"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[95897],{23582:(e,t,a)=>{a.d(t,{A:()=>d});var n,l=a(469733),r=a(296540),i=a(525512),c=a(687573),s=a(648092),o=a(523275),E=a(874807),u=a(906593),m=a(434008);!function(e){e.TYPE="type",e.SUBSCRIPTION="subscription",e.ENABLED="enabled",e.META="meta"}(n||(n={}));const A=(e,t,a)=>({[n.TYPE]:m.uw.SUBSCRIBE,[n.SUBSCRIPTION]:e,[n.ENABLED]:t,[n.META]:a}),d=(e,t=E.P1,a=(0,o.A)(),n=!1)=>{const m=(0,l.useDispatch)(),d=(0,r.useMemo)(()=>JSON.stringify(a),[a]),_=(0,l.useSelector)(s.a),C=(0,r.useMemo)(()=>[_[u.Uz],...n?[_[u.o4]]:[]].filter(Boolean),[_,n]),M=(0,r.useCallback)(e=>(0,i.K6)(e,t),[t]),p=(0,r.useCallback)(e=>{(0,i.$N)(e)},[]);(0,r.useEffect)(()=>(C.forEach(t=>{t.send(A(e,!0,JSON.parse(d)))}),()=>{C.forEach(t=>{t.send(A(e,!1,JSON.parse(d)))})}),[m,e,d,C]),(0,r.useEffect)(()=>{const t=c._[e].map(M);return()=>{t.forEach(p)}},[m,e,M,p])}},33453:(e,t,a)=>{a.d(t,{A2:()=>n,AU:()=>E,FC:()=>s,Qw:()=>o,RR:()=>l,_U:()=>u,lT:()=>c,w4:()=>r});const n="deviceTags",l="_id",r=`:${l}:`,i="/v2/api/site/{site}/device-tags",c=i,s=i,o=`${i}/device-tag-assignment/${r}`,E=`${i}/${r}`,u=`/v2/api/device-tags/${r}`},46119:(e,t,a)=>{a.d(t,{A:()=>n});const n={open:(e,t="_blank",a="noopener,noreferrer")=>window.open(e,t,a)}},55983:(e,t,a)=>{a.d(t,{Ai:()=>i,Ar:()=>c,Qv:()=>s,ZP:()=>o,aY:()=>r,p6:()=>l});var n=a(448547);const l="alarm-manager",r="control-plane",i=`${r}/integrations`,c=`${r}/backups`,s="admins",o=Object.values(n.Kr)},60519:(e,t,a)=>{a.d(t,{As:()=>_,H2:()=>u,JQ:()=>c,Jc:()=>m,Qu:()=>s,cW:()=>A,lQ:()=>o,m7:()=>E,vs:()=>C,zp:()=>d});var n=a(801081),l=a(198494),r=a(792072),i=a(602021);const c=(0,n.Mz)(r.Y8,e=>e),s=(0,n.Mz)(l.Io,l.mn,l.aK,i.dK,i.IX,(e,t,a,n,l)=>e?t||a:n||l),o=(0,n.Mz)(l.Io,l.mn,l.aK,i.dK,i.IX,(e,t,a,n,l)=>e?t||a:n||l),E=(0,n.Mz)(l.Io,l.mn,l.aK,i.dK,i.IX,(e,t,a,n,l)=>e?t||a:n||l),u=(0,n.Mz)(l.Io,l.mn,l.aK,l.$7,i.dK,i.IX,(e,t,a,n,l,r)=>e?t||a||n:l||r),m=(0,n.Mz)(i.EL,e=>!e),A=m,d=m,_=m,C=m},89124:(e,t,a)=>{a.d(t,{qF:()=>x,UH:()=>V,Ay:()=>H});var n=a(469733),l=a(296540),r=a(951272),i=a(71479),c=a(217439),s=a(870443),o=a(60519),E=a(566723),u=a(143811),m=a(294303),A=a(689965),d=a(845030),_=a(699784),C=a(780811),M=a(906619),p=a(198494),I=a(255212),O=a(438628),N=a(732881),v=a(117982),D=a(900956),S=a(592563),T=a(74750),b=a(592510),f=a(516693),h=a(370333),R=a(582724),g=a(662297),k=a(242366),y=a(659552),P=a(33453),B=a(801156),L=a(784465);const U=(0,i.A)(m.A)`
  flex-direction: column;
  > button {
    justify-content: flex-start;
    width: fit-content;
  }
  gap: ${E.kc};
