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/1.0.663/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : C:/Program Files/Avast Software/Avast/gui_resources/1.0.663/Tuneup.js
//{"name":"Tuneup","version":"1.2.691","created":"2021-09-06T10:52:54.498Z"}
import t from"./ractive.js";import{EventEmitter as e,eventer as s,napiTracker as n,serviceRequest as a,moduleManager as i}from"./napi.js";import{productModel as l,ipmService as r}from"./napiExtensions.js";import{format as o}from"./i18n.js";function c(t,e){return t?t.reduce((function(t,s){return t+s[e]}),0):0}function p(t){const e=t.split(/(?=[A-Z])|\./);let s="";return e.forEach((function(t,n){s.length&&(e[n-1].length>1||t.length>1)&&(2!==t.length||"s"!==t[1])&&(s+=" "),s+=t})),s[0].toUpperCase()+s.slice(1)}const u={regCleanup:"RegCleanup",diskCleanup:"DiskCleanup",fixProblems:"FixProblems",softwareCleanup:"SoftwareCleanup",programDeactivator:"ProgramDeactivator"},d={installed:"installed",installing:"installing",notInstalled:"notInstalled",error:"error"},_={notScanned:"not_scanned",scanning:"scanning",scanned:"scanned",error:"error"},h={statusChanged:"statusChanged",installStateChanged:"installStateChanged",licenseChanged:"licenseChanged",installFinished:"installFinished"};const g=new class extends e{constructor(){super(),this.EVENTS=h,this.INSTALL_STATES=d,this.SCAN_STATES=_,this.installInProgress=!1,this.resultSeen=this.getResultSeen(),this.scanStopped=this.isScanStopped(),this._installState=null,this._statusData=null,this._items=null,s.on("tuneup.onStatusChanged",this._statusChangeHandler.bind(this)),s.on("tuneup.onInstallStateChanged.started",this._installStateChangeHandler.bind(this,d.installing)),s.on("tuneup.onInstallStateChanged.finished",this._installStateChangeHandler.bind(this,d.installed)),s.on("tuneup.onInstallStateChanged.failed",this._installStateChangeHandler.bind(this,d.error)),s.on("app.avast.lis.install.event",(t=>{"finish"===t.step&&this.getInstallState("avast").then((t=>{this._installStateChangeHandler(t)}))})),s.on("app.avg.lis.install.event",(t=>{"finish"===t.step&&this.getInstallState("avg").then((t=>{this._installStateChangeHandler(t)}))}))}destroy(){this._installState=null,this._statusData=null,this._items=null,this.removeAllListeners()}startScan(){return this._setScanStopped(!1),n.event("Cleanup","Scan"),a("app.tuneup.Scan")}stopScan(){return a("app.tuneup.Stop").then((()=>{this._setScanStopped(!0)}))}getInstallState(t="avast"){return this._isInstalled(t).then((t=>(this._installState=t?d.installed:d.notInstalled,this._installState)))}isLicensed(){return l.isLicensed("ais_cmp_cleanup")}getIssuesCount(t){let e=0;return e+=t.regCleanup?1:0,e+=t.diskCleanup?1:0,e+=t.fixProblems?t.fixProblems.length:0,e+=t.programDeactivator?t.programDeactivator.length:0,e}getStatus(){return this._statusData?Promise.resolve(this._statusData):this._loadStatus()}getSmartScanItems(t){return t?(this._statusData=this._adjustStatusData(t.data),this._loadItems()):a("app.smartScan.GetIssues","scanTuneup").then((t=>(this._statusData=this._adjustStatusData(t.issues),this._loadItems())))}getItems(){return this.getStatus().then((()=>this._loadItems()))}installCleanup(t="avast",e={}){if(!this._installPromise){const s=()=>delete this._installPromise;this._installPromise=i.importModule("MyLicenses","licenses").then((t=>t())).then((s=>{const n="avg"===t.toLowerCase()?"tuneup":"cleanup";return e.walletKey?s.installProduct(n,{walletKey:e.walletKey}):s.installBestProductOf(n)})).then((()=>{s(),this._installStateChangeHandler(d.installing)})).catch(s)}return this._installPromise}openCleanup(){return n.event("Cleanup","Open"),a("app.utils.ExecuteCleanupStandalone").catch((()=>a("app.openapp.ui",{id:"tu"})))}_isInstalled(t){const e="avg"===(t=t.toLowerCase())?"tu":"cleanup";return a("app."+t+".lis.get.install",{}).then((t=>Boolean(t&&t.products&&t.products[e]&&t.products[e].installed))).catch((e=>(console.error("app."+t+".lis.get.install",JSON.stringify(e)),!1)))}_loadStatus(){return a("app.tuneup.GetStatus").then((t=>(this._statusData=this._adjustStatusData(t),this._statusData)))}_loadItems(){this._items={};const t=[];return Object.keys(u).filter((e=>{if(this._statusData&&this._statusData.pluginStates[e]===_.scanned)return t.push(this._loadPluginItems(e)),!0})),t.length?Promise.all(t).then((()=>this._items)).catch((()=>Promise.reject())):Promise.resolve(this._items)}_loadPluginItems(t){return this._statusData.pluginStates[t]===_.scanned?a("app.tuneup.GetItems",{plugin:u[t]}).then((e=>this._adjustItems(t,e).then((e=>(this._items[t]=e,this._items[t]))))):Promise.reject()}_statusChangeHandler(t){this._statusData=this._adjustStatusData(t),this._statusData.state===_.scanned?this._loadItems().then((()=>{this.emit(h.statusChanged,this._statusData)})).catch((()=>{this.emit(h.statusChanged,this._statusData)})):this.emit(h.statusChanged,this._statusData)}_installStateChangeHandler(t){this._installState=t,this.emit(h.installStateChanged,this._installState)}_adjustStatusData(t){const e={state:t.state,progress:t.progress&&t.progress.percent,pluginStates:{}};if(t.plugins){let s,n;for(s in u)n=t.plugins[u[s]],e.pluginStates[s]=n?n.state:_.notScanned}return e}_adjustItems(t,e){const s=[];let n;switch(t){case"fixProblems":if(e){const t=/^FixProblems_([a-zA-Z0-9]*)_.*/;let n,a;e.forEach((e=>{n=e.title&&t.exec(e.title.id),a=n&&n[1],a&&s.push({id:a,name:p(a),parameter:e.title.params})}))}break;case"diskCleanup":e&&e.categories&&e.categories.forEach((t=>{const e=new RegExp("^DiskCleanup_"),n={id:t.id,name:p(t.id.replace(e,"")),count:0,size:0};t.subcategories&&t.subcategories.forEach((function(t){n.count+=t.count,n.size+=t.size})),s.push(n)})),s.sort((function(t,e){return e.size-t.size}));break;case"regCleanup":e&&e.categories&&e.categories.forEach((t=>{t.subcategories&&t.subcategories.forEach((t=>{const e={name:t.title,count:t.count};t.items&&t.items.length&&(e.items=[],t.items.forEach((t=>{e.items.push(t.fileName)}))),s.push(e)}))}));break;case"programDeactivator":if(e){const t=[];e.forEach((e=>{const s={name:e.title,impact:e.impact&&e.impact.percent};if(e.icon){const n=this._getIconData(e.icon.path).then((t=>(s.icon=t,s)));t.push(n)}else t.push(Promise.resolve(s))})),n=Promise.all(t).then((function(t){return t.sort((function(t,e){return e.impact-t.impact}))}))}break;case"softwareCleanup":if(e&&e.SoftwareList){let t,n;for(t in e.SoftwareList)n=e.SoftwareList[t],n.rating&&n.rating<=2&&s.push({name:n.name,rating:n.rating,stars:Math.round(2*n.rating)/2,iconPath:n.icon})}s.sort((function(t,e){return t.rating-e.rating}))}return n||Promise.resolve(s)}_getIconData(t){return a("app.utils.GetShellIcon",{path:t,size:"large"}).then((t=>t.data)).catch((e=>{console.error("app.utils.GetShellIcon - "+t,JSON.stringify(e))}))}isScanStopped(){return"1"===window.localStorage.getItem("cleanupPp_scanStopped")}_setScanStopped(t){t?window.localStorage.setItem("cleanupPp_scanStopped","1"):window.localStorage.removeItem("cleanupPp_scanStopped")}getResultSeen(){return"1"===window.localStorage.getItem("cleanupPp_resultSeen")}unmarkResultAsSeen(){window.localStorage.removeItem("cleanupPp_resultSeen"),this.resultSeen=!1}markResultAsSeen(){window.localStorage.setItem("cleanupPp_resultSeen","1"),this.resultSeen=!0}};const f=t.extend({template:{v:3,t:[{t:4,f:[{t:7,e:"div",a:{class:["row ",{t:2,x:{r:["clickable"],s:'_0?"-hoverable":""'}}]},v:{click:{n:"showIssueDetails",d:[{t:2,r:"sectionId"}]}},f:[{t:7,e:"div",a:{class:"row__icon"},f:[{t:7,e:"div",a:{slot:"icon"},f:[{t:7,e:"div",a:{class:"cpp_issue__icon"},f:[{t:7,e:"Icon",a:{name:["cleanup-",{t:2,x:{r:["sectionId"],s:"_0.toLowerCase()"}}]}}," ",{t:7,e:"kin-icon",a:{name:"badge-critical",size:"16",class:"cpp_issue__sub-icon"}}]}]}]}," ",{t:7,e:"div",a:{class:"row__main"},f:[{t:7,e:"div",a:{slot:"main-content"},f:[{t:7,e:"div",f:[{t:3,x:{r:["nls","sectionId"],s:'_0("cleanuppp."+_1+".title")'}},": ",{t:7,e:"span",a:{class:"color-critical -text"},f:[{t:2,r:"issueInfo"}]}]}," ",{t:7,e:"p",a:{class:"p -small -secondary"},f:[{t:3,x:{r:["nls","sectionId","itemSum"],s:'_0("cleanuppp.ss2."+_1+".desc",_2)'}}]}]}]}," ",{t:4,f:[{t:7,e:"kin-button",a:{size:"small",type:"blank",icononly:"true",class:"row__more",title:[{t:2,x:{r:["nls","sectionId"],s:'_0("cleanuppp."+_1+".title")'}},": ",{t:2,r:"issueInfo"}," - ",{t:2,x:{r:["nls"],s:'_0("global.details")'}}]},v:{click:{n:"showItemDetails",d:[{t:2,r:"sectionId"}]}},f:[{t:7,e:"kin-icon",a:{name:"icon-s-controls-arrow-right",size:"16",rtlflip:"true"}}]}],n:50,r:"clickable"}]}],n:50,r:"itemSum"}]},data:()=>({sectionId:null,items:null,clickable:!0,issueInfo:null,itemSum:null}),oninit(){this.observe("items",this._onItemsChanged.bind(this))},_onItemsChanged(t){t=t||[];let e;switch(this.get("sectionId")){case"diskCleanup":e=t.length,this.set("issueInfo",o.formatBytes(c(t,"size")));break;case"fixProblems":e=t.length,this.set("issueInfo",e);break;case"regCleanup":e=c(t,"count"),this.set("issueInfo",e);break;case"programDeactivator":e=t.length,this.set("issueInfo",e)}this.set("itemSum",e)}}),m=t.extend({template:{v:3,t:[{t:4,f:[{t:7,e:"Overlay",a:{txt:["{close:'",{t:2,x:{r:["nls"],s:'_0("global.close")'}},"'}"],title:[{t:2,x:{r:["nls","sectionId"],s:'_1&&_0("cleanuppp."+_1+".title")'}}]},f:[{t:7,e:"h2",a:{class:"h2 -margins"},f:[{t:3,x:{r:["nls","sectionId"],s:'_1&&_0("cleanuppp."+_1+".title")'}},": ",{t:7,e:"span",a:{class:"color-critical -text"},f:[{t:2,x:{r:["getIssueInfo","sectionId"],s:"_0(_1)"}}]}]}," ",{t:7,e:"p",a:{class:"p g-margin-bottom--30"},f:[{t:3,x:{r:["nls","sectionId","items.length"],s:'_1&&_0("cleanuppp.ss2."+_1+".desc",_2)'}}]}," ",{t:8,x:{r:["getOverviewPartial","sectionId"],s:"_0(_1)"}}]}],n:50,r:"sectionId"}," "],p:{diskCleanupOverview:[{t:7,e:"table",a:{class:"table -no-border -small"},f:[{t:7,e:"tr",f:[{t:7,e:"th",f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.tableHeader.name")'}}]}," ",{t:7,e:"th",a:{class:"table__actions"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.tableHeader.items")'}}]}," ",{t:7,e:"th",a:{class:"table__actions"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.tableHeader.size")'}}]}]}," ",{t:4,f:[{t:7,e:"tr",f:[{t:7,e:"td",f:[{t:2,r:"name"}]}," ",{t:7,e:"td",a:{class:"table__actions"},f:[{t:2,r:"count"}]}," ",{t:7,e:"td",a:{class:"table__actions"},f:[{t:3,x:{r:["nls","formatBytes","size"],s:'_0("cleanuppp.diskCleanup.sizeFound",_1(_2))'}}]}]}],n:52,r:"items"}]}],fixProblemsOverview:[{t:7,e:"table",a:{class:"table -no-border"},f:[{t:4,f:[{t:7,e:"tr",f:[{t:7,e:"td",a:{class:"cpp_table__icon text -secondary"},f:[{t:7,e:"Icon",a:{name:["cleanup-",{t:2,r:"id"}]}}]}," ",{t:7,e:"td",f:[{t:7,e:"p",a:{class:"p"},f:[{t:4,f:[{t:3,x:{r:["nls","id","."],s:'_0("cleanuppp.fixProblems."+_1+".title",_2)'}}],i:"i",r:"parameter"}," ",{t:4,f:[{t:3,x:{r:["nls","id"],s:'_0("cleanuppp.fixProblems."+_1+".title")'}}],n:51,r:"parameter"}]}," ",{t:7,e:"p",a:{class:"p -small -secondary"},f:[{t:3,x:{r:["nls","id"],s:'_0("cleanuppp.fixProblems."+_1+".desc")'}}]}]}]}],n:52,r:"items"}]}],programDeactivatorOverview:[{t:7,e:"table",a:{class:"table"},f:[{t:7,e:"tr",f:[{t:7,e:"th"}," ",{t:7,e:"th",f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.programDeactivator.name")'}}]}," ",{t:7,e:"th",a:{class:"cpp_table__heat"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.programDeactivator.slowdownSeverity")'}}]}]}," ",{t:4,f:[{t:7,e:"tr",f:[{t:7,e:"td",a:{class:"cpp_table__icon"},f:[{t:7,e:"ImgIcon",a:{src:["data:image/png;base64,",{t:2,r:"icon"}]}}]}," ",{t:7,e:"td",f:[{t:2,r:"name"}]}," ",{t:7,e:"td",a:{class:"cpp_table__heat"},f:[{t:7,e:"kin-tooltip",f:[{t:7,e:"div",a:{slot:"tooltip-activator"},f:[{t:7,e:"Progress",a:{percentage:[{t:2,r:"impact"}],heat:0}}]}," ",{t:7,e:"div",a:{slot:"tooltip"},f:[{t:2,r:"impact"},"%"]}]}]}]}],n:52,r:"items"}]}],regCleanupOverview:[{t:7,e:"table",a:{class:"table -no-border -small"},f:[{t:7,e:"tr",f:[{t:7,e:"th",f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.tableHeader.name")'}}]}," ",{t:7,e:"th",a:{class:"table__actions"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.tableHeader.items")'}}]}]}," ",{t:4,f:[{t:7,e:"tr",f:[{t:7,e:"td",f:[{t:7,e:"button",v:{click:{m:"toggle",a:{r:["index"],s:'["items."+_0+".expanded"]'}}},a:{class:"cpp_table__button"},m:[{t:4,f:['title="',{t:3,x:{r:["nls"],s:'_0("global.clickToExpand")'}},'"'],n:50,x:{r:["items","items.length"],s:"_0&&_1"}},{t:4,n:51,f:['disabled="true"'],x:{r:["items","items.length"],s:"_0&&_1"}}],f:[{t:7,e:"Icon",a:{name:[{t:4,f:["chevron-down"],n:50,x:{r:["items","items.length"],s:"_0&&_1"}},{t:4,n:51,f:["cleanup-regcleanup"],x:{r:["items","items.length"],s:"_0&&_1"}}],cssCls:["cpp_registry__icon",{t:4,f:[" g-rotate--180"],n:50,x:{r:["expanded","items","items.length"],s:"_0&&_1&&_2"}}]}}," ",{t:7,e:"span",a:{class:"cpp_registry__name"},f:[{t:2,r:"name"}]}]}]}," ",{t:7,e:"td",a:{class:"table__actions"},f:[{t:7,e:"span",a:{class:"color-danger -text"},f:[{t:2,r:"count"}]}]}]}," ",{t:4,f:[{t:4,f:[{t:7,e:"tr",f:[{t:7,e:"td",a:{colspan:"2",class:"cpp_table__expanded"},f:[{t:7,e:"Icon",a:{name:"cleanup-regcleanup",cssCls:"cpp_registry__icon"}}," ",{t:7,e:"span",a:{class:"cpp_registry__name"},f:[{t:2,r:"."}]}]}]}],n:52,r:"items"}],n:50,x:{r:["expanded","items","items.length"],s:"_0&&_1&&_2"}}],n:52,i:"index",r:"items"}]}]}},data:function(){return{sectionId:void 0,items:void 0,getOverviewPartial:function(t){return t+"Overview"},getItemSum:c,getIssueInfo:this.getIssueInfo,formatBytes:o.formatBytes}},oninit(){n.event("Smart Scan 2.0","Detail",this.get("sectionId")),this.on("Overlay.close",(()=>{this.fire("hideIssueDetails")}))},getIssueInfo(t){const e=this.get("items");switch(t){case"diskCleanup":return o.formatBytes(c(e,"size"));case"fixProblems":case"programDeactivator":return e.length;case"regCleanup":return c(e,"count")}}}),S=l.getProductId(),b={avast:"cleanup",avg:"tu"},x=t.extend({template:{v:3,t:[{t:7,e:"View",a:{csscls:"-center",loading:[{t:2,r:"loading"}],actionbar:"true"},f:[{t:7,e:"div",a:{slot:"description"},f:[{t:7,e:"h1",a:{class:"h1 kin_scan__title","data-test":"ss_scanTuneup_title"},f:[{t:3,x:{r:["nls","issuesCount"],s:'_0("cleanuppp.ss2.results.title",_1)'}}]}," ",{t:7,e:"p",a:{class:"kin_scan__subtitle"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.ss2.smartscan.subtitle")'}}]}]}," ",{t:7,e:"div",a:{slot:"view-content",class:"kin_scan__list"},f:[{t:4,f:[{t:7,e:"IssueItem",a:{sectionId:"diskCleanup",items:[{t:2,r:"items.diskCleanup"}]}}," ",{t:7,e:"IssueItem",a:{sectionId:"regCleanup",items:[{t:2,r:"items.regCleanup"}]}}," ",{t:7,e:"IssueItem",a:{sectionId:"programDeactivator",items:[{t:2,r:"items.programDeactivator"}]}}," ",{t:7,e:"IssueItem",a:{sectionId:"fixProblems",items:[{t:2,r:"items.fixProblems"}]}}],n:50,r:"items"}," ",{t:4,f:[{t:7,e:"IssueDetails",a:{sectionId:[{t:2,r:"openedSectionId"}],items:[{t:2,rx:{r:"items",m:[{t:30,n:"openedSectionId"}]}}]}}],n:50,r:"openedSectionId"}]}," ",{t:7,e:"div",a:{slot:"view-actions"},f:[{t:4,f:[{t:4,f:[{t:7,e:"div",f:[{t:7,e:"kin-button",a:{size:"small","data-test":"ss_scanTuneup_skip"},v:{click:{n:"issuesSkip",a:[!0]}},f:[{t:3,x:{r:["nls"],s:'_0("global.skipForNow")'}}]}," ",{t:7,e:"kin-button",a:{size:"small",type:"secondary",class:"g-margin-left--5","data-test":"ss_scanTuneup_resolve"},v:{click:"issuesResolve"},f:[{t:3,x:{r:["nls"],s:'_0("global.resolveAll")'}}]}]}],n:50,r:"ipmOpened"},{t:4,n:51,f:[{t:7,e:"div",f:[{t:7,e:"kin-button",a:{size:"small","data-test":"ss_scanTuneup_resolve"},v:{click:"issuesResolve"},f:[{t:3,x:{r:["nls"],s:'_0("global.resolveAll")'}}]}]}," ",{t:7,e:"div",a:{class:"kin_actions__right"},f:[{t:7,e:"button",a:{class:"a","data-test":"ss_scanTuneup_skip"},v:{click:"issuesSkip"},f:[{t:3,x:{r:["nls"],s:'_0("global.skipForNow")'}}]}]}],r:"ipmOpened"}],n:50,x:{r:["loading"],s:"!_0"}}]}]}]},components:{IssueItem:f,IssueDetails:m},data:function(){return{issueItems:null,ipmOpened:!1,ipmBuyId:null,pscr:null,openedSectionId:null}},computed:{issuesCount:function(){const t=this.get("issueItems");return null==t?0:g.getIssuesCount(t)},loading:function(){return null==this.get("issueItems")}},oninit(){this.listeners=[];null==this.get("issueItems")&&g.getSmartScanItems().then((t=>{this.set({issueItems:t})})),this.on("issuesResolve",(()=>{const t=this.get("ipmBuyId")??207,e=this.get("pscr");e?r.openWindow(t,{p_scr:e}):r.openWindow(t),setTimeout((()=>{this.set("ipmOpened",!0)}),2e3),this.addInstallListeners()})),this.on("IssueItem.showIssueDetails",((t,e)=>{this.set("openedSectionId",e)})),this.on("IssueDetails.hideIssueDetails",(()=>{this.set("openedSectionId",null)}))},addInstallListeners(){const t=b[S];this.listeners.push(s.on("app."+S+".lis.install.event",(e=>{e&&"finish"===e.step&&a("app."+S+".lis.get.install",{ids:[t]}).then((e=>{e&&e.products&&e.products[t].installed&&this.fire("productPurchased",t)}))})))},onteardown(){this.listeners.forEach((t=>{t()}))}}),I=t.extend({template:{v:3,t:[{t:4,f:[{t:7,e:"kin-loading",a:{label:[{t:2,x:{r:["nls"],s:'_0("global.loading")'}}],fullscreen:"true"}}],n:50,r:"loading"},{t:4,n:51,f:[{t:4,f:[{t:7,e:"div",a:{class:"kin_scan__result cpp_scan__result"},f:[{t:7,e:"kin-icon",a:{name:"circle-critical",class:"kin_scan__icon",size:"96"}}," ",{t:7,e:"h1",a:{class:"h1 kin_scan__title"},f:[{t:3,x:{r:["nls"],s:'_0("smartscan.ss2.scanStopped.title")'}}]}," ",{t:7,e:"p",a:{class:"kin_scan__subtitle"},f:[{t:3,x:{r:["nls"],s:'_0("smartscan.ss2.scanStopped.subtitle")'}}]}]}," ",{t:7,e:"div",a:{class:"kin_scan__actions"},f:[{t:7,e:"kin-button",v:{click:"startScanAgain"},a:{"data-test":"scn_scanAgain"},f:[{t:3,x:{r:["nls"],s:'_0("smartscan.ss2.scanStopped.scanAgain")'}}]}," ",{t:7,e:"kin-button",a:{type:"secondary",class:"g-margin-left--10","data-test":"scn_back"},v:{click:"return"},f:[{t:3,x:{r:["nls"],s:'_0("global.goBack")'}}]}]}],n:50,r:"scanStopped"},{t:4,n:51,f:[{t:4,n:50,x:{r:["scanState","SCAN_STATES.scanned","resultSeen"],s:"_0===_1&&!_2"},f:[{t:4,f:[{t:7,e:"div",a:{class:"kin_scan__result cpp_scan__result"},f:[{t:7,e:"kin-icon",a:{name:"circle-ok",class:"kin_scan__icon",size:"96"}}," ",{t:7,e:"h1",a:{class:"h1 kin_scan__title","data-test":"ss_scanTuneup_titleEmpty"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.ss2.noIssues.title")'}}]}," ",{t:7,e:"p",a:{class:"kin_scan__subtitle"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.ss2.noIssues.subtitle")'}}]}]}," ",{t:7,e:"div",a:{class:"kin_scan__actions"},f:[{t:7,e:"kin-button",v:{click:"skipEmpty"},a:{"data-test":"ss_scanTuneup_next"},f:[{t:4,f:[{t:2,x:{r:["nls"],s:'_0("global.done")'}}],n:50,x:{r:["emptyCta"],s:'_0==="done"'}},{t:4,n:51,f:[{t:2,x:{r:["nls"],s:'_0("global.next")'}}],x:{r:["emptyCta"],s:'_0==="done"'}}]}]}],n:50,x:{r:["issueCount"],s:"_0===0"}},{t:4,n:51,f:[{t:4,n:50,x:{r:["issueCount"],s:"_0>0"},f:[{t:7,e:"IssuesList",a:{ipmBuyId:"343",pscr:"cleanup",issueItems:[{t:2,r:"items"}]}}]}],x:{r:["issueCount"],s:"_0===0"}}]},{t:4,n:50,x:{r:["SCAN_STATES.scanned","resultSeen","scanState","SCAN_STATES.scanning"],s:"(!(_2===_0&&!_1))&&(_2===_3)"},f:[" ",{t:7,e:"View",f:[{t:7,e:"div",a:{slot:"view-content"},f:[{t:7,e:"div",a:{class:"kin_page-content -scan"},f:[{t:7,e:"div",a:{class:"kin_scan -fullscreen"},f:[{t:7,e:"div",a:{class:"kin_scan__progress"},f:[{t:7,e:"kin-progress",a:{percentage:[{t:2,r:"scanProgress"}],dotted:"true"}}]}," ",{t:7,e:"div",a:{class:"kin_scan__subtitle -overlay"},f:[{t:2,x:{r:["nls","subtitleText"],s:"_0(_1)"}}]}," ",{t:7,e:"div",a:{class:"kin_scan__actions"},f:[{t:7,e:"kin-button",a:{type:"secondary"},v:{click:"stopScan"},f:[{t:2,x:{r:["nls"],s:'_0("global.stopScan")'}}]}]}]}]}]}]}]}],r:"scanStopped"}],r:"loading"},{t:4,f:[{t:7,e:"Modal",a:{title:[{t:2,x:{r:["nls"],s:'_0("scans.leaveModal.title")'}}],subtitle:[{t:2,x:{r:["nls"],s:'_0("scans.leaveModal.desc")'}}]},f:[{t:7,e:"div",a:{class:"modal__actions"},f:[{t:7,e:"kin-button",v:{click:"done"},a:{type:"critical"},f:[{t:2,x:{r:["nls"],s:'_0("scans.leaveModal.ignore")'}}]}," ",{t:7,e:"kin-button",a:{type:"secondary",class:"g-margin-left--5"},v:{click:"Modal.close"},f:[{t:2,x:{r:["nls"],s:'_0("scans.leaveModal.dontExit")'}}]}]}]}],n:50,x:{r:["modalDialog"],s:'_0==="confirmLeaveModal"'}},{t:4,f:[{t:7,e:"Modal",a:{title:[{t:2,x:{r:["nls"],s:'_0("scans.skipModal.title")'}}],subtitle:[{t:2,x:{r:["nls"],s:'_0("scans.skipModal.desc")'}}]},f:[{t:7,e:"div",a:{class:"modal__actions"},f:[{t:7,e:"kin-button",v:{click:"done"},a:{type:"critical"},f:[{t:2,x:{r:["nls"],s:'_0("global.skip")'}}]}," ",{t:7,e:"kin-button",a:{type:"secondary",class:"g-margin-left--5"},v:{click:"Modal.close"},f:[{t:2,x:{r:["nls"],s:'_0("scans.skipModal.dontSkip")'}}]}]}]}],n:50,x:{r:["modalDialog"],s:'_0==="confirmSkipModal"'}}]},css:".cpp_issue__icon {\n  position: relative;\n  width: 4rem;\n  height: 4rem;\n  border-radius: 4rem;\n  font-size: 2.4rem;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  background-color: var(--ds-on-background-light);\n}\n.cpp_issue__sub-icon {\n  position: absolute;\n  bottom: -1px;\n  right: -1px;\n}\ntd.cpp_table__icon {\n  font-size: 28px;\n  padding-right: 0;\n  width: 42px;\n  text-align: left;\n}\ntd.cpp_table__expanded {\n  padding-left: 32px;\n}\n.cpp_table__button {\n  display: block;\n  width: 100%;\n  text-align: left;\n}\n.cpp_table__button:enabled {\n  cursor: pointer;\n}\ntd.cpp_table__heat {\n  width: 40%;\n  padding-right: 0;\n  position: relative;\n}\ntd.cpp_table__heat kin-tooltip {\n  display: block;\n}\n.cpp_registry__icon {\n  font-size: 20px;\n  float: left;\n}\n.cpp_registry__name {\n  display: block;\n  margin-left: 30px;\n  word-break: break-all;\n}\n.cpp_rating__stars {\n  position: absolute;\n  z-index: 1;\n  min-width: 100px;\n  height: 1em;\n}\n.cpp_progress {\n  width: 300px;\n  margin-left: auto;\n  margin-right: auto;\n}\n.cpp_scan__result {\n  margin-bottom: 13rem;\n}\n",components:{IssuesList:x},data:function(){return{scanProgress:0,issueCount:void 0,SCAN_STATES:g.SCAN_STATES,scanStopped:g.isScanStopped(),resultSeen:!0,scanState:void 0,loading:!0,modalDialog:null}},computed:{subtitleText(){const t=["tuneup.regCleanup.scanningFor","tuneup.diskCleanup.scanningFor","tuneup.fixProblems.scanningFor","tuneup.softwareCleanup.scanningFor","tuneup.programDeactivator.scanningFor"],e=100/t.length;return t[Math.floor(this.get("scanProgress")/e)]}},onconstruct(){this._scanStatus=[{id:"tuneup",progress:0,issueCount:0,title:"Cleanup++"}]},oninit(){this.observe("scanState",(t=>{this.fire("update",t)})),this.observe("scanStopped",(t=>{this.fire("scanStopped",t)})),this.on("startScan",this.startScan.bind(this)),this.on("startScanAgain",this.startScanAgain.bind(this)),this.on("IssuesList.issuesResolve",this.resolveIssues.bind(this)),this.on("IssuesList.issuesSkip skipEmpty",this.skipIssues.bind(this)),this.on("stopScan",this.stopScan.bind(this)),this.on("return",this.return.bind(this)),g.getStatus().then(this.updateStatus.bind(this)),this.statusChangedListener=g.on(g.EVENTS.statusChanged,this.updateStatus.bind(this)),this._backClickBind=this.backClicked.bind(this),window.addEventListener("backClick",this._backClickBind),this.on("Modal.close",(()=>{this.set("modalDialog",null)})),this.on("done",(()=>{this.fire("skip"),this.updateResultSeen(!0)}))},updateStatus(t){this.set({loading:!1,resultSeen:g.getResultSeen(),scanState:t.state,scanProgress:t.progress}),t.state===g.SCAN_STATES.scanned?this.updateItems():this.updateResultSeen(!1)},startScanAgain(){this.startScan()},startScan(){g.getStatus().then((t=>{(t.state===g.SCAN_STATES.notScanned||t.state===g.SCAN_STATES.scanned&&g.getResultSeen()||g.isScanStopped())&&(this.updateResultSeen(!1),this.set({scanStopped:!1,scanProgress:0,scanState:g.SCAN_STATES.scanning}),g.startScan())}))},updateItems(){g.getItems().then((t=>{this.set({items:t,issueCount:g.getIssuesCount(t)})})).catch((t=>{console.error(t)}))},updateResultSeen(t){t?g.markResultAsSeen():g.unmarkResultAsSeen(),this.set("resultSeen",t),this.fire("resultSeen",t)},resolveIssues(){this.fire("resolve"),this.updateResultSeen(!0)},skipIssues(){this.get("issueCount")?this.set("modalDialog","confirmSkipModal"):(this.fire("skip"),this.updateResultSeen(!0))},backClicked(){const t=this.get("scanState")===g.SCAN_STATES.scanning;this.get("issueCount")&&!t&&!g.isScanStopped()?this.set("modalDialog","confirmLeaveModal"):(this.fire("skip"),t||this.updateResultSeen(!0))},stopScan(){g.stopScan().then((()=>{this.fire("stop"),this.set("scanStopped",!0)}))},return(){this.updateResultSeen(!0),this.fire("goBack"),this.set("scanStopped",!1)},onteardown(){this.statusChangedListener(),window.removeEventListener("backClick",this._backClickBind),this._backClickBind=null}}),v=t.extend({template:{v:3,t:[{t:7,e:"Page",a:{heading:[{t:2,x:{r:["hideHeading","nls"],s:'_0?"":_1("cleanuppp")'}}],cssCls:"cpp -center-header -center-all",backHash:"#performance"},f:[{t:7,e:"div",a:{slot:"breadcrumbs"},f:[{t:7,e:"Crumbs",a:{customBreadcrumbs:["[{title: ",{t:3,x:{r:["nls"],s:'_0("performance")'}},", url : '#performance', section: true}, {title: ",{t:3,x:{r:["nls"],s:'_0("cleanuppp")'}},", url: '#CleanupPp'}]"]}}]}," ",{t:7,e:"div",a:{slot:"page-content"},f:[{t:4,f:[{t:7,e:"Scan",a:{emptyCta:"done"}}],n:50,r:"showScan"},{t:4,n:51,f:[{t:7,e:"View",f:[{t:7,e:"div",a:{slot:"view-content"},f:[{t:4,f:[{t:7,e:"div",a:{class:"cpp_page"},f:[{t:7,e:"OfflinePage"}]}],n:50,r:"showOfflinePage"},{t:4,n:51,f:[{t:4,f:[{t:7,e:"section",a:{class:"nui_icon-page"},f:[{t:7,e:"kin-icon",a:{name:"icon-m-tools-cleanup",size:"200",class:"kin_view__icon"}}," ",{t:7,e:"h2",a:{class:"h2 -margins"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.installed.title")'}}]}," ",{t:7,e:"p",a:{class:"p g-margin-bottom--30"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.installed.desc")'}}]}," ",{t:7,e:"kin-button",a:{size:"large"},v:{click:"openCleanup"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.openCleanup")'}}]}]}],n:50,x:{r:["installState","INSTALL_STATES.installed"],s:"_0===_1"}},{t:4,n:51,f:[{t:4,n:50,x:{r:["installState","INSTALL_STATES.installing"],s:"_0===_1"},f:[{t:7,e:"section",a:{class:"nui_icon-page"},f:[{t:7,e:"kin-icon",a:{name:"icon-m-tools-cleanup",size:"200",class:"kin_view__icon"}}," ",{t:7,e:"h2",a:{class:"h2 -margins"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.installing.title")'}}]}," ",{t:7,e:"p",a:{class:"p g-margin-bottom--30"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.installing.desc")'}}]}," ",{t:7,e:"Progress",a:{percentage:"unknown",cssCls:"-standalone cpp_progress"}}]}]},{t:4,n:50,x:{r:["INSTALL_STATES.installing","installState","INSTALL_STATES.notInstalled"],s:"(!(_1===_0))&&(_1===_2)"},f:[" ",{t:4,f:[{t:7,e:"section",a:{class:"nui_icon-page"},f:[{t:7,e:"kin-icon",a:{name:"icon-m-tools-cleanup",size:"200",class:"kin_view__icon color-disabled -text"}}," ",{t:7,e:"h2",a:{class:"h2 -margins"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.install.title")'}}]}," ",{t:7,e:"p",a:{class:"p g-margin-bottom--30"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.install.desc")'}}]}," ",{t:7,e:"kin-button",a:{size:"large",processing:[{t:2,r:"isInstallInProgress"}],"kin-disabled":[{t:2,r:"isInstallInProgress"}]},v:{click:"install"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.install")'}}]}]}],n:50,r:"isLicensed"},{t:4,n:51,f:[{t:7,e:"section",a:{class:"nui_icon-page"},f:[{t:7,e:"kin-icon",a:{name:"icon-m-tools-cleanup",size:"200",class:"kin_view__icon color-disabled -text"}}," ",{t:7,e:"h2",a:{class:"h2 -margins"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.notInstalled.title")'}}]}," ",{t:7,e:"p",a:{class:"p g-margin-bottom--30"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.notInstalled.desc")'}}]}," ",{t:7,e:"kin-button",a:{size:"large"},v:{click:"startScan"},f:[{t:2,x:{r:["nls"],s:'_0("global.scanNow")'}}]}]}],r:"isLicensed"}]}],x:{r:["installState","INSTALL_STATES.installed"],s:"_0===_1"}}],r:"showOfflinePage"}]}]}],r:"showScan"}]}]}]},css:".cpp_page {\n  height: 95%;\n}\n.cpp_actions {\n  position: absolute;\n  bottom: 0;\n  left: 0;\n  right: 0;\n  text-align: center;\n  height: 50px;\n}\n.cpp_loader {\n  padding-top: 0;\n  height: 375px;\n}\n.cpp_loader__container {\n  width: 21vw;\n  height: 21vw;\n  font-size: 10px;\n}\ntd.cpp_table__icon {\n  font-size: 28px;\n  padding-right: 0;\n  width: 42px;\n  text-align: left;\n}\ntd.cpp_table__expanded {\n  padding-left: 32px;\n}\n.cpp_table__button {\n  display: block;\n  width: 100%;\n  text-align: left;\n}\n.cpp_table__button:enabled {\n  cursor: pointer;\n}\ntd.cpp_table__heat {\n  width: 40%;\n  padding-right: 0;\n  position: relative;\n}\n.cpp_registry__icon {\n  font-size: 20px;\n  float: left;\n}\n.cpp_registry__name {\n  display: block;\n  margin-left: 30px;\n  word-break: break-all;\n}\n.cpp_rating__stars {\n  position: absolute;\n  z-index: 1;\n  min-width: 100px;\n  height: 1em;\n}\n.cpp_progress {\n  width: 300px;\n  margin-left: auto;\n  margin-right: auto;\n}\n",components:{Scan:I},data:function(){return{INSTALL_STATES:g.INSTALL_STATES,SCAN_STATES:g.SCAN_STATES,installState:null,scanState:null,items:null,online:navigator.onLine,isLicensed:null,resultSeen:g.getResultSeen(),isInstallInProgress:g.installInProgress}},computed:{showOfflinePage(){return!this.get("online")&&this.get("installState")===g.INSTALL_STATES.notInstalled&&!this.get("isLicensed")},showScan(){return this.get("online")&&this.get("installState")===g.INSTALL_STATES.notInstalled&&!this.get("isLicensed")&&(this.get("scanState")===g.SCAN_STATES.scanning||this.get("scanState")===g.SCAN_STATES.scanned&&!this.get("resultSeen"))},hideHeading(){return this.get("showScan")&&this.get("scanState")!==g.SCAN_STATES.scanning}},oninit(){this.onlineListener=this.onConnectivityChanged.bind(this,!0),this.offlineListener=this.onConnectivityChanged.bind(this,!1),g.on(g.EVENTS.statusChanged,(t=>{this.set({scanState:t.state})})),window.addEventListener("online",this.onlineListener),window.addEventListener("offline",this.offlineListener),g.on(g.EVENTS.installStateChanged,this.updateInstallState.bind(this)),g.on(g.EVENTS.licenseChanged,(t=>{this.set("isLicensed",t)})),this.set("isLicensed",g.isLicensed()),this.on("startScan",(()=>{g.startScan()})),this.on("openCleanup",g.openCleanup.bind(g)),this.on("install",(()=>this.installCleanup())),this.on("Scan.resultSeen",(t=>{this.set("resultSeen",t)})),new Promise((function(t,e){let s=0;g.getInstallState().then((e=>{t(e)})).catch((()=>{this.checkingServiceIntervalId=setInterval((()=>{g.getInstallState().then((e=>{t(e)})).catch((t=>{s<=40?s++:(clearInterval(this.checkingServiceIntervalId),delete this.checkingServiceIntervalId,e(t))}))}),1e3)}))})).then(this.updateInstallState.bind(this)).catch((t=>{console.error("ERROR",t),this.screenError(t.description)}))},installCleanup(){this.get("isInstallInProgress")||(n.event("Cleanup","Install"),this.set({isInstallInProgress:!0}),g.installCleanup())},onteardown(){g.destroy(),null!=this.checkingServiceIntervalId&&clearInterval(this.checkingServiceIntervalId),window.removeEventListener("online",this.onlineListener),window.removeEventListener("offline",this.offlineListener)},updateInstallState(t){this.set("installState",t),t===g.INSTALL_STATES.error?this.screenError():t===g.INSTALL_STATES.notInstalled&&g.getStatus().then((t=>{console.log(t),this.set({scanState:t.state,resultSeen:g.getResultSeen()})}))},onConnectivityChanged(t){this.set("online",t)}});const k=t.extend({template:{v:3,t:[{t:4,f:[{t:7,e:"div",a:{class:"kin_scan__result"},f:[{t:7,e:"h1",a:{class:"h1 smr_progress__title","data-test":"ss_scanTuneup_progress"},f:[{t:3,x:{r:["nls","scannerData.progress"],s:'_0("cleanuppp.ss2.progress.title",_1)'}}]}," ",{t:7,e:"p",a:{class:"kin_scan__subtitle"},f:[{t:8,r:"partial_progress_component"}]}]}," ",{t:7,e:"div",a:{class:"kin_scan__actions"},f:[{t:7,e:"kin-button",a:{type:"secondary","data-test":"ss_scanTuneup_stop"},v:{click:"stop"},f:[{t:3,x:{r:["nls"],s:'_0("global.stopScan")'}}]}]}],n:50,x:{r:["scannerData.status"],s:'_0!=="done"'}},{t:4,n:51,f:[{t:4,n:50,x:{r:["scannerData.issuesCount"],s:"_0===0"},f:[{t:7,e:"div",a:{class:"kin_scan__result"},f:[{t:7,e:"h1",a:{class:"h1 kin_scan__title","data-test":"ss_scanTuneup_titleEmpty"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.ss2.noIssues.title")'}}]}," ",{t:7,e:"p",a:{class:"kin_scan__subtitle"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.ss2.noIssues.subtitle")'}}]}]}," ",{t:7,e:"div",a:{class:"kin_scan__actions"},f:[{t:7,e:"kin-button",v:{click:"next"},a:{"data-test":"ss_scanTuneup_next"},f:[{t:3,x:{r:["nls"],s:'_0("global.next")'}}]}]}]},{t:4,n:50,x:{r:["scannerData.issuesCount"],s:"!(_0===0)"},f:[" ",{t:7,e:"IssuesList"}]}],x:{r:["scannerData.status"],s:'_0!=="done"'}}],p:{partial_progress_component:[{t:4,f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.regCleanupEllipsis")'}}],n:50,x:{r:["scanners.scanTuneup.scannerProgress"],s:"_0<=25"}},{t:4,n:51,f:[{t:4,n:50,x:{r:["scanners.scanTuneup.scannerProgress"],s:"_0<=50"},f:[{t:3,x:{r:["nls"],s:'_0("cleanuppp.diskCleanupEllipsis")'}}]},{t:4,n:50,x:{r:["scanners.scanTuneup.scannerProgress"],s:"(!(_0<=50))&&(_0<=75)"},f:[" ",{t:3,x:{r:["nls"],s:'_0("cleanuppp.fixProblemsEllipsis")'}}]},{t:4,n:50,x:{r:["scanners.scanTuneup.scannerProgress"],s:"(!(_0<=50))&&(!(_0<=75))"},f:[" ",{t:3,x:{r:["nls"],s:'_0("cleanuppp.programDeactivatorEllipsis")'}}]}],x:{r:["scanners.scanTuneup.scannerProgress"],s:"_0<=25"}}]}},css:".cpp_issue__icon {\n  position: relative;\n  width: 4rem;\n  height: 4rem;\n  border-radius: 4rem;\n  font-size: 2.4rem;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  background-color: rgba(255,255,255,0.16);\n}\n.cpp_issue__sub-icon {\n  position: absolute;\n  bottom: -1px;\n  right: -1px;\n}\ntd.cpp_table__icon {\n  font-size: 28px;\n  width: 42px;\n  text-align: start;\n}\ntd.cpp_table__expanded {\n  padding-left: 32px;\n  padding-right: 32px;\n}\n.cpp_table__button {\n  display: block;\n  width: 100%;\n  text-align: start;\n}\n.cpp_table__button:enabled {\n  cursor: pointer;\n}\ntd.cpp_table__heat {\n  width: 40%;\n  padding-right: 0;\n  padding-left: 0;\n}\ntd.cpp_table__heat kin-tooltip,\ntd.cpp_table__heat kin-dropdown {\n  width: 100%;\n}\n.cpp_registry__icon {\n  font-size: 20px;\n  float: left;\n}\n.cpp_registry__name {\n  display: block;\n  margin-left: 30px;\n  margin-right: 30px;\n  word-break: break-all;\n}\n[dir='rtl'] .cpp_issue__sub-icon {\n  left: -1px;\n  right: auto;\n}\n[dir='rtl'] .cpp_registry__icon {\n  float: right;\n}\n",components:{IssuesList:x},scannerId:void 0,data:function(){return{loading:!1,items:null,issuesCount:0,ipmOpened:!1}},oninit(){n.view("SmartScan/Resolve/Tuneup"),this.on("next",(()=>{this.fire("nextScanner")})),this.on("IssuesList.issuesSkip",((t,e)=>{e?this.fire("nextScanner"):this.fire("skipScanner",{scannerId:this.scannerId})})),this.on("stop",(()=>{this.fire("stopScan")})),this.on("updateScannerData",(t=>{this.set("scannerData",{progress:t.progress,status:t.status,issuesCount:t.issuesCount}),"done"===t.status&&(n.ipm(372),t.issuesCount>0&&this._init())})),this.on("Item.showItemDetails",((t,e)=>{this.set("openedSectionId",e)})),this.on("ItemDetails.close",(()=>{this.set("openedSectionId",void 0)}))},_init(){this.set("loading",!0),g.getSmartScanItems().then((t=>{this.set({items:t,issuesCount:g.getIssuesCount(t),loading:!1})}))},finish(){this.fire("nextScanner"),this.fire("allIssuesResolved",this.scannerId)},onteardown(){g.destroy()}});export default v;export{f as IssueItem,I as PerformanceScan,g as ServiceProxy,k as SmartScanV2};const C={name:"Tuneup",version:"1.2.691",created:"2021-09-06T10:52:54.498Z"};export{C as metadata};