"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[75962],{335521:(e,l,n)=>{n.d(l,{A:()=>r});var t=n(469733),a=n(296540),i=n(532419);const r=({mac:e,props:l,children:n})=>n((0,t.useSelector)((0,a.useMemo)(()=>(0,i.bw)(e,l),[e,l])))},875962:(e,l,n)=>{n.d(l,{A:()=>Z});var t=n(469733),a=n(296540),i=n(951272),r=n(705145),c=n(71479),o=n(592563),m=n(398300),s=n(566723),E=n(143811),d=n(955161),u=n(845030),_=n(699784),h=n(335521),I=n(147606),p=n(874807);const M=({children:e})=>a.createElement("span",{onClick:e=>{e.stopPropagation()},role:"button",tabIndex:0,onKeyDown:p.P1},e),A=(0,c.A)("ul")`
  padding: 0;
  list-style-type: none;
  margin-block-start: ${s.kc};
  margin-block-end: 0;
  li {
    margin-bottom: ${s.YC};
    button {
      max-width: 180px;
    }
  }
`,b=(e,l,n,i)=>c=>{const s=(0,t.useDispatch)(),E=(0,a.useCallback)(e=>()=>{s((0,u.XP)({type:m.H.DEVICE,id:e}))},[s]);return a.createElement(I.A,{title:a.createElement(_.sA,{id:"COMMON_WIFI_MESHING_DISABLED_CONFIRMATION_TITLE"}),message:a.createElement(a.Fragment,null,a.createElement(r.A,null,a.createElement(_.sA,{id:"COMMON_WIFI_MESHING_DISABLED_TOOLTIP"})),a.createElement(r.A,null,a.createElement(_.sA,{id:"COMMON_WIFI_MESHING_DISABLED_TOOLTIP_CONFIRMATION"})),a.createElement(A,null,i?a.createElement("li",null,a.createElement(o.A,{onClick:E(i)},a.createElement(r.A,{size:"inherit",color:"inherit",isTruncated:!0},a.createElement(h.A,{mac:i,props:["name"]},({name:e=i})=>e)))):null,"string"!=typeof n?n.map(e=>a.createElement("li",{key:e},a.createElement(o.A,{onClick:E(e)},a.createElement(r.A,{size:"inherit",color:"inherit",isTruncated:!0},a.createElement(h.A,{mac:e,props:["name"]},({name:l=e})=>l))))):null)),onConfirm:()=>{l(!e)},confirmButtonLabel:a.createElement(_.sA,{id:"COMMON_WIFI_MESHING_DISABLED_CONFIRMATION_CONFIRM_ACTION"}),confirmButtonVariant:"destructive",trigger:a.createElement("span",null,(0,a.cloneElement)(c,{onChange:p.P1}))})};var O;!function(e){e.MESHING="MESHING",e.DOWNLINKS="DOWNLINKS",e.UPLINKS="UPLINKS"}(O||(O={}));const C={[O.MESHING]:({meshingEnabled:e,downlinkMeshingMacs:l,meshingChildMac:n})=>e&&(l.length>0||!!n),[O.DOWNLINKS]:({downlinkMeshEnabled:e,downlinkMeshingMacs:l})=>e&&l.length>0,[O.UPLINKS]:({uplinkMeshEnabled:e,meshingChildMac:l})=>l&&e},P=({warningType:e,children:l,downlinkMeshingMacs:n,meshingChildMac:t,meshingEnabled:i,downlinkMeshEnabled:r,uplinkMeshEnabled:c,onChange:o,checked:m,...s})=>{const u=C[e]({meshingEnabled:i,uplinkMeshEnabled:c,downlinkMeshEnabled:r,downlinkMeshingMacs:n,meshingChildMac:t});return a.createElement(d.A,{condition:u,wrapper:b(m,o,n,t)},a.createElement(E.A,{checked:m,...s,type:"realCheckbox",disabled:s.disabled,onChange:({target:{checked:e}})=>{o(e)}},u?a.createElement(M,null,l):l))};var k=n(960407),g=n(860631),L=n(766624),N=n(927099),T=n(104739),R=n(963070),S=n(822336),y=n(396660),D=n(38937),v=n(6510),w=n(573531),f=n(989512);const U=(0,c.A)(T.v)`
  background: ${({theme:{motifPalette:{uBlue01:e}}})=>e};
  border-radius: ${S.Ay["desktop-radius-infinity"]};
  padding: 0 ${s.kc};
  height: ${s.Er};
