"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[31891],{412086(e,n,i){i.d(n,{A:()=>o});var l=i(602086),a=i(977872),s=i(754924);const o=({mac:e,props:n,children:i})=>{const o=(0,a.d4)((0,l.useMemo)(()=>(0,s.bw)(e,n),[e,n]));return i((0,l.useMemo)(()=>o,[o]))}},454928(e,n,i){i.d(n,{A:()=>s});var l=i(274934),a=i(947414);const s=({children:e})=>(0,l.jsx)("span",{onClick:e=>{e.stopPropagation()},role:"button",tabIndex:0,onKeyDown:a.P1,children:e})},420610(e,n,i){i.d(n,{J:()=>a});var l=i(857780);const a={[l.Dd.INDOOR]:"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_INDOOR",[l.Dd.OUTDOOR]:"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR"}},609664(e,n,i){i.d(n,{A:()=>c});var l=i(274934),a=i(814557),s=i(938984),o=i(247816),r=i(309130),d=i(470070);const t=(0,o.A)("div")`
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0 ${r.YC};
  overflow: hidden;

  &:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: ${({theme:{themeName:e}})=>a.Ay[`desktop-color-ublue-06-${e}`]};
    opacity: 0.1;
    border-radius: 8px;
  }
`,c=()=>(0,l.jsx)(t,{children:(0,l.jsx)(s.A,{size:"small",color:"ublue-06",children:(0,l.jsx)(d.sA,{id:"COMMON_MLO"})})})},753104(e,n,i){i.d(n,{A:()=>A});var l=i(274934),a=i(938984),s=i(184580),o=i(247816),r=i(120197),d=i(100978),t=i(331472),c=i(309130),_=i(470070),h=i(927316),u=i(293668),m=i(609664);const p=(0,o.A)("li")`
  padding: ${c.kc} ${c.YC};
  display: flex;
  align-items: flex-start;
  gap: ${c.YC};
