"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[79320],{91255(e,t,n){n.d(t,{T:()=>s});var i=n(691189),a=n(771805);const r=":wanNetworkGroup:",l=`ispStatus${r}`,o=`${a.w}/wan/${r}/isp-status`,s=(e,t={},n={})=>(0,i.Kd)(l.replace(r,e),o.replace(r,e),l,{queryParams:{include_isp_alerts:!1},...t},n)},882675(e,t,n){var i;n.d(t,{L:()=>i}),function(e){e.DOWNTIMES="downtimes",e.PACKET_LOSS="packet_loss",e.HIGH_LATENCIES="high_latencies"}(i||(i={}))},479403(e,t,n){n.d(t,{IB:()=>c,mo:()=>d,nN:()=>m});var i=n(801081),a=n(25553),r=n(87485),l=n(882675),o=n(91255);const s=e=>(0,i.Mz)((e=>(0,a.uh)((0,o.T)(e)))(e),r.i6),m=e=>(0,i.Mz)(s(e),({wan_status:e})=>e),c=e=>(0,i.Mz)(s(e),({connection_warnings:e})=>e||{[l.L.DOWNTIMES]:[],[l.L.PACKET_LOSS]:[],[l.L.HIGH_LATENCIES]:[]}),d=e=>(0,i.Mz)(s(e),({speedtest_historical:e})=>e||[])},75354(e,t,n){n.d(t,{A:()=>R});var i=n(296540),a=n(814942),r=n.n(a),l=n(776248),o=n.n(l),s=n(837407),m=n.n(s),c=n(580351),d=n.n(c),A=n(128153),u=n.n(A),E=n(258407),p=n.n(E),h=n(324837),_=n.n(h),g=n(89189),I=n.n(g),N=n(990292),C=n.n(N),O=n(127403),S=n.n(O),x=n(590517),T=n.n(x),v=n(778899),f=n.n(v),y=n(894713),M=n.n(y),D=n(296713),w=n.n(D),L=n(916537);const R=({uptime:e=0})=>{const t=new Date;let n=r()(t,e);const a=e=>(n=e,n),l=o()(t,n),s=u()(t,a(C()(n,l))),c=m()(t,a(T()(n,s))),A=I()(t,a(S()(n,c))),E=_()(t,a(w()(n,A))),h=p()(t,a(M()(n,E))),g=d()(t,a(f()(n,h)));let N="DASHBOARD_DURATION_SECONDS";return l?N="DASHBOARD_DURATION_YEARS":s?N="DASHBOARD_DURATION_MONTHS":c?N="DASHBOARD_DURATION_WEEKS":A?N="DASHBOARD_DURATION_DAYS":E?N="DASHBOARD_DURATION_HOURS":h&&(N="DASHBOARD_DURATION_MINUTES"),i.createElement(L.sA,{id:N,values:{years:l,months:s,weeks:c,days:A,hours:E,minutes:h,seconds:g}})}},224948(e,t,n){n.d(t,{A:()=>d});var i=n(296540),a=n(217439),r=n(71479),l=n(566723),o=n(294303),s=n(689965);const m=(0,r.A)("div")`
  margin-right: ${l.kc};
`,c=(0,r.A)("div")`
  margin-left: ${l.kc};