`,w=(0,i.A)(m.A)`
  align-items: center;
  gap: ${E.kc};
`,F=({mac:e})=>{const t=(0,n.useDispatch)(),[a,r]=(0,l.useState)(!1),[i,c]=(0,l.useState)(""),[s,E]=(0,l.useState)(!1),[u,m]=(0,l.useState)(!1),A=(0,n.useSelector)(y._),d=(0,l.useMemo)(()=>A.map(({[B.Ko.NAME]:e})=>e),[A]),C=(0,n.useSelector)(o.Qu),M=(0,l.useMemo)(()=>A.map(e=>({value:e[B.Ko._ID],label:e[B.Ko.NAME]})),[A]),p=(0,l.useMemo)(()=>A.reduce((t,a)=>(a[B.Ko.MEMBER_DEVICE_MACS].includes(e)&&t.push(a[B.Ko._ID]),t),[]),[A,e]),I=(0,l.useCallback)(a=>{t((0,L.gT)({[B.nr.MAC]:e,...(({added:e,removed:t})=>({[B.nr.DEVICE_TAG_ADDITIONS]:e,[B.nr.DEVICE_TAG_REMOVALS]:t}))((0,h.qk)(p,a))})).then(()=>{t((0,L.uu)()),r(!1)})},[t,p,e]),F=(0,l.useCallback)(e=>{r(e)},[]),V=(0,l.useCallback)(e=>()=>{e(),c("")},[]),z=(0,l.useCallback)(()=>{t((0,L.$5)({[B.iV.NAME]:i,[B.iV.MEMBER_DEVICE_MACS]:[e]})).then(e=>{t({type:f.xk,meta:{model:P.A2,extend:!0,fetchTime:Date.now(),id:e[B.Ko._ID],idField:P.RR},payload:{data:e}}),r(!1),c("")})},[t,e,i]),K=(0,l.useCallback)(({close:e})=>l.createElement(w,null,l.createElement(T.A,{variant:"tertiary-neutral",onPress:V(e)},l.createElement(_.sA,{id:"COMMON_ACTION_CANCEL"})),l.createElement(T.A,{onPress:z,isDisabled:!i||s||u},l.createElement(_.sA,{id:"COMMON_ACTION_SAVE"}))),[V,z,i,s,u]),$=(0,l.useCallback)(({target:{value:e}})=>{c(e)},[]);return(0,l.useEffect)(()=>{E(d.includes(i)),m(i.startsWith(" ")||i.endsWith(" "))},[d,i]),(0,R.A)([(0,L.uu)(void 0,{crudCacheStrategy:{type:b.e.CACHE}})],l.createElement(U,null,A.length?l.createElement(g.A,{options:M,label:p.length?l.createElement(_.sA,{id:"COMMON_DEVICE_TAGS"}):void 0,triggerButtonText:"COMMON_ACTION_EDIT",isFullWidth:!0,onChange:I,value:p}):null,C?l.createElement(D.A,{isOpen:a,onOpenChange:F},l.createElement(v.A,null,l.createElement(S.A,{type:"button",fontSize:"medium"},l.createElement(_.sA,{id:"DEVICE_CREATE_TAG"}))),l.createElement(N.A,{actionButtons:K,placement:"bottom left"},l.createElement(k.A,{width:300},l.createElement(O.A,{value:i,label:l.createElement(_.sA,{id:"DEVICE_TAG_NAME"}),variant:"secondary",width:"100%",onChange:$,invalid:s?l.createElement(_.sA,{id:"COMMON_PLEASE_ENTER_UNIQUE_NAME"}):u?l.createElement(_.sA,{id:"COMMON_VALIDATION_NO_LEADING_TRAILING_SPACES"}):void 0})))):null))},V="general",z=(0,i.A)(m.A)`
  flex-direction: column;
