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/WebCam.js
//{"name":"WebCam","version":"1.2.236","created":"2021-03-10T09:13:39.302Z"}
import{eventer as e,napiTracker as t,windowApi as o,serviceRequest as s}from"./napi.js";import{logger as i}from"./libs.js";import{productModel as a,ipmService as n}from"./napiExtensions.js";import l from"./ractive.js";import{nls as c}from"./i18n.js";import{modals as d}from"./ractiveComponents.js";const r="ais_cmp_webcam",p={title:"webcamshield",desc:"webcamshield.settings.desc",modeLabel:"webcamshield.settings.mode.label",modeSmart:"webcamshield.settings.mode.smart",modeStrict:"webcamshield.settings.mode.strict",modeNoMercy:"webcamshield.settings.mode.noMercy",viewAllowedAndBlockedApps:"settings.viewAllowedAndBlockedApps"},m={mode:{id:"webcam-settings-mode",label:c(p.modeLabel)+":",options:[{label:c(p.modeSmart),value:1},{label:c(p.modeStrict),value:2},{label:c(p.modeNoMercy),value:3}],path:"webcam://webcam/common/mode",track:{subject:"Mode",valueMap:{1:"Smart",2:"Strict",3:"No mercy"}},search:{title:p.modeLabel,others:[p.modeSmart,p.modeStrict,p.modeNoMercy]}},allowedAndBlockedAppsLink:{id:"webcam_settings_allowedAndBlockedAppsLink",search:p.viewAllowedAndBlockedApps}},g=l.extend({template:{v:3,t:[{t:7,e:"Page",a:{heading:[{t:3,x:{r:["nls"],s:'_0("webcamshield")'}}],cssCls:"wcm",settingsUrl:"#Settings/WebCam",upsell:[{t:2,x:{r:["componentLicensed"],s:"!_0"}}],inactive:[{t:2,x:{r:["componentEnabled"],s:"!_0"}}],inactiveMsg:[{t:3,x:{r:["nls"],s:'_0("webcamshield.inactive.tooltip")'}}],backHash:"#privacy"},f:[{t:7,e:"div",a:{slot:"breadcrumbs"},f:[{t:7,e:"Crumbs",a:{customBreadcrumbs:["[{title: ",{t:3,x:{r:["nls"],s:'_0("privacy")'}},", url : '#privacy', section: true}, {title: ",{t:3,x:{r:["nls"],s:'_0("webcamshield")'}},", url: '#privacy/WebCam'}]"]}}]}," ",{t:7,e:"div",a:{slot:"controls"},f:[{t:7,e:"Switch",a:{attr:"{id:'wcm_switch'}",checked:[{t:2,r:"componentEnabled"}],preventToggle:"true",title:[{t:3,x:{r:["nls"],s:'_0("webcamshield")'}}]},v:{domClick:"toggleStatus"}}]}," ",{t:4,f:[{t:7,e:"div",a:{slot:"upsell"},f:[{t:7,e:"Upsell",a:{desc:[{t:3,x:{r:["nls"],s:'_0("upsell.desc.webcam")'}}],animation:[{t:2,r:"UPSELL_ANIMATION"}]}}]}],n:50,x:{r:["componentLicensed"],s:"!_0"}}," ",{t:7,e:"div",a:{slot:"page-content"},f:[{t:7,e:"kin-view",f:[{t:7,e:"div",a:{slot:"description"},f:[{t:7,e:"p",a:{class:"kin_description__text"},f:[{t:3,x:{r:["nls"],s:'_0("webcamshield.desc")'}}]}]}," ",{t:7,e:"div",a:{slot:"view-content"},f:[{t:7,e:"SvgIcon",a:{name:[{t:2,x:{r:["componentEnabled"],s:'_0?"webcam-on":"webcam-off"'}}],cssCls:"kin_view__icon"}}]}]}]}]}]},data:()=>({UPSELL_ANIMATION:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAACqCAMAAAAKqCSwAAAAjVBMVEUAAACruPSVq96TpdyNpNqOoteQo9eKn9SOotaVqeCMoNWMoNWMoNWLn9SLoNWMoNWMoNWModeLn9SLoNWNodaLn9WNn9aLn9SLoNWLn9SMn9WKn9SLn9SLn9SLn9SLn9SLn9SLn9SLn9SLn9WLn9SLn9SLn9SLn9WNo9eKn9SLn9SLn9SLn9SLn9SKntRxPm9nAAAALnRSTlMABAwQFiMb+SkIXEtXq0U/Oi3y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FIuoSpzmJYZ+KUD610Mh12AmOyGKLNViDZb6bysZhrWaqZg+Sq9GckUvcrAqgpIKw+GVQzBJgB3MwCvGoFThZBVFoyrF8gbDZJGRSyXCspyKVCbRGCVPr1xTIUOGSEfeeoz83uh7MwRWhRZ6FFkEEalytDc2QTmDDxzAoWcw1juIZELqOQGpnIJvqxhLTPYSg9mpkuvslxBjGsbux4LlHoMap6Bljtg5B7oSQxWEkCYDH6dFzpIUggSC9xEBy95ASf/TN/oy5f/0ze6LZgnGmu1rgAAAABJRU5ErkJggg==",componentEnabled:a.isEnabled(r),componentLicensed:a.isLicensed(r)}),oninit(){this.log=i.createLogger("webcam"),this.listeners=[],this.listeners.push(e.on("product.change.feature."+r,(e=>{this.set("componentEnabled",e.enabled),this.set("componentLicensed",e.licensed)}))),this.on("toggleStatus",((e,t)=>{t?d.stopOptions().then((e=>this._toggleStatus(e.time))).catch((()=>{this.log.info("no stop option selected.. doing nothing")})):a.isPassiveMode()?d.passiveMode().then((()=>this._toggleStatus())):this._toggleStatus()})),this.on("Upsell.init",(()=>{t.event("Upsell","View")})),this.on("Upsell.buy",(()=>{n.openWindow(343)}))},_toggleStatus:e=>a.toggleFeature(r,e).catch((e=>{console.error(`Toggling ${r} failed`,e)})),onteardown(){this.listeners.forEach((e=>e()))}}),h=i.createLogger("webcam.detectionDialog"),w=/[/|\\]/g,b="block",A="allow",S="ignore",f=l.components.DetectionDialog.extend({asyncLoad:!0,gaTrack:t,oninit:function(){this._super(),h.info("oninit"),this._data=this.getData(),this.set("config",this.getConfig()),window.setTimeout(this.ready.bind(this),0)},windowClose(e){o.broadcastEvent("settings.blockedAndAllowedApps.changed",{updateDelay:1e3}).finally((()=>{o.close(e)}))},getData(){const e=this.get("params.appname"),t=this.get("params.filename");return{appName:e?e.split(w).pop():"---",appPath:e,fileName:t?t.split(w).pop():"---",filePath:t}},getConfig(){h.info("getConfig");const e={icon:{name:"icon-l-webcam"},title:c("webcamshield.detected.title"),text:c("webcamshield.detected",this._data.appName,this._data.fileName),actionText:c("webcamshield.whatToDo"),actions:[],details:this.getDetails(),status:null,closeResponse:{returnCode:S},color:"red"};return e.actions.push({label:c("global.blockApp"),nextConfig:this.getBlockedConfig()}),e.actions.push({label:c("global.allowApp"),nextConfig:this.getAllowedConfig()}),e},getBlockedConfig(){return h.info("getting the blocked config"),{icon:{name:"icon-s-status-check"},title:c("webcamshield.appBlocked.title"),text:c("webcamshield.appBlocked.desc",this._data.appName,this._data.fileName),actionText:c("webcamshield.weAlwaysBlock"),actions:[{label:c("global.gotIt")}],details:this.getDetails(),status:{text:c("webcamshield.blocked")},closeResponse:{returnCode:b},color:"green"}},getAllowedConfig(){return h.info("getting the allowed config"),{icon:{name:"icon-s-status-check"},title:c("webcamshield.appAllowed.title"),text:c("webcamshield.appAllowed.desc",this._data.appName,this._data.fileName),actionText:c("webcamshield.weAlwaysAllow"),actions:[{label:c("global.gotIt")}],details:this.getDetails(),status:{text:c("webcamshield.allowed")},closeResponse:{returnCode:A},color:"green"}},getDetails(){return h.info("getting details"),[{title:c("global.appName"),value:this._data.appPath,testValue:"threatName"},{title:c("global.filePath"),value:this._data.filePath,testValue:"file"},{title:c("global.detectedBy"),value:c("webcamshield"),testValue:"detectedBy_WebcamShield"}]}}),u=i.createLogger("webcam.accessToaster"),L=l.extend({template:{v:3,t:[{t:7,e:"Toaster",a:{windowWidth:[{t:2,r:"windowWidth"}],windowHeight:[{t:2,r:"windowHeight"}],customContent:"true",autoResize:"true"},f:[{t:7,e:"p",a:{class:"toaster__text p -small"},f:[{t:4,f:[{t:3,x:{r:["nls","process"],s:'_0("webcamshield.appAllowed.desc",_1)'}}],n:50,r:"allowed"},{t:4,n:51,f:[{t:3,x:{r:["nls","process"],s:'_0("webcamshield.appBlocked.desc",_1)'}}],r:"allowed"}]}," ",{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("global.dontShowAgain")'}}]}]}]}]},data:function(){return{process:"",allowed:!0,windowWidth:360}},oninit:function(){this._super(),this.toasterCompo=this.findComponent("Toaster"),this.toasterCompo.windowClose=o.close,this.toasterCompo.gaTrack=t,this.on("Toaster.doAreaAction",(function(){u.info("opening webcam"),s("app.windowManager.ShowMainWindow",{route:"WebCam/settings"}).then((function(){o.close({reason:o.CLOSE_REASONS.navigateToOtherWindow})})).catch((function(e){u.error("opening webcam page failed",e)}))})),this.on("toggleSwitch",(function(e){const o=e.node.checked;t.event("Toaster","Click",o?"DontShowAgain":"ShowAgain"),this.set("switchDisabled",!0),s("app.windowManager.SetToasterVisibility",{visible:!o,id:"webcam_acccess_toaster"}).then((()=>{this.set("switchDisabled",!1)})).catch((()=>{e.node.checked=!o,this.set("switchDisabled",!1)}))}))}}),x={title:p.title,desc:p.desc,items:m},v=l.extend({template:{v:3,t:[{t:7,e:"SettingsContainer",a:{component:[{t:2,r:"component"}],ipmBuyElm:[{t:2,r:"ipmBuyElm"}],title:[{t:3,x:{r:["nls","STRINGS.title"],s:"_0(_1)"}}],desc:[{t:3,x:{r:["nls","STRINGS.desc"],s:"_0(_1)"}}],stopOptions:[{t:2,r:"stopOptions"}]},f:[{t:7,e:"SettingsSelect",a:{property:[{t:2,r:"properties.mode"}],labelSmall:0}}," ",{t:7,e:"div",a:{id:[{t:2,r:"properties.allowedAndBlockedAppsLink.id"},"__container"]},f:[{t:7,e:"SettingsWhiteAndBlackList"}]}]}]},data:()=>({STRINGS:p,component:r,ipmBuyElm:343,stopOptions:{},properties:m})});export default g;export{L as accessToaster,f as detection,v as settings,x as settingsSearchStrings};const C={name:"WebCam",version:"1.2.236",created:"2021-03-10T09:13:39.302Z"};export{C as metadata};