var m=Object.create;var a=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h(t))!T.call(e,o)&&o!==n&&a(e,o,{get:()=>t[o],enumerable:!(i=y(t,o))||i.enumerable});return e};var C=(e,t,n)=>(n=e!=null?m(u(e)):{},d(t||!e||!e.__esModule?a(n,"default",{value:e,enumerable:!0}):n,e)),v=e=>d(a({},"__esModule",{value:!0}),e);var w={};b(w,{default:()=>p});module.exports=v(w);var r=require("electron/main"),s=require("../../common/modules/client"),c=C(require("../../common/modules/l10n")),f=require("../modules/parent"),g=require("deepmerge-ts"),l=require("../modules/config");function P(){const e=(0,g.deepmerge)(l.appConfig.value.settings,new c.default().settings),t=e,n=Object.freeze({algolia:"Algolia",spotify:"Spotify",hcaptcha:"hCaptcha",paypal:"PayPal",audius:"Audius",gif:"Klipy",reddit:"Reddit",soundcloud:"SoundCloud",streamable:"Streamable",twitch:"Twitch",twitter:"Twitter",vimeo:"Vimeo",youtube:"YouTube",googleStorageApi:"Google Storage API"});return Object.entries(n).map(i=>{t.advanced?.cspThirdParty?.labels&&t.advanced.cspThirdParty.labels[i[0]]===void 0&&(t.advanced.cspThirdParty.labels[i[0]]=i[1])}),t.advanced?.cspThirdParty?.name!==void 0&&(t.advanced.cspThirdParty.name=e.advanced.csp.name+" \u2013 "+e.advanced.cspThirdParty.name),t}function p(e){const t=P(),n=Object.freeze([Object.freeze(["general",t.general]),Object.freeze(["privacy",t.privacy]),Object.freeze(["advanced",t.advanced])]);e.isVisible()||e.show();const i=(0,f.initWindow)("settings",e,{minWidth:s.appInfo.minWinWidth,minHeight:s.appInfo.minWinHeight});if(i!==void 0)return r.ipcMain.handle("settings-generate-html",o=>{if(!(o.senderFrame&&new URL(o.senderFrame.url).protocol!=="file:"))return i.isDestroyed()||i.show(),n}),i.once("closed",()=>{r.ipcMain.removeHandler("settings-generate-html")}),i}
