"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[41129],{94411(e,t,n){n.d(t,{A:()=>u});var o=n(602086),i=n(977872),a=n(396489),r=n.n(a),l=n(570801),s=n(54013),d=n(332530),c=n(158402),m=n(722837);const h=Object.keys(m.l).reduce((e,t)=>(e[t]=!1,e),{}),u=e=>((e=>{const t=(0,i.wA)(),n=(0,i.d4)(l.Bm);(0,o.useEffect)(()=>{if(!h[e]){h[e]=!0;const o=d.W2[s.xz.TABLES][e],i=n[e]||{},a=o?.initialColumnSnapshot;if(a){const n={...i?.initialColumnSnapshot},o=[...i.initialColumns||[]];if(Object.keys(n).length)Object.entries(a).forEach(([e,t])=>{e in n||(n[e]=t)}),Object.entries(n).forEach(([e,t])=>{!o.includes(e)&&t&&o.push(e)}),r()(o,i.initialColumns)||t((0,c.yT)(e,{initialColumns:Array.from(new Set([...o,...i.initialColumns])),initialColumnSnapshot:n}));else if(o.length){const n=o.reduce((e,t)=>(e[t]=!0,e),{});t((0,c.yT)(e,{initialColumnSnapshot:n,initialColumns:Object.keys(n)}))}}}},[t,e,n])})(e),(0,i.d4)((0,o.useMemo)(()=>(0,l.h)(e),[e])))},752104(e,t,n){n.d(t,{A:()=>i,Q:()=>a});var o=n(765567);const i="_",a=[o.ZM,o.Je]},635496(e,t,n){var o;n.d(t,{M:()=>o}),function(e){e.MAIN="main",e.DHCP="dhcp",e.HOTSPOT="hotspot"}(o||(o={}))},535322(e,t,n){n.d(t,{A:()=>g,I:()=>o});var o,i=n(274934),a=n(814557),r=n(158885),l=n(247816),s=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(o||(o={}));const h=(0,l.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${s.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${s.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${d.Ln}`:d.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||d.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>a.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,l.A)(r.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${s.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${s.S.LIGHT}`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||a.Ay[t===s.S.DARK?`desktop-color-neutral-01-${s.S.DARK}`:`desktop-color-neutral-00-${s.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,g=({type:e,marginBottom:t,margin:n,padding:a,flex:r,width:l,nested:s,...d})=>"items"in d?(0,i.jsx)(u,{marginBottom:t,margin:n,padding:a,flex:r,nested:s,...d}):(0,i.jsx)(h,{nested:s,width:l,marginBottom:t,margin:n,padding:a,flex:r,isButtonList:e===o.BUTTON_LIST,...d,children:d.children})},90479(e,t,n){n.d(t,{A:()=>d});var o=n(274934),i=n(309130),a=n(100978),r=n(831433),l=n(421314),s=n(650632);const d=({defaultName:e="",client:t=null,width:n=25,height:d=25,alt:c})=>(0,o.jsxs)(a.A,{alignItems:"center",gap:i.kc,children:[(0,o.jsx)(s.A,{client:t,width:n,height:d,alt:c}),(0,o.jsx)(l.A,{variant:"inherit",children:(0,r.tn)(t)||e})]})},199742(e,t,n){n.d(t,{A:()=>d});var o=n(274934),i=n(602086),a=n(558948),r=n(309130),l=n(100978),s=n(535322);const d=({actions:e})=>(0,o.jsx)(s.A,{marginBottom:"none",children:(0,o.jsx)(l.A,{flexDirection:"column",gap:r.kc,width:"100%",children:e.filter(Boolean).map((e,t,n)=>(0,o.jsxs)(i.Fragment,{children:[e,t<n.length-1?(0,o.jsx)(l.A,{width:"100%",flexDirection:"column",paddingTop:r.YC,paddingBottom:r.YC,children:(0,o.jsx)(a.A,{orientation:"horizontal"})}):null]},[t,e.toString()].join()))})})},589252(e,t,n){n.d(t,{A:()=>s});var o=n(274934),i=n(977872),a=n(897166),r=n(633144),l=n(100978);const s=({allowReadOnly:e,...t})=>{const n=(0,i.d4)(a.EL)&&!e;return(0,o.jsx)(l.A,{alignItems:"center",children:(0,o.jsx)(r.A,{size:"medium",type:"button",...t,disabled:n||t.isDisabled})})}},241129(e,t,n){n.r(t),n.d(t,{default:()=>E});var o=n(274934),i=n(602086),a=n(977872),r=n(244081),l=n(101134),s=n(589252),d=n(199742),c=n(104997),m=n(635496),h=n(470070),u=n(302318),g=n(239627),p=n(745454),A=n(792929),x=n(594005),b=n(810024),C=n(722837),f=n(449339),w=n(421314),j=n(579875),$=n(90479),v=n(535322),S=n(205521),k=n(869332),L=n(831433),N=n(34118);const T=[{id:"name",growthFactor:1,sortable:!0,label:(0,o.jsx)(h.sA,{id:"COMMON_CLIENT"}),renderCell:e=>(0,o.jsx)($.A,{client:e}),compare:(0,x.l0)(e=>(0,L.tn)(e))},{id:"ip",growthFactor:1,sortable:!0,label:(0,o.jsx)(h.sA,{id:"COMMON_IP_ADDRESS"}),renderCell:({ip:e})=>(0,o.jsx)(w.A,{children:e||(0,o.jsx)(h.sA,{id:"COMMON_FALLBACK"})}),compare:(0,x.l0)(({ip:e})=>e&&(0,p.isValidIpv4)(e)?(0,b.GQ)(e):0)}],O=[{value:20,default:!0}],I=(0,i.memo)(({wlanConfiguration:e})=>{const t=(0,a.wA)(),n=(0,a.d4)((0,N.pO)(e.name||"")),[r,l]=(0,i.useState)(0),s=(0,i.useCallback)(e=>{e!==r&&l(e)},[r]),d=(0,i.useCallback)(()=>l(0),[]),c=(0,i.useCallback)(e=>{t((0,S.XP)({type:f.H.CLIENT,id:e.id})),t((0,k.AS)())},[t]),m=(0,i.useCallback)(({from:e,rowsPerPage:t})=>(0,o.jsx)(A.A,{items:n,onRowClick:c,disableColumnFilters:!0,idField:"id",initialSortBy:"ip",columns:T,rowLimit:t,rowOffset:e,truncateHeaderCells:!0}),[n,c]);return n.length?(0,o.jsx)(v.A,{children:(0,o.jsx)(j.A,{wrapperFlexProps:{padding:"0",overflowX:"hidden",overflowY:"scroll"},tableType:C.l.WIFI_CLIENTS,itemCount:n.length,onRenderTable:m,onPageChanged:s,onRowsChanged:d,pageNumber:r,rowOptions:O})}):null}),E=({activeItem:e})=>{const t=(0,a.wA)(),n=(0,l.A)(`${c.VO.CLIENTS}/${m.M.MAIN}`);return(0,i.useEffect)(()=>{t((0,g.$3)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}))},[t]),(0,o.jsxs)(o.Fragment,{children:[e?(0,o.jsx)(I,{wlanConfiguration:e}):null,(0,o.jsx)(d.A,{actions:[(0,o.jsx)(s.A,{allowReadOnly:!0,to:n,onClick:()=>{t((0,u.$N)(e?.name?[e.name]:[]))},children:(0,o.jsx)(h.sA,{id:"COMMON_VIEW_IN_CLIENTS_TABLE"})})]})]})}},579875(e,t,n){n.d(t,{A:()=>x});var o=n(274934),i=n(602086),a=n(977872),r=n(938984),l=n(237887),s=n(309130),d=n(100978),c=n(470070),m=n(94411),h=n(158402),u=n(584779),g=n(310758);const p=(0,n(247816).A)("div")`
  overflow: auto;
  width: 100%;
  height: 100%;
