let e = require(`electron`);
console.log(`Preload script loaded`), e.contextBridge.exposeInMainWorld(`api`, {
  auth: {
    login: (t, n, r) => e.ipcRenderer.invoke(`auth:login`, t, n, r),
    refresh: () => e.ipcRenderer.invoke(`auth:refresh`),
    logout: () => e.ipcRenderer.invoke(`auth:logout`)
  },
  profiles: {
    get: () => e.ipcRenderer.invoke(`profiles:get`)
  },
  game: {
    launch: t => {
      e.ipcRenderer.invoke(`game:launch`, t)
    },
    launchComputeDownload: t => e.ipcRenderer.on(`game:launch_compute_download`, e => t()),
    launchDownload: t => e.ipcRenderer.on(`game:launch_download`, (e, n) => t(n)),
    downloadProgress: t => e.ipcRenderer.on(`game:download_progress`, (e, n) => t(n)),
    downloadError: t => e.ipcRenderer.on(`game:download_error`, (e, n) => t(n)),
    downloadEnd: t => e.ipcRenderer.on(`game:download_end`, (e, n) => t(n)),
    launchInstallLoader: t => e.ipcRenderer.on(`game:launch_install_loader`, (e, n) => t(n)),
    launchExtractNatives: t => e.ipcRenderer.on(`game:launch_extract_natives`, e => t()),
    extractProgress: t => e.ipcRenderer.on(`game:extract_progress`, (e, n) => t(n)),
    extractEnd: t => e.ipcRenderer.on(`game:extract_end`, (e, n) => t(n)),
    launchCopyAssets: t => e.ipcRenderer.on(`game:launch_copy_assets`, e => t()),
    copyProgress: t => e.ipcRenderer.on(`game:copy_progress`, (e, n) => t(n)),
    copyEnd: t => e.ipcRenderer.on(`game:copy_end`, (e, n) => t(n)),
    launchPatchLoader: t => e.ipcRenderer.on(`game:launch_patch_loader`, e => t()),
    patchProgress: t => e.ipcRenderer.on(`game:patch_progress`, (e, n) => t(n)),
    patchError: t => e.ipcRenderer.on(`game:patch_error`, (e, n) => t(n)),
    patchEnd: t => e.ipcRenderer.on(`game:patch_end`, (e, n) => t(n)),
    launchCheckJava: t => e.ipcRenderer.on(`game:launch_check_java`, e => t()),
    javaInfo: t => e.ipcRenderer.on(`game:java_info`, (e, n) => t(n)),
    launchClean: t => e.ipcRenderer.on(`game:launch_clean`, e => t()),
    cleanProgress: t => e.ipcRenderer.on(`game:clean_progress`, (e, n) => t(n)),
    cleanEnd: t => e.ipcRenderer.on(`game:clean_end`, (e, n) => t(n)),
    launchLaunch: t => e.ipcRenderer.on(`game:launch_launch`, (e, n) => t(n)),
    launched: t => e.ipcRenderer.on(`game:launched`, e => t()),
    launchData: t => e.ipcRenderer.on(`game:launch_data`, (e, n) => t(n)),
    launchClose: t => e.ipcRenderer.on(`game:launch_close`, (e, n) => t(n)),
    launchDebug: t => e.ipcRenderer.on(`game:launch_debug`, (e, n) => t(n)),
    patchDebug: t => e.ipcRenderer.on(`game:patch_debug`, (e, n) => t(n))
  },
  server: {
    getStatus: (t, n) => e.ipcRenderer.invoke(`server:status`, t, n)
  },
  news: {
    getNews: () => e.ipcRenderer.invoke(`news:get_news`),
    getCategories: () => e.ipcRenderer.invoke(`news:get_categories`)
  },
  background: {
    get: () => e.ipcRenderer.invoke(`background:get`)
  },
  maintenance: {
    get: () => e.ipcRenderer.invoke(`maintenance:get`)
  },
  bootstraps: {
    check: () => e.ipcRenderer.invoke(`bootstraps:check`),
    download: () => e.ipcRenderer.invoke(`bootstraps:download`),
    install: () => e.ipcRenderer.invoke(`bootstraps:install`),
    downloadProgress: t => e.ipcRenderer.on(`bootstraps:download_progress`, (e, n) => t(n)),
    downloadEnd: t => e.ipcRenderer.on(`bootstraps:download_end`, (e, n) => t(n)),
    error: t => e.ipcRenderer.on(`bootstraps:error`, (e, n) => t(n))
  },
  settings: {
    get: () => e.ipcRenderer.invoke(`settings:get`),
    set: t => e.ipcRenderer.invoke(`settings:set`, t),
    pickJava: () => e.ipcRenderer.invoke(`settings:pick_java`)
  },
  system: {
    getInfo: () => e.ipcRenderer.invoke(`system:info`)
  }
});