`,I=({className:e,id:n,isSelected:i,onClick:o,option:{label:r,value:I,radioLinks:A=[],mloMeshSupported:E=!1}})=>(0,l.jsxs)(p,{id:n,onClick:o,className:e,"aria-selected":i,role:"option",children:[(0,l.jsx)(d.A,{flexDirection:"column",minWidth:c.Er,justifyContent:"flex-start",children:i?(0,l.jsx)(s.A,{size:"original"}):null}),(0,l.jsxs)(d.A,{flexDirection:"column",width:"100%",children:[(0,l.jsxs)(d.A,{flexDirection:"row",maxWidth:150,children:[(0,l.jsx)(a.A,{variant:"body-primary",isTruncated:!0,children:r}),E&&A.length>1?(0,l.jsx)(d.A,{position:"relative",marginLeft:c.YC,children:(0,l.jsx)(m.A,{})}):null]}),(0,l.jsx)(d.A,{flexDirection:"row",children:(0,l.jsx)(a.A,{variant:"caption",children:I})})]}),(0,l.jsx)(d.A,{flexDirection:"column",alignItems:"flex-end",children:A.sort((e,n)=>(0,h.xd)(e.radio,n.radio)).map(({radio:e,signal:n,channel:i},s)=>(0,l.jsxs)(d.A,{flexDirection:"row",gap:c.YC,alignItems:"center",children:[(0,l.jsx)(d.A,{flexDirection:"column",whiteSpace:"nowrap",children:void 0!==i?(0,l.jsxs)(a.A,{variant:"caption",children:[(0,l.jsx)(_.sA,{id:"COMMON_CHANNEL_RADIO_CHANNEL",values:{channel:i}})," (",(0,l.jsx)(_.sA,{id:(0,u.dI)(e)}),")"]}):null}),(0,l.jsx)(d.A,{flexDirection:"column",whiteSpace:"nowrap",children:void 0!==n?(0,l.jsxs)(a.A,{variant:"caption",color:(0,t.b5)(n),children:[n," ",(0,l.jsx)(_.sA,{id:"COMMON_UNIT_DBM"})]}):null})]},`${e}-${s}`))})]}),A=({options:e,value:n,onChange:i,...a})=>(0,l.jsx)(r.A,{full:!0,translateLabel:!0,name:"parentMac",type:"dropdown",variant:"secondary",options:e,value:n,onChange:i,searchable:!0,placeholder:"COMMON_PLACEHOLDER_SELECT_DEVICE",translatePlaceholder:!0,validated:!0,renderOption:I,...a})},331891(e,n,i){i.d(n,{A:()=>B});var l=i(274934),a=i(977872),s=i(602086),o=i(900302),r=i(586566),d=i(345272),t=i(449339),c=i(309130),_=i(589650),h=i(843871),u=i(721398),m=i(420610),p=i(787481),I=i(120197),A=i(793442),E=i(100978),O=i(470070),x=i(857780),M=i(726831);const N=({is6GhzSupported:e})=>{const{setFieldValue:n}=(0,h.j7)();return(0,l.jsx)(E.A,{marginBottom:c.Ln,alignItems:"center",children:(0,l.jsx)(p.A,{gap:c.kc,children:[x.Dd.INDOOR,x.Dd.OUTDOOR].map(i=>(0,l.jsx)(I.A,{name:"outdoor_install_mode",type:"radio",value:i,onChange:()=>(e=>{switch(n("outdoor_install_mode",e),e){case x.Dd.OUTDOOR:n("outdoor_mode_override",x.Gi.ON);break;case x.Dd.INDOOR:n("outdoor_mode_override",x.Gi.OFF)}})(i),children:(0,l.jsxs)(E.A,{alignItems:"center",gap:c.YC,children:[(0,l.jsx)(O.sA,{id:m.J[i]}),i===x.Dd.OUTDOOR?(0,l.jsx)(u.A,{messageId:e?"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR_6GHZ_TOOLTIP":"DEVICE_ENABLE_AFC_MODAL_INSTALL_MODE_OUTDOOR_TOOLTIP",values:{link:(0,l.jsx)(A.A,{id:"COMMON_LEARN_MORE",href:M.A.afcArticle})},variant:"outline",isInteractive:!0,portal:!0}):null]})},i))})})};var g=i(258893),L=i(205521),C=i(669641),D=i(561614),j=i(291935),b=i(598990),k=i(956978),v=i(754924),R=i(787677),P=i(643319),T=i(829540),f=i(728064),S=i(350626),w=i(570801),y=i(927316);const U=({device:e,radios:n})=>{const{formatMessage:i}=(0,O.tz)(),s=(0,a.d4)(w.EH),{values:{radios:o},setFieldValue:r}=(0,h.j7)(),[d]=n,t=(0,y.A4)(e,s);return(0,y.Ox)(e,d.name,t,i).length<=1?null:(0,l.jsx)(S.A,{name:"radios.0.antenna_id",configuredAntennaId:o[0].antenna_id,onChangeRadioAntenna:i=>{const l=(0,y.Sb)(e.antenna_table||[],i);n.forEach((n,a)=>{const s=n.name;(void 0!==(l?.[`${s}_gain`]??void 0)||(0,y.kb)(e,i))&&(r(`radios.${a}.antenna_id`,i),r(`radios.${a}.antenna_gain`,(0,y.pK)(l,s)))})},radio:d,device:e})},B=({activeItem:e,sortedRadios:n,hideMeshing:i})=>{const h=(0,a.wA)(),u=(0,a.d4)(j.Zc),m=(0,a.d4)(v.ID),p=(0,a.d4)(j.ZZ),I=(0,k.KKO)(e.model,"outdoorModeSupport"),A=(0,r.X5)(e,p),E=(0,s.useMemo)(()=>n.map(({radio:e})=>n.some(({radio:e})=>e===D.sx.RADIO_6E)?e===d.A[D.sx.RADIO_6E.toUpperCase()].type:e===d.A.NA.type).lastIndexOf(!0),[n]),O=(0,k.zg4)(e)?D.sx.RADIO_NG:D.sx.RADIO_NA,x=n.findIndex(e=>e.radio===O),M=n.filter(({radio:e})=>e&&e===D.sx.RADIO_6E).length;return(0,s.useEffect)(()=>{h((0,b.Uc)())},[h]),(0,l.jsxs)(l.Fragment,{children:[I?(0,l.jsx)(N,{is6GhzSupported:M>0}):null,!e.multi_active_antennas||(0,k.ERA)(e)?(0,l.jsx)(U,{device:e,radios:n}):null,(0,k.r$V)(e)?(0,l.jsx)(f.A,{radioIdx:x,deviceRadio:{device:e,radio:n[x]}}):n.map((i,a)=>{const r=a===n.length-1;return(0,l.jsxs)(s.Fragment,{children:[i.radio!==D.sx.RADIO_6E||e.support_wifi6e||A?(0,l.jsx)(T.qk,{device:e,radio:i,isLastNa:a===E,radio6gCount:M,mode:T.Hm.DEVICE_AND_RADIO,onSelectMeshingParents:()=>{const n=(0,C.T)(e,m);n?.device&&h((0,L.XP)({type:t.H.DEVICE,id:n.device.mac,tab:_.BC.SETTINGS}))}}):(0,l.jsx)(R.A,{radioType:i.radio}),r?null:(0,l.jsx)(o.A,{style:{margin:`${c.Ln} 0`}})]},`${i.radio}-${i.name}`)}),(!i&&u||A&&M>1)&&!(0,k.E4T)(e)?(0,l.jsx)(o.A,{style:{margin:`${c.Ln} 0`}}):null,A&&M>1&&!I?(0,l.jsx)(g.A,{isOutdoor:!0}):null,!i&&u?(0,l.jsx)(P.A,{device:e}):null]})}},643319(e,n,i){i.d(n,{A:()=>B});var l=i(274934),a=i(977872),s=i(602086),o=i(843871),r=i(117948),d=i(95032),t=i(247816),c=i(954702),_=i(449339),h=i(309130),u=i(120197),m=i(408402),p=i(205521),I=i(470070),A=i(412086),E=i(146215),O=i(947414),x=i(454928);const M=(0,t.A)("ul")`
  padding: 0;
  list-style-type: none;
  margin-block-start: ${h.kc};
  margin-block-end: 0;
  li {
    margin-bottom: ${h.YC};
    button {
      max-width: 180px;
    }
  }
