"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[42798],{945185(e,t,n){n.d(t,{fw:()=>c,GB:()=>m,q_:()=>h});var o=n(571766),i=n(29472),a=n(774366),r=n(290454);const s=`${r.w}/active-leases`,l=`${r.w}/vendor-ids`,d=`${r.w}/dhcp-import`,c=(e,t={},n={})=>(0,i.Kd)("dhcpLeases",(e=>e?`${s}/${e}`:s)(e),e,t,n),m=(e={},t={})=>(0,i.t9)("vendorIds",l,e,{idField:e=>e,...t}),h=e=>(0,i.vB)(o.aC,null,null,a.A.POST,d,{},e)},562054(e,t,n){n.d(t,{T:()=>s,o:()=>l});var o=n(222102),i=n(656466),a=n(401042),r=n(945185);const s=e=>(0,o.Mz)((0,i.uh)((0,r.fw)(e)),a.i6),l=(0,o.Mz)((0,i.uh)((0,r.GB)()),a.kh)},94411(e,t,n){n.d(t,{A:()=>u});var o=n(602086),i=n(977872),a=n(396489),r=n.n(a),s=n(570801),l=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)(s.Bm);(0,o.useEffect)(()=>{if(!h[e]){h[e]=!0;const o=d.W2[l.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,s.h)(e),[e])))},959330(e,t,n){n.d(t,{I:()=>i,s:()=>o});const o=25,i=5},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:()=>p,I:()=>o});var o,i=n(274934),a=n(814557),r=n(158885),s=n(247816),l=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,s.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===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.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,s.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===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.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===l.S.DARK?`desktop-color-neutral-01-${l.S.DARK}`:`desktop-color-neutral-00-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,p=({type:e,marginBottom:t,margin:n,padding:a,flex:r,width:s,nested:l,...d})=>"items"in d?(0,i.jsx)(u,{marginBottom:t,margin:n,padding:a,flex:r,nested:l,...d}):(0,i.jsx)(h,{nested:l,width:s,marginBottom:t,margin:n,padding:a,flex:r,isButtonList:e===o.BUTTON_LIST,...d,children:d.children})},199742(e,t,n){n.d(t,{A:()=>d});var o=n(274934),i=n(602086),a=n(558948),r=n(309130),s=n(100978),l=n(535322);const d=({actions:e})=>(0,o.jsx)(l.A,{marginBottom:"none",children:(0,o.jsx)(s.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)(s.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:()=>l});var o=n(274934),i=n(977872),a=n(897166),r=n(633144),s=n(100978);const l=({allowReadOnly:e,...t})=>{const n=(0,i.d4)(a.EL)&&!e;return(0,o.jsx)(s.A,{alignItems:"center",children:(0,o.jsx)(r.A,{size:"medium",type:"button",...t,disabled:n||t.isDisabled})})}},242798(e,t,n){n.r(t),n.d(t,{default:()=>R});var o=n(274934),i=n(977872),a=n(602086),r=n(101134),s=n(589252),l=n(199742),d=n(104997),c=n(635496),m=n(470070),h=n(486159),u=n(945185),p=n(745454),g=n(792929),x=n(594005),A=n(810024),b=n(722837),f=n(449339),C=n(309130),w=n(421314),j=n(579875),v=n(100978),$=n(974390),k=n(650632),S=n(535322),T=n(205521),L=n(959330),N=n(562054),O=n(831433);const I=[{id:"name",growthFactor:1,sortable:!0,label:(0,o.jsx)(m.sA,{id:"COMMON_CLIENT"}),renderCell:e=>(0,o.jsxs)(v.A,{alignItems:"center",gap:C.kc,children:["model"in e?(0,o.jsx)($.A,{width:L.s,height:L.s,model:e.model}):(0,o.jsx)(k.A,{width:L.s,height:L.s,client:e}),(0,o.jsx)(w.A,{variant:"inherit",children:(0,O.tn)(e)||e.mac})]}),compare:(0,x.l0)(e=>(0,O.tn)(e))},{id:"ip",growthFactor:1,sortable:!0,label:(0,o.jsx)(m.sA,{id:"COMMON_IP_ADDRESS"}),renderCell:({ip:e})=>(0,o.jsx)(w.A,{children:e||(0,o.jsx)(m.sA,{id:"COMMON_FALLBACK"})}),compare:(0,x.l0)(({ip:e})=>e&&(0,p.isValidIpv4)(e)?(0,A.GQ)(e):0)}],M=[{value:20,default:!0}],B=({network:e})=>{const t=(0,i.wA)(),n=(0,i.d4)((0,N.T)(e._id)),r=(0,a.useMemo)(()=>n?.dhcp_lease_info||[],[n]),[s,l]=(0,a.useState)(0),d=(0,a.useCallback)(e=>{e!==s&&l(e)},[s]),c=(0,a.useCallback)(()=>l(0),[]),m=(0,a.useCallback)(e=>t((0,T.XP)({type:f.H.CLIENT,id:e.mac})),[t]),h=(0,a.useCallback)(({from:e,rowsPerPage:t})=>(0,o.jsx)(g.A,{items:r,onRowClick:m,disableColumnFilters:!0,idField:"mac",initialSortBy:"ip",columns:I,rowLimit:t,rowOffset:e,truncateHeaderCells:!0}),[r,m]);return r.length?(0,o.jsx)(S.A,{children:(0,o.jsx)(j.A,{wrapperFlexProps:{padding:"0",overflowX:"hidden",overflowY:"scroll"},tableType:b.l.NETWORK_CLIENTS,itemCount:r.length,onRenderTable:h,onPageChanged:d,onRowsChanged:c,pageNumber:s,rowOptions:M})}):null},R=({activeItem:e})=>{const t=(0,i.wA)(),n=(0,r.A)(`${d.VO.CLIENTS}/${c.M.DHCP}`);return(0,a.useEffect)(()=>{t((0,u.fw)(e._id))},[t,e._id]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(B,{network:e}),(0,o.jsx)(l.A,{actions:[(0,o.jsx)(s.A,{allowReadOnly:!0,to:n,onClick:()=>{t((0,h.lj)(e._id))},children:(0,o.jsx)(m.sA,{id:"COMMON_VIEW_IN_IP_TABLE"})})]})]})}},579875(e,t,n){n.d(t,{A:()=>A});var o=n(274934),i=n(602086),a=n(977872),r=n(938984),s=n(237887),l=n(309130),d=n(100978),c=n(470070),m=n(94411),h=n(158402),u=n(584779),p=n(310758);const g=(0,n(247816).A)("div")`
  overflow: auto;
  width: 100%;
  height: 100%;
