text: !function(e){function t(t){for(var r,i,l=t[0],u=t[1],s=t[2],f=0,d=[];f<l.length;f++)i=l[f],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&d.push(o[i][0]),o[i]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);for(c&&c(t);d.length;)d.shift()();return a.push.apply(a,s||[]),n()}function n(){for(var e,t=0;t<a.length;t++){for(var n=a[t],r=!0,l=1;l<n.length;l++){var u=n[l];0!==o[u]&&(r=!1)}r&&(a.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},o={0:0},a=[];function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var l=window.webpackJsonp=window.webpackJsonp||[],u=l.push.bind(l);l.push=t,l=l.slice();for(var s=0;s<l.length;s++)t(l[s]);var c=u;a.push([47,1]),n()}([,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(i,l)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,a=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(i=0<(i=u.trys).length&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],a=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,a,i,l,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l},a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorageItem=function(e,t){return void 0===t&&(t=""),window.localStorage.getItem(e)||t},t.setLocalStorageItem=function(e,t){return window.localStorage.setItem(e,t)},t.removeLocalStorageItem=function(e){return window.localStorage.removeItem(e)},t.noop=function(){},t.to=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e];case 1:return[2,[t.sent(),null]];case 2:return[2,[null,t.sent()]];case 3:return[2]}}))}))},t.partition=function(e,t){var n,r,o=[],i=[];try{for(var l,u=a(e),s=u.next();!s.done;s=u.next())t(l=s.value)?o.push(l):i.push(l)}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return[o,i]}},,function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(129)),r(n(131)),r(n(132)),r(n(134)),r(n(136)),r(n(138)),r(n(139)),r(n(141)),r(n(143)),r(n(145)),r(n(147)),r(n(149)),r(n(151)),r(n(153)),r(n(155))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(57))},,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(i,l)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,a=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(i=0<(i=u.trys).length&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],a=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,a,i,l,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=i(n(58)),u=i(n(75)),s=n(4),c=n(11),f=n(76),d=n(77);function p(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.getInstance()];case 1:return[2,e.sent().get("configs")]}}))}))}function h(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.getInstance()];case 1:return[2,e.sent().get("version")]}}))}))}function v(){return r(this,void 0,void 0,(function(){var e,t,n,r;return o(this,(function(o){switch(o.label){case 0:return c.isClashX()?[4,c.jsBridge.getAPIInfo()]:[3,2];case 1:return[2,{hostname:(e=o.sent()).host,port:e.port,secret:e.secret}];case 2:if(t=s.getLocalStorageItem("externalControllerAddr","127.0.0.1"),n=s.getLocalStorageItem("externalControllerPort","9090"),r=s.getLocalStorageItem("secret",""),!t||!n)throw new Error("can't get hostname or port");return[2,{hostname:t,port:n,secret:r}]}}))}))}t.getInstance=f.createAsyncSingleton((function(){return r(void 0,void 0,void 0,(function(){var e,t,n,r;return o(this,(function(o){switch(o.label){case 0:return[4,v()];case 1:return e=o.sent(),t=e.hostname,n=e.port,r=e.secret,[2,l.default.create({baseURL:"//"+t+":"+n,headers:r?{Authorization:"Bearer "+r}:{}})]}}))}))})),t.getConfig=p,t.updateConfig=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,t.getInstance()];case 1:return[2,n.sent().patch("configs",e)]}}))}))},t.getRules=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.getInstance()];case 1:return[2,e.sent().get("rules")]}}))}))},t.updateRules=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.getInstance()];case 1:return[2,e.sent().put("rules")]}}))}))},t.getProxies=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.getInstance()];case 1:return[2,e.sent().get("proxies")]}}))}))},t.getProxy=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,t.getInstance()];case 1:return[2,n.sent().get("proxies/"+e)]}}))}))},t.getVersion=h,t.getProxyDelay=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,t.getInstance()];case 1:return[2,n.sent().get("proxies/"+e+"/delay",{params:{timeout:5e3,url:"http://www.gstatic.com/generate_204"}})]}}))}))},t.closeAllConnections=function(){return r(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.getInstance()];case 1:return[2,e.sent().delete("connections")]}}))}))},t.changeProxySelected=function(e,n){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,t.getInstance()];case 1:return[2,r.sent().put("proxies/"+e,{name:n})]}}))}))},t.getExternalControllerConfig=v,t.getLogsStreamReader=f.createAsyncSingleton((function(){return r(this,void 0,void 0,(function(){var e,t,n,r,i,l,c,f;return o(this,(function(o){switch(o.label){case 0:return[4,v()];case 1:return e=o.sent(),[4,p()];case 2:return t=o.sent().data,[4,s.to(h())];case 3:return n=a.apply(void 0,[o.sent(),2]),r=n[0],i=n[1],l=i?"unkonwn version":r.data.version,c=u.default.valid(l)&&u.default.gt(l,"v0.15.0-52-gc384693"),f=location.protocol+"//"+e.hostname+":"+e.port+"/logs?level="+t["log-level"],[2,new d.StreamReader({url:f,bufferLength:200,token:e.secret,useWebsocket:c})]}}))}))})),t.getConnectionStreamReader=f.createAsyncSingleton((function(){return r(this,void 0,void 0,(function(){var e,t,n,r,i,l,u;return o(this,(function(o){switch(o.label){case 0:return[4,v()];case 1:return e=o.sent(),[4,s.to(h())];case 2:return t=a.apply(void 0,[o.sent(),2]),n=t[0],r=t[1],i=r?"unkonwn version":n.data.version,l=!!i||!0,u=location.protocol+"//"+e.hostname+":"+e.port+"/connections",[2,new d.StreamReader({url:u,bufferLength:200,token:e.secret,useWebsocket:l})]}}))}))}))},function(e,t,n){"use strict";function r(){return"ClashX Runtime"===navigator.userAgent}Object.defineProperty(t,"__esModule",{value:!0}),t.isClashX=r,t.jsBridge=null;var o=function(){function e(e){var t=this;void 0===e&&(e=function(){}),this.instance=null,window.WebViewJavascriptBridge&&(this.instance=window.WebViewJavascriptBridge,e(this.instance)),this.initBridge((function(n){t.instance=n,e(n)}))}return e.prototype.initBridge=function(e){if(!r())return e(null);if(window.WebViewJavascriptBridge)return e(window.WebViewJavascriptBridge);if(window.WVJBCallbacks)return window.WVJBCallbacks.push(e);window.WVJBCallbacks=[e];var t=document.createElement("iframe");t.style.display="none",t.src="https://__bridge_loaded__",document.documentElement.appendChild(t),setTimeout((function(){return document.documentElement.removeChild(t)}),0)},e.prototype.callHandler=function(e,t){var n=this;return new Promise((function(r){n.instance.callHandler(e,t,r)}))},e.prototype.ping=function(){return this.callHandler("ping")},e.prototype.readConfigString=function(){return this.callHandler("readConfigString")},e.prototype.getPasteboard=function(){return this.callHandler("getPasteboard")},e.prototype.getAPIInfo=function(){return this.callHandler("apiInfo")},e.prototype.setPasteboard=function(e){return this.callHandler("setPasteboard",e)},e.prototype.writeConfigWithString=function(e){return this.callHandler("writeConfigWithString",e)},e.prototype.setSystemProxy=function(e){return this.callHandler("setSystemProxy",e)},e.prototype.getStartAtLogin=function(){return this.callHandler("getStartAtLogin")},e.prototype.getProxyDelay=function(e){return this.callHandler("speedTest",e)},e.prototype.setStartAtLogin=function(e){return this.callHandler("setStartAtLogin",e)},e.prototype.isSystemProxySet=function(){return this.callHandler("isSystemProxySet")},e}();t.JsBridge=o,t.setupJsBridge=function(e){return t.jsBridge?e(t.jsBridge):void(t.jsBridge=new o(e))}},,function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var i=n(78),l=n(79),u=n(0),s=n(4);t.useObject=function(e){var t=o(i.useImmer(e),2),n=t[0],l=t[1];return[n,function(e,t){"string"==typeof e?l((function(n){n[e]=t})):"function"==typeof e?l(e):"object"===r(e)&&l((function(t){var n,r,o=e;try{for(var i=a(Object.keys(o)),l=i.next();!l.done;l=i.next()){var u=l.value;t[u]=o[u]}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}))}]},t.useInterval=function(e,t){var n=u.useRef(s.noop);u.useEffect((function(){return n.current=e}),[e]),u.useEffect((function(){if(null!==t){var e=setInterval((function(){return n.current()}),t);return function(){return clearInterval(e)}}}),[t])},t.composeContainer=function(e){var t=l.createContainer((function(){return Object.keys(e).reduce((function(t,n){return t[n]=e[n](),t}),{})}));return{Provider:t.Provider,containers:Object.keys(e).reduce((function(e,n){return e[n]=function(){return t.useContainer()[n]},e}),{})}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o,a=r(n(38));(o=t.Action||(t.Action={})).SPEED_NOTIFY="speed-notify";var i=function(){function e(){this.EE=new a.default}return e.prototype.notifySpeedTest=function(){this.EE.emit(o.SPEED_NOTIFY)},e.prototype.subscribe=function(e,t){this.EE.addListener(e,t)},e.prototype.unsubscribe=function(e,t){this.EE.removeListener(e,t)},e}();t.default=new i},,,,,function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(48)),a=n(11);a.isClashX()?a.setupJsBridge(o.default):o.default()},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=n(12),l=n(24),u=n(8),s=o(n(125));t.default=function(){var e=document.getElementById("root"),t=a.createElement(u.Provider,null,a.createElement(l.HashRouter,null,a.createElement(s.default,null)));i.render(t,e)}},,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(i,l)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,a=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(i=0<(i=u.trys).length&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],a=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,a,i,l,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l},i=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),s=l(n(10)),c=n(13),f=n(11),d=n(4),p=n(80);var h=c.composeContainer({useData:function(){function e(){h(!0)}var t=i(c.useObject({version:"",general:{},proxy:[],proxyGroup:[],rules:[]}),2),n=t[0],l=t[1],f=i(u.useState(!1),2),p=f[0],h=f[1];return{data:n,fetch:function(){return o(this,void 0,void 0,(function(){var t,n,o,u,c,f,p,h,v,m,y,b,g,_,w,E;return a(this,(function(a){switch(a.label){case 0:return[4,d.to(Promise.all([s.getConfig(),s.getProxies(),s.getRules()]))];case 1:return t=i.apply(void 0,[a.sent(),2]),n=t[0],(o=t[1])&&(!o.response||401===o.response.status)&&e(),u=i(n,3),c=u[0].data,f=u[1],p=u[2],l("general",{port:c.port,socksPort:c["socks-port"],redirPort:c["redir-port"],mode:c.mode,logLevel:c["log-level"],allowLan:c["allow-lan"]}),h=new Set(["Selector","URLTest","Fallback","LoadBalance"]),v=new Set(["DIRECT","REJECT","GLOBAL"]),(m=f.data.proxies.GLOBAL).name="GLOBAL",y=m.all.filter((function(e){return!v.has(e)})).map((function(e){return r(r({},f.data.proxies[e]),{name:e})})),b=i(d.partition(y,(function(e){return!h.has(e.type)})),2),g=b[0],_=b[1],l({proxy:g,proxyGroup:"Global"===c.mode?[m]:_,rules:p.data.rules}),[4,d.to(s.getVersion())];case 2:return w=i.apply(void 0,[a.sent(),2]),E=w[0],w[1]?[2]:(l("version",E.data.version),[2])}}))}))},unauthorized:{visible:p,show:e,hidden:function(){h(!1)}},updateDelay:function(e,t){l((function(n){var r=n.proxy.find((function(t){return t.name===e}));r&&r.history.push({time:Date.now().toString(),delay:t})}))}}},useAPIInfo:function(){var e=i(c.useObject({hostname:"127.0.0.1",port:"9090",secret:""}),2),t=e[0],n=e[1];return{data:t,fetch:function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return[4,s.getExternalControllerConfig()];case 1:return e=t.sent(),n(r({},e)),[2]}}))}))},update:function(e){return o(this,void 0,void 0,(function(){var t,n,r;return a(this,(function(){return t=e.hostname,n=e.port,r=e.secret,d.setLocalStorageItem("externalControllerAddr",t),d.setLocalStorageItem("externalControllerPort",n),d.setLocalStorageItem("secret",r),window.location.reload(),[2]}))}))}}},useClashXData:function(){var e=i(c.useObject({startAtLogin:!1,systemProxy:!1}),2),t=e[0],n=e[1];return{data:t,fetch:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return[4,f.jsBridge.getStartAtLogin()];case 1:return e=r.sent(),[4,f.jsBridge.isSystemProxySet()];case 2:return t=r.sent(),n({startAtLogin:e,systemProxy:t}),[2]}}))}))}}},useI18n:p.useI18n}),v=h.Provider,m=h.containers;t.Provider=v,t.containers=m},,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(i,l)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,a=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(i=0<(i=u.trys).length&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],a=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,a,i,l,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0}),t.createAsyncSingleton=function(e){var t=null;return function(){return r(this,void 0,void 0,(function(){return o(this,(function(){return t?[2,t]:[2,(t=e()).catch((function(e){throw t=null,e}))]}))}))}}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(i,l)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,a=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(i=0<(i=u.trys).length&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],a=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,a,i,l,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(4),s=l(n(38)),c=function(){function e(e){this.EE=new s.default,this.innerBuffer=[],this.isClose=!1,this.config=Object.assign({bufferLength:0,retryInterval:5e3,headers:{}},e),this.config.useWebsocket?this.websocketLoop():this.loop()}return e.prototype.websocketLoop=function(){var e=this,t=new URL(this.config.url);t.protocol="http:"===location.protocol?"ws:":"wss:",t.searchParams.set("token",this.config.token);var n=new WebSocket(t.toString());n.addEventListener("message",(function(t){var n=JSON.parse(t.data);e.EE.emit("data",[n]),0<e.config.bufferLength&&(e.innerBuffer.push(n),e.innerBuffer.length>e.config.bufferLength&&e.innerBuffer.splice(0,e.innerBuffer.length-e.config.bufferLength))})),n.addEventListener("close",(function(){return setTimeout(e.websocketLoop,e.config.retryInterval)})),n.addEventListener("error",(function(t){e.EE.emit("error",t),setTimeout(e.websocketLoop,e.config.retryInterval)}))},e.prototype.loop=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,l,s,c,f,d,p,h;return o(this,(function(o){switch(o.label){case 0:return[4,u.to(fetch(this.config.url,{mode:"cors",headers:this.config.token?{Authorization:"Bearer "+this.config.token}:{}}))];case 1:if(e=a.apply(void 0,[o.sent(),2]),t=e[0],n=e[1])return this.retry(n),[2];r=t.body.getReader(),l=new TextDecoder,o.label=2;case 2:return this.isClose?[3,4]:[4,u.to(r.read())];case 3:return s=a.apply(void 0,[o.sent(),2]),c=s[0].value,(f=s[1])?(this.retry(f),[3,4]):(d=l.decode(c).trim().split("\n"),p=d.map((function(e){return JSON.parse(e)})),this.EE.emit("data",p),0<this.config.bufferLength&&((h=this.innerBuffer).push.apply(h,i(p)),this.innerBuffer.length>this.config.bufferLength&&this.innerBuffer.splice(0,this.innerBuffer.length-this.config.bufferLength)),[3,2]);case 4:return[2]}}))}))},e.prototype.retry=function(e){this.isClose||(this.EE.emit("error",e),window.setTimeout(this.loop,this.config.retryInterval))},e.prototype.subscribe=function(e,t){this.EE.addListener(e,t)},e.prototype.unsubscribe=function(e,t){this.EE.removeListener(e,t)},e.prototype.buffer=function(){return this.innerBuffer.slice()},e.prototype.destory=function(){this.EE.removeAllListeners(),this.isClose=!0},e}();t.StreamReader=c},,,function(e,t,n){"use strict";var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),l=a(n(81)),u=n(4),s=a(n(123)),c=a(n(124)),f={en_US:s.default,zh_CN:c.default},d="language",p=Object.keys(f);function h(){var e,t,n=u.getLocalStorageItem(d);if(n&&p.includes(n))return n;var o=function(){var e,t,n=[];if(window.navigator)if(window.navigator.languages)try{for(var o,a=r(window.navigator.languages),i=a.next();!i.done;i=a.next())o=i.value,n.push(o)}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else window.navigator.language&&n.push(navigator.language);return n}();try{for(var a,i=r(o),l=i.next();!l.done;l=i.next()){if((a=l.value).includes("zh"))return"zh_CN";if(a.includes("us"))return"en_US"}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return"en_US"}t.useI18n=function(){var e=o(i.useState(h()),2),t=e[0],n=e[1],r=i.useCallback((function(e){return{t:function(n){return l.default(f[t][e],n)}}}),[t]);return{lang:t,locales:p,setLang:function(e){n(e),u.setLocalStorageItem(d,e)},useTranslation:r}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={SideBar:{Proxies:"Proxies",Overview:"Overview",Logs:"Logs",Rules:"Rules",Settings:"Setting",Connections:"Connections"},Settings:{title:"Settings",labels:{startAtLogin:"Start at login",language:"language",setAsSystemProxy:"Set as system proxy",allowConnectFromLan:"Allow connect from Lan",proxyMode:"Mode",socks5ProxyPort:"Socks5 proxy port",httpProxyPort:"HTTP proxy port",externalController:"External controller"},values:{cn:"中文",en:"English",global:"Global",rules:"Rules",direct:"Direct"},versionString:"Current ClashX is the latest version：{{version}}",checkUpdate:"Check Update",externalControllerSetting:{title:"External Controller",note:"Please note that modifying this configuration will only configure Dashboard. Will not modify your Clash configuration file. Please make sure that the external controller address matches the address in the Clash configuration file, otherwise, Dashboard will not be able to connect to Clash.",host:"Host",port:"Port",secret:"Secret"}},Logs:{title:"Logs"},Rules:{title:"Rules"},Connections:{title:"Connections",keepClosed:"Keep closed connections",total:{text:"total",upload:"upload",download:"download"},closeAll:{title:"Warning",content:"This would close all connections"},columns:{host:"Host",network:"Network",type:"Type",chains:"Chains",rule:"Rule",time:"Time",speed:"Speed",upload:"Upload",download:"Download"}},Proxies:{title:"Proxies",editDialog:{title:"Edit Proxy",color:"Color",name:"Name",type:"Type",server:"Server",port:"Port",password:"Password",cipher:"Cipher",obfs:"Obfs","obfs-host":"Obfs-host",uuid:"UUID",alterId:"AlterId",tls:"TLS"},groupTitle:"Policy Group",expandText:"Expand",collapseText:"Collapse",speedTestText:"Speed Test"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={SideBar:{Proxies:"代理",Overview:"总览",Logs:"日志",Rules:"规则",Settings:"设置",Connections:"连接"},Settings:{title:"设置",labels:{startAtLogin:"开机时启动",language:"语言",setAsSystemProxy:"设置为系统代理",allowConnectFromLan:"允许来自局域网的连接",proxyMode:"代理模式",socks5ProxyPort:"Socks5 代理端口",httpProxyPort:"HTTP 代理端口",externalController:"外部控制设置"},values:{cn:"中文",en:"English",global:"全局",rules:"规则",direct:"直连"},versionString:"当前 ClashX 已是最新版本：{{version}}",checkUpdate:"检查更新",externalControllerSetting:{title:"编辑外部控制设置",note:"请注意，修改该配置项并不会修改你的 Clash 配置文件，请确认修改后的外部控制地址和 Clash 配置文件内的地址一致，否则会导致 Dashboard 无法连接。",host:"Host",port:"端口",secret:"密钥"}},Logs:{title:"日志"},Rules:{title:"规则"},Connections:{title:"连接",keepClosed:"保留关闭连接",total:{text:"总量",upload:"上传",download:"下载"},closeAll:{title:"警告",content:"将会关闭所有连接"},columns:{host:"域名",network:"网络",type:"类型",chains:"节点链",rule:"规则",time:"连接时间",speed:"速率",upload:"上传",download:"下载"}},Proxies:{title:"代理",editDialog:{title:"编辑代理",color:"颜色",name:"名字",type:"类型",server:"服务器",port:"端口",password:"密码",cipher:"加密方式",obfs:"Obfs","obfs-host":"Obfs-host",uuid:"UUID",alterId:"AlterId",tls:"TLS"},groupTitle:"策略组",expandText:"展开",collapseText:"收起",speedTestText:"测速"}}},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=n(24),l=n(126),u=o(n(3)),s=n(11);n(127);var c=o(n(128)),f=o(n(163)),d=o(n(166)),p=o(n(168)),h=o(n(170)),v=o(n(173)),m=o(n(177)),y=n(10);t.default=l.hot((function(){a.useEffect((function(){y.getLogsStreamReader()}),[]);var e=[{path:"/proxies",name:"Proxies",component:c.default},{path:"/logs",name:"Logs",component:f.default},{path:"/rules",name:"Rules",component:d.default,noMobile:!0},{path:"/connections",name:"Connections",component:v.default,noMobile:!0},{path:"/settings",name:"Settings",component:p.default}];return a.default.createElement("div",{className:u.default("app",{"not-clashx":!s.isClashX()})},a.default.createElement(h.default,{routes:e}),a.default.createElement("div",{className:"page-container"},a.default.createElement(i.Route,{exact:!0,path:"/",component:function(){return a.default.createElement(i.Redirect,{to:"/proxies"})}}),e.map((function(e){return a.default.createElement(i.Route,{exact:!1,path:e.path,key:e.path,component:e.component})}))),a.default.createElement(m.default,null))}))},,function(e,t,n){},function(e,t,n){"use strict";var r,o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l,u,s=a(n(0)),c=i(n(42)),f=n(6),d=n(8),p=n(157);n(162),(u=l||(l={}))[u.None=0]="None",u[u.Asc=1]="Asc",u[u.Desc=2]="Desc";var h=((r={})[l.None]="sort",r[l.Asc]="sort-ascending",r[l.Desc]="sort-descending",r);function v(e,t){var n=Number.MAX_SAFE_INTEGER,r=e.history.length?e.history.slice(-1)[0].delay:0;return((t.history.length?t.history.slice(-1)[0].delay:0)||n)-(r||n)}t.default=function(){var e=d.containers.useData(),t=e.data,n=e.fetch,r=(0,d.containers.useI18n().useTranslation)("Proxies").t;s.useLayoutEffect((function(){n()}),[]);var a=o(s.useState(l.None),2),i=a[0],u=a[1],m=s.useMemo((function(){return i===l.Desc?t.proxy.slice().sort((function(e,t){return v(e,t)})):i===l.Asc?t.proxy.slice().sort((function(e,t){return-1*v(e,t)})):t.proxy.slice()}),[i,t]);return s.default.createElement("div",{className:"page"},s.default.createElement("div",{className:"proxies-container"},s.default.createElement(f.Header,{title:r("groupTitle")}),s.default.createElement(f.Card,{className:"proxies-group-card"},s.default.createElement("ul",{className:"proxies-group-list"},t.proxyGroup.map((function(e){return s.default.createElement("li",{className:"proxies-group-item",key:e.name},s.default.createElement(p.Group,{config:e}))}))))),s.default.createElement("div",{className:"proxies-container"},s.default.createElement(f.Header,{title:r("title")},s.default.createElement(f.Icon,{className:"proxies-action-icon",type:h[i],onClick:function(){u((i+1)%3)},size:20}),s.default.createElement(f.Icon,{className:"proxies-action-icon",type:"speed",size:20}),s.default.createElement("span",{className:"proxies-speed-test",onClick:function(){c.default.notifySpeedTest()}},r("speedTestText"))),s.default.createElement("ul",{className:"proxies-list"},m.map((function(e){return s.default.createElement("li",{key:e.name},s.default.createElement(p.Proxy,{config:e}))})))))}},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=o(n(3));n(130),t.Header=function(e){var t=e.title,n=e.children,r=e.className,o=e.style;return a.createElement("header",{className:i.default("header",r),style:o},a.createElement("h1",null,t),a.createElement("div",{className:"operations"},n))}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(0)),l=a(n(3));t.Icon=function(e){var t=e.type,n=e.size,o=void 0===n?14:n,a=e.className,u=e.style,s=l.default("clash-iconfont","icon-"+t,a),c=r({fontSize:o},u),f=r(r({},e),{className:s,style:c});return i.createElement("i",r({},f))}},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=n(6),l=n(4),u=o(n(3));n(133),t.Switch=function(e){var t=e.className,n=e.checked,r=void 0!==n&&n,o=e.disabled,s=void 0!==o&&o,c=e.onChange,f=void 0===c?l.noop:c,d=u.default("switch",{checked:r,disabled:s},t);return a.createElement("div",{className:d,onClick:function(){s||f(!r)}},a.createElement(i.Icon,{className:"switch-icon",type:"check",size:20,style:{fontWeight:"bold"}}))}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=o(n(3));n(135),t.Card=function(e){var t=e.className,n=e.style,r=e.children;return a.createElement("div",{className:i.default("card",t),style:n},r)}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=o(n(3));n(137),t.Row=function(e){var t=e.gutter,n=void 0===t?24:t,r=e.align,o=void 0===r?"top":r,l=e.justify,u=void 0===l?"start":l,s=e.className,c=e.style,f=e.children;return a.createElement("div",{className:i.default("row","row-gutter-"+n,"row-align-"+o,"row-justify-"+u,s),style:c},f)}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=o(n(3));t.Col=function(e){var t=e.offset,n=void 0===t?0:t,r=e.order,o=void 0===r?0:r,l=e.span,u=void 0===l?1:l,s=e.className,c=e.style,f=e.children,d=Object.assign({},{order:o},c);return a.createElement("div",{className:i.default("column","column-offset-"+n,"column-span-"+u,s),style:d},f)}},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=o(n(3));n(140),t.ButtonSelect=function(e){var t=e.options,n=e.value,r=e.onSelect;return a.createElement("div",{className:"button-select"},t.map((function(e){return a.createElement("button",{value:e.value,key:e.value,className:i.default("button-select-options",{actived:n===e.value}),onClick:function(){return r(e.value)}},e.label)})))}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(0)),l=n(8),u=n(4),s=a(n(3));n(142),t.Tags=function(e){var t=e.className,n=e.data,o=e.onClick,a=e.select,c=e.canClick,f=e.rowHeight,d=(0,l.containers.useI18n().useTranslation)("Proxies").t,p=r(i.useState(!1),2),h=p[0],v=p[1],m=r(i.useState(!1),2),y=m[0],b=m[1],g=i.useRef();i.useLayoutEffect((function(){b(30<g.current.offsetHeight)}),[]);var _=h?"auto":f,w=c?o:u.noop,E=n.map((function(e){var t=s.default({"tags-selected":a===e,"can-click":c});return i.default.createElement("li",{className:t,key:e,onClick:function(){return w(e)}},e)}));return i.default.createElement("div",{className:s.default("tags-container",t),style:{height:_}},i.default.createElement("ul",{ref:g,className:s.default("tags",{expand:h})},E),y&&i.default.createElement("span",{className:"tags-expand",onClick:function(){v(!h)}},d(h?"collapseText":"expandText")))}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=n(4),l=o(n(3));n(144),t.Input=function(e){var t=e.className,n=e.style,r=e.value,o=void 0===r?"":r,u=e.align,s=void 0===u?"center":u,c=e.inside,f=e.autoFocus,d=e.type,p=void 0===d?"text":d,h=e.onChange,v=void 0===h?i.noop:h,m=e.onBlur,y=void 0===m?i.noop:m,b=l.default("input","input-align-"+s,{"input-inside":void 0!==c&&c},t);return a.createElement("input",{className:b,style:n,value:o,autoFocus:void 0!==f&&f,type:p,onChange:function(e){return v(e.target.value,e)},onBlur:y})}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(0)),l=a(n(3)),u=n(6),s=n(12);n(146),t.Select=function(e){function t(e){var t=p.current;t&&!t.contains(e.target)&&y(!1)}var n=e.value,o=e.onSelect,a=e.children,c=e.className,f=e.style,d=i.useRef(),p=i.useRef(),h=i.useRef();i.useLayoutEffect((function(){return document.addEventListener("click",t,!0),function(){document.addEventListener("click",t,!0),d.current&&document.body.removeChild(d.current)}}),[]);var v=r(i.useState(!1),2),m=v[0],y=v[1],b=r(i.useState(!1),2),g=b[0],_=b[1],w=i.useMemo((function(){var e=Math.floor;if(h.current){var t=h.current.getBoundingClientRect();return{top:e(t.top)-10,left:e(t.left)-10}}return{}}),[]),E=i.useMemo((function(){var e=null;return i.default.Children.forEach(a,(function(t){t.props&&t.props.value===n&&(e=t)})),e}),[n,a]),x=i.useMemo((function(){return i.default.Children.map(a,(function(e){if(!e.props||!e.type)return e;var t=e.props.value===n?l.default(e.props.className,"selected"):e.props.className,r=e.props.onClick;return i.default.cloneElement(e,Object.assign({},e.props,{onClick:function(t){o(e.props.value,t),y(!1),r&&r(t)},className:t}))}))}),[a,n,o]),S=i.default.createElement("div",{className:l.default("select-list",{"select-list-show":m}),ref:p,style:w},i.default.createElement("ul",{className:"list"},x));return i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{className:l.default("select",c),style:f,ref:h,onClick:function(){if(!g){if(!d.current){var e=document.createElement("div");document.body.appendChild(e),d.current=e}_(!0)}y(!0)}},E&&E.props&&E.props.children,i.default.createElement(u.Icon,{type:"triangle-down"})),g&&s.createPortal(S,d.current))},t.Option=function(e){var t=e.className,n=e.style,r=e.key,o=e.disabled,a=e.children,u=e.onClick,s=void 0===u?function(){}:u,c=l.default("option",{disabled:void 0!==o&&o},t);return i.default.createElement("li",{className:c,style:n,key:r,onClick:s},a)}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(0)),l=a(n(3)),u=n(12),s=n(6),c=n(4);n(148),t.Modal=function(e){var t=e.show,n=e.title,r=void 0===n?"Modal":n,o=e.size,a=void 0===o?"small":o,f=e.footer,d=e.onOk,p=void 0===d?c.noop:d,h=e.onClose,v=void 0===h?c.noop:h,m=e.bodyClassName,y=e.bodyStyle,b=e.className,g=e.style,_=e.children,w=i.useRef(document.createElement("div")),E=i.useRef();i.useLayoutEffect((function(){return document.body.appendChild(w.current),function(){return document.body.removeChild(w.current)}}),[]);var x=i.default.createElement("div",{className:l.default("modal-mask",{"modal-show":!(void 0!==t)||t}),ref:E,onClick:function(e){e.target===E.current&&v()}},i.default.createElement("div",{className:l.default("modal","modal-"+a,b),style:g},i.default.createElement("div",{className:"modal-title"},r),i.default.createElement("div",{className:l.default("modal-body",m),style:y},_),(!(void 0!==f)||f)&&i.default.createElement("div",{className:"footer"},i.default.createElement(s.Button,{onClick:function(){return v()}},"取 消"),i.default.createElement(s.Button,{type:"primary",onClick:function(){return p()}},"确 定"))));return u.createPortal(x,w.current)},t.useModal=function(){var e=r(i.useState(!1),2),t=e[0],n=e[1];return{visible:t,show:function(){n(!0)},hide:function(){n(!1)}}}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=o(n(3)),l=n(6);n(150);var u={success:"check",info:"info",warning:"info",error:"close"};t.Alert=function(e){var t=e.message,n=void 0===t?"":t,r=e.type,o=void 0===r?"info":r,s=e.inside,c=e.children,f=e.className,d=e.style,p=i.default("alert","alert-"+(void 0!==s&&s?"note":"box")+"-"+o,f);return a.createElement("div",{className:p,style:d},a.createElement("span",{className:"alert-icon"},a.createElement(l.Icon,{type:u[o],size:26})),n?a.createElement("p",{className:"alert-message"},n):a.createElement("div",{className:"alert-message"},c))}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=o(n(3)),l=n(4);n(152),t.Button=function(e){var t=e.type,n=void 0===t?"normal":t,r=e.onClick,o=void 0===r?l.noop:r,u=e.children,s=e.className,c=e.style,f=i.default("button","button-"+n,s);return a.createElement("button",{className:f,style:c,onClick:o},u)}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=a(n(0)),u=i(n(3)),s=n(12),c=n(6),f=n(4);n(154);var d={info:"info",success:"check",warning:"info-o",error:"close"};function p(e){var t=e.removeComponent,n=void 0===t?f.noop:t,r=e.onClose,a=void 0===r?f.noop:r,i=e.icon,s=void 0===i?l.default.createElement(c.Icon,{type:"info",size:16}):i,d=e.content,p=void 0===d?"":d,h=e.type,v=void 0===h?"info":h,m=e.duration,y=void 0===m?1500:m,b=o(l.useState(!1),2),g=b[0],_=b[1];return l.useLayoutEffect((function(){window.setTimeout((function(){return _(!0)}),0);var e=window.setTimeout((function(){_(!1),a()}),y);return function(){return window.clearTimeout(e)}}),[]),l.default.createElement("div",{className:u.default("message","message-"+v,{"message-show":g}),onTransitionEnd:function(){return!g&&n()}},l.default.createElement("span",{className:"message-icon"},s),l.default.createElement("span",{className:"message-content"},p))}function h(e){var t=document.createElement("div");document.body.appendChild(t);var n=l.default.createElement(c.Icon,{type:d[e.type],size:16}),o=e.type,a=e.content,i=e.duration,u=e.onClose;s.render(l.default.createElement(p,r({},{icon:n,type:o,content:a,removeComponent:function(){s.unmountComponentAtNode(t)&&document.body.removeChild(t)},duration:i,onClose:u})),t)}t.Message=p,t.info=function(e,t,n){return h({type:"info",content:e,duration:t,onClose:n})},t.success=function(e,t,n){return h({type:"success",content:e,duration:t,onClose:n})},t.warning=function(e,t,n){return h({type:"warning",content:e,duration:t,onClose:n})},t.error=function(e,t,n){return h({type:"error",content:e,duration:t,onClose:n})},t.showMessage=h},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=n(6),l=n(4),u=o(n(3));n(156),t.Checkbox=function(e){var t=e.className,n=e.checked,r=void 0!==n&&n,o=e.onChange,s=void 0===o?l.noop:o,c=u.default("checkbox",{checked:r},t);return a.createElement("div",{className:c,onClick:function(){s(!r)}},a.createElement(i.Icon,{className:"checkbox-icon",type:"check",size:18}),a.createElement("div",null,e.children))}},function(e,t,n){},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(158)),r(n(160))},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(i,l)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,a=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(i=0<(i=u.trys).length&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],a=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,a,i,l,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=i(n(0)),s=l(n(3)),c=n(8),f=n(10),d=i(n(42)),p=n(11),h=n(4);n(159);var v={"#909399":0,"#00c520":150,"#ff9a28":500,"#ff3e5e":1/0};function m(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return p.isClashX()?[4,p.jsBridge.getProxyDelay(e)]:[3,2];case 1:return[2,t.sent()];case 2:return[4,f.getProxyDelay(e)];case 3:return[2,t.sent().data.delay]}}))}))}t.Proxy=function(e){function t(){return r(this,void 0,void 0,(function(){var e,t,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,h.to(m(n.name))];case 1:return e=a.apply(void 0,[o.sent(),2]),t=e[0],r=e[1],p(i=r?0:t),y(n.name,i),[2]}}))}))}var n=e.config,i=e.className,l=a(u.useState(0),2),f=l[0],p=l[1],y=c.containers.useData().updateDelay;u.useEffect((function(){p(n.history&&n.history.length?n.history.slice(-1)[0].delay:0)}),[n]),u.useLayoutEffect((function(){return d.default.subscribe(d.Action.SPEED_NOTIFY,t),function(){return d.default.unsubscribe(d.Action.SPEED_NOTIFY,t)}}),[]);var b=u.useMemo((function(){return 0===f}),[f]),g=u.useMemo((function(){return Object.keys(v).find((function(e){return f<=v[e]}))}),[f]),_=b?void 0:g;return u.default.createElement("div",{className:s.default("proxy-item",{"proxy-error":b},i)},u.default.createElement("span",{className:"proxy-type",style:{backgroundColor:_}},n.type),u.default.createElement("p",{className:"proxy-name"},n.name),u.default.createElement("p",{className:"proxy-delay"},0===f?"-":f+"ms"))}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(i,l)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,a=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(i=0<(i=u.trys).length&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],a=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,a,i,l,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=a(n(0)),l=n(8),u=n(10),s=n(6);n(161),t.Group=function(e){var t=l.containers.useData().fetch,n=e.config,a="Selector"===n.type;return i.createElement("div",{className:"proxy-group"},i.createElement("div",{className:"proxy-group-part"},i.createElement("span",{className:"proxy-group-name"},n.name),i.createElement("span",{className:"proxy-group-type"},n.type)),i.createElement("div",{className:"proxy-group-tags-container"},i.createElement(s.Tags,{className:"proxy-group-tags",data:n.all,onClick:function(n){return r(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,u.changeProxySelected(e.config.name,n)];case 1:return r.sent(),[4,t()];case 2:return r.sent(),[2]}}))}))},select:n.now,canClick:a,rowHeight:30})))}},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(i,l)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,a=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(i=0<(i=u.trys).length&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],a=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,a,i,l,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l},i=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=l(n(0)),c=u(n(164)),f=n(8),d=n(6),p=n(10);n(165),t.default=function(){var e=s.useRef(),t=s.useRef([]),n=i(s.useState([]),2),l=n[0],u=n[1],h=(0,f.containers.useI18n().useTranslation)("Logs").t;return s.useLayoutEffect((function(){var t=e.current;t.scrollTop=t.scrollHeight}),[t.current]),s.useEffect((function(){function e(e){t.current=t.current.slice().concat(e.map((function(e){return r(r({},e),{time:new Date})}))),u(t.current)}return function(){o(this,void 0,void 0,(function(){var n;return a(this,(function(r){switch(r.label){case 0:return[4,p.getLogsStreamReader()];case 1:return n=r.sent(),t.current=n.buffer(),u(t.current),n.subscribe("data",e),[2]}}))}))}(),function(){return null}}),[]),s.default.createElement("div",{className:"page"},s.default.createElement(d.Header,{title:h("title")}),s.default.createElement(d.Card,{className:"logs-card"},s.default.createElement("ul",{className:"logs-panel",ref:e},l.map((function(e,t){return s.default.createElement("li",{key:t},s.default.createElement("span",{className:"logs-panel-time"},c.default(e.time).format("YYYY-MM-DD HH:mm:ss")),s.default.createElement("span",null,"[",e.type,"] ",e.payload))})))))}},,function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=n(6),l=n(8),u=n(44),s=o(n(43));n(167),t.default=function(){function e(e){var t=e.index,n=e.style,r=c[t];return a.default.createElement("li",{className:"rule-item",style:n},a.default.createElement(i.Row,{className:"rule-item-row",gutter:24,align:"middle"},a.default.createElement(i.Col,{className:"rule-type",span:6,offset:1},r.type),a.default.createElement(i.Col,{className:"payload",span:11},r.payload),a.default.createElement(i.Col,{className:"rule-proxy",span:6},r.proxy)))}var t=l.containers.useData(),n=t.data,r=t.fetch,o=(0,l.containers.useI18n().useTranslation)("Rules").t,c=n.rules;return a.useEffect((function(){r()}),[]),a.default.createElement("div",{className:"page"},a.default.createElement(i.Header,{title:o("title")}),a.default.createElement(i.Card,{className:"rules-card"},a.default.createElement(s.default,{className:"rules"},(function(t){var n=t.height,r=t.width;return a.default.createElement(u.FixedSizeList,{height:n,width:r,itemCount:c.length,itemSize:50},e)}))))}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(i,l)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,a=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(i=0<(i=u.trys).length&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],a=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,a,i,l,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var l=i(n(0)),u=n(6),s=n(8),c=n(10),f=n(13),d=n(4),p=n(11);n(169);var h=[{label:"中文",value:"zh_CN"},{label:"English",value:"en_US"}];t.default=function(){var e=s.containers.useClashXData(),t=e.data,n=e.fetch,i=s.containers.useData(),v=i.data,m=i.fetch,y=i.unauthorized.show,b=s.containers.useAPIInfo().data,g=s.containers.useI18n(),_=g.useTranslation,w=g.setLang,E=g.lang,x=_("Settings").t,S=a(f.useObject({socks5ProxyPort:7891,httpProxyPort:7890,isClashX:!1}),2),C=S[0],P=S[1];l.useEffect((function(){m(),p.isClashX()&&n().then((function(){return P("isClashX",!0)}))}),[]),l.useEffect((function(){P("socks5ProxyPort",v.general.socksPort),P("httpProxyPort",v.general.port)}),[v]);var k=b.hostname,O=b.port,N=v.general,M=N.allowLan,j=N.mode,T=t.startAtLogin,I=t.systemProxy,L=[{label:x("values.global"),value:"Global"},{label:x("values.rules"),value:"Rule"},{label:x("values.direct"),value:"Direct"}];return l.default.createElement("div",{className:"page"},l.default.createElement(u.Header,{title:x("title")}),l.default.createElement(u.Card,{className:"settings-card"},l.default.createElement(u.Row,{gutter:24,align:"middle"},l.default.createElement(u.Col,{span:12},l.default.createElement(u.Col,{span:14,offset:1},l.default.createElement("span",{className:"label"},x("labels.startAtLogin"))),l.default.createElement(u.Col,{span:8,className:"value-column"},l.default.createElement(u.Switch,{disabled:!C.isClashX,checked:T,onChange:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,p.jsBridge.setStartAtLogin(e)];case 1:return t.sent(),n(),[2]}}))}))}}))),l.default.createElement(u.Col,{span:12},l.default.createElement(u.Col,{span:8,offset:1},l.default.createElement("span",{className:"label"},x("labels.language"))),l.default.createElement(u.Col,{span:14,className:"value-column"},l.default.createElement(u.ButtonSelect,{options:h,value:E,onSelect:function(e){w(e)}})))),l.default.createElement(u.Row,{gutter:24,align:"middle"},l.default.createElement(u.Col,{span:12},l.default.createElement(u.Col,{span:14,offset:1},l.default.createElement("span",{className:"label"},x("labels.setAsSystemProxy"))),l.default.createElement(u.Col,{span:8,className:"value-column"},l.default.createElement(u.Switch,{disabled:!C.isClashX,checked:I,onChange:function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,p.jsBridge.setSystemProxy(e)];case 1:return t.sent(),n(),[2]}}))}))}}))),l.default.createElement(u.Col,{span:12},l.default.createElement(u.Col,{span:14,offset:1},l.default.createElement("span",{className:"label"},x("labels.allowConnectFromLan"))),l.default.createElement(u.Col,{span:8,className:"value-column"},l.default.createElement(u.Switch,{checked:M,onChange:function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,d.to(c.updateConfig({"allow-lan":e}))];case 1:return t=a.apply(void 0,[n.sent(),2]),t[1]?[3,3]:[4,m()];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}}))))),l.default.createElement(u.Card,{className:"settings-card"},l.default.createElement(u.Row,{gutter:24,align:"middle"},l.default.createElement(u.Col,{span:12},l.default.createElement(u.Col,{span:8,offset:1},l.default.createElement("span",{className:"label"},x("labels.proxyMode"))),l.default.createElement(u.Col,{span:14,className:"value-column"},l.default.createElement(u.ButtonSelect,{options:L,value:j,onSelect:function(e){return r(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,d.to(c.updateConfig({mode:e}))];case 1:return t=a.apply(void 0,[n.sent(),2]),t[1]||m(),[2]}}))}))}}))),l.default.createElement(u.Col,{span:12},l.default.createElement(u.Col,{span:14,offset:1},l.default.createElement("span",{className:"label"},x("labels.socks5ProxyPort"))),l.default.createElement(u.Col,{span:8},l.default.createElement(u.Input,{value:C.socks5ProxyPort,onChange:function(e){return P("socks5ProxyPort",parseInt(e,10))},onBlur:function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,d.to(c.updateConfig({"socks-port":C.socks5ProxyPort}))];case 1:return e=a.apply(void 0,[t.sent(),2]),e[1]?[3,3]:[4,m()];case 2:t.sent(),P("socks5ProxyPort",v.general.socksPort),t.label=3;case 3:return[2]}}))}))}})))),l.default.createElement(u.Row,{gutter:24,align:"middle"},l.default.createElement(u.Col,{span:12},l.default.createElement(u.Col,{span:14,offset:1},l.default.createElement("span",{className:"label"},x("labels.httpProxyPort"))),l.default.createElement(u.Col,{span:8},l.default.createElement(u.Input,{value:C.httpProxyPort,onChange:function(e){return P("httpProxyPort",parseInt(e,10))},onBlur:function(){return r(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return[4,d.to(c.updateConfig({port:C.httpProxyPort}))];case 1:return e=a.apply(void 0,[t.sent(),2]),e[1]?[3,3]:[4,m()];case 2:t.sent(),P("httpProxyPort",v.general.port),t.label=3;case 3:return[2]}}))}))}}))),l.default.createElement(u.Col,{span:12},l.default.createElement(u.Col,{span:12,offset:1},l.default.createElement("span",{className:"label"},x("labels.externalController"))),l.default.createElement(u.Col,{className:"external-controller",span:10},l.default.createElement("span",{className:"modify-btn",onClick:y},k+":"+O))))),l.default.createElement(u.Card,{className:"clash-version",style:{display:"none"}},l.default.createElement("span",{className:"check-icon"},l.default.createElement(u.Icon,{type:"check",size:20})),l.default.createElement("p",{className:"version-info"},x("versionString")),l.default.createElement("span",{className:"check-update-btn"},x("checkUpdate"))))}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(0)),i=n(24),l=o(n(3)),u=n(8);n(171);var s=o(n(172));t.default=function(e){var t=e.routes,n=(0,u.containers.useI18n().useTranslation)("SideBar").t,r=t.map((function(e){var t=e.path,r=e.name,o=e.exact,u=e.noMobile;return a.createElement("li",{className:l.default("item",{"no-mobile":u}),key:r},a.createElement(i.NavLink,{to:t,activeClassName:"active",exact:!!o},n(r)))}));return a.createElement("div",{className:"sidebar"},a.createElement("img",{src:s.default,className:"sidebar-logo"}),a.createElement("ul",{className:"sidebar-menu"},r))}},function(e,t,n){},function(e,t,n){"use strict";n.r(t),t.default=n.p+"img/33343e6117c37aaef8886179007ba6b5.png"},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function l(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):o(e.value).then(i,l)}u((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(i=2&n[0]?a.return:n[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,n[1])).done)return i;switch(a=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,a=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(!(i=0<(i=u.trys).length&&i[i.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]<i[3])){u.label=n[1];break}if(6===n[0]&&u.label<i[1]){u.label=i[1],i=n;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(n);break}i[2]&&u.ops.pop(),u.trys.pop();continue}n=t.call(e,u)}catch(e){n=[6,e],a=0}finally{o=i=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,a,i,l,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l},i=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},l=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c,f,d=u(n(0)),p=n(174),h=n(44),v=s(n(43)),m=n(179),y=s(n(3)),b=n(6),g=n(8),_=u(n(10)),w=n(13),E=n(4),x=n(175);n(176),(f=c||(c={})).Host="host",f.Network="network",f.Type="type",f.Chains="chains",f.Rule="rule",f.Speed="speed",f.Upload="upload",f.Download="download",f.Time="time";var S=[[c.Host,260],[c.Network,80],[c.Type,120],[c.Chains,200],[c.Rule,140],[c.Speed,200],[c.Upload,100],[c.Download,100],[c.Time,120]],C=new Set([c.Network,c.Type,c.Rule,c.Speed,c.Upload,c.Download,c.Time]),P=new Set([c.Host,c.Network,c.Type,c.Rule,c.Upload,c.Download]);function k(e){for(var t=["B","KB","MB","GB","TB"],n=0;~~(e/1024)&&n<t.length;)e/=1024,n++;return(0===n?e:e.toFixed(2))+" "+t[n]}function O(e,t){switch(!0){case 0===e&&0===t:return"-";case 0!==e&&0!==t:return"↑ "+k(e)+"/s ↓ "+k(t)+"/s";case 0!==e:return"↑ "+k(e)+"/s";default:return"↓ "+k(t)+"/s"}}t.default=function(){var e=g.containers.useI18n(),t=e.useTranslation,n=e.lang,u=t("Connections").t,s=i(w.useObject({uploadTotal:0,downloadTotal:0}),2),c=s[0],f=s[1],N=i(w.useObject({column:"",asc:!0}),2),M=N[0],j=N[1],T=b.useModal(),I=T.visible,L=T.show,D=T.hide,R=x.useConnections(),B=R.connections,A=R.feed,H=R.save,z=R.toggleSave,G=d.useMemo((function(){return B.sort((function(e,t){if(e.completed!==t.completed)return e.completed?1:-1;var n=new Date(e.start).getTime()-new Date(t.start).getTime();return 0==n?e.id.localeCompare(t.id):n})).map((function(e){return{id:e.id,host:(e.metadata.host||e.metadata.destinationIP)+":"+e.metadata.destinationPort,chains:e.chains.slice().reverse().join(" --\x3e "),rule:e.rule,time:m.format(new Date(e.start),n),upload:k(e.upload),download:k(e.download),type:e.metadata.type,network:e.metadata.network.toUpperCase(),speed:O(e.speed.upload,e.speed.download),completed:!!e.completed}})).sort((function(e,t){return""===M.column?0:M.asc?e[M.column].localeCompare(t[M.column]):t[M.column].localeCompare(e[M.column])}))}),[B,M]),U=d.useMemo((function(){return S.map((function(e){return{Header:u("columns."+e[0]),accessor:e[0],minWidth:e[1],width:e[1]}}))}),[n,u]);d.useEffect((function(){function e(e){var t,n;try{for(var r,o=l(e),a=o.next();!a.done;a=o.next())r=a.value,f({uploadTotal:r.uploadTotal,downloadTotal:r.downloadTotal}),A(r.connections)}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}return function(){o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,_.getConnectionStreamReader()];case 1:return t.sent().subscribe("data",e),[2]}}))}))}(),function(){}}),[]);var W=p.useTable({columns:U,data:G},p.useBlockLayout,p.useResizeColumns),X=W.getTableProps,F=W.getTableBodyProps,J=W.headerGroups,V=W.rows,Y=W.prepareRow,K=W.columns,q=W.totalColumnsWidth,Q=d.useMemo((function(){return J[0]}),[J]),Z=d.useCallback((function(e){var t=e.columnIndex,n=e.rowIndex,o=e.style,a=V[n];Y(a);var i=a.cells[t],l=y.default("connections-block",{center:C.has(i.column.id),completed:!!a.original.completed});return d.default.createElement("div",r({},a.getRowProps({style:o}),{className:"connections-item"}),d.default.createElement("div",r({},i.getCellProps(),{className:l}),i.render("Cell")))}),[Y,V]),$=i(d.useState(0),2),ee=$[0],te=$[1],ne=d.useCallback((function(e){var t=e.scrollLeft;return te(t)}),[te]),re=d.useCallback((function(e){return K[e].width}),[K]),oe=d.useRef();return d.useLayoutEffect((function(){oe.current&&oe.current.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!1})}),[q]),d.default.createElement("div",{className:"page"},d.default.createElement(b.Header,{title:u("title")},d.default.createElement("span",{className:"connections-filter total"},"("+u("total.text")+": "+u("total.upload")+" "+k(c.uploadTotal)+" "+u("total.download")+" "+k(c.downloadTotal)+")"),d.default.createElement(b.Checkbox,{className:"connections-filter",checked:H,onChange:z},u("keepClosed")),d.default.createElement(b.Icon,{className:"connections-filter dangerous",onClick:L,type:"close-all",size:20})),d.default.createElement(b.Card,{className:"connections-card"},d.default.createElement("div",r({},X(),{className:"connections"}),d.default.createElement("div",r({},Q.getHeaderGroupProps(),{className:"connections-tr",style:{transform:"translateX(-"+ee+"px)"}}),Q.headers.map((function(e,t){var n=e.id,o=P.has(n)?function(){return function(e){e===M.column?M.asc?j("asc",!1):j({column:"",asc:!0}):j("column",e)}(n)}:E.noop;return d.default.createElement("div",r({},e.getHeaderProps(),{className:"connections-th",onClick:o}),e.render("Header"),M.column===n&&(M.asc?" ↑":" ↓"),t!==Q.headers.length-1&&d.default.createElement("div",r({},e.getResizerProps(),{className:"connections-resizer"})))}))),d.default.createElement("div",r({},F(),{className:"connections-body"}),d.default.createElement(v.default,null,(function(e){var t=e.height,n=e.width;return d.default.createElement(h.VariableSizeGrid,{ref:oe,onScroll:ne,itemData:G,itemKey:function(e){var t=e.rowIndex,n=e.columnIndex;return e.data[t].id+"/"+n},height:t,width:n,columnCount:U.length,columnWidth:re,rowCount:V.length,rowHeight:function(){return 36}},Z)}))))),d.default.createElement(b.Modal,{title:u("closeAll.title"),show:I,onClose:D,onOk:function(){_.closeAllConnections().finally((function(){return D()}))}},u("closeAll.content")))}},,function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),u=function(){function e(){this.connections=new Map,this.saveDisconnection=!1}return e.prototype.appendToSet=function(e){var t,n,a,i,l=e.reduce((function(e,t){return e.set(t.id,t)}),new Map);try{for(var u=o(this.connections.keys()),s=u.next();!s.done;s=u.next())if(f=s.value,!l.has(f))if(this.saveDisconnection){var c=this.connections.get(f);c.completed=!0,c.speed={upload:0,download:0}}else this.connections.delete(f)}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}try{for(var f,d=o(l.keys()),p=d.next();!p.done;p=d.next())if(f=p.value,this.connections.has(f)){var h=this.connections.get(f),v=l.get(f);this.connections.set(f,r(r({},v),{speed:{upload:v.upload-h.upload,download:v.download-h.download}}))}else this.connections.set(f,r(r({},l.get(f)),{speed:{upload:0,download:0}}))}catch(e){a={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(a)throw a.error}}},e.prototype.toggleSave=function(){var e,t;if(this.saveDisconnection){this.saveDisconnection=!1;try{for(var n,r=o(this.connections.keys()),a=r.next();!a.done;a=r.next())n=a.value,this.connections.get(n).completed&&this.connections.delete(n)}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}}else this.saveDisconnection=!0;return this.saveDisconnection},e.prototype.getConnections=function(){return i(this.connections.values())},e}();t.useConnections=function(){var e=l.useMemo((function(){return new u}),[]),t=l.useRef(!0),n=a(l.useState([]),2),r=n[0],o=n[1],i=a(l.useState(!1),2),s=i[0],c=i[1];return{connections:r,feed:function(n){e.appendToSet(n),t.current&&o(e.getConnections()),t.current=!t.current},toggleSave:function(){var n=e.toggleSave();c(n),n||o(e.getConnections()),t.current=!0},save:s}}},function(e,t,n){},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||0<t--)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var a=o(n(0)),i=n(13),l=n(6),u=n(8);n(178),t.default=function(){var e=(0,u.containers.useI18n().useTranslation)("Settings").t,t=u.containers.useAPIInfo(),n=t.data,o=t.update,s=t.fetch,c=u.containers.useData().unauthorized,f=c.hidden,d=c.visible,p=r(i.useObject({hostname:"",port:"",secret:""}),2),h=p[0],v=p[1];return a.useEffect((function(){s()}),[]),a.useEffect((function(){v({hostname:n.hostname,port:n.port,secret:n.secret})}),[n]),a.default.createElement(l.Modal,{show:d,title:e("externalControllerSetting.title"),bodyClassName:"external-controller",onClose:f,onOk:function(){var e=h.hostname,t=h.port,n=h.secret;o({hostname:e,port:t,secret:n})}},a.default.createElement(l.Alert,{type:"info",inside:!0},a.default.createElement("p",null,e("externalControllerSetting.note"))),a.default.createElement(l.Row,{gutter:24,align:"middle"},a.default.createElement(l.Col,{span:4,className:"title"},e("externalControllerSetting.host")),a.default.createElement(l.Col,{span:20,className:"form"},a.default.createElement(l.Input,{align:"left",inside:!0,value:h.hostname,onChange:function(e){return v("hostname",e)}}))),a.default.createElement(l.Row,{gutter:24,align:"middle"},a.default.createElement(l.Col,{span:4,className:"title"},e("externalControllerSetting.port")),a.default.createElement(l.Col,{span:20,className:"form"},a.default.createElement(l.Input,{align:"left",inside:!0,value:h.port,onChange:function(e){return v("port",e)}}))),a.default.createElement(l.Row,{gutter:24,align:"middle"},a.default.createElement(l.Col,{span:4,className:"title"},e("externalControllerSetting.secret")),a.default.createElement(l.Col,{span:20,className:"form"},a.default.createElement(l.Input,{align:"left",inside:!0,value:h.secret,onChange:function(e){return v("secret",e)}}))))}},function(e,t,n){}]);