"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[37491],{949909(e,t,a){var r;a.d(t,{S:()=>r}),function(e){e.API_DEVICE_ADOPT="API_DEVICE_ADOPT",e.API_DEVICE_RESTART="API_DEVICE_RESTART",e.API_WIDGET_OS_STATS="API_WIDGET_OS_STATS"}(r||(r={}))},575593(e,t,a){a.d(t,{p:()=>s});var r=a(801081),l=a(215454),n=a(602021),m=a(198494),c=a(949909);const s=e=>(0,r.Mz)(n.ah,l.pw,n.dK,m.fR,(t,a,r,l)=>{switch(e){case c.S.API_DEVICE_ADOPT:case c.S.API_DEVICE_RESTART:return r||t.includes(e);case c.S.API_WIDGET_OS_STATS:return l||a.includes(e);default:return r}})},535362(e,t,a){a.d(t,{A:()=>C});var r=a(296540),l=a(469733),n=a(314714),m=a(566723),c=a(916537),s=a(575593),E=a(949909),i=a(578819),o=a(780811),d=a(837612),_=a(602197),I=a(171073),A=a(175875),u=a(147606),N=a(294303);const p=({device:e,disabled:t,confirmTitle:a,confirmMessage:p,confirmButtonMessage:C,hidePoe:S,customName:T,unit_id:R})=>{const O=(0,l.useDispatch)(),D=(0,l.useSelector)((0,s.p)(E.S.API_DEVICE_RESTART)),[g,M]=(0,r.useState)(!1),G=T||e.name||e.mac,y=(0,o.Tbi)(e)&&(0,i.b0)(e.port_table),U=(0,d.S9)(e),v=U!==_.g.CONNECTED&&U!==_.g.RFSCANNING,V=y||(0,o.moU)(e)||!e.bypassConfirmRestart,b=(0,r.useCallback)(()=>{O((0,I.CP)(e,g?"hard":"soft",R))},[O,e,g,R]);return D?r.createElement(u.A,{title:r.createElement(c.sA,{id:a||"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",values:{deviceName:G}}),message:r.createElement(r.Fragment,null,r.createElement(c.sA,{id:p||"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",values:{deviceName:G}}),y&&!S?r.createElement(N.A,{paddingTop:m.kc},r.createElement(n.A,{checked:g,id:"hardReboot",onChange:()=>{M(e=>!e)}},r.createElement(c.sA,{id:"DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"}))):null),confirmButtonLabel:C||"DEVICE_ACTIONS_RESTART",confirmButtonVariant:"destructive",onConfirm:b,trigger:V?r.createElement(A.A,{isDisabled:v||t},r.createElement(c.sA,{id:"DEVICE_ACTIONS_RESTART"})):null}):null},C=(0,r.memo)(({device:e,disabled:t,confirmTitle:a,confirmMessage:l,confirmButtonMessage:n,hidePoe:m,customName:c,unit_id:s})=>r.createElement(p,{device:e,disabled:t,confirmTitle:a,confirmMessage:l,confirmButtonMessage:n,hidePoe:m,customName:c,unit_id:s}))},452663(e,t,a){a.d(t,{i:()=>R,A:()=>O});var r=a(296540),l=a(469733),n=a(314714),m=a(566723),c=a(137625),s=a(294303),E=a(916537),i=a(575593),o=a(949909),d=a(578819),_=a(780811),I=a(602197),A=a(171073),u=a(6510),N=a(535362),p=a(71479),C=a(734707);const S=(0,p.A)(C.Ay)`
  padding: 0;
