;/*FB_PKG_DELIM*/

__d("ACSCipherSuiteModule",[],(function(a,b,c,d,e,f){"use strict";b={hash:"SHA-512",name:"HMAC"};c={curveName:"RISTRETTO",macAlgorithm:b,value:1};var g=new Map([[c.value,c]]);function a(a){return g.has(a)?g.get(a):null}f.VOPRF_RISTRETTO_HMACSHA512=c;f.getACSCipherSuiteByValue=a}),66);
__d("ACSTokenHmacUtil",["XPlatReactCrypto"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b,c){return h(a,b).then(function(a){return j(a,c)})}function h(a,b){return d("XPlatReactCrypto").subtleImportKey("raw",b,a,!1,["sign"]).then(function(b){return{algo:a,key:b}})}function i(a){return typeof a.hash==="string"?a.hash:a.hash.name}function j(a,b){var c=a.algo;a=a.key;c={hash:i(c),name:"HMAC"};return d("XPlatReactCrypto").subtleSign(c,a,b).then(function(a){return new Uint8Array(a)})}g.hmac=a}),98);
__d("AcfToastImpressionFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("1873550");b=d("FalcoLoggerInternal").create("acf_toast_impression",a);e=b;g["default"]=e}),98);
__d("ArmadilloCutoverClientFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("699");b=d("FalcoLoggerInternal").create("armadillo_cutover_client",a);e=b;g["default"]=e}),98);
__d("AvailableListState",[],(function(a,b,c,d,e,f){a=Object.freeze({OFFLINE:0,IDLE:1,ACTIVE:2,MOBILE:3});f["default"]=a}),66);
__d("BizCoreFbApPlusMessageButtonClickFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("6143");b=d("FalcoLoggerInternal").create("biz_core_fb_ap_plus_message_button_click",a);e=b;g["default"]=e}),98);
__d("BizCoreFbApPlusMessageButtonImpressionFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("6144");b=d("FalcoLoggerInternal").create("biz_core_fb_ap_plus_message_button_impression",a);e=b;g["default"]=e}),98);
__d("CometBatchNotificationsStateChangeSubscription_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="6546596222061607"}),null);
__d("CometBatchNotificationsStateChangeSubscription.graphql",["CometBatchNotificationsStateChangeSubscription_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a={defaultValue:null,kind:"LocalArgument",name:"environment"},c={defaultValue:null,kind:"LocalArgument",name:"input"},d=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"input"}],concreteType:"BatchNotificationStateChangeSubscribeResponsePayload",kind:"LinkedField",name:"batch_notification_state_change_subscribe",plural:!1,selections:[{alias:null,args:null,concreteType:"Notification",kind:"LinkedField",name:"aggregated_notifications",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"seen_state",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:[{kind:"Variable",name:"environment",variableName:"environment"}],kind:"ScalarField",name:"notifications_unseen_count",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"last_update_timestamp",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[a,c],kind:"Fragment",metadata:null,name:"CometBatchNotificationsStateChangeSubscription",selections:d,type:"Subscription",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[c,a],kind:"Operation",name:"CometBatchNotificationsStateChangeSubscription",selections:d},params:{id:b("CometBatchNotificationsStateChangeSubscription_facebookRelayOperation"),metadata:{subscriptionName:"batch_notification_state_change_subscribe"},name:"CometBatchNotificationsStateChangeSubscription",operationKind:"subscription",text:null}}}();e.exports=a}),null);
__d("CometBatchNotificationsStateChangeSubscription",["CometBatchNotificationsStateChangeSubscription.graphql","CometRelay"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h!==void 0?h:h=b("CometBatchNotificationsStateChangeSubscription.graphql");function a(a){return d("CometRelay").requestSubscription(a,{subscription:i,variables:{environment:"MAIN_SURFACE",input:{environment:"MAIN_SURFACE",query_flags:["INCLUDE_WA_P2B_NOTIFS"]}}})}g.subscription=i;g.batchSubscribe=a}),98);
__d("CometCastingMiniplayerRoot.react",["CastingContext","CometPlaceholder.react","JSResourceForInteraction","lazyLoadComponent","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||(h=d("react"));b=h;var j=b.useContext,k=b.c,l=c("lazyLoadComponent")(c("JSResourceForInteraction")("CometCastingMiniplayer.react").__setRef("CometCastingMiniplayerRoot.react"));function a(){var a=k(1),b=j(d("CastingContext").CastingStateContext);if(b==null)return null;a[0]===Symbol["for"]("react.memo_cache_sentinel")?(b=i.jsx(c("CometPlaceholder.react"),{fallback:null,children:i.jsx(l,{})}),a[0]=b):b=a[0];return b}g["default"]=a}),98);
__d("GhlTestUbtFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("1942319");b=d("FalcoLoggerInternal").create("ghl_test_ubt",a);e=b;g["default"]=e}),98);
__d("CometGHLTestUBT",["GhlTestUbtFalcoEvent","JSScheduler","ghlTestUBT"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a){(h||(h=d("JSScheduler"))).scheduleLoggingPriCallback(function(){c("ghlTestUBT")(function(b,d){b&&a.addGlobalMetadata("adblocker_enabled",1);return c("GhlTestUbtFalcoEvent").log(function(){return{recent:d,ubt:b}})})})}g["default"]=a}),98);
__d("CometNotificationsStateChangeSubscription_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="6421625191268347"}),null);
__d("CometNotificationsStateChangeSubscription.graphql",["CometNotificationsStateChangeSubscription_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a={defaultValue:null,kind:"LocalArgument",name:"environment"},c={defaultValue:null,kind:"LocalArgument",name:"input"},d=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"input"}],concreteType:"NotificationStateChangeSubscribeResponsePayload",kind:"LinkedField",name:"notification_state_change_subscribe",plural:!1,selections:[{alias:null,args:null,concreteType:"Notification",kind:"LinkedField",name:"notification",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"seen_state",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:[{kind:"Variable",name:"environment",variableName:"environment"}],kind:"ScalarField",name:"notifications_unseen_count",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"last_update_timestamp",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[a,c],kind:"Fragment",metadata:null,name:"CometNotificationsStateChangeSubscription",selections:d,type:"Subscription",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[c,a],kind:"Operation",name:"CometNotificationsStateChangeSubscription",selections:d},params:{id:b("CometNotificationsStateChangeSubscription_facebookRelayOperation"),metadata:{subscriptionName:"notification_state_change_subscribe"},name:"CometNotificationsStateChangeSubscription",operationKind:"subscription",text:null}}}();e.exports=a}),null);
__d("CometNotificationsStateChangeSubscription",["CometNotificationsStateChangeSubscription.graphql","CometRelay"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h!==void 0?h:h=b("CometNotificationsStateChangeSubscription.graphql");function a(a){return d("CometRelay").requestSubscription(a,{subscription:i,variables:{environment:"MAIN_SURFACE",input:{environment:"MAIN_SURFACE",query_flags:["INCLUDE_WA_P2B_NOTIFS"]}}})}c={subscribe:a,subscription:i};g["default"]=c}),98);
__d("CometObjectFitContainerWithMaxHeight.react",["CometObjectFitContainer.react","react","useCometSize_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||d("react");function a(a){var b=a.contentAspectRatio,d=a.maxHeight;a=babelHelpers.objectWithoutPropertiesLoose(a,["contentAspectRatio","maxHeight"]);var e=c("useCometSize_DO_NOT_USE")(),f=e[0];e=e[1];var g=16/9;b=b!=null&&isFinite(b)&&b>0?b:g;if(d!=null&&d>0&&e!=null){g=e.width/b;g>d&&(b=e.width/d)}return i.jsx(c("CometObjectFitContainer.react"),babelHelpers["extends"]({contentAspectRatio:b,objectFitMode:"CONTAINER_WIDTH_BASED_ASPECT_RATIO",ref:f},a))}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98);
__d("CometOnBeforeUnloadDialog.react",["fbt","CometTrackingNodeProvider.react","FDSButtonGroup.react","FDSCardedDialogLegacy.react","TetraText.react","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||d("react");function a(a){var b=a.disabled;b=b===void 0?!1:b;var d=a.onClose,e=a.onCloseButtonPress,f=a.primaryAction,g=a.secondaryAction,i=a.body,k=a.cancel,l=a.confirm;a=a.title;var m=function(){f(),d()},n=function(){g(),d()};return j.jsx(c("CometTrackingNodeProvider.react"),{trackingNode:163,children:j.jsxs(c("FDSCardedDialogLegacy.react"),{onClose:function(){e(),d()},testid:void 0,title:a,titleHorizontalAlignment:"start",withCloseButton:!0,children:[j.jsx("div",{className:"xz9dl7a x1pi30zi xsag5q8 x1swvt13 x1n2onr6",children:j.jsx(c("TetraText.react"),{type:"body3",children:i})}),j.jsx("div",{className:"x78zum5 x1q0g3np x13a6bvl xexx8yu x4uap5 x1l90r2v xkhd6sd",children:j.jsx(c("FDSButtonGroup.react"),{direction:"backward",paddingHorizontal:16,primary:{disabled:b,label:(a=l)!=null?a:h._("__JHASH__dV9Vz_8TRow__JHASH__"),onPress:m,testid:"CometOnBeforeUnloadDialogConfirmButton"},secondary:{disabled:b,label:(i=k)!=null?i:h._("__JHASH__vfZ0qXC5Zmr__JHASH__"),onPress:n,reduceEmphasis:!0,testid:"CometOnBeforeUnloadDialogCancelButton"}})})]})})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("CometProfileSwitchedToast_query.graphql",[],(function(a,b,c,d,e,f){"use strict";a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"CometProfileSwitchedToast_query",selections:[{args:null,kind:"FragmentSpread",name:"useCometProfileSwitchedToast_query"}],type:"Query",abstractKey:null};e.exports=a}),null);
__d("useCometProfileSwitchedToast_query.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"useCometProfileSwitchedToast_query",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"actor",plural:!1,selections:[{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"username",storageKey:null},a,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profile_type_name_for_content",storageKey:null},{alias:null,args:[{kind:"Literal",name:"height",value:32},{kind:"Literal",name:"width",value:32}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],storageKey:"profile_picture(height:32,width:32)"},{alias:null,args:null,concreteType:"UserProfileSwitcherEligibleProfilesConnection",kind:"LinkedField",name:"profile_switcher_eligible_profiles",plural:!1,selections:[{alias:null,args:null,concreteType:"ProfileSwitcherEligibleProfile",kind:"LinkedField",name:"nodes",plural:!0,selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"profile",plural:!1,selections:[a],storageKey:null}],storageKey:null}],storageKey:null}],type:"User",abstractKey:null}],storageKey:null}],storageKey:null},{args:null,kind:"FragmentSpread",name:"useCometProfileSwitchMutation_query"}],type:"Query",abstractKey:null}}();e.exports=a}),null);
__d("useCometProfileSwitchedToast",["fbt","CometListCellStrict_DEPRECATED.react","CometRelay","CometRouteURL","FDSButtonGroup.react","TetraText.react","XCometMeControllerRouteBuilder","XCometProfileControllerRouteBuilder","XCometProfileVanityControllerRouteBuilder","emptyFunction","react","useCometProfileSwitchMutation","useCometProfileSwitchTracer","useCometProfileSwitchedToast_query.graphql"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k=j||d("react");function a(a){var e,f,g,j,l,m=a.onDismiss,n=a.previousProfileID;a=a.query;a=d("CometRelay").useFragment(i!==void 0?i:i=b("useCometProfileSwitchedToast_query.graphql"),a);e=a==null?void 0:(e=a.viewer)==null?void 0:(e=e.actor)==null?void 0:e.name;f=a==null?void 0:(f=a.viewer)==null?void 0:(f=f.actor)==null?void 0:f.id;g=a==null?void 0:(g=a.viewer)==null?void 0:(g=g.actor)==null?void 0:(g=g.profile_picture)==null?void 0:g.uri;var o=a==null?void 0:(j=a.viewer)==null?void 0:(j=j.actor)==null?void 0:(j=j.profile_switcher_eligible_profiles)==null?void 0:j.nodes.map(function(a){return(a=a.profile)==null?void 0:a.id});j=(a==null?void 0:(j=a.viewer)==null?void 0:(j=j.actor)==null?void 0:j.profile_type_name_for_content)==="PAGE";l=(l=a.viewer)==null?void 0:(l=l.actor)==null?void 0:l.username;l=l==null||l.length===0?"":c("XCometProfileVanityControllerRouteBuilder").buildURL({vanity:l});var p=d("CometRouteURL").useRouteURLPath();l=l===p;var q=c("XCometProfileControllerRouteBuilder").buildURL({}),r=d("CometRouteURL").useRouteURLParams().id;q=q===p&&r===f;p=l||q;var s=c("useCometProfileSwitchTracer")({origin:"switched_toast",originatingSurface:"switched_toast"}),t=c("useCometProfileSwitchMutation")({data:a});r=function(){(o==null?void 0:o.includes(n))&&s(function(a){t(n,a,null,"switched_toast")}),m()};f=null;l=k.jsx(c("CometListCellStrict_DEPRECATED.react"),{addOnStart:g!=null?{"aria-label":h._("__JHASH__fZU-5mdO94e__JHASH__"),linkProps:{url:c("XCometMeControllerRouteBuilder").buildURL({})},onPress:m,shape:"circle",size:48,source:{uri:g},type:"profile-photo"}:null,body:k.jsx(c("FDSButtonGroup.react"),{align:p?"start":"justify",paddingHorizontal:0,paddingTop:12,primary:p?{label:h._("__JHASH__2kACvdZJNBP__JHASH__"),onPress:r,padding:"wide",type:"secondary"}:{label:j?h._("__JHASH__--2XPIPCpnJ__JHASH__"):h._("__JHASH__GRs1INByQRl__JHASH__"),linkProps:{url:c("XCometMeControllerRouteBuilder").buildURL({})},onPress:m,type:"primary"},secondary:p?null:{label:h._("__JHASH__2kACvdZJNBP__JHASH__"),onPress:r,type:"secondary"},size:"large",wrap:"forward"}),headline:k.jsx(c("TetraText.react"),{type:"headline4",children:h._("__JHASH__AG0e6FYCEFC__JHASH__",[h._param("profile_name",e)])})});return{accessibilityAnnouncement:f,content:l,onCloseClick:m,onMouseEnter:c("emptyFunction"),profileName:e}}g["default"]=a}),226);
__d("CometProfileSwitchedToast.react",["fbt","CometProfileSwitchedToast_query.graphql","CometRelay","CometToastCard.react","react","useCometProfileSwitchedToast"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k=j||d("react");function a(a){var e=a.onDismiss,f=a.previousProfileID;a=a.query;a=d("CometRelay").useFragment(i!==void 0?i:i=b("CometProfileSwitchedToast_query.graphql"),a);f=c("useCometProfileSwitchedToast")({onDismiss:e,previousProfileID:f,query:a});return k.jsx(c("CometToastCard.react"),{accessibilityAnnouncement:f.accessibilityAnnouncement,content:f.content,headline:h._("__JHASH__H1oTPehjLo5__JHASH__",[h._param("profile_name",f.profileName)]),onCloseClick:e,onMouseEnter:function(){}})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("XDOMScannerResultsControllerRouteBuilder",["jsRouteBuilder"],(function(a,b,c,d,e,f,g){a=c("jsRouteBuilder")("/shared/user_preferences/",Object.freeze({}),void 0);b=a;g["default"]=b}),98);
__d("DOMScanner",["Base64","ConstUriUtils","DOMScannerConfig","FBLogger","JSScheduler","Promise","WebStorage","XDOMScannerResultsControllerRouteBuilder","cometAsyncFetch","isFacebookURI"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k=0,l=!1,m=!1;function n(a){return a.startsWith("data:")&&a.includes(";base64,")}function o(a){return n(a)?!1:q(a)}function p(){var a=[],b=document.getElementsByTagName("*");for(var c=0;c<b.length;++c)b[c].shadowRoot!=null&&a.push(b[c]);return a}function q(a){a=d("ConstUriUtils").getUri(a.toString());return a==null?!1:!c("isFacebookURI")(a)}function r(){var a=[],b=p();for(var c=0;c<b.length;c++){var d=b[c],e=d.getBoundingClientRect();e=JSON.stringify({position:{b:e.bottom,l:e.left,r:e.right,t:e.top},size:{h:e.height,w:e.width}},null,2);a.push(["shadow_root",d.tagName,d.id,d.className,e])}return a}function s(){var a=[],b=document.querySelectorAll("script");for(var c=0;c<b.length;++c){var d=b[c];if(d.src&&o(String(d.src))){var e=d.src,f=null,g=null;d.className&&(f=d.className);d.id&&(g=d.id);d=["script",e,g,f,null];a.push(d)}}return a}function t(){var a=[],b=document.getElementsByTagName("iframe");for(var c=0;c<b.length;++c){var d=b[c];if(d.src&&o(d.src)){var e=d.src,f=null,g=null,h=d.getBoundingClientRect();h=JSON.stringify({position:{b:h.bottom,l:h.left,r:h.right,t:h.top},size:{h:d.height,w:d.width},src:d.src,visibility:d.style.visibility},null,2);d.className&&(f=d.className);d.id&&(g=d.id);d=["iframe",e,g,f,h];a.push(d)}}return a}function u(){var a=[],b=(j||(j=c("WebStorage"))).getLocalStorage();if(!b||!b.length)return a;for(var d=0;d<b.length;++d)a.push(b.key(d));return a}function v(){var a=[],b=document.getElementsByTagName("link");for(var c=0;c<b.length;++c){var d=b[c];if(d.href&&o(String(d.href))){var e=d.href;e=["link",e,d.type,d.as,null];a.push(e)}}return a}function w(a,b,d,e){e={event:e?"scan_result":"logged_out_scan_result",local_storage:b,results:a,runtime:k,scan_id:d};c("cometAsyncFetch")(c("XDOMScannerResultsControllerRouteBuilder").buildUri({}).toString(),{data:{data:c("Base64").encodeObject(e)},method:"POST"})["catch"](function(a){c("FBLogger")("domscanner").catching(a).mustfix("Send response failed. %s",a.errorCode,a.errorType)})}function x(a){var e=new Date().valueOf(),f=[],g=[],j=new(i||(i=b("Promise")))(function(a){(h||(h=d("JSScheduler"))).scheduleLoggingPriCallback(function(){try{f=f.concat(s())}catch(a){c("FBLogger")("domscanner").catching(a).mustfix("Check Scripts failed")}a()})}),l=new i(function(a){(h||(h=d("JSScheduler"))).scheduleLoggingPriCallback(function(){try{g=g.concat(u())}catch(a){c("FBLogger")("domscanner").catching(a).mustfix("Check local storage failed")}a()})}),m=new i(function(a){(h||(h=d("JSScheduler"))).scheduleLoggingPriCallback(function(){try{f=f.concat(v())}catch(a){c("FBLogger")("domscanner").catching(a).mustfix("Check link tags failed")}a()})}),n=new i(function(a){(h||(h=d("JSScheduler"))).scheduleLoggingPriCallback(function(){try{f=f.concat(r())}catch(a){c("FBLogger")("domscanner").catching(a).mustfix("Check shadow roots failed")}a()})}),o=new i(function(a){(h||(h=d("JSScheduler"))).scheduleLoggingPriCallback(function(){try{f=f.concat(t())}catch(a){c("FBLogger")("domscanner").catching(a).mustfix("Check iframes failed")}a()})});i.all([j,l,m,n,o])["finally"](function(){k=new Date().valueOf()-e,(h||(h=d("JSScheduler"))).scheduleLoggingPriCallback(function(){return w(f,g,a,!0)})})}function a(){!l&&c("DOMScannerConfig").needs_scan&&(l=!0,window.setTimeout(function(){return(h||(h=d("JSScheduler"))).scheduleLoggingPriCallback(function(){return x(c("DOMScannerConfig").scan_id)})},c("DOMScannerConfig").delay))}function e(){if(!m&&c("DOMScannerConfig").needs_scan){m=!0;var a=new Date().valueOf(),b=[],d=[];try{b=s(),d=u()}catch(a){c("FBLogger")("domscanner_loginpage").catching(a).mustfix("Scanning failed on login page %s",a.errorCode,a.errorType)}k=new Date().valueOf()-a;w(b,d,c("DOMScannerConfig").scan_id,!1)}}f={checkIframes:t,checkLinkTags:v,checkScripts:s,checkShadowRoots:r};g.scheduleScan=a;g.scanLoginPage=e;g.exportedForTesting=f}),98);
__d("CometRootDeferredSharedWithDomScanner",["CometRootDeferredShared","DOMScanner","ErrorGuard"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a){(h||(h=c("ErrorGuard"))).applyWithGuard(function(){return d("DOMScanner").scheduleScan()},null,[]),d("CometRootDeferredShared").initDeferred(a)}g.initDeferred=a}),98);
__d("XUpdateTimezoneControllerRouteBuilder",["jsExtraRouteBuilder"],(function(a,b,c,d,e,f,g){a=c("jsExtraRouteBuilder")("/ajax/autoset_timezone_ajax/",Object.freeze({is_forced:!1}),["/ajax/autoset_timezone_ajax.php","/ajax/timezone/update/","/ajax/timezone/update.php"],void 0);b=a;g["default"]=b}),98);
__d("CometTimezoneUpdater",["UserTimezoneServerTimeData","XUpdateTimezoneControllerRouteBuilder","cometAsyncFetch","getBrowserGMTOffsetAdjustedForSkew","getBrowserTimezone","killswitch"],(function(a,b,c,d,e,f,g){"use strict";function a(){var a,b=(a=d("UserTimezoneServerTimeData")).force_update,e=a.server_gmt_offset,f=a.server_time;a=a.timezone;if(f==null||e==null)return;f=-c("getBrowserGMTOffsetAdjustedForSkew")(f);var g=c("killswitch")("TIMEZONE_SET_IANA_ZONE_NAME")?null:c("getBrowserTimezone")();(b===!0||f!==e||g!=null&&g!==a)&&c("cometAsyncFetch")(c("XUpdateTimezoneControllerRouteBuilder").buildExtraURL("/ajax/timezone/update.php",{}),{data:{gmt_off:f,is_forced:b,tz:g},method:"POST"})}b={updateTimezoneIfNecessary:a};e=b;g["default"]=e}),98);
__d("CometRootDeferred",["CometRootDeferredSharedWithDomScanner","CometTimezoneUpdater","JSScheduler","SketchComet","promiseDone"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a){var b=a.sketchInfo;a=babelHelpers.objectWithoutPropertiesLoose(a,["sketchInfo"]);b!=null&&(h||(h=d("JSScheduler"))).scheduleSpeculativeCallback(function(){c("promiseDone")(c("SketchComet").solveAllPrimitivesAndCallAsyncController(b.seed1,b.seed2,b.rounds))});d("CometRootDeferredSharedWithDomScanner").initDeferred(a);c("CometTimezoneUpdater").updateTimezoneIfNecessary()}g.initDeferred=a}),98);
__d("CometRouteActorToasterQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="6178173252294200"}),null);
__d("CometRouteActorToasterQuery.graphql",["CometRouteActorToasterQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"scale"}],c={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},e={alias:"toast_icon",args:[{kind:"Literal",name:"height",value:32},{kind:"Variable",name:"scale",variableName:"scale"},{kind:"Literal",name:"width",value:32}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"CometRouteActorToasterQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"actor",plural:!1,selections:[c,d,e],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"CometRouteActorToasterQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"actor",plural:!1,selections:[c,d,e,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:b("CometRouteActorToasterQuery_facebookRelayOperation"),metadata:{},name:"CometRouteActorToasterQuery",operationKind:"query",text:null}}}();e.exports=a}),null);
__d("CometRouteActorToaster.react",["fbt","Actor","CometRelay","CometRouteActorToasterBlocklist","CometRouteActorToasterQuery.graphql","TetraProfilePhoto.react","TetraText.react","WebPixelRatio","cometPushToast","getTopMostRoute","promiseDone","react","requireDeferred","useCometRouterState","useCurrentRoute","useProfileCometIsViewAs","useRouteReferrer"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k=j||(j=d("react"));e=j;var l=e.useEffect,m=e.useRef,n=c("requireDeferred")("AcfToastImpressionFalcoEvent").__setRef("CometRouteActorToaster.react");function o(a,b){if(b)return k.jsx(c("TetraText.react"),{color:"primary",type:"body3",children:h._("__JHASH__dhtpcLgifst__JHASH__",[h._implicitParam("=m2",k.jsx(c("TetraText.react"),{type:"bodyLink3",children:h._("__JHASH__IxzOnYaj38q__JHASH__")}))])});else return k.jsx(c("TetraText.react"),{color:"primary",type:"body3",children:h._("__JHASH__Kzzb7vg3fH___JHASH__",[h._param("actor",k.jsx(c("TetraText.react"),{type:"bodyLink3",children:a}))])})}var p=i!==void 0?i:i=b("CometRouteActorToasterQuery.graphql");function a(){var a=d("CometRelay").useRelayEnvironment(),b=d("Actor").useActor(),e=b[0];b=c("useCometRouterState")();var f=c("useCurrentRoute")(),g=c("useRouteReferrer")(),h=c("useProfileCometIsViewAs")(),i=m({actorID:g==null?void 0:g.actorID,tracePolicy:g==null?void 0:g.tracePolicy});g=c("CometRouteActorToasterBlocklist").route_trace_policies;var j=f==null?void 0:f.tracePolicy;g=g.includes(j);b=b!=null?c("getTopMostRoute")(b):null;f=f===b;var q=f&&!g&&!h;l(function(){var b,f=(b=i.current)==null?void 0:b.actorID,g=(b=i.current)==null?void 0:b.tracePolicy;if(f!=null&&f!==e&&q){b=function(a){var b;b=a==null?void 0:(b=a.viewer)==null?void 0:(b=b.actor)==null?void 0:b.name;if(b!=null){var e;e=(a==null?void 0:(e=a.viewer)==null?void 0:(e=e.actor)==null?void 0:e.__typename)==="User";a=a==null?void 0:(a=a.viewer)==null?void 0:(a=a.actor)==null?void 0:(a=a.toast_icon)==null?void 0:a.uri;a=a!=null?k.jsx(c("TetraProfilePhoto.react"),{shape:"circle",size:32,source:{uri:a}}):null;b=o(b,e);d("cometPushToast").cometPushToast({icon:a,message:b});n.onReady(function(a){a=a.log;a(function(){var a;return{destination:(a=j)!=null?a:"comet.app",destination_type:"comet_route",source:g,source_type:"comet_route",source_userid:f}})})}};var h={scale:d("WebPixelRatio").get()};c("promiseDone")(d("CometRelay").fetchQuery(a,p,h).toPromise(),b)}i.current={actorID:e,tracePolicy:j}},[e,j,a,q]);return null}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("CometVideoPictureInPictureManagerHooks",["CometVideoPictureInPictureManagerContext","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=(h||d("react")).useContext;function a(){return i(d("CometVideoPictureInPictureManagerContext").CometVideoPictureInPictureManagerContext)}g.useCometVideoPictureInPictureManager=a}),98);
__d("CometWatchAndScrollCloseButton_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"CometWatchAndScrollCloseButton_video",selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"owner",plural:!1,selections:[{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"has_professional_features_for_watch",storageKey:null}],type:"VideoOwner",abstractKey:"__isVideoOwner"}],storageKey:null}],type:"Video",abstractKey:null};e.exports=a}),null);
__d("CometWatchAndScrollCloseButton.react",["fbt","ix","CometRelay","CometSetWatchAndScrollVideoContext","CometWatchAndScrollCloseButton_video.graphql","CometWatchAndScrollVideoContext","TetraIcon.react","VideoPlayerInstreamAdsStateHooks","fbicon","react","requireDeferred","stylex","useCometRouterState","useCometTahoeChainingDepth","useMinifiedProductAttribution","useVideoPlayerDefaultControlsVisibility"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l,m=l||(l=d("react"));e=l;var n=e.useContext,o=e.c,p=c("requireDeferred")("VideoHomeTypedLiteLogger").__setRef("CometWatchAndScrollCloseButton.react"),q={absolutePosition:{end:"xnx3k43",left:null,right:null,position:"x10l6tqk",top:"x1jzctok",$$css:!0},closeButton:{zIndex:"x1vjfegm",$$css:!0},closeButtonHidden:{opacity:"xg01cxk",visibility:"xlshs6z",$$css:!0}};function a(a){var e=o(20);a=a.video;var f;e[0]===Symbol["for"]("react.memo_cache_sentinel")?(f=j!==void 0?j:j=b("CometWatchAndScrollCloseButton_video.graphql"),e[0]=f):f=e[0];f=d("CometRelay").useFragment(f,a);var g=n(c("CometSetWatchAndScrollVideoContext")),l=n(c("CometWatchAndScrollVideoContext"));a=d("useCometTahoeChainingDepth").useChainingDepthContext();var r=a.chainingDepthState;a=c("useVideoPlayerDefaultControlsVisibility")();var s=a.isControlsVisible,t=a.onUserInteraction;f=!!(f==null?void 0:(a=f.owner)==null?void 0:a.has_professional_features_for_watch);a=d("VideoPlayerInstreamAdsStateHooks").useInstreamAdsIsStart();var u=f||a,v=c("useMinifiedProductAttribution")();f=c("useCometRouterState")();var w=(a=f==null?void 0:f.main.route.tabKey)!=null?a:"undefined";f=!u&&q.absolutePosition;a=!u&&!s&&q.closeButtonHidden;e[1]!==f||e[2]!==a?(s=(k||(k=c("stylex")))(f,q.closeButton,a),e[1]=f,e[2]=a,e[3]=s):s=e[3];e[4]===Symbol["for"]("react.memo_cache_sentinel")?(f=h._("__JHASH__gRfYYYiiNCL__JHASH__"),e[4]=f):f=e[4];a=u?"primary":"white";var x;e[5]===Symbol["for"]("react.memo_cache_sentinel")?(x=d("fbicon")._(i("478233"),20),e[5]=x):x=e[5];var y;e[6]!==l||e[7]!==g||e[8]!==t||e[9]!==u||e[10]!==r||e[11]!==v||e[12]!==w?(y=function(){var a=l==null?void 0:l.sessionStartTime,b=new Date(),c=(l==null?void 0:l.sessionTrigger)?l==null?void 0:l.sessionTrigger:null;g(null);t({name:"exit_watch_and_scroll_video",type:"happened"});u&&p.onReady(function(d){var e=r+1,f=a?(b.getTime()-a.getTime())/1e3:null;d.log({attribution_id_v2:v,click_point:"close_button",click_target:"watch_and_scroll",event:"click",event_target_info:w});d.log({event:"watch_and_scroll_end_session",event_target_info:c,video_watched_count:e,watch_time_in_watch_and_scroll_s:f})})},e[6]=l,e[7]=g,e[8]=t,e[9]=u,e[10]=r,e[11]=v,e[12]=w,e[13]=y):y=e[13];e[14]!==a||e[15]!==y?(f=m.jsx(c("TetraIcon.react"),{"aria-label":f,color:a,icon:x,onPress:y}),e[14]=a,e[15]=y,e[16]=f):f=e[16];e[17]!==s||e[18]!==f?(x=m.jsx("i",{className:s,children:f}),e[17]=s,e[18]=f,e[19]=x):x=e[19];return x}g["default"]=a}),226);
__d("CometWatchAndScrollContainer_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"CometWatchAndScrollContainer_video",selections:[{args:null,kind:"FragmentSpread",name:"useVideoOriginalDimensionsRelay_video"}],type:"Video",abstractKey:null};e.exports=a}),null);
__d("CometWatchAndScrollTopBar_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},b={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"uri_token",storageKey:null};return{argumentDefinitions:[{kind:"RootArgument",name:"scale"}],kind:"Fragment",metadata:null,name:"CometWatchAndScrollTopBar_video",selections:[a,b,{alias:null,args:null,kind:"ScalarField",name:"title_with_fallback",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{args:null,kind:"FragmentSpread",name:"CometWatchAndScrollCloseButton_video"},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"owner",plural:!1,selections:[b,a,{alias:null,args:[{kind:"Literal",name:"height",value:32},{kind:"Variable",name:"scale",variableName:"scale"},{kind:"Literal",name:"width",value:32}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],storageKey:null},{kind:"InlineFragment",selections:[c,{alias:null,args:null,kind:"ScalarField",name:"page_vanity_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"vanity",storageKey:null}],type:"Page",abstractKey:null},{kind:"InlineFragment",selections:[c,{kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Literal",name:"site",value:"www"}],kind:"ScalarField",name:"url",storageKey:'url(site:"www")'}],type:"User",abstractKey:null}],type:"VideoOwner",abstractKey:"__isVideoOwner"}],storageKey:null},{alias:null,args:null,concreteType:"Story",kind:"LinkedField",name:"creation_story",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"identifier_token",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"debug_info",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tracking",storageKey:null}],storageKey:null}],type:"Video",abstractKey:null}}();e.exports=a}),null);
__d("CometWatchAndScrollTopBar.react",["ix","CometLink.react","CometRelay","CometRow.react","CometRowItem.react","CometVideoHomeThreeDotContextMenu.react","CometWatchAndScrollCloseButton.react","CometWatchAndScrollTopBar_video.graphql","FDSTextPairing.react","TetraProfilePhoto.react","XCometGamingVanityControllerRouteBuilder","XCometVideoHomePlaylistControllerRouteBuilder","fbicon","isStringNullOrEmpty","react","requireDeferred","useCometRouterState","useMinifiedProductAttribution","useNavigateToTahoePassthroughProps"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k=j||(j=d("react"));e=j;var l=e.useState,m=e.c,n=c("requireDeferred")("VideoHomeTypedLiteLogger").__setRef("CometWatchAndScrollTopBar.react"),o={actorIcon:{marginStart:"x1i64zmx",marginLeft:null,marginRight:null,paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0},closeButton:{display:"x78zum5",marginTop:"x14vqqas",marginEnd:"xq8finb",marginBottom:"xod5an3",marginStart:"x16n37ib",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0},row:{marginTop:"xdj266r",marginEnd:"x11i5rnm",marginBottom:"xat24cr",marginStart:"x1mh8g0r",width:"xh8yej3",$$css:!0},threeDot:{display:"x78zum5",marginTop:"xdj266r",marginEnd:"x11i5rnm",marginBottom:"xat24cr",marginStart:"x1mh8g0r",paddingTop:"xexx8yu",paddingEnd:"x4uap5",paddingBottom:"x18d9i69",paddingStart:"xkhd6sd",$$css:!0}};function a(a){var e=m(49),f=a.isGamingVideo,g=a.routeTracePolicy,j=a.subOrigin,s=a.video;a=a.videoUrl;var t;e[0]===Symbol["for"]("react.memo_cache_sentinel")?(t=i!==void 0?i:i=b("CometWatchAndScrollTopBar_video.graphql"),e[0]=t):t=e[0];t=d("CometRelay").useFragment(t,s);var u=c("useMinifiedProductAttribution")();s=c("useNavigateToTahoePassthroughProps")();var v=l(!1);v[0];var w=v[1];e[1]===Symbol["for"]("react.memo_cache_sentinel")?(v=function(a){w(a)},e[1]=v):v=e[1];v=v;var x=t==null?void 0:t.owner;if(t==null||x==null)return null;var y;e[2]!==s||e[3]!==j||e[4]!==g?(y=babelHelpers["extends"]({},s,{playerSubOrigin:j,portalingRouteTracePolicy:g,portalingSubOrigin:j}),e[2]=s,e[3]=j,e[4]=g,e[5]=y):y=e[5];s=y;j="#";g=x.uri_token;if(g!=null){e[6]!==g?(y=c("XCometVideoHomePlaylistControllerRouteBuilder").buildURL({idorvanity:g}),e[6]=g,e[7]=y):y=e[7];j=y}else x.url!=null&&(j=x.url);if(f){g=(y=(g=x.page_vanity_url)!=null?g:x.vanity)!=null?y:x.uri_token;if(g!=null){if(e[8]!==t.id||e[9]!==g){y=c("XCometGamingVanityControllerRouteBuilder").buildURL({injected_hero_video_id:(y=t.id)!=null?y:void 0,vanity:g});e[8]=t.id;e[9]=g;e[10]=y}else y=e[10];j=y}}e[11]===Symbol["for"]("react.memo_cache_sentinel")?(g="x1jx94hy xgqcy7u x1lq5wgf x163d74j x78zum5 xds687c x1dqyrwa x1hc1fzr x10l6tqk x17qophe x11zq2l5 x1nm1lid xm4efwp xx6bhzk x11xpdln",e[11]=g):g=e[11];y=(y=x.profile_picture)==null?void 0:y.uri;var z=f?s:void 0,A;e[12]!==x.id||e[13]!==x.name||e[14]!==j||e[15]!==y||e[16]!==z||e[17]!==u?(A=k.jsx(c("CometRowItem.react"),{xstyle:o.actorIcon,children:k.jsx(p,{actorID:x.id,actorName:x.name,actorURL:j,iconURI:y,passthroughProps:z,productAttribution:u})}),e[12]=x.id,e[13]=x.name,e[14]=j,e[15]=y,e[16]=z,e[17]=u,e[18]=A):A=e[18];e[19]!==s||e[20]!==u||e[21]!==t.title_with_fallback||e[22]!==a?(y=k.jsx(r,{passthroughProps:s,productAttribution:u,title:t.title_with_fallback,videoUrl:a}),e[19]=s,e[20]=u,e[21]=t.title_with_fallback,e[22]=a,e[23]=y):y=e[23];z=f?s:void 0;e[24]!==x.name||e[25]!==j||e[26]!==z||e[27]!==u?(a=k.jsx(q,{actorName:x.name,actorURL:j,passthroughProps:z,productAttribution:u}),e[24]=x.name,e[25]=j,e[26]=z,e[27]=u,e[28]=a):a=e[28];e[29]!==y||e[30]!==a?(f=k.jsx(c("CometRowItem.react"),{expanding:!0,children:k.jsx(c("FDSTextPairing.react"),{headline:y,headlineLineLimit:1,level:4,meta:a,metaLineLimit:1,metaLocation:"above"})}),e[29]=y,e[30]=a,e[31]=f):f=e[31];e[32]===Symbol["for"]("react.memo_cache_sentinel")?(s=d("fbicon")._(h("555291"),20),e[32]=s):s=e[32];j=(x=t.creation_story)==null?void 0:x.identifier_token;e[33]!==u?(z=function(){n.onReady(function(a){a.log({attribution_id_v2:u,click_point:"three_dot_menu",click_target:"watch_and_scroll",event:"click"})})},e[33]=u,e[34]=z):z=e[34];a=(y=t.creation_story)==null?void 0:y.debug_info;y=(x=t.creation_story)==null?void 0:x.tracking;e[35]!==s||e[36]!==j||e[37]!==z||e[38]!==a||e[39]!==y||e[40]!==t.id?(x=k.jsx(c("CometRowItem.react"),{xstyle:o.threeDot,children:k.jsx(c("CometVideoHomeThreeDotContextMenu.react"),{icon:s,identifierToken:j,onMenuVisibilityChange:v,onPress:z,position:"above",storyDebugInfo:a,tracking:y,videoID:t.id,videoMenuLocation:"WATCH_AND_SCROLL"})}),e[35]=s,e[36]=j,e[37]=z,e[38]=a,e[39]=y,e[40]=t.id,e[41]=x):x=e[41];e[42]!==t?(v=k.jsx(c("CometRowItem.react"),{xstyle:o.closeButton,children:k.jsx(c("CometWatchAndScrollCloseButton.react"),{video:t})}),e[42]=t,e[43]=v):v=e[43];e[44]!==A||e[45]!==f||e[46]!==x||e[47]!==v?(s=k.jsx("div",{className:g,children:k.jsxs(c("CometRow.react"),{paddingHorizontal:0,paddingVertical:0,verticalAlign:"center",xstyle:o.row,children:[A,f,x,v]})}),e[44]=A,e[45]=f,e[46]=x,e[47]=v,e[48]=s):s=e[48];return s}function p(a){var b=m(12),d=a.actorName,e=a.actorURL,f=a.iconURI,g=a.passthroughProps,h=a.productAttribution;a=c("isStringNullOrEmpty")(d)?e:d;g=(d=g)!=null?d:void 0;b[0]!==g||b[1]!==e?(d={passthroughProps:g,url:e},b[0]=g,b[1]=e,b[2]=d):d=b[2];b[3]!==h?(g=function(){n.onReady(function(a){a.log({attribution_id_v2:h,click_point:"actor_profile_picture",click_target:"watch_and_scroll",event:"click"})})},b[3]=h,b[4]=g):g=b[4];e=f||"";b[5]!==e?(f={uri:e},b[5]=e,b[6]=f):f=b[6];b[7]!==a||b[8]!==d||b[9]!==g||b[10]!==f?(e=k.jsx(c("TetraProfilePhoto.react"),{"aria-label":a,linkProps:d,onPress:g,size:32,source:f}),b[7]=a,b[8]=d,b[9]=g,b[10]=f,b[11]=e):e=b[11];return e}function q(a){var b=m(5),d=a.actorName,e=a.actorURL,f=a.passthroughProps,g=a.productAttribution;if(b[0]!==d||b[1]!==g||b[2]!==f||b[3]!==e){a=c("isStringNullOrEmpty")(d)?null:k.jsx(c("CometLink.react"),{href:e,onClick:function(){n.onReady(function(a){a.log({attribution_id_v2:g,click_point:"actor_name",click_target:"watch_and_scroll",event:"click"})})},passthroughProps:(a=f)!=null?a:void 0,children:d});b[0]=d;b[1]=g;b[2]=f;b[3]=e;b[4]=a}else a=b[4];return a}function r(a){var b=m(8),d=a.passthroughProps,e=a.productAttribution,f=a.title;a=a.videoUrl;var g=c("useCometRouterState")(),h=g==null?void 0:g.main.route.tabKey;b[0]!==e||b[1]!==h?(g=function(){n.onReady(function(a){a.log({attribution_id_v2:e,click_point:"video_title",click_target:"watch_and_scroll",event:"click",event_target_info:h})})},b[0]=e,b[1]=h,b[2]=g):g=b[2];var i;b[3]!==a||b[4]!==g||b[5]!==d||b[6]!==f?(i=k.jsx(c("CometLink.react"),{href:a,onClick:g,passthroughProps:d,children:f}),b[3]=a,b[4]=g,b[5]=d,b[6]=f,b[7]=i):i=b[7];return i}g["default"]=a}),98);
__d("CometWatchAndScrollVideoQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="7795463093875854"}),null);
__d("CometWatchAndScrollVideoQuery.graphql",["VideoPlayerRelay_video$normalization.graphql","CometWatchAndScrollVideoQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a={defaultValue:null,kind:"LocalArgument",name:"chainingCursor"},c={defaultValue:null,kind:"LocalArgument",name:"chainingSeedVideoID"},d={defaultValue:null,kind:"LocalArgument",name:"scale"},e={defaultValue:null,kind:"LocalArgument",name:"videoID"},f=[{kind:"Variable",name:"id",variableName:"videoID"}],g={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"has_professional_features_for_watch",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"is_gaming_video",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"is_soundbites_video",storageKey:null},l={alias:null,args:null,concreteType:"PayToAccessPaywall",kind:"LinkedField",name:"pay_to_access_paywall",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"should_show_paywall",storageKey:null}],storageKey:null},m=[{kind:"Variable",name:"id",variableName:"chainingSeedVideoID"}],n={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"uri_token",storageKey:null},p=[{kind:"Literal",name:"site",value:"www"}],q={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r=[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],s=[g],t={alias:null,args:null,kind:"ScalarField",name:"title_with_fallback",storageKey:null},u={kind:"InlineFragment",selections:s,type:"Node",abstractKey:"__isNode"};return{fragment:{argumentDefinitions:[a,c,d,e],kind:"Fragment",metadata:null,name:"CometWatchAndScrollVideoQuery",selections:[{alias:null,args:f,concreteType:"Video",kind:"LinkedField",name:"video",plural:!1,selections:[g,h,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"owner",plural:!1,selections:[{kind:"InlineFragment",selections:[i],type:"VideoOwner",abstractKey:"__isVideoOwner"}],storageKey:null},j,k,{args:null,kind:"FragmentSpread",name:"CometWatchAndScrollContainer_video"},{args:null,kind:"FragmentSpread",name:"VideoPlayerRelay_video"},{args:null,kind:"FragmentSpread",name:"VideoPlayerWithLiveVideoEndscreen_video"},{args:null,kind:"FragmentSpread",name:"VideoPlayerWithLiveVideoIndicator_video"},{args:null,kind:"FragmentSpread",name:"CometWatchAndScrollTopBar_video"},{args:null,kind:"FragmentSpread",name:"CometWatchAndScrollCloseButton_video"},{args:null,kind:"FragmentSpread",name:"VideoPlayerWithWatchAndScrollWarningScreen_video"},{args:null,kind:"FragmentSpread",name:"VideoPlayerWithAudioOverlay_video"},{args:null,kind:"FragmentSpread",name:"VideoPlayerWithAudioBackground_video"},{args:null,kind:"FragmentSpread",name:"VideoPlayerWithWatchAndScrollChainingWrapper_video"},l],storageKey:null},{alias:"chainingSeedVideo",args:m,concreteType:"Video",kind:"LinkedField",name:"video",plural:!1,selections:[{kind:"Defer",selections:[{args:[{kind:"Variable",name:"cursor",variableName:"chainingCursor"},{kind:"Variable",name:"seedVideoID",variableName:"chainingSeedVideoID"}],kind:"FragmentSpread",name:"VideoPlayerSkipControl_video"}]}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[a,c,e,d],kind:"Operation",name:"CometWatchAndScrollVideoQuery",selections:[{alias:null,args:f,concreteType:"Video",kind:"LinkedField",name:"video",plural:!1,selections:[g,h,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"owner",plural:!1,selections:[n,{kind:"InlineFragment",selections:[i,o,{kind:"InlineFragment",selections:[{alias:null,args:p,kind:"ScalarField",name:"url",storageKey:'url(site:"www")'}],type:"User",abstractKey:null}],type:"VideoOwner",abstractKey:"__isVideoOwner"},g,q,{alias:null,args:[{kind:"Literal",name:"height",value:32},{kind:"Variable",name:"scale",variableName:"scale"},{kind:"Literal",name:"width",value:32}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:r,storageKey:null},{kind:"InlineFragment",selections:[o,{alias:null,args:null,kind:"ScalarField",name:"page_vanity_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"vanity",storageKey:null}],type:"Page",abstractKey:null}],storageKey:null},j,k,{alias:null,args:null,kind:"ScalarField",name:"original_width",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"original_height",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"original_rotation",storageKey:null},{alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"live_end_text",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_huddle",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_live_audio_room_v2_broadcast",storageKey:null},{alias:null,args:null,concreteType:"Event",kind:"LinkedField",name:"associated_paid_online_event",plural:!1,selections:s,storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_live_streaming",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_paid_virtual_event_premium_content",storageKey:null},{alias:"breakingStatus",args:null,kind:"ScalarField",name:"breaking_status",storageKey:null},{alias:"videoId",args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:"isPremiere",args:null,kind:"ScalarField",name:"is_premiere",storageKey:null},{alias:"liveViewerCount",args:null,kind:"ScalarField",name:"live_viewer_count_read_only",storageKey:null},{alias:"rehearsalInfo",args:null,concreteType:"LiveVideoRehearsalInfo",kind:"LinkedField",name:"rehearsal_info",plural:!1,selections:[{alias:"typeName",args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"publish_time",storageKey:null},{alias:null,args:null,concreteType:"Video",kind:"LinkedField",name:"live_speaker_count_indicator",plural:!1,selections:[{args:null,documentName:"VideoPlayerWithLiveVideoIndicator_video",fragmentName:"HuddlesSpeakerCountIndicatorContainer_video",fragmentPropName:"video",kind:"ModuleImport"},g],storageKey:null},q,t,{alias:null,args:null,concreteType:"Story",kind:"LinkedField",name:"creation_story",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"identifier_token",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"debug_info",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tracking",storageKey:null},g,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"shareable",plural:!1,selections:[n,{alias:"wwwUrl",args:p,kind:"ScalarField",name:"url",storageKey:'url(site:"www")'},u],storageKey:null}],storageKey:null},{alias:null,args:[{kind:"Literal",name:"framework",value:"WARNING_SCREENS"},{kind:"Literal",name:"location",value:"video_channel"}],concreteType:"CIXScreen",kind:"LinkedField",name:"cix_screen",plural:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"view_model",plural:!1,selections:[n,{kind:"InlineFragment",selections:[{args:null,documentName:"VideoPlayerWithWatchAndScrollWarningScreen_video",fragmentName:"CometWarningScreenOverlay_data",fragmentPropName:"data",kind:"ModuleImport"}],type:"OverlayWarningScreenViewModel",abstractKey:null},u],storageKey:null}],storageKey:'cix_screen(framework:"WARNING_SCREENS",location:"video_channel")'},{alias:null,args:null,concreteType:"Story",kind:"LinkedField",name:"container_story",plural:!1,selections:s,storageKey:null},{alias:null,args:null,concreteType:"VideoThumbnail",kind:"LinkedField",name:"preferred_thumbnail",plural:!1,selections:[{alias:null,args:null,concreteType:"Image",kind:"LinkedField",name:"image",plural:!1,selections:r,storageKey:null},g],storageKey:null},{alias:null,args:[{kind:"Literal",name:"supported",value:"2sq8zP"}],concreteType:null,kind:"LinkedField",name:"comet_video_player_audio_overlay_renderer",plural:!1,selections:[n,{kind:"InlineFragment",selections:[{args:null,documentName:"VideoPlayerWithAudioOverlay_video",fragmentName:"CometVideoPlayerWithLiveAudioRoomV2OverlayRenderer_renderer",fragmentPropName:"renderer",kind:"ModuleImport"}],type:"CometVideoPlayerWithLiveAudioRoomV2OverlayRenderer",abstractKey:null},{kind:"InlineFragment",selections:[{args:null,documentName:"VideoPlayerWithAudioOverlay_video",fragmentName:"CometVideoPlayerWithHuddleOverlayRenderer_renderer",fragmentPropName:"renderer",kind:"ModuleImport"}],type:"CometVideoPlayerWithHuddleOverlayRenderer",abstractKey:null},{kind:"InlineFragment",selections:[{args:null,documentName:"VideoPlayerWithAudioOverlay_video",fragmentName:"CometVideoPlayerWithPodcastOverlayRenderer_renderer",fragmentPropName:"renderer",kind:"ModuleImport"}],type:"CometVideoPlayerWithPodcastOverlayRenderer",abstractKey:null},{kind:"InlineFragment",selections:[{args:null,documentName:"VideoPlayerWithAudioOverlay_video",fragmentName:"VideoPlayerWithMusicSproutOverlayRenderer_renderer",fragmentPropName:"renderer",kind:"ModuleImport"}],type:"VideoPlayerWithMusicSproutOverlayRenderer",abstractKey:null},{kind:"InlineFragment",selections:[{args:null,documentName:"VideoPlayerWithAudioOverlay_video",fragmentName:"CometVideoPlayerWithSoundbiteOverlayRenderer_renderer",fragmentPropName:"renderer",kind:"ModuleImport"}],type:"CometVideoPlayerWithSoundbiteOverlayRenderer",abstractKey:null}],storageKey:'comet_video_player_audio_overlay_renderer(supported:"2sq8zP")'},{alias:null,args:[{kind:"Literal",name:"supported",value:"2ZlrYX"}],concreteType:null,kind:"LinkedField",name:"comet_video_player_audio_background_renderer",plural:!1,selections:[n,{kind:"InlineFragment",selections:[{args:null,documentName:"VideoPlayerWithAudioBackground_video",fragmentName:"CometVideoPlayerWithHuddleBackgroundRenderer_renderer",fragmentPropName:"renderer",kind:"ModuleImport"}],type:"CometVideoPlayerWithHuddleBackgroundRenderer",abstractKey:null}],storageKey:'comet_video_player_audio_background_renderer(supported:"2ZlrYX")'},{alias:null,args:null,kind:"ScalarField",name:"can_viewer_share",storageKey:null},l,{args:null,fragment:b("VideoPlayerRelay_video$normalization.graphql"),kind:"FragmentSpread"}],storageKey:null},{alias:"chainingSeedVideo",args:m,concreteType:"Video",kind:"LinkedField",name:"video",plural:!1,selections:[{"if":null,kind:"Defer",label:"CometWatchAndScrollVideoQuery$defer$VideoPlayerSkipControl_video_izUbj",selections:[g,{alias:null,args:[{kind:"Literal",name:"entry_point",value:"WNS"}],concreteType:null,kind:"LinkedField",name:"video_channel",plural:!1,selections:[n,{alias:null,args:[{kind:"Variable",name:"after",variableName:"chainingCursor"},{kind:"Literal",name:"caller",value:"WNS"},{kind:"Variable",name:"exclude_video",variableName:"chainingSeedVideoID"},{kind:"Literal",name:"first",value:1}],concreteType:"VideoChannelFeedConnection",kind:"LinkedField",name:"video_channel_feed",plural:!1,selections:[{alias:null,args:null,concreteType:"VideoChannelFeedEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[n,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"StoryAttachment",kind:"LinkedField",name:"attachments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"media",plural:!1,selections:[n,{kind:"InlineFragment",selections:[g,{alias:null,args:[{kind:"Literal",name:"height",value:202},{kind:"Literal",name:"sizing",value:"cover-fill-cropped"},{kind:"Literal",name:"width",value:360}],concreteType:"Image",kind:"LinkedField",name:"image",plural:!1,selections:r,storageKey:'image(height:202,sizing:"cover-fill-cropped",width:360)'},t,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"owner",plural:!1,selections:[n,q,g],storageKey:null},h],type:"Video",abstractKey:null},u,{kind:"InlineFragment",selections:s,type:"DynamicFeedAdAttachmentMedia",abstractKey:null},{kind:"InlineFragment",selections:s,type:"GenericAttachmentMedia",abstractKey:null},{kind:"InlineFragment",selections:s,type:"MontageImage",abstractKey:null},{kind:"InlineFragment",selections:s,type:"MontageVideo",abstractKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"click_tracking_linkshim_cb",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"encrypted_click_tracking",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"encrypted_tracking",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"viewability_config",storageKey:null},{alias:null,args:null,concreteType:"CometClientViewConfig",kind:"LinkedField",name:"client_view_config",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_delay_log_impression",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"use_banzai_signal_imp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"use_banzai_vital_imp",storageKey:null}],storageKey:null}],type:"Story",abstractKey:null},u,{kind:"InlineFragment",selections:s,type:"CommunityTabTrendingPOGFeedUnit",abstractKey:null},{kind:"InlineFragment",selections:s,type:"FBShortsMidCardFeedUnit",abstractKey:null},{kind:"InlineFragment",selections:s,type:"GroupsMultiGYSJStoryUnit",abstractKey:null},{kind:"InlineFragment",selections:s,type:"GroupsTabCategoriesUnit",abstractKey:null},{kind:"InlineFragment",selections:s,type:"PagesYouMayLikeFeedUnit",abstractKey:null},{kind:"InlineFragment",selections:s,type:"StoriesTrayFeedUnit",abstractKey:null},{kind:"InlineFragment",selections:s,type:"XFBDummyReelsInWatchIFU",abstractKey:null}],storageKey:null}],storageKey:null}],storageKey:null},g],storageKey:'video_channel(entry_point:"WNS")'}]},g],storageKey:null}]},params:{id:b("CometWatchAndScrollVideoQuery_facebookRelayOperation"),metadata:{},name:"CometWatchAndScrollVideoQuery",operationKind:"query",text:null}}}();e.exports=a}),null);
__d("VideoPlayerPictureInPictureControl.react",["fbt","ix","CometVideoPictureInPictureManagerContext","VideoPlayerControlIcon.react","VideoPlayerHooks","fbicon","react","requireDeferred","useMinifiedProductAttribution","useVideoPlayerPortalingPassthroughProps"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l=j||(j=d("react"));b=j;b.useCallback;var m=b.useContext,n=b.useEffect,o=b.c,p=c("requireDeferred")("VideoHomeTypedLiteLogger").__setRef("VideoPlayerPictureInPictureControl.react"),q=window.document.pictureInPictureEnabled;function a(a){var b=o(15),e=a.routeTracePolicy,f=a.subOrigin;b[0]===Symbol["for"]("react.memo_cache_sentinel")?(a=h._("__JHASH__AQMjhAwOZ46__JHASH__"),b[0]=a):a=b[0];a=a;var g=c("useMinifiedProductAttribution")(),j;b[1]!==g||b[2]!==e||b[3]!==f?(j=function(){p.onReady(function(a){a.log({attribution_id_v2:g,click_point:"control_picture_in_picture",event:"click",event_target_info:e,player_suborigin:f})})},b[1]=g,b[2]=e,b[3]=f,b[4]=j):j=b[4];var r=j,s=(k||(k=d("VideoPlayerHooks"))).useController(),t=m(d("CometVideoPictureInPictureManagerContext").CometVideoPictureInPictureManagerAPIContext);b[5]!==t||b[6]!==r?(j=function(){t.openPipPlayer(),r()},b[5]=t,b[6]=r,b[7]=j):j=b[7];j=j;var u=c("useVideoPlayerPortalingPassthroughProps")(),v=u.portableVideoID,w;b[8]!==t||b[9]!==s||b[10]!==v?(u=function(){q&&(t.setController(s),t.setPipPortableVideoID(v))},w=[t,s,v],b[8]=t,b[9]=s,b[10]=v,b[11]=u,b[12]=w):(u=b[11],w=b[12]);n(u,w);b[13]!==j?(u=q?l.jsx(c("VideoPlayerControlIcon.react"),{icon:d("fbicon")._(i("509931"),20),label:a,onPress:j,tooltip:a}):null,b[13]=j,b[14]=u):u=b[14];return u}g.VideoPlayerPictureInPictureControl=a}),226);
__d("VideoPlayerSkipControlBase.react",["fbt","ix","VideoPlayerControlIcon.react","fbicon","react"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k=(j||(j=d("react"))).c,l=j;function a(a){var b=k(7),e=a.disabled,f=a.onHoverIn,g=a.onHoverOut;a=a.onPress;var j,m;b[0]===Symbol["for"]("react.memo_cache_sentinel")?(j=d("fbicon")._(i("1052613"),20),m=h._("__JHASH__RMwYtzhsEt6__JHASH__"),b[0]=j,b[1]=m):(j=b[0],m=b[1]);b[2]!==e||b[3]!==f||b[4]!==g||b[5]!==a?(j=l.jsx(c("VideoPlayerControlIcon.react"),{color:"white",disabled:e,icon:j,label:m,onHoverIn:f,onHoverOut:g,onPress:a}),b[2]=e,b[3]=f,b[4]=g,b[5]=a,b[6]=j):j=b[6];return j}g["default"]=a}),226);
__d("CometWatchAndScrollChainingQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="25818399221139717"}),null);
__d("CometWatchAndScrollChainingQuery.graphql",["CometWatchAndScrollChainingQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"caller"},{defaultValue:null,kind:"LocalArgument",name:"chainingCursor"},{defaultValue:null,kind:"LocalArgument",name:"channelEntryPoint"},{defaultValue:null,kind:"LocalArgument",name:"count"},{defaultValue:null,kind:"LocalArgument",name:"scale"},{defaultValue:null,kind:"LocalArgument",name:"seedVideoID"}],c=[{kind:"Variable",name:"id",variableName:"seedVideoID"}],d=[{kind:"Variable",name:"entry_point",variableName:"channelEntryPoint"}],e=[{kind:"Variable",name:"after",variableName:"chainingCursor"},{kind:"Variable",name:"caller",variableName:"caller"},{kind:"Variable",name:"exclude_video",variableName:"seedVideoID"},{kind:"Variable",name:"first",variableName:"count"}],f={alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i=[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],j={alias:null,args:[{kind:"Literal",name:"height",value:202},{kind:"Literal",name:"sizing",value:"cover-fill-cropped"},{kind:"Literal",name:"width",value:360}],concreteType:"Image",kind:"LinkedField",name:"image",plural:!1,selections:i,storageKey:'image(height:202,sizing:"cover-fill-cropped",width:360)'},k=[h],l={alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"click_tracking_linkshim_cb",storageKey:null},n={alias:null,args:null,kind:"ScalarField",name:"encrypted_click_tracking",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"encrypted_tracking",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"viewability_config",storageKey:null},q={alias:null,args:null,concreteType:"CometClientViewConfig",kind:"LinkedField",name:"client_view_config",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_delay_log_impression",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"use_banzai_signal_imp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"use_banzai_vital_imp",storageKey:null}],storageKey:null},r={kind:"InlineFragment",selections:k,type:"Node",abstractKey:"__isNode"};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"CometWatchAndScrollChainingQuery",selections:[{alias:null,args:c,concreteType:"Video",kind:"LinkedField",name:"video",plural:!1,selections:[{alias:null,args:d,concreteType:null,kind:"LinkedField",name:"video_channel",plural:!1,selections:[{alias:null,args:e,concreteType:"VideoChannelFeedConnection",kind:"LinkedField",name:"video_channel_feed",plural:!1,selections:[{alias:null,args:null,concreteType:"VideoChannelFeedEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[f,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"StoryAttachment",kind:"LinkedField",name:"attachments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"media",plural:!1,selections:[g,{kind:"InlineFragment",selections:[{args:null,kind:"FragmentSpread",name:"CometWatchAndScrollContextSection_video"},h,j,{alias:null,args:null,concreteType:"MusicVideoMetadata",kind:"LinkedField",name:"pmv_metadata",plural:!1,selections:[g],storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"owner",plural:!1,selections:k,storageKey:null},l],type:"Video",abstractKey:null}],storageKey:null}],storageKey:null},m,n,o,p,q],type:"Story",abstractKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"CometWatchAndScrollChainingQuery",selections:[{alias:null,args:c,concreteType:"Video",kind:"LinkedField",name:"video",plural:!1,selections:[{alias:null,args:d,concreteType:null,kind:"LinkedField",name:"video_channel",plural:!1,selections:[g,{alias:null,args:e,concreteType:"VideoChannelFeedConnection",kind:"LinkedField",name:"video_channel_feed",plural:!1,selections:[{alias:null,args:null,concreteType:"VideoChannelFeedEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[f,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[g,{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"StoryAttachment",kind:"LinkedField",name:"attachments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"media",plural:!1,selections:[g,{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"title_with_fallback",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"owner",plural:!1,selections:[g,{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},h,{alias:null,args:[{kind:"Literal",name:"height",value:32},{kind:"Variable",name:"scale",variableName:"scale"},{kind:"Literal",name:"width",value:32}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:i,storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"has_professional_features_for_watch",storageKey:null}],type:"VideoOwner",abstractKey:"__isVideoOwner"},{kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Literal",name:"site",value:"www"}],kind:"ScalarField",name:"url",storageKey:'url(site:"www")'}],type:"User",abstractKey:null}],storageKey:null},h,j,{alias:null,args:null,concreteType:"MusicVideoMetadata",kind:"LinkedField",name:"pmv_metadata",plural:!1,selections:[g,h],storageKey:null},l],type:"Video",abstractKey:null},r,{kind:"InlineFragment",selections:k,type:"DynamicFeedAdAttachmentMedia",abstractKey:null},{kind:"InlineFragment",selections:k,type:"GenericAttachmentMedia",abstractKey:null},{kind:"InlineFragment",selections:k,type:"MontageImage",abstractKey:null},{kind:"InlineFragment",selections:k,type:"MontageVideo",abstractKey:null}],storageKey:null}],storageKey:null},m,n,o,p,q],type:"Story",abstractKey:null},r,{kind:"InlineFragment",selections:k,type:"CommunityTabTrendingPOGFeedUnit",abstractKey:null},{kind:"InlineFragment",selections:k,type:"FBShortsMidCardFeedUnit",abstractKey:null},{kind:"InlineFragment",selections:k,type:"GroupsMultiGYSJStoryUnit",abstractKey:null},{kind:"InlineFragment",selections:k,type:"GroupsTabCategoriesUnit",abstractKey:null},{kind:"InlineFragment",selections:k,type:"PagesYouMayLikeFeedUnit",abstractKey:null},{kind:"InlineFragment",selections:k,type:"StoriesTrayFeedUnit",abstractKey:null},{kind:"InlineFragment",selections:k,type:"XFBDummyReelsInWatchIFU",abstractKey:null}],storageKey:null}],storageKey:null}],storageKey:null},h],storageKey:null},h],storageKey:null}]},params:{id:b("CometWatchAndScrollChainingQuery_facebookRelayOperation"),metadata:{},name:"CometWatchAndScrollChainingQuery",operationKind:"query",text:null}}}();e.exports=a}),null);
__d("CometWatchAndScrollChaining_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"CometWatchAndScrollChaining_video",selections:[{args:null,kind:"FragmentSpread",name:"CometWatchAndScrollFallbackCTAScreen_video"}],type:"Video",abstractKey:null};e.exports=a}),null);
__d("CometWatchAndScrollContextSection_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a={argumentDefinitions:[{kind:"RootArgument",name:"scale"}],kind:"Fragment",metadata:null,name:"CometWatchAndScrollContextSection_video",selections:[{alias:null,args:null,kind:"ScalarField",name:"title_with_fallback",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"owner",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:[{kind:"Literal",name:"height",value:32},{kind:"Variable",name:"scale",variableName:"scale"},{kind:"Literal",name:"width",value:32}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"has_professional_features_for_watch",storageKey:null}],type:"VideoOwner",abstractKey:"__isVideoOwner"},{kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Literal",name:"site",value:"www"}],kind:"ScalarField",name:"url",storageKey:'url(site:"www")'}],type:"User",abstractKey:null}],storageKey:null}],type:"Video",abstractKey:null};e.exports=a}),null);
__d("CometWatchAndScrollContextSection.react",["CometLink.react","CometRelay","CometWatchAndScrollContextSection_video.graphql","TetraProfilePhoto.react","TetraText.react","XCometVideoHomePlaylistControllerRouteBuilder","isStringNullOrEmpty","react","requireDeferred","useMinifiedProductAttribution"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j=(i||(i=d("react"))).c,k=i,l=c("requireDeferred")("VideoHomeTypedLiteLogger").__setRef("CometWatchAndScrollContextSection.react");function a(a){var e,f=j(32);a=a.video;var g=c("useMinifiedProductAttribution")(),i;f[0]===Symbol["for"]("react.memo_cache_sentinel")?(i=h!==void 0?h:h=b("CometWatchAndScrollContextSection_video.graphql"),f[0]=i):i=f[0];i=d("CometRelay").useFragment(i,a);a=i==null?void 0:i.owner;if(i==null||a==null)return null;var n=a.id,o=a.name,p=a.url;e=(e=a.profile_picture)==null?void 0:e.uri;var q="#";if(a.has_professional_features_for_watch===!0){f[1]!==n?(a=c("XCometVideoHomePlaylistControllerRouteBuilder").buildURL({idorvanity:n}),f[1]=n,f[2]=a):a=f[2];q=a}else p!=null&&(q=p);f[3]===Symbol["for"]("react.memo_cache_sentinel")?(n="x6s0dn4 x78zum5",a="x1emribx",f[3]=n,f[4]=a):(n=f[3],a=f[4]);f[5]!==o||f[6]!==q?(p=c("isStringNullOrEmpty")(o)?q:o,f[5]=o,f[6]=q,f[7]=p):p=f[7];var r;f[8]!==q?(r={url:q},f[8]=q,f[9]=r):r=f[9];var s;f[10]!==g?(s=function(){l.onReady(function(a){a.log({attribution_id_v2:g,click_point:"actor_profile_picture",click_target:"watch_and_scroll_end_screen",event:"click"})})},f[10]=g,f[11]=s):s=f[11];e=e||"";var t;f[12]!==e?(t={uri:e},f[12]=e,f[13]=t):t=f[13];f[14]!==p||f[15]!==r||f[16]!==s||f[17]!==t?(e=k.jsx("div",{className:a,children:k.jsx(c("TetraProfilePhoto.react"),{"aria-label":p,linkProps:r,onPress:s,size:32,source:t})}),f[14]=p,f[15]=r,f[16]=s,f[17]=t,f[18]=e):e=f[18];f[19]===Symbol["for"]("react.memo_cache_sentinel")?(a="xeuugli",f[19]=a):a=f[19];f[20]!==o||f[21]!==q?(p=!c("isStringNullOrEmpty")(o)&&k.jsx(c("CometLink.react"),{color:"secondary",href:q,onClick:m,children:k.jsx(c("TetraText.react"),{color:"secondary",numberOfLines:1,type:"meta4",children:o})}),f[20]=o,f[21]=q,f[22]=p):p=f[22];f[23]===Symbol["for"]("react.memo_cache_sentinel")?(r="x1gslohp",f[23]=r):r=f[23];s=i==null?void 0:i.title_with_fallback;f[24]!==s?(t=k.jsx("div",{className:r,children:k.jsx(c("TetraText.react"),{color:"primary",numberOfLines:1,type:"headlineEmphasized4",children:s})}),f[24]=s,f[25]=t):t=f[25];f[26]!==p||f[27]!==t?(o=k.jsxs("div",{className:a,children:[p,t]}),f[26]=p,f[27]=t,f[28]=o):o=f[28];f[29]!==e||f[30]!==o?(q=k.jsxs("div",{className:n,children:[e,o]}),f[29]=e,f[30]=o,f[31]=q):q=f[31];return q}function m(){l.onReady(n)}function n(a){a.log({click_point:"actor_name",click_target:"watch_and_scroll_end_screen",event:"click"})}g["default"]=a}),98);
__d("CometWatchAndScrollActionButton.react",["CometPressable.react","TetraIcon.react","TetraText.react","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=(h||(h=d("react"))).c,j=h;function a(a){var b=i(24),d=a.icon,e=a.label,f=a.onPress,g=a.testid;a=a.url;var h;b[0]===Symbol["for"]("react.memo_cache_sentinel")?(h="x6s0dn4 x78zum5 xdt5ytf xl56j7k x14vqqas xq8finb xod5an3 x16n37ib x1n2onr6 x1dmp6jm",b[0]=h):h=b[0];var k;b[1]===Symbol["for"]("react.memo_cache_sentinel")?(k="xgjxtca xnuwv8w x1lqxvo2 xgi2ibe x14yjl9h xudhj91 x18nykt9 xww2gxu x13fuv20 xu3j5b3 x1q0q8m5 x26u7qi xamhcws xol2nv xlxy82 x19p7ews xod5an3 x889kno x1iji9kk x1a8lsjc x1sln4lm",b[1]=k):k=b[1];var l;b[2]!==a?(l={url:a},b[2]=a,b[3]=l):l=b[3];var m;b[4]!==e||b[5]!==d?(m=j.jsx(c("TetraIcon.react"),{"aria-label":e,color:"white",hideHoverOverlay:!0,icon:d}),b[4]=e,b[5]=d,b[6]=m):m=b[6];b[7]!==e||b[8]!==l||b[9]!==f||b[10]!==m?(d=j.jsx("div",{className:k,children:j.jsx(c("CometPressable.react"),{"aria-label":e,linkProps:l,onPress:f,children:m})}),b[7]=e,b[8]=l,b[9]=f,b[10]=m,b[11]=d):d=b[11];b[12]!==a?(k={url:a},b[12]=a,b[13]=k):k=b[13];b[14]!==e?(l=j.jsx(c("TetraText.react"),{align:"center",color:"primaryOnMedia",type:"bodyLink4",children:e}),b[14]=e,b[15]=l):l=b[15];b[16]!==k||b[17]!==f||b[18]!==l?(m=j.jsx(c("CometPressable.react"),{linkProps:k,onPress:f,children:l}),b[16]=k,b[17]=f,b[18]=l,b[19]=m):m=b[19];b[20]!==g||b[21]!==d||b[22]!==m?(a=j.jsxs("div",{className:h,"data-testid":void 0,children:[d,m]}),b[20]=g,b[21]=d,b[22]=m,b[23]=a):a=b[23];return a}g["default"]=a}),98);
__d("CometWatchAndScrollFallbackCTAScreen_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"CometWatchAndScrollFallbackCTAScreen_video",selections:[{args:null,kind:"FragmentSpread",name:"VideoPlayerReshareButton_video"}],type:"Video",abstractKey:null};e.exports=a}),null);
__d("CometWatchAndScrollFallbackCTAScreen.react",["fbt","ix","CometRelay","CometSetWatchAndScrollVideoContext","CometWatchAndScrollActionButton.react","CometWatchAndScrollFallbackCTAScreen_video.graphql","VideoPlayerHooks","VideoPlayerReshareButton.react","XCometWatchControllerRouteBuilder","fbicon","react","requireDeferred","useCometRouterState","useMinifiedProductAttribution"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l,m=k||(k=d("react"));e=k;var n=e.useContext,o=e.c,p=c("requireDeferred")("VideoHomeTypedLiteLogger").__setRef("CometWatchAndScrollFallbackCTAScreen.react");function a(a){var e=o(22),f=a.setIsCanceled;a=a.video;var g;e[0]===Symbol["for"]("react.memo_cache_sentinel")?(g=j!==void 0?j:j=b("CometWatchAndScrollFallbackCTAScreen_video.graphql"),e[0]=g):g=e[0];g=d("CometRelay").useFragment(g,a);var k=c("useMinifiedProductAttribution")(),q=(l||(l=d("VideoPlayerHooks"))).useController();a=c("useCometRouterState")();a=a==null?void 0:a.main.route.tabKey;a=a!=="watch";var r=n(c("CometSetWatchAndScrollVideoContext")),s;e[1]!==k?(s=function(a){p.onReady(function(b){b.log({attribution_id_v2:k,click_point:a,click_target:"watch_and_scroll_end_screen",event:"click"})})},e[1]=k,e[2]=s):s=e[2];var t=s,u;e[3]===Symbol["for"]("react.memo_cache_sentinel")?(s="x6s0dn4 xrmyhay x1l1xfun x13fuv20 x178xt8z x1ey2m1c x9f619 x78zum5 xds687c xl56j7k x13zrc24 xbxaen2 x1t1ogtf x1u72gb5 x10l6tqk x17qophe x13vifvy",u="x1cy8zhl x78zum5 x1q0g3np xl56j7k",e[3]=s,e[4]=u):(s=e[3],u=e[4]);var v;e[5]!==a||e[6]!==r||e[7]!==t?(v=a&&m.jsx(c("CometWatchAndScrollActionButton.react"),{icon:d("fbicon")._(i("607168"),16),label:h._("__JHASH___cyqgKfFL6l__JHASH__"),onPress:function(){r(null),t("watch_button")},url:c("XCometWatchControllerRouteBuilder").buildURL({})}),e[5]=a,e[6]=r,e[7]=t,e[8]=v):v=e[8];var w;e[9]===Symbol["for"]("react.memo_cache_sentinel")?(a=d("fbicon")._(i("534218"),16),w=h._("__JHASH__3wtbhevyblT__JHASH__"),e[9]=a,e[10]=w):(a=e[9],w=e[10]);e[11]!==q||e[12]!==f||e[13]!==t?(a=m.jsx(c("CometWatchAndScrollActionButton.react"),{icon:a,label:w,onPress:function(){q.play("user_initiated"),f(!1),t("replay")}}),e[11]=q,e[12]=f,e[13]=t,e[14]=a):a=e[14];e[15]!==g||e[16]!==t?(w=g!=null&&m.jsx(c("VideoPlayerReshareButton.react"),{renderActionButton:function(a){var b=a.onPress;return m.jsx(c("CometWatchAndScrollActionButton.react"),{icon:d("fbicon")._(i("484394"),16),label:h._("__JHASH__7sgCXbUM9aN__JHASH__"),onPress:function(){b(),t("share_button")}})},video:g}),e[15]=g,e[16]=t,e[17]=w):w=e[17];e[18]!==v||e[19]!==a||e[20]!==w?(g=m.jsx("div",{className:s,children:m.jsxs("div",{className:u,children:[v,a,w]})}),e[18]=v,e[19]=a,e[20]=w,e[21]=g):g=e[21];return g}g["default"]=a}),226);
__d("CometWatchAndScrollChaining.react",["fbt","ix","CometBackgroundImage.react","CometPictureInPictureExpContext","CometPressable.react","CometRelay","CometSetWatchAndScrollVideoContext","CometTahoeEndScreenProgressCircle.react","CometTheme.react","CometVideoPictureInPictureManager.react","CometWatchAndScrollChainingQuery.graphql","CometWatchAndScrollChaining_video.graphql","CometWatchAndScrollContextSection.react","CometWatchAndScrollFallbackCTAScreen.react","CometWatchAndScrollSetStoryViewabilityLoggerContext","CometWatchAndScrollVideoContext","TetraIcon.react","TetraText.react","VideoPlayerHooks","WebPixelRatio","fbicon","react","requireDeferred","useCometTahoeChainingDepth","useMinifiedProductAttribution"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l,m,n=l||(l=d("react"));e=l;var o=e.useCallback,p=e.useContext,q=e.useEffect,r=e.useState,s=c("requireDeferred")("VideoHomeTypedLiteLogger").__setRef("CometWatchAndScrollChaining.react");function a(a){var e,f=a.hidden,g=a.routeTracePolicy,l=a.seedVideoID,t=a.subOrigin;a=a.video;var u=p(c("CometWatchAndScrollVideoContext")),v=u==null?void 0:u.chainingCursor;a=d("CometRelay").useFragment(j!==void 0?j:j=b("CometWatchAndScrollChaining_video.graphql"),a);v=d("CometRelay").useLazyLoadQuery(k!==void 0?k:k=b("CometWatchAndScrollChainingQuery.graphql"),{caller:"WNS",chainingCursor:v,channelEntryPoint:"WNS",count:1,scale:d("WebPixelRatio").get(),seedVideoID:l});var w=d("useCometTahoeChainingDepth").useChainingDepthContext(),x=w.chainingDepthDispatch;w=r(!1);var y=w[0],z=w[1],A=(m||(m=d("VideoPlayerHooks"))).useController(),B=p(c("CometSetWatchAndScrollVideoContext")),C=c("useMinifiedProductAttribution")();w=(w=v.video)==null?void 0:(v=w.video_channel)==null?void 0:(w=v.video_channel_feed)==null?void 0:(v=w.edges)==null?void 0:v[0];var D=w==null?void 0:w.cursor,E=w==null?void 0:w.node,F=E==null?void 0:(v=E.attachments)==null?void 0:(w=v[0])==null?void 0:w.media;v=(F==null?void 0:F.pmv_metadata)&&F.pmv_metadata!=null;var G=!!v;q(function(){!f&&!y&&s.onReady(function(a){a.log({event:"watch_and_scroll_end_screen_impression"})})},[f,y]);var H=p(c("CometWatchAndScrollSetStoryViewabilityLoggerContext")),I=p(c("CometPictureInPictureExpContext")),J=o(function(a){s.onReady(function(b){b.log({event:a})}),B({chainingCursor:D,chainingSeedVideoID:l,routeTracePolicy:g,sessionStartTime:u==null?void 0:u.sessionStartTime,sessionTrigger:u==null?void 0:u.sessionTrigger,subOrigin:t,videoID:F==null?void 0:F.id,videoUrl:F==null?void 0:F.url}),H({clientViewConfig:E==null?void 0:E.client_view_config,encryptedTracking:E==null?void 0:E.encrypted_tracking,trackingCode:{click_tracking_linkshim_cb:(E==null?void 0:E.click_tracking_linkshim_cb)||"",encrypted_click_tracking:(E==null?void 0:E.encrypted_click_tracking)||"",encrypted_tracking:(E==null?void 0:E.encrypted_tracking)||""},videoID:F==null?void 0:F.id,viewabilityConfig:E==null?void 0:E.viewability_config})},[D,g,l,H,B,E==null?void 0:E.click_tracking_linkshim_cb,E==null?void 0:E.client_view_config,E==null?void 0:E.encrypted_click_tracking,E==null?void 0:E.encrypted_tracking,E==null?void 0:E.viewability_config,t,u==null?void 0:u.sessionStartTime,u==null?void 0:u.sessionTrigger,F]);if(y)return n.jsx(c("CometWatchAndScrollFallbackCTAScreen.react"),{setIsCanceled:z,video:a});if(F==null||F.__typename!=="Video"){s.onReady(function(a){a.log({event:"watch_and_scroll_chaining_query_empty"})});return n.jsx(c("CometWatchAndScrollFallbackCTAScreen.react"),{setIsCanceled:z,video:a})}v=(w=F.image)==null?void 0:w.uri;a=function(){z(!0),s.onReady(function(a){a.log({attribution_id_v2:C,click_point:"cancel_button",click_target:"watch_and_scroll_end_screen",event:"click"})})};w=function(){A.play("user_initiated"),s.onReady(function(a){a.log({attribution_id_v2:C,click_point:"replay",click_target:"watch_and_scroll_end_screen",event:"click"})})};var K=h._("__JHASH__gHxfq7Lt3Mv__JHASH__"),L=F==null?void 0:(e=F.owner)==null?void 0:e.id;return n.jsx(c("CometTheme.react"),{theme:"dark",children:n.jsxs("div",{className:"x1ey2m1c x9f619 xds687c x10l6tqk x17qophe x13vifvy",children:[n.jsx("div",{className:"x1ey2m1c x9f619 xds687c x10l6tqk x17qophe x13vifvy",children:v!=null&&n.jsx(c("CometBackgroundImage.react"),{src:v})}),n.jsxs("div",{className:"xrmyhay x1ey2m1c x9f619 x78zum5 xds687c xdt5ytf x889kno x1iji9kk x1a8lsjc x1sln4lm x10l6tqk x17qophe x13vifvy",children:[n.jsx("div",{className:"xyorhqc",children:n.jsx(c("TetraText.react"),{color:"primaryOnMedia",type:"body3",children:h._("__JHASH__59L0MmpSxEn__JHASH__")})}),n.jsx(c("CometWatchAndScrollContextSection.react"),{video:F}),n.jsxs("div",{className:"x6s0dn4 x78zum5 xr1yuqi",children:[n.jsx("div",{className:"x1emribx",children:n.jsx(c("TetraIcon.react"),{"aria-label":K,color:"white",icon:d("fbicon")._(i("534219"),20),onPress:w})}),n.jsx(c("CometPressable.react"),{onPress:w,children:n.jsx(c("TetraText.react"),{color:"primaryOnMedia",type:"bodyLink4",children:K})})]})]}),n.jsx("div",{className:"x6s0dn4 x1ey2m1c x9f619 x78zum5 xds687c xdt5ytf xl56j7k x47corl x10l6tqk x17qophe x13vifvy",children:n.jsxs("div",{className:"x1sy10c2 x71s49j",children:[!f&&n.jsx(c("CometPressable.react"),{"aria-label":h._("__JHASH__RPoFRbVl1Un__JHASH__"),onPress:function(){J("watch_and_scroll_chaining_click_advance"),x&&x({type:"INCREMENT"})},children:n.jsx(c("CometTahoeEndScreenProgressCircle.react"),{circleDiameter:44,circleStrokeColor:"var(--base-blue)",circleStrokeWidth:3,iconSize:20,isMakingProgress:!f,onProgressDone:function(){var a=I.pictureInPictureExpConfig.isInPictureInPictureExp,b=I.pictureInPictureExpConfig.isInPictureInPictureExpControlGroup,c=I.pictureInPictureExpConfig.isSkipAndChainingDisabled;a=!a&&!b||(a||b)&&!G&&!d("CometVideoPictureInPictureManager.react").EXCLUDED_PROVIDERS.includes(L)&&!c;if(a)J("watch_and_scroll_chaining_auto_advance"),x&&x({type:"INCREMENT"});else return},timeoutSec:6})}),n.jsx("div",{className:"x1anpbxc",children:n.jsx(c("CometPressable.react"),{onPress:a,children:n.jsx(c("TetraText.react"),{color:"secondary",type:"bodyLink4",children:h._("__JHASH__DTSCtZ4zhvM__JHASH__")})})})]})})]})})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("VideoPlayerWithWatchAndScrollChaining_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"VideoPlayerWithWatchAndScrollChaining_video",selections:[{args:null,kind:"FragmentSpread",name:"CometWatchAndScrollChaining_video"}],type:"Video",abstractKey:null};e.exports=a}),null);
__d("VideoPlayerWithWatchAndScrollChaining.react",["CometLoadingAnimation.react","CometPlaceholder.react","CometRelay","CometWatchAndScrollChaining.react","CometWatchAndScrollVideoContext","VideoPlayerWithWatchAndScrollChaining_video.graphql","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j=i||(i=d("react"));e=i;var k=e.useContext,l=e.c;function a(a){var e=l(8),f=a.hidden,g=a.routeTracePolicy,i=a.subOrigin;a=a.video;var m=k(c("CometWatchAndScrollVideoContext"));m=m==null?void 0:m.chainingSeedVideoID;var n;e[0]===Symbol["for"]("react.memo_cache_sentinel")?(n=h!==void 0?h:h=b("VideoPlayerWithWatchAndScrollChaining_video.graphql"),e[0]=n):n=e[0];n=d("CometRelay").useFragment(n,a);if(m==null)return null;e[1]===Symbol["for"]("react.memo_cache_sentinel")?(a=j.jsx("div",{className:"x6s0dn4 xrmyhay x1ey2m1c x9f619 x78zum5 xds687c xl56j7k x10l6tqk x17qophe x13vifvy",children:j.jsx("div",{className:"xc9qbxq x1n2onr6 x14qfxbe",children:j.jsx(c("CometLoadingAnimation.react"),{size:36})})}),e[1]=a):a=e[1];e[2]!==f||e[3]!==g||e[4]!==m||e[5]!==i||e[6]!==n?(a=j.jsx(c("CometPlaceholder.react"),{fallback:a,children:j.jsx(c("CometWatchAndScrollChaining.react"),{hidden:f,routeTracePolicy:g,seedVideoID:m,subOrigin:i,video:n})}),e[2]=f,e[3]=g,e[4]=m,e[5]=i,e[6]=n,e[7]=a):a=e[7];return a}g["default"]=a}),98);
__d("VideoPlayerWithWatchAndScrollChainingWrapper_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"VideoPlayerWithWatchAndScrollChainingWrapper_video",selections:[{args:null,kind:"FragmentSpread",name:"VideoPlayerWithWatchAndScrollChaining_video"}],type:"Video",abstractKey:null};e.exports=a}),null);
__d("VideoPlayerWithWatchAndScrollChainingWrapper.react",["CometPrerenderer.react","CometRelay","VideoPlayerHooks","VideoPlayerWithWatchAndScrollChaining.react","VideoPlayerWithWatchAndScrollChainingWrapper_video.graphql","react","stylex","useVideoPlayerControllerSubscription"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k,l=(j||(j=d("react"))).c,m=j,n=.8,o=0,p={hidden:{display:"x1s85apg",$$css:!0}};function q(a){var b=l(3),e=(k||(k=d("VideoPlayerHooks"))).useIsLive(),f;b[0]!==e?(f=function(a,b){var c,d;if(e)c=!1,d=!1;else{var f=a.getCurrentState().ended,g=a.getPlayheadPosition();a=a.getCurrentState();var h=a.duration,i=a.loopCount;a=a.loopCurrent;h=Math.min(h*n,h-o);c=a>=i&&f;d=b!=null&&b.shouldPrerender||g>h}return b!=null&&b.isVisible===c&&b.shouldPrerender===d?b:{isVisible:c,shouldPrerender:d}},b[0]=e,b[1]=f):f=b[1];f=c("useVideoPlayerControllerSubscription")(f);if(!a){b[2]===Symbol["for"]("react.memo_cache_sentinel")?(a={isVisible:!1,shouldPrerender:!1},b[2]=a):a=b[2];return a}return f}function a(a){var e=l(7),f=a.isVideoHomeEligible,g=a.routeTracePolicy,j=a.subOrigin;a=a.video;var k=q(f),n;e[0]===Symbol["for"]("react.memo_cache_sentinel")?(n=h!==void 0?h:h=b("VideoPlayerWithWatchAndScrollChainingWrapper_video.graphql"),e[0]=n):n=e[0];var o=d("CometRelay").useFragment(n,a);e[1]!==f||e[2]!==g||e[3]!==j||e[4]!==o||e[5]!==k?(n=f?m.jsx(c("CometPrerenderer.react"),{prerenderingProps:k,children:function(a){return m.jsx("div",{className:(i||(i=c("stylex")))(a.hidden===!0&&p.hidden),children:m.jsx(c("VideoPlayerWithWatchAndScrollChaining.react"),babelHelpers["extends"]({routeTracePolicy:g,subOrigin:j},a,{video:o}))})}}):null,e[1]=f,e[2]=g,e[3]=j,e[4]=o,e[5]=k,e[6]=n):n=e[6];return n}g.useWatchAndScrollChainingComponentRenderedStatus=q;g.VideoPlayerWithWatchAndScrollChainingWrapper=a}),98);
__d("VideoPlayerWithWatchAndScrollSoundContext.react",["CometWatchAndScrollSoundContext","VideoPlayerHooks","react","usePrevious"],(function(a,b,c,d,e,f,g){"use strict";var h,i;b=h||d("react");var j=b.useContext,k=b.useEffect,l=b.useRef,m=b.c;function a(){var a=m(16),b=j(c("CometWatchAndScrollSoundContext")),e=(i||(i=d("VideoPlayerHooks"))).useController(),f=i.useMuted(),g=i.useVolume(),h=i.usePaused(),n=c("usePrevious")(f),o=c("usePrevious")(g),p=l(f),q=l(g),r,s;a[0]!==n||a[1]!==f||a[2]!==b||a[3]!==o||a[4]!==g?(r=function(){n!==null&&n!==f&&b.setMuted(f),o!==null&&o!==g&&b.setVolume(g)},s=[f,n,o,b,g],a[0]=n,a[1]=f,a[2]=b,a[3]=o,a[4]=g,a[5]=r,a[6]=s):(r=a[5],s=a[6]);k(r,s);a[7]!==h||a[8]!==b?(r=function(){h||(b.muted==null&&b.setMuted(p.current),b.volume==null&&b.setVolume(q.current))},s=[h,b],a[7]=h,a[8]=b,a[9]=r,a[10]=s):(r=a[9],s=a[10]);k(r,s);a[11]!==h||a[12]!==b||a[13]!==e?(r=function(){if(!h){var a=b.muted,c=b.volume;a!=null&&e.setMuted(a,"user_initiated");c!=null&&e.setVolume(c)}},s=[e,h,b],a[11]=h,a[12]=b,a[13]=e,a[14]=r,a[15]=s):(r=a[14],s=a[15]);k(r,s);return null}g["default"]=a}),98);
__d("VideoPlayerWithWatchAndScrollWarningScreen_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"VideoPlayerWithWatchAndScrollWarningScreen_video",selections:[{alias:null,args:[{kind:"Literal",name:"framework",value:"WARNING_SCREENS"},{kind:"Literal",name:"location",value:"video_channel"}],concreteType:"CIXScreen",kind:"LinkedField",name:"cix_screen",plural:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"view_model",plural:!1,selections:[{kind:"InlineFragment",selections:[{args:null,documentName:"VideoPlayerWithWatchAndScrollWarningScreen_video",fragmentName:"CometWarningScreenOverlay_data",fragmentPropName:"data",kind:"ModuleImport"}],type:"OverlayWarningScreenViewModel",abstractKey:null}],storageKey:null}],storageKey:'cix_screen(framework:"WARNING_SCREENS",location:"video_channel")'},{alias:null,args:null,concreteType:"Story",kind:"LinkedField",name:"container_story",plural:!1,selections:[a],storageKey:null},a,{alias:null,args:null,concreteType:"VideoThumbnail",kind:"LinkedField",name:"preferred_thumbnail",plural:!1,selections:[{alias:null,args:null,concreteType:"Image",kind:"LinkedField",name:"image",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],storageKey:null}],storageKey:null}],type:"Video",abstractKey:null}}();e.exports=a}),null);
__d("VideoPlayerWithWatchAndScrollWarningScreen.react",["CometRelay","CometWarningScreenContext","VideoPlayerHooks","VideoPlayerWithWatchAndScrollWarningScreen_video.graphql","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k=i||(i=d("react"));c=i;var l=c.useEffect,m=c.c;function a(a){var c,e,f=m(22);a=a.video;var g;f[0]===Symbol["for"]("react.memo_cache_sentinel")?(g=h!==void 0?h:h=b("VideoPlayerWithWatchAndScrollWarningScreen_video.graphql"),f[0]=g):g=f[0];g=d("CometRelay").useFragment(g,a);var i=(j||(j=d("VideoPlayerHooks"))).useController(),n=j.usePaused();a=j.useEnded();var o=d("CometWarningScreenContext").useSetOverlayExists(),p=d("CometWarningScreenContext").useShowOverlay(),q=d("CometWarningScreenContext").useIsOverlayShown();c=g==null?void 0:(c=g.cix_screen)==null?void 0:c.view_model;var r=c!=null;e=(e=g==null?void 0:(e=g.preferred_thumbnail)==null?void 0:(e=e.image)==null?void 0:e.uri)!=null?e:"#";var s=g==null?void 0:g.id;g=g==null?void 0:(g=g.container_story)==null?void 0:g.id;var t;f[1]!==r||f[2]!==o||f[3]!==p?(t=function(){r&&(o(!0),p(!0))},f[1]=r,f[2]=o,f[3]=p,f[4]=t):t=f[4];var u;f[5]!==i||f[6]!==o||f[7]!==p||f[8]!==r?(u=[i,o,p,r],f[5]=i,f[6]=o,f[7]=p,f[8]=r,f[9]=u):u=f[9];l(t,u);f[10]!==n||f[11]!==q||f[12]!==i?(t=function(){!n&&q&&i.pause("warning_screen_cover")},u=[i,q,n],f[10]=n,f[11]=q,f[12]=i,f[13]=t,f[14]=u):(t=f[13],u=f[14]);l(t,u);f[15]!==r||f[16]!==a||f[17]!==s||f[18]!==c||f[19]!==e||f[20]!==g?(t=r&&!a?k.jsx(d("CometRelay").MatchContainer,{match:c,props:{alwaysShowDetails:!0,contentID:s,data:c,mediaUri:e,storyID:g,surface:"video_channel"}}):null,f[15]=r,f[16]=a,f[17]=s,f[18]=c,f[19]=e,f[20]=g,f[21]=t):t=f[21];return t}g["default"]=a}),98);
__d("CometWatchAndScroll.react",["CaptionsTextSizeMapping","CometInteractionSourceContext","CometLoadingAnimation.react","CometObjectFitContainerWithMaxHeight.react","CometPictureInPictureExpContext","CometPlaceholder.react","CometProductAttribution","CometRelay","CometRouteProductAttributionContext","CometRouterPushViewStackContext","CometSetWatchAndScrollVideoContext","CometTahoeChainingDepthLogging.react","CometTrackingCodeProvider.react","CometUFIVideoPlayerUtils","CometVideoPictureInPictureManager.react","CometVideoPictureInPictureManagerContext","CometWarningScreenContext","CometWatchAndScrollCloseButton.react","CometWatchAndScrollContainer_video.graphql","CometWatchAndScrollSoundContext","CometWatchAndScrollStoryViewabilityLoggerContext","CometWatchAndScrollTopBar.react","CometWatchAndScrollVideoContext","CometWatchAndScrollVideoQuery.graphql","HiddenSubtreeContext","HiddenSubtreeContextProvider.react","Locale","VideoAutoplayLocalScopeProvider.react","VideoPlayerAutoplayRulesProvider","VideoPlayerCaptionsDisplayConfigContext","VideoPlayerCometWatchInjectionControl.react","VideoPlayerDefaultControls.react","VideoPlayerDefaultControlsProperties","VideoPlayerHooks","VideoPlayerInstreamAdsStateHooks","VideoPlayerNavigateToTahoeOrFullScreenControl.react","VideoPlayerPictureInPictureControl.react","VideoPlayerRelay.react","VideoPlayerSkipControlBase.react","VideoPlayerSurface.react","VideoPlayerWithAudioBackground.react","VideoPlayerWithAudioOverlay.react","VideoPlayerWithLiveVideoEndscreen.react","VideoPlayerWithLiveVideoIndicator.react","VideoPlayerWithWatchAndScrollChainingWrapper.react","VideoPlayerWithWatchAndScrollSoundContext.react","VideoPlayerWithWatchAndScrollWarningScreen.react","WebPixelRatio","XCometGamingVideoControllerRouteBuilder","XCometWatchControllerRouteBuilder","deferredLoadComponent","isRouteTransparent","react","requireDeferred","requireDeferredForDisplay","stylex","useCometRouterState","useMWChatOpenTabCount","useMinifiedProductAttribution","useStoryViewabilityLogger","useVideoOriginalDimensionsRelay","useVideoPlayerPortalingPassthroughProps"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k,l,m=l||(l=d("react"));e=l;var n=e.useContext,o=e.useEffect;e.useMemo;var p=e.c,q=c("requireDeferred")("VideoHomeTypedLiteLogger").__setRef("CometWatchAndScroll.react"),r=c("deferredLoadComponent")(c("requireDeferredForDisplay")("VideoPlayerSkipControl.react").__setRef("CometWatchAndScroll.react")),s=d("VideoPlayerAutoplayRulesProvider").provideAutoplayRules("wns"),t={container:{backgroundColor:"xal61yo",bottom:"x1jn9clo",boxShadow:"x2c8kfy",display:"x78zum5",end:"x164qtfw",left:null,right:null,justifyContent:"xl56j7k",minHeight:"xz65tgg",position:"xixxii4",width:"xxsgkw5",$$css:!0},hiddenContainer:{backgroundColor:"xal61yo",bottom:"x1jn9clo",boxShadow:"x2c8kfy",display:"x1s85apg",end:"x164qtfw",left:null,right:null,justifyContent:"xl56j7k",minHeight:"xz65tgg",position:"xixxii4",width:"xxsgkw5",$$css:!0}};function u(){var a=c("useMWChatOpenTabCount")();return a*338+80}function a(){var a=p(37),b=n(c("CometRouterPushViewStackContext")),e=n(c("CometWatchAndScrollVideoContext")),f=n(c("CometSetWatchAndScrollVideoContext")),g=n(c("CometWatchAndScrollSoundContext")),h=n(c("CometPictureInPictureExpContext")),i=!1;e!=null&&h.pictureInPictureExpConfig.isInPictureInPictureExp&&(i=!0);a[0]!==i||a[1]!==b?(h=i?!1:(b||[]).some(v),a[0]=i,a[1]=b,a[2]=h):h=a[2];b=h;h=e==null?void 0:e.portableVideoID;var k=e==null?void 0:e.routeTracePolicy,l=e==null?void 0:e.subOrigin,q=e==null?void 0:e.videoID,r=e==null?void 0:e.chainingSeedVideoID,s=e==null?void 0:e.chainingCursor,x,y;a[3]!==e||a[4]!==q||a[5]!==r||a[6]!==f?(x=function(){e!=null&&q!=null&&r==null&&f(babelHelpers["extends"]({},e,{chainingSeedVideoID:q}))},y=[r,f,q,e],a[3]=e,a[4]=q,a[5]=r,a[6]=f,a[7]=x,a[8]=y):(x=a[7],y=a[8]);o(x,y);a[9]!==q||a[10]!==g?(x=function(){q==null&&(g.setMuted(null),g.setVolume(null))},y=[g,q],a[9]=q,a[10]=g,a[11]=x,a[12]=y):(x=a[11],y=a[12]);o(x,y);x=u();if(q==null||l==null||k==null||b)return null;y=i?t.hiddenContainer:t.container;var z;a[13]!==y?(z=(j||(j=c("stylex")))(y),a[13]=y,a[14]=z):z=a[14];a[15]!==x?(y=d("Locale").isRTL()?{left:x}:{right:x},a[15]=x,a[16]=y):y=a[16];a[17]===Symbol["for"]("react.memo_cache_sentinel")?(x=m.jsx("div",{className:"x78zum5 x6gtfd8 x10l6tqk x14qfxbe",children:m.jsx(c("CometLoadingAnimation.react"),{size:36})}),a[17]=x):x=a[17];a[18]!==z||a[19]!==y?(x=m.jsx("div",{className:z,style:y,children:x}),a[18]=z,a[19]=y,a[20]=x):x=a[20];a[21]!==s||a[22]!==r||a[23]!==h||a[24]!==k||a[25]!==l||a[26]!==q?(z=m.jsx(w,{chainingCursor:s,chainingSeedVideoID:r,portableVideoID:h,routeTracePolicy:k,subOrigin:l,videoID:q}),a[21]=s,a[22]=r,a[23]=h,a[24]=k,a[25]=l,a[26]=q,a[27]=z):z=a[27];a[28]!==i||a[29]!==z?(y=m.jsx(d("CometVideoPictureInPictureManager.react").CometVideoPictureInPictureManager,{isPipEnabled:i,children:z}),a[28]=i,a[29]=z,a[30]=y):y=a[30];a[31]!==b||a[32]!==y?(s=m.jsx(c("HiddenSubtreeContextProvider.react"),{isHidden:b,children:y}),a[31]=b,a[32]=y,a[33]=s):s=a[33];a[34]!==x||a[35]!==s?(h=m.jsx(c("CometPlaceholder.react"),{fallback:x,children:s}),a[34]=x,a[35]=s,a[36]=h):h=a[36];return h}function v(a){a=a.route;return!c("isRouteTransparent")(a)}function w(a){var e=p(37),f=a.chainingCursor,g=a.chainingSeedVideoID,i=a.portableVideoID,j=a.routeTracePolicy,k=a.subOrigin;a=a.videoID;var l;e[0]===Symbol["for"]("react.memo_cache_sentinel")?(l=h!==void 0?h:h=b("CometWatchAndScrollVideoQuery.graphql"),e[0]=l):l=e[0];g=(g=g)!=null?g:a;var n;e[1]===Symbol["for"]("react.memo_cache_sentinel")?(n=d("WebPixelRatio").get(),e[1]=n):n=e[1];e[2]!==f||e[3]!==g||e[4]!==a?(n={chainingCursor:f,chainingSeedVideoID:g,scale:n,videoID:a},e[2]=f,e[3]=g,e[4]=a,e[5]=n):n=e[5];f=d("CometRelay").useLazyLoadQuery(l,n);d("CaptionsTextSizeMapping").FixedCaptionsTextSizeMap;e[6]===Symbol["for"]("react.memo_cache_sentinel")?(g={liveCaptionsTextAlignment:"center",textSizeMapping:d("CaptionsTextSizeMapping").FixedCaptionsTextSizeMap},e[6]=g):g=e[6];l=g;n=l;e[7]!==j?(g=d("CometProductAttribution").getProductAttributionEntryV2({link_context:null,navChainContent:null,rootName:"CometWatchAndScroll.react",tap_point:"unexpected",tracePolicy:j,trackingNodes:null}),e[7]=j,e[8]=g):g=e[8];e[9]!==g?(l={v2:[g]},e[9]=g,e[10]=l):l=e[10];g=l;l=g;g=f.chainingSeedVideo;f=f.video;if(f==null)return null;var o=(f==null?void 0:f.is_gaming_video)===!0,q=f==null?void 0:f.id,r;e[11]!==q?(r=c("XCometGamingVideoControllerRouteBuilder").buildURL(q!=null?{ref:"comet_wns",video_id:q}:{}),e[11]=q,e[12]=r):r=e[12];r=r;var t;e[13]!==q?(t=c("XCometWatchControllerRouteBuilder").buildURL(q!=null?{v:q}:{}),e[13]=q,e[14]=t):t=e[14];q=t;t=(f==null?void 0:(t=f.pay_to_access_paywall)==null?void 0:t.should_show_paywall)===!0;r=o?r:q;if(t)return null;e[15]===Symbol["for"]("react.memo_cache_sentinel")?(q={placeDescription:"watch_and_scroll"},e[15]=q):q=e[15];t=!!((t=f.owner)==null?void 0:t.has_professional_features_for_watch);var u;e[16]!==g||e[17]!==o||e[18]!==t||e[19]!==r||e[20]!==j||e[21]!==k||e[22]!==f?(u=m.jsx(z,{chainingSeedVideo:g,isGamingVideo:o,isVideoHomeEligible:t,permalinkUrl:r,routeTracePolicy:j,subOrigin:k,video:f}),e[16]=g,e[17]=o,e[18]=t,e[19]=r,e[20]=j,e[21]=k,e[22]=f,e[23]=u):u=e[23];e[24]!==j||e[25]!==i||e[26]!==k||e[27]!==f||e[28]!==u?(g=m.jsx(c("VideoPlayerRelay.react"),{initialTracePolicy:j,playerFormat:"watch_scroll",portalingEnabled:!0,portalingFromVideoID:i,portalingPlaceMetaData:q,subOrigin:k,video:f,volumeSetting:null,children:u}),e[24]=j,e[25]=i,e[26]=k,e[27]=f,e[28]=u,e[29]=g):g=e[29];e[30]!==f||e[31]!==a||e[32]!==g?(o=m.jsx(x,{video:f,videoID:a,children:g}),e[30]=f,e[31]=a,e[32]=g,e[33]=o):o=e[33];e[34]!==l||e[35]!==o?(t=m.jsx(c("CometInteractionSourceContext").Provider,{value:54,children:m.jsx(c("VideoAutoplayLocalScopeProvider.react"),{autoplayLocalRules:s,children:m.jsx(d("CometUFIVideoPlayerUtils").CometUFIVideoPlayerStateAndControllerContextProvider,{children:m.jsx(d("CometWarningScreenContext").CometWarningScreenContextProvider,{overlayExists:!1,children:m.jsx(c("VideoPlayerCaptionsDisplayConfigContext").Provider,{value:n,children:m.jsx(c("CometRouteProductAttributionContext").Provider,{value:l,children:o})})})})})}),e[34]=l,e[35]=o,e[36]=t):t=e[36];return t}function x(a){var e=p(22),f=a.children,g=a.video;a=a.videoID;var h;e[0]===Symbol["for"]("react.memo_cache_sentinel")?(h=i!==void 0?i:i=b("CometWatchAndScrollContainer_video.graphql"),e[0]=h):h=e[0];h=d("CometRelay").useFragment(h,g);g=c("useVideoOriginalDimensionsRelay")(h);h=g.originalAspectRatio;g=u();var k=n(c("CometWatchAndScrollStoryViewabilityLoggerContext"));a=(k==null?void 0:k.videoID)===a;var l=k==null?void 0:k.clientViewConfig,o=k==null?void 0:k.encryptedTracking,q=k==null?void 0:k.viewabilityConfig,r;e[1]!==l||e[2]!==o||e[3]!==q?(r={clientViewConfig:l,encryptedTracking:o,position:0,viewabilityConfig:q},e[1]=l,e[2]=o,e[3]=q,e[4]=r):r=e[4];l=c("useStoryViewabilityLogger")(r);o=l.debuggingInfoLoggers;q=l.ref;r=n(c("CometPictureInPictureExpContext"));l=r.pictureInPictureExpConfig.isInPictureInPictureExp;r=l?t.hiddenContainer:t.container;e[5]!==r?(l=(j||(j=c("stylex")))(r),e[5]=r,e[6]=l):l=e[6];r=a?q:null;e[7]!==g?(q=d("Locale").isRTL()?{left:g}:{right:g},e[7]=g,e[8]=q):q=e[8];e[9]!==h||e[10]!==f?(g=m.jsx(c("CometObjectFitContainerWithMaxHeight.react"),{contentAspectRatio:h,maxHeight:300,children:f}),e[9]=h,e[10]=f,e[11]=g):g=e[11];e[12]!==l||e[13]!==r||e[14]!==q||e[15]!==o||e[16]!==g?(h=m.jsxs("div",{className:l,ref:r,style:q,children:[o,g]}),e[12]=l,e[13]=r,e[14]=q,e[15]=o,e[16]=g,e[17]=h):h=e[17];f=h;l=k==null?void 0:k.trackingCode;e[18]!==l||e[19]!==a||e[20]!==f?(r=l!=null&&a?m.jsx(c("CometTrackingCodeProvider.react"),{trackingCode:l,children:f}):f,e[18]=l,e[19]=a,e[20]=f,e[21]=r):r=e[21];return r}function y(){var a=p(4),b=(k||(k=d("VideoPlayerHooks"))).useController(),e=n(c("HiddenSubtreeContext")).hidden,f,g;a[0]!==e||a[1]!==b?(f=function(){e||b.play("user_initiated")},g=[b,e],a[0]=e,a[1]=b,a[2]=f,a[3]=g):(f=a[2],g=a[3]);o(f,g)}function z(a){var b=p(63),e=a.chainingSeedVideo,f=a.isGamingVideo,g=a.isVideoHomeEligible,h=a.permalinkUrl,i=a.routeTracePolicy,j=a.subOrigin;a=a.video;y();var l=c("useCometRouterState")();l=l==null?void 0:l.main.route.tabKey;var s=d("CometWarningScreenContext").useHasOverlay(),t=d("VideoPlayerInstreamAdsStateHooks").useInstreamAdsIsStart(),u=(k||(k=d("VideoPlayerHooks"))).useIsVideoBroadcast(),v=n(c("CometSetWatchAndScrollVideoContext")),w=a.is_soundbites_video===!0;t=g||t||w;w=f?"gaming":"watch";u=g&&!s&&l==="watch"&&!((u=u)!=null?u:!1);l=l!==w&&g&&!s;var x=!f&&(l||u);w=d("VideoPlayerWithWatchAndScrollChainingWrapper.react").useWatchAndScrollChainingComponentRenderedStatus(g).isVisible;s=n(c("CometPictureInPictureExpContext"));var z=s.pictureInPictureExpConfig.isInPictureInPictureExp;l=s.pictureInPictureExpConfig.isSkipAndChainingDisabled;u=z&&!l;s=!w;var A=c("useMinifiedProductAttribution")();b[0]!==A?(l=function(a){q.onReady(function(b){b.log({attribution_id_v2:A,click_point:a,click_target:"watch_and_scroll",event:"click"})})},b[0]=A,b[1]=l):l=b[1];var B=l,C=a.url;b[2]!==j||b[3]!==C?(w={subOrigin:j,videoTahoeUrl:C},b[2]=j,b[3]=C,b[4]=w):w=b[4];l=w;w=l;l=d("VideoPlayerDefaultControlsProperties").MutedButtonVisibility.SEPARATE_FROM_OTHER_CONTROLS;var D=k.useController(),E=n(d("CometVideoPictureInPictureManagerContext").CometVideoPictureInPictureManagerAPIContext),F=c("useVideoPlayerPortalingPassthroughProps")(),G=F.portableVideoID,H;b[5]!==z||b[6]!==E||b[7]!==D||b[8]!==G?(F=function(){z&&(E.setController(D),E.setPipPortableVideoID(G))},H=[E,D,G,z],b[5]=z,b[6]=E,b[7]=D,b[8]=G,b[9]=F,b[10]=H):(F=b[9],H=b[10]);o(F,H);b[11]===Symbol["for"]("react.memo_cache_sentinel")?(F=m.jsx(c("CometTahoeChainingDepthLogging.react"),{}),b[11]=F):F=b[11];b[12]!==t||b[13]!==x||b[14]!==h||b[15]!==C||b[16]!==f||b[17]!==i||b[18]!==j||b[19]!==a?(H=t&&m.jsx(c("CometWatchAndScrollTopBar.react"),{isGamingVideo:f,routeTracePolicy:i,subOrigin:j,video:a,videoUrl:x?h:C}),b[12]=t,b[13]=x,b[14]=h,b[15]=C,b[16]=f,b[17]=i,b[18]=j,b[19]=a,b[20]=H):H=b[20];b[21]!==a?(f=m.jsx(c("CometPlaceholder.react"),{fallback:null,children:m.jsx(c("VideoPlayerWithAudioBackground.react"),{playerFormat:"inline",video:a})}),b[21]=a,b[22]=f):f=b[22];b[23]!==s||b[24]!==i||b[25]!==j||b[26]!==x||b[27]!==v||b[28]!==B||b[29]!==h||b[30]!==C||b[31]!==u||b[32]!==e?(l=s&&m.jsx(c("VideoPlayerDefaultControls.react"),{mutedButtonVisibility:l,pictureInPictureControl:m.jsx(d("VideoPlayerPictureInPictureControl.react").VideoPlayerPictureInPictureControl,{routeTracePolicy:i,subOrigin:j}),renderExpandControl:function(a){a=a.onUserInteraction;return x?m.jsx(c("VideoPlayerCometWatchInjectionControl.react"),{onPress:function(){v(null),B("control_open_in_watch")},routeTracePolicy:i,subOrigin:j,videoWatchUrl:h}):m.jsx(c("VideoPlayerNavigateToTahoeOrFullScreenControl.react"),{onPressFullscreenControl:function(){return B("control_fullscreen")},onPressTahoeControl:function(){B("control_expand_to_tahoe"),v(null)},onUserInteraction:a,subOrigin:"watch_scroll",videoTahoeUrl:C})},shouldRenderCaptionsControl:!1,skipControl:u?m.jsx(c("CometPlaceholder.react"),{fallback:m.jsx(c("VideoPlayerSkipControlBase.react"),{disabled:!0}),children:e?m.jsx(r,{subOrigin:j,video:e}):m.jsx(c("VideoPlayerSkipControlBase.react"),{disabled:!0})}):null,subOrigin:"watch_scroll"}),b[23]=s,b[24]=i,b[25]=j,b[26]=x,b[27]=v,b[28]=B,b[29]=h,b[30]=C,b[31]=u,b[32]=e,b[33]=l):l=b[33];b[34]!==t||b[35]!==a?(s=!t&&m.jsx(c("CometWatchAndScrollCloseButton.react"),{video:a}),b[34]=t,b[35]=a,b[36]=s):s=b[36];b[37]!==a?(u=m.jsx(c("VideoPlayerWithLiveVideoEndscreen.react"),{video:a}),e=m.jsx(c("VideoPlayerWithLiveVideoIndicator.react"),{hasCometNavOverlay:!1,video:a}),b[37]=a,b[38]=u,b[39]=e):(u=b[38],e=b[39]);b[40]!==a?(t=m.jsx(c("CometPlaceholder.react"),{fallback:null,children:m.jsx(c("VideoPlayerWithAudioOverlay.react"),{playerFormat:"watch_scroll",video:a})}),b[40]=a,b[41]=t):t=b[41];var I;b[42]!==g||b[43]!==i||b[44]!==j||b[45]!==a?(I=m.jsx(d("VideoPlayerWithWatchAndScrollChainingWrapper.react").VideoPlayerWithWatchAndScrollChainingWrapper,{isVideoHomeEligible:g,routeTracePolicy:i,subOrigin:j,video:a}),b[42]=g,b[43]=i,b[44]=j,b[45]=a,b[46]=I):I=b[46];b[47]!==a?(g=m.jsx(c("CometPlaceholder.react"),{fallback:null,children:m.jsx(c("VideoPlayerWithWatchAndScrollWarningScreen.react"),{video:a})}),b[47]=a,b[48]=g):g=b[48];b[49]!==w?(a=m.jsx(d("CometUFIVideoPlayerUtils").CometUFIVideoPlayerStateAndControllerExtractor,{data:w}),b[49]=w,b[50]=a):a=b[50];b[51]===Symbol["for"]("react.memo_cache_sentinel")?(w=m.jsx(c("VideoPlayerWithWatchAndScrollSoundContext.react"),{}),b[51]=w):w=b[51];b[52]!==H||b[53]!==f||b[54]!==l||b[55]!==s||b[56]!==u||b[57]!==e||b[58]!==t||b[59]!==I||b[60]!==g||b[61]!==a?(F=m.jsxs(c("VideoPlayerSurface.react"),{children:[F,H,f,l,s,u,e,t,I,g,a,w]}),b[52]=H,b[53]=f,b[54]=l,b[55]=s,b[56]=u,b[57]=e,b[58]=t,b[59]=I,b[60]=g,b[61]=a,b[62]=F):F=b[62];return F}g["default"]=a}),98);
__d("CometWatchAndScrollUpNextCard_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"CometWatchAndScrollUpNextCard_video",selections:[{alias:null,args:[{kind:"Literal",name:"height",value:202},{kind:"Literal",name:"sizing",value:"cover-fill-cropped"},{kind:"Literal",name:"width",value:360}],concreteType:"Image",kind:"LinkedField",name:"image",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],storageKey:'image(height:202,sizing:"cover-fill-cropped",width:360)'},{alias:null,args:null,kind:"ScalarField",name:"title_with_fallback",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"owner",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null}],storageKey:null}],type:"Video",abstractKey:null};e.exports=a}),null);
__d("CometWatchAndScrollUpNextCard.react",["fbt","CometLink.react","CometRelay","CometResponsiveColumns.react","CometTahoeEndScreenProgressCircle.react","CometWatchAndScrollUpNextCard_video.graphql","TetraText.react","VideoPlayerHooks","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k,l=(j||(j=d("react"))).c,m=j,n={metaColumn:{flexBasis:"x12s9zaq",$$css:!0},thumbnailColumn:{flexBasis:"x19l4sor",$$css:!0}};function a(a){var e,f=l(30),g=a.hidden,j=a.onNextVideo;a=a.video;var o;f[0]===Symbol["for"]("react.memo_cache_sentinel")?(o=i!==void 0?i:i=b("CometWatchAndScrollUpNextCard_video.graphql"),f[0]=o):o=f[0];o=d("CometRelay").useFragment(o,a);a=(k||(k=d("VideoPlayerHooks"))).useEnded();if(o==null)return null;e=(e=o.image)==null?void 0:e.uri;var p;f[1]!==e?(p=e!=null?{backgroundImage:"url("+e+")"}:{backgroundColor:"var(--disabled-icon)"},f[1]=e,f[2]=p):p=f[2];e=p;f[3]===Symbol["for"]("react.memo_cache_sentinel")?(p="xztyhrg x18d0r48 x1lcm9me x1yr5g0i xrt01vj x10y3i5r x1ey2m1c x9f619 xds687c x10l6tqk x17qophe x13vifvy",f[3]=p):p=f[3];f[4]!==e?(p=m.jsx("div",{className:p,style:e}),f[4]=e,f[5]=p):p=f[5];e=p;p=o.title_with_fallback;o=(o=o.owner)==null?void 0:o.name;var q;f[6]===Symbol["for"]("react.memo_cache_sentinel")?(q="x1jx94hy x1lq5wgf xgqcy7u x30kzoy x9jhf4c x1qqjqyx x78zum5 xds687c x1xmf6yo x1emribx x1e56ztr x1i64zmx x1y1aw1k x1sxyh0 xwib8y2 xurb0ha x10l6tqk x17qophe",f[6]=q):q=f[6];var r;f[7]===Symbol["for"]("react.memo_cache_sentinel")?(r="x6s0dn4 x78zum5 xdt5ytf xaymia4 xl56j7k x10l6tqk x17qophe x13vifvy x10y0s8s",f[7]=r):r=f[7];var s;f[8]!==j||f[9]!==g||f[10]!==a?(s=j&&m.jsx(c("CometLink.react"),{onClick:function(){return j("watch_and_scroll_chaining_click_advance")},children:m.jsx(c("CometTahoeEndScreenProgressCircle.react"),{circleDiameter:32,circleStrokeColor:"var(--base-blue)",circleStrokeWidth:3,iconSize:20,isMakingProgress:!g&&a,onProgressDone:function(){return j("watch_and_scroll_chaining_auto_advance")},timeoutSec:6})}),f[8]=j,f[9]=g,f[10]=a,f[11]=s):s=f[11];f[12]!==e||f[13]!==s?(g=m.jsx(d("CometResponsiveColumns.react").Column,{xstyle:n.thumbnailColumn,children:m.jsxs("div",{className:r,children:[e,s]})}),f[12]=e,f[13]=s,f[14]=g):g=f[14];f[15]===Symbol["for"]("react.memo_cache_sentinel")?(a="x78zum5 xdt5ytf xu06os2 x1ok221b",r="xjpr12u",f[15]=a,f[16]=r):(a=f[15],r=f[16]);f[17]===Symbol["for"]("react.memo_cache_sentinel")?(e=m.jsx("div",{className:r,children:m.jsx(c("TetraText.react"),{color:"secondary",type:"meta4",children:h._("__JHASH__ie05BxoRsTp__JHASH__")})}),s="x1xmf6yo",f[17]=e,f[18]=s):(e=f[17],s=f[18]);f[19]!==o?(r=m.jsx("div",{className:s,children:m.jsx(c("TetraText.react"),{color:"secondary",numberOfLines:1,type:"body4",children:o})}),f[19]=o,f[20]=r):r=f[20];f[21]===Symbol["for"]("react.memo_cache_sentinel")?(s="x1xmf6yo",f[21]=s):s=f[21];f[22]!==p?(o=m.jsx("div",{className:s,children:m.jsx(c("TetraText.react"),{color:"primary",numberOfLines:1,type:"bodyLink4",children:p})}),f[22]=p,f[23]=o):o=f[23];f[24]!==r||f[25]!==o?(s=m.jsx(d("CometResponsiveColumns.react").Column,{xstyle:n.metaColumn,children:m.jsxs("div",{className:a,children:[e,r,o]})}),f[24]=r,f[25]=o,f[26]=s):s=f[26];f[27]!==g||f[28]!==s?(p=m.jsx("div",{className:q,children:m.jsxs(d("CometResponsiveColumns.react").Container,{children:[g,s]})}),f[27]=g,f[28]=s,f[29]=p):p=f[29];return p}g["default"]=a}),226);
__d("DocumentTitle",["Arbiter"],(function(a,b,c,d,e,f,g){var h=1500,i=null,j=!1,k=0,l=[],m=null,n=document.title,o=0;function p(){l.length>0?!j?(q(l[k].title),k=++k%l.length):r():(clearInterval(i),i=null,r())}function q(a){document.title=a,j=!0}function r(){s.set(m||n,!0),j=!1}var s=function(){function a(a){this.$1=a}a.get=function(){return n};a.set=function(a,b){var d=a.toString();document.title=d;!b?(n=d,m=null,c("Arbiter").inform("update_title",a)):m=d};a.blink=function(b){b={title:b.toString()};l.push(b);i===null&&(i=setInterval(p,h));return new a(b)};var b=a.prototype;b.stop=function(){var a=l.indexOf(this.$1);a>=0&&(l.splice(a,1),k>a?k--:k==a&&k==l.length&&(k=0))};a.badge=function(b){var d=a.get();d=b?"("+b+") "+d:d;a.set(d,!0);c("Arbiter").inform("update_title_badge",b,"state");o=b};a.preserveBadgeAndSet=function(b){a.set(b,!1),c("Arbiter").inform("update_title",b),a.badge(o)};return a}();g["default"]=s}),98);
__d("EncryptedBackupTaskIssuedFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("5726");b=d("FalcoLoggerInternal").create("encrypted_backup_task_issued",a);e=b;g["default"]=e}),98);
__d("EncryptedBackupdDYIFileSaver",["requireDeferred"],(function(a,b,c,d,e,f,g){"use strict";var h=c("requireDeferred")("file-saver").__setRef("EncryptedBackupdDYIFileSaver");function a(a,b){h.onReadyImmediately(function(c){c=c.saveAs;c(b,a)})}g.saveFile=a}),98);
__d("EncryptedBackupsDYIUtils",["EncryptedBackupdDYIFileSaver","MAWBridgeSendAndReceive","MAWEBFrontendQPLLogger","Promise","asyncToGeneratorRuntime","promiseDone","requireDeferred"],(function(a,b,c,d,e,f,g){"use strict";var h,i=c("requireDeferred")("jszip").__setRef("EncryptedBackupsDYIUtils");function j(a){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var c=(yield d("MAWBridgeSendAndReceive").sendAndReceive("backend","getAllThreadsAsJson")),e={};Object.keys(c).forEach(function(b){var d=c[b],f=d.messages,g=d.participants;d=d.stickers;f=f.map(function(a){var b=a.common;a.jsonType;a=babelHelpers.objectWithoutPropertiesLoose(a,["common","jsonType"]);return babelHelpers["extends"]({},b,a)});a.file("inbox/"+b+"/messages.json",JSON.stringify({messages:f,participants:g},null,4));["photos","videos","audio","gifs"].forEach(function(d){var e=c[b][d];Object.entries(e).forEach(function(c){var e=c[0];c=c[1];a.file("inbox/"+b+"/"+d+"/"+e,c)})});Object.entries(d).forEach(function(a){var b=a[0];a=a[1];e[b]=a})});Object.entries(e).forEach(function(b){var c=b[0];b=b[1];a.file("stickers_used/"+c,b)});return(h||(h=b("Promise"))).resolve(a)});return k.apply(this,arguments)}function a(a){i.onReady(function(b){b=b();c("promiseDone")(j(b).then(function(a){return a.generateAsync({compression:"DEFLATE",compressionOptions:{level:6},type:"blob"})}).then(function(b){d("EncryptedBackupdDYIFileSaver").saveFile("messages.zip",b),d("MAWEBFrontendQPLLogger").endDyiE2ECompleted(a,!0)}))})}g.createFileAndDownload=a}),98);
__d("LsRtcCallSummaryFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("1743880");b=d("FalcoLoggerInternal").create("ls_rtc_call_summary",a);e=b;g["default"]=e}),98);
__d("LsRtcConnectionStartFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("1743881");b=d("FalcoLoggerInternal").create("ls_rtc_connection_start",a);e=b;g["default"]=e}),98);
__d("LsRtcGroupE2eeFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("1066");b=d("FalcoLoggerInternal").create("ls_rtc_group_e2ee",a);e=b;g["default"]=e}),98);
__d("LsRtcP2pE2eeFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("5665");b=d("FalcoLoggerInternal").create("ls_rtc_p2p_e2ee",a);e=b;g["default"]=e}),98);
__d("LsRtcPeerConnectionSummaryFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("1743883");b=d("FalcoLoggerInternal").create("ls_rtc_peer_connection_summary",a);e=b;g["default"]=e}),98);
__d("ZenonLSLogsUploader",["DateConsts","LsRtcCallSummaryFalcoEvent","LsRtcConnectionStartFalcoEvent","LsRtcGroupE2eeFalcoEvent","LsRtcP2pE2eeFalcoEvent","LsRtcPeerConnectionSummaryFalcoEvent","ZenonAuditedCheckpointLogId","ZenonInfraActionsLogger","ZenonLSCallStartEventManager","ZenonLSCallStartEventStore","ZenonLSCallSummary","ZenonLSCallSummaryStore","ZenonLSE2EEStatsManager","ZenonLSE2EEStore","ZenonLSPeerConnectionSummary","ZenonLSPeerConnectionSummaryStore","justknobx"],(function(a,b,c,d,e,f,g){"use strict";var h=d("DateConsts").MS_PER_MIN*30,i={getLoggableEndCallLogs:function(a){a=a.getLocalStorageObjects();var b=[];for(var c in a)for(var d in a[c]){var e=a[c][d];if(e.__z){var f=e.__t;if(Date.now()-f>h){f=e.__d;b.push({endCallLogStr:f,peerID:c,signalingID:d})}}}return b},logCallStartEventManager:function(a){var b=a.callStartEventManager,e=a.peerID;a=a.signalingID;if(c("justknobx")._("853"))return;c("ZenonInfraActionsLogger").logCheckpointEmployeesTestUsersOnly({checkpoint:"Uploading NSL call start summary from local storage peerID: "+e+", signalingID: "+a});c("LsRtcConnectionStartFalcoEvent").logCritical(function(){return b.getStartEventData()});d("ZenonLSCallStartEventStore").ZenonLSCallStartEventStoreInstance.removeLocalStorageObjects([{peerID:e,signalingID:a}])},logCallStartEvents:function(){var a=i.getLoggableEndCallLogs(d("ZenonLSCallStartEventStore").ZenonLSCallStartEventStoreInstance);a.forEach(function(a){var b=a.endCallLogStr,d=a.peerID;a=a.signalingID;try{b=c("ZenonLSCallStartEventManager").fromJsonString(b);b&&i.logCallStartEventManager({callStartEventManager:b,peerID:d,signalingID:a})}catch(a){c("ZenonInfraActionsLogger").logError({auditId:c("ZenonAuditedCheckpointLogId").RP_ROOMS_INFRA_WWW__ERROR,error:a.message,errorDomain:"ZenonLSLogsUploader_callStartEvent"})}})},logCallSummaries:function(){var a=i.getLoggableEndCallLogs(d("ZenonLSCallSummaryStore").ZenonLSCallSummaryStoreInstance);a.forEach(function(a){var b=a.endCallLogStr,d=a.peerID;a=a.signalingID;try{b=c("ZenonLSCallSummary").fromJsonString(b);b&&i.logCallSummary({callSummary:b,peerID:d,signalingID:a})}catch(a){c("ZenonInfraActionsLogger").logError({auditId:c("ZenonAuditedCheckpointLogId").RP_ROOMS_INFRA_WWW__ERROR,error:a.message,errorDomain:"ZenonLSLogsUploader_callSummary"})}})},logCallSummary:function(a){var b=a.callSummary,e=a.peerID;a=a.signalingID;if(c("justknobx")._("853"))return;c("ZenonInfraActionsLogger").logCheckpointEmployeesTestUsersOnly({checkpoint:"Uploading NSL call summary from local storage peerID: "+e+", signalingID: "+a});c("LsRtcCallSummaryFalcoEvent").logCritical(function(){return babelHelpers["extends"]({},b.getSummaryLoggingInfo())});d("ZenonLSCallSummaryStore").ZenonLSCallSummaryStoreInstance.removeLocalStorageObjects([{peerID:e,signalingID:a}])},logE2eeStats:function(){var a=i.getLoggableEndCallLogs(d("ZenonLSE2EEStore").ZenonLSE2EEStoreInstance);a.forEach(function(a){var b=a.endCallLogStr,d=a.peerID;a=a.signalingID;try{b=c("ZenonLSE2EEStatsManager").fromJsonString(b);b&&i.logE2eeStatsManager({e2eeStatsManager:b,peerID:d,signalingID:a})}catch(a){c("ZenonInfraActionsLogger").logError({auditId:c("ZenonAuditedCheckpointLogId").RP_ROOMS_INFRA_WWW__ERROR,error:a.message,errorDomain:"ZenonLSLogsUploader_e2eeStats"})}})},logE2eeStatsManager:function(a){var b=a.e2eeStatsManager,e=a.peerID;a=a.signalingID;if(c("justknobx")._("853"))return;c("ZenonInfraActionsLogger").logCheckpointEmployeesTestUsersOnly({checkpoint:"Uploading NSL E2EE summary from local storage peerID: "+e+", signalingID: "+a});c("LsRtcGroupE2eeFalcoEvent").logCritical(function(){return b.getGroupE2eeMetricsInFalcoShape()});c("LsRtcP2pE2eeFalcoEvent").logCritical(function(){return b.getP2pE2eeMetricsInFalcoShape()});d("ZenonLSE2EEStore").ZenonLSE2EEStoreInstance.removeLocalStorageObjects([{peerID:e,signalingID:a}])},logEndCallLogEvents:function(){i.logCallSummaries(),i.logE2eeStats(),i.logPeerConnectionSummaries(),i.logCallStartEvents()},logPeerConnectionSummaries:function(){var a=i.getLoggableEndCallLogs(d("ZenonLSPeerConnectionSummaryStore").ZenonLSPeerConnectionSummaryStoreInstance);a.forEach(function(a){var b=a.endCallLogStr,d=a.peerID;a=a.signalingID;try{b=c("ZenonLSPeerConnectionSummary").fromJsonString(b);b&&i.logPeerConnectionSummary({peerConnectionSummary:b,peerID:d,signalingID:a})}catch(a){c("ZenonInfraActionsLogger").logError({auditId:c("ZenonAuditedCheckpointLogId").RP_ROOMS_INFRA_WWW__ERROR,error:a.message,errorDomain:"ZenonLSLogsUploader_peerConnectionSummary"})}})},logPeerConnectionSummary:function(a){var b=a.peerConnectionSummary,e=a.peerID;a=a.signalingID;if(c("justknobx")._("853"))return;c("ZenonInfraActionsLogger").logCheckpointEmployeesTestUsersOnly({checkpoint:"Uploading NSL PCS summary from local storage peerID: "+e+", signalingID: "+a});c("LsRtcPeerConnectionSummaryFalcoEvent").logCritical(function(){return b.getPeerConnectionSummary()});d("ZenonLSPeerConnectionSummaryStore").ZenonLSPeerConnectionSummaryStoreInstance.removeLocalStorageObjects([{peerID:e,signalingID:a}])}};a=i;g["default"]=a}),98);
__d("FBRTCCallSummaryUploader",["DateConsts","ZenonLSLogsUploader"],(function(a,b,c,d,e,f,g){var h=10*d("DateConsts").MS_PER_MIN,i=null;function a(){if(i!==null)return;i=window.setInterval(function(){c("ZenonLSLogsUploader").logEndCallLogEvents()},h)}g.init=a}),98);
__d("FriendingCometFriendRequestConfirmSubscription_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="7764445583591938"}),null);
__d("FriendingCometFriendRequestConfirmSubscription.graphql",["CometTextWithEntitiesRelay_textWithEntities$normalization.graphql","FriendingCometFriendRequestConfirmSubscription_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"},{defaultValue:null,kind:"LocalArgument",name:"scale"}],c=[{kind:"Variable",name:"data",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"notif_id",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"seen_state",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"time_confirmed",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},j={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},k={kind:"Variable",name:"scale",variableName:"scale"},l=[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"FriendingCometFriendRequestConfirmSubscription",selections:[{alias:null,args:c,concreteType:"FriendRequestConfirmSubscribeResponsePayload",kind:"LinkedField",name:"friend_request_confirm_subscribe",plural:!1,selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{args:[{kind:"Literal",name:"bookmarkID",value:"2356318349"}],kind:"FragmentSpread",name:"useTopTabBadgeCount_viewer"},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"actor",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"CometNotificationsListItem_actor"}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"new_friend",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"FriendingCometAcceptedFriendRequestsPanel_user"}],storageKey:null},{alias:null,args:null,concreteType:"Notification",kind:"LinkedField",name:"notif",plural:!1,selections:[{args:[{kind:"Literal",name:"isToast",value:!0}],kind:"FragmentSpread",name:"CometNotificationsListItem_notification"},d,e,f,{alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"body",plural:!1,selections:[g],storageKey:null}],storageKey:null},h],storageKey:null}],type:"Subscription",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"FriendingCometFriendRequestConfirmSubscription",selections:[{alias:null,args:c,concreteType:"FriendRequestConfirmSubscribeResponsePayload",kind:"LinkedField",name:"friend_request_confirm_subscribe",plural:!1,selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:[{items:[{kind:"Literal",name:"bookmark_ids.0",value:"2356318349"}],kind:"ListValue",name:"bookmark_ids"},{kind:"Literal",name:"environment",value:"COMET"},{kind:"Literal",name:"folder_id",value:"PRODUCT"},{kind:"Literal",name:"sections",value:["FACEBOOK_APP"]}],concreteType:"BookmarksConnection",kind:"LinkedField",name:"bookmarks",plural:!1,selections:[{alias:null,args:null,concreteType:"BookmarksEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Bookmark",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"bookmarked_node",plural:!1,selections:[i,e],storageKey:null},{alias:null,args:[{kind:"Literal",name:"bookmark_render_location",value:"COMET_TOP_TAB"}],kind:"ScalarField",name:"unread_count",storageKey:'unread_count(bookmark_render_location:"COMET_TOP_TAB")'},e],storageKey:null}],storageKey:null}],storageKey:'bookmarks(bookmark_ids:["2356318349"],environment:"COMET",folder_id:"PRODUCT",sections:["FACEBOOK_APP"])'},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"actor",plural:!1,selections:[i,{kind:"TypeDiscriminator",abstractKey:"__isActor"},e,j],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"new_friend",plural:!1,selections:[j,{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:[{kind:"Literal",name:"height",value:60},k,{kind:"Literal",name:"width",value:60}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:l,storageKey:null},e],storageKey:null},{alias:null,args:null,concreteType:"Notification",kind:"LinkedField",name:"notif",plural:!1,selections:[e,d,{alias:null,args:null,kind:"ScalarField",name:"notif_type",storageKey:null},{kind:"ClientExtension",selections:[{alias:"id_for_entrypoint",args:null,kind:"ScalarField",name:"__id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null}]},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"notif_attachments",plural:!0,selections:[i,{kind:"InlineFragment",selections:[{args:null,documentName:"CometNotificationsListItemAttachment_notification",fragmentName:"CometNotificationsListItemFriendRequestAttachment_notifAttachments",fragmentPropName:"notifAttachments",kind:"ModuleImport"}],type:"FriendRequestNotifAttachment",abstractKey:null},{kind:"InlineFragment",selections:[{args:null,documentName:"CometNotificationsListItemAttachment_notification",fragmentName:"CometNotificationsListItemInlineCTAAttachment_notifAttachments",fragmentPropName:"notifAttachments",kind:"ModuleImport"}],type:"InlineCTACometNotifAttachment",abstractKey:null},{kind:"InlineFragment",selections:[{args:null,documentName:"CometNotificationsListItemAttachment_notification",fragmentName:"CometNotificationsListItemPageInviteAttachment_notifAttachments",fragmentPropName:"notifAttachments",kind:"ModuleImport"}],type:"PageInviteNotifAttachment",abstractKey:null},{kind:"InlineFragment",selections:[{args:null,documentName:"CometNotificationsListItemAttachment_notification",fragmentName:"CometNotificationsListItemQuickPromotionAttachment_notifAttachments",fragmentPropName:"notifAttachments",kind:"ModuleImport"}],type:"QuickPromotionNotifAttachment",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"StructuredSurveySession",kind:"LinkedField",name:"inline_survey",plural:!1,selections:[i],storageKey:null}],type:"InlineSurveyNotifAttachment",abstractKey:null}],storageKey:null},{alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"body",plural:!1,selections:[{args:null,fragment:b("CometTextWithEntitiesRelay_textWithEntities$normalization.graphql"),kind:"FragmentSpread"},g],storageKey:null},{alias:null,args:[{kind:"Literal",name:"height",value:56},k,{kind:"Literal",name:"width",value:56}],concreteType:"Image",kind:"LinkedField",name:"notif_image",plural:!1,selections:l,storageKey:null},{alias:null,args:[{kind:"Literal",name:"site",value:"comet"}],kind:"ScalarField",name:"url",storageKey:'url(site:"comet")'},f,{alias:"creation_time",args:null,concreteType:"CreationTimeWithRelativeText",kind:"LinkedField",name:"creation_time_with_relative_text",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"GlyphIconData",kind:"LinkedField",name:"icon_data",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"reaction_type",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"glyph_name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"glyph_icon_url",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tracking",storageKey:null}],storageKey:null},h],storageKey:null}]},params:{id:b("FriendingCometFriendRequestConfirmSubscription_facebookRelayOperation"),metadata:{subscriptionName:"friend_request_confirm_subscribe"},name:"FriendingCometFriendRequestConfirmSubscription",operationKind:"subscription",text:null}}}();e.exports=a}),null);
__d("FriendingCometFriendRequestConfirmSubscription",["CometRelay","FriendingCometFriendRequestConfirmSubscription.graphql","WebPixelRatio","cr:1723177","relay-runtime"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h!==void 0?h:h=b("FriendingCometFriendRequestConfirmSubscription.graphql");function a(a,c,e,f,g,h){var j=function(a){var b=a.getRootField("friend_request_confirm_subscribe");if(b==null)return;var c=a.get(d("relay-runtime").VIEWER_ID);if(c==null)return;var e=b.getLinkedRecord("new_friend");if(e==null)return;b=b.getValue("time_confirmed");c=d("relay-runtime").ConnectionHandler.getConnection(c,"FriendingCometAcceptedFriendRequestsPanel_friend_confirmed_notifications");if(c==null)return;a=d("relay-runtime").ConnectionHandler.createEdge(a,c,e,"FriendConfirmedNotificationsEdge");a.setValue(b,"time_sent");d("relay-runtime").ConnectionHandler.insertEdgeBefore(c,a);e=parseInt(c.getValue("count"),0);c.setValue(e+1,"count")},k=function(a){a!=null&&b("cr:1723177")!=null&&f!==!0&&b("cr:1723177").pushFriendingConfirmedCometToast(a,e)};return d("CometRelay").requestSubscription(c,{onCompleted:g,onError:h,onNext:k,subscription:i,updater:j,variables:{input:{requester_id:a},scale:d("WebPixelRatio").get()}})}g.subscribe=a}),98);
__d("FriendingCometFriendRequestReceiveSubscription_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="8583364905013695"}),null);
__d("FriendingCometFriendRequestReceiveSubscription.graphql",["CometTextWithEntitiesRelay_textWithEntities$normalization.graphql","FriendingCometFriendRequestReceiveSubscription_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"},{defaultValue:null,kind:"LocalArgument",name:"scale"}],c=[{kind:"Variable",name:"data",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"friendship_status",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"time_received",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"notif_id",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"seen_state",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},j=[i],k={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},m={kind:"Variable",name:"scale",variableName:"scale"},n=[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],o={alias:null,args:[{kind:"Literal",name:"site",value:"comet"}],kind:"ScalarField",name:"url",storageKey:'url(site:"comet")'};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"FriendingCometFriendRequestReceiveSubscription",selections:[{alias:null,args:c,concreteType:"FriendRequestReceiveSubscribeResponsePayload",kind:"LinkedField",name:"friend_request_receive_subscribe",plural:!1,selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{args:[{kind:"Literal",name:"bookmarkID",value:"2356318349"}],kind:"FragmentSpread",name:"useTopTabBadgeCount_viewer"},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"actor",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"CometNotificationsListItem_actor"}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"sender",plural:!1,selections:[d,e,{args:null,kind:"FragmentSpread",name:"FriendingCometFriendRequestsListItem_user"}],storageKey:null},f,{alias:null,args:null,concreteType:"Notification",kind:"LinkedField",name:"notif",plural:!1,selections:[{args:[{kind:"Literal",name:"isToast",value:!0}],kind:"FragmentSpread",name:"CometNotificationsListItem_notification"},g,d,h,{alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"body",plural:!1,selections:j,storageKey:null}],storageKey:null}],storageKey:null}],type:"Subscription",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"FriendingCometFriendRequestReceiveSubscription",selections:[{alias:null,args:c,concreteType:"FriendRequestReceiveSubscribeResponsePayload",kind:"LinkedField",name:"friend_request_receive_subscribe",plural:!1,selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:[{items:[{kind:"Literal",name:"bookmark_ids.0",value:"2356318349"}],kind:"ListValue",name:"bookmark_ids"},{kind:"Literal",name:"environment",value:"COMET"},{kind:"Literal",name:"folder_id",value:"PRODUCT"},{kind:"Literal",name:"sections",value:["FACEBOOK_APP"]}],concreteType:"BookmarksConnection",kind:"LinkedField",name:"bookmarks",plural:!1,selections:[{alias:null,args:null,concreteType:"BookmarksEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Bookmark",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"bookmarked_node",plural:!1,selections:[k,d],storageKey:null},{alias:null,args:[{kind:"Literal",name:"bookmark_render_location",value:"COMET_TOP_TAB"}],kind:"ScalarField",name:"unread_count",storageKey:'unread_count(bookmark_render_location:"COMET_TOP_TAB")'},d],storageKey:null}],storageKey:null}],storageKey:'bookmarks(bookmark_ids:["2356318349"],environment:"COMET",folder_id:"PRODUCT",sections:["FACEBOOK_APP"])'},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"actor",plural:!1,selections:[k,{kind:"TypeDiscriminator",abstractKey:"__isActor"},d,l],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"sender",plural:!1,selections:[d,e,l,{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:[{kind:"Literal",name:"height",value:60},m,{kind:"Literal",name:"width",value:60}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:n,storageKey:null},{kind:"InlineFragment",selections:[{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"social_context",plural:!1,selections:j,storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"social_context_top_mutual_friends",plural:!0,selections:[d,l,o,{alias:null,args:[{kind:"Literal",name:"height",value:20},m,{kind:"Literal",name:"width",value:20}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:n,storageKey:null}],storageKey:null}],type:"User",abstractKey:null}],type:"FriendNode",abstractKey:"__isFriendNode"}],storageKey:null},f,{alias:null,args:null,concreteType:"Notification",kind:"LinkedField",name:"notif",plural:!1,selections:[d,g,{alias:null,args:null,kind:"ScalarField",name:"notif_type",storageKey:null},{kind:"ClientExtension",selections:[{alias:"id_for_entrypoint",args:null,kind:"ScalarField",name:"__id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null}]},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"notif_attachments",plural:!0,selections:[k,{kind:"InlineFragment",selections:[{args:null,documentName:"CometNotificationsListItemAttachment_notification",fragmentName:"CometNotificationsListItemFriendRequestAttachment_notifAttachments",fragmentPropName:"notifAttachments",kind:"ModuleImport"}],type:"FriendRequestNotifAttachment",abstractKey:null},{kind:"InlineFragment",selections:[{args:null,documentName:"CometNotificationsListItemAttachment_notification",fragmentName:"CometNotificationsListItemInlineCTAAttachment_notifAttachments",fragmentPropName:"notifAttachments",kind:"ModuleImport"}],type:"InlineCTACometNotifAttachment",abstractKey:null},{kind:"InlineFragment",selections:[{args:null,documentName:"CometNotificationsListItemAttachment_notification",fragmentName:"CometNotificationsListItemPageInviteAttachment_notifAttachments",fragmentPropName:"notifAttachments",kind:"ModuleImport"}],type:"PageInviteNotifAttachment",abstractKey:null},{kind:"InlineFragment",selections:[{args:null,documentName:"CometNotificationsListItemAttachment_notification",fragmentName:"CometNotificationsListItemQuickPromotionAttachment_notifAttachments",fragmentPropName:"notifAttachments",kind:"ModuleImport"}],type:"QuickPromotionNotifAttachment",abstractKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"StructuredSurveySession",kind:"LinkedField",name:"inline_survey",plural:!1,selections:[k],storageKey:null}],type:"InlineSurveyNotifAttachment",abstractKey:null}],storageKey:null},{alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"body",plural:!1,selections:[{args:null,fragment:b("CometTextWithEntitiesRelay_textWithEntities$normalization.graphql"),kind:"FragmentSpread"},i],storageKey:null},{alias:null,args:[{kind:"Literal",name:"height",value:56},m,{kind:"Literal",name:"width",value:56}],concreteType:"Image",kind:"LinkedField",name:"notif_image",plural:!1,selections:n,storageKey:null},o,h,{alias:"creation_time",args:null,concreteType:"CreationTimeWithRelativeText",kind:"LinkedField",name:"creation_time_with_relative_text",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"timestamp",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"GlyphIconData",kind:"LinkedField",name:"icon_data",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"reaction_type",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"glyph_name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"glyph_icon_url",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tracking",storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:b("FriendingCometFriendRequestReceiveSubscription_facebookRelayOperation"),metadata:{subscriptionName:"friend_request_receive_subscribe"},name:"FriendingCometFriendRequestReceiveSubscription",operationKind:"subscription",text:null}}}();e.exports=a}),null);
__d("FriendingCometFriendRequestReceiveSubscription",["CometRelay","FriendingCometFriendRequestReceiveSubscription.graphql","WebPixelRatio","cr:1723177","relay-runtime"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h!==void 0?h:h=b("FriendingCometFriendRequestReceiveSubscription.graphql");function a(a,c,e,f,g,h){var j=function(a){var b=a.getRootField("friend_request_receive_subscribe");if(b==null)return;var c=a.get(d("relay-runtime").VIEWER_ID);if(c==null)return;var e=b.getLinkedRecord("sender");if(e==null)return;b=b.getValue("time_received");c=d("relay-runtime").ConnectionHandler.getConnection(c,"FriendingCometFriendRequestsPanel_friending_possibilities",{friending_channel:"REQUESTS_JEWEL"});if(c==null)return;var f=c.getLinkedRecords("edges");if(f!=null){f=f==null?void 0:f.filter(function(a){a=a==null?void 0:a.getLinkedRecord("node");return(a==null?void 0:a.getValue("id"))!==e.getValue("id")});c.setLinkedRecords(f,"edges");c.setValue(f.length,"count")}f=d("relay-runtime").ConnectionHandler.createEdge(a,c,e,"FriendingPossibilitiesEdge");f.setValue(b,"time");f.setValue(!1,"is_seen");d("relay-runtime").ConnectionHandler.insertEdgeBefore(c,f);a=parseInt(c.getValue("count"),10);c.setValue(a+1,"count")},k=function(a){a!=null&&b("cr:1723177")!=null&&f!==!0&&b("cr:1723177").pushFriendingCometToast(a,e)};return d("CometRelay").requestSubscription(c,{onCompleted:g,onError:h,onNext:k,subscription:i,updater:j,variables:{input:{receiver_id:a},scale:d("WebPixelRatio").get()}})}g.subscribe=a}),98);
__d("LSACSExperimentCapability",[],(function(a,b,c,d,e,f){a=Object.freeze({RETRY_AFTER_TASK_SERIALIZATION_FAILURE_EXPONENTIAL_BACKOFF:0,BUMP_TOKEN_SYNC_TASK_AT_TASK_SERIALIZATION:1,INSERT_PENDING_TASK_PARENT_ROW_WHEN_NO_ACS_TOKENS_AT_TASK_INSERTION:2});f["default"]=a}),66);
__d("LSAppState",[],(function(a,b,c,d,e,f){a=Object.freeze({BACKGROUND:0,FOREGROUND:1});f["default"]=a}),66);
__d("LSBeginHandlingFireForgetTasksForQueue",[],(function(a,b,c,d,e,f){function a(){var a=arguments,b=a[a.length-1],c=[],d=[];return b.sequence([function(e){return b.sequence([function(d){return c[0]=b.createArray(),b.forEach(b.filter(b.db.table(5).fetch(),function(b){return b.queueName===a[0]}),function(a){a=a.item;return c[3]=new b.Map(),c[3].set("label",a.context),c[3].set("payload",a.taskValue),c[3].set("queue_name",a.queueName),c[3].set("task_id",a.taskId),c[3].set("failure_count",b.i64.eq(b.i64.cast([0,0]),b.i64.cast([0,0]))?void 0:b.i64.cast([0,0])),c[4]=(c[0].push(c[3]),c[0])})},function(e){return c[1]=new b.Map(),c[1].set("tasks",c[0]),c[1].set("epoch_id",void 0),c[2]=new b.Map(),c[2].set("queue_name",a[0]),c[2].set("next_sync_ms",void 0),c[2].set("work_item_type",b.i64.cast([0,5])),c[2].set("network_payload",c[1]),c[2].set("http_url_override",void 0),c[2].set("skip_realtime_gateway",!1),d[0]=c[2]}])},function(a){return b.resolve(d)}])}a.__sproc_name__="LSCoreBeginHandlingFireForgetTasksForQueueStoredProcedure";e.exports=a}),null);
__d("LSBeginHandlingFireForgetTasksForQueueStoredProcedure",["LSBeginHandlingFireForgetTasksForQueue","cr:8709"],(function(a,b,c,d,e,f,g){function a(a,b){var d=[];d[0]=b.queueName;return c("LSBeginHandlingFireForgetTasksForQueue").apply(void 0,d.concat([a]))}g["default"]=a}),98);
__d("LSForceTaskExecutionImmediately",[],(function(a,b,c,d,e,f){function a(){var a=arguments,b=a[a.length-1],c=[],d=[];return b.sequence([function(d){return b.db.table(2).fetch([[[a[0]]]]).next().then(function(d,e){var f=d.done;d=d.value;return f?0:(e=d.item,c[1]=b.i64.of_float(Date.now()),b.i64.lt(c[1],e.minTimeToSyncTimestampMs)?b.forEach(b.db.table(2).fetch([[[a[0]]]]),function(a){var c=a.update;a=a.item;return c({minTimeToSyncTimestampMs:b.i64.cast([0,0]),failureCount:b.i64.add(a.failureCount,b.i64.cast([0,1]))})}):b.resolve())})},function(a){return b.resolve(d)}])}a.__sproc_name__="LSCoreForceTaskExecutionImmediatelyStoredProcedure";e.exports=a}),null);
__d("LSRemoveBlindedTokens",[],(function(a,b,c,d,e,f){function a(){var a=arguments,b=a[a.length-1],c=[];return b.sequence([function(c){return b.forEach(b.filter(b.db.table(308).fetch(),function(b){return b.configId===a[0]}),function(a){return a["delete"]()})},function(a){return b.resolve(c)}])}a.__sproc_name__="LSAnonymousCredentialsRemoveBlindedTokensStoredProcedure";e.exports=a}),null);
__d("LSRemoveUsedTokens",[],(function(a,b,c,d,e,f){function a(){var a=arguments,b=a[a.length-1],c=[];return b.sequence([function(a){return b.forEach(b.filter(b.db.table(309).fetch(),function(a){return b.i64.le(a.redeemLimit,b.i64.cast([0,0]))}),function(a){return a["delete"]()})},function(a){return b.resolve(c)}])}a.__sproc_name__="LSAnonymousCredentialsRemoveUsedTokensStoredProcedure";e.exports=a}),null);
__d("LSGetCurrentTokenPoolState",["LSArrayGetObjectAt","LSRemoveBlindedTokens","LSRemoveUsedTokens"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(b){return d[0]=c.i64.of_float(Date.now()),d[1]=c.createArray(),c.count(c.filter(c.db.table(307).fetch(),function(b){return b.projectName===a[0]})).then(function(a){return d[2]=a})},function(b){return c.forEach(c.filter(c.db.table(307).fetch(),function(b){return b.projectName===a[0]}),function(a){a=a.item;return d[7]=a.configId,c.i64.gt(d[0],a.expirationTimestampMs)?c.forEach(c.db.table(307).fetch([[[d[7]]]]),function(a){return a["delete"]()}):c.resolve(d[8]=(d[1].push(d[7]),d[1]))})},function(a){return c.storedProcedure(b("LSRemoveUsedTokens"))},function(a){return d[3]=c.i64.cast([0,0]),d[4]=c.i64.of_int32(d[1].length),c.i64.gt(d[4],c.i64.cast([0,0]))?c.loopAsync(d[4],function(a){return d[7]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[1],d[7]).then(function(a){return a=a,d[8]=a[0],d[9]=a[1],a})},function(a){return c.count(c.filter(c.db.table(309).fetch(),function(a){return a.configId===d[8]})).then(function(a){return d[10]=a})},function(a){return d[3]=c.i64.add(d[10],d[3]),c.storedProcedure(b("LSRemoveBlindedTokens"),d[8])}])}):c.resolve()},function(a){return c.i64.gt(d[2],c.i64.cast([0,0]))?(d[7]=c.i64.of_int32(d[1].length),d[5]=c.i64.ge(d[7],c.i64.cast([0,1]))):d[5]=void 0,d[5]!==void 0?(d[5]?(c.i64.gt(d[3],c.i64.cast([0,0]))?d[8]=c.i64.cast([0,3]):d[8]=c.i64.cast([0,2]),d[7]=d[8]):d[7]=c.i64.cast([0,1]),d[6]=d[7]):d[6]=c.i64.cast([0,0]),a=[d[6],d[3]],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSAnonymousCredentialsGetCurrentTokenPoolStateStoredProcedure";e.exports=a}),null);
__d("LSIssueNextSync",["LSIssueNewTaskAndGetTaskID"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(e){return c.sequence([function(b){return c.count(c.filter(c.db.table(310).fetch(),function(b){return b.projectName===a[1]})).then(function(a){return d[0]=a})},function(e){return c.i64.gt(d[0],c.i64.cast([0,0]))&&a[3]===!0?c.resolve(0):c.sequence([function(b){return c.forEach(c.filter(c.db.table(310).fetch(),function(b){return b.projectName===a[1]}),function(a){return a["delete"]()})},function(e){return c.i64.gt(a[2],c.i64.cast([0,0]))?(d[3]=c.i64.of_float(Date.now()),d[1]=c.i64.add(d[3],a[2])):d[1]=c.i64.cast([0,0]),c.storedProcedure(b("LSIssueNewTaskAndGetTaskID"),["acs_sync","_",a[1]].join(""),c.i64.cast([0,362]),"",void 0,void 0,c.i64.cast([0,0]),c.i64.cast([0,0]),void 0,void 0,d[1],c.i64.cast([0,0])).then(function(a){return a=a,d[2]=a[0],a})},function(b){return c.db.table(310).add({taskId:d[2],projectName:a[1],maxClientTokenPoolSize:a[0]})}])}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSAnonymousCredentialsIssueNextSyncStoredProcedure";e.exports=a}),null);
__d("XPlatReactVoprf",["asyncToGeneratorRuntime","requireDeferred"],(function(a,b,c,d,e,f,g){"use strict";var h=c("requireDeferred")("LSVoprfWasm").__setRef("XPlatReactVoprf"),i=null;function a(){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(i==null){var a=(yield h.load());a=(yield a());var b=a.createCurveRistretto(),c=a.createVoprfExpTwohashdh(b);i={voprfInfo:{curvePtr:b,voprfPtr:c},voprfWasm:a}}return i});return j.apply(this,arguments)}g.loadXPlatReactVoprf=a}),98);
__d("LSVoprfBlind.nop",["XPlatReactVoprf","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){a=(yield d("XPlatReactVoprf").loadXPlatReactVoprf());b=a.voprfInfo;a=a.voprfWasm;a=a.blind(b,new Uint8Array(c));return[a.blindedElement.buffer,a.blindingFactor.buffer]});function c(b,c,d){return a.apply(this,arguments)}return c}();g["default"]=a}),98);
__d("LSVoprfCreateNonce.nop",["XPlatReactCrypto","XPlatReactVoprf","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("XPlatReactVoprf").loadXPlatReactVoprf());b=a.voprfInfo;a=a.voprfWasm;a=a.getCurveBytes(b);b=new Uint8Array(a);d("XPlatReactCrypto").getRandomValues(b);return[b.buffer]});function c(b,c){return a.apply(this,arguments)}return c}();g["default"]=a}),98);
__d("LSTaskSerializerAcsIssueNextSync",["LSBase64Encode.nop","LSGetCurrentTokenPoolState","LSIssueNextSync","LSVoprfBlind.nop","LSVoprfCreateNonce.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return c.db.table(310).fetch([[[a[0]]]]).next().then(function(a,e){var f=a.done;a=a.value;return f?(function(a){c.logger(a).mustfix(a)}("Request context for the passed task_id was not found"),f=[void 0,void 0,void 0],d[0]=f[0],d[1]=f[1],d[2]=f[2],f):(e=a.item,c.sequence([function(a){return d[9]=e.projectName,d[10]=e.maxClientTokenPoolSize,c.storedProcedure(b("LSGetCurrentTokenPoolState"),d[9]).then(function(a){return a=a,d[4]=a[0],d[5]=a[1],a})},function(a){return c.i64.eq(d[4],c.i64.cast([0,0]))||c.i64.eq(d[4],c.i64.cast([0,1]))?c.resolve((d[11]=new c.Map(),d[11].set("project_name",d[9]),d[12]=c.toJSON(d[11]),a=[d[12],c.i64.cast([0,351]),void 0],d[6]=a[0],d[7]=a[1],d[8]=a[2],a)):c.sequence([function(a){return d[11]=c.i64.of_float(Date.now()),c.islc(c.sortBy(c.filter(c.db.table(307).fetch(),function(a){return a.projectName===d[9]&&c.i64.gt(a.expirationTimestampMs,d[11])}),[["expirationTimestampMs","DESC"]]),0,c.i64.to_float(c.i64.cast([0,1]))).next().then(function(e,f){var a=e.done;e=e.value;return a?(function(a){c.logger(a).mustfix(a)}("A config for the passed project name was not found"),d[16]=new c.Map(),d[16].set("project_name",d[9]),d[16].set("max_client_token_pool_size",d[10]),d[17]=c.toJSON(d[16]),a=[d[17],c.i64.cast([0,362]),void 0],d[12]=a[0],d[13]=a[1],d[14]=a[2],a):(f=e.item,c.sequence([function(a){return d[24]=f.configId,d[16]=f.maxEvals,d[26]=f.tokenPollFrequencyMs,d[25]=f.maxClientTokenPoolSize,d[17]=c.i64.sub(d[10],d[5]),d[23]=c.i64.lt(d[16],d[17])?d[16]:d[17],d[18]=c.createArray(),c.i64.gt(d[23],c.i64.cast([0,0]))?c.loopAsync(d[23],function(a){return d[27]=a,c.sequence([function(a){return c.nativeOperation(b("LSVoprfCreateNonce.nop")).then(function(a){return a=a,d[28]=a[0],a})},function(a){return c.blobs.neq(d[28],void 0)?c.sequence([function(a){return c.nativeOperation(b("LSVoprfBlind.nop"),d[28]).then(function(a){return a=a,d[29]=a[0],d[30]=a[1],a})},function(a){return c.blobs.neq(d[29],void 0)?c.blobs.neq(d[30],void 0)?c.sequence([function(a){return d[31]=c.i64.cast([-1,4294967295]),c.db.table(308).peekNextAutoIncrementId().then(function(a){return d[31]=a})},function(a){return c.db.table(308).add({tokenId:void 0,blindedNonce:d[29],blindingFactor:d[30],nonce:d[28],configId:d[24]})},function(a){return c.db.table(308).fetch([[[d[31]]]]).next().then(function(b,e){var a=b.done;b=b.value;return a?d[32]=c.i64.cast([-1,4294967295]):(e=b.item,d[32]=e.tokenId)})},function(a){return c.i64.eq(d[32],c.i64.cast([-1,4294967295]))?c.sequence([function(a){return c.islc(c.db.table(308).fetchDesc([[[{gt:c.i64.cast([0,0])}]]]),0,c.i64.to_float(c.i64.cast([0,1]))).next().then(function(b,e){var a=b.done;b=b.value;return a?d[37]=c.i64.cast([-1,4294967295]):(e=b.item,d[37]=e.tokenId)})},function(a){return d[34]=d[37]}]):c.resolve(d[34]=d[32])},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[29]).then(function(a){return a=a,d[35]=a[0],a})},function(a){return d[36]=new c.Map(),d[36].set("id",d[34]),d[36].set("data",d[35]==null?"":d[35]),d[37]=(d[18].push(d[36]),d[18])}]):c.resolve():c.resolve()}]):c.resolve()}])}):c.resolve()},function(a){return d[19]=c.i64.of_int32(d[18].length),c.i64.gt(d[19],c.i64.cast([0,0]))?c.resolve((d[27]=new c.Map(),d[27].set("project_name",d[9]),d[27].set("config_id",d[24]),d[27].set("blinded_nonces",d[18]),d[28]=c.toJSON(d[27]),a=[d[28],c.i64.cast([0,354]),void 0],d[20]=a[0],d[21]=a[1],d[22]=a[2],a)):c.sequence([function(a){return c.i64.neq(d[26],void 0)?c.sequence([function(a){return c.i64.neq(d[25],void 0)?c.sequence([function(a){return function(a){c.logger(a).info(a)}(["Already have the max number of tokens. Scheduling next ACS token sync locally for project: ",d[9]].join("")),c.storedProcedure(b("LSIssueNextSync"),d[25],d[9],d[26],!1)},function(a){return a=[void 0,void 0,void 0],d[30]=a[0],d[31]=a[1],d[32]=a[2],a}]):c.resolve((function(a){c.logger(a).info(a)}(["token_poll_frequency is nonnull but max_client_token_pool_size is null. Already have the max number of tokens. Scheduling the next ACS token sync for project: ",d[9]].join("")),d[33]=new c.Map(),d[33].set("project_name",d[9]),d[33].set("max_client_token_pool_size",d[10]),d[34]=c.toJSON(d[33]),a=[d[34],c.i64.cast([0,362]),void 0],d[30]=a[0],d[31]=a[1],d[32]=a[2],a))},function(a){return a=[d[30],d[31],d[32]],d[27]=a[0],d[28]=a[1],d[29]=a[2],a}]):c.resolve((function(a){c.logger(a).info(a)}(["Already have the max number of tokens. Scheduling the next ACS token sync for project: ",d[9]].join("")),d[30]=new c.Map(),d[30].set("project_name",d[9]),d[30].set("max_client_token_pool_size",d[10]),d[31]=c.toJSON(d[30]),a=[d[31],c.i64.cast([0,362]),void 0],d[27]=a[0],d[28]=a[1],d[29]=a[2],a))},function(a){return a=[d[27],d[28],d[29]],d[20]=a[0],d[21]=a[1],d[22]=a[2],a}])},function(a){return a=[d[20],d[21],d[22]],d[12]=a[0],d[13]=a[1],d[14]=a[2],a}]))})},function(a){return a=[d[12],d[13],d[14]],d[6]=a[0],d[7]=a[1],d[8]=a[2],a}])},function(a){return a=[d[6],d[7],d[8]],d[0]=a[0],d[1]=a[1],d[2]=a[2],a}]))})},function(a){return a=[d[0],d[1],d[2]],e[0]=a[0],e[1]=a[1],e[2]=a[2],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSAnonymousCredentialsTaskSerializerAcsIssueNextSyncStoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerE2eeMessageIntegrityCheckV2",[],(function(a,b,c,d,e,f){function a(){var a,b=arguments,c=b[b.length-1],d=[];return a=[void 0,c.i64.cast([0,705]),void 0],d[0]=a[0],d[1]=a[1],d[2]=a[2],a,c.resolve(d)}a.__sproc_name__="LSEncryptedBackupsTaskSerializerE2eeMessageIntegrityCheckV2StoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerE2eeMetadataThreadIntegrityCheck",[],(function(a,b,c,d,e,f){function a(){var a,b=arguments,c=b[b.length-1],d=[];return a=[void 0,c.i64.cast([0,700]),void 0],d[0]=a[0],d[1]=a[1],d[2]=a[2],a,c.resolve(d)}a.__sproc_name__="LSE2EEMessagingMetadataMailboxTaskSerializerE2eeMetadataThreadIntegrityCheckStoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerEncryptedBackupAction",[],(function(a,b,c,d,e,f){function a(){var a,b=arguments,c=b[b.length-1],d=[];return a=[void 0,c.i64.cast([0,319]),void 0],d[0]=a[0],d[1]=a[1],d[2]=a[2],a,c.resolve(d)}a.__sproc_name__="LSEncryptedBackupsTaskSerializerEncryptedBackupActionStoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerEncryptedBackupsLoopingUpload",["LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(a){return c.sequence([function(a){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][taskSerializerEncryptedBackupsLoopingUpload] Beginning execution."),d[1]=c.i64.of_float(Date.now()),function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][LSEncryptedBackupsTaskSerializerEncryptedBackupsLoopingUploadStoredProcedure] LSEncryptedBackupsLoopingUploadPayloadsTable table not found"),d[2]=c.createArray(),void 0!==void 0?d[9]=(d[2].push(void 0),d[2]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"LSEncryptedBackupsTaskSerializerEncryptedBackupsLoopingUploadStoredProcedure","LSEncryptedBackupsLoopingUploadPayloadsTable table not found",d[2],c.i64.cast([0,3]))},function(a){return d[3]=c.i64.of_float(Date.now()),d[4]=c.i64.random(),d[6]="Finishing execution. Execution time: ",d[7]=c.i64.to_string(c.i64.sub(d[3],d[0])),d[8]=" ms",d[5]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][taskSerializerEncryptedBackupsLoopingUpload] ",d[5],d[6],d[5],d[7],d[5],d[8]].join("")),c.i64.eq(c.i64.mod_(d[4],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[9]=",",d[10]=c.createArray(),void 0!==void 0?d[11]=(d[10].push(void 0),d[10]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"taskSerializerEncryptedBackupsLoopingUpload",[d[6],d[9],d[7],d[9],d[8]].join(""),d[10],c.i64.cast([0,4]))):c.resolve()},function(a){return a=['{"request_id":"unknown","upload_type":"FBN","payload":{"error_code":2,"operation":"","error_message":"","__typename":"MPSUploadFailurePayload"}}',c.i64.cast([0,50043]),void 0],e[0]=a[0],e[1]=a[1],e[2]=a[2],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsTaskSerializerEncryptedBackupsLoopingUploadStoredProcedure";e.exports=a}),null);
__d("LSQueryLocalPersistenceStoreForBackup.nop",["Promise","ReQL","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){c=(yield d("ReQL").toArrayAsync(d("ReQL").fromTableDescending(a.local_message_persistence_store).filter(function(a){var b=a.offlineThreadingId;a=a.threadId;return a===e&&f===b})));if(c.length===0)return(h||(h=b("Promise"))).resolve([void 0,void 0,!1]);a=c[0];return(h||(h=b("Promise"))).resolve([a.messagePayload,a.messageTimestampMs,!1])});function c(b,c,d,e){return a.apply(this,arguments)}return c}();g["default"]=a}),98);
__d("LSQueryLocalPersistenceStoreSupplementalForBackup.nop",["Promise","ReQL","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f,g){c=(yield d("ReQL").firstAsync(d("ReQL").fromTableDescending(a.local_message_persistence_store_supplemental).filter(function(a){var b=a.supplementalKey,c=a.threadId;a=a.toplevelOfflineThreadingId;return c===e&&a===f&&b===g})));return c==null?(h||(h=b("Promise"))).resolve([void 0,void 0]):(h||(h=b("Promise"))).resolve([c.messagePayload,c.messageTimestampMs])});function c(b,c,d,e,f){return a.apply(this,arguments)}return c}();g["default"]=a}),98);
__d("isInstamadilloOpenEB",["qex"],(function(a,b,c,d,e,f,g){"use strict";function a(){return c("qex")._("890")===!0}g["default"]=a}),98);
__d("LSQueryLocalPersistenceStoreTagsForBackup.nop",["LSVec","Promise","ReQL","asyncToGeneratorRuntime","isInstamadilloEB","isInstamadilloOpenEB"],(function(a,b,c,d,e,f,g){"use strict";var h,i=":";a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){if(!c("isInstamadilloEB")()&&!c("isInstamadilloOpenEB")())return(h||(h=b("Promise"))).resolve([c("LSVec").ofArray([])]);e=(yield d("ReQL").firstAsync(d("ReQL").fromTableDescending(a.local_message_persistence_store_tag_index.index("offlineThreadingId")).getKeyRange(g,f)));if(e==null)return(h||(h=b("Promise"))).resolve([c("LSVec").ofArray([])]);a=e.tag;return(h||(h=b("Promise"))).resolve([c("LSVec").ofArray(a.split(i))])});function e(b,c,d,e){return a.apply(this,arguments)}return e}();g["default"]=a}),98);
__d("LSLoadUnencryptedProtobufWithInputs",["LSBase64Encode.nop","LSGetBlobFromString.nop","LSLogMebClientEvent.nop","LSQueryLocalPersistenceStoreForBackup.nop","LSQueryLocalPersistenceStoreSupplementalForBackup.nop","LSQueryLocalPersistenceStoreTagsForBackup.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][loadUnencryptedProtobufWithInputs] Beginning execution."),d[1]=c.i64.of_float(Date.now()),!1===!0?c.resolve((function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure] Returning error REQUIRED_COLUMN_NOT_PRESENT_ON_CLIENT"),d[10]=new c.Map(),d[10].set("error_code",c.i64.cast([-1,4294967293])),d[10].set("stored_procedure","LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure"),d[10].set("error_message",""),e=[void 0,d[10]],d[2]=e[0],d[3]=e[1],e)):c.sequence([function(e){return c.i64.eq(a[0],c.i64.cast([0,1]))?c.sequence([function(e){return c.nativeOperation(b("LSQueryLocalPersistenceStoreForBackup.nop"),a[1],a[2]).then(function(a){return a=a,d[12]=a[0],d[13]=a[1],d[14]=a[2],a})},function(e){return c.nativeOperation(b("LSQueryLocalPersistenceStoreTagsForBackup.nop"),a[1],a[2]).then(function(a){return a=a,d[15]=a[0],a})},function(e){return c.blobs.neq(d[12],void 0)?c.sequence([function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[12]).then(function(a){return a=a,d[18]=a[0],a})},function(b){return d[18]!==void 0?(d[15]!==void 0?(d[23]=new c.Map(),d[23].set("message_tags",d[15]),d[24]=new c.Map(),d[28]="message_tags",d[25]=d[23].get(d[28]),d[23],d[25]?d[26]=!1:d[26]=!0,d[26]?0:d[24].set(d[28],d[25]),d[27]=c.toJSON(d[24]),d[21]=d[27]):d[21]=void 0,d[22]=new c.Map(),d[22].set("backup_action",a[0]),d[22].set("protobuf_encrypted",d[18]),d[22].set("supplemental_data_encrypted",void 0),d[22].set("timestamp_ms",a[4]),d[22].set("message_tags",d[21]),b=[d[22],void 0],d[19]=b[0],d[20]=b[1],b):(function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure] Returning error PROTOBUF_FORMATTING_FAILED"),d[21]=new c.Map(),d[21].set("error_code",c.i64.cast([0,68])),d[21].set("stored_procedure","LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure"),d[21].set("error_message",""),b=[void 0,d[21]],d[19]=b[0],d[20]=b[1],b),b=[d[19],d[20]],d[16]=b[0],d[17]=b[1],b}]):c.resolve((d[14]?(function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure] Returning error PROTOBUF_ALREADY_DELETED"),d[20]=new c.Map(),d[20].set("error_code",c.i64.cast([0,70])),d[20].set("stored_procedure","LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure"),d[20].set("error_message",""),e=[void 0,d[20]],d[18]=e[0],d[19]=e[1],e):(function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure] Returning error PROTOBUF_NOT_FOUND_IN_TOPLEVEL_TABLE"),d[20]=new c.Map(),d[20].set("error_code",c.i64.cast([0,63])),d[20].set("stored_procedure","LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure"),d[20].set("error_message",""),e=[void 0,d[20]],d[18]=e[0],d[19]=e[1],e),e=[d[18],d[19]],d[16]=e[0],d[17]=e[1],e))},function(a){return a=[d[16],d[17]],d[10]=a[0],d[11]=a[1],a}]):c.sequence([function(e){return c.i64.eq(a[0],c.i64.cast([0,2]))?c.sequence([function(e){return a[3]!==void 0?c.sequence([function(e){return c.nativeOperation(b("LSQueryLocalPersistenceStoreSupplementalForBackup.nop"),a[1],a[2],a[3]).then(function(a){return a=a,d[16]=a[0],d[17]=a[1],a})},function(e){return c.nativeOperation(b("LSQueryLocalPersistenceStoreTagsForBackup.nop"),a[1],a[2]).then(function(a){return a=a,d[18]=a[0],a})},function(e){return c.blobs.neq(d[16],void 0)?c.sequence([function(e){return c.nativeOperation(b("LSGetBlobFromString.nop"),a[3]).then(function(a){return a=a,d[21]=a[0],a})},function(e){return c.blobs.neq(d[21],void 0)?c.sequence([function(a){return d[24]=new c.Map(),d[24].set("sk_ciphertext",d[21]),d[24].set("sk_hash",d[21]),c.nativeOperation(b("LSBase64Encode.nop"),d[16]).then(function(a){return a=a,d[25]=a[0],a})},function(b){return d[25]!==void 0?(d[18]!==void 0?(d[30]=new c.Map(),d[30].set("message_tags",d[18]),d[31]=new c.Map(),d[35]="message_tags",d[32]=d[30].get(d[35]),d[30],d[32]?d[33]=!1:d[33]=!0,d[33]?0:d[31].set(d[35],d[32]),d[34]=c.toJSON(d[31]),d[28]=d[34]):d[28]=void 0,d[29]=new c.Map(),d[29].set("backup_action",a[0]),d[29].set("protobuf_encrypted",d[25]),d[29].set("supplemental_data_encrypted",d[24]),d[29].set("timestamp_ms",a[4]),d[29].set("message_tags",d[28]),b=[d[29],void 0],d[26]=b[0],d[27]=b[1],b):(function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure] Returning error PROTOBUF_FORMATTING_FAILED"),d[28]=new c.Map(),d[28].set("error_code",c.i64.cast([0,68])),d[28].set("stored_procedure","LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure"),d[28].set("error_message",""),b=[void 0,d[28]],d[26]=b[0],d[27]=b[1],b),b=[d[26],d[27]],d[22]=b[0],d[23]=b[1],b}]):c.resolve((function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure] Returning error SUPPLEMENTAL_FORMATTING_FAILED"),d[24]=new c.Map(),d[24].set("error_code",c.i64.cast([0,69])),d[24].set("stored_procedure","LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure"),d[24].set("error_message",""),e=[void 0,d[24]],d[22]=e[0],d[23]=e[1],e))},function(a){return a=[d[22],d[23]],d[19]=a[0],d[20]=a[1],a}]):c.resolve((function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure] Returning error PROTOBUF_NOT_FOUND_IN_SUPPLEMENTAL_TABLE"),d[21]=new c.Map(),d[21].set("error_code",c.i64.cast([0,64])),d[21].set("stored_procedure","LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure"),d[21].set("error_message",""),e=[void 0,d[21]],d[19]=e[0],d[20]=e[1],e))},function(a){return a=[d[19],d[20]],d[14]=a[0],d[15]=a[1],a}]):c.resolve((function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure] Returning error SUPPLEMENTAL_KEY_NOT_SET_IN_CONTEXT_TABLE"),d[16]=new c.Map(),d[16].set("error_code",c.i64.cast([0,65])),d[16].set("stored_procedure","LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure"),d[16].set("error_message",""),e=[void 0,d[16]],d[14]=e[0],d[15]=e[1],e))},function(a){return a=[d[14],d[15]],d[12]=a[0],d[13]=a[1],a}]):c.resolve((c.i64.eq(a[0],c.i64.cast([0,3]))?(d[16]=new c.Map(),d[16].set("backup_action",a[0]),d[16].set("protobuf_encrypted",void 0),d[16].set("supplemental_data_encrypted",void 0),d[16].set("timestamp_ms",a[4]),d[16].set("message_tags",void 0),e=[d[16],void 0],d[14]=e[0],d[15]=e[1],e):(function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure] Returning error INVALID_BACKUP_OPERATION"),d[16]=new c.Map(),d[16].set("error_code",c.i64.cast([-1,4294967289])),d[16].set("stored_procedure","LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure"),d[16].set("error_message",""),e=[void 0,d[16]],d[14]=e[0],d[15]=e[1],e),e=[d[14],d[15]],d[12]=e[0],d[13]=e[1],e))},function(a){return a=[d[12],d[13]],d[10]=a[0],d[11]=a[1],a}])},function(a){return a=[d[10],d[11]],d[2]=a[0],d[3]=a[1],a}])},function(a){return d[4]=c.i64.of_float(Date.now()),d[5]=c.i64.random(),d[7]="Finishing execution. Execution time: ",d[8]=c.i64.to_string(c.i64.sub(d[4],d[0])),d[9]=" ms",d[6]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][loadUnencryptedProtobufWithInputs] ",d[6],d[7],d[6],d[8],d[6],d[9]].join("")),c.i64.eq(c.i64.mod_(d[5],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[10]=",",d[11]=c.createArray(),void 0!==void 0?d[12]=(d[11].push(void 0),d[11]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"loadUnencryptedProtobufWithInputs",[d[7],d[10],d[8],d[10],d[9]].join(""),d[11],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[2],d[3]],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsLoadUnencryptedProtobufWithInputsStoredProcedure";e.exports=a}),null);
__d("LSLoadUnencryptedProtobufBackupSerializedPayloadData",["LSLoadUnencryptedProtobufWithInputs","LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(b){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][loadUnencryptedProtobufBackupSerializedPayloadData] Beginning execution."),d[1]=c.i64.of_float(Date.now()),d[19]=c.i64.mul(d[1],c.i64.cast([0,1e6])),c.db.table(2).fetch([[[a[0]]]]).next().then(function(b,e){var f=b.done;b=b.value;return f?(d[23]=c.i64.of_float(Date.now()),f=[a[0],void 0,void 0,void 0,void 0,c.i64.sub(c.i64.mul(d[23],c.i64.cast([0,1e6])),d[19]),void 0],d[2]=f[0],d[3]=f[1],d[4]=f[2],d[5]=f[3],d[6]=f[4],d[7]=f[5],d[8]=f[6],f):(e=b.item,d[23]=c.i64.of_float(Date.now()),f=[a[0],e.queueName,e.enqueueTimestampMs,e.priority,e.firstExecutedTimestampMs,c.i64.sub(c.i64.mul(d[23],c.i64.cast([0,1e6])),d[19]),void 0],d[2]=f[0],d[3]=f[1],d[4]=f[2],d[5]=f[3],d[6]=f[4],d[7]=f[5],d[8]=f[6],f)})},function(e){return d[10]=new c.Map(),d[10].set("task_id",d[2]),d[10].set("queue_name",d[3]),d[10].set("enqueue_timestamp_ms",d[4]),d[10].set("priority",d[5]),d[10].set("first_executed_timestamp_ms",d[6]),d[10].set("execution_time_ns",d[7]),d[10].set("echo_encoding_execution_time_ns",d[8]),d[11]=new c.Map(),d[11].set("task_metadata",d[10]),d[11].set("action_type",void 0),d[11].set("content_type",void 0),d[11].set("identifiers",void 0),d[11].set("identifiers_v2",void 0),d[11].set("task_creation_source",void 0),d[11].set("message_payload_source",c.i64.cast([0,2])),c.filter(c.db.table(305).fetch(),function(b){return c.i64.eq(b.pendingBackupTaskId,a[0])}).next().then(function(e,f){var g=e.done;e=e.value;return g?(d[23]=new c.Map(),d[23].set("error_code",c.i64.cast([0,5])),d[23].set("stored_procedure","LSEncryptedBackupsLoadUnencryptedProtobufBackupSerializedPayloadDataStoredProcedure"),d[23].set("error_message",""),g=[void 0,d[23],d[11]],d[12]=g[0],d[13]=g[1],d[14]=g[2],g):(f=e.item,c.sequence([function(b){return d[41]=f.actThreadId,d[42]=f.toplevelOfflineThreadingId,d[24]=f.messageTimestampMs,d[23]=new c.Map(),d[23].set("backup_id","openEbUploadGenericBackupId"),d[23].set("act_thread_id",d[41]),d[23].set("server_thread_id",d[41]),d[23].set("timestamp",c.i64.to_string(d[24])),d[23].set("otid",d[42]),d[25]=new c.Map(),d[25].set("backup_id","openEbUploadGenericBackupId"),d[25].set("act_thread_id",d[41]),d[25].set("timestamp",c.i64.to_string(d[24])),d[25].set("otid",d[42]),c.db.table(2).fetch([[[a[0]]]]).next().then(function(e,f){var b=e.done;e=e.value;return b?(d[43]=c.i64.of_float(Date.now()),b=[a[0],void 0,void 0,void 0,void 0,c.i64.sub(c.i64.mul(d[43],c.i64.cast([0,1e6])),d[19]),void 0],d[26]=b[0],d[27]=b[1],d[28]=b[2],d[29]=b[3],d[30]=b[4],d[31]=b[5],d[32]=b[6],b):(f=e.item,d[43]=c.i64.of_float(Date.now()),b=[a[0],f.queueName,f.enqueueTimestampMs,f.priority,f.firstExecutedTimestampMs,c.i64.sub(c.i64.mul(d[43],c.i64.cast([0,1e6])),d[19]),void 0],d[26]=b[0],d[27]=b[1],d[28]=b[2],d[29]=b[3],d[30]=b[4],d[31]=b[5],d[32]=b[6],b)})},function(a){return d[34]=new c.Map(),d[34].set("task_id",d[26]),d[34].set("queue_name",d[27]),d[34].set("enqueue_timestamp_ms",d[28]),d[34].set("priority",d[29]),d[34].set("first_executed_timestamp_ms",d[30]),d[34].set("execution_time_ns",d[31]),d[34].set("echo_encoding_execution_time_ns",d[32]),d[35]=new c.Map(),d[35].set("task_metadata",d[34]),d[35].set("action_type",void 0),d[35].set("content_type",void 0),d[35].set("identifiers",void 0),d[35].set("identifiers_v2",d[25]),d[35].set("task_creation_source",void 0),d[35].set("message_payload_source",c.i64.cast([0,2])),c.storedProcedure(b("LSLoadUnencryptedProtobufWithInputs"),f.backupAction,d[41],d[42],f.supplementalKey,d[24],d[23]).then(function(a){return a=a,d[36]=a[0],d[37]=a[1],a})},function(a){return d[36]!==void 0?(d[43]=new c.Map(),d[43].set("unencrypted_protobuf_backup_payload",d[36]),d[43].set("message_identifiers",d[23]),d[43].set("attachment_backup_payload",f.attachmentPayload),d[43].set("sender_id",f.senderId),d[43].set("extra_data_for_eb_upload",void 0),a=[d[43],void 0,d[35]],d[38]=a[0],d[39]=a[1],d[40]=a[2],a):(a=[void 0,d[37],d[35]],d[38]=a[0],d[39]=a[1],d[40]=a[2],a),a=[d[38],d[39],d[40]],d[12]=a[0],d[13]=a[1],d[14]=a[2],a}]))})},function(a){return d[16]=c.i64.of_float(Date.now()),d[17]=c.i64.random(),d[20]="Finishing execution. Execution time: ",d[21]=c.i64.to_string(c.i64.sub(d[16],d[0])),d[22]=" ms",d[18]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][loadUnencryptedProtobufBackupSerializedPayloadData] ",d[18],d[20],d[18],d[21],d[18],d[22]].join("")),c.i64.eq(c.i64.mod_(d[17],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[23]=",",d[24]=c.createArray(),void 0!==void 0?d[25]=(d[24].push(void 0),d[24]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"loadUnencryptedProtobufBackupSerializedPayloadData",[d[20],d[23],d[21],d[23],d[22]].join(""),d[24],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[12],d[13],d[14]],e[0]=a[0],e[1]=a[1],e[2]=a[2],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsLoadUnencryptedProtobufBackupSerializedPayloadDataStoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerEncryptedBackupsOpenUpload",["LSArrayGetObjectAt","LSBase64Encode.nop","LSDeserializeFromJsonIntoDictionaryV2.nop","LSLoadUnencryptedProtobufBackupSerializedPayloadData","LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][taskSerializerEncryptedBackupsOpenUpload] Beginning execution."),d[1]=c.i64.of_float(Date.now()),c.storedProcedure(b("LSLoadUnencryptedProtobufBackupSerializedPayloadData"),a[0]).then(function(a){return a=a,d[2]=a[0],d[3]=a[1],d[4]=a[2],a})},function(a){return d[2]!==void 0?c.sequence([function(a){return d[15]=d[2].get("message_identifiers"),d[2],d[16]=d[2].get("unencrypted_protobuf_backup_payload"),d[2],d[17]=d[15].get("server_thread_id"),d[15],d[18]=d[15].get("timestamp"),d[15],d[19]=d[15].get("otid"),d[15],d[20]=d[15].get("act_thread_id"),d[15],d[21]=new c.Map(),d[21].set("server_thread_key",d[17]),d[21].set("timestamp",d[18]),d[21].set("otid",d[19]),d[21].set("wa_thread_id",c.i64.from_string(d[20])),d[22]=d[16].get("message_tags"),d[16],d[23]=new c.Map(),d[23].set("message_identifiers",d[21]),d[24]=d[16].get("supplemental_data_encrypted"),d[16],d[24]!==void 0?c.sequence([function(a){return d[30]=d[16].get("protobuf_encrypted"),d[16],d[31]=d[16].get("backup_action"),d[16],d[32]=d[16].get("timestamp_ms"),d[16],d[33]=d[24].get("sk_ciphertext"),d[24],c.nativeOperation(b("LSBase64Encode.nop"),d[33]).then(function(a){return a=a,d[34]=a[0],a})},function(a){return d[35]=d[24].get("sk_hash"),d[24],c.nativeOperation(b("LSBase64Encode.nop"),d[35]).then(function(a){return a=a,d[36]=a[0],a})},function(a){return d[37]=new c.Map(),d[37].set("supplementary_data_key",void 0),d[37].set("encrypted_protobuf",d[30]),d[37].set("key_value_backup_action",d[31]),d[37].set("protobuf_ts_ms",d[32]),d[37].set("supplemental_key_ciphertext",d[34]),d[37].set("supplemental_key_hash",d[36]),d[37].set("message_tags",d[22]),d[25]=d[37]}]):c.resolve((d[30]=d[16].get("protobuf_encrypted"),d[16],d[31]=d[16].get("backup_action"),d[16],d[32]=d[16].get("timestamp_ms"),d[16],d[33]=new c.Map(),d[33].set("supplementary_data_key",void 0),d[33].set("encrypted_protobuf",d[30]),d[33].set("key_value_backup_action",d[31]),d[33].set("protobuf_ts_ms",d[32]),d[33].set("message_tags",d[22]),d[25]=d[33]))},function(a){return d[23].set("key_value_backup_unencrypted_payload",d[25]),d[26]=d[2].get("sender_id"),d[2],d[23].set("sender_id",d[26]),d[27]=d[2].get("attachment_backup_payload"),d[2],d[27]!==void 0?d[23].set("attachment_backup_payload",d[27]):0,d[28]=d[2].get("extra_data_for_eb_upload"),d[2],d[28]!==void 0?c.sequence([function(a){return c.nativeOperation(b("LSDeserializeFromJsonIntoDictionaryV2.nop"),d[28]).then(function(a){return a=a,d[30]=a[0],a})},function(a){return d[31]=new c.Map(),d[35]="ttd",d[32]=d[30].get(d[35]),d[30],d[32]?d[33]=!1:d[33]=!0,d[33]?c.resolve():c.sequence([function(a){return d[32]?d[36]=!1:d[36]=!0,d[36]?c.resolve(d[37]=void 0):c.sequence([function(a){return d[38]=new c.Map(),d[41]="message_tags",d[39]=d[32].get(d[41]),d[32],d[39]?d[40]=!1:d[40]=!0,d[40]?c.resolve():c.sequence([function(a){return d[42]=c.createArray(),d[43]=c.i64.of_int32(d[39].length),c.i64.gt(d[43],c.i64.cast([0,0]))?c.loopAsync(d[43],function(a){return d[44]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[39],d[44]).then(function(a){return a=a,d[45]=a[0],d[46]=a[1],a})},function(a){return d[47]=(d[42].push(d[45]),d[42])}])}):c.resolve()},function(a){return d[38].set(d[41],d[42])}])},function(a){return d[37]=d[38]}])},function(a){return d[31].set(d[35],d[37])}])},function(a){return d[34]=d[31].get("ttd"),d[31],d[34]!==void 0?(d[36]=new c.Map(),d[40]="message_tags",d[37]=d[34].get(d[40]),d[34],d[37]?d[38]=!1:d[38]=!0,d[38]?0:d[36].set(d[40],d[37]),d[39]=c.toJSON(d[36]),d[23].set("tags_to_delete",d[39])):0}]):c.resolve()},function(a){return d[29]=c.toJSON(d[23]),a=[d[29],void 0,d[4]],d[5]=a[0],d[6]=a[1],d[7]=a[2],a}]):c.resolve((d[3]?d[15]=!1:d[15]=!0,d[15]?(a=[void 0,void 0,d[4]],d[16]=a[0],d[17]=a[1],d[18]=a[2],a):(a=[void 0,d[3],d[4]],d[16]=a[0],d[17]=a[1],d[18]=a[2],a),a=[d[16],d[17],d[18]],d[5]=a[0],d[6]=a[1],d[7]=a[2],a))},function(a){return d[15]=new c.Map(),d[16]=d[15].set("success",d[5]),d[17]=d[15].set("failure",d[6]),d[18]=d[15].set("context",d[7]),d[19]=c.toJSON(d[15]),d[8]=d[19],d[9]=c.i64.of_float(Date.now()),d[10]=c.i64.random(),d[12]="Finishing execution. Execution time: ",d[13]=c.i64.to_string(c.i64.sub(d[9],d[0])),d[14]=" ms",d[11]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][taskSerializerEncryptedBackupsOpenUpload] ",d[11],d[12],d[11],d[13],d[11],d[14]].join("")),c.i64.eq(c.i64.mod_(d[10],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[15]=",",d[16]=c.createArray(),void 0!==void 0?d[17]=(d[16].push(void 0),d[16]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"taskSerializerEncryptedBackupsOpenUpload",[d[12],d[15],d[13],d[15],d[14]].join(""),d[16],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[8],c.i64.cast([0,50048])],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsTaskSerializerEncryptedBackupsOpenUploadStoredProcedure";e.exports=a}),null);
__d("LSGetOpenEpochKeys",["LSAppendDataTraceAddon","LSArrayGetObjectAt","LSCreateDataTrace","LSCreateDataTraceID.nop","LSDeleteBackupOnClient","LSIsMobileClient","LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(a){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsGetOpenEpochKeysStoredProcedure] Beginning execution."),c.islc(c.filter(c.db.table(168).fetch(),function(a){return c.i64.eq(a.authorityLevel,c.i64.cast([0,80]))&&c.i64.eq(a.backupTenancy,c.i64.cast([0,2]))}),0,c.i64.to_float(c.i64.cast([0,1]))).next().then(function(a,b){b=a.done;a=a.value;return b?d[1]=!1:(a.item,d[1]=!0)})},function(a){return d[1]?d[3]=c.i64.or_(c.i64.cast([0,90]),c.i64.cast([0,128])):d[3]=c.i64.cast([0,90]),c.sequence([function(a){return c.nativeOperation(b("LSCreateDataTraceID.nop")).then(function(a){return a=a,d[20]=a[0],a})},function(a){return c.sequence([function(a){return d[24]="EncryptedBackups MCD Trace ID",d[25]=c.i64.to_string(d[3]),d[23]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][MEBTraceUtils] ",d[23],d[24],d[23],d[25]].join("")),c.resolve()},function(a){return c.storedProcedure(b("LSCreateDataTrace"),d[20],void 0,void 0,"get_open_epoch_keys",d[3])}])},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[21]=a[0],a})},function(a){return d[21]?d[22]=!0:d[22]=!1,d[22]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[23]=c.createArray(),void 0!==void 0?d[24]=(d[23].push(void 0),d[23]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[23],c.i64.cast([0,3]))):c.resolve()},function(a){return d[4]=d[20]}])},function(b){return d[15]="Querying latest epoch keys with authority level: ",a[0]?d[5]="OPTIMISTIC":d[5]="AUTHORITATIVE",d[6]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][LSEncryptedBackupsGetOpenEpochKeysStoredProcedure] ",d[6],d[15],d[6],d[5]].join("")),c.resolve()},function(e){return a[0]?d[7]="OPTIMISTIC":d[7]="AUTHORITATIVE",c.sequence([function(a){return d[4]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[4],c.i64.cast([0,2842]),c.i64.cast([0,2]),void 0,d[7]):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[20]=a[0],a})},function(a){return d[20]?d[21]=!0:d[21]=!1,d[21]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[22]=c.createArray(),void 0!==void 0?d[23]=(d[22].push(void 0),d[22]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[22],c.i64.cast([0,3]))):c.resolve()}])},function(a){return c.sequence([function(a){return d[4]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[4],c.i64.cast([0,2844]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[20]=a[0],a})},function(a){return d[20]?d[21]=!0:d[21]=!1,d[21]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[22]=c.createArray(),void 0!==void 0?d[23]=(d[22].push(void 0),d[22]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[22],c.i64.cast([0,3]))):c.resolve()}])},function(b){return d[8]=c.createArray(),c.forEach(c.filter(c.db.table(169).fetch(),function(b){return a[0]||c.i64.eq(b.authorityLevel,c.i64.cast([0,80]))}),function(a){a=a.item;return d[20]=(d[8].push(c.blobs.to_string(a.epochAnonIdBlob)),d[8])})},function(a){return d[9]=c.i64.of_int32(d[8].length),c.i64.gt(d[9],c.i64.cast([0,0]))?c.sequence([function(a){return d[20]=c.i64.of_int32(d[8].length),c.sequence([function(a){return d[4]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[4],c.i64.cast([0,2845]),c.i64.cast([0,2]),void 0,c.i64.to_string(d[20])):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[25]=a[0],a})},function(a){return d[25]?d[26]=!0:d[26]=!1,d[26]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[27]=c.createArray(),void 0!==void 0?d[28]=(d[27].push(void 0),d[27]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[27],c.i64.cast([0,3]))):c.resolve()}])},function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[8],c.i64.cast([0,0])).then(function(a){return a=a,d[21]=a[0],d[22]=a[1],a})},function(a){return d[23]=d[21],d[24]=c.i64.of_int32(d[8].length),c.i64.gt(d[24],c.i64.cast([0,0]))?c.loopAsync(d[24],function(a){return d[25]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[8],d[25]).then(function(a){return a=a,d[26]=a[0],d[27]=a[1],a})},function(a){return c.i64.eq([0,d[23].length],[0,d[26].length])?(d[23]===d[26]?d[29]=d[23]:(d[23]>d[26]?d[30]=d[23]:d[30]=d[26],d[29]=d[30]),d[28]=d[29]):(c.i64.gt([0,d[23].length],[0,d[26].length])?d[29]=d[23]:d[29]=d[26],d[28]=d[29]),d[23]=d[28]}])}):c.resolve()},function(a){return d[10]=d[23]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][LSEncryptedBackupsGetOpenEpochKeysStoredProcedure] Epoch anon ID list is empty."),d[20]=c.createArray(),void 0!==void 0?d[21]=(d[20].push(void 0),d[20]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"LSEncryptedBackupsGetOpenEpochKeysStoredProcedure","Epoch anon ID list is empty.",d[20],c.i64.cast([0,3]))},function(a){return c.sequence([function(a){return d[4]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[4],c.i64.cast([0,2846]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[21]=a[0],a})},function(a){return d[21]?d[22]=!0:d[22]=!1,d[22]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[23]=c.createArray(),void 0!==void 0?d[24]=(d[23].push(void 0),d[23]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[23],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[10]=void 0}])},function(a){return d[10]!==void 0?c.sequence([function(a){return d[4]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[4],c.i64.cast([0,2863]),c.i64.cast([0,2]),void 0,d[10]):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[20]=a[0],a})},function(a){return d[20]?d[21]=!0:d[21]=!1,d[21]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[22]=c.createArray(),void 0!==void 0?d[23]=(d[22].push(void 0),d[22]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[22],c.i64.cast([0,3]))):c.resolve()}]):c.sequence([function(a){return d[4]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[4],c.i64.cast([0,2864]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[20]=a[0],a})},function(a){return d[20]?d[21]=!0:d[21]=!1,d[21]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[22]=c.createArray(),void 0!==void 0?d[23]=(d[22].push(void 0),d[22]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[22],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[16]=c.blobs.of_string(d[10]),c.blobs.neq(d[16],void 0)?c.sequence([function(a){return c.sequence([function(a){return d[4]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[4],c.i64.cast([0,2847]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[22]=a[0],a})},function(a){return d[22]?d[23]=!0:d[23]=!1,d[23]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[24]=c.createArray(),void 0!==void 0?d[25]=(d[24].push(void 0),d[24]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[24],c.i64.cast([0,3]))):c.resolve()}])},function(a){return c.filter(c.db.table(169).fetch(),function(a){return c.blobs.eq(a.epochAnonIdBlob,d[16])}).next().then(function(a,e){var f=a.done;a=a.value;return f?c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][LSEncryptedBackupsGetOpenEpochKeysStoredProcedure] Found a most recent epoch anon ID, but unable to locate it again in the table. This can really only happen if the tablesomehow changed in the middle of our transaction."),d[22]=c.createArray(),void 0!==void 0?d[23]=(d[22].push(void 0),d[22]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"LSEncryptedBackupsGetOpenEpochKeysStoredProcedure","Found a most recent epoch anon ID, but unable to locate it again in the table. This can really only happen if the tablesomehow changed in the middle of our transaction.",d[22],c.i64.cast([0,3]))},function(a){return c.sequence([function(a){return d[4]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[4],c.i64.cast([0,2848]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[23]=a[0],a})},function(a){return d[23]?d[24]=!0:d[24]=!1,d[24]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[25]=c.createArray(),void 0!==void 0?d[26]=(d[25].push(void 0),d[25]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[25],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[20]=void 0}]):(e=a.item,c.sequence([function(a){return d[26]=e.epochAnonIdBlob,d[24]="Using latest epoch: ",d[25]=c.blobs.to_string(d[26]),d[22]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][LSEncryptedBackupsGetOpenEpochKeysStoredProcedure] ",d[22],d[24],d[22],d[25]].join("")),c.resolve()},function(a){return d[23]=new c.Map(),d[23].set("epoch_id",e.epochId),d[23].set("epoch_root_key",e.epochRootKeyBlob),d[23].set("epoch_anon_id",d[26]),d[20]=d[23]}]))})},function(a){return d[11]=d[20]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][LSEncryptedBackupsGetOpenEpochKeysStoredProcedure] No epochs whatsoever on client! This should absolutely never happen. Deleting backup from client."),d[20]=c.createArray(),void 0!==void 0?d[21]=(d[20].push(void 0),d[20]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"LSEncryptedBackupsGetOpenEpochKeysStoredProcedure","No epochs whatsoever on client! This should absolutely never happen. Deleting backup from client.",d[20],c.i64.cast([0,3]))},function(a){return c.sequence([function(a){return d[4]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[4],c.i64.cast([0,2843]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[21]=a[0],a})},function(a){return d[21]?d[22]=!0:d[22]=!1,d[22]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[23]=c.createArray(),void 0!==void 0?d[24]=(d[23].push(void 0),d[23]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[23],c.i64.cast([0,3]))):c.resolve()}])},function(a){return c.storedProcedure(b("LSDeleteBackupOnClient"),void 0,"get_open_epoch_keys",!0,d[4],"Attempted to fetch epoch keys when there are no epochs on the client.",!1)},function(a){return d[11]=void 0}])},function(a){return d[12]=c.i64.of_float(Date.now()),d[13]=c.i64.random(),d[17]="Finishing execution. Execution time: ",d[18]=c.i64.to_string(c.i64.sub(d[12],d[0])),d[19]=" ms",d[14]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][LSEncryptedBackupsGetOpenEpochKeysStoredProcedure] ",d[14],d[17],d[14],d[18],d[14],d[19]].join("")),c.i64.eq(c.i64.mod_(d[13],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[20]=",",d[21]=c.createArray(),void 0!==void 0?d[22]=(d[21].push(void 0),d[21]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"LSEncryptedBackupsGetOpenEpochKeysStoredProcedure",[d[17],d[20],d[18],d[20],d[19]].join(""),d[21],c.i64.cast([0,4]))):c.resolve()},function(a){return e[0]=d[11]}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsGetOpenEpochKeysStoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerEncryptedBackupsRestoreWithSerializer",["LSAppendDataTraceAddon","LSBase64Encode.nop","LSGetOpenEpochKeys","LSIsMobileClient","LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(a){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsTaskSerializerEncryptedBackupsRestoreWithSerializerStoredProcedure] Beginning execution."),function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsTaskSerializerEncryptedBackupsRestoreWithSerializerStoredProcedure] Fetching locally available epochs on client from epochs table"),d[1]=c.createArray(),c.forEach(c.filter(c.db.table(169).fetch(),function(a){return c.i64.eq(a.authorityLevel,c.i64.cast([0,80]))}),function(a){a=a.item;return d[16]=(d[1].push(a.epochId),d[1])})},function(a){return d[11]="Queried locally available epochs. Count: ",d[2]=c.i64.of_int32(d[1].length),d[12]=c.i64.to_string(d[2]),d[3]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][MEBEpochClientUtils] ",d[3],d[11],d[3],d[12]].join("")),c.resolve()},function(e){return c.db.table(168).fetch().next().then(function(e,f){var g=e.done;e=e.value;return g?(g=[void 0,void 0,void 0],d[4]=g[0],d[5]=g[1],d[6]=g[2],g):(f=e.item,c.sequence([function(e){return d[19]=f.deviceId,c.i64.neq(d[19],void 0)?c.sequence([function(e){return c.db.table(190).fetch([[[a[0]]]]).next().then(function(e,h){var a=e.done;e=e.value;return a?c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][LSEncryptedBackupsTaskSerializerEncryptedBackupsRestoreWithSerializerStoredProcedure] No restore payload context found."),d[24]=c.createArray(),void 0!==void 0?d[25]=(d[24].push(void 0),d[24]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"LSEncryptedBackupsTaskSerializerEncryptedBackupsRestoreWithSerializerStoredProcedure","No restore payload context found.",d[24],c.i64.cast([0,3]))},function(a){return a=[void 0,void 0,void 0],d[20]=a[0],d[21]=a[1],d[22]=a[2],a}]):(h=e.item,c.sequence([function(a){return d[32]=h.traceId,c.sequence([function(a){return d[32]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[32],c.i64.cast([0,3603]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[33]=a[0],a})},function(a){return d[33]?d[34]=!0:d[34]=!1,d[34]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[35]=c.createArray(),void 0!==void 0?d[36]=(d[35].push(void 0),d[35]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[35],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[24]=new c.Map(),d[24].set("server_thread_key",h.serverThreadKey),d[24].set("otid",h.messageId),d[24].set("timestamp",h.unencryptedSortKey),d[24].set("wa_thread_id",h.waThreadId),c.nativeOperation(b("LSBase64Encode.nop"),f.ocmfClientStateBlob).then(function(a){return a=a,d[25]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),f.mailboxRootKeyBlob).then(function(a){return a=a,d[26]=a[0],a})},function(a){return d[27]=new c.Map(),d[27].set("ocmf_client_state_blob",d[25]==null?"":d[25]),d[27].set("mailbox_root_key",d[26]==null?"":d[26]),c.storedProcedure(b("LSGetOpenEpochKeys"),!1).then(function(a){return a=a,d[28]=a[0],a})},function(a){return d[28]!==void 0?(d[33]=d[28].get("epoch_id"),d[28],d[29]=d[33]):d[29]=void 0,d[30]=new c.Map(),d[30].set("content_type",h.contentType),d[30].set("device_id",d[19]),d[30].set("epoch_id",d[29]),d[30].set("list_id",h.listId),d[30].set("num_items",h.numItems),d[30].set("start_sort_key",h.startSortKey),d[30].set("mailbox_partial_id",h.mailboxPartialId),d[30].set("trace_id",d[32]),d[30].set("message_partial_id",h.messagePartialId),d[30].set("newer_num_items",h.newerNumItems),d[30].set("locally_available_epochs",d[1]),d[30].set("raw_identifiers",d[24]),d[30].set("raw_tokens",d[27]),d[31]=c.toJSON(d[30]),a=[d[31],c.i64.cast([0,50015]),void 0],d[20]=a[0],d[21]=a[1],d[22]=a[2],a}]))})},function(a){return a=[d[20],d[21],d[22]],d[16]=a[0],d[17]=a[1],d[18]=a[2],a}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][LSEncryptedBackupsTaskSerializerEncryptedBackupsRestoreWithSerializerStoredProcedure] Unexpected error: Device ID is null."),d[20]=c.createArray(),void 0!==void 0?d[21]=(d[20].push(void 0),d[20]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"LSEncryptedBackupsTaskSerializerEncryptedBackupsRestoreWithSerializerStoredProcedure","Unexpected error: Device ID is null.",d[20],c.i64.cast([0,3]))},function(a){return a=[void 0,void 0,void 0],d[16]=a[0],d[17]=a[1],d[18]=a[2],a}])},function(a){return a=[d[16],d[17],d[18]],d[4]=a[0],d[5]=a[1],d[6]=a[2],a}]))})},function(a){return d[8]=c.i64.of_float(Date.now()),d[9]=c.i64.random(),d[13]="Finishing execution. Execution time: ",d[14]=c.i64.to_string(c.i64.sub(d[8],d[0])),d[15]=" ms",d[10]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][LSEncryptedBackupsTaskSerializerEncryptedBackupsRestoreWithSerializerStoredProcedure] ",d[10],d[13],d[10],d[14],d[10],d[15]].join("")),c.i64.eq(c.i64.mod_(d[9],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[16]=",",d[17]=c.createArray(),void 0!==void 0?d[18]=(d[17].push(void 0),d[17]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"LSEncryptedBackupsTaskSerializerEncryptedBackupsRestoreWithSerializerStoredProcedure",[d[13],d[16],d[14],d[16],d[15]].join(""),d[17],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[4],d[5],d[6]],e[0]=a[0],e[1]=a[1],e[2]=a[2],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsTaskSerializerEncryptedBackupsRestoreWithSerializerStoredProcedure";e.exports=a}),null);
__d("LSDeriveValueSecretRefV2",["LSArrayGetObjectAt","LSBase64Encode.nop","LSCreateDerivedKeys.nop","LSGetBlobFromString.nop","LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][deriveValueSecretRefV2] Beginning execution."),d[1]=c.i64.of_float(Date.now()),d[2]=a[2].get("message_payload_encryption_keys"),a[2],d[3]=d[2].get("encryption_version"),d[2],d[4]=d[2].get("epoch_anon_id"),d[2],d[5]=d[2].get("epoch_root_key"),d[2],d[6]=d[2].get("payload_key"),d[2],d[7]=c.createArray(),d[41]=(d[7].push(c.i64.cast([0,6])),d[7]),c.nativeOperation(b("LSGetBlobFromString.nop"),"epoch_anon_id_debug").then(function(a){return a=a,d[8]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[8],void 0,d[4],d[7]).then(function(a){return a=a,d[9]=a[0],a})},function(a){return d[9]?d[10]=!1:d[10]=!0,d[10]?c.resolve(d[11]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[9],c.i64.cast([0,0])).then(function(a){return a=a,d[41]=a[0],d[42]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[41]).then(function(a){return a=a,d[43]=a[0],a})},function(a){return d[11]=d[43]==null?"":d[43]}])},function(a){return d[12]=c.createArray(),d[41]=(d[12].push(c.i64.cast([0,6])),d[12]),c.nativeOperation(b("LSGetBlobFromString.nop"),"epoch_root_key_debug").then(function(a){return a=a,d[13]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[13],void 0,d[5],d[12]).then(function(a){return a=a,d[14]=a[0],a})},function(a){return d[14]?d[15]=!1:d[15]=!0,d[15]?c.resolve(d[16]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[14],c.i64.cast([0,0])).then(function(a){return a=a,d[41]=a[0],d[42]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[41]).then(function(a){return a=a,d[43]=a[0],a})},function(a){return d[16]=d[43]==null?"":d[43]}])},function(a){return d[17]=c.createArray(),d[41]=(d[17].push(c.i64.cast([0,6])),d[17]),c.nativeOperation(b("LSGetBlobFromString.nop"),"message_key_debug").then(function(a){return a=a,d[18]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[18],void 0,d[6],d[17]).then(function(a){return a=a,d[19]=a[0],a})},function(a){return d[19]?d[20]=!1:d[20]=!0,d[20]?c.resolve(d[21]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[19],c.i64.cast([0,0])).then(function(a){return a=a,d[41]=a[0],d[42]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[41]).then(function(a){return a=a,d[43]=a[0],a})},function(a){return d[21]=d[43]==null?"":d[43]}])},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[5]).then(function(a){return a=a,d[22]=a[0],a})},function(e){return c.nativeOperation(b("LSGetBlobFromString.nop"),[d[22]==null?"":d[22],a[0]].join("")).then(function(a){return a=a,d[23]=a[0],a})},function(a){return d[24]=c.createArray(),d[41]=(d[24].push(c.i64.cast([0,6])),d[24]),c.nativeOperation(b("LSGetBlobFromString.nop"),"epoch_root_key_thread_id_debug").then(function(a){return a=a,d[25]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[25],void 0,d[23],d[24]).then(function(a){return a=a,d[26]=a[0],a})},function(a){return d[26]?d[27]=!1:d[27]=!0,d[27]?c.resolve(d[28]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[26],c.i64.cast([0,0])).then(function(a){return a=a,d[41]=a[0],d[42]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[41]).then(function(a){return a=a,d[43]=a[0],a})},function(a){return d[28]=d[43]==null?"":d[43]}])},function(a){return d[29]=":",c.blobs.neq(d[5],void 0)?c.sequence([function(a){return d[41]=c.createArray(),d[47]=(d[41].push(c.i64.cast([0,18])),d[41]),c.nativeOperation(b("LSCreateDerivedKeys.nop"),c.blob("bWViL2RlYnVnL2ZpbmdlcnByaW50L01FQkVwb2NoUm9vdEtleQ=="),void 0,d[5],d[41]).then(function(a){return a=a,d[42]=a[0],a})},function(a){return d[42]!==void 0?c.sequence([function(a){return d[47]=c.i64.of_int32(d[42].length),c.i64.ge(d[47],c.i64.cast([0,1]))?c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[42],c.i64.cast([0,0])).then(function(a){return a=a,d[49]=a[0],d[50]=a[1],a})},function(a){return d[48]=d[49]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBFingerprint] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),d[49]=c.createArray(),void 0!==void 0?d[50]=(d[49].push(void 0),d[49]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBFingerprint","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",d[49],c.i64.cast([0,3]))},function(a){return d[48]=void 0}])},function(a){return d[43]=d[48]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBFingerprint] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),d[47]=c.createArray(),void 0!==void 0?d[48]=(d[47].push(void 0),d[47]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBFingerprint","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",d[47],c.i64.cast([0,3]))},function(a){return d[43]=void 0}])},function(a){return c.blobs.neq(d[43],void 0)?d[44]=!0:d[44]=!1,d[44]?0:(function(a){c.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),c["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),c.nativeOperation(b("LSBase64Encode.nop"),d[43]).then(function(a){return a=a,d[45]=a[0],a})},function(a){return d[45]!==void 0?d[46]=d[45]:d[46]="encodingfailed",d[30]=d[46]}]):c.resolve(d[30]="null")},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[4]).then(function(a){return a=a,d[31]=a[0],a})},function(e){return d[32]=new c.Map(),d[32].set("encryption_version",d[3]),d[32].set("epoch_anon_id",d[31]==null?"":d[31]),d[32].set("message_encryption_values",[d[11],d[29],d[16],d[29],d[21],d[29],d[28]].join("")),d[32].set("root_key_fingerprint",d[30]),d[32].set("backup_id",a[1]),d[33]=c.toJSON(d[32]),d[34]=new c.Map(),d[34].set("value_secret_ref",d[33]),d[35]=c.i64.of_float(Date.now()),d[36]=c.i64.random(),d[38]="Finishing execution. Execution time: ",d[39]=c.i64.to_string(c.i64.sub(d[35],d[0])),d[40]=" ms",d[37]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][deriveValueSecretRefV2] ",d[37],d[38],d[37],d[39],d[37],d[40]].join("")),c.i64.eq(c.i64.mod_(d[36],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[41]=",",d[42]=c.createArray(),void 0!==void 0?d[43]=(d[42].push(void 0),d[42]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"deriveValueSecretRefV2",[d[38],d[41],d[39],d[41],d[40]].join(""),d[42],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[34],void 0],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsDeriveValueSecretRefV2StoredProcedure";e.exports=a}),null);
__d("LSEncryptIdentifiersV2",["LSBase64Encode.nop","LSBinaryToHex.nop","LSGetBlobFromInt64BE.nop","LSGetBlobFromString.nop","LSHmac_v2.nop","LSLogMebClientEvent.nop","LSOcmfClientMap.nop","LSOpeEncrypt.nop","LSTruncateSortKey.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][encryptIdentifiersV2] Beginning execution."),d[1]=c.i64.of_float(Date.now()),d[2]=a[6].get("ocmf_shared_key"),a[6],c.nativeOperation(b("LSGetBlobFromString.nop"),a[2]).then(function(a){return a=a,d[3]=a[0],a})},function(a){return c.nativeOperation(b("LSHmac_v2.nop"),c.blob("bWFpbGJveF9pZF9zY29wZQ=="),d[3]).then(function(a){return a=a,d[4]=a[0],a})},function(a){return c.nativeOperation(b("LSOcmfClientMap.nop"),d[2],d[4]).then(function(a){return a=a,d[5]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[5]).then(function(a){return a=a,d[6]=a[0],a})},function(e){return c.i64.eq(a[0],c.i64.cast([0,2]))&&c.i64.eq(a[1],c.i64.cast([0,2]))?d[7]=a[5]:d[7]=a[3],d[8]=a[6].get("ocmf_shared_key"),a[6],c.nativeOperation(b("LSGetBlobFromString.nop"),d[7]).then(function(a){return a=a,d[9]=a[0],a})},function(a){return c.nativeOperation(b("LSHmac_v2.nop"),c.blob("dGhyZWFkX2lkX3Njb3Bl"),d[9]).then(function(a){return a=a,d[10]=a[0],a})},function(a){return c.nativeOperation(b("LSOcmfClientMap.nop"),d[8],d[10]).then(function(a){return a=a,d[11]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[11]).then(function(a){return a=a,d[12]=a[0],a})},function(e){return d[13]=a[6].get("ope_key"),a[6],c.nativeOperation(b("LSGetBlobFromInt64BE.nop"),a[4]).then(function(a){return a=a,d[14]=a[0],a})},function(a){return c.nativeOperation(b("LSTruncateSortKey.nop"),d[14]).then(function(a){return a=a,d[15]=a[0],a})},function(a){return c.nativeOperation(b("LSOpeEncrypt.nop"),d[13],d[15],c.i64.cast([0,16])).then(function(a){return a=a,d[16]=a[0],a})},function(a){return c.nativeOperation(b("LSBinaryToHex.nop"),d[16]).then(function(a){return a=a,d[17]=a[0],a})},function(e){return d[18]=a[6].get("ocmf_shared_key"),a[6],c.nativeOperation(b("LSGetBlobFromString.nop"),a[5]).then(function(a){return a=a,d[19]=a[0],a})},function(a){return c.nativeOperation(b("LSHmac_v2.nop"),c.blob("bWVzc2FnZV9pZF9zY29wZQ=="),d[19]).then(function(a){return a=a,d[20]=a[0],a})},function(a){return c.nativeOperation(b("LSOcmfClientMap.nop"),d[18],d[20]).then(function(a){return a=a,d[21]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[21]).then(function(a){return a=a,d[22]=a[0],a})},function(a){return d[23]=new c.Map(),d[23].set("backup_id_ocmf_partial",d[6]==null?"":d[6]),d[23].set("act_thread_id_ocmf_partial",d[12]==null?"":d[12]),d[23].set("timestamp_encrypted",d[17]==null?"":d[17]),d[23].set("otid_ocmf_partial",d[22]==null?"":d[22]),d[24]=c.i64.of_float(Date.now()),d[25]=c.i64.random(),d[27]="Finishing execution. Execution time: ",d[28]=c.i64.to_string(c.i64.sub(d[24],d[0])),d[29]=" ms",d[26]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][encryptIdentifiersV2] ",d[26],d[27],d[26],d[28],d[26],d[29]].join("")),c.i64.eq(c.i64.mod_(d[25],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[30]=",",d[31]=c.createArray(),void 0!==void 0?d[32]=(d[31].push(void 0),d[31]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"encryptIdentifiersV2",[d[27],d[30],d[28],d[30],d[29]].join(""),d[31],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[23],void 0],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsEncryptIdentifiersV2StoredProcedure";e.exports=a}),null);
__d("LSEncryptMessagePayloadV2",["LSArrayGetObjectAt","LSBase64Encode.nop","LSCreateDerivedKeys.nop","LSGetBlobFromString.nop","LSLogMebClientEvent.nop","LSSymmetricEncryptionCreateEncryptedString.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][encryptMessagePayloadV2] Beginning execution."),d[1]=c.i64.of_float(Date.now()),d[2]=a[2].get("message_payload_encryption_keys"),a[2],d[3]=d[2].get("payload_key"),d[2],c.nativeOperation(b("LSSymmetricEncryptionCreateEncryptedString.nop"),d[3],c.blobs.of_string(["message_thread","_",a[1]].join("")),a[3]).then(function(a){return a=a,d[4]=a[0],a})},function(e){return d[4]!==void 0?c.sequence([function(a){return d[13]=d[2].get("encryption_version"),d[2],d[14]=d[2].get("epoch_anon_id"),d[2],d[15]=d[2].get("epoch_root_key"),d[2],d[16]=d[2].get("payload_key"),d[2],d[17]=c.createArray(),d[45]=(d[17].push(c.i64.cast([0,6])),d[17]),c.nativeOperation(b("LSGetBlobFromString.nop"),"epoch_anon_id_debug").then(function(a){return a=a,d[18]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[18],void 0,d[14],d[17]).then(function(a){return a=a,d[19]=a[0],a})},function(a){return d[19]?d[20]=!1:d[20]=!0,d[20]?c.resolve(d[21]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[19],c.i64.cast([0,0])).then(function(a){return a=a,d[45]=a[0],d[46]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[45]).then(function(a){return a=a,d[47]=a[0],a})},function(a){return d[21]=d[47]==null?"":d[47]}])},function(a){return d[22]=c.createArray(),d[45]=(d[22].push(c.i64.cast([0,6])),d[22]),c.nativeOperation(b("LSGetBlobFromString.nop"),"epoch_root_key_debug").then(function(a){return a=a,d[23]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[23],void 0,d[15],d[22]).then(function(a){return a=a,d[24]=a[0],a})},function(a){return d[24]?d[25]=!1:d[25]=!0,d[25]?c.resolve(d[26]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[24],c.i64.cast([0,0])).then(function(a){return a=a,d[45]=a[0],d[46]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[45]).then(function(a){return a=a,d[47]=a[0],a})},function(a){return d[26]=d[47]==null?"":d[47]}])},function(a){return d[27]=c.createArray(),d[45]=(d[27].push(c.i64.cast([0,6])),d[27]),c.nativeOperation(b("LSGetBlobFromString.nop"),"message_key_debug").then(function(a){return a=a,d[28]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[28],void 0,d[16],d[27]).then(function(a){return a=a,d[29]=a[0],a})},function(a){return d[29]?d[30]=!1:d[30]=!0,d[30]?c.resolve(d[31]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[29],c.i64.cast([0,0])).then(function(a){return a=a,d[45]=a[0],d[46]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[45]).then(function(a){return a=a,d[47]=a[0],a})},function(a){return d[31]=d[47]==null?"":d[47]}])},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[15]).then(function(a){return a=a,d[32]=a[0],a})},function(e){return c.nativeOperation(b("LSGetBlobFromString.nop"),[d[32]==null?"":d[32],a[1]].join("")).then(function(a){return a=a,d[33]=a[0],a})},function(a){return d[34]=c.createArray(),d[45]=(d[34].push(c.i64.cast([0,6])),d[34]),c.nativeOperation(b("LSGetBlobFromString.nop"),"epoch_root_key_thread_id_debug").then(function(a){return a=a,d[35]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[35],void 0,d[33],d[34]).then(function(a){return a=a,d[36]=a[0],a})},function(a){return d[36]?d[37]=!1:d[37]=!0,d[37]?c.resolve(d[38]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[36],c.i64.cast([0,0])).then(function(a){return a=a,d[45]=a[0],d[46]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[45]).then(function(a){return a=a,d[47]=a[0],a})},function(a){return d[38]=d[47]==null?"":d[47]}])},function(a){return d[39]=":",c.blobs.neq(d[15],void 0)?c.sequence([function(a){return d[45]=c.createArray(),d[51]=(d[45].push(c.i64.cast([0,18])),d[45]),c.nativeOperation(b("LSCreateDerivedKeys.nop"),c.blob("bWViL2RlYnVnL2ZpbmdlcnByaW50L01FQkVwb2NoUm9vdEtleQ=="),void 0,d[15],d[45]).then(function(a){return a=a,d[46]=a[0],a})},function(a){return d[46]!==void 0?c.sequence([function(a){return d[51]=c.i64.of_int32(d[46].length),c.i64.ge(d[51],c.i64.cast([0,1]))?c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[46],c.i64.cast([0,0])).then(function(a){return a=a,d[53]=a[0],d[54]=a[1],a})},function(a){return d[52]=d[53]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBFingerprint] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),d[53]=c.createArray(),void 0!==void 0?d[54]=(d[53].push(void 0),d[53]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBFingerprint","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",d[53],c.i64.cast([0,3]))},function(a){return d[52]=void 0}])},function(a){return d[47]=d[52]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBFingerprint] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),d[51]=c.createArray(),void 0!==void 0?d[52]=(d[51].push(void 0),d[51]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBFingerprint","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",d[51],c.i64.cast([0,3]))},function(a){return d[47]=void 0}])},function(a){return c.blobs.neq(d[47],void 0)?d[48]=!0:d[48]=!1,d[48]?0:(function(a){c.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),c["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),c.nativeOperation(b("LSBase64Encode.nop"),d[47]).then(function(a){return a=a,d[49]=a[0],a})},function(a){return d[49]!==void 0?d[50]=d[49]:d[50]="encodingfailed",d[40]=d[50]}]):c.resolve(d[40]="null")},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[14]).then(function(a){return a=a,d[41]=a[0],a})},function(b){return d[42]=new c.Map(),d[42].set("encryption_version",d[13]),d[42].set("epoch_anon_id",d[41]==null?"":d[41]),d[42].set("message_encryption_values",[d[21],d[39],d[26],d[39],d[31],d[39],d[38]].join("")),d[42].set("root_key_fingerprint",d[40]),d[42].set("backup_id",a[0]),d[43]=c.toJSON(d[42]),d[44]=new c.Map(),d[44].set("encrypted_message_payload",d[4]),d[44].set("value_secret_ref",d[43]),b=[d[44],void 0],d[5]=b[0],d[6]=b[1],b}]):c.resolve((d[13]=new c.Map(),d[13].set("error_code",c.i64.cast([0,40])),d[13].set("stored_procedure","LSEncryptedBackupsEncryptMessagePayloadV2StoredProcedure"),d[13].set("error_message",""),e=[void 0,d[13]],d[5]=e[0],d[6]=e[1],e))},function(a){return d[7]=c.i64.of_float(Date.now()),d[8]=c.i64.random(),d[10]="Finishing execution. Execution time: ",d[11]=c.i64.to_string(c.i64.sub(d[7],d[0])),d[12]=" ms",d[9]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][encryptMessagePayloadV2] ",d[9],d[10],d[9],d[11],d[9],d[12]].join("")),c.i64.eq(c.i64.mod_(d[8],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[13]=",",d[14]=c.createArray(),void 0!==void 0?d[15]=(d[14].push(void 0),d[14]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"encryptMessagePayloadV2",[d[10],d[13],d[11],d[13],d[12]].join(""),d[14],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[5],d[6]],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsEncryptMessagePayloadV2StoredProcedure";e.exports=a}),null);
__d("LSLoadAndEncryptProtobufWithInputsV2",["LSArrayGetObjectAt","LSBase64Encode.nop","LSCreateDerivedKeys.nop","LSGetBlobFromString.nop","LSHmac_v2.nop","LSLogMebClientEvent.nop","LSQueryLocalPersistenceStoreForBackup.nop","LSQueryLocalPersistenceStoreSupplementalForBackup.nop","LSQueryLocalPersistenceStoreTagsForBackup.nop","LSSymmetricEncryptionCreateEncryptedData.nop","gkx"],(function(a,b,c,d,e,f,g){function a(){var a=arguments,d=a[a.length-1],e=[],f=[];return d.sequence([function(g){return d.sequence([function(f){return e[0]=d.i64.of_float(Date.now()),function(a){d.logger(a).info(a)}("[EncryptedBackups][loadAndEncryptProtobufWithInputsV2] Beginning execution."),e[1]=d.i64.of_float(Date.now()),(c("gkx")("23657")||c("gkx")("26375"))&&(c("gkx")("26377")||c("gkx")("687"))?d.sequence([function(c){return d.i64.eq(a[0],d.i64.cast([0,1]))?d.sequence([function(c){return d.nativeOperation(b("LSQueryLocalPersistenceStoreForBackup.nop"),a[1],a[2]).then(function(a){return a=a,e[12]=a[0],e[13]=a[1],e[14]=a[2],a})},function(c){return d.nativeOperation(b("LSQueryLocalPersistenceStoreTagsForBackup.nop"),a[1],a[2]).then(function(a){return a=a,e[15]=a[0],a})},function(c){return d.blobs.neq(e[12],void 0)?d.sequence([function(c){return e[18]=a[5].get("message_payload_encryption_keys"),a[5],e[19]=e[18].get("payload_key"),e[18],d.nativeOperation(b("LSSymmetricEncryptionCreateEncryptedData.nop"),e[19],d.blobs.of_string(["message_thread","_",a[1]].join("")),e[12]).then(function(a){return a=a,e[20]=a[0],a})},function(a){return d.blobs.neq(e[20],void 0)?d.sequence([function(a){return d.nativeOperation(b("LSBase64Encode.nop"),e[20]).then(function(a){return a=a,e[24]=a[0],a})},function(a){return e[21]=e[24]}]):d.resolve(e[21]=void 0)},function(b){return e[21]!==void 0?(e[15]!==void 0?(e[26]=new d.Map(),e[26].set("message_tags",e[15]),e[27]=new d.Map(),e[31]="message_tags",e[28]=e[26].get(e[31]),e[26],e[28]?e[29]=!1:e[29]=!0,e[29]?0:e[27].set(e[31],e[28]),e[30]=d.toJSON(e[27]),e[24]=e[30]):e[24]=void 0,e[25]=new d.Map(),e[25].set("backup_action",a[0]),e[25].set("protobuf_encrypted",e[21]),e[25].set("supplemental_data_encrypted",void 0),e[25].set("timestamp_ms",a[4]),e[25].set("message_tags",e[24]),e[25].set("serialized_attachment_backup_payload",void 0),b=[e[25],void 0],e[22]=b[0],e[23]=b[1],b):(function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error PROTOBUF_ENCRYPTION_FAILED"),e[24]=new d.Map(),e[24].set("error_code",d.i64.cast([0,62])),e[24].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[24].set("error_message",""),b=[void 0,e[24]],e[22]=b[0],e[23]=b[1],b),b=[e[22],e[23]],e[16]=b[0],e[17]=b[1],b}]):d.resolve((e[14]?(function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error PROTOBUF_ALREADY_DELETED"),e[20]=new d.Map(),e[20].set("error_code",d.i64.cast([0,70])),e[20].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[20].set("error_message",""),c=[void 0,e[20]],e[18]=c[0],e[19]=c[1],c):(function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error PROTOBUF_NOT_FOUND_IN_TOPLEVEL_TABLE"),e[20]=new d.Map(),e[20].set("error_code",d.i64.cast([0,63])),e[20].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[20].set("error_message",""),c=[void 0,e[20]],e[18]=c[0],e[19]=c[1],c),c=[e[18],e[19]],e[16]=c[0],e[17]=c[1],c))},function(a){return a=[e[16],e[17]],e[10]=a[0],e[11]=a[1],a}]):d.sequence([function(c){return d.i64.eq(a[0],d.i64.cast([0,2]))?d.sequence([function(c){return a[3]!==void 0?d.sequence([function(c){return d.nativeOperation(b("LSQueryLocalPersistenceStoreSupplementalForBackup.nop"),a[1],a[2],a[3]).then(function(a){return a=a,e[16]=a[0],e[17]=a[1],a})},function(c){return d.nativeOperation(b("LSQueryLocalPersistenceStoreTagsForBackup.nop"),a[1],a[2]).then(function(a){return a=a,e[18]=a[0],a})},function(c){return d.blobs.neq(e[16],void 0)?d.sequence([function(c){return e[21]=a[5].get("mailbox_root_key_v2"),a[5],d.blobs.neq(e[21],void 0)?d.sequence([function(c){return e[24]=a[5].get("message_payload_encryption_keys"),a[5],e[25]=e[24].get("epoch_root_key"),e[24],e[26]=d.createArray(),e[39]=(e[26].push(d.i64.cast([0,32])),e[26]),d.nativeOperation(b("LSCreateDerivedKeys.nop"),d.blob("a2RmX2luZm86bWFpbGJveF9yb290X2tleV92Mj5zdXBwbGVtZW50YWxfcHJmX2tleQ=="),void 0,e[21],e[26]).then(function(a){return a=a,e[27]=a[0],a})},function(a){return e[27]!==void 0?d.sequence([function(a){return e[39]=d.i64.of_int32(e[27].length),d.i64.ge(e[39],d.i64.cast([0,1]))?d.sequence([function(a){return d.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),e[27],d.i64.cast([0,0])).then(function(a){return a=a,e[41]=a[0],e[42]=a[1],a})},function(a){return e[40]=e[41]}]):d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),e[41]=d.createArray(),void 0!==void 0?e[42]=(e[41].push(void 0),e[41]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",e[41],d.i64.cast([0,3]))},function(a){return e[40]=void 0}])},function(a){return e[28]=e[40]}]):d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),e[39]=d.createArray(),void 0!==void 0?e[40]=(e[39].push(void 0),e[39]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",e[39],d.i64.cast([0,3]))},function(a){return e[28]=void 0}])},function(a){return d.blobs.neq(e[28],void 0)?e[29]=!0:e[29]=!1,e[29]?0:(function(a){d.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),d["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),e[30]=d.createArray(),e[39]=(e[30].push(d.i64.cast([0,32])),e[30]),d.nativeOperation(b("LSCreateDerivedKeys.nop"),d.blob("a2RmX2luZm86bWFpbGJveF9yb290X2tleV92Mj5zdXBwbGVtZW50YWxfZW5jX2tleQ=="),void 0,e[25],e[30]).then(function(a){return a=a,e[31]=a[0],a})},function(a){return e[31]!==void 0?d.sequence([function(a){return e[39]=d.i64.of_int32(e[31].length),d.i64.ge(e[39],d.i64.cast([0,1]))?d.sequence([function(a){return d.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),e[31],d.i64.cast([0,0])).then(function(a){return a=a,e[41]=a[0],e[42]=a[1],a})},function(a){return e[40]=e[41]}]):d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),e[41]=d.createArray(),void 0!==void 0?e[42]=(e[41].push(void 0),e[41]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",e[41],d.i64.cast([0,3]))},function(a){return e[40]=void 0}])},function(a){return e[32]=e[40]}]):d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),e[39]=d.createArray(),void 0!==void 0?e[40]=(e[39].push(void 0),e[39]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",e[39],d.i64.cast([0,3]))},function(a){return e[32]=void 0}])},function(c){return d.blobs.neq(e[32],void 0)?e[33]=!0:e[33]=!1,e[33]?0:(function(a){d.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),d["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),d.nativeOperation(b("LSGetBlobFromString.nop"),a[3]).then(function(a){return a=a,e[34]=a[0],a})},function(a){return d.nativeOperation(b("LSHmac_v2.nop"),e[28],e[34]).then(function(a){return a=a,e[35]=a[0],a})},function(a){return d.nativeOperation(b("LSSymmetricEncryptionCreateEncryptedData.nop"),e[32],d.blob("c3VwcGxlbWVudGFsX2VuY19hYWQ="),e[34]).then(function(a){return a=a,e[36]=a[0],a})},function(c){return d.blobs.neq(e[36],void 0)?d.sequence([function(c){return e[39]=new d.Map(),e[39].set("sk_ciphertext",e[36]),e[39].set("sk_hash",e[35]),e[40]=a[5].get("message_payload_encryption_keys"),a[5],e[41]=e[40].get("payload_key"),e[40],d.nativeOperation(b("LSSymmetricEncryptionCreateEncryptedData.nop"),e[41],d.blobs.of_string(["message_thread","_",a[1]].join("")),e[16]).then(function(a){return a=a,e[42]=a[0],a})},function(a){return d.blobs.neq(e[42],void 0)?d.sequence([function(a){return d.nativeOperation(b("LSBase64Encode.nop"),e[42]).then(function(a){return a=a,e[46]=a[0],a})},function(a){return e[43]=e[46]}]):d.resolve(e[43]=void 0)},function(b){return e[43]!==void 0?(e[18]!==void 0?(e[48]=new d.Map(),e[48].set("message_tags",e[18]),e[49]=new d.Map(),e[53]="message_tags",e[50]=e[48].get(e[53]),e[48],e[50]?e[51]=!1:e[51]=!0,e[51]?0:e[49].set(e[53],e[50]),e[52]=d.toJSON(e[49]),e[46]=e[52]):e[46]=void 0,e[47]=new d.Map(),e[47].set("backup_action",a[0]),e[47].set("protobuf_encrypted",e[43]),e[47].set("supplemental_data_encrypted",e[39]),e[47].set("timestamp_ms",a[4]),e[47].set("message_tags",e[46]),e[47].set("serialized_attachment_backup_payload",void 0),b=[e[47],void 0],e[44]=b[0],e[45]=b[1],b):(function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error PROTOBUF_ENCRYPTION_FAILED"),e[46]=new d.Map(),e[46].set("error_code",d.i64.cast([0,62])),e[46].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[46].set("error_message",""),b=[void 0,e[46]],e[44]=b[0],e[45]=b[1],b),b=[e[44],e[45]],e[37]=b[0],e[38]=b[1],b}]):d.resolve((function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error SUPPLEMENTAL_ENCRYPTION_FAILED"),e[39]=new d.Map(),e[39].set("error_code",d.i64.cast([0,66])),e[39].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[39].set("error_message",""),c=[void 0,e[39]],e[37]=c[0],e[38]=c[1],c))},function(a){return a=[e[37],e[38]],e[22]=a[0],e[23]=a[1],a}]):d.resolve((function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error NULL_MAILBOX_ROOT_KEY_V2"),e[24]=new d.Map(),e[24].set("error_code",d.i64.cast([0,27])),e[24].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[24].set("error_message",""),c=[void 0,e[24]],e[22]=c[0],e[23]=c[1],c))},function(a){return a=[e[22],e[23]],e[19]=a[0],e[20]=a[1],a}]):d.resolve((function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error PROTOBUF_NOT_FOUND_IN_SUPPLEMENTAL_TABLE"),e[21]=new d.Map(),e[21].set("error_code",d.i64.cast([0,64])),e[21].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[21].set("error_message",""),c=[void 0,e[21]],e[19]=c[0],e[20]=c[1],c))},function(a){return a=[e[19],e[20]],e[14]=a[0],e[15]=a[1],a}]):d.resolve((function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error SUPPLEMENTAL_KEY_NOT_SET_IN_CONTEXT_TABLE"),e[16]=new d.Map(),e[16].set("error_code",d.i64.cast([0,65])),e[16].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[16].set("error_message",""),c=[void 0,e[16]],e[14]=c[0],e[15]=c[1],c))},function(a){return a=[e[14],e[15]],e[12]=a[0],e[13]=a[1],a}]):d.sequence([function(c){return d.i64.eq(a[0],d.i64.cast([0,4]))?d.sequence([function(c){return d.nativeOperation(b("LSQueryLocalPersistenceStoreForBackup.nop"),a[1],a[2]).then(function(a){return a=a,e[16]=a[0],e[17]=a[1],e[18]=a[2],a})},function(c){return d.nativeOperation(b("LSQueryLocalPersistenceStoreTagsForBackup.nop"),a[1],a[2]).then(function(a){return a=a,e[19]=a[0],a})},function(c){return d.blobs.neq(e[16],void 0)?d.sequence([function(c){return e[22]=a[5].get("message_payload_encryption_keys"),a[5],e[23]=e[22].get("payload_key"),e[22],d.nativeOperation(b("LSSymmetricEncryptionCreateEncryptedData.nop"),e[23],d.blobs.of_string(["message_thread","_",a[1]].join("")),e[16]).then(function(a){return a=a,e[24]=a[0],a})},function(a){return d.blobs.neq(e[24],void 0)?d.sequence([function(a){return d.nativeOperation(b("LSBase64Encode.nop"),e[24]).then(function(a){return a=a,e[28]=a[0],a})},function(a){return e[25]=e[28]}]):d.resolve(e[25]=void 0)},function(b){return e[25]!==void 0?(e[19]!==void 0?(e[30]=new d.Map(),e[30].set("message_tags",e[19]),e[31]=new d.Map(),e[35]="message_tags",e[32]=e[30].get(e[35]),e[30],e[32]?e[33]=!1:e[33]=!0,e[33]?0:e[31].set(e[35],e[32]),e[34]=d.toJSON(e[31]),e[28]=e[34]):e[28]=void 0,e[29]=new d.Map(),e[29].set("backup_action",a[0]),e[29].set("protobuf_encrypted",e[25]),e[29].set("supplemental_data_encrypted",void 0),e[29].set("timestamp_ms",a[4]),e[29].set("message_tags",e[28]),e[29].set("serialized_attachment_backup_payload",void 0),b=[e[29],void 0],e[26]=b[0],e[27]=b[1],b):(function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error PROTOBUF_ENCRYPTION_FAILED"),e[28]=new d.Map(),e[28].set("error_code",d.i64.cast([0,62])),e[28].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[28].set("error_message",""),b=[void 0,e[28]],e[26]=b[0],e[27]=b[1],b),b=[e[26],e[27]],e[20]=b[0],e[21]=b[1],b}]):d.resolve((e[18]?(function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error PROTOBUF_ALREADY_DELETED"),e[24]=new d.Map(),e[24].set("error_code",d.i64.cast([0,70])),e[24].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[24].set("error_message",""),c=[void 0,e[24]],e[22]=c[0],e[23]=c[1],c):(function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error PROTOBUF_NOT_FOUND_IN_TOPLEVEL_TABLE"),e[24]=new d.Map(),e[24].set("error_code",d.i64.cast([0,63])),e[24].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[24].set("error_message",""),c=[void 0,e[24]],e[22]=c[0],e[23]=c[1],c),c=[e[22],e[23]],e[20]=c[0],e[21]=c[1],c))},function(a){return a=[e[20],e[21]],e[14]=a[0],e[15]=a[1],a}]):d.resolve((d.i64.eq(a[0],d.i64.cast([0,3]))?(e[18]=new d.Map(),e[18].set("backup_action",a[0]),e[18].set("protobuf_encrypted",void 0),e[18].set("supplemental_data_encrypted",void 0),e[18].set("timestamp_ms",a[4]),e[18].set("message_tags",void 0),e[18].set("serialized_attachment_backup_payload",void 0),c=[e[18],void 0],e[16]=c[0],e[17]=c[1],c):(function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error UNKNOWN"),e[18]=new d.Map(),e[18].set("error_code",d.i64.cast([0,603])),e[18].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[18].set("error_message",""),c=[void 0,e[18]],e[16]=c[0],e[17]=c[1],c),c=[e[16],e[17]],e[14]=c[0],e[15]=c[1],c))},function(a){return a=[e[14],e[15]],e[12]=a[0],e[13]=a[1],a}])},function(a){return a=[e[12],e[13]],e[10]=a[0],e[11]=a[1],a}])},function(a){return a=[e[10],e[11]],e[2]=a[0],e[3]=a[1],a}]):d.resolve((function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure] Returning error NOT_SUPPORTED_ON_WEB"),e[10]=new d.Map(),e[10].set("error_code",d.i64.cast([0,7])),e[10].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure"),e[10].set("error_message",""),f=[void 0,e[10]],e[2]=f[0],e[3]=f[1],f))},function(a){return e[4]=d.i64.of_float(Date.now()),e[5]=d.i64.random(),e[7]="Finishing execution. Execution time: ",e[8]=d.i64.to_string(d.i64.sub(e[4],e[0])),e[9]=" ms",e[6]="",function(a){d.logger(a).info(a)}(["[EncryptedBackups][loadAndEncryptProtobufWithInputsV2] ",e[6],e[7],e[6],e[8],e[6],e[9]].join("")),d.i64.eq(d.i64.mod_(e[5],d.i64.cast([0,1e3])),d.i64.cast([0,0]))?(e[10]=",",e[11]=d.createArray(),void 0!==void 0?e[12]=(e[11].push(void 0),e[11]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"loadAndEncryptProtobufWithInputsV2",[e[7],e[10],e[8],e[10],e[9]].join(""),e[11],d.i64.cast([0,4]))):d.resolve()},function(a){return a=[e[2],e[3]],f[0]=a[0],f[1]=a[1],a}])},function(a){return d.resolve(f)}])}a.__sproc_name__="LSEncryptedBackupsLoadAndEncryptProtobufWithInputsV2StoredProcedure";d=a;g["default"]=d}),98);
__d("LSLoadAndEncryptProtobufV2",["LSLoadAndEncryptProtobufWithInputsV2","LSLogMebClientEvent.nop","gkx"],(function(a,b,c,d,e,f,g){function a(){var a=arguments,d=a[a.length-1],e=[],f=[];return d.sequence([function(g){return d.sequence([function(f){return e[0]=d.i64.of_float(Date.now()),function(a){d.logger(a).info(a)}("[EncryptedBackups][loadAndEncryptProtobufV2] Beginning execution."),e[1]=d.i64.of_float(Date.now()),(c("gkx")("23657")||c("gkx")("26375"))&&(c("gkx")("26377")||c("gkx")("687"))?d.sequence([function(c){return d.filter(d.db.table(305).fetch(),function(b){return d.i64.eq(b.pendingBackupTaskId,a[0])}).next().then(function(c,f){var g=c.done;c=c.value;return g?(function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufV2StoredProcedure] Returning error PROTOBUF_CONTEXT_ROW_NOT_FOUND"),e[13]=new d.Map(),e[13].set("error_code",d.i64.cast([0,67])),e[13].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufV2StoredProcedure"),e[13].set("error_message",""),g=[void 0,e[13]],e[10]=g[0],e[11]=g[1],g):(f=c.item,d.sequence([function(c){return d.storedProcedure(b("LSLoadAndEncryptProtobufWithInputsV2"),f.backupAction,a[2],f.toplevelOfflineThreadingId,f.supplementalKey,f.messageTimestampMs,a[1]).then(function(a){return a=a,e[13]=a[0],e[14]=a[1],a})},function(a){return a=[e[13],e[14]],e[10]=a[0],e[11]=a[1],a}]))})},function(a){return a=[e[10],e[11]],e[2]=a[0],e[3]=a[1],a}]):d.resolve((function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsLoadAndEncryptProtobufV2StoredProcedure] Returning error NOT_SUPPORTED_ON_WEB"),e[10]=new d.Map(),e[10].set("error_code",d.i64.cast([0,7])),e[10].set("stored_procedure","LSEncryptedBackupsLoadAndEncryptProtobufV2StoredProcedure"),e[10].set("error_message",""),f=[void 0,e[10]],e[2]=f[0],e[3]=f[1],f))},function(a){return e[4]=d.i64.of_float(Date.now()),e[5]=d.i64.random(),e[7]="Finishing execution. Execution time: ",e[8]=d.i64.to_string(d.i64.sub(e[4],e[0])),e[9]=" ms",e[6]="",function(a){d.logger(a).info(a)}(["[EncryptedBackups][loadAndEncryptProtobufV2] ",e[6],e[7],e[6],e[8],e[6],e[9]].join("")),d.i64.eq(d.i64.mod_(e[5],d.i64.cast([0,1e3])),d.i64.cast([0,0]))?(e[10]=",",e[11]=d.createArray(),void 0!==void 0?e[12]=(e[11].push(void 0),e[11]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"loadAndEncryptProtobufV2",[e[7],e[10],e[8],e[10],e[9]].join(""),e[11],d.i64.cast([0,4]))):d.resolve()},function(a){return a=[e[2],e[3]],f[0]=a[0],f[1]=a[1],a}])},function(a){return d.resolve(f)}])}a.__sproc_name__="LSEncryptedBackupsLoadAndEncryptProtobufV2StoredProcedure";d=a;g["default"]=d}),98);
__d("LSSerializeBackupPayloadV2",["LSAppendDataTraceAddon","LSArrayGetObjectAt","LSBase64Encode.nop","LSCreateDerivedKeys.nop","LSDeriveValueSecretRefV2","LSEncryptIdentifiersV2","LSEncryptMessagePayloadV2","LSGetBlobFromString.nop","LSGetLatestEpochKeys","LSIsEncryptionVersionSecure","LSIsMobileClient","LSLoadAndEncryptProtobufV2","LSLogMebClientEvent.nop","LSLogWebQpl.nop","gkx","justknobx"],(function(a,b,c,d,e,f,g){function a(){var a=arguments,d=a[a.length-1],e=[],f=[];return d.sequence([function(g){return d.sequence([function(f){return e[0]=d.i64.of_float(Date.now()),function(a){d.logger(a).info(a)}("[EncryptedBackups][serializeBackupPayloadV2] Beginning execution."),e[1]=d.i64.of_float(Date.now()),e[9]=d.i64.mul(e[1],d.i64.cast([0,1e6])),(c("gkx")("23657")||c("gkx")("26375"))&&c("justknobx")._("1071")?d.sequence([function(c){return d.islc(d.filter(d.db.table(168).fetch(),function(a){return d.i64.eq(a.authorityLevel,d.i64.cast([0,80]))||!1}),0,d.i64.to_float(d.i64.cast([0,1]))).next().then(function(c,f){var g=c.done;c=c.value;return g?d.sequence([function(b){return d.db.table(2).fetch([[[a[0]]]]).next().then(function(c,f){var b=c.done;c=c.value;return b?(e[30]=d.i64.of_float(Date.now()),b=[a[0],void 0,void 0,void 0,void 0,d.i64.sub(d.i64.mul(e[30],d.i64.cast([0,1e6])),e[9]),void 0],e[18]=b[0],e[19]=b[1],e[20]=b[2],e[21]=b[3],e[22]=b[4],e[23]=b[5],e[24]=b[6],b):(f=c.item,e[30]=d.i64.of_float(Date.now()),b=[a[0],f.queueName,f.enqueueTimestampMs,void 0,f.firstExecutedTimestampMs,d.i64.sub(d.i64.mul(e[30],d.i64.cast([0,1e6])),e[9]),void 0],e[18]=b[0],e[19]=b[1],e[20]=b[2],e[21]=b[3],e[22]=b[4],e[23]=b[5],e[24]=b[6],b)})},function(a){return e[26]=new d.Map(),e[26].set("task_id",e[18]),e[26].set("queue_name",e[19]),e[26].set("enqueue_timestamp_ms",e[20]),e[26].set("priority",e[21]),e[26].set("first_executed_timestamp_ms",e[22]),e[26].set("execution_time_ns",e[23]),e[26].set("echo_encoding_execution_time_ns",e[24]),e[27]=new d.Map(),e[27].set("task_metadata",e[26]),e[27].set("action_type",void 0),e[27].set("content_type",void 0),e[27].set("identifiers",void 0),e[27].set("identifiers_v2",void 0),e[27].set("task_creation_source",void 0),e[27].set("message_payload_source",d.i64.cast([0,2])),e[28]=new d.Map(),e[28].set("error_code",d.i64.cast([0,1])),e[28].set("stored_procedure","LSEncryptedBackupsSerializeBackupPayloadV2StoredProcedure"),e[28].set("error_message",""),e[29]=d.createArray(),a=[void 0,e[28],e[27],e[29]],e[13]=a[0],e[14]=a[1],e[15]=a[2],e[16]=a[3],a}]):(f=c.item,d.sequence([function(a){return e[28]=f.mailboxRootKeyBlob,e[29]=f.deviceId,e[27]=f.backupTenancy,e[26]=f.encryptionVersion,e[18]=void 0,d.i64.neq(e[18],void 0)?d.resolve(e[19]=e[18]):d.sequence([function(a){return e[30]=d.createArray(),d.storedProcedure(b("LSIsEncryptionVersionSecure"),d.i64.cast([0,0])).then(function(a){return a=a,e[31]=a[0],a})},function(a){return e[31]?e[40]=(e[30].push(d.i64.cast([0,0])),e[30]):0,d.storedProcedure(b("LSIsEncryptionVersionSecure"),d.i64.cast([0,2])).then(function(a){return a=a,e[32]=a[0],a})},function(a){return e[32]?e[40]=(e[30].push(d.i64.cast([0,2])),e[30]):0,d.storedProcedure(b("LSIsEncryptionVersionSecure"),d.i64.cast([0,3])).then(function(a){return a=a,e[33]=a[0],a})},function(a){return e[33]?e[40]=(e[30].push(d.i64.cast([0,3])),e[30]):0,d.storedProcedure(b("LSIsEncryptionVersionSecure"),d.i64.cast([0,4])).then(function(a){return a=a,e[34]=a[0],a})},function(a){return e[34]?e[40]=(e[30].push(d.i64.cast([0,4])),e[30]):0,e[35]=d.createArray(),e[36]=d.i64.of_int32(e[30].length),d.i64.gt(e[36],d.i64.cast([0,0]))?d.loopAsync(e[36],function(a){return e[40]=a,d.sequence([function(a){return d.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),e[30],e[40]).then(function(a){return a=a,e[41]=a[0],e[42]=a[1],a})},function(a){return e[43]=(e[35].push(e[41]),e[35])}])}):d.resolve()},function(a){return d.sequence([function(a){return e[40]=d.createArray(),e[41]=d.i64.of_int32(e[35].length),d.i64.gt(e[41],d.i64.cast([0,0]))?d.loopAsync(e[41],function(a){return e[43]=a,d.sequence([function(a){return d.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),e[35],e[43]).then(function(a){return a=a,e[44]=a[0],e[45]=a[1],a})},function(a){return e[46]=(e[40].push(d.i64.to_string(e[44])),e[40])}])}):d.resolve()},function(a){return e[42]=e[40].join(","),e[37]=e[42]}])},function(a){return e[35].some(function(a){return d.i64.eq(e[26],a)})?e[38]=e[26]:e[38]=void 0,d.i64.neq(e[38],void 0)?e[39]=e[38]:e[39]=void 0,e[19]=e[39]}])},function(c){return d.i64.neq(e[19],void 0)?e[20]=e[19]:e[20]=d.i64.cast([0,0]),d.i64.neq(e[27],void 0)?e[21]=e[27]:e[21]=d.i64.cast([0,1]),d.i64.neq(e[29],void 0)?d.sequence([function(c){return d.db.table(177).fetch([[[a[0]]],"fk_pending_tasks"]).next().then(function(g,h){var c=g.done;g=g.value;return c?d.sequence([function(b){return d.db.table(2).fetch([[[a[0]]]]).next().then(function(c,f){var b=c.done;c=c.value;return b?(e[47]=d.i64.of_float(Date.now()),b=[a[0],void 0,void 0,void 0,void 0,d.i64.sub(d.i64.mul(e[47],d.i64.cast([0,1e6])),e[9]),void 0],e[35]=b[0],e[36]=b[1],e[37]=b[2],e[38]=b[3],e[39]=b[4],e[40]=b[5],e[41]=b[6],b):(f=c.item,e[47]=d.i64.of_float(Date.now()),b=[a[0],f.queueName,f.enqueueTimestampMs,void 0,f.firstExecutedTimestampMs,d.i64.sub(d.i64.mul(e[47],d.i64.cast([0,1e6])),e[9]),void 0],e[35]=b[0],e[36]=b[1],e[37]=b[2],e[38]=b[3],e[39]=b[4],e[40]=b[5],e[41]=b[6],b)})},function(a){return e[43]=new d.Map(),e[43].set("task_id",e[35]),e[43].set("queue_name",e[36]),e[43].set("enqueue_timestamp_ms",e[37]),e[43].set("priority",e[38]),e[43].set("first_executed_timestamp_ms",e[39]),e[43].set("execution_time_ns",e[40]),e[43].set("echo_encoding_execution_time_ns",e[41]),e[44]=new d.Map(),e[44].set("task_metadata",e[43]),e[44].set("action_type",void 0),e[44].set("content_type",void 0),e[44].set("identifiers",void 0),e[44].set("identifiers_v2",void 0),e[44].set("task_creation_source",void 0),e[44].set("message_payload_source",d.i64.cast([0,2])),e[45]=new d.Map(),e[45].set("error_code",d.i64.cast([0,5])),e[45].set("stored_procedure","LSEncryptedBackupsSerializeBackupPayloadV2StoredProcedure"),e[45].set("error_message","Pending backup context row not found"),e[46]=d.createArray(),a=[void 0,e[45],e[44],e[46]],e[30]=a[0],e[31]=a[1],e[32]=a[2],e[33]=a[3],a}]):(h=g.item,d.sequence([function(c){return e[40]=h.actionType,e[41]=h.contentType,e[45]=h.echoContent,e[43]=h.lsTraceId,e[44]=h.echoEncodingLatencyNs,e[42]=h.attachmentPayload,e[46]=h.tamThreadSubtype,e[47]=h.isInstamadillo,e[35]=new d.Map(),e[35].set("backup_id",d.i64.to_string(f.backupId)),e[35].set("act_thread_id",h.listKey),e[35].set("timestamp",h.sortKey),e[35].set("otid",h.uniqueKey),e[48]=h.error==null?d.i64.cast([0,0]):h.error,d.i64.eq(e[48],d.i64.cast([0,0]))?d.sequence([function(a){return e[49]=e[35].get("act_thread_id"),e[35],e[50]=e[35].get("otid"),e[35],d.storedProcedure(b("LSGetLatestEpochKeys"),!1).then(function(a){return a=a,e[51]=a[0],e[52]=a[1],a})},function(a){return e[51]!==void 0?d.sequence([function(a){return d.i64.eq(e[41],d.i64.cast([0,1]))?d.sequence([function(a){return e[62]=d.createArray(),e[67]=(e[62].push(d.i64.cast([0,32])),e[62]),d.nativeOperation(b("LSGetBlobFromString.nop"),["thread_ope_key","_",e[49]].join("")).then(function(a){return a=a,e[63]=a[0],a})},function(a){return d.nativeOperation(b("LSCreateDerivedKeys.nop"),e[63],void 0,e[28],e[62]).then(function(a){return a=a,e[64]=a[0],a})},function(a){return e[64]?e[65]=!1:e[65]=!0,e[65]?d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] Got null keys while deriving message list OPE key. Returning null blobish"),e[67]=d.createArray(),void 0!==void 0?e[68]=(e[67].push(void 0),e[67]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","Got null keys while deriving message list OPE key. Returning null blobish",e[67],d.i64.cast([0,3]))},function(a){return e[66]=void 0}]):d.sequence([function(a){return d.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),e[64],d.i64.cast([0,0])).then(function(a){return a=a,e[67]=a[0],e[68]=a[1],a})},function(a){return e[66]=e[67]}])},function(a){return e[59]=e[66]}]):d.sequence([function(a){return d.i64.eq(e[40],d.i64.cast([0,2]))?d.sequence([function(a){return e[63]=d.createArray(),e[68]=(e[63].push(d.i64.cast([0,32])),e[63]),d.nativeOperation(b("LSGetBlobFromString.nop"),["thread_ope_key","_",e[50]].join("")).then(function(a){return a=a,e[64]=a[0],a})},function(a){return d.nativeOperation(b("LSCreateDerivedKeys.nop"),e[64],void 0,e[28],e[63]).then(function(a){return a=a,e[65]=a[0],a})},function(a){return e[65]?e[66]=!1:e[66]=!0,e[66]?d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] Got null keys while deriving message list OPE key. Returning null blobish"),e[68]=d.createArray(),void 0!==void 0?e[69]=(e[68].push(void 0),e[68]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","Got null keys while deriving message list OPE key. Returning null blobish",e[68],d.i64.cast([0,3]))},function(a){return e[67]=void 0}]):d.sequence([function(a){return d.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),e[65],d.i64.cast([0,0])).then(function(a){return a=a,e[68]=a[0],e[69]=a[1],a})},function(a){return e[67]=e[68]}])},function(a){return e[62]=e[67]}]):d.resolve(e[62]=void 0)},function(a){return e[59]=e[62]}])},function(a){return d.blobs.neq(e[59],void 0)?d.sequence([function(a){return e[62]=e[51].get("epoch_keys"),e[51],e[63]=e[62].get("epoch_anon_id"),e[62],e[64]=e[62].get("epoch_root_key"),e[62],e[65]=d.createArray(),e[76]=(e[65].push(d.i64.cast([0,32])),e[65]),d.i64.ge(e[20],d.i64.cast([0,3]))?d.resolve(e[66]=void 0):d.sequence([function(a){return d.nativeOperation(b("LSGetBlobFromString.nop"),e[49]).then(function(a){return a=a,e[76]=a[0],a})},function(a){return e[66]=e[76]}])},function(a){return d.i64.ge(e[20],d.i64.cast([0,4]))?(e[76]="_",e[67]=["message_key_in_epoch",e[76],d.blobs.to_string(e[63]),e[76],"cipher_version",e[76],d.i64.to_string(e[20]),e[76],"thread",e[76],e[49]==null?"":e[49]].join("")):(d.i64.ge(e[20],d.i64.cast([0,3]))?(e[77]="_",e[76]=["message_key_in_epoch",e[77],d.blobs.to_string(e[63]),e[77],"cipher_version",e[77],d.i64.to_string(e[20]),e[77],"thread",e[77],e[49]==null?"":e[49]].join("")):(d.i64.ge(e[20],d.i64.cast([0,2]))?(e[78]="_",e[77]=["message_key_in_epoch",e[78],d.blobs.to_string(e[63]),e[78],"cipher_version",e[78],d.i64.to_string(e[20])].join("")):e[77]=["message_key_in_epoch","_",d.blobs.to_string(e[63])].join(""),e[76]=e[77]),e[67]=e[76]),d.nativeOperation(b("LSGetBlobFromString.nop"),e[67]).then(function(a){return a=a,e[68]=a[0],a})},function(a){return d.nativeOperation(b("LSCreateDerivedKeys.nop"),e[68],e[66],e[64],e[65]).then(function(a){return a=a,e[69]=a[0],a})},function(a){return e[69]?e[70]=!1:e[70]=!0,e[70]?d.resolve(e[71]=void 0):d.sequence([function(a){return d.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),e[69],d.i64.cast([0,0])).then(function(a){return a=a,e[76]=a[0],e[77]=a[1],a})},function(a){return e[71]=e[76]}])},function(a){return d.filter(d.db.table(169).fetch(),function(a){return d.blobs.eq(a.epochAnonIdBlob,d.blob("MA=="))}).next().then(function(c,f){var a=c.done;c=c.value;return a?d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBTableUtils] Failed to get mailbox_root_key_v2: epoch 0 is not available."),e[76]=d.createArray(),void 0!==void 0?e[77]=(e[76].push(void 0),e[76]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTableUtils","Failed to get mailbox_root_key_v2: epoch 0 is not available.",e[76],d.i64.cast([0,3]))},function(a){return e[72]=void 0}]):(f=c.item,d.sequence([function(a){return e[76]=d.createArray(),e[84]=(e[76].push(d.i64.cast([0,32])),e[76]),d.nativeOperation(b("LSCreateDerivedKeys.nop"),d.blob("a2RmX2luZm86bWFpbGJveF9yb290X2tleT5zYWx0X21haWxib3hfcm9vdF9rZXlfdjI="),void 0,e[28],e[76]).then(function(a){return a=a,e[77]=a[0],a})},function(a){return e[77]!==void 0?d.sequence([function(a){return e[84]=d.i64.of_int32(e[77].length),d.i64.ge(e[84],d.i64.cast([0,1]))?d.sequence([function(a){return d.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),e[77],d.i64.cast([0,0])).then(function(a){return a=a,e[86]=a[0],e[87]=a[1],a})},function(a){return e[85]=e[86]}]):d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),e[86]=d.createArray(),void 0!==void 0?e[87]=(e[86].push(void 0),e[86]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",e[86],d.i64.cast([0,3]))},function(a){return e[85]=void 0}])},function(a){return e[78]=e[85]}]):d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),e[84]=d.createArray(),void 0!==void 0?e[85]=(e[84].push(void 0),e[84]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",e[84],d.i64.cast([0,3]))},function(a){return e[78]=void 0}])},function(a){return d.blobs.neq(e[78],void 0)?e[79]=!0:e[79]=!1,e[79]?0:(function(a){d.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),d["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),e[80]=d.createArray(),e[84]=(e[80].push(d.i64.cast([0,32])),e[80]),d.nativeOperation(b("LSCreateDerivedKeys.nop"),d.blob("a2RmX2luZm86bWFpbGJveF9yb290X2tleT5tYWlsYm94X3Jvb3Rfa2V5X3Yy"),e[78],f.epochRootKeyBlob,e[80]).then(function(a){return a=a,e[81]=a[0],a})},function(a){return e[81]!==void 0?d.sequence([function(a){return e[84]=d.i64.of_int32(e[81].length),d.i64.ge(e[84],d.i64.cast([0,1]))?d.sequence([function(a){return d.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),e[81],d.i64.cast([0,0])).then(function(a){return a=a,e[86]=a[0],e[87]=a[1],a})},function(a){return e[85]=e[86]}]):d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),e[86]=d.createArray(),void 0!==void 0?e[87]=(e[86].push(void 0),e[86]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",e[86],d.i64.cast([0,3]))},function(a){return e[85]=void 0}])},function(a){return e[82]=e[85]}]):d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),e[84]=d.createArray(),void 0!==void 0?e[85]=(e[84].push(void 0),e[84]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",e[84],d.i64.cast([0,3]))},function(a){return e[82]=void 0}])},function(a){return d.blobs.neq(e[82],void 0)?e[83]=!0:e[83]=!1,e[83]?0:(function(a){d.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),d["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),e[72]=e[82]}]))})},function(a){return d.blobs.neq(e[71],void 0)?d.sequence([function(a){return d.blobs.neq(e[72],void 0)?d.sequence([function(a){return e[82]=d.createArray(),e[86]=(e[82].push(d.i64.cast([0,32])),e[82]),d.nativeOperation(b("LSCreateDerivedKeys.nop"),d.blob("a2RmX2luZm86bWFpbGJveF9yb290X2tleV92Mj5mYWxsYmFja19rZXk="),void 0,e[72],e[82]).then(function(a){return a=a,e[83]=a[0],a})},function(a){return e[83]!==void 0?d.sequence([function(a){return e[86]=d.i64.of_int32(e[83].length),d.i64.ge(e[86],d.i64.cast([0,1]))?d.sequence([function(a){return d.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),e[83],d.i64.cast([0,0])).then(function(a){return a=a,e[88]=a[0],e[89]=a[1],a})},function(a){return e[87]=e[88]}]):d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),e[88]=d.createArray(),void 0!==void 0?e[89]=(e[88].push(void 0),e[88]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",e[88],d.i64.cast([0,3]))},function(a){return e[87]=void 0}])},function(a){return e[84]=e[87]}]):d.sequence([function(a){return function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),e[86]=d.createArray(),void 0!==void 0?e[87]=(e[86].push(void 0),e[86]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",e[86],d.i64.cast([0,3]))},function(a){return e[84]=void 0}])},function(a){return d.blobs.neq(e[84],void 0)?e[85]=!0:e[85]=!1,e[85]?0:(function(a){d.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),d["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),e[76]=e[84]}]):d.resolve(e[76]=void 0)},function(a){return e[77]=e[62].get("epoch_root_key"),e[62],e[78]=e[62].get("epoch_anon_id"),e[62],e[79]=e[62].get("epoch_id"),e[62],e[80]=new d.Map(),e[80].set("payload_key",e[71]),e[80].set("payload_fallback_key",e[76]),e[80].set("encryption_version",e[20]),e[80].set("epoch_root_key",e[77]),e[80].set("epoch_anon_id",e[78]),e[80].set("epoch_id",e[79]),e[81]=new d.Map(),e[81].set("ope_key",e[59]),e[81].set("message_payload_encryption_keys",e[80]),e[81].set("ocmf_shared_key",f.ocmfClientStateBlob),e[81].set("mailbox_base_salt",e[28]),e[81].set("mailbox_root_key_v2",e[72]),a=[e[81],void 0],e[74]=a[0],e[75]=a[1],a}]):d.resolve((e[76]=new d.Map(),e[76].set("error_code",d.i64.cast([0,26])),e[76].set("stored_procedure","MEBKeyDeriver"),e[76].set("error_message",""),a=[void 0,e[76]],e[74]=a[0],e[75]=a[1],a))},function(a){return a=[e[74],e[75]],e[60]=a[0],e[61]=a[1],a}]):d.resolve((e[62]=new d.Map(),e[62].set("error_code",d.i64.cast([0,25])),e[62].set("stored_procedure","MEBKeyDeriver"),e[62].set("error_message",""),a=[void 0,e[62]],e[60]=a[0],e[61]=a[1],a))},function(a){return a=[e[60],e[61]],e[53]=a[0],e[54]=a[1],a}]):d.resolve((a=[void 0,e[52]],e[53]=a[0],e[54]=a[1],a))},function(c){return e[53]!==void 0?d.sequence([function(a){return e[59]=e[35].get("backup_id"),e[35],e[60]=e[35].get("act_thread_id"),e[35],e[61]=e[35].get("timestamp"),e[35],e[62]=e[35].get("otid"),e[35],d.storedProcedure(b("LSEncryptIdentifiersV2"),e[40],e[41],e[59],e[60],d.i64.from_string(e[61]),e[62],e[53]).then(function(a){return a=a,e[63]=a[0],e[64]=a[1],a})},function(c){return e[63]!==void 0?d.sequence([function(c){return e[69]=e[35].get("act_thread_id"),e[35],d.storedProcedure(b("LSLoadAndEncryptProtobufV2"),a[0],e[53],e[69]).then(function(a){return a=a,e[70]=a[0],e[71]=a[1],a})},function(c){return d.sequence([function(c){return d.i64.eq(e[40],d.i64.cast([0,1]))?(e[84]=e[45]===""?void 0:e[45],e[84]!==void 0?(c=[e[84],void 0],e[82]=c[0],e[83]=c[1],c):(e[85]=new d.Map(),e[85].set("error_code",d.i64.cast([0,30])),e[85].set("stored_procedure","LSEncryptedBackupsSerializeBackupPayloadV2StoredProcedure"),e[85].set("error_message",""),c=[void 0,e[85]],e[82]=c[0],e[83]=c[1],c),c=[e[82],e[83]],e[76]=c[0],e[77]=c[1],c):(c=["",void 0],e[76]=c[0],e[77]=c[1],c),e[76]!==void 0?d.sequence([function(a){return d.i64.eq(e[40],d.i64.cast([0,1]))?d.sequence([function(a){return e[88]=e[35].get("backup_id"),e[35],e[89]=e[35].get("act_thread_id"),e[35],d.storedProcedure(b("LSEncryptMessagePayloadV2"),e[88],e[89],e[53],e[76]).then(function(a){return a=a,e[90]=a[0],e[91]=a[1],a})},function(a){return a=[e[90],e[91]],e[82]=a[0],e[83]=a[1],a}]):d.resolve((e[88]=new d.Map(),e[88].set("encrypted_message_payload",""),e[88].set("value_secret_ref",""),a=[e[88],void 0],e[82]=a[0],e[83]=a[1],a))},function(c){return e[82]!==void 0?d.sequence([function(a){return e[88]=e[63].get("act_thread_id_ocmf_partial"),e[63],e[89]=e[63].get("otid_ocmf_partial"),e[63],e[90]=e[63].get("timestamp_encrypted"),e[63],e[91]=new d.Map(),e[91].set("list_key",e[88]),e[91].set("unique_key",e[89]),e[91].set("sort_key",e[90]),e[82]!==void 0?(e[123]=e[82].get("encrypted_message_payload"),e[82],e[124]=e[82].get("value_secret_ref"),e[82],e[125]=new d.Map(),e[125].set("value",e[123]),e[125].set("value_secret_ref",e[124]),e[92]=e[125]):e[92]=void 0,e[93]=new d.Map(),e[93].set("list_item_id",e[91]),e[93].set("list_item",e[92]),e[93].set("action_type",e[40]),e[94]=e[35].get("timestamp"),e[35],e[95]=e[35].get("otid"),e[35],e[96]=e[35].get("act_thread_id"),e[35],e[97]=new d.Map(),e[97].set("timestamp",e[94]),e[97].set("otid",e[95]),e[97].set("wa_thread_id",d.i64.from_string(e[96])),e[98]=e[53].get("mailbox_base_salt"),e[53],d.nativeOperation(b("LSBase64Encode.nop"),e[98]).then(function(a){return a=a,e[99]=a[0],a})},function(a){return e[100]=e[53].get("ocmf_shared_key"),e[53],d.nativeOperation(b("LSBase64Encode.nop"),e[100]).then(function(a){return a=a,e[101]=a[0],a})},function(a){return e[102]=new d.Map(),e[102].set("mailbox_root_key",e[99]==null?"":e[99]),e[102].set("ocmf_client_state_blob",e[101]==null?"":e[101]),e[103]=e[63].get("backup_id_ocmf_partial"),e[63],e[104]=e[53].get("message_payload_encryption_keys"),e[53],e[105]=e[104].get("epoch_id"),e[104],e[106]=e[53].get("message_payload_encryption_keys"),e[53],e[107]=e[106].get("encryption_version"),e[106],e[122]=e[43]==null?"":e[43],e[108]=new d.Map(),e[108].set("mailbox_partial_id",e[103]),e[108].set("action",e[93]),e[108].set("device_id",e[29]),e[108].set("echo_version",d.i64.cast([0,0])),e[108].set("epoch_id",e[105]),e[108].set("trace_id",void 0),e[108].set("encryption_version",e[107]),e[108].set("is_thread",d.i64.eq(e[41],d.i64.cast([0,2]))),e[108].set("raw_identifiers",e[97]),e[108].set("raw_tokens",e[102]),e[108].set("request_id",e[122]),e[108].set("tam_thread_subtype",e[46]==null?d.i64.cast([0,0]):e[46]),e[108].set("is_instamadillo",e[47]==null?!1:e[47]),e[70]!==void 0?d.sequence([function(a){return e[123]=e[70].get("supplemental_data_encrypted"),e[70],e[123]!==void 0?d.sequence([function(a){return e[125]=e[70].get("protobuf_encrypted"),e[70],e[126]=e[70].get("backup_action"),e[70],e[127]=e[70].get("timestamp_ms"),e[70],e[128]=e[123].get("sk_ciphertext"),e[123],d.nativeOperation(b("LSBase64Encode.nop"),e[128]).then(function(a){return a=a,e[129]=a[0],a})},function(a){return e[130]=e[123].get("sk_hash"),e[123],d.nativeOperation(b("LSBase64Encode.nop"),e[130]).then(function(a){return a=a,e[131]=a[0],a})},function(a){return e[132]=e[70].get("message_tags"),e[70],e[133]=new d.Map(),e[133].set("supplementary_data_key",void 0),e[133].set("encrypted_protobuf",e[125]),e[133].set("key_value_backup_action",e[126]),e[133].set("protobuf_ts_ms",e[127]),e[133].set("supplemental_key_ciphertext",e[129]),e[133].set("supplemental_key_hash",e[131]),e[133].set("message_tags",e[132]),e[124]=e[133]}]):d.resolve((e[125]=e[70].get("protobuf_encrypted"),e[70],e[126]=e[70].get("backup_action"),e[70],e[127]=e[70].get("timestamp_ms"),e[70],e[128]=e[70].get("message_tags"),e[70],e[129]=new d.Map(),e[129].set("supplementary_data_key",void 0),e[129].set("encrypted_protobuf",e[125]),e[129].set("key_value_backup_action",e[126]),e[129].set("protobuf_ts_ms",e[127]),e[129].set("message_tags",e[128]),e[124]=e[129]))},function(a){return e[108].set("key_value_backup_payload",e[124])}]):d.resolve()},function(a){return e[42]!==void 0?e[108].set("attachment_backup_payload",e[42]):function(a){d.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsSerializeBackupPayloadV2StoredProcedure] attachment_payload is null."),e[122]!==void 0?d.nativeOperation(b("LSLogWebQpl.nop"),e[122],d.i64.cast([0,521481602]),"upload_start",d.i64.cast([0,0]),void 0,void 0):d.resolve()},function(a){return d.sequence([function(a){return e[43]!==void 0?d.storedProcedure(b("LSAppendDataTraceAddon"),e[43],d.i64.cast([0,1463]),d.i64.cast([0,2]),void 0,void 0):d.resolve()},function(a){return d.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,e[123]=a[0],a})},function(a){return e[123]?e[124]=!0:e[124]=!1,e[124]&&!0?(function(a){d.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),e[125]=d.createArray(),void 0!==void 0?e[126]=(e[125].push(void 0),e[125]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",e[125],d.i64.cast([0,3]))):d.resolve()}])},function(b){return e[109]=d.toJSON(e[108]),d.db.table(2).fetch([[[a[0]]]]).next().then(function(c,f){var b=c.done;c=c.value;return b?(e[123]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[124]=void 0:e[124]=e[44],b=[a[0],void 0,void 0,void 0,void 0,d.i64.sub(d.i64.mul(e[123],d.i64.cast([0,1e6])),e[9]),e[124]],e[110]=b[0],e[111]=b[1],e[112]=b[2],e[113]=b[3],e[114]=b[4],e[115]=b[5],e[116]=b[6],b):(f=c.item,e[123]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[124]=void 0:e[124]=e[44],b=[a[0],f.queueName,f.enqueueTimestampMs,void 0,f.firstExecutedTimestampMs,d.i64.sub(d.i64.mul(e[123],d.i64.cast([0,1e6])),e[9]),e[124]],e[110]=b[0],e[111]=b[1],e[112]=b[2],e[113]=b[3],e[114]=b[4],e[115]=b[5],e[116]=b[6],b)})},function(a){return e[118]=new d.Map(),e[118].set("task_id",e[110]),e[118].set("queue_name",e[111]),e[118].set("enqueue_timestamp_ms",e[112]),e[118].set("priority",e[113]),e[118].set("first_executed_timestamp_ms",e[114]),e[118].set("execution_time_ns",e[115]),e[118].set("echo_encoding_execution_time_ns",e[116]),e[119]=new d.Map(),e[119].set("task_metadata",e[118]),e[119].set("action_type",e[40]),e[119].set("content_type",e[41]),e[119].set("identifiers",void 0),e[119].set("identifiers_v2",e[35]),e[119].set("task_creation_source",void 0),e[119].set("message_payload_source",d.i64.cast([0,2])),e[120]=new d.Map(),e[120].set("payload",e[109]),e[121]=d.createArray(),e[123]=(e[121].push(e[71]),e[121]),a=[e[120],void 0,e[119],e[121]],e[84]=a[0],e[85]=a[1],e[86]=a[2],e[87]=a[3],a}]):d.sequence([function(b){return d.sequence([function(b){return d.db.table(2).fetch([[[a[0]]]]).next().then(function(c,f){var b=c.done;c=c.value;return b?(e[103]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[104]=void 0:e[104]=e[44],b=[a[0],void 0,void 0,void 0,void 0,d.i64.sub(d.i64.mul(e[103],d.i64.cast([0,1e6])),e[9]),e[104]],e[92]=b[0],e[93]=b[1],e[94]=b[2],e[95]=b[3],e[96]=b[4],e[97]=b[5],e[98]=b[6],b):(f=c.item,e[103]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[104]=void 0:e[104]=e[44],b=[a[0],f.queueName,f.enqueueTimestampMs,void 0,f.firstExecutedTimestampMs,d.i64.sub(d.i64.mul(e[103],d.i64.cast([0,1e6])),e[9]),e[104]],e[92]=b[0],e[93]=b[1],e[94]=b[2],e[95]=b[3],e[96]=b[4],e[97]=b[5],e[98]=b[6],b)})},function(a){return e[100]=new d.Map(),e[100].set("task_id",e[92]),e[100].set("queue_name",e[93]),e[100].set("enqueue_timestamp_ms",e[94]),e[100].set("priority",e[95]),e[100].set("first_executed_timestamp_ms",e[96]),e[100].set("execution_time_ns",e[97]),e[100].set("echo_encoding_execution_time_ns",e[98]),e[101]=new d.Map(),e[101].set("task_metadata",e[100]),e[101].set("action_type",e[40]),e[101].set("content_type",e[41]),e[101].set("identifiers",void 0),e[101].set("identifiers_v2",e[35]),e[101].set("task_creation_source",void 0),e[101].set("message_payload_source",d.i64.cast([0,2])),e[102]=d.createArray(),e[103]=(e[102].push(e[71]),e[102]),a=[void 0,e[83],e[101],e[102]],e[88]=a[0],e[89]=a[1],e[90]=a[2],e[91]=a[3],a}])},function(a){return a=[e[88],e[89],e[90],e[91]],e[84]=a[0],e[85]=a[1],e[86]=a[2],e[87]=a[3],a}])},function(a){return a=[e[84],e[85],e[86],e[87]],e[78]=a[0],e[79]=a[1],e[80]=a[2],e[81]=a[3],a}]):d.sequence([function(b){return d.sequence([function(b){return d.db.table(2).fetch([[[a[0]]]]).next().then(function(c,f){var b=c.done;c=c.value;return b?(e[97]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[98]=void 0:e[98]=e[44],b=[a[0],void 0,void 0,void 0,void 0,d.i64.sub(d.i64.mul(e[97],d.i64.cast([0,1e6])),e[9]),e[98]],e[86]=b[0],e[87]=b[1],e[88]=b[2],e[89]=b[3],e[90]=b[4],e[91]=b[5],e[92]=b[6],b):(f=c.item,e[97]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[98]=void 0:e[98]=e[44],b=[a[0],f.queueName,f.enqueueTimestampMs,void 0,f.firstExecutedTimestampMs,d.i64.sub(d.i64.mul(e[97],d.i64.cast([0,1e6])),e[9]),e[98]],e[86]=b[0],e[87]=b[1],e[88]=b[2],e[89]=b[3],e[90]=b[4],e[91]=b[5],e[92]=b[6],b)})},function(a){return e[94]=new d.Map(),e[94].set("task_id",e[86]),e[94].set("queue_name",e[87]),e[94].set("enqueue_timestamp_ms",e[88]),e[94].set("priority",e[89]),e[94].set("first_executed_timestamp_ms",e[90]),e[94].set("execution_time_ns",e[91]),e[94].set("echo_encoding_execution_time_ns",e[92]),e[95]=new d.Map(),e[95].set("task_metadata",e[94]),e[95].set("action_type",e[40]),e[95].set("content_type",e[41]),e[95].set("identifiers",void 0),e[95].set("identifiers_v2",e[35]),e[95].set("task_creation_source",void 0),e[95].set("message_payload_source",d.i64.cast([0,2])),e[96]=d.createArray(),e[97]=(e[96].push(e[71]),e[96]),a=[void 0,e[77],e[95],e[96]],e[82]=a[0],e[83]=a[1],e[84]=a[2],e[85]=a[3],a}])},function(a){return a=[e[82],e[83],e[84],e[85]],e[78]=a[0],e[79]=a[1],e[80]=a[2],e[81]=a[3],a}])},function(a){return a=[e[78],e[79],e[80],e[81]],e[72]=a[0],e[73]=a[1],e[74]=a[2],e[75]=a[3],a}])},function(a){return a=[e[72],e[73],e[74],e[75]],e[65]=a[0],e[66]=a[1],e[67]=a[2],e[68]=a[3],a}]):d.sequence([function(b){return d.db.table(2).fetch([[[a[0]]]]).next().then(function(c,f){var b=c.done;c=c.value;return b?(e[80]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[81]=void 0:e[81]=e[44],b=[a[0],void 0,void 0,void 0,void 0,d.i64.sub(d.i64.mul(e[80],d.i64.cast([0,1e6])),e[9]),e[81]],e[69]=b[0],e[70]=b[1],e[71]=b[2],e[72]=b[3],e[73]=b[4],e[74]=b[5],e[75]=b[6],b):(f=c.item,e[80]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[81]=void 0:e[81]=e[44],b=[a[0],f.queueName,f.enqueueTimestampMs,void 0,f.firstExecutedTimestampMs,d.i64.sub(d.i64.mul(e[80],d.i64.cast([0,1e6])),e[9]),e[81]],e[69]=b[0],e[70]=b[1],e[71]=b[2],e[72]=b[3],e[73]=b[4],e[74]=b[5],e[75]=b[6],b)})},function(a){return e[77]=new d.Map(),e[77].set("task_id",e[69]),e[77].set("queue_name",e[70]),e[77].set("enqueue_timestamp_ms",e[71]),e[77].set("priority",e[72]),e[77].set("first_executed_timestamp_ms",e[73]),e[77].set("execution_time_ns",e[74]),e[77].set("echo_encoding_execution_time_ns",e[75]),e[78]=new d.Map(),e[78].set("task_metadata",e[77]),e[78].set("action_type",e[40]),e[78].set("content_type",e[41]),e[78].set("identifiers",void 0),e[78].set("identifiers_v2",e[35]),e[78].set("task_creation_source",void 0),e[78].set("message_payload_source",d.i64.cast([0,2])),e[79]=d.createArray(),e[80]=(e[79].push(void 0),e[79]),a=[void 0,e[64],e[78],e[79]],e[65]=a[0],e[66]=a[1],e[67]=a[2],e[68]=a[3],a}])},function(a){return a=[e[65],e[66],e[67],e[68]],e[55]=a[0],e[56]=a[1],e[57]=a[2],e[58]=a[3],a}]):d.sequence([function(b){return d.db.table(2).fetch([[[a[0]]]]).next().then(function(c,f){var b=c.done;c=c.value;return b?(e[70]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[71]=void 0:e[71]=e[44],b=[a[0],void 0,void 0,void 0,void 0,d.i64.sub(d.i64.mul(e[70],d.i64.cast([0,1e6])),e[9]),e[71]],e[59]=b[0],e[60]=b[1],e[61]=b[2],e[62]=b[3],e[63]=b[4],e[64]=b[5],e[65]=b[6],b):(f=c.item,e[70]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[71]=void 0:e[71]=e[44],b=[a[0],f.queueName,f.enqueueTimestampMs,void 0,f.firstExecutedTimestampMs,d.i64.sub(d.i64.mul(e[70],d.i64.cast([0,1e6])),e[9]),e[71]],e[59]=b[0],e[60]=b[1],e[61]=b[2],e[62]=b[3],e[63]=b[4],e[64]=b[5],e[65]=b[6],b)})},function(a){return e[67]=new d.Map(),e[67].set("task_id",e[59]),e[67].set("queue_name",e[60]),e[67].set("enqueue_timestamp_ms",e[61]),e[67].set("priority",e[62]),e[67].set("first_executed_timestamp_ms",e[63]),e[67].set("execution_time_ns",e[64]),e[67].set("echo_encoding_execution_time_ns",e[65]),e[68]=new d.Map(),e[68].set("task_metadata",e[67]),e[68].set("action_type",e[40]),e[68].set("content_type",e[41]),e[68].set("identifiers",void 0),e[68].set("identifiers_v2",e[35]),e[68].set("task_creation_source",void 0),e[68].set("message_payload_source",d.i64.cast([0,2])),e[69]=d.createArray(),e[70]=(e[69].push(void 0),e[69]),a=[void 0,e[54],e[68],e[69]],e[55]=a[0],e[56]=a[1],e[57]=a[2],e[58]=a[3],a}])},function(a){return a=[e[55],e[56],e[57],e[58]],e[36]=a[0],e[37]=a[1],e[38]=a[2],e[39]=a[3],a}]):d.sequence([function(b){return d.db.table(2).fetch([[[a[0]]]]).next().then(function(c,f){var b=c.done;c=c.value;return b?(e[61]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[62]=void 0:e[62]=e[44],b=[a[0],void 0,void 0,void 0,void 0,d.i64.sub(d.i64.mul(e[61],d.i64.cast([0,1e6])),e[9]),e[62]],e[49]=b[0],e[50]=b[1],e[51]=b[2],e[52]=b[3],e[53]=b[4],e[54]=b[5],e[55]=b[6],b):(f=c.item,e[61]=d.i64.of_float(Date.now()),d.i64.eq(e[44],d.i64.cast([0,0]))||d.i64.eq(e[44],void 0)?e[62]=void 0:e[62]=e[44],b=[a[0],f.queueName,f.enqueueTimestampMs,void 0,f.firstExecutedTimestampMs,d.i64.sub(d.i64.mul(e[61],d.i64.cast([0,1e6])),e[9]),e[62]],e[49]=b[0],e[50]=b[1],e[51]=b[2],e[52]=b[3],e[53]=b[4],e[54]=b[5],e[55]=b[6],b)})},function(a){return e[57]=new d.Map(),e[57].set("task_id",e[49]),e[57].set("queue_name",e[50]),e[57].set("enqueue_timestamp_ms",e[51]),e[57].set("priority",e[52]),e[57].set("first_executed_timestamp_ms",e[53]),e[57].set("execution_time_ns",e[54]),e[57].set("echo_encoding_execution_time_ns",e[55]),e[58]=new d.Map(),e[58].set("task_metadata",e[57]),e[58].set("action_type",e[40]),e[58].set("content_type",e[41]),e[58].set("identifiers",void 0),e[58].set("identifiers_v2",e[35]),e[58].set("task_creation_source",void 0),e[58].set("message_payload_source",d.i64.cast([0,2])),e[59]=new d.Map(),e[59].set("error_code",e[48]),e[59].set("stored_procedure","LSEncryptedBackupsSerializeBackupPayloadV2StoredProcedure"),e[59].set("error_message",""),e[60]=d.createArray(),a=[void 0,e[59],e[58],e[60]],e[36]=a[0],e[37]=a[1],e[38]=a[2],e[39]=a[3],a}])},function(a){return a=[e[36],e[37],e[38],e[39]],e[30]=a[0],e[31]=a[1],e[32]=a[2],e[33]=a[3],a}]))})},function(a){return a=[e[30],e[31],e[32],e[33]],e[22]=a[0],e[23]=a[1],e[24]=a[2],e[25]=a[3],a}]):d.sequence([function(b){return d.db.table(2).fetch([[[a[0]]]]).next().then(function(c,f){var b=c.done;c=c.value;return b?(e[42]=d.i64.of_float(Date.now()),b=[a[0],void 0,void 0,void 0,void 0,d.i64.sub(d.i64.mul(e[42],d.i64.cast([0,1e6])),e[9]),void 0],e[30]=b[0],e[31]=b[1],e[32]=b[2],e[33]=b[3],e[34]=b[4],e[35]=b[5],e[36]=b[6],b):(f=c.item,e[42]=d.i64.of_float(Date.now()),b=[a[0],f.queueName,f.enqueueTimestampMs,void 0,f.firstExecutedTimestampMs,d.i64.sub(d.i64.mul(e[42],d.i64.cast([0,1e6])),e[9]),void 0],e[30]=b[0],e[31]=b[1],e[32]=b[2],e[33]=b[3],e[34]=b[4],e[35]=b[5],e[36]=b[6],b)})},function(a){return e[38]=new d.Map(),e[38].set("task_id",e[30]),e[38].set("queue_name",e[31]),e[38].set("enqueue_timestamp_ms",e[32]),e[38].set("priority",e[33]),e[38].set("first_executed_timestamp_ms",e[34]),e[38].set("execution_time_ns",e[35]),e[38].set("echo_encoding_execution_time_ns",e[36]),e[39]=new d.Map(),e[39].set("task_metadata",e[38]),e[39].set("action_type",void 0),e[39].set("content_type",void 0),e[39].set("identifiers",void 0),e[39].set("identifiers_v2",void 0),e[39].set("task_creation_source",void 0),e[39].set("message_payload_source",d.i64.cast([0,2])),e[40]=new d.Map(),e[40].set("error_code",d.i64.cast([0,24])),e[40].set("stored_procedure","LSEncryptedBackupsSerializeBackupPayloadV2StoredProcedure"),e[40].set("error_message",""),e[41]=d.createArray(),a=[void 0,e[40],e[39],e[41]],e[22]=a[0],e[23]=a[1],e[24]=a[2],e[25]=a[3],a}])},function(a){return a=[e[22],e[23],e[24],e[25]],e[13]=a[0],e[14]=a[1],e[15]=a[2],e[16]=a[3],a}]))})},function(a){return a=[e[13],e[14],e[15],e[16]],e[2]=a[0],e[3]=a[1],e[4]=a[2],e[5]=a[3],a}]):d.sequence([function(b){return d.db.table(2).fetch([[[a[0]]]]).next().then(function(b,c){var f=b.done;b=b.value;return f?(e[25]=d.i64.of_float(Date.now()),f=[a[0],void 0,void 0,void 0,void 0,d.i64.sub(d.i64.mul(e[25],d.i64.cast([0,1e6])),e[9]),void 0],e[13]=f[0],e[14]=f[1],e[15]=f[2],e[16]=f[3],e[17]=f[4],e[18]=f[5],e[19]=f[6],f):(c=b.item,e[25]=d.i64.of_float(Date.now()),f=[a[0],c.queueName,c.enqueueTimestampMs,void 0,c.firstExecutedTimestampMs,d.i64.sub(d.i64.mul(e[25],d.i64.cast([0,1e6])),e[9]),void 0],e[13]=f[0],e[14]=f[1],e[15]=f[2],e[16]=f[3],e[17]=f[4],e[18]=f[5],e[19]=f[6],f)})},function(a){return e[21]=new d.Map(),e[21].set("task_id",e[13]),e[21].set("queue_name",e[14]),e[21].set("enqueue_timestamp_ms",e[15]),e[21].set("priority",e[16]),e[21].set("first_executed_timestamp_ms",e[17]),e[21].set("execution_time_ns",e[18]),e[21].set("echo_encoding_execution_time_ns",e[19]),e[22]=new d.Map(),e[22].set("task_metadata",e[21]),e[22].set("action_type",void 0),e[22].set("content_type",void 0),e[22].set("identifiers",void 0),e[22].set("identifiers_v2",void 0),e[22].set("task_creation_source",void 0),e[22].set("message_payload_source",d.i64.cast([0,2])),e[23]=new d.Map(),e[23].set("error_code",d.i64.cast([0,4])),e[23].set("stored_procedure","LSEncryptedBackupsSerializeBackupPayloadV2StoredProcedure"),e[23].set("error_message",""),e[24]=d.createArray(),a=[void 0,e[23],e[22],e[24]],e[2]=a[0],e[3]=a[1],e[4]=a[2],e[5]=a[3],a}])},function(a){return e[6]=d.i64.of_float(Date.now()),e[7]=d.i64.random(),e[10]="Finishing execution. Execution time: ",e[11]=d.i64.to_string(d.i64.sub(e[6],e[0])),e[12]=" ms",e[8]="",function(a){d.logger(a).info(a)}(["[EncryptedBackups][serializeBackupPayloadV2] ",e[8],e[10],e[8],e[11],e[8],e[12]].join("")),d.i64.eq(d.i64.mod_(e[7],d.i64.cast([0,1e3])),d.i64.cast([0,0]))?(e[13]=",",e[14]=d.createArray(),void 0!==void 0?e[15]=(e[14].push(void 0),e[14]):0,d.nativeOperation(b("LSLogMebClientEvent.nop"),"serializeBackupPayloadV2",[e[10],e[13],e[11],e[13],e[12]].join(""),e[14],d.i64.cast([0,4]))):d.resolve()},function(a){return a=[e[2],e[3],e[4],e[5]],f[0]=a[0],f[1]=a[1],f[2]=a[2],f[3]=a[3],a}])},function(a){return d.resolve(f)}])}a.__sproc_name__="LSEncryptedBackupsSerializeBackupPayloadV2StoredProcedure";d=a;g["default"]=d}),98);
__d("LSTaskSerializerEncryptedBackupsUpload",["LSArrayGetObjectAt","LSLogMebClientEvent.nop","LSSerializeBackupPayloadV2"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(b){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][taskSerializerEncryptedBackupsUpload] Beginning execution."),d[1]=c.i64.of_float(Date.now()),c.forEach(c.db.table(177).fetch([[[a[0]]],"fk_pending_tasks"]),function(a){var b=a.update;a.item;return b({backupStatus:c.i64.cast([0,2])})})},function(e){return c.storedProcedure(b("LSSerializeBackupPayloadV2"),a[0]).then(function(a){return a=a,d[2]=a[0],d[3]=a[1],d[4]=a[2],d[5]=a[3],a})},function(a){return d[6]=c.i64.of_int32(d[5].length),c.i64.gt(d[6],c.i64.cast([0,0]))?c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[5],c.i64.cast([0,0])).then(function(a){return a=a,d[20]=a[0],d[21]=a[1],a})},function(a){return d[7]=d[20]}]):c.resolve(d[7]=void 0)},function(a){return d[2]?d[8]=!1:d[8]=!0,d[8]?(d[3]?d[20]=!1:d[20]=!0,d[20]?(a=[void 0,void 0,d[7],d[4]],d[21]=a[0],d[22]=a[1],d[23]=a[2],d[24]=a[3],a):(a=[void 0,d[3],d[7],d[4]],d[21]=a[0],d[22]=a[1],d[23]=a[2],d[24]=a[3],a),a=[d[21],d[22],d[23],d[24]],d[9]=a[0],d[10]=a[1],d[11]=a[2],d[12]=a[3],a):(d[20]=d[2].get("payload"),d[2],a=[d[20],d[3],d[7],d[4]],d[9]=a[0],d[10]=a[1],d[11]=a[2],d[12]=a[3],a),d[20]=new c.Map(),d[21]=d[20].set("success",d[9]),d[22]=d[20].set("failure",d[10]),d[23]=d[20].set("protobuf_failure",d[11]),d[24]=d[20].set("context",d[12]),d[25]=c.toJSON(d[20]),d[13]=d[25],d[14]=c.i64.of_float(Date.now()),d[15]=c.i64.random(),d[17]="Finishing execution. Execution time: ",d[18]=c.i64.to_string(c.i64.sub(d[14],d[0])),d[19]=" ms",d[16]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][taskSerializerEncryptedBackupsUpload] ",d[16],d[17],d[16],d[18],d[16],d[19]].join("")),c.i64.eq(c.i64.mod_(d[15],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[20]=",",d[21]=c.createArray(),void 0!==void 0?d[22]=(d[21].push(void 0),d[21]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"taskSerializerEncryptedBackupsUpload",[d[17],d[20],d[18],d[20],d[19]].join(""),d[21],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[13],c.i64.cast([0,50026])],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsTaskSerializerEncryptedBackupsUploadStoredProcedure";e.exports=a}),null);
__d("LSLoadProtobufBackupSerializedPayloadData",["LSArrayGetObjectAt","LSBase64Encode.nop","LSCreateDerivedKeys.nop","LSEncryptIdentifiersV2","LSGetBlobFromString.nop","LSGetLatestEpochKeys","LSIsEncryptionVersionSecure","LSLoadAndEncryptProtobufV2","LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(b){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][loadProtobufBackupSerializedPayloadData] Beginning execution."),d[1]=c.i64.of_float(Date.now()),d[19]=c.i64.mul(d[1],c.i64.cast([0,1e6])),c.db.table(2).fetch([[[a[0]]]]).next().then(function(b,e){var f=b.done;b=b.value;return f?(d[23]=c.i64.of_float(Date.now()),f=[a[0],void 0,void 0,void 0,void 0,c.i64.sub(c.i64.mul(d[23],c.i64.cast([0,1e6])),d[19]),void 0],d[2]=f[0],d[3]=f[1],d[4]=f[2],d[5]=f[3],d[6]=f[4],d[7]=f[5],d[8]=f[6],f):(e=b.item,d[23]=c.i64.of_float(Date.now()),f=[a[0],e.queueName,e.enqueueTimestampMs,e.priority,e.firstExecutedTimestampMs,c.i64.sub(c.i64.mul(d[23],c.i64.cast([0,1e6])),d[19]),void 0],d[2]=f[0],d[3]=f[1],d[4]=f[2],d[5]=f[3],d[6]=f[4],d[7]=f[5],d[8]=f[6],f)})},function(e){return d[10]=new c.Map(),d[10].set("task_id",d[2]),d[10].set("queue_name",d[3]),d[10].set("enqueue_timestamp_ms",d[4]),d[10].set("priority",d[5]),d[10].set("first_executed_timestamp_ms",d[6]),d[10].set("execution_time_ns",d[7]),d[10].set("echo_encoding_execution_time_ns",d[8]),d[11]=new c.Map(),d[11].set("task_metadata",d[10]),d[11].set("action_type",void 0),d[11].set("content_type",void 0),d[11].set("identifiers",void 0),d[11].set("identifiers_v2",void 0),d[11].set("task_creation_source",void 0),d[11].set("message_payload_source",c.i64.cast([0,2])),c.islc(c.filter(c.db.table(168).fetch(),function(a){return c.i64.eq(a.authorityLevel,c.i64.cast([0,80]))||!1}),0,c.i64.to_float(c.i64.cast([0,1]))).next().then(function(e,f){var g=e.done;e=e.value;return g?(d[23]=new c.Map(),d[23].set("error_code",c.i64.cast([0,1])),d[23].set("stored_procedure","LSEncryptedBackupsLoadProtobufBackupSerializedPayloadDataStoredProcedure"),d[23].set("error_message",""),g=[void 0,d[23],d[11]],d[12]=g[0],d[13]=g[1],d[14]=g[2],g):(f=e.item,c.sequence([function(a){return d[32]=f.backupId,d[33]=f.mailboxRootKeyBlob,d[34]=f.deviceId,d[31]=f.backupTenancy,d[30]=f.encryptionVersion,d[23]=void 0,c.i64.neq(d[23],void 0)?c.resolve(d[24]=d[23]):c.sequence([function(a){return d[35]=c.createArray(),c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,0])).then(function(a){return a=a,d[36]=a[0],a})},function(a){return d[36]?d[45]=(d[35].push(c.i64.cast([0,0])),d[35]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,2])).then(function(a){return a=a,d[37]=a[0],a})},function(a){return d[37]?d[45]=(d[35].push(c.i64.cast([0,2])),d[35]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,3])).then(function(a){return a=a,d[38]=a[0],a})},function(a){return d[38]?d[45]=(d[35].push(c.i64.cast([0,3])),d[35]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,4])).then(function(a){return a=a,d[39]=a[0],a})},function(a){return d[39]?d[45]=(d[35].push(c.i64.cast([0,4])),d[35]):0,d[40]=c.createArray(),d[41]=c.i64.of_int32(d[35].length),c.i64.gt(d[41],c.i64.cast([0,0]))?c.loopAsync(d[41],function(a){return d[45]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[35],d[45]).then(function(a){return a=a,d[46]=a[0],d[47]=a[1],a})},function(a){return d[48]=(d[40].push(d[46]),d[40])}])}):c.resolve()},function(a){return c.sequence([function(a){return d[45]=c.createArray(),d[46]=c.i64.of_int32(d[40].length),c.i64.gt(d[46],c.i64.cast([0,0]))?c.loopAsync(d[46],function(a){return d[48]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[40],d[48]).then(function(a){return a=a,d[49]=a[0],d[50]=a[1],a})},function(a){return d[51]=(d[45].push(c.i64.to_string(d[49])),d[45])}])}):c.resolve()},function(a){return d[47]=d[45].join(","),d[42]=d[47]}])},function(a){return d[40].some(function(a){return c.i64.eq(d[30],a)})?d[43]=d[30]:d[43]=void 0,c.i64.neq(d[43],void 0)?d[44]=d[43]:d[44]=void 0,d[24]=d[44]}])},function(e){return c.i64.neq(d[24],void 0)?d[25]=d[24]:d[25]=c.i64.cast([0,0]),c.i64.neq(d[31],void 0)?d[26]=d[31]:d[26]=c.i64.cast([0,1]),c.i64.neq(d[34],void 0)?c.sequence([function(e){return c.filter(c.db.table(305).fetch(),function(b){return c.i64.eq(b.pendingBackupTaskId,a[0])}).next().then(function(h,i){var e=h.done;h=h.value;return e?(d[39]=new c.Map(),d[39].set("error_code",c.i64.cast([0,5])),d[39].set("stored_procedure","LSEncryptedBackupsLoadProtobufBackupSerializedPayloadDataStoredProcedure"),d[39].set("error_message",""),e=[void 0,d[39],d[11]],d[35]=e[0],d[36]=e[1],d[37]=e[2],e):(i=h.item,c.sequence([function(b){return d[61]=i.actThreadId,d[62]=i.toplevelOfflineThreadingId,d[40]=i.messageTimestampMs,d[39]=new c.Map(),d[39].set("backup_id",c.i64.to_string(d[32])),d[39].set("act_thread_id",d[61]),d[39].set("server_thread_id",d[61]),d[39].set("timestamp",c.i64.to_string(d[40])),d[39].set("otid",d[62]),d[41]=new c.Map(),d[41].set("backup_id",c.i64.to_string(d[32])),d[41].set("act_thread_id",d[61]),d[41].set("timestamp",c.i64.to_string(d[40])),d[41].set("otid",d[62]),c.db.table(2).fetch([[[a[0]]]]).next().then(function(e,f){var b=e.done;e=e.value;return b?(d[63]=c.i64.of_float(Date.now()),b=[a[0],void 0,void 0,void 0,void 0,c.i64.sub(c.i64.mul(d[63],c.i64.cast([0,1e6])),d[19]),void 0],d[42]=b[0],d[43]=b[1],d[44]=b[2],d[45]=b[3],d[46]=b[4],d[47]=b[5],d[48]=b[6],b):(f=e.item,d[63]=c.i64.of_float(Date.now()),b=[a[0],f.queueName,f.enqueueTimestampMs,f.priority,f.firstExecutedTimestampMs,c.i64.sub(c.i64.mul(d[63],c.i64.cast([0,1e6])),d[19]),void 0],d[42]=b[0],d[43]=b[1],d[44]=b[2],d[45]=b[3],d[46]=b[4],d[47]=b[5],d[48]=b[6],b)})},function(a){return d[50]=new c.Map(),d[50].set("task_id",d[42]),d[50].set("queue_name",d[43]),d[50].set("enqueue_timestamp_ms",d[44]),d[50].set("priority",d[45]),d[50].set("first_executed_timestamp_ms",d[46]),d[50].set("execution_time_ns",d[47]),d[50].set("echo_encoding_execution_time_ns",d[48]),d[51]=new c.Map(),d[51].set("task_metadata",d[50]),d[51].set("action_type",c.i64.cast([0,1])),d[51].set("content_type",c.i64.cast([0,1])),d[51].set("identifiers",void 0),d[51].set("identifiers_v2",d[41]),d[51].set("task_creation_source",void 0),d[51].set("message_payload_source",c.i64.cast([0,2])),d[52]=d[39].get("act_thread_id"),d[39],d[53]=d[39].get("otid"),d[39],c.storedProcedure(b("LSGetLatestEpochKeys"),!1).then(function(a){return a=a,d[54]=a[0],d[55]=a[1],a})},function(a){return d[54]!==void 0?c.sequence([function(a){return c.i64.eq(c.i64.cast([0,1]),c.i64.cast([0,1]))?c.sequence([function(a){return d[66]=c.createArray(),d[71]=(d[66].push(c.i64.cast([0,32])),d[66]),c.nativeOperation(b("LSGetBlobFromString.nop"),["thread_ope_key","_",d[52]].join("")).then(function(a){return a=a,d[67]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[67],void 0,d[33],d[66]).then(function(a){return a=a,d[68]=a[0],a})},function(a){return d[68]?d[69]=!1:d[69]=!0,d[69]?c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] Got null keys while deriving message list OPE key. Returning null blobish"),d[71]=c.createArray(),void 0!==void 0?d[72]=(d[71].push(void 0),d[71]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","Got null keys while deriving message list OPE key. Returning null blobish",d[71],c.i64.cast([0,3]))},function(a){return d[70]=void 0}]):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[68],c.i64.cast([0,0])).then(function(a){return a=a,d[71]=a[0],d[72]=a[1],a})},function(a){return d[70]=d[71]}])},function(a){return d[63]=d[70]}]):c.sequence([function(a){return c.i64.eq(c.i64.cast([0,1]),c.i64.cast([0,2]))?c.sequence([function(a){return d[67]=c.createArray(),d[72]=(d[67].push(c.i64.cast([0,32])),d[67]),c.nativeOperation(b("LSGetBlobFromString.nop"),["thread_ope_key","_",d[53]].join("")).then(function(a){return a=a,d[68]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[68],void 0,d[33],d[67]).then(function(a){return a=a,d[69]=a[0],a})},function(a){return d[69]?d[70]=!1:d[70]=!0,d[70]?c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] Got null keys while deriving message list OPE key. Returning null blobish"),d[72]=c.createArray(),void 0!==void 0?d[73]=(d[72].push(void 0),d[72]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","Got null keys while deriving message list OPE key. Returning null blobish",d[72],c.i64.cast([0,3]))},function(a){return d[71]=void 0}]):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[69],c.i64.cast([0,0])).then(function(a){return a=a,d[72]=a[0],d[73]=a[1],a})},function(a){return d[71]=d[72]}])},function(a){return d[66]=d[71]}]):c.resolve(d[66]=void 0)},function(a){return d[63]=d[66]}])},function(a){return c.blobs.neq(d[63],void 0)?c.sequence([function(a){return d[66]=d[54].get("epoch_keys"),d[54],d[67]=d[66].get("epoch_anon_id"),d[66],d[68]=d[66].get("epoch_root_key"),d[66],d[69]=c.createArray(),d[80]=(d[69].push(c.i64.cast([0,32])),d[69]),c.i64.ge(d[25],c.i64.cast([0,3]))?c.resolve(d[70]=void 0):c.sequence([function(a){return c.nativeOperation(b("LSGetBlobFromString.nop"),d[52]).then(function(a){return a=a,d[80]=a[0],a})},function(a){return d[70]=d[80]}])},function(a){return c.i64.ge(d[25],c.i64.cast([0,4]))?(d[80]="_",d[71]=["message_key_in_epoch",d[80],c.blobs.to_string(d[67]),d[80],"cipher_version",d[80],c.i64.to_string(d[25]),d[80],"thread",d[80],d[52]==null?"":d[52]].join("")):(c.i64.ge(d[25],c.i64.cast([0,3]))?(d[81]="_",d[80]=["message_key_in_epoch",d[81],c.blobs.to_string(d[67]),d[81],"cipher_version",d[81],c.i64.to_string(d[25]),d[81],"thread",d[81],d[52]==null?"":d[52]].join("")):(c.i64.ge(d[25],c.i64.cast([0,2]))?(d[82]="_",d[81]=["message_key_in_epoch",d[82],c.blobs.to_string(d[67]),d[82],"cipher_version",d[82],c.i64.to_string(d[25])].join("")):d[81]=["message_key_in_epoch","_",c.blobs.to_string(d[67])].join(""),d[80]=d[81]),d[71]=d[80]),c.nativeOperation(b("LSGetBlobFromString.nop"),d[71]).then(function(a){return a=a,d[72]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[72],d[70],d[68],d[69]).then(function(a){return a=a,d[73]=a[0],a})},function(a){return d[73]?d[74]=!1:d[74]=!0,d[74]?c.resolve(d[75]=void 0):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[73],c.i64.cast([0,0])).then(function(a){return a=a,d[80]=a[0],d[81]=a[1],a})},function(a){return d[75]=d[80]}])},function(a){return c.filter(c.db.table(169).fetch(),function(a){return c.blobs.eq(a.epochAnonIdBlob,c.blob("MA=="))}).next().then(function(e,f){var a=e.done;e=e.value;return a?c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTableUtils] Failed to get mailbox_root_key_v2: epoch 0 is not available."),d[80]=c.createArray(),void 0!==void 0?d[81]=(d[80].push(void 0),d[80]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTableUtils","Failed to get mailbox_root_key_v2: epoch 0 is not available.",d[80],c.i64.cast([0,3]))},function(a){return d[76]=void 0}]):(f=e.item,c.sequence([function(a){return d[80]=c.createArray(),d[88]=(d[80].push(c.i64.cast([0,32])),d[80]),c.nativeOperation(b("LSCreateDerivedKeys.nop"),c.blob("a2RmX2luZm86bWFpbGJveF9yb290X2tleT5zYWx0X21haWxib3hfcm9vdF9rZXlfdjI="),void 0,d[33],d[80]).then(function(a){return a=a,d[81]=a[0],a})},function(a){return d[81]!==void 0?c.sequence([function(a){return d[88]=c.i64.of_int32(d[81].length),c.i64.ge(d[88],c.i64.cast([0,1]))?c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[81],c.i64.cast([0,0])).then(function(a){return a=a,d[90]=a[0],d[91]=a[1],a})},function(a){return d[89]=d[90]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),d[90]=c.createArray(),void 0!==void 0?d[91]=(d[90].push(void 0),d[90]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",d[90],c.i64.cast([0,3]))},function(a){return d[89]=void 0}])},function(a){return d[82]=d[89]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),d[88]=c.createArray(),void 0!==void 0?d[89]=(d[88].push(void 0),d[88]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",d[88],c.i64.cast([0,3]))},function(a){return d[82]=void 0}])},function(a){return c.blobs.neq(d[82],void 0)?d[83]=!0:d[83]=!1,d[83]?0:(function(a){c.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),c["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),d[84]=c.createArray(),d[88]=(d[84].push(c.i64.cast([0,32])),d[84]),c.nativeOperation(b("LSCreateDerivedKeys.nop"),c.blob("a2RmX2luZm86bWFpbGJveF9yb290X2tleT5tYWlsYm94X3Jvb3Rfa2V5X3Yy"),d[82],f.epochRootKeyBlob,d[84]).then(function(a){return a=a,d[85]=a[0],a})},function(a){return d[85]!==void 0?c.sequence([function(a){return d[88]=c.i64.of_int32(d[85].length),c.i64.ge(d[88],c.i64.cast([0,1]))?c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[85],c.i64.cast([0,0])).then(function(a){return a=a,d[90]=a[0],d[91]=a[1],a})},function(a){return d[89]=d[90]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),d[90]=c.createArray(),void 0!==void 0?d[91]=(d[90].push(void 0),d[90]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",d[90],c.i64.cast([0,3]))},function(a){return d[89]=void 0}])},function(a){return d[86]=d[89]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),d[88]=c.createArray(),void 0!==void 0?d[89]=(d[88].push(void 0),d[88]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",d[88],c.i64.cast([0,3]))},function(a){return d[86]=void 0}])},function(a){return c.blobs.neq(d[86],void 0)?d[87]=!0:d[87]=!1,d[87]?0:(function(a){c.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),c["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),d[76]=d[86]}]))})},function(a){return c.blobs.neq(d[75],void 0)?c.sequence([function(a){return c.blobs.neq(d[76],void 0)?c.sequence([function(a){return d[86]=c.createArray(),d[90]=(d[86].push(c.i64.cast([0,32])),d[86]),c.nativeOperation(b("LSCreateDerivedKeys.nop"),c.blob("a2RmX2luZm86bWFpbGJveF9yb290X2tleV92Mj5mYWxsYmFja19rZXk="),void 0,d[76],d[86]).then(function(a){return a=a,d[87]=a[0],a})},function(a){return d[87]!==void 0?c.sequence([function(a){return d[90]=c.i64.of_int32(d[87].length),c.i64.ge(d[90],c.i64.cast([0,1]))?c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[87],c.i64.cast([0,0])).then(function(a){return a=a,d[92]=a[0],d[93]=a[1],a})},function(a){return d[91]=d[92]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),d[92]=c.createArray(),void 0!==void 0?d[93]=(d[92].push(void 0),d[92]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",d[92],c.i64.cast([0,3]))},function(a){return d[91]=void 0}])},function(a){return d[88]=d[91]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBCryptoUtils] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),d[90]=c.createArray(),void 0!==void 0?d[91]=(d[90].push(void 0),d[90]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBCryptoUtils","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",d[90],c.i64.cast([0,3]))},function(a){return d[88]=void 0}])},function(a){return c.blobs.neq(d[88],void 0)?d[89]=!0:d[89]=!1,d[89]?0:(function(a){c.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),c["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),d[80]=d[88]}]):c.resolve(d[80]=void 0)},function(a){return d[81]=d[66].get("epoch_root_key"),d[66],d[82]=d[66].get("epoch_anon_id"),d[66],d[83]=d[66].get("epoch_id"),d[66],d[84]=new c.Map(),d[84].set("payload_key",d[75]),d[84].set("payload_fallback_key",d[80]),d[84].set("encryption_version",d[25]),d[84].set("epoch_root_key",d[81]),d[84].set("epoch_anon_id",d[82]),d[84].set("epoch_id",d[83]),d[85]=new c.Map(),d[85].set("ope_key",d[63]),d[85].set("message_payload_encryption_keys",d[84]),d[85].set("ocmf_shared_key",f.ocmfClientStateBlob),d[85].set("mailbox_base_salt",d[33]),d[85].set("mailbox_root_key_v2",d[76]),a=[d[85],void 0],d[78]=a[0],d[79]=a[1],a}]):c.resolve((d[80]=new c.Map(),d[80].set("error_code",c.i64.cast([0,26])),d[80].set("stored_procedure","MEBKeyDeriver"),d[80].set("error_message",""),a=[void 0,d[80]],d[78]=a[0],d[79]=a[1],a))},function(a){return a=[d[78],d[79]],d[64]=a[0],d[65]=a[1],a}]):c.resolve((d[66]=new c.Map(),d[66].set("error_code",c.i64.cast([0,25])),d[66].set("stored_procedure","MEBKeyDeriver"),d[66].set("error_message",""),a=[void 0,d[66]],d[64]=a[0],d[65]=a[1],a))},function(a){return a=[d[64],d[65]],d[56]=a[0],d[57]=a[1],a}]):c.resolve((a=[void 0,d[55]],d[56]=a[0],d[57]=a[1],a))},function(e){return d[56]!==void 0?c.sequence([function(a){return d[63]=d[39].get("backup_id"),d[39],d[64]=d[39].get("act_thread_id"),d[39],d[65]=d[39].get("timestamp"),d[39],d[66]=d[39].get("otid"),d[39],c.storedProcedure(b("LSEncryptIdentifiersV2"),c.i64.cast([0,1]),c.i64.cast([0,1]),d[63],d[64],c.i64.from_string(d[65]),d[66],d[56]).then(function(a){return a=a,d[67]=a[0],d[68]=a[1],a})},function(a){return d[69]=d[56].get("message_payload_encryption_keys"),d[56],d[70]=d[69].get("encryption_version"),d[69],d[71]=d[69].get("epoch_anon_id"),d[69],d[72]=d[69].get("epoch_root_key"),d[69],d[73]=d[39].get("act_thread_id"),d[39],d[74]=d[69].get("payload_key"),d[69],d[75]=d[39].get("backup_id"),d[39],d[76]=c.createArray(),d[106]=(d[76].push(c.i64.cast([0,6])),d[76]),c.nativeOperation(b("LSGetBlobFromString.nop"),"epoch_anon_id_debug").then(function(a){return a=a,d[77]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[77],void 0,d[71],d[76]).then(function(a){return a=a,d[78]=a[0],a})},function(a){return d[78]?d[79]=!1:d[79]=!0,d[79]?c.resolve(d[80]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[78],c.i64.cast([0,0])).then(function(a){return a=a,d[106]=a[0],d[107]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[106]).then(function(a){return a=a,d[108]=a[0],a})},function(a){return d[80]=d[108]==null?"":d[108]}])},function(a){return d[81]=c.createArray(),d[106]=(d[81].push(c.i64.cast([0,6])),d[81]),c.nativeOperation(b("LSGetBlobFromString.nop"),"epoch_root_key_debug").then(function(a){return a=a,d[82]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[82],void 0,d[72],d[81]).then(function(a){return a=a,d[83]=a[0],a})},function(a){return d[83]?d[84]=!1:d[84]=!0,d[84]?c.resolve(d[85]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[83],c.i64.cast([0,0])).then(function(a){return a=a,d[106]=a[0],d[107]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[106]).then(function(a){return a=a,d[108]=a[0],a})},function(a){return d[85]=d[108]==null?"":d[108]}])},function(a){return d[86]=c.createArray(),d[106]=(d[86].push(c.i64.cast([0,6])),d[86]),c.nativeOperation(b("LSGetBlobFromString.nop"),"message_key_debug").then(function(a){return a=a,d[87]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[87],void 0,d[74],d[86]).then(function(a){return a=a,d[88]=a[0],a})},function(a){return d[88]?d[89]=!1:d[89]=!0,d[89]?c.resolve(d[90]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[88],c.i64.cast([0,0])).then(function(a){return a=a,d[106]=a[0],d[107]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[106]).then(function(a){return a=a,d[108]=a[0],a})},function(a){return d[90]=d[108]==null?"":d[108]}])},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[72]).then(function(a){return a=a,d[91]=a[0],a})},function(a){return c.nativeOperation(b("LSGetBlobFromString.nop"),[d[91]==null?"":d[91],d[73]].join("")).then(function(a){return a=a,d[92]=a[0],a})},function(a){return d[93]=c.createArray(),d[106]=(d[93].push(c.i64.cast([0,6])),d[93]),c.nativeOperation(b("LSGetBlobFromString.nop"),"epoch_root_key_thread_id_debug").then(function(a){return a=a,d[94]=a[0],a})},function(a){return c.nativeOperation(b("LSCreateDerivedKeys.nop"),d[94],void 0,d[92],d[93]).then(function(a){return a=a,d[95]=a[0],a})},function(a){return d[95]?d[96]=!1:d[96]=!0,d[96]?c.resolve(d[97]=""):c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[95],c.i64.cast([0,0])).then(function(a){return a=a,d[106]=a[0],d[107]=a[1],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[106]).then(function(a){return a=a,d[108]=a[0],a})},function(a){return d[97]=d[108]==null?"":d[108]}])},function(a){return d[98]=":",c.blobs.neq(d[72],void 0)?c.sequence([function(a){return d[106]=c.createArray(),d[112]=(d[106].push(c.i64.cast([0,18])),d[106]),c.nativeOperation(b("LSCreateDerivedKeys.nop"),c.blob("bWViL2RlYnVnL2ZpbmdlcnByaW50L01FQkVwb2NoUm9vdEtleQ=="),void 0,d[72],d[106]).then(function(a){return a=a,d[107]=a[0],a})},function(a){return d[107]!==void 0?c.sequence([function(a){return d[112]=c.i64.of_int32(d[107].length),c.i64.ge(d[112],c.i64.cast([0,1]))?c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[107],c.i64.cast([0,0])).then(function(a){return a=a,d[114]=a[0],d[115]=a[1],a})},function(a){return d[113]=d[114]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBFingerprint] CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM."),d[114]=c.createArray(),void 0!==void 0?d[115]=(d[114].push(void 0),d[114]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBFingerprint","CreateDerivedKeys returned an empty list of keys. This should never happen; aborting dasm VM.",d[114],c.i64.cast([0,3]))},function(a){return d[113]=void 0}])},function(a){return d[108]=d[113]}]):c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBFingerprint] CreateDerivedKeys returned null. This should never happen; aborting dasm VM."),d[112]=c.createArray(),void 0!==void 0?d[113]=(d[112].push(void 0),d[112]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBFingerprint","CreateDerivedKeys returned null. This should never happen; aborting dasm VM.",d[112],c.i64.cast([0,3]))},function(a){return d[108]=void 0}])},function(a){return c.blobs.neq(d[108],void 0)?d[109]=!0:d[109]=!1,d[109]?0:(function(a){c.logger(a).mustfix(a)}("LS::assert is failed. Attempting to coerce a null value to nonnull."),c["throw"]("LS::assert is failed. Attempting to coerce a null value to nonnull.")),c.nativeOperation(b("LSBase64Encode.nop"),d[108]).then(function(a){return a=a,d[110]=a[0],a})},function(a){return d[110]!==void 0?d[111]=d[110]:d[111]="encodingfailed",d[99]=d[111]}]):c.resolve(d[99]="null")},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[71]).then(function(a){return a=a,d[100]=a[0],a})},function(e){return d[101]=new c.Map(),d[101].set("encryption_version",d[70]),d[101].set("epoch_anon_id",d[100]==null?"":d[100]),d[101].set("message_encryption_values",[d[80],d[98],d[85],d[98],d[90],d[98],d[97]].join("")),d[101].set("root_key_fingerprint",d[99]),d[101].set("backup_id",d[75]),d[102]=c.toJSON(d[101]),d[67]!==void 0?c.sequence([function(e){return d[106]=d[39].get("act_thread_id"),d[39],c.storedProcedure(b("LSLoadAndEncryptProtobufV2"),a[0],d[56],d[106]).then(function(a){return a=a,d[107]=a[0],d[108]=a[1],a})},function(a){return d[107]!==void 0?(d[112]=new c.Map(),d[112].set("protobuf_backup_payload",d[107]),d[112].set("encrypted_identifiers",d[67]),d[112].set("device_id",d[34]),d[112].set("identifiers",d[39]),d[112].set("encryption_keys",d[56]),d[112].set("content_type",c.i64.cast([0,1])),d[112].set("action_type",c.i64.cast([0,1])),d[112].set("value_secret_ref",d[102]),d[112].set("attachment_backup_payload",i.attachmentPayload),d[112].set("extra_data_for_eb_upload",void 0),a=[d[112],void 0,d[51]],d[109]=a[0],d[110]=a[1],d[111]=a[2],a):(a=[void 0,d[108],d[51]],d[109]=a[0],d[110]=a[1],d[111]=a[2],a),a=[d[109],d[110],d[111]],d[103]=a[0],d[104]=a[1],d[105]=a[2],a}]):c.resolve((e=[void 0,d[68],d[51]],d[103]=e[0],d[104]=e[1],d[105]=e[2],e))},function(a){return a=[d[103],d[104],d[105]],d[58]=a[0],d[59]=a[1],d[60]=a[2],a}]):c.resolve((e=[void 0,d[57],d[51]],d[58]=e[0],d[59]=e[1],d[60]=e[2],e))},function(a){return a=[d[58],d[59],d[60]],d[35]=a[0],d[36]=a[1],d[37]=a[2],a}]))})},function(a){return a=[d[35],d[36],d[37]],d[27]=a[0],d[28]=a[1],d[29]=a[2],a}]):c.resolve((d[35]=new c.Map(),d[35].set("error_code",c.i64.cast([0,24])),d[35].set("stored_procedure","LSEncryptedBackupsLoadProtobufBackupSerializedPayloadDataStoredProcedure"),d[35].set("error_message",""),e=[void 0,d[35],d[11]],d[27]=e[0],d[28]=e[1],d[29]=e[2],e))},function(a){return a=[d[27],d[28],d[29]],d[12]=a[0],d[13]=a[1],d[14]=a[2],a}]))})},function(a){return d[16]=c.i64.of_float(Date.now()),d[17]=c.i64.random(),d[20]="Finishing execution. Execution time: ",d[21]=c.i64.to_string(c.i64.sub(d[16],d[0])),d[22]=" ms",d[18]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][loadProtobufBackupSerializedPayloadData] ",d[18],d[20],d[18],d[21],d[18],d[22]].join("")),c.i64.eq(c.i64.mod_(d[17],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[23]=",",d[24]=c.createArray(),void 0!==void 0?d[25]=(d[24].push(void 0),d[24]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"loadProtobufBackupSerializedPayloadData",[d[20],d[23],d[21],d[23],d[22]].join(""),d[24],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[12],d[13],d[14]],e[0]=a[0],e[1]=a[1],e[2]=a[2],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsLoadProtobufBackupSerializedPayloadDataStoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerEncryptedBackupsUploadProtobufOnly",["LSArrayGetObjectAt","LSBase64Encode.nop","LSDeserializeFromJsonIntoDictionaryV2.nop","LSLoadProtobufBackupSerializedPayloadData","LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][taskSerializerEncryptedBackupsUploadProtobufOnly] Beginning execution."),d[1]=c.i64.of_float(Date.now()),c.storedProcedure(b("LSLoadProtobufBackupSerializedPayloadData"),a[0]).then(function(a){return a=a,d[2]=a[0],d[3]=a[1],d[4]=a[2],a})},function(a){return d[2]!==void 0?c.sequence([function(a){return d[15]=d[2].get("encrypted_identifiers"),d[2],d[16]=d[2].get("identifiers"),d[2],d[17]=d[2].get("encryption_keys"),d[2],d[18]=d[2].get("protobuf_backup_payload"),d[2],d[19]=d[15].get("act_thread_id_ocmf_partial"),d[15],d[20]=d[15].get("otid_ocmf_partial"),d[15],d[21]=d[15].get("timestamp_encrypted"),d[15],d[22]=new c.Map(),d[22].set("list_key",d[19]),d[22].set("unique_key",d[20]),d[22].set("sort_key",d[21]),d[23]=d[2].get("value_secret_ref"),d[2],d[24]=new c.Map(),d[24].set("value",""),d[24].set("value_secret_ref",d[23]),d[25]=d[2].get("action_type"),d[2],d[26]=new c.Map(),d[26].set("list_item_id",d[22]),d[26].set("list_item",d[24]),d[26].set("action_type",d[25]),d[27]=d[16].get("server_thread_id"),d[16],d[28]=d[16].get("timestamp"),d[16],d[29]=d[16].get("otid"),d[16],d[30]=d[16].get("act_thread_id"),d[16],d[31]=new c.Map(),d[31].set("server_thread_key",d[27]),d[31].set("timestamp",d[28]),d[31].set("otid",d[29]),d[31].set("wa_thread_id",c.i64.from_string(d[30])),d[32]=d[17].get("mailbox_base_salt"),d[17],c.nativeOperation(b("LSBase64Encode.nop"),d[32]).then(function(a){return a=a,d[33]=a[0],a})},function(a){return d[34]=d[17].get("ocmf_shared_key"),d[17],c.nativeOperation(b("LSBase64Encode.nop"),d[34]).then(function(a){return a=a,d[35]=a[0],a})},function(a){return d[36]=new c.Map(),d[36].set("mailbox_root_key",d[33]==null?"":d[33]),d[36].set("ocmf_client_state_blob",d[35]==null?"":d[35]),d[37]=d[15].get("backup_id_ocmf_partial"),d[15],d[38]=d[2].get("device_id"),d[2],d[39]=d[17].get("message_payload_encryption_keys"),d[17],d[40]=d[39].get("epoch_id"),d[39],d[41]=d[17].get("message_payload_encryption_keys"),d[17],d[42]=d[41].get("encryption_version"),d[41],d[43]=d[2].get("content_type"),d[2],d[44]=new c.Map(),d[44].set("mailbox_partial_id",d[37]),d[44].set("action",d[26]),d[44].set("device_id",d[38]),d[44].set("echo_version",c.i64.cast([0,0])),d[44].set("epoch_id",d[40]),d[44].set("trace_id",void 0),d[44].set("encryption_version",d[42]),d[44].set("is_thread",c.i64.eq(d[43],c.i64.cast([0,2]))),d[44].set("raw_identifiers",d[31]),d[44].set("raw_tokens",d[36]),d[44].set("request_id",""),d[44].set("is_instamadillo",!0),d[45]=d[18].get("supplemental_data_encrypted"),d[18],d[45]!==void 0?c.sequence([function(a){return d[50]=d[18].get("protobuf_encrypted"),d[18],d[51]=d[18].get("backup_action"),d[18],d[52]=d[18].get("timestamp_ms"),d[18],d[53]=d[45].get("sk_ciphertext"),d[45],c.nativeOperation(b("LSBase64Encode.nop"),d[53]).then(function(a){return a=a,d[54]=a[0],a})},function(a){return d[55]=d[45].get("sk_hash"),d[45],c.nativeOperation(b("LSBase64Encode.nop"),d[55]).then(function(a){return a=a,d[56]=a[0],a})},function(a){return d[57]=d[18].get("message_tags"),d[18],d[58]=new c.Map(),d[58].set("supplementary_data_key",void 0),d[58].set("encrypted_protobuf",d[50]),d[58].set("key_value_backup_action",d[51]),d[58].set("protobuf_ts_ms",d[52]),d[58].set("supplemental_key_ciphertext",d[54]),d[58].set("supplemental_key_hash",d[56]),d[58].set("message_tags",d[57]),d[46]=d[58]}]):c.resolve((d[50]=d[18].get("protobuf_encrypted"),d[18],d[51]=d[18].get("backup_action"),d[18],d[52]=d[18].get("timestamp_ms"),d[18],d[53]=d[18].get("message_tags"),d[18],d[54]=new c.Map(),d[54].set("supplementary_data_key",void 0),d[54].set("encrypted_protobuf",d[50]),d[54].set("key_value_backup_action",d[51]),d[54].set("protobuf_ts_ms",d[52]),d[54].set("message_tags",d[53]),d[46]=d[54]))},function(a){return d[44].set("key_value_backup_payload",d[46]),d[47]=d[2].get("attachment_backup_payload"),d[2],d[47]!==void 0?d[44].set("attachment_backup_payload",d[47]):0,d[48]=d[2].get("extra_data_for_eb_upload"),d[2],d[48]!==void 0?c.sequence([function(a){return c.nativeOperation(b("LSDeserializeFromJsonIntoDictionaryV2.nop"),d[48]).then(function(a){return a=a,d[50]=a[0],a})},function(a){return d[51]=new c.Map(),d[55]="ttd",d[52]=d[50].get(d[55]),d[50],d[52]?d[53]=!1:d[53]=!0,d[53]?c.resolve():c.sequence([function(a){return d[52]?d[56]=!1:d[56]=!0,d[56]?c.resolve(d[57]=void 0):c.sequence([function(a){return d[58]=new c.Map(),d[61]="message_tags",d[59]=d[52].get(d[61]),d[52],d[59]?d[60]=!1:d[60]=!0,d[60]?c.resolve():c.sequence([function(a){return d[62]=c.createArray(),d[63]=c.i64.of_int32(d[59].length),c.i64.gt(d[63],c.i64.cast([0,0]))?c.loopAsync(d[63],function(a){return d[64]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[59],d[64]).then(function(a){return a=a,d[65]=a[0],d[66]=a[1],a})},function(a){return d[67]=(d[62].push(d[65]),d[62])}])}):c.resolve()},function(a){return d[58].set(d[61],d[62])}])},function(a){return d[57]=d[58]}])},function(a){return d[51].set(d[55],d[57])}])},function(a){return d[54]=d[51].get("ttd"),d[51],d[54]!==void 0?(d[56]=new c.Map(),d[60]="message_tags",d[57]=d[54].get(d[60]),d[54],d[57]?d[58]=!1:d[58]=!0,d[58]?0:d[56].set(d[60],d[57]),d[59]=c.toJSON(d[56]),d[44].set("tags_to_delete",d[59])):0}]):c.resolve()},function(a){return d[49]=c.toJSON(d[44]),a=[d[49],void 0,d[4]],d[5]=a[0],d[6]=a[1],d[7]=a[2],a}]):c.resolve((d[3]?d[15]=!1:d[15]=!0,d[15]?(a=[void 0,void 0,d[4]],d[16]=a[0],d[17]=a[1],d[18]=a[2],a):(a=[void 0,d[3],d[4]],d[16]=a[0],d[17]=a[1],d[18]=a[2],a),a=[d[16],d[17],d[18]],d[5]=a[0],d[6]=a[1],d[7]=a[2],a))},function(a){return d[15]=new c.Map(),d[16]=d[15].set("success",d[5]),d[17]=d[15].set("failure",d[6]),d[18]=d[15].set("context",d[7]),d[19]=c.toJSON(d[15]),d[8]=d[19],d[9]=c.i64.of_float(Date.now()),d[10]=c.i64.random(),d[12]="Finishing execution. Execution time: ",d[13]=c.i64.to_string(c.i64.sub(d[9],d[0])),d[14]=" ms",d[11]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][taskSerializerEncryptedBackupsUploadProtobufOnly] ",d[11],d[12],d[11],d[13],d[11],d[14]].join("")),c.i64.eq(c.i64.mod_(d[10],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[15]=",",d[16]=c.createArray(),void 0!==void 0?d[17]=(d[16].push(void 0),d[16]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"taskSerializerEncryptedBackupsUploadProtobufOnly",[d[12],d[15],d[13],d[15],d[14]].join(""),d[16],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[8],c.i64.cast([0,50042]),void 0],e[0]=a[0],e[1]=a[1],e[2]=a[2],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsTaskSerializerEncryptedBackupsUploadProtobufOnlyStoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerMuteThreadV2",[],(function(a,b,c,d,e,f){function a(){var a=arguments,b=a[a.length-1],c=[],d=[];return b.sequence([function(e){return b.sequence([function(d){return b.db.table(32).fetch([[[a[0]]]]).next().then(function(d,e){var f=d.done;d=d.value;return f?(c[4]=b.createArray(),c[5]=(c[4].push("TaskSerializerMuteThreadV2: Task ID not found"),c[4]),c[6]=(c[4].push(a[0]),c[4]),c[7]=b.toJSON(c[4]),function(a){b.logger(a).mustfix(a)}(c[7]),f=[void 0,void 0,void 0],c[0]=f[0],c[1]=f[1],c[2]=f[2],f):(e=d.item,b.sequence([function(a){return c[8]=e.threadKey,b.db.table(9).fetch([[[c[8]]]]).next().then(function(d,e){var a=d.done;d=d.value;return a?(c[9]=b.createArray(),c[10]=(c[9].push("TaskSerializerMuteThreadV2: Thread not found"),c[9]),c[11]=(c[9].push(c[8]),c[9]),c[12]=b.toJSON(c[9]),function(a){b.logger(a).mustfix(a)}(c[12]),a=[void 0,void 0,void 0],c[4]=a[0],c[5]=a[1],c[6]=a[2],a):(e=d.item,b.sequence([function(a){return b.db.table(9).fetch([[[c[8]]]]).next().then(function(d,e){var a=d.done;d=d.value;return a?c[9]=b.i64.cast([0,1]):(e=d.item,c[14]=e.syncGroup,b.i64.neq(c[14],void 0)?c[13]=c[14]:c[13]=b.i64.cast([0,1]),c[9]=c[13])})},function(a){return c[11]=new b.Map(),c[11].set("thread_key",c[8]),c[11].set("mailbox_type",b.i64.cast([0,0])),c[11].set("mute_expire_time_ms",e.muteExpireTimeMs),c[11].set("sync_group",c[9]),c[12]=b.toJSON(c[11]),a=[c[12],b.i64.cast([0,144]),void 0],c[4]=a[0],c[5]=a[1],c[6]=a[2],a}]))})},function(a){return a=[c[4],c[5],c[6]],c[0]=a[0],c[1]=a[1],c[2]=a[2],a}]))})},function(a){return a=[c[0],c[1]],d[0]=a[0],d[1]=a[1],a}])},function(a){return b.resolve(d)}])}a.__sproc_name__="LSMailboxTaskSerializerMuteThreadV2StoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerRemoveThread",[],(function(a,b,c,d,e,f){function a(){var a=arguments,b=a[a.length-1],c=[],d=[];return b.sequence([function(e){return b.sequence([function(d){return b.db.table(32).fetch([[[a[0]]]]).next().then(function(d,e){var f=d.done;d=d.value;return f?(c[4]=b.createArray(),c[5]=(c[4].push("TaskSerializerRemoveThreadV2: Task ID not found"),c[4]),c[6]=(c[4].push(a[0]),c[4]),c[7]=b.toJSON(c[4]),function(a){b.logger(a).mustfix(a)}(c[7]),f=[void 0,void 0,void 0],c[0]=f[0],c[1]=f[1],c[2]=f[2],f):(e=d.item,c[7]=e.removeType,b.i64.neq(c[7],void 0)?(c[8]=new b.Map(),c[8].set("thread_key",e.threadKey),c[8].set("remove_type",c[7]),c[8].set("sync_group",e.syncGroup==null?b.i64.cast([0,1]):e.syncGroup),c[9]=b.toJSON(c[8]),f=[c[9],b.i64.cast([0,146]),void 0],c[4]=f[0],c[5]=f[1],c[6]=f[2],f):(d=[void 0,void 0,void 0],c[4]=d[0],c[5]=d[1],c[6]=d[2],d),e=[c[4],c[5],c[6]],c[0]=e[0],c[1]=e[1],c[2]=e[2],e)})},function(a){return a=[c[0],c[1]],d[0]=a[0],d[1]=a[1],a}])},function(a){return b.resolve(d)}])}a.__sproc_name__="LSMailboxTaskSerializerRemoveThreadStoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerSendMessageV2",["LSSymmetricEncryptionCreateEncryptedString.nop","gkx"],(function(a,b,c,d,e,f,g){function a(){var a=arguments,b=a[a.length-1],d=[],e=[];return b.sequence([function(f){return b.sequence([function(e){return b.db.table(31).fetch([[[a[0]]]]).next().then(function(e,f){var g=e.done;e=e.value;return g?(d[4]=b.createArray(),d[5]=(d[4].push("task ID not found"),d[4]),d[6]=(d[4].push(a[0]),d[4]),d[7]=b.toJSON(d[4]),function(a){b.logger(a).mustfix(a)}(d[7]),g=[void 0,void 0,void 0],d[0]=g[0],d[1]=g[1],d[2]=g[2],g):(f=e.item,b.sequence([function(e){return d[11]=f.offlineThreadingId,d[12]=f.messageId,d[20]=f.threadAttributionSource,d[9]=f.platformRef,d[10]=f.platformToken,d[8]=f.replySourceId,d[13]=f.replySourceType,d[19]=f.sendType,d[21]=f.markThreadRead,d[14]=f.initiatingSource,d[15]=f.skipUrlPreviewGen,d[17]=f.textHasLinks,d[18]=f.multitabEnv,d[16]=f.richTextFormatType,b.db.table(12).fetch([[[d[11]]],"optimistic"]).next().then(function(f,g){var e=f.done;f=f.value;return e?(d[22]=b.createArray(),d[23]=(d[22].push("OTID not found"),d[22]),d[24]=(d[22].push(d[11]),d[22]),d[25]=b.toJSON(d[22]),function(a){b.logger(a).mustfix(a)}(d[25]),e=[void 0,void 0,void 0],d[4]=e[0],d[5]=e[1],d[6]=e[2],e):(g=f.item,b.sequence([function(e){return d[29]=g.text,d[26]=g.threadKey,d[30]=g.messageId,d[38]=g.senderId,d[28]=g.stickerId,d[32]=g.mentionOffsets,d[33]=g.mentionLengths,d[27]=g.mentionIds,d[34]=g.mentionTypes,d[37]=g.replyType,d[35]=g.isForwarded,d[31]=g.forwardScore,d[36]=g.hotEmojiSize,b.db.table(9).fetch([[[d[26]]]]).next().then(function(f,h){var e=f.done;f=f.value;return e?(d[39]=b.createArray(),d[40]=(d[39].push("thread not found"),d[39]),d[41]=(d[39].push(d[26]),d[39]),d[42]=b.toJSON(d[39]),function(a){b.logger(a).mustfix(a)}(d[42]),e=[void 0,void 0,void 0],d[22]=e[0],d[23]=e[1],d[24]=e[2],e):(h=f.item,b.sequence([function(c){return d[46]=h.threadName,d[45]=h.threadKey,d[47]=h.mailboxType,d[39]=h.threadType,d[48]=h.capabilities,d[49]=h.capabilities2,d[50]=h.capabilities3,d[51]=h.capabilities4,b.db.table(2).fetch([[[a[0]]]]).next().then(function(e,f){var c=e.done;e=e.value;return c?d[40]=!1:(f=e.item,b.sequence([function(c){return b.islc(b.db.table(2).fetch([[[f.queueName]],"queueNameTaskId"]),0,b.i64.to_float(b.i64.cast([0,1]))).next().then(function(e,f){var c=e.done;e=e.value;return c?d[52]=!1:(f=e.item,d[52]=b.i64.eq(f.taskId,a[0]))})},function(a){return d[40]=d[52]}]))})},function(a){return b.i64.eq(h.authorityLevel,b.i64.cast([0,20]))&&(b.i64.eq(d[39],b.i64.cast([0,2]))||b.i64.eq(d[39],b.i64.cast([0,5]))||b.i64.eq(d[39],b.i64.cast([0,26])))&&d[40]?b.sequence([function(a){return d[55]=d[19]==null?b.i64.cast([0,1]):d[19],b.db.table(9).fetch([[[d[26]]]]).next().then(function(c,e){var a=c.done;c=c.value;return a?d[52]=b.i64.cast([0,1]):(e=c.item,d[70]=e.syncGroup,b.i64.neq(d[70],void 0)?d[69]=d[70]:d[69]=b.i64.cast([0,1]),d[52]=d[69])})},function(a){return d[54]=new b.Map(),d[54].set("thread_id",d[26]),d[54].set("otid",d[11]),d[54].set("source",d[20]==null?b.i64.cast([0,0]):d[20]),d[54].set("send_type",b.i64.cast([0,1])),d[54].set("sync_group",d[52]),d[54].set("mark_thread_read",d[21]),b.i64.eq(d[55],b.i64.cast([0,1]))?b.resolve(d[54].set("text",d[29])):b.i64.eq(d[55],b.i64.cast([0,2]))?b.resolve(b.i64.neq(d[28],void 0)?(d[54].set("sticker_id",d[28]),d[54].set("send_type",d[55])):0):b.i64.eq(d[55],b.i64.cast([0,7]))?b.sequence([function(a){return b.db.table(16).fetch([[[d[26],d[30]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?(a=[void 0,void 0],d[69]=a[0],d[70]=a[1],a):(c=b.item,a=[c.filename,c.attributionAppId],d[69]=a[0],d[70]=a[1],a)})},function(a){return d[69]!==void 0?b.i64.neq(d[70],void 0)?(d[54].set("url",d[69]),d[54].set("attribution_app_id",d[70]),d[54].set("send_type",d[55])):0:0}]):b.i64.eq(d[55],b.i64.cast([0,3]))?b.sequence([function(a){return d[54].set("text",d[29]),d[69]=b.createArray(),d[70]=b.createArray(),b.forEach(b.sortBy(b.db.table(16).fetch([[[d[26],d[30]]]]),[["attachmentIndex","ASC"]]),function(a){a=a.item;return d[71]=a.offlineAttachmentId,d[72]=(d[69].push(b.i64.from_string(a.attachmentFbid)),d[69]),d[71]!==void 0?d[72]=(d[70].push(d[71]),d[70]):0})},function(a){return d[54].set("attachment_fbids",d[69]),b.i64.eq(d[55],b.i64.cast([0,9]))?d[54].set("offline_attachment_ids",d[70]):0,d[54].set("send_type",d[55])}]):b.i64.eq(d[55],b.i64.cast([0,9]))?b.sequence([function(a){return d[54].set("text",d[29]),d[69]=b.createArray(),d[70]=b.createArray(),b.forEach(b.sortBy(b.db.table(16).fetch([[[d[26],d[30]]]]),[["attachmentIndex","ASC"]]),function(a){a=a.item;return d[71]=a.offlineAttachmentId,d[72]=(d[69].push(b.i64.from_string(a.attachmentFbid)),d[69]),d[71]!==void 0?d[72]=(d[70].push(d[71]),d[70]):0})},function(a){return d[54].set("attachment_fbids",d[69]),b.i64.eq(d[55],b.i64.cast([0,9]))?d[54].set("offline_attachment_ids",d[70]):0,d[54].set("send_type",d[55])}]):b.i64.eq(d[55],b.i64.cast([0,10]))?b.sequence([function(a){return d[54].set("text",d[29]),d[69]=b.createArray(),d[70]=b.createArray(),b.forEach(b.sortBy(b.db.table(16).fetch([[[d[26],d[30]]]]),[["attachmentIndex","ASC"]]),function(a){a=a.item;return d[71]=a.offlineAttachmentId,d[72]=(d[69].push(b.i64.from_string(a.attachmentFbid)),d[69]),d[71]!==void 0?d[72]=(d[70].push(d[71]),d[70]):0})},function(a){return d[54].set("attachment_fbids",d[69]),b.i64.eq(d[55],b.i64.cast([0,9]))?d[54].set("offline_attachment_ids",d[70]):0,d[54].set("send_type",d[55])}]):b.i64.eq(d[55],b.i64.cast([0,4]))?b.sequence([function(a){return b.db.table(16).fetch([[[d[26],d[30]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?d[69]=void 0:(c=b.item,d[69]=c.attachmentFbid)})},function(a){return b.db.table(16).fetch([[[d[26],d[30]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?d[71]=void 0:(c=b.item,d[71]=c.actionUrl)})},function(a){return d[69]!==void 0?(d[54].set("text",d[29]),d[71]!==void 0?d[54].set("url",d[71]):0,d[54].set("forwarded_share_id",d[69]),d[54].set("send_type",d[55])):0}]):b.i64.eq(d[55],b.i64.cast([0,5]))?b.resolve(d[12]!==void 0?(d[54].set("forwarded_msg_id",d[12]),d[54].set("send_type",d[55]),b.i64.neq(d[31],void 0)?d[54].set("forward_score",d[31]):0,d[54].set("strip_forwarded_msg_caption",!1)):0):b.i64.eq(d[55],b.i64.cast([0,6]))?b.sequence([function(a){return b.db.table(16).fetch([[[d[26],d[30]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?(a=[void 0,void 0],d[69]=a[0],d[70]=a[1],a):(c=b.item,a=[c.filename,c.attributionAppId],d[69]=a[0],d[70]=a[1],a)})},function(a){return d[69]!==void 0?(d[54].set("url",d[69]),d[54].set("text",d[29]),d[54].set("send_type",d[55])):0}]):b.i64.eq(d[55],b.i64.cast([0,11]))?b.sequence([function(a){return b.db.table(16).fetch([[[d[26],d[30]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?(a=[void 0,void 0],d[69]=a[0],d[70]=a[1],a):(c=b.item,a=[c.actionUrl,c.attributionAppId],d[69]=a[0],d[70]=a[1],a)})},function(a){return d[69]!==void 0?(d[54].set("url",d[69]),c("gkx")("3272")?d[54].set("text",d[29]):0,d[54].set("send_type",d[55])):0}]):b.resolve(0)},function(a){return d[65]=d[8]===""?void 0:d[8],d[65]!==void 0?b.i64.neq(d[13],void 0)?(d[69]=new b.Map(),d[69].set("reply_source_id",d[65]),d[69].set("reply_source_type",d[13]),d[69].set("reply_type",d[37]==null?b.i64.cast([0,0]):d[37]),d[69].set("reply_source_attachment_id",void 0),d[54].set("reply_metadata",d[69])):0:0,d[66]=d[27]===""?void 0:d[27],d[66]!==void 0?(d[69]=d[32]===""?void 0:d[32],d[69]!==void 0?(d[70]=d[33]===""?void 0:d[33],d[70]!==void 0?(d[71]=new b.Map(),d[71].set("mention_ids",d[66]),d[71].set("mention_offsets",d[69]),d[71].set("mention_lengths",d[70]),d[71].set("mention_types",d[34]===""?void 0:d[34]),d[54].set("mention_data",d[71])):0):0):0,d[35]!==void 0?d[54].set("is_forwarded",d[35]):0,d[67]=d[9]===""?void 0:d[9],d[67]!==void 0?d[54].set("platform_ref",d[67]):0,d[68]=d[10]===""?void 0:d[10],d[68]!==void 0?d[54].set("platform_token",d[68]):0,[b.i64.cast([0,1]),b.i64.cast([0,2])].some(function(a){return b.i64.eq(d[55],a)})?b.i64.neq(d[36],void 0)?d[54].set("hot_emoji_size",d[36]):0:0,b.i64.neq(d[14],void 0)?d[54].set("initiating_source",d[14]):0,d[15]!==void 0?d[54].set("skip_url_preview_gen",d[15]):0,b.i64.neq(d[16],void 0)?d[54].set("rich_text_format_type",d[16]):0,b.resolve()},function(a){return d[17]!==void 0?d[54].set("text_has_links",d[17]):0,d[18]!==void 0?d[54].set("multitab_env",d[18]):0,b.filter(b.db.table(14).fetch([[[d[45],d[38]]]]),function(a){return b.i64.eq(a.threadKey,d[45])&&b.i64.eq(b.i64.cast([0,0]),d[47])&&b.i64.eq(a.contactId,d[38])}).next().then(function(c,e){var a=c.done;c=c.value;return a?d[56]=!1:(e=c.item,b.i64.eq(d[39],b.i64.cast([0,152]))?(d[70]=e.threadRoles,b.i64.lt(b.i64.cast([0,7]),b.i64.cast([0,0]))||b.i64.gt(b.i64.cast([0,7]),b.i64.cast([0,7]))?d[71]=!1:d[71]=!b.i64.eq(b.i64.and_(b.i64.lsl_(b.i64.cast([0,1]),b.i64.to_int32(b.i64.cast([0,7]))),d[70]),b.i64.cast([0,0])),d[72]=d[48],d[73]=d[49],d[74]=d[50],d[75]=d[51],d[77]=b.i64.div(b.i64.cast([0,223]),b.i64.cast([0,64])),d[78]=b.i64.lsl_(b.i64.cast([0,1]),b.i64.to_int32(b.i64.sub(b.i64.cast([0,223]),b.i64.mul(d[77],b.i64.cast([0,64]))))),b.i64.lt(b.i64.cast([0,223]),b.i64.cast([0,0]))||b.i64.gt(b.i64.cast([0,223]),b.i64.cast([0,244]))?d[76]=!1:(b.i64.eq(d[77],b.i64.cast([0,0]))?d[79]=!b.i64.eq(b.i64.and_(d[78],d[72]),b.i64.cast([0,0])):(b.i64.eq(d[77],b.i64.cast([0,1]))?d[80]=!b.i64.eq(b.i64.and_(d[78],d[73]),b.i64.cast([0,0])):(b.i64.eq(d[77],b.i64.cast([0,2]))?d[81]=!b.i64.eq(b.i64.and_(d[78],d[74]),b.i64.cast([0,0])):(b.i64.eq(d[77],b.i64.cast([0,3]))?d[82]=!b.i64.eq(b.i64.and_(d[78],d[75]),b.i64.cast([0,0])):d[82]=!1,d[81]=d[82]),d[80]=d[81]),d[79]=d[80]),d[76]=d[79]),d[71]===d[76]?0:(function(a){b.logger(a).mustfix(a)}("LS::assert is failed. Thread role and thread capability don't agree for Broadcast Channels message-as-page functionality; aborting"),b["throw"]("LS::assert is failed. Thread role and thread capability don't agree for Broadcast Channels message-as-page functionality; aborting")),d[69]=d[71]):d[69]=!1,d[56]=d[69])})},function(a){return d[56]?d[54].set("perform_action_as_page",!0):0,d[58]=b.createArray(),b.forEach(b.db.table(14).fetch([[[d[26]]]]),function(a){a=a.item;return d[69]=(d[58].push(a.contactId),d[58])})},function(a){return d[59]=new b.Map(),d[59].set("participants",d[58]),d[59].set("send_payload",d[54]),d[46]!==void 0?d[59].set("thread_name",d[46]):0,b.db.table(312).fetch([[[d[26]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?d[60]=void 0:(c=b.item,d[60]=c.metadata)})},function(a){return d[59].set("thread_metadata",d[60]),b.forEach(b.db.table(9).fetch([[[d[45]]]]),function(a){var b=a.update;a.item;return b({otidOfFirstMessage:g.offlineThreadingId})})},function(a){return d[60]===void 0||!1?(b.i64.eq(d[39],b.i64.cast([0,5]))||b.i64.eq(d[39],b.i64.cast([0,26]))?(function(a){b.logger(a).mustfix(a)}("For Marketplace & community chat subthreads, thread metadata cannot be null"),a=[void 0,void 0,void 0],d[69]=a[0],d[70]=a[1],d[71]=a[2],a):(d[72]=b.toJSON(d[59]),a=[d[72],b.i64.cast([0,130]),void 0],d[69]=a[0],d[70]=a[1],d[71]=a[2],a),a=[d[69],d[70],d[71]],d[62]=a[0],d[63]=a[1],d[64]=a[2],a):(b.i64.eq(d[39],b.i64.cast([0,5]))?(d[72]=b.toJSON(d[59]),a=[d[72],b.i64.cast([0,645]),void 0],d[69]=a[0],d[70]=a[1],d[71]=a[2],a):(b.i64.eq(d[39],b.i64.cast([0,26]))?(d[75]=b.toJSON(d[59]),a=[d[75],b.i64.cast([0,696]),void 0],d[72]=a[0],d[73]=a[1],d[74]=a[2],a):(b.i64.eq(d[39],b.i64.cast([0,2]))?(d[78]=b.toJSON(d[59]),a=[d[78],b.i64.cast([0,787]),void 0],d[75]=a[0],d[76]=a[1],d[77]=a[2],a):(d[78]=b.toJSON(d[59]),a=[d[78],b.i64.cast([0,645]),void 0],d[75]=a[0],d[76]=a[1],d[77]=a[2],a),a=[d[75],d[76],d[77]],d[72]=a[0],d[73]=a[1],d[74]=a[2],a),a=[d[72],d[73],d[74]],d[69]=a[0],d[70]=a[1],d[71]=a[2],a),a=[d[69],d[70],d[71]],d[62]=a[0],d[63]=a[1],d[64]=a[2],a),a=[d[62],d[63],d[64]],d[42]=a[0],d[43]=a[1],d[44]=a[2],a}]):b.sequence([function(a){return d[55]=d[19]==null?b.i64.cast([0,1]):d[19],b.db.table(9).fetch([[[d[26]]]]).next().then(function(c,e){var a=c.done;c=c.value;return a?d[52]=b.i64.cast([0,1]):(e=c.item,d[64]=e.syncGroup,b.i64.neq(d[64],void 0)?d[63]=d[64]:d[63]=b.i64.cast([0,1]),d[52]=d[63])})},function(a){return d[54]=new b.Map(),d[54].set("thread_id",d[26]),d[54].set("otid",d[11]),d[54].set("source",d[20]==null?b.i64.cast([0,0]):d[20]),d[54].set("send_type",b.i64.cast([0,1])),d[54].set("sync_group",d[52]),d[54].set("mark_thread_read",d[21]),b.i64.eq(d[55],b.i64.cast([0,1]))?b.resolve(d[54].set("text",d[29])):b.i64.eq(d[55],b.i64.cast([0,2]))?b.resolve(b.i64.neq(d[28],void 0)?(d[54].set("sticker_id",d[28]),d[54].set("send_type",d[55])):0):b.i64.eq(d[55],b.i64.cast([0,7]))?b.sequence([function(a){return b.db.table(16).fetch([[[d[26],d[30]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?(a=[void 0,void 0],d[63]=a[0],d[64]=a[1],a):(c=b.item,a=[c.filename,c.attributionAppId],d[63]=a[0],d[64]=a[1],a)})},function(a){return d[63]!==void 0?b.i64.neq(d[64],void 0)?(d[54].set("url",d[63]),d[54].set("attribution_app_id",d[64]),d[54].set("send_type",d[55])):0:0}]):b.i64.eq(d[55],b.i64.cast([0,3]))?b.sequence([function(a){return d[54].set("text",d[29]),d[63]=b.createArray(),d[64]=b.createArray(),b.forEach(b.sortBy(b.db.table(16).fetch([[[d[26],d[30]]]]),[["attachmentIndex","ASC"]]),function(a){a=a.item;return d[65]=a.offlineAttachmentId,d[66]=(d[63].push(b.i64.from_string(a.attachmentFbid)),d[63]),d[65]!==void 0?d[66]=(d[64].push(d[65]),d[64]):0})},function(a){return d[54].set("attachment_fbids",d[63]),b.i64.eq(d[55],b.i64.cast([0,9]))?d[54].set("offline_attachment_ids",d[64]):0,d[54].set("send_type",d[55])}]):b.i64.eq(d[55],b.i64.cast([0,9]))?b.sequence([function(a){return d[54].set("text",d[29]),d[63]=b.createArray(),d[64]=b.createArray(),b.forEach(b.sortBy(b.db.table(16).fetch([[[d[26],d[30]]]]),[["attachmentIndex","ASC"]]),function(a){a=a.item;return d[65]=a.offlineAttachmentId,d[66]=(d[63].push(b.i64.from_string(a.attachmentFbid)),d[63]),d[65]!==void 0?d[66]=(d[64].push(d[65]),d[64]):0})},function(a){return d[54].set("attachment_fbids",d[63]),b.i64.eq(d[55],b.i64.cast([0,9]))?d[54].set("offline_attachment_ids",d[64]):0,d[54].set("send_type",d[55])}]):b.i64.eq(d[55],b.i64.cast([0,10]))?b.sequence([function(a){return d[54].set("text",d[29]),d[63]=b.createArray(),d[64]=b.createArray(),b.forEach(b.sortBy(b.db.table(16).fetch([[[d[26],d[30]]]]),[["attachmentIndex","ASC"]]),function(a){a=a.item;return d[65]=a.offlineAttachmentId,d[66]=(d[63].push(b.i64.from_string(a.attachmentFbid)),d[63]),d[65]!==void 0?d[66]=(d[64].push(d[65]),d[64]):0})},function(a){return d[54].set("attachment_fbids",d[63]),b.i64.eq(d[55],b.i64.cast([0,9]))?d[54].set("offline_attachment_ids",d[64]):0,d[54].set("send_type",d[55])}]):b.i64.eq(d[55],b.i64.cast([0,4]))?b.sequence([function(a){return b.db.table(16).fetch([[[d[26],d[30]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?d[63]=void 0:(c=b.item,d[63]=c.attachmentFbid)})},function(a){return b.db.table(16).fetch([[[d[26],d[30]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?d[65]=void 0:(c=b.item,d[65]=c.actionUrl)})},function(a){return d[63]!==void 0?(d[54].set("text",d[29]),d[65]!==void 0?d[54].set("url",d[65]):0,d[54].set("forwarded_share_id",d[63]),d[54].set("send_type",d[55])):0}]):b.i64.eq(d[55],b.i64.cast([0,5]))?b.resolve(d[12]!==void 0?(d[54].set("forwarded_msg_id",d[12]),d[54].set("send_type",d[55]),b.i64.neq(d[31],void 0)?d[54].set("forward_score",d[31]):0,d[54].set("strip_forwarded_msg_caption",!1)):0):b.i64.eq(d[55],b.i64.cast([0,6]))?b.sequence([function(a){return b.db.table(16).fetch([[[d[26],d[30]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?(a=[void 0,void 0],d[63]=a[0],d[64]=a[1],a):(c=b.item,a=[c.filename,c.attributionAppId],d[63]=a[0],d[64]=a[1],a)})},function(a){return d[63]!==void 0?(d[54].set("url",d[63]),d[54].set("text",d[29]),d[54].set("send_type",d[55])):0}]):b.i64.eq(d[55],b.i64.cast([0,11]))?b.sequence([function(a){return b.db.table(16).fetch([[[d[26],d[30]]]]).next().then(function(b,c){var a=b.done;b=b.value;return a?(a=[void 0,void 0],d[63]=a[0],d[64]=a[1],a):(c=b.item,a=[c.actionUrl,c.attributionAppId],d[63]=a[0],d[64]=a[1],a)})},function(a){return d[63]!==void 0?(d[54].set("url",d[63]),c("gkx")("3272")?d[54].set("text",d[29]):0,d[54].set("send_type",d[55])):0}]):b.resolve(0)},function(a){return d[59]=d[8]===""?void 0:d[8],d[59]!==void 0?b.i64.neq(d[13],void 0)?(d[63]=new b.Map(),d[63].set("reply_source_id",d[59]),d[63].set("reply_source_type",d[13]),d[63].set("reply_type",d[37]==null?b.i64.cast([0,0]):d[37]),d[63].set("reply_source_attachment_id",void 0),d[54].set("reply_metadata",d[63])):0:0,d[60]=d[27]===""?void 0:d[27],d[60]!==void 0?(d[63]=d[32]===""?void 0:d[32],d[63]!==void 0?(d[64]=d[33]===""?void 0:d[33],d[64]!==void 0?(d[65]=new b.Map(),d[65].set("mention_ids",d[60]),d[65].set("mention_offsets",d[63]),d[65].set("mention_lengths",d[64]),d[65].set("mention_types",d[34]===""?void 0:d[34]),d[54].set("mention_data",d[65])):0):0):0,d[35]!==void 0?d[54].set("is_forwarded",d[35]):0,d[61]=d[9]===""?void 0:d[9],d[61]!==void 0?d[54].set("platform_ref",d[61]):0,d[62]=d[10]===""?void 0:d[10],d[62]!==void 0?d[54].set("platform_token",d[62]):0,[b.i64.cast([0,1]),b.i64.cast([0,2])].some(function(a){return b.i64.eq(d[55],a)})?b.i64.neq(d[36],void 0)?d[54].set("hot_emoji_size",d[36]):0:0,b.i64.neq(d[14],void 0)?d[54].set("initiating_source",d[14]):0,d[15]!==void 0?d[54].set("skip_url_preview_gen",d[15]):0,b.i64.neq(d[16],void 0)?d[54].set("rich_text_format_type",d[16]):0,b.resolve()},function(a){return d[17]!==void 0?d[54].set("text_has_links",d[17]):0,d[18]!==void 0?d[54].set("multitab_env",d[18]):0,b.filter(b.db.table(14).fetch([[[d[45],d[38]]]]),function(a){return b.i64.eq(a.threadKey,d[45])&&b.i64.eq(b.i64.cast([0,0]),d[47])&&b.i64.eq(a.contactId,d[38])}).next().then(function(c,e){var a=c.done;c=c.value;return a?d[56]=!1:(e=c.item,b.i64.eq(d[39],b.i64.cast([0,152]))?(d[64]=e.threadRoles,b.i64.lt(b.i64.cast([0,7]),b.i64.cast([0,0]))||b.i64.gt(b.i64.cast([0,7]),b.i64.cast([0,7]))?d[65]=!1:d[65]=!b.i64.eq(b.i64.and_(b.i64.lsl_(b.i64.cast([0,1]),b.i64.to_int32(b.i64.cast([0,7]))),d[64]),b.i64.cast([0,0])),d[66]=d[48],d[67]=d[49],d[68]=d[50],d[69]=d[51],d[71]=b.i64.div(b.i64.cast([0,223]),b.i64.cast([0,64])),d[72]=b.i64.lsl_(b.i64.cast([0,1]),b.i64.to_int32(b.i64.sub(b.i64.cast([0,223]),b.i64.mul(d[71],b.i64.cast([0,64]))))),b.i64.lt(b.i64.cast([0,223]),b.i64.cast([0,0]))||b.i64.gt(b.i64.cast([0,223]),b.i64.cast([0,244]))?d[70]=!1:(b.i64.eq(d[71],b.i64.cast([0,0]))?d[73]=!b.i64.eq(b.i64.and_(d[72],d[66]),b.i64.cast([0,0])):(b.i64.eq(d[71],b.i64.cast([0,1]))?d[74]=!b.i64.eq(b.i64.and_(d[72],d[67]),b.i64.cast([0,0])):(b.i64.eq(d[71],b.i64.cast([0,2]))?d[75]=!b.i64.eq(b.i64.and_(d[72],d[68]),b.i64.cast([0,0])):(b.i64.eq(d[71],b.i64.cast([0,3]))?d[76]=!b.i64.eq(b.i64.and_(d[72],d[69]),b.i64.cast([0,0])):d[76]=!1,d[75]=d[76]),d[74]=d[75]),d[73]=d[74]),d[70]=d[73]),d[65]===d[70]?0:(function(a){b.logger(a).mustfix(a)}("LS::assert is failed. Thread role and thread capability don't agree for Broadcast Channels message-as-page functionality; aborting"),b["throw"]("LS::assert is failed. Thread role and thread capability don't agree for Broadcast Channels message-as-page functionality; aborting")),d[63]=d[65]):d[63]=!1,d[56]=d[63])})},function(a){return d[56]?d[54].set("perform_action_as_page",!0):0,d[58]=b.toJSON(d[54]),a=[d[58],b.i64.cast([0,46]),void 0],d[42]=a[0],d[43]=a[1],d[44]=a[2],a}])},function(a){return a=[d[42],d[43],d[44]],d[22]=a[0],d[23]=a[1],d[24]=a[2],a}]))})},function(a){return a=[d[22],d[23],d[24]],d[4]=a[0],d[5]=a[1],d[6]=a[2],a}]))})},function(a){return a=[d[4],d[5],d[6]],d[0]=a[0],d[1]=a[1],d[2]=a[2],a}]))})},function(a){return a=[d[0],d[1]],e[0]=a[0],e[1]=a[1],a}])},function(a){return b.resolve(e)}])}a.__sproc_name__="LSMailboxTaskSerializerSendMessageV2StoredProcedure";b=a;g["default"]=b}),98);
__d("LSTaskSerializerSyncThreadCapabilities",[],(function(a,b,c,d,e,f){function a(){var a,b=arguments,c=b[b.length-1],d=[];return a=[void 0,void 0,void 0],d[0]=a[0],d[1]=a[1],d[2]=a[2],a,c.resolve(d)}a.__sproc_name__="LSMailboxTaskSerializerSyncThreadCapabilitiesStoredProcedure";e.exports=a}),null);
__d("LSIsExperimentCapabilityEnabled.nop",["LSACSExperimentCapability","LSIntEnum","MetaConfig","Promise"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j=c("MetaConfig")._("87"),k=c("MetaConfig")._("156");a=function(a,e,f,g){switch((i||(i=d("LSIntEnum"))).toNumber(f)){case c("LSACSExperimentCapability").BUMP_TOKEN_SYNC_TASK_AT_TASK_SERIALIZATION:return(h||(h=b("Promise"))).resolve([k]);case c("LSACSExperimentCapability").INSERT_PENDING_TASK_PARENT_ROW_WHEN_NO_ACS_TOKENS_AT_TASK_INSERTION:return(h||(h=b("Promise"))).resolve([!1]);case c("LSACSExperimentCapability").RETRY_AFTER_TASK_SERIALIZATION_FAILURE_EXPONENTIAL_BACKOFF:return(h||(h=b("Promise"))).resolve([j])}return(h||(h=b("Promise"))).resolve([!1])};g["default"]=a}),98);
__d("LSMailboxTaskCompletionApiOnTaskCompletion",[],(function(a,b,c,d,e,f){function a(){var a=arguments,b=a[a.length-1],c=[];return b.sequence([function(c){return b.forEach(b.db.table(233).fetch([[[a[0]]]]),function(b){var c=b.update;b.item;return c({success:a[1]})})},function(a){return b.resolve(c)}])}a.__sproc_name__="LSCoreMailboxTaskCompletionApiOnTaskCompletionStoredProcedure";e.exports=a}),null);
__d("LSVoprfHmac.nop",["ACSCipherSuiteModule","ACSTokenHmacUtil","Promise","XPlatReactTextEncoder","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;a=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c,e,f){a=d("ACSCipherSuiteModule").getACSCipherSuiteByValue(d("ACSCipherSuiteModule").VOPRF_RISTRETTO_HMACSHA512.value);if(!a)return(h||(h=b("Promise"))).resolve([void 0]);c=(yield d("ACSTokenHmacUtil").hmac(a.macAlgorithm,new Uint8Array(f).slice(),new(d("XPlatReactTextEncoder").TextEncoder)().encode(e)));return(h||(h=b("Promise"))).resolve([c.buffer])});function c(b,c,d,e){return a.apply(this,arguments)}return c}();g["default"]=a}),98);
__d("LSTaskSerializerUnauthenticatedTask",["LSArrayGetObjectAt","LSBase64Encode.nop","LSIsExperimentCapabilityEnabled.nop","LSMailboxTaskCompletionApiOnTaskCompletion","LSRemoveUsedTokens","LSVoprfHmac.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(b){return c.db.table(311).fetch([[[a[0]]]]).next().then(function(a,b){var c=a.done;a=a.value;return c?d[0]=void 0:(b=a.item,d[0]=b.projectName)})},function(e){return d[0]!==void 0?c.sequence([function(e){return a[1]!==void 0?c.sequence([function(a){return d[9]=c.createArray(),d[10]=c.i64.of_float(Date.now()),c.forEach(c.filter(c.db.table(307).fetch(),function(a){return d[0]===a.projectName&&c.i64.gt(a.expirationTimestampMs,d[10])}),function(a){a=a.item;return d[16]=(d[9].push(a.configId),d[9])})},function(a){return c.sequence([function(a){return d[16]=c.createArray(),d[17]=c.i64.of_int32(d[9].length),c.i64.gt(d[17],c.i64.cast([0,0]))?c.loopAsync(d[17],function(a){return d[19]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[9],d[19]).then(function(a){return a=a,d[20]=a[0],d[21]=a[1],a})},function(a){return d[22]=(d[16].push(d[20]),d[16])}])}):c.resolve()},function(a){return d[18]=d[16].join(","),d[11]=d[18]}])},function(e){return c.filter(c.db.table(309).fetch(),function(a){return d[9].includes(a.configId)&&c.i64.gt(a.redeemLimit,c.i64.cast([0,0]))}).next().then(function(e,f){var g=e.done;e=e.value;return g?c.sequence([function(a){return c.nativeOperation(b("LSIsExperimentCapabilityEnabled.nop"),c.i64.cast([0,0]),d[0]).then(function(a){return a=a,d[16]=a[0],a})},function(e){return d[16]?c.sequence([function(b){return c.db.table(311).fetch([[[a[0]]]]).next().then(function(b,e){var a=b.done;b=b.value;return a?d[20]=c.i64.cast([0,0]):(e=b.item,d[20]=e.failureCount)})},function(b){return c.forEach(c.db.table(311).fetch([[[a[0]]]]),function(a){a=a.item;return c.forEach(c.db.table(311).fetch([[[a.taskId]]]),function(a){var b=a.update;a.item;return b({failureCount:c.i64.add(d[20],c.i64.cast([0,1]))})})})},function(a){return a=[void 0,void 0,c.i64.mul(c.i64.lsl_(c.i64.cast([0,1]),c.i64.to_int32(c.i64.mod_(d[20],c.i64.cast([0,7])))),c.i64.cast([0,500]))],d[17]=a[0],d[18]=a[1],d[19]=a[2],a}]):c.sequence([function(d){return c.storedProcedure(b("LSMailboxTaskCompletionApiOnTaskCompletion"),a[0],!1)},function(b){return d[20]=c.createArray(),d[21]=(d[20].push("Unauthenticated Task Serializer: no valid tokens"),d[20]),d[22]=(d[20].push(a[0]),d[20]),d[23]=(d[20].push(d[0]),d[20]),d[24]=c.toJSON(d[20]),function(a){c.logger(a).mustfix(a)}(d[24]),b=[void 0,void 0,void 0],d[17]=b[0],d[18]=b[1],d[19]=b[2],b}])},function(a){return a=[d[17],d[18],d[19]],d[12]=a[0],d[13]=a[1],d[14]=a[2],a}]):(f=e.item,c.sequence([function(e){return d[20]=f.tokenId,c.nativeOperation(b("LSVoprfHmac.nop"),a[2]==null?"":a[2],f.sharedSecret).then(function(a){return a=a,d[16]=a[0],a})},function(e){return c.blobs.neq(d[16],void 0)?c.sequence([function(a){return c.forEach(c.db.table(309).fetch([[[d[20]]]]),function(a){var b=a.update;a=a.item;return b({redeemLimit:c.i64.sub(a.redeemLimit,c.i64.cast([0,1]))})})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[16]).then(function(a){return a=a,d[21]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),f.nonce).then(function(a){return a=a,d[22]=a[0],a})},function(b){return d[23]=new c.Map(),d[23].set("config_id",f.configId),d[23].set("tag",d[21]==null?"":d[21]),d[23].set("aux",d[22]==null?"":d[22]),d[23].set("project_name",d[0]),d[24]=c.toJSON(d[23]),d[25]=new c.Map(),d[25].set("payload",a[2]==null?"":a[2]),d[25].set("token",d[24]),d[26]=c.toJSON(d[25]),b=[d[26],c.i64.from_string(a[1]),void 0],d[17]=b[0],d[18]=b[1],d[19]=b[2],b}]):c.sequence([function(a){return c.forEach(c.db.table(309).fetch([[[d[20]]]]),function(a){return a["delete"]()})},function(d){return c.storedProcedure(b("LSMailboxTaskCompletionApiOnTaskCompletion"),a[0],!1)},function(b){return d[21]=c.createArray(),d[22]=(d[21].push("Unauthenticated Task Serializer: hmac failed"),d[21]),d[23]=(d[21].push(a[0]),d[21]),d[24]=c.toJSON(d[21]),function(a){c.logger(a).mustfix(a)}(d[24]),b=[void 0,void 0,void 0],d[17]=b[0],d[18]=b[1],d[19]=b[2],b}])},function(a){return a=[d[17],d[18],d[19]],d[12]=a[0],d[13]=a[1],d[14]=a[2],a}]))})},function(a){return a=[d[12],d[13],d[14]],d[6]=a[0],d[7]=a[1],d[8]=a[2],a}]):c.sequence([function(d){return c.storedProcedure(b("LSMailboxTaskCompletionApiOnTaskCompletion"),a[0],!1)},function(b){return d[9]=c.createArray(),d[10]=(d[9].push("Unauthenticated Task Serializer: task has no write label"),d[9]),d[11]=(d[9].push(a[0]),d[9]),d[12]=c.toJSON(d[9]),function(a){c.logger(a).mustfix(a)}(d[12]),b=[void 0,void 0,void 0],d[6]=b[0],d[7]=b[1],d[8]=b[2],b}])},function(a){return a=[d[6],d[7],d[8]],d[2]=a[0],d[3]=a[1],d[4]=a[2],a}]):c.sequence([function(d){return c.storedProcedure(b("LSMailboxTaskCompletionApiOnTaskCompletion"),a[0],!1)},function(b){return d[6]=c.createArray(),d[7]=(d[6].push("Unauthenticated Task Serializer: anonymous_task_context row not found"),d[6]),d[8]=(d[6].push(a[0]),d[6]),d[9]=c.toJSON(d[6]),function(a){c.logger(a).mustfix(a)}(d[9]),b=[void 0,void 0,void 0],d[2]=b[0],d[3]=b[1],d[4]=b[2],b}])},function(a){return c.storedProcedure(b("LSRemoveUsedTokens"))},function(a){return d[0]!==void 0?c.sequence([function(a){return c.nativeOperation(b("LSIsExperimentCapabilityEnabled.nop"),c.i64.cast([0,1]),d[0]).then(function(a){return a=a,d[6]=a[0],a})},function(a){return d[6]?c.sequence([function(a){return c.i64.neq(d[4],void 0)?c.resolve(d[8]=!0):c.sequence([function(a){return d[10]=c.createArray(),d[11]=c.i64.of_float(Date.now()),c.forEach(c.filter(c.db.table(307).fetch(),function(a){return d[0]===a.projectName&&c.i64.gt(a.expirationTimestampMs,d[11])}),function(a){a=a.item;return d[15]=(d[10].push(a.configId),d[10])})},function(a){return c.sequence([function(a){return d[15]=c.createArray(),d[16]=c.i64.of_int32(d[10].length),c.i64.gt(d[16],c.i64.cast([0,0]))?c.loopAsync(d[16],function(a){return d[18]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[10],d[18]).then(function(a){return a=a,d[19]=a[0],d[20]=a[1],a})},function(a){return d[21]=(d[15].push(d[19]),d[15])}])}):c.resolve()},function(a){return d[17]=d[15].join(","),d[12]=d[17]}])},function(a){return c.filter(c.db.table(309).fetch(),function(a){return d[10].includes(a.configId)&&c.i64.gt(a.redeemLimit,c.i64.cast([0,0]))}).next().then(function(a,b){b=a.done;a=a.value;return b?d[13]=!0:(a.item,d[13]=!1)})},function(a){return d[8]=d[13]}])},function(a){return d[8]?c.sequence([function(a){return c.filter(c.db.table(310).fetch(),function(a){return a.projectName===d[0]}).next().then(function(a,b){var c=a.done;a=a.value;return c?d[10]=void 0:(b=a.item,d[10]=b.taskId)})},function(a){return d[9]=d[10]}]):c.resolve(d[9]=void 0)},function(a){return d[7]=d[9]}]):c.resolve(d[7]=void 0)},function(a){return d[5]=d[7]}]):c.resolve(d[5]=void 0)},function(a){return a=[d[2],d[3],d[4],d[5]],e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSAnonymousCredentialsTaskSerializerUnauthenticatedTaskStoredProcedure";e.exports=a}),null);
__d("LSTaskSerializerUpdateThreadName",[],(function(a,b,c,d,e,f){function a(){var a=arguments,b=a[a.length-1],c=[],d=[];return b.sequence([function(e){return b.sequence([function(d){return b.db.table(32).fetch([[[a[0]]]]).next().then(function(d,e){var f=d.done;d=d.value;return f?(c[4]=b.createArray(),c[5]=(c[4].push("taskSerializerUpdateThreadName: Task ID not found"),c[4]),c[6]=(c[4].push(a[0]),c[4]),c[7]=b.toJSON(c[4]),function(a){b.logger(a).mustfix(a)}(c[7]),f=[void 0,void 0,void 0],c[0]=f[0],c[1]=f[1],c[2]=f[2],f):(e=d.item,b.sequence([function(a){return c[8]=e.threadKey,b.db.table(9).fetch([[[c[8]]]]).next().then(function(d,e){var a=d.done;d=d.value;return a?(c[9]=b.createArray(),c[10]=(c[9].push("taskSerializerUpdateThreadName: Thread not found"),c[9]),c[11]=(c[9].push(c[8]),c[9]),c[12]=b.toJSON(c[9]),function(a){b.logger(a).mustfix(a)}(c[12]),a=[void 0,void 0,void 0],c[4]=a[0],c[5]=a[1],c[6]=a[2],a):(e=d.item,b.sequence([function(a){return b.db.table(9).fetch([[[c[8]]]]).next().then(function(d,e){var a=d.done;d=d.value;return a?c[9]=b.i64.cast([0,1]):(e=d.item,c[14]=e.syncGroup,b.i64.neq(c[14],void 0)?c[13]=c[14]:c[13]=b.i64.cast([0,1]),c[9]=c[13])})},function(a){return c[11]=new b.Map(),c[11].set("thread_key",c[8]),c[11].set("thread_name",e.threadName==null?"":e.threadName),c[11].set("sync_group",c[9]),c[12]=b.toJSON(c[11]),a=[c[12],b.i64.cast([0,32]),void 0],c[4]=a[0],c[5]=a[1],c[6]=a[2],a}]))})},function(a){return a=[c[4],c[5],c[6]],c[0]=a[0],c[1]=a[1],c[2]=a[2],a}]))})},function(a){return a=[c[0],c[1],c[2]],d[0]=a[0],d[1]=a[1],d[2]=a[2],a}])},function(a){return b.resolve(d)}])}a.__sproc_name__="LSMailboxTaskSerializerUpdateThreadNameStoredProcedure";e.exports=a}),null);
__d("LSSerializeTask",["LSForceTaskExecutionImmediately","LSTaskSerializerAcsIssueNextSync","LSTaskSerializerE2eeMessageIntegrityCheckV2","LSTaskSerializerE2eeMetadataThreadIntegrityCheck","LSTaskSerializerEncryptedBackupAction","LSTaskSerializerEncryptedBackupsLoopingUpload","LSTaskSerializerEncryptedBackupsOpenUpload","LSTaskSerializerEncryptedBackupsRestoreWithSerializer","LSTaskSerializerEncryptedBackupsUpload","LSTaskSerializerEncryptedBackupsUploadProtobufOnly","LSTaskSerializerMuteThreadV2","LSTaskSerializerRemoveThread","LSTaskSerializerSendMessageV2","LSTaskSerializerSyncThreadCapabilities","LSTaskSerializerUnauthenticatedTask","LSTaskSerializerUpdateThreadName"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return a[1]==="46"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerSendMessageV2"),a[0]).then(function(a){return a=a,d[8]=a[0],d[9]=a[1],a})},function(a){return a=[d[8],c.i64.to_string(d[9]),void 0,void 0],d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],a}]):c.sequence([function(e){return a[1]==="144"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerMuteThreadV2"),a[0]).then(function(a){return a=a,d[12]=a[0],d[13]=a[1],a})},function(a){return a=[d[12],c.i64.to_string(d[13]),void 0,void 0],d[8]=a[0],d[9]=a[1],d[10]=a[2],d[11]=a[3],a}]):c.sequence([function(e){return a[1]==="146"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerRemoveThread"),a[0]).then(function(a){return a=a,d[16]=a[0],d[17]=a[1],a})},function(a){return a=[d[16],c.i64.to_string(d[17]),void 0,void 0],d[12]=a[0],d[13]=a[1],d[14]=a[2],d[15]=a[3],a}]):c.sequence([function(e){return a[1]==="32"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerUpdateThreadName"),a[0]).then(function(a){return a=a,d[20]=a[0],d[21]=a[1],d[22]=a[2],a})},function(a){return a=[d[20],c.i64.to_string(d[21]),void 0,void 0],d[16]=a[0],d[17]=a[1],d[18]=a[2],d[19]=a[3],a}]):c.sequence([function(e){return a[1]==="362"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerAcsIssueNextSync"),a[0]).then(function(a){return a=a,d[24]=a[0],d[25]=a[1],d[26]=a[2],a})},function(a){return a=[d[24],c.i64.to_string(d[25]),void 0,void 0],d[20]=a[0],d[21]=a[1],d[22]=a[2],d[23]=a[3],a}]):c.sequence([function(e){return a[1]==="50015"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerEncryptedBackupsRestoreWithSerializer"),a[0]).then(function(a){return a=a,d[28]=a[0],d[29]=a[1],d[30]=a[2],a})},function(a){return a=[d[28],c.i64.to_string(d[29]),void 0,void 0],d[24]=a[0],d[25]=a[1],d[26]=a[2],d[27]=a[3],a}]):c.sequence([function(e){return a[1]==="319"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerEncryptedBackupAction"),a[0]).then(function(a){return a=a,d[32]=a[0],d[33]=a[1],d[34]=a[2],a})},function(a){return a=[d[32],c.i64.to_string(d[33]),void 0,void 0],d[28]=a[0],d[29]=a[1],d[30]=a[2],d[31]=a[3],a}]):c.sequence([function(e){return a[1]==="50026"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerEncryptedBackupsUpload"),a[0]).then(function(a){return a=a,d[36]=a[0],d[37]=a[1],a})},function(a){return a=[d[36],c.i64.to_string(d[37]),void 0,void 0],d[32]=a[0],d[33]=a[1],d[34]=a[2],d[35]=a[3],a}]):c.sequence([function(e){return a[1]==="50042"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerEncryptedBackupsUploadProtobufOnly"),a[0]).then(function(a){return a=a,d[40]=a[0],d[41]=a[1],d[42]=a[2],a})},function(a){return a=[d[40],c.i64.to_string(d[41]),void 0,void 0],d[36]=a[0],d[37]=a[1],d[38]=a[2],d[39]=a[3],a}]):c.sequence([function(e){return a[1]==="700"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerE2eeMetadataThreadIntegrityCheck"),a[0]).then(function(a){return a=a,d[44]=a[0],d[45]=a[1],d[46]=a[2],a})},function(a){return a=[d[44],c.i64.to_string(d[45]),void 0,void 0],d[40]=a[0],d[41]=a[1],d[42]=a[2],d[43]=a[3],a}]):c.sequence([function(e){return a[1]==="705"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerE2eeMessageIntegrityCheckV2"),a[0]).then(function(a){return a=a,d[48]=a[0],d[49]=a[1],d[50]=a[2],a})},function(a){return a=[d[48],c.i64.to_string(d[49]),void 0,void 0],d[44]=a[0],d[45]=a[1],d[46]=a[2],d[47]=a[3],a}]):c.sequence([function(e){return a[1]==="50043"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerEncryptedBackupsLoopingUpload"),a[0]).then(function(a){return a=a,d[52]=a[0],d[53]=a[1],d[54]=a[2],a})},function(a){return a=[d[52],c.i64.to_string(d[53]),void 0,void 0],d[48]=a[0],d[49]=a[1],d[50]=a[2],d[51]=a[3],a}]):c.sequence([function(e){return a[1]==="50048"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerEncryptedBackupsOpenUpload"),a[0]).then(function(a){return a=a,d[56]=a[0],d[57]=a[1],a})},function(a){return a=[d[56],c.i64.to_string(d[57]),void 0,void 0],d[52]=a[0],d[53]=a[1],d[54]=a[2],d[55]=a[3],a}]):c.sequence([function(e){return a[1]==="160013"?c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerSyncThreadCapabilities"),a[0]).then(function(a){return a=a,d[60]=a[0],d[61]=a[1],d[62]=a[2],a})},function(a){return a=[d[60],c.i64.to_string(d[61]),void 0,void 0],d[56]=a[0],d[57]=a[1],d[58]=a[2],d[59]=a[3],a}]):c.resolve((e=[a[2],a[1],void 0,void 0],d[56]=e[0],d[57]=e[1],d[58]=e[2],d[59]=e[3],e))},function(a){return a=[d[56],d[57],d[58],d[59]],d[52]=a[0],d[53]=a[1],d[54]=a[2],d[55]=a[3],a}])},function(a){return a=[d[52],d[53],d[54],d[55]],d[48]=a[0],d[49]=a[1],d[50]=a[2],d[51]=a[3],a}])},function(a){return a=[d[48],d[49],d[50],d[51]],d[44]=a[0],d[45]=a[1],d[46]=a[2],d[47]=a[3],a}])},function(a){return a=[d[44],d[45],d[46],d[47]],d[40]=a[0],d[41]=a[1],d[42]=a[2],d[43]=a[3],a}])},function(a){return a=[d[40],d[41],d[42],d[43]],d[36]=a[0],d[37]=a[1],d[38]=a[2],d[39]=a[3],a}])},function(a){return a=[d[36],d[37],d[38],d[39]],d[32]=a[0],d[33]=a[1],d[34]=a[2],d[35]=a[3],a}])},function(a){return a=[d[32],d[33],d[34],d[35]],d[28]=a[0],d[29]=a[1],d[30]=a[2],d[31]=a[3],a}])},function(a){return a=[d[28],d[29],d[30],d[31]],d[24]=a[0],d[25]=a[1],d[26]=a[2],d[27]=a[3],a}])},function(a){return a=[d[24],d[25],d[26],d[27]],d[20]=a[0],d[21]=a[1],d[22]=a[2],d[23]=a[3],a}])},function(a){return a=[d[20],d[21],d[22],d[23]],d[16]=a[0],d[17]=a[1],d[18]=a[2],d[19]=a[3],a}])},function(a){return a=[d[16],d[17],d[18],d[19]],d[12]=a[0],d[13]=a[1],d[14]=a[2],d[15]=a[3],a}])},function(a){return a=[d[12],d[13],d[14],d[15]],d[8]=a[0],d[9]=a[1],d[10]=a[2],d[11]=a[3],a}])},function(a){return a=[d[8],d[9],d[10],d[11]],d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3],a}])},function(e){return a[3]?c.resolve((d[1]==="60009"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","60009"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[8]=e[0],d[9]=e[1],d[10]=e[2],d[11]=e[3],e):(d[1]==="60006"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","60006"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[12]=e[0],d[13]=e[1],d[14]=e[2],d[15]=e[3],e):(d[1]==="60008"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","60008"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[16]=e[0],d[17]=e[1],d[18]=e[2],d[19]=e[3],e):(d[1]==="60011"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","60011"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[20]=e[0],d[21]=e[1],d[22]=e[2],d[23]=e[3],e):(d[1]==="765"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","765"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[24]=e[0],d[25]=e[1],d[26]=e[2],d[27]=e[3],e):(d[1]==="1006"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","1006"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[28]=e[0],d[29]=e[1],d[30]=e[2],d[31]=e[3],e):(d[1]==="160009"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","160009"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[32]=e[0],d[33]=e[1],d[34]=e[2],d[35]=e[3],e):(d[1]==="761"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","761"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[36]=e[0],d[37]=e[1],d[38]=e[2],d[39]=e[3],e):(d[1]==="1018"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","1018"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[40]=e[0],d[41]=e[1],d[42]=e[2],d[43]=e[3],e):(d[1]==="632"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","632"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[44]=e[0],d[45]=e[1],d[46]=e[2],d[47]=e[3],e):(d[1]==="384"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","384"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[48]=e[0],d[49]=e[1],d[50]=e[2],d[51]=e[3],e):(d[1]==="384"?(function(a){c.logger(a).mustfix(a)}(["Deidentified task with label ","384"," is being executed through the 'identified' path. This should never happen!"].join("")),e=[void 0,void 0,void 0,void 0],d[52]=e[0],d[53]=e[1],d[54]=e[2],d[55]=e[3],e):(e=[d[0],d[1],d[2],d[3]],d[52]=e[0],d[53]=e[1],d[54]=e[2],d[55]=e[3],e),e=[d[52],d[53],d[54],d[55]],d[48]=e[0],d[49]=e[1],d[50]=e[2],d[51]=e[3],e),e=[d[48],d[49],d[50],d[51]],d[44]=e[0],d[45]=e[1],d[46]=e[2],d[47]=e[3],e),e=[d[44],d[45],d[46],d[47]],d[40]=e[0],d[41]=e[1],d[42]=e[2],d[43]=e[3],e),e=[d[40],d[41],d[42],d[43]],d[36]=e[0],d[37]=e[1],d[38]=e[2],d[39]=e[3],e),e=[d[36],d[37],d[38],d[39]],d[32]=e[0],d[33]=e[1],d[34]=e[2],d[35]=e[3],e),e=[d[32],d[33],d[34],d[35]],d[28]=e[0],d[29]=e[1],d[30]=e[2],d[31]=e[3],e),e=[d[28],d[29],d[30],d[31]],d[24]=e[0],d[25]=e[1],d[26]=e[2],d[27]=e[3],e),e=[d[24],d[25],d[26],d[27]],d[20]=e[0],d[21]=e[1],d[22]=e[2],d[23]=e[3],e),e=[d[20],d[21],d[22],d[23]],d[16]=e[0],d[17]=e[1],d[18]=e[2],d[19]=e[3],e),e=[d[16],d[17],d[18],d[19]],d[12]=e[0],d[13]=e[1],d[14]=e[2],d[15]=e[3],e),e=[d[12],d[13],d[14],d[15]],d[8]=e[0],d[9]=e[1],d[10]=e[2],d[11]=e[3],e),e=[d[8],d[9],d[10],d[11]],d[4]=e[0],d[5]=e[1],d[6]=e[2],d[7]=e[3],e)):c.sequence([function(e){return c.storedProcedure(b("LSTaskSerializerUnauthenticatedTask"),a[0],d[1],d[0]).then(function(a){return a=a,d[8]=a[0],d[9]=a[1],d[10]=a[2],d[11]=a[3],a})},function(a){return c.i64.neq(d[11],void 0)?c.storedProcedure(b("LSForceTaskExecutionImmediately"),d[11]):c.resolve()},function(a){return a=[d[8],c.i64.to_string(d[9]),void 0,d[10]],d[4]=a[0],d[5]=a[1],d[6]=a[2],d[7]=a[3],a}])},function(a){return a=[d[4],d[5],d[6],d[7]],e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSCoreSerializeTaskStoredProcedure";e.exports=a}),null);
__d("LSSerializeTaskStoredProcedure",["LSSerializeTask","cr:8709"],(function(a,b,c,d,e,f,g){function a(a,b){var d=[];d[0]=b.taskId;d[1]=b.taskLabel;d[2]=b.taskValue;d[3]=b.requiresAuthentication;return c("LSSerializeTask").apply(void 0,d.concat([a]))}g["default"]=a}),98);
__d("LSBeginHandlingPendingTasksForQueue2",["I64","LSFactory","LSIntEnum","LSPendingTasksPluginType","LSSerializeTaskStoredProcedure","LSShape","LSVec","Promise","ReQL","XPlatReactCrypto","asyncToGeneratorRuntime","gkx","isNativeTask"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k=500,l=3e4,m=5,n=50,o=7;function p(a,b){return q.apply(this,arguments)}function q(){q=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield a.lightspeed_task_context.get(b));return a==null||a.requiresAuthentication});return q.apply(this,arguments)}function r(a,b){return s.apply(this,arguments)}function s(){s=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("ReQL").firstAsync(d("ReQL").fromTableAscending(a.pending_tasks.index("queueNameTaskId")).getKeyRange(b)));return a==null?{context:void 0,failureCount:(i||(i=d("I64"))).neg_one,httpUrlOverride:void 0,minTimeToSyncTimestampMs:i.neg_one,pluginType:(j||(j=d("LSIntEnum"))).ofNumber(c("LSPendingTasksPluginType").LS_BROKER),queueName:""}:a});return s.apply(this,arguments)}function t(a,b){return u.apply(this,arguments)}function u(){u=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){a=(yield d("ReQL").firstAsync(d("ReQL").fromTableAscending(a.network_requests).getKeyRange(b)));return a==null?0:(i||(i=d("I64"))).to_float(a.lastSyncRequestTimestampMs)});return u.apply(this,arguments)}function v(a,b,c){b=(i||(i=d("I64"))).equal(a.failureCount,(i||(i=d("I64"))).zero)||b;if(b)return 0;b=(i||(i=d("I64"))).to_float(a.failureCount)>o?(i||(i=d("I64"))).to_float(a.failureCount)-o:(i||(i=d("I64"))).to_float(a.failureCount);a=Math.min((1<<Math.min(b-1,o))*k,l);b=c+a;return Math.max(b-Date.now(),0)}function w(){var a=Array.from(d("XPlatReactCrypto").getRandomValues(new Uint32Array(2)));a[0]>>>=1;return(i||(i=d("I64"))).add(i.lsl_(i.of_float(a[0]),32),i.of_float(a[1]))}function x(){var a=(i||(i=d("I64"))).of_float(Date.now());return i.and_(i.or_(i.lsl_(a,22),i.and_(w(),i.castExn([0,4194303]))),i.castExn([2147483647,4294967295]))}function y(a,b){return z.apply(this,arguments)}function z(){z=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=x(),e=(yield a.network_requests.get(b,(i||(i=d("I64"))).neg_one));e==null?yield a.network_requests.add({epochId:c,failureCount:(i||(i=d("I64"))).zero,lastSentTimestampMs:i.zero,lastSyncRequestTimestampMs:i.of_float(Date.now()),syncDatabaseId:i.neg_one,taskQueueName:b}):yield a.network_requests.put(babelHelpers["extends"]({},e,{epochId:c,lastSyncRequestTimestampMs:(i||(i=d("I64"))).of_float(Date.now())}));return c});return z.apply(this,arguments)}function A(a,b){return B.apply(this,arguments)}function B(){B=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){return(yield d("ReQL").firstAsync(d("ReQL").fromTableAscending(a.network_requests).getKeyRange(b).filter(function(a){return a.epochId!=null})))!=null});return B.apply(this,arguments)}function C(a,b,c){var e=(i||(i=d("I64"))).to_float(a.minTimeToSyncTimestampMs),f=Date.now();e=e-f;f=e<=0;return f?v(a,b,c):e}function D(a){return a.httpUrlOverride!=null||(i||(i=d("I64"))).to_float(a.failureCount)>o}function E(a){return a.timeoutTimestampMs!=null?(i||(i=d("I64"))).to_float(a.timeoutTimestampMs)<=Date.now():!1}function F(a){return a===90..toString()||a===130..toString()||a===153..toString()}function G(a,b,c,d,e){e=e===0?void 0:e;return{failureCount:e,label:a,payload:b,queueName:c,taskId:d}}function H(a,b,c){return I.apply(this,arguments)}function I(){I=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,e){a=(yield c("LSSerializeTaskStoredProcedure")(c("LSFactory")(a),{requiresAuthentication:e,taskId:b.taskId,taskLabel:b.context,taskValue:b.taskValue}));e=a[0];var f=a[1];a[2];a=a[3];if(e==null){if(a!=null)return{minRetryDelayMs:a};return}return G(f,e,b.queueName,b.taskId,(i||(i=d("I64"))).to_float(b.failureCount))});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){if(b.context==null){yield a.pending_tasks["delete"](b.taskId);return}var d=E(b);if(d){yield a.pending_tasks["delete"](b.taskId);return}return H(a,b,c)});return K.apply(this,arguments)}function L(a,b){b=b>=(c("gkx")("26373")&&a===String(207)?n:m)||F(a);return!b}function M(a,b){return N.apply(this,arguments)}function N(){N=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var c=(yield a.pending_tasks.get(b.taskId));c!=null&&(i||(i=d("I64"))).equal(b.firstExecutedTimestampMs,(i||(i=d("I64"))).zero)&&(yield a.pending_tasks.put(babelHelpers["extends"]({},c,{firstExecutedTimestampMs:(i||(i=d("I64"))).of_float(Date.now())})))});return N.apply(this,arguments)}function O(a,b){return P.apply(this,arguments)}function P(){P=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,c){if(c.length===0)return{epochId:void 0,tasks:[]};var e=[],f=c[0].httpUrlOverride,g=(yield (h||(h=b("Promise"))).all(c.map(function(b){return p(a,b.taskId)}))).some(Boolean);for(c of c){var j=c.httpUrlOverride===f,k=(yield p(a,c.taskId))===g;yield M(a,c);if(!j||!k)break;j=(yield J(a,c,g));if(j!=null&&j.payload!=null)e.push(j);else if((j==null?void 0:j.minRetryDelayMs)!=null){k=(yield a.pending_tasks.get(c.taskId));if(k!=null){yield a.pending_tasks.put(babelHelpers["extends"]({},k,{failureCount:(i||(i=d("I64"))).add((k=k.failureCount)!=null?k:(i||(i=d("I64"))).zero,i.one),minTimeToSyncTimestampMs:i.add(j.minRetryDelayMs,i.of_float(Date.now()))}))}}else yield a.pending_tasks["delete"](c.taskId);if(!L(c.context,e.length))break}return{epochId:void 0,tasks:e}});return P.apply(this,arguments)}function Q(a,b,c,d,e){return R.apply(this,arguments)}function R(){R=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,d,e){e===void 0&&(e=!0);b=(yield O(a,b));var f=b.tasks;if(f.length===0)return{httpUrlOverride:void 0,networkPayload:void 0,nextSyncMs:void 0,queueName:c,skipRealtimeGateway:!1,workItemType:4};if(e===!0){f=(yield y(a,c));b.epochId=f}e=(yield r(a,c));return{httpUrlOverride:e.httpUrlOverride,networkPayload:b,nextSyncMs:void 0,queueName:c,skipRealtimeGateway:D(e),workItemType:d}});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=(yield r(a,b)),g=(yield t(a,b));f=C(f,e,g);e=f!==0;if(e)return[{httpUrlOverride:void 0,networkPayload:void 0,nextSyncMs:f,queueName:b,skipRealtimeGateway:!1,workItemType:3}];g=[];e=(yield d("ReQL").toArrayAsync(d("ReQL").fromTableAscending(a.pending_tasks.index("queueNameTaskId")).getKeyRange(b)));f=e.filter(c("isNativeTask"));if(f.length>0){f=(yield Q(a,f,b,2,c("gkx")("4778")===!0));g.push(f)}f=e.filter(function(a){return!c("isNativeTask")(a)});if(f.length>0){e=(yield Q(a,f,b,1));g.push(e)}return g});return T.apply(this,arguments)}function U(a,b,c){return V.apply(this,arguments)}function V(){V=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){var d=!(yield A(a,b));return d?S(a,b,c):[{httpUrlOverride:void 0,networkPayload:void 0,nextSyncMs:void 0,queueName:b,skipRealtimeGateway:!1,workItemType:4}]});return V.apply(this,arguments)}function a(a,b){return W.apply(this,arguments)}function W(){W=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var e=b.ignoreSoftDelay;b=b.queueName;a=(yield U(a,b,e));return a.map(function(a){var b;return d("LSShape").ofRecord({network_payload:d("LSShape").ofRecord({epoch_id:(b=a.networkPayload)==null?void 0:b.epochId,tasks:c("LSVec").ofArray(((b=(b=a.networkPayload)==null?void 0:b.tasks)!=null?b:[]).map(function(a){var b;return d("LSShape").ofRecord({failure_count:a.failureCount!=null?(i||(i=d("I64"))).of_float(a.failureCount):void 0,label:(b=a.label)!=null?b:void 0,payload:a.payload,queue_name:a.queueName,task_id:a.taskId})}))}),next_sync_ms:a.nextSyncMs!=null?(i||(i=d("I64"))).of_float(a.nextSyncMs):void 0,queue_name:a.queueName,skip_realtime_gateway:a.skipRealtimeGateway,work_item_type:(j||(j=d("LSIntEnum"))).ofNumber(a.workItemType)})})});return W.apply(this,arguments)}a._updateTaskIfNeeded=M;a._getHeadOfNormalQueue=r;a._lastSyncRequestTimestampForQueue=t;a._exponentialBackoffForNormalQueue=v;a._generateNewEpoch=x;a._openNewEpochForQueue=y;a._isEpochOpenForQueue=A;a._calculateDelayForNormalQueue=C;a._queueShouldSkipRealtimeGateway=D;a._isNativeTask=c("isNativeTask");a._taskIsTimedOut=E;a._taskShouldStopBatching=F;a._buildTaskPayloadExpressionForNormalTaskWithParameters=G;a._buildTaskPayloadExpressionForValidatedNormalTask=H;a._buildTaskPayloadExpressionForUnvalidatedNormalTask=J;a._workForNormalQueueWithoutDelay=Q;a._workForNormalQueueWithClosedEpoch=S;a._buildWorkForNormalQueue=U;a._buildNetworkPayloadShapeForTasks=O;a._canContinueBatchingForQueue=L;g["default"]=a}),98);
__d("LSCookie",["$InternalEnum","Cookie","CookieCore","CurrentEnvironment","CurrentMessengerUser","FBLogger","I64","LSE2EEMetadataSyncGroupUtils","LSIntEnum","MessengerLogHistory","MqttWebDeviceID","ReQL","SortedAsyncIterable","isPromise","isStringNullOrEmpty","pageID","promiseDone"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k=b("$InternalEnum")({SYNCING:"1",NOT_SYNCING:"0"}),l=d("MessengerLogHistory").getInstance("client_init"),m=c("CurrentEnvironment").instagramdotcom?"igd_ls":"m_ls",n={c:{},d:c("MqttWebDeviceID").clientID,s:k.NOT_SYNCING,u:c("pageID")};function o(a){function b(a){d("CookieCore").setWithDomain_FOR_MESSENGER_LS_ONLY(m,JSON.stringify(a),window.location.hostname)}var e=c("Cookie").get(m);if(e==null){var f;b((f={},f[d("CurrentMessengerUser").getIDorEIMU()]=a,f));return}f=JSON.parse(e);if(f.u==null){b(babelHelpers["extends"]({},f,(e={},e[d("CurrentMessengerUser").getIDorEIMU()]=a,e)))}else{b((f={},f[d("CurrentMessengerUser").getIDorEIMU()]=a,f))}}function a(){c("Cookie").clear(m)}function p(a){if(typeof a!=="object")return null;if(a==null)return null;var b=a.c,c=a.d,d=a.s;a=a.u;d=typeof d==="string"?k.cast(d):null;b=typeof b==="object"&&b!=null?Object.entries(b).reduce(function(a,b){var c=b[0];b=b[1];if(a==null||typeof b!=="string")return null;a[c]=b;return a},{}):null;if(typeof c!=="string")return null;if(d==null)return null;if(b==null)return null;return typeof a!=="string"?null:{c:b,d:c,s:d,u:a}}function q(){var a=c("Cookie").get(m);if(c("isStringNullOrEmpty")(a))return n;a=JSON.parse(a);var b=d("CurrentMessengerUser").getIDorEIMU(),e=p(a);a=typeof a==="object"&&a!=null?p(a[b]):null;return(a=(b=a)!=null?b:e)!=null?a:n}function r(a){var b=q();if(b.u!==c("pageID"))return;var e={};a.forEach(function(a){a[0];a=a[1];var b=a.currentCursor;a=a.groupId;b!=null&&(e[(i||(i=d("I64"))).to_string(a)]=b)});l.debug("Updated sync cookie to set syncing=false, saving latest cursors");o(babelHelpers["extends"]({},b,{c:e,s:k.NOT_SYNCING}))}var s=[1,2,d("LSE2EEMetadataSyncGroupUtils").shouldAlwaysResetE2EEMetadata()?null:95];function e(a){var b=d("SortedAsyncIterable").toArray(d("ReQL").union.apply(void 0,s.map(function(b){return b==null?d("ReQL").empty():d("ReQL").fromTableAscending(a.tables.sync_groups).getKeyRange((j||(j=d("LSIntEnum"))).ofNumber(b))})));if((h||(h=c("isPromise")))(b)){c("promiseDone")(b.then(function(a){r(a)}));return}r(b)}function f(){try{var a=q();l.debug("Updated sync cookie to set syncing=true");o(babelHelpers["extends"]({},a,{s:k.SYNCING,u:c("pageID")}))}catch(a){c("FBLogger")("ls_web_init").catching(a).warn("Failed to sync cookie")}}g.Status=k;g.DEFAULT_COOKIE=n;g.clear=a;g.get=q;g.syncBeforeUnload=e;g.setSyncing=f}),98);
__d("LSEncryptedBackupsAttachmentErrorCode",[],(function(a,b,c,d,e,f){a=Object.freeze({NO_ERROR:0,UNKNOWN_ERROR:1,MEDIA_TYPE_MISSING:2,PRODUCT_TYPE_MISSING:3,SERIALIZATION_ERROR:21});f["default"]=a}),66);
__d("LSSyncStoredProcedureUtils",["I64","ReQL","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(a,b,c){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){c=c!=null?(h||(h=d("I64"))).of_float(Date.now()+c):b.minTimeToSyncTimestampMs;yield a.pending_tasks.put(babelHelpers["extends"]({},b,{failureCount:(h||(h=d("I64"))).add(b.failureCount,h.one),minTimeToSyncTimestampMs:c}))});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){b=(yield d("ReQL").firstAsync(d("ReQL").fromTableAscending(a.pending_tasks.index("queueNameTaskId")).getKeyRange(b)));if(b==null)return;return i(a,b,c)});return k.apply(this,arguments)}function c(a,b,c){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b=(yield a.network_requests.get(b,c));if(b==null)return;yield a.network_requests.put(babelHelpers["extends"]({},b,{failureCount:(h||(h=d("I64"))).add(b==null?void 0:b.failureCount,h.one)}))});return l.apply(this,arguments)}function e(a,b,c){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){b=(yield a.network_requests.get(b,c));if(b==null)return;yield a.network_requests.put(babelHelpers["extends"]({},b,{epochId:void 0,networkTaskIdentifier:void 0}))});return m.apply(this,arguments)}g.incrementPendingTaskFailureCount=i;g.incrementPendingTasksTaskFailureCount=a;g.incrementNetworkRequestsTaskFailureCount=c;g.closeEpoch=e}),98);
__d("LSHandleTaskSendFailureForQueue2",["I64","LSSyncStoredProcedureUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a,b,c){return i.apply(this,arguments)}function i(){i=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c){yield d("LSSyncStoredProcedureUtils").incrementPendingTasksTaskFailureCount(a,b,c),yield d("LSSyncStoredProcedureUtils").incrementNetworkRequestsTaskFailureCount(a,b,(h||(h=d("I64"))).neg_one),yield d("LSSyncStoredProcedureUtils").closeEpoch(a,b,h.neg_one)});return i.apply(this,arguments)}g["default"]=a}),98);
__d("LSHandleTaskSendSuccessForQueue2",["I64","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,b){var c=(yield a.network_requests.get(b,(h||(h=d("I64"))).neg_one));if(c==null||c.epochId==null)return;yield a.network_requests["delete"](b,h.neg_one)});return i.apply(this,arguments)}g["default"]=a}),98);
__d("LSSerializeAttachmentBackupPayload",["LSAppendDataTraceAddon","LSArrayGetObjectAt","LSBase64Encode.nop","LSFlushDataTrace.nop","LSGetBlobFromString.nop","LSHmac_v2.nop","LSIsEncryptionVersionSecure","LSIsMobileClient","LSLogMebClientEvent.nop","LSOcmfClientMap.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][serializeAttachmentBackupPayload] Beginning execution."),d[1]=c.i64.of_float(Date.now()),d[2]=c.i64.of_int32(a[0].length),c.i64.gt(d[2],c.i64.cast([0,0]))?c.loopAsync(d[2],function(e){return d[12]=e,c.sequence([function(e){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),a[0],d[12]).then(function(a){return a=a,d[13]=a[0],d[14]=a[1],a})},function(a){return d[15]=d[13].get("attachment_trace_id"),d[13],d[16]=d[15],c.sequence([function(a){return d[16]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[16],c.i64.cast([0,1873]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[17]=a[0],a})},function(a){return d[17]?d[18]=!0:d[18]=!1,d[18]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[19]=c.createArray(),void 0!==void 0?d[20]=(d[19].push(void 0),d[19]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[19],c.i64.cast([0,3]))):c.resolve()}])},function(a){return c.sequence([function(a){return c.sequence([function(a){return d[16]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),d[16],c.i64.cast([0,84]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[19]=a[0],a})},function(a){return d[19]?d[20]=!0:d[20]=!1,d[20]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[21]=c.createArray(),void 0!==void 0?d[22]=(d[21].push(void 0),d[21]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[21],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[16]!==void 0?c.nativeOperation(b("LSFlushDataTrace.nop"),d[16]):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[17]=a[0],a})},function(a){return d[17]?d[18]=!0:d[18]=!1,d[18]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[19]=c.createArray(),void 0!==void 0?d[20]=(d[19].push(void 0),d[19]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[19],c.i64.cast([0,3]))):c.resolve()}])}])}):c.resolve()},function(e){return c.islc(c.filter(c.db.table(168).fetch(),function(a){return c.i64.eq(a.authorityLevel,c.i64.cast([0,80]))||!1}),0,c.i64.to_float(c.i64.cast([0,1]))).next().then(function(e,f){var g=e.done;e=e.value;return g?(d[12]=new c.Map(),d[12].set("error_code",c.i64.cast([0,1])),d[12].set("stored_procedure","LSEncryptedBackupsSerializeAttachmentBackupPayloadStoredProcedure"),d[12].set("error_message",""),g=[void 0,d[12]],d[3]=g[0],d[4]=g[1],g):(f=e.item,c.sequence([function(a){return d[20]=f.ocmfClientStateBlob,d[19]=f.backupTenancy,d[18]=f.encryptionVersion,d[12]=void 0,c.i64.neq(d[12],void 0)?c.resolve(d[13]=d[12]):c.sequence([function(a){return d[21]=c.createArray(),c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,0])).then(function(a){return a=a,d[22]=a[0],a})},function(a){return d[22]?d[31]=(d[21].push(c.i64.cast([0,0])),d[21]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,2])).then(function(a){return a=a,d[23]=a[0],a})},function(a){return d[23]?d[31]=(d[21].push(c.i64.cast([0,2])),d[21]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,3])).then(function(a){return a=a,d[24]=a[0],a})},function(a){return d[24]?d[31]=(d[21].push(c.i64.cast([0,3])),d[21]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,4])).then(function(a){return a=a,d[25]=a[0],a})},function(a){return d[25]?d[31]=(d[21].push(c.i64.cast([0,4])),d[21]):0,d[26]=c.createArray(),d[27]=c.i64.of_int32(d[21].length),c.i64.gt(d[27],c.i64.cast([0,0]))?c.loopAsync(d[27],function(a){return d[31]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[21],d[31]).then(function(a){return a=a,d[32]=a[0],d[33]=a[1],a})},function(a){return d[34]=(d[26].push(d[32]),d[26])}])}):c.resolve()},function(a){return c.sequence([function(a){return d[31]=c.createArray(),d[32]=c.i64.of_int32(d[26].length),c.i64.gt(d[32],c.i64.cast([0,0]))?c.loopAsync(d[32],function(a){return d[34]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[26],d[34]).then(function(a){return a=a,d[35]=a[0],d[36]=a[1],a})},function(a){return d[37]=(d[31].push(c.i64.to_string(d[35])),d[31])}])}):c.resolve()},function(a){return d[33]=d[31].join(","),d[28]=d[33]}])},function(a){return d[26].some(function(a){return c.i64.eq(d[18],a)})?d[29]=d[18]:d[29]=void 0,c.i64.neq(d[29],void 0)?d[30]=d[29]:d[30]=void 0,d[13]=d[30]}])},function(e){return c.i64.neq(d[13],void 0)?d[14]=d[13]:d[14]=c.i64.cast([0,0]),c.i64.neq(d[19],void 0)?d[15]=d[19]:d[15]=c.i64.cast([0,1]),c.i64.neq(f.deviceId,void 0)?c.sequence([function(e){return c.i64.eq(a[4],c.i64.cast([0,0]))?c.sequence([function(e){return d[23]=c.createArray(),d[24]=c.i64.of_int32(a[0].length),c.i64.gt(d[24],c.i64.cast([0,0]))?c.loopAsync(d[24],function(e){return d[40]=e,c.sequence([function(e){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),a[0],d[40]).then(function(a){return a=a,d[41]=a[0],d[42]=a[1],a})},function(e){return d[43]=d[41].get("media_type"),d[41],d[44]=d[41].get("zippy_object_id"),d[41],d[63]=d[44],d[45]=d[41].get("attachment_trace_id"),d[41],d[46]=c.createArray(),d[64]=(d[46].push(c.i64.to_string(f.backupId)),d[46]),d[64]=(d[46].push(d[63]),d[46]),d[47]=c.toJSON(d[46]),d[48]=c.createArray(),d[64]=(d[48].push(a[1]),d[48]),d[64]=(d[48].push(d[63]),d[48]),d[49]=c.toJSON(d[48]),c.nativeOperation(b("LSGetBlobFromString.nop"),d[47]).then(function(a){return a=a,d[50]=a[0],a})},function(a){return c.nativeOperation(b("LSHmac_v2.nop"),c.blob("YXR0YWNobWVudF9rZXlfc2NvcGU="),d[50]).then(function(a){return a=a,d[51]=a[0],a})},function(a){return c.nativeOperation(b("LSOcmfClientMap.nop"),d[20],d[51]).then(function(a){return a=a,d[52]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[52]).then(function(a){return a=a,d[53]=a[0],a})},function(a){return c.nativeOperation(b("LSGetBlobFromString.nop"),d[49]).then(function(a){return a=a,d[54]=a[0],a})},function(a){return c.nativeOperation(b("LSHmac_v2.nop"),c.blob("YXR0YWNobWVudF90b2tlbl9zYWx0X3Njb3Bl"),d[54]).then(function(a){return a=a,d[55]=a[0],a})},function(a){return c.nativeOperation(b("LSOcmfClientMap.nop"),d[20],d[55]).then(function(a){return a=a,d[56]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[56]).then(function(a){return a=a,d[57]=a[0],a})},function(a){return c.nativeOperation(b("LSGetBlobFromString.nop"),d[47]).then(function(a){return a=a,d[58]=a[0],a})},function(a){return c.nativeOperation(b("LSHmac_v2.nop"),c.blob("YXR0YWNobWVudF9rZXlfc2FsdF9zY29wZQ=="),d[58]).then(function(a){return a=a,d[59]=a[0],a})},function(a){return c.nativeOperation(b("LSOcmfClientMap.nop"),d[20],d[59]).then(function(a){return a=a,d[60]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[60]).then(function(a){return a=a,d[61]=a[0],a})},function(a){return d[62]=new c.Map(),d[62].set("attachment_index_key",d[53]==null?"":d[53]),d[62].set("media_type",d[43]),d[62].set("zippy_object_id",d[63]),d[62].set("attachment_trace_id",d[45]),d[62].set("salt_partial_access_token",d[57]==null?"":d[57]),d[62].set("salt_partial_attachment_index_key",d[61]==null?"":d[61]),d[64]=(d[23].push(d[62]),d[23])}])}):c.resolve()},function(e){return c.nativeOperation(b("LSGetBlobFromString.nop"),a[1]).then(function(a){return a=a,d[25]=a[0],a})},function(a){return c.nativeOperation(b("LSHmac_v2.nop"),c.blob("bWVzc2FnZV9pZF9zY29wZQ=="),d[25]).then(function(a){return a=a,d[26]=a[0],a})},function(a){return c.nativeOperation(b("LSOcmfClientMap.nop"),d[20],d[26]).then(function(a){return a=a,d[27]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[27]).then(function(a){return a=a,d[28]=a[0],a})},function(e){return c.nativeOperation(b("LSGetBlobFromString.nop"),a[1]).then(function(a){return a=a,d[29]=a[0],a})},function(a){return c.nativeOperation(b("LSHmac_v2.nop"),c.blob("YXR0YWNobWVudF90b2tlbl9zYWx0X3Njb3Bl"),d[29]).then(function(a){return a=a,d[30]=a[0],a})},function(a){return c.nativeOperation(b("LSOcmfClientMap.nop"),d[20],d[30]).then(function(a){return a=a,d[31]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[31]).then(function(a){return a=a,d[32]=a[0],a})},function(e){return c.nativeOperation(b("LSGetBlobFromString.nop"),a[2]).then(function(a){return a=a,d[33]=a[0],a})},function(a){return c.nativeOperation(b("LSHmac_v2.nop"),c.blob("dGhyZWFkX2lkX3Njb3Bl"),d[33]).then(function(a){return a=a,d[34]=a[0],a})},function(a){return c.nativeOperation(b("LSOcmfClientMap.nop"),d[20],d[34]).then(function(a){return a=a,d[35]=a[0],a})},function(a){return c.nativeOperation(b("LSBase64Encode.nop"),d[35]).then(function(a){return a=a,d[36]=a[0],a})},function(b){return d[37]=new c.Map(),d[37].set("attachment_infos",d[23]),d[37].set("message_partial_id",d[28]==null?"":d[28]),d[37].set("product_type",a[3]),d[37].set("salt_partial_id",d[32]==null?"":d[32]),d[37].set("thread_partial_id",d[36]==null?"":d[36]),d[38]=c.toJSON(d[37]),d[39]=new c.Map(),d[39].set("payload",d[38]),b=[d[39],void 0],d[21]=b[0],d[22]=b[1],b}]):c.resolve((a[5]!==void 0?d[23]=a[5]:d[23]="",d[24]=new c.Map(),d[24].set("error_code",c.i64.cast([-1,4294967295])),d[24].set("stored_procedure","LSEncryptedBackupsSerializeAttachmentBackupPayloadStoredProcedure"),d[24].set("error_message",d[23]),e=[void 0,d[24]],d[21]=e[0],d[22]=e[1],e))},function(a){return a=[d[21],d[22]],d[16]=a[0],d[17]=a[1],a}]):c.resolve((d[21]=new c.Map(),d[21].set("error_code",c.i64.cast([0,24])),d[21].set("stored_procedure","LSEncryptedBackupsSerializeAttachmentBackupPayloadStoredProcedure"),d[21].set("error_message",""),e=[void 0,d[21]],d[16]=e[0],d[17]=e[1],e))},function(a){return a=[d[16],d[17]],d[3]=a[0],d[4]=a[1],a}]))})},function(a){return d[6]=c.i64.of_float(Date.now()),d[7]=c.i64.random(),d[9]="Finishing execution. Execution time: ",d[10]=c.i64.to_string(c.i64.sub(d[6],d[0])),d[11]=" ms",d[8]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][serializeAttachmentBackupPayload] ",d[8],d[9],d[8],d[10],d[8],d[11]].join("")),c.i64.eq(c.i64.mod_(d[7],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[12]=",",d[13]=c.createArray(),void 0!==void 0?d[14]=(d[13].push(void 0),d[13]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"serializeAttachmentBackupPayload",[d[9],d[12],d[10],d[12],d[11]].join(""),d[13],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[3],d[4]],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsSerializeAttachmentBackupPayloadStoredProcedure";e.exports=a}),null);
__d("LSWriteToPendingProtobufBackupsContextV2",[],(function(a,b,c,d,e,f){function a(){var a=arguments,b=a[a.length-1],c=[];return b.sequence([function(c){return b.db.table(305).add({pk:void 0,pendingBackupTaskId:a[0],actThreadId:a[1],toplevelOfflineThreadingId:a[2],messageTimestampMs:a[4],backupAction:a[5],supplementalKey:a[3],attachmentPayload:a[6],senderId:a[7]})},function(a){return b.resolve(c)}])}a.__sproc_name__="LSEncryptedBackupsWriteToPendingProtobufBackupsContextV2StoredProcedure";e.exports=a}),null);
__d("LSIssueMessageBackup",["LSArrayGetObjectAt","LSIsEncryptionVersionSecure","LSIssueNewEbTaskAndGetTaskIDV2","LSLogMebClientEvent.nop","LSSerializeAttachmentBackupPayload","LSWriteToPendingProtobufBackupsContextV2"],(function(a,b,c,d,e,f,g){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][issueMessageBackup] Beginning execution."),d[1]=c.i64.of_float(Date.now()),c.islc(c.filter(c.db.table(168).fetch(),function(a){return c.i64.eq(a.authorityLevel,c.i64.cast([0,80]))||!1}),0,c.i64.to_float(c.i64.cast([0,1]))).next().then(function(e,f){var g=e.done;e=e.value;return g?c.sequence([function(b){return d[11]=c.createArray(),d[14]=(d[11].push("Skipping the message upload since EB is disabled. act thread id = "),d[11]),d[14]=(d[11].push(a[0]),d[11]),d[14]=(d[11].push(", otid = "),d[11]),d[14]=(d[11].push(a[1]),d[11]),d[12]=d[11].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageBackup] ","",d[12]].join("")),c.resolve()},function(a){return d[13]=new c.Map(),d[13].set("error_code",c.i64.cast([0,1])),d[13].set("stored_procedure","LSEncryptedBackupsIssueMessageBackupStoredProcedure"),d[13].set("error_message",""),a=[void 0,d[13]],d[2]=a[0],d[3]=a[1],a}]):(f=e.item,c.sequence([function(a){return d[18]=f.backupTenancy,d[17]=f.encryptionVersion,d[11]=void 0,c.i64.neq(d[11],void 0)?c.resolve(d[12]=d[11]):c.sequence([function(a){return d[19]=c.createArray(),c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,0])).then(function(a){return a=a,d[20]=a[0],a})},function(a){return d[20]?d[29]=(d[19].push(c.i64.cast([0,0])),d[19]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,2])).then(function(a){return a=a,d[21]=a[0],a})},function(a){return d[21]?d[29]=(d[19].push(c.i64.cast([0,2])),d[19]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,3])).then(function(a){return a=a,d[22]=a[0],a})},function(a){return d[22]?d[29]=(d[19].push(c.i64.cast([0,3])),d[19]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,4])).then(function(a){return a=a,d[23]=a[0],a})},function(a){return d[23]?d[29]=(d[19].push(c.i64.cast([0,4])),d[19]):0,d[24]=c.createArray(),d[25]=c.i64.of_int32(d[19].length),c.i64.gt(d[25],c.i64.cast([0,0]))?c.loopAsync(d[25],function(a){return d[29]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[19],d[29]).then(function(a){return a=a,d[30]=a[0],d[31]=a[1],a})},function(a){return d[32]=(d[24].push(d[30]),d[24])}])}):c.resolve()},function(a){return c.sequence([function(a){return d[29]=c.createArray(),d[30]=c.i64.of_int32(d[24].length),c.i64.gt(d[30],c.i64.cast([0,0]))?c.loopAsync(d[30],function(a){return d[32]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[24],d[32]).then(function(a){return a=a,d[33]=a[0],d[34]=a[1],a})},function(a){return d[35]=(d[29].push(c.i64.to_string(d[33])),d[29])}])}):c.resolve()},function(a){return d[31]=d[29].join(","),d[26]=d[31]}])},function(a){return d[24].some(function(a){return c.i64.eq(d[17],a)})?d[27]=d[17]:d[27]=void 0,c.i64.neq(d[27],void 0)?d[28]=d[27]:d[28]=void 0,d[12]=d[28]}])},function(e){return c.i64.neq(d[12],void 0)?d[13]=d[12]:d[13]=c.i64.cast([0,0]),c.i64.neq(d[18],void 0)?d[14]=d[18]:d[14]=c.i64.cast([0,1]),c.i64.neq(f.deviceId,void 0)?c.sequence([function(e){var f;return c.sequence([function(e){return a[11]!==void 0?c.sequence([function(e){return d[27]=a[11].get("attachment_infos"),a[11],d[28]=a[11].get("attachment_infos"),a[11],d[29]=a[11].get("product_type"),a[11],d[30]=a[11].get("error"),a[11],d[31]=a[11].get("error_message"),a[11],c.storedProcedure(b("LSSerializeAttachmentBackupPayload"),d[28],a[1],a[0],d[29],d[30],d[31]).then(function(a){return a=a,d[32]=a[0],d[33]=a[1],a})},function(a){return d[32]?d[34]=!1:d[34]=!0,d[34]?c.sequence([function(a){return d[33]?d[40]=!1:d[40]=!0,d[40]?c.sequence([function(a){return function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][LSEncryptedBackupsIssueMessageBackupStoredProcedure] Invalid Attachment payload generated"),d[44]=c.createArray(),void 0!==void 0?d[45]=(d[44].push(void 0),d[44]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"LSEncryptedBackupsIssueMessageBackupStoredProcedure","Invalid Attachment payload generated",d[44],c.i64.cast([0,3]))},function(a){return a=[void 0,void 0,d[27]],d[41]=a[0],d[42]=a[1],d[43]=a[2],a}]):c.resolve((a=[void 0,d[33],d[27]],d[41]=a[0],d[42]=a[1],d[43]=a[2],a))},function(a){return a=[d[41],d[42],d[43]],d[35]=a[0],d[36]=a[1],d[37]=a[2],a}]):c.resolve((d[40]=d[32].get("payload"),d[32],a=[d[40],void 0,d[27]],d[35]=a[0],d[36]=a[1],d[37]=a[2],a))},function(b){return d[40]=new c.Map(),d[41]=d[40].set("success",d[35]),d[42]=d[40].set("failure",d[36]),d[43]=d[40].set("upload_context",d[37]),d[44]=c.toJSON(d[40]),d[38]=d[44],d[39]=a[11].get("error"),a[11],b=[d[38],d[39]],d[25]=b[0],d[26]=b[1],b}]):c.resolve((function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsIssueMessageBackupStoredProcedure] Null Attachments for the message"),e=[void 0,void 0],d[25]=e[0],d[26]=e[1],e))},function(a){return a=[d[25],d[26]],d[19]=a[0],d[20]=a[1],a}])},function(e){return d[21]=["eb_upload",":",a[0]].join(""),d[22]=c.i64.of_float(Date.now()),c.storedProcedure(b("LSIssueNewEbTaskAndGetTaskIDV2"),d[21],c.i64.cast([0,50026]),"",c.i64.cast([0,0]),c.i64.cast([0,93]),c.i64.le(c.i64.cast([0,0]),c.i64.cast([0,0]))?c.i64.cast([0,0]):c.i64.add(d[22],c.i64.sub(c.i64.cast([0,0]),c.i64.mod_(d[22],c.i64.cast([0,0])))),void 0,c.i64.cast([0,0])).then(function(a){return a=a,d[23]=a[0],a})},function(b){return c.db.table(177).add({pk:void 0,pendingBackupTaskId:d[23],actionType:c.i64.cast([0,1]),contentType:c.i64.cast([0,1]),backupStatus:c.i64.cast([0,1]),listKey:a[0],uniqueKey:a[1],sortKey:c.i64.to_string(c.i64.add(c.i64.mul(c.i64.div(a[2],c.i64.cast([0,1e3])),c.i64.cast([0,1e3])),c.i64.div(c.i64.mod_(c.i64.and_(c.i64.asr_(c.i64.from_string(a[1]),c.i64.to_int32(c.i64.cast([0,22]))),c.i64.cast([511,4294967295])),c.i64.cast([0,1e5])),c.i64.cast([0,100])))),persistentId:"",isInstamadillo:a[12],echoContent:a[4],lsTraceId:a[5],error:a[6],echoEncodingLatencyNs:a[7],errorMessage:a[8],attachmentPayload:d[19],attachmentErrorCode:d[20]})},function(b){return c.i64.eq(c.i64.cast([0,1]),c.i64.cast([0,1]))?c.i64.eq(c.i64.cast([0,1]),c.i64.cast([0,1]))?(d[25]=c.createArray(),d[27]=(d[25].push("Successfully issued message backup task. act thread id = "),d[25]),d[27]=(d[25].push(a[0]),d[25]),d[27]=(d[25].push(", otid = "),d[25]),d[27]=(d[25].push(a[1]),d[25]),d[26]=d[25].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageBackup] ","",d[26]].join("")),c.resolve()):(d[25]=c.createArray(),d[27]=(d[25].push("Successfully issued message remove task. act thread id = "),d[25]),d[27]=(d[25].push(a[0]),d[25]),d[27]=(d[25].push(", otid = "),d[25]),d[27]=(d[25].push(a[1]),d[25]),d[26]=d[25].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageBackup] ","",d[26]].join("")),c.resolve()):(d[25]=c.createArray(),d[27]=(d[25].push("Successfully issued thread remove task. act thread id = "),d[25]),d[27]=(d[25].push(a[0]),d[25]),d[26]=d[25].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageBackup] ","",d[26]].join("")),c.resolve())},function(e){return a[9]!==void 0?(d[25]=a[9].get("act_thread_id"),a[9],d[26]=a[9].get("backup_action"),a[9],d[27]=a[9].get("toplevel_offline_threading_id"),a[9],d[28]=a[9].get("message_timestamp_ms"),a[9],d[29]=a[9].get("supplemental_key"),a[9],d[30]=a[9].get("attachment_payload"),a[9],c.storedProcedure(b("LSWriteToPendingProtobufBackupsContextV2"),d[23],d[25],d[27],d[29],d[28],d[26],d[30],void 0,void 0)):c.resolve()},function(a){return d[24]=new c.Map(),d[24].set("task_id",d[23]),a=[d[24],void 0],d[15]=a[0],d[16]=a[1],a}]):c.sequence([function(b){return d[19]=c.createArray(),d[22]=(d[19].push("Skipping the message upload since EB is disabled. act thread id = "),d[19]),d[22]=(d[19].push(a[0]),d[19]),d[22]=(d[19].push(", otid = "),d[19]),d[22]=(d[19].push(a[1]),d[19]),d[20]=d[19].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageBackup] ","",d[20]].join("")),c.resolve()},function(a){return d[21]=new c.Map(),d[21].set("error_code",c.i64.cast([0,24])),d[21].set("stored_procedure","LSEncryptedBackupsIssueMessageBackupStoredProcedure"),d[21].set("error_message",""),a=[void 0,d[21]],d[15]=a[0],d[16]=a[1],a}])},function(a){return a=[d[15],d[16]],d[2]=a[0],d[3]=a[1],a}]))})},function(a){return d[5]=c.i64.of_float(Date.now()),d[6]=c.i64.random(),d[8]="Finishing execution. Execution time: ",d[9]=c.i64.to_string(c.i64.sub(d[5],d[0])),d[10]=" ms",d[7]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageBackup] ",d[7],d[8],d[7],d[9],d[7],d[10]].join("")),c.i64.eq(c.i64.mod_(d[6],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[11]=",",d[12]=c.createArray(),void 0!==void 0?d[13]=(d[12].push(void 0),d[12]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"issueMessageBackup",[d[8],d[11],d[9],d[11],d[10]].join(""),d[12],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[2],d[3]],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsIssueMessageBackupStoredProcedure";c=a;g["default"]=c}),98);
__d("LSIssueMessageBackupStoredProcedure",["LSIssueMessageBackup","cr:8709"],(function(a,b,c,d,e,f,g){function a(a,b){var d=[];d[0]=b.actThreadId;d[1]=b.otid;d[2]=b.authoritativeTs;d[3]=b.source;d[4]=b.echoDocument;d[5]=b.traceId;d[6]=b.error;d[7]=b.echoEncodingLatencyNs;d[8]=b.errorMessage;d[9]=b.protobufBackupContext;d[10]=b.tamThreadSubtype;d[11]=b.attachmentBackupContext;d[12]=b.isInstamadillo;return c("LSIssueMessageBackup").apply(void 0,d.concat([a]))}g["default"]=a}),98);
__d("LSIssueMessageRemove",["LSArrayGetObjectAt","LSIsEncryptionVersionSecure","LSIssueNewEbTaskAndGetTaskIDV2","LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][issueMessageRemove] Beginning execution."),d[1]=c.i64.of_float(Date.now()),c.islc(c.filter(c.db.table(168).fetch(),function(a){return c.i64.eq(a.authorityLevel,c.i64.cast([0,80]))||!1}),0,c.i64.to_float(c.i64.cast([0,1]))).next().then(function(e,f){var g=e.done;e=e.value;return g?c.sequence([function(b){return d[11]=c.createArray(),d[14]=(d[11].push("Skipping message upload since EB is disabled. act thread id = "),d[11]),d[14]=(d[11].push(a[0]),d[11]),d[14]=(d[11].push(", otid = "),d[11]),d[14]=(d[11].push(a[1]),d[11]),d[12]=d[11].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageRemove] ","",d[12]].join("")),c.resolve()},function(a){return d[13]=new c.Map(),d[13].set("error_code",c.i64.cast([0,1])),d[13].set("stored_procedure","LSEncryptedBackupsIssueMessageRemoveStoredProcedure"),d[13].set("error_message",""),a=[void 0,d[13]],d[2]=a[0],d[3]=a[1],a}]):(f=e.item,c.sequence([function(a){return d[18]=f.backupTenancy,d[17]=f.encryptionVersion,d[11]=void 0,c.i64.neq(d[11],void 0)?c.resolve(d[12]=d[11]):c.sequence([function(a){return d[19]=c.createArray(),c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,0])).then(function(a){return a=a,d[20]=a[0],a})},function(a){return d[20]?d[29]=(d[19].push(c.i64.cast([0,0])),d[19]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,2])).then(function(a){return a=a,d[21]=a[0],a})},function(a){return d[21]?d[29]=(d[19].push(c.i64.cast([0,2])),d[19]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,3])).then(function(a){return a=a,d[22]=a[0],a})},function(a){return d[22]?d[29]=(d[19].push(c.i64.cast([0,3])),d[19]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,4])).then(function(a){return a=a,d[23]=a[0],a})},function(a){return d[23]?d[29]=(d[19].push(c.i64.cast([0,4])),d[19]):0,d[24]=c.createArray(),d[25]=c.i64.of_int32(d[19].length),c.i64.gt(d[25],c.i64.cast([0,0]))?c.loopAsync(d[25],function(a){return d[29]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[19],d[29]).then(function(a){return a=a,d[30]=a[0],d[31]=a[1],a})},function(a){return d[32]=(d[24].push(d[30]),d[24])}])}):c.resolve()},function(a){return c.sequence([function(a){return d[29]=c.createArray(),d[30]=c.i64.of_int32(d[24].length),c.i64.gt(d[30],c.i64.cast([0,0]))?c.loopAsync(d[30],function(a){return d[32]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[24],d[32]).then(function(a){return a=a,d[33]=a[0],d[34]=a[1],a})},function(a){return d[35]=(d[29].push(c.i64.to_string(d[33])),d[29])}])}):c.resolve()},function(a){return d[31]=d[29].join(","),d[26]=d[31]}])},function(a){return d[24].some(function(a){return c.i64.eq(d[17],a)})?d[27]=d[17]:d[27]=void 0,c.i64.neq(d[27],void 0)?d[28]=d[27]:d[28]=void 0,d[12]=d[28]}])},function(e){return c.i64.neq(d[12],void 0)?d[13]=d[12]:d[13]=c.i64.cast([0,0]),c.i64.neq(d[18],void 0)?d[14]=d[18]:d[14]=c.i64.cast([0,1]),c.i64.neq(f.deviceId,void 0)?c.sequence([function(e){return d[19]=["eb_upload",":",a[0]].join(""),d[20]=c.i64.of_float(Date.now()),c.storedProcedure(b("LSIssueNewEbTaskAndGetTaskIDV2"),d[19],c.i64.cast([0,50026]),"",c.i64.cast([0,0]),c.i64.cast([0,93]),c.i64.le(c.i64.cast([0,0]),c.i64.cast([0,0]))?c.i64.cast([0,0]):c.i64.add(d[20],c.i64.sub(c.i64.cast([0,0]),c.i64.mod_(d[20],c.i64.cast([0,0])))),void 0,c.i64.cast([0,0])).then(function(a){return a=a,d[21]=a[0],a})},function(b){return c.db.table(177).add({pk:void 0,pendingBackupTaskId:d[21],actionType:c.i64.cast([0,2]),contentType:c.i64.cast([0,1]),backupStatus:c.i64.cast([0,1]),listKey:a[0],uniqueKey:a[1],sortKey:c.i64.to_string(c.i64.add(c.i64.mul(c.i64.div(a[2],c.i64.cast([0,1e3])),c.i64.cast([0,1e3])),c.i64.div(c.i64.mod_(c.i64.and_(c.i64.asr_(c.i64.from_string(a[1]),c.i64.to_int32(c.i64.cast([0,22]))),c.i64.cast([511,4294967295])),c.i64.cast([0,1e5])),c.i64.cast([0,100])))),persistentId:"",isInstamadillo:!1,lsTraceId:a[4],error:a[5]})},function(b){return c.i64.eq(c.i64.cast([0,1]),c.i64.cast([0,1]))?c.i64.eq(c.i64.cast([0,2]),c.i64.cast([0,1]))?(d[23]=c.createArray(),d[25]=(d[23].push("Successfully issued message backup task. act thread id = "),d[23]),d[25]=(d[23].push(a[0]),d[23]),d[25]=(d[23].push(", otid = "),d[23]),d[25]=(d[23].push(a[1]),d[23]),d[24]=d[23].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageRemove] ","",d[24]].join("")),c.resolve()):(d[23]=c.createArray(),d[25]=(d[23].push("Successfully issued message remove task. act thread id = "),d[23]),d[25]=(d[23].push(a[0]),d[23]),d[25]=(d[23].push(", otid = "),d[23]),d[25]=(d[23].push(a[1]),d[23]),d[24]=d[23].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageRemove] ","",d[24]].join("")),c.resolve()):(d[23]=c.createArray(),d[25]=(d[23].push("Successfully issued thread remove task. act thread id = "),d[23]),d[25]=(d[23].push(a[0]),d[23]),d[24]=d[23].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageRemove] ","",d[24]].join("")),c.resolve())},function(a){return d[22]=new c.Map(),d[22].set("task_id",d[21]),a=[d[22],void 0],d[15]=a[0],d[16]=a[1],a}]):c.sequence([function(b){return d[19]=c.createArray(),d[22]=(d[19].push("Skipping message upload since EB is disabled. act thread id = "),d[19]),d[22]=(d[19].push(a[0]),d[19]),d[22]=(d[19].push(", otid = "),d[19]),d[22]=(d[19].push(a[1]),d[19]),d[20]=d[19].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageRemove] ","",d[20]].join("")),c.resolve()},function(a){return d[21]=new c.Map(),d[21].set("error_code",c.i64.cast([0,24])),d[21].set("stored_procedure","LSEncryptedBackupsIssueMessageRemoveStoredProcedure"),d[21].set("error_message",""),a=[void 0,d[21]],d[15]=a[0],d[16]=a[1],a}])},function(a){return a=[d[15],d[16]],d[2]=a[0],d[3]=a[1],a}]))})},function(a){return d[5]=c.i64.of_float(Date.now()),d[6]=c.i64.random(),d[8]="Finishing execution. Execution time: ",d[9]=c.i64.to_string(c.i64.sub(d[5],d[0])),d[10]=" ms",d[7]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueMessageRemove] ",d[7],d[8],d[7],d[9],d[7],d[10]].join("")),c.i64.eq(c.i64.mod_(d[6],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[11]=",",d[12]=c.createArray(),void 0!==void 0?d[13]=(d[12].push(void 0),d[12]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"issueMessageRemove",[d[8],d[11],d[9],d[11],d[10]].join(""),d[12],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[2],d[3]],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsIssueMessageRemoveStoredProcedure";e.exports=a}),null);
__d("LSIssueMessageRemoveStoredProcedure",["LSIssueMessageRemove","cr:8709"],(function(a,b,c,d,e,f,g){function a(a,b){var d=[];d[0]=b.actThreadId;d[1]=b.otid;d[2]=b.authoritativeTs;d[3]=b.source;d[4]=b.traceId;d[5]=b.error;return c("LSIssueMessageRemove").apply(void 0,d.concat([a]))}g["default"]=a}),98);
__d("LSIssueThreadRemove",["LSArrayGetObjectAt","LSIsEncryptionVersionSecure","LSIssueNewEbTaskAndGetTaskIDV2","LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][issueThreadRemove] Beginning execution."),d[1]=c.i64.of_float(Date.now()),c.islc(c.filter(c.db.table(168).fetch(),function(a){return c.i64.eq(a.authorityLevel,c.i64.cast([0,80]))||!1}),0,c.i64.to_float(c.i64.cast([0,1]))).next().then(function(e,f){var g=e.done;e=e.value;return g?c.sequence([function(b){return d[11]=c.createArray(),d[14]=(d[11].push("Skipping thread remove since EB is disabled. act thread id = "),d[11]),d[14]=(d[11].push(a[0]),d[11]),d[12]=d[11].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueThreadRemove] ","",d[12]].join("")),c.resolve()},function(a){return d[13]=new c.Map(),d[13].set("error_code",c.i64.cast([0,1])),d[13].set("stored_procedure","LSEncryptedBackupsIssueThreadRemoveStoredProcedure"),d[13].set("error_message",""),a=[void 0,d[13]],d[2]=a[0],d[3]=a[1],a}]):(f=e.item,c.sequence([function(a){return d[18]=f.backupTenancy,d[17]=f.encryptionVersion,d[11]=void 0,c.i64.neq(d[11],void 0)?c.resolve(d[12]=d[11]):c.sequence([function(a){return d[19]=c.createArray(),c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,0])).then(function(a){return a=a,d[20]=a[0],a})},function(a){return d[20]?d[29]=(d[19].push(c.i64.cast([0,0])),d[19]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,2])).then(function(a){return a=a,d[21]=a[0],a})},function(a){return d[21]?d[29]=(d[19].push(c.i64.cast([0,2])),d[19]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,3])).then(function(a){return a=a,d[22]=a[0],a})},function(a){return d[22]?d[29]=(d[19].push(c.i64.cast([0,3])),d[19]):0,c.storedProcedure(b("LSIsEncryptionVersionSecure"),c.i64.cast([0,4])).then(function(a){return a=a,d[23]=a[0],a})},function(a){return d[23]?d[29]=(d[19].push(c.i64.cast([0,4])),d[19]):0,d[24]=c.createArray(),d[25]=c.i64.of_int32(d[19].length),c.i64.gt(d[25],c.i64.cast([0,0]))?c.loopAsync(d[25],function(a){return d[29]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[19],d[29]).then(function(a){return a=a,d[30]=a[0],d[31]=a[1],a})},function(a){return d[32]=(d[24].push(d[30]),d[24])}])}):c.resolve()},function(a){return c.sequence([function(a){return d[29]=c.createArray(),d[30]=c.i64.of_int32(d[24].length),c.i64.gt(d[30],c.i64.cast([0,0]))?c.loopAsync(d[30],function(a){return d[32]=a,c.sequence([function(a){return c.nativeTypeOperation("Array",b("LSArrayGetObjectAt"),d[24],d[32]).then(function(a){return a=a,d[33]=a[0],d[34]=a[1],a})},function(a){return d[35]=(d[29].push(c.i64.to_string(d[33])),d[29])}])}):c.resolve()},function(a){return d[31]=d[29].join(","),d[26]=d[31]}])},function(a){return d[24].some(function(a){return c.i64.eq(d[17],a)})?d[27]=d[17]:d[27]=void 0,c.i64.neq(d[27],void 0)?d[28]=d[27]:d[28]=void 0,d[12]=d[28]}])},function(e){return c.i64.neq(d[12],void 0)?d[13]=d[12]:d[13]=c.i64.cast([0,0]),c.i64.neq(d[18],void 0)?d[14]=d[18]:d[14]=c.i64.cast([0,1]),c.i64.neq(f.deviceId,void 0)?c.sequence([function(e){return d[19]=["eb_upload",":",a[0]].join(""),d[20]=c.i64.of_float(Date.now()),c.storedProcedure(b("LSIssueNewEbTaskAndGetTaskIDV2"),d[19],c.i64.cast([0,50026]),"",c.i64.cast([0,0]),c.i64.cast([0,93]),c.i64.le(c.i64.cast([0,0]),c.i64.cast([0,0]))?c.i64.cast([0,0]):c.i64.add(d[20],c.i64.sub(c.i64.cast([0,0]),c.i64.mod_(d[20],c.i64.cast([0,0])))),void 0,c.i64.cast([0,0])).then(function(a){return a=a,d[21]=a[0],a})},function(b){return c.db.table(177).add({pk:void 0,pendingBackupTaskId:d[21],actionType:c.i64.cast([0,2]),contentType:c.i64.cast([0,2]),backupStatus:c.i64.cast([0,1]),listKey:a[0],uniqueKey:a[0],sortKey:a[1],persistentId:"",isInstamadillo:!1,lsTraceId:a[3],error:a[4]})},function(b){return c.i64.eq(c.i64.cast([0,2]),c.i64.cast([0,1]))?c.i64.eq(c.i64.cast([0,2]),c.i64.cast([0,1]))?(d[23]=c.createArray(),d[25]=(d[23].push("Successfully issued message backup task. act thread id = "),d[23]),d[25]=(d[23].push(a[0]),d[23]),d[25]=(d[23].push(", otid = "),d[23]),d[25]=(d[23].push(a[0]),d[23]),d[24]=d[23].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueThreadRemove] ","",d[24]].join("")),c.resolve()):(d[23]=c.createArray(),d[25]=(d[23].push("Successfully issued message remove task. act thread id = "),d[23]),d[25]=(d[23].push(a[0]),d[23]),d[25]=(d[23].push(", otid = "),d[23]),d[25]=(d[23].push(a[0]),d[23]),d[24]=d[23].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueThreadRemove] ","",d[24]].join("")),c.resolve()):(d[23]=c.createArray(),d[25]=(d[23].push("Successfully issued thread remove task. act thread id = "),d[23]),d[25]=(d[23].push(a[0]),d[23]),d[24]=d[23].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueThreadRemove] ","",d[24]].join("")),c.resolve())},function(a){return d[22]=new c.Map(),d[22].set("task_id",d[21]),a=[d[22],void 0],d[15]=a[0],d[16]=a[1],a}]):c.sequence([function(b){return d[19]=c.createArray(),d[22]=(d[19].push("Skipping thread remove since EB is disabled. act thread id = "),d[19]),d[22]=(d[19].push(a[0]),d[19]),d[20]=d[19].join(void 0||""),function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueThreadRemove] ","",d[20]].join("")),c.resolve()},function(a){return d[21]=new c.Map(),d[21].set("error_code",c.i64.cast([0,24])),d[21].set("stored_procedure","LSEncryptedBackupsIssueThreadRemoveStoredProcedure"),d[21].set("error_message",""),a=[void 0,d[21]],d[15]=a[0],d[16]=a[1],a}])},function(a){return a=[d[15],d[16]],d[2]=a[0],d[3]=a[1],a}]))})},function(a){return d[5]=c.i64.of_float(Date.now()),d[6]=c.i64.random(),d[8]="Finishing execution. Execution time: ",d[9]=c.i64.to_string(c.i64.sub(d[5],d[0])),d[10]=" ms",d[7]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][issueThreadRemove] ",d[7],d[8],d[7],d[9],d[7],d[10]].join("")),c.i64.eq(c.i64.mod_(d[6],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[11]=",",d[12]=c.createArray(),void 0!==void 0?d[13]=(d[12].push(void 0),d[12]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"issueThreadRemove",[d[8],d[11],d[9],d[11],d[10]].join(""),d[12],c.i64.cast([0,4]))):c.resolve()},function(a){return a=[d[2],d[3]],e[0]=a[0],e[1]=a[1],a}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsIssueThreadRemoveStoredProcedure";e.exports=a}),null);
__d("LSIssueThreadRemoveStoredProcedure",["LSIssueThreadRemove","cr:8709"],(function(a,b,c,d,e,f,g){function a(a,b){var d=[];d[0]=b.actThreadId;d[1]=b.sortKey;d[2]=b.source;d[3]=b.traceId;d[4]=b.error;return c("LSIssueThreadRemove").apply(void 0,d.concat([a]))}g["default"]=a}),98);
__d("LSPlatformRequestId",[],(function(a,b,c,d,e,f){"use strict";var g=4;function a(){var a=g;g+=1;return a}b={generate:a};f["default"]=b}),66);
__d("LSPlatformRequestScheduler",["clearTimeout","setTimeout"],(function(a,b,c,d,e,f,g){"use strict";a=function(){function a(){this.requests=new Map()}var b=a.prototype;b.schedule=function(a,b,d){var e=this.requests.get(b);e!=null&&c("clearTimeout")(e);this.requests.set(b,c("setTimeout")(a,d))};b.cleanup=function(){this.requests.forEach(function(a){return c("clearTimeout")(a)})};return a}();g["default"]=a}),98);
__d("LSPlatformServerResponseHandler",["FBLogger","Promise","asyncToGeneratorRuntime","clearTimeout","setTimeout"],(function(a,b,c,d,e,f,g){"use strict";var h;a=function(){function a(a){this.eval=a,this.currentlyRunning=(h||(h=b("Promise"))).resolve()}var d=a.prototype;d.evalWhenReady=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var d=[];try{var e=c("setTimeout")(function(){c("FBLogger")("messenger_web_product").mustfix("waited longer than 30 seconds to download dependencies")},3e4);d.push(e);yield a;c("clearTimeout")(e);a=c("setTimeout")(function(){c("FBLogger")("messenger_web_product").mustfix("waited longer than 30 seconds to eval sync script")},3e4);d.push(a);yield this.eval(b);c("clearTimeout")(a)}catch(a){d.forEach(function(a){return c("clearTimeout")(a)}),c("FBLogger")("messenger_web_product").catching(a).mustfix("syncscript execution failed "+(a==null?void 0:a.message))}});function d(b,c){return a.apply(this,arguments)}return d}();d.evalInOrderReceived=function(a,b){var c=this,d=this.currentlyRunning.then(function(){return c.evalWhenReady(a,babelHelpers["extends"]({},b,{priority:"sync_script"}))});this.currentlyRunning=d;return d};return a}();g["default"]=a}),98);
__d("MWPBeginHandlingPendingTasksForQueue",["LSBeginHandlingFireForgetTasksForQueueStoredProcedure","LSBeginHandlingPendingTasksForQueue2","LSFactory","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,d){var e=d.fireAndForgetTask,g=d.ignoreSoftDelay,h=d.queueName;d=(yield a.runInTransaction(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){if(e===!0){var b=(yield c("LSBeginHandlingFireForgetTasksForQueueStoredProcedure")(c("LSFactory")(a),{queueName:h}));b=b[0];return[b]}return c("LSBeginHandlingPendingTasksForQueue2")(a,{ignoreSoftDelay:g,queueName:h})});return function(b){return a.apply(this,arguments)}}(),"readwrite",void 0,void 0,f.id+":37"));return d});return h.apply(this,arguments)}g["default"]=a}),98);
__d("MWPlatformTaskUtils",["FBLogger","I64","JSScheduler","MetaConfig","Promise","ReQL","asyncToGeneratorRuntime","promiseDone"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j;function k(a,e){function f(){return g.apply(this,arguments)}function g(){g=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield a(e)}catch(a){c("FBLogger")("messenger_web_product").catching(a).warn("Failed to calculate work for task queue %s",e.queueName)}});return g.apply(this,arguments)}if((j||(j=d("I64"))).gt(e.priority,(j||(j=d("I64"))).zero)&&c("MetaConfig")._("78")){var h=function(){f()};(i||(i=c("JSScheduler"))).scheduleLoggingPriCallback(h)}else c("promiseDone")(f())}function l(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){try{yield a(b)}catch(a){c("FBLogger")("messenger_web_product").catching(a).warn("Failed to calculate work for fire forget queue %s",b.queueName)}});return m.apply(this,arguments)}function a(a,c){var e=new Set(),f=[],g=[];g.push(a.tables.pending_tasks.index("queueNameTaskId").subscribe(function(a,b){var c;if(b.operation==="delete"){e.add(a[0]);return}a=b.operation==="put"&&b.prevValue==null||b.operation==="add";c=b.operation==="put"&&(j||(j=d("I64"))).compare(b.value.failureCount,(c=(c=b.prevValue)==null?void 0:c.failureCount)!=null?c:(j||(j=d("I64"))).zero)>0;(a||c)&&e.add(b.value.queueName);(b.operation==="add"&&b.value.dataTraceId==null||b.value.dataTraceId==="")&&f.push(b.value)}));g.push(a.tables.network_requests.subscribe(function(a,b){a=a[0];if(a==="")return;b.operation==="delete"?e.add(a):b.value.epochId==null&&e.add(a)}));g.push(a.subscribeToCommit(function(){var g=Array.from(e);e.clear();f=[];g.forEach(function(){var e=b("asyncToGeneratorRuntime").asyncToGenerator(function*(b){b=(yield d("ReQL").firstAsync(d("ReQL").fromTableAscending(a.tables.pending_tasks.index("queueNameTaskId")).bounds({gte:[b]})));b!=null&&k(c,b)});return function(a){return e.apply(this,arguments)}}())}));return g}function e(a,e){c("promiseDone")(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var b=(yield d("ReQL").toArrayAsync(d("ReQL").fromTableAscending(a.tables.pending_tasks))),c=new Set();for(b of b){if(c.has(b.queueName))continue;c.add(b.queueName);k(e,b)}})())}function n(a,e){c("promiseDone")(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var g=(yield d("ReQL").toArrayAsync(d("ReQL").fromTableAscending(a.tables.pending_fire_and_forget_tasks)));yield (h||(h=b("Promise"))).all(g.map(function(a){return l(e,a)}));c("promiseDone")(a.runInTransaction(function(a){return(h||(h=b("Promise"))).all(g.map(function(b){return a.pending_fire_and_forget_tasks["delete"](b.taskId)}))},"readwrite","background",void 0,f.id+":196"))})())}function o(a,b){var c=!1,d=[];d.push(a.tables.pending_fire_and_forget_tasks.subscribe(function(a,b){if(b.operation==="delete")return;a=b.operation==="put"&&b.prevValue==null||b.operation==="add";a&&(c=!0)}));d.push(a.subscribeToCommit(function(){c&&n(a,b),c=!1}));return d}g.checkQueuesWhenPendingTaskTableUpdates=a;g.checkAllPendingTasksForWork=e;g.checkAllFireForgetTasksForWork=n;g.checkQueuesWhenPendingFireForgetTaskTableUpdates=o}),98);
__d("LSPlatformTaskSystemTransport",["CurrentMessengerUser","FBLogger","I64","JSResourceForInteraction","JSScheduler","LSDatabaseProviderType","LSHandleTaskSendFailureForQueue2","LSHandleTaskSendSuccessForQueue2","LSIntEnum","LSJson","LSMailboxInitialSyncCursor","LSPlatformRealtimeTransport","LSPlatformRequestId","LSPlatformRequestScheduler","LSPlatformServerResponseHandler","LSShape","LSVec","MWPBeginHandlingPendingTasksForQueue","MWPBumpEntityKey","MWPlatformTaskUtils","Promise","ReQL","asyncToGeneratorRuntime","cr:4031","cr:6668","gkx","isInstamadillo","promiseDone","qex"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k,l=500,m=c("JSResourceForInteraction")("publishLSPlatformDeidentifiedPayload").__setRef("LSPlatformTaskSystemTransport"),n=new Set([632,765,60011,1006].map(function(a){return a.toString()}));a=function(){function a(a,e,f,g){var h=this;this.key="ls";this.$8=!1;this.$18=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){b=(yield c("MWPBeginHandlingPendingTasksForQueue")(h.$1,{ignoreSoftDelay:b,queueName:a}));for(a of b)yield h.$17(d("LSShape").toRecord(a))});return function(b,c){return a.apply(this,arguments)}}();this.$1=a;this.$2=e;this.$3=f;this.$4=g;this.$8=d("LSDatabaseProviderType").isProviderPersisted(a);this.$5=new(c("LSPlatformRequestScheduler"))();this.$6=new(c("LSPlatformServerResponseHandler"))(f);this.$7=this.$9();this.$10()}var e=a.prototype;e.$11=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(!(c("gkx")("26392")||c("isInstamadillo")())){var d=(yield this.$2.publish(b));return d}d=a.filter(function(a){return a.label!=null&&n.has(a.label)});if(d.length<a.length){d.length>0&&c("FBLogger")("maw_ohai").mustfix("Deidentifed tasks label %s sent together with normal tasks",d[0].label);a=(yield this.$2.publish(b));return a}a=d[0];d=(yield m.load());d=(yield d(babelHelpers["extends"]({},b,{taskLabel:a.label})));return d});function d(b,c){return a.apply(this,arguments)}return d}();e.$12=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield this.$1.runInTransaction(function(b){return c("LSHandleTaskSendFailureForQueue2")(b,a)},"readwrite",void 0,void 0,f.id+":150")});function d(b){return a.apply(this,arguments)}return d}();e.$13=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){yield this.$1.runInTransaction(function(b){return c("LSHandleTaskSendSuccessForQueue2")(b,a)},"readwrite","background",void 0,f.id+":159")});function d(b){return a.apply(this,arguments)}return d}();e.$14=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a=c("LSVec").toArray(a.tasks).slice(0).map(function(a){return d("LSShape").toRecord(a)});a=a[0];if(a==null)return;a=(yield d("ReQL").firstAsync(d("ReQL").fromTableAscending(this.$1.tables.pending_tasks).getKeyRange(a.task_id)));return a==null?void 0:a.dataTraceId});function e(b){return a.apply(this,arguments)}return e}();e.$15=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f=this;if(a.network_payload==null)return;var g=d("LSShape").toRecord(a.network_payload);(k||(k=c("JSScheduler"))).scheduleLoggingPriCallback(function(){return g&&(b("cr:6668")==null?void 0:b("cr:6668").recordTaskSending(g.tasks))});var i=this.$4;try{yield (j||(j=b("Promise"))).all(c("LSVec").toArray(g.tasks).map(function(a){return d("LSShape").toRecord(a)}).map(function(b){var g=c("LSPlatformRequestId").generate();return f.$11([b],{payload:d("LSJson").stringify(d("LSShape").ofRecord({label:b.label,payload:b.payload,version:i})),queueName:a.queue_name,requestId:g,syncChannel:d("LSMailboxInitialSyncCursor").syncChannel,type_:(h||(h=d("I64"))).of_int32(e)})}))}catch(a){}});function e(b,c){return a.apply(this,arguments)}return e}();e.$16=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){if(a.network_payload==null)return;var f=d("LSShape").toRecord(a.network_payload),g=c("LSVec").toArray(f.tasks).map(function(a){return d("LSShape").toRecord(a)}),j=(yield this.$14(f));(k||(k=c("JSScheduler"))).scheduleLoggingPriCallback(function(){return f&&(b("cr:6668")==null?void 0:b("cr:6668").recordTaskSending(f.tasks))});var l=c("LSPlatformRequestId").generate(),m,n=c("qex")._("789");if(n!=null&&n!=="default"){n=n+"."+(i||(i=d("LSIntEnum"))).toNumber(d("LSMailboxInitialSyncCursor").syncChannel)+"."+e.toString();d("MWPBumpEntityKey").bumpEntityKeyWithAppId("messenger.lightspeed",n)}try{m=(yield this.$11(g,{payload:d("LSJson").stringify(d("LSShape").ofRecord(babelHelpers["extends"]({},f,{version_id:this.$4},j==null?{}:{data_trace_id:j}))),queueName:a.queue_name,requestId:l,syncChannel:d("LSMailboxInitialSyncCursor").syncChannel,type_:(h||(h=d("I64"))).of_int32(e)}))}catch(b){b.RE_EXN_ID===d("LSPlatformRealtimeTransport").Timeout?d("MWPBumpEntityKey").bumpEntityKeyWithAppId("lsplatform_tasks","send_fail_timeout"):b.RE_EXN_ID===d("LSPlatformRealtimeTransport").NotConnected?(d("MWPBumpEntityKey").bumpEntityKeyWithAppId("lsplatform_tasks","send_fail_notconnected"),c("FBLogger")("messenger_web_product").warn("Publishing a task to the server not connected")):(d("MWPBumpEntityKey").bumpEntityKeyWithAppId("lsplatform_tasks","send_fail_generic"),c("FBLogger")("messenger_web_product").warn("Error while publishing a task for request: %s, error %s",e,JSON.stringify(b))),yield this.$12(a.queue_name)}if(m!=null&&m.type==="taskresponse")try{n=m.downloadTask;var o=m.payload;j={experiments:o.ex,sp:o.sp,syncScript:o.payload,target:o.target,taskNames:g.map(function(a){return a.label}).filter(Boolean)};this.$8?yield this.$6.evalWhenReady(n,j):yield this.$3(j);yield this.$13(a.queue_name);(k||(k=c("JSScheduler"))).scheduleLoggingPriCallback(function(){return f&&(b("cr:6668")==null?void 0:b("cr:6668").recordTaskSent(f.tasks,o.payload))})}catch(b){d("MWPBumpEntityKey").bumpEntityKeyWithAppId("lsplatform_tasks","handle_task_failure"),c("FBLogger")("messenger_web_product").catching(b).mustfix("Encountered an error while processing a task response via realtime transport"),yield this.$12(a.queue_name)}});function e(b,c){return a.apply(this,arguments)}return e}();e.decideWhatToDoWithTask=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){var h=this,i=(yield c("MWPBeginHandlingPendingTasksForQueue")(a,{fireAndForgetTask:g,ignoreSoftDelay:!1,queueName:e,transportKey:f}));c("promiseDone")(b("asyncToGeneratorRuntime").asyncToGenerator(function*(){for(var a of i)yield h.$17(d("LSShape").toRecord(a))})())});function e(b,c,d,e){return a.apply(this,arguments)}return e}();e.$17=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=this.$5,f=this.$18;function g(a,b){e.schedule(function(){c("promiseDone")(f(a,!1))},a,b!=null?(h||(h=d("I64"))).to_float(b):l)}var i=(h||(h=d("I64"))).to_int32(a.work_item_type);switch(i){case 1:yield this.$16(a,3);break;case 5:yield this.$15(a,4);break;case 3:g(a.queue_name,a.next_sync_ms);break;case 2:yield b("cr:4031").handleLSWork(this.$1,a,d("CurrentMessengerUser").getAccountID());break;case 4:break;default:c("FBLogger")("messenger_web_product").warn("Unknown Task type of %s",i)}});function e(b){return a.apply(this,arguments)}return e}();e.$9=function(){var a=this,e=this.$1;return this.$2.onReconnect(function(){c("promiseDone")(e.runInTransaction(function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=(yield d("ReQL").toArrayAsync(d("ReQL").fromTableAscending(a.network_requests).bounds({gte:d("ReQL").key("")})));yield (j||(j=b("Promise"))).all(e.map(function(b){b=b.taskQueueName;return c("LSHandleTaskSendFailureForQueue2")(a,b)}))});return function(b){return a.apply(this,arguments)}}(),"readwrite",void 0,void 0,f.id+":441")),a.$10()})};e.$10=function(){var a=this;d("MWPlatformTaskUtils").checkAllPendingTasksForWork(this.$1,function(b){b=b.queueName;return a.decideWhatToDoWithTask(a.$1,b)})};e.cleanup=function(){this.$7()};return a}();g["default"]=a}),98);
__d("LSProcessBackupIds",["LSAppendDataTraceAddon","LSIsMobileClient","LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(e){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][LSEncryptedBackupsProcessBackupIdsStoredProcedure] Beginning execution."),c.sequence([function(d){return a[0]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),a[0],c.i64.cast([0,1487]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[9]=a[0],a})},function(a){return d[9]?d[10]=!0:d[10]=!1,d[10]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[11]=c.createArray(),void 0!==void 0?d[12]=(d[11].push(void 0),d[11]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[11],c.i64.cast([0,3]))):c.resolve()}])},function(e){return c.db.table(172).fetch([[[c.i64.cast([0,1])]]]).next().then(function(e,f){var g=e.done;e=e.value;return g?c.sequence([function(e){return c.sequence([function(d){return a[0]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),a[0],c.i64.cast([0,1488]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[9]=a[0],a})},function(a){return d[9]?d[10]=!0:d[10]=!1,d[10]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[11]=c.createArray(),void 0!==void 0?d[12]=(d[11].push(void 0),d[11]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[11],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[1]=c.i64.cast([0,0])}]):(f=e.item,c.sequence([function(e){return d[11]=f.backupId,d[10]=f.authorityLevel,c.i64.eq(d[10],c.i64.cast([0,20]))?c.resolve(d[9]=c.i64.cast([0,1])):c.sequence([function(e){return c.i64.eq(d[10],c.i64.cast([0,80]))?c.sequence([function(e){return c.i64.eq(d[11],void 0)?c.sequence([function(e){return c.sequence([function(d){return a[0]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),a[0],c.i64.cast([0,1492]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[14]=a[0],a})},function(a){return d[14]?d[15]=!0:d[15]=!1,d[15]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[16]=c.createArray(),void 0!==void 0?d[17]=(d[16].push(void 0),d[16]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[16],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[13]=c.i64.cast([0,2])}]):c.sequence([function(e){return c.i64.eq(d[11],c.i64.cast([-1,4294967295]))?c.sequence([function(e){return c.sequence([function(d){return a[0]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),a[0],c.i64.cast([0,1489]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[15]=a[0],a})},function(a){return d[15]?d[16]=!0:d[16]=!1,d[16]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[17]=c.createArray(),void 0!==void 0?d[18]=(d[17].push(void 0),d[17]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[17],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[14]=c.i64.cast([-1,4294967295])}]):c.sequence([function(e){return c.filter(c.db.table(168).fetch(),function(a){return c.i64.eq(a.backupId,d[11])&&c.i64.eq(a.authorityLevel,c.i64.cast([0,80]))}).next().then(function(e,f){f=e.done;e=e.value;return f?c.sequence([function(e){return c.sequence([function(d){return a[0]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),a[0],c.i64.cast([0,1490]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[17]=a[0],a})},function(a){return d[17]?d[18]=!0:d[18]=!1,d[18]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[19]=c.createArray(),void 0!==void 0?d[20]=(d[19].push(void 0),d[19]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[19],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[15]=c.i64.cast([0,4])}]):(e.item,c.sequence([function(e){return c.sequence([function(d){return a[0]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),a[0],c.i64.cast([0,1491]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[17]=a[0],a})},function(a){return d[17]?d[18]=!0:d[18]=!1,d[18]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[19]=c.createArray(),void 0!==void 0?d[20]=(d[19].push(void 0),d[19]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[19],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[15]=c.i64.cast([0,3])}]))})},function(a){return d[14]=d[15]}])},function(a){return d[13]=d[14]}])},function(a){return d[12]=d[13]}]):c.sequence([function(e){return c.sequence([function(d){return a[0]!==void 0?c.storedProcedure(b("LSAppendDataTraceAddon"),a[0],c.i64.cast([0,1489]),c.i64.cast([0,2]),void 0,void 0):c.resolve()},function(a){return c.storedProcedure(b("LSIsMobileClient")).then(function(a){return a=a,d[13]=a[0],a})},function(a){return d[13]?d[14]=!0:d[14]=!1,d[14]&&!0?(function(a){c.logger(a).mustfix(a)}("[EncryptedBackups][MEBTraceUtils] LSDataTraceMciTraceLog native op not supported"),d[15]=c.createArray(),void 0!==void 0?d[16]=(d[15].push(void 0),d[15]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"MEBTraceUtils","LSDataTraceMciTraceLog native op not supported",d[15],c.i64.cast([0,3]))):c.resolve()}])},function(a){return d[12]=c.i64.cast([-1,4294967295])}])},function(a){return d[9]=d[12]}])},function(a){return d[1]=d[9]}]))})},function(a){return d[3]=c.i64.of_float(Date.now()),d[4]=c.i64.random(),d[6]="Finishing execution. Execution time: ",d[7]=c.i64.to_string(c.i64.sub(d[3],d[0])),d[8]=" ms",d[5]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][LSEncryptedBackupsProcessBackupIdsStoredProcedure] ",d[5],d[6],d[5],d[7],d[5],d[8]].join("")),c.i64.eq(c.i64.mod_(d[4],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[9]=",",d[10]=c.createArray(),void 0!==void 0?d[11]=(d[10].push(void 0),d[10]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"LSEncryptedBackupsProcessBackupIdsStoredProcedure",[d[6],d[9],d[7],d[9],d[8]].join(""),d[10],c.i64.cast([0,4]))):c.resolve()},function(a){return e[0]=d[1]}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSEncryptedBackupsProcessBackupIdsStoredProcedure";e.exports=a}),null);
__d("LSProcessBackupIdsStoredProcedure",["LSProcessBackupIds","cr:8709"],(function(a,b,c,d,e,f,g){function a(a,b){b===void 0&&(b={});var d=[];d[0]=b.traceId;return c("LSProcessBackupIds").apply(void 0,d.concat([a]))}g["default"]=a}),98);
__d("LSReportAppState",["LSIssueNewTask"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(e){return d[0]=new c.Map(),d[0].set("app_state",a[0]),d[0].set("request_id",a[1]),d[1]=c.toJSON(d[0]),c.storedProcedure(b("LSIssueNewTask"),"ls_presence_report_app_state",c.i64.cast([0,123]),d[1],void 0,void 0,c.i64.cast([0,0]),c.i64.cast([0,0]),c.i64.cast([0,6]),void 0,c.i64.cast([0,0]),c.i64.cast([0,0]))},function(a){return c.resolve(e)}])}a.__sproc_name__="LSPresenceReportAppStateStoredProcedure";e.exports=a}),null);
__d("LSReportAppStateStoredProcedure",["LSReportAppState","cr:8709"],(function(a,b,c,d,e,f,g){function a(a,b){var d=[];d[0]=b.appState;d[1]=b.requestId;return c("LSReportAppState").apply(void 0,d.concat([a]))}g["default"]=a}),98);
__d("LSTamThreadSubtype",[],(function(a,b,c,d,e,f){a=Object.freeze({STANDARD:0,VANISH_MODE:1,DUAL_SEND_SHADOW:2,BTV_COMPANION:3,BLEND_DUAL_SEND:4,BLEND_DUAL_SEND_NO_NETWORK:5});f["default"]=a}),66);
__d("LSUserVisibleErrorsUtil",["LSFactory","LSRemoveErrorStoredProcedure","promiseDone"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){c("promiseDone")(a.runInTransaction(function(a){return c("LSRemoveErrorStoredProcedure")(c("LSFactory")(a),{errorId:b})},"readwrite",void 0,void 0,f.id+":24"))}g.removeUserVisibleErrorFromTable=a}),98);
__d("LSWriteSupplementalMessage",["LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(b){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][writeSupplementalMessage] Beginning execution."),d[1]=c.i64.of_float(Date.now()),c.filter(c.db.table(302).fetch(),function(b){return b.threadId===a[1]&&b.toplevelOfflineThreadingId===a[2]&&b.supplementalKey===a[3]}).next().then(function(a,b){var c=a.done;a=a.value;return c?d[2]=void 0:(b=a.item,d[2]=b.messageTimestampMs)})},function(b){return c.i64.neq(d[2],void 0)?c.sequence([function(b){return c.i64.gt(d[2],a[5])?c.resolve(d[11]=!1):c.sequence([function(b){return c.forEach(c.filter(c.db.table(302).fetch(),function(b){return b.threadId===a[1]&&b.toplevelOfflineThreadingId===a[2]&&b.supplementalKey===a[3]}),function(a){return a["delete"]()})},function(b){return c.db.table(302).add({pk:void 0,messagePayload:a[0],threadId:a[1],toplevelOfflineThreadingId:a[2],supplementalKey:a[3],offlineThreadingId:a[4],messageTimestampMs:a[5]})},function(a){return d[11]=!0}])},function(a){return d[4]=d[11]}]):c.sequence([function(b){return c.forEach(c.filter(c.db.table(302).fetch(),function(b){return b.threadId===a[1]&&b.toplevelOfflineThreadingId===a[2]&&b.supplementalKey===a[3]}),function(a){return a["delete"]()})},function(b){return c.db.table(302).add({pk:void 0,messagePayload:a[0],threadId:a[1],toplevelOfflineThreadingId:a[2],supplementalKey:a[3],offlineThreadingId:a[4],messageTimestampMs:a[5]})},function(a){return d[4]=!0}])},function(a){return d[5]=c.i64.of_float(Date.now()),d[6]=c.i64.random(),d[8]="Finishing execution. Execution time: ",d[9]=c.i64.to_string(c.i64.sub(d[5],d[0])),d[10]=" ms",d[7]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][writeSupplementalMessage] ",d[7],d[8],d[7],d[9],d[7],d[10]].join("")),c.i64.eq(c.i64.mod_(d[6],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[11]=",",d[12]=c.createArray(),void 0!==void 0?d[13]=(d[12].push(void 0),d[12]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"writeSupplementalMessage",[d[8],d[11],d[9],d[11],d[10]].join(""),d[12],c.i64.cast([0,4]))):c.resolve()},function(a){return e[0]=d[4]}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSMPSWriteSupplementalMessageStoredProcedure";e.exports=a}),null);
__d("LSWriteSupplementalMessageStoredProcedure",["LSWriteSupplementalMessage","cr:8709"],(function(a,b,c,d,e,f,g){function a(a,b){var d=[];d[0]=b.messagePayload;d[1]=b.threadId;d[2]=b.toplevelOfflineThreadingId;d[3]=b.supplementalKey;d[4]=b.offlineThreadingId;d[5]=b.messageTimestampMs;return c("LSWriteSupplementalMessage").apply(void 0,d.concat([a]))}g["default"]=a}),98);
__d("LSWriteTopLevelMessage",["LSLogMebClientEvent.nop"],(function(a,b,c,d,e,f){function a(){var a=arguments,c=a[a.length-1],d=[],e=[];return c.sequence([function(f){return c.sequence([function(b){return d[0]=c.i64.of_float(Date.now()),function(a){c.logger(a).info(a)}("[EncryptedBackups][writeTopLevelMessage] Beginning execution."),d[1]=c.i64.of_float(Date.now()),c.filter(c.db.table(301).fetch(),function(b){return b.threadId===a[1]&&b.offlineThreadingId===a[2]}).next().then(function(a,b){var c=a.done;a=a.value;return c?d[2]=void 0:(b=a.item,d[2]=b.messageTimestampMs)})},function(b){return c.i64.neq(d[2],void 0)?c.sequence([function(b){return c.i64.gt(d[2],a[3])?c.resolve(d[11]=!1):c.sequence([function(b){return c.filter(c.db.table(303).fetch(),function(b){return b.threadId===a[1]&&b.offlineThreadingId===a[2]}).next().then(function(a,b){b=a.done;a=a.value;return b?d[12]=!1:(a.item,d[12]=!0)})},function(b){return d[12]?c.sequence([function(b){return c.forEach(c.filter(c.db.table(303).fetch(),function(b){return b.threadId===a[1]&&b.offlineThreadingId===a[2]}),function(b){var c=b.update;b.item;return c({deletedMessagePayload:a[0],isLocalOnlyMessage:a[4],messageTimestampMs:a[3]})})},function(b){return c.forEach(c.filter(c.db.table(301).fetch(),function(b){return b.threadId===a[1]&&b.offlineThreadingId===a[2]&&c.i64.eq(b.messageTimestampMs,c.i64.cast([-1,4294967295]))}),function(b){var c=b.update;b.item;return c({messageTimestampMs:a[3]})})},function(a){return d[14]=!1}]):c.sequence([function(b){return c.forEach(c.filter(c.db.table(301).fetch(),function(b){return b.threadId===a[1]&&b.offlineThreadingId===a[2]}),function(a){return a["delete"]()})},function(b){return c.db.table(301).add({pk:void 0,messagePayload:a[0],threadId:a[1],offlineThreadingId:a[2],messageTimestampMs:a[3],isLocalOnlyMessage:a[4],extraData:a[5]})},function(a){return d[14]=!0}])},function(a){return d[11]=d[14]}])},function(a){return d[4]=d[11]}]):c.sequence([function(b){return c.filter(c.db.table(303).fetch(),function(b){return b.threadId===a[1]&&b.offlineThreadingId===a[2]}).next().then(function(a,b){b=a.done;a=a.value;return b?d[11]=!1:(a.item,d[11]=!0)})},function(b){return d[11]?c.sequence([function(b){return c.forEach(c.filter(c.db.table(303).fetch(),function(b){return b.threadId===a[1]&&b.offlineThreadingId===a[2]}),function(b){var c=b.update;b.item;return c({deletedMessagePayload:a[0],isLocalOnlyMessage:a[4],messageTimestampMs:a[3]})})},function(b){return c.forEach(c.filter(c.db.table(301).fetch(),function(b){return b.threadId===a[1]&&b.offlineThreadingId===a[2]&&c.i64.eq(b.messageTimestampMs,c.i64.cast([-1,4294967295]))}),function(b){var c=b.update;b.item;return c({messageTimestampMs:a[3]})})},function(a){return d[13]=!1}]):c.sequence([function(b){return c.forEach(c.filter(c.db.table(301).fetch(),function(b){return b.threadId===a[1]&&b.offlineThreadingId===a[2]}),function(a){return a["delete"]()})},function(b){return c.db.table(301).add({pk:void 0,messagePayload:a[0],threadId:a[1],offlineThreadingId:a[2],messageTimestampMs:a[3],isLocalOnlyMessage:a[4],extraData:a[5]})},function(a){return d[13]=!0}])},function(a){return d[4]=d[13]}])},function(a){return d[5]=c.i64.of_float(Date.now()),d[6]=c.i64.random(),d[8]="Finishing execution. Execution time: ",d[9]=c.i64.to_string(c.i64.sub(d[5],d[0])),d[10]=" ms",d[7]="",function(a){c.logger(a).info(a)}(["[EncryptedBackups][writeTopLevelMessage] ",d[7],d[8],d[7],d[9],d[7],d[10]].join("")),c.i64.eq(c.i64.mod_(d[6],c.i64.cast([0,1e3])),c.i64.cast([0,0]))?(d[11]=",",d[12]=c.createArray(),void 0!==void 0?d[13]=(d[12].push(void 0),d[12]):0,c.nativeOperation(b("LSLogMebClientEvent.nop"),"writeTopLevelMessage",[d[8],d[11],d[9],d[11],d[10]].join(""),d[12],c.i64.cast([0,4]))):c.resolve()},function(a){return e[0]=d[4]}])},function(a){return c.resolve(e)}])}a.__sproc_name__="LSMPSWriteTopLevelMessageStoredProcedure";e.exports=a}),null);
__d("LSWriteTopLevelMessageStoredProcedure",["LSWriteTopLevelMessage","cr:8709"],(function(a,b,c,d,e,f,g){function a(a,b){var d=[];d[0]=b.messagePayload;d[1]=b.threadId;d[2]=b.offlineThreadingId;d[3]=b.messageTimestampMs;d[4]=b.isLocalOnlyMessage;d[5]=b.extraData;return c("LSWriteTopLevelMessage").apply(void 0,d.concat([a]))}g["default"]=a}),98);
__d("MAWBridgeDeleteMessagesOfThreadHandler",["I64","LSEncryptedBackupsBackupTenancy","LSFactory","LSIntEnum","LSIssueThreadRemoveStoredProcedure","LSMEBTaskCreationSource","MAWEncryptedBackupUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h,i;function a(a,b){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){if(b.actionType===2){var e=(yield d("MAWEncryptedBackupUtils").getBackupTenancy(a));if(e==null||!(h||(h=d("I64"))).equal(e,(i||(i=d("LSIntEnum"))).ofNumber(c("LSEncryptedBackupsBackupTenancy").PRODUCTION)))return;yield c("LSIssueThreadRemoveStoredProcedure")(c("LSFactory")(a),{actThreadId:b.threadId,sortKey:b.ts.toString(),source:(i||(i=d("LSIntEnum"))).ofNumber(c("LSMEBTaskCreationSource").TAM_WEB)})}});return j.apply(this,arguments)}g.call=a}),98);
__d("MAWBridgeTraceUtils",["I64","Promise","ReQL"],(function(a,b,c,d,e,f,g){"use strict";var h,i;function a(a,c,e){return d("ReQL").toArrayAsync(d("ReQL").fromTableAscending(a.data_trace_meta).filter(function(a){var b=a.contextThree;if(b!=null&&c===b&&(i||(i=d("I64"))).equal(a.traceType,e))return a.shouldFlush===!1;else return!1})).then(function(a){if(a.length!==0)return(h||(h=b("Promise"))).resolve(a[0].traceId);else return(h||(h=b("Promise"))).resolve()})}g.getTraceId=a}),98);
__d("MAWBridgeStartTraceHandler",["ArmadilloDataTraceCheckPoint","ArmadilloDataTraceType","I64","LSAppendDataTraceAddonStoredProcedure","LSDataTraceTag","LSFactory","LSRequestId","MAWAckLevel","MAWBridgeTraceUtils","MAWMsg","MAWTimeUtils","Promise","gkx","killswitch","promiseDone"],(function(a,b,c,d,e,f,g){"use strict";var h,i;function j(a,b,e){return a.data_trace_meta.add({contextOne:void 0,contextThree:b.externalId,contextTwo:void 0,foregroundTimestampMs:(i||(i=d("I64"))).zero,initTimestampMs:d("MAWTimeUtils").toTimestamp(b.ts),predefinedId:void 0,shouldFlush:!1,traceId:e,traceType:b.traceType}).then(function(){return c("LSAppendDataTraceAddonStoredProcedure")(c("LSFactory")(a),{checkPointId:d("ArmadilloDataTraceCheckPoint").traceCreated,dataTraceId:e,syncChannel:(i||(i=d("I64"))).neg_one})}).then(function(){var f;if(b.threadKey==null||!c("gkx")("23995"))return;return c("LSAppendDataTraceAddonStoredProcedure")(c("LSFactory")(a),{checkPointId:d("ArmadilloDataTraceCheckPoint").armadilloTlcControlOpenThread,dataTraceId:e,syncChannel:(i||(i=d("I64"))).neg_one,tags:(f=b.threadKey)!=null?f:void 0})})}function a(a,e){if(c("killswitch")("MESSENGER_WEB_DATA_TRACE_ID"))return(h||(h=b("Promise"))).resolve();var f=e.ack,g=e.traceType;return f===d("MAWAckLevel").ACK.clock?d("MAWBridgeTraceUtils").getTraceId(a,e.externalId,e.traceType).then(function(f){if(f!=null)return;var k=c("LSRequestId").generate();if((i||(i=d("I64"))).equal(g,d("ArmadilloDataTraceType").armadilloMessageSend))return j(a,e,k).then(function(){var b=e.threadType;if(b==="User")return;return c("LSAppendDataTraceAddonStoredProcedure")(c("LSFactory")(a),{checkPointId:d("ArmadilloDataTraceCheckPoint").traceGroupMessage,dataTraceId:k,syncChannel:(i||(i=d("I64"))).neg_one})}).then(function(){if(e.isFirstMsg)return c("LSAppendDataTraceAddonStoredProcedure")(c("LSFactory")(a),{checkPointId:d("ArmadilloDataTraceCheckPoint").armadilloActMessageSend,dataTraceId:k,syncChannel:(i||(i=d("I64"))).neg_one,tags:"first_msg=1"})}).then(function(){var f=e.type_;f=f===d("MAWMsg").text?d("ArmadilloDataTraceCheckPoint").traceTextMessage:f===d("MAWMsg").ptt||f===d("MAWMsg").image||f===d("MAWMsg").video||f===d("MAWMsg").gif?d("ArmadilloDataTraceCheckPoint").traceMediaMessage:void 0;if(f==null)return(h||(h=b("Promise"))).resolve(f);c("promiseDone")(c("LSAppendDataTraceAddonStoredProcedure")(c("LSFactory")(a),{checkPointId:f,dataTraceId:k,syncChannel:(i||(i=d("I64"))).neg_one}));return(h||(h=b("Promise"))).resolve(f)}).then(function(b){if(b==null)return;if(!(i||(i=d("I64"))).equal(b,d("ArmadilloDataTraceCheckPoint").traceMediaMessage))return;b=e.type_;b=b===d("MAWMsg").image?d("LSDataTraceTag").image:b===d("MAWMsg").ptt?d("LSDataTraceTag").audio:b===d("MAWMsg").video?d("LSDataTraceTag").video:b===d("MAWMsg").gif?d("LSDataTraceTag").animatedImage:d("LSDataTraceTag").none;return c("LSAppendDataTraceAddonStoredProcedure")(c("LSFactory")(a),{checkPointId:d("ArmadilloDataTraceCheckPoint").richMediaMediaSendAttachmentType,dataTraceId:k,syncChannel:(i||(i=d("I64"))).neg_one,tags:String(b)})});else return j(a,e,k)}):(h||(h=b("Promise"))).resolve()}g.call=a}),98);
__d("MAWBridgeStartTraceWithTraceIdHandler",["MAWMainTraceUtils","MAWTimeUtils","WATimeUtils"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){return d("MAWMainTraceUtils").startTraceWithTxn(a,d("MAWTimeUtils").toTimestamp(d("WATimeUtils").unixTime()),b.traceId,b.traceType,void 0,void 0,b.traceContext)}g.call=a}),98);
__d("MAWBridgeUpdateDYIStatusV2",["EncryptedBackupdDYIFileSaver","EncryptedBackupsDYIFileUtils","EncryptedBackupsDYITypes","FBLogger","asyncToGeneratorRuntime","promiseDone"],(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){d("EncryptedBackupdDYIFileSaver").saveFile(a,b),window.setTimeout(function(){c("promiseDone")(e())},1e3)});return i.apply(this,arguments)}function a(a){return j.apply(this,arguments)}function j(){j=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var e=a.qplInstanceKeyE2E;a=a.status;var f=c("FBLogger")("[labyrinth_web][dyi]");if(a===d("EncryptedBackupsDYITypes").EncryptedBackupsDYIState.Completed)try{if(navigator.storage==null)throw f.mustfixThrow("Storage management API is not supported. Please try one of the supported browsers.");var g=d("EncryptedBackupsDYIFileUtils").DyiArchiveFilename,i=(yield d("EncryptedBackupsDYIFileUtils").getRootFolderHandle()),j=(yield d("EncryptedBackupsDYIFileUtils").readFile(i,g));yield h(g,j,b("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield i.removeEntry(g)}));f.info("Saving file with filename ",g);e!=null&&f.mustfix("TODO: End the QPL marker here");f.info("DYI Complete")}catch(a){f.mustfix("Failed to download the DYI archive: %s",a);return d("EncryptedBackupsDYITypes").EncryptedBackupsDYIState.Failed}return a});return j.apply(this,arguments)}g.call=a}),98);
__d("MAWBridgeUpdateDyiStatus",["EncryptedBackupsDYIUtils","I64","LSIntEnum","MAWEBFrontendQPLLogger","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";var h,i;function j(a,b){return k.apply(this,arguments)}function k(){k=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield a.encrypted_backups_dyi_backup_restore_status.put({currentStatus:b,pk:(h||(h=d("I64"))).zero})});return k.apply(this,arguments)}function a(a,b){var c=b.qplInstanceKeyE2E;b=b.status;d("MAWEBFrontendQPLLogger").logDyiE2EDyiBackupRestoreCompleted(c,b);d("EncryptedBackupsDYIUtils").createFileAndDownload(c);if(b)return j(a,(i||(i=d("LSIntEnum"))).ofNumber(1));else return j(a,(i||(i=d("LSIntEnum"))).ofNumber(2))}g.call=a}),98);
__d("MAWBridgeUpdateTraceHandler",["ArmadilloDataTraceCheckPoint","I64","LSAppendDataTraceAddonStoredProcedure","LSDataTraceCheckPoint","LSFactory","LSIntEnum","MAWBridgeTraceEvent","Promise","ReQL","emptyFunction","killswitch","updateAndFlushLSDataTrace"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j;function k(a,e,f){return d("ReQL").toArrayAsync(d("ReQL").fromTableAscending(a.data_trace_meta).filter(function(a){var b=a.contextThree;if(b!=null&&e.externalIds.includes(b)&&(j||(j=d("I64"))).equal(a.traceType,e.traceType))return a.shouldFlush===!1;else return!1})).then(function(g){var i=[];return g.reduce(function(b,g){return b.then(function(){i.push(g.traceId);var b=e.errorMessage;if(b!=null)return c("LSAppendDataTraceAddonStoredProcedure")(c("LSFactory")(a),{checkPointId:f,dataTraceId:g.traceId,errorMessage:b,syncChannel:(j||(j=d("I64"))).neg_one});else return c("LSAppendDataTraceAddonStoredProcedure")(c("LSFactory")(a),{checkPointId:f,dataTraceId:g.traceId,syncChannel:(j||(j=d("I64"))).neg_one})})},(h||(h=b("Promise"))).resolve()).then(function(){return i})})}function l(a,d){return d.reduce(function(b,d){return b.then(function(){return c("updateAndFlushLSDataTrace")(a,d)})},(h||(h=b("Promise"))).resolve())}function a(a,e){if(c("killswitch")("MESSENGER_WEB_DATA_TRACE_ID"))return(h||(h=b("Promise"))).resolve();var f=e.event;if(f===c("MAWBridgeTraceEvent").ReceivedReceipt)return k(a,e,d("ArmadilloDataTraceCheckPoint").deliveryReceiptReceived).then(function(b){return l(a,b)});else if(f===c("MAWBridgeTraceEvent").ReceivedSent)return k(a,e,d("ArmadilloDataTraceCheckPoint").advancedCryptoMEMSendTaskComplete).then(c("emptyFunction"));else if(f===c("MAWBridgeTraceEvent").FlowEndForFailure)return k(a,e,(i||(i=d("LSIntEnum"))).ofNumber(c("LSDataTraceCheckPoint").FLOW_END_FOR_FAILURE)).then(function(b){return l(a,b)});else if(f===c("MAWBridgeTraceEvent").FlowEndForSuccess)return k(a,e,(i||(i=d("LSIntEnum"))).ofNumber(c("LSDataTraceCheckPoint").FLOW_END_AND_FLUSH)).then(function(b){return l(a,b)});else return(h||(h=b("Promise"))).resolve()}g.call=a}),98);
__d("MessageBackupTagsDelimiter",[],(function(a,b,c,d,e,f){"use strict";a=":";f.INSTAMADILLO_TAG_DELIMITER=a}),66);
__d("MAWSharedWriteToMPSTables",["FBLogger","I64","IGDWEBUploadMessageUtils","LSFactory","LSWriteSupplementalMessageStoredProcedure","LSWriteTopLevelMessageStoredProcedure","MAWEBUploadMessageUtils","MAWSharedEbUploadEntity","MessageBackupTagsDelimiter","Promise","asyncToGeneratorRuntime","promiseDone","requireDeferred"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j=c("requireDeferred")("ReverbWriteFailureFalcoEvent").__setRef("MAWSharedWriteToMPSTables"),k=c("requireDeferred")("ReverbWriteSuccessFalcoEvent").__setRef("MAWSharedWriteToMPSTables");function l(a,b,d,e,f,g){if(!f)return;e?c("promiseDone")(k.load(),function(c){return c.log(function(){return{backup_action:d,backup_protocol:"open_eb_ttlc",message_id:a,thread_id:b}})}):c("promiseDone")(j.load(),function(c){return c.log(function(){return{backup_action:d,backup_protocol:"open_eb_ttlc",failure_reason:g,message_id:a,thread_id:b}})})}function a(a,b,c,d){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e,f,g){var j=e.backupActionType,k=e.instamadilloItemId,m=e.msgId,n=e.originalMsgProtocolId,o=e.protobuf,p=e.serverTs;e=e.supplementalKey;m=m.externalId;n=n==null?void 0:n.externalId;k=g===!0&&k!=null?(i||(i=d("I64"))).of_float(k):(i||(i=d("I64"))).of_float(d("MAWEBUploadMessageUtils").echoOverrideMessageSortOrder({externalId:m,serverTs:p,ts:p}));var q=!1;switch(j){case 1:try{j=(yield c("LSWriteTopLevelMessageStoredProcedure")(c("LSFactory")(a),{isLocalOnlyMessage:!1,messagePayload:d("MAWSharedEbUploadEntity").getEbBackupMessageBytesBuffer(o),messageTimestampMs:k,offlineThreadingId:m,threadId:f}));j=j[0];j&&(q=!0);l(m,f,"upsert_top_level",j,g)}catch(a){l(m,f,"upsert_top_level",!1,g,a)}break;case 2:if(n==null||e==null)l(m,f,"upsert_supplemental",!1,g),c("FBLogger")("labyrinth_web").warn("Missing toplevelOfflineThreadingId or supplementalKey when writing to MPS tables");else try{j=(yield c("LSWriteSupplementalMessageStoredProcedure")(c("LSFactory")(a),{messagePayload:d("MAWSharedEbUploadEntity").getEbBackupMessageBytesBuffer(o),messageTimestampMs:k,offlineThreadingId:m,supplementalKey:e,threadId:f,toplevelOfflineThreadingId:n}));k=j[0];k&&(q=!0);l(n,f,"upsert_supplemental",k,g)}catch(a){l(n,f,"upsert_supplemental",!1,g,a)}break;case 4:if(n==null)break;e=(yield c("LSWriteTopLevelMessageStoredProcedure")(c("LSFactory")(a),{isLocalOnlyMessage:!1,messagePayload:d("MAWSharedEbUploadEntity").getEbBackupMessageBytesBuffer(o),messageTimestampMs:(i||(i=d("I64"))).of_float(d("IGDWEBUploadMessageUtils").generateProtobufServerTs(n,p)),offlineThreadingId:m,threadId:f}));j=e[0];j&&(q=!0);l(n,f,"delete_top_level",!1,g);break;case 3:q=!0;n!=null&&l(n,f,"delete_top_level",!1,g);break;default:c("FBLogger")("labyrinth_web").warn("Unsupported backupActionType when writing to MPS tables")}if(q)return(h||(h=b("Promise"))).resolve(q);else return(h||(h=b("Promise"))).reject(!1)});return m.apply(this,arguments)}function e(a,e,f){var g=e.instamadilloItemId,j=e.msgId;e=e.tags;e!=null&&e.length!==0&&g!=null&&c("promiseDone")(a.local_message_persistence_store_tag_index.put({localMessagePersistenceStoreKey:(i||(i=d("I64"))).of_string(j.externalId),messageTimestampMs:i.of_float(g),offlineThreadingId:j.externalId,tag:e.join(d("MessageBackupTagsDelimiter").INSTAMADILLO_TAG_DELIMITER),threadId:f}));return(h||(h=b("Promise"))).resolve()}g.writeToMPSTables=a;g.writeTagsToMPSTables=e}),98);
__d("MAWBridgeUploadMessageGQLHandler",["I64","JSResourceForInteraction","LSEncryptedBackupsBackupTenancy","LSIntEnum","MAWEBFrontendQPLLogger","MAWEncryptedBackupUtils","MAWSharedWriteToMPSTables","Promise","WALogger","asyncToGeneratorRuntime","gkx","isInstamadilloEB"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[labyrinth_web] uploadMessage.authTs is null for the message"]);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("isInstamadilloEB")())return(j||(j=b("Promise"))).resolve();var f=(yield d("MAWEncryptedBackupUtils").getBackupTenancy(a));e=(yield (j||(j=b("Promise"))).all(e.map(function(b){var e=b.protoMsg;if(f==null||!(h||(h=d("I64"))).equal(f,(i||(i=d("LSIntEnum"))).ofNumber(c("LSEncryptedBackupsBackupTenancy").PRODUCTION))){if(b.uploadTrackingInstanceKey!=null){var g=b.uploadTrackingInstanceKey;d("MAWEBFrontendQPLLogger").addPointEBUploadTracking(g,"user_device_not_enrolled_invalid_gql_request");d("MAWEBFrontendQPLLogger").endEBUploadTracking(g)}return}g=b.authTs;if(g==null){d("WALogger").ERROR(k());b.uploadTrackingInstanceKey!=null&&d("MAWEBFrontendQPLLogger").failEBUploadTracking(b.uploadTrackingInstanceKey,"message_auth_ts_is_null");return}return c("gkx")("23966")&&e!=null?d("MAWSharedWriteToMPSTables").writeToMPSTables(a,e,b.threadId,!1).then(function(){return b}):b})));e=e.filter(Boolean);if(e.length===0)return;yield m(a,e)});return l.apply(this,arguments)}function m(a,b){return n.apply(this,arguments)}function n(){n=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){yield c("JSResourceForInteraction")("MAWEncryptedBackupsMessageUploadMutation").__setRef("MAWBridgeUploadMessageGQLHandler").load().then(function(c){return c.uploadMessageOverGQL(a,b)})});return n.apply(this,arguments)}g.call=a}),98);
__d("MWEBODSUtils",["CurrentMessengerUser","MWEBODSCategory","ODS"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a,b){var e=d("CurrentMessengerUser").getAppID();e=e!=null?e.toString():"unknown";e=a+"."+e;(h||(h=d("ODS"))).bumpEntityKey(c("MWEBODSCategory"),e,b);h.bumpEntityKey(c("MWEBODSCategory"),a,b)}g.markODSForEB=a}),98);
__d("MAWBridgeUploadMessageHandler",["FBLogger","I64","LSDataTraceCheckPoint","LSEncryptedBackupsAttachmentErrorCode","LSEncryptedBackupsBackupTenancy","LSFactory","LSIntEnum","LSIssueMessageBackupStoredProcedure","LSIssueMessageRemoveStoredProcedure","LSMEBTaskCreationSource","LSShape","LSTamThreadSubtype","LSVec","MAWEBFrontendQPLLogger","MAWEncryptedBackupUtils","MAWMsgType","MAWSharedWriteToMPSTables","MAWTimeUtils","MAWTraceUtils","MWEBODSEntityName.enum","MWEBODSUtils","Promise","WALogger","asyncToGeneratorRuntime","gkx","isInstamadillo","isInstamadilloEB","requireDeferred"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j;function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["[labyrinth_web] uploadMessage.authTs is null for the message"]);k=function(){return a};return a}var l=c("requireDeferred")("EncryptedBackupTaskIssuedFalcoEvent").__setRef("MAWBridgeUploadMessageHandler");function a(a,b){return m.apply(this,arguments)}function m(){m=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){var f,g;if(c("isInstamadilloEB")())return(j||(j=b("Promise"))).resolve();e.uploadTrackingInstanceKey!=null&&d("MAWEBFrontendQPLLogger").addPointEBUploadTracking(e.uploadTrackingInstanceKey,"upload_tracking_bridge_handler");d("MWEBODSUtils").markODSForEB(c("MWEBODSEntityName.enum").MAW_EB_UPLOAD_COUNTER,"upload."+((f=e.messageType)!=null?f:"unknown"));f=e.protoMsg;var m=e.traceId,o=(yield d("MAWEncryptedBackupUtils").getBackupTenancy(a,m,e.uploadTrackingInstanceKey));g=((g=e.uploadTrackingInstanceKey)!=null?g:e.traceId).toString();if(o==null||!(h||(h=d("I64"))).equal(o,(i||(i=d("LSIntEnum"))).ofNumber(c("LSEncryptedBackupsBackupTenancy").PRODUCTION))){d("MAWEBFrontendQPLLogger").addPointAndEndFlowUploadMessageBackup(m,"user_device_not_enrolled_invalid_echo_request");if(e.uploadTrackingInstanceKey!=null){o=e.uploadTrackingInstanceKey;d("MAWEBFrontendQPLLogger").addPointEBUploadTracking(o,"user_device_not_enrolled_invalid_echo_request");d("MAWEBFrontendQPLLogger").endEBUploadTracking(o)}d("MAWTraceUtils").recordCheckpointForTrace(g,(i||(i=d("LSIntEnum"))).ofNumber(c("LSDataTraceCheckPoint").LABYRINTH_WEB_UPLOAD_USER_DEVICE_NOT_ENROLLED),[],!1);d("MAWTraceUtils").recordInvalidUploadRequestAndFlushTrace(g,i.ofNumber(c("LSDataTraceCheckPoint").LABYRINTH_WEB_ECHO_MESSAGE_UPLOAD_INVALID_REQUEST),[]);return}m=e.echoDocument;o=e.authTs;if(o==null){d("WALogger").ERROR(k());return}if(e.actionType===1){var p=e.echoEncodingLatencyNs,q=e.errorCode,r=e.errorMessage;d("MAWEBFrontendQPLLogger").addPointUploadMessageBackup(e.traceId,"issuing_message_backup");e.uploadTrackingInstanceKey!=null&&d("MAWEBFrontendQPLLogger").addPointEBUploadTracking(e.uploadTrackingInstanceKey,"issuing_message_backup");var s;if(c("gkx")("23966")&&f!=null)try{var t;yield d("MAWSharedWriteToMPSTables").writeToMPSTables(a,f,e.threadId,!1);s=d("LSShape").ofRecord({act_thread_id:e.threadId,attachment_payload:null,backup_action:(i||(i=d("LSIntEnum"))).ofNumber(f.backupActionType),message_timestamp_ms:d("MAWTimeUtils").toTimestamp(f.serverTs),supplemental_key:f.supplementalKey,toplevel_offline_threading_id:(t=(t=f.originalMsgProtocolId)==null?void 0:t.externalId)!=null?t:f.msgId.externalId})}catch(a){c("FBLogger")("labyrinth_web").mustfix("[labyrinth_web] Error writing to MPSTables for the upload message")}var u;if(e.attachmentBackupContext!=null){t=n(e.attachmentBackupContext,null);t!=null&&(u=d("LSShape").ofRecord(t))}e.uploadTrackingInstanceKey!=null&&d("MAWEBFrontendQPLLogger").addPointEBUploadTracking(e.uploadTrackingInstanceKey,"upload_handler_echo_protobuf_context",{bool:{attachment_backup_context:u!=null,protobuf_context:s!=null}});if(e.messageType!=null){f=d("MAWMsgType").isMAWSupportedMediaType(e.messageType)?"media":"non-media";d("MWEBODSUtils").markODSForEB(c("MWEBODSEntityName.enum").MAW_EB_UPLOAD_COUNTER,"upload."+f)}u!=null&&d("MWEBODSUtils").markODSForEB(c("MWEBODSEntityName.enum").MAW_EB_UPLOAD_COUNTER,"upload.attachment_unified_backup");yield c("LSIssueMessageBackupStoredProcedure")(c("LSFactory")(a),{actThreadId:e.threadId,attachmentBackupContext:u,authoritativeTs:(h||(h=d("I64"))).of_float(o*1e3),echoDocument:(t=m)!=null?t:"",echoEncodingLatencyNs:p!=null?(h||(h=d("I64"))).of_float(p):void 0,error:q!=null?(i||(i=d("LSIntEnum"))).ofNumber(q):void 0,errorMessage:r!=null?r:void 0,isInstamadillo:c("isInstamadillo")(),otid:e.messageId,protobufBackupContext:s,source:(i||(i=d("LSIntEnum"))).ofNumber(c("LSMEBTaskCreationSource").TAM),tamThreadSubtype:i.ofNumber(c("isInstamadillo")()?c("LSTamThreadSubtype").BLEND_DUAL_SEND:c("LSTamThreadSubtype").STANDARD),traceId:g});e.uploadTrackingInstanceKey!=null&&d("MAWEBFrontendQPLLogger").addPointEBUploadTracking(e.uploadTrackingInstanceKey,"upload_tracking_upload_task_issued");void l.load().then(function(a){return a.log(function(){return{message_id:e.messageId,trace_id:e.traceId}})})}else e.actionType===2&&(yield c("LSIssueMessageRemoveStoredProcedure")(c("LSFactory")(a),{actThreadId:e.threadId,authoritativeTs:(h||(h=d("I64"))).of_float(o*1e3),otid:e.messageId,source:(i||(i=d("LSIntEnum"))).ofNumber(c("LSMEBTaskCreationSource").TAM),traceId:g}),e.uploadTrackingInstanceKey!=null&&d("MAWEBFrontendQPLLogger").addPointEBUploadTracking(e.uploadTrackingInstanceKey,"upload_tracking_remove_task_issued"))});return m.apply(this,arguments)}function n(a,b){if(a.attachmentInfos.length!==1)return;var e=a.attachmentInfos[0];e=c("LSVec").ofArray([d("LSShape").ofRecord({attachment_trace_id:e.attachmentTraceId,media_type:e.mediaType,zippy_object_id:e.zippyObjectId})]);var f=(i||(i=d("LSIntEnum"))).ofNumber(c("LSEncryptedBackupsAttachmentErrorCode").NO_ERROR);a.error!=null&&(f=(i||(i=d("LSIntEnum"))).ofNumber(c("LSEncryptedBackupsAttachmentErrorCode").UNKNOWN_ERROR));e={attachment_infos:e,error:f,error_message:null,product_type:a.productType,server_thread_key:b};return e}g.call=a}),98);
__d("MAWBridgeUploadMessageByBatchHandler",["MAWBridgeTraceRecordCheckpointHandler","MAWBridgeUploadMessageGQLHandler","MAWBridgeUploadMessageHandler","MAWEBFrontendQPLLogger","Promise","QPLUserFlow","WALogger","asyncToGeneratorRuntime","gkx","promiseDone","qex"],(function(a,b,c,d,e,f,g){"use strict";var h;function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["[labyrinth][web] Error in GQL upload batch of size "," , error: ",""]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["[labyrinth][web] Successfully completed GQL upload batch of size ",""]);j=function(){return a};return a}function k(a,b){a.forEach(function(a){a.uploadTrackingInstanceKey!=null&&d("MAWEBFrontendQPLLogger").addPointEBUploadTracking(a.uploadTrackingInstanceKey,b)})}function a(a,b){return l.apply(this,arguments)}function l(){l=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,e){k(e.messages,"upload_tracking_bridge_batch_handler");if(c("gkx")("381")||c("qex")._("973")===!0){k(e.messages,"upload_tracking_bridge_batch_handler_gql");try{yield d("MAWBridgeUploadMessageGQLHandler").call(a,e.messages),d("WALogger").LOG(j(),e.messages.length),k(e.messages,"upload_tracking_bridge_batch_handler_gql_issued")}catch(a){e.messages.forEach(function(a){a.uploadTrackingInstanceKey!=null&&d("MAWEBFrontendQPLLogger").failEBUploadTracking(a.uploadTrackingInstanceKey,"gql_upload_failed")}),d("WALogger").ERROR(i(),e.messages.length,a)}return(h||(h=b("Promise"))).resolve()}k(e.messages,"upload_tracking_bridge_batch_handler_echo");e.qpl.forEach(function(a){return c("QPLUserFlow").addPoint(a.event,a.action.name,{instanceKey:a.instanceKey,timestamp:a.timestamp})});e.checkPoint.forEach(function(b){return c("promiseDone")(d("MAWBridgeTraceRecordCheckpointHandler").call(a,b))});for(e of e.messages)yield d("MAWBridgeUploadMessageHandler").call(a,e);return(h||(h=b("Promise"))).resolve()});return l.apply(this,arguments)}g.call=a}),98);
__d("MWEncryptedBackupsProcessBackupIdsDEPRECATED",["FBLogger","LSFactory","LSIntEnum","LSProcessBackupIdsStoredProcedure","MWChatEncryptedBackupsLogging","MWChatEncryptedBackupsQPLEvents","MWEncryptedBackupsFirstRestoreUpsellTime","Promise","QPLEvent","QPLUserFlow","ReQL","WebSession","gkx","promiseDone"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k=c("gkx")("23914");function l(a){if(k){var e=d("MWEncryptedBackupsFirstRestoreUpsellTime").getFirstRestoreUpsellTime();c("QPLUserFlow").getActiveFlowIDs().includes((i||(i=d("QPLEvent"))).getMarkerId(d("MWChatEncryptedBackupsQPLEvents").processBackupIdsQPLEvent))||c("QPLUserFlow").start(d("MWChatEncryptedBackupsQPLEvents").processBackupIdsQPLEvent,{annotations:{string:{ebSessionIdentifier:e,processBackupIdsVersion:"msys",sessionTabId:d("WebSession").getId()}}});return a.runInTransaction(function(a){return c("LSProcessBackupIdsStoredProcedure")(c("LSFactory")(a))},"readwrite",void 0,void 0,f.id+":53").then(function(a){a=(j||(j=d("LSIntEnum"))).unwrapIntEnum(a[0]);c("QPLUserFlow").addPoint(d("MWChatEncryptedBackupsQPLEvents").processBackupIdsQPLEvent,"EB_STATE_"+a+".");d("MWChatEncryptedBackupsLogging").endSuccess({event:d("MWChatEncryptedBackupsQPLEvents").processBackupIdsQPLEvent});return a})}else return(h||(h=b("Promise"))).resolve(0)}function a(a,b){return a.tables.encrypted_backups.subscribe(function(){c("promiseDone")(d("ReQL").toArrayAsync(d("ReQL").fromTableAscending(a.tables.encrypted_backups)),function(d){if(d!=null){c("promiseDone")(l(a),b,function(a){c("FBLogger")("labyrinth_web").catching(a).info("Error in db transaction")});return}})})}g.processBackupIdsStoredProcedure=l;g.subscribeToEncryptedBackupsRow=a}),98);
__d("MWPlatformTaskSystem",["LSPlatformRequestScheduler","MWPlatformTaskUtils","asyncToGeneratorRuntime"],(function(a,b,c,d,e,f,g){"use strict";a=function(){function a(a,b){var e=this;this.$1=a;this.$2=b;this.$3=new(c("LSPlatformRequestScheduler"))();this.$4=d("MWPlatformTaskUtils").checkQueuesWhenPendingTaskTableUpdates(a,function(b){var c=b.queueName;b=b.transportKey;return e.$6(a,c,b,!1)});this.$5=d("MWPlatformTaskUtils").checkQueuesWhenPendingFireForgetTaskTableUpdates(a,function(b){var c=b.queueName;b=b.transportKey;return e.$6(a,c,b,!0)});this.$7()}var e=a.prototype;e.$6=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b,c,d){yield this.$2.decideWhatToDoWithTask(a,b,c,d)});function c(b,c,d,e){return a.apply(this,arguments)}return c}();e.$7=function(){var a=this;d("MWPlatformTaskUtils").checkAllPendingTasksForWork(this.$1,function(b){b=b.queueName;return a.$6(a.$1,b)})};e.cleanup=function(){this.$4.forEach(function(a){return a()}),this.$5.forEach(function(a){return a()}),this.$2.cleanup()};return a}();g["default"]=a}),98);
__d("useMWPReportPresence",["I64","LSAppState","LSFactory","LSReportAppStateStoredProcedure","MsgrPresenceUpdateFalcoEvent","gkx","promiseDone","react","useReStore","uuidv4"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k=(j||d("react")).useCallback;function a(){var a=(h||(h=c("useReStore")))();return k(function(b){var e=c("uuidv4")();c("gkx")("21097")&&c("MsgrPresenceUpdateFalcoEvent").log(function(){return{client_request_id:e,event_type:"app_state_update",is_foregrounded:b===c("LSAppState").FOREGROUND,is_new_ls_presence_reporting:!0}});c("promiseDone")(a.runInTransaction(function(a){return c("LSReportAppStateStoredProcedure")(c("LSFactory")(a),{appState:(i||(i=d("I64"))).of_float(b),requestId:e})},"readwrite",void 0,void 0,f.id+":40"))},[a])}g["default"]=a}),98);
__d("useMWPPresenceManager",["LSAppState","Run","react","useDebouncedComet","useGlobalEventListener","useMWPReportPresence"],(function(a,b,c,d,e,f,g){"use strict";var h;b=h||d("react");var i=b.useCallback,j=b.useEffect,k=b.useRef;function a(){var a=k(c("LSAppState").FOREGROUND),b=c("useMWPReportPresence")(),e=i(function(){b(a.current)},[b]),f=c("useDebouncedComet")(e,{wait:2e3});e=i(function(){a.current=c("LSAppState").FOREGROUND,f()},[f]);var g=i(function(){a.current=c("LSAppState").BACKGROUND,f()},[f]);c("useGlobalEventListener")("focus",e);c("useGlobalEventListener")("blur",g);j(function(){b(c("LSAppState").FOREGROUND);var a=d("Run").onBeforeUnload(function(){b(c("LSAppState").BACKGROUND)},!1);return function(){return a.remove()}},[b])}g.useMWPPresenceManager=a}),98);
__d("MWSetupPresenceReporting.react",["useMWPPresenceManager"],(function(a,b,c,d,e,f,g){"use strict";function a(){d("useMWPPresenceManager").useMWPPresenceManager();return null}g["default"]=a}),98);
__d("MessengerCamcorder.svg.react",["react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||d("react");function a(a){return i.jsxs("svg",babelHelpers["extends"]({viewBox:"0 0 36 36",fill:"currentColor",width:"1em",height:"1em"},a,{children:[a.title!=null&&i.jsx("title",{children:a.title}),a.children!=null&&i.jsx("defs",{children:a.children}),i.jsx("path",{d:"M9 9.5a4 4 0 0 0-4 4v9a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-9a4 4 0 0 0-4-4H9zM25.829 21.532l3.723 1.861A1 1 0 0 0 31 22.5V13.5a1 1 0 0 0-1.448-.894l-3.723 1.861A1.5 1.5 0 0 0 25 15.81v4.38a1.5 1.5 0 0 0 .829 1.342z"})]}))}a.displayName=a.name+" [from "+f.id+"]";a._isSVG=!0;b=a;g["default"]=b}),98);
__d("MessengerLock.svg.react",["react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||d("react");function a(a){return i.jsxs("svg",babelHelpers["extends"]({viewBox:"0 0 36 36",width:"1em",height:"1em",fill:"currentColor"},a,{children:[a.title!=null&&i.jsx("title",{children:a.title}),a.children!=null&&i.jsx("defs",{children:a.children}),i.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.25 15.5a.25.25 0 0 0 .25-.25V12a5.5 5.5 0 1 1 11 0v3.25c0 .138.112.25.25.25h.75a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2h.75zm3 0h5.5a.25.25 0 0 0 .25-.25V12a3 3 0 1 0-6 0v3.25c0 .138.112.25.25.25z"})]}))}a.displayName=a.name+" [from "+f.id+"]";a._isSVG=!0;b=a;g["default"]=b}),98);
__d("MessengerPhone.svg.react",["react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||d("react");function a(a){return i.jsxs("svg",babelHelpers["extends"]({viewBox:"0 0 36 36",fill:"currentColor",width:"1em",height:"1em"},a,{children:[a.title!=null&&i.jsx("title",{children:a.title}),a.children!=null&&i.jsx("defs",{children:a.children}),i.jsx("path",{d:"M25.753 28.2c1.07-.357 1.816-1.275 2.423-2.225a2.05 2.05 0 0 0 .037-2.151 4.998 4.998 0 0 0-.723-.963 11.594 11.594 0 0 0-2.888-2.112c-.58-.299-1.272-.212-1.808.159l-2.098 1.452a.472.472 0 0 1-.437.055 11.557 11.557 0 0 1-4.045-2.63 11.554 11.554 0 0 1-2.63-4.044.472.472 0 0 1 .056-.437l1.453-2.098c.37-.536.457-1.228.158-1.807A11.587 11.587 0 0 0 13.14 8.51a4.995 4.995 0 0 0-.963-.723 2.05 2.05 0 0 0-2.15.037c-.951.607-1.87 1.353-2.225 2.424-1.174 3.527 1.187 8.461 5.338 12.613 4.152 4.151 9.086 6.512 12.614 5.338z"})]}))}a.displayName=a.name+" [from "+f.id+"]";a._isSVG=!0;b=a;g["default"]=b}),98);
__d("PresenceStatusProviderSubscription_ContactProfilesQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="7188178894556645"}),null);
__d("PresenceStatusProviderSubscription_ContactProfilesQuery.graphql",["PresenceStatusProviderSubscription_ContactProfilesQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"ids"},{defaultValue:null,kind:"LocalArgument",name:"scale"}],c=[{kind:"Variable",name:"ids",variableName:"ids"}],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:[{kind:"Literal",name:"height",value:36},{kind:"Variable",name:"scale",variableName:"scale"},{kind:"Literal",name:"width",value:36}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"PresenceStatusProviderSubscription_ContactProfilesQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:c,concreteType:null,kind:"LinkedField",name:"chat_sidebar_contact_nodes",plural:!0,selections:[d,e,f],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"PresenceStatusProviderSubscription_ContactProfilesQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:c,concreteType:null,kind:"LinkedField",name:"chat_sidebar_contact_nodes",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},d,{kind:"TypeDiscriminator",abstractKey:"__isProfile"},e,f],storageKey:null}],storageKey:null}]},params:{id:b("PresenceStatusProviderSubscription_ContactProfilesQuery_facebookRelayOperation"),metadata:{},name:"PresenceStatusProviderSubscription_ContactProfilesQuery",operationKind:"query",text:null}}}();e.exports=a}),null);
__d("PresenceStatusProviderSubscription_PresenceStatusChatVisibilityQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="5081675628568293"}),null);
__d("PresenceStatusProviderSubscription_PresenceStatusChatVisibilityQuery.graphql",["PresenceStatusProviderSubscription_PresenceStatusChatVisibilityQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a={alias:null,args:null,kind:"ScalarField",name:"chat_visibility",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"has_converted_to_view_side_settings",storageKey:null};return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"PresenceStatusProviderSubscription_PresenceStatusChatVisibilityQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[a,{alias:null,args:null,concreteType:"PresenceViewerBasedSettings",kind:"LinkedField",name:"presence_view_side_settings",plural:!1,selections:[c],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"PresenceStatusProviderSubscription_PresenceStatusChatVisibilityQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[a,{alias:null,args:null,concreteType:"PresenceViewerBasedSettings",kind:"LinkedField",name:"presence_view_side_settings",plural:!1,selections:[c,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:b("PresenceStatusProviderSubscription_PresenceStatusChatVisibilityQuery_facebookRelayOperation"),metadata:{},name:"PresenceStatusProviderSubscription_PresenceStatusChatVisibilityQuery",operationKind:"query",text:null}}}();e.exports=a}),null);
__d("PresenceStatusProviderSubscription_rankings.graphql",[],(function(a,b,c,d,e,f){"use strict";a={kind:"InlineDataFragment",name:"PresenceStatusProviderSubscription_rankings"};e.exports=a}),null);
__d("PresenceStatusProviderSubscription",["AvailableListState","CometHomeContactsConfig","CometRelay","CurrentUser","PresenceStatusProviderSubscription_ContactProfilesQuery.graphql","PresenceStatusProviderSubscription_PresenceStatusChatVisibilityQuery.graphql","PresenceStatusProviderSubscription_rankings.graphql","Promise","WebPixelRatio","chunkArray","promiseDone","recoverableViolation","relay-runtime","requireDeferred"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k,l=c("requireDeferred")("FBMqttChannel").__setRef("PresenceStatusProviderSubscription"),m=c("requireDeferred")("MessengerMQTTPresence").__setRef("PresenceStatusProviderSubscription"),n=Object.assign.apply(Object,[{}].concat(Object.entries(c("AvailableListState")).map(function(a){var b,c=a[0];a=a[1];return b={},b[String(a)]=c,b}))),o=h!==void 0?h:h=b("PresenceStatusProviderSubscription_PresenceStatusChatVisibilityQuery.graphql"),p=i!==void 0?i:i=b("PresenceStatusProviderSubscription_ContactProfilesQuery.graphql");function q(a){var b=null,c=l.onReady(function(c){c.subscribe("/legacy_web",function(b){var c=JSON.parse(b);c.type==="privacy_changed"&&a.commitUpdate(function(a){a=a.getRoot();if(a==null)return;a=a.getLinkedRecord("viewer");if(a==null)return;a.setValue(((a=c.data)==null?void 0:a.visibility)===!0,"chat_visibility")})}),b=function(){return c.unsubscribeAll("/legacy_web")}});return{remove:function(){c.remove(),b!=null&&b()}}}function r(a,b,c,d,e){var f=null,g=m.onReady(function(g){g.subscribe({reset:function(){var f=b.current,g={};Object.keys(f).forEach(function(a){delete g[a]});b.current=g;A(a,b.current,c,d,e)},setMultiFromMQTT:function(f){var g=b.current,h=babelHelpers["extends"]({},g);f.forEach(function(a){h[a.u]={last_active_time:a.l,status:a.p}});b.current=h;A(a,b.current,c,d,e)}}),f=function(){return g.unsubscribe()}});return{remove:function(){g.remove(),f!=null&&f()}}}function s(a,b,c,e,f){var g,h=d("relay-runtime").getRequest(o);h=d("relay-runtime").createOperationDescriptor(h,{});h=a.lookup(h.fragment);g=(g=h.data)==null?void 0:g.viewer;var i=typeof g==="object"?g==null?void 0:g.chat_visibility:null;e.current=!!i;return a.subscribe(h,function(d){d=d.data;d=d==null?void 0:d.viewer;if(typeof d!=="object"||d==null)return;var g=d==null?void 0:d.presence_view_side_settings;if(typeof g==="object"&&g!=null&&g.has_converted_to_view_side_settings===!0)return;g=d.chat_visibility;i!=null&&g!==i&&A(a,b.current,c,e,f);i=g})}var t={height:36,scale:d("WebPixelRatio").get(),width:36},u=500;function v(a,e){a=c("chunkArray")(Array.from(a),u);a=a.map(function(a){return d("CometRelay").fetchQuery(e,p,{ids:a,scale:d("WebPixelRatio").get()},{fetchPolicy:"store-or-network"}).toPromise()});return(k||(k=b("Promise"))).all(a)}var w=function(a,b,d){if(b.size===0)return;c("promiseDone")(v(b,d).then(function(b){d.commitUpdate(function(c){b.forEach(function(b){b=(b==null?void 0:(b=b.viewer)==null?void 0:b.chat_sidebar_contact_nodes)||[];b.forEach(function(b){b=x(b,c);a.push(b)})}),z(c,a)})}))};function x(a,b){var c=a==null?void 0:a.id;if(c==null)return;var d=b.get(c);d==null&&(d=b.create(c,"User"));b=a==null?void 0:a.name;if(b==null)return;d.setValue(b,"name");c=d.getOrCreateLinkedRecord("profile_picture","Image",t);b=a==null?void 0:(b=a.profile_picture)==null?void 0:b.uri;if(b==null)return;c.setValue(a==null?void 0:(b=a.profile_picture)==null?void 0:b.uri,"uri");d.setLinkedRecord(c,"profile_picture",t);return d}var y=function(a,b,d,e){a.commitUpdate(function(f){if(d==null)return;var g=new Set(Object.keys(b).filter(function(a){return c("CurrentUser").getID()!==a&&((a=b[a])==null?void 0:a.status)===2})),h=d.filter(function(a){var c=a.buddy_id;a=a.status;return a==null||c==null?!1:((c=e.current?(c=b[c])==null?void 0:c.status:0)!=null?c:0)===a}).map(function(a){a=(a=a.user)==null?void 0:a.id;if(a==null)return null;g["delete"](a);return f.get(a)}).filter(Boolean);g.size>0&&(g.forEach(function(a){var b=f.get(a);if(b!=null&&b.getValue("name")!=null){var c=b.getLinkedRecord("profile_picture",t);c!=null&&c.getValue("uri")!=null&&(h.push(b),g["delete"](a))}}),w(h,g,a));z(f,h)})};function z(a,b){a=a.getRoot().getLinkedRecord("viewer");if(a==null){c("recoverableViolation")("Viewer should not be null here, something has gone horribly wrong","messenger_presence_web");return}a.setLinkedRecords(b,"chat_sidebar_contacts",{count:c("CometHomeContactsConfig").numContactsToFetch})}function A(a,b,c,d,e){a.commitUpdate(function(a){var e=a.getRoot();if(e==null)return;e=e.getLinkedRecord("viewer");if(e==null)return;var f=e.getLinkedRecord("presence_view_side_settings"),g=f!=null&&f.getValue("has_converted_to_view_side_settings")===!0||e.getValue("chat_visibility")===!0;f=e.getLinkedRecord("actor");f!=null&&g?f.setValue("ACTIVE","availability"):f!=null&&f.setValue("OFFLINE","availability");d.current=g;e=Object.keys(b);e.forEach(function(c){var d,e;d=(d=b[c])==null?void 0:d.status;e=(e=b[c])==null?void 0:e.last_active_time;d=d==null?null:n[String(d)];var f=a.get(c);f==null&&d==="ACTIVE"&&(f=a.create(c,"User"));f!=null&&(f.setValue(d==="ACTIVE"&&g?d:null,"availability"),!g?f.setValue(null,"last_active_time"):e!==0&&e!=null&&f.setValue(e,"last_active_time"))});c()}),y(a,b,e,d)}function a(a,c,e,f,g){g=g!=null?g.map(function(a){return d("CometRelay").readInlineData(j!==void 0?j:j=b("PresenceStatusProviderSubscription_rankings.graphql"),a)}):null;var h=q(a),i=r(a,c,e,f,g),k=s(a,c,e,f,g);return{remove:function(){i.remove(),h.remove(),k.dispose()}}}g.init=a}),98);
__d("PresenceStatusProviderSubscriptionComponentQuery.graphql",["relay-runtime"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"count"},{defaultValue:null,kind:"LocalArgument",name:"scale"}],b={alias:null,args:null,kind:"ScalarField",name:"chat_visibility",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"has_converted_to_view_side_settings",storageKey:null},d=[{kind:"Variable",name:"count",variableName:"count"}],e={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"buddy_id",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"PresenceStatusProviderSubscriptionComponentQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[b,{alias:null,args:null,concreteType:"PresenceViewerBasedSettings",kind:"LinkedField",name:"presence_view_side_settings",plural:!1,selections:[c],storageKey:null},{alias:null,args:d,concreteType:"ChatSidebarRankedContact",kind:"LinkedField",name:"chat_sidebar_contact_rankings",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"PresenceStatusProviderSubscription_rankings",selections:[e,f,{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[g,{args:null,kind:"FragmentSpread",name:"MWChatContact_profile"}],storageKey:null}],args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"PresenceStatusProviderSubscriptionComponentQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[b,{alias:null,args:null,concreteType:"PresenceViewerBasedSettings",kind:"LinkedField",name:"presence_view_side_settings",plural:!1,selections:[c,g],storageKey:null},{alias:null,args:d,concreteType:"ChatSidebarRankedContact",kind:"LinkedField",name:"chat_sidebar_contact_rankings",plural:!0,selections:[e,f,{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[g,{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:[{kind:"Literal",name:"first",value:1}],concreteType:"DirectInboxBroadcastBucketConnection",kind:"LinkedField",name:"story_bucket",plural:!1,selections:[{alias:null,args:null,concreteType:"DirectMessageThreadBucket",kind:"LinkedField",name:"nodes",plural:!0,selections:[g,{alias:null,args:null,concreteType:"Story",kind:"LinkedField",name:"first_story_to_show",plural:!1,selections:[g,{alias:null,args:null,concreteType:"StoryCardSeenState",kind:"LinkedField",name:"story_card_seen_state",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_seen_by_viewer",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:"story_bucket(first:1)"},{alias:null,args:[{kind:"Literal",name:"height",value:36},{kind:"Variable",name:"scale",variableName:"scale"},{kind:"Literal",name:"width",value:36}],concreteType:"Image",kind:"LinkedField",name:"profile_picture",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"uri",storageKey:null}],storageKey:null},{kind:"ClientExtension",selections:[{alias:null,args:null,kind:"ScalarField",name:"availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"last_active_time",storageKey:null}]}],type:"User",abstractKey:null}],type:"Profile",abstractKey:"__isProfile"}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:"6866728583456581",metadata:{},name:"PresenceStatusProviderSubscriptionComponentQuery",operationKind:"query",text:null}}}();b("relay-runtime").PreloadableQueryRegistry.set(a.params.id,a);e.exports=a}),null);
__d("PresenceStatusProviderSubscriptionComponent.react",["CometRelay","PresenceStatusProviderSubscription","PresenceStatusProviderSubscriptionComponentQuery.graphql","WebPixelRatio","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j=(i||d("react")).useEffect,k=50;function l(){return d("CometRelay").useLazyLoadQuery(h!==void 0?h:h=b("PresenceStatusProviderSubscriptionComponentQuery.graphql"),{count:k,scale:d("WebPixelRatio").get()})}function a(a){var b=a.chatVisibilityRef,c=a.presenceInformer,e=a.presenceMap;a=l();var f=(a=a==null?void 0:(a=a.viewer)==null?void 0:a.chat_sidebar_contact_rankings)!=null?a:null,g=d("CometRelay").useRelayEnvironment();j(function(){var a=d("PresenceStatusProviderSubscription").init(g,e,c,b,f);return function(){a.remove()}},[g,c,e,f,b]);return null}g["default"]=a}),98);
__d("RTWebCallBlockSettingHooksQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="6238322836279073"}),null);
__d("RTWebCallBlockSettingHooksQuery.graphql",["RTWebCallBlockSettingHooksQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"call_blocked_until",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"RTWebCallBlockSettingHooksQuery",selections:a,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"RTWebCallBlockSettingHooksQuery",selections:a},params:{id:b("RTWebCallBlockSettingHooksQuery_facebookRelayOperation"),metadata:{},name:"RTWebCallBlockSettingHooksQuery",operationKind:"query",text:null}}}();e.exports=a}),null);
__d("RTWebCallBlockSettingHooks",["CometRelay","DateConsts","RTWebCallBlockSettingHooksQuery.graphql","RTWebCallBlockedSettingSubscription","RTWebPreCallContext","ServerTime","promiseDone","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i;e=i||d("react");var j=e.useContext,k=e.useEffect,l=e.useState,m=6e4,n=h!==void 0?h:h=b("RTWebCallBlockSettingHooksQuery.graphql"),o=function(a,b){return function(c){c=c.getRoot();if(c==null)return;c=c.getLinkedRecord("viewer");if(c==null)return;c.setValue(b,a)}};function p(a){return a===-1?a:(a||0)*d("DateConsts").MS_PER_SEC}function q(){var a=d("CometRelay").useRelayEnvironment(),b=d("CometRelay").getActorID(a),e=l(0),f=e[0],g=e[1];k(function(){var e=d("CometRelay").fetchQuery(a,n,{},{fetchPolicy:"store-or-network"}).toPromise().then(function(a){a=a==null?void 0:a.viewer;a!=null&&g(p(a.call_blocked_until))});c("promiseDone")(e);var f=d("RTWebCallBlockedSettingSubscription").subscribe(a,{viewer_id:b},function(b){b=b==null?void 0:b.rtweb_call_blocked_setting_subscribe;b!=null&&(g(p(b.call_blocked_until)),a.commitUpdate(o("call_blocked_until",b.call_blocked_until)))});return function(){f.dispose()}},[a,b]);return f}function r(){var a=q(),b=d("ServerTime").getMillis(),c=a<0,e=a>b;b=l(c||e);var f=b[0],g=b[1];(c||e)!==f&&g(c||e);k(function(){if(e){var b=window.setInterval(function(){a<=d("ServerTime").getMillis()&&(g(!1),window.clearInterval(b))},m);return function(){window.clearInterval(b)}}},[a,e]);return f}function a(){var a=j(c("RTWebPreCallContext")),b=r();k(function(){a!=null&&a.callInviteModel.startListening({callsBlocked:b})},[a,b])}g.useCallBlockSettingValue=q;g.useHasCallsBlocked=r;g.useCallBlockSetting=a}),98);
__d("showDesktopNotification",["MessengerDesktopNotificationPermissions","MessengerDesktopNotifications","ZenonUserActionLogger"],(function(a,b,c,d,e,f,g){"use strict";var h=8e3;function a(){return function(a){var b=a.acceptCall,e=a.body,f=a.icon;a=a.title;var g={body:e,closeTime:h,icon:f,onClick:function(){d("ZenonUserActionLogger").logClick({component:"browser_notification",surface:"desktop_notification"}),window.focus(),b({trigger:"desktop_notification"})},onShow:function(){d("ZenonUserActionLogger").logImpression({component:"browser_notification",surface:"desktop_notification"})},title:a};if(d("MessengerDesktopNotifications").checkPermission()===c("MessengerDesktopNotificationPermissions").DEFAULT){d("MessengerDesktopNotifications").requestPermission(function(){d("MessengerDesktopNotifications").showNotification(g)});return}d("MessengerDesktopNotifications").showNotification(g)}}g["default"]=a}),98);
__d("RTWebCallInviteDesktopNotification.react",["fbt","RTWebPreCallHooks","ZenonUsersHooks","react","showDesktopNotification","usePrevious"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||d("react");function a(a){a=a.invite;return(a==null?void 0:a.type)==="ringing"?j.jsx(k,{invite:a}):null}a.displayName=a.name+" [from "+f.id+"]";function k(a){a=a.invite;var b=c("showDesktopNotification")(),e=c("usePrevious")(a.ringID),f=d("RTWebPreCallHooks").useAcceptCallCallback(!1),g=d("ZenonUsersHooks").useZenonUser(a.inviterID),h=a.requestingVideo,i=a.participants.length>1;if(e!==a.ringID&&g!=null){b({acceptCall:f,body:m(g.shortName),icon:(e=g.profilePictureUrl)!=null?e:null,title:l(h,i)})}return null}k.displayName=k.name+" [from "+f.id+"]";function l(a,b){if(!b)return a?h._("__JHASH__tNVvdc3BFrb__JHASH__"):h._("__JHASH__g-EGCs7nK0S__JHASH__");else return a?h._("__JHASH__xQCntgBdfrr__JHASH__"):h._("__JHASH__P8yKBnycp5c__JHASH__")}function m(a){return h._("__JHASH__Cy_ySzw9b09__JHASH__",[h._param("caller name",a)])}g["default"]=a}),226);
__d("RTWebCometCallDialog.react",["CometControlledUserBlockingDialog.react","FDSButtonGroup.react","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||(h=d("react")),j=h.useId;function a(a){var b,d=a.acceptIcon,e=a.acceptLabel,f=a.acceptTestid,g=a.body,h=a.declineLabel;h=h===void 0?null:h;var k=a.onClose;a=a.title;a=a===void 0?null:a;var l=function(){k(!0)},m=function(){k(!1)},n=j();return i.jsxs(c("CometControlledUserBlockingDialog.react"),{disableClosingWithMask:!0,labelledBy:n,onDismiss:m,title:(b=a)!=null?b:void 0,withCloseButton:!0,children:[i.jsx("div",{className:"xdt5ytf xl56j7k xz9dl7a x1pi30zi xsag5q8 x1swvt13",id:a==null?n:void 0,children:g}),i.jsx("div",{className:"xexx8yu x1sxyh0 x1l90r2v xkhd6sd",children:i.jsx(c("FDSButtonGroup.react"),{align:"end",direction:"backward",primary:{icon:d,label:e,onPress:l,testid:f,type:"primary"},secondary:h!==null?{label:h,onPress:m,reduceEmphasis:!0}:null})})]})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98);
__d("StartVideoChatLinkCall",["FBLogger","RTWebPreCallContextSingleton","RelayFBDefaultEnvironment","URI","XGroupCallControllerRouteBuilder","ZenonActorHooks","ZenonCallIdentifiersUtil","ZenonPeerID","ZenonSignalingProtocol","gkx","randomZenonNonce"],(function(a,b,c,d,e,f,g){"use strict";var h,i=d("RTWebPreCallContextSingleton").create({relayEnvironment:c("RelayFBDefaultEnvironment")});function a(a,b,e,f){b===void 0&&(b=!1);e===void 0&&(e=!1);f===void 0&&(f="");if(!c("gkx")("24231"))return null;if(i){var g=i.callWindowController,h=i.incomingRingSDK,k="",l=a,m=d("ZenonCallIdentifiersUtil").generateZenonClientSessionID();if(b){b=j(a);k=c("randomZenonNonce")();if(b!=null){a={call_context:"LINK:"+b,funnel_session_id:f,nonce:k};e&&(a.auto_join=!0);l=c("XGroupCallControllerRouteBuilder").buildURL(a).toString()}}b=g.initCall({context:{signalingID:m,intent:"start or join",invitees:[],existingCall:null},mediaType:"video",nonce:k,joinContext:{linkUrl:l,type:"link"},representedID:d("ZenonActorHooks").ZenonActor.getID()});f=b[0];b[1];h.startCallIntent(k,{signalingID:m,callTrigger:"meetup_join",isE2eeMandated:!1,isPopupBlocked:f===null,isVideo:!0,peerID:d("ZenonPeerID").ZenonMWPeerID,protocol:c("ZenonSignalingProtocol").MW});return f}else return null}function j(a){var b=new(h||(h=c("URI")))(a),d=b.getDomain();b=b.stripTrailingSlash().getPath();if(d==="msngr.com")return b.substring(1);if(d==="m.me"&&/^\/v(id)?\//.test(b))return b.replace(/^\/v(id)?\//,"");d=/^\/groupcall\/LINK:/;if(d.test(b))return b.replace(d,"");c("FBLogger")("rtc_www").mustfix('Could not extract LinkHash from Video Chat Link. Link = "%s"',a);return null}g.startCall=a}),98);
__d("RTWebMDSCallNotificationDialog.react",["fbt","MDSCircleButton.react","MDSColumn.react","MDSColumnItem.react","MDSControlledUserBlockingDialog.react","MDSFacepilePhoto.react","MDSIcon.react","MDSRow.react","MDSRowItem.react","MDSText.react","MDSTheme.react","MWXText.react","MessengerCamcorder.svg.react","MessengerCross.svg.react","MessengerLock.svg.react","MessengerPhone.svg.react","SVGIcon","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||d("react"),k={content:{maxWidth:"x1tkr9og",$$css:!0}};function a(a){var b=a.acceptLabel,e=a.acceptTestid;e=a.declineLabel;var f=a.headline,g=a.isE2EECall;g=g===void 0?!1:g;var i=a.isVideoCall,l=a.metaContent,m=a.onAccept,n=a.onClose,o=a.onDecline;a.participantIDs;var p=a.profiles;a=a.title;var q=function(){o(),n()},r=function(){m(),n()};g=j.jsx(c("MDSText.react"),{align:"center",type:"meta2",children:j.jsxs(c("MDSRow.react"),{align:"center",paddingHorizontal:0,paddingVertical:0,spacing:0,verticalAlign:"center",children:[g&&j.jsx(c("MDSRowItem.react"),{children:j.jsx(c("MDSIcon.react"),{color:"secondary",icon:d("SVGIcon").svgIcon(c("MessengerLock.svg.react")),size:20})}),j.jsx(c("MDSRowItem.react"),{children:g?h._("__JHASH__-ecQvdNdcfW__JHASH__"):l})]})});return j.jsx(c("MDSTheme.react"),{children:j.jsx(c("MDSControlledUserBlockingDialog.react"),{disableClosingWithMask:!0,onDismiss:q,size:"content",title:a,withCloseButton:!0,children:j.jsxs(c("MDSColumn.react"),{align:"center",expanding:!0,paddingHorizontal:20,xstyle:k.content,children:[j.jsx(c("MDSColumnItem.react"),{paddingVertical:8,children:j.jsx(c("MDSFacepilePhoto.react"),{items:p,size:60})}),j.jsx(c("MDSColumnItem.react"),{children:j.jsxs(c("MDSColumn.react"),{spacing:32,children:[j.jsx(c("MWXText.react"),{align:"center",isSemanticHeading:!0,type:"headlineEmphasized1",children:f}),g]})}),j.jsx(c("MDSColumnItem.react"),{align:"stretch",expanding:!0,paddingVertical:12,children:j.jsxs(c("MDSRow.react"),{align:"center",expanding:!0,children:[j.jsx(c("MDSRowItem.react"),{children:j.jsxs(c("MDSColumn.react"),{align:"center",paddingHorizontal:16,spacing:12,children:[j.jsx(c("MDSColumnItem.react"),{children:j.jsx(c("MDSCircleButton.react"),{color:"white",icon:d("SVGIcon").svgIcon(c("MessengerCross.svg.react")),label:e,onPress:q,size:40,testid:void 0,type:"red"})}),j.jsx(c("MDSColumnItem.react"),{children:j.jsx(c("MDSText.react"),{align:"center",type:"body4",children:e})})]})}),j.jsx(c("MDSRowItem.react"),{children:j.jsxs(c("MDSColumn.react"),{align:"center",paddingHorizontal:16,spacing:12,children:[j.jsx(c("MDSColumnItem.react"),{children:j.jsx(c("MDSCircleButton.react"),{color:"white",icon:i===!0?d("SVGIcon").svgIcon(c("MessengerCamcorder.svg.react")):d("SVGIcon").svgIcon(c("MessengerPhone.svg.react")),label:b,onPress:r,size:40,testid:void 0,type:"green"})}),j.jsx(c("MDSColumnItem.react"),{children:j.jsx(c("MDSText.react"),{align:"center",type:"body4",children:b})})]})})]})})]})})})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("RTWebIncomingCallDialogContainer.react",["fbt","ALT_PLACEHOLDER_FIXME","CometAccessibilityAnnouncement.react","RTWebMDSCallNotificationDialog.react","ZenonUsers","ZenonUsersHooks","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||d("react");function a(a){var b=a.inviterID,e=a.isE2EECall;e=e===void 0?!1:e;var f=a.isVideoCall;f=f===void 0?!0:f;var g=a.onAccept,i=a.onClose,k=a.onDecline,l=a.participantIDs;a=a.receiverID;b=d("ZenonUsersHooks").useZenonUser(b);a=d("ZenonUsersHooks").useZenonUser((a=a)!=null?a:null);l=l.length>1;var m=b==null?h._("__JHASH__lLvypHbTeYz__JHASH__"):h._("__JHASH__E5uMxVlOys1__JHASH__",[h._param("name",b.name)]),n=b==null?h._("__JHASH__vTIK0p-NqNH__JHASH__"):h._("__JHASH__k3FKWh9ZadY__JHASH__",[h._param("name",b.name)]);a=b==null?f?h._("__JHASH__CIJdm48Noob__JHASH__"):h._("__JHASH__Eplm4Qo5zzt__JHASH__"):a&&a.userType===d("ZenonUsers").ZenonUserType.Page?h._("__JHASH__IewfM-xG2nK__JHASH__",[h._param("name",b.name),h._param("page",a.name)]):h._("__JHASH__PWAbxoD9AAl__JHASH__",[h._param("name",b.name)]);l=l?f?m:n:a;return j.jsxs(j.Fragment,{children:[j.jsx(c("CometAccessibilityAnnouncement.react"),{assertive:!0,children:l}),j.jsx(c("RTWebMDSCallNotificationDialog.react"),{acceptLabel:h._("__JHASH__dpE3kinjxKt__JHASH__"),acceptTestid:"answerCallButton",declineLabel:h._("__JHASH__dTblojfehN7__JHASH__"),headline:l,isE2EECall:e,isVideoCall:f,metaContent:h._("__JHASH__pISuXhjR7Xl__JHASH__"),onAccept:g,onClose:i,onDecline:k,profiles:[{alt:c("ALT_PLACEHOLDER_FIXME"),source:{uri:(m=b==null?void 0:b.profilePictureUrl)!=null?m:""}}],title:h._("__JHASH__d62h3ObkIif__JHASH__")})]})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("useRTWebIncomingCallDialog",["QPLUserFlow","RTWebIncomingCallDialogContainer.react","RTWebPreCallContext","ZenonUserActionLogger","qpl","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||(h=d("react"));b=h;var j=b.useContext,k=b.useState;function a(a){var b=a.inviterID,e=a.isE2EECall,f=a.isVideoCall,g=a.onAccept,h=a.onDecline,l=a.participantIDs;a=a.receiverID;var m=k(!1),n=m[0],o=m[1];m=j(c("RTWebPreCallContext"));var p=m?m.callInviteModel:null;return[n?i.jsx(c("RTWebIncomingCallDialogContainer.react"),{inviterID:b,isE2EECall:e,isVideoCall:f,onAccept:function(){g(),o(!1)},onClose:function(){return o(!1)},onDecline:function(){h(),o(!1)},participantIDs:l,receiverID:a}):null,{dismiss:function(){return o(!1)},show:function(){var a;d("ZenonUserActionLogger").logImpression({surface:"incoming_call_dialog"});c("QPLUserFlow").addPoint(c("qpl")._(64225282,"3408"),"render_dialog",{instanceKey:+(p==null?void 0:(a=p.getCurrentInvite())==null?void 0:a.ringID)});o(!0)}}]}g["default"]=a}),98);
__d("RTWebIncomingUnsupportedBrowserDialogWrapper.react",["cr:230"],(function(a,b,c,d,e,f,g){"use strict";g["default"]=b("cr:230")}),98);
__d("RTWebIncomingUnsupportedE2EEDialogNameQuery$Parameters",["RTWebIncomingUnsupportedE2EEDialogNameQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a={kind:"PreloadableConcreteRequest",params:{id:b("RTWebIncomingUnsupportedE2EEDialogNameQuery_facebookRelayOperation"),metadata:{},name:"RTWebIncomingUnsupportedE2EEDialogNameQuery",operationKind:"query",text:null}};e.exports=a}),null);
__d("RTWebIncomingUnsupportedE2EEDialog.entrypoint",["JSResourceForInteraction","RTWebIncomingUnsupportedE2EEDialogNameQuery$Parameters"],(function(a,b,c,d,e,f,g){"use strict";a={getPreloadProps:function(a){a=a.id;return{queries:{queryReference:{parameters:b("RTWebIncomingUnsupportedE2EEDialogNameQuery$Parameters"),variables:{id:a}}}}},root:c("JSResourceForInteraction")("RTWebIncomingUnsupportedE2EEDialog.react").__setRef("RTWebIncomingUnsupportedE2EEDialog.entrypoint")};g["default"]=a}),98);
__d("useRTWebIncomingUnsupportedBrowserDialog",["CometPlaceholder.react","RTWebIncomingUnsupportedBrowserDialogWrapper.react","RTWebIncomingUnsupportedE2EEDialog.entrypoint","RelayHooks","ZenonUserActionLogger","react","useCometRelayEntrypointContextualEnvironmentProvider"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||(h=d("react")),j=h.useState;function a(a){var b=a.inviterID,e=a.isE2EECall,f=a.isVideoCall,g=a.onClose,h=a.participantIDs;a=a.threadType;var k=j(!1),l=k[0],m=k[1];k=c("useCometRelayEntrypointContextualEnvironmentProvider")();k=d("RelayHooks").useEntryPointLoader(k,c("RTWebIncomingUnsupportedE2EEDialog.entrypoint"));var n=k[0],o=k[1];function p(a){a&&e&&n==null&&o({id:b}),m(a)}return[l?e?i.jsx(c("CometPlaceholder.react"),{fallback:null,children:n!=null&&i.jsx(d("RelayHooks").EntryPointContainer,{entryPointReference:n,props:{inviterID:b,onClose:function(){g(),p(!1)},threadType:a}})}):i.jsx(c("RTWebIncomingUnsupportedBrowserDialogWrapper.react"),{hide:function(){return p(!1)},inviterID:b,isVideoCall:f,onClose:function(){g(),p(!1)},participantIDs:h,threadType:a}):null,{dismiss:function(){return p(!1)},show:function(){d("ZenonUserActionLogger").logImpression({surface:"unsupported_browser_dialog"}),p(!0)}}]}g["default"]=a}),98);
__d("RTWebMissedCallDialogContainer.react",["fbt","ALT_PLACEHOLDER_FIXME","CometAccessibilityAnnouncement.react","IntlVariations","RTWebMDSCallNotificationDialog.react","ZenonUsers","ZenonUsersHooks","emptyFunction","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||d("react");function a(a){var b,e=a.actorID,f=a.inviterID,g=a.isVideoCall,i=a.onCallback,k=a.onClose,l=a.participantIDs,m=a.receiverID;a.timeMissed;a=d("ZenonUsersHooks").useZenonUser(f);f=d("ZenonUsersHooks").useZenonUsers(l);m=d("ZenonUsersHooks").useZenonUser((m=m)!=null?m:null);var n=[];n.push({alt:c("ALT_PLACEHOLDER_FIXME"),source:{uri:(b=a==null?void 0:a.profilePictureUrl)!=null?b:""}});m&&m.userType===d("ZenonUsers").ZenonUserType.Page||f.forEach(function(a){if(a.id!==e){n.push({alt:c("ALT_PLACEHOLDER_FIXME"),source:{uri:(a=a==null?void 0:a.profilePictureUrl)!=null?a:""}})}});b=l.length>1?a!=null?h._("__JHASH__gaBcb3A0ac3__JHASH__",[h._name("caller",a.name,c("IntlVariations").GENDER_UNKNOWN)]):h._("__JHASH__oYTKHbmjvdl__JHASH__"):a!=null?h._("__JHASH__d_49GG-7G7P__JHASH__",[h._name("caller",a.name,c("IntlVariations").GENDER_UNKNOWN)]):h._("__JHASH__qjr_m32VN_V__JHASH__");return j.jsxs(j.Fragment,{children:[j.jsx(c("CometAccessibilityAnnouncement.react"),{assertive:!0,children:b}),j.jsx(c("RTWebMDSCallNotificationDialog.react"),{acceptLabel:h._("__JHASH__EBp4M17vY4j__JHASH__"),acceptTestid:"missedCallRedial",declineLabel:h._("__JHASH__GgiLHNwW0uJ__JHASH__"),headline:h._("__JHASH__6OttBPSrAFd__JHASH__",[h._name("caller",a==null?void 0:a.name,c("IntlVariations").GENDER_UNKNOWN)]),isVideoCall:g,metaContent:b,onAccept:i,onClose:k,onDecline:c("emptyFunction"),profiles:n,title:h._("__JHASH__kTzyPp9VwB9__JHASH__")})]})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("useRTWebMissedCallDialog",["RTWebMissedCallDialogContainer.react","ZenonUserActionLogger","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||(h=d("react")),j=h.useState;function a(a){var b=a.actorID,e=a.inviterID,f=a.isVideoCall,g=a.onCallback,h=a.participantIDs,k=a.receiverID;a=a.timeMissed;var l=j(!1),m=l[0],n=l[1];return[m?i.jsx(c("RTWebMissedCallDialogContainer.react"),{actorID:b,inviterID:e,isVideoCall:f,onCallback:g,onClose:function(){return n(!1)},participantIDs:h,receiverID:k,timeMissed:a}):null,{dismiss:function(){return n(!1)},show:function(){d("ZenonUserActionLogger").logImpression({surface:"missed_call_dialog"}),n(!0)}}]}g["default"]=a}),98);
__d("RTWebCometRoomIncomingCallDialog_DisclaimerQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="7185429224860500"}),null);
__d("RTWebCometRoomIncomingCallDialog_DisclaimerQuery$Parameters",["RTWebCometRoomIncomingCallDialog_DisclaimerQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a={kind:"PreloadableConcreteRequest",params:{id:b("RTWebCometRoomIncomingCallDialog_DisclaimerQuery_facebookRelayOperation"),metadata:{},name:"RTWebCometRoomIncomingCallDialog_DisclaimerQuery",operationKind:"query",text:null}};e.exports=a}),null);
__d("RTWebCometRoomIncomingCallDialog.entrypoint",["JSResourceForInteraction","RTWebCometRoomIncomingCallDialog_DisclaimerQuery$Parameters"],(function(a,b,c,d,e,f,g){"use strict";a={getPreloadProps:function(){return{queries:{queryReference:{parameters:b("RTWebCometRoomIncomingCallDialog_DisclaimerQuery$Parameters"),variables:{nuxID:8259}}}}},root:c("JSResourceForInteraction")("RTWebCometRoomIncomingCallDialogContainer.react").__setRef("RTWebCometRoomIncomingCallDialog.entrypoint")};g["default"]=a}),98);
__d("useRoomIncomingCallDialog",["CometPlaceholder.react","CometRelay","RTWebCometRoomIncomingCallDialog.entrypoint","RelayHooks","VideoChatLinksUserActionsMultiplexLogger","react","useCometRelayEntrypointContextualEnvironmentProvider"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||(h=d("react")),j=h.useState;function a(a){var b=a.inviterID,e=a.linkUrl,f=a.onAccept,g=a.onDecline,h=a.roomName;a=a.sender;var k=c("useCometRelayEntrypointContextualEnvironmentProvider")();k=d("RelayHooks").useEntryPointLoader(k,c("RTWebCometRoomIncomingCallDialog.entrypoint"));var l=k[0],m=k[1];k=j(!1);var n=k[0],o=k[1];return[n&&l!=null?i.jsx(c("CometPlaceholder.react"),{fallback:null,children:i.jsx(d("CometRelay").EntryPointContainer,{entryPointReference:l,props:{inviterID:b,linkUrl:e,onAccept:function(){f(),o(!1)},onDecline:function(){g(),o(!1)},roomName:h,sender:a}})}):null,{dismiss:function(){return o(!1)},show:function(){m({}),new(c("VideoChatLinksUserActionsMultiplexLogger"))().setSurface("vcl_meetups_notification").setEvent("room_ringback_received").setVideoCallLinkURLRaw(e).log(),o(!0)}}]}g["default"]=a}),98);
__d("RTWebMissedCallContent.react",["fbt","CometProgressIndicator.react","CometRelativeTimestamp.react","RTWebCometCallMessageLayout.react","ZenonUsersHooks","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||d("react");function a(a){var b=a.inviterID,e=a.isRoomCall,f=a.isVideoCall,g=a.participantIDs;a=a.timeMissed;b=d("ZenonUsersHooks").useZenonUser(b);var i=d("ZenonUsersHooks").useZenonUsers(g).valueSeq().toArray();g=g.length>1;g=!g||e?h._("__JHASH__yg5Wj05Olkt__JHASH__",[h._param("caller name",b==null?void 0:b.name)]):f?h._("__JHASH__N8i901ca52j__JHASH__",[h._param("caller name",b==null?void 0:b.name)]):h._("__JHASH__DUJ5tOEW6-x__JHASH__",[h._param("caller name",b==null?void 0:b.name)]);return b===null?j.jsx(c("CometProgressIndicator.react"),{}):j.jsx(c("RTWebCometCallMessageLayout.react"),{caller:b,mainMessage:g,participants:i,subMessage:j.jsx(c("CometRelativeTimestamp.react"),{date:a,format:"normal"})})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("RTWebCometRoomMissedCallDialogContainer.react",["fbt","ix","RTWebCometCallDialog.react","RTWebMissedCallContent.react","VideoChatLinksUserActionsMultiplexLogger","fbicon","react"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k=j||d("react");function a(a){var b=a.inviterID,e=a.linkUrl,f=a.onCallback,g=a.onClose,j=a.participantIDs,l=a.roomName;a=a.timeMissed;return k.jsx(c("RTWebCometCallDialog.react"),{acceptIcon:d("fbicon")._(i("493173"),16),acceptLabel:h._("__JHASH__w3CZsnYYCtS__JHASH__"),body:k.jsx(c("RTWebMissedCallContent.react"),{inviterID:b,isRoomCall:!0,isVideoCall:!1,participantIDs:j,timeMissed:a}),declineLabel:h._("__JHASH__EugSOocwBfG__JHASH__"),onClose:function(a){a?(new(c("VideoChatLinksUserActionsMultiplexLogger"))().setSurface("vcl_meetups_notification").setEvent("room_ringback_accepted").setVideoCallLinkURLRaw(e).log(),f()):new(c("VideoChatLinksUserActionsMultiplexLogger"))().setSurface("vcl_meetups_notification").setEvent("room_ringback_missed_dialog_dismissed").setVideoCallLinkURLRaw(e).log(),g()},title:h._("__JHASH__bMJmvEBqc28__JHASH__",[h._param("room name",l)])})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("useRoomMissedCallDialog",["RTWebCometRoomMissedCallDialogContainer.react","VideoChatLinksUserActionsMultiplexLogger","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||(h=d("react")),j=h.useState;function a(a){var b=a.inviterID,d=a.linkUrl,e=a.onCallback,f=a.participantIDs,g=a.roomName;a=a.timeMissed;var h=j(!1),k=h[0],l=h[1];return[k?i.jsx(c("RTWebCometRoomMissedCallDialogContainer.react"),{inviterID:b,linkUrl:d,onCallback:e,onClose:function(){return l(!1)},participantIDs:f,roomName:g,timeMissed:a}):null,{dismiss:function(){return l(!1)},show:function(){new(c("VideoChatLinksUserActionsMultiplexLogger"))().setSurface("vcl_meetups_notification").setEvent("room_ringback_missed").setVideoCallLinkURLRaw(d).log(),l(!0)}}]}g["default"]=a}),98);
__d("useZenonDialogController",["react","usePrevious"],(function(a,b,c,d,e,f,g){"use strict";var h;b=h||d("react");var i=b.useEffect,j=b.useState;function a(a,b){var d=j(null),e=d[0],f=d[1],g=c("usePrevious")(a);i(function(){var c;if((a==null?void 0:a.ringID)===(g==null?void 0:g.ringID)&&(a==null?void 0:a.type)===(g==null?void 0:g.type))return;e!=null&&(e.dismiss(),f(null));if(a===null)return;f(b);(c=b())==null?void 0:c.show()},[e,b,a,g])}g["default"]=a}),98);
__d("RTWebCometCallInviteDialogs.react",["Actor","RTWebDropInUtils","RTWebIncomingRingConfiguration","RTWebPreCallContext","RTWebPreCallHooks","ServerTime","StartVideoChatLinkCall","react","useRTWebIncomingCallDialog","useRTWebIncomingUnsupportedBrowserDialog","useRTWebMissedCallDialog","useRoomIncomingCallDialog","useRoomMissedCallDialog","useZenonDialogController"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||(h=d("react")),j=h.useContext;function a(a){var b,e=a.invite;a=d("Actor").useActor();var f=a[0];a=j(c("RTWebPreCallContext"));var g=d("RTWebPreCallHooks").useStartCallCallback(),h=a?a.callInviteModel:null,k=(a=e==null?void 0:e.participants)!=null?a:[],l=(a=e==null?void 0:e.isE2eeMandated)!=null?a:!1;a=(a=e==null?void 0:e.inviterID)!=null?a:"";b=(b=e==null?void 0:e.requestingVideo)!=null?b:!1;var m=null,n="",o="";if((e==null?void 0:e.context.type)==="room"){var p;m=e.context.room;n=(p=m.linkHash)!=null?p:"";o=(p=m.roomName)!=null?p:""}var q=d("RTWebPreCallHooks").useAcceptCallCallback(!1);p=c("useRoomMissedCallDialog")({inviterID:a,linkUrl:n,onCallback:function(){d("StartVideoChatLinkCall").startCall(n,!0,!0),h==null?void 0:h.dismiss()},participantIDs:k,roomName:o,timeMissed:new Date(d("ServerTime").getMillis())});var r=p[0],s=p[1];p=c("useRTWebIncomingCallDialog")({inviterID:a,isE2EECall:l,isVideoCall:b,onAccept:function(){q({trigger:"comet_incoming_dialog_accept_button"})},onDecline:function(){h==null?void 0:h.decline("IgnoreCall")},participantIDs:k});var t=p[0],u=p[1];p=c("useRTWebIncomingUnsupportedBrowserDialog")({inviterID:a,isE2EECall:l,isVideoCall:b,onClose:function(){h==null?void 0:h.dismiss()},participantIDs:k,threadType:(e==null?void 0:e.context.type)==="thread"?e.context.thread.type:2});var v=p[0],w=p[1];m=c("useRoomIncomingCallDialog")({inviterID:a,linkUrl:n,onAccept:function(){d("StartVideoChatLinkCall").startCall(n,!0,!0)},onDecline:function(){h==null?void 0:h.decline("IgnoreCall")},roomName:o,sender:(o=(p=m)==null?void 0:p.sender)!=null?o:""});p=m[0];var x=m[1];o=c("useRTWebMissedCallDialog")({actorID:f,inviterID:a,isVideoCall:b,onCallback:function(){if((e==null?void 0:e.context.type)==="thread"){var a,b=e==null?void 0:e.context.thread;g({existingCall:null,invitees:[(a=e==null?void 0:e.inviterID)!=null?a:""].concat(k.filter(function(a){return a!==f})),isE2eeMandated:(a=e==null?void 0:e.isE2eeMandated)!=null?a:!1,mediaType:(e==null?void 0:e.requestingVideo)?"video":"audio",thread:b,trigger:"comet_missed_call_dialog"})}h==null?void 0:h.dismiss()},participantIDs:k,timeMissed:new Date(d("ServerTime").getMillis())});m=o[0];var y=o[1];c("useZenonDialogController")(e,function(){if(e===null||h==null)return null;if(d("RTWebDropInUtils").isDropInFromAppMessages(e==null?void 0:e.controllerParams.appMessages))return null;if(l&&!d("RTWebIncomingRingConfiguration").isE2EESupportedClient())return w;if(e.context.type==="room")switch(e.type){case"ringing":return x;case"missed":return s;default:return null}switch(e.type){case"ringing":return u;case"missed":return e.context.type==="thread"?y:null;case"unsupported_browser":return w;default:return null}});return i.jsxs(i.Fragment,{children:[t,m,v,r,p]})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98);
__d("useZenonRingTone",["RTCSounds","Sound","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=(h||d("react")).useEffect,j=[d("RTCSounds").ringtone_mp3_url,d("RTCSounds").ringtone_ogg_url];function a(a){a===void 0&&(a=!1),i(function(){if(a){d("Sound").play(j,null,!0);return function(){d("Sound").stop(j)}}},[a])}g["default"]=a}),98);
__d("ZenonCallInviteRingtone.react",["useZenonRingTone"],(function(a,b,c,d,e,f,g){"use strict";function a(a){a=a.invite;c("useZenonRingTone")((a==null?void 0:a.type)==="ringing");return null}g["default"]=a}),98);
__d("useDocumentTitleBlink",["DocumentTitle","react"],(function(a,b,c,d,e,f,g){"use strict";var h,i=(h||d("react")).useEffect;function a(a){i(function(){if(a==null)return;var b=c("DocumentTitle").blink(a);return function(){b.stop()}},[a])}g["default"]=a}),98);
__d("ZenonCallInviteTitleBlinking.react",["fbt","ZenonUsersHooks","react","useDocumentTitleBlink"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j=i||d("react");function a(a){a=a.invite;return a!==null&&a.type==="ringing"&&a.inviterID!=null?j.jsx(k,{inviterID:a.inviterID}):null}a.displayName=a.name+" [from "+f.id+"]";function k(a){a=a.inviterID;a=d("ZenonUsersHooks").useZenonUser(a);c("useDocumentTitleBlink")(a?h._("__JHASH__MwALAshovbD__JHASH__",[h._param("name",a.shortName)]):null);return null}k.displayName=k.name+" [from "+f.id+"]";g["default"]=a}),226);
__d("RTWebCometCallInviteController.react",["RTWebCallBlockSettingHooks","RTWebCallInviteDesktopNotification.react","RTWebCometCallInviteDialogs.react","RTWebPreCallHooks","ZenonCallInviteRingtone.react","ZenonCallInviteTitleBlinking.react","react","requireDeferred"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h||d("react");b=c("requireDeferred")("FBRTCCallSummaryUploader").__setRef("RTWebCometCallInviteController.react");b.onReady(function(a){a.init()});function a(){d("RTWebCallBlockSettingHooks").useCallBlockSetting();d("RTWebPreCallHooks").useNoAnswerTimeout();var a=d("RTWebPreCallHooks").useCallInvite();return i.jsxs(i.Fragment,{children:[i.jsx(c("RTWebCometCallInviteDialogs.react"),{invite:a}),i.jsx(c("RTWebCallInviteDesktopNotification.react"),{invite:a}),i.jsx(c("ZenonCallInviteRingtone.react"),{invite:a}),i.jsx(c("ZenonCallInviteTitleBlinking.react"),{invite:a})]})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98);
__d("ReverbWriteFailureFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("5829");b=d("FalcoLoggerInternal").create("reverb_write_failure",a);e=b;g["default"]=e}),98);
__d("ReverbWriteSuccessFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("5831");b=d("FalcoLoggerInternal").create("reverb_write_success",a);e=b;g["default"]=e}),98);
__d("SetHovercardInteractionPreferenceMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="8371614642855977"}),null);
__d("SetHovercardInteractionPreferenceMutation.graphql",["SetHovercardInteractionPreferenceMutation_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:"data",variableName:"input"}],concreteType:"XFBSetHovercardInteractionPreferenceHovercardSettingsResponsePayload",kind:"LinkedField",name:"xfb_set_hovercard_interaction_preference_hovercard_settings",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"client_mutation_id",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"SetHovercardInteractionPreferenceMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"SetHovercardInteractionPreferenceMutation",selections:c},params:{id:b("SetHovercardInteractionPreferenceMutation_facebookRelayOperation"),metadata:{},name:"SetHovercardInteractionPreferenceMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
__d("SetHovercardInteractionPreference",["CometRelay","SetHovercardInteractionPreferenceMutation.graphql"],(function(a,b,c,d,e,f,g){"use strict";var h;function a(a){var c=a.environment;a=a.input;d("CometRelay").commitMutation(c,{mutation:h!==void 0?h:h=b("SetHovercardInteractionPreferenceMutation.graphql"),variables:a})}g["default"]=a}),98);
__d("SwitchedSuccessFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("2055");b=d("FalcoLoggerInternal").create("switched_success",a);e=b;g["default"]=e}),98);
__d("VideoPlayerSkipControl_video.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{argumentDefinitions:[{defaultValue:"WNS",kind:"LocalArgument",name:"caller"},{defaultValue:"WNS",kind:"LocalArgument",name:"channelEntryPoint"},{defaultValue:1,kind:"LocalArgument",name:"count"},{defaultValue:null,kind:"LocalArgument",name:"cursor"},{defaultValue:null,kind:"LocalArgument",name:"seedVideoID"}],kind:"Fragment",metadata:null,name:"VideoPlayerSkipControl_video",selections:[a,{alias:null,args:[{kind:"Variable",name:"entry_point",variableName:"channelEntryPoint"}],concreteType:null,kind:"LinkedField",name:"video_channel",plural:!1,selections:[{alias:null,args:[{kind:"Variable",name:"after",variableName:"cursor"},{kind:"Variable",name:"caller",variableName:"caller"},{kind:"Variable",name:"exclude_video",variableName:"seedVideoID"},{kind:"Variable",name:"first",variableName:"count"}],concreteType:"VideoChannelFeedConnection",kind:"LinkedField",name:"video_channel_feed",plural:!1,selections:[{alias:null,args:null,concreteType:"VideoChannelFeedEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineFragment",selections:[{alias:null,args:null,concreteType:"StoryAttachment",kind:"LinkedField",name:"attachments",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"InlineFragment",selections:[a,{args:null,kind:"FragmentSpread",name:"CometWatchAndScrollUpNextCard_video"},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"owner",plural:!1,selections:[a],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null}],type:"Video",abstractKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"click_tracking_linkshim_cb",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"encrypted_click_tracking",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"encrypted_tracking",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"viewability_config",storageKey:null},{alias:null,args:null,concreteType:"CometClientViewConfig",kind:"LinkedField",name:"client_view_config",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_delay_log_impression",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"use_banzai_signal_imp",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"use_banzai_vital_imp",storageKey:null}],storageKey:null}],type:"Story",abstractKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Video",abstractKey:null}}();e.exports=a}),null);
__d("VideoPlayerSkipControl.react",["CometRelay","CometSetWatchAndScrollVideoContext","CometVideoPictureInPictureManager.react","CometVideoPictureInPictureManagerHooks","CometWatchAndScrollSetStoryViewabilityLoggerContext","CometWatchAndScrollUpNextCard.react","CometWatchAndScrollVideoContext","VideoPlayerHooks","VideoPlayerSkipControlBase.react","VideoPlayerSkipControl_video.graphql","react","requireDeferred","useCometTahoeChainingDepth","useMinifiedProductAttribution","usePlayerOriginRouteTracePolicy"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j,k=i||(i=d("react"));e=i;var l=e.useCallback,m=e.useContext,n=e.useState,o=c("requireDeferred")("VideoHomeTypedLiteLogger").__setRef("VideoPlayerSkipControl.react");function a(a){var e,f=a.subOrigin;a=a.video;a=d("CometRelay").useFragment(h!==void 0?h:h=b("VideoPlayerSkipControl_video.graphql"),a);var g=d("useCometTahoeChainingDepth").useChainingDepthContext(),i=g.chainingDepthDispatch,p=m(c("CometWatchAndScrollVideoContext"));g=(j||(j=d("VideoPlayerHooks"))).useEnded();var q=m(c("CometWatchAndScrollSetStoryViewabilityLoggerContext")),r=m(c("CometSetWatchAndScrollVideoContext"));a=(a=a.video_channel)==null?void 0:(a=a.video_channel_feed)==null?void 0:(a=a.edges)==null?void 0:a[0];var s=a==null?void 0:a.cursor,t=a==null?void 0:a.node,u=t==null?void 0:t.client_view_config;a=t==null?void 0:(a=t.attachments)==null?void 0:(a=a[0])==null?void 0:a.media;var v=a!=null&&a.__typename==="Video"?a==null?void 0:a.id:null,w=p==null?void 0:p.chainingSeedVideoID,x=c("usePlayerOriginRouteTracePolicy")(),y=n(!1),z=y[0],A=y[1];y=l(function(){A(!0),o.onReady(function(a){a.log({event:"watch_and_scroll_skip_overlay_impression"})})},[]);var B=l(function(){A(!1)},[]);e=a==null?void 0:(e=a.owner)==null?void 0:e.id;var C=j.useIsPremiumMusicVideo(),D=a==null?void 0:a.url,E=c("useMinifiedProductAttribution")(),F=l(function(){var a;o.onReady(function(a){a.log({attribution_id_v2:E,click_point:"control_skip",click_target:"watch_and_scroll",event:"click"})});r({chainingCursor:s,chainingSeedVideoID:w,routeTracePolicy:(a=p==null?void 0:p.routeTracePolicy)!=null?a:x,sessionStartTime:p==null?void 0:p.sessionStartTime,sessionTrigger:p==null?void 0:p.sessionTrigger,subOrigin:f,videoID:v,videoUrl:D});a={can_delay_log_impression:u==null?void 0:u.can_delay_log_impression,use_banzai_signal_imp:u==null?void 0:u.use_banzai_signal_imp,use_banzai_vital_imp:u==null?void 0:u.use_banzai_vital_imp};q({clientViewConfig:a,encryptedTracking:t==null?void 0:t.encrypted_tracking,trackingCode:{click_tracking_linkshim_cb:(t==null?void 0:t.click_tracking_linkshim_cb)||"",encrypted_click_tracking:(t==null?void 0:t.encrypted_click_tracking)||"",encrypted_tracking:(t==null?void 0:t.encrypted_tracking)||""},videoID:v,viewabilityConfig:t==null?void 0:t.viewability_config});i&&i({type:"INCREMENT"})},[v,i,u==null?void 0:u.can_delay_log_impression,u==null?void 0:u.use_banzai_signal_imp,u==null?void 0:u.use_banzai_vital_imp,s,x,q,r,t==null?void 0:t.click_tracking_linkshim_cb,t==null?void 0:t.encrypted_click_tracking,t==null?void 0:t.encrypted_tracking,t==null?void 0:t.viewability_config,f,w,p==null?void 0:p.routeTracePolicy,p==null?void 0:p.sessionStartTime,p==null?void 0:p.sessionTrigger,D]),G=d("CometVideoPictureInPictureManagerHooks").useCometVideoPictureInPictureManager(),H=G.setHasNextChainedVideo,I=G.setSkippedFromPipPlayer;G=G.skippedFromPipPlayer;if(a==null||a.__typename!=="Video"){o.onReady(function(a){a.log({event:"watch_and_scroll_chaining_query_empty"})});H(!1);return k.jsx(c("VideoPlayerSkipControlBase.react"),{disabled:!0})}else H(!C&&!d("CometVideoPictureInPictureManager.react").EXCLUDED_PROVIDERS.includes(e));G&&(F(),I(!1));return k.jsxs(k.Fragment,{children:[k.jsx(c("VideoPlayerSkipControlBase.react"),{onHoverIn:y,onHoverOut:B,onPress:F}),z&&!g&&k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"x1jx94hy xm3z3ea x1x8b98j x131883w x16mih1h x1qqjqyx x1ta3ar0 x10l6tqk xyokknr x1rr8tx7 x1se2ifz"}),k.jsx(c("CometWatchAndScrollUpNextCard.react"),{hidden:!1,video:a})]})]})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),98);
__d("WebStorageManagerEstimatesFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("2144");b=d("FalcoLoggerInternal").create("web_storage_manager_estimates",a);e=b;g["default"]=e}),98);
__d("WellbeingGenericFalcoEvent",["FalcoLoggerInternal","getFalcoLogPolicy_DO_NOT_USE"],(function(a,b,c,d,e,f,g){"use strict";a=c("getFalcoLogPolicy_DO_NOT_USE")("255");b=d("FalcoLoggerInternal").create("wellbeing_generic",a);e=b;g["default"]=e}),98);
__d("addCometProfileSwitchAnnotation",["JSScheduler","QuickPerformanceLogger","isRecentProfileSwitchSessionStorage","profileSwitchOriginSessionStorage","qpl"],(function(a,b,c,d,e,f,g){"use strict";var h,i;function a(a){(i||(i=d("JSScheduler"))).scheduleLoggingPriCallback(function(){var b=c("isRecentProfileSwitchSessionStorage").getAndRemove();b&&((h||(h=c("QuickPerformanceLogger"))).markerEnd(c("qpl")._(30606395,"1860"),2,0,h.currentTimestamp()),a.addAnnotationInt("is_recent_profile_switch",b.didSwitchToMainProfile?2:1));b=c("profileSwitchOriginSessionStorage").getAndRemove();b&&a.addMetadata("origin",b.origin)})}g["default"]=a}),98);
__d("logCometTopNavTabPress",["CometHomeProductBadgedNavigationLogger","logCometWatchTabSelectedEvent"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b,e){e!=null&&b!=null&&b>0&&d("CometHomeProductBadgedNavigationLogger").markerStartAndAnnotateWithProductID(e);switch(a){case"watch":c("logCometWatchTabSelectedEvent")("tab",b>0,"tab");break;default:break}}g["default"]=a}),98);