`,N=(e,n,i,o)=>r=>{const t=(0,a.wA)(),h=(0,s.useCallback)(e=>()=>{t((0,p.XP)({type:_.H.DEVICE,id:e}))},[t]);return(0,l.jsx)(E.A,{title:(0,l.jsx)(I.sA,{id:"COMMON_WIFI_MESHING_DISABLED_CONFIRMATION_TITLE"}),message:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.A,{children:(0,l.jsx)(I.sA,{id:"COMMON_WIFI_MESHING_DISABLED_TOOLTIP"})}),(0,l.jsx)(d.A,{children:(0,l.jsx)(I.sA,{id:"COMMON_WIFI_MESHING_DISABLED_TOOLTIP_CONFIRMATION"})}),(0,l.jsxs)(M,{children:[o?(0,l.jsx)("li",{children:(0,l.jsx)(c.A,{onClick:h(o),children:(0,l.jsx)(d.A,{size:"inherit",color:"inherit",isTruncated:!0,children:(0,l.jsx)(A.A,{mac:o,props:["name"],children:({name:e=o})=>e})})})}):null,"string"!=typeof i?i.map(e=>(0,l.jsx)("li",{children:(0,l.jsx)(c.A,{onClick:h(e),children:(0,l.jsx)(d.A,{size:"inherit",color:"inherit",isTruncated:!0,children:(0,l.jsx)(A.A,{mac:e,props:["name"],children:({name:n=e})=>n})})})},e)):null]})]}),onConfirm:()=>{n(!e)},confirmButtonLabel:"COMMON_WIFI_MESHING_DISABLED_CONFIRMATION_CONFIRM_ACTION",confirmButtonVariant:"destructive",trigger:(0,l.jsx)("span",{children:(0,s.cloneElement)(r,{onChange:O.P1})})})};var g;!function(e){e.MESHING="MESHING",e.DOWNLINKS="DOWNLINKS",e.UPLINKS="UPLINKS"}(g||(g={}));const L={[g.MESHING]:({meshingEnabled:e,downlinkMeshingMacs:n,meshingChildMac:i})=>e&&(n.length>0||!!i),[g.DOWNLINKS]:({downlinkMeshEnabled:e,downlinkMeshingMacs:n})=>e&&n.length>0,[g.UPLINKS]:({uplinkMeshEnabled:e,meshingChildMac:n})=>n&&e},C=({warningType:e,children:n,downlinkMeshingMacs:i,meshingChildMac:a,meshingEnabled:s,downlinkMeshEnabled:o,uplinkMeshEnabled:r,onChange:d,checked:t,...c})=>{const _=L[e]({meshingEnabled:s,uplinkMeshEnabled:r,downlinkMeshEnabled:o,downlinkMeshingMacs:i,meshingChildMac:a});return(0,l.jsx)(m.A,{condition:!c.disabled&&_,wrapper:N(t,d,i,a),children:(0,l.jsx)(u.A,{checked:t,...c,type:"realCheckbox",disabled:c.disabled,onChange:({target:{checked:e}})=>{d(e)},children:_?(0,l.jsx)(x.A,{children:n}):n})})};var D=i(100978),j=i(926699),b=i(716342),k=i(291935),v=i(956978),R=i(857780),P=i(754924),T=i(347625),f=i(360664),S=i(586566),w=i(753104);const y=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:i=!1,hideWirelessUplink:d=!1,hideUplinkPriority:t=!1})=>{const{formatMessage:c}=(0,I.tz)(),_=(0,a.wA)(),{values:u,setFieldValue:m}=(0,o.j7)(),{wireless_uplink_mac:p="",wireless_downlink_macs:A=[]}=(0,a.d4)((0,s.useMemo)(()=>(0,j.pB)(e.mac),[e.mac]))||{},E=(0,a.d4)((0,s.useMemo)(()=>(0,j.mZ)(e.mac),[e.mac])),O=(0,a.d4)(k.Zc),x=(0,a.d4)(k.XA),M=(0,a.d4)((0,s.useMemo)(()=>(0,P.sL)((e.uplink_table||[]).filter(({mac:n})=>n!==e.mac),{excludeDeviceType:R.bq.UDB}),[e.mac,e.uplink_table])),N=(0,s.useMemo)(()=>{const e=M.map(e=>({label:(0,T.Q)(e),value:e.mac,radioLinks:"radioLinks"in e?e.radioLinks:void 0,mloMeshSupported:"mlo_mesh_supported"in e&&e.mlo_mesh_supported&&x?.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"])},[x?.mlo_mesh_enabled,M]),{parentOptions1:L,parentOptions2:B}=(0,s.useMemo)(()=>((e,n,i,l)=>({parentOptions1:[y(e),...n.filter(e=>!e.value||e.value!==l)],parentOptions2:[y(e),...n.filter(e=>!e.value||e.value!==i)]}))(c,N,u.uplinkPriority1,u.uplinkPriority2),[N,u.uplinkPriority1,u.uplinkPriority2,c]),K=(0,s.useCallback)((e,n)=>{let i=u.uplinkPriority1,l=u.uplinkPriority2;e===U.UPLINK_PRIORITY_1&&!n&&l?(i=l,l="",m(U.UPLINK_PRIORITY_1,i),m(U.UPLINK_PRIORITY_2,l)):m(e,n)},[m,u.uplinkPriority1,u.uplinkPriority2]),V=(0,s.useMemo)(()=>(0,v.DAR)({model:e.model}),[e.model]),F=(0,s.useMemo)(()=>(0,S._8)({model:e.model,wifi_caps2:e.wifi_caps2}),[e.model,e.wifi_caps2]),H=(0,s.useMemo)(()=>(0,v.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]),$=u.radios.some(e=>e.vwire_enabled??!0);return(0,s.useEffect)(()=>{_((0,b.d)(e.mac))},[e.mac,_]),O?(0,l.jsxs)(D.A,{flexDirection:"column",gap:h.Ln,children:[(0,v.r$V)(e)||i&&(!H||d||F)?null:(0,l.jsxs)(D.A,{flexDirection:"row",gap:h.Ln,children:[i?null:(0,l.jsx)(D.A,{flexDirection:"column",alignItems:"inherit",children:(0,l.jsx)(C,{label:"COMMON_MESH_PARENT",name:"vwireEnabled",type:"realCheckbox",checked:$,disabled:!E||n,onChange:e=>{var n;m("radios",(n=e,u.radios.map(e=>({...e,vwire_enabled:n}))))},tooltipMessage:(0,l.jsx)(I.sA,{id:"DEVICE_PROPERTIES_LABEL_TOOLTIP_WIRELESS_DOWNLINK"}),warningType:g.DOWNLINKS,meshingEnabled:Boolean(u.meshingEnabled),downlinkMeshEnabled:$,uplinkMeshEnabled:Boolean(u.uplinkMeshEnabled),downlinkMeshingMacs:A,children:(0,l.jsx)(I.sA,{id:"COMMON_MESH_PARENT"})})}),!H||d||F?null:(0,l.jsx)(D.A,{flexDirection:"column",alignItems:"inherit",children:(0,l.jsx)(C,{label:"DEVICE_MESH_CONNECT",name:"uplinkMeshEnabled",type:"realCheckbox",checked:Boolean(u.uplinkMeshEnabled),disabled:!E||n,onChange:e=>{m("uplinkMeshEnabled",e)},tooltipMessage:(0,l.jsx)(I.sA,{id:V?"DEVICE_PROPERTIES_LABEL_TOOLTIP_WIRELESS_UPLINK_DEVICE":"DEVICE_PROPERTIES_LABEL_TOOLTIP_WIRELESS_UPLINK"}),warningType:g.UPLINKS,meshingEnabled:Boolean(u.meshingEnabled),uplinkMeshEnabled:Boolean(u.uplinkMeshEnabled),downlinkMeshingMacs:A,meshingChildMac:p?e.mac:void 0,children:(0,l.jsx)(I.sA,{id:"DEVICE_MESH_CONNECT"})})})]}),H&&u.uplinkMeshEnabled&&!t?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(D.A,{children:(0,l.jsx)(w.A,{label:"DEVICE_PROPERTIES_LABEL_PRIORITY_NUMBER",translateLabel:!0,translateLabelValues:{number:u.uplinkPriority1?1:null},name:U.UPLINK_PRIORITY_1,options:L,value:u.uplinkPriority1,onChange:({value:e})=>K(U.UPLINK_PRIORITY_1,e)})}),u.uplinkPriority1?(0,l.jsx)(D.A,{children:(0,l.jsx)(w.A,{label:"DEVICE_PROPERTIES_LABEL_PRIORITY_NUMBER",translateLabelValues:{number:2},name:U.UPLINK_PRIORITY_2,options:B,value:u.uplinkPriority2,onChange:({value:e})=>K(U.UPLINK_PRIORITY_2,e)})}):null]}):null]}):null}},360664(e,n,i){i.d(n,{GX:()=>l,Hv:()=>o,K:()=>a,TV:()=>r,f$:()=>d,rr:()=>s});const l=-30,a=-80,s=-65,o=184,r=238,d=10}}]);