`,T=({device:e,isConfirmOpen:t,setIsConfirmOpen:a,disabled:i})=>{const o=(0,l.useDispatch)(),[N,p]=(0,r.useState)(!1),C=(0,r.useMemo)(()=>(0,u.Q)({name:e.name,model:e.model,mac:e.mac}),[e.name,e.model,e.mac]),T=(0,r.useMemo)(()=>(0,_.Tbi)({type:e.type})&&(0,d.b0)(e.port_table),[e.type,e.port_table]),R=(0,r.useMemo)(()=>e.deviceState!==I.g.CONNECTED&&e.deviceState!==I.g.RFSCANNING,[e.deviceState]),O=(0,r.useCallback)(()=>{o((0,A.CP)({name:e.name,model:e.model,mac:e.mac},N?"hard":"soft"))},[o,e.name,e.model,e.mac,N]),D=(0,r.useCallback)(()=>{a(!1)},[a]),g=(0,r.useCallback)(()=>{p(e=>!e)},[]),M=(0,r.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),T||(0,_.moU)({type:e.type,model:e.model,device_mode_override:e.device_mode_override})||!e.bypassConfirmRestart?a(!0):o((0,A.CP)({name:e.name,model:e.model,mac:e.mac}))},[o,T,e.bypassConfirmRestart,a,e.type,e.model,e.device_mode_override,e.name,e.mac]);return r.createElement(c.A,{isOpen:t,title:"DEVICE_ACTIONS_RESTART_CONFIRM_TITLE",titleValues:{deviceName:C},message:"DEVICE_ACTIONS_RESTART_CONFIRM_MESSAGE",messageValues:{deviceName:C},...T?{body:r.createElement(s.A,{paddingTop:m.kc},r.createElement(n.A,{checked:N,id:"hardReboot",onChange:g},r.createElement(E.sA,{id:"DEVICE_ACTIONS_RESTART_CONFIRM_CYCLE_POE_POWER"})))}:{},buttonMessage:"DEVICE_ACTIONS_RESTART",buttonVariant:"danger",handleConfirm:O,handleClose:D,offset:-1},r.createElement(S,{variant:"link",onClick:M,disabled:R||i},r.createElement(E.sA,{id:"DEVICE_ACTIONS_RESTART"})))},R=e=>(0,l.useSelector)((0,r.useMemo)(()=>(0,i.p)(o.S.API_DEVICE_RESTART),[]))?r.createElement(T,{...e}):null,O=(0,r.memo)(({device:e,disabled:t})=>r.createElement(N.A,{device:e,disabled:t}))},175875(e,t,a){a.d(t,{A:()=>E});var r=a(469733),l=a(296540),n=a(592563),m=a(180524),c=a(602021),s=a(294303);const E=(0,l.forwardRef)(({allowReadOnly:e,disabledReason:t,...a},E)=>{const i=(0,r.useSelector)(c.EL)&&!e;return l.createElement(s.A,{alignItems:"center"},l.createElement(m.A,{description:t,placement:"left"},l.createElement(n.A,{fontSize:"medium",type:"button",...a,isDisabled:i||a.isDisabled||!!t,ref:E})))})},595053(e,t,a){a.d(t,{A:()=>E});var r=a(296540),l=a(489391),n=a(822336),m=a(382389),c=a(115829),s=a(532114);const E=({softLimit:e=0,threshold:t,used:a=0,dataFormat:E,inactive:i=!1})=>{const o=n.Ay[`desktop-color-${((e,t,a,r)=>{switch(!0){case r:return"text-4";case!e:return"text-3";case t>=e:return"red-06";case a&&t>=.01*a*e:return"orange-06";default:return"green-06"}})(e,a,t,i)}-${(0,m.u)().themeName}`];return r.createElement(c.A,{color:i?"text-4":"text-3",size:"medium"},r.createElement(s.A,{colorOverride:o},(0,l.Ay)(a,"bytes",E)),e>0?r.createElement("span",null," / ",(0,l.Ay)(e,"bytes",E)):null)}},937491(e,t,a){a.d(t,{A:()=>He});var r=a(296540),l=a(217439),n=a(180524),m=a(566723),c=a(53765),s=a(766624),E=a(294303),i=a(916537),o=a(812301),d=a(780811),_=a(569299),I=a(702549),A=a(602197),u=a(996734),N=a(282811),p=a(822336),C=a(382389),S=a(438905),T=a(546343),R=a(339577),O=a(469733),D=a(259902),g=a(71479),M=a(506327),G=(a(115829),a(332898)),y=a(128736);const U=()=>r.createElement(r.Fragment,null," · ");var v=a(532114),V=a(864635),b=a(452663),f=a(532419),L=a(592563),P=a(968906),F=a(398300),h=a(855019),B=a(845030),Y=a(432275);const x=({mac:e,slot:t=I.td.SLOT_1,children:a,disabled:l})=>{const n=(0,O.useDispatch)();return r.createElement(L.A,{...P.A.addDataTestId(P.A.TestId.SIDE_PANEL_TRIGGER),onPress:()=>{n((0,B.XP)({type:F.H.DEVICE,id:e,tab:h.BC.SETTINGS,subId:t.toString(),customData:{scrollIntoViewId:Y.Bu}}))},isDisabled:l},a)};var W=a(87730),q=a(592510),k=a(834959),H=a(413357),w=a(422969),z=a(745667),K=a(837612);const $=({mac:e,disabled:t})=>{const a=(0,O.useSelector)((0,r.useMemo)(()=>(0,f.tG)(e),[e])),m=(0,K.S9)(a)===A.g.CONNECTED,c=(0,d.uod)(a)&&Boolean(a.wan_networkgroup);return(0,w.A)([(0,H.Zi)(k.B.DEVICES),(0,z.hh)(void 0,{crudCacheStrategy:{type:q.e.CACHE}})],r.createElement(n.A,{description:c?r.createElement(i.sA,{id:"DEVICE_ESIM_NOT_SUPPORTED_ON_WAN_ADOPTED_DEVICES"}):a.can_activate_esim?void 0:r.createElement(i.sA,{id:"DEVICE_ESIM_MUST_HAVE_INTERNET"})},r.createElement("span",null,r.createElement(x,{mac:e,slot:I.HY.ESIM,disabled:t||!m||!a.can_activate_esim},r.createElement(l.A,{size:"inherit",color:"inherit"},r.createElement(i.sA,{id:"DEVICE_ACTIVATE_ESIM"}))))))};var Q;!function(e){e.DEFAULT="default",e.METERED="metered",e.WARNING="warning",e.LIMITED="limited"}(Q||(Q={}));const Z=I.G_.OPERATIONAL,j={[u.qU.SUCCESS]:"green-06",[u.qU.WARNING]:"orange-06",[u.qU.DANGER]:"red-06",[u.qU.MISSING]:"neutral-06"},J=(0,g.A)("div")`
  position: absolute;
  top: 0;
  left: -${m.YC};
  right: -${m.YC};
  bottom: 0;
  pointer-events: auto;
