clash_for_linux/dashboard/public/assets/Proxies.71af777a.js

2 lines
23 KiB
JavaScript
Raw Normal View History

2022-02-17 14:30:03 +08:00
import{r as o,j as m,g as E,C as Pe,N as Se,Z as k,k as $,R as P,O as Re,M as Ae,T as Te}from"./vendor.38e754a4.js";import{B as x,E as Me,F as V,N as K,c as _,G as Z,H as I,k as S,I as Le,J as Y,K as z,L as B,M as Ne,O as De,P as Fe,Q as J,R as $e,g as Q,C as X,l as ee,T as Ie,m as te,U as ze,V as Be,W as qe,X as je}from"./index.ee5bc09a.js";import{F as He,p as We,A as Ge,I as Ue}from"./Fab.4dc9cb99.js";import{R as Ve,T as Ke}from"./TextFitler.cc7f7fa3.js";import{f as Ze}from"./index.9233837d.js";import{S as Ye}from"./Select.29a5a6ae.js";import"./debounce.76599460.js";const Je="_FlexCenter_1380a_1";var Qe={FlexCenter:Je};function Xe({children:e}){return o.exports.createElement("div",{className:Qe.FlexCenter},e)}const{useRef:re,useEffect:et}=m;function tt({onClickPrimaryButton:e,onClickSecondaryButton:t}){const r=re(null),n=re(null);et(()=>{r.current.focus()},[]);const s=a=>{a.keyCode===39?n.current.focus():a.keyCode===37&&r.current.focus()};return o.exports.createElement("div",{onKeyDown:s},o.exports.createElement("h2",null,"Close Connections?"),o.exports.createElement("p",null,'Click "Yes" to close those connections that are still using the old selected proxy in this group'),o.exports.createElement("div",{style:{height:30}}),o.exports.createElement(Xe,null,o.exports.createElement(x,{onClick:e,ref:r},"Yes"),o.exports.createElement("div",{style:{width:20}}),o.exports.createElement(x,{onClick:t,ref:n},"No")))}const rt="_header_1y9js_1",nt="_arrow_1y9js_8",ot="_isOpen_1y9js_13",st="_btn_1y9js_20",at="_qty_1y9js_25";var g={header:rt,arrow:nt,isOpen:ot,btn:st,qty:at};function ne({name:e,type:t,toggle:r,isOpen:n,qty:s}){const a=o.exports.useCallback(i=>{i.preventDefault(),(i.key==="Enter"||i.key===" ")&&r()},[r]);return o.exports.createElement("div",{className:g.header,onClick:r,style:{cursor:"pointer"},tabIndex:0,onKeyDown:a,role:"button"},o.exports.createElement("div",null,o.exports.createElement(Me,{name:e,type:t})),typeof s=="number"?o.exports.createElement("span",{className:g.qty},s):null,o.exports.createElement(x,{kind:"minimal",onClick:r,className:g.btn,title:"Toggle collapsible section"},o.exports.createElement("span",{className:E(g.arrow,{[g.isOpen]:n})},o.exports.createElement(Pe,{size:20}))))}const{useMemo:it}=m;function ct(e,t){return e.filter(r=>{const n=t[r];return n===void 0?!0:n.number!==0})}const R=(e,t)=>{if(e&&typeof e.number=="number"&&e.number>0)return e.number;const r=t&&t.type;return r&&K.indexOf(r)>-1?-1:999999},lt={Natural:e=>e,LatencyAsc:(e,t,r)=>e.sort((n,s)=>{const a=R(t[n],r&&r[n]),i=R(t[s],r&&r[s]);return a-i}),LatencyDesc:(e,t,r)=>e.sort((n,s)=>{const a=R(t[n],r&&r[n]);return R(t[s],r&&r[s])-a}),NameAsc:e=>e.sort(),NameDesc:e=>e.sort((t,r)=>t>r?-1:t<r?1:0)};function ut(e,t){const r=t.toLowerCase().split(" ").map(n=>n.trim()).filter(n=>!!n);return r.length===0?e:e.filter(n=>{let s=0;for(;s<r.length;s++){const a=r[s];if(n.toLowerCase().indexOf(a)>-1)return!0}return!1})}function pt(e,t,r,n,s,a){let i=[...e];return r&&(i=ct(e,t)),typeof n=="string"&&n!==""&&(i=ut(i,n)),lt[s](i,t,a)}function oe(e,t,r,n,s){const[a]=Se(V);return it(()=>pt(e,t,r,a,n,s),[e,t,r,a,n,s])}const dt="_header_1g0y5_1",ft="_zapWrapper_1g0y5_5";var se={header:dt,zapWrapper:ft};const ae={Right:39,Left:37,Enter:13,Space:32},mt="_proxy_sq0tg_1",ht="_now_sq0tg_25",vt="_error_sq0tg_29",yt="_selectable_sq0tg_32",xt="_proxyType_sq0tg_40",_t="_row_sq0tg_51",bt="_proxyName_sq0tg_57",Et="_proxySmall_sq0tg_68";var h={proxy:mt,now:ht,error:vt,selectable:yt,proxyType:xt,row:_t,proxyName:bt,proxySmall:Et};const gt="_proxyLatency_15kyb_1";var wt={proxyLatency:gt};function Ct({number:e,color:t}){return o.exports.createElement("span",{className:wt.proxyLatency,style:{color:t}},o.exports.createElement("span",null,e," ms"))}const{useMemo:w}=m,C={good:"#67c23a",normal:"#d4b75c",bad:"#e67f3c",na:"#909399"};function ie({number:e}={}){return e===0?C.na:e<200?C.good:e<400?C.normal:typeof e=="number"?C.bad:C.na}function Ot(e,t){return K.indexOf(t)>-1?"linear-gradient(135deg, white 15%, #999 15% 30%, white 30% 45%, #999 45% 60%, white 60% 75%, #999 75% 90