"use strict";(self.webpackChunkdami=self.webpackChunkdami||[]).push([[6877],{6877:(s,e,t)=>{t.r(e),t.d(e,{default:()=>n});var o=t(93150),i=t.n(o),r=t(31263);const n=function({data:s,id:e}){const t=this.getBlockConnections(e);return new Promise(((e,o)=>{s.clearProxy&&i().proxy.settings.clear({});const n={mode:"fixed_servers",rules:{singleProxy:{scheme:s.scheme},bypassList:(0,r.cb)(s.bypassList)?[]:s.bypassList.split(",")}};let l=s.port;if((0,r.cb)(s.host)){if(s.clearProxy)return this.engine.isUsingProxy=!1,void e({data:"",nextBlockId:t});const i=new Error("invalid-proxy-host");return i.nextBlockId=t,void o(i)}{let e=s.host;if(/^https?|socks4|socks5/i.test(s.host)){let[t,o]=s.host.split(/:\/\/(.*)/);o.includes(":")&&([o,l]=o.split(":")),e=o,n.rules.singleProxy.scheme=t}n.rules.singleProxy.host=e}l&&!Number.isNaN(+l)&&(n.rules.singleProxy.port=+l),chrome.proxy.settings.set({value:n,scope:"regular"},(()=>{this.engine.isUsingProxy=!0,e({data:s.host,nextBlockId:t})}))}))}}}]);