"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[55581],{24446(e,t,l){l.r(t),l.d(t,{default:()=>de});var n=l(296540),a=l(86571),i=l(689965),r=l(780811),s=l(328787),c=l(190492),o=l(932832),E=l(673283),m=l(566723),_=l(281884),A=l(392699),u=l(124092),d=l(470962),I=l(294303),p=l(602197),v=l(996734),C=l(129361),T=l(489391),N=l(822336),O=l(382389),g=l(115829),U=l(532114),D=l(916537),S=l(837612),h=l(902786),f=l(569299),L=l(282811),P=l(469733),R=l(758649),b=l(217439),y=l(823858),k=l(71479),M=l(968906),x=l(574137),w=l(137298),V=l(778851),B=l(398300),G=l(855019),H=l(845030),F=l(271856),z=l(811569);const W=(0,k.A)(F.A)`
  width: fit-content;
  & > div > button > span > div {
    display: flex;
    & > span {
      margin: 0 !important;
    }
  }
`,$=(0,k.A)(R.A)`
  display: block;
  white-space: nowrap;
  height: 31px;
  padding: 0;
  color: ${({color:e})=>e};
  line-height: 14px;
`,K=(0,k.A)(y.A)`
  margin-right: ${m.kc};
  color: ${x.PA.warning};
`,Y=(0,k.A)("div")`
  width: 170px;
  line-height: 18px;
`,Q=({mac:e,isUnreachable:t,isUnavailable:l})=>{const a=(0,P.useDispatch)(),{formatMessage:i}=(0,D.tz)(),r=t||l,s=t?"LTE_ACTIONS_SUBSCRIPTION_CHECK_UNREACHABLE_TOOLTIP":l?"LTE_ACTIONS_SUBSCRIPTION_CHECK_UNAVAILABLE_TOOLTIP":"LTE_ACTIONS_SUBSCRIPTION_CHECK_TOOLTIP",c=r?"LTE_ACTIONS_SUBSCRIPTION_CHECK_UNAVAILABLE":"LTE_ACTIONS_SUBSCRIPTION_CHECK",o=(0,n.useCallback)(()=>{r||a((0,z.ZS)([e],i))},[r,a,e,i]);return n.createElement(W,{position:"topRight",portal:!0,description:n.createElement(Y,null,n.createElement(D.sA,{id:s}))},n.createElement($,{variant:"inline",onClick:o,disabled:r},n.createElement(K,{size:"original"}),n.createElement(b.A,{size:"small",color:r?"text-2":"ublue-06"},n.createElement(D.sA,{id:c}))))};var Z=l(417378),q=l(602021),J=l(198494),X=l(142394),j=l(252959),ee=l(103595),te=l(727270);const le=(0,k.A)(I.A)`
  margin-top: ${m.kc};
  line-height: 1.5;
  text-align: left;
`,ne=(0,k.A)(y.A)`
  margin-right: ${m.kc};
  color: ${x.PA.warning};
`,ae=(0,k.A)("div")`
  width: 16px;
  min-width: 16px;
  margin-right: ${m.kc};
`,ie=(0,k.A)("div")`
  display: inline-block;