`,X=(0,g.A)(E.A)`
  flex: 0 0 ${86}px;
  align-items: center;
  gap: ${m.YC};
`,ee=((0,g.A)(E.A)`
  flex-direction: row;
  align-items: center;
`,(0,g.A)(E.A)`
  flex: 1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
`),te=(0,g.A)(E.A)`
  justify-content: end;
  flex: 1 0 auto;
  align-items: center;
  gap: ${m.YC};
`,ae=({code:e,tooltip:t})=>r.createElement(E.A,{justifyContent:"center",alignItems:"center",position:"relative",pointerEvents:"none",flex:0,marginRight:m.kc},r.createElement(M.A,{color:p.Ay[`desktop-color-${j[e]}-${(0,C.u)().themeName}`]}),r.createElement(n.A,{description:t,placement:"top start"},r.createElement(J,null))),re=()=>r.createElement(E.A,{padding:`0 ${m.YC}`,height:16,alignItems:"center",justifyContent:"center",borderRadius:p.Ay["desktop-radius-infinity"],background:p.Ay[`desktop-color-neutral-03-${(0,C.u)().themeName}`]},r.createElement(l.A,{color:"text-2",size:"xsmall"},r.createElement(i.sA,{id:"COMMON_PRIMARY"}))),le=({slot:e=I.HY.SLOT_1,disabled:t=!1,primary:a})=>r.createElement(X,null,r.createElement(T.m$,{slot:(0,_.Ff)(e),esim:e===I.HY.ESIM,weight:"bold",color:t?"text-4":"text-1"}),a?r.createElement(re,null):null),ne=({disabled:e=!1})=>r.createElement(te,null,r.createElement(l.A,{color:e?"text-4":"text-3",size:"medium"},r.createElement(i.sA,{id:"DEVICE_NO_SIM"}))),me=({signal_percent:e=0})=>r.createElement(G.A,{width:N.Rx,height:N.KN,signal_percent:e}),ce=({tooltip:e})=>r.createElement(te,{gap:m.YC},r.createElement(l.A,{color:"text-4",size:"medium"},r.createElement(i.sA,{id:"COMMON_DISABLED"})),e?r.createElement(s.A,{description:e}):null),se=()=>r.createElement(l.A,{color:"text-2",size:"medium"},r.createElement(i.sA,{id:"DEVICE_MBB_FAILOVER_STANDBY"})),Ee=({mac:e,disabled:t=!1})=>r.createElement(te,{gap:m.YC},r.createElement($,{mac:e,disabled:t}),r.createElement(s.A,{description:r.createElement(i.sA,{id:"DEVICE_ESIM_ACTIVATION_TOOLTIP"}),disabled:t})),ie=({mac:e,slot:t=I.HY.SLOT_1})=>r.createElement(te,null,r.createElement(x,{mac:e,slot:t},r.createElement(i.sA,{id:"DEVICE_MBB_SETUP_REQUIRED"}))),oe=({mac:e,slot:t=I.HY.SLOT_1,children:a})=>r.createElement(x,{mac:e,slot:t},a||r.createElement(i.sA,{id:"COMMON_SETTINGS"})),de=({mac:e})=>{const t=(0,O.useSelector)((0,r.useMemo)(()=>(0,f.tG)(e),[e]));return r.createElement(b.A,{device:t})},_e=({radio:e})=>r.createElement(te,{gap:m.YC},r.createElement(l.A,{color:"text-3",size:"medium"},r.createElement(i.sA,{id:"COMMON_CONNECTING"})),r.createElement(me,{signal_percent:e?.signal_percent})),Ie=({sim:e,isRemoving:t,tooltip:a,messageId:m})=>r.createElement(te,null,m?r.createElement(l.A,{color:"text-3",size:"medium"},r.createElement(i.sA,{id:m})):null,r.createElement(n.A,{description:a},r.createElement("span",null,r.createElement(W.J,{initialTime:e.display_state_elapsed,duration:(0,_.gX)(e.display_state),isRemoving:t})))),Ae=({messageId:e,children:t,values:a})=>r.createElement(te,{alignItems:"center",gap:m.YC},r.createElement(y.A,null),r.createElement(E.A,{alignItems:"baseline"},r.createElement(l.A,{color:"text-2",size:"medium"},r.createElement(i.sA,{id:e,values:a})),t?r.createElement(r.Fragment,null,r.createElement(U,null),t):null)),ue=({messageId:e,tooltip:t,mac:a,slot:l,children:c})=>r.createElement(te,{alignItems:"center",gap:m.YC},r.createElement(y.A,null),r.createElement(E.A,{alignItems:"baseline",gap:m.YC},r.createElement(n.A,{description:t},r.createElement("span",null,r.createElement(oe,{mac:a,slot:l},r.createElement(i.sA,{id:e}))))),c),Ne=({mac:e,slot:t=I.HY.SLOT_1})=>r.createElement(te,{alignItems:"center",gap:m.YC},r.createElement(x,{mac:e,slot:t},r.createElement(E.A,{gap:m.YC},r.createElement(y.A,null),r.createElement(i.sA,{id:"DEVICE_ESIM_ACTIVATION_FAILED"})))),pe=()=>r.createElement(te,{gap:m.YC},r.createElement(D.A,{size:"original",color:p.Ay[`desktop-color-red-06-${(0,C.u)().themeName}`]}),r.createElement(l.A,{color:"text-2",size:"medium"},r.createElement(i.sA,{id:"COMMON_BLOCKED"}))),Ce=({radio:e})=>r.createElement(N.A3,{signal_percent:e?.signal_percent,dBm:e?.rsrp??e?.rscp}),Se=({radio:e})=>r.createElement(te,{gap:m.YC},r.createElement(l.A,{color:"text-3",size:"medium"},r.createElement(i.sA,{id:"DEVICE_ULTE_PRO_SETUP_SEARCHING_INFO"})),r.createElement(me,{signal_percent:e?.signal_percent})),Te=({messageId:e,sim:t})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:I.HY.ESIM}),r.createElement(Ie,{sim:t,messageId:e})),Re=({mac:e,carrier:t})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.DANGER}),r.createElement(le,{slot:I.HY.ESIM}),r.createElement(ee,null,r.createElement(R.R,{carrier:t}),r.createElement(Ne,{mac:e,slot:I.HY.ESIM}))),Oe=({slot:e})=>r.createElement(n.A,{description:r.createElement("span",null,r.createElement(V.Gh,{slot:e}))},r.createElement("span",null,r.createElement(y.A,{size:"original",color:p.Ay[`desktop-color-red-06-${(0,C.u)().themeName}`]}))),De=({slot:e,resetPolicy:t,usage:a=0,softLimit:l=0})=>r.createElement(n.A,{description:r.createElement("span",null,r.createElement(V.Tk,{slot:e,resetPolicy:t,usage:a,softLimit:l,dataFormat:"SI"}))},r.createElement("span",null,r.createElement(y.A,{size:"original",color:p.Ay[`desktop-color-orange-06-${(0,C.u)().themeName}`]}))),ge=({slot:e})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.MISSING}),r.createElement(le,{slot:I.HY.ESIM,disabled:!0}),r.createElement(ce,{tooltip:r.createElement(i.sA,{id:"DEVICE_MBB_ESIM_SLOT_DISABLED_TOOLTIP",values:{sim:r.createElement(T.pF,{slot:e})}})})),Me=({slot:e})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.MISSING}),r.createElement(le,{slot:e,disabled:!0}),r.createElement(ce,{tooltip:r.createElement(i.sA,{id:"DEVICE_MBB_SLOT_N_DISABLED_TOOLTIP",values:{sim:r.createElement(T.pF,{slot:e})}})})),Ge=({slot:e})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.MISSING}),r.createElement(le,{slot:e}),r.createElement(ne,null)),ye=({slot:e})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.MISSING}),r.createElement(le,{slot:e,disabled:!0}),r.createElement(te,null)),Ue=({slot:e,mac:t,carrierName:a})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:e}),r.createElement(ue,{messageId:"DEVICE_MBB_NETWORK_NOT_AUTHORIZED",tooltip:r.createElement("span",null,r.createElement(i.sA,{id:"DEVICE_MBB_NETWORK_NOT_AUTHORIZED"}),". ",r.createElement(i.sA,{id:"DEVICE_MBB_NETWORK_NOT_AUTHORIZED_EXPLANATION",values:{carrier:a}})),mac:t,slot:e})),ve={[I.G_.NO_SIM]:({slot:e})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.MISSING}),r.createElement(le,{slot:e}),r.createElement(ne,null)),[I.G_.ESIM_READY_TO_ACTIVATE]:({mac:e})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.MISSING}),r.createElement(le,{slot:I.HY.ESIM}),r.createElement(Ee,{mac:e})),[I.G_.OPERATIONAL_METERED]:({radio:e,slot:t,primary:a,sim:{spn:l,asn:n}})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.SUCCESS}),r.createElement(le,{slot:t,primary:a}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(l),asn:n}),r.createElement(te,null,r.createElement(Ce,{radio:e})))),[I.G_.OPERATIONAL_WARNING]:({radio:e,slot:t,sim:{spn:a,asn:l,txbytes:n,rxbytes:m},overrides:{reset_policy:c,data_soft_limit_bytes:s}})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:t}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(a),asn:l}),r.createElement(te,null,r.createElement(De,{slot:t,resetPolicy:c,usage:(0,_.rB)({txbytes:n,rxbytes:m}),softLimit:s}),r.createElement(Ce,{radio:e})))),[I.G_.OPERATIONAL_LIMITED]:({radio:e,slot:t,primary:a,sim:{spn:l,asn:n}})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:t,primary:a}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(l),asn:n}),r.createElement(te,null,r.createElement(Oe,{slot:t}),r.createElement(Ce,{radio:e})))),[I.G_.OPERATIONAL]:({sim:{spn:e,asn:t},radio:a,slot:l,primary:n})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.SUCCESS}),r.createElement(le,{slot:l,primary:n}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(e),asn:t}),r.createElement(te,null,r.createElement(Ce,{radio:a})))),[I.G_.FAILOVER_READY_METERED]:({slot:e,sim:t,primary:a})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:e,primary:a}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(t.spn),asn:t.asn}),r.createElement(te,null,r.createElement(se,null)))),[I.G_.FAILOVER_READY_WARNING]:({slot:e,sim:{spn:t,asn:a,txbytes:l,rxbytes:n},primary:m,overrides:{reset_policy:c,data_soft_limit_bytes:s}})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:e,primary:m}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(t),asn:a}),r.createElement(te,null,r.createElement(De,{slot:e,resetPolicy:c,usage:(0,_.rB)({txbytes:l,rxbytes:n}),softLimit:s}),r.createElement(se,null)))),[I.G_.FAILOVER_READY_LIMITED]:({slot:e,sim:{spn:t,asn:a},primary:l})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:e,primary:l}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(t),asn:a}),r.createElement(te,null,r.createElement(Oe,{slot:e}),r.createElement(se,null)))),[I.G_.FAILOVER_READY]:({slot:e,sim:t,primary:a})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.SUCCESS}),r.createElement(le,{slot:e,primary:a}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(t.spn),asn:t.asn}),r.createElement(te,null,r.createElement(se,null)))),[I.G_.SEARCHING]:({slot:e,primary:t,radio:a,sim:l})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:e,primary:t}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(l.spn),asn:l.asn}),r.createElement(Se,{radio:a}))),[I.G_.SETUP_REQUIRED]:({mac:e,slot:t,sim:a})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:t}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(a.spn),asn:a.asn}),r.createElement(te,null,r.createElement(ie,{mac:e,slot:t})))),[I.G_.ROAMING_FORBIDDEN]:({mac:e,sim:t,slot:a,primary:l})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:a,primary:l}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(t.spn),asn:t.asn}),r.createElement(ue,{messageId:"COMMON_ROAMING",mac:e,slot:a}))),[I.G_.CONNECTING]:({slot:e,radio:t,primary:a,sim:l})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:e,primary:a}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(l.spn),asn:l.asn}),r.createElement(_e,{radio:t}))),[I.G_.READING_SIM_DATA]:({slot:e,sim:t,primary:a})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:e,primary:a}),r.createElement(ee,null,r.createElement(R.R,{carrier:(0,_.ap)(t.spn),asn:t.asn}),r.createElement(te,null,r.createElement(Ie,{sim:t,tooltip:r.createElement(E.A,{flexDirection:"column"},r.createElement("span",null,r.createElement(i.sA,{id:"COMMON_SETTING_UP"})," ",r.createElement(T.pF,{slot:e}),"."),r.createElement(i.sA,{id:"DEVICE_IN_PROGRESS_MESSAGE"}))})))),[I.G_.ESIM_INITIALIZING]:({sim:e})=>r.createElement(Te,{messageId:"DEVICE_PREPARING_ESIM",sim:e}),[I.G_.ESIM_DOWNLOADING]:({sim:e})=>r.createElement(Te,{messageId:"DEVICE_DOWNLOADING_PROFILE",sim:e}),[I.G_.ESIM_ACTIVATING]:({sim:e})=>r.createElement(Te,{messageId:"DEVICE_ACTIVATING_ESIM",sim:e}),[I.G_.ESIM_FINALIZING]:({sim:e})=>r.createElement(Te,{messageId:"DEVICE_FINALIZING_SETUP",sim:e}),[I.G_.ESIM_FINALIZING_DOWNLOAD_FAILED]:({sim:e})=>r.createElement(Te,{messageId:"DEVICE_CLEANING_UP",sim:e}),[I.G_.ESIM_FINALIZING_ACTIVATION_FAILED]:({sim:e})=>r.createElement(Te,{messageId:"DEVICE_CLEANING_UP",sim:e}),[I.G_.ESIM_DEACTIVATING]:({sim:e})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.WARNING}),r.createElement(le,{slot:I.HY.ESIM}),r.createElement(Ie,{sim:e,isRemoving:!0,tooltip:r.createElement("span",null,r.createElement(i.sA,{id:"COMMON_REMOVING"})," ",r.createElement(T.pF,{slot:I.HY.ESIM}))})),[I.G_.PIN_INCORRECT]:({mac:e,slot:t,primary:a})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.DANGER}),r.createElement(le,{slot:t,primary:a}),r.createElement(ue,{messageId:"DEVICE_MBB_STATUS_INCORRECT_PIN_CODE",mac:e,slot:t})),[I.G_.PIN_REQUIRED]:({mac:e,slot:t,primary:a})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.DANGER}),r.createElement(le,{slot:t,primary:a}),r.createElement(ue,{messageId:"DEVICE_PIN_CODE_REQUIRED",mac:e,slot:t})),[I.G_.ERROR]:({mac:e,slot:t,primary:a})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.DANGER}),r.createElement(le,{slot:t,primary:a}),r.createElement(Ae,{messageId:"DEVICE_ERROR_OCCURRED"},r.createElement(de,{mac:e}))),[I.G_.ESIM_INITIALIZATION_FAILED]:({mac:e,sim:t})=>r.createElement(Re,{mac:e,carrier:(0,_.ap)(t.spn)}),[I.G_.ESIM_ACTIVATION_FAILED]:({mac:e,sim:t})=>r.createElement(Re,{mac:e,carrier:(0,_.ap)(t.spn)}),[I.G_.ESIM_DOWNLOAD_FAILED]:({mac:e,sim:t})=>r.createElement(Re,{mac:e,carrier:(0,_.ap)(t.spn)}),[I.G_.BLOCKED]:({slot:e,primary:t})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.DANGER}),r.createElement(le,{slot:e,primary:t}),r.createElement(pe,null)),[I.G_.PUK_REQUIRED]:({mac:e,slot:t,primary:a})=>r.createElement(r.Fragment,null,r.createElement(ae,{code:u.qU.DANGER}),r.createElement(le,{slot:t,primary:a}),r.createElement(ue,{messageId:"DEVICE_PUK_REQUIRED",mac:e,slot:t}))},Ve=({mac:e,sim:t,overrides:a,displaySlot:l,displayState:n,primary:m,radio:c})=>r.createElement(r.Fragment,null,ve[n]?.({mac:e,overrides:a,sim:t,radio:c,slot:l,primary:m})),be=({offline:e=!1,isCompact:t=!1,slotCount:a=0,...l})=>{const n=p.Ay[`desktop-border-divider-${(0,C.u)().themeName}`],c=(({displayState:e,displaySlot:t,slotCount:a,sim:l,offline:n,radio:m={},mac:c})=>{const s=(0,_.Qi)(t,a);return t===I.HY.ESIM&&(0,S.J)(e,l.esim)?r.createElement(ge,{slot:(0,_.WW)(a)}):s&&(0,S._)(e,l.esim)?r.createElement(Me,{slot:t}):n?r.createElement(ye,{slot:t}):s&&(0,_.k3)(e)||s&&(0,_.k3)(e)?r.createElement(Ge,{slot:t}):(0,_.Ub)(m,l)?r.createElement(Ue,{slot:t,mac:c,carrierName:(0,_.ap)(l?.spn)}):void 0})({displayState:l.displayState,displaySlot:l.displaySlot,slotCount:a,sim:l.sim,offline:e,radio:l.radio,mac:l.mac});return r.createElement(E.A,{borderBottom:t?void 0:n,padding:t?void 0:m.YC,height:t?27:32,alignItems:"center",justifyContent:"space-between"},c||r.createElement(Ve,{...l}))};var fe=a(701548);const Le=({mac:e,slot:t,isInvalid:a})=>r.createElement(E.A,{gap:m.YC},r.createElement(fe.A,{size:"original",variant:"fill",color:p.Ay[`desktop-color-orange-06-${(0,C.u)().themeName}`]}),r.createElement("span",null,r.createElement(l.A,{size:"medium",color:"text-1"},r.createElement(i.sA,{id:a?"DEVICE_PIN_CODE_INVALID":"DEVICE_PIN_CODE_REQUIRED"})," · "),r.createElement(x,{mac:e,slot:(0,_.CJ)(t)},r.createElement(i.sA,{id:"COMMON_SETTINGS"}))));var Pe=a(881295);const Fe=({radio:{signal_percent:e,rsrp:t,rscp:a}={}})=>{const l=(0,Pe._i)(e,(0,C.u)().themeName),n=t??a;return r.createElement(c.Y,{id:"COMMON_SIGNAL"},r.createElement(v.A,{colorOverride:l,size:"inherit"},n?r.createElement(r.Fragment,null,n," ",r.createElement(i.sA,{id:"COMMON_UNIT_DBM"})):r.createElement(i.sA,{id:"COMMON_FALLBACK"})))};var he=a(595053);const Be=(e,t={},a,r,l)=>{switch(!0){case!e.card_present:case(0,d.aK8)(l||A.g.UNKNOWN):return u.qU.MISSING;case(0,_.Gv)(e):return u.qU.DANGER;case r===u.Gu.MODEM_INIT&&e.active:case r===u.Gu.SIM_ACTIVATION&&e.active:case r===u.Gu.SEARCHING&&e.active:case r===u.Gu.CONNECTING&&e.active:case(0,_.Ao)(e):case(0,_.cN)(e,t):case(0,_.d)(e.current_apn,a):case e.data_limited:return u.qU.WARNING;case e.connection_info?.inet_state===I.uQ.DISCONNECTED:case a?.signal===u.OP.NO_SIGNAL:return u.qU.DANGER;case(0,_.nP)(e,r):return u.qU.SUCCESS;default:return u.qU.MISSING}},Ye=(e,t={},a={},l,n)=>{switch(!0){case!e.card_present:case(0,_.cN)(e,t):case(0,_.kV)(e):case(0,_.Ao)(e):return null;default:return r.createElement(he.A,{softLimit:a.data_limit_enabled?a.data_soft_limit_bytes:0,threshold:a.data_limit_enabled?a.data_warning_threshold:void 0,dataFormat:"SI",used:(0,_.rB)(e),inactive:(0,d.aK8)(n||A.g.UNKNOWN)})}},xe=(e,t,a,c,I={},p)=>{switch(!0){case(0,d.aK8)(t||A.g.UNKNOWN):return r.createElement(l.A,{color:"text-3",size:"medium"},r.createElement(i.sA,{id:"COMMON_OFFLINE"}));case(0,_.cN)(c,I):return r.createElement(W.A,{initialTime:c.display_state_elapsed,duration:(0,_.gX)(c.display_state)});case!c.card_present&&c.slot===o.QB:return r.createElement(E.A,{gap:m.YC},r.createElement($,{mac:e}),r.createElement(s.A,{description:r.createElement(i.sA,{id:"DEVICE_ESIM_ACTIVATION_TOOLTIP"})}));case!c.card_present:return r.createElement(l.A,{color:"text-3",size:"medium"},r.createElement(i.sA,{id:"DEVICE_NO_SIM"}));case(0,_.kV)(c):return r.createElement(x,{mac:e,slot:(0,_.CJ)(c.slot)},r.createElement(i.sA,{id:"DEVICE_MBB_SETUP_REQUIRED"}));case(0,_.Ao)(c):return r.createElement(Le,{mac:e,slot:c.slot,isInvalid:(0,_.Gv)(c)});case a===u.Gu.READY&&(0,_.vc)(c)&&!c.active:return r.createElement(l.A,{color:"text-3",size:"medium"},r.createElement(i.sA,{id:"COMMON_READY"}));default:return r.createElement(r.Fragment,null,c.active?r.createElement(n.A,{description:a===u.Gu.READY?r.createElement(Fe,{radio:p}):void 0,placement:"top start"},r.createElement("span",null,r.createElement(N.A3,{signal_percent:p?.signal_percent},a===u.Gu.SEARCHING?r.createElement(i.sA,{id:"DEVICE_ULTE_PRO_SETUP_SEARCHING_INFO"}):(0,_.mR)(p?.rat)?p?.rat:0===p?.signal_percent?r.createElement(i.sA,{id:"COMMON_NO_SIGNAL"}):null))):null,c.slot===o.QB&&!I&&c.card_present?r.createElement(s.A,{description:r.createElement(i.sA,{id:"DEVICE_ESIM_TOOLTIP"})}):null)}},We=(e={},t={},a=void 0,l=void 0)=>{switch(!0){case!e.card_present:case(0,d.aK8)(l||A.g.UNKNOWN):return;case a===u.Gu.MODEM_INIT&&e.card_present:case a===u.Gu.SIM_ACTIVATION&&e.card_present:case a===u.Gu.CONNECTING&&e.active:case(0,_.cN)(e,t.esim):return r.createElement(i.sA,{id:"DEVICE_MBB_STATUS_SETTING_UP"});case a===u.Gu.SEARCHING&&e.active:return r.createElement(i.sA,{id:"DEVICE_MBB_STATUS_SEARCHING"});case(0,_.Gv)(e):return r.createElement(i.sA,{id:"DEVICE_MBB_STATUS_INCORRECT_PIN_CODE"});case(0,_.Ao)(e):return r.createElement(i.sA,{id:"DEVICE_PIN_CODE_REQUIRED"});case e.data_limited:return r.createElement(i.sA,{id:"DEVICE_MBB_STATUS_DATA_LIMIT_REACHED"});case(0,_.FT)(e):return r.createElement(i.sA,{id:"DEVICE_MBB_STATUS_INTERNET_UNREACHABLE"});case t?.radio?.signal===u.OP.NO_SIGNAL&&e.active:return r.createElement(i.sA,{id:"DEVICE_ULTE_PRO_SETUP_NO_SIGNAL"});case t?.radio&&(0,_.mr)(t.radio)&&e.active:return r.createElement(i.sA,{id:"DEVICE_MBB_STATUS_CANNOT_REGISTER"});case e.esim&&t.esim?.last_operation?.state===I.hM.FAILURE:return r.createElement(i.sA,{id:"DEVICE_MBB_STATUS_UNABLE_TO_ACTIVATE_ESIM"});case(0,_.d)(e.current_apn,t.radio):return r.createElement(i.sA,{id:"DEVICE_MBB_STATUS_ROAMING_UNAVAILABLE"});case(0,_.nP)(e,t.state)&&!!t.radio:return r.createElement(c.m,{minWidth:120},r.createElement(Fe,{radio:t.radio}));default:return}},qe=({mac:e,deviceState:t,mbb:a,mbb_overrides:l,isCompact:n})=>r.createElement(E.A,{flexDirection:"column",gap:n?void 0:m.kc,width:"100%"},(a?.sim||[]).map((m={})=>{const c=(l?.sim||[]).find(e=>e.slot===m.slot)||{};return r.createElement(N.Ay,{key:m.slot,slot:m.slot,esim:m.esim,card_present:m.card_present,statusCode:Be(m,a.esim,a.radio,a.state,t),message:Ye(m,a.esim,c,0,t),status:xe(e,t,a.state,m,a.esim,a.radio),statusBallTooltip:We(m,a,a.state,t),isCompact:n})})),ke=({mac:e,mbb:t,mbb_overrides:a,isCompact:l,deviceState:n})=>r.createElement(E.A,{flexDirection:"column",width:"100%"},(0,_.Vl)(t.sim||[]).map(m=>{const c=t.sim?.find(e=>e.slot===(0,_.Ff)(m,t.sim?.length))||{},s=(a?.sim||[]).find(e=>e.slot===c.slot)||{};return r.createElement(be,{key:m,displaySlot:m,mac:e,sim:c,displayState:c.display_state||Z,primary:a?.primary_slot===c.slot,overrides:s,radio:t.radio,isCompact:l,offline:(0,d.aK8)(n||A.g.UNKNOWN),slotCount:t.sim?.length})})),He=e=>{const t=(0,r.useMemo)(()=>e.mbb.sim?.some(({display_state:e})=>Boolean(e)),[e.mbb.sim]);return r.createElement(t?ke:qe,{...e})}}}]);