"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[17481],{817481(e,i,s){s.r(i),s.d(i,{default:()=>pe});var t=s(274934),a=s(376892),n=s(535322),l=s(956978),r=s(872926),c=s(293705),o=s(369187),d=s(214246),_=s(602086),A=s(309130),I=s(159911),E=s(562896),x=s(249295),m=s(260449),p=s(100978),u=s(45978),h=s(419151),C=s(451336),v=s(729736),j=s(814557),T=s(263705),N=s(421314),O=s(453007),g=s(470070),U=s(434521),D=s(333015),S=s(262768),L=s(920492),P=s(977872),R=s(599110),f=s(938984),b=s(600191),y=s(247816),k=s(590979),M=s(443502),w=s(320509),V=s(743178),B=s(449339),G=s(589650),H=s(205521),F=s(125799),W=s(355108);const $=(0,y.A)(F.A)`
  width: fit-content;
  & > div > button > span > div {
    display: flex;
    & > span {
      margin: 0 !important;
    }
  }
`,z=(0,y.A)(R.A)`
  display: block;
  white-space: nowrap;
  height: 31px;
  padding: 0;
  color: ${({color:e})=>e};
  line-height: 14px;
`,K=(0,y.A)(b.A)`
  margin-right: ${A.kc};
  color: ${M.PA.warning};
`,Y=(0,y.A)("div")`
  width: 170px;
  line-height: 18px;
`,Z=({mac:e,isUnreachable:i,isUnavailable:s})=>{const a=(0,P.wA)(),{formatMessage:n}=(0,g.tz)(),l=i||s,r=i?"LTE_ACTIONS_SUBSCRIPTION_CHECK_UNREACHABLE_TOOLTIP":s?"LTE_ACTIONS_SUBSCRIPTION_CHECK_UNAVAILABLE_TOOLTIP":"LTE_ACTIONS_SUBSCRIPTION_CHECK_TOOLTIP",c=l?"LTE_ACTIONS_SUBSCRIPTION_CHECK_UNAVAILABLE":"LTE_ACTIONS_SUBSCRIPTION_CHECK",o=(0,_.useCallback)(()=>{l||a((0,W.ZS)([e],n))},[l,a,e,n]);return(0,t.jsx)($,{position:"topRight",portal:!0,description:(0,t.jsx)(Y,{children:(0,t.jsx)(g.sA,{id:r})}),children:(0,t.jsxs)(z,{variant:"inline",onClick:o,disabled:l,children:[(0,t.jsx)(K,{size:"original"}),(0,t.jsx)(f.A,{size:"small",color:l?"text-2":"ublue-06",children:(0,t.jsx)(g.sA,{id:c})})]})})};var Q=s(594633),J=s(897166),X=s(570801),q=s(15085),ee=s(221008),ie=s(310379),se=s(807811),te=s(244081);const ae=(0,y.A)(p.A)`
  margin-top: ${A.kc};
  line-height: 1.5;
  text-align: left;
`,ne=(0,y.A)(b.A)`
  margin-right: ${A.kc};
  color: ${M.PA.warning};
`,le=(0,y.A)("div")`
  width: 16px;
  min-width: 16px;
  margin-right: ${A.kc};
`,re=(0,y.A)("div")`
  display: inline-block;
