DollyDeviceDiagnosticDownloadModal.react",["fbt","CometRelay","DateConsts","DollyDeviceDiagnosticDownloadModalQuery.graphql","DollyDeviceDiagnosticUpdateDialog.react","DollyDeviceDiagnosticUtil","FBLogger","MCDSFlexbox.react","MCDSLink.react","MCDSText.react","gkx","promiseDone","react","useDollyDeviceDiagnosticConnection","useDollyDeviceDiagnosticDisconnectOrErrorModal","useDollyDeviceDiagnosticLogger","useDollyDeviceDiagnosticPreloadAssets","useOnBeforeUnload","useStoreLogEventOnceOnInitialRender"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k=j||(j=d("react"));e=j;var l=e.useCallback,m=e.useState,n=7*d("DateConsts").MS_PER_MIN;function a(a){var e=a.deviceClient,f=a.onClose,g=a.onComplete;a=a.onReconnect;var j=m(null),o=j[0],p=j[1];j=m(0);var q=j[0],r=j[1];j=c("useDollyDeviceDiagnosticConnection")();j=j.isDisconnected;var s=m(null),t=s[0],u=s[1];c("useOnBeforeUnload")(function(){return{warnMessage:h._(/*BTDS*/"Are you sure you want to leave?")}});s=c("useDollyDeviceDiagnosticLogger")({currentStep:d("DollyDeviceDiagnosticUtil").DollyDeviceDiagnosticStepName.DOWNLOAD_UPDATES,serialNumber:e.getSerialNumber()});var v=s.logClick,w=s.logDownloadAttempt,x=s.logDownloadFail,y=s.logDownloadSuccess;s=s.logView;c("useStoreLogEventOnceOnInitialRender")(s);s=d("CometRelay").useLazyLoadQuery(i!==void 0?i:i=b("DollyDeviceDiagnosticDownloadModalQuery.graphql"),{serialNumber:e.getSerialNumber()});s=s.xfb_list_webusb_device_latest_build_query;if(s==null)throw c("FBLogger")("dolly").mustfixThrow("Build info is null");var z=s.build_number,A=s.build_number_display_name,B=s.semantic_version,C=s.status_code,D=s.url,E=c("gkx")("14003")?B:A,F=l(function(){var a=z+".zip";w(z);u(Date.now());c("promiseDone")(e.download(a,D,r),function(a){y(z),g(a)},function(a){p("Error downloading file");x(z,"Error downloading file");throw c("FBLogger")("dolly").mustfixThrow("Error downloading file. %s",a)})},[z,e,w,x,y,g,D]);s=c("useDollyDeviceDiagnosticDisconnectOrErrorModal")(j,f,a,o,C);if(s!=null)return s;if(q===0)return k.jsx(c("DollyDeviceDiagnosticUpdateDialog.react"),{modalDetails:{illustration:{imageUrl:d("useDollyDeviceDiagnosticPreloadAssets").AssetSource.DOWNLOAD_UPDATES,size:d("DollyDeviceDiagnosticUtil").DollyDeviceDiagnosticImageSize.SMALL},progressContent:{title:h._(/*BTDS*/"Ready for download"),content:[k.jsx(c("MCDSText.react"),{children:h._(/*BTDS*/"The latest update ({=m1}) is ready to be downloaded. Please make sure you have 2GB of storage available on this computer.",[h._implicitParam("=m1",k.jsx(c("MCDSLink.react"),{target:"_blank",url:d("DollyDeviceDiagnosticUtil").RELEASE_NOTES_LINK,onClick:function(){v("build "+E)},children:h._(/*BTDS*/"{version_to_display}",[h._param("version_to_display",E)])}))])},0),k.jsx(c("MCDSText.react"),{children:h._(/*BTDS*/"Keep your device connected during the download. It may take up to 7 minutes.")},1),h._(/*BTDS*/"Do not disconnect your device while the software is downloading.")]},action:{label:h._(/*BTDS*/"Start download"),onClick:function(){v("Start download"),F()}},onClose:f,isDismissable:!0}});B=q>0?[k.jsx(c("MCDSFlexbox.react"),{alignItems:"center",direction:"column",children:k.jsxs(c("MCDSText.react"),{textAlign:"center",children:[h._(/*BTDS*/"Downloaded:")," ",Math.floor(q),"%"]})},0)]:[];B.push(h._(/*BTDS*/"Do not disconnect your device."));return k.jsx(c("DollyDeviceDiagnosticUpdateDialog.react"),{errorCalloutProps:t!=null&&Date.now()-t>n?{title:h._(/*BTDS*/"Looks like this is taking longer than expected"),message:h._(/*BTDS*/"If the software still hasnu2019t been downloaded in the next 5 minutes, please power off your device, disconnect it, and try again."),messageTextAlignment:"center"}:null,modalDetails:{illustration:{imageUrl:d("useDollyDeviceDiagnosticPreloadAssets").AssetSource.DOWNLOAD_UPDATES,size:d("DollyDeviceDiagnosticUtil").DollyDeviceDiagnosticImageSize.SMALL},progressContent:{title:h._(/*BTDS*/"Downloading software..."),content:B},onClose:f,isDismissable:!1}})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
-----
DollyDeviceDiagnosticDownloadModalQuery.graphql",["DollyDeviceDiagnosticDownloadModalQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"serialNumber"}],c=[{kind:"Variable",name:"serial",variableName:"serialNumber"}],d={alias:null,args:null,kind:"ScalarField",name:"build_number",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"build_number_display_name",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"status_code",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"semantic_version",storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"DollyDeviceDiagnosticDownloadModalQuery",selections:[{alias:null,args:c,concreteType:"XFBFirmwareOTALatestBuildInfo",kind:"LinkedField",name:"xfb_list_webusb_device_latest_build_query",plural:!1,selections:[{kind:"RequiredField",field:d,action:"THROW",path:"xfb_list_webusb_device_latest_build_query.build_number"},{kind:"RequiredField",field:e,action:"THROW",path:"xfb_list_webusb_device_latest_build_query.build_number_display_name"},{kind:"RequiredField",field:f,action:"THROW",path:"xfb_list_webusb_device_latest_build_query.url"},{kind:"RequiredField",field:g,action:"THROW",path:"xfb_list_webusb_device_latest_build_query.status_code"},{kind:"RequiredField",field:h,action:"THROW",path:"xfb_list_webusb_device_latest_build_query.semantic_version"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"DollyDeviceDiagnosticDownloadModalQuery",selections:[{alias:null,args:c,concreteType:"XFBFirmwareOTALatestBuildInfo",kind:"LinkedField",name:"xfb_list_webusb_device_latest_build_query",plural:!1,selections:[d,e,f,g,h],storageKey:null}]},params:{id:b("DollyDeviceDiagnosticDownloadModalQuery_facebookRelayOperation"),metadata:{},name:"DollyDeviceDiagnosticDownloadModalQuery",operationKind:"query",text:null}}}();e.exports=a}),null);
-----
DollyDeviceDiagnosticDownloadModalQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="24039225842381903"}),null);
-----
-----
DollyDeviceDiagnosticDownloadModalQuery.graphql",["DollyDeviceDiagnosticDownloadModalQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"serialNumber"}],c=[{kind:"Variable",name:"serial",variableName:"serialNumber"}],d={alias:null,args:null,kind:"ScalarField",name:"build_number",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"build_number_display_name",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"status_code",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"semantic_version",storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"DollyDeviceDiagnosticDownloadModalQuery",selections:[{alias:null,args:c,concreteType:"XFBFirmwareOTALatestBuildInfo",kind:"LinkedField",name:"xfb_list_webusb_device_latest_build_query",plural:!1,selections:[{kind:"RequiredField",field:d,action:"THROW",path:"xfb_list_webusb_device_latest_build_query.build_number"},{kind:"RequiredField",field:e,action:"THROW",path:"xfb_list_webusb_device_latest_build_query.build_number_display_name"},{kind:"RequiredField",field:f,action:"THROW",path:"xfb_list_webusb_device_latest_build_query.url"},{kind:"RequiredField",field:g,action:"THROW",path:"xfb_list_webusb_device_latest_build_query.status_code"},{kind:"RequiredField",field:h,action:"THROW",path:"xfb_list_webusb_device_latest_build_query.semantic_version"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"DollyDeviceDiagnosticDownloadModalQuery",selections:[{alias:null,args:c,concreteType:"XFBFirmwareOTALatestBuildInfo",kind:"LinkedField",name:"xfb_list_webusb_device_latest_build_query",plural:!1,selections:[d,e,f,g,h],storageKey:null}]},params:{id:b("DollyDeviceDiagnosticDownloadModalQuery_facebookRelayOperation"),metadata:{},name:"DollyDeviceDiagnosticDownloadModalQuery",operationKind:"query",text:null}}}();e.exports=a}),null);
-----
DollyDeviceDiagnosticDownloadModalQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="24039225842381903"}),null);
-----