`,B=({children:e})=>a.createElement(U,null,a.createElement(N.A,{size:"caption",color:"info"},e)),V=({items:e,parent:l})=>{const n=(0,t.useDispatch)(),i=(0,a.useCallback)(({mac:e})=>{n((0,u.XP)({type:m.H.DEVICE,id:e}))},[n]),r=(0,a.useMemo)(()=>[{id:"nameInfo",sortable:!0,compare:(0,y.l0)(e=>(0,v.Q)(e)),minWidth:40,label:a.createElement(_.sA,{id:"COMMON_NAME"}),renderCell:({mac:e,name:n,model:t})=>a.createElement(a.Fragment,null,a.createElement(f.A,{device:{model:t,name:n,mac:e}}),l&&e===l&&a.createElement(a.Fragment,null," ",a.createElement(B,null,a.createElement(_.sA,{id:"DEVICE_PARENT"}))))},{id:"channel",sortable:!0,compare:(0,y.l0)(({channel:e})=>e||w.L),minWidth:35,maxWidth:90,label:a.createElement(_.sA,{id:"COMMON_CHANNEL"}),renderCell:({channel:e})=>a.createElement(N.A,{color:"inherit",size:"body"},e)},{id:"signal",sortable:!0,compare:(0,y.l0)(({signal:e})=>e||0),minWidth:35,maxWidth:90,label:a.createElement(_.sA,{id:"COMMON_SIGNAL"}),renderCell:({signal:e})=>e?a.createElement(N.A,{size:"body",color:(0,D.b5)(e)},e," ",a.createElement(_.sA,{id:"COMMON_UNIT_DBM"})):a.createElement(_.sA,{id:"COMMON_FALLBACK"})}],[l]);return a.createElement(a.Fragment,null,a.createElement(R.A,{items:e,disableColumnFilters:!0,disableSelection:!0,disableTextPointer:!0,columns:r,idField:"mac",truncateHeaderCells:!0,onRowClick:i}),e.length?null:a.createElement(N.A,{style:{marginTop:s.Ln},size:"body"},a.createElement(_.sA,{id:"DEVICE_PROPERTIES_AP_UPLINKS_TABLE_EMPTY"})))};var K=n(889740),x=n(294303),H=n(728204),W=n(998146),F=n(302167),Y=n(780811),G=n(768195),z=n(532419),$=n(724090);const q=e=>({value:"",label:e({id:"COMMON_VALUE_AUTO"})});var Q;!function(e){e.UPLINK_PRIORITY_1="uplinkPriority1",e.UPLINK_PRIORITY_2="uplinkPriority2"}(Q||(Q={}));const X=({device:e,allowOnlyPrioritySelection:l=!1,disabled:n=!1,hideWirelessDownlink:r=!1,hideWirelessUplink:c=!1,hideUplinkPriority:o=!1})=>{const{formatMessage:m}=(0,_.tz)(),d=(0,t.useDispatch)(),{values:u,setFieldValue:h}=(0,i.j7)(),I=(0,t.useSelector)((0,a.useMemo)(()=>(0,k.G3)({excludeDeviceType:G.bq.UDB}),[])),{wireless_uplink_mac:p="",wireless_downlink_macs:M=[]}=(0,t.useSelector)((0,a.useMemo)(()=>(0,H.pB)(e.mac),[e.mac]))||{},A=(0,t.useSelector)((0,a.useMemo)(()=>(0,H.mZ)(e.mac),[e.mac])),b=(0,t.useSelector)(F.Zc),C=(0,t.useSelector)((0,a.useMemo)(()=>(0,z.sL)((e.uplink_table||[]).filter(({mac:l})=>l!==e.mac),{excludeDeviceType:G.bq.UDB}),[e.mac,e.uplink_table])),{priorityUplinkOptions1:N,priorityUplinkOptions2:T}=(0,a.useMemo)(()=>((e,l,n,t)=>({priorityUplinkOptions1:[q(e),...l.filter(e=>!e.value||e.value!==t)],priorityUplinkOptions2:[q(e),...l.filter(e=>!e.value||e.value!==n)]}))(m,I,u.uplinkPriority1,u.uplinkPriority2),[I,u.uplinkPriority1,u.uplinkPriority2,m]),R=(0,a.useCallback)((e,l)=>{let n=u.uplinkPriority1,t=u.uplinkPriority2;e===Q.UPLINK_PRIORITY_1&&!l&&t?(n=t,t="",h(Q.UPLINK_PRIORITY_1,n),h(Q.UPLINK_PRIORITY_2,t)):h(e,l)},[h,u.uplinkPriority1,u.uplinkPriority2]),S=(0,a.useMemo)(()=>(0,Y.DAR)({model:e.model}),[e.model]),y=(0,a.useMemo)(()=>(0,Y.G5G)({type:e.type,model:e.model,device_mode_override:e.device_mode_override})||S||n||l,[e.type,e.model,e.device_mode_override,n,l,S]),D=u.radios.some(e=>e.vwire_enabled??!0);const v=(0,g.dg)(e)&&(!r&&D||y&&!!u.uplinkMeshEnable);return(0,a.useEffect)(()=>{d((0,W.d)(e.mac))},[e.mac,d]),b?a.createElement(x.A,{flexDirection:"column",gap:s.Ln},(0,Y.r$V)(e)||r&&(!y||c)?null:a.createElement(x.A,{flexDirection:"row",gap:s.Ln},r?null:a.createElement(x.A,{flexDirection:"column",alignItems:"inherit"},a.createElement(P,{label:"COMMON_MESH_PARENT",name:"vwireEnabled",type:"realCheckbox",checked:D,disabled:!A||l||n,onChange:e=>{h("radios",((e,l)=>e.map(e=>({...e,vwire_enabled:l})))(u.radios,e))},tooltipMessage:a.createElement(_.sA,{id:"DEVICE_PROPERTIES_LABEL_TOOLTIP_WIRELESS_DOWNLINK"}),warningType:O.DOWNLINKS,meshingEnabled:Boolean(u.meshingEnabled),downlinkMeshEnabled:D,uplinkMeshEnabled:Boolean(u.uplinkMeshEnable),downlinkMeshingMacs:M},a.createElement(_.sA,{id:"COMMON_MESH_PARENT"}))),y&&!c?a.createElement(x.A,{flexDirection:"column",alignItems:"inherit"},a.createElement(P,{label:"DEVICE_MESH_CONNECT",name:"uplinkMeshEnable",type:"realCheckbox",checked:Boolean(u.uplinkMeshEnable),disabled:!A||l||n,onChange:e=>{h("uplinkMeshEnable",e)},tooltipMessage:a.createElement(_.sA,{id:S?"DEVICE_PROPERTIES_LABEL_TOOLTIP_WIRELESS_UPLINK_DEVICE":"DEVICE_PROPERTIES_LABEL_TOOLTIP_WIRELESS_UPLINK"}),warningType:O.UPLINKS,meshingEnabled:Boolean(u.meshingEnabled),uplinkMeshEnabled:Boolean(u.uplinkMeshEnable),downlinkMeshingMacs:M,meshingChildMac:p?e.mac:void 0},a.createElement(_.sA,{id:"DEVICE_MESH_CONNECT"}))):null),v?a.createElement(x.A,{flexDirection:"row"},a.createElement(E.A,{label:"DEVICE_MESH_MLO_STR",name:"mesh_mlo_enabled",type:"realCheckbox",checked:u.mesh_mlo_enabled,disabled:!A||n,onChange:({target:{checked:e}})=>{h("mesh_mlo_enabled",e)}},a.createElement(x.A,{flexDirection:"row",alignItems:"center",gap:s.YC},a.createElement(_.sA,{id:"DEVICE_MESH_MLO_STR"}),a.createElement($.A,{name:"mesh_mlo_enabled",info:a.createElement(L.A,{description:a.createElement(_.sA,{id:"DEVICE_PROPERTIES_LABEL_TOOLTIP_WIRELESS_DEVICE_MESH_MLO_STR"}),portal:!0,isInteractive:!0,iconProps:{isActive:!0,size:"original"}})}),a.createElement(K.A,null)))):null,y&&u.uplinkMeshEnable&&!o?a.createElement(a.Fragment,null,a.createElement(x.A,null,a.createElement(E.A,{full:!0,label:"DEVICE_PROPERTIES_LABEL_PRIORITY_NUMBER",translateLabel:!0,translateLabelValues:{number:u.uplinkPriority1?1:null},name:Q.UPLINK_PRIORITY_1,type:"dropdown",variant:"secondary",options:N,searchable:!0,onChange:({value:e})=>R(Q.UPLINK_PRIORITY_1,e),placeholder:"COMMON_PLACEHOLDER_SELECT_DEVICE",translatePlaceholder:!0})),u.uplinkPriority1?a.createElement(x.A,null,a.createElement(E.A,{full:!0,label:"DEVICE_PROPERTIES_LABEL_PRIORITY_NUMBER",translateLabel:!0,translateLabelValues:{number:2},name:Q.UPLINK_PRIORITY_2,type:"dropdown",variant:"secondary",options:T,searchable:!0,onChange:({value:e})=>R(Q.UPLINK_PRIORITY_2,e),placeholder:"COMMON_PLACEHOLDER_SELECT_DEVICE",translatePlaceholder:!0})):null,C.length>0?a.createElement(x.A,{flexDirection:"column"},a.createElement(V,{items:C})):null):null):null},Z=({device:e,...l})=>(0,a.useMemo)(()=>(0,Y.moU)({type:e.type,model:e.model,device_mode_override:e.device_mode_override})&&(0,Y.YdF)({type:e.type}),[e.type,e.model,e.device_mode_override])?null:a.createElement(X,{device:e,...l})},989512:(e,l,n)=>{n.d(l,{A:()=>E});var t=n(296540),a=n(705145),i=n(71479),r=n(6510);const c=(0,i.A)("span")`
  white-space: nowrap;
`;var o=n(294303),m=n(6176);const s=(0,i.A)(m.A)`
  float: left;
`,E=({defaultName:e="",device:{model:l,name:n,mac:i}={},width:m=25,height:E=25,leftOffset:d=0})=>t.createElement(o.A,{alignItems:"center",marginLeft:d,width:"100%"},t.createElement(o.A,{marginRight:8,flex:`0 0 ${m}px`,width:m,height:E},t.createElement(s,{model:l,width:m,height:E})),t.createElement(a.A,{isTruncated:!0,size:"medium",color:"text-2"},t.createElement(c,null,(0,r.Q)({model:l,name:n,mac:i})||e)))}}]);