(window.webpackJsonpunifiNetworkUi=window.webpackJsonpunifiNetworkUi||[]).push([[4],{2821:function(e,t,a){"use strict";var l=a(0),r=a.n(l),n=a(3),i=a(1671),c=a(5),o=a(34);const s=Object(n.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(n.c)(i.a)`
  bottom: -1px;
`;t.a=({isLoading:e,children:t,...a})=>r.a.createElement(s,Object.assign({},a,{flex:"none",className:"base-control-panel",position:"relative",alignItems:"center",justifyContent:"space-between",height:50}),t,r.a.createElement(d,{isLoading:e,placement:"bottom"}))},2822:function(e,t,a){"use strict";var l=a(0),r=a.n(l),n=a(3),i=a(5),c=a(1),o=a(47),s=a(481),d=a(2821),m=a(2823),E=a(2832),b=a(31),_=a(179);const u=Object(n.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:n,filtersActive:o,title:O,leftContent:p,isDisplayOptionsDisabled:g})=>{const v=(null==e?void 0:e.length)>1,h=!v&&1===e.length;return r.a.createElement(d.a,{isLoading:a},p&&p,v&&r.a.createElement(m.a,{routes:e}),h&&r.a.createElement(u,{weight:"bold"},e[0].label),O&&r.a.createElement(u,{weight:"bold",addMargin:t&&!p},r.a.createElement(c.b,{id:O})),r.a.createElement(i.a,{height:"100%",flex:v||O||h?"none":1,alignItems:"center",justifyContent:"flex-end",marginLeft:"auto"},l,!t&&r.a.createElement(_.a,{condition:g,wrapper:e=>r.a.createElement(s.a,{position:"bottom",width:"208px",portal:!0,message:r.a.createElement(b.p,null,r.a.createElement(c.b,{id:"COMMON_DISPLAY_OPTS_DISABLED"}))},e)},r.a.createElement(E.a,{disabled:g,filterTitleLabel:n,filtersActive:o}))))}},2823:function(e,t,a){"use strict";var l=a(0),r=a.n(l),n=a(3),i=a(25),c=a(807);var o=({items:e,...t})=>{const{params:a,path:l}=Object(i.n)(),n=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,n);return r.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(n.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,...r})=>({id:e,label:t,disabled:"function"==typeof a?a(r):a,path:l})),[e]);return t?r.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 E})),a.d(t,"c",(function(){return b.a}));a(2821);var l=a(2828),r=a(3),n=a(173);var i=Object(r.c)(n.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(r.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=r.a`
  align-items: center;
  display: flex;
  height: 100%;
  width: auto;
  justify-content: flex-end;
  overflow-x: unset;

  > div {
    margin: initial;
  }
`;function E(e){return s.a.createElement(d.a,Object.assign({className:m},e))}a(2823),a(2822);var b=a(2826)},2826:function(e,t,a){"use strict";var l=a(0),r=a.n(l),n=a(3),i=a(1),c=a(47),o=a(2600);const s=Object(n.c)(c.a)`
  line-height: 24px;
  color: ${({theme:e})=>e.motifPalette.text01};
`,d=Object(n.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:n,toggleStyle:c})=>r.a.createElement(d,{toggleStyle:c},r.a.createElement(o.a,{checked:e,id:a,onChange:l,disabled:t},"string"==typeof n?r.a.createElement(s,{size:"body"},r.a.createElement(i.b,{id:n})):n))},2828:function(e,t,a){"use strict";var l=a(0),r=a.n(l),n=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),E=a(3116),b=a(3108),_=a(464),u=a(3059);const O=Object(d.c)(u.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)||[],E=Object(l.useMemo)(()=>Object.values(e).every(e=>m.includes(e)),[m]),b=Object(l.useCallback)(()=>{const t=E||(null==m?void 0:m.length)?[]:Object.values(e);d(Object(c.L)(a,{initialColumns:t},!0))},[d,E,a,m]),_=Object(l.useMemo)(()=>[{full:!0,id:"showAllFields",checked:E||!!(null==m?void 0:m.length)&&"mixed",children:r.a.createElement(n.b,{id:"COMMON_ALL"}),onChange:b}].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])?r.a.createElement(n.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 r.a.createElement(O,{spacing:"flush",items:_,variant:"list"})};const g=Object(d.c)(m.a)`
  width: 258px !important;
`;var v;!function(e){e.COLUMNS="columns",e.FILTERS="filters"}(v||(v={}));var h=({filterTitleLabel:e,isOpen:t,onClose:a,columnTabProps:o,renderFilterDrawerContent:s,footerProps:d,side:m="left"})=>{var u;const[O,h]=Object(l.useState)(v.FILTERS),{tableType:C}=o||{tableType:null},I=Object(i.useDispatch)(),T=(null===(u=Object(i.useSelector)(Object(c.B)(C)))||void 0===u?void 0:u.initialColumns)||[],j=d&&O===v.COLUMNS,f=Object(l.useMemo)(()=>{var e,t;return j&&Object(_.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,T)},[j,C,T]),S=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:[]];I(Object(c.L)(C,{initialColumns:l},!0))},[I,C]),N=Object(l.useCallback)(({id:e})=>h(e),[h]),R=o?r.a.createElement(E.a,{onSelectTab:N,tabs:[{id:v.FILTERS,label:r.a.createElement(n.b,{id:"COMMON_CONTROL_PANEL_FILTERS"}),render:s},{id:v.COLUMNS,label:r.a.createElement(n.b,{id:"COMMON_CONTROL_PANEL_COLUMNS"}),render:()=>r.a.createElement(p,{columns:o.columns,hidden:o.hidden,columnLabels:o.columnLabels,tableType:C})}]}):s(),P=Object(l.useMemo)(()=>j?{label:r.a.createElement(n.b,{id:"COMMON_CONTROL_PANEL_FILTER_FOOTER_RESTORE_COLUMNS"}),onClick:S,disabled:f}:d,[j,d,f,S]),D=Object(l.useCallback)(()=>{a(),h(v.FILTERS)},[a,h]);return r.a.createElement(g,{in:t,renderHeader:()=>null,onClose:a,side:m},t&&r.a.createElement(b.a,{footerProps:P,headerProps:{label:e},onClose:D},R))},C=a(2822);t.a=Object(n.e)(({routes:e=[],hideFilterButton:t=!1,isLoading:a,children:n,filterFooterProps:d,columnTabProps:m,renderFilterDrawerContent:E,filterTitleLabel:b,filtersActive:_,title:u,onClose:O,intl:p,leftContent:g,isDisplayOptionsDisabled:v})=>{var I;const T=Object(i.useDispatch)(),j=Object(i.useSelector)(o),f=(null===(I=Object(i.useSelector)(Object(c.B)(null==m?void 0:m.tableType)))||void 0===I?void 0:I.initialColumns)||[],S=p.formatMessage({id:b||"COMMON_CONTROL_PANEL_FILTER_TITLE"});Object(l.useEffect)(()=>()=>{T(Object(s.b)(!1))},[]);const N=Object(l.useCallback)(()=>{T(Object(s.b)(!1)),null==O||O(),(null==m?void 0:m.tableType)&&T(Object(c.L)(m.tableType,{initialColumns:f}))},[T,O,null==m?void 0:m.tableType,f]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(h,{isOpen:j,filterTitleLabel:S,onClose:N,columnTabProps:m,renderFilterDrawerContent:()=>j&&E,footerProps:d,side:"right"}),r.a.createElement(C.a,{leftContent:g,routes:e,hideFilterButton:t,isLoading:a,filterTitleLabel:S,filtersActive:_,title:u,isDisplayOptionsDisabled:v},n))})},2832:function(e,t,a){"use strict";var l=a(0),r=a.n(l),n=a(3),i=a(4),c=a(3117),o=a(34),s=a(5),d=a(1192);const m=Object(n.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 n=Object(i.useDispatch)();return r.a.createElement(s.a,{height:"100%"},r.a.createElement(m,{disabled:l,title:e,onClick:()=>!l&&n(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),r=a(3);const n=Object(r.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=n},2840:function(e,t,a){"use strict";a.d(t,"a",(function(){return n})),a.d(t,"b",(function(){return i}));const l=/[\p{Z}\p{S}\p{C}]+/u,r=/[\u0300-\u036f]/g;const n=e=>{let t=""+e;return t=function(e){let t=e;return e.normalize&&(t=e.normalize("NFD").replace(r,"")),t}(t).toLowerCase(),t.split(l)},i=(e,t)=>{const a=t.length;for(let l=0;l<a;l+=1){const[a,r]=t[l];if(e.some(e=>e[a]===r))return{id:`${a}::${r}`,label:r}}}},2841:function(e,t,a){"use strict";var l=a(0),r=a.n(l),n=a(3);const i=Object(n.c)("div")`
  width: 100%;
  table:after {
    content: '';
    display: block;
    position: absolute;
    right: -32px;
    width: 32px;
    height: 1px;
  }
`;t.a=({children:e})=>r.a.createElement(i,null,e)},2843:function(e,t,a){"use strict";var l=a(0),r=a.n(l),n=a(3071),i=a(3072),c=a(3094),o=a(3),s=a(4),d=a(1),m=a(2607),E=a(1199),b=a(190),_=a(142),u=a(62),O=a(34),p=a(757),g=a(751);const v=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=()=>r.a.createElement(m.a,null,r.a.createElement("style",null,"\n        .multi-search-fix {\n          z-index: 25;\n        }\n    ")),C=Object(o.c)(n.a)`
  &[aria-selected='true'] {
    background: ${({theme:e})=>e.motifPalette.neutral02};
  }
`,I=Object(o.c)(i.a)`
  &[aria-selected='true'] {
    background: ${({theme:e})=>e.motifPalette.neutral02};
  }
`,T=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 j(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:n,searchIndex:i,enabledColumns:o,records:d,recordIdKey:m})=>{var O;const f=Object(s.useDispatch)(),S=Object(s.useSelector)(u.f),N=Object(s.useSelector)(u.e),R=Object(s.useSelector)(u.b),P=Object(l.useMemo)(()=>Object(_.e)(S,N,R),[R,N,S]),D=`${b.a.PERSIST}:${b.a.NETWORK}.${P||b.a.LOCAL}.${t}`,M=null===(O=null===window||void 0===window?void 0:window.localStorage)||void 0===O?void 0:O.getItem(D),A=Object(s.useSelector)(Object(g.b)(n)),[L,y]=Object(l.useState)(()=>M?JSON.parse(M):a()),[x,w]=Object(l.useState)({value:"",searchResults:[]}),F=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),r=[{id:t,label:a},...l].slice(0,6);y(r),b.b.setItem(D,JSON.stringify(r))};Object(l.useEffect)(()=>{d.forEach(e=>{i.add(e)});const e=new Set(d.map(e=>e[m]));F.current.forEach(t=>!e.has(t)&&i.remove(t)),F.current=e},[m,d,i]);Object(l.useEffect)(()=>{A.length&&A.forEach(e=>{const{fsQuery:t,result:a}=e,l=i.search(t),r=T(l);Object(E.a)(a,r)||f(Object(p.h)({...e,result:r,label:""+t.query,modelName:n}))})},[f,d]);const U=L.map(({id:e,label:t})=>({id:e,label:r.a.createElement(I,{label:t,onRemove:t=>{t.stopPropagation(),(e=>{const t=L.filter(t=>t.id!==e);y(t),b.b.setItem(D,JSON.stringify(t))})(e)}})}));return r.a.createElement(v,null,r.a.createElement(h,null),r.a.createElement(c.a,{dropdownPortalClassName:"multi-search-fix",selectOnEnter:!0,onAddTag:e=>{var t;const a=null===(t=x.searchResults)||void 0===t?void 0:t.find(({id:t})=>t===e);if(x.searchResults.length>0&&a&&(f(Object(p.e)({modelName:n,id:a.id,fsQuery:a.fsQuery,result:a.result,label:a.tag})),V(a),w(e=>({...e,searchResults:[]}))),0===x.searchResults.length&&e){const[t,a]=e.split("::"),l=i.search({query:a,index:"all"===t?o:[t]});f(Object(p.e)({modelName:n,id:e,fsQuery:j(l,a),result:T(l),label:a})),V({id:e,tag:a})}},onChange:(e,t)=>{const a=i.search(t,d.length||100,{index:o,enrich:!0}),l=T(a),c=A.map(({result:e})=>e),s=c.concat(l),b=Object(E.b)(...s),_=[{id:"all::"+t,label:r.a.createElement(C,{label:r.a.createElement(r.a.Fragment,null,t),count:b.size}),fsQuery:j(a,t),tag:""+t,result:l,modelName:n}],u=((e,t,a)=>{const l={},r=e.length;for(let n=0;n<r;n+=1){const{field:r,result:i}=e[n];l[r]=new Set;const c=i.length;for(let e=0;e<c;e+=1)t.has(i[e].doc[a])&&l[r].add(i[e].doc[r])}return l})(a,b,m),O=[];Object.keys(u).forEach(e=>{u[e].forEach(t=>{const a={query:t,index:[e]},l=i.search(a),r=Object(E.b)(...c,new Set(l[0].result));O.push({id:`${e}::${t}`,fsQuery:a,query:t,count:r.size,result:r})})}),O.sort((e,t)=>t.count-e.count),O.slice(0,5).forEach(({query:e,count:t,id:a,result:l,fsQuery:i})=>{_.push({id:a,label:r.a.createElement(C,{label:r.a.createElement(r.a.Fragment,null,e),count:t,className:"test"}),fsQuery:i,tag:""+e,result:new Set(l),modelName:n})}),w(""===t?{value:"",searchResults:[]}:{value:t,searchResults:_})},onClear:()=>{w(e=>({...e,value:""}))},onReset:()=>{w({searchResults:[],value:""}),f(Object(p.g)(n))},onRemoveTag:e=>{f(Object(p.f)(n,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:x.searchResults,searchResultsLabel:e.formatMessage({id:"MULTI_SEARCH_RESULTS"}),tags:A,value:x.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 n})),a.d(t,"b",(function(){return i}));var l=a(398),r=a(194);const n=e=>Object(l.h)({name:r.a.UNIFI_DEVICES,value:e}),i=e=>Object(l.f)({name:r.a.UNIFI_DEVICES,mode:e})},2910:function(e,t,a){"use strict";a.d(t,"a",(function(){return h}));var l=a(0),r=a.n(l),n=a(1),i=a(3),c=a(481),o=a(1154),s=a(851),d=a(985),m=a(47),E=a(48),b=a(104),_=a(32),u=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;
`,v=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 _.g.GATEWAY:case _.g.UXG:{const a=100-+(e["system-stats"]&&e["system-stats"].cpu||0);return r.a.createElement(g,{position:"bottom",portal:!0,className:t,message:r.a.createElement(O,null,r.a.createElement(n.b,{id:"DEVICE_UTILIZATION_INVERTED"}))},r.a.createElement(p,null,r.a.createElement(o.a,{variant:"gradient",value:a})))}case _.g.SWITCH:{if(!i||i<0)return a?r.a.createElement(v,{className:t},r.a.createElement(o.a,{value:0})):r.a.createElement(n.b,{id:"COMMON_NA"});const l=r.a.createElement(s.a,{type:"percent",input:i/100,style:{color:d.a.getGradientColor(i/100)}}),c=r.a.createElement(r.a.Fragment,null,r.a.createElement(p,null,r.a.createElement("div",{style:{flexGrow:1,marginRight:"10px"}},r.a.createElement(m.a,{heading:"primary"},r.a.createElement(n.b,{id:"DEVICE_SWITCH_EXPERIENCE"}))),r.a.createElement("div",null,r.a.createElement(m.a,{heading:"primary"},l))),C&&C.length?r.a.createElement(r.a.Fragment,null,r.a.createElement(m.a,{heading:"primary"},r.a.createElement(n.b,{id:C.length>1?"DEVICE_SWITCH_PORT_PROBLEM_PORTS":"DEVICE_SWITCH_PORT_PROBLEM_PORT"})),C.map(e=>r.a.createElement(p,{key:e.name},r.a.createElement("div",{style:{flexGrow:1}},e.name),r.a.createElement("div",null,r.a.createElement("span",{style:{color:d.a.getGradientColor(e.satisfaction/100)}},e.satisfaction,"%"))))):null,r.a.createElement(u.a,{device:e}));return r.a.createElement(g,{position:"bottom",message:c,portal:!0,className:t},r.a.createElement(p,null,r.a.createElement(o.a,{variant:"gradient",value:i})))}case _.g.AP:{const{averageSatisfaction:e,byRadio:l}=h;if(!e)return a?r.a.createElement(v,{className:t},r.a.createElement(o.a,{value:0})):r.a.createElement(n.b,{id:"COMMON_NA"});if(e<0)return a?r.a.createElement(v,{className:t},r.a.createElement(o.a,{value:0})):r.a.createElement(n.b,{id:"COMMON_NO_CLIENT"});const i=Object.entries(l).reduce((e,[t,a])=>(e.push(r.a.createElement(O,null,r.a.createElement(m.a,{heading:"primary",style:{marginBottom:"8px"}},r.a.createElement(n.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(r.a.createElement(p,{style:{marginBottom:"8px"}},r.a.createElement("div",{style:{flexGrow:1}},t),r.a.createElement("div",null,r.a.createElement("span",{style:a>=0?{color:E.a["color-"+Object(b.c)(a)]}:{}},a>=0?a+"%":"-"))))})}),e),[]);return r.a.createElement(g,{position:"bottom",message:r.a.createElement(r.a.Fragment,null,i),width:192,portal:!0},r.a.createElement(p,null,r.a.createElement(o.a,{value:e,variant:Object(b.c)(e)})))}default:return a?r.a.createElement(v,{className:t},r.a.createElement(o.a,{value:0})):r.a.createElement(n.b,{id:"COMMON_NA"})}},[c,e,t,i,C,a,h])}},2911:function(e,t,a){"use strict";var l=a(0),r=a.n(l),n=a(1),i=a(4),c=a(2757),o=a(173),s=a(495),d=a(85),m=a(20),E=a(5),b=a(123),_=a(757),u=a(751),O=a(625),p=a(2610),g=a(344),v=a(2884);t.a=({hasAnyDeviceSelector:e,searchModelName:t})=>{const a=Object(i.useSelector)(e),l=Object(i.useSelector)(Object(u.b)(t)),h=Object(i.useSelector)(d.selectIsUnifiDevicesPageSupportedController),C=Object(i.useDispatch)(),I=()=>{const e=Object(s.a)(h?g.a:p.a);C(h?Object(v.a)(e):Object(O.a)(e)),C(Object(m.L)(h?b.a.UNIFI_DEVICE:b.a.DEVICE,{filters:e}))},T=()=>{const e=document.querySelector("input[role=combobox]");e&&e.focus(),C(Object(_.g)(t))};return r.a.createElement(E.a,{width:"100%",flexDirection:"column"},r.a.createElement(()=>{switch(!0){case!!l.length:return r.a.createElement(c.a,{icon:"noElements",maxWidth:386,detailPadding:35,title:r.a.createElement(n.b,{id:"COMMON_NO_MATCH"}),details:r.a.createElement(n.b,{id:"DEVICE_EMPTY_SEARCH_NO_DEVICES_DETAILS"}),button:r.a.createElement(o.a,{variant:"primary"},r.a.createElement(n.b,{id:"COMMON_REMOVE_FILTERS"})),onClick:T});case a:return r.a.createElement(c.a,{icon:"noElements",maxWidth:386,detailPadding:35,title:r.a.createElement(n.b,{id:"COMMON_NO_MATCH"}),details:r.a.createElement(n.b,{id:"DEVICE_EMPTY_FILTER_NO_DEVICES_DETAILS"}),button:r.a.createElement(o.a,{variant:"primary"},r.a.createElement(n.b,{id:"COMMON_BUTTON_RESET_DISPLAY_OPTION"})),onClick:I});default:return r.a.createElement(c.a,{icon:"noElements",maxWidth:386,detailPadding:35,title:r.a.createElement(n.b,{id:"DEVICE_EMPTY_HEADER"}),details:r.a.createElement(n.b,{id:"DEVICE_EMPTY_NO_DEVICES_DETAILS"}),button:null})}},null))}},2936:function(e,t,a){"use strict";var l,r,n=a(6),i=a(0),c=a.n(i),o=a(3),s=a(4),d=a(25),m=a(5),E=a(107),b=a(15),_=a(234),u=a(47),O=a(495),p=a(1),g=a(2824),v=a(20),h=a(123),C=a(46),I=a(2833),T=a(108),j=a(118),f=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"}(r||(r={}));const S={[r.GATEWAY]:"UNIFI_DEVICE_FILTER_ELEMENT_GATEWAY",[r.SWITCH]:"UNIFI_DEVICE_FILTER_ELEMENT_SWITCH",[r.ACCESS_POINT]:"UNIFI_DEVICE_FILTER_ELEMENT_ACCESS_POINT",[r.SMART_POWER]:"UNIFI_DEVICE_FILTER_ELEMENT_SMART_POWER",[r.BUILDING_BRIDGE]:"UNIFI_DEVICE_FILTER_ELEMENT_BUILDING_BRIDGE",[r.ULTE]:"UNIFI_DEVICE_FILTER_ELEMENT_ULTE",[r.NON_NETWORK_DEVICES]:"UNIFI_DEVICE_FILTER_ELEMENT_NON_NETWORK_DEVICES"};var N;!function(e){e.POWER="power"}(N||(N={}));const R={[N.POWER]:"UNIFI_DEVICE_FILTER_DESCRIPTION_POWER"};var P=a(194),D=a(285);const M={[l.ELEMENTS]:Object.values(r),[l.DESCRIPTION]:Object.values(N)},A=Object(D.b)(P.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(I.a)(t,a)},[e]),n=Object(i.useCallback)(({target:{checked:a}})=>{const r=Object(O.a)(M[l.ELEMENTS]),n=Object(O.a)(e);n[l.ELEMENTS]=a?r:[],t(n)},[t,e]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(g.c,{checked:a,onChange:n,id:"showAllDevices",text:"COMMON_SHOW_ALL_DEVICES",toggleStyle:{marginTop:28,marginRight:24,marginBottom:16,marginLeft:24}}),c.a.createElement(f.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(r).map(e=>({key:e,id:e,children:c.a.createElement(p.b,{id:S[e]})}))},{id:l.DESCRIPTION,label:c.a.createElement(p.b,{id:"UNIFI_DEVICE_FILTER_HEADER_DESCRIPTION"}),openByDefault:!0,options:Object.values(N).map(t=>({key:t,id:t,children:c.a.createElement(p.a,{id:R[t]}),disabled:!e[l.ELEMENTS].length}))}]}))};var y=a(398);const x=Object(o.c)(u.a)`
  margin-left: 7px;
  line-height: 24px;
  font-weight: bold;
  font-size: 14px;
`;var w=({deviceData:e})=>{const t=Object(s.useDispatch)(),a=Object(s.useSelector)(A),l=Object(i.useCallback)(e=>{var a;t((a=e,Object(y.h)({name:P.a.UNIFI_DEVICES_PORTS,value:a}))),t(Object(v.L)(h.a.UNIFI_DEVICE_PORTS,{filters:e}))},[t]),r=Object(i.useMemo)(()=>Object(I.a)(a,M),[a]),n=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(j.b),columnLabels:j.c,hidden:[j.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:n,disabled:r},filtersActive:!r,leftContent:c.a.createElement(c.a.Fragment,null,c.a.createElement(T.c,{device:e,width:26,height:26}),c.a.createElement(x,null,Object(C.c)(e)))})},F=a(173),V=a(2623),U=a(2869),W=a(10),k=a(57),H=a(89),G=a(206),B=a(641);const z=(e,t)=>t(e),$={[l.ELEMENTS]:{[r.GATEWAY]:e=>z(e,n.isGateway),[r.SWITCH]:e=>z(e,n.isSwitch)&&!z(e,n.isSmartPower),[r.ACCESS_POINT]:e=>z(e,n.isAp)&&!z(e,n.isSmartPower)&&!z(e,n.isUlte),[r.SMART_POWER]:e=>z(e,n.isSmartPower),[r.BUILDING_BRIDGE]:e=>z(e,n.isUBB),[r.ULTE]:e=>z(e,n.isUlte),[r.NON_NETWORK_DEVICES]:(e,t)=>t&&t!==G.d.NETWORK_DEVICES},[l.DESCRIPTION]:{[N.POWER]:e=>{const t=Object(n.getDeviceState)(e);return[n.DeviceState.PENDING,n.DeviceState.ADOPTION_REQUIRED,n.DeviceState.ADOPTION_FAILED,n.DeviceState.FIRMWARE_MISMATCH].some(e=>e===t)}}},Y=(e,t,a)=>{if(!e)return!1;const l=Object(B.b)(t);return!(!Object.values(l).length||!((e,t,a)=>{const l={};return Object.entries(e).forEach(([e,r])=>{var n;l[e]=null===(n=null==r?void 0:r.some)||void 0===n?void 0:n.call(r,l=>{var r,n,i;return null!==(i=null===(n=null===(r=$[e])||void 0===r?void 0:r[l])||void 0===n?void 0:n.call(r,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(T.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,r=l?e.mac:t.id,n=l?Object(C.c)(e):Object(H.getClientName)(t);return c.a.createElement(Q,{onClick:()=>a(e,t)},n.split(" ",2).map((e,t)=>{const a=`DiagramLabel-${r}-${t}`;return c.a.createElement(u.a,{key:a,truncate:!0},e)}))};const ee=Object(o.c)(u.a)`
  color: ${({theme:e})=>e.motifPalette.text03};
  line-height: 16px;
  font-size: 10px;
`;var te=({cellData:e})=>{const t=Object(n.getPortPoeValue)(e);return t&&c.a.createElement(m.a,null,c.a.createElement(ee,null,t))},ae=a(1657),le=a(22),re=({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})),ne=({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:r,isPortsDiagramDisabled:o,isWanPort:d})=>{const m=Object(le.n)(),E=e||{},_=Object(n.getUplinkRemotePort)(Object(s.useSelector)(n.selectDevicesData),t),u=Object(n.getPortIcons)(e,t,Object(s.useSelector)(b.selectNetworkGroups),_),O=Object(n.getExtendedPortColor)(e),p=e&&e.isMediaSfp?re:ne,g=l.includes(e.port_idx),v=Object(i.useMemo)(()=>d(e.port_idx),[e.port_idx]),h=Object(i.useMemo)(()=>d(l[0]),[l[0]]),C=!l.length||v===h,I=(e.masked||o||!C)&&!g;return c.a.createElement(ie,{onClick:()=>!I&&r(e.port_idx,!1),color:O.text,isDisabled:I,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:u})),c.a.createElement(se,{upSideDown:a},Object(n.getPortIndex)(E,!0)))};const me=Object(o.c)("div")`
  width: 64px;
`,Ee=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;
`,be=Object(o.c)(m.a)`
  width: 1px;
  height: 33px;
  background: ${({theme:e})=>e.motifPalette.neutral04};
`;var _e=({cellData:e,deviceData:t,isFirstRow:a,...l})=>{const i=Object(s.useSelector)(n.selectDevicesData),o=Object(s.useSelector)(Object(H.selectClientsByDevice)(t)),d=Object(s.useSelector)(A);if(!e)return Object(n.isUdmBase)(t)||Object(n.isUdr)(t)?null:c.a.createElement(me,null);const{description:m,elements:E}=d,b=e||{},_=Object(n.getPortUplink)(b,t,i)||Object(n.getPortDownlink)(b,t,i),u=o.find(t=>t.sw_port===(null==e?void 0:e.portIdx)),O=null==m?void 0:m.includes(N.POWER),p=Y(_,{elements:E},K.UnifiDeviceType.NETWORK_DEVICES),g=null==E?void 0:E.includes(r.NON_NETWORK_DEVICES);return c.a.createElement(Ee,{isFirstRow:a},c.a.createElement(de,Object.assign({deviceData:t,cellData:e,upSideDown:!a},l)),(p&&_||g&&u)&&c.a.createElement(c.a.Fragment,null,c.a.createElement(be,null),c.a.createElement(J,Object.assign({connectedDevice:p?_:void 0,connectedClient:g?u:void 0,deviceData:t},l)),c.a.createElement(Z,Object.assign({connectedDevice:p?_:void 0,connectedClient:g?u:void 0,deviceData:t},l)),O&&c.a.createElement(te,{cellData:e})))};const ue=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(k.G)(e),l=a.length?Object(k.c)(a,e):Object(k.f)(e);return l&&0!==l.length?c.a.createElement(ue,null,l.map((a,l)=>c.a.createElement(Oe,{key:"PortDiagramLayoutRow-"+(l+1)},a.map((a,r)=>{const n=`PortDiagramLayoutCell-${l+1}-${r+1}`,i=a&&(null==e?void 0:e.port_table)&&Object(k.u)(a.portNumber,e);return c.a.createElement(_e,Object.assign({cellData:i,deviceData:e,key:n,isFirstRow:0===l},t))})))):c.a.createElement(pe,null,c.a.createElement(W.cb,{isActive:!0,className:"mr-2"}),c.a.createElement(p.b,{id:"DEVICE_DIAGRAM_MISSING"}))};const ve=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 Ie=({deviceData:e,closeAllPorts:t,selectedPorts:a,...l})=>{const{ref:r,width:n}=Object(U.a)(),{ref:i,width:o}=Object(U.a)(),s=Math.min((n-98)/o,1);return c.a.createElement("div",{ref:r},c.a.createElement(ve,null,c.a.createElement(he,null,!!a.length&&c.a.createElement(F.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})))},Te=a(734),je=a(61),fe=a(14),Se=a(2768),Ne=a(94),Re=a(7),Pe=a(131),De=a(90),Me=a(496),Ae=a(17),Le=a(1651),ye=a(1599),xe=a(391),we=a(425),Fe=a.n(we),Ve=a(1644),Ue=a(1648),We=a(2591),ke=a(2602),He=a(2592),Ge=a(11),Be=a(208),ze=a(141),$e=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:r,lldpmed_enabled:o,op_mode:d,poe_mode:E,speed:b,stormctrl_enabled:_},setFieldValue:O,setFieldTouched:g,initialValues:v,intl:h,isBatchEdit:C}){var I,T,j;const{port_table:f=[]}=e,{op_mode:S,port_idx:N,port_poe:R}=t,P=e.dot1x_portctrl_enabled,D=1===N,M=Object(n.hasSwitch)(e)||(Object(n.isInWallHd)(e)||Object(n.isUaiw6)(e)||Object(n.isU6EIW)(e))&&(D||P),A=Object(n.isInWallHd)(e),L=Object(n.getIsInWallAp)(e),y=Object(n.isUdm)(e),x=Object(n.isUdr)(e),w=Object(n.isSwitch)(e),F=Object(Ne.u)(e),V=Object(Ne.t)(e),U=Object(Ne.s)(e),k=Object(Ne.x)(e),H=Object(n.getPortPoeAvailability)(t),G=H.isPoePassthroughSupported&&!H.isPoeOffSupported,B="switch"===S&&(R||Object(n.isUaiw6)(e)||Object(n.isU6EIW)(e))&&M,z=Object(s.useDispatch)(),$=Object(i.useMemo)(()=>{var e;try{return null===(e=JSON.parse(b))||void 0===e?void 0:e.speed}catch(t){return null}},[b]),Y=Object(i.useMemo)(()=>Object(et.getSupportedSpeeds)(t).map(({autoneg:e,speed:t=0,full_duplex:a=!1})=>{const{value:l,unit:r}=Object(Ze.d)(1e6*t/8,"bitrate"),n=`${Object(Je.a)(l,1)}${r}`;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:n}}}),[t]),K=Object(i.useMemo)(()=>{var t;if(e){const a="mirror"===S;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,S]),{isAggregateAllowed:X,hasMaxAggregateSessionsReached:q,aggregatePortOptions:J}=Object(i.useMemo)(()=>{var a,l;const r=Object(n.getPortNumbers)(e),i=Object.keys(r).reduce((e,t)=>r[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)(f,t,tt.a.MAX),m=Object(Xe.b)(c,d),E=m[0],b=m[m.length-1]||E;return{isAggregateAllowed:E<=b&&b<=i,hasMaxAggregateSessionsReached:s>=o,aggregatePortOptions:m.map(e=>({label:"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_HYPHEN",value:e,values:{port:e}}))}},[e,t,f]),Q=Object(i.useMemo)(()=>{const{isPoeOffSupported:e,isPoePassthroughSupported:t,isPoePassive24Supported:a,isPoeAutoSupported:l,isPoePlusPlusSupported:r,isPoePlusSupported:n}=H,i=[];if(e&&i.push({label:h.formatMessage({id:"COMMON_DEVICE_POE_MODE_OFF"}),value:De.d.OFF}),t&&i.push({label:h.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSTHROUGH"}),value:De.d.PASSTHROUGH}),!t&&a&&i.push({label:h.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"}),value:De.d.PASSIVE_24V}),!t&&l){const e=[];r?e.push(h.formatMessage({id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS"})):n?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:De.d.AUTO})}return i},[h,H.isPoeOffSupported,H.isPoePassthroughSupported,H.isPoePassive24Supported,H.isPoeAutoSupported,H.isPoePlusPlusSupported,H.isPoePlusSupported]),Z=Object(i.useMemo)(()=>e.port_table.filter(e=>a.includes(e.port_idx)).every(e=>{const t=Object(n.getPortPoeAvailability)(e);switch(E){case De.d.OFF:return t.isPoeOffSupported;case De.d.PASSTHROUGH:return t.isPoePassthroughSupported;case De.d.PASSIVE_24V:return t.isPoePassive24Supported;case De.d.AUTO:return t.isPoeAutoSupported;default:return!0}}),[a.length,E]);return c.a.createElement(c.a.Fragment,null,B&&c.a.createElement(c.a.Fragment,null,c.a.createElement(We.a,null,c.a.createElement(ke.a,{htmlFor:"poe_mode",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_POE_MODE_LABEL"})}),c.a.createElement(He.a,null,G?c.a.createElement(qe.a,null,c.a.createElement(W.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(u.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!==De.d.PASSIVE_24V&&e!==De.d.PASSTHROUGH||z(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===De.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),z(Object(Ke.e)())},onCancel:()=>{O("poe_mode",E),z(Object(Ke.e)())},size:"medium"}))}}))),!Z&&c.a.createElement(We.a,null,c.a.createElement(qe.a,null,c.a.createElement(W.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(u.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NOTICE_POE_NOT_APPLICABLE_TO_ALL_PORTS"}))))),!y&&!L&&c.a.createElement(We.a,null,c.a.createElement(ke.a,{htmlFor:"op_mode",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_OPERATIONS_LABEL"})}),c.a.createElement(He.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(We.a,null,c.a.createElement(ke.a,{htmlFor:"mirror_port_idx",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_MIRRORING_PORT"})}),c.a.createElement(He.a,null,c.a.createElement(Ge.Field,{name:"mirror_port_idx",type:"number",variant:"secondary"}))),"aggregate"===d&&c.a.createElement(We.a,null,c.a.createElement(ke.a,{htmlFor:"aggregatePortStop",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_AGGREGATE_PORTS_LABEL"})}),c.a.createElement(He.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:N}),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(W.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(u.a,{size:"caption"},c.a.createElement(p.a,{id:(null===(I=e.downlink_table)||void 0===I?void 0:I.length)?"DEVICE_PROPERTIES_WARNING_PORT_AGGREGATION_UPLINK":"DEVICE_PROPERTIES_WARNING_PORT_AGGREGATION_DOWNLINK"}))),q&&c.a.createElement(qe.a,null,c.a.createElement(W.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(u.a,{size:"caption"},c.a.createElement(p.a,{id:"DEVICE_PROPERTIES_WARNING_PORT_AGGREGATION_MAX_SESSION_WARNING"}))))),!L&&t.media&&c.a.createElement(We.a,null,c.a.createElement(ke.a,{htmlFor:"speed",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_LINK_SPEED_LABEL"})}),c.a.createElement(He.a,{column:!0,style:{gap:20}},c.a.createElement(Ge.Field,{name:"speed",type:"dropdown",variant:"secondary",full:!0,translateOptions:!0,options:Y}),w&&$===De.c.PORTSPEED_FULL_25G.speed&&c.a.createElement(qe.a,null,c.a.createElement(W.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(u.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_LINK_SPEED_SFP28_ALERT"}))))),F&&"aggregate"!==d&&!A&&c.a.createElement(We.a,null,c.a.createElement(ke.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(He.a,null,c.a.createElement(Ge.Field,{name:"isolation",type:"realCheckbox"},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"})))),"switch"===d&&!L&&!y&&!x&&c.a.createElement(c.a.Fragment,null,c.a.createElement(We.a,null,c.a.createElement(ke.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(He.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,v[e]),g(e,!1)})}},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"})))),_&&c.a.createElement(c.a.Fragment,null,c.a.createElement(We.a,null,c.a.createElement(ke.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(He.a,null,c.a.createElement(Ge.Field,{name:"stormctrl_ucast_rate",type:"number",variant:"secondary",min:De.e.MIN,max:De.e.MAX}))),c.a.createElement(We.a,null,c.a.createElement(ke.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(He.a,null,c.a.createElement(Ge.Field,{name:"stormctrl_mcast_rate",type:"number",variant:"secondary",min:De.e.MIN,max:De.e.MAX}))),c.a.createElement(We.a,null,c.a.createElement(ke.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(He.a,null,c.a.createElement(Ge.Field,{name:"stormctrl_bcast_rate",type:"number",variant:"secondary",min:De.e.MIN,max:De.e.MAX}))))),V&&"switch"===d&&!A&&c.a.createElement(c.a.Fragment,null,c.a.createElement(We.a,null,c.a.createElement(ke.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(He.a,null,c.a.createElement(Ge.Field,{name:"lldpmed_enabled",type:"realCheckbox",afterChange:e=>{O("lldpmed_enabled",e),e||O("lldpmed_notify_enabled",v.lldpmed_notify_enabled)}},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"})))),o&&c.a.createElement(We.a,null,c.a.createElement(ke.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(He.a,null,c.a.createElement(Ge.Field,{name:"lldpmed_notify_enabled",type:"realCheckbox"},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"}))))),k&&"switch"===d&&!A&&c.a.createElement(We.a,null,c.a.createElement(ke.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(He.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(We.a,null,c.a.createElement(ke.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(He.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",v.egress_rate_limit_kbps),g("egress_rate_limit_kbps",!1))}},c.a.createElement(p.b,{id:"COMMON_ACTION_ENABLE"})))),l&&c.a.createElement(We.a,null,c.a.createElement(ke.a,{htmlFor:"egress_rate_limit_kbps",alignWith:"toggle",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_RATE_LIMIT_LABEL"})}),c.a.createElement(He.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===(T=De.b[r])||void 0===T?void 0:T.MIN,max:null===(j=De.b[r])||void 0===j?void 0:j.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),rt=a(26),nt=a(2624),it=a(23);const ct=Object(o.c)(m.a)`
  width: 100%;
`,ot=(e,t,a,l)=>Array.from(e,(e,r)=>({id:"port_security_mac_address-"+r,port_security_mac_address:e,port_security_mac_address_name:Object(nt.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,r=Object(s.useSelector)(n.selectDevicesData),o=Object(s.useSelector)(H.selectCombinedClientsData),d=Object(i.useMemo)(()=>({editActive:!1,port_security_mac_address:ot(l,r,o,t)}),[l,r,o,t]),m=Object(i.useMemo)(()=>ot(l,r,o,t),[l,r,o,t]),E=Object(i.useMemo)(()=>[{name:"new_port_security_mac_address",type:"text"}],[]),b=Object(i.useCallback)(e=>{a("port_security_mac_address",e)},[a]),_=Object(i.useCallback)(({port_security_mac_address:e,new_port_security_mac_address:t})=>{t&&b([...e.map(({port_security_mac_address:e})=>e),t])},[b]),u=Object(i.useCallback)(({port_security_mac_address:t})=>{b(e.port_security_mac_address.filter(e=>e!==t))},[e,b]),O=Object(i.useCallback)(e=>{b([...e.map(({port_security_mac_address:e})=>e)])},[b]);return c.a.createElement(ct,{flexWrap:"wrap"},c.a.createElement(lt.c,{fieldName:"port_security_mac_address",items:m,columns:st,fieldLabels:dt,newFields:E,onAddItem:_,onRemoveItem:u,onEditSubmit:O,initialValues:d,useValuesInSchema:!0,validationSchema:e=>(e=>{const t=()=>it.a.string().label("DEVICE_PORT_FORM_MAC_ADDRESS_LABEL").matches(rt.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 Et=Object(o.c)("li")`
  ${({isGroup:e})=>e?"\n      pointer-events: none;\n      opacity: 0.4;\n    ":"margin-left: 16px;"}
`,bt=Object(o.c)(Ve.a)`
  & > div > span {
    flex: 1;
  }
`,_t=Object(o.c)(Be.a)`
  width: 100%;
  padding: 30px 0 0;
  border-top: none;
  margin-bottom: 125px;
  gap: 10px;
`;const ut=()=>{const e=c.a.createElement(p.b,{id:"DEVICE_VALIDATION_HINT_RANGE",values:{min:De.e.MIN,max:De.e.MAX}});return Re.a.number().when("stormctrl_enabled",{is:!0,then:Re.a.number().label(e).min(De.e.MIN,e).max(De.e.MAX,e).integer(e)})},Ot=Object(fe.f)({enableReinitialize:!0,mapPropsToValues:({currentPort:e,currentPortOverride:t})=>{const{port_idx:a,poe_mode:l,portconf_id:r,stormctrl_bcast_enabled:n=!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:E,lldpmed_notify_enabled:b=!1,speed:_,full_duplex:u,op_mode:O,mirror_port_idx:p,port_security_mac_address:g=[],egress_rate_limit_kbps_enabled:v=!1,egress_rate_limit_kbps:h="",stp_port_mode:C=!0,nameOverride:I="",aggregate_num_ports:T=null}=e;return{name:I,speed:(null==t?void 0:t.speed)&&(null==t?void 0:t.full_duplex)?JSON.stringify({speed:_,full_duplex:u}):JSON.stringify({speed:0,full_duplex:!1}),lldpmed_enabled:!1!==E,stormctrl_enabled:n||c||s,aggregatePortStop:T?a+T-1:null,port_idx:a,poe_mode:l,portconf_id:r,stormctrl_bcast_enabled:n,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:b,full_duplex:u,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:v,stp_port_mode:C}},validationSchema:({activeItem:e})=>{const t=Object(n.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),r=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:De.b[Me.a[e?1:0].value].MIN,max:De.b[Me.a[e?1:0].value].MAX}});return Re.a.object().shape({port_idx:Re.a.number(),name:Re.a.string(),poe_mode:Re.a.string(),portconf_id:Re.a.string(),stormctrl_enabled:Re.a.boolean(),stormctrl_bcast_enabled:Re.a.boolean(),stormctrl_bcast_rate:ut(),stormctrl_mcast_enabled:Re.a.boolean(),stormctrl_mcast_rate:ut(),stormctrl_ucast_enabled:Re.a.boolean(),stormctrl_ucast_rate:ut(),isolation:Re.a.boolean(),full_duplex:Re.a.boolean(),lldpmed_enabled:Re.a.boolean(),lldpmed_notify_enabled:Re.a.boolean(),op_mode:Re.a.string(),mirror_port_idx:Re.a.number().when("op_mode",{is:"mirror",then:Re.a.number().required(r).min(a,r).max(l,r)}),aggregatePortStop:Re.a.number().nullable().when("op_mode",{is:"aggregate",then:Re.a.number().required().label("DEVICE_PORT_FORM_AGGREGATE_PORT_LABEL")}),port_security_mac_address:Re.a.array().of(Re.a.string()),egress_rate_limit_kbps_enabled:Re.a.boolean(),stp_port_mode:Re.a.boolean(),egress_rate_limit_kbps:Re.a.number().when(["egress_rate_limit_unit","egress_rate_limit_kbps_enabled"],{is:(e,t)=>e===Me.a[0].value&&t,then:Re.a.number().required(i()).min(De.b.k.MIN,i()).max(De.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:Re.a.number().required(i(!0)).min(De.b.M.MIN,i(!0)).max(De.b.M.MAX,i(!0))})})},handleSubmit:(e,{props:{updateDeviceWithIdEndpoint:t,activeItem:{_id:a,port_overrides:l=[],mac:r},selectedPorts:i,activeItem:c,currentPort:o,closeAllPorts:s,intl:d,history:m}})=>{var E;const b=d.formatMessage({id:"DEVICE_PROPERTY_HEADER_PORTS"}),_=Object(n.getIsPortConfDisabled)(c,o),{stormctrl_enabled:u,stormctrl_bcast_rate:O,stormctrl_mcast_rate:p,lldpmed_enabled:g,lldpmed_notify_enabled:v,stormctrl_ucast_rate:h,egress_rate_limit_kbps:C,egress_rate_limit_kbps_enabled:I,op_mode:T,mirror_port_idx:j,stp_port_mode:f,aggregatePortStop:S}=e,{speed:N,full_duplex:R}=JSON.parse(e.speed);let P=null;I&&(P=e.egress_rate_limit_unit===Me.a[1].value?1e3*C:C),delete e.egress_rate_limit_unit;const D={...e,speed:N,full_duplex:R,stp_port_mode:f,autoneg:!N,lldpmed_notify_enabled:!!g&&v,stormctrl_bcast_enabled:!!u&&!!O,stormctrl_bcast_rate:u?O:null,stormctrl_mcast_enabled:!!u&&!!p,stormctrl_mcast_rate:u?p:null,stormctrl_ucast_enabled:!!u&&!!h,stormctrl_ucast_rate:u?h:null,egress_rate_limit_kbps:P,mirror_port_idx:"mirror"===T?j.toString():null,aggregate_num_ports:"aggregate"===T?S-o.port_idx+1:null},M=Object(Se.a)(D,(e,t)=>"portconf_id"===t?_:"stormctrl_enabled"===t||("op_mode"===t&&"switch"===e||("lldpmed_enabled"===t?e:("full_duplex"!==t||!D.speed)&&("autoneg"!==t&&("poe_mode"===t&&"mirror"===D.op_mode||("stp_port_mode"===t?!("switch"===D.op_mode&&Object(Ne.x)(c)&&!Object(n.isInWallHd)(c)):"aggregatePortStop"===t||!e))))));M.port_security_enabled=!!(null===(E=M.port_security_mac_address)||void 0===E?void 0:E.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,r,{successToast:{icon:Ae.a.success,message:"DEVICE_PORT_FORM_SAVE_SUCCESS"},failureToast:{icon:Ae.a.danger,message:"DEVICE_NOTICE_SAVE_ERROR",values:{section:b}},mergeAndOverrideKeys:["port_overrides"],extend:!0}).then(()=>{s()})}}),pt={updateDeviceWithIdEndpoint:n.updateDeviceWithIdEndpoint};var gt=Object(je.compose)(Object(s.connect)((e,{activeItem:t,selectedPorts:a})=>({portConfig:Object(Pe.selectPortConf)(e),currentPort:Object(n.getCurrentPortData)(a[0],t),currentPortOverride:Object(n.getCurrentPortOverrideData)(a[0],t)}),pt),p.e,Ot)((function({portConfig:e,activeItem:t,selectedPorts:a,history:l,closeAllPorts:r,currentPort:o,submitForm:m,resetForm:E,setFieldValue:b,setFieldTouched:_,values:O,values:{name:g,op_mode:h,portconf_id:C},intl:I,dirty:T,initialValues:j,setValues:f,disablePortsDiagram:S}){const N=Object(le.n)(),R=Object(n.getIsInWallAp)(t),P=Object(n.getIsSwitchMini)(t),D=Object(n.getIsUapUswHybrid)(t),M=Object(Ne.v)(t),A=Object(n.getHasSwitchFullFeatures)(t,o),L=Object(n.getIsPortConfDisabled)(t,o),y=Object(n.getPortPoeAvailability)(o),x=Object(Xe.f)(y),w=Object(s.useDispatch)(),V=Object(s.useSelector)(ze.b),U=Object(s.useSelector)($e.i),k=Object(s.useSelector)(v.s),H=Object(d.i)(U,{site:V}),G="switch"===h&&M&&!R&&!Object(n.isUdm)(t),[B,z]=Object(i.useState)(""),[$,Y]=Object(i.useState)(!1),[K,X]=Object(i.useState)(!1),q=a.length>1;Object(i.useEffect)(()=>{S("switch"!==O.op_mode)},[O.op_mode,S]);const J=Object(i.useMemo)(()=>{const t=e.map(e=>({...e,groupLabel:Object(n.getPortProfileGroup)(e)})),a=Object(Le.a)(t,"groupLabel");return Object.entries(a).reduce((e,[t,a])=>{const l=a.filter(e=>D?e.attr_hidden_id!==n.SWITCH_PROFILE.ALL_ID:!P||"DEVICE_PROPERTIES_VALUES_SWITCH_PORT_PROFILE_GROUP_CUSTOM"!==e.groupLabel).map(({name:e,_id:t})=>({label:e,value:t}));return"undefined"===t||P&&"DEVICE_PROPERTIES_VALUES_SWITCH_PORT_PROFILE_GROUP_CUSTOM"===t?(e.push(...l),e):(e.push({groupLabel:I.formatMessage({id:t}),items:l}),e)},[])},[I,e,D]),Q=Object(i.useMemo)(()=>Object(ye.a)(J.map(({groupLabel:e,items:t})=>[{isGroup:!0,label:e,value:e},...t])),[J]),Z=(ee=t,Object(n.isAp)(ee)?"DEVICE_TYPE_ACCESS_POINT":Object(n.isUdm)(ee)?"DEVICE_TYPE_GATEWAY":"DEVICE_TYPE_SWITCH");var ee;const te=Object(i.useCallback)((t,l)=>{const r=x.includes(De.d.AUTO)?De.d.AUTO:De.d.OFF,i=null==e?void 0:e.find(e=>e._id===t),s=Object(n.getIsNoEditPortProfile)(i),d=(null==o?void 0:o.portconf_id)===(null==i?void 0:i._id),{speed:m=0,full_duplex:_=0}=i,u={lldpmed_enabled:!0,stormctrl_enabled:!1,aggregatePortStop:null,poe_mode:r,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={...u,...null==e?void 0:e.find(e=>e._id===(null==o?void 0:o.portconf_id))},v=(null==p?void 0:p.speed)&&(null==p?void 0:p.full_duplex)?{speed:m,full_duplex:_}:{speed:0,full_duplex:!1},h=["name","speed"],C=Object.keys(O).filter(e=>e in p&&!h.includes(e));try{const e=!Fe()(Object(xe.a)(p,C),Object(xe.a)(O,C))||!Fe()(v,JSON.parse(O.speed));X(e)}catch(S){X(!0)}d?(E(),b("name",g)):f(s&&!d?{...O,portconf_id:null==i?void 0:i._id,speed:JSON.stringify({speed:0,full_duplex:!1}),...u}:{...O,speed:(null==i?void 0:i.speed)&&(null==i?void 0:i.full_duplex)?JSON.stringify({speed:m,full_duplex:_}):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 T=(null==i?void 0:i.poe_mode)||r;z(T);const j=x.includes(T);Y(j),j?T===De.d.PASSIVE_24V||T===De.d.PASSTHROUGH?w(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,T===De.d.PASSIVE_24V?I.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"}):T)},title:"DEVICE_ACTIONS_SWITCH_PORT_POE_MODE_CONFIRM_TITLE",useFormattedMessage:!0,onConfirm:()=>{b("poe_mode",T),w(Object(Ke.e)()),l()},onCancel:()=>{b("poe_mode",null==o?void 0:o.poe_mode),w(Object(Ke.e)())},size:"medium"})):(b("poe_mode",T),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:r=!1,label:n,value:i}})=>c.a.createElement(Et,{key:`${e}-${n}`,id:e,onClick:e=>{te(i,()=>t(e))},className:a,"aria-selected":l,role:"option",isGroup:r},n),disabled:L}),[te,A,L,Q]);return Object(le.g)([Object(Pe.fetchPortConf)()],c.a.createElement(c.a.Fragment,null,c.a.createElement(Ue.a,{padding:"none"},c.a.createElement(bt,{title:c.a.createElement(p.b,{id:"DEVICE_PROPERTIES_PORTS_LABEL",values:((e,t)=>"aggregate"===e.op_mode?{ports:Object(n.getPortIndex)(e),total:e.aggregate_num_ports}:{ports:t.join(", "),total:t.length})(o,a)}),hideUnderline:!0}),q&&c.a.createElement(We.a,null,c.a.createElement(qe.a,null,c.a.createElement(W.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(u.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NOTICE_PORT_BATCH_EDIT",values:{portIdx:a[0]}})))),!q&&c.a.createElement(We.a,null,c.a.createElement(ke.a,{htmlFor:"name",alignWith:"input",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NAME_LABEL"})}),c.a.createElement(He.a,null,c.a.createElement(Ge.Field,{name:"name",type:"text",variant:"secondary"}))),c.a.createElement(We.a,null,c.a.createElement(ke.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(He.a,{column:!0,style:{gap:"12px"}},ae,c.a.createElement(F.a,{size:"small",type:"button",variant:"inline",onClick:()=>l.push(H+"/settings/profiles")},c.a.createElement(W.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(We.a,null,c.a.createElement(qe.a,null,c.a.createElement(W.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(u.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NOTICE_OVERRIDE_RESET"})))),!!o.portconf_id&&C!==o.portconf_id&&!$&&o.port_poe&&K&&c.a.createElement(We.a,null,c.a.createElement(qe.a,null,c.a.createElement(W.a,{size:"original",color:N.motifPalette.warning,variant:"fill"}),c.a.createElement(u.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,[B].map(e=>{switch(e){case De.d.PASSIVE_24V:return I.formatMessage({id:"COMMON_DEVICE_POE_MODE_PASSIVE"});case De.d.AUTO:return I.formatMessage({id:"COMMON_DEVICE_POE_MODE_AUTO"});default:return e}}).join())}})))),L&&c.a.createElement(We.a,null,c.a.createElement(qe.a,null,c.a.createElement(W.cb,{isActive:!0,size:"original",variant:"fill"}),c.a.createElement(u.a,{size:"caption"},c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_NOTICE_PORT_CONF_DISABLED"})))),!q&&o.poe_enable&&c.a.createElement(We.a,null,c.a.createElement(ke.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(He.a,null,c.a.createElement(F.a,{size:"small",type:"button",variant:"inline",onClick:()=>{w(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:()=>{w(Object(n.powerCyclePort)(t,o.port_idx)),w(Object(Ke.e)())}}))},disabled:k},c.a.createElement(W.Sb,{height:20,width:20,style:{padding:"2px"}}),c.a.createElement(p.b,{id:"DEVICE_ACTIONS_PORT_POWER_CYCLE"})))),G&&c.a.createElement(We.a,null,c.a.createElement(ke.a,{htmlFor:"macFilter",alignWith:"dropdown",label:c.a.createElement(p.b,{id:"DEVICE_PORT_FORM_MAC_ADDRESS_FILTER_LABEL"})}),c.a.createElement(He.a,null,c.a.createElement(mt,{setFieldValue:b,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:j,setFieldValue:b,setFieldTouched:_,portData:o,activeItem:t,formValues:O,selectedPorts:a,isBatchEdit:q})),c.a.createElement(_t,{isDirty:T||q,onFormSubmit:()=>{q?w(Object(Ye.a)({title:"DEVICE_ACTIONS_SWITCH_BATCH_SAVE_CONFIRMATION_TITLE",message:"DEVICE_ACTIONS_SWITCH_BATCH_SAVE_CONFIRMATION_MESSAGE",onConfirm:()=>{m(),w(Object(Ke.e)())}})):m()},onFormCancel:()=>{E(),r()},allowCancel:!0})))}));const vt=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 r=Object(d.k)(),n=Object(i.useMemo)(()=>a(t[0]),[t[0]]);return c.a.createElement("div",null,c.a.createElement(vt,null,n?c.a.createElement(Te.a,{activeItem:e,history:r,isFullPage:!0}):c.a.createElement(gt,Object.assign({activeItem:e,selectedPorts:t,history:r},l))))},Ct=a(2628);const It=Object(o.c)(m.a)`
  padding: 24px;
  border: 1px solid ${({theme:e})=>e.motifPalette.neutral03};
  border-radius: 12px;
`;var Tt=({deviceData:e,...t})=>{const{initialColumns:a=[]}=Object(s.useSelector)(Object(v.B)(h.a.UNIFI_DEVICE_PORTS)),l=Object(i.useMemo)(()=>{const e=[...a];return e.includes(j.b.PORT_SYMBOL)||e.unshift(j.b.PORT_SYMBOL),e},[a]);return c.a.createElement("div",null,c.a.createElement(It,{flexDirection:"column"},c.a.createElement(Ct.a,Object.assign({deviceData:e,columnOverride:l,fullData:!0},t))))};const jt=Object(o.c)(m.a)`
  overflow: hidden;
`,ft=Object(o.c)(m.a)`
  padding: 24px 2px 24px 24px;
  gap: 24px;
  overflow-x: hidden;
  overflow-y: scroll;
`,St=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:r}=Object(d.m)(),o=Object(s.useSelector)(e=>Object(n.selectDeviceData)(e,l)),m=Object(s.useSelector)(b.selectNetworkGroups),[u,O]=Object(i.useState)(!1),p=Object(i.useMemo)(()=>/^[0-9,]+$/.test(r)?r.split(",").map(e=>Number(e)).filter(e=>!!e):[],[r]),g=Object(i.useCallback)((r,n=!1)=>{const{path:i}=e;let c=[...p];n?c=c.includes(r)?[]:[r]:c.includes(r)?c=c.filter(e=>e!==r):c.push(r),t.push(Object(d.i)(i,{site:a,deviceId:l,portIds:c.join(",")||void 0})),c.length||O(!1)},[a,l,p]),v=Object(i.useCallback)(()=>{const{path:r}=e;t.push(Object(d.i)(r,{site:a,deviceId:l,portIds:void 0})),O(!1)},[a,l,p]),h=Object(i.useCallback)((e,r)=>{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:r.mac,panel:E.a.OVERVIEW}))},[a,l,p]),C=Object(i.useCallback)(e=>{var t;if(!Object(n.isUdm)(o))return!1;const a=Object(n.getCurrentPortData)(e,o),l=Object(_.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(jt,{flexDirection:"column"},c.a.createElement(St,null,c.a.createElement(w,{deviceData:o})),c.a.createElement(ft,{flexDirection:"column"},c.a.createElement(Ie,{deviceData:o,selectedPorts:p,onPropertiesOpen:h,onPortOpen:g,closeAllPorts:v,isPortsDiagramDisabled:u,isWanPort:C}),p.length?c.a.createElement(ht,{deviceData:o,selectedPorts:p,closeAllPorts:v,disablePortsDiagram:O,isWanPort:C}):c.a.createElement(Tt,{deviceData:o,onPortOpen:g})))})},3105:function(e,t,a){"use strict";a.r(t);var l=a(0),r=a.n(l),n=a(4),i=a(25),c=a(2604),o=a(362),s=a(92),d=a(2936),m=a(10),E=a(495),b=a(1),_=a(952),u=a(20),O=a(2824),p=a(2833),g=a(194),v=a(123),h=a(751),C=a(1192),I=a(2610),T=a(625),j=a(6),f=a(2839),S=a(235),N=a(665);var R=({onChangeDeviceFilter:e})=>{const t=Object(n.useSelector)(I.b),a=Object(n.useSelector)(j.memoSelectFilterDeviceData),i=(e,t)=>{var l;return null===(l=(a||[]).map(a=>Object(N.b)({[e]:[t]},a)).filter(e=>e.every(Boolean)))||void 0===l?void 0:l.length},c=Object(l.useMemo)(()=>Object(p.a)(t,I.a),[t]),o=Object(l.useCallback)(({target:{checked:t}})=>{const a=t?Object(E.a)(I.a):{};e(a)},[e]);return r.a.createElement(r.a.Fragment,null,r.a.createElement(O.c,{checked:c,onChange:o,id:"showAllDevices",text:"COMMON_SHOW_ALL_DEVICES",toggleStyle:{marginTop:28,marginRight:24,marginBottom:16,marginLeft:24}}),r.a.createElement(f.a,{onChange:(t,a)=>e(a),selectedIds:t,multiOpen:!0,items:[{id:S.c.ELEMENTS,openByDefault:!0,label:r.a.createElement(b.b,{id:"DEVICE_HEADER_ELEMENTS"}),options:Object.values(S.a).map(e=>({key:e,id:e,children:r.a.createElement(b.b,{id:"DEVICE_FILTER_ELEMENT_"+e.toUpperCase()}),labelProps:{count:i(S.c.ELEMENTS,e)}}))},{id:S.c.STATUS,label:r.a.createElement(b.b,{id:"DEVICE_HEADER_STATUS"}),options:Object.values(S.b).map(e=>({key:e,id:e,children:r.a.createElement(b.a,{id:"DEVICE_FILTER_STATUS_"+e.toUpperCase()}),labelProps:{count:i(S.c.STATUS,e)}}))}]}))},P=a(2850),D=a(2843),M=a(190),A=a(2840),L=a(2620);const y=["mac","search_type","search_status","search_name","search_model_name","search_ip","search_connection","search_network","search_experience"],x=new P.Document({tokenize:"reverse",cache:500,encode:A.a,document:{store:y,id:"mac",index:y}});var w=Object(b.e)(({intl:e})=>{const t=Object(n.useSelector)(Object(L.b)(e));return r.a.createElement(D.a,{lsKey:M.a.DEVICES_SEARCH_HISTORY,getInitialSuggestions:()=>((e,t)=>[Object(A.b)(e,[["search_type",t.formatMessage({id:"DEVICE_FILTER_ELEMENT_ACCESS_POINT"})],["search_type",t.formatMessage({id:"DEVICE_FILTER_ELEMENT_GATEWAY"})],["search_type",t.formatMessage({id:"DEVICE_FILTER_ELEMENT_SWITCH"})]]),Object(A.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(A.b)(e,[["search_connection",t.formatMessage({id:"COMMON_WORD_WIRED"})]])].filter(e=>e))(t,e),searchModelName:"devices",searchIndex:x,enabledColumns:y,recordIdKey:"mac",records:t})});var F=Object(b.e)(()=>{const e=Object(n.useSelector)(I.b),t=Object(n.useDispatch)(),a=Object(l.useMemo)(()=>Object(p.a)(e,I.a),[e]),i=!!Object(n.useSelector)(Object(h.b)("devices")).length,c=Object(l.useCallback)(e=>{t(Object(T.a)(e)),t(Object(u.L)(v.a.DEVICE,{filters:e}))},[t]),o=Object(l.useCallback)(()=>{c(Object(E.a)(I.a))},[c]);return Object(l.useEffect)(()=>{i&&t(Object(C.b)(!1))},[t,i]),r.a.createElement(O.b,{isLoading:!1,title:"DEVICE_HEADER_DEVICES",renderFilterDrawerContent:r.a.createElement(R,{onChangeDeviceFilter:c}),columnTabProps:{columns:Object.values(_.b),columnLabels:_.c,hidden:[_.b.STATUS_BALL],tableType:v.a.DEVICE},filterFooterProps:{label:r.a.createElement(b.b,{id:"COMMON_CONTROL_PANEL_FILTER_FOOTER_RESTORE_DEFAULTS"}),onClick:o,disabled:a},isDisplayOptionsDisabled:i,filtersActive:!a,leftContent:r.a.createElement(w,null)},r.a.createElement(O.a,{onClick:()=>t(Object(T.b)(g.b.LIST))},r.a.createElement(m.mb,{size:"original",variant:"fill"})),r.a.createElement(O.a,{onClick:()=>t(Object(T.b)(g.b.GRID))},r.a.createElement(m.jb,{size:"original"})))}),V=a(3),U=a(1670),W=a(2762),k=a(5),H=a(2841),G=a(851),B=a(47),z=a(481),$=a(66),Y=a(423),K=a(42),X=a(31),q=a(88),J=a(753),Q=a(884),Z=a(1107),ee=a(1590),te=a(1014),ae=a(714),le=a(1106),re=a(60);const ne=Object(V.c)(G.a)`
  color: ${({theme:e})=>e.colors.primary};
`,ie=Object(V.c)("div")`
  white-space: nowrap;
`,ce=({device:e,children:t,ignoreHide:a=!1,ignoreOpacity:l=!1})=>!a&&Object(q.j)(e)?null:r.a.createElement(X.f,{width:"100%",opacity:l||e.deviceState!==j.DeviceState.DISCONNECTED?1:.5},t),oe=({showUnifiCareBadge:e})=>[{id:_.b.STATUS_BALL,label:null,growthFactor:1,renderCell:({status:e,statusPulse:t})=>r.a.createElement(Q.a,{status:e,statusPulse:t,marginLeft:5,marginRight:12}),compare:K.v},{id:_.b.TYPE,sortable:!0,minWidth:65,maxWidth:65,label:r.a.createElement(X.f,null,r.a.createElement(b.b,{id:_.c[_.b.TYPE]})),renderCell:t=>r.a.createElement(q.f,{device:t,showUnifiCareBadge:e}),compare:K.v},{id:_.b.DEVICE_NAME,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.DEVICE_NAME]}),renderCell:e=>r.a.createElement(ce,{device:e,ignoreHide:!0},r.a.createElement(q.a,{device:e})),compare:Object(K.b)(({name:e})=>e)},{id:_.b.STATUS,sortable:!0,minWidth:200,label:r.a.createElement(b.b,{id:_.c[_.b.STATUS]}),omitHideCellOverflow:q.j,renderCell:e=>r.a.createElement(ce,{device:e,ignoreHide:!0},r.a.createElement(q.e,{device:e},r.a.createElement(q.d,{device:e}))),compare:K.v},{id:_.b.MAC_ADDRESS,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.MAC_ADDRESS]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},e.mac)),compare:Object(K.b)(({mac:e})=>e)},{id:_.b.MODEL,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.MODEL]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},null==e?void 0:e.modelName,Object(j.isU6)(e)&&r.a.createElement(q.h,{size:"small",isActive:!0}))),compare:K.q},{id:_.b.IP_ADDRESS,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.IP_ADDRESS]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},Object(j.getDeviceIp)(e))),compare:K.n},{id:_.b.CONNECTION,minWidth:180,sortable:!0,label:r.a.createElement(b.b,{id:_.c[_.b.CONNECTION]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},"wired"===(null==e?void 0:e.connection)?r.a.createElement(b.b,{id:"COMMON_WORD_WIRED"}):"-"===(null==e?void 0:e.connection)?r.a.createElement(b.b,{id:"COMMON_HYPHEN"}):null==e?void 0:e.connection)),compare:Object(K.b)((e,t,a)=>{const{connection:l}=e;return Object(q.j)(e)?Object(re.c)(a):"-"===l?Object(re.d)(a):l})},{id:_.b.NETWORK,minWidth:180,sortable:!0,label:r.a.createElement(b.b,{id:_.c[_.b.NETWORK]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},(()=>{var t,a;switch(null===(t=null==e?void 0:e.uplink)||void 0===t?void 0:t.type){case"wire":return(null==e?void 0:e.connection_network_name)||r.a.createElement(b.b,{id:"COMMON_HYPHEN"});case"wireless":return(null===(a=null==e?void 0:e.uplink)||void 0===a?void 0:a.essid)||r.a.createElement(b.b,{id:"COMMON_HYPHEN"});default:return r.a.createElement(b.b,{id:"COMMON_HYPHEN"})}})())),compare:Object(K.b)((e,t,a)=>{var l,r,n;return Object(q.j)(e)?Object(re.c)(a):"wire"===(null===(l=null==e?void 0:e.uplink)||void 0===l?void 0:l.type)||(null==e?void 0:e.is_wired)?(null==e?void 0:e.connection_network_name)||(null==e?void 0:e.network_name)||Object(re.d)(a):"wireless"!==(null===(r=null==e?void 0:e.uplink)||void 0===r?void 0:r.type)&&(null==e?void 0:e.is_wired)?Object(re.d)(a):(null==e?void 0:e.essid)||(null===(n=null==e?void 0:e.uplink)||void 0===n?void 0:n.essid)||Object(re.d)(a)})},{id:_.b.EXPERIENCE,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.EXPERIENCE]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(Z.a,{device:e})),compare:Object(K.b)((e,t,a)=>Object(K.e)(e,a))},{id:_.b.FIRMWARE_STATUS,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.FIRMWARE_STATUS]}),renderCell:e=>Object(j.getDeviceState)(e)===j.DeviceState.UPGRADING?r.a.createElement(B.a,{color:"inherit",size:"body"},r.a.createElement(b.b,{id:"COMMON_DEVICE_STATE_UPGRADING"})):r.a.createElement(ce,{device:e},e.upgradable?r.a.createElement(le.a,{device:e,label:"COMMON_CLICK_TO_UPDATE"}):r.a.createElement(B.a,{color:"inherit",size:"body"},r.a.createElement(b.b,{id:"COMMON_UP_TO_DATE"}))),compare:Object(K.b)((e,t,a)=>Object(q.j)(e)?Object(re.b)(a):((null==e?void 0:e.firmware_status)||(null==e?void 0:e.upgradable)||Object(re.e)(a),null==e?void 0:e.upgradable))},{id:_.b.FIRMWARE_VERSION,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.FIRMWARE_VERSION]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},(null==e?void 0:e.displayable_version)||r.a.createElement(b.b,{id:"COMMON_UP_TO_DATE"}))),compare:K.m},{id:_.b.UPLINK_PORT,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.UPLINK_PORT]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(q.g,{device:e})),compare:K.z},{id:_.b.MEMORY_USAGE,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.MEMORY_USAGE]}),renderCell:e=>{const t=Object(j.getDeviceMemoryUsage)(e);return r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},t?t+"%":r.a.createElement(b.b,{id:"COMMON_HYPHEN"})))},compare:K.p},{id:_.b.CPU_USAGE,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.CPU_USAGE]}),renderCell:e=>{var t;return r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},(null===(t=null==e?void 0:e["system-stats"])||void 0===t?void 0:t.cpu)?e["system-stats"].cpu+"%":r.a.createElement(b.b,{id:"COMMON_HYPHEN"})))},compare:K.k},{id:_.b.LOAD_AVERAGE,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.LOAD_AVERAGE]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(ie,null,r.a.createElement(B.a,{color:"inherit",size:"body"},e.loadAvg||r.a.createElement(b.b,{id:"COMMON_HYPHEN"})))),compare:K.o},{id:_.b.UTILIZATION,minWidth:180,sortable:!0,label:r.a.createElement(b.b,{id:_.c[_.b.UTILIZATION]}),renderCell:e=>r.a.createElement(ce,{device:e},Object(ee.a)(e)),compare:Object(K.b)((e,t,a)=>{var l;return Object(q.j)(e)?Object(re.b)(a):(null==e?void 0:e.portsUtilization)||0!==(null===(l=null==e?void 0:e.radio_table_stats)||void 0===l?void 0:l.length)?(null==e?void 0:e.portsUtilization)?Object(K.f)(e):Object(K.d)(e):Object(re.e)(a)})},{id:_.b.CLIENTS,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.CLIENTS]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},null==e?void 0:e.num_sta)),compare:Object(K.b)((e,t,a)=>Object(q.j)(e)?Object(re.b)(a):null==e?void 0:e.num_sta)},{id:_.b.DAILY_USAGE,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.DAILY_USAGE]}),renderCell:e=>{var t,a;const l=((null===(t=null==e?void 0:e.deviceUsageReport)||void 0===t?void 0:t.tx_bytes)||0)+((null===(a=null==e?void 0:e.deviceUsageReport)||void 0===a?void 0:a.rx_bytes)||0);return r.a.createElement(ce,{device:e},l>0?r.a.createElement(G.a,{size:"body",type:"bytes",input:l}):r.a.createElement(b.b,{id:"COMMON_HYPHEN"}))},compare:Object(K.b)((e,t,a)=>{var l,r;if(Object(q.j)(e))return Object(re.b)(a);const n=((null===(l=null==e?void 0:e.deviceUsageReport)||void 0===l?void 0:l.tx_bytes)||0)+((null===(r=null==e?void 0:e.deviceUsageReport)||void 0===r?void 0:r.rx_bytes)||0);return n>0?n:Object(re.e)(a)})},{id:_.b.LAST_SEEN,sortable:!0,minWidth:150,label:r.a.createElement(b.b,{id:_.c[_.b.LAST_SEEN]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},(null==e?void 0:e.last_seen)?r.a.createElement(J.a,{date:Object(Y.b)(e.last_seen)}):r.a.createElement(b.b,{id:"COMMON_HYPHEN"}))),compare:Object(K.b)((e,t,a)=>Object(q.j)(e)?Object(re.b)(a):(null==e?void 0:e.last_seen)?null==e?void 0:e.last_seen:Object(re.e)(a))},{id:_.b.DOWNLINK,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.DOWNLINK]}),renderCell:e=>{var t;return r.a.createElement(ce,{device:e,ignoreOpacity:!0},r.a.createElement(ie,null,r.a.createElement(X.q,{bytes:(null===(t=null==e?void 0:e.uplink)||void 0===t?void 0:t["rx_bytes-r"])||0,direction:"down",size:"body",iconStyle:{width:"10px",height:"16px",margin:"0 16px 2px 0"},pow:2})))},compare:Object(K.b)((e,t,a)=>{const{uplink:l}=e;return Object(q.j)(e)?Object(re.b)(a):(null==l?void 0:l["rx_bytes-r"])?null==l?void 0:l["rx_bytes-r"]:Object(re.e)(a)})},{id:_.b.UPLINK,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.UPLINK]}),renderCell:e=>{var t;return r.a.createElement(ce,{device:e,ignoreOpacity:!0},r.a.createElement(ie,null,r.a.createElement(X.q,{bytes:(null===(t=null==e?void 0:e.uplink)||void 0===t?void 0:t["tx_bytes-r"])||0,direction:"up",size:"body",iconStyle:{width:"10px",height:"16px",margin:"0 16px 2px 0"},pow:2})))},compare:Object(K.b)((e,t,a)=>{const{uplink:l}=e;return Object(q.j)(e)?Object(re.b)(a):(null==l?void 0:l["tx_bytes-r"])?null==l?void 0:l["tx_bytes-r"]:Object(re.e)(a)})},{id:_.b.UPTIME,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.UPTIME]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(ie,null,r.a.createElement(B.a,{color:"inherit",size:"body"},(null==e?void 0:e.uptime)?Object(Y.a)(e.uptime):r.a.createElement(b.b,{id:"COMMON_HYPHEN"})))),compare:Object(K.b)((e,t,a)=>Object(q.j)(e)?Object(re.b)(a):(null==e?void 0:e.uptime)?null==e?void 0:e.uptime:Object(re.e)(a))},{id:_.b.WLAN2G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.WLAN2G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},(null==e?void 0:e.wlan2g)||r.a.createElement(b.b,{id:"COMMON_HYPHEN"}))),compare:Object(K.b)((e,t,a)=>Object(q.j)(e)?Object(re.c)(a):(null==e?void 0:e.wlan2g)?null==e?void 0:e.wlan2g:Object(re.d)(a))},{id:_.b.WLAN5G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.WLAN5G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},(null==e?void 0:e.wlan5g)||r.a.createElement(b.b,{id:"COMMON_HYPHEN"}))),compare:Object(K.b)((e,t,a)=>Object(q.j)(e)?Object(re.c)(a):(null==e?void 0:e.wlan5g)?null==e?void 0:e.wlan5g:Object(re.d)(a))},{id:_.b.WLAN6G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.WLAN6G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},(null==e?void 0:e.wlan6g)||r.a.createElement(b.b,{id:"COMMON_HYPHEN"}))),compare:Object(K.b)((e,t,a)=>Object(q.j)(e)?Object(re.c)(a):(null==e?void 0:e.wlan6g)?null==e?void 0:e.wlan6g:Object(re.d)(a))},{id:_.b.RADIO2G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.RADIO2G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},r.a.createElement(q.b,{device:e,radio:$.b.RADIO_NG}))),compare:(e,t,a,l)=>Object(K.r)(a,l,$.b.RADIO_NG)},{id:_.b.RADIO5G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.RADIO5G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},r.a.createElement(q.b,{device:e,radio:$.b.RADIO_NA}))),compare:(e,t,a,l)=>Object(K.r)(a,l,$.b.RADIO_NA)},{id:_.b.RADIO6G,sortable:!0,minWidth:185,label:r.a.createElement(b.a,{id:_.c[_.b.RADIO6G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},r.a.createElement(q.b,{device:e,radio:$.b.RADIO_6E}))),compare:(e,t,a,l)=>Object(K.r)(a,l,$.b.RADIO_6E)},{id:_.b.CLIENTS2G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.CLIENTS2G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},r.a.createElement(q.c,{radioTableStats:e.radio_table_stats,radio:$.b.RADIO_NG}))),compare:K.h},{id:_.b.CLIENTS5G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.CLIENTS5G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},r.a.createElement(q.c,{radioTableStats:e.radio_table_stats,radio:$.b.RADIO_NA}))),compare:K.i},{id:_.b.CLIENTS6G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.CLIENTS6G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},r.a.createElement(q.c,{radioTableStats:e.radio_table_stats,radio:$.b.RADIO_6E}))),compare:K.j},{id:_.b.BSSID,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.BSSID]}),renderCell:e=>r.a.createElement(ce,{device:e},(()=>{if(null==e?void 0:e.bssid){const t=r.a.createElement(r.a.Fragment,null,((null==e?void 0:e.vap_table)||[]).slice(0,16).map(e=>r.a.createElement("div",{key:e.bssid},e.bssid)),((null==e?void 0:e.vap_table)||[]).length>16&&r.a.createElement("div",null,"..."));return r.a.createElement(z.a,{message:t},r.a.createElement(B.a,{color:"inherit",size:"body"},(null==e?void 0:e.bssid)+"..."||r.a.createElement(b.b,{id:"COMMON_HYPHEN"})))}return r.a.createElement(b.b,{id:"COMMON_HYPHEN"})})()),compare:Object(K.b)((e,t,a)=>{var l;if(Object(q.j)(e))return Object(re.c)(a);const{vap_table:r}=e;return(null==r?void 0:r.length)&&(null===(l=null==r?void 0:r[0])||void 0===l?void 0:l.bssid)?r[0].bssid:Object(re.d)(a)})},{id:_.b.TX,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.TX]}),renderCell:e=>r.a.createElement(ce,{device:e},(null==e?void 0:e["tx_bytes-d"])?r.a.createElement(ie,null,r.a.createElement(m.fb,null),r.a.createElement(G.a,{size:"body",type:"bytes",input:e["tx_bytes-d"],color:"success"})):r.a.createElement(b.b,{id:"COMMON_HYPHEN"})),compare:Object(K.b)((e,t,a)=>Object(q.j)(e)?Object(re.b)(a):(null==e?void 0:e["tx_bytes-d"])||Object(re.e)(a))},{id:_.b.RX,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.RX]}),renderCell:e=>r.a.createElement(ce,{device:e},(null==e?void 0:e["rx_bytes-d"])?r.a.createElement(ie,null,r.a.createElement(m.gb,null),r.a.createElement(ne,{size:"body",type:"bytes",input:e["rx_bytes-d"]})):r.a.createElement(b.b,{id:"COMMON_HYPHEN"})),compare:Object(K.b)((e,t,a)=>Object(q.j)(e)?Object(re.b)(a):(null==e?void 0:e["rx_bytes-d"])||Object(re.e)(a))},{id:_.b.TX2G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.TX2G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(te.a,{device:e,radioType:$.b.RADIO_NG})),compare:K.w},{id:_.b.TX5G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.TX5G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(te.a,{device:e,radioType:$.b.RADIO_NA})),compare:K.x},{id:_.b.TX6G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.TX6G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(te.a,{device:e,radioType:$.b.RADIO_6E})),compare:K.y},{id:_.b.CHANNEL,sortable:!0,minWidth:180,label:r.a.createElement(b.b,{id:_.c[_.b.CHANNEL]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(B.a,{color:"inherit",size:"body"},Object(j.getDeviceRadioChannels)(e)||r.a.createElement(b.b,{id:"COMMON_HYPHEN"}))),compare:K.g},{id:_.b.CHANNEL2G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.CHANNEL2G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(ae.a,{device:e,radioType:$.b.RADIO_NG})),compare:K.A},{id:_.b.CHANNEL5G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.CHANNEL5G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(ae.a,{device:e,radioType:$.b.RADIO_NA})),compare:K.B},{id:_.b.CHANNEL6G,sortable:!0,minWidth:180,label:r.a.createElement(b.a,{id:_.c[_.b.CHANNEL6G]}),renderCell:e=>r.a.createElement(ce,{device:e},r.a.createElement(ae.a,{device:e,radioType:$.b.RADIO_6E})),compare:K.C}];var se=a(236),de=a(285),me=a(76),Ee=a(22),be=a(146),_e=a(2851),ue=a(107),Oe=a(108),pe=a(737),ge=a(46),ve=a(2910),he=a(1108);const Ce=Object(V.c)(X.f)`
  height: 120px;
  background: ${({theme:e})=>e.motifPalette.disabled01};

  > picture {
    width: calc(100% - 10px) !important;
    height: 110px;
    text-align: center;
  }
`,Ie=Object(V.c)(Oe.c)`
  max-width: 100%;
  max-height: 100%;
`,Te=Object(V.c)(X.f)`
  width: 100%;
  height: 100%;
  ${({theme:{spacing:e}})=>`padding: ${e["spacing-l"]} 0 ${e["spacing-s"]}`};
`,je=Object(V.c)(X.f)`
  > div:nth-child(2) {
    max-width: 90%;

    > span:first-child {
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
`,fe=Object(V.c)(B.a)`
  height: 18px;
`,Se=Object(V.c)(pe.a)`
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
`,Ne=Object(V.c)(m.Rc)`
  position: absolute;
  top: 7px;
  right: 7px;
`,Re=Object(V.c)(B.a)`
  max-width: 165px;
`,Pe=Object(V.c)(X.f)`
  svg {
    color: ${({theme:e})=>e.motifPalette.icon02};
  }
`,De=({device:e})=>{const{portsUtilization:t}=e,{speed:a=0}=Object(j.getUplinkAttrs)(e)||{},l={style:{marginRight:"4px"}},n=Object(j.isSwitch)(e),i=r.a.createElement(he.a,{device:e,hideBar:!0}),c=Object(j.isDeviceWireless)(e),o=c?r.a.createElement(m.Tc,Object.assign({},l,{height:20,width:20})):r.a.createElement(X.f,{alignItems:"center",height:20},r.a.createElement(m.I,Object.assign({},l,{height:14,width:14})),r.a.createElement(B.a,{color:"tertiary",size:"caption"},r.a.createElement(b.b,{id:a>=1e3?"COMMON_PORT_SPEED_GBE":"COMMON_PORT_SPEED_MBE"})));return n?r.a.createElement(z.a,{message:i,position:"bottom",portal:!0,width:192},r.a.createElement(X.f,{alignItems:"center",height:20},r.a.createElement(m.I,Object.assign({},l,{height:14,width:14})),r.a.createElement(B.a,{color:"tertiary",size:"caption"},""+t.totalActivePorts,"/",""+t.total))):c?o:r.a.createElement(X.f,{alignItems:"center",height:20},r.a.createElement(m.v,Object.assign({},l)),r.a.createElement(B.a,{color:"tertiary",size:"caption"},(null==e?void 0:e.num_sta)||0))};var Me=e=>e.map(e=>{const{status:t,statusPulse:a,uplink:l}=e;return{id:e._id,image:r.a.createElement(Ce,{justifyContent:"center",alignItems:"center",width:"100%"},Object(j.isU6)(e)&&r.a.createElement(Ne,{isActive:!0,size:"large"}),r.a.createElement(Ie,{device:e,filesMap:"GRID",width:"auto"})),children:r.a.createElement(Te,{flexDirection:"column",justifyContent:"center"},r.a.createElement(je,{justifyContent:"center",alignItems:"center"},r.a.createElement(Q.a,{status:t,statusPulse:a,marginRight:6}),r.a.createElement(Re,{truncate:!0},Object(ge.c)(e))),r.a.createElement(fe,{centered:!0,color:"tertiary",size:"caption"},Object(j.getDeviceIp)(e)||""),Object(j.isDeviceWireless)(e)||Object(j.isAp)(e)?r.a.createElement(X.f,{margin:"8px 0"},r.a.createElement(ve.a,{device:e,alwaysShowStatusBar:!0})):r.a.createElement(X.f,{height:26}),r.a.createElement(Pe,{justifyContent:"space-between",width:"100%",alignItems:"center"},r.a.createElement(X.f,{alignItems:"center"},r.a.createElement(De,{device:e})),r.a.createElement(X.f,{alignItems:"center"},r.a.createElement(X.q,{bytes:(null==l?void 0:l["rx_bytes-r"])||0,direction:"down",pow:2}),r.a.createElement(X.q,{bytes:(null==l?void 0:l["tx_bytes-r"])||0,direction:"up",iconStyle:{marginLeft:"8px"},pow:2}))),Object(j.hasActiveUnifiCare)(e)&&r.a.createElement(Se,{width:32,height:32}))}}),Ae=a(2911);const Le=Object(V.c)(k.a)`
  table {
    .rowDisabledClassName {
      pointer-events: initial;
    }
  }
`;var ye=({devicesTableData:e})=>{const t=Object(n.useDispatch)(),{site:a}=Object(i.m)(),c=Object(i.k)(),o=Object(l.useMemo)(()=>Object(de.c)(g.a.DEVICES),[]),d=Object(n.useSelector)(o)!==g.b.GRID,{sortBy:m,isAscending:E,initialColumns:b}=Object(n.useSelector)(Object(u.B)(se.a.DEVICE)),O=Object(n.useSelector)(L.a),p=e&&e.length>0,v=Object(l.useMemo)(()=>p&&e.some(e=>Object(j.hasActiveUnifiCare)(e)),[p,e]),h=Object(l.useCallback)(e=>{const{mac:l}=e,r=Object(i.i)("/:site/devices/:section?/:id?/:panel?/:subPanel?",{id:l,section:"properties",site:a,panel:ue.a.OVERVIEW});c.push(r),t(Object(me.g)({type:s.c.DEVICE,mac:l}))},[t,c,a]),C=Object(l.useCallback)(({id:e},a)=>{t(Object(u.L)(se.a.DEVICE,{sortBy:e,isAscending:a}))},[t]),I=[...b];return I.length&&!I.includes(_.b.STATUS_BALL)&&I.unshift(_.b.STATUS_BALL),Object(Ee.g)([Object(be.fetchDeviceDailyUsageReport)(O)],r.a.createElement(r.a.Fragment,null,p&&(null==b?void 0:b.length)?r.a.createElement(Le,{height:"100%",padding:"32px",overflow:"auto"},d?r.a.createElement(H.a,null,r.a.createElement(U.a,{items:e,columns:oe({showUnifiCareBadge:v}),onRowClick:h,onSort:C,rowHeight:32,initialSortBy:m,initiallySortAscending:E,columnOverride:I,divideTableByKey:"pendingAdoption",disableBlankRowDivide:!0,disableColumnFilters:!0,rowDisabledClassName:"rowDisabledClassName",headerRowClassName:_e.a})):r.a.createElement(q.i,null,r.a.createElement(W.a,{gutterSize:16,tileSize:"medium",selectType:"none",onTileClick:(t,a,l)=>h(e[l]),items:Me(e)}))):r.a.createElement(Ae.a,{hasAnyDeviceSelector:j.selectHasAnyDevice,searchModelName:"devices"})))},xe=a(35);function we(e){const{devicesTableData:t,history:a,location:r,match:i}=e,c=t.find(e=>e.mac===i.params.id),o=Object(n.useDispatch)(),s=()=>{a.push(r.pathname.split("/device-upgrade")[0]),o(Object(xe.e)())},d=Object(l.useMemo)(()=>c&&Object(j.isDeviceDowngradable)(c),[null==c?void 0:c.version,null==c?void 0:c.upgrade_to_firmware]);return Object(l.useEffect)(()=>((null==c?void 0:c.upgrade_to_firmware)?o(Object(j.confirmDeviceUpgrade)({titleValues:{deviceName:Object(ge.c)(c)},messageValues:{deviceName:Object(ge.c)(c),fromVersion:null==c?void 0:c.version,toVersion:null==c?void 0:c.upgrade_to_firmware},onConfirm:()=>{o(Object(j.upgradeDevice)(c,d))},onCancel:()=>{s()},isDowngrade:d})):s(),()=>{s()}),[]),null}t.default=Object(i.o)(({match:{path:e}})=>{const t=Object(n.useSelector)(L.c);return r.a.createElement(r.a.Fragment,null,r.a.createElement(i.g,null,r.a.createElement(o.a,{path:e+"/:deviceId/ports/:portIds?"},r.a.createElement(d.a,null)),r.a.createElement(o.a,null,r.a.createElement(F,null),r.a.createElement(ye,{devicesTableData:t}))),r.a.createElement(i.g,null,r.a.createElement(o.a,{path:"/:site/devices/device-upgrade/:id/",render:e=>r.a.createElement(we,Object.assign({devicesTableData:t},e))}),r.a.createElement(o.a,{path:"/:site/devices/properties/:id?/:panel?/:subPanel?/:subPanelId?"},r.a.createElement(c.a,{panelType:s.c.DEVICE}))))})}}]);