(window.webpackJsonpunifiNetworkUi=window.webpackJsonpunifiNetworkUi||[]).push([[18],{2821:function(e,t,a){"use strict";var l=a(0),n=a.n(l),r=a(3),i=a(1671),c=a(5),o=a(34);const s=Object(r.c)(c.a)`
  border-bottom: 1px ${({theme:e})=>e.colors.border} solid;
  box-sizing: border-box;

  @media ${o.a.VIEWPORT_M_UP} {
    padding: 0 ${({theme:e})=>e.space[4]}px;
  }
`,d=Object(r.c)(i.a)`
  bottom: -1px;
`;t.a=({isLoading:e,children:t,...a})=>n.a.createElement(s,Object.assign({},a,{flex:"none",className:"base-control-panel",position:"relative",alignItems:"center",justifyContent:"space-between",height:50}),t,n.a.createElement(d,{isLoading:e,placement:"bottom"}))},2822:function(e,t,a){"use strict";var l=a(0),n=a.n(l),r=a(3),i=a(5),c=a(1),o=a(47),s=a(481),d=a(2821),m=a(2823),_=a(2832),E=a(31),u=a(179);const b=Object(r.c)(o.a,{shouldForwardProp:e=>"addMargin"!==e})`
  font-size: 14px;
  ${({addMargin:e})=>e&&"margin-left: 50%;"}
  position: absolute;
  transform: translateX(-50%);
  left: 50%;
`;t.a=({routes:e=[],hideFilterButton:t=!1,isLoading:a,children:l,filterTitleLabel:r,filtersActive:o,title:O,leftContent:p,isDisplayOptionsDisabled:g})=>{const I=(null==e?void 0:e.length)>1,h=!I&&1===e.length;return n.a.createElement(d.a,{isLoading:a},p&&p,I&&n.a.createElement(m.a,{routes:e}),h&&n.a.createElement(b,{weight:"bold"},e[0].label),O&&n.a.createElement(b,{weight:"bold",addMargin:t&&!p},n.a.createElement(c.b,{id:O})),n.a.createElement(i.a,{height:"100%",flex:I||O||h?"none":1,alignItems:"center",justifyContent:"flex-end",marginLeft:"auto"},l,!t&&n.a.createElement(u.a,{condition:g,wrapper:e=>n.a.createElement(s.a,{position:"bottom",width:"208px",portal:!0,message:n.a.createElement(E.p,null,n.a.createElement(c.b,{id:"COMMON_DISPLAY_OPTS_DISABLED"}))},e)},n.a.createElement(_.a,{disabled:g,filterTitleLabel:r,filtersActive:o}))))}},2823:function(e,t,a){"use strict";var l=a(0),n=a.n(l),r=a(3),i=a(25),c=a(807);var o=({items:e,...t})=>{const{params:a,path:l}=Object(i.n)(),r=Object(i.l)(),o=Object(i.k)(),s=e.find(({path:e})=>e===l)||((e,{pathname:t})=>e.find(({path:e})=>new RegExp(e.replace(/\/:\w+\?.*/g,"/?.*").replace(/:\w+/g,"\\w+").replace(/\//g,"\\$&")).test(t)))(e,r);return n.a.createElement(c.a,Object.assign({tabs:e,selectedTab:null==s?void 0:s.id,onSelectTab:({path:e,params:t={}})=>o.push(Object(i.i)(e,{...a,...t}))},t))};const s=Object(r.c)(o)`
  height: 100%;
  position: absolute;
  left: 0;
  right: 0;
  div,
  button {
    height: 100% !important;
  }
`;t.a=({routes:e})=>{const t=Object(l.useMemo)(()=>e&&e.map(({id:e,label:t,disabled:a,path:l,...n})=>({id:e,label:t,disabled:"function"==typeof a?a(n):a,path:l})),[e]);return t?n.a.createElement(s,{selectedTabBold:!0,items:t}):null}},2824:function(e,t,a){"use strict";a.d(t,"b",(function(){return l.a})),a.d(t,"a",(function(){return i})),a.d(t,"d",(function(){return c})),a.d(t,"e",(function(){return _})),a.d(t,"c",(function(){return E.a}));a(2821);var l=a(2828),n=a(3),r=a(173);var i=Object(n.c)(r.a)`
  padding-left: ${({theme:e})=>e.space[3]}px;
  padding-right: ${({theme:e})=>e.space[3]}px;
  color: ${({theme:e})=>e.colors.subtlerText};
  &:hover {
    color: ${({theme:e})=>e.colors.mediumText};
  }
`;var c=Object(n.c)("span")`
  border-right: 1px ${({theme:e})=>e.colors.border} solid;
  margin: 0 ${({theme:e})=>e.space[4]}px;
  position: relative;
  height: 100%;
  display: block;
`,o=a(0),s=a.n(o),d=a(807);const m=n.a`
  align-items: center;
  display: flex;
  height: 100%;
  width: auto;
  justify-content: flex-end;
  overflow-x: unset;

  > div {
    margin: initial;
  }
`;function _(e){return s.a.createElement(d.a,Object.assign({className:m},e))}a(2823),a(2822);var E=a(2826)},2826:function(e,t,a){"use strict";var l=a(0),n=a.n(l),r=a(3),i=a(1),c=a(47),o=a(2600);const s=Object(r.c)(c.a)`
  line-height: 24px;
  color: ${({theme:e})=>e.motifPalette.text01};
`,d=Object(r.c)("div",{shouldForwardProp:e=>"toggleStyle"!==e})`
  justify-content: space-between;
  margin-top: ${({toggleStyle:e})=>{var t;return null!==(t=null==e?void 0:e.marginTop)&&void 0!==t?t:8}}px;
  margin-right: ${({toggleStyle:e})=>{var t;return null!==(t=null==e?void 0:e.marginRight)&&void 0!==t?t:0}}px;
  margin-bottom: ${({toggleStyle:e})=>{var t;return null!==(t=null==e?void 0:e.marginBottom)&&void 0!==t?t:0}}px;
  margin-left: ${({toggleStyle:e})=>{var t;return null!==(t=null==e?void 0:e.marginLeft)&&void 0!==t?t:0}}px;
  width: auto !important;

  label {
    margin-left: 0;
  }
`;t.a=({checked:e,disabled:t,id:a,onChange:l,text:r,toggleStyle:c})=>n.a.createElement(d,{toggleStyle:c},n.a.createElement(o.a,{checked:e,id:a,onChange:l,disabled:t},"string"==typeof r?n.a.createElement(s,{size:"body"},n.a.createElement(i.b,{id:r})):r))},2828:function(e,t,a){"use strict";var l=a(0),n=a.n(l),r=a(1),i=a(4),c=a(20);const o=e=>{var t;return null===(t=null==e?void 0:e.filters)||void 0===t?void 0:t.isFilterOpen};var s=a(1192),d=a(3),m=a(2769),_=a(3116),E=a(3108),u=a(464),b=a(3059);const O=Object(d.c)(b.a)`
  padding: 24px;
`;var p=({columns:e,columnLabels:t,tableType:a,hidden:o=[]})=>{var s;const d=Object(i.useDispatch)(),m=(null===(s=Object(i.useSelector)(Object(c.B)(a)))||void 0===s?void 0:s.initialColumns)||[],_=Object(l.useMemo)(()=>Object.values(e).every(e=>m.includes(e)),[m]),E=Object(l.useCallback)(()=>{const t=_||(null==m?void 0:m.length)?[]:Object.values(e);d(Object(c.L)(a,{initialColumns:t},!0))},[d,_,a,m]),u=Object(l.useMemo)(()=>[{full:!0,id:"showAllFields",checked:_||!!(null==m?void 0:m.length)&&"mixed",children:n.a.createElement(r.b,{id:"COMMON_ALL"}),onChange:E}].concat(Object.values(e).filter(e=>!o.includes(e)).map(e=>({full:!0,id:e,checked:m.includes(e),children:(null==t?void 0:t[e])?n.a.createElement(r.a,{id:t[e]}):e,onChange:({target:{checked:t}})=>{const l=t?[...m,e]:m.filter(t=>t!==e);d(Object(c.L)(a,{initialColumns:l},!0))}}))),[m,a]);return n.a.createElement(O,{spacing:"flush",items:u,variant:"list"})};const g=Object(d.c)(m.a)`
  width: 258px !important;
`;var I;!function(e){e.COLUMNS="columns",e.FILTERS="filters"}(I||(I={}));var h=({filterTitleLabel:e,isOpen:t,onClose:a,columnTabProps:o,renderFilterDrawerContent:s,footerProps:d,side:m="left"})=>{var b;const[O,h]=Object(l.useState)(I.FILTERS),{tableType:C}=o||{tableType:null},v=Object(i.useDispatch)(),f=(null===(b=Object(i.useSelector)(Object(c.B)(C)))||void 0===b?void 0:b.initialColumns)||[],T=d&&O===I.COLUMNS,S=Object(l.useMemo)(()=>{var e,t;return T&&Object(u.a)(null===(t=null===(e=null===c.c||void 0===c.c?void 0:c.c.tables)||void 0===e?void 0:e[C])||void 0===t?void 0:t.initialColumns,f)},[T,C,f]),D=Object(l.useCallback)(()=>{var e,t,a;const l=[...null!==(a=null===(t=null===(e=null===c.c||void 0===c.c?void 0:c.c.tables)||void 0===e?void 0:e[C])||void 0===t?void 0:t.initialColumns)&&void 0!==a?a:[]];v(Object(c.L)(C,{initialColumns:l},!0))},[v,C]),j=Object(l.useCallback)(({id:e})=>h(e),[h]),P=o?n.a.createElement(_.a,{onSelectTab:j,tabs:[{id:I.FILTERS,label:n.a.createElement(r.b,{id:"COMMON_CONTROL_PANEL_FILTERS"}),render:s},{id:I.COLUMNS,label:n.a.createElement(r.b,{id:"COMMON_CONTROL_PANEL_COLUMNS"}),render:()=>n.a.createElement(p,{columns:o.columns,hidden:o.hidden,columnLabels:o.columnLabels,tableType:C})}]}):s(),R=Object(l.useMemo)(()=>T?{label:n.a.createElement(r.b,{id:"COMMON_CONTROL_PANEL_FILTER_FOOTER_RESTORE_COLUMNS"}),onClick:D,disabled:S}:d,[T,d,S,D]),N=Object(l.useCallback)(()=>{a(),h(I.FILTERS)},[a,h]);return n.a.createElement(g,{in:t,renderHeader:()=>null,onClose:a,side:m},t&&n.a.createElement(E.a,{footerProps:R,headerProps:{label:e},onClose:N},P))},C=a(2822);t.a=Object(r.e)(({routes:e=[],hideFilterButton:t=!1,isLoading:a,children:r,filterFooterProps:d,columnTabProps:m,renderFilterDrawerContent:_,filterTitleLabel:E,filtersActive:u,title:b,onClose:O,intl:p,leftContent:g,isDisplayOptionsDisabled:I})=>{var v;const f=Object(i.useDispatch)(),T=Object(i.useSelector)(o),S=(null===(v=Object(i.useSelector)(Object(c.B)(null==m?void 0:m.tableType)))||void 0===v?void 0:v.initialColumns)||[],D=p.formatMessage({id:E||"COMMON_CONTROL_PANEL_FILTER_TITLE"});Object(l.useEffect)(()=>()=>{f(Object(s.b)(!1))},[]);const j=Object(l.useCallback)(()=>{f(Object(s.b)(!1)),null==O||O(),(null==m?void 0:m.tableType)&&f(Object(c.L)(m.tableType,{initialColumns:S}))},[f,O,null==m?void 0:m.tableType,S]);return n.a.createElement(n.a.Fragment,null,n.a.createElement(h,{isOpen:T,filterTitleLabel:D,onClose:j,columnTabProps:m,renderFilterDrawerContent:()=>T&&_,footerProps:d,side:"right"}),n.a.createElement(C.a,{leftContent:g,routes:e,hideFilterButton:t,isLoading:a,filterTitleLabel:D,filtersActive:u,title:b,isDisplayOptionsDisabled:I},r))})},2832:function(e,t,a){"use strict";var l=a(0),n=a.n(l),r=a(3),i=a(4),c=a(3117),o=a(34),s=a(5),d=a(1192);const m=Object(r.c)(c.a,{shouldForwardProp:e=>"disabled"!==e})`
  pointer-events: ${({disabled:e})=>e?"none":"auto"};
  opacity: ${({disabled:e})=>e?.45:1};
  cursor: ${({disabled:e})=>e?"default":"pointer"};
  padding: 0 8px 0 0;
  z-index: 5;

  // Hides the text element on smaller screens
  button div > span {
    display: none;
  }

  button svg {
    margin-right: 0;
  }

  button {
    padding: 0 8px;
  }

  @media ${o.a.VIEWPORT_M_UP} {
    button {
      padding: 0 16px;
    }

    button svg {
      margin-right: 4px;
    }

    button div > span {
      display: inline-block;
    }
  }
`;t.a=({filterTitleLabel:e,filtersActive:t,items:a,disabled:l})=>{const r=Object(i.useDispatch)();return n.a.createElement(s.a,{height:"100%"},n.a.createElement(m,{disabled:l,title:e,onClick:()=>!l&&r(Object(d.b)(!0)),filtersActive:t}),a)}},2833:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));const l=(e,t)=>{const a=Object.keys(e||{}),l=Object.keys(t||{});return a.length===l.length&&l.every(a=>e[a]&&e[a].length===t[a].length&&t[a].every(t=>e[a].includes(t)))}},2839:function(e,t,a){"use strict";var l=a(3104),n=a(3);const r=Object(n.c)(l.a)`
  li > div:nth-child(2) > div > div {
    padding: 0 0 10px;
    label > div:last-child > div:first-child > span {
      display: block;
      max-width: 85%;
    }
  }
`;t.a=r},2840:function(e,t,a){"use strict";a.d(t,"a",(function(){return r})),a.d(t,"b",(function(){return i}));const l=/[\p{Z}\p{S}\p{C}]+/u,n=/[\u0300-\u036f]/g;const r=e=>{let t=""+e;return t=function(e){let t=e;return e.normalize&&(t=e.normalize("NFD").replace(n,"")),t}(t).toLowerCase(),t.split(l)},i=(e,t)=>{const a=t.length;for(let l=0;l<a;l+=1){const[a,n]=t[l];if(e.some(e=>e[a]===n))return{id:`${a}::${n}`,label:n}}}},2841:function(e,t,a){"use strict";var l=a(0),n=a.n(l),r=a(3);const i=Object(r.c)("div")`
  width: 100%;
  table:after {
    content: '';
    display: block;
    position: absolute;
    right: -32px;
    width: 32px;
    height: 1px;
  }
`;t.a=({children:e})=>n.a.createElement(i,null,e)},2843:function(e,t,a){"use strict";var l=a(0),n=a.n(l),r=a(3071),i=a(3072),c=a(3094),o=a(3),s=a(4),d=a(1),m=a(2607),_=a(1199),E=a(190),u=a(142),b=a(62),O=a(34),p=a(757),g=a(751);const I=Object(o.c)("div")`
  // Raise above tabs in wifi scanner and wifi speed-test
  z-index: 1;
  margin-left: 16px;
  max-width: 280px;
  width: 100%;
  @media ${O.a.VIEWPORT_M_UP} {
    max-width: 320px;
  }

  @media ${O.a.VIEWPORT_L_UP} {
    max-width: 420px;
  }
`,h=()=>n.a.createElement(m.a,null,n.a.createElement("style",null,"\n        .multi-search-fix {\n          z-index: 25;\n        }\n    ")),C=Object(o.c)(r.a)`
  &[aria-selected='true'] {
    background: ${({theme:e})=>e.motifPalette.neutral02};
  }
`,v=Object(o.c)(i.a)`
  &[aria-selected='true'] {
    background: ${({theme:e})=>e.motifPalette.neutral02};
  }
`,f=e=>{const t=new Set,a=e.length;for(let l=0;l<a;l+=1){const{result:a}=e[l];a.forEach(e=>{const a=e.id||e;t.add(a)})}return t};function T(e,t){return{index:e.map(({field:e})=>e),query:t,enrich:!0}}t.a=Object(d.e)(({intl:e,lsKey:t,getInitialSuggestions:a,searchModelName:r,searchIndex:i,enabledColumns:o,records:d,recordIdKey:m})=>{var O;const S=Object(s.useDispatch)(),D=Object(s.useSelector)(b.f),j=Object(s.useSelector)(b.e),P=Object(s.useSelector)(b.b),R=Object(l.useMemo)(()=>Object(u.e)(D,j,P),[P,j,D]),N=`${E.a.PERSIST}:${E.a.NETWORK}.${R||E.a.LOCAL}.${t}`,M=null===(O=null===window||void 0===window?void 0:window.localStorage)||void 0===O?void 0:O.getItem(N),A=Object(s.useSelector)(Object(g.b)(r)),[L,F]=Object(l.useState)(()=>M?JSON.parse(M):a()),[w,x]=Object(l.useState)({value:"",searchResults:[]}),y=Object(l.useRef)(new Set(d.map(e=>e[m]))),V=e=>{const{id:t,tag:a}=e,l=L.filter(e=>e.id!==t),n=[{id:t,label:a},...l].slice(0,6);F(n),E.b.setItem(N,JSON.stringify(n))};Object(l.useEffect)(()=>{d.forEach(e=>{i.add(e)});const e=new Set(d.map(e=>e[m]));y.current.forEach(t=>!e.has(t)&&i.remove(t)),y.current=e},[m,d,i]);Object(l.useEffect)(()=>{A.length&&A.forEach(e=>{const{fsQuery:t,result:a}=e,l=i.search(t),n=f(l);Object(_.a)(a,n)||S(Object(p.h)({...e,result:n,label:""+t.query,modelName:r}))})},[S,d]);const U=L.map(({id:e,label:t})=>({id:e,label:n.a.createElement(v,{label:t,onRemove:t=>{t.stopPropagation(),(e=>{const t=L.filter(t=>t.id!==e);F(t),E.b.setItem(N,JSON.stringify(t))})(e)}})}));return n.a.createElement(I,null,n.a.createElement(h,null),n.a.createElement(c.a,{dropdownPortalClassName:"multi-search-fix",selectOnEnter:!0,onAddTag:e=>{var t;const a=null===(t=w.searchResults)||void 0===t?void 0:t.find(({id:t})=>t===e);if(w.searchResults.length>0&&a&&(S(Object(p.e)({modelName:r,id:a.id,fsQuery:a.fsQuery,result:a.result,label:a.tag})),V(a),x(e=>({...e,searchResults:[]}))),0===w.searchResults.length&&e){const[t,a]=e.split("::"),l=i.search({query:a,index:"all"===t?o:[t]});S(Object(p.e)({modelName:r,id:e,fsQuery:T(l,a),result:f(l),label:a})),V({id:e,tag:a})}},onChange:(e,t)=>{const a=i.search(t,d.length||100,{index:o,enrich:!0}),l=f(a),c=A.map(({result:e})=>e),s=c.concat(l),E=Object(_.b)(...s),u=[{id:"all::"+t,label:n.a.createElement(C,{label:n.a.createElement(n.a.Fragment,null,t),count:E.size}),fsQuery:T(a,t),tag:""+t,result:l,modelName:r}],b=((e,t,a)=>{const l={},n=e.length;for(let r=0;r<n;r+=1){const{field:n,result:i}=e[r];l[n]=new Set;const c=i.length;for(let e=0;e<c;e+=1)t.has(i[e].doc[a])&&l[n].add(i[e].doc[n])}return l})(a,E,m),O=[];Object.keys(b).forEach(e=>{b[e].forEach(t=>{const a={query:t,index:[e]},l=i.search(a),n=Object(_.b)(...c,new Set(l[0].result));O.push({id:`${e}::${t}`,fsQuery:a,query:t,count:n.size,result:n})})}),O.sort((e,t)=>t.count-e.count),O.slice(0,5).forEach(({query:e,count:t,id:a,result:l,fsQuery:i})=>{u.push({id:a,label:n.a.createElement(C,{label:n.a.createElement(n.a.Fragment,null,e),count:t,className:"test"}),fsQuery:i,tag:""+e,result:new Set(l),modelName:r})}),x(""===t?{value:"",searchResults:[]}:{value:t,searchResults:u})},onClear:()=>{x(e=>({...e,value:""}))},onReset:()=>{x({searchResults:[],value:""}),S(Object(p.g)(r))},onRemoveTag:e=>{S(Object(p.f)(r,e))},overflowTitleLabel:e.formatMessage({id:"MULTI_SEARCH_OVERFLOW_LABEL"}),overflowTranslations:{singular:"{0} "+e.formatMessage({id:"MULTI_SEARCH_OVERFLOW_SINGULAR"}),plural:"{0} "+e.formatMessage({id:"MULTI_SEARCH_OVERFLOW_PLURAL"})},removeTagLabel:e.formatMessage({id:"MULTI_SEARCH_REMOVE_TERM"}),recentTerms:U,recentTermsLabel:e.formatMessage({id:"MULTI_SEARCH_RECENT_TERMS_LABEL"}),recentTermsTitle:e.formatMessage({id:"MULTI_SEARCH_RECENT_TERMS_TITLE"}),resetButton:e.formatMessage({id:"COMMON_ACTION_RESET"}),searchResults:w.searchResults,searchResultsLabel:e.formatMessage({id:"MULTI_SEARCH_RESULTS"}),tags:A,value:w.value,width:440}))})},2851:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));const l=a(3).a`
  th {
    span {
      font-size: 14px;
      font-weight: 700;
    }
    svg {
      width: 16px;
      height: 16px;
    }
  }
`},2884:function(e,t,a){"use strict";a.d(t,"a",(function(){return r})),a.d(t,"b",(function(){return i}));var l=a(398),n=a(194);const r=e=>Object(l.h)({name:n.a.UNIFI_DEVICES,value:e}),i=e=>Object(l.f)({name:n.a.UNIFI_DEVICES,mode:e})},2910:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var l=a(0),n=a.n(l),r=a(1),i=a(3),c=a(481),o=a(1154),s=a(851),d=a(985),m=a(47),_=a(48),E=a(104),u=a(32),b=a(1108);const O=Object(i.c)("div")`
  white-space: nowrap;
`,p=Object(i.c)("div")`
  white-space: nowrap;
  display: flex;
  align-items: center;
`,g=Object(i.c)(c.a)`
  width: 100%;
  min-width: 110px;
`,I=Object(i.c)("div")`
  width: 100%;
`,h=({device:e,className:t,alwaysShowStatusBar:a})=>{const{satisfaction:i,type:c,satisfactionByRadio:h,problemPorts:C}=e;return Object(l.useMemo)(()=>{switch(c){case u.g.GATEWAY:case u.g.UXG:{const a=100-+(e["system-stats"]&&e["system-stats"].cpu||0);return n.a.createElement(g,{position:"bottom",portal:!0,className:t,message:n.a.createElement(O,null,n.a.createElement(r.b,{id:"DEVICE_UTILIZATION_INVERTED"}))},n.a.createElement(p,null,n.a.createElement(o.a,{variant:"gradient",value:a})))}case u.g.SWITCH:{if(!i||i<0)return a?n.a.createElement(I,{className:t},n.a.createElement(o.a,{value:0})):n.a.createElement(r.b,{id:"COMMON_NA"});const l=n.a.createElement(s.a,{type:"percent",input:i/100,style:{color:d.a.getGradientColor(i/100)}}),c=n.a.createElement(n.a.Fragment,null,n.a.createElement(p,null,n.a.createElement("div",{style:{flexGrow:1,marginRight:"10px"}},n.a.createElement(m.a,{heading:"primary"},n.a.createElement(r.b,{id:"DEVICE_SWITCH_EXPERIENCE"}))),n.a.createElement("div",null,n.a.createElement(m.a,{heading:"primary"},l))),C&&C.length?n.a.createElement(n.a.Fragment,null,n.a.createElement(m.a,{heading:"primary"},n.a.createElement(r.b,{id:C.length>1?"DEVICE_SWITCH_PORT_PROBLEM_PORTS":"DEVICE_SWITCH_PORT_PROBLEM_PORT"})),C.map(e=>n.a.createElement(p,{key:e.name},n.a.createElement("div",{style:{flexGrow:1}},e.name),n.a.createElement("div",null,n.a.createElement("span",{style:{color:d.a.getGradientColor(e.satisfaction/100)}},e.satisfaction,"%"))))):null,n.a.createElement(b.a,{device:e}));return n.a.createElement(g,{position:"bottom",message:c,portal:!0,className:t},n.a.createElement(p,null,n.a.createElement(o.a,{variant:"gradient",value:i})))}case u.g.AP:{const{averageSatisfaction:e,byRadio:l}=h;if(!e)return a?n.a.createElement(I,{className:t},n.a.createElement(o.a,{value:0})):n.a.createElement(r.b,{id:"COMMON_NA"});if(e<0)return a?n.a.createElement(I,{className:t},n.a.createElement(o.a,{value:0})):n.a.createElement(r.b,{id:"COMMON_NO_CLIENT"});const i=Object.entries(l).reduce((e,[t,a])=>(e.push(n.a.createElement(O,null,n.a.createElement(m.a,{heading:"primary",style:{marginBottom:"8px"}},n.a.createElement(r.b,{id:"na"===t?"DEVICE_WIFI_EXPERIENCE_5G":"DEVICE_WIFI_EXPERIENCE_2G"})))),Object.values(a).forEach(t=>{t.reverse().forEach(({essid:t,satisfaction:a})=>{e.push(n.a.createElement(p,{style:{marginBottom:"8px"}},n.a.createElement("div",{style:{flexGrow:1}},t),n.a.createElement("div",null,n.a.createElement("span",{style:a>=0?{color:_.a["color-"+Object(E.c)(a)]}:{}},a>=0?a+"%":"-"))))})}),e),[]);return n.a.createElement(g,{position:"bottom",message:n.a.createElement(n.a.Fragment,null,i),width:192,portal:!0},n.a.createElement(p,null,n.a.createElement(o.a,{value:e,variant:Object(E.c)(e)})))}default:return a?n.a.createElement(I,{className:t},n.a.createElement(o.a,{value:0})):n.a.createElement(r.b,{id:"COMMON_NA"})}},[c,e,t,i,C,a,h])}},2911:function(e,t,a){"use strict";var l=a(0),n=a.n(l),r=a(1),i=a(4),c=a(2757),o=a(173),s=a(495),d=a(85),m=a(20),_=a(5),E=a(123),u=a(757),b=a(751),O=a(625),p=a(2610),g=a(344),I=a(2884);t.a=({hasAnyDeviceSelector:e,searchModelName:t})=>{const a=Object(i.useSelector)(e),l=Object(i.useSelector)(Object(b.b)(t)),h=Object(i.useSelector)(d.selectIsUnifiDevicesPageSupportedController),C=Object(i.useDispatch)(),v=()=>{const e=Object(s.a)(h?g.a:p.a);C(h?Object(I.a)(e):Object(O.a)(e)),C(Object(m.L)(h?E.a.UNIFI_DEVICE:E.a.DEVICE,{filters:e}))},f=()=>{const e=document.querySelector("input[role=combobox]");e&&e.focus(),C(Object(u.g)(t))};return n.a.createElement(_.a,{width:"100%",flexDirection:"column"},n.a.createElement(()=>{switch(!0){case!!l.length:return n.a.createElement(c.a,{icon:"noElements",maxWidth:386,detailPadding:35,title:n.a.createElement(r.b,{id:"COMMON_NO_MATCH"}),details:n.a.createElement(r.b,{id:"DEVICE_EMPTY_SEARCH_NO_DEVICES_DETAILS"}),button:n.a.createElement(o.a,{variant:"primary"},n.a.createElement(r.b,{id:"COMMON_REMOVE_FILTERS"})),onClick:f});case a:return n.a.createElement(c.a,{icon:"noElements",maxWidth:386,detailPadding:35,title:n.a.createElement(r.b,{id:"COMMON_NO_MATCH"}),details:n.a.createElement(r.b,{id:"DEVICE_EMPTY_FILTER_NO_DEVICES_DETAILS"}),button:n.a.createElement(o.a,{variant:"primary"},n.a.createElement(r.b,{id:"COMMON_BUTTON_RESET_DISPLAY_OPTION"})),onClick:v});default:return n.a.createElement(c.a,{icon:"noElements",maxWidth:386,detailPadding:35,title:n.a.createElement(r.b,{id:"DEVICE_EMPTY_HEADER"}),details:n.a.createElement(r.b,{id:"DEVICE_EMPTY_NO_DEVICES_DETAILS"}),button:null})}},null))}},2936:function(e,t,a){"use strict";var l,n,r=a(6),i=a(0),c=a.n(i),o=a(3),s=a(4),d=a(25),m=a(5),_=a(107),E=a(15),u=a(234),b=a(47),O=a(495),p=a(1),g=a(2824),I=a(20),h=a(123),C=a(46),v=a(2833),f=a(108),T=a(118),S=a(2839);!function(e){e.ELEMENTS="elements",e.DESCRIPTION="description"}(l||(l={})),function(e){e.GATEWAY="gateway",e.SWITCH="switch",e.ACCESS_POINT="access_point",e.SMART_POWER="smart_power",e.BUILDING_BRIDGE="building_bridge",e.ULTE="ulte",e.NON_NETWORK_DEVICES="non_network_devices"}(n||(n={}));const D={[n.GATEWAY]:"UNIFI_DEVICE_FILTER_ELEMENT_GATEWAY",[n.SWITCH]:"UNIFI_DEVICE_FILTER_ELEMENT_SWITCH",[n.ACCESS_POINT]:"UNIFI_DEVICE_FILTER_ELEMENT_ACCESS_POINT",[n.SMART_POWER]:"UNIFI_DEVICE_FILTER_ELEMENT_SMART_POWER",[n.BUILDING_BRIDGE]:"UNIFI_DEVICE_FILTER_ELEMENT_BUILDING_BRIDGE",[n.ULTE]:"UNIFI_DEVICE_FILTER_ELEMENT_ULTE",[n.NON_NETWORK_DEVICES]:"UNIFI_DEVICE_FILTER_ELEMENT_NON_NETWORK_DEVICES"};var j;!function(e){e.POWER="power"}(j||(j={}));const P={[j.POWER]:"UNIFI_DEVICE_FILTER_DESCRIPTION_POWER"};var R=a(194),N=a(285);const M={[l.ELEMENTS]:Object.values(n),[l.DESCRIPTION]:Object.values(j)},A=Object(N.b)(R.a.UNIFI_DEVICES_PORTS,h.a.UNIFI_DEVICE_PORTS,M),L=({filters:e,onChangeUnifiDeviceFilter:t})=>{const a=Object(i.useMemo)(()=>{const t={[l.ELEMENTS]:e[l.ELEMENTS]},a={[l.ELEMENTS]:M[l.ELEMENTS]};return Object(v.a)(t,a)},[e]),r=Object(i.useCallback)(({target:{checked:a}})=>{const n=Object(O.a)(M[l.ELEMENTS]),r=Object(O.a)(e);r[l.ELEMENTS]=a?n:[],t(r)},[t,e]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(g.c,{checked:a,onChange:r,id:"showAllDevices",text:"COMMON_SHOW_ALL_DEVICES",toggleStyle:{marginTop:28,marginRight:24,marginBottom:16,marginLeft:24}}),c.a.createElement(S.a,{onChange:(e,a)=>t(a),selectedIds:e,multiOpen:!0,items:[{id:l.ELEMENTS,label:c.a.createElement(p.b,{id:"UNIFI_DEVICE_FILTER_HEADER_ELEMENTS"}),openByDefault:!0,options:Object.values(n).map(e=>({key:e,id:e,children:c.a.createElement(p.b,{id:D[e]})}))},{id:l.DESCRIPTION,label:c.a.createElement(p.b,{id:"UNIFI_DEVICE_FILTER_HEADER_DESCRIPTION"}),openByDefault:!0,options:Object.values(j).map(t=>({key:t,id:t,children:c.a.createElement(p.a,{id:P[t]}),disabled:!e[l.ELEMENTS].length}))}]}))};var F=a(398);const w=Object(o.c)(b.a)`
  margin-left: 7px;
  line-height: 24px;
  font-weight: bold;
  font-size: 14px;
`;var x=({deviceData:e})=>{const t=Object(s.useDispatch)(),a=Object(s.useSelector)(A),l=Object(i.useCallback)(e=>{var a;t((a=e,Object(F.h)({name:R.a.UNIFI_DEVICES_PORTS,value:a}))),t(Object(I.L)(h.a.UNIFI_DEVICE_PORTS,{filters:e}))},[t]),n=Object(i.useMemo)(()=>Object(v.a)(a,M),[a]),r=Object(i.useCallback)(()=>{l(Object(O.a)(M))},[l]);return c.a.createElement(g.b,{isLoading:!1,title:"UNIFI_DEVICE_HEADER_UNIFI_DEVICES",columnTabProps:{columns:Object.values(T.b),columnLabels:T.c,hidden:[T.b.PORT_SYMBOL],tableType:h.a.UNIFI_DEVICE_PORTS},renderFilterDrawerContent:c.a.createElement(L,{onChangeUnifiDeviceFilter:l,filters:a}),filterFooterProps:{label:c.a.createElement(p.b,{id:"COMMON_CONTROL_PANEL_FILTER_FOOTER_RESTORE_DEFAULTS"}),onClick:r,disabled:n},filtersActive:!n,leftContent:c.a.createElement(c.a.Fragment,null,c.a.createElement(f.c,{device:e,width:26,height:26}),c.a.createElement(w,null,Object(C.c)(e)))})},y=a(173),V=a(2623),U=a(2869),k=a(10),W=a(57),B=a(89),G=a(206),H=a(641);const $=(e,t)=>t(e),z={[l.ELEMENTS]:{[n.GATEWAY]:e=>$(e,r.isGateway),[n.SWITCH]:e=>$(e,r.isSwitch)&&!$(e,r.isSmartPower),[n.ACCESS_POINT]:e=>$(e,r.isAp)&&!$(e,r.isSmartPower)&&!$(e,r.isUlte),[n.SMART_POWER]:e=>$(e,r.isSmartPower),[n.BUILDING_BRIDGE]:e=>$(e,r.isUBB),[n.ULTE]:e=>$(e,r.isUlte),[n.NON_NETWORK_DEVICES]:(e,t)=>t&&t!==G.d.NETWORK_DEVICES},[l.DESCRIPTION]:{[j.POWER]:e=>{const t=Object(r.getDeviceState)(e);return[r.DeviceState.PENDING,r.DeviceState.ADOPTION_REQUIRED,r.DeviceState.ADOPTION_FAILED,r.DeviceState.FIRMWARE_MISMATCH].some(e=>e===t)}}},Y=(e,t,a)=>{if(!e)return!1;const l=Object(H.b)(t);return!(!Object.values(l).length||!((e,t,a)=>{const l={};return Object.entries(e).forEach(([e,n])=>{var r;l[e]=null===(r=null==n?void 0:n.some)||void 0===r?void 0:r.call(n,l=>{var n,r,i;return null!==(i=null===(r=null===(n=z[e])||void 0===n?void 0:n[l])||void 0===r?void 0:r.call(n,t,a))&&void 0!==i&&i})}),Object.values(l)})(l,e,a).every(Boolean))};var K=a(85),X=a(218);const q=Object(o.c)(m.a)`
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: ${({theme:e})=>e.motifPalette.neutral01};
  cursor: pointer;
`;var J=({connectedDevice:e,connectedClient:t,onPropertiesOpen:a})=>{if(!e&&!t)return null;const l=!!e;return c.a.createElement(q,{onClick:()=>a(e,t)},l?c.a.createElement(f.c,{device:e,width:26,height:26}):c.a.createElement(m.a,{height:25,minWidth:25,maxWidth:25,justifyContent:"center",alignItems:"center"},c.a.createElement(X.a,{client:t})))};const Q=Object(o.c)(m.a)`
  flex-direction: column;
  color: ${({theme:e})=>e.motifPalette.text02};

  text-align: center;
  cursor: pointer;

  & > span {
    max-width: 64px;
    line-height: 16px;
    font-size: 10px;
    font-weight: bold;
  }
`;var Z=({connectedDevice:e,connectedClient:t,onPropertiesOpen:a})=>{if(!e&&!t)return null;const l=!!e,n=l?e.mac:t.id,r=l?Object(C.c)(e):Object(B.getClientName)(t);return c.a.createElement(Q,{onClick:()=>a(e,t)},r.split(" ",2).map((e,t)=>{const a=`DiagramLabel-${n}-${t}`;return c.a.createElement(b.a,{key:a,truncate:!0},e)}))};const ee=Object(o.c)(b.a)`
  color: ${({theme:e})=>e.motifPalette.text03};
  line-height: 16px;
  font-size: 10px;
`;var te=({cellData:e})=>{const t=Object(r.getPortPoeValue)(e);return t&&c.a.createElement(m.a,null,c.a.createElement(ee,null,t))},ae=a(1657),le=a(22),ne=({background:e,border:t})=>c.a.createElement("svg",{width:"54",height:"41",viewBox:"0 0 54 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c.a.createElement("path",{d:"M53.5 10V40C53.5 40.2761 53.2761 40.5 53 40.5H0.999999C0.723857 40.5 0.5 40.2761 0.5 40V10C0.5 9.72386 0.723858 9.5 1 9.5H10.125H13.625C14.4534 9.5 15.125 8.82843 15.125 8V4V1C15.125 0.723858 15.3489 0.5 15.625 0.5H38.375C38.6511 0.5 38.875 0.723857 38.875 1V4V8C38.875 8.82843 39.5466 9.5 40.375 9.5H43.875H53C53.2761 9.5 53.5 9.72386 53.5 10Z",fill:e,stroke:t})),re=({background:e,border:t})=>c.a.createElement("svg",{width:"48",height:"41",viewBox:"0 0 48 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c.a.createElement("path",{d:"M47.5 10V40C47.5 40.2761 47.2761 40.5 47 40.5H0.999999C0.723857 40.5 0.5 40.2761 0.5 40V10C0.5 9.72386 0.723858 9.5 1 9.5H8C8.82843 9.5 9.5 8.82843 9.5 8V5C9.5 4.72386 9.72386 4.5 10 4.5H12C12.8284 4.5 13.5 3.82843 13.5 3V1C13.5 0.723858 13.7239 0.5 14 0.5H34C34.2761 0.5 34.5 0.723858 34.5 1V3C34.5 3.82843 35.1716 4.5 36 4.5H38C38.2761 4.5 38.5 4.72386 38.5 5V8C38.5 8.82843 39.1716 9.5 40 9.5H47C47.2761 9.5 47.5 9.72386 47.5 10Z",fill:e,stroke:t}),c.a.createElement("path",{d:"M17 38L17 40",stroke:t}),c.a.createElement("path",{d:"M19 38L19 40",stroke:t}),c.a.createElement("path",{d:"M21 38L21 40",stroke:t}),c.a.createElement("path",{d:"M23 38L23 40",stroke:t}),c.a.createElement("path",{d:"M25 38L25 40",stroke:t}),c.a.createElement("path",{d:"M27 38L27 40",stroke:t}),c.a.createElement("path",{d:"M29 38L29 40",stroke:t}),c.a.createElement("path",{d:"M31 38L31 40",stroke:t}));const ie=Object(o.c)("div",{shouldForwardProp:e=>!["color","isSfpPort","isDisabled"].includes(e)})`
  height: 41px;
  width: ${({isSfpPort:e})=>e?"54px":"48px"};
  align-items: center;
  color: ${({theme:e,color:t})=>e.motifPalette[t]};
  justify-content: center;
  display: flex;
  position: relative;
  pointer-events: auto;
  cursor: pointer;

  ${({isDisabled:e})=>e&&"\n    pointer-events: none;\n    opacity: 0.4;\n  "}
`,ce=Object(o.c)("div",{shouldForwardProp:e=>!["isSelected","upSideDown"].includes(e)})`
  & > svg {
    transform: ${({upSideDown:e})=>e?"rotate(180deg)":"rotate(0deg)"};

    /**
     * Workaround for safari
     * @see: https://stackoverflow.com/questions/56478925/safari-drop-shadow-filter-remains-visible-even-with-hidden-element
     */
    will-change: filter;

    ${({isSelected:e})=>e&&"\n        // the next drop-shadow adds shadow to the just generated drop-shadow\n        filter: drop-shadow( 0px -2px 0px rgba(0, 111, 255, 1)) \n                drop-shadow( 0px  2px 0px rgba(0, 111, 255, 1))\n                drop-shadow(-2px  0px 0px rgba(0, 111, 255, 1)) \n                drop-shadow( 2px  0px 0px rgba(0, 111, 255, 1));\n    "}
  }
`,oe=Object(o.c)("div",{shouldForwardProp:e=>!["upSideDown"].includes(e)})`
  position: absolute;
  ${({upSideDown:e})=>e?"top: 8px;":"bottom: 8px;"}
  right: 0px;
  width: 25px;
  height: 25px;
`,se=Object(o.c)("span",{shouldForwardProp:e=>!["upSideDown"].includes(e)})`
  position: absolute;
  width: 40px;
  height: 20px;
  line-height: 20px;
  text-align: left;
  ${({upSideDown:e})=>e?"top: 0px;":"bottom: 0px;"}
  left: 4px;
`;var de=({cellData:e,deviceData:t,upSideDown:a,selectedPorts:l,onPortOpen:n,isPortsDiagramDisabled:o,isWanPort:d})=>{const m=Object(le.n)(),_=e||{},u=Object(r.getUplinkRemotePort)(Object(s.useSelector)(r.selectDevicesData),t),b=Object(r.getPortIcons)(e,t,Object(s.useSelector)(E.selectNetworkGroups),u),O=Object(r.getExtendedPortColor)(e),p=e&&e.isMediaSfp?ne:re,g=l.includes(e.port_idx),I=Object(i.useMemo)(()=>d(e.port_idx),[e.port_idx]),h=Object(i.useMemo)(()=>d(l[0]),[l[0]]),C=!l.length||I===h,v=(e.masked||o||!C)&&!g;return c.a.createElement(ie,{onClick:()=>!v&&n(e.port_idx,!1),color:O.text,isDisabled:v,isSfpPort:e.isMediaSfp},c.a.createElement(ce,{isSelected:g,upSideDown:a},c.a.createElement(p,{background:m.motifPalette[O.background],border:m.motifPalette[O.border]})),c.a.createElement(oe,{upSideDown:a},c.a.createElement(ae.a,{icons:b})),c.a.createElement(se,{upSideDown:a},Object(r.getPortIndex)(_,!0)))};const me=Object(o.c)("div")`
  width: 64px;
`,_e=Object(o.c)(m.a,{shouldForwardProp:e=>!["isFirstRow"].includes(e)})`
  flex-direction: ${({isFirstRow:e})=>e?"column-reverse":"column"};
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  width: 64px;
  min-width: 64px;
  position: relative;
`,Ee=Object(o.c)(m.a)`
  width: 1px;
  height: 33px;
  background: ${({theme:e})=>e.motifPalette.neutral04};
`;var ue=({cellData:e,deviceData:t,isFirstRow:a,...l})=>{const i=Object(s.useSelector)(r.selectDevicesData),o=Object(s.useSelector)(Object(B.selectClientsByDevice)(t)),d=Object(s.useSelector)(A);if(!e)return Object(r.isUdmBase)(t)||Object(r.isUdr)(t)?null:c.a.createElement(me,null);const{description:m,elements:_}=d,E=e||{},u=Object(r.getPortUplink)(E,t,i)||Object(r.getPortDownlink)(E,t,i),b=o.find(t=>t.sw_port===(null==e?void 0:e.portIdx)),O=null==m?void 0:m.includes(j.POWER),p=Y(u,{elements:_},K.UnifiDeviceType.NETWORK_DEVICES),g=null==_?void 0:_.includes(n.NON_NETWORK_DEVICES);return c.a.createElement(_e,{isFirstRow:a},c.a.createElement(de,Object.assign({deviceData:t,cellData:e,upSideDown:!a},l)),(p&&u||g&&b)&&c.a.createElement(c.a.Fragment,null,c.a.createElement(Ee,null),c.a.createElement(J,Object.assign({connectedDevice:p?u:void 0,connectedClient:g?b:void 0,deviceData:t},l)),c.a.createElement(Z,Object.assign({connectedDevice:p?u:void 0,connectedClient:g?b:void 0,deviceData:t},l)),O&&c.a.createElement(te,{cellData:e})))};const be=Object(o.c)(m.a)`
  flex-direction: column;
  justify-content: center;
  gap: 20px;
`,Oe=Object(o.c)(m.a)`
  flex: 1 1 41px;
  gap: 4px;
`,pe=Object(o.c)(m.a)`
  font-size: ${({theme:e})=>e.fontSizes[0]}px;
`;var ge=({deviceData:e,...t})=>{const{diagram:a}=Object(W.G)(e),l=a.length?Object(W.c)(a,e):Object(W.f)(e);return l&&0!==l.length?c.a.createElement(be,null,l.map((a,l)=>c.a.createElement(Oe,{key:"PortDiagramLayoutRow-"+(l+1)},a.map((a,n)=>{const r=`PortDiagramLayoutCell-${l+1}-${n+1}`,i=a&&(null==e?void 0:e.port_table)&&Object(W.u)(a.portNumber,e);return c.a.createElement(ue,Object.assign({cellData:i,deviceData:e,key:r,isFirstRow:0===l},t))})))):c.a.createElement(pe,null,c.a.createElement(k.cb,{isActive:!0,className:"mr-2"}),c.a.createElement(p.b,{id:"DEVICE_DIAGRAM_MISSING"}))};const Ie=Object(o.c)(m.a)`
  padding: 24px;
  border: 1px solid ${({theme:e})=>e.motifPalette.neutral03};
  border-radius: 12px;

  flex-direction: column;
  gap: 24px;
  align-items: center;
`,he=Object(o.c)("div")`
  position: relative;
  width: 100%;
  line-height: 24px;

  & > div {
    position: absolute;
    right: 0;
    top: 0;
  }
`,Ce=Object(o.c)(m.a,{shouldForwardProp:e=>!["scale"].includes(e)})`
  transform: scale(${({scale:e})=>e});
`;var ve=({deviceData:e,closeAllPorts:t,selectedPorts:a,...l})=>{const{ref:n,width:r}=Object(U.a)(),{ref:i,width:o}=Object(U.a)(),s=Math.min((r-98)/o,1);return c.a.createElement("div",{ref:n},c.a.createElement(Ie,null,c.a.createElement(he,null,!!a.length&&c.a.createElement(y.a,{size:"small",type:"button",variant:"inline",onClick:()=>t()},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_BUTTON_CLOSE_PORT_EDIT"}))),c.a.createElement("div",{ref:i},c.a.createElement(Ce,{scale:s},c.a.createElement(ge,Object.assign({deviceData:e,selectedPorts:a,closeAllPorts:t},l)))),c.a.createElement(V.a,{deviceData:e,singleLine:!0})))},fe=a(734),Te=a(61),Se=a(14),De=a(2768),je=a(94),Pe=a(7),Re=a(131),Ne=a(90),Me=a(496),Ae=a(17),Le=a(1651),Fe=a(1599),we=a(391),xe=a(425),ye=a.n(xe),Ve=a(1644),Ue=a(1648),ke=a(2591),We=a(2602),Be=a(2592),Ge=a(11),He=a(208),$e=a(141),ze=a(62),Ye=a(79),Ke=a(35),Xe=a(616),qe=a(248),Je=a(2688),Qe=a(165),Ze=a(132),et=a(330),tt=a(2625);var at=Object(p.e)((function({activeItem:e,portData:t,selectedPorts:a,formValues:{egress_rate_limit_kbps_enabled:l,egress_rate_limit_unit:n,lldpmed_enabled:o,op_mode:d,poe_mode:_,speed:E,stormctrl_enabled:u},setFieldValue:O,setFieldTouched:g,initialValues:I,intl:h,isBatchEdit:C}){var v,f,T;const{port_table:S=[]}=e,{op_mode:D,port_idx:j,port_poe:P}=t,R=e.dot1x_portctrl_enabled,N=1===j,M=Object(r.hasSwitch)(e)||(Object(r.isInWallHd)(e)||Object(r.isUaiw6)(e)||Object(r.isU6EIW)(e))&&(N||R),A=Object(r.isInWallHd)(e),L=Object(r.getIsInWallAp)(e),F=Object(r.isUdm)(e),w=Object(r.isUdr)(e),x=Object(r.isSwitch)(e),y=Object(je.u)(e),V=Object(je.t)(e),U=Object(je.s)(e),W=Object(je.x)(e),B=Object(r.getPortPoeAvailability)(t),G=B.isPoePassthroughSupported&&!B.isPoeOffSupported,H="switch"===D&&(P||Object(r.isUaiw6)(e)||Object(r.isU6EIW)(e))&&M,$=Object(s.useDispatch)(),z=Object(i.useMemo)(()=>{var e;try{return null===(e=JSON.parse(E))||void 0===e?void 0:e.speed}catch(t){return null}},[E]),Y=Object(i.useMemo)(()=>Object(et.getSupportedSpeeds)(t).map(({autoneg:e,speed:t=0,full_duplex:a=!1})=>{const{value:l,unit:n}=Object(Ze.d)(1e6*t/8,"bitrate"),r=`${Object(Je.a)(l,1)}${n}`;let i;return i=e?"COMMON_DEVICE_AUTONEG_FULL":a?"COMMON_DEVICE_DUPLEX_FULL_STRING":"COMMON_DEVICE_DUPLEX_HALF_STRING",{full_duplex:a,label:i,value:JSON.stringify({speed:t,full_duplex:a}),values:!e&&{speed:r}}}),[t]),K=Object(i.useMemo)(()=>{var t;if(e){const a="mirror"===D;let l=Object(Qe.a)(e,"switch_caps.max_mirror_sessions",void 0);if(l||0===l||(l=1),a||(null===(t=null==e?void 0:e.port_table)||void 0===t?void 0:t.filter(e=>"mirror"===e.op_mode).length)<l)return!0}return!1},[e,D]),{isAggregateAllowed:X,hasMaxAggregateSessionsReached:q,aggregatePortOptions:J}=Object(i.useMemo)(()=>{var a,l;const n=Object(r.getPortNumbers)(e),i=Object.keys(n).reduce((e,t)=>n[t].length+e,0),{port_idx:c}=t,o=null!==(l=null===(a=null==e?void 0:e.switch_caps)||void 0===a?void 0:a.max_aggregate_sessions)&&void 0!==l?l:4,s=null==e?void 0:e.port_table.filter(e=>e.aggregate_num_ports>1).length,d=Object(Xe.d)(S,t,tt.a.MAX),m=Object(Xe.b)(c,d),_=m[0],E=m[m.length-1]||_;return{isAggregateAllowed:_<=E&&E<=i,hasMaxAggregateSessionsReached:s>=o,aggregatePortOptions:m.map(e=>({label:"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_HYPHEN",value:e,values:{port:e}}))}},[e,t,S]),Q=Object(i.useMemo)(()=>{const{isPoeOffSupported:e,isPoePassthroughSupported:t,isPoePassive24Supported:a,isPoeAutoSupported:l,isPoePlusPlusSupported:n,isPoePlusSupported:r}=B,i=[];if(e&&i.push({label:h.formatMessage({id:"COMMON_DEVICE_POE_MODE_OFF"}),value:Ne.d.OFF}),t&&i.push({label:h.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSTHROUGH"}),value:Ne.d.PASSTHROUGH}),!t&&a&&i.push({label:h.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"}),value:Ne.d.PASSIVE_24V}),!t&&l){const e=[];n?e.push(h.formatMessage({id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS"})):r?e.push(h.formatMessage({id:"COMMON_DEVICE_POE_MODE_POE_PLUS"})):e.push(h.formatMessage({id:"COMMON_DEVICE_POE_MODE_POE"})),e.push(h.formatMessage({id:"DEVICE_PORT_FORM_AUTO_DETECT"})),i.push({label:h.formatMessage({id:"COMMON_DEVICE_POE_MODE_AUTO"}),value:Ne.d.AUTO})}return i},[h,B.isPoeOffSupported,B.isPoePassthroughSupported,B.isPoePassive24Supported,B.isPoeAutoSupported,B.isPoePlusPlusSupported,B.isPoePlusSupported]),Z=Object(i.useMemo)(()=>e.port_table.filter(e=>a.includes(e.port_idx)).every(e=>{const t=Object(r.getPortPoeAvailability)(e);switch(_){case Ne.d.OFF:return t.isPoeOffSupported;case Ne.d.PASSTHROUGH:return t.isPoePassthroughSupported;case Ne.d.PASSIVE_24V:return t.isPoePassive24Supported;case Ne.d.AUTO:return t.isPoeAutoSupported;default:return!0}}),[a.length,_]);return c.a.createElement(c.a.Fragment,null,H&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"poe_mode",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_POE_MODE_LABEL"})}),c.a.createElement(Be.a,null,G?c.a.createElement(qe.a,null,c.a.createElement(k.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(b.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NOTICE_POE_PASSTHROUGH_ONLY"}))):c.a.createElement(Ge.Field,{name:"poe_mode",type:"dropdown",variant:"secondary",full:!0,options:Q,afterChange:e=>{e!==Ne.d.PASSIVE_24V&&e!==Ne.d.PASSTHROUGH||$(Object(Ye.a)({message:"DEVICE_ACTIONS_SWITCH_PORT_POE_MODE_CONFIRM_MESSAGE",messageValues:{ports:c.a.createElement("strong",null,a.join(", ")),portsCount:a.length,poe_mode:c.a.createElement("strong",null,e===Ne.d.PASSIVE_24V?h.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"}):e)},title:"DEVICE_ACTIONS_SWITCH_PORT_POE_MODE_CONFIRM_TITLE",useFormattedMessage:!0,onConfirm:()=>{O("poe_mode",e),$(Object(Ke.e)())},onCancel:()=>{O("poe_mode",_),$(Object(Ke.e)())},size:"medium"}))}}))),!Z&&c.a.createElement(ke.a,null,c.a.createElement(qe.a,null,c.a.createElement(k.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(b.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NOTICE_POE_NOT_APPLICABLE_TO_ALL_PORTS"}))))),!F&&!L&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"op_mode",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_OPERATIONS_LABEL"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"op_mode",type:"dropdown",variant:"secondary",full:!0,disabled:C,translateOptions:!0,options:[{label:"DEVICE_PORT_FORM_SWITCHING_LABEL",value:"switch"},...K?[{label:"DEVICE_PORT_FORM_MIRRORING_LABEL",value:"mirror"}]:[],...X?[{label:"DEVICE_PORT_FORM_AGGREGATE_LABEL",value:"aggregate"}]:[]]}))),"mirror"===d&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"mirror_port_idx",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_MIRRORING_PORT"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"mirror_port_idx",type:"number",variant:"secondary"}))),"aggregate"===d&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"aggregatePortStop",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_AGGREGATE_PORTS_LABEL"})}),c.a.createElement(Be.a,{column:!0,style:{gap:20}},c.a.createElement(m.a,{width:"100%"},c.a.createElement(m.a,{flex:1},c.a.createElement(Ge.Field,{name:"port_idx",variant:"secondary",full:!0,value:h.formatMessage({id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_HYPHEN"},{port:j}),disabled:!0})),c.a.createElement(m.a,{justifyContent:"center",width:"2em"},"-"),c.a.createElement(m.a,{flex:1},c.a.createElement(Ge.Field,{name:"aggregatePortStop",type:"dropdown",variant:"secondary",full:!0,options:J,translateOptions:!0,validated:!0,disabled:q}))),!q&&c.a.createElement(qe.a,null,c.a.createElement(k.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(b.a,{size:"caption"},c.a.createElement(p.a,{id:(null===(v=e.downlink_table)||void 0===v?void 0:v.length)?"DEVICE_PROPERTIES_WARNING_PORT_AGGREGATION_UPLINK":"DEVICE_PROPERTIES_WARNING_PORT_AGGREGATION_DOWNLINK"}))),q&&c.a.createElement(qe.a,null,c.a.createElement(k.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(b.a,{size:"caption"},c.a.createElement(p.a,{id:"DEVICE_PROPERTIES_WARNING_PORT_AGGREGATION_MAX_SESSION_WARNING"}))))),!L&&t.media&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"speed",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_LINK_SPEED_LABEL"})}),c.a.createElement(Be.a,{column:!0,style:{gap:20}},c.a.createElement(Ge.Field,{name:"speed",type:"dropdown",variant:"secondary",full:!0,translateOptions:!0,options:Y}),x&&z===Ne.c.PORTSPEED_FULL_25G.speed&&c.a.createElement(qe.a,null,c.a.createElement(k.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(b.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_LINK_SPEED_SFP28_ALERT"}))))),y&&"aggregate"!==d&&!A&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"isolation",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_PORT_ISOLATION_LABEL"}),tooltip:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_PORT_ISOLATION_NOTIFICATION"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"isolation",type:"realCheckbox"},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"})))),"switch"===d&&!L&&!F&&!w&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"stormctrl_enabled",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_STORM_CONTROL_LABEL"}),tooltip:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_STORM_CONTROL_TOOLTIP"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"stormctrl_enabled",type:"realCheckbox",afterChange:e=>{O("stormctrl_enabled",e),e||["stormctrl_ucast_rate","stormctrl_mcast_rate","stormctrl_bcast_rate"].forEach(e=>{O(e,I[e]),g(e,!1)})}},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"})))),u&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"stormctrl_ucast_rate",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_UNKNOWN_UNICAST"}),tooltip:c.a.createElement(p.b,{id:"COMMON_ENTER_PACKETS_PER_SECOND"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"stormctrl_ucast_rate",type:"number",variant:"secondary",min:Ne.e.MIN,max:Ne.e.MAX}))),c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"stormctrl_mcast_rate",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_UNKNOWN_MULTICAST"}),tooltip:c.a.createElement(p.b,{id:"COMMON_ENTER_PACKETS_PER_SECOND"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"stormctrl_mcast_rate",type:"number",variant:"secondary",min:Ne.e.MIN,max:Ne.e.MAX}))),c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"stormctrl_bcast_rate",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_UNKNOWN_BROADCAST"}),tooltip:c.a.createElement(p.b,{id:"COMMON_ENTER_PACKETS_PER_SECOND"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"stormctrl_bcast_rate",type:"number",variant:"secondary",min:Ne.e.MIN,max:Ne.e.MAX}))))),V&&"switch"===d&&!A&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"lldpmed_enabled",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_LLDP_MED_LABEL"}),tooltip:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_LLDP_MED_TOOLTIP"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"lldpmed_enabled",type:"realCheckbox",afterChange:e=>{O("lldpmed_enabled",e),e||O("lldpmed_notify_enabled",I.lldpmed_notify_enabled)}},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"})))),o&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"lldpmed_notify_enabled",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_TOPOLOGY_LABEL"}),tooltip:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_TOPOLOGY_TOOLTIP"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"lldpmed_notify_enabled",type:"realCheckbox"},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"}))))),W&&"switch"===d&&!A&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"stp_port_mode",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_STP_LABEL"}),tooltip:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_STP_TOOLTIP"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"stp_port_mode",type:"realCheckbox"},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"})))),U&&"switch"===d&&!A&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"egress_rate_limit_kbps_enabled",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_EGRESS_LABEL"}),tooltip:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_EGRESS_TOOLTIP"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"egress_rate_limit_kbps_enabled",type:"realCheckbox",afterChange:e=>{O("egress_rate_limit_kbps_enabled",e),e||(O("egress_rate_limit_kbps",I.egress_rate_limit_kbps),g("egress_rate_limit_kbps",!1))}},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"})))),l&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"egress_rate_limit_kbps",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_RATE_LIMIT_LABEL"})}),c.a.createElement(Be.a,null,c.a.createElement(m.a,{width:"100%",justifyContent:"space-between"},c.a.createElement(Ge.Field,{name:"egress_rate_limit_kbps",type:"number",variant:"secondary",width:220,min:null===(f=Ne.b[n])||void 0===f?void 0:f.MIN,max:null===(T=Ne.b[n])||void 0===T?void 0:T.MAX}),c.a.createElement(Ge.Field,{name:"egress_rate_limit_unit",type:"dropdown",variant:"secondary",width:100,options:Me.a.slice(0,2),translateOptions:!0}))))))})),lt=a(100),nt=a(26),rt=a(2624),it=a(23);const ct=Object(o.c)(m.a)`
  width: 100%;
`,ot=(e,t,a,l)=>Array.from(e,(e,n)=>({id:"port_security_mac_address-"+n,port_security_mac_address:e,port_security_mac_address_name:Object(rt.a)(t,a,e,l)})),st=[{id:"port_security_mac_address",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_MAC_ADDRESS_LABEL"}),sortable:!1},{id:"port_security_mac_address_name",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NAME_LABEL"}),sortable:!1}],dt={port_security_mac_addresses:"DEVICE_PORT_FORM_TOPOLOGY_LABEL"};var mt=Object(p.e)(({formValues:e,intl:t,setFieldValue:a})=>{const{port_security_mac_address:l}=e,n=Object(s.useSelector)(r.selectDevicesData),o=Object(s.useSelector)(B.selectCombinedClientsData),d=Object(i.useMemo)(()=>({editActive:!1,port_security_mac_address:ot(l,n,o,t)}),[l,n,o,t]),m=Object(i.useMemo)(()=>ot(l,n,o,t),[l,n,o,t]),_=Object(i.useMemo)(()=>[{name:"new_port_security_mac_address",type:"text"}],[]),E=Object(i.useCallback)(e=>{a("port_security_mac_address",e)},[a]),u=Object(i.useCallback)(({port_security_mac_address:e,new_port_security_mac_address:t})=>{t&&E([...e.map(({port_security_mac_address:e})=>e),t])},[E]),b=Object(i.useCallback)(({port_security_mac_address:t})=>{E(e.port_security_mac_address.filter(e=>e!==t))},[e,E]),O=Object(i.useCallback)(e=>{E([...e.map(({port_security_mac_address:e})=>e)])},[E]);return c.a.createElement(ct,{flexWrap:"wrap"},c.a.createElement(lt.c,{fieldName:"port_security_mac_address",items:m,columns:st,fieldLabels:dt,newFields:_,onAddItem:u,onRemoveItem:b,onEditSubmit:O,initialValues:d,useValuesInSchema:!0,validationSchema:e=>(e=>{const t=()=>it.a.string().label("DEVICE_PORT_FORM_MAC_ADDRESS_LABEL").matches(nt.s,{message:c.a.createElement(p.b,{id:"COMMON_VALIDATION_VALID_MAC"})}),a={arrayFieldName:"port_security_mac_address",stringFieldName:"port_security_mac_address",errorMessage:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_MAC_MUST_BE_UNIQUE"})};return it.a.object().shape({editActive:it.a.bool(),new_port_security_mac_address:t().isMacUnique({formValues:null,...a}),port_security_mac_address:it.a.array().of(it.a.object().shape({port_security_mac_address:t().isMacUnique({formValues:e,...a}).required()}))})})(e),addButtonText:"COMMON_ACTION_ADD",fieldVariant:"secondary"}))});const _t=Object(o.c)("li")`
  ${({isGroup:e})=>e?"\n      pointer-events: none;\n      opacity: 0.4;\n    ":"margin-left: 16px;"}
`,Et=Object(o.c)(Ve.a)`
  & > div > span {
    flex: 1;
  }
`,ut=Object(o.c)(He.a)`
  width: 100%;
  padding: 30px 0 0;
  border-top: none;
  margin-bottom: 125px;
  gap: 10px;
`;const bt=()=>{const e=c.a.createElement(p.b,{id:"DEVICE_VALIDATION_HINT_RANGE",values:{min:Ne.e.MIN,max:Ne.e.MAX}});return Pe.a.number().when("stormctrl_enabled",{is:!0,then:Pe.a.number().label(e).min(Ne.e.MIN,e).max(Ne.e.MAX,e).integer(e)})},Ot=Object(Se.f)({enableReinitialize:!0,mapPropsToValues:({currentPort:e,currentPortOverride:t})=>{const{port_idx:a,poe_mode:l,portconf_id:n,stormctrl_bcast_enabled:r=!1,stormctrl_bcast_rate:i="",stormctrl_mcast_enabled:c=!1,stormctrl_mcast_rate:o="",stormctrl_ucast_enabled:s=!1,stormctrl_ucast_rate:d="",isolation:m=!1,lldpmed_enabled:_,lldpmed_notify_enabled:E=!1,speed:u,full_duplex:b,op_mode:O,mirror_port_idx:p,port_security_mac_address:g=[],egress_rate_limit_kbps_enabled:I=!1,egress_rate_limit_kbps:h="",stp_port_mode:C=!0,nameOverride:v="",aggregate_num_ports:f=null}=e;return{name:v,speed:(null==t?void 0:t.speed)&&(null==t?void 0:t.full_duplex)?JSON.stringify({speed:u,full_duplex:b}):JSON.stringify({speed:0,full_duplex:!1}),lldpmed_enabled:!1!==_,stormctrl_enabled:r||c||s,aggregatePortStop:f?a+f-1:null,port_idx:a,poe_mode:l,portconf_id:n,stormctrl_bcast_enabled:r,stormctrl_bcast_rate:i,stormctrl_mcast_enabled:c,stormctrl_mcast_rate:o,stormctrl_ucast_enabled:s,stormctrl_ucast_rate:d,isolation:m,lldpmed_notify_enabled:E,full_duplex:b,mirror_port_idx:p,op_mode:O,port_security_mac_address:g,egress_rate_limit_kbps:h,egress_rate_limit_unit:Me.a[0].value,egress_rate_limit_kbps_enabled:I,stp_port_mode:C}},validationSchema:({activeItem:e})=>{const t=Object(r.getPortNumbers)(e),a=Math.min(t.standard[0]||1,t.sfp[0]||1,t.plus[0]||1),l=Math.max(t.standard[t.standard.length-1]||1,t.sfp[t.sfp.length-1]||1,t.plus[t.plus.length-1]||1),n=c.a.createElement(p.b,{id:"DEVICE_VALIDATION_HINT_RANGE",values:{min:a,max:l}}),i=(e=!1)=>c.a.createElement(p.b,{id:"DEVICE_VALIDATION_HINT_RANGE",values:{min:Ne.b[Me.a[e?1:0].value].MIN,max:Ne.b[Me.a[e?1:0].value].MAX}});return Pe.a.object().shape({port_idx:Pe.a.number(),name:Pe.a.string(),poe_mode:Pe.a.string(),portconf_id:Pe.a.string(),stormctrl_enabled:Pe.a.boolean(),stormctrl_bcast_enabled:Pe.a.boolean(),stormctrl_bcast_rate:bt(),stormctrl_mcast_enabled:Pe.a.boolean(),stormctrl_mcast_rate:bt(),stormctrl_ucast_enabled:Pe.a.boolean(),stormctrl_ucast_rate:bt(),isolation:Pe.a.boolean(),full_duplex:Pe.a.boolean(),lldpmed_enabled:Pe.a.boolean(),lldpmed_notify_enabled:Pe.a.boolean(),op_mode:Pe.a.string(),mirror_port_idx:Pe.a.number().when("op_mode",{is:"mirror",then:Pe.a.number().required(n).min(a,n).max(l,n)}),aggregatePortStop:Pe.a.number().nullable().when("op_mode",{is:"aggregate",then:Pe.a.number().required().label("DEVICE_PORT_FORM_AGGREGATE_PORT_LABEL")}),port_security_mac_address:Pe.a.array().of(Pe.a.string()),egress_rate_limit_kbps_enabled:Pe.a.boolean(),stp_port_mode:Pe.a.boolean(),egress_rate_limit_kbps:Pe.a.number().when(["egress_rate_limit_unit","egress_rate_limit_kbps_enabled"],{is:(e,t)=>e===Me.a[0].value&&t,then:Pe.a.number().required(i()).min(Ne.b.k.MIN,i()).max(Ne.b.k.MAX,i()).integer()}).when(["egress_rate_limit_unit","egress_rate_limit_kbps_enabled"],{is:(e,t)=>e===Me.a[1].value&&t,then:Pe.a.number().required(i(!0)).min(Ne.b.M.MIN,i(!0)).max(Ne.b.M.MAX,i(!0))})})},handleSubmit:(e,{props:{updateDeviceWithIdEndpoint:t,activeItem:{_id:a,port_overrides:l=[],mac:n},selectedPorts:i,activeItem:c,currentPort:o,closeAllPorts:s,intl:d,history:m}})=>{var _;const E=d.formatMessage({id:"DEVICE_PROPERTY_HEADER_PORTS"}),u=Object(r.getIsPortConfDisabled)(c,o),{stormctrl_enabled:b,stormctrl_bcast_rate:O,stormctrl_mcast_rate:p,lldpmed_enabled:g,lldpmed_notify_enabled:I,stormctrl_ucast_rate:h,egress_rate_limit_kbps:C,egress_rate_limit_kbps_enabled:v,op_mode:f,mirror_port_idx:T,stp_port_mode:S,aggregatePortStop:D}=e,{speed:j,full_duplex:P}=JSON.parse(e.speed);let R=null;v&&(R=e.egress_rate_limit_unit===Me.a[1].value?1e3*C:C),delete e.egress_rate_limit_unit;const N={...e,speed:j,full_duplex:P,stp_port_mode:S,autoneg:!j,lldpmed_notify_enabled:!!g&&I,stormctrl_bcast_enabled:!!b&&!!O,stormctrl_bcast_rate:b?O:null,stormctrl_mcast_enabled:!!b&&!!p,stormctrl_mcast_rate:b?p:null,stormctrl_ucast_enabled:!!b&&!!h,stormctrl_ucast_rate:b?h:null,egress_rate_limit_kbps:R,mirror_port_idx:"mirror"===f?T.toString():null,aggregate_num_ports:"aggregate"===f?D-o.port_idx+1:null},M=Object(De.a)(N,(e,t)=>"portconf_id"===t?u:"stormctrl_enabled"===t||("op_mode"===t&&"switch"===e||("lldpmed_enabled"===t?e:("full_duplex"!==t||!N.speed)&&("autoneg"!==t&&("poe_mode"===t&&"mirror"===N.op_mode||("stp_port_mode"===t?!("switch"===N.op_mode&&Object(je.x)(c)&&!Object(r.isInWallHd)(c)):"aggregatePortStop"===t||!e))))));M.port_security_enabled=!!(null===(_=M.port_security_mac_address)||void 0===_?void 0:_.length);t({port_overrides:[M,...i.slice(1).map(e=>{var t;return{...M,port_idx:e,name:null===(t=l.find(t=>t.port_idx===e))||void 0===t?void 0:t.name}}),...l.filter(e=>!i.includes(e.port_idx))]},a,n,{successToast:{icon:Ae.a.success,message:"DEVICE_PORT_FORM_SAVE_SUCCESS"},failureToast:{icon:Ae.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR",values:{section:E}},mergeAndOverrideKeys:["port_overrides"],extend:!0}).then(()=>{s()})}}),pt={updateDeviceWithIdEndpoint:r.updateDeviceWithIdEndpoint};var gt=Object(Te.compose)(Object(s.connect)((e,{activeItem:t,selectedPorts:a})=>({portConfig:Object(Re.selectPortConf)(e),currentPort:Object(r.getCurrentPortData)(a[0],t),currentPortOverride:Object(r.getCurrentPortOverrideData)(a[0],t)}),pt),p.e,Ot)((function({portConfig:e,activeItem:t,selectedPorts:a,history:l,closeAllPorts:n,currentPort:o,submitForm:m,resetForm:_,setFieldValue:E,setFieldTouched:u,values:O,values:{name:g,op_mode:h,portconf_id:C},intl:v,dirty:f,initialValues:T,setValues:S,disablePortsDiagram:D}){const j=Object(le.n)(),P=Object(r.getIsInWallAp)(t),R=Object(r.getIsSwitchMini)(t),N=Object(r.getIsUapUswHybrid)(t),M=Object(je.v)(t),A=Object(r.getHasSwitchFullFeatures)(t,o),L=Object(r.getIsPortConfDisabled)(t,o),F=Object(r.getPortPoeAvailability)(o),w=Object(Xe.f)(F),x=Object(s.useDispatch)(),V=Object(s.useSelector)($e.b),U=Object(s.useSelector)(ze.i),W=Object(s.useSelector)(I.s),B=Object(d.i)(U,{site:V}),G="switch"===h&&M&&!P&&!Object(r.isUdm)(t),[H,$]=Object(i.useState)(""),[z,Y]=Object(i.useState)(!1),[K,X]=Object(i.useState)(!1),q=a.length>1;Object(i.useEffect)(()=>{D("switch"!==O.op_mode)},[O.op_mode,D]);const J=Object(i.useMemo)(()=>{const t=e.map(e=>({...e,groupLabel:Object(r.getPortProfileGroup)(e)})),a=Object(Le.a)(t,"groupLabel");return Object.entries(a).reduce((e,[t,a])=>{const l=a.filter(e=>N?e.attr_hidden_id!==r.SWITCH_PROFILE.ALL_ID:!R||"DEVICE_PROPERTIES_VALUES_SWITCH_PORT_PROFILE_GROUP_CUSTOM"!==e.groupLabel).map(({name:e,_id:t})=>({label:e,value:t}));return"undefined"===t||R&&"DEVICE_PROPERTIES_VALUES_SWITCH_PORT_PROFILE_GROUP_CUSTOM"===t?(e.push(...l),e):(e.push({groupLabel:v.formatMessage({id:t}),items:l}),e)},[])},[v,e,N]),Q=Object(i.useMemo)(()=>Object(Fe.a)(J.map(({groupLabel:e,items:t})=>[{isGroup:!0,label:e,value:e},...t])),[J]),Z=(ee=t,Object(r.isAp)(ee)?"DEVICE_TYPE_ACCESS_POINT":Object(r.isUdm)(ee)?"DEVICE_TYPE_GATEWAY":"DEVICE_TYPE_SWITCH");var ee;const te=Object(i.useCallback)((t,l)=>{const n=w.includes(Ne.d.AUTO)?Ne.d.AUTO:Ne.d.OFF,i=null==e?void 0:e.find(e=>e._id===t),s=Object(r.getIsNoEditPortProfile)(i),d=(null==o?void 0:o.portconf_id)===(null==i?void 0:i._id),{speed:m=0,full_duplex:u=0}=i,b={lldpmed_enabled:!0,stormctrl_enabled:!1,aggregatePortStop:null,poe_mode:n,stormctrl_bcast_enabled:!1,stormctrl_bcast_rate:"",stormctrl_mcast_enabled:!1,stormctrl_mcast_rate:"",stormctrl_ucast_enabled:!1,stormctrl_ucast_rate:"",isolation:!1,lldpmed_notify_enabled:!1,op_mode:"switch",port_security_mac_address:[],egress_rate_limit_kbps:"",egress_rate_limit_unit:Me.a[0].value,egress_rate_limit_kbps_enabled:!1,stp_port_mode:!0,full_duplex:!1},p={...b,...null==e?void 0:e.find(e=>e._id===(null==o?void 0:o.portconf_id))},I=(null==p?void 0:p.speed)&&(null==p?void 0:p.full_duplex)?{speed:m,full_duplex:u}:{speed:0,full_duplex:!1},h=["name","speed"],C=Object.keys(O).filter(e=>e in p&&!h.includes(e));try{const e=!ye()(Object(we.a)(p,C),Object(we.a)(O,C))||!ye()(I,JSON.parse(O.speed));X(e)}catch(D){X(!0)}d?(_(),E("name",g)):S(s&&!d?{...O,portconf_id:null==i?void 0:i._id,speed:JSON.stringify({speed:0,full_duplex:!1}),...b}:{...O,speed:(null==i?void 0:i.speed)&&(null==i?void 0:i.full_duplex)?JSON.stringify({speed:m,full_duplex:u}):JSON.stringify({speed:0,full_duplex:!1}),lldpmed_enabled:!1!==(null==i?void 0:i.lldpmed_enabled),stormctrl_enabled:(null==i?void 0:i.stormctrl_bcast_enabled)||(null==i?void 0:i.stormctrl_mcast_enabled)||(null==i?void 0:i.stormctrl_ucast_enabled),stormctrl_bcast_enabled:null==i?void 0:i.stormctrl_bcast_enabled,stormctrl_bcast_rate:null==i?void 0:i.stormctrl_bcast_rate,stormctrl_mcast_enabled:null==i?void 0:i.stormctrl_mcast_enabled,stormctrl_mcast_rate:null==i?void 0:i.stormctrl_mcast_rate,stormctrl_ucast_enabled:null==i?void 0:i.stormctrl_ucast_enabled,stormctrl_ucast_rate:null==i?void 0:i.stormctrl_ucast_rate,isolation:null==i?void 0:i.isolation,lldpmed_notify_enabled:null==i?void 0:i.lldpmed_notify_enabled,full_duplex:null==i?void 0:i.full_duplex,op_mode:null==i?void 0:i.op_mode,egress_rate_limit_kbps:null==i?void 0:i.egress_rate_limit_kbps,egress_rate_limit_unit:Me.a[0].value,egress_rate_limit_kbps_enabled:null==i?void 0:i.egress_rate_limit_kbps_enabled,stp_port_mode:null==i?void 0:i.stp_port_mode});const f=(null==i?void 0:i.poe_mode)||n;$(f);const T=w.includes(f);Y(T),T?f===Ne.d.PASSIVE_24V||f===Ne.d.PASSTHROUGH?x(Object(Ye.a)({message:"DEVICE_ACTIONS_SWITCH_PORT_POE_MODE_CONFIRM_MESSAGE",messageValues:{ports:c.a.createElement("strong",null,a.join(", ")),portsCount:a.length,poe_mode:c.a.createElement("strong",null,f===Ne.d.PASSIVE_24V?v.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"}):f)},title:"DEVICE_ACTIONS_SWITCH_PORT_POE_MODE_CONFIRM_TITLE",useFormattedMessage:!0,onConfirm:()=>{E("poe_mode",f),x(Object(Ke.e)()),l()},onCancel:()=>{E("poe_mode",null==o?void 0:o.poe_mode),x(Object(Ke.e)())},size:"medium"})):(E("poe_mode",f),l()):l()},[O,null==o?void 0:o.poe_mode,e]),ae=Object(i.useMemo)(()=>c.a.createElement(Ge.Field,{name:"portconf_id",type:"dropdown",variant:"secondary",full:!0,options:Q,renderOption:({id:e,onClick:t,className:a,isSelected:l,option:{isGroup:n=!1,label:r,value:i}})=>c.a.createElement(_t,{key:`${e}-${r}`,id:e,onClick:e=>{te(i,()=>t(e))},className:a,"aria-selected":l,role:"option",isGroup:n},r),disabled:L}),[te,A,L,Q]);return Object(le.g)([Object(Re.fetchPortConf)()],c.a.createElement(c.a.Fragment,null,c.a.createElement(Ue.a,{padding:"none"},c.a.createElement(Et,{title:c.a.createElement(p.b,{id:"DEVICE_PROPERTIES_PORTS_LABEL",values:((e,t)=>"aggregate"===e.op_mode?{ports:Object(r.getPortIndex)(e),total:e.aggregate_num_ports}:{ports:t.join(", "),total:t.length})(o,a)}),hideUnderline:!0}),q&&c.a.createElement(ke.a,null,c.a.createElement(qe.a,null,c.a.createElement(k.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(b.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NOTICE_PORT_BATCH_EDIT",values:{portIdx:a[0]}})))),!q&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"name",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NAME_LABEL"})}),c.a.createElement(Be.a,null,c.a.createElement(Ge.Field,{name:"name",type:"text",variant:"secondary"}))),c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"portconf_id",alignWith:"dropdown",label:A?c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_PORT_PROFILE_LABEL"}):c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_PORT_NETWORKS_VLAN_LABEL"})}),c.a.createElement(Be.a,{column:!0,style:{gap:"12px"}},ae,c.a.createElement(y.a,{size:"small",type:"button",variant:"inline",onClick:()=>l.push(B+"/settings/profiles")},c.a.createElement(k.p,{height:20,width:20}),c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_MANAGE_PORT_PROFILES"})))),!!o.portconf_id&&C!==o.portconf_id&&K&&c.a.createElement(ke.a,null,c.a.createElement(qe.a,null,c.a.createElement(k.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(b.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NOTICE_OVERRIDE_RESET"})))),!!o.portconf_id&&C!==o.portconf_id&&!z&&o.port_poe&&K&&c.a.createElement(ke.a,null,c.a.createElement(qe.a,null,c.a.createElement(k.a,{size:"original",color:j.motifPalette.warning,variant:"fill"}),c.a.createElement(b.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NOTICE_OVERRIDE_POE_MODE",values:{profile_poe_mode:c.a.createElement("strong",null,[H].map(e=>{switch(e){case Ne.d.PASSIVE_24V:return v.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"});case Ne.d.AUTO:return v.formatMessage({id:"COMMON_DEVICE_POE_MODE_AUTO"});default:return e}}).join())}})))),L&&c.a.createElement(ke.a,null,c.a.createElement(qe.a,null,c.a.createElement(k.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(b.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NOTICE_PORT_CONF_DISABLED"})))),!q&&o.poe_enable&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"name",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_PORT_MANUAL_POWER_CYCLE"}),tooltip:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_PORT_MANUAL_POWER_CYCLE_DESCRIPTION",values:{deviceType:c.a.createElement(p.a,{id:Z})}})}),c.a.createElement(Be.a,null,c.a.createElement(y.a,{size:"small",type:"button",variant:"inline",onClick:()=>{x(Object(Ye.a)({message:"DEVICE_ACTIONS_SWITCH_PORT_POWER_CONFIRM_MESSAGE",messageValues:{portName:c.a.createElement("strong",null,o.portName),deviceName:t.name},title:"DEVICE_ACTIONS_SWITCH_PORT_POWER_CONFIRM_TITLE",useFormattedMessage:!0,onConfirm:()=>{x(Object(r.powerCyclePort)(t,o.port_idx)),x(Object(Ke.e)())}}))},disabled:W},c.a.createElement(k.Sb,{height:20,width:20,style:{padding:"2px"}}),c.a.createElement(p.b,{id:"DEVICE_ACTIONS_PORT_POWER_CYCLE"})))),G&&c.a.createElement(ke.a,null,c.a.createElement(We.a,{htmlFor:"macFilter",alignWith:"dropdown",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_MAC_ADDRESS_FILTER_LABEL"})}),c.a.createElement(Be.a,null,c.a.createElement(mt,{setFieldValue:E,formValues:O}))),c.a.createElement(Ve.a,{title:c.a.createElement(p.b,{id:"DEVICE_PORT_PROFILE_OVERRIDE"}),hideUnderline:!0}),c.a.createElement(at,{initialValues:T,setFieldValue:E,setFieldTouched:u,portData:o,activeItem:t,formValues:O,selectedPorts:a,isBatchEdit:q})),c.a.createElement(ut,{isDirty:f||q,onFormSubmit:()=>{q?x(Object(Ye.a)({title:"DEVICE_ACTIONS_SWITCH_BATCH_SAVE_CONFIRMATION_TITLE",message:"DEVICE_ACTIONS_SWITCH_BATCH_SAVE_CONFIRMATION_MESSAGE",onConfirm:()=>{m(),x(Object(Ke.e)())}})):m()},onFormCancel:()=>{_(),n()},allowCancel:!0})))}));const It=Object(o.c)(m.a)`
  overflow-x: auto;

  flex-direction: column;
  align-items: center;

  & > * {
    max-width: 600px;
  }
`;var ht=({deviceData:e,selectedPorts:t,isWanPort:a,...l})=>{const n=Object(d.k)(),r=Object(i.useMemo)(()=>a(t[0]),[t[0]]);return c.a.createElement("div",null,c.a.createElement(It,null,r?c.a.createElement(fe.a,{activeItem:e,history:n,isFullPage:!0}):c.a.createElement(gt,Object.assign({activeItem:e,selectedPorts:t,history:n},l))))},Ct=a(2628);const vt=Object(o.c)(m.a)`
  padding: 24px;
  border: 1px solid ${({theme:e})=>e.motifPalette.neutral03};
  border-radius: 12px;
`;var ft=({deviceData:e,...t})=>{const{initialColumns:a=[]}=Object(s.useSelector)(Object(I.B)(h.a.UNIFI_DEVICE_PORTS)),l=Object(i.useMemo)(()=>{const e=[...a];return e.includes(T.b.PORT_SYMBOL)||e.unshift(T.b.PORT_SYMBOL),e},[a]);return c.a.createElement("div",null,c.a.createElement(vt,{flexDirection:"column"},c.a.createElement(Ct.a,Object.assign({deviceData:e,columnOverride:l,fullData:!0},t))))};const Tt=Object(o.c)(m.a)`
  overflow: hidden;
`,St=Object(o.c)(m.a)`
  padding: 24px 2px 24px 24px;
  gap: 24px;
  overflow-x: hidden;
  overflow-y: scroll;
`,Dt=Object(o.c)("div")`
  & > div {
    padding-left: 24px;
    padding-right: 24px;
  }
`;t.a=Object(d.o)(({match:e})=>{Object(s.useDispatch)();const t=Object(d.k)(),{site:a,deviceId:l,portIds:n}=Object(d.m)(),o=Object(s.useSelector)(e=>Object(r.selectDeviceData)(e,l)),m=Object(s.useSelector)(E.selectNetworkGroups),[b,O]=Object(i.useState)(!1),p=Object(i.useMemo)(()=>/^[0-9,]+$/.test(n)?n.split(",").map(e=>Number(e)).filter(e=>!!e):[],[n]),g=Object(i.useCallback)((n,r=!1)=>{const{path:i}=e;let c=[...p];r?c=c.includes(n)?[]:[n]:c.includes(n)?c=c.filter(e=>e!==n):c.push(n),t.push(Object(d.i)(i,{site:a,deviceId:l,portIds:c.join(",")||void 0})),c.length||O(!1)},[a,l,p]),I=Object(i.useCallback)(()=>{const{path:n}=e;t.push(Object(d.i)(n,{site:a,deviceId:l,portIds:void 0})),O(!1)},[a,l,p]),h=Object(i.useCallback)((e,n)=>{t.push(Object(d.i)("/:site/devices/:deviceId/ports/:portIds?/properties/:id?/:panel?",{site:a,deviceId:l,portIds:p.join(",")||void 0,id:e?e.mac:n.mac,panel:_.a.OVERVIEW}))},[a,l,p]),C=Object(i.useCallback)(e=>{var t;if(!Object(r.isUdm)(o))return!1;const a=Object(r.getCurrentPortData)(e,o),l=Object(u.g)(a.ifname,o,m);return!(null===(t=null==l?void 0:l.id)||void 0===t?void 0:t.startsWith("LAN"))},[m,o,p]);return c.a.createElement(Tt,{flexDirection:"column"},c.a.createElement(Dt,null,c.a.createElement(x,{deviceData:o})),c.a.createElement(St,{flexDirection:"column"},c.a.createElement(ve,{deviceData:o,selectedPorts:p,onPropertiesOpen:h,onPortOpen:g,closeAllPorts:I,isPortsDiagramDisabled:b,isWanPort:C}),p.length?c.a.createElement(ht,{deviceData:o,selectedPorts:p,closeAllPorts:I,disablePortsDiagram:O,isWanPort:C}):c.a.createElement(ft,{deviceData:o,onPortOpen:g})))})},3099:function(e,t,a){"use strict";a.r(t);var l=a(0),n=a.n(l),r=a(4),i=a(25),c=a(362),o=a(853),s=a(254),d=a(49),m=a(5),_=a(76),E=a(92),u=a(2911),b=a(123),O=a(107),p=a(194),g=a(20),I=a(85),h=a(126),C=a(6),v=a(2841),f=a(3),T=a(47),S=a(1670),D=a(1),j=a(615),P=a(44),R=a(2851);const N=Object(f.c)(m.a)`
  table {
    .rowDisabledClassName {
      pointer-events: initial;
    }
  }
`,M=Object(f.c)("img")`
  width: 24px;
  margin-right: 12px;
`;var A=({icon:e,header:t,data:a,onRowClick:r=null,onSort:i,showUnifiCareBadge:c=!1,tablePreferences:{isAscending:o,sortBy:s,initialColumns:d}})=>{const _=Object(l.useMemo)(()=>{const e=[...d];return e.length&&!e.includes(P.b.STATUS_BALL)&&e.unshift(P.b.STATUS_BALL),e},[d]),E=Object(l.useMemo)(()=>Object(j.a)(c),[c]);return a.length?n.a.createElement(N,{flexDirection:"column",marginBottom:20},n.a.createElement(m.a,{alignItems:"center"},e&&n.a.createElement(M,{src:e}),n.a.createElement(T.a,{size:"body",color:"tertiary"},t||n.a.createElement(D.b,{id:"UNIFI_NUMBER_OF_DEVICES",values:{number:a.length}}))),n.a.createElement(S.a,{idField:"mac",headerRowClassName:R.a,items:a,columns:E,onRowClick:r,onSort:i,rowHeight:32,initialSortBy:s,initiallySortAscending:o,columnOverride:_,rowDisabledClassName:"rowDisabledClassName",disableColumnFilters:!0})):null};var L=({initialColumns:e,onSort:t,onRowClick:a})=>{const l=Object(r.useSelector)(I.selectUnifiNetworkDeviceTableData),i=Object(r.useSelector)(Object(g.B)(b.a.UNIFI_DEVICE_NETWORK)),c=Object(r.useSelector)(h.a);return n.a.createElement(v.a,null,n.a.createElement(A,{data:l,icon:c+"/unifiDevices/unifiNetworkDevice.png",tablePreferences:{...i,initialColumns:e},showUnifiCareBadge:l.some(e=>Object(C.hasActiveUnifiCare)(e)),onSort:(e,a)=>t(e,a,b.a.UNIFI_DEVICE_NETWORK),onRowClick:a}))};var F=({initialColumns:e,onSort:t,onRowClick:a})=>{const l=Object(r.useSelector)(I.selectUnifiProtectDeviceTableData),i=Object(r.useSelector)(Object(g.B)(b.a.UNIFI_DEVICE_PROTECT)),c=Object(r.useSelector)(h.a);return n.a.createElement(A,{data:l,icon:c+"/unifiDevices/unifiProtectDevice.png",tablePreferences:{...i,initialColumns:e},onSort:(e,a)=>t(e,a,b.a.UNIFI_DEVICE_PROTECT),onRowClick:a})};var w=({initialColumns:e,onSort:t,onRowClick:a})=>{const l=Object(r.useSelector)(I.selectUnifiTalkDeviceTableData),i=Object(r.useSelector)(Object(g.B)(b.a.UNIFI_DEVICE_TALK)),c=Object(r.useSelector)(h.a);return n.a.createElement(A,{data:l,icon:c+"/unifiDevices/unifiTalkDevice.png",tablePreferences:{...i,initialColumns:e},onSort:(e,a)=>t(e,a,b.a.UNIFI_DEVICE_TALK),onRowClick:a})};var x=({initialColumns:e,onSort:t,onRowClick:a})=>{const l=Object(r.useSelector)(I.selectUnifiAccessDeviceTableData),i=Object(r.useSelector)(Object(g.B)(b.a.UNIFI_DEVICE_ACCESS)),c=Object(r.useSelector)(h.a);return n.a.createElement(A,{data:l,icon:c+"/unifiDevices/unifiAccessDevice.png",tablePreferences:{...i,initialColumns:e},onSort:(e,a)=>t(e,a,b.a.UNIFI_DEVICE_ACCESS),onRowClick:a})};var y=({initialColumns:e,onSort:t,onRowClick:a})=>{const l=Object(r.useSelector)(I.selectUnifiConnectDeviceTableData),i=Object(r.useSelector)(Object(g.B)(b.a.UNIFI_DEVICE_CONNECT)),c=Object(r.useSelector)(h.a);return n.a.createElement(A,{data:l,icon:c+"/unifiDevices/unifiConnectDevice.png",tablePreferences:{...i,initialColumns:e},onSort:(e,a)=>t(e,a,b.a.UNIFI_DEVICE_CONNECT),onRowClick:a})};var V=({initialColumns:e,onSort:t,onRowClick:a})=>{const l=Object(r.useSelector)(I.selectUnifiUnmanagedDeviceTableData),i=Object(r.useSelector)(Object(g.B)(b.a.UNIFI_DEVICE_UNMANAGED));return n.a.createElement(A,{data:l,icon:void 0,header:n.a.createElement(D.b,{id:"UNIFI_DEVICE_HEADER_UNIFI_UNMANAGED"}),tablePreferences:{...i,initialColumns:e},onSort:(e,a)=>t(e,a,b.a.UNIFI_DEVICE_UNMANAGED),onRowClick:a})};var U=e=>{const t=Object(l.useCallback)(({id:t},a,l)=>e.dispatch(Object(g.L)(l,{sortBy:t,isAscending:a,initialColumns:e.initialColumns})),[]);return n.a.createElement(m.a,{flexDirection:"column"},[L,F,w,x,y,V].map(a=>n.a.createElement(a,Object.assign({key:a.name,onSort:t},e))))},k=a(2762),W=a(88),B=a(10),G=a(1154),H=a(481),$=a(31),z=a(108),Y=a(884),K=a(2910),X=a(737),q=a(46),J=a(1108),Q=a(267),Z=a(104);const ee=Object(f.c)(z.c)`
  max-width: 100%;
  max-height: 100%;
`,te=Object(f.c)($.c)`
  max-width: 100%;
  max-height: 80%;
`,ae=Object(f.c)($.f)`
  background: ${({theme:e})=>e.motifPalette.disabled01};
  > picture {
    width: calc(100% - 10px) !important;
    height: 110px;
    text-align: center;
  }
`,le=Object(f.c)(B.Rc)`
  position: absolute;
  top: 7px;
  right: 7px;
`,ne=Object(f.c)($.f)`
  ::after > div:nth-child(2) {
    max-width: 90%;
    > span:first-child {
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
`,re=Object(f.c)($.f)`
  svg {
    color: ${({theme:e})=>e.motifPalette.icon02};
  }
`,ie=Object(f.c)(X.a)`
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
`,ce=Object(f.c)(T.a)`
  max-width: 165px;
`,oe=({unifiDevice:e})=>Object(I.isNetworkUnifiDevice)(e)?n.a.createElement(ee,{device:e,filesMap:"GRID",width:"auto"}):n.a.createElement(te,{client:e,grid:!0,width:"auto"}),se=({unifiDevice:e})=>n.a.createElement($.f,{margin:"8px 0"},Object(I.isNetworkUnifiDevice)(e)?n.a.createElement(K.a,{device:e,alwaysShowStatusBar:!0}):n.a.createElement(G.a,{value:e.satisfaction,variant:Object(Z.c)(e.satisfaction)})),de=({unifiDevice:e})=>{const{portsUtilization:t,wired_speed_megabits_per_second:a}=e,l={style:{marginRight:"4px"}};return Object(C.isSwitch)(e)?n.a.createElement(H.a,{message:n.a.createElement(J.a,{device:e,hideBar:!0}),position:"bottom",portal:!0,width:192},n.a.createElement($.f,{alignItems:"center",height:20},n.a.createElement(B.I,Object.assign({},l,{height:14,width:14})),n.a.createElement(T.a,{color:"tertiary",size:"caption"},""+t.totalActivePorts,"/",""+t.total))):Object(I.isNetworkUnifiDevice)(e)?n.a.createElement($.f,{alignItems:"center",height:20},n.a.createElement(B.v,Object.assign({},l)),n.a.createElement(T.a,{color:"tertiary",size:"caption"},(null==e?void 0:e.num_sta)||0)):Object(C.isDeviceWireless)(e)?n.a.createElement(B.Tc,Object.assign({},l,{height:20,width:20})):n.a.createElement($.f,{alignItems:"center",height:20},n.a.createElement(B.I,Object.assign({},l,{height:14,width:14})),n.a.createElement(T.a,{color:"tertiary",size:"caption"},n.a.createElement(D.b,{id:a>=1e3?"COMMON_PORT_SPEED_GBE":"COMMON_PORT_SPEED_MBE"})))},me=({unifiDevice:e})=>Object(I.isNetworkUnifiDevice)(e)&&Object(C.hasActiveUnifiCare)(e)?n.a.createElement(ie,{width:32,height:32}):null;var _e=e=>e.map(e=>({id:e._id,image:n.a.createElement(ae,{justifyContent:"center",alignItems:"center",width:"100%",height:"120px"},Object(C.isU6)(e)&&n.a.createElement(le,{isActive:!0,size:"large"}),n.a.createElement(oe,{unifiDevice:e})),children:n.a.createElement($.f,{width:"100%",height:"100%",flexDirection:"column",justifyContent:"center",padding:"16px 0 8px"},n.a.createElement(ne,{justifyContent:"center",alignItems:"center"},n.a.createElement(Y.a,{status:e.status,statusPulse:e.statusPulse,marginRight:6}),n.a.createElement(ce,{truncate:!0},Object(q.c)(e))),n.a.createElement(T.a,{centered:!0,color:"tertiary",size:"caption"},Object(C.getDeviceIp)(e)||""),Object(C.isDeviceWireless)(e)||Object(C.isAp)(e)?n.a.createElement(Q.a,{mac:e.mac,props:["satisfaction"]},({satisfaction:t})=>n.a.createElement(se,{unifiDevice:Object.assign({},e,{satisfaction:t})})):n.a.createElement($.f,{height:26}),n.a.createElement(re,{justifyContent:"space-between",width:"100%"},n.a.createElement($.f,{alignItems:"center"},n.a.createElement(de,{unifiDevice:e})),n.a.createElement($.f,{alignItems:"center"},n.a.createElement(Q.a,{mac:e.mac,props:["download_speed_bytes_per_second"]},({download_speed_bytes_per_second:e=0})=>n.a.createElement($.q,{bytes:e,direction:"down",pow:2})),n.a.createElement(Q.a,{mac:e.mac,props:["upload_speed_bytes_per_second"]},({upload_speed_bytes_per_second:e=0})=>n.a.createElement($.q,{bytes:e,direction:"up",pow:2})))),n.a.createElement(me,{unifiDevice:e}))}));var Ee=({onRowClick:e})=>{const t=Object(r.useSelector)(I.selectAllCustomUnifiNetworkDeviceGridViewData);return n.a.createElement(W.i,null,n.a.createElement(k.a,{gutterSize:16,tileSize:"medium",selectType:"none",onTileClick:(a,l,n)=>e(null==t?void 0:t[n]),items:_e(t)}))};const ue=({allUnifiDeviceTableCustomData:e,onRowClick:t,dispatch:a})=>{const{initialColumns:l=[]}=Object(r.useSelector)(Object(d.v)(b.a.UNIFI_DEVICE));return e.length&&l.length?n.a.createElement(m.a,{height:"100%",padding:"32px",overflow:"auto",flexDirection:"column"},n.a.createElement(U,{onRowClick:t,dispatch:a,initialColumns:l})):n.a.createElement(u.a,{hasAnyDeviceSelector:o.d,searchModelName:"unifiDevices"})},be=({allUnifiDeviceTableCustomData:e,onRowClick:t})=>e.length?n.a.createElement(m.a,{height:"100%",padding:"32px",overflow:"auto",flexDirection:"column"},n.a.createElement(Ee,{onRowClick:t})):n.a.createElement(u.a,{hasAnyDeviceSelector:o.d,searchModelName:"unifiDevices"});var Oe=({viewType:e})=>{const t=Object(r.useDispatch)(),{site:a}=Object(i.m)(),c=Object(i.k)(),d=Object(r.useSelector)(o.c),m=Object(l.useCallback)(e=>{c.push(Object(i.i)("/:site/devices/properties/:id?/:panel?/:subPanel?/:subPanelId?",{id:e.mac,site:a,panel:O.a.OVERVIEW})),t(Object(_.g)({type:Object(s.c)(e)?E.c.DEVICE:E.c.CLIENT,mac:e.mac}))},[a]);return e===p.b.LIST?n.a.createElement(ue,{allUnifiDeviceTableCustomData:d,onRowClick:m,dispatch:t}):n.a.createElement(be,{allUnifiDeviceTableCustomData:d,onRowClick:m})},pe=a(495),ge=a(2824),Ie=a(2833),he=a(1192),Ce=a(751),ve=a(2850),fe=a(2843),Te=a(190),Se=a(2840);const De=["mac","search_type","search_status","search_name","search_model_name","search_ip","search_connection","search_network","search_experience","search_product_line"],je=new ve.Document({tokenize:"reverse",cache:500,encode:Se.a,document:{store:De,id:"mac",index:De}});var Pe=Object(D.e)(({intl:e})=>{const t=Object(r.useSelector)(Object(I.selectAllUnifiDeviceSearchData)(e));return n.a.createElement(fe.a,{lsKey:Te.a.UNIFI_DEVICES_SEARCH_HISTORY,getInitialSuggestions:()=>((e,t)=>[Object(Se.b)(e,[["search_type",t.formatMessage({id:"UNIFI_DEVICE_FILTER_ELEMENT_ACCESS_POINT"})],["search_type",t.formatMessage({id:"UNIFI_DEVICE_FILTER_ELEMENT_GATEWAY"})],["search_type",t.formatMessage({id:"UNIFI_DEVICE_FILTER_ELEMENT_SWITCH"})]]),Object(Se.b)(e,[["search_status",t.formatMessage({id:"DEVICE_FILTER_STATUS_ONLINE"})],["search_status",t.formatMessage({id:"DEVICE_FILTER_STATUS_OFFLINE"})],["search_status",t.formatMessage({id:"DEVICE_FILTER_STATUS_PENDING_ADOPTION"})]]),Object(Se.b)(e,[["search_connection",t.formatMessage({id:"COMMON_WORD_WIRED"})]]),Object(Se.b)(e,[["search_product_line","UniFi Protect"],["search_product_line","UniFi Access"],["search_product_line","UniFi Network"]])].filter(e=>e))(t,e),searchModelName:"unifiDevices",searchIndex:je,enabledColumns:De,recordIdKey:"mac",records:t})}),Re=a(2839),Ne=a(119),Me=a(244),Ae=a(344);const Le=({filters:e,networkFilterData:t,nonNetworkFilterData:a,onChangeUnifiDeviceFilter:r})=>{const i=(e,l)=>{var n,r;return(null===(n=(t||[]).map(t=>Object(Me.c)({[e]:[l]},t,I.UnifiDeviceType.NETWORK_DEVICES)).filter(e=>e.every(Boolean)))||void 0===n?void 0:n.length)+(null===(r=(a||[]).map(t=>Object(Me.c)({[e]:[l]},t,I.UnifiDeviceType.ACCESS_DEVICES)).filter(e=>e.every(Boolean)))||void 0===r?void 0:r.length)},c=Object(l.useMemo)(()=>Object(Ie.a)(e,Ae.a),[e]),o=Object(l.useCallback)(({target:{checked:e}})=>{const t=e?Object(pe.a)(Ae.a):{};r(t)},[r]);return n.a.createElement(n.a.Fragment,null,n.a.createElement(ge.c,{checked:c,onChange:o,id:"showAllDevices",text:"COMMON_SHOW_ALL_DEVICES",toggleStyle:{marginTop:28,marginRight:24,marginBottom:16,marginLeft:24}}),n.a.createElement(Re.a,{onChange:(e,t)=>r(t),selectedIds:e,multiOpen:!0,items:[{id:Ne.c.ELEMENTS,label:n.a.createElement(D.b,{id:"UNIFI_DEVICE_FILTER_HEADER_ELEMENTS"}),openByDefault:!0,options:Object.values(Ne.a).map(e=>({key:e,id:e,children:n.a.createElement(D.b,{id:"UNIFI_DEVICE_FILTER_ELEMENT_"+e.toUpperCase()}),labelProps:{count:i(Ne.c.ELEMENTS,e)}}))},{id:Ne.c.STATUS,label:n.a.createElement(D.b,{id:"UNIFI_DEVICE_FILTER_HEADER_STATUS"}),options:Object.values(Ne.b).map(e=>({key:e,id:e,children:n.a.createElement(D.a,{id:"UNIFI_DEVICE_FILTER_STATUS_"+e.toUpperCase()}),labelProps:{count:i(Ne.c.STATUS,e)}}))}]}))};var Fe=a(2884);var we=()=>{const e=Object(r.useSelector)(Ae.c),t=Object(r.useSelector)(I.selectNetworkUnifiDeviceCustomData),a=Object(r.useSelector)(I.selectNonNetworkUnifiDeviceCustomData),i=Object(r.useDispatch)(),c=Object(l.useCallback)(e=>{i(Object(Fe.a)(e)),i(Object(g.L)(b.a.UNIFI_DEVICE,{filters:e}))},[i]),o=!!Object(r.useSelector)(Object(Ce.b)("unifiDevices")).length,s=Object(l.useMemo)(()=>Object(Ie.a)(e,Ae.a),[e]),d=Object(l.useCallback)(()=>{c(Object(pe.a)(Ae.a))},[c]);return Object(l.useEffect)(()=>{o&&i(Object(he.b)(!1))},[i,o]),n.a.createElement(ge.b,{isLoading:!1,title:"UNIFI_DEVICE_HEADER_UNIFI_DEVICES",columnTabProps:{columns:Object.values(P.b),columnLabels:P.c,hidden:[P.b.STATUS_BALL],tableType:b.a.UNIFI_DEVICE},renderFilterDrawerContent:n.a.createElement(Le,{onChangeUnifiDeviceFilter:c,filters:e,networkFilterData:t,nonNetworkFilterData:a}),filterFooterProps:{label:n.a.createElement(D.b,{id:"COMMON_CONTROL_PANEL_FILTER_FOOTER_RESTORE_DEFAULTS"}),onClick:d,disabled:s},filtersActive:!s,isDisplayOptionsDisabled:o,leftContent:n.a.createElement(Pe,null)},n.a.createElement(ge.a,{onClick:()=>i(Object(Fe.b)(p.b.LIST))},n.a.createElement(B.mb,{size:"original",variant:"fill"})),n.a.createElement(ge.a,{onClick:()=>i(Object(Fe.b)(p.b.GRID))},n.a.createElement(B.jb,{size:"original"})))},xe=a(2936),ye=a(256),Ve=a(2604),Ue=a(22),ke=a(8);t.default=Object(i.o)(({match:{path:e}})=>{const t=Object(r.useSelector)(Ae.b);return Object(Ue.g)([Object(I.fetchUnifiDevices)(void 0,{crudCacheStrategy:{type:ke.a.CACHE}}),Object(ye.c)("unifiDevices")],n.a.createElement(n.a.Fragment,null,n.a.createElement(i.g,null,n.a.createElement(c.a,{path:e+"/:deviceId/ports/:portIds?"},n.a.createElement(xe.a,null)),n.a.createElement(c.a,null,n.a.createElement(we,null),n.a.createElement(Oe,{viewType:t}))),n.a.createElement(i.g,null,n.a.createElement(c.a,{path:e+"(/.*)?/properties/:id?/:panel?/:subPanel?/:subPanelId?"},n.a.createElement(Ve.a,{panelType:E.c.UNIFI_DEVICE})))))})}}]);