`,A=({onRenderTable:e,itemCount:t,section:n="COMMON_RECORDS",rowOptions:A,onRowsChanged:x,onPageChanged:b,onOffsetChanged:C,tableType:f,pageNumber:w,paginationFlexProps:j={},paginationDropdownProps:$={},unknownCount:v=!1,paginationTableContainerClassName:S})=>{const k=(0,a.wA)(),L=(0,i.useMemo)(()=>A||g.o,[A]),N=(0,i.useMemo)(()=>L.map(({value:e})=>({label:String(e),value:e})),[L]),T=(0,m.A)(f),O=(0,i.useMemo)(()=>Number(T?.rowsPerPage&&N.some(({value:e})=>Number(e)===T.rowsPerPage)?T.rowsPerPage:L.find(e=>e?.default)?.value||L?.[0]?.value),[T,N,L]),I=(0,i.useMemo)(()=>Math.max(g.B,w||g.B),[w]),E=(0,i.useCallback)(e=>{b?.(e)},[b]),M=(0,i.useCallback)(()=>{E(I-1)},[I,E]),R=(0,i.useCallback)(()=>{E(I+1)},[I,E]),y=(0,i.useCallback)(({value:e})=>{const t=Number(e);k((0,h.yT)(f,{rowsPerPage:t})),x?.(t)},[k,x,f]),D=(0,i.useMemo)(()=>{let e=I*O;return e>t&&(e=t-O,E(Math.ceil(Math.ceil(e)/O))),e},[E,I,O,t]),B=(0,i.useMemo)(()=>{let e=D+O;return e>=t&&(e=t),e},[D,O,t]),P=(0,i.useMemo)(()=>{const e={pageNumber:w,from:D,rowsPerPage:O};return C?.(e),e},[w,D,O,C]),F=(0,i.useMemo)(()=>I===g.B,[I]),H=(0,i.useMemo)(()=>B>=t,[B,t]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p,{className:S,children:e(P)}),(0,o.jsx)(d.A,{justifyContent:"space-between",...j,children:void 0!==D&&void 0!==B&&void 0!==t?(0,o.jsxs)(d.A,{alignItems:"center",children:[(0,o.jsxs)(d.A,{children:[(0,o.jsx)(u.A,{disabled:F,onClick:M}),(0,o.jsx)(u.A,{disabled:H,rotate:!0,onClick:R})]}),(0,o.jsx)(d.A,{marginLeft:s.kc,marginRight:s.S2,children:(0,o.jsx)(r.A,{size:"small",color:"text-2",children:(0,o.jsx)(c.sA,{id:"PAGINATION_FROM_TO",values:{from:D+1,to:B,total:`${t}${v?"+":""}`,section:(0,o.jsx)(c.sA,{id:n})}})})}),N.length>1?(0,o.jsxs)(d.A,{alignItems:"center",children:[(0,o.jsx)(d.A,{marginRight:s.kc,children:(0,o.jsx)(r.A,{size:"small",color:"text-2",children:(0,o.jsx)(c.sA,{id:"PAGINATION_ROWS_PER_PAGE"})})}),(0,o.jsx)("div",{style:{width:"75px"},children:(0,o.jsx)(l.A.Sorted,{value:O,options:N,onChange:y,variant:"secondary",direction:"top",width:"100%",portal:!0,...$})})]}):null]}):null})]})},x=({itemCount:e,rowOptions:t,onRenderTable:n,wrapperFlexProps:a,paginationTableContainerClassName:r,keepPaginationWhileLoading:l=!1,...c})=>{const m=(0,i.useMemo)(()=>e>Math.min(...(t||g.o).map(({value:e})=>e)),[e,t]);return(0,o.jsx)(d.A,{padding:s.Ln,gap:s.Ln,width:"100%",height:"100%",flexDirection:"column",overflow:"hidden",...a,children:l||m?(0,o.jsx)(A,{itemCount:e,rowOptions:t,onRenderTable:n,wrapperFlexProps:a,paginationTableContainerClassName:r,...c}):(0,o.jsx)(p,{className:r,children:n({pageNumber:0,from:0,rowsPerPage:e})})})}},584779(e,t,n){n.d(t,{A:()=>u});var o,i=n(274934),a=n(599110),r=n(247816),l=n(565527);!function(e){e.DEFAULT="default",e.HOVER="hover",e.DISABLED="disabled",e.ACTIVE="active"}(o||(o={}));const s={[o.DEFAULT]:{[l.S.LIGHT]:"#d6d9e2",[l.S.DARK]:"#3f3f3f"},[o.HOVER]:{[l.S.LIGHT]:"#7e8190",[l.S.DARK]:"#9d9d9d"},[o.DISABLED]:{[l.S.LIGHT]:"#eeeff3",[l.S.DARK]:"#1e1e1e"},[o.ACTIVE]:{[l.S.LIGHT]:"#a4a7b5",[l.S.DARK]:"#2f2f2f"}},d=(e,t)=>s[t][e],c=(e,t)=>`1px 0px 0px 0px ${d(e,t)}`;var m=n(291508);const h=(0,r.A)(a.A,(0,m.A)("rotate"))`
  margin: 0;
  padding: 0;
  width: 26px;
  height: 24px;
  color: inherit;
  background-color: transparent;
  box-sizing: border-box;
  border-radius: 4px 0 0 4px;
  border-right: 0;
  border-color: transparent;
  border-color: ${({theme:{themeName:e}})=>`${d(e,o.DEFAULT)}`};
  box-shadow: ${({theme:{themeName:e}})=>`${c(e,o.DEFAULT)}`};
  ${({rotate:e=!1})=>e?"\n    transform: rotate(-180deg);\n  ":"\n  position: relative; \n  left: -1px;\n  margin-left: 1px;\n    "}
  > span {
    display: flex;
    align-items: center;
    justify-content: center;
    > div {
      display: flex;
    }
  }
  &:disabled {
    z-index: 0;
    box-shadow: ${({theme:{themeName:e}})=>`${c(e,o.DISABLED)} !important`};
    border-color: ${({theme:{themeName:e}})=>`${d(e,o.DISABLED)} !important`};
  }
  &:hover {
    z-index: 1;
    box-shadow: ${({theme:{themeName:e}})=>`${c(e,o.HOVER)} !important`};
    border-color: ${({theme:{themeName:e}})=>`${d(e,o.HOVER)} !important`};
    border-right: 0;
    background-color: transparent !important;
  }
  &:active {
    box-shadow: ${({theme:{themeName:e}})=>`${c(e,o.ACTIVE)} !important`};
    border-color: ${({theme:{themeName:e}})=>`${d(e,o.ACTIVE)} !important`};
  }
