"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[10514],{335521(e,n,t){t.d(n,{A:()=>r});var l=t(296540),a=t(469733),i=t(532419);const r=({mac:e,props:n,children:t})=>t((0,a.useSelector)((0,l.useMemo)(()=>(0,i.bw)(e,n),[e,n])))},515219(e,n,t){t.d(n,{J:()=>a});var l=t(768195);const a={[l.Dd.INDOOR]:"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_INDOOR",[l.Dd.OUTDOOR]:"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR"}},475405(e,n,t){t.d(n,{A:()=>d});var l=t(822336),a=t(296540),i=t(217439),r=t(71479),o=t(566723),c=t(916537);const s=(0,r.A)("div")`
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0 ${o.YC};
  overflow: hidden;

  &:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: ${({theme:{themeName:e}})=>l.Ay[`desktop-color-ublue-06-${e}`]};
    opacity: 0.1;
    border-radius: 8px;
  }
`,d=()=>a.createElement(s,null,a.createElement(i.A,{size:"small",color:"ublue-06"},a.createElement(c.sA,{id:"COMMON_MLO"})))},408565(e,n,t){t.d(n,{A:()=>A});var l=t(296540),a=t(217439),i=t(495003),r=t(71479),o=t(143811),c=t(294303),s=t(38937),d=t(566723),m=t(916537),E=t(170459),u=t(943887),_=t(475405);const p=(0,r.A)("li")`
  padding: ${d.kc} ${d.YC};
  display: flex;
  align-items: flex-start;
  gap: ${d.YC};