`,ce=({activeItem:e,activeItem:{lte_subscription_status:i,mac:s},deviceIsUlte:a,deviceIsUltePro:n})=>{const l=(0,P.wA)(),r=(0,P.d4)(Q.S$),c=(0,P.d4)(ee.H),o=(0,P.d4)(X.Pk),d=(0,P.d4)(J.dK),A=(0,P.d4)(X.fR),I=(0,_.useMemo)(()=>(0,V.Qh)(r),[r]),E=(0,_.useMemo)(()=>`${se.DU}${I}/payments`,[I]),x=(0,_.useMemo)(()=>d||A,[d,A]),{subscriptionIsApplicable:m,subscriptionIsUnreachable:p,subscriptionIsUnavailable:u,hasUlteNotConnectedWarning:h,hasUlteNotRegisteredWarning:C,hasCountryLockedWarning:v,lteUsageData:j}=(0,_.useMemo)(()=>({subscriptionIsApplicable:(0,D.pW)(e),subscriptionIsUnreachable:(0,D.oe)(e),subscriptionIsUnavailable:a&&!!o&&!(0,D._D)(e,o),hasUlteNotConnectedWarning:(0,U.AO)(e),hasUlteNotRegisteredWarning:(0,U.Ql)(e),hasCountryLockedWarning:(0,U.t7)(c,e),lteUsageData:(0,D.cm)(e)}),[e,a,o,c]),{isApproachingLimit:T,isOverSoftLimit:N}=(0,_.useMemo)(()=>({statusColor:M.PA[j.state],isApproachingLimit:"warning"===j.state||"danger"===j.state&&!j.hasOverages,isOverSoftLimit:j.hasOverages&&!j.isSuspended}),[j]),O=(0,_.useMemo)(()=>x&&(m||p||u),[x,m,p,u]),{ltePaymentPastDue:S,isDeactivatedForNonPayment:L}=(0,_.useMemo)(()=>({ltePaymentPastDue:a&&i===q.Z.PAST_DUE,isDeactivatedForNonPayment:a&&i===q.Z.CANCELED}),[a,i]),b=(0,_.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),l((0,H.XP)({type:B.H.DEVICE,id:s,tab:G.BC.SETTINGS}))},[l,s]);return(0,_.useEffect)(()=>{l((0,ie.v)(void 0,{crudCacheStrategy:{type:te.e.CACHE}}))},[l]),(0,t.jsxs)(t.Fragment,{children:[T?(0,t.jsxs)(ae,{children:[(0,t.jsx)(ne,{size:"original",variant:"fill"}),(0,t.jsx)(f.A,{children:(0,t.jsx)(g.sA,{id:"DEVICE_DATA_USAGE_LTE_APPROACHING_LIMIT",values:{amount:`${j.width}%`}})})]}):null,N?(0,t.jsxs)(ae,{children:[(0,t.jsx)(ne,{size:"original",variant:"fill"}),(0,t.jsx)("div",{children:(0,t.jsx)(g.sA,{id:"DEVICE_DATA_USAGE_LTE_OVER_SOFT_LIMIT",values:{softLimit:(0,w.m0)(j.softLimitBytes),hardLimit:(0,w.m0)(j.hardLimitBytes)}})})]}):null,j.isSuspended?(0,t.jsxs)(ae,{children:[(0,t.jsx)(ne,{size:"original",variant:"fill"}),(0,t.jsx)(g.sA,{id:"DEVICE_DATA_USAGE_LTE_OVER_HARD_LIMIT"})]}):null,"success"!==j.state?(0,t.jsxs)(ae,{children:[(0,t.jsx)(le,{}),(0,t.jsxs)(re,{children:[(0,t.jsx)(g.sA,{id:"DEVICE_DATA_USAGE_LTE_INCREASE_LIMIT"})," ",(0,t.jsx)(R.A,{variant:"inline",onClick:b,...k.A.addDataTestId(k.A.TestId.SIDE_PANEL_TRIGGER),children:(0,t.jsx)(g.sA,{id:"DEVICE_DATA_USAGE_LTE_INCREASE_LIMIT_BUTTON"})})]})]}):null,S||L?(0,t.jsxs)(ae,{children:[(0,t.jsx)(ne,{size:"original",variant:"fill"}),(0,t.jsx)(g.sA,{id:L?"DEVICE_DATA_USAGE_LTE_SERVICE_CANCELED":"DEVICE_DATA_USAGE_LTE_PAYMENT_OVERDUE",values:{link:(0,t.jsx)("a",{href:E,target:"_blank",rel:"noopener noreferrer",children:(0,t.jsx)(g.sA,{id:"COMMON_ACTION_UPDATE_NOW"})})}})]}):null,v?(0,t.jsxs)(ae,{children:[(0,t.jsx)(ne,{size:"original",variant:"fill"}),(0,t.jsx)(g.sA,{id:"DEVICE_PROPERTIES_NOTICE_COUNTRY_LOCKED_WARNING_BODY"})]}):null,h?(0,t.jsxs)(ae,{children:[(0,t.jsx)(ne,{size:"original",variant:"fill"}),(0,t.jsx)(g.sA,{id:"DEVICE_PROPERTIES_NOTICE_ULTE_NOT_CONNECTED_WARNING_BODY"})]}):null,C?(0,t.jsxs)(ae,{children:[(0,t.jsx)(ne,{size:"original",variant:"fill"}),(0,t.jsx)(g.sA,{id:"DEVICE_PROPERTIES_NOTICE_ULTE_NOT_REGISTERED_WARNING_BODY"})]}):null,O&&!n?(0,t.jsx)(Z,{mac:s,isApplicable:m,isUnreachable:p,isUnavailable:u}):null]})},oe=({softLimit:e=0,used:i=0,dataFormat:s,inactive:a=!1})=>{let n="green-06";a?n="text-4":e&&i>=e&&(n="orange-06");const l=j.Ay[`desktop-color-${n}-${(0,T.u)().themeName}`];return(0,t.jsxs)(N.A,{color:"text-3",size:"medium",children:[(0,t.jsx)(O.A,{colorOverride:l,children:(0,v.Ay)(i,"bytes",s)}),e>0?(0,t.jsxs)("span",{children:[" / ",(0,v.Ay)(e,"bytes",s)]}):null]})},de=({activeItem:e,activeItem:{lte_soft_limit:i},deviceIsUlte:s,deviceIsUltePro:a})=>{const n=(0,D.cm)(e);return(0,U.YP)(e)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(L.Ay,{statusCode:n.state,status:(0,S.mR)(e.lte_rat)?(0,t.jsx)(L.lo,{signal:(0,l.KwR)(e),children:e.lte_state===h.Gu.SEARCHING?(0,t.jsx)(g.sA,{id:"DEVICE_ULTE_PRO_SETUP_SEARCHING_INFO"}):e.lte_rat}):null,message:(0,t.jsx)(oe,{softLimit:i,dataFormat:"IEC",used:n.usedBytes}),card_present:!!e.lte_iccid}),(0,t.jsx)(ce,{activeItem:e,deviceIsUlte:s,deviceIsUltePro:a})]}):null};var _e=s(83597);const Ae=({activeItem:e,activeItem:{deviceState:i,uplink:s},deviceIsUlte:a,deviceIsUltePro:n})=>{const r=(0,_.useMemo)(()=>(0,I.H)(i||u.g.UNKNOWN,s?.type),[i,s?.type]),c=r===E.v.OFFLINE;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(x.A,{activeItem:e,isOffline:c,description:(0,t.jsx)(C.A,{activeItem:e,connectionStatus:r}),style:{flex:1},children:[(0,t.jsx)(p.A,{marginTop:A.kc,flexDirection:"column",children:(0,t.jsx)(de,{activeItem:e,signalStrength:(0,l.KwR)(e),rat:e.lte_rat||h.MH.UNKNOWN,deviceIsUlte:a,deviceIsUltePro:n})}),(0,t.jsx)(_e.A,{activeItem:e})]}),c?(0,t.jsx)(m.A,{}):null]})};var Ie=s(215202),Ee=s(664092);const xe=({isFailoverMode:e,...i})=>(0,t.jsxs)(p.A,{gap:A.kc,flexDirection:"column",children:[(0,t.jsx)(Ie.D,{size:"medium",children:(0,t.jsx)(g.sA,{id:"COMMON_SIM"})}),(0,t.jsxs)("div",{children:[e?(0,t.jsxs)(Ee.A,{children:[(0,t.jsx)(f.A,{color:"text-2",children:(0,t.jsx)(g.sA,{id:"COMMON_MODE"})}),(0,t.jsx)(f.A,{color:"text-3",children:(0,t.jsx)(g.sA,{id:e?"COMMON_FAILOVER":"DEVICE_PRIMARY_INTERNET"})})]}):null,(0,t.jsx)(c.A,{...i})]})]});var me=s(216082);const pe=({activeItem:e,activeItem:{adopted:i,ip:s,ipv6:_,mac:A,shortname:I,name:E,type:x,model:m,config_network:p,uplink:u,sys_stats:h,lte_imei:C,lte_failover:v,lte_failover_active:j,lte_networkoperator:T,lte_apn:N,lte_pdptype:O,lte_rat:g,lte_rx_chan:U,lte_tx_chan:D,lte_iccid:S,displayable_version:L,uptime:P}})=>{const R=(0,l.mHb)({model:m});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Ae,{activeItem:e,deviceIsUltePro:R,deviceIsUlte:(0,l.tNJ)({model:m})}),(0,t.jsx)(r.A,{ip:s,adopted:i,config_network:p}),(0,t.jsx)(d.A,{sys_stats:h,ip:s,mac:A,imei:C,displayable_version:L,uptime:P,name:E,type:x,model:m,ipv6:_}),(0,t.jsx)(n.A,{children:(0,t.jsx)(xe,{isFailoverMode:Boolean(v),status:j?c.H.ACTIVE:c.H.STANDBY,networkoperator:T,apn:N,pdp_type:O,rat:g,rx_chan:+(U||0),tx_chan:+(D||0),iccid:S})}),u?.mac?(0,t.jsx)(n.A,{type:n.I.ACCORDION,items:[{id:"uplink",openByDefault:!0,label:(0,t.jsx)(a.A,{id:"COMMON_PARENT_DEVICE"}),renderContent:()=>(0,t.jsx)(o.A,{activeItem:e,deviceIsUltePro:R})}]}):null,(0,t.jsx)(me.A,{shortname:I})]})}}}]);