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EAAO,GACxB","file":"/npm/hyper-transparent-bg@1.5.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/hyper-transparent-bg@1.5.2/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const electron = require('electron');\nconst { app } = electron;\nconst uuid = require('uuid');\nconst executeJavaScript = require('./lib/executeJavaScript');\nconst bg = require('./lib/bg');\n\nconst id = uuid.v4();\n\n// Default background effects\nlet transparentBgConfig = {\n  WebkitFilter: 'blur(5px)',\n  opacity: '0.3',\n};\n\n// Default backgroun color, just in case it's not set\nlet backgroundColor = '#000';\n\n// This throws an error for some reason... Letting that error die a silent death...\ntry {\n  // Enable capturing of the screen to set as the background\n  app.commandLine.appendSwitch('enable-blink-features', 'GetUserMedia');\n  app.commandLine.appendSwitch('enable-usermedia-screen-capturing');\n  app.commandLine.appendSwitch('max-gum-fps', '60');\n} catch (iDontKnowWhyThisIsAnError) {}\n\nexports.decorateConfig = config => {\n  if (config.backgroundColor) backgroundColor = config.backgroundColor;\n  if (config.transparentBg) {\n    transparentBgConfig = Object.assign(transparentBgConfig, config.transparentBg);\n  }\n\n  // Set background to be transparent to show video\n  const newConfig = Object.assign({}, config);\n  newConfig.backgroundColor = 'rgba(0, 0, 0, 0.1)';\n  return newConfig;\n};\n\nexports.onWindow = win => {\n\n  // Don't capture the console as part of the background\n  win.setContentProtection(true);\n\n  let screen;\n  const getScreen = location => electron.screen.getDisplayNearestPoint(location);\n\n  const update = event => {\n    const location = event.sender.getBounds();\n    const newScreen = getScreen(location);\n    if (screen.id !== newScreen.id) {\n      screen = newScreen;\n      executeJavaScript(event.sender, bg.video.update({ screen, video: { id } }));\n    }\n\n    bg.video.update({ screen, video: { id } });\n    executeJavaScript(event.sender, bg.position({ id, screen, location }));\n  };\n\n  win.webContents.on('dom-ready', () => {\n    const location = win.getBounds();\n    screen = getScreen(location);\n    executeJavaScript(\n      win,\n      bg.video.set({ screen, video: { id, style: transparentBgConfig, backgroundColor } }),\n      bg.position({ id, screen, location })\n    );\n    win.on('move', update);\n    win.on('resize', update);\n  });\n\n};\n"]}