`,I=({className:e,id:n,isSelected:t,onClick:r,option:{label:o,value:I,radioLinks:A=[],mloMeshSupported:O=!1}})=>l.createElement(p,{id:n,onClick:r,className:e,"aria-selected":t,role:"option"},l.createElement(c.A,{flexDirection:"column",minWidth:d.Er,justifyContent:"flex-start"},t?l.createElement(i.A,{size:"original"}):null),l.createElement(c.A,{flexDirection:"column",width:"100%"},l.createElement(c.A,{flexDirection:"row",maxWidth:150},l.createElement(a.A,{variant:"body-primary",isTruncated:!0},o),O&&A.length>1?l.createElement(c.A,{position:"relative",marginLeft:d.YC},l.createElement(_.A,null)):null),l.createElement(c.A,{flexDirection:"row"},l.createElement(a.A,{variant:"caption"},I))),l.createElement(c.A,{flexDirection:"column",alignItems:"flex-end"},A.sort((e,n)=>(0,E.xd)(e.radio,n.radio)).map(({radio:e,signal:n,channel:t},i)=>l.createElement(c.A,{flexDirection:"row",key:`${e}-${i}`,gap:d.YC,alignItems:"center"},l.createElement(c.A,{flexDirection:"column",whiteSpace:"nowrap"},void 0!==t?l.createElement(a.A,{variant:"caption"},l.createElement(m.sA,{id:"COMMON_CHANNEL_RADIO_CHANNEL",values:{channel:t}})," (",l.createElement(m.sA,{id:(0,u.dI)(e)}),")"):null),l.createElement(c.A,{flexDirection:"column",whiteSpace:"nowrap"},void 0!==n?l.createElement(a.A,{variant:"caption",color:(0,s.b5)(n)},n," ",l.createElement(m.sA,{id:"COMMON_UNIT_DBM"})):null))))),A=({options:e,value:n,onChange:t,...a})=>l.createElement(o.A,{full:!0,translateLabel:!0,name:"parentMac",type:"dropdown",variant:"secondary",options:e,value:n,onChange:t,searchable:!0,placeholder:"COMMON_PLACEHOLDER_SELECT_DEVICE",translatePlaceholder:!0,validated:!0,renderOption:I,...a})},210514(e,n,t){t.d(n,{A:()=>B});var l=t(469733),a=t(296540),i=t(84385),r=t(860631),o=t(943805),c=t(398300),s=t(566723),d=t(855019),m=t(951272),E=t(252093),u=t(515219),_=t(553432),p=t(143811),I=t(349107),A=t(294303),O=t(916537),h=t(768195),M=t(765562);const N=({is6GhzSupported:e})=>{const{setFieldValue:n}=(0,m.j7)();return a.createElement(A.A,{marginBottom:s.Ln,alignItems:"center"},a.createElement(_.A,{gap:s.kc},[h.Dd.INDOOR,h.Dd.OUTDOOR].map(t=>a.createElement(p.A,{key:t,name:"outdoor_install_mode",type:"radio",value:t,onChange:()=>(e=>{switch(n("outdoor_install_mode",e),e){case h.Dd.OUTDOOR:n("outdoor_mode_override",h.Gi.ON);break;case h.Dd.INDOOR:n("outdoor_mode_override",h.Gi.OFF)}})(t)},a.createElement(A.A,{alignItems:"center",gap:s.YC},a.createElement(O.sA,{id:u.J[t]}),t===h.Dd.OUTDOOR?a.createElement(E.A,{messageId:e?"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR_6GHZ_TOOLTIP":"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR_TOOLTIP",values:{link:a.createElement(I.A,{id:"COMMON_LEARN_MORE",href:M.A.afcArticle})},variant:"outline",isInteractive:!0,portal:!0}):null)))))};var g=t(376576),D=t(845030),L=t(614164),C=t(564985),k=t(302167),b=t(457311),v=t(780811),R=t(532419),P=t(533105),T=t(27262),S=t(227902),f=t(329681),y=t(563485),w=t(198494),x=t(170459);const U=({device:e,radios:n})=>{const{formatMessage:t}=(0,O.tz)(),i=(0,l.useSelector)(w.EH),{values:{radios:r},setFieldValue:o}=(0,m.j7)(),[c]=n,s=(0,x.A4)(e,i);return(0,x.Ox)(e,c.name,s,t).length<=1?null:a.createElement(y.A,{name:"radios.0.antenna_id",configuredAntennaId:r[0].antenna_id,onChangeRadioAntenna:t=>{const l=(0,x.Sb)(e.antenna_table||[],t);n.forEach((n,a)=>{const i=n.name;(void 0!==(l?.[`${i}_gain`]??void 0)||(0,x.kb)(e,t))&&(o(`radios.${a}.antenna_id`,t),o(`radios.${a}.antenna_gain`,(0,x.pK)(l,i)))})},radio:c,device:e})},B=({activeItem:e,sortedRadios:n,hideMeshing:t})=>{const m=(0,l.useDispatch)(),E=(0,l.useSelector)(k.Zc),u=(0,l.useSelector)(R.ID),_=(0,l.useSelector)(k.ZZ),p=(0,v.KKO)(e.model,"outdoorModeSupport"),I=(0,r.X5)(e,_),A=(0,a.useMemo)(()=>n.map(({radio:e})=>n.some(({radio:e})=>e===C.sx.RADIO_6E)?e===o.A[C.sx.RADIO_6E.toUpperCase()].type:e===o.A.NA.type).lastIndexOf(!0),[n]),O=(0,v.zg4)(e)?C.sx.RADIO_NG:C.sx.RADIO_NA,h=n.findIndex(e=>e.radio===O),M=n.filter(({radio:e})=>e&&e===C.sx.RADIO_6E).length;return(0,a.useEffect)(()=>{m((0,b.Uc)())},[m]),a.createElement(a.Fragment,null,p?a.createElement(N,{is6GhzSupported:M>0}):null,!e.multi_active_antennas||(0,v.ERA)(e)?a.createElement(U,{device:e,radios:n}):null,(0,v.r$V)(e)?a.createElement(f.A,{radioIdx:h,deviceRadio:{device:e,radio:n[h]}}):n.map((t,l)=>{const r=l===n.length-1;return a.createElement(a.Fragment,{key:`${t.radio}-${t.name}`},t.radio!==C.sx.RADIO_6E||e.support_wifi6e||I?a.createElement(S.qk,{device:e,radio:t,isLastNa:l===A,radio6gCount:M,mode:S.Hm.DEVICE_AND_RADIO,onSelectMeshingParents:()=>{const n=(0,L.T)(e,u);n?.device&&m((0,D.XP)({type:c.H.DEVICE,id:n.device.mac,tab:d.BC.SETTINGS}))}}):a.createElement(P.A,{radioType:t.radio}),r?null:a.createElement(i.A,{style:{margin:`${s.Ln} 0`}}))}),(!t&&E||I&&M>1)&&!(0,v.E4T)(e)?a.createElement(i.A,{style:{margin:`${s.Ln} 0`}}):null,I&&M>1&&!p?a.createElement(g.A,{isOutdoor:!0}):null,!t&&E?a.createElement(T.A,{device:e}):null)}},27262(e,n,t){t.d(n,{A:()=>B});var l=t(469733),a=t(296540),i=t(951272),r=t(784045),o=t(705145),c=t(71479),s=t(592563),d=t(398300),m=t(566723),E=t(143811),u=t(955161),_=t(845030),p=t(916537),I=t(335521),A=t(147606),O=t(874807);const h=({children:e})=>a.createElement("span",{onClick:e=>{e.stopPropagation()},role:"button",tabIndex:0,onKeyDown:O.P1},e),M=(0,c.A)("ul")`
  padding: 0;
  list-style-type: none;
  margin-block-start: ${m.kc};
  margin-block-end: 0;
  li {
    margin-bottom: ${m.YC};
    button {
      max-width: 180px;
    }
  }
