import{c as e}from"./index-ltw-H9qF.js";import{r as a,c as t,j as r}from"./vendor-react-LhvuxEgB.js";import{s}from"./signal-scoring-CcBiRcks.js";const o=e("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),n=e("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),l=e("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),c=e("signal-high",[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}],["path",{d:"M17 20V8",key:"1tkaf5"}]]),i=e("signal-low",[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}]]),d=e("signal-medium",[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}]]),p=e("signal-zero",[["path",{d:"M2 20h.01",key:"4haj6o"}]]),h=e("signal",[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}],["path",{d:"M17 20V8",key:"1tkaf5"}],["path",{d:"M22 4v16",key:"sih9yq"}]]),x=e("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),u={excellent:"color(display-p3 0.00 1.00 0.00)",good:"color(display-p3 0.55 0.90 0.15)",fair:"color(display-p3 1.00 0.85 0.00)",weak:"color(display-p3 1.00 0.55 0.15)",poor:"color(display-p3 1.00 0.20 0.20)"},g={excellent:"#4ADE80",good:"#A3E635",fair:"#FACC15",weak:"#FB923C",poor:"#EF4444"};function f(e){return e>=-90?"excellent":e>=-100?"good":e>=-110?"fair":e>=-120?"weak":"poor"}function y(e,a,t=!0){return a?t?{backgroundColor:g[e],"--p3-color":u[e]}:{backgroundColor:"rgba(255, 255, 255, 0.25)"}:{backgroundColor:"rgba(255, 255, 255, 0.1)"}}function m(e,a=!0){return e&&a?"signal-bar-active":""}function k({rssi:e,className:a="w-4 h-4"}){const s=f(e),o=function(e){switch(e){case"excellent":return"text-signal-excellent";case"good":return"text-signal-good";case"fair":return"text-signal-fair";case"weak":return"text-signal-poor";case"poor":return"text-signal-critical";default:return"text-fg-muted"}}(s),n=t(o,a);switch(s){case"excellent":return r.jsx(h,{className:n});case"good":return r.jsx(c,{className:n});case"fair":return r.jsx(d,{className:n});case"weak":return r.jsx(i,{className:n});default:return r.jsx(p,{className:n})}}const j=a.memo(function({rssi:e,snr:a,compact:o=!1,showValues:n=!0,radioConfig:l,nfPenalty:c=0,validated:i=!0}){const d=void 0!==a?function(e,a,t,r=0){const o=s(a,e,t,r);return o?function(e){switch(e){case"excellent":return"excellent";case"good":return"good";case"fair":return"fair";case"poor":return"weak";case"critical":return"poor"}}(o.finalGrade):f(e)}(e,a,l,c):f(e),p={excellent:4,good:3,fair:2,weak:1,poor:0}[d];return o?r.jsxs("div",{className:"flex items-center gap-1.5",children:[n&&r.jsx("span",{className:t("type-data-xs w-[32px] text-left",i?"text-fg-secondary":"text-fg-muted"),children:e}),r.jsx("div",{className:"flex items-center gap-[2px] h-3 w-[14px]",children:Array.from({length:4}).map((e,a)=>r.jsx("div",{className:t("w-[3px] h-full rounded-[1px] transition-colors",m(a<p,i)),style:y(d,a<p,i)},a))})]}):r.jsxs("div",{className:"flex items-center gap-2",children:[n&&r.jsxs("div",{className:"flex flex-col items-start w-[52px]",children:[r.jsxs("span",{className:t("type-data-xs leading-tight",i?"text-fg-secondary":"text-fg-muted"),children:[e," dBm"]}),void 0!==a&&r.jsxs("span",{className:"type-data-xs text-fg-muted leading-tight",children:[a.toFixed(1)," dB"]})]}),r.jsx("div",{className:"flex items-center gap-[2px] h-3.5 w-[14px]",children:Array.from({length:4}).map((e,a)=>r.jsx("div",{className:t("w-[3px] h-full rounded-[1px] transition-colors",m(a<p,i)),style:y(d,a<p,i)},a))})]})});function w(e){const a=f(e);return a.charAt(0).toUpperCase()+a.slice(1)}function v(e){if("tx_local"===e.packet_origin)return!1;if("tx_forward"===e.packet_origin)return!1;const a=Array.isArray(e.original_path)?e.original_path:[],t=Array.isArray(e.forwarded_path)?e.forwarded_path:[];return!(a.length>0||t.length>0)}export{o as A,l as C,j as S,x as Z,h as a,n as b,k as c,w as g,v as i};
