"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[45561],{470591(e,t,n){n.d(t,{A:()=>a});const a=(0,n(296540).createContext)({isStandalone:!0,header:[null,()=>{}],footer:[null,()=>{}]})},785976(e,t,n){n.d(t,{O:()=>r,g:()=>c});var a=n(602197);var l=n(837612);const r=e=>{const t=(0,l.S9)(e);return[a.g.PENDING,a.g.ADOPTION_REQUIRED,a.g.ADOPTING].includes(t)&&(!e.unsupported||e.adoptable_when_upgraded)},c=e=>{const t=(0,l.S9)(e),n=!e.unsupported||(e.adoptable_when_upgraded??(e.unsupported&&2===e.unsupported_reason));return[a.g.ADOPTION_FAILED].includes(t)&&n}},949909(e,t,n){var a;n.d(t,{S:()=>a}),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"}(a||(a={}))},575593(e,t,n){n.d(t,{p:()=>o});var a=n(801081),l=n(215454),r=n(602021),c=n(198494),i=n(949909);const o=e=>(0,a.Mz)(r.ah,l.pw,r.dK,c.fR,(t,n,a,l)=>{switch(e){case i.S.API_DEVICE_ADOPT:case i.S.API_DEVICE_RESTART:return a||t.includes(e);case i.S.API_WIDGET_OS_STATS:return l||n.includes(e);default:return a}})},284388(e,t,n){n.d(t,{A:()=>o});var a=n(296540),l=n(450514),r=n(463107),c=n(74750),i=n(916537);const o=({onCancel:e,onConfirm:t,cssProperties:n})=>a.createElement(r.aF.Root,{isOpen:!0},a.createElement(l.A,{actionButtons:a.createElement(a.Fragment,null,a.createElement(c.A,{type:"button",variant:"neutral",onPress:e},a.createElement(i.sA,{id:"COMMON_UNSAVED_CHANGES_STAY"})),a.createElement(c.A,{type:"button",variant:"destructive",onPress:t},a.createElement(i.sA,{id:"COMMON_UNSAVED_CHANGES_LEAVE"}))),title:(0,i.tz)().formatMessage({id:"COMMON_UNSAVED_CHANGES_TITLE"}),width:"small",isDismissable:!1,onClose:e,style:n},a.createElement(i.sA,{id:"COMMON_UNSAVED_CHANGES_CONTENT"})))},412952(e,t,n){n.d(t,{A:()=>i});var a=n(296540),l=n(846885),r=n.n(l);var c=n(284388);const i=({ignoredPaths:e,onLeave:t,beforeOnLeave:n,zIndex:l})=>{const i=(e=>(t,n)=>null==e||!t||!n||![].concat(e).some(e=>"string"==typeof e?n.pathname===e&&t.pathname===e:e instanceof RegExp&&(e.test(n.pathname)||e.test(t.pathname))))(e),o=(0,a.useMemo)(()=>(e,t)=>i(e,t)&&((e,t)=>t?.pathname!==e.pathname)(e,t),[i]),s=(0,a.useCallback)(e=>{n?.(),e()},[n]);return a.createElement(r(),{when:o,afterConfirm:t,beforeConfirm:s},({onCancel:e,onConfirm:t})=>a.createElement(c.A,{onCancel:e,onConfirm:t,cssProperties:{zIndex:l}}))}},98627(e,t,n){n.d(t,{A:()=>o});var a=n(296540),l=n(217439),r=n(566723),c=n(294303),i=n(296704);const o=({groupSize:e=4,maxWidth:t,value:n})=>{return a.createElement(c.A,{alignItems:"flex-start"},a.createElement(c.A,{gap:r.YC,rowGap:0,flexFlow:"row wrap",maxWidth:t,justifyContent:"space-between"},(o=n,s=e,o.match(new RegExp(`.{1,${s}}`,"g"))??[]).map(e=>a.createElement(l.A,{color:"text-3",size:"medium"},e))),a.createElement(i.A,{value:n}));var o,s}},224948(e,t,n){n.d(t,{A:()=>E});var a=n(296540),l=n(217439),r=n(71479),c=n(566723),i=n(294303),o=n(689965);const s=(0,r.A)("div")`
  margin-right: ${c.kc};
`,m=(0,r.A)("div")`
  margin-left: ${c.kc};
`,E=({icon:e,closeIcon:t,nested:n,children:r,...c})=>a.createElement(o.A,{nested:n,...c},a.createElement(i.A,null,a.createElement(s,null,e),a.createElement(l.A,{size:"medium"},r),t?a.createElement(m,null,t):null))},142208(e,t,n){n.d(t,{A:()=>k});var a=n(822336),l=n(296540),r=n(469733),c=n(271856),i=n(217439),o=n(71479),s=n(382389),m=n(132196),E=n(6510),d=n(137625),A=n(845030),u=n(916537),_=n(286818),C=n(953048),p=n(293016),I=n(649413),S=n(497470),O=n(83344),v=n(323572),T=n(457311),D=n(602021),g=n(837612),h=n(602197),N=n(171073),P=n(765268),f=n(955161),M=n(734707),R=n(311785);const b=(0,o.A)(M.Ay,(0,R.A)("disabled"))`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{themeName:e,motifPalette:{red05:t}},disabled:n})=>n?t:a.Ay[`desktop-color-red-06-${e}`]};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:n})=>n?e:t};
  }
`,y=m.AH`
  flex: 1;
  width: 100%;
`,U=e=>l.createElement(c.A,{portal:!0,width:180,description:l.createElement(i.A,{style:{whiteSpace:"pre-wrap"}},l.createElement(u.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"})),className:y},e),k=({device:e,disabled:t,variant:n})=>{const a=(0,r.useDispatch)(),c=(0,s.u)(),[o,m]=(0,l.useState)(!1),[R,k]=(0,l.useState)(!1),L=(0,r.useSelector)(D.EL),V=(0,r.useSelector)(_.OA),w=(0,g.S9)(e),{isDeviceDisconnected:x,isDeviceAdoptionFailed:z,deviceBusy:$}=(0,l.useMemo)(()=>({isDeviceDisconnected:w===h.g.DISCONNECTED,isDeviceAdoptionFailed:w===h.g.ADOPTION_FAILED,deviceBusy:(0,g.C1)(w)}),[w]),G=(0,l.useMemo)(()=>t||$||L,[t,$,L]),W=(0,l.useCallback)(()=>{const{id:t,type:n}=(0,I.Se)(V);n===p.F7.DEVICE&&t===e?.mac&&(a((0,S.U)(C.Zt)),a((0,S.Ao)([])))},[e?.mac,a,V]);return l.createElement(f.A,{condition:$,wrapper:U},l.createElement(d.A,{isOpen:R,title:"COMMON_ACTION_REMOVE_CONFIRM_TITLE",titleValues:{deviceName:(0,E.Q)(e)},message:x||z?"DEVICE_DISCONNECTED_ACTIONS_REMOVE_CONFIRM_MESSAGE":"DEVICE_ACTIONS_REMOVE_CONFIRM_MESSAGE",messageValues:{deviceName:(0,E.Q)(e)},buttonMessage:"COMMON_ACTION_REMOVE",buttonVariant:"danger",handleConfirm:async()=>{m(!0),a((0,v.Yl)(e.mac)).then(()=>{W(),a((0,O.W)(e.mac)),a((0,N.XL)(e.mac)),m(!1),k(!1),a((0,A.K5)()),a((0,T.Uc)()),a((0,P.O)())}).finally(()=>{m(!1),k(!1)})},handleClose:()=>{m(!1),k(!1)},className:"tertiary"===n?y:""},l.createElement(b,{disabled:G,variant:"tertiary"===n?void 0:"link",className:"tertiary"===n?(0,M.sC)(c):"",onClick:e=>{e.preventDefault(),e.stopPropagation(),k(!0)},loader:o?"spinner":null,type:"button"},l.createElement(i.A,{color:"red-06",size:"medium"},l.createElement(u.sA,{id:"COMMON_ACTION_REMOVE"})))))}},551753(e,t,n){n.d(t,{A:()=>_});var a=n(822336),l=n(296540),r=n(758649),c=n(217439),i=n(162420),o=n(823858),s=n(793336),m=n(382389),E=n(46119),d=n(916537),A=n(224948),u=n(294303);const _=(0,l.memo)(({children:e,customIcon:t,link:n,nested:_,extra:C,variant:p="warning",...I})=>{const{themeName:S}=(0,m.u)(),O=(0,l.useMemo)(()=>{switch(p){case"warning":return l.createElement(o.A,{size:"original",color:a.Ay[`desktop-color-orange-06-${S}`],variant:"fill"});case"info":return l.createElement(i.A,{isActive:!0,size:"original",variant:"fill"});case"custom":return t;default:return l.createElement(s.A,{size:"medium",color:a.Ay[`desktop-color-red-06-${S}`],variant:"fill"})}},[p,S,t]),v=(0,l.useCallback)(()=>{E.A.open(n)},[n]);return l.createElement(A.A,{icon:O,nested:_,...I},l.createElement(u.A,{flexDirection:"column",alignItems:"flex-start"},l.createElement(c.A,null,e),l.createElement(c.A,null,n?l.createElement(r.A,{type:"button",variant:"inline",onClick:v},l.createElement(d.sA,{id:"COMMON_LEARN_MORE"})):null),C))})},101955(e,t,n){n.d(t,{X:()=>a,c:()=>l});const a="PROPERTY_PANEL_CLASSNAME",l=[]},647758(e,t,n){n.d(t,{A:()=>o});var a=n(469733),l=n(296540),r=n(282556),c=n(602021),i=n(198494);const o=()=>{const e=(0,a.useSelector)(r.zi),t=(0,a.useSelector)(i.BQ),n=(0,a.useSelector)(c.hq),o=(0,l.useMemo)(()=>new Intl.DateTimeFormat(e,{hourCycle:t,month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",timeZone:n}),[e,t,n]);return(0,l.useCallback)(e=>o.format(e),[o])}},932752(e,t,n){n.d(t,{Z:()=>l,z:()=>r});var a=n(6510);const l=(e,t)=>e?t.find(({mac:t})=>t===e):void 0,r=(e,t,n,l,r)=>{const c=!r&&t?` ${l({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER"},{port:t})}`:"";return e?`${e}${c}`:n?`${(0,a.Q)(n)}${c}`:l({id:"COMMON_FALLBACK"})}},252093(e,t,n){n.d(t,{A:()=>i});var a=n(296540),l=n(271856),r=n(162420),c=n(916537);const i=({messageId:e,tooltipClassName:t,values:n,isInteractive:i,portal:o,variant:s="twoTone",size:m="medium"})=>a.createElement(l.A,{description:a.createElement(c.sA,{id:e,values:n}),width:210,isInteractive:i,portal:o,tooltipClassName:t},a.createElement(r.A,{isActive:!0,omitSvgMargin:!0,variant:s,size:m}))},777741(e,t,n){n.d(t,{A:()=>o});var a=n(296540),l=n(217439),r=n(360113),c=n(916537),i=n(98627);const o=({eid:e})=>e?a.createElement(r.A,{flexProps:{height:"auto"}},a.createElement(l.A,{color:"text-2",size:"medium"},a.createElement(c.sA,{id:"DEVICE_ESIM_EID"})),a.createElement(i.A,{maxWidth:145,value:e})):null},10373(e,t,n){n.d(t,{A:()=>o});var a=n(296540),l=n(217439),r=n(916537),c=n(98627),i=n(360113);const o=({imei:e})=>a.createElement(i.A,{flexProps:{height:"auto"}},a.createElement(l.A,{color:"text-2",size:"medium"},a.createElement(r.sA,{id:"DEVICE_IMEI"})),a.createElement(c.A,{maxWidth:141,value:e}))},813040(e,t,n){n.d(t,{A:()=>d,R:()=>E});var a=n(296540),l=n(822336),r=n(71479),c=n(180524),i=n(566723),o=n(294303),s=n(252093);const m=(0,r.A)(o.A)`
  flex-direction: column;
  height: ${48}px;
  border-bottom: ${({theme:{themeName:e}})=>l.Ay[`desktop-border-divider-${e}`]};
  padding: ${i.xO} 0;
  position: relative;
  .tooltip-position-fixer {
    margin-right: -${i.Ln};
  }
`,E=({tooltipId:e,disabledTooltip:t,children:n,tooltipProps:l={},...r})=>a.createElement(m,{...r},a.createElement(o.A,{justifyContent:"space-between",alignItems:"center"},a.createElement(c.A,{description:t,placement:"left"},a.createElement("span",null,n)),e?a.createElement(s.A,{messageId:e,tooltipClassName:"tooltip-position-fixer",variant:"outline",...l}):null)),d=E},296704(e,t,n){n.d(t,{A:()=>s});var a=n(469733),l=n(296540),r=n(592563),c=n(895795),i=n(742920),o=n(675359);const s=({value:e})=>{const t=(0,a.useDispatch)(),n=(0,l.useCallback)(()=>navigator.clipboard.writeText(e).then(()=>{t((0,o.ox)({icon:i.C.success,message:"COMMON_COPIED_TO_CLIPBOARD",duration:1e3}))}),[e,t]);return l.createElement(r.A,{onPress:n,variant:"neutral"},l.createElement(c.A,{size:"original"}))}},360113(e,t,n){n.d(t,{A:()=>s});var a=n(296540),l=n(71479),r=n(566723),c=n(294303),i=n(311785);const o=(0,l.A)(c.A,(0,i.A)("valueMaxWidth","keyMinWidth","compact"))`
  &:not(:last-child) {
    ${({compact:e})=>e?"":`margin-bottom: ${r.kc};`}
  }
  & > {
    &:nth-child(1) {
      min-width: ${({keyMinWidth:e})=>e}px;
    }
    &:nth-child(2) {
      max-width: ${({valueMaxWidth:e})=>e}px;
    }
  }
`,s=({children:e,valueMaxWidth:t=215,keyMinWidth:n=0,flexProps:l={},compact:c=!1})=>a.createElement(o,{width:"100%",justifyContent:"space-between",gap:r.kc,height:c?void 0:24,valueMaxWidth:t,keyMinWidth:n,compact:c,...l},e)},906936(e,t,n){n.d(t,{A:()=>p});var a=n(296540),l=n(938487),r=n.n(l),c=n(162420),i=n(823858),o=n(793336),s=n(71479),m=n(382389),E=n(566723),d=n(294303),A=n(311785);const u=(0,s.A)(d.A,(0,A.A)("borderColor","backgroundColor","dividerColor"))`
  background-color: ${({backgroundColor:e})=>e};
  border-left: 2px solid ${({borderColor:e})=>e};
  padding: ${E.Ln} ${E.Ln} ${E.Ln} 0;

  & + & {
    border-top: 1px solid ${({dividerColor:e})=>e};
  }
`,_=(0,s.A)(d.A)`
  min-width: 36px;
  max-width: 36px;
`,C=(e,{warning:t,neutral01:n,danger:l,info:s})=>{switch(e){case"warning":return{icon:a.createElement(i.A,{size:"medium",color:t,variant:"fill"}),backgroundColor:n,borderColor:t,dividerColor:r()(t).alpha(.2).css()};case"danger":return{icon:a.createElement(o.A,{size:"medium",color:l,variant:"fill"}),backgroundColor:n,borderColor:l,dividerColor:r()(l).alpha(.2).css()};default:return{icon:a.createElement(c.A,{isActive:!0,size:"original"}),backgroundColor:n,borderColor:s,dividerColor:r()(s).alpha(.2).css()}}},p=({level:e,children:t,overrideLevel:n})=>{const{motifPalette:l}=(0,m.u)(),{icon:r,backgroundColor:c,borderColor:i,dividerColor:o}={...C(e,l),...n};return a.createElement(u,{flexDirection:"row",width:"100%",backgroundColor:c,borderColor:i,dividerColor:o},a.createElement(_,{justifyContent:"center"},r),a.createElement(d.A,{flexDirection:"column",justifyContent:"center"},t))}},339577(e,t,n){n.d(t,{R:()=>u,n:()=>A});var a=n(296540),l=n(613910),r=n(566723),c=n(115829),i=n(568777),o=n(294303),s=n(765562),m=n(746289);const E={width:"auto",maxWidth:"80px",height:"20px"},d=`${s.A.asnPath}65534${m.m1}`,A={ATT:7018,TMOBILE:21928,VERIZON:701},u=({carrier:e,asn:t})=>e?a.createElement(o.A,{gap:r.YC,flex:"0 1 auto",overflow:"hidden"},a.createElement(o.A,{flex:"0 0 auto"},void 0!==t?a.createElement(i.A,{asn:t,style:E,useFallback:!0,customFallback:d}):a.createElement(l.A,{size:"original"})),a.createElement(c.A,{color:"text-2",size:"medium"},e)):null},675116(e,t,n){n.d(t,{A:()=>D});var a=n(296540),l=n(469733),r=n(231755),c=n(689965),i=n(566723),o=n(294303),s=n(814356),m=n(302167),E=n(780811),d=n(217439),A=n(916537),u=n(339577);const _=({children:e})=>a.createElement(d.A,{color:"text-3",size:"small"},e),C=({children:e,reference:t})=>a.createElement(o.A,{gap:i.YC},a.createElement(o.A,{width:12},a.createElement(_,null,t)),a.createElement(o.A,null,a.createElement(d.A,{color:"text-3",size:"small"},e))),p=({children:e,reference:t})=>a.createElement(o.A,null,e,a.createElement(_,null,t)),I=()=>a.createElement(o.A,{flexDirection:"column",gap:i.YC},a.createElement(o.A,null,a.createElement(d.A,{color:"text-2",size:"medium"},a.createElement(A.sA,{id:"DEVICE_CERTIFIED_WITH"})," "),a.createElement(o.A,{gap:i.kc},a.createElement(u.R,{carrier:a.createElement(A.sA,{id:"DEVICE_CARRIER_ATT"}),asn:u.n.ATT}),a.createElement(p,{reference:"*"},a.createElement(u.R,{carrier:a.createElement(A.sA,{id:"DEVICE_CARRIER_TMOBILE"}),asn:u.n.TMOBILE})))),a.createElement(C,{reference:"*"},a.createElement(A.sA,{id:"DEVICE_TMOBILE_NOT_SUPPORTED",values:{br:a.createElement("br",null)}})),a.createElement(C,{reference:"**"},a.createElement(A.sA,{id:"DEVICE_CARRIER_NOT_SUPPORTED",values:{carrier:a.createElement(A.sA,{id:"DEVICE_CARRIER_VERIZON"})}})));var S=n(10373),O=n(777741),v=n(569299);const T=({networkScanOperators:e=[]})=>e.length?a.createElement(o.A,{gap:i.kc},a.createElement(d.A,{color:"text-2",size:"medium"},a.createElement(A.sA,{id:"DEVICE_MBB_LOCAL_CARRIERS"}),":"),e.map(e=>a.createElement(u.R,{key:e.name,carrier:(0,v.ap)(e.name),asn:e.asn}))):null,D=({imei:e,eId:t,networkScanOperators:n=[],model:d})=>{const A=(0,l.useSelector)(m.AP),u=(0,E.uMn)({model:d})||(0,E.KLl)({model:d})||(0,E.evX)({model:d})||(0,E.ocB)({model:d}),_=(0,s.Kq)(A)&&u;return e||t||n?.length||_?a.createElement(c.A,null,a.createElement(o.A,{flexDirection:"column",gap:i.kc},a.createElement(o.A,{flexDirection:"column",gap:i.xO,paddingBottom:i.YC},_?a.createElement(I,null):a.createElement(T,{networkScanOperators:n}),a.createElement(r.A,null)),e?a.createElement(S.A,{imei:e}):null,t?a.createElement(O.A,{eid:t}):null)):null}},123396(e,t,n){n.d(t,{A:()=>b});var a=n(296540),l=n(813040),r=n(822336),c=n(469733),i=n(271856),o=n(217439),s=n(71479),m=n(382389),E=n(132196),d=n(137625),A=n(955161),u=n(734707),_=n(845030),C=n(916537),p=n(691189),I=n(294201);const S=`${n(771805).J}/cmd/devmgr/ubb-unpair`;var O=n(83344),v=n(602021),T=n(837612),D=n(602197),g=n(171073),h=n(765268),N=n(311785);const P=(0,s.A)(u.Ay,(0,N.A)("disabled"))`
  padding: 0;
  ${({disabled:e})=>e?"pointer-events: none; opacity: 0.4;":""};
  color: ${({theme:{themeName:e,motifPalette:{red05:t}},disabled:n})=>n?t:r.Ay[`desktop-color-red-06-${e}`]};
  &:hover {
    color: ${({theme:{motifPalette:{red05:e}}})=>e};
  }
  &:active {
    color: ${({theme:{motifPalette:{red05:e,red07:t}},disabled:n})=>n?e:t};
  }
`,f=E.AH`
  flex: 1;
  width: 100%;
`,M=e=>a.createElement(i.A,{portal:!0,description:a.createElement(o.A,{style:{whiteSpace:"pre-wrap"}},a.createElement(C.sA,{id:"DEVICE_ACTIONS_REMOVE_TOOLTIP"})),className:f},e),R=({device:e,disabled:t,variant:n})=>{const l=(0,c.useDispatch)(),r=(0,m.u)(),[i,s]=(0,a.useState)(!1),[E,N]=(0,a.useState)(!1),R=(0,c.useSelector)(v.EL),b=(0,T.S9)(e),{isDeviceDisconnected:y,isDeviceAdoptionFailed:U,deviceBusy:k}=(0,a.useMemo)(()=>({isDeviceDisconnected:b===D.g.DISCONNECTED,isDeviceAdoptionFailed:b===D.g.ADOPTION_FAILED,deviceBusy:(0,T.C1)(b)}),[b]),L=(0,a.useMemo)(()=>t||k||R||y||U,[t,k,R,y,U]),V=(0,a.useMemo)(()=>"tertiary"===n,[n]);return a.createElement(A.A,{condition:k,wrapper:M},a.createElement(d.A,{isOpen:E,title:"DEVICE_ACTIONS_UNPAIR_CONFIRM_TITLE",message:"DEVICE_ACTIONS_UNPAIR_CONFIRM_MESSAGE",buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",handleConfirm:async()=>{var t;s(!0),l((t=e.mac,(0,p.Xj)(I.A.UBB_UNPAIR,S,{mac:t}))).then(()=>{l((0,O.W)(e.mac)),l((0,g.XL)(e.mac)),s(!1),N(!1),l((0,_.K5)()),l((0,h.O)())}).finally(()=>{s(!1),N(!1)})},handleClose:()=>{s(!1),N(!1)},className:V?f:""},a.createElement(P,{disabled:L,variant:V?void 0:"link",className:V?(0,u.sC)(r):"",onClick:e=>{e.preventDefault(),e.stopPropagation(),N(!0)},loader:i?"spinner":null,type:"button"},a.createElement(o.A,{color:"red-06",size:"medium"},a.createElement(C.sA,{id:"COMMON_ACTION_UNPAIR"})))))},b=({activeItem:e})=>a.createElement(l.R,{tooltipId:"DEVICE_ACTIONS_UNPAIR_INFO",tooltipProps:{tooltipClassName:"tooltip-position-fixer",variant:"outline"}},a.createElement(R,{device:e}))},817935(e,t,n){n.r(t),n.d(t,{default:()=>Dt});var a=n(296540),l=n(469733),r=n(960407),c=n(840279),i=n(422969),o=n(956347),s=n(840124),m=n(973581),E=n(935780),d=n(845030),A=n(198494),u=n(412952);const _=()=>{const e=(0,l.useDispatch)(),t=(0,a.useCallback)(()=>{e((0,d.SQ)(!1))},[e]);return a.createElement(u.A,{onLeave:t})};var C=n(284388);const p=()=>{const e=(0,l.useDispatch)(),t=(0,a.useCallback)(()=>{e((0,d.Fr)())},[e]),n=(0,a.useCallback)(()=>{e((0,d.nw)())},[e]);return a.createElement(C.A,{onCancel:t,onConfirm:n})};var I=n(398300),S=n(916537),O=n(837612),v=n(991e3),T=n(71479),D=n(566723);const g=(0,T.A)(v.A)`
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: ${D.Ln};
`,h=(0,a.memo)(({tabs:e,currentTab:t})=>{const n=(0,l.useDispatch)(),r=(0,a.useCallback)(e=>{n((0,d.X2)(e))},[n]);return e?.length?a.createElement(g,{tabs:e,value:t,iconOnly:!0,onChange:r,tooltipProps:{animate:!1}}):null});var N=n(822336),P=n(574137),f=n(613870),M=n(780811),R=n(294303);const b=(0,T.A)(R.A)`
  background-color: ${P.PA.success};
  color: ${P.N0};
  font-size: 11px;
`,y=(0,T.A)("div")`
  font-weight: ${N.Ay["desktop-font-weight-semibold"]};
  margin-bottom: ${D.YC};
`,U=({activeItem:e})=>(e=>Object(e)===e&&"type"in e&&"model"in e&&"adopted"in e&&!("product_line"in e))(e)&&(0,M.tNJ)(e)&&(0,M.Vly)(e)?a.createElement(b,{flex:"none",height:50,minHeight:50,padding:`${D.kc} ${D.fS}`,position:"relative"},a.createElement(R.A,{alignItems:"center",justifyContent:"center",marginRight:D.Ln},a.createElement(f.A,{width:18,height:18,strength:(0,M.KwR)(e),color:"currentColor",inactiveColor:P.kv})),a.createElement(R.A,{flexDirection:"column",justifyContent:"center",flex:1},a.createElement(y,null,a.createElement(S.sA,{id:"DEVICE_ULTE_IS_ACTIVE_TITLE"})),a.createElement(S.sA,{id:"DEVICE_ULTE_IS_ACTIVE_DETAILS"}))):null;var k=n(962926),L=n(217439),V=n(162420),w=n(382389),x=n(132196),z=n(6510),$=n(860631),G=n(224948),W=n(349107),H=n(532419),F=n(765562),B=n(932752);const Y=({last_uplink:e={}})=>{const{formatMessage:t}=(0,S.tz)(),n=(0,l.useSelector)(H.CC),r=(0,B.Z)(e.uplink_mac,n),c=(0,B.z)(e.uplink_device_name,e.uplink_remote_port,r,t);return a.createElement(G.A,{icon:a.createElement(V.A,{size:"original",isActive:!0,variant:"fill"})},a.createElement(L.A,null,a.createElement(S.sA,{id:"COMMON_DEVICE_CONNECTION_INTERRUPTED_WARNING",values:{strong:S.ko,uplinkDeviceName:c||a.createElement(S.sA,{id:"COMMON_UNKNOWN"}),link:a.createElement(W.A,{href:F.A.offlineArticle,id:"COMMON_HERE",noWrap:!0})}})))};var K=n(984576),X=n(551753),j=n(876250),Q=n(6176),Z=n(142208),q=n(300477),J=n(999589),ee=n(758649),te=n(592510),ne=n(130851),ae=n(464265),le=n(776309),re=n(465860),ce=n(675359),ie=n(126457),oe=n(86392),se=n(811569),me=n(477544),Ee=n(632169),de=n(460680),Ae=n(766254),ue=n(575593),_e=n(949909),Ce=n(975503),pe=n(990249),Ie=n(598796),Se=n(154628),Oe=n(785976),ve=n(602197),Te=n(171073),De=n(573363),ge=n(302167),he=n(180830),Ne=n(328403),Pe=n(959341),fe=n(274509),Me=n(823858);const Re=()=>a.createElement(R.A,{gap:D.kc,marginTop:D.kc},a.createElement(Me.A,{size:"original",color:P.PA.warning,variant:"fill"}),a.createElement(L.A,null,a.createElement(S.sA,{id:"DEVICE_UBB_ADOPT_WARNING_MESSAGE",values:{b:S.b}}))),be=(0,a.memo)(({name:e,model:t,mac:n})=>a.createElement(R.A,{gap:D.kc,marginTop:D.kc},a.createElement(Me.A,{size:"original",color:P.PA.warning,variant:"fill"}),a.createElement(L.A,{size:"small"},a.createElement(S.sA,{id:(0,M.P1n)(t)?"DEVICE_ADOPT_SECOND_GATEWAY_WHEN_UDM_USED_INFO":"DEVICE_ADOPT_SECOND_GATEWAY_INFO",values:{gateway:(0,z.Q)({name:e,model:t,mac:n}),b:S.b,br:S.br}})))),ye=()=>a.createElement(R.A,{gap:D.kc,marginTop:D.kc},a.createElement(Me.A,{size:"original",color:P.PA.warning,variant:"fill"}),a.createElement(L.A,null,a.createElement(S.sA,{id:"DEVICE_ULTE_PRO_SETUP_SIM_INCOMPATIBLE",values:{strong:S.ko}}))),Ue=()=>a.createElement(R.A,{gap:D.kc,marginTop:D.kc},a.createElement(Me.A,{size:"original",color:P.PA.warning,variant:"fill"}),a.createElement(L.A,null,a.createElement(S.sA,{id:"DEVICE_ULTE_USG_REQUIRED"})));var ke=n(906936);const Le=(0,T.A)(L.A)`
  line-height: 20px;
  margin-bottom: 10px;
`,Ve=()=>a.createElement(ke.A,{level:"warning"},a.createElement(Le,{size:"small"},a.createElement(S.sA,{id:"DEVICE_ACTIONS_ADOPT_WARNING_MESSAGE",values:{b:S.b}})));var we=n(715504);const xe=x.AH`
  flex: 1;
`,ze=({device:e,onAdoptionInitiated:t,disabled:n})=>{const{formatMessage:r}=(0,S.tz)(),c=(0,l.useDispatch)(),i=(0,O.S9)(e),[o,s]=(0,a.useState)(!0),[m,E]=(0,a.useState)(i===ve.g.ADOPTING),u=(0,l.useSelector)((0,ue.p)(_e.S.API_DEVICE_ADOPT)),_=(0,l.useSelector)(H.ID),C=(0,l.useSelector)(H.U$),p=(0,l.useSelector)(Ce.fV),v=(0,l.useSelector)(ne.p),T=(0,l.useSelector)(me.hX),g=(0,l.useSelector)(he.Xs),h=(0,l.useSelector)(De.A),N=(0,l.useSelector)(de.Z9),P=(0,ae.A)(Ie.Xj.MANAGED_SHADOW_MODE),f=(0,l.useSelector)(A.ay),b=(0,l.useSelector)(ge.jE),y=b?.cloud_template,U=i===ve.g.ADOPTION_FAILED,k=(0,O.YP)(e),L=(0,Oe.O)(e),V=(0,Oe.g)(e),w=!!e?.adoptable_when_upgraded,x=(0,M.moU)(e)&&!(0,M.DBW)(_,e,N,P),z=(0,M.tNJ)(e),$=z&&!(0,M.nKo)(_,e),G=z&&!e?.lte_imei,W=!!e?.lte_sim_incompatible,F=!k&&(L||V)&&u&&!($||x)&&!G,B=z&&!p,Y=(0,M.YdF)(e)&&!(0,Se.Ck)(e)&&!(0,M.IOl)(e),K=n||m||o||B||Y||W;(0,a.useEffect)(()=>{E(i===ve.g.ADOPTING)},[i,e.mac]),(0,a.useEffect)(()=>{Promise.all([c((0,Ne.Yo)(void 0,{crudCacheStrategy:{type:te.e.CACHE}})),c((0,Ee.uy)(void 0,{crudCacheStrategy:{type:te.e.CACHE}})),...P?[c((0,Ae.V9)(void 0,{crudCacheStrategy:{type:te.e.CACHE}}))]:[]]).then(()=>s(!1))},[c,P]),(0,a.useEffect)(()=>{c((0,pe.T)(void 0,{crudCacheStrategy:{type:te.e.CACHE}}))},[c]);return F?a.createElement(R.A,{flexDirection:"column"},B?a.createElement(Ue,null):null,W?a.createElement(ye,null):null,Y?a.createElement(Re,null):null,U&&!V?a.createElement(Ve,null):null,U&&V?a.createElement(Z.A,{device:e,variant:"tertiary"}):null,L?a.createElement(R.A,{gap:D.kc,alignItems:"center",marginTop:D.kc},a.createElement(we.e,{device:e},a.createElement(ee.A,{variant:"primary",onClick:n=>{n?.preventDefault(),n?.stopPropagation(),(n=>{function l(){z?(c((0,se.ji)(e.mac,(0,M.mHb)(e)?"LTE_PRO_ADOPTION":"LTE_ADOPTION")),E(!1)):function(){if(e.discovered_by===fe.A.PROTOCOL_V2_ID)E(!1);else if(V?c((0,Te.T3)(e,n.values)).catch(()=>E(!1)):c((0,Te.Hk)(e)).catch(()=>E(!1)),(0,M.G5G)(e)){const t=(0,q.A)();T||c((0,ce.ox)({icon:a.createElement("div",null,a.createElement(Q.C,{model:e?.model,width:53,height:53,imagePath:v,deviceModelMap:h,theme:f})),title:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_TITLE",message:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_MESSAGE",primaryButton:{label:r({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_ACTION"}),onClick:()=>{c((0,ce.uU)(t)),c((0,d.XP)({type:I.H.WIFI,id:Pe.R6}))}},translateTitle:!0},t)),g||(0,M.r$V)(e)||c((0,ce.ox)({icon:a.createElement("div",null,a.createElement(Q.C,{model:e?.model,width:53,height:53,imagePath:v,deviceModelMap:h,theme:f})),title:r({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_AP_GROUP_NOT_DEFAULT_TITLE"},{deviceName:e?.hostname}),message:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_AP_GROUP_NOT_DEFAULT_MESSAGE",primaryButton:{label:r({id:"DEVICE_ACTIONS_ADOPT_ACCESS_POINT_ACTION"}),onClick:()=>{c((0,ce.uU)(t)),c((0,d.XP)({type:I.H.WIFI,id:Pe.R6}))}}},t))}}()}function i(){if(e.elite&&e.elite.replacement_for_mac){const t=_.find(t=>t.mac===e.elite.replacement_for_mac);c((0,oe.E)({title:"DEVICE_APPLY_CONFIGURATION_HEADER",titleValues:{deviceName:t.name},message:"DEVICE_APPLY_CONFIGURATION_MESSAGE",messageValues:{deviceName:t.name},size:"small",onConfirm:()=>{c((0,ie.AS)())},onCancel:()=>{c((0,ie.AS)()),V?l():(0,re.A)([e.mac],{dispatch:c,cloudTemplate:y}).then(l).catch(()=>E(!1))}}))}else(0,M.m_j)({type:e.type})?c((0,ie.to)({modalType:le.A.REGISTER_ISP_GUIDE,modalProps:{onConfirm:l,onCancel:()=>E(!1)}})):V?l():(0,re.A)([e.mac],{dispatch:c,cloudTemplate:y}).then(l).catch(()=>E(!1))}w?c((0,oe.E)({title:"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_TITLE",titleValues:{deviceName:e.name},message:e.upgrade_to_firmware?"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_VERSION_MESSAGE":"DEVICE_ACTIONS_ADOPT_AND_UPGRADE_CONFIRM_MESSAGE",messageValues:{fromVersion:(0,J.coerce)(e.version)?.version,toVersion:(0,J.coerce)(e.upgrade_to_firmware)?.version},size:"small",onConfirm:()=>{c((0,ie.AS)()),i()},onCancel:()=>{c((0,ie.AS)()),E(!1)}})):i(),E(!0),t?.()})()},disabled:K,wrapClassName:xe},a.createElement(S.sA,m?{id:"COMMON_DEVICE_STATE_ADOPTING"}:{id:w?"DEVICE_ACTIONS_ADOPT_AND_UPGRADE":"DEVICE_ACTIONS_ADOPT"})))):null):a.createElement(R.A,{flexDirection:"column"},!x||P&&C.model===e.model?null:a.createElement(be,{name:C.name,model:C.model,mac:C.mac}))};var $e,Ge=n(187483),We=n(215454),He=n(211368),Fe=n(231226),Be=n(546391),Ye=n(123396),Ke=n(689965),Xe=n(325898),je=n(768195);!function(e){e[e.AP=0]="AP",e[e.SWITCH=1]="SWITCH",e[e.DEFAULT=2]="DEFAULT"}($e||($e={}));const Qe={[$e.AP]:()=>{const e=(0,l.useSelector)(ne.p),{motif:t}=(0,Xe.A)();return a.createElement(R.A,{justifyContent:"center"},a.createElement("video",{height:226,loop:!0,muted:!0,autoPlay:!0,src:`${e}/resetButton/reset-AP_${t}.mp4`}))},[$e.SWITCH]:()=>{const e=(0,l.useSelector)(ne.p);return a.createElement(R.A,{justifyContent:"end"},a.createElement("img",{width:326,height:226,src:`${e}/resetButton/switch.png`,alt:"reset"}))},[$e.DEFAULT]:()=>{const e=(0,l.useSelector)(ne.p);return a.createElement(R.A,{justifyContent:"center"},a.createElement("img",{width:"100%",height:152,src:`${e}/resetButton/other.png`,alt:"reset"}))}},Ze={[je.W4.U5GMAX]:"DEVICE_RESET_DESC_LCM"},qe=["U7HD","U7NHD","UCXG","U7SHD","U7PG2","U7LR","U7LT","UAL6","UAP6","UALR6","UALR6v2","UALR6v3","UAP6MP","UAPL6","UALRPL6","U6ENT"],Je=["US24P250","S224250","US48P500","S248500","US8P150","S28150","USC8P150","US16P150","S216150","USL24P","USL24PB","US24PRO2","US24PRO","USLP24P","USL48","USL48B","USL48P","USL48PB","US48PRO","USLP48P","US48PRO2","USL16P","USL16PB","USXG","US6XG150","US624P","US648P","USXG24","USL8A","USAGGPRO","USL8MP"],et=({model:e})=>{const t=(0,a.useMemo)(()=>{const t=qe.includes(e),n=Je.includes(e);let a=$e.DEFAULT;return t?a=$e.AP:n&&(a=$e.SWITCH),a},[e]),n=Qe[t];return a.createElement(a.Fragment,null,a.createElement(R.A,{marginTop:D.kc},a.createElement(R.A,{marginRight:D.kc},a.createElement(V.A,{isActive:!0,variant:"fill",size:"original"})),a.createElement(L.A,null,a.createElement(S.sA,{id:Ze[e]||"DEVICE_PROPERTIES_RESET_DESC"}))),a.createElement(n,null))};var tt=n(360113),nt=n(675116);const at=x.AH`
  margin-bottom: ${D.Ln};
`,lt=(0,T.A)("div")`
  align-self: center;
`,rt=({activeItem:e,activeItem:{mac:t,model:n,ip:r,state:c,last_uplink:i,mbb:o,type:s,wan_networkgroup:m}})=>{const E=(0,l.useSelector)(Fe.IN),d=(0,l.useSelector)(H.k4),A=(0,l.useSelector)(H.pV),u=(0,l.useSelector)(Fe.Eo),_=(0,l.useSelector)(H.YS),C=(0,l.useSelector)(We.C7),p=(0,l.useSelector)(Ge.TP),{motifPalette:{orange01:I}}=(0,w.u)(),v=(0,M.R30)({type:s,model:n})&&A&&!m,T=(0,O.S9)(e),g=T===ve.g.MANAGED_BY_OTHER,h=T===ve.g.ADOPTION_FAILED,[N,P]=(0,a.useState)(T===ve.g.ADOPTING),f=(0,M.X6b)(e),b=(0,$.UA)(e);(0,a.useEffect)(()=>{P(T===ve.g.ADOPTING)},[t,T]);let y=null;E&&u&&(C&&(y=a.createElement(R.A,{flexDirection:"column"},a.createElement(S.sA,{id:"DEVICE_ADOPTION_LIMIT_REACHED_CLOUD_CONSOLE",values:{limit:u.limit}}),a.createElement(W.A,{id:"DEVICE_ADOPTION_MANAGE_CLOUD_CONSOLE_SUBSCRIPTION",href:p.replace(Be.pG,"/console-settings")}))),_&&(y=a.createElement(S.sA,{id:"DEVICE_ADOPTION_UNIFI_EXPRESS",values:{limit:u.limit,link:a.createElement(W.A,{href:F.A.unifiConsoles,id:"DEVICE_ADOPTION_HIGHER_CAPACITY_CONSOLE"})}})));const U=y&&!N;return a.createElement(a.Fragment,null,(0,M.JWq)(e)||(0,M.R$Q)(e)?a.createElement(X.A,{variant:"warning"},a.createElement(L.A,null,a.createElement(S.sA,{id:"DEVICE_POE_PASSTHROUGH_WARNING",values:{port:(0,M.R$Q)(e)?1:2}}))):null,a.createElement(k.A,{className:at,sections:[a.createElement(a.Fragment,null,a.createElement(R.A,{gap:D.kc},a.createElement(Q.A,{model:e.model,size:j.Xh.MEDIUM,width:40,height:40}),a.createElement(lt,null,a.createElement("div",null,a.createElement(L.A,{weight:"bold"},(0,z.Lm)(e.model))))),E?null:a.createElement(ze,{device:e,onAdoptionInitiated:()=>P(!0),disabled:v}),g?a.createElement(et,{model:n}):null,U&&_&&h?a.createElement(Z.A,{device:e,variant:"tertiary"}):null)]}),He.q[c]===ve.g.ADOPTION_FAILED?a.createElement(Y,{last_uplink:i}):null,U?a.createElement(G.A,{icon:a.createElement(V.A,{size:"original",isActive:!0,variant:"fill"})},a.createElement(L.A,null,y)):null,v?a.createElement(G.A,{icon:a.createElement(K.k0,{size:"original",variant:"fill",color:I})},a.createElement(L.A,null,a.createElement(S.sA,{id:"DEVICE_RESTRICT_ADOPTION_ONE_CELLULAR_DEVICE",values:{deviceName:d,model:(0,z.Lm)(e.model)}}))):null,(0,M.zqY)({mbb:o})?a.createElement(nt.A,{imei:o?.imei,eId:o?.esim?.eid,networkScanOperators:o?.network_scan?.operators||[],model:n}):null,a.createElement(Ke.A,null,t?a.createElement(tt.A,null,a.createElement(L.A,{color:"text-2",size:"medium"},a.createElement(S.sA,{id:"COMMON_MAC_ADDRESS"})),a.createElement(L.A,{color:"text-3",size:"medium"},t)):null,r?a.createElement(tt.A,null,a.createElement(L.A,{color:"text-2",size:"medium"},a.createElement(S.sA,{id:"COMMON_IP_ADDRESS"})),a.createElement(L.A,{color:"text-3",size:"medium"},r)):null),f&&b&&!C?a.createElement(Ke.A,{type:Ke.I.BUTTON_LIST},a.createElement(Ye.A,{activeItem:e})):null)};var ct=n(101955);const it=(0,a.memo)(e=>{const{activeItem:{type:t,data:n},content:c}=e,i=(0,l.useSelector)(r.oI),o=(0,l.useSelector)(r.Oh),s=(0,l.useSelector)(r.n6),m=i&&i in c.panels?i:c.defaultId,{formatMessage:E}=(0,S.tz)(),d=t===I.H.DEVICE&&!(0,O.YP)(n),A=(0,a.useMemo)(()=>{if(c.singlePanel)return ct.c;const t=Object.keys(c.panels).reduce((t,n)=>{const{disabled:a,title:l,icon:r}=c.panels[n];return a?.({...e})||t.push({value:n,label:l&&E({id:l}),icon:r}),t},[]);return t.length<2?ct.c:d?[{value:c.defaultId,label:E({id:c.panels[c.defaultId].title}),icon:c.panels[c.defaultId].icon}]:t},[e,c,d,E]),u=(0,a.useMemo)(()=>{if(d)return a.createElement(rt,{activeItem:n,key:"adopt-panel"});if((s||o)&&c.subComponent)return a.createElement(c.subComponent,{activeItem:n,subPanel:s,subId:o});const{component:e}=c.panels[m];return a.createElement(e,{activeItem:n,subPanel:i})},[c,n,d,m,o,i,s]);return a.createElement(a.Suspense,{fallback:null},!c.singlePanel&&A.length>1&&!d?a.createElement(h,{tabs:A,currentTab:m}):null,a.createElement(U,{activeItem:n}),u)});var ot=n(260447),st=n(117639),mt=n(647758);var Et=n(798517),dt=n(874807);const At=({activeItem:{data:e,type:t}})=>{const{formatMessage:n}=(0,S.tz)(),a=(0,mt.A)(),l=(0,ot.B)(t);return l?.renderTitle(l?.getLabel(e,{formatMessage:n,formatDateTime:a})||"",e)||null},ut=({id:e,panelType:t})=>{const n=(0,a.useRef)(null),i=(0,l.useDispatch)(),{pathname:u}=(0,o.zy)(),C=(0,l.useSelector)(r.WS),I=(0,l.useSelector)(r.Em),O=(0,l.useSelector)(r.aK),v=(0,l.useSelector)(r.LK),T=(0,l.useSelector)(r.gm),D=(0,l.useSelector)(r.S5),g=(0,l.useSelector)(A.P),h=(({id:e,type:t})=>{const{formatMessage:n}=(0,S.tz)(),r=(0,l.useSelector)((0,a.useMemo)(()=>e&&(0,ot.B)(t)?.selectData(e,{formatMessage:n})||dt.P1,[e,t,n]))||{};return{type:t,data:r}})({id:e,type:t||v});((e,t)=>{const n=(0,l.useDispatch)(),r=(0,a.useMemo)(()=>(0,st.Tl)(t.type,e)?(0,st.iy)(t.type,e):void 0,[t.type,e]),c=(0,st.As)(t),i=(0,mt.A)(),o=(0,st.Zs)(t,(0,S.tz)().formatMessage,i);(0,a.useEffect)(()=>{r&&n(void 0!==c.imageId&&void 0!==o?(0,d.WN)({id:r,element:c.image,label:o,closable:!0}):(0,d.CY)(r))},[n,r,o,c.imageId])})(e,h),(0,E.A)(e);const{views:N,currentViewId:P}=(0,a.useMemo)(()=>({views:g&&D.length>1?D:(0,c.A)(),currentViewId:D.find(({id:e})=>T&&v&&e.includes(T)&&e.includes(v))?.id}),[g,D,v,T]),f=(0,a.useCallback)(e=>{if(e===P){const t=N.filter(({id:t})=>t!==e).pop();if(t?.id){const[e,n]=t.id.split(Et._H);i((0,d.XP)({type:e,id:n}))}}i((0,d.CY)(e))},[i,N,P]),M=(0,a.useCallback)(()=>{P&&i((0,d.CY)(P)),i((0,d.DW)(u)),i((0,d.K5)())},[i,P,u]);(0,m.A)(()=>{C&&M()},[C]),(0,a.useEffect)(()=>{C&&!h.type&&M()},[C,h.type,M]);const R=(0,ot.B)(h.type),b=h&&h.type&&Object.keys(h?.data||{})?.length?R?.content:void 0,y="function"==typeof b?b(h.data):b,U=(0,l.useSelector)(r.oI);(0,a.useEffect)(()=>{n.current&&(n.current.scrollTop=0)},[U]);const k=(0,a.useCallback)(e=>{const[t,n]=e.split(Et._H);i((0,d.XP)({type:t,id:n}))},[i]);return(0,a.useEffect)(()=>{C&&!y&&M()},[M,C,y]),y?a.createElement(s.A,{key:P,in:C,header:a.createElement(At,{activeItem:h}),onClose:M,scrollableRef:n,views:N,currentViewId:P,onViewClick:k,onViewClose:f,className:ct.X},C?a.createElement(it,{content:y,activeItem:h}):null,I?a.createElement(p,null):null,O?a.createElement(_,null):null):null};var _t;!function(e){e.TYPE="type",e.ID="id",e.SUB_ID="subId"}(_t||(_t={}));const Ct=Object.values(I.H);var pt=n(849513),It=n(212178);var St=n(627440);const Ot=new RegExp(`/${St.VO.DEVICES}/properties/(.*)`);var vt=n(775586);const Tt=({id:e,type:t})=>{const n=(0,a.useMemo)(()=>(0,ot.B)(t)?.dependencies||(0,c.A)(),[t]);return(0,i.A)(n,e&&t?a.createElement(ut,{id:e,panelType:t}):null)},Dt=(0,a.memo)(()=>{const{pathname:e,search:t}=(0,vt.A)(),n=(0,l.useSelector)(r.gm),c=(0,l.useSelector)(r.LK);((e,t,n)=>{const c=(0,l.useDispatch)(),{pathname:i}=(0,o.zy)(),s=(0,It.A)(i),m=(0,It.A)(e),E=(0,l.useSelector)(r.oI),A=(0,l.useSelector)(r.SP),u=(0,l.useSelector)(r.RJ);(0,a.useEffect)(()=>{if(i!==s||e!==m){t&&n&&(s||m)&&!A&&c((0,d.mn)({[s||m]:{[pt.QK.ID]:t,[pt.QK.TYPE]:n,[pt.QK.TAB]:E}}));const a=u[i||e];c(a&&!A?(0,d.XP)({[pt.QK.ID]:a[pt.QK.ID],[pt.QK.TYPE]:a[pt.QK.TYPE],[pt.QK.TAB]:a[pt.QK.TAB]}):(0,d.K5)())}},[c,i,s,e,m,t,n,E,u,A])})(e,n,c),(e=>{const t=(0,l.useDispatch)();(0,a.useEffect)(()=>{const n=e.match(Ot)?.[1]?.split("/")?.[0];n&&t((0,d.XP)({type:I.H.DEVICE,id:n}))},[t,e])})(e),(e=>{const t=(0,l.useDispatch)();(0,a.useEffect)(()=>{const n=new URLSearchParams(e),a=n.get(_t.TYPE),l=n.get(_t.ID),r=n.get(_t.SUB_ID);l&&Ct.includes(a)&&t((0,d.XP)({type:a,id:l,subId:r}))},[t,e])})(t);const i=(0,a.useMemo)(()=>[n,c].join(),[n,c]);return n&&c?a.createElement(Tt,{key:i,id:n,type:c}):null})},775586(e,t,n){n.d(t,{A:()=>r});var a=n(296540),l=n(956347);const r=()=>{const e=(0,l.zy)(),[t,n]=(0,a.useState)(e.search),[r,c]=(0,a.useState)(e.pathname),i=(0,a.useCallback)(e=>{const{search:t,pathname:a}=e.target.location;n(t),c(a)},[]);return(0,a.useEffect)(()=>(window.addEventListener("replacestate",i),()=>{window.removeEventListener("replacestate",i)})),{search:t,pathname:r}}},935780(e,t,n){n.d(t,{A:()=>M});var a=n(296540),l=n(469733),r=n(592510),c=n(525512),i=n(413914),o=n(687573),s=n(648092),m=n(906593),E=n(171073),d=n(984652),A=n(602197),u=n(960987),_=n(691294);const C=new Map,p="device-watch-mode-listener",I=["mac","state"],S=["uplink_mac","type","unifi_device"],O=({mac:e,state:t},n)=>Boolean(e&&n)&&e!==n&&t===u.A[A.g.CONNECTED],v=e=>e.type!==_.sK.WIRELESS&&e.type!==_.sK.WIRED||e.unifi_device?void 0:e.uplink_mac;var T,D,g=n(801081),h=n(189601),N=n(602021),P=n(532419),f=n(239417);!function(e){e.DEVICE_MAC="device_mac",e.IS_WATCHED="is_watched",e.WATCHED_TIMEOUT="watched_timeout",e.UPDATE_INTERVAL_SECONDS="update_interval_seconds"}(T||(T={})),function(e){e.INSTANCES="instances",e.TIMEOUT="timeout"}(D||(D={}));const M=e=>{const t=(0,l.useDispatch)(),n=(0,l.useSelector)((0,a.useMemo)(()=>{return t=e,(0,h.WY)()((0,g.Mz)((0,f.kV)(t,S),v),e=>e);var t},[e])),A=(0,a.useMemo)(()=>n||e,[n,e]),u=(0,l.useSelector)((0,a.useMemo)(()=>{return e=A,(0,h.WY)()((0,g.Mz)((0,P.bw)(e,I),N.vc,O),e=>e);var e},[A])),_=(0,l.useSelector)(s.a),M=(0,a.useMemo)(()=>_[m.Uz],[_]),R=(0,a.useCallback)(e=>{M.send({type:i.E.WATCH_DEVICE,device_mac:e})},[M]),b=(0,a.useCallback)(({[T.IS_WATCHED]:e,[T.WATCHED_TIMEOUT]:t,[T.DEVICE_MAC]:n})=>{if(e){const e=1e3*t;if(e>Date.now()){const t=C.get(n);t&&(t[D.TIMEOUT]=setTimeout(()=>{R(n)},(e=>Math.max(e-Date.now()-5e3,5e3))(e)))}}},[R]),y=(0,a.useCallback)(e=>(0,c.K6)(e,b,!1,(e=>`${p}::${e}`)(e)),[b]);(0,a.useEffect)(()=>{if(u){Object.keys((0,c.WM)()).some(e=>e.startsWith(p))||o._[i.E.WATCH_DEVICE].map(y);const e=C.get(A);e?e[D.INSTANCES]+=1:(R(A),C.set(A,{[D.INSTANCES]:1,[D.TIMEOUT]:void 0}))}return()=>{const e=C.get(A);e&&(e[D.INSTANCES]>1?e[D.INSTANCES]-=1:(clearTimeout(e[D.TIMEOUT]),C.delete(A)),C.size||Object.keys((0,c.WM)()).filter(e=>e.startsWith(p)).forEach(c.$N))}},[R,y,A,u]),(0,a.useEffect)(()=>{t((0,E.Uc)(void 0,{crudCacheStrategy:{type:r.e.CACHE}})),t((0,d.$3)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}))},[t])}},973581(e,t,n){n.d(t,{A:()=>l});var a=n(296540);const l=(e,t=[])=>{const n=t=>{27===t.keyCode&&e(t)};(0,a.useEffect)(()=>(document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}),t)}},464265(e,t,n){n.d(t,{A:()=>c});var a=n(296540),l=n(469733),r=n(792072);const c=e=>(0,l.useSelector)((0,a.useMemo)(()=>(0,r.jN)(e),[e]))}}]);