"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[97664],{727885(e,t,n){var i,r,s,o,d;n.d(t,{c_:()=>d,fP:()=>s,ku:()=>o,us:()=>r,zb:()=>i}),function(e){e.CLIENTS="CLIENTS",e.NETWORKS="NETWORKS",e.USERS="USERS",e.GROUPS="GROUPS",e.IDENTITIES="IDENTITIES"}(i||(i={})),function(e){e.MAC="MAC",e.NETWORK_ID="NETWORK_ID",e.NETWORK_GROUP_ID="NETWORK_GROUP_ID",e.ULP_USER_ID="ULP_USER_ID",e.ULP_USER_GROUP_ID="ULP_USER_GROUP_ID"}(r||(r={})),function(e){e.DISABLED="DISABLED",e.SHORT="SHORT",e.LONG="LONG"}(s||(s={})),function(e){e.LIMIT="LIMIT",e.PRIORITIZE="PRIORITIZE",e.LIMIT_AND_PRIORITIZE="LIMIT_AND_PRIORITIZE"}(o||(o={})),function(e){e.ALLOWLIST="ALLOWLIST",e.BLOCKLIST="BLOCKLIST",e.TURN_OFF_INTERNET="TURN_OFF_INTERNET",e.QUARANTINE="QUARANTINE"}(d||(d={}))},535322(e,t,n){n.d(t,{A:()=>A,I:()=>i});var i,r=n(274934),s=n(814557),o=n(158885),d=n(247816),a=n(565527),c=n(309130),l=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const u=(0,d.A)(l.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${c.Ln}`:c.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||c.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}})=>s.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,h=(0,d.A)(o.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.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||s.Ay[t===a.S.DARK?`desktop-color-neutral-01-${a.S.DARK}`:`desktop-color-neutral-00-${a.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${c.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${c.Ln} ${c.Ln};
      }
    }
  }
`,A=({type:e,marginBottom:t,margin:n,padding:s,flex:o,width:d,nested:a,...c})=>"items"in c?(0,r.jsx)(h,{marginBottom:t,margin:n,padding:s,flex:o,nested:a,...c}):(0,r.jsx)(u,{nested:a,width:d,marginBottom:t,margin:n,padding:s,flex:o,isButtonList:e===i.BUTTON_LIST,...c,children:c.children})},297640(e,t,n){n.d(t,{A:()=>m});var i=n(274934),r=n(977872),s=n(95032),o=n(309130),d=n(100978),a=n(650632),c=n(831433),l=n(34118);const m=({mac:e})=>{const t=(0,r.d4)(l.GB).find(t=>"mac"in t&&t.mac===e)||{};return(0,i.jsxs)(d.A,{gap:o.kc,alignItems:"center",children:[(0,i.jsx)(d.A,{maxWidth:16,maxHeight:16,children:(0,i.jsx)(a.A,{client:{mac:e,...t}})}),(0,i.jsx)(s.A,{variant:"inherit",isTruncated:!0,children:(0,c.tn)(t||{})||e})]})}},199742(e,t,n){n.d(t,{A:()=>c});var i=n(274934),r=n(602086),s=n(558948),o=n(309130),d=n(100978),a=n(535322);const c=({actions:e})=>(0,i.jsx)(a.A,{marginBottom:"none",children:(0,i.jsx)(d.A,{flexDirection:"column",gap:o.kc,width:"100%",children:e.filter(Boolean).map((e,t,n)=>(0,i.jsxs)(r.Fragment,{children:[e,t<n.length-1?(0,i.jsx)(d.A,{width:"100%",flexDirection:"column",paddingTop:o.YC,paddingBottom:o.YC,children:(0,i.jsx)(s.A,{orientation:"horizontal"})}):null]},[t,e.toString()].join()))})})},963428(e,t,n){n.d(t,{A:()=>l});var i=n(274934),r=n(977872),s=n(602086),o=n(954702),d=n(669439),a=n(897166),c=n(100978);const l=(0,s.forwardRef)(({allowReadOnly:e,disabledReason:t,...n},s)=>{const l=(0,r.d4)(a.EL)&&!e;return(0,i.jsx)(c.A,{alignItems:"center",children:(0,i.jsx)(d.A,{description:t,placement:"left",children:(0,i.jsx)(o.A,{fontSize:"medium",type:"button",...n,isDisabled:l||n.isDisabled||!!t,ref:s})})})})},174710(e,t,n){n.d(t,{A:()=>o});var i=n(274934),r=n(304151),s=n(158498);const o=function({items:e,getItemKey:t,renderItem:n,maxItemCount:o,renderShowMore:d,showListMarkers:a,title:c,position:l,isInteractive:m,cursorType:u,listGap:h,iconProps:A}){return(0,i.jsx)(r.A,{title:c,position:l,isInteractive:m,cursorType:u,description:(0,i.jsx)(s.A,{items:e,getItemKey:t,renderItem:n,maxItemCount:o,listGap:h,renderShowMore:d,showListMarkers:a}),iconProps:A})}},986993(e,t,n){n.d(t,{A:()=>c});var i=n(274934),r=n(95032),s=n(470070),o=n(421314),d=n(300626),a=n(174710);const c=function({items:e,renderMultipleItemsSummary:t,renderListItem:n,renderNoItems:c,getItemKey:l,enabled:m=!0,showListMarkers:u,cursorType:h,isInteractive:A}){const g=m?"inherit":"disabled";return e.length>1?(0,i.jsx)(d.A,{tooltip:(0,i.jsx)(a.A,{items:e,getItemKey:l,renderItem:n,showListMarkers:u,isInteractive:A,cursorType:h}),children:(0,i.jsx)(o.A,{color:g,cursorType:h,children:t(e)})}):1===e.length?(0,i.jsx)(o.A,{color:g,cursorType:h,children:n(e[0])}):c?(0,i.jsx)(i.Fragment,{children:c()}):(0,i.jsx)(r.A,{isTruncated:!0,color:g,children:(0,i.jsx)(s.sA,{id:"COMMON_FALLBACK"})})}},300626(e,t,n){n.d(t,{A:()=>o});var i=n(274934),r=n(309130),s=n(100978);const o=({children:e,tooltip:t})=>(0,i.jsxs)(s.A,{maxWidth:"100%",overflow:"hidden",gap:r.YC,alignItems:"center",children:[e?(0,i.jsx)(s.A,{flex:1,overflow:"hidden",children:e}):null,t]})},828196(e,t,n){n.d(t,{A:()=>l});var i=n(274934),r=n(938984),s=n(95032),o=n(247816),d=n(470070),a=n(664092);const c=(0,o.A)(r.A)`
  white-space: nowrap;