`,K=(0,i.A)("div")`
  margin-bottom: ${E.Ln};
`,$=(0,r.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:{name:e,mac:t}={}})=>({name:e!==t?e:""}),validationSchema:s.A.object().shape({name:s.A.string().label("COMMON_NAME").max(128)}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),x=({isUdmDevice:e,label:t="COMMON_NAME",hideBubbleWrapper:a=!1,hideDeviceTags:r=!1,mac:i})=>{const s=(0,n.useSelector)(o.JQ),d=(0,n.useSelector)(o.H2),C=(0,n.useSelector)(p.Io),O=a?l.Fragment:A.A;return l.createElement(z,null,l.createElement(O,null,l.createElement(K,null,l.createElement(I.A,{isUdmDevice:e},l.createElement(u.A,{label:t,variant:"secondary",name:"name",full:!0,disabled:e})))),s&&d&&!r?l.createElement(A.A,{type:A.I.ACCORDION,items:[{id:"device-tags",label:l.createElement(m.A,{gap:E.YC,alignItems:"center"},l.createElement(_.sA,{id:"COMMON_DEVICE_TAGS"}),C?l.createElement(M.A,null,l.createElement(c.A,{size:"medium",color:"ublue-06"},l.createElement(_.sA,{id:"COMMON_FABRIC"}))):null),openByDefault:!0,renderContent:()=>l.createElement(F,{mac:i})}]}):null)};const H=$(function({activeItem:e,setFormDirty:t,setFormInvalid:a,dirty:r,isValid:i,values:c,resetForm:s,label:o="COMMON_NAME",formName:E=V,hideBubbleWrapper:u=!1,hideDeviceTags:m=!1}){const A=(0,n.useDispatch)(),_=(0,C.D6h)(e);return(0,l.useEffect)(()=>(A((0,d.uo)({[E]:()=>_?{}:c})),A((0,d.Oo)({[E]:()=>s({values:c})})),A((0,d.rW)({[E]:s})),()=>{A((0,d.uo)({[E]:null})),A((0,d.Oo)({[E]:null})),A((0,d.rW)({[E]:null}))}),[A,s,c,_,E]),(0,l.useEffect)(()=>{t(E,r),a(E,!i)},[t,r,a,i,E]),l.createElement(x,{isUdmDevice:_,label:o,hideBubbleWrapper:u,hideDeviceTags:m,mac:e.mac})})},242366:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(296540),l=a(566723),r=a(294303);const i=(0,n.forwardRef)((e,t)=>n.createElement(r.A,{ref:t,flexDirection:"column",gap:l.kc,width:"100%",...e}))},255212:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(469733),l=a(296540),r=a(271856),i=a(834316),c=a(928085),s=a(196010),o=a(349107),E=a(699784),u=a(187483),m=a(556456),A=a(55983);const d=({children:e,isUdmDevice:t})=>{const a=(0,n.useSelector)(m.yE),d=(0,c.A)(A.aY),_=(0,n.useSelector)(u.TP);return l.createElement(r.A,{portal:!0,isInteractive:!0,description:t?l.createElement(E.sA,{id:"DEVICE_PROPERTIES_NAME_LINK_CONTROL_PLANE",values:{link:a?l.createElement(s.A,{to:d},l.createElement(E.sA,{id:"COMMON_CONTROL_PLANE"})):l.createElement(o.A,{href:(0,i.ec)(_),id:"COMMON_CONTROL_PLANE"})}}):null},l.createElement("span",null,e))}},329109:(e,t,a)=>{a.d(t,{A:()=>E});var n=a(296540),l=a(691441),r=a(71479),i=a(132196),c=a(373229);const s=(0,r.A)("div")`
  height: 66px;
`,o=i.AH`
  padding: 0px !important;
