"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[1032],{840437:(e,t,n)=>{n.r(t),n.d(t,{default:()=>W});var l=n(296540),c=n(592510),r=n(860923),a=n(582724),o=n(834959),s=n(413357),i=n(566723),d=n(105540),m=n(604482),E=n(566425),A=n(479369),u=n(294303),h=n(789163),p=n(427907),D=n(54227),I=n(469733),C=n(459449),k=n(445535),_=n(910849),y=n(877773),O=n(711120);const g=()=>{const e=(0,I.useDispatch)(),t=(0,I.useSelector)(y.w);return l.createElement(k.A,{label:l.createElement(C.sA,{id:"COMMON_VIEW_BY"}),hasPaddedContent:!0},l.createElement(u.A,{gap:i.kc},l.createElement(D.A,{id:_.w.AUDIO,checked:t===_.w.AUDIO,onChange:()=>{e((0,O.Ct)(_.w.AUDIO))},disabled:!0},l.createElement(C.sA,{id:"DEVICE_XLR"})),l.createElement(D.A,{id:_.w.VIDEO,checked:t===_.w.VIDEO,onChange:()=>{e((0,O.Ct)(_.w.VIDEO))}},l.createElement(C.sA,{id:"DEVICE_HDMI"}))))},b=()=>l.createElement(p.A,{leftFilterPageId:m.g1.PORT_MANAGEMENT,tabs:l.createElement(h.Ay,{selectedTab:h.al.AV_MANAGER})},l.createElement(g,null));var P=n(217439),V=n(444232),f=n(659833),N=n(845030),$=n(398300),w=n(71479),R=n(822336),G=n(998837),U=n(297454),v=n(311785),x=n(115829);const M=(0,w.A)(u.A)`
  width: ${100}px;
  height: ${24}px;
`,B=(0,w.A)(M,(0,v.A)("disabled"))`
  align-items: center;
  justify-content: center;
  padding: ${i.kc} ${i.YC};
  border: ${({theme:{themeName:e}})=>R.Ay[`desktop-border-divider-${e}`]};
  border-radius: ${R.Ay["desktop-radius-base"]};
  overflow: hidden;
  position: relative;
  cursor: pointer;
  ${({disabled:e,theme:{themeName:t}})=>e?`\n          background-color: ${R.Ay[`desktop-color-neutral-01-${t}`]};\n          cursor: unset;\n          pointer-events: none;\n        `:""}
`,L=(0,w.A)(B)`
  background-color: ${({theme:{themeName:e}})=>R.Ay[`desktop-color-green-01-${e}`]};
  border-color: ${({theme:{themeName:e}})=>R.Ay[`desktop-color-green-03-${e}`]};
`,S=({children:e,disabled:t,onClick:n})=>l.createElement(B,{disabled:t,onClick:n},l.createElement(x.A,{size:"small",color:t?"text-3":"text-2"},e)),H=e=>l.createElement(L,{...e},l.createElement(U.A,{color:R.Ay[`desktop-color-green-06-${(0,G.u)().themeName}`]})),T=({children:e})=>l.createElement(u.A,{flex:"1",justifyContent:"center",style:{writingMode:"sideways-lr"}},e);var X=n(943390),j=n(794320),z=n(448571);const Q=({host:e,mac:t,disabled:n})=>{const c=(0,I.useDispatch)();return l.createElement(B,{disabled:n,onClick:()=>{c((0,O.IU)({id:j.P9,type:X.CQ.VIDEO,host:e,clients:[t]})),c((0,N.XP)({type:$.H.VIDEO_BRIDGE_GROUP,id:z.PANEL_VIDEO_BRIDGE_GROUP_SIDE_PANEL_ID}))}})},F=({hostGroup:e})=>{const t=(0,I.useDispatch)();return l.createElement(H,{onClick:()=>{t((0,O.IU)({id:e.id,type:X.CQ.VIDEO,host:e.host?.mac||"",clients:(e.clients||[]).map(e=>e.mac),group:e})),t((0,N.XP)({type:$.H.VIDEO_BRIDGE_GROUP,id:z.PANEL_VIDEO_BRIDGE_GROUP_SIDE_PANEL_ID}))}})};var Y=n(6510);const Z=({name:e,model:t,mac:n}={name:"",model:"",mac:""})=>`${(0,Y.Q)({name:e,model:t,mac:n})} ${n.slice(-4)}`,q=()=>{const e=(0,I.useDispatch)(),{clients:t=[],hosts:n=[],groups:c=[]}=(0,I.useSelector)(f.tM),r=(0,I.useSelector)(V.Ib),a=(0,l.useMemo)(()=>[...t,...n],[t,n]),o=(0,l.useCallback)(t=>()=>{e((0,N.XP)({type:$.H.DEVICE,id:t}))},[e]);return l.createElement(u.A,{flexDirection:"column"},l.createElement(u.A,{flex:"1",justifyContent:"center"},l.createElement(P.A,{size:"small",color:"text-3"},l.createElement(C.sA,{id:"PROAV_VIDEO_OUT"}))),l.createElement(u.A,null,l.createElement(T,null,l.createElement(P.A,{size:"small",color:"text-3"},l.createElement(C.sA,{id:"PROAV_VIDEO_IN"}))),l.createElement(u.A,{flexDirection:"column"},l.createElement(u.A,null,l.createElement(M,null),a.map(e=>l.createElement(S,{key:e,disabled:n.includes(e),onClick:o(e)},Z(r.get(e))))),a.map(e=>{const s=c.find(t=>t.host?.mac===e);return l.createElement(u.A,{key:e},l.createElement(S,{disabled:t.includes(e),onClick:o(e)},Z(r.get(e))),a.map(t=>(s?.clients||[]).some(e=>e.mac===t)?l.createElement(F,{key:t,hostGroup:s}):l.createElement(Q,{key:t,disabled:e===t||n.includes(t),host:e,mac:t})))}))))},W=()=>(0,a.A)([(0,s.Zi)(o.B.DEVICES),(0,s.Zi)(o.B.PROAV),(0,A.y)(void 0,{crudCacheStrategy:{type:c.e.CACHE}}),(0,E.Hq)(void 0,{crudCacheStrategy:{type:c.e.CACHE}})],l.createElement(r.A,{mainPanelProps:{gap:i.Ln}},l.createElement(d.A,{leftFilterPageId:m.g1.PORT_MANAGEMENT,content:l.createElement(b,null),overflow:"hidden",paddingBottom:i.Ln},l.createElement(u.A,{flexDirection:"column",padding:i.Ln},l.createElement(q,null)))))}}]);