text: (window.webpackJsonp=window.webpackJsonp||[]).push([[3,18,29,30],{1149:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var s=r(141);var n=r(208),i=r(107);function o(e){return function(e){if(Array.isArray(e))return Object(s.a)(e)}(e)||Object(n.a)(e)||Object(i.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},1163:function(e,t,r){var s=r(1222);s.__esModule&&(s=s.default),"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,r(2).default)("224fb1dc",s,!0,{sourceMap:!1})},1164:function(e,t,r){var s=r(1224);s.__esModule&&(s=s.default),"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,r(2).default)("358d6e41",s,!0,{sourceMap:!1})},1165:function(e,t,r){var s=r(1226);s.__esModule&&(s=s.default),"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,r(2).default)("584f8f44",s,!0,{sourceMap:!1})},1221:function(e,t,r){"use strict";r(1163)},1222:function(e,t,r){var s=r(1)(!1);s.push([e.i,".server-mode-selector-container{position:fixed;bottom:2rem;padding:.5rem;width:100%;background:#34495e}.server-mode-selector-container label{font-weight:500}.server-mode-selector-container .el-form-item__label{color:#f4f7fc}.server-mode-selector-container .el-select input{background:#2c3e50;border:1px solid #f4f7fc;color:#f4f7fc;border-radius:0}.server-mode-selector-container .el-select .el-input .el-input__inner{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.server-mode-selector-container .el-select .el-input.is-disabled .el-input__inner{background:transparent;color:#f4f7fc}.server-mode-selector-container .el-select .el-input.is-disabled .el-input__suffix{display:none}",""]),e.exports=s},1223:function(e,t,r){"use strict";r(1164)},1224:function(e,t,r){var s=r(1)(!1);s.push([e.i,".left-space[data-v-54224be0]{margin-left:1rem}",""]),e.exports=s},1225:function(e,t,r){"use strict";r(1165)},1226:function(e,t,r){var s=r(1)(!1);s.push([e.i,".left-space[data-v-5610ec63]{margin-left:1rem}",""]),e.exports=s},1253:function(e,t,r){"use strict";r.r(t);var s=r(19),n={data:function(){return{}},computed:{show_access_mode:function(){return this.runTimeState.show_access_mode},show_smart_route:function(){return this.runTimeState.show_smart_route},server_mode_label:function(){return this.$t("settings_page.connect_protocol.title")},server_mode_str:function(){return{ssltide:"SSLTide",ss:"Shadowsocks(R)",v2:"V2Ray",trojan:"Trojan",auto:"自动"}[this.$store.state.runTimeState.server_mode]},coreSupportTrojan:function(){return this.versionNewerThan("1.8.3")>0},smart_route_str:function(){return""},servermode:{get:function(){return console.log("servermode------\x3e",this.runTimeState.servermode),this.runTimeState.servermode},set:function(e){this.$store.commit("runTimeState",{servermode:e})}},smart_route:{get:function(){return console.log("smart_route------\x3e",this.runTimeState.smart_route),this.runTimeState.smart_route},set:function(e){s.ipcRenderer.send("update-smart-route",e),this.$store.commit("runTimeState",{smart_route:e})}},workmode:{get:function(){return console.log("workmode------\x3e",this.runTimeState.workmode),this.runTimeState.workmode},set:function(e){this.$store.commit("runTimeState",{workmode:e})}}},methods:{}},i=(r(1221),r(51)),o=Object(i.a)(n,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"server-mode-selector-container"},[e.show_smart_route?r("div",[r("el-form",{ref:"form",staticClass:"full-width no-margin",attrs:{"label-width":"60%",size:"small","label-position":"left"}},[r("el-form-item",{staticClass:"no-margin",attrs:{label:e.$t("settings_page.work_mode.title")}},[r("el-select",{staticClass:"full-width no-margin",attrs:{placeholder:"选择代理模式"},model:{value:e.smart_route,callback:function(t){e.smart_route=t},expression:"smart_route"}},[r("el-option",{attrs:{label:e.$tc("settings_page.work_mode.options",1),value:!0}}),r("el-option",{attrs:{label:e.$tc("settings_page.work_mode.options",2),value:!1}})],1)],1)],1)],1):e._e(),e.show_access_mode?r("div",[r("el-form",{ref:"form",staticClass:"full-width no-margin",attrs:{"label-width":"60%",size:"small","label-position":"left"}},[r("el-form-item",{staticClass:"no-margin",attrs:{label:e.server_mode_label}},[r("el-select",{staticClass:"full-width no-margin",attrs:{placeholder:"选择接入模式",disabled:"connected"==e.runTimeState.connect_state.status},model:{value:e.servermode,callback:function(t){e.servermode=t},expression:"servermode"}},[r("el-option",{attrs:{label:e.$t("auto"),value:"auto"}}),r("el-option",{attrs:{label:"SSLTide",value:"ssltide",disabled:!e.runTimeState.selected_line.ssltide}}),r("el-option",{attrs:{label:"Trojan",value:"trojan",disabled:!e.runTimeState.selected_line.trojan||!e.coreSupportTrojan}}),r("el-option",{attrs:{label:"V2Ray(VMESS)",value:"v2",disabled:!e.runTimeState.selected_line.v2}})],1)],1)],1)],1):e._e()])}),[],!1,null,null,null);t.default=o.exports},1265:function(e,t,r){var s=r(1330);s.__esModule&&(s=s.default),"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);(0,r(2).default)("54ccaa18",s,!0,{sourceMap:!1})},1303:function(e,t,r){"use strict";r.r(t);r(62),r(39),r(27),r(23),r(9),r(40),r(76),r(205),r(63),r(140),r(28);var s=r(1149),n=r(18),i=r(52),o=r(19);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}var c={components:{ModeSelection:r(1253).default},data:function(){return{card_style:{"padding-top":0},selected_line:{},actualServerUsedByClash:null}},computed:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({sortedLines:function(){var e=this,t=["cn1","gb","jp2","sg2"],r=["tw1","tw2","tw3","hk2","la3","la2","la1"];return Object(s.a)(this.current_lines).sort((function(s,n){if(e.getLatencyResult(s)&&e.getLatencyResult(n))return e.getLatencyResult(s)-e.getLatencyResult(n);if(!s.name||!n.name)return 0;var i=s.name.split(" ")[0].toLowerCase(),o=n.name.split(" ")[0].toLowerCase();return t.includes(i)?1:r.includes(i)?-1:i>o?1:-1}))},sortedLinesWithAuto:function(){return this.coreIsClash?[this.auto_server].concat(Object(s.a)(this.sortedLines)):this.sortedLines},show_access_mode:function(){return this.runTimeState.show_access_mode},show_smart_route:function(){return this.runTimeState.show_smart_route},listStyle:function(){var e=3.2;return console.log(this.show_access_mode),console.log(this.show_smart_route),this.show_access_mode&&(e+=2.8),this.show_smart_route&&(e+=2.8),console.log(e),{bottom:e+"rem"}},pre_left:function(){return this.current_service.pre_quota>=1e3?"∞":(Number(this.current_service.pre_quota)-Number(this.current_service.pre_used)).toFixed(1)},pre_left_str:function(){return isNaN(Number(this.pre_left))?this.pre_left:"".concat(this.pre_left,"GB")},pre_used_str:function(){return this.current_service.pre_used.toFixed(1)+"GB"},auto_server:function(){return{is_auto:!0,name:this.$t("auto_server.name"),description:this.$t("auto_server.description")}},workmode:{get:function(){return console.log("workmode------\x3e",this.runTimeState.workmode),this.runTimeState.workmode},set:function(e){this.$store.commit("runTimeState",{workmode:e})}}},Object(i.b)(["speedTestResults"])),created:function(){var e=this;o.ipcRenderer.removeAllListeners("run-time-state-change"),o.ipcRenderer.removeAllListeners("selected_line-change"),o.ipcRenderer.on("selected_line-change",(function(t,r){e.changeSelectedLine(r)})),o.ipcRenderer.removeAllListeners("tcp-ping-reply"),o.ipcRenderer.on("tcp-ping-reply",(function(t,r){e.speedTestReply(r)})),this.coreIsClash&&(o.ipcRenderer.removeAllListeners("clash-speed-test-reply"),o.ipcRenderer.on("clash-speed-test-reply",(function(t,r){e.clashSpeedTestReply(r)})),o.ipcRenderer.removeAllListeners("clash-auto-server-change"),o.ipcRenderer.on("clash-auto-server-change",(function(t,r){console.log("clash auto server changed:",r),e.$notify({title:e.$t("new_server_selected")+r,type:"success",offset:20,duration:2500})})))},mounted:function(){var e=this;this.runTimeState.selected_line&&this.runTimeState.selected_line.name||(console.log("set default line.",this.sortedLines[0]),this.sortedLines[0]&&(this.changeSelectedLine(this.sortedLines[0]),this.sortedLines[0]||setTimeout((function(){e.changeSelectedLine(e.sortedLines[0])}),1e3)))},methods:{getFlagISO:function(e){if(!e.name)return"";var t=e.name.split(" ")[0].replace(/\d/g,"").toLowerCase();return{la:"us",ft:"us",sjc:"us"}[t]||t},getLatencyResult:function(e){return this.speedTestResults?this.speedTestResults[e.name]||this.speedTestResults[e.server]:(console.log("no speed result."),null)},changeSelectedLine:function(e){var t=this;if(e){if(console.log("ssl port:",e.ssltide_port),this.connected&&!this.coreIsClash)return console.log("Connected and not using Clash, ignoring.");if(e.premium&&this.pre_left<=0)return this.$confirm(this.$t("buy_premium_data.line_change_warning")).then((function(e){t.$router.push({path:"/dashboard/buy-premium-data/"})})).catch((function(e){}));if(this.$store.dispatch("runTimeState",{selected_line:e}),this.workmode=e.is_auto?"auto":"manual",this.connected&&this.coreIsClash)if(this.runTimeState.connect_state.line.name===e.name)console.log("same server, click ignored.");else{e.is_auto?o.ipcRenderer.send("clash",{action:"switchToAutoServer"}):o.ipcRenderer.send("clash",{action:"setProxy",arg:e.name});var r={line:JSON.parse(JSON.stringify(e)),servermode:this.runTimeState.servermode,status:"connected"};this.$store.dispatch("runTimeState",{connect_state:r}),o.ipcRenderer.send("user-info-update",4)}e.is_auto||"auto"===this.runTimeState.servermode||e[this.runTimeState.servermode]||(console.log("changing servermode..."),this.$store.dispatch("runTimeState",{servermode:"auto"}))}},performLatencyTest:function(){return this.coreIsClash&&this.connected?this.clashSpeedTest():this.tcpSpeedTest()},tcpSpeedTest:function(){var e=this;this.$message(this.$t("speed_test.notify")),this.sortedLines.forEach((function(t){var r=443;"home"===e.runTimeState.current_service_cate&&(r=8443);var s=t.ssltide_port||r;o.ipcRenderer.send("tcp-ping",{name:t.name,server:t.server,port:s,opt:{}})}))},clashSpeedTest:function(){var e=this;this.$message(this.$t("speed_test.notify")),this.sortedLines.forEach((function(t){o.ipcRenderer.send("clash-speed-test",{arg:{serverName:t.name,url:e.runTimeState.checkwebsite||"http://www.gstatic.com/generate_204",timeout:5e3}})}))},speedTestReply:function(e){console.log(e),this.$store.dispatch("speedTestResult",e)},clashSpeedTestReply:function(e){this.$store.dispatch("clashSpeedTestResult",e)},goBuyPremiumData:function(){var e=this;console.log("yay");var t="/buy-service/?cate=allplatform&time=0";if(this.pre_left<=0)return this.$router.push({path:t});this.$confirm(this.$t("buy_premium_data.redirect_confirm")).then((function(r){e.$router.push({path:t})})).catch((function(e){}))}}},l=c,u=(r(1329),r(51)),d=Object(u.a)(l,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"server-list-container"},[r("div",{staticClass:"kept-space"}),r("div",{staticClass:"server-list",style:e.listStyle},[e._l(e.sortedLinesWithAuto,(function(t,s){return r("el-card",{key:t.name,staticClass:"line-container",class:{selected:e.runTimeState.selected_line.name==t.name,connected:"connected"==e.runTimeState.connect_state.status&&e.runTimeState.connect_state.line.name==t.name},attrs:{"body-style":e.card_style},nativeOn:{click:function(r){return e.changeSelectedLine(t)}}},[r("el-row",{staticClass:"line-content"},[r("h1",{staticClass:"title smooth"},[e.runTimeState.no_flag||t.is_auto?e._e():r("flag",{attrs:{iso:e.getFlagISO(t),squared:!1}}),r("ServerName",{attrs:{server:t}}),t.ratio>1?r("a",{staticClass:"label"},[r("el-popover",{attrs:{placement:"top-start",width:"200",trigger:"hover",content:"将以实际使用量 x"+t.ratio+" 计入账号"}},[r("span",{attrs:{slot:"reference"},slot:"reference"},[e._v("x"+e._s(t.ratio))])])],1):e._e(),r("span",{directives:[{name:"show",rawName:"v-show",value:"connected"==e.runTimeState.connect_state.status&&e.runTimeState.connect_state.line.name==t.name,expression:"runTimeState.connect_state.status == 'connected' && runTimeState.connect_state.line.name == line.name"}],staticClass:"right"},[r("i",{staticClass:"right el-icon-success"})]),e.getLatencyResult(t)?r("span",{staticClass:"right label round success super-badge test-result"},[e.getLatencyResult(t)<5001?r("span",[e._v(e._s(e.getLatencyResult(t))),r("span",{staticClass:"small"},[e._v("ms")])]):e._e(),e.getLatencyResult(t)>5e3?r("span",[r("span",{staticClass:"small"},[e._v(e._s(e.$t("timeout")))])]):e._e()]):e._e(),t.perm&&"allplatform"==e.runTimeState.current_service_cate&&-1==t.perm.indexOf(2)?r("span",{staticClass:"right label round super-badge"},[e._v(e._s(e.$t("pro_only")))]):e._e(),t.premium?r("span",{staticClass:"right label round super-badge premium-badge"},[r("el-popover",{attrs:{placement:"top-start",width:"200",trigger:"hover",content:e.$tc("buy_premium_data.premium_cost_hint",e.pre_left_str)},nativeOn:{click:function(t){return e.goBuyPremiumData.apply(null,arguments)}}},[r("span",{attrs:{slot:"reference"},slot:"reference"},["∞"==e.pre_left_str?r("span",[e._v(e._s(e.pre_left_str)+e._s(e.$t("premium")))]):e._e(),e.pre_left>0?r("span",[e._v(e._s(e.$t("premium"))+" "+e._s(e.pre_left_str))]):e._e(),e.pre_left<=0?r("span",[e._v(e._s(e.$t("buy_premium_data.badge_hint")))]):e._e()])])],1):e._e()],1),r("h5",{staticClass:"description"},[r("ServerDescription",{attrs:{server:t}})],1)])],1)})),r("el-card",{staticClass:"utils"},[r("el-button",{attrs:{type:"primary"},on:{click:e.performLatencyTest}},[e._v(e._s(e.$t("speed_test.btn")))]),r("br"),r("br"),r("p",{staticClass:"small"},[e._v(e._s(e.$t("speed_test.desc")))])],1)],2),r("div",[r("ModeSelection")],1)])}),[],!1,null,null,null);t.default=d.exports;installComponents(d,{ServerName:r(1304).default,ServerDescription:r(1305).default,ModeSelection:r(1253).default})},1304:function(e,t,r){"use strict";r.r(t);r(140),r(28);var s={name:"ServerName",props:{server:{type:Object,default:function(){}}},computed:{name:function(){return"zh"===this.$i18n.locale?this.server.name:this.server.name.split(" ")[0]}}},n=(r(1223),r(51)),i=Object(n.a)(s,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",[e._v(e._s(e.name))])}),[],!1,null,"54224be0",null);t.default=i.exports},1305:function(e,t,r){"use strict";r.r(t);r(28),r(105);var s={name:"ServerDescription",props:{server:{type:Object,default:function(){}}},computed:{description:function(){return"zh"===this.$i18n.locale||this.server.name.startsWith("AUTO")?this.server.description:this.server.name.startsWith("CN")?"Specially optimized for access from China.":""}}},n=(r(1225),r(51)),i=Object(n.a)(s,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("span",[e._v(e._s(e.description))])}),[],!1,null,"5610ec63",null);t.default=i.exports},1329:function(e,t,r){"use strict";r(1265)},1330:function(e,t,r){var s=r(1)(!1);s.push([e.i,".server-list-container{position:fixed;bottom:6.2rem;height:100vh}.server-list-container .utils{background:#2c3e50;text-align:center;border:none;border-radius:0}.server-list-container .utils *{color:#f9f9f9}.server-list-container .utils a{color:#1abc9c!important}.server-list-container .utils .el-button{background:transparent}.server-list-container .kept-space{position:fixed;top:0;left:0;height:1.5rem}.server-list-container .server-list{top:1.5rem;overflow-x:overlay;overflow-y:overlay;position:fixed}.server-list-container .server-list .el-card:hover{box-shadow:0 2px 12px 0 rgba(0,0,0,.2)}.server-list-container .server-list:hover::-webkit-scrollbar{width:2px;background-color:#2c3e50}.server-list-container .server-list::-webkit-scrollbar{width:0}.server-list-container .server-list::-webkit-scrollbar-track,.server-list-container .server-list::-webkit-scrollbar-track-piece{display:none}.server-list-container .server-list::-webkit-scrollbar-thumb{background:grey}.server-list-container .server-list .line-container{cursor:default;margin-bottom:1px;position:relative;border:none;border-radius:0!important;width:100vw;background:#2c3e50}.server-list-container .server-list .line-container .line-content{border:none;width:100%;padding-top:1rem}.server-list-container .server-list .line-container .line-content .super-badge{margin:0 .1rem 0 .5rem;color:#f9f9f9!important;background:#8e44ad}.server-list-container .server-list .line-container .line-content .super-badge.premium-badge{cursor:pointer}.server-list-container .server-list .line-container .line-content .super-badge.premium-badge .test-result{margin:0 1rem;background:#7f8c8d!important}.server-list-container .server-list .line-container .line-content .line-number{display:none;font-size:1rem;color:#95a5a6}.server-list-container .server-list .line-container .line-content .label{margin-left:1rem;font-size:.8rem}.server-list-container .server-list .line-container .line-content .title{font-size:1.3rem;font-weight:500;color:#bdc3c7}.server-list-container .server-list .line-container .line-content .title .flag-icon{margin-right:1rem}.server-list-container .server-list .line-container .line-content .description{margin-top:.5rem;font-weight:500;font-size:.8rem;color:#95a5a6}.server-list-container .server-list .line-container.connected{background:#16a085}.server-list-container .server-list .line-container.connected *{color:#fff!important}.server-list-container .server-list .line-container.selected{position:-webkit-sticky;position:sticky;top:0;bottom:0;z-index:999999;box-shadow:0 0 12px 5px rgba(0,0,0,.3)}.server-list-container .server-list .line-container.selected:not(.connected){background:#16a085}.server-list-container .server-list .line-container.selected:not(.connected) *{color:#fff}.server-list-container .server-list .line-container:hover .line-number{display:inline}.server-list-container .server-list .line-container:hover .line-number .title{padding-left:.5rem}.server-list-container .server-list .line-container:hover:not(.connected):not(.selected){background:#34495e}.server-list-container .server-list .line-container:hover:not(.connected):not(.selected) *{color:#bdc3c7}",""]),e.exports=s}}]);