`,E=({isDirty:e,onFormSubmit:t,onFormCancel:a,isInvalid:r,...i})=>e?n.createElement(l.A,null,n.createElement(c.A,{isDirty:e,onFormCancel:a,onFormSubmit:t,isInvalid:r,className:o,...i})):n.createElement(s,null)},373229:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(296540),l=a(758649),r=a(71479),i=a(566723),c=a(699784);const s=(0,r.A)("footer",{shouldForwardProp:e=>"hasFormResetButton"!==e})`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${i.S2} ${i.fS};
  gap: ${i.kc};
`,o=({allowCancel:e,isDirty:t,isInvalid:a,isSubmitting:r,onFormSubmit:i,onFormReset:o,onFormCancel:E,className:u,submitButtonText:m,customButton:A,applyButton:d,applyButtonFirst:_,hideCancelButton:C,form:M})=>{const p=(0,n.useMemo)(()=>d||n.createElement(l.A,{name:"submit",variant:"primary",type:"submit",onClick:i,disabled:!t||a||r,form:M},n.createElement(c.sA,{id:m||"COMMON_ACTION_APPLY_CHANGES"})),[d,M,t,a,r,i,m]);return n.createElement(s,{className:u,hasFormResetButton:!!o},_?p:A,C?null:n.createElement(l.A,{name:"cancel",variant:"default",type:"button",onClick:E,disabled:!e&&!t},n.createElement(c.sA,{id:"COMMON_ACTION_CANCEL"})),o?n.createElement(l.A,{name:"reset",variant:"default",type:"button",onClick:o,disabled:!t},n.createElement(c.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULTS"})):null,_?A:p)}},525512:(e,t,a)=>{a.d(t,{$N:()=>c,K6:()=>i,WM:()=>r});var n=a(300477);const l={},r=()=>l,i=(e,t,a=!1,r=null)=>{const i=r||(0,n.A)();return l[i]||(l[i]={eventKeys:Array.isArray(e)?e:[e],id:i,action:t,forSuperSite:a}),i},c=e=>{delete l[e]}},556456:(e,t,a)=>{a.d(t,{XU:()=>A,YQ:()=>d,aB:()=>m,g0:()=>I,jO:()=>_,tx:()=>u,yB:()=>E,yE:()=>M,zn:()=>p});var n=a(801081),l=a(874807),r=a(187483),i=a(448547),c=a(524332),s=a(55983);const o=(0,n.Mz)(r.kb,e=>e[i.C2.SWAI_ROUTES]||[]),E=(0,n.Mz)(o,e=>e.filter(e=>s.ZP.every(t=>!e[c.rR.PATH].startsWith(t)))),u=(0,n.Mz)(E,e=>e.filter(e=>!e[c.rR.IS_HIDDEN])),m=(0,n.Mz)(o,e=>e.filter(e=>e[c.rR.PATH].startsWith(i.Kr.SETTINGS))),A=(0,n.Mz)(m,e=>e.filter(e=>!e[c.rR.IS_HIDDEN])),d=(0,n.Mz)(o,e=>e.filter(e=>e[c.rR.PATH].startsWith(i.Kr.SYSLOG))),_=(0,n.Mz)(d,e=>e.filter(e=>!e[c.rR.IS_HIDDEN])),C=e=>(0,n.Mz)(o,t=>t.some(t=>t[c.rR.PATH].includes(e)&&!t[c.rR.IS_HIDDEN])),M=(0,n.Mz)(C(s.aY),e=>e),p=(0,n.Mz)(C(s.p6),e=>e),I=(0,n.Mz)(r.nx,e=>e[i.Y7.ROUTES_ADAPTER]||{[c.bh.ROUTES]:[],[c.bh.ADD_ROUTES_LISTENER]:l.P1,[c.bh.REMOVE_ROUTES_LISTENER]:l.P1,[c.bh.ON_ROUTE_CONTAINER_ADDED]:l.P1,[c.bh.ON_ROUTE_CONTAINER_REMOVED]:l.P1})},648092:(e,t,a)=>{a.d(t,{a:()=>s,m:()=>o});var n=a(801081),l=a(386234),r=a(276907),i=a(919952),c=a(434008);const s=(0,n.Mz)(e=>e[i.U.SHARED][r.N.WEB_SOCKET],e=>e?.[c.SC.POOL]||{}),o=(0,n.Mz)(s,e=>(0,l.UI)(t=>e[t]))},656883:(e,t,a)=>{a.d(t,{n:()=>r});var n=a(458112),l=a(744742);const r=e=>(0,l.pb)({name:n.T.RADIOS,value:e})},659552:(e,t,a)=>{a.d(t,{_:()=>s});var n=a(801081),l=a(25553),r=a(87485),i=a(784465);const c=(0,l.uh)((0,i.uu)()),s=(0,n.Mz)(c,r.kh)},784465:(e,t,a)=>{a.d(t,{$5:()=>E,gT:()=>A,kW:()=>u,uK:()=>m,uu:()=>o});var n=a(165126),l=a(516693),r=a(691189),i=a(887831),c=a(33453),s=a(801156);const o=(e={},t={})=>(0,r.t9)(c.A2,c.lT,e,{...t,idField:c.RR}),E=e=>(0,r.vB)(l.aC,null,null,i.A.POST,c.FC,{},e,{fetchConfig:{getAllPostData:!0}}),u=e=>(0,r.vB)(l.aC,null,null,i.A.PUT,c.AU.replace(c.w4,e[s.d5.ID]),{},(0,n.A)(e,[s.d5.ID]),{fetchConfig:{getAllPostData:!0}}),m=e=>(0,r.vB)(l.aC,null,null,i.A.DELETE,c._U.replace(c.w4,e[s.Xs.ID]),{},(0,n.A)(e,[s.Xs.ID]),{}),A=e=>(0,r.vB)(l.aC,null,null,i.A.POST,c.Qw.replace(c.w4,e[s.nr.MAC]),{},(0,n.A)(e,[s.nr.MAC]),{})},801156:(e,t,a)=>{var n,l,r,i,c;a.d(t,{Ko:()=>n,Xs:()=>i,d5:()=>r,iV:()=>l,nr:()=>c}),function(e){e._ID="_id",e.NAME="name",e.MEMBER_DEVICE_MACS="member_device_macs"}(n||(n={})),function(e){e.NAME="name",e.MEMBER_DEVICE_MACS="member_device_macs"}(l||(l={})),function(e){e.ID="id",e.NAME="name",e.DEVICE_MAC_ADDITIONS="device_mac_additions",e.DEVICE_MAC_REMOVALS="device_mac_removals"}(r||(r={})),function(e){e.ID="id"}(i||(i={})),function(e){e.MAC="mac",e.DEVICE_TAG_ADDITIONS="device_tag_additions",e.DEVICE_TAG_REMOVALS="device_tag_removals"}(c||(c={}))},821580:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(296540),l=a(454195),r=a(566723),i=a(294303);const c=e=>n.createElement(i.A,{paddingTop:r.YC,paddingBottom:r.YC,gap:r.Ln,rowGap:r.YC,flexWrap:"wrap",minHeight:l.b,alignItems:"center",...e})},834316:(e,t,a)=>{a.d(t,{$H:()=>l,SK:()=>n,ec:()=>r});const n=e=>e.replace("network","ADMINS"),l=e=>e.replace("network","applications"),r=e=>e.replace("network","console-settings")},842630:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(469733),l=a(296540),r=a(602021);const i=({children:e=null})=>(0,n.useSelector)(r.EL)?null:l.createElement(l.Fragment,null,e)},906619:(e,t,a)=>{a.d(t,{A:()=>E});var n=a(296540),l=a(71479),r=a(822336),i=a(566723),c=a(939703),s=a(294303);const o=(0,l.A)(s.A,{shouldForwardProp:e=>"color"!==e})`
  border-radius: ${r.Ay["desktop-radius-infinity"]};
  background: ${({color:e,theme:{themeName:t}})=>(0,c.b_)(e||r.Ay[`desktop-color-ublue-06-${t}`],.1)};
  padding: 2px ${i.kc};
`,E=({children:e,color:t})=>n.createElement(o,{color:t},e)}}]);