"use strict";(self.webpackChunkpasswords_webextension=self.webpackChunkpasswords_webextension||[]).push([[2393],{8962:(e,r,o)=>{o.d(r,{Z:()=>t});class t{async execute(e,r){console.trace("controller.execute() not implemented")}}},8823:(e,r,o)=>{o.r(r),o.d(r,{default:()=>g});var t=o(8962),a=o(9083),s=o(460),c=o(6567),l=o(8838),n=o(1842),i=o(7968);class g extends t.Z{async execute(e,r){let o=e.getPayload(),t=await this._getTheme(o);r.setType("server.theme").setPayload(t)}async _getTheme(e){let r=`server.${e}.theme`;if(s.Z.has(r))return s.Z.get(r);try{let o=await this._fetchThemeFromApi(e);return s.Z.set(r,o),o}catch(r){return c.Z.logError(r),await this._getDefaultTheme(e)}}async _fetchThemeFromApi(e){let r=(await a.Z.findById(e)).getInstance("repository.setting"),o=await r.findByScope("server"),t={};for(let e of o)"theme"===e.name.substr(0,5)&&(t[e.name.substring(6)]=e.value);return i.Z.processTheme(t)}async _getDefaultTheme(e){let r=await n.Z.findById(e);return i.Z.processTheme({"app.icon":await l.Z.getBrowserApi().runtime.getURL("img/favicon-fallback.svg"),background:`${r.getBaseUrl()}core/img/background.png`,logo:`${r.getBaseUrl()}core/img/logo/logo.svg`})}}},7968:(e,r,o)=>{o.d(r,{Z:()=>t});const t=new class{processTheme(e){let r={"--color-primary":"#0082c9","--color-text":"#ffffff","--image-background":"linear-gradient(40deg, #0082c9 0%, #30b6ff 100%)","--image-logo":"","--border-radius":"3px","--border-radius-large":"10px","--border-radius-pill":"100px"};return null===e||(e.hasOwnProperty("colors")&&(e.colors.hasOwnProperty("primary")&&(r["--color-primary"]=e.colors.primary),e.colors.hasOwnProperty("text")&&(r["--color-text"]=e.colors.text)),e.hasOwnProperty("color.primary")&&(r["--color-primary"]=e["color.primary"]),e.hasOwnProperty("color.text")&&(r["--color-text"]=e["color.text"]),e.hasOwnProperty("background")&&("#0082c9"!==r["--color-primary"]&&(r["--image-background"]=`linear-gradient(40deg,${r["--color-primary"]} 0%,${r["--color-text"]} 320%)`),r["--image-background"]=`url(${e.background}), ${r["--image-background"]}`),e.hasOwnProperty("logo")&&(r["--image-logo"]=`url(${e.logo})`)),r}}}}]);