`,x=({onRenderTable:e,itemCount:t,section:n="COMMON_RECORDS",rowOptions:x,onRowsChanged:A,onPageChanged:b,onOffsetChanged:f,tableType:C,pageNumber:w,paginationFlexProps:j={},paginationDropdownProps:v={},unknownCount:$=!1,paginationTableContainerClassName:k})=>{const S=(0,a.wA)(),T=(0,i.useMemo)(()=>x||p.o,[x]),L=(0,i.useMemo)(()=>T.map(({value:e})=>({label:String(e),value:e})),[T]),N=(0,m.A)(C),O=(0,i.useMemo)(()=>Number(N?.rowsPerPage&&L.some(({value:e})=>Number(e)===N.rowsPerPage)?N.rowsPerPage:T.find(e=>e?.default)?.value||T?.[0]?.value),[N,L,T]),I=(0,i.useMemo)(()=>Math.max(p.B,w||p.B),[w]),M=(0,i.useCallback)(e=>{b?.(e)},[b]),B=(0,i.useCallback)(()=>{M(I-1)},[I,M]),R=(0,i.useCallback)(()=>{M(I+1)},[I,M]),D=(0,i.useCallback)(({value:e})=>{const t=Number(e);S((0,h.yT)(C,{rowsPerPage:t})),A?.(t)},[S,A,C]),E=(0,i.useMemo)(()=>{let e=I*O;return e>t&&(e=t-O,M(Math.ceil(Math.ceil(e)/O))),e},[M,I,O,t]),P=(0,i.useMemo)(()=>{let e=E+O;return e>=t&&(e=t),e},[E,O,t]),y=(0,i.useMemo)(()=>{const e={pageNumber:w,from:E,rowsPerPage:O};return f?.(e),e},[w,E,O,f]),_=(0,i.useMemo)(()=>I===p.B,[I]),F=(0,i.useMemo)(()=>P>=t,[P,t]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g,{className:k,children:e(y)}),(0,o.jsx)(d.A,{justifyContent:"space-between",...j,children:void 0!==E&&void 0!==P&&void 0!==t?(0,o.jsxs)(d.A,{alignItems:"center",children:[(0,o.jsxs)(d.A,{children:[(0,o.jsx)(u.A,{disabled:_,onClick:B}),(0,o.jsx)(u.A,{disabled:F,rotate:!0,onClick:R})]}),(0,o.jsx)(d.A,{marginLeft:l.kc,marginRight:l.S2,children:(0,o.jsx)(r.A,{size:"small",color:"text-2",children:(0,o.jsx)(c.sA,{id:"PAGINATION_FROM_TO",values:{from:E+1,to:P,total:`${t}${$?"+":""}`,section:(0,o.jsx)(c.sA,{id:n})}})})}),L.length>1?(0,o.jsxs)(d.A,{alignItems:"center",children:[(0,o.jsx)(d.A,{marginRight:l.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)(s.A.Sorted,{value:O,options:L,onChange:D,variant:"secondary",direction:"top",width:"100%",portal:!0,...v})})]}):null]}):null})]})},A=({itemCount:e,rowOptions:t,onRenderTable:n,wrapperFlexProps:a,paginationTableContainerClassName:r,keepPaginationWhileLoading:s=!1,...c})=>{const m=(0,i.useMemo)(()=>e>Math.min(...(t||p.o).map(({value:e})=>e)),[e,t]);return(0,o.jsx)(d.A,{padding:l.Ln,gap:l.Ln,width:"100%",height:"100%",flexDirection:"column",overflow:"hidden",...a,children:s||m?(0,o.jsx)(x,{itemCount:e,rowOptions:t,onRenderTable:n,wrapperFlexProps:a,paginationTableContainerClassName:r,...c}):(0,o.jsx)(g,{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),s=n(565527);!function(e){e.DEFAULT="default",e.HOVER="hover",e.DISABLED="disabled",e.ACTIVE="active"}(o||(o={}));const l={[o.DEFAULT]:{[s.S.LIGHT]:"#d6d9e2",[s.S.DARK]:"#3f3f3f"},[o.HOVER]:{[s.S.LIGHT]:"#7e8190",[s.S.DARK]:"#9d9d9d"},[o.DISABLED]:{[s.S.LIGHT]:"#eeeff3",[s.S.DARK]:"#1e1e1e"},[o.ACTIVE]:{[s.S.LIGHT]:"#a4a7b5",[s.S.DARK]:"#2f2f2f"}},d=(e,t)=>l[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),s=n(767822),l=n(820633),d=n(308111);const c=e=>(0,o.jsx)(r.A,{renderOption:s.q,...e}),m=e=>(0,o.jsx)(c,{...e});m.Sorted=e=>{const t=(0,a.d4)(l.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),s=n(64222),l=n(332530);const d=[...new Set([o.H,r.Q.join(r.A),a.Zt,s.F,i.nc,l.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}}]);