`,u=({disabled:e,onClick:t,rotate:n})=>(0,i.jsx)(h,{variant:"secondary",rotate:n,disabled:e,onClick:t,type:"button",children:(0,i.jsx)("svg",{width:"4",height:"8",viewBox:"0 0 4 8",fill:"none",children:(0,i.jsx)("path",{d:"M3.75026 0.999386C3.75026 1.11739 3.70826 1.23639 3.62426 1.33138L1.25026 3.99939L1.27026 4.02039L3.62326 6.66739C3.80726 6.87339 3.78826 7.18939 3.58226 7.37339C3.37626 7.55739 3.06026 7.53839 2.87626 7.33239L0.530256 4.69439C0.156256 4.30739 0.156256 3.69139 0.530256 3.30439L2.87526 0.667385C3.05826 0.461386 3.37526 0.442385 3.58126 0.626385C3.69326 0.724385 3.75026 0.861386 3.75026 0.999386Z",fill:"#A4A7B5"})})})},696049(e,t,n){n.d(t,{H:()=>o});const o=""},237887(e,t,n){n.d(t,{A:()=>h});var o=n(274934),i=n(602086),a=n(977872),r=n(693371),l=n(767822),s=n(820633),d=n(308111);const c=e=>(0,o.jsx)(r.A,{renderOption:l.q,...e}),m=e=>(0,o.jsx)(c,{...e});m.Sorted=e=>{const t=(0,a.d4)(s.zi),n=(0,i.useMemo)(()=>(0,d.k)(t),[t]);return(0,o.jsx)(c,{...e,sortBy:n})};const h=m},308111(e,t,n){n.d(t,{R:()=>m,k:()=>h});var o=n(696049),i=n(350068),a=n(177173),r=n(752104),l=n(64222),s=n(332530);const d=[...new Set([o.H,r.Q.join(r.A),a.Zt,l.F,i.nc,s.Vr])],c={numeric:!0,sensitivity:"base"},m=(e,t)=>{const n=[];for(let o=e;o<=t;o+=1)n.push({value:o,label:String(o)});return n},h=e=>({value:t,label:n},{value:o,label:i})=>d.includes(t?.toString())||d.includes(o?.toString())?1/0:n?.toString().localeCompare(i?.toString(),e,c)??-1}}]);