Server : Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6
System : Windows NT USER-PC 6.1 build 7601 (Windows 7 Professional Edition Service Pack 1) AMD64
User : User ( 0)
PHP Version : 7.4.6
Disable Function : NONE
Directory :  C:/Program Files/Avast Software/Avast/gui_resources/default_av/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : C:/Program Files/Avast Software/Avast/gui_resources/default_av/System.js
//{"name":"System","version":"1.2.231","created":"2021-03-10T09:09:15.201Z"}
import t from"./ractive.js";import{windowApi as e,napiTracker as s,moduleManager as o,eventer as n,serviceRequest as i}from"./napi.js";import{settingsService as a,systemService as r,napiUtils as c,productModel as d,passwordService as l}from"./napiExtensions.js";import{nls as u}from"./i18n.js";const m=t.extend({}),p=t.extend({template:{v:3,t:[{t:7,e:"Toaster",a:{windowHeight:[{t:2,r:"windowHeight"}],windowWidth:[{t:2,r:"windowWidth"}],customContent:"true",title:[{t:2,x:{r:["nls"],s:'_0("system.toasters.deviceConnected.title")'}}],text:[{t:2,r:"driveName"}],autoResize:"true",",":0,icon:"icon-m-usb-stick"},f:[{t:7,e:"div",a:{class:"toaster__btns"},f:[{t:7,e:"p",f:[{t:7,e:"button",a:{class:"btn","data-test":"sys_deviceConnected_scan"},v:{click:"scan"},f:[{t:2,x:{r:["nls"],s:'_0("system.toasters.deviceConnected.scan")'}}]}]}," ",{t:4,f:[{t:7,e:"p",f:[{t:7,e:"button",a:{class:"a","data-test":"sys_deviceConnected_stopOffering"},v:{click:"stopOffering"},f:[{t:2,x:{r:["nls"],s:'_0("system.toasters.deviceConnected.stopOffering")'}}]}]}],n:50,r:"stopOfferingAllowed"}]}]}]},data:function(){return{driveName:null,windowWidth:450,autoResize:!0,stopOfferingAllowed:!1}},oninit:function(){this._super(),this.toasterCompo=this.findComponent("Toaster"),this.toasterCompo.windowClose=e.close,this.toasterCompo.gaTrack=s;const t=e.getUrlParams();this.set("driveName",t.desc),a.get("avcfg://settings/Common/ExternalDriveScanOffer").then((t=>{this.set("stopOfferingAllowed",!t.locked)})),this.on("scan",(function(){s.event("Toaster","Click","Scan"),o.importModule("Scans","serviceProxy").then((e=>e.getScanRoute({scanType:"folder",scanPath:t.path}))).then((t=>{if(!t)throw"no scan route";e.openMainWindow({route:t}).then((()=>{e.close()}))})).catch((()=>e.close()))})),this.on("stopOffering",(function(t,o){s.event("Toaster","Click","Stop offering"),a.set("avcfg://settings/Common/ExternalDriveScanOffer",0).finally((()=>{e.close()}))}))}}),g=t.extend({template:{v:3,t:[{t:7,e:"Toaster",a:{windowHeight:[{t:2,r:"windowHeight"}],windowWidth:[{t:2,r:"windowWidth"}],customContent:"true",title:[{t:3,x:{r:["nls"],s:'_0("system.toasters.restart.title")'}}],text:[{t:3,x:{r:["nls"],s:'_0("system.toasters.restart.text")'}}],autoResize:"true"},f:[{t:7,e:"div",a:{class:"toaster__btns"},f:[{t:7,e:"kin-button",v:{click:"restart"},a:{"data-test":"sys_restart"},f:[{t:3,x:{r:["nls"],s:'_0("system.toasters.restart.restartComputer")'}}]}," ",{t:7,e:"kin-dropdown",f:[{t:7,e:"kin-button",a:{type:"secondary",slot:"dropdown-activator"},f:[{t:3,x:{r:["nls"],s:'_0("system.toasters.restart.remindMeLater")'}}," ",{t:7,e:"kin-icon",a:{name:"icon-s-controls-arrow-down",size:"16",class:"g-margin-left--10"}}]}," ",{t:4,f:[{t:7,e:"kin-dropdown-item",v:{click:{n:"remindMeLater",d:[{t:2,r:"minutes"}]}},a:{"data-test":["sys_restart-remind-",{t:2,r:"minutes"}]},f:[{t:3,r:"title"}]}],n:52,r:"remindMeIn"}]}]}]}]},data:function(){return{remindMeIn:[{title:u("system.toasters.restart.remindMe.inXminutes",15),minutes:15},{title:u("system.toasters.restart.remindMe.inXhours",1),minutes:60},{title:u("system.toasters.restart.remindMe.tomorrow"),minutes:1440},{title:u("system.toasters.restart.remindMe.nextCentury"),minutes:0}],windowWidth:450,autoResize:!0}},oninit:function(){this._super(),this.toasterCompo=this.findComponent("Toaster"),this.toasterCompo.windowClose=e.close,this.toasterCompo.gaTrack=s,this.on("restart",(function(){s.event("Toaster","Click","Restart"),r.restart({rebootType:"RebootAfterUpdate"}),e.close()})),this.on("remindMeLater",(function(t,o){s.event("Toaster","Click","RemindMeLater"),r.showRestartDialog({delay:o}).finally((()=>e.close()))}))}}),w=1,h=2,f=3,b=12,v=14,x=18,y=19,_=t.extend({template:{v:3,t:[{t:7,e:"Toaster",a:{windowHeight:[{t:2,r:"windowHeight"}],windowWidth:[{t:2,r:"windowWidth"}],customContent:"true",title:[{t:3,r:"mainText"}],text:[{t:3,x:{r:["nls"],s:'_0("system.toasters.update.text")'}}],autoResize:"true",progress:"-1"},f:[]}]},data:function(){return{windowWidth:450,autoResize:!0,mainText:u("system.toasters.update.title")}},oninit:function(){this._super(),this.toasterCompo=this.findComponent("Toaster"),this.toasterCompo.windowClose=e.close,this.toasterCompo.gaTrack=s;const t=new URL(document.location).searchParams,o=+(t.get("newEdition")||-1);o<+(t.get("oldEdition")||-1)&&this.set({mainText:u("system.toasters.update.down.title",this.getEditionName(o))}),n.on("app.setup.ProgramUpdateFinished",(()=>{e.close()})),setTimeout((()=>{e.close()}),12e5)},getEditionName(t){switch(t){case w:return u("global.product.free_av");case h:return u("global.product.pro_av");case f:return u("global.product.suite");case b:return u(c.getProductStringId("premier"));case v:return u("global.product.business");case x:return u("global.product.business_soho");case y:return u("global.product.omni")}return u("global.product.free_av")}}),C=t.extend({template:{v:3,t:[{t:7,e:"Toaster",a:{windowWidth:[{t:2,r:"windowWidth"}],windowHeight:[{t:2,r:"windowHeight"}],customContent:"true",text:[{t:3,x:{r:["nls"],s:'_0("system.toasters.wrongTime.text")'}}],autoResize:"true"},f:[{t:7,e:"button",a:{class:"toaster__btn btn"},v:{click:"setCorrectTime"},f:[{t:3,x:{r:["nls"],s:'_0("system.toasters.wrongTime.setCorrectTime")'}}]}," ",{t:7,e:"div",a:{class:"toaster__footer"},f:[{t:7,e:"input",a:{type:"checkbox",id:"dontShowAgain",disabled:[{t:2,r:"switchDisabled"}],class:["checkbox -small ",{t:4,f:["-disabled"],n:50,r:"switchDisabled"}]},v:{click:"toggleSwitch"}}," ",{t:7,e:"label",a:{for:"dontShowAgain",class:"checkbox__label text -secondary -small"},f:[{t:3,x:{r:["nls"],s:'_0("system.toasters.wrongTime.dontShowAgain")'}}]}]}]}]},oninit:function(){this._super(),this.toasterCompo=this.findComponent("Toaster"),this.toasterCompo.windowClose=e.close,this.toasterCompo.gaTrack=s,this.on("setCorrectTime",(function(){s.event("Toaster","Click","SetCorrectTime"),i("app.system.SetCorrectTime"),e.close()})),this.on("toggleSwitch",(function(t){const e=t.node.checked;s.event("Toaster","Click",e?"DontShowAgain":"ShowAgain"),this.set("switchDisabled",!0),i("app.windowManager.SetToasterVisibility",{visible:!e,id:"wrong_time_toaster"}).then((()=>{this.set("switchDisabled",!1)})).catch((()=>{t.node.checked=!e,this.set("switchDisabled",!1)}))}))}}),T=t.extend({template:{v:3,t:[{t:7,e:"Titlebar",a:{minimizeIcon:"false",product:[{t:2,r:"product"}],title:[{t:2,r:"title"}],closeIconTitle:[{t:2,x:{r:["nls"],s:'_0("global.closeModalWindow")'}}],cssCls:"-toaster"}}," ",{t:7,e:"div",a:{class:"nui_main -toaster -full"},f:[{t:7,e:"h1",a:{class:"h2"},f:[{t:3,r:"text"}]}," ",{t:7,e:"div",a:{class:"toaster__btns g-margin-top--20"},f:[{t:7,e:"kin-button",v:{click:"restart"},a:{"data-test":"sys_restart"},f:[{t:3,x:{r:["nls"],s:'_0("system.toasters.restart.restartComputer")'}}]}," ",{t:4,f:[{t:7,e:"kin-dropdown",f:[{t:7,e:"kin-button",a:{type:"secondary",slot:"dropdown-activator"},f:[{t:3,x:{r:["nls"],s:'_0("system.toasters.restart.remindMeLater")'}}," ",{t:7,e:"kin-icon",a:{name:"icon-s-controls-arrow-down",size:"16",class:"g-margin-left--10"}}]}," ",{t:4,f:[{t:7,e:"kin-dropdown-item",v:{click:{n:"remindMeLater",d:[{t:2,r:"minutes"}]}},a:{"data-test":["sys_restart-remind-",{t:2,r:"minutes"}]},f:[{t:3,r:"title"}]}],n:52,r:"remindMeIn"}]}],n:50,r:"enablePostpone"}]}]}]},data:function(){return{remindMeIn:[{title:u("system.toasters.restart.remindMe.inXminutes",10),minutes:10},{title:u("system.toasters.restart.remindMe.inXhours",1),minutes:60},{title:u("system.toasters.restart.remindMe.inXhours",4),minutes:240},{title:u("system.toasters.restart.remindMe.inXhours",6),minutes:360},{title:u("system.toasters.restart.remindMe.tomorrow"),minutes:1440},{title:u("system.toasters.restart.remindMe.nextWeek"),minutes:10080},{title:u("system.toasters.restart.remindMe.nextCentury"),minutes:0}],windowWidth:600,windowHeight:300,autoResize:!0,product:"",productEx:"",isAfbManaged:d.isAfbManaged(),enablePostpone:!0}},computed:{title(){const t=this.get("productEx")||this.get("product");return u(c.getProductStringId(t))},text(){return this.get("isAfbManaged")?u("system.dialog.restart.businness.title"):u("system.dialog.restart.title")}},oninit:function(){this._super();const t=new URL(document.location).searchParams;this.set({enablePostpone:"1"!==t.get("no_postpone")}),d.update().then((()=>{this.set({product:d.getProduct(),productEx:d.getState().productEx,isAfbManaged:d.isAfbManaged()})})),this.on("*.closeWindow",(()=>{e.close()})),this.on("restart",(function(){s.event("Dialog","Click","Restart"),r.restart({rebootType:r.RESTART_TYPES.afterUpdate}),e.close()})),this.on("remindMeLater",(function(t,o){s.event("Dialog","Click","RemindMeLater"),r.showRestartDialog({delay:o}).finally((()=>e.close()))}))}}),k=["service","ini","uninstall","selfdef","password","component"],E=0,R=1,M=2,A=t.extend({template:{v:3,t:[{t:7,e:"Titlebar",a:{minimizeIcon:"false",product:[{t:2,r:"product"}],title:[{t:2,r:"title"}]}}," ",{t:7,e:"div",a:{class:"nui_page"},f:[{t:7,e:"div",a:{class:"center g-padding-left--20 g-padding-right--20"},f:[{t:7,e:"p",a:{class:"p g-margin-top--20"},f:[{t:2,r:"desc"}]}," ",{t:7,e:"p",a:{class:"p g-margin-top--20"},f:[{t:2,x:{r:["nls"],s:'_0("system.consent.question")'}}]}," ",{t:7,e:"p",a:{class:"p g-margin-top--10 g-margin-bottom--20"},f:[{t:2,x:{r:["nls"],s:'_0("system.consent.note")'}}]}," ",{t:7,e:"form",v:{submit:"validate"},f:[{t:4,f:[{t:7,e:"div",a:{class:"form__row -simple g-margin-toip--10"},f:[{t:7,e:"Input",a:{id:"pwd1",innerValue:[{t:2,r:"password"}],type:"password",label:[{t:2,x:{r:["nls"],s:'_0("global.dialog.enterPassword.inputLabel")'}}],error:[{t:2,x:{r:["passwordError"],s:"!!_0"}}],message:[{t:2,r:"passwordError"}],autofocus:0}}]}],n:50,x:{r:["type"],s:"_0==4"}}," ",{t:7,e:"div",a:{class:"toaster__btns"},f:[{t:7,e:"button",a:{class:"btn -secondary","data-test":"sys_consent_yes"},v:{click:"actionYes"},f:[{t:3,x:{r:["nls"],s:'_0("global.yes")'}}]}," ",{t:7,e:"button",a:{class:"btn -secondary","data-test":"sys_consent_no"},v:{click:"actionNo"},f:[{t:3,x:{r:["nls"],s:'_0("global.no")'}}," ",{t:7,e:"span",a:{style:"min-width:25px;display:inline-block;text-align:left"},f:[{t:2,r:"countdown"}]}]}]}]}]}]}]},data:function(){return{windowWidth:600,windowHeight:250,autoResize:!0,product:"",productEx:"",title:u("system.consent.general.title"),desc:u("system.consent.general.desc"),_countdown:60,intervalId:0,password:"",passwordError:"",type:3}},computed:{countdown(){const t=this.get("_countdown");return t<=0?"":"("+t+")"}},oninit:function(){this._super(),this.parseArgs(),d.update().then((()=>{this.set({product:d.getProduct(),productEx:d.getState().productEx})})),this.startCloseCountdown(),this.on("*.closeWindow",(()=>{this.cancel()})),this.on("actionYes",(function(){"password"!==k[this.get("type")]?(s.event("consentDialog","Click","Yes"),i("modalWindow.close",{action:R}),e.close()):this.validate()})),this.on("actionNo",(function(){s.event("consentDialog","Click","No"),this.cancel()})),this.on("validate",(t=>{t.original.preventDefault(),"password"===k[this.get("type")]?this.validate():this.fire("actionNo")}))},cancel(){"password"===k[this.get("type")]?i("modalWindow.close",{action:M}):i("modalWindow.close",{action:E}),e.close()},onteardown(){const t=this.get("intervalId");0!==t&&(window.clearInterval(t),this.set({intervalId:0}))},parseArgs(){const t=new URL(document.location).searchParams,e={flags:+t.get("flags"),filename:decodeURIComponent(t.get("filename")),param:decodeURIComponent(t.get("param"))},s=e.flags;this.set({title:u("system.consent."+k[s]+".title"),desc:u("system.consent."+k[s]+".desc"),type:s,windowHeight:"password"==k[s]?360:250}),"component"!==k[s]&&"password"!==k[s]||this.set({desc:u("system.consent."+k[s]+".desc",e.param)})},validate(){l.verifyPassword(this.get("password")).then((t=>{t?(i("modalWindow.close",{action:R}),e.close()):this.set({passwordError:u("global.dialog.enterPassword.invalidPassword")})}))},startCloseCountdown(){0==this.get("intervalId")&&this.set({intervalId:window.setInterval((()=>{let t=this.get("_countdown");t-- >0?this.set({_countdown:t}):this.cancel()}),1e3)})}}),I={OK:{text:u("global.ok"),value:1},CANCEL:{text:u("global.cancel"),value:2},ABORT:{text:u("global.abort"),value:3},RETRY:{text:u("global.retry"),value:4},IGNORE:{text:u("global.ignore"),value:5},YES:{text:u("global.yes"),value:6},NO:{text:u("global.no"),value:7},TRYAGAIN:{text:u("global.tryagain"),value:10},CONTINUE:{text:u("global.continue"),value:11}},N={name:"MB_OK",code:0,buttons:[I.OK]},S=[N,{name:"MB_ABORTRETRYIGNORE",code:2,buttons:[I.ABORT,I.RETRY,I.IGNORE]},{name:"MB_CANCELTRYCONTINUE",code:6,buttons:[I.CANCEL,I.TRYAGAIN,I.CONTINUE]},{name:"MB_OKCANCEL",code:1,buttons:[I.OK,I.CANCEL]},{name:"MB_RETRYCANCEL",code:5,buttons:[I.RETRY,I.CANCEL]},{name:"MB_YESNO",code:4,buttons:[I.YES,I.NO]},{name:"MB_YESNOCANCEL",code:3,buttons:[I.YES,I.NO,I.CANCEL]}],O=t.extend({template:{v:3,t:[{t:7,e:"Titlebar",a:{minimizeIcon:"false",product:[{t:2,r:"product"}],title:[{t:2,r:"title"}]}}," ",{t:7,e:"div",a:{class:"nui_page"},f:[{t:7,e:"div",a:{class:"center g-padding-left--20 g-padding-right--20"},f:[{t:7,e:"p",a:{class:"p g-margin-top--20 g-margin-bottom--20"},f:[{t:2,r:"desc"}]}," ",{t:7,e:"div",a:{class:"toaster__btns"},f:[{t:4,f:[{t:7,e:"button",a:{class:["btn ",{t:2,x:{r:["primaryBtn","@index"],s:'_0==_1?"-primary":"-secondary"'}}],"data-test":["sys_messagebox_btn",{t:2,r:"@index"}]},v:{click:"btnClick"},f:[{t:2,r:"text"}," ",{t:4,f:[{t:7,e:"span",a:{style:"min-width:25px;display:inline-block;text-align:left"},f:[{t:2,r:"countdown"}]}],n:50,x:{r:["countdownBtn","@index"],s:"_0==_1"}}]}],n:52,r:"buttons"}]}]}]}]},data:function(){return{windowWidth:550,windowHeight:250,autoResize:!0,product:"",productEx:"",title:"",icon:"",desc:"",buttons:[],_countdown:60,intervalId:0,primaryBtn:-1,countdownBtn:-1}},computed:{countdown(){const t=this.get("_countdown");return t<=0?"":"("+t+")"}},oninit:function(){this._super(),this.parseArgs(),d.update().then((()=>{this.set({product:d.getProduct(),productEx:d.getState().productEx})})),this.on("*.closeWindow",(()=>{this.cancel()})),this.on("btnClick",(t=>{s.event("messageBox","Click",String(t.context.value)),i("messageBox.close",{action:t.context.value}),e.close()}))},onteardown(){const t=this.get("intervalId");0!==t&&(window.clearInterval(t),this.set({intervalId:0}))},cancel(){i("messageBox.close",{action:I.CANCEL.value}),e.close()},parseArgs(){const t=new URL(document.location).searchParams;let e=decodeURIComponent(t.get("text"));const s=e.indexOf("\t");-1!=s&&(this.set({title:e.substring(0,s)}),e=e.substring(s+1));const o={text:e,type:(+t.get("type")).toString(16)%10,defaultBtn:+t.get("defaultBtn")-1,countdownBtn:+t.get("countdownBtn")-1},n=S.filter((t=>o.type==t.code));this.set({buttons:n[0].buttons||N.buttons,desc:o.text,icon:n.icon,primaryBtn:o.defaultBtn,countdownBtn:o.countdownBtn}),-1<o.countdownBtn&&this.startCloseCountdown()},startCloseCountdown(){0==this.get("intervalId")&&this.set({intervalId:window.setInterval((()=>{let t=this.get("_countdown");if(t-- >0)this.set({_countdown:t});else{const t=this.get("buttons")[this.get("countdownBtn")];t&&t.value?(i("messageBox.close",{action:t.value}),e.close()):this.cancel()}}),1e3)})}});export default m;export{A as consentDialog,p as deviceConnectedToaster,O as messageBox,T as restartDialog,g as restartToaster,_ as updateToaster,C as wrongTimeToaster};const B={name:"System",version:"1.2.231",created:"2021-03-10T09:09:15.201Z"};export{B as metadata};