`,d=({icon:e,closeIcon:t,nested:n,children:r,...l})=>i.createElement(s.A,{nested:n,...l},i.createElement(o.A,null,i.createElement(m,null,e),i.createElement(a.A,{size:"medium"},r),t?i.createElement(c,null,t):null))},22169(e,t,n){n.d(t,{A:()=>m});var i=n(296540),a=n(217439),r=n(916537),l=n(115829),o=n(39705),s=n(294303);const m=({ipv6:e,size:t="inherit",color:n="inherit"})=>{const m=e?.[0];return m?i.createElement(s.A,{width:"100%",justifyContent:"flex-end"},i.createElement(l.A,{flexProps:{justifyContent:"flex-end",alignItems:"center"},color:n,size:t},m),e?.length>1?i.createElement(o.A,{items:e,isInteractive:!0,showListMarkers:!1,getItemKey:e=>e,renderListItem:e=>i.createElement(i.Fragment,null,e),renderMultipleItemsSummary:()=>null}):null):i.createElement(a.A,{size:t,color:n},i.createElement(r.sA,{id:"COMMON_FALLBACK"}))}},689965(e,t,n){n.d(t,{A:()=>E,I:()=>i});var i,a=n(296540),r=n(822336),l=n(963724),o=n(71479),s=n(825032),m=n(566723),c=n(294303),d=n(311785);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const A=(0,o.A)(c.A,(0,d.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||r.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>r.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,o.A)(l.A,(0,d.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||r.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||r.Ay[t===s.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${m.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${m.Ln} ${m.Ln};
      }
    }
  }
`,E=({type:e,marginBottom:t,margin:n,padding:r,flex:l,width:o,nested:s,...m})=>"items"in m?a.createElement(u,{marginBottom:t,margin:n,padding:r,flex:l,nested:s,...m}):a.createElement(A,{nested:s,width:o,marginBottom:t,margin:n,padding:r,flex:l,isButtonList:e===i.BUTTON_LIST,...m},m.children)},819127(e,t,n){n.d(t,{A:()=>l});var i=n(296540),a=n(766624),r=n(530813);const l=function({items:e,getItemKey:t,renderItem:n,maxItemCount:l,renderShowMore:o,showListMarkers:s,title:m,position:c,isInteractive:d,cursorType:A,listGap:u,iconProps:E}){return i.createElement(a.A,{title:m,position:c,isInteractive:d,cursorType:A,description:i.createElement(r.A,{items:e,getItemKey:t,renderItem:n,maxItemCount:l,listGap:u,renderShowMore:o,showListMarkers:s}),iconProps:E})}},39705(e,t,n){n.d(t,{A:()=>m});var i=n(296540),a=n(705145),r=n(916537),l=n(115829),o=n(424135),s=n(819127);const m=function({items:e,renderMultipleItemsSummary:t,renderListItem:n,renderNoItems:m,getItemKey:c,enabled:d=!0,showListMarkers:A,cursorType:u,isInteractive:E}){const p=d?"inherit":"disabled";return e.length>1?i.createElement(o.A,{tooltip:i.createElement(s.A,{items:e,getItemKey:c,renderItem:n,showListMarkers:A,isInteractive:E,cursorType:u})},i.createElement(l.A,{color:p,cursorType:u},t(e))):1===e.length?i.createElement(l.A,{color:p,cursorType:u},n(e[0])):m?i.createElement(i.Fragment,null,m()):i.createElement(a.A,{isTruncated:!0,color:p},i.createElement(r.sA,{id:"COMMON_FALLBACK"}))}},424135(e,t,n){n.d(t,{A:()=>l});var i=n(296540),a=n(566723),r=n(294303);const l=({children:e,tooltip:t})=>i.createElement(r.A,{maxWidth:"100%",overflow:"hidden",gap:a.YC,alignItems:"center"},e?i.createElement(r.A,{flex:1,overflow:"hidden"},e):null,t)},86571(e,t,n){n.d(t,{A:()=>l});var i=n(296540),a=n(217439),r=n(916537);const l=({id:e,children:t,values:n})=>i.createElement(a.A,{color:"text-1",weight:"bold",size:"medium"},e?i.createElement(r.sA,{id:e,values:n}):null,t)},579320(e,t,n){n.r(t),n.d(t,{default:()=>Ye});var i,a=n(296540),r=n(469733),l=n(592510),o=n(86571),s=n(689965),m=n(479403),c=n(91255),d=n(780811),A=n(566723),u=n(294303),E=n(916537),p=n(195462),h=n(945132);!function(e){e.NEUTRAL="neutral",e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger"}(i||(i={}));var _=n(217439),g=n(822336),I=n(823858),N=n(71479),C=n(311785);const O=(0,N.A)(u.A)`
  width: 336px;
  padding: ${A.Ln} ${A.xO};
  margin-bottom: ${A.S2};
  background-color: ${({theme:{themeName:e}})=>g.Ay[`desktop-color-neutral-02-${e}`]};
`,S=(0,N.A)(I.A,(0,C.A)("color"))`
  margin-right: ${A.xO};
  color: ${({theme:{motifPalette:e},color:t})=>e[t]};
`,x=({isHighLatency:e,isPacketLoss:t,latencyState:n})=>e||t?a.createElement(O,null,a.createElement(S,{size:"original",variant:"twoTone",color:t?"danger":n}),a.createElement(_.A,{size:"small",color:"text-2"},a.createElement(E.sA,{id:e&&t?"DASHBOARD_ISP_HIGH_LAT_PACKET_LOSS":e?"DASHBOARD_ISP_HIGH_LAT":"DASHBOARD_ISP_PACKET_LOSS"})," ",a.createElement(E.sA,{id:"DASHBOARD_ISP_RESTART"}))):null;var T=n(618983),v=n(6510),f=n(381377),y=n(747065),M=n(568777);const D=(0,N.A)(u.A,(0,C.A)("latencyState"))`
  border-bottom: 1px solid ${({theme:{motifPalette:e},latencyState:t})=>e[t]};
`,w=(0,N.A)(u.A,(0,C.A)("content","isIsp"))`
  &:after {
    content: ${({content:e})=>`'${e}'`};
    position: absolute;
    ${({isIsp:e=!1})=>`\n      width: ${e?"150px":"200%"};\n      left: ${e?"0":"-100%"};\n      text-align: ${e?"start":"end"};\n    `}
    bottom: -25%;
    white-space: nowrap;
    font-weight: 600;
    font-size: 10px;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-bottom: -${A.YC};
  }
`,L=(0,a.memo)(({formatMessage:e,model:t,type:n,latencyState:r,serviceProviderName:l,serviceProviderAsn:o})=>a.createElement(u.A,{position:"relative",width:"100%",alignItems:"center",justifyContent:"space-between",marginTop:A.kc},a.createElement(w,{position:"relative",content:l||e({id:"COMMON_ISP"}),isIsp:!0},a.createElement(u.A,{width:25,maxWidth:25,minWidth:25,height:45,maxHeight:45,minHeight:45},a.createElement(M.A,{style:{width:"25px",objectFit:"contain"},asn:o,name:l,useFallback:!0}))),a.createElement(D,{position:"absolute",width:"calc(100% - 28px)",left:25,latencyState:r},(0,a.createElement)((0,N.A)(r===i.SUCCESS?T.A:I.A,(0,C.A)("latencyState"))`
  position: absolute;
  left: calc(50% - 12.5px);
  margin-top: 8px;
  color: ${({theme:{motifPalette:e},latencyState:t})=>e[t]};
`,{latencyState:r,size:"medium",variant:"twoTone"})),a.createElement(w,{position:"relative",content:t&&n?(0,v.Lm)(t):e({id:"COMMON_NON_UNIFI_GW"})},t&&n?a.createElement(y.A,{model:t,type:n,size:45}):a.createElement(f.A,null))));var R=n(340936),b=n(325898),k=n(936344),P=n(282556),$=n(602021),z=n(198494),H=n(831743),U=n(66706),G=n(112142);const B={[i.DANGER]:30,[i.WARNING]:15};var W=n(825032);const F="ispGraphGradientId",Y={[W.S.LIGHT]:{[i.NEUTRAL]:"#D6D9E2",[i.SUCCESS]:"#88E0A2",[i.WARNING]:"#FFDB1A",[i.DANGER]:"#F03A3E"},[W.S.DARK]:{[i.NEUTRAL]:"#333543",[i.SUCCESS]:"#30AD55",[i.WARNING]:"#D9BA16",[i.DANGER]:"#CC3135"}};var K=n(506327);const j=({y:e,x:t,latency_max:n,formatTimestamp:i})=>a.createElement(u.A,{flexDirection:"column",gap:A.YC},a.createElement(u.A,{justifyContent:"space-between"},a.createElement(_.A,{color:"text-1",size:"small"},a.createElement(E.sA,{id:"COMMON_TIME"})),a.createElement(_.A,{color:"text-2",size:"small"},i(t)," - ",i(t+3e5))),a.createElement(u.A,{justifyContent:"space-between"},a.createElement(_.A,{color:"text-1",size:"small"},a.createElement(E.sA,{id:"COMMON_AVERAGE"})),a.createElement(_.A,{color:"text-2",size:"small"},a.createElement(E.sA,{id:"COMMON_UNIT_MILLISECONDS_SHORT",values:{value:e}}))),a.createElement(u.A,{justifyContent:"space-between"},a.createElement(_.A,{color:"text-1",size:"small"},a.createElement(E.sA,{id:"COMMON_MAXIMUM"})),a.createElement(_.A,{color:"text-2",size:"small"},a.createElement(E.sA,{id:"COMMON_UNIT_MILLISECONDS_SHORT",values:{value:n}})))),V=({downtimes:e,formatTimestamp:t})=>a.createElement(u.A,{flexDirection:"column",gap:A.YC},a.createElement(_.A,{color:"text-1",size:"small",weight:"bold"},a.createElement(E.sA,{id:"COMMON_INTERNET_DISCONNECTED"})),(e||[]).map(({id:e,downtime_in_seconds:n,timestamp:i})=>a.createElement(u.A,{key:e,alignItems:"center",gap:A.YC},a.createElement(K.A,{status:"destructive"}),a.createElement(_.A,{style:{marginLeft:A.YC},color:"text-2",size:"small"},t(i)," - ",t(i+1e3*n))))),Z=(e,t,n,r)=>()=>{const l=100*Math.min(Math.max(n,0),t)/t,o=l-100*Math.min(B[i.DANGER],t)/t,s=l-100*Math.min(B[i.WARNING],t)/t;return a.createElement("defs",null,a.createElement("linearGradient",{id:e,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},o>0?a.createElement("stop",{offset:`${o}%`,stopColor:Y[r][i.DANGER],stopOpacity:.7}):null,s>0?a.createElement("stop",{offset:`${s}%`,stopColor:Y[r][i.WARNING],stopOpacity:.7}):null,a.createElement("stop",{offset:"100%",stopColor:Y[r][i.SUCCESS],stopOpacity:.7})))},q=(e,t,n)=>Y[n][t?i.DANGER:e<1&&i.NEUTRAL||e>B[i.DANGER]&&i.DANGER||e>B[i.WARNING]&&i.WARNING||i.SUCCESS],Q=({width:e,height:t,highestYAxis:n,motif:i,formatTimestamp:r})=>({left:l,top:o,hidden:s,y:m=0,x:c=0,custom:{latency_max:d,downtimes:A,downtime:E}={latency_max:0,downtime:!1,downtimes:[]}})=>a.createElement(a.Fragment,null,a.createElement(G.A,{width:200,left:l,top:o-4,description:E?a.createElement(V,{formatTimestamp:r,downtimes:A}):a.createElement(j,{formatTimestamp:r,y:m,x:c,latency_max:d}),hidden:s||m<0||!n,tooltipProps:{maxWidth:"auto",...l&&e&&{position:l<Math.round(e/2)?"topLeft":"topRight"},offset:16}}),a.createElement(u.A,{position:"absolute",top:0,left:0},a.createElement("svg",{width:e,height:t},n&&l&&o?a.createElement(U.A,{hasAnimation:!1,x:l,y:o,color:q(m,E,i)}):null)));var X=n(162420),J=n(180524);const ee=(0,a.memo)(()=>a.createElement(u.A,{alignItems:"center",marginBottom:A.kc,gap:A.kc},a.createElement(_.A,{size:"medium",color:"text-1"},a.createElement(E.sA,{id:"COMMON_LATENCY"})," (",a.createElement(E.sA,{id:"COMMON_UNIT_MS"}),")"),a.createElement(J.A,{description:a.createElement(E.sA,{id:"DASHBOARD_PING_SERVER"})},a.createElement("span",null,a.createElement(X.A,{isActive:!0}))))),te=({uplinkStatusStatistics:e,formatMessage:t})=>{const{motif:n}=(0,b.A)(),i=(0,a.useRef)(null),l=(0,r.useSelector)($.hq),o=(0,r.useSelector)(P.zi),s=(0,r.useSelector)(z.BQ),{ref:m,width:c=0,height:d=0}=(0,R.A)(),{chartData:A,highestYAxis:E}=(0,a.useMemo)(()=>{let t=0;return{chartData:e.map(({latency:e,timestamp:n,latency_max:i,downtime:a,downtimes:r})=>(e>t&&(t=e),{x:n,y:a?0:Math.max(.5,e),custom:{latency_max:i,downtime:a,downtimes:r}})),highestYAxis:t}},[e]),_=Math.max(60,E),g=(0,a.useMemo)(()=>((e,t)=>{const n=e[0]?.timestamp||Date.now()-h.jU,i=e.length>1&&e.at(-1)?.timestamp||Date.now(),a=i-n<h.$_;return(0,p.v)([n,i],5).map((e,r,l)=>({value:e,label:0===r?t({id:a?"COMMON_GRANULARITY_MINS_CUSTOM":"COMMON_GRANULARITY_HRS_CUSTOM"},{...a?{minutes:Math.ceil((i-n)/6e4)}:{hours:Math.ceil((i-n)/h.$_)}}):r===l.length-1&&t({id:"COMMON_NOW"})||null}))})(e,t),[e,t]),I=(0,a.useMemo)(()=>(0,p.Y)(_,5),[_]),N=(0,a.useCallback)(e=>new Intl.DateTimeFormat(o,{timeZone:l,hourCycle:s,hour:"numeric",minute:"2-digit"}).format(e),[o,l,s]);return a.createElement(u.A,{width:"100%",height:"100%",flexDirection:"column"},a.createElement(ee,null),a.createElement(u.A,{ref:m,minHeight:190,position:"relative",width:"100%"},a.createElement(k.A,{xAxis:g,yAxis:I,width:c,height:d,margin:[20,5,30,20]},(({chartData:e,width:t,height:n,tooltipContainer:i,maxYAxis:r,highestYAxis:l,motif:o,formatTimestamp:s})=>(m,c,d,A,u,E,p,h,_,g)=>a.createElement(H.A,{data:e,maxY:d,mouseData:c,getCoordinates:m,lineColor:"transparent",variant:"gradientArea",interpolation:"curved",customGradientId:F,allowCustomDots:!0,renderCustomGradient:Z(F,r,l,o),tooltipPortal:i?.current,yAxisMax:E,yAxisMin:p,y2AxisMax:h,y2AxisMin:_,showTooltip:g,renderTooltip:Q({width:t,height:n,highestYAxis:l,formatTimestamp:s,motif:o})}))({chartData:A,width:c,height:d,tooltipContainer:i,maxYAxis:_,highestYAxis:E,motif:n,formatTimestamp:N})),a.createElement("div",{ref:i})))},ne=(0,a.memo)(({availability:e,latency:t,model:n,type:r,isWanConnected:l,serviceProviderName:o,serviceProviderAsn:s,wanIspStatus:{statistics:m=[],latency_threshold:c}={statistics:[],latency_threshold:0}})=>{const{formatMessage:d}=(0,E.tz)(),p=(0,a.useMemo)(()=>((e,t)=>{if(e&&t){if(e>2*t)return i.DANGER;if(e>t)return i.WARNING}return i.SUCCESS})(t,c),[t,c]);return a.createElement(u.A,{width:"100%",height:"100%",flexDirection:"column",paddingBottom:A.kc},a.createElement(x,{isPacketLoss:e<100,isHighLatency:p!==i.SUCCESS,latencyState:p}),a.createElement(te,{uplinkStatusStatistics:m,formatMessage:d}),a.createElement(L,{model:n,type:r,formatMessage:d,latencyState:l?p:i.DANGER,serviceProviderName:o,serviceProviderAsn:s}))});var ie=n(271856),ae=n(882675);const re={[ae.L.DOWNTIMES]:"COMMON_INTERNET_DISCONNECTED",[ae.L.PACKET_LOSS]:"DASHBOARD_MODULE_INTERNET_PACKET_LOSS",[ae.L.HIGH_LATENCIES]:"DASHBOARD_MODULE_INTERNET_HEALTH_LATENCY"},le={[ae.L.DOWNTIMES]:null,[ae.L.PACKET_LOSS]:"DASHBOARD_MODULE_INTERNET_PACKET_LOSS_NOTICE",[ae.L.HIGH_LATENCIES]:null};var oe=n(75354);const se=e=>"downtime_in_seconds"in e,me=(0,N.A)(u.A,(0,C.A)("ispConnectionWarning"))`
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border-width: 1px;
  border-style: solid;
  ${({theme:{themeName:e},ispConnectionWarning:t})=>`\n    border-color: ${t===ae.L.HIGH_LATENCIES?g.Ay[`desktop-color-orange-06-${e}`]:g.Ay[`desktop-color-red-06-${e}`]};\n    background-color: ${t===ae.L.PACKET_LOSS?"transparent":t===ae.L.HIGH_LATENCIES?g.Ay[`desktop-color-orange-06-${e}`]:g.Ay[`desktop-color-red-06-${e}`]};\n  `}
`,ce=(0,N.A)("span")`
  &:after {
    content: '|';
  }
  margin: 0 ${A.kc};
  color: ${({theme:{themeName:e}})=>g.Ay[`desktop-color-neutral-03-${e}`]};
`,de=({ispConnectionWarningValues:e,dateTimeFormat:t})=>a.createElement(u.A,{flexDirection:"column",gap:A.YC},e.sort((e,t)=>(se(t)?t.timestamp:t.timestamp_start)-(se(e)?e.timestamp:e.timestamp_start)).slice(0,20).map(e=>{return n=se(e)?e.timestamp:e.timestamp_start,i=se(e)?e.downtime_in_seconds:(e.timestamp_end-e.timestamp_start)/1e3,a.createElement(_.A,{key:n,size:"small",color:"text-1"},n>0?t.format(n):null,n>0&&i>0?a.createElement(a.Fragment,null," - "):null,i>0?a.createElement(oe.A,{uptime:i}):null);var n,i})),Ae=({ispConnectionWarningValue:e,dateTimeFormat:t})=>{return n=se(e)?e.timestamp:e.timestamp_start,i=se(e)?e.downtime_in_seconds:(e.timestamp_end-e.timestamp_start)/1e3,a.createElement(a.Fragment,null,n>0?t.format(n):null,n>0&&i>0?a.createElement(ce,null):null,i>0?a.createElement(oe.A,{uptime:i}):null);var n,i},ue=(0,a.memo)(({networkgroup:e})=>{const t=(0,r.useSelector)($.hq),n=(0,r.useSelector)(P.zi),i=(0,r.useSelector)(z.BQ),l=Object.entries((0,r.useSelector)((0,a.useMemo)(()=>(0,m.IB)(e),[e]))).filter(([e,t=[]])=>Boolean(t.length)),o=(0,a.useMemo)(()=>new Intl.DateTimeFormat(n,{hourCycle:i,timeZone:t,month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}),[n,i,t]);return l.length?a.createElement(u.A,{flexDirection:"column",width:"100%",gap:A.kc},l.map(([e,t])=>a.createElement(u.A,{key:e,alignItems:"center",gap:A.Ln},a.createElement(me,{ispConnectionWarning:e}),a.createElement(u.A,{flexDirection:"column"},a.createElement(u.A,{alignItems:"center",gap:A.YC},a.createElement(_.A,{size:"medium",color:"text-1"},a.createElement(E.sA,{id:re[e]||"COMMON_UNKNOWN"})),le[e]?a.createElement(ie.A,{width:320,portal:!0,description:a.createElement(E.sA,{id:le[e]})},a.createElement(X.A,{isActive:!0})):null),a.createElement(_.A,{size:"small",color:"text-3"},t.length>1?a.createElement(u.A,{alignItems:"center",gap:A.kc},a.createElement(E.sA,{id:"DASHBOARD_MULTIPLE_TIMES"}),a.createElement(ie.A,{width:"100%",maxWidth:"max-content",description:a.createElement(de,{ispConnectionWarningValues:t,dateTimeFormat:o}),portal:!0},a.createElement(X.A,{isActive:!0}))):a.createElement(Ae,{ispConnectionWarningValue:t[0],dateTimeFormat:o})))))):a.createElement(_.A,{color:"text-3",size:"medium"},a.createElement(E.sA,{id:"DASHBOARD_MODULE_INTERNET_NO_EV"}))});var Ee=n(777916),pe=n(383653),he=n(137298),_e=n(568560),ge=n(22169),Ie=n(115829),Ne=n(519680),Ce=n(745667),Oe=n(817518),Se=n(634229),xe=n(896291),Te=n(811822);const ve=(0,N.A)(u.A)`
  flex-direction: column;
  gap: ${A.kc};
  white-space: nowrap;
`,fe=(0,N.A)(u.A)`
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: ${A.Ln};
`,ye=(0,a.memo)(({lan_ip:e,ip:t,ipv6:n,latency:i,port_idx:o,configuration:m,service_provider:c,statistics:d,isWanUp:A,isWanConnected:p,wanIspStatus:h,wanDhcpv6PdSize:g})=>{const I=(0,r.useDispatch)();(0,a.useEffect)(()=>{I((0,Ce.hh)(void 0,{crudCacheStrategy:{type:l.e.CACHE}})),I((0,Se.Sk)(void 0,{crudCacheStrategy:{type:l.e.CACHE}})),I((0,xe.N)(void 0,{crudCacheStrategy:{type:l.e.CACHE}}))},[I]);const N=(0,a.useMemo)(()=>m?.wan_type_v6&&m?.wan_type_v6!==Oe.c.DISABLED?(0,Ne.Ae)(m.wan_type_v6,m?.wan_ipv6,n):[],[m?.wan_ipv6,m?.wan_type_v6,n]);return a.createElement(s.A,null,a.createElement(ve,null,a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"COMMON_STATUS"})),a.createElement(_.A,{color:"text-3",size:"medium"},a.createElement(E.sA,{id:A?p?"COMMON_ONLINE":"COMMON_OFFLINE":"COMMON_DISCONNECTED"}))),t?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"COMMON_WAN_IP_ADDRESS"}),o?a.createElement(a.Fragment,null," (",a.createElement(E.sA,{id:"COMMON_PORT"})," ",o,")"):null),a.createElement(_.A,{color:"text-3",size:"medium"},t)):null,e?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"COMMON_GATEWAY_IP"})),a.createElement(_.A,{color:"text-3",size:"medium"},e)):null,N.length?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"COMMON_WAN_IP_V6"})),a.createElement(u.A,{flex:"1",minWidth:"0",justifyContent:"flex-end"},a.createElement(_e.A,{ipv6:N,size:"medium",color:"text-3"}))):null,g&&N.length?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"COMMON_IPV6_PREFIX"})),a.createElement(u.A,{flex:"1",minWidth:"0",justifyContent:"flex-end"},a.createElement(ge.A,{ipv6:[`${(0,pe.Gh)(N[0],g)}/${g}`],color:"text-3",size:"medium"}))):null,Number.isFinite(i)?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"COMMON_LATENCY"})),a.createElement(_.A,{color:"text-3",size:"medium"},a.createElement(E.sA,{id:"COMMON_UNIT_MILLISECONDS_SHORT",values:{value:i>0?i:"<1"}}))):null,c?.name?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"COMMON_SERVICE_PROVIDER"})),a.createElement(Ie.A,{color:"text-3",size:"medium",flexProps:{justifyContent:"end"}},c.name)):null,c?.city?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"COMMON_LABEL_LOCATION"})),a.createElement(_.A,{color:"text-3",size:"medium"},c.city)):null,m?.wan_provider_capabilities?.download_kilobits_per_second?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"DASHBOARD_ISP_PROPERTY_DOWNLOAD_CAPACITY"})),a.createElement(Ee.A,{type:"bytes",input:(0,he.Zz)(m.wan_provider_capabilities.download_kilobits_per_second),options:"bitrate",color:"tertiary",size:"body"})):null,m?.wan_provider_capabilities?.upload_kilobits_per_second?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"DASHBOARD_ISP_PROPERTY_UPLOAD_CAPACITY"})),a.createElement(Ee.A,{type:"bytes",input:(0,he.Zz)(m.wan_provider_capabilities.upload_kilobits_per_second),options:"bitrate",color:"tertiary",size:"body"})):null,(0,Te.Et)(h?.uptime)?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"COMMON_UPTIME"})),a.createElement(_.A,{size:"medium",color:"text-3"},h.uptime,"%")):null,d?.peak_usage?.download_percentage&&-1!==d.peak_usage.download_percentage&&d.peak_usage?.upload_percentage&&1!==d.peak_usage.upload_percentage?a.createElement(fe,null,a.createElement(_.A,{color:"text-1",size:"medium"},a.createElement(E.sA,{id:"DASHBOARD_PEAK_UTILIZATION"})),a.createElement(_.A,{size:"medium",color:"text-3"},`${Math.min(d.peak_usage.download_percentage,100).toFixed(0)}% / ${Math.min(d.peak_usage.upload_percentage,100).toFixed(0)}%`)):null))});var Me,De=n(382389),we=n(592563),Le=n(956347),Re=n(224948),be=n(746289);!function(e){e.INITIALIZING="INITIALIZING",e.ACTIVE="ACTIVE",e.CONNECTION_ISSUE="CONNECTION_ISSUE",e.IP_CONFLICT="IP_CONFLICT"}(Me||(Me={}));var ke=n(928085),Pe=n(959341);const $e="192.168.100.0/24";var ze=n(845030),He=n(398300),Ue=n(366188),Ge=n(959207),Be=n(968906);const We=(0,N.A)(u.A)`
  flex-direction: column;
`,Fe=({service_provider:e,isp_stats:t})=>{const{themeName:n}=(0,De.u)(),i=(0,r.useDispatch)(),l=(0,Le.W6)(),o=(0,ke.A)(Pe.Cs),s=(0,r.useSelector)(Ue.Ct),m=(0,a.useMemo)(()=>s.find(e=>(0,Ge.mC)(e)===$e)?._id,[s]),c=(0,a.useMemo)(()=>[[e?.name?.toLowerCase()===be.ej.toLowerCase()&&(t?.status===Me.CONNECTION_ISSUE||t?.status===Me.IP_CONFLICT),a.createElement(X.A,{variant:"fill",size:"original",color:g.Ay[`desktop-color-ublue-06-${n}`]}),(()=>{switch(t?.status){case Me.CONNECTION_ISSUE:return{id:"DASHBOARD_STARLINK_GATEWAY_NOTIFICATIONS"};case Me.IP_CONFLICT:return{id:"DASHBOARD_STARLINK_IP_NOTIFICATIONS",values:{starlinkSubnet:$e,link:a.createElement(we.A,{type:"button",onClick:()=>{m?i((0,ze.XP)({type:He.H.NETWORK,id:m})):l.push(o)},...Be.A.addDataTestId(Be.A.TestId.SIDE_PANEL_TRIGGER)},a.createElement(E.sA,{id:"DASHBOARD_STARLINK_IP_ACTION"}))},headerId:"DASHBOARD_STARLINK_IP_HEADER"};default:return{id:void 0}}})()]],[e?.name,n,t?.status,i,l,o,m]);return a.createElement(We,null,c.map(([e,t,{id:n,values:i,headerId:r}])=>e?a.createElement(Re.A,{key:n,icon:t},r?a.createElement(a.Fragment,null,a.createElement(_.A,{size:"medium",weight:"bold",color:"text-1"},a.createElement(E.sA,{id:r})),a.createElement("br",null)):null,a.createElement(E.sA,{id:n,values:i})):null))},Ye=({activeItem:{ip:e,ipv6:t,availability:n,latency:i,port_idx:A,configuration:u,details:{service_provider:E,isp_stats:p},statistics:h,model:_,type:g,lan_ip:I,networkgroup:N,isWanUp:C,isWanConnected:O,wan_dhcpv6_pd_size:S}})=>{const x=(0,r.useDispatch)(),T=(0,r.useSelector)((0,a.useMemo)(()=>(0,m.nN)(N),[N])),v=(0,a.useMemo)(()=>(0,d.oWO)({type:g}),[g]),f=(0,a.useMemo)(()=>[{id:"internetQuality",openByDefault:!0,label:a.createElement(o.A,{id:"DASHBOARD_MODULE_INTERNET_QUALITY"}),renderContent:()=>a.createElement(ne,{latency:i,model:_,type:g,availability:n,isWanConnected:O,serviceProviderName:E?.name,serviceProviderAsn:E?.asn,wanIspStatus:T})}],[i,_,g,n,O,E?.name,E?.asn,T]),y=(0,a.useMemo)(()=>[{id:"internetEventLogs",openByDefault:!0,label:a.createElement(o.A,{id:"DASHBOARD_MODULE_INTERNET_EV_LOG"}),renderContent:()=>a.createElement(ue,{networkgroup:N})}],[N]);return(0,a.useEffect)(()=>{x((0,c.T)(N,void 0,{crudCacheStrategy:{type:l.e.CACHE}}))},[x,N]),a.createElement(a.Fragment,null,a.createElement(Fe,{service_provider:E,isp_stats:p}),a.createElement(ye,{ip:e,lan_ip:I,ipv6:t,latency:i,port_idx:A,configuration:u,service_provider:E,statistics:h,isWanUp:C,isWanConnected:O,wanIspStatus:T,wanDhcpv6PdSize:S}),v?null:a.createElement(a.Fragment,null,a.createElement(s.A,{type:s.I.ACCORDION,items:f}),a.createElement(s.A,{type:s.I.ACCORDION,items:y})))}},766624(e,t,n){n.d(t,{A:()=>s});var i=n(296540),a=n(271856),r=n(709690),l=n(284428),o=n(566723);const s=({description:e,isInteractive:t,portal:n=!0,cursorType:s,title:m,position:c,width:d,iconProps:A,disabled:u=!1})=>{const E=(0,l.Im)()||u,p=(0,l.q)();return i.createElement(a.A,{description:e,portal:n,isInteractive:t,style:{display:"flex",alignItems:"center"},cursorType:s,title:m,position:c,width:d,disableHover:p},i.createElement(r.A,{isActive:!0,size:"original",opacity:E?o.xN:void 0,...A}))}},971550(e,t,n){n.d(t,{A:()=>c,N:()=>s});var i=n(296540),a=n(71479),r=n(566723),l=n(294303),o=n(311785);const s=(0,a.A)(l.A,(0,o.A)("isPortrait","isGateway","isUdm"))`
  ${({isPortrait:e,isGatewayType:t,isUdm:n})=>`\n      padding-bottom: ${e?r.kc:"initial"};\n      height: ${e?"100%":"auto"};\n      display: flex;\n      align-items: center;\n      img {\n        width: ${(n?"20px":t&&"70%")||"inherit"};\n        height: ${(n?"40px":e&&"inherit")||"unset"} !important;\n      }  \n    `}
`,m=(0,a.A)(l.A)`
  img {
    object-position: right;
  }
`,c=({children:e,size:t=60,flexProps:n={}})=>i.createElement(m,{justifyContent:"flex-end",width:t,maxWidth:t,minWidth:t,height:t,maxHeight:t,minHeight:t,overflow:"hidden",zIndex:1,...n},e)},747065(e,t,n){n.d(t,{A:()=>s});var i=n(296540),a=n(876250),r=n(6176),l=n(768195),o=n(971550);const s=(0,i.memo)(({model:e,type:t,size:n,flexProps:s={}})=>i.createElement(o.A,{size:n,flexProps:s},i.createElement(o.N,{alignContent:"center",justifyContent:"center",isPortrait:!1,isGatewayType:t===l.bq.UGW,isUdm:e===l.W4.UDM},i.createElement(r.A,{height:"100%",width:"100%",size:a.Xh.MEDIUM,variant:a.Hx.NOPADDING,model:e}))))},381377(e,t,n){n.d(t,{A:()=>o});var i=n(296540),a=n(469733),r=n(130851),l=n(971550);const o=({size:e=45})=>{const t=(0,a.useSelector)(r.p);return i.createElement(l.A,{size:e,flexProps:{alignItems:"center"}},i.createElement("img",{style:{width:"100%"},src:`${t}/device/generic.png`,alt:"Gateway"}))}},568560(e,t,n){n.d(t,{A:()=>p});var i=n(296540),a=n(469733),r=n(217439),l=n(895795),o=n(383653),s=n(742920),m=n(115829),c=n(39705),d=n(294303),A=n(675359),u=n(916537),E=n(348466);const p=({ipv6:e=[],enabled:t=!0,size:n="inherit",color:p="inherit",showOnlyPrefix:h=!1})=>{const _=(0,a.useDispatch)(),g=(0,i.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{_((0,A.ox)({icon:s.C.success,message:"COMMON_COPIED_TO_CLIPBOARD"}))})},[_]),I=(0,i.useCallback)((e,t)=>{t.stopPropagation(),t.preventDefault(),g(e)},[g]),N=(0,i.useMemo)(()=>(e=>{const t=e=>(0,o.G8)(e)?0:(0,o.ZV)(e)?1:2;return e.sort((e,n)=>t(e)-t(n))})(e||[]).map(e=>{const[t,n]=e.split(E.Ed);return h?`${(0,o.Gh)(t,Number(n))}/${n}`:(0,o.z2)(e)}),[e,h]),C=N?.[0];return C?i.createElement(d.A,{maxWidth:"100%",justifyContent:"flex-end"},i.createElement(m.A,{enabled:t,flexProps:{justifyContent:"flex-end",alignItems:"center"},color:t?p:"disabled",size:n},C),N?.length>1?i.createElement(c.A,{items:N,isInteractive:!0,showListMarkers:!1,getItemKey:e=>e,renderListItem:e=>i.createElement(i.Fragment,null,e,i.createElement(l.A,{size:"original",actionable:!0,onClick:t=>I(e,t)})),renderMultipleItemsSummary:()=>null}):i.createElement(l.A,{size:"original",actionable:!0,onClick:e=>I(C,e)})):i.createElement(r.A,{size:n,color:t?p:"disabled"},i.createElement(u.sA,{id:"COMMON_FALLBACK"}))}},451449(e,t,n){n.d(t,{I:()=>i});const i=(0,n(296540).createContext)({fields:!1,labels:!1,tooltipPopovers:!1,tooltipIcons:!1})},284428(e,t,n){n.d(t,{Im:()=>s,iL:()=>m,mQ:()=>l,pv:()=>r,q:()=>o});var i=n(296540),a=n(451449);function r(){return(0,i.useContext)(a.I)}function l(){return r().fields}function o(){return r().tooltipPopovers}function s(){return r().tooltipIcons}function m(){return r().labels}},195462(e,t,n){n.d(t,{Y:()=>a,v:()=>r});var i=n(847439);const a=(e,t,n=!1)=>{const a=t-1;let r=Math.ceil(e);if(Number.isNaN(r))return[];const l=r%a;return 0!==l&&(r+=a-l),(0,i.A)(t,e=>{return{value:t=e?Math.ceil(e*(r/a)):0,label:n?e%2==0&&String(t)||null:String(t)};var t}).reverse()},r=(e,t)=>{const[n]=e,i=[n],a=e.length-1;for(let n=1;n<t-1;n+=1){const r=n*a/(t-1),l=Math.floor(r).toFixed();i[n]=Math.round(e[l]+(e[Math.ceil(r).toFixed()]-e[l])*(+r-+l))}return i[t-1]=e[a],i}}}]);