`,l=({id:e,color:t,values:n,children:r})=>(0,i.jsxs)(a.A,{children:[(0,i.jsx)(c,{color:"text-2",size:"medium",children:(0,i.jsx)(d.sA,{id:e,values:n})}),(0,i.jsx)(s.A,{color:t||"text-3",size:"medium",isTruncated:!0,children:r})]})},664092(e,t,n){n.d(t,{A:()=>c});var i=n(274934),r=n(247816),s=n(309130),o=n(100978),d=n(291508);const a=(0,r.A)(o.A,(0,d.A)("valueMaxWidth","keyMinWidth","compact"))`
  &:not(:last-child) {
    ${({compact:e})=>e?"":`margin-bottom: ${s.kc};`}
  }
  & > {
    &:nth-child(1) {
      min-width: ${({keyMinWidth:e})=>e}px;
    }
    &:nth-child(2) {
      max-width: ${({valueMaxWidth:e})=>e}px;
    }
  }
`,c=({children:e,valueMaxWidth:t=215,keyMinWidth:n=0,flexProps:r={},compact:o=!1})=>(0,i.jsx)(a,{width:"100%",justifyContent:"space-between",gap:s.kc,height:o?void 0:24,valueMaxWidth:t,keyMinWidth:n,compact:o,...r,children:e})},597664(e,t,n){n.r(t),n.d(t,{default:()=>N});var i=n(274934),r=n(977872),s=n(380047),o=n(159469),d=n(464920),a=n(509927),c=n(309130),l=n(986993),m=n(963428),u=n(199742),h=n(146215),A=n(376527),g=n(100978),x=n(895983),I=n(297640),p=n(535322),O=n(700444),T=n(470070),E=n(727885),j=n(775211),L=n(969288),M=n(828196);const N=({activeItem:e})=>{const t=(0,r.wA)(),n=(0,a.V)(()=>t((0,j.XR)(e.id)),{onError:e=>{const n=(0,d.F)(e)?e:void 0;return t((0,O.ox)({icon:o.C.danger,message:"SETTINGS_REMOVE_OBJECT_FAILED",errorMessage:n?.msg,errorValues:n}))}});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(p.A,{children:[(0,i.jsx)(M.A,{id:"COMMON_TARGET",children:e.target_type===E.zb.CLIENTS||e.target_type===E.zb.GROUPS?(0,i.jsx)(l.A,{items:e.targets.map(e=>e.value),getItemKey:e=>e,renderListItem:e=>(0,i.jsx)(I.A,{mac:e}),renderMultipleItemsSummary:e=>(0,i.jsx)(T.sA,{id:"COMMON_DEVICE_COUNT_PLURAL",values:{count:e.length}})}):e.target_type===E.zb.NETWORKS?(0,i.jsx)(l.A,{items:e.targets.map(e=>e.value),getItemKey:e=>e,renderListItem:e=>(0,i.jsx)(x.A,{id:e}),renderMultipleItemsSummary:e=>(0,i.jsx)(T.sA,{id:"COMMON_NETWORK_COUNT",values:{count:e.length}})}):(0,i.jsx)(T.sA,{id:"COMMON_FALLBACK"})}),(0,i.jsx)(M.A,{id:"SETTINGS_SECURE",children:e.secure?.enabled?(0,i.jsx)(s.A,{size:"original"}):(0,i.jsx)(g.A,{width:c.Er,justifyContent:"center",alignItems:"center",height:"100%",children:(0,i.jsx)(T.sA,{id:"COMMON_FALLBACK"})})}),(0,i.jsx)(M.A,{id:"COMMON_ROUTE",children:e.route?.enabled?(0,i.jsx)(s.A,{size:"original"}):(0,i.jsx)(g.A,{width:c.Er,justifyContent:"center",alignItems:"center",height:"100%",children:(0,i.jsx)(T.sA,{id:"COMMON_FALLBACK"})})}),(0,i.jsx)(M.A,{id:"COMMON_QOS",children:e.qos?.enabled?(0,i.jsx)(s.A,{size:"original"}):(0,i.jsx)(g.A,{width:c.Er,justifyContent:"center",alignItems:"center",height:"100%",children:(0,i.jsx)(T.sA,{id:"COMMON_FALLBACK"})})}),(0,i.jsx)(g.A,{children:(0,i.jsx)(A.A,{to:`${L.Db}/${e.id}`,children:(0,i.jsx)(T.sA,{id:"SETTINGS_OPEN_OBJECT"})})})]}),(0,i.jsx)(u.A,{actions:[(0,i.jsx)(h.A,{trigger:(0,i.jsx)(m.A,{variant:"destructive",children:(0,i.jsx)(T.sA,{id:"COMMON_ACTION_REMOVE"})}),title:(0,i.jsx)(T.sA,{id:"COMMON_QUESTION_REMOVE",values:{name:e.name}}),message:(0,i.jsx)(T.sA,{id:"SETTINGS_REMOVE_OBJECT_CONFIRMATION",values:{count:1}}),isActionPending:n.isLoading,onConfirm:()=>n.execute()})]})]})}},509927(e,t,n){n.d(t,{V:()=>o});var i=n(602086),r=n(603606);const s=e=>{const t=(0,i.useRef)(e);return(0,i.useEffect)(()=>{t.current=e},[e]),(0,i.useCallback)((...e)=>t.current(...e),[])};function o(e,t){const n=(0,i.useRef)([]),[,o]=(0,i.useState)(0),[d,a]=(0,i.useState)(null);(0,i.useEffect)(()=>{const e=setInterval(()=>{n.current.length&&t?.estimatedDurationMs&&o(e=>e+1)},1e3);return()=>clearInterval(e)},[t?.estimatedDurationMs]);const c=t?.dedupe??!1,l=s(t?.onSuccess||(()=>{})),m=s(t?.onError||(()=>{})),u=(0,i.useCallback)((...i)=>{if(c&&n.current.length)return Promise.reject();const s=(async()=>e(...i))();return n.current.push({promise:s,startedAt:Date.now()}),o(e=>e+1),s.then(e=>(l?.(e),a(e),e)).catch(async e=>{if(t?.delayOnErrorMs&&await(0,r.u)(t.delayOnErrorMs),a(null),!m)throw e;m(e)}).finally(async()=>{n.current=n.current.filter(e=>e.promise!==s),o(e=>e+1)})},[e,c,m,l,t?.delayOnErrorMs]),h=n.current.at(-1),A=h&&t?.estimatedDurationMs?Math.min((Date.now()-h.startedAt)/t.estimatedDurationMs,.9):void 0;return{execute:u,isLoading:!!n.current.length,lastData:d,estimatedProgress:A}}},603606(e,t,n){n.d(t,{u:()=>i});const i=e=>new Promise(t=>{setTimeout(t,e)})}}]);