EBRepairEpochs",["Base64Utils","EBDeps","EBEpochUtils","EBGetClientState","EBRepairEpochQuery","I64","LSAuthorityLevel","LSIntEnum","ReQL","WAResultOrError","getErrorSafe"],(function(t,n,r,o,a,i,l){"use strict";var e,s;async function u(){var t=await o("EBDeps").getDeps().getLSDB();try{var n=await o("EBGetClientState").getClientState(t);if(n==null)return o("WAResultOrError").makeError("Client state is missing");var a=n.backupId,i=n.device_id;if(a==null||i==null)return o("WAResultOrError").makeError("Backup ID or device ID is missing");var l=await o("ReQL").toArrayAsync(o("ReQL").fromTableAscending(t.tables.secure_encrypted_backups_epochs)),u=await Promise.all(l.filter(function(t){return(e||(e=o("I64"))).equal(t.authorityLevel,(s||(s=o("LSIntEnum"))).ofNumber(r("LSAuthorityLevel").AUTHORITATIVE))}).map(async function(t){var n=await o("EBEpochUtils").getFingerPrint(t.epochRootKeyBlob,"MEBEpochRootKey");return{epoch_id:(e||(e=o("I64"))).to_string(t.epochId),fingerprint:{sensitive_string_value:o("Base64Utils").fromArrayBuffer(n)}}})),c=await o("EBRepairEpochQuery").RepairEpochQuery({backup_id:(e||(e=o("I64"))).to_string(a),device_id:e.to_string(i),locally_available_epochs:u,trace_id:void 0});return c}catch(e){var d=r("getErrorSafe")(e);return o("WAResultOrError").makeError(d.message)}}l.EBRepairEpochs=u}),98);
-----
EBRepairEpochQuery",["EBRepairEpochQuery.graphql","WAResultOrError","createWorkerQuery"],(function(t,n,r,o,a,i,l){"use strict";var e;async function s(t){var a,i=e!==void 0?e:e=n("EBRepairEpochQuery.graphql"),l=await r("createWorkerQuery")(i,{input:t}),s=l==null||(a=l.viewer)==null||(a=a.encrypted_backup)==null||(a=a.mailbox)==null?void 0:a.repair_epoch;return(s==null?void 0:s.is_success)===!0&&(s==null?void 0:s.epoch_derivation_set)!=null?o("WAResultOrError").makeResult(s.epoch_derivation_set):(s==null?void 0:s.exception_string)!=null?o("WAResultOrError").makeError(s.exception_string):o("WAResultOrError").makeError("Repair epoch failed")}l.RepairEpochQuery=s}),98);
-----
EBRepairEpochQuery.graphql",["EBRepairEpochQuery_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{alias:null,args:null,kind:"ScalarField",name:"epoch_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"epoch_anon_id",storageKey:null}],r={alias:null,args:null,concreteType:"XFBEncryptedBackupMailbox",kind:"LinkedField",name:"mailbox",plural:!1,selections:[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBRepairEpochResponse",kind:"LinkedField",name:"repair_epoch",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"is_success",storageKey:null},{alias:null,args:null,concreteType:"XFBEpochDerivationSet",kind:"LinkedField",name:"epoch_derivation_set",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"target_device_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"epoch_sync_reason",storageKey:null},{alias:null,args:null,concreteType:"XFBEncryptedBackupsEpochEdge",kind:"LinkedField",name:"epoch_edges",plural:!0,selections:[{alias:null,args:null,concreteType:"XFBEpochIds",kind:"LinkedField",name:"from_epoch",plural:!1,selections:t,storageKey:null},{alias:null,args:null,concreteType:"XFBEpochIds",kind:"LinkedField",name:"to_epoch",plural:!1,selections:t,storageKey:null},{alias:null,args:null,concreteType:"XFBEpochForwardEdge",kind:"LinkedField",name:"forward_edge",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"encrypted_entropy",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"auth_public_key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"epoch_storage_public_key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"entropy_fingerprint",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"psk_fingerprint",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"backward_edge",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"from_epoch_fingerprint",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"to_epoch_fingerprint",storageKey:null},{alias:null,args:null,concreteType:"XFBMinosEpoch",kind:"LinkedField",name:"to_minos_epoch",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"epoch_head",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"self_epoch_signature",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"exception_string",storageKey:null}],storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"EBRepairEpochQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBEncryptedBackup",kind:"LinkedField",name:"encrypted_backup",plural:!1,selections:[r],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"EBRepairEpochQuery",selections:[{alias:null,args:null,concreteType:"Viewer",kind:"LinkedField",name:"viewer",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBEncryptedBackup",kind:"LinkedField",name:"encrypted_backup",plural:!1,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:n("EBRepairEpochQuery_facebookRelayOperation"),metadata:{},name:"EBRepairEpochQuery",operationKind:"query",text:null}}})();a.exports=e}),null);
-----
EBRepairEpochQuery_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="24909722305343802"}),null);
-----