!function(){global.tip;var o=require("nw.gui").Window.get();o.setAlwaysOnTop(!0);var l=global.album;var t=new class{constructor(o){this.name=o.name,this.subAlbums=JSON.parse(JSON.stringify(o.subAlbums)),this.photographers=JSON.parse(JSON.stringify(o.photographers)),this.autoDownload=!0,this.autoUpload=!0,this.downloadAllSub=!o||void 0===o.downloadAllSub||o.downloadAllSub,this.downloadAllPhotographer=!o||void 0===o.downloadAllPhotographer||o.downloadAllPhotographer}updateDownloadFilter(o){o.subalbum&&(this.downloadAllSub=this.isDownloadAllSub()),o.photographer&&(this.downloadAllPhotographer=this.isDownloadAllPhotographer())}getDownloadSubs(){return this.subAlbums.filter(o=>o.download)}getDownloadPhotographers(){return this.photographers.filter(o=>o.download)}isDownloadAllSub(){return this.getDownloadSubs().length===this.subAlbums.length}isDownloadAllPhotographer(){return this.getDownloadPhotographers().length===this.photographers.length}toggleSelectDownloadAllSub(o){this.isDownloadAllSub()?this.subAlbums.forEach(o=>{o.download=!1}):this.subAlbums.forEach(o=>{o.download=!0})}toggleSelectDownloadAllPhotographer(o){this.isDownloadAllPhotographer()?this.photographers.forEach(o=>{o.download=!1}):this.photographers.forEach(o=>{o.download=!0})}}(l),e=new Vue({el:"#root",data:{album:t,showDownloadSubSelector:!1,showDownloadPhotographerSelector:!1},watch:{showDownloadSubSelector:o=>{o&&window.addEventListener("click",e.showSelectorEventListener)},showDownloadPhotographerSelector:o=>{o&&window.addEventListener("click",e.showSelectorEventListener)}},methods:{showSelectorEventListener:()=>{e.showDownloadSubSelector=!1,e.showDownloadPhotographerSelector=!1,window.removeEventListener("click",e.showSelectorEventListener)},confirm:t=>{l.subAlbums=e.album.subAlbums,l.photographers=e.album.photographers,l.autoDownload=e.album.autoDownload,l.autoUpload=e.album.autoUpload,l.updateDownloadFilter({subalbum:l.subAlbums,photographer:l.photographers}),l.hasSetDownloadFrom=!0,l.updateRecord(),o.close()},cancel:()=>{l.hasSetDownloadFrom=!0,l.updateRecord(),o.close()}}})}();