`,re=({activeItem:e,activeItem:{lte_subscription_status:t,mac:l},deviceIsUlte:a,deviceIsUltePro:i})=>{const r=(0,P.useDispatch)(),s=(0,P.useSelector)(Z.S$),c=(0,P.useSelector)(j.H),o=(0,P.useSelector)(J.Pk),E=(0,P.useSelector)(q.dK),m=(0,P.useSelector)(J.fR),_=(0,n.useMemo)(()=>(0,V.Qh)(s),[s]),A=(0,n.useMemo)(()=>`${te.DU}${_}/payments`,[_]),u=(0,n.useMemo)(()=>E||m,[E,m]),{subscriptionIsApplicable:d,subscriptionIsUnreachable:I,subscriptionIsUnavailable:p,hasUlteNotConnectedWarning:v,hasUlteNotRegisteredWarning:C,hasCountryLockedWarning:T,lteUsageData:N}=(0,n.useMemo)(()=>({subscriptionIsApplicable:(0,h.pW)(e),subscriptionIsUnreachable:(0,h.oe)(e),subscriptionIsUnavailable:a&&!!o&&!(0,h._D)(e,o),hasUlteNotConnectedWarning:(0,S.AO)(e),hasUlteNotRegisteredWarning:(0,S.Ql)(e),hasCountryLockedWarning:(0,S.t7)(c,e),lteUsageData:(0,h.cm)(e)}),[e,a,o,c]),{isApproachingLimit:O,isOverSoftLimit:g}=(0,n.useMemo)(()=>({statusColor:x.PA[N.state],isApproachingLimit:"warning"===N.state||"danger"===N.state&&!N.hasOverages,isOverSoftLimit:N.hasOverages&&!N.isSuspended}),[N]),U=(0,n.useMemo)(()=>u&&(d||I||p),[u,d,I,p]),{ltePaymentPastDue:f,isDeactivatedForNonPayment:L}=(0,n.useMemo)(()=>({ltePaymentPastDue:a&&t===X.Z.PAST_DUE,isDeactivatedForNonPayment:a&&t===X.Z.CANCELED}),[a,t]),y=(0,n.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r((0,H.XP)({type:B.H.DEVICE,id:l,tab:G.BC.SETTINGS}))},[r,l]);return(0,n.useEffect)(()=>{r((0,ee.v)())},[r]),n.createElement(n.Fragment,null,O?n.createElement(le,null,n.createElement(ne,{size:"original",variant:"fill"}),n.createElement(b.A,null,n.createElement(D.sA,{id:"DEVICE_DATA_USAGE_LTE_APPROACHING_LIMIT",values:{amount:`${N.width}%`}}))):null,g?n.createElement(le,null,n.createElement(ne,{size:"original",variant:"fill"}),n.createElement("div",null,n.createElement(D.sA,{id:"DEVICE_DATA_USAGE_LTE_OVER_SOFT_LIMIT",values:{softLimit:(0,w.m0)(N.softLimitBytes),hardLimit:(0,w.m0)(N.hardLimitBytes)}}))):null,N.isSuspended?n.createElement(le,null,n.createElement(ne,{size:"original",variant:"fill"}),n.createElement(D.sA,{id:"DEVICE_DATA_USAGE_LTE_OVER_HARD_LIMIT"})):null,"success"!==N.state?n.createElement(le,null,n.createElement(ae,null),n.createElement(ie,null,n.createElement(D.sA,{id:"DEVICE_DATA_USAGE_LTE_INCREASE_LIMIT"})," ",n.createElement(R.A,{variant:"inline",onClick:y,...M.A.addDataTestId(M.A.TestId.SIDE_PANEL_TRIGGER)},n.createElement(D.sA,{id:"DEVICE_DATA_USAGE_LTE_INCREASE_LIMIT_BUTTON"})))):null,f||L?n.createElement(le,null,n.createElement(ne,{size:"original",variant:"fill"}),n.createElement(D.sA,{id:L?"DEVICE_DATA_USAGE_LTE_SERVICE_CANCELED":"DEVICE_DATA_USAGE_LTE_PAYMENT_OVERDUE",values:{link:n.createElement("a",{href:A,target:"_blank",rel:"noopener noreferrer"},n.createElement(D.sA,{id:"COMMON_ACTION_UPDATE_NOW"}))}})):null,T?n.createElement(le,null,n.createElement(ne,{size:"original",variant:"fill"}),n.createElement(D.sA,{id:"DEVICE_PROPERTIES_NOTICE_COUNTRY_LOCKED_WARNING_BODY"})):null,v?n.createElement(le,null,n.createElement(ne,{size:"original",variant:"fill"}),n.createElement(D.sA,{id:"DEVICE_PROPERTIES_NOTICE_ULTE_NOT_CONNECTED_WARNING_BODY"})):null,C?n.createElement(le,null,n.createElement(ne,{size:"original",variant:"fill"}),n.createElement(D.sA,{id:"DEVICE_PROPERTIES_NOTICE_ULTE_NOT_REGISTERED_WARNING_BODY"})):null,U&&!i?n.createElement(Q,{mac:l,isApplicable:d,isUnreachable:I,isUnavailable:p}):null)},se=({softLimit:e=0,used:t=0,dataFormat:l,inactive:a=!1})=>{let i="green-06";a?i="text-4":e&&t>=e&&(i="orange-06");const r=N.Ay[`desktop-color-${i}-${(0,O.u)().themeName}`];return n.createElement(g.A,{color:"text-3",size:"medium"},n.createElement(U.A,{colorOverride:r},(0,T.Ay)(t,"bytes",l)),e>0?n.createElement("span",null," / ",(0,T.Ay)(e,"bytes",l)):null)},ce=({activeItem:e,activeItem:{lte_soft_limit:t},deviceIsUlte:l,deviceIsUltePro:a})=>{const i=(0,h.cm)(e);return(0,S.YP)(e)?n.createElement(n.Fragment,null,n.createElement(L.Ay,{statusCode:i.state,status:(0,f.mR)(e.lte_rat)?n.createElement(L.lo,{signal:(0,r.KwR)(e)},e.lte_state===v.Gu.SEARCHING?n.createElement(D.sA,{id:"DEVICE_ULTE_PRO_SETUP_SEARCHING_INFO"}):e.lte_rat):null,message:n.createElement(se,{softLimit:t,dataFormat:"IEC",used:i.usedBytes}),card_present:!!e.lte_iccid}),n.createElement(re,{activeItem:e,deviceIsUlte:l,deviceIsUltePro:a})):null};var oe=l(236037);const Ee=({activeItem:e,activeItem:{deviceState:t,uplink:l},deviceIsUlte:a,deviceIsUltePro:i})=>{const s=(0,n.useMemo)(()=>(0,_.H)(t||p.g.UNKNOWN,l?.type),[t,l?.type]),c=s===A.v.OFFLINE;return n.createElement(n.Fragment,null,n.createElement(u.A,{activeItem:e,isOffline:c,description:n.createElement(C.A,{activeItem:e,connectionStatus:s}),style:{flex:1}},n.createElement(I.A,{marginTop:m.kc,flexDirection:"column"},n.createElement(ce,{activeItem:e,signalStrength:(0,r.KwR)(e),rat:e.lte_rat||v.MH.UNKNOWN,deviceIsUlte:a,deviceIsUltePro:i})),n.createElement(oe.A,{activeItem:e})),c?n.createElement(d.A,null):null)};var me=l(170121),_e=l(360113);const Ae=({isFailoverMode:e,...t})=>n.createElement(I.A,{gap:m.kc,flexDirection:"column"},n.createElement(me.D,{size:"medium"},n.createElement(D.sA,{id:"COMMON_SIM"})),n.createElement("div",null,e?n.createElement(_e.A,null,n.createElement(b.A,{color:"text-2"},n.createElement(D.sA,{id:"COMMON_MODE"})),n.createElement(b.A,{color:"text-3"},n.createElement(D.sA,{id:e?"COMMON_FAILOVER":"DEVICE_PRIMARY_INTERNET"}))):null,n.createElement(c.A,{...t})));var ue=l(78853);const de=({activeItem:e,activeItem:{adopted:t,ip:l,ipv6:m,mac:_,shortname:A,name:u,type:d,model:I,config_network:p,uplink:v,sys_stats:C,lte_imei:T,lte_failover:N,lte_failover_active:O,lte_networkoperator:g,lte_apn:U,lte_pdptype:D,lte_rat:S,lte_rx_chan:h,lte_tx_chan:f,lte_iccid:L,displayable_version:P,uptime:R}})=>{const b=(0,r.mHb)({model:I});return n.createElement(n.Fragment,null,n.createElement(Ee,{activeItem:e,deviceIsUltePro:b,deviceIsUlte:(0,r.tNJ)({model:I})}),n.createElement(s.A,{ip:l,adopted:t,config_network:p}),n.createElement(E.A,{sys_stats:C,ip:l,mac:_,imei:T,displayable_version:P,uptime:R,name:u,type:d,model:I,ipv6:m}),n.createElement(i.A,null,n.createElement(Ae,{isFailoverMode:Boolean(N),status:O?c.H.ACTIVE:c.H.STANDBY,networkoperator:g,apn:U,pdp_type:D,rat:S,rx_chan:+(h||0),tx_chan:+(f||0),iccid:L})),v?.mac?n.createElement(i.A,{type:i.I.ACCORDION,items:[{id:"uplink",openByDefault:!0,label:n.createElement(a.A,{id:"COMMON_PARENT_DEVICE"}),renderContent:()=>n.createElement(o.A,{activeItem:e,deviceIsUltePro:b})}]}):null,n.createElement(ue.A,{shortname:A}))}},766624(e,t,l){l.d(t,{A:()=>c});var n=l(296540),a=l(271856),i=l(709690),r=l(284428),s=l(566723);const c=({description:e,isInteractive:t,portal:l=!0,cursorType:c,title:o,position:E,width:m,iconProps:_,disabled:A=!1})=>{const u=(0,r.Im)()||A,d=(0,r.q)();return n.createElement(a.A,{description:e,portal:l,isInteractive:t,style:{display:"flex",alignItems:"center"},cursorType:c,title:o,position:E,width:m,disableHover:d},n.createElement(i.A,{isActive:!0,size:"original",opacity:u?s.xN:void 0,..._}))}},451449(e,t,l){l.d(t,{I:()=>n});const n=(0,l(296540).createContext)({fields:!1,labels:!1,tooltipPopovers:!1,tooltipIcons:!1})},284428(e,t,l){l.d(t,{Im:()=>c,iL:()=>o,mQ:()=>r,pv:()=>i,q:()=>s});var n=l(296540),a=l(451449);function i(){return(0,n.useContext)(a.I)}function r(){return i().fields}function s(){return i().tooltipPopovers}function c(){return i().tooltipIcons}function o(){return i().labels}}}]);