`,N=(e,n,t,i)=>r=>{const c=(0,l.useDispatch)(),m=(0,a.useCallback)(e=>()=>{c((0,_.XP)({type:d.H.DEVICE,id:e}))},[c]);return a.createElement(A.A,{title:a.createElement(p.sA,{id:"COMMON_WIFI_MESHING_DISABLED_CONFIRMATION_TITLE"}),message:a.createElement(a.Fragment,null,a.createElement(o.A,null,a.createElement(p.sA,{id:"COMMON_WIFI_MESHING_DISABLED_TOOLTIP"})),a.createElement(o.A,null,a.createElement(p.sA,{id:"COMMON_WIFI_MESHING_DISABLED_TOOLTIP_CONFIRMATION"})),a.createElement(M,null,i?a.createElement("li",null,a.createElement(s.A,{onClick:m(i)},a.createElement(o.A,{size:"inherit",color:"inherit",isTruncated:!0},a.createElement(I.A,{mac:i,props:["name"]},({name:e=i})=>e)))):null,"string"!=typeof t?t.map(e=>a.createElement("li",{key:e},a.createElement(s.A,{onClick:m(e)},a.createElement(o.A,{size:"inherit",color:"inherit",isTruncated:!0},a.createElement(I.A,{mac:e,props:["name"]},({name:n=e})=>n))))):null)),onConfirm:()=>{n(!e)},confirmButtonLabel:"COMMON_WIFI_MESHING_DISABLED_CONFIRMATION_CONFIRM_ACTION",confirmButtonVariant:"destructive",trigger:a.createElement("span",null,(0,a.cloneElement)(r,{onChange:O.P1}))})};var g;!function(e){e.MESHING="MESHING",e.DOWNLINKS="DOWNLINKS",e.UPLINKS="UPLINKS"}(g||(g={}));const D={[g.MESHING]:({meshingEnabled:e,downlinkMeshingMacs:n,meshingChildMac:t})=>e&&(n.length>0||!!t),[g.DOWNLINKS]:({downlinkMeshEnabled:e,downlinkMeshingMacs:n})=>e&&n.length>0,[g.UPLINKS]:({uplinkMeshEnabled:e,meshingChildMac:n})=>n&&e},L=({warningType:e,children:n,downlinkMeshingMacs:t,meshingChildMac:l,meshingEnabled:i,downlinkMeshEnabled:r,uplinkMeshEnabled:o,onChange:c,checked:s,...d})=>{const m=D[e]({meshingEnabled:i,uplinkMeshEnabled:o,downlinkMeshEnabled:r,downlinkMeshingMacs:t,meshingChildMac:l});return a.createElement(u.A,{condition:!d.disabled&&m,wrapper:N(s,c,t,l)},a.createElement(E.A,{checked:s,...d,type:"realCheckbox",disabled:d.disabled,onChange:({target:{checked:e}})=>{c(e)}},m?a.createElement(h,null,n):n))};var C=t(294303),k=t(728204),b=t(998146),v=t(302167),R=t(780811),P=t(768195),T=t(532419),S=t(6510),f=t(337029),y=t(860631),w=t(408565);const x=e=>({value:"",label:e({id:"COMMON_VALUE_AUTO"})});var U;!function(e){e.UPLINK_PRIORITY_1="uplinkPriority1",e.UPLINK_PRIORITY_2="uplinkPriority2"}(U||(U={}));const B=({device:e,disabled:n=!1,hideWirelessDownlink:t=!1,hideWirelessUplink:o=!1,hideUplinkPriority:c=!1})=>{const{formatMessage:s}=(0,p.tz)(),d=(0,l.useDispatch)(),{values:E,setFieldValue:u}=(0,i.j7)(),{wireless_uplink_mac:_="",wireless_downlink_macs:I=[]}=(0,l.useSelector)((0,a.useMemo)(()=>(0,k.pB)(e.mac),[e.mac]))||{},A=(0,l.useSelector)((0,a.useMemo)(()=>(0,k.mZ)(e.mac),[e.mac])),O=(0,l.useSelector)(v.Zc),h=(0,l.useSelector)(v.XA),M=(0,l.useSelector)((0,a.useMemo)(()=>(0,T.sL)((e.uplink_table||[]).filter(({mac:n})=>n!==e.mac),{excludeDeviceType:P.bq.UDB}),[e.mac,e.uplink_table])),N=(0,a.useMemo)(()=>{const e=M.map(e=>({label:(0,S.Q)(e),value:e.mac,radioLinks:"radioLinks"in e?e.radioLinks:void 0,mloMeshSupported:"mlo_mesh_supported"in e&&e.mlo_mesh_supported&&h?.mlo_mesh_enabled}));return(0,r.A)(e,[e=>Math.max(...e.radioLinks?.map(e=>e.signal||f.K)??[f.K]),e=>e.label],["desc","asc"])},[h?.mlo_mesh_enabled,M]),{parentOptions1:D,parentOptions2:B}=(0,a.useMemo)(()=>((e,n,t,l)=>({parentOptions1:[x(e),...n.filter(e=>!e.value||e.value!==l)],parentOptions2:[x(e),...n.filter(e=>!e.value||e.value!==t)]}))(s,N,E.uplinkPriority1,E.uplinkPriority2),[N,E.uplinkPriority1,E.uplinkPriority2,s]),K=(0,a.useCallback)((e,n)=>{let t=E.uplinkPriority1,l=E.uplinkPriority2;e===U.UPLINK_PRIORITY_1&&!n&&l?(t=l,l="",u(U.UPLINK_PRIORITY_1,t),u(U.UPLINK_PRIORITY_2,l)):u(e,n)},[u,E.uplinkPriority1,E.uplinkPriority2]),V=(0,a.useMemo)(()=>(0,R.DAR)({model:e.model}),[e.model]),F=(0,a.useMemo)(()=>(0,y._8)({model:e.model,wifi_caps2:e.wifi_caps2}),[e.model,e.wifi_caps2]),H=(0,a.useMemo)(()=>(0,R.G5G)({type:e.type,model:e.model,device_mode_override:e.device_mode_override})||V||n,[e.type,e.model,e.device_mode_override,n,V]),$=E.radios.some(e=>e.vwire_enabled??!0);return(0,a.useEffect)(()=>{d((0,b.d)(e.mac))},[e.mac,d]),O?a.createElement(C.A,{flexDirection:"column",gap:m.Ln},(0,R.r$V)(e)||t&&(!H||o||F)?null:a.createElement(C.A,{flexDirection:"row",gap:m.Ln},t?null:a.createElement(C.A,{flexDirection:"column",alignItems:"inherit"},a.createElement(L,{label:"COMMON_MESH_PARENT",name:"vwireEnabled",type:"realCheckbox",checked:$,disabled:!A||n,onChange:e=>{var n;u("radios",(n=e,E.radios.map(e=>({...e,vwire_enabled:n}))))},tooltipMessage:a.createElement(p.sA,{id:"DEVICE_PROPERTIES_LABEL_TOOLTIP_WIRELESS_DOWNLINK"}),warningType:g.DOWNLINKS,meshingEnabled:Boolean(E.meshingEnabled),downlinkMeshEnabled:$,uplinkMeshEnabled:Boolean(E.uplinkMeshEnabled),downlinkMeshingMacs:I},a.createElement(p.sA,{id:"COMMON_MESH_PARENT"}))),!H||o||F?null:a.createElement(C.A,{flexDirection:"column",alignItems:"inherit"},a.createElement(L,{label:"DEVICE_MESH_CONNECT",name:"uplinkMeshEnabled",type:"realCheckbox",checked:Boolean(E.uplinkMeshEnabled),disabled:!A||n,onChange:e=>{u("uplinkMeshEnabled",e)},tooltipMessage:a.createElement(p.sA,{id:V?"DEVICE_PROPERTIES_LABEL_TOOLTIP_WIRELESS_UPLINK_DEVICE":"DEVICE_PROPERTIES_LABEL_TOOLTIP_WIRELESS_UPLINK"}),warningType:g.UPLINKS,meshingEnabled:Boolean(E.meshingEnabled),uplinkMeshEnabled:Boolean(E.uplinkMeshEnabled),downlinkMeshingMacs:I,meshingChildMac:_?e.mac:void 0},a.createElement(p.sA,{id:"DEVICE_MESH_CONNECT"})))),H&&E.uplinkMeshEnabled&&!c?a.createElement(a.Fragment,null,a.createElement(C.A,null,a.createElement(w.A,{label:"DEVICE_PROPERTIES_LABEL_PRIORITY_NUMBER",translateLabel:!0,translateLabelValues:{number:E.uplinkPriority1?1:null},name:U.UPLINK_PRIORITY_1,options:D,value:E.uplinkPriority1,onChange:({value:e})=>K(U.UPLINK_PRIORITY_1,e)})),E.uplinkPriority1?a.createElement(C.A,null,a.createElement(w.A,{label:"DEVICE_PROPERTIES_LABEL_PRIORITY_NUMBER",translateLabelValues:{number:2},name:U.UPLINK_PRIORITY_2,options:B,value:E.uplinkPriority2,onChange:({value:e})=>K(U.UPLINK_PRIORITY_2,e)})):null):null):null}},337029(e,n,t){t.d(n,{GX:()=>l,Hv:()=>r,K:()=>a,TV:()=>o,f$:()=>c,rr:()=>i});const l=-30,a=-80,i=-65,r=184,o=238,c=10}}]);