"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[14236],{9535:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(296540),a=n(861878);const i=({onClear:e,labelId:t="COMMON_ACTION_CLEAR_FILTERS",disabled:n})=>r.createElement(a.A,{onPress:e,labelId:t,disabled:n})},17441:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(296540),a=n(713769),i=n(264863);const l=({children:e})=>r.createElement(i.A,null,r.createElement(a.y,null,e))},30386:(e,t,n)=>{n.d(t,{A:()=>r});const r=e=>+(e||0).toFixed(1)},67716:(e,t,n)=>{n.d(t,{Ot:()=>f,T_:()=>m,_G:()=>h,d$:()=>A,fy:()=>u,o2:()=>d,sN:()=>E,yE:()=>p});var r=n(822336),a=n(71479),i=n(939703),l=n(566723),o=n(294303),s=n(740618),c=n(343255);const u=(0,a.A)(o.A,{shouldForwardProp:e=>"height"!==e})`
  flex-direction: column;
  flex: 0 0 auto;
  width: calc(${c.b}px + ${l.Ln});
  height: ${({height:e})=>e?`${e}px`:"auto"};
  position: relative;
  background-color: ${({theme:{themeName:e}})=>r.Ay[`desktop-color-neutral-00-${e}`]};
  z-index: 1;
  padding-bottom: ${l.kc};
  gap: ${l.kc};
`,m=(0,a.A)(o.A)`
  flex-direction: column;
  width: ${c.b}px;
`,d=(0,a.A)(o.A,{shouldForwardProp:e=>"isLeftFilterEditorOpen"!==e})`
  width: fit-content;
  ${({isLeftFilterEditorOpen:e})=>e?`margin-left: ${l.YC};`:""}
`,p=(0,a.A)(o.A)`
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  gap: ${l.kc};
  // buffer for the last element to be fully visible
  padding-bottom: ${l.Ln};
  ${s.gm?"padding-right: 16px;":"scrollbar-gutter: stable;"}
`,E=(0,a.A)(o.A)`
  width: calc(100% - ${l.xO});
  position: absolute;
  bottom: 0;
  flex-direction: column;
  justify-content: center;
  min-height: 36px;
  background-color: ${({theme:{themeName:e}})=>r.Ay[`desktop-color-neutral-00-${e}`]};
`,f=(0,a.A)(o.A,{shouldForwardProp:e=>"hasOverflow"!==e})`
  ${({hasOverflow:e})=>e?"opacity: 0;":""}
`,A=(0,a.A)("div")`
  position: absolute;
  top: -${l.kc};
  left: -${l.Ln};
  width: 100%;
  height: 8px;
  background: linear-gradient(
    180deg,
    ${({theme:{themeName:e}})=>(0,i.b_)(r.Ay[`desktop-color-neutral-00-${e}`],0)} 0%,
    ${({theme:{themeName:e}})=>(0,i.b_)(r.Ay[`desktop-color-neutral-00-${e}`],8)} 100%
  );
`,h=(0,a.A)(o.A)`
  width: 248px;
  border: 1px solid ${({theme:{themeName:e}})=>r.Ay[`desktop-color-neutral-03-${e}`]};
  border-radius: ${r.Ay["desktop-radius-base"]};
  padding: ${l.xO} ${l.kc};
  background: ${({theme:{themeName:e}})=>r.Ay[`desktop-color-neutral-01-${e}`]};
`},77247:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(296540);const a=e=>{const[t,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{const t=()=>{e.current&&n(e.current.scrollHeight>e.current.clientHeight)};t();const r=new ResizeObserver(t);return e.current&&r.observe(e.current),()=>{r.disconnect()}},[e]),t}},105540:(e,t,n)=>{n.d(t,{A:()=>_});var r=n(296540),a=n(469733),i=n(530281),l=n(514625),o=n(604482),s=n(580176),c=n(789768),u=n(749177),m=n(822336),d=n(71479),p=n(566723),E=n(294303);const f=(0,d.A)(E.A,{shouldForwardProp:e=>!["leftFilterPanelOpen","buttonTop"].includes(e)})`
  position: absolute;
  z-index: 10;
  cursor: pointer;
  border: 1px solid ${({theme:{themeName:e}})=>m.Ay[`desktop-color-divider-border-${e}`]};
  border-radius: ${m.Ay["desktop-radius-base"]};
  top: ${({buttonTop:e})=>e??p.xO};
  right: ${({leftFilterPanelOpen:e})=>e?"-11":"-14"}px;
  background: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-01-${e}`]};
  > div:first-child {
    width: 18px;
    height: 32px;
  }
  svg {
    left: ${({leftFilterPanelOpen:e})=>e?"0":"4"}px;
    position: relative;
    color: ${({theme:{themeName:e}})=>m.Ay[`desktop-color-neutral-07-${e}`]};
  }
`,A=({leftFilterPageId:e,buttonTop:t})=>{const n=(0,a.useDispatch)(),m=(0,u.A)(e),d=(0,r.useCallback)(()=>{n(m?(0,s.MZ)(e):(0,s.lF)(e)),n((0,c.ZN)(e,{[o.d.PANEL_OPEN]:!m}))},[n,m,e]),p=m?i.A:l.A;return r.createElement(f,{leftFilterPanelOpen:m,buttonTop:t,onClick:d},r.createElement(p,{size:"small",actionable:!0,omitSvgMargin:!0}))},h=(0,d.A)(E.A)`
  width: 100%;
  height: 100%;
  flex-direction: row;
  position: relative;
`,g=(0,d.A)(E.A,{shouldForwardProp:e=>"leftFilterPanelOpen"!==e})`
  position: relative;
  padding-top: ${p.xO};
  ${({leftFilterPanelOpen:e,theme:{themeName:t}})=>e?`\n        border-right: 1px solid ${m.Ay[`desktop-color-divider-border-${t}`]};\n        padding-left: ${p.xO};\n      `:""}
`,_=({children:e,content:t,leftFilterPageId:n,buttonTop:a,leftFilterContentContainerClassname:i,...l})=>{const o=(0,u.A)(n);return r.createElement(h,{...l},r.createElement(g,{leftFilterPanelOpen:o,className:i},n?r.createElement(A,{leftFilterPageId:n,buttonTop:a}):null,o?t:null),e)}},160087:(e,t,n)=>{n.d(t,{s:()=>o});var r=n(822336),a=n(71479),i=n(566723),l=n(294303);const o=(0,a.A)(l.A)`
  border-bottom: 1px solid ${({theme:{themeName:e}})=>r.Ay[`desktop-color-neutral-02-${e}`]};
  padding: ${i.kc};
  flex-direction: column;
  width: 100%;
  position: relative;
  gap: ${i.kc};
`},182463:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Us});var r=n(469733),a=n(296540),i=n(998837),l=n(132196),o=n(592510),s=n(371715),c=n(834959),u=n(61902),m=n(604482),d=n(413357),p=n(582724),E=n(860923),f=n(105540),A=n(627440),h=n(632169),g=n(540883),_=n(745667),C=n(83344),S=n(691189);const b=1e4,O=(e={},t={})=>(0,S.Kd)("topology","/v2/api/site/{site}/topology","topology",e,t),y=O(void 0,{crudCacheStrategy:{type:o.e.POLLED,interval:b}});var N=n(457311),x=n(634229),T=n(37e3),I=n(920470),v=n(789768),k=n(866593),M=n(902733),L=n(71177),D=n(171073),w=n(984652),$=n(274174),R=n(951272),P=n(840124),F=n(870443);const z=F.A.string().label("COMMON_NETWORK_NAME").required().min(2).max(32),V=e=>e.reduce((e,t)=>("DEVICE"===t.type?e.device_mac_list.push(t.mac):e.client_mac_list.push(t.mac),e),{device_mac_list:[],client_mac_list:[]}),Y=e=>({mac:e.mac,type:e.type,name:e.name});var W,B,G=n(801081),H=n(149133),U=n(919952),X=n(720903),j=n(189601),Z=n(862296),K=n(860631);!function(e){e.WIRELESS="WIRELESS",e.WIRED="WIRED"}(W||(W={})),function(e){e.DEVICE="DEVICE",e.CLIENT="CLIENT",e.INVISIBLE_ROOT="INVISIBLE_ROOT",e.ISP="ISP",e.USW_WAN="USW_WAN",e.CABLE_INTERNET="CABLE_INTERNET"}(B||(B={}));var q=n(25553),Q=n(87485);const J=(0,q.uh)(O()),ee=(0,G.Mz)(J,e=>(0,Q.i6)(e));var te,ne=n(823881),re=n(302167),ae=n(366188),ie=n(944373),le=n(602021),oe=n(198494),se=n(415246),ce=n(305988),ue=n(807516),me=n(780811),de=n(532419),pe=n(90380),Ee=n(512768),fe=n(598796),Ae=n(792072),he=n(837612),ge=n(602197),_e=n(485897),Ce=n(951106),Se=n(691294),be=n(239417),Oe=n(538535),ye=n(23961),Ne=n(822336);!function(e){e[e.TRAFFIC_0=0]="TRAFFIC_0",e[e.TRAFFIC_20=1]="TRAFFIC_20",e[e.TRAFFIC_40=2]="TRAFFIC_40",e[e.TRAFFIC_60=3]="TRAFFIC_60",e[e.TRAFFIC_80=4]="TRAFFIC_80",e[e.TRAFFIC_100=5]="TRAFFIC_100"}(te||(te={}));const xe={[te.TRAFFIC_0]:{backgroundWidth:4,particlesWidth:0,circlesInGroup:0},[te.TRAFFIC_20]:{backgroundWidth:10,particlesWidth:4,circlesInGroup:3},[te.TRAFFIC_40]:{backgroundWidth:14,particlesWidth:8,circlesInGroup:6},[te.TRAFFIC_60]:{backgroundWidth:18,particlesWidth:12,circlesInGroup:10},[te.TRAFFIC_80]:{backgroundWidth:22,particlesWidth:16,circlesInGroup:13},[te.TRAFFIC_100]:{backgroundWidth:26,particlesWidth:20,circlesInGroup:15}},Te=Ne.Ay["desktop-color-aqua-06-light"],Ie=Ne.Ay["desktop-color-purple-06-light"],ve=(e,t)=>{const n=[],{circlesInGroup:r,particlesWidth:i}=xe[e];for(let e=0;e<r;e+=1){const t=Math.random()<.5?Te:Ie,r=(0,ye.yT)(-i/2,i/2),l=(0,ye.yT)(-i/2,i/2);n.push(a.createElement("circle",{key:e,r:.5,fill:t,cx:r,cy:l}))}const l=`traffic-${e}-variant-${t}`;return a.createElement("g",{key:l,id:l},n)},{defs:ke,groupIds:Me}=(()=>{const e=[],t={[te.TRAFFIC_0]:[],[te.TRAFFIC_20]:[],[te.TRAFFIC_40]:[],[te.TRAFFIC_60]:[],[te.TRAFFIC_80]:[],[te.TRAFFIC_100]:[]};return Object.values(te).forEach(n=>{if("number"==typeof n)for(let r=0;r<6;r+=1){const a=ve(n,r);e.push(a),t[n].push(`traffic-${n}-variant-${r}`)}}),{defs:e,groupIds:t}})(),Le=e=>0===e?te.TRAFFIC_0:e<=20?te.TRAFFIC_20:e<=40?te.TRAFFIC_40:e<=60?te.TRAFFIC_60:e<=80?te.TRAFFIC_80:te.TRAFFIC_100,De=(e,t)=>e.reduce((e,n)=>{const r=t.port_table.find(e=>e.port_idx===n);return r?(e.tx+=r["tx_bytes-r"],e.rx+=r["rx_bytes-r"],e.sum+=r["tx_bytes-r"]+r["rx_bytes-r"],e):e},{tx:0,rx:0,sum:0}),we=(e,t,n)=>{const{edge:r,mac:a}=e;if(!r)return;const{uplinkMac:i,uplinkPortNumber:l}=r,o=n.find(e=>e.peers.top===i||e.peers.bottom===i);if(!o)return;const s=t.find(e=>e.mac===o.peers.top),c=t.find(e=>e.mac===o.peers.bottom),u=t.find(e=>e.mac===a),m=o.peers.top===i;if(!s||!c||!u)return;const d=o.target_links.find(e=>m?e.top.includes(l):e.bottom.includes(l));if(!d)return;const{tx:p,rx:E,sum:f}=De(d.top,s),{tx:A,rx:h,sum:g}=De(d.bottom,c);return{topTx:p,topRx:E,topSum:f,bottomTx:A,bottomRx:h,bottomSum:g}},$e=(e,t,n)=>{const r=n.find(e=>e.mac===t),a=n.find(t=>t.mac===e);if(r&&a)return{topTx:a.uplink["rx_bytes-r"],topRx:a.uplink["tx_bytes-r"],topSum:a.uplink["tx_bytes-r"]+a.uplink["rx_bytes-r"],bottomTx:r.uplink["rx_bytes-r"],bottomRx:r.uplink["tx_bytes-r"],bottomSum:r.uplink["tx_bytes-r"]+r.uplink["rx_bytes-r"]}};var Re=n(773423),Pe=n(165126),Fe=n(726947);const ze=e=>Fe.s0.includes(e),Ve=e=>{const t=(0,he.kG)(e.state);switch(!0){case(e=>Fe.Sh.includes(e))(t):return Re.sf.ONLINE;case ze(t):return Re.sf.OFFLINE;case(e=>e===ge.g.ISOLATED)(t):return Re.sf.ISOLATED;case((e,t)=>Fe.NJ.includes(e)&&!t)(t,e.default):return Re.sf.MANAGED_BY_ANOTHER_CONSOLE;case((e,t)=>Fe.NJ.includes(e)&&t)(t,e.default):return Re.sf.PENDING_ADOPTION;default:return null}},Ye={[Re.pC.DEVICES_STATUS]:(e,t)=>!t[Re.pC.DEVICES_STATUS].length||t[Re.pC.DEVICES_STATUS].includes(Ve(e))},We=Object.values(Ye);var Be=n(945532),Ge=n(997515),He=n(101617),Ue=n(909519),Xe=n(614054),je=n(581799);const Ze=e=>{const{x:t,y:n,parent:r,data:a}=e||{},{id:i,state:l,type:o,mac:s,allowedInVisualProgramming:c,wifiRadios:u,name:m,traffic:d,model:p,unifiDevice:E,mcLagBottomSwitchMac:f,mcLagGroup:A,stackingGroup:h}=a||{};return{x:t,y:n,parentX:r?.x||0,parentY:r?.y||0,id:i,state:l,type:o,mac:s,allowedInVisualProgramming:c,wifiRadios:u,name:m,traffic:d,model:p,unifiDevice:E,mcLagBottomSwitchMac:f,mcLagGroup:A,stackingGroup:h}},Ke=e=>{const{source:t,target:n}=e||{};return{source:{id:t.data.id,x:t.x,y:t.y,type:t.data.type,mac:t.data.mac,firstChildMac:t.children[0].data.mac,hasMultipleChildren:t.children.length>1},target:{id:n.data.id,x:n.x,y:n.y,mac:n.data.mac,traffic:n.data.traffic,edge:n.data.edge}}},qe=(e,t)=>{const{vertices:n=[],edges:r=[]}=e,a=t.map(e=>e.units.find(e=>1===e.index)?.mac),i=t.flatMap(e=>e.units.filter(e=>1!==e.index).map(e=>e.mac)),l=r.map(e=>{const{uplinkMac:n,downlinkMac:r}=e,a=t.find(e=>e.units.some(e=>e.mac===n||e.mac===r));if(!a)return e;const i=a?.units.find(e=>1===e.index)?.mac,l=a.units.filter(e=>1!==e.index).map(e=>e.mac);if(!i||!l.length)return e;if(!l.includes(r)){if(l.includes(n)){const t={...e,uplinkMac:i};if(t.uplinkMac===t.downlinkMac)return;return t}return e}}),o=n.map(e=>{const n=a.includes(e.mac),r=t.find(t=>t.units.some(t=>t.mac===e.mac));return n?{...e,stackingGroup:r}:e}).filter(e=>!i.includes(e.mac));return{...e,vertices:o,edges:l.filter(Boolean)}},Qe=(e,t)=>{const{vertices:n=[],edges:r=[]}=e,a=t.map(e=>e.peers.bottom),i=t.map(e=>e.peers.top),l=r.map(e=>{const{uplinkMac:n,downlinkMac:a}=e,i=t.find(e=>e.peers.bottom===n||e.peers.bottom===a);if(!i)return e;if(i.peers.bottom!==a){if(i.peers.bottom===n){const t={...e,uplinkMac:i.peers.top};if(t.uplinkMac===t.downlinkMac){const e=r.find(e=>e.downlinkMac===i.peers.bottom);t.uplinkMac=e?.uplinkMac}return t}return e}}),o=n.map(e=>{if(i.includes(e.mac)){const n=t.find(t=>t.peers.top===e.mac);return{...e,mcLagBottomSwitchMac:n?.peers?.bottom,mcLagGroup:n}}return e}).filter(e=>!a.includes(e.mac));return{...e,vertices:o,edges:l.filter(Boolean)}},Je=e=>je.hD+je.dB+e,et=e=>({id:je._K,name:je._K,mac:je.Aw,type:B.INVISIBLE_ROOT,parentMac:void 0,children:e.map(e=>({...e,parentMac:je.Aw}))}),tt=(e,t,n,r)=>{if(!e.length)return e;const{mainTreeRoot:a,uciNode:i,isolatedNodes:l}=((e,t)=>{let n,r,a=[];if(e.forEach(e=>{const i=He[e.model]?.type;switch(!0){case(0,me.moU)({model:e.model,type:i})&&t===e.mac:n=e;break;case(0,me.m_j)({model:e.model,type:i}):r={...e,type:B.CABLE_INTERNET},e.children?.length&&([n]=e.children);break;default:a.push(e)}}),!n){const r=e=>e.mac===t||e.children?.some(e=>r(e))||!1,i=e.find(e=>r(e));i&&(n=i,a=a.filter(e=>e.mac!==i.mac))}return{mainTreeRoot:n,uciNode:r,isolatedNodes:a}})(e,n),o=((e,t,n=[])=>{const r=[];let a;if(n.length){const e=n[0];a={id:je.TD,name:e?.name,mac:e?.mac,type:B.USW_WAN,parentMac:void 0,children:[]}}if(t){const n={...t,children:[]};a?(a.children=e?[e]:[],n.children=[a]):n.children=e?[e]:[],r.push(n)}else a?(a.children=e?[e]:[],r.push(a)):e&&r.push(e);return r})(a,i,r),s=((e,t,n,r)=>{const a=[];return e.forEach(e=>{let i={...e,parentMac:void 0};const l=je.Aw;r&&(i={id:`${je._K}-${e.mac}-uswwan`,name:je._K,mac:`${l}-${e.mac}-uswwan`,type:B.INVISIBLE_ROOT,parentMac:void 0,children:[i]}),n&&(i={id:`${je._K}-${e.mac}-uci`,name:je._K,mac:`${l}-${e.mac}-uci`,type:B.INVISIBLE_ROOT,parentMac:void 0,children:[i]}),t&&(i={id:`${je._K}-${e.mac}-isp`,name:je._K,mac:`${l}-${e.mac}-isp`,type:B.INVISIBLE_ROOT,parentMac:void 0,children:[i]}),a.push(i)}),a})(l,t,Boolean(i),Boolean(r.length)),c=((e,t)=>{if(!t)return e;const n=e.length?e.map(e=>({...e,parentMac:je.D1})):[],r={id:je.RE,name:je.RE,mac:je.D1,type:B.ISP,parentMac:void 0,children:n};return r.isIsp=t,[r]})(o,t);return[...c,...s]},nt=e=>je.zU+e,rt=(e,t,n,r,a,i,l,o,s,c)=>{if(!e)return{nodes:[],links:[]};const u=(0,Be.Ay)(e,e=>!e||e.id&&t.has(e?.id)?null:e.children&&e.children.length>0?(e=>{if(!e||e.length<=1)return e;const t=e.findIndex(e=>e.type===B.ISP);if(-1!==t){const n=e[t],r=e.filter((e,n)=>n!==t),a=Math.ceil(r.length/2);return[...r.slice(0,a),n,...r.slice(a)]}const n=[...e].sort((e,t)=>(t.children?.length||0)-(e.children?.length||0)),r=new Array(n.length),a=Math.floor(n.length/2);let i=0;for(let e=0;e<n.length;e+=1)r[a+i]=n[e],i=i>0?-i:1-i;return r.filter(Boolean)})(e.children):e.children),m=(0,Ge.A)().nodeSize([je.hD,Je(n)]).separation(()=>1);m.nodeSize([je.hD,Je(n)]);const d=m(u),p=((e,t)=>{const n=e.descendants();return n.forEach(e=>{e.data.type===B.ISP&&(e.y+=nt(t))}),n})(d,r?je.Hz:n),E=p.find(e=>e.data.type===B.ISP)||p.find(e=>{if(e.data.type===B.DEVICE&&a){const t=He[e.data.model]?.type;return(0,me.moU)({model:e.data.model,type:t})&&a===e.data.mac}return!1})||p.find(e=>e.data.type===B.DEVICE),f=E?-E.x:0,A=E?-E.y:0;p.forEach(e=>{e.x+=f,e.y+=A}),r&&p.forEach(e=>{const t=e.x,n=e.y;e.x=n,e.y=t});return{nodes:p.map(e=>{const t=e.data.type===B.DEVICE,n=e.data.type===B.CLIENT,r=s.get(e.data.mac),a=c.get(e.data.mac),u=t&&r?(0,Xe.w)(r.detailed_states):!(!n||!a)&&(0,Xe.w)(a.detailed_states),m=t&&Boolean(r?.vbms_table?.battpool?.readycnt),d=n?a?.signal:void 0,p=e.data.children?.length>0;return{...Ze(e),hasPoeWarnings:u,hasSmartBattery:m,isLteActive:i,lteDeviceMac:l,wanId:o,clientSignal:d,hasChildren:p}}),links:d.links().map(Ke).filter(e=>e.source.type!==B.INVISIBLE_ROOT)}},at=e=>{const t=(e=>{const{showSSID:t,showWifiStandards:n,showWiredPorts:r,showRadioChannel:a,showStpPriority:i}=e;return t||n||r||a||i})(e),n=e.rotateMap;return t&&!n?je.VQ:0},it=e=>`${e.source.id}-${e.target.id}`,lt=(e,t,n,r,a)=>a?`translate(${e},${t})`:`translate(${n},${r})`,ot={transition:"none"},st=e=>{const t=[],{vertices:n=[],edges:r=[]}=e,a=n.map(e=>{const{mac:t}=e,n=((e,t)=>t.find(t=>t.downlinkMac===e))(t,r);return{...e,edge:n,id:e.mac}}).filter(e=>void 0!==e),i=a.reduce((e,t)=>(e[t.mac]=t,e),{});return a.forEach(e=>{const n=i[e.edge?.uplinkMac];n?(n.children||(n.children=[])).push(e):t.push(e)}),t};var ct=n(564985);const ut=e=>e.edge?.type===W.WIRELESS&&e.edge?.radioBand===ct.sx.RADIO_NG?Re.$o.CONNECTION_2G:e.edge?.type===W.WIRELESS&&e.edge?.radioBand===ct.sx.RADIO_NA?Re.$o.CONNECTION_5G:e.edge?.type===W.WIRELESS&&e.edge?.radioBand===ct.sx.RADIO_6E?Re.$o.CONNECTION_6G:Re.$o.CONNECTION_WIRED,mt={[Re.pC.CLIENTS_CONNECTION]:(e,t)=>!t[Re.pC.CLIENTS_CONNECTION].length||t[Re.pC.CLIENTS_CONNECTION].includes(ut(e)),[Re.pC.CLIENTS_BROADCAST]:(e,t)=>!t[Re.pC.CLIENTS_BROADCAST].length||t[Re.pC.CLIENTS_BROADCAST].includes(e.edge?.essid),[Re.pC.CLIENTS_VLANS]:(e,t)=>!t[Re.pC.CLIENTS_VLANS].length||t[Re.pC.CLIENTS_VLANS].includes(e.edge?.networkId),[Re.pC.CLIENTS_VENDORS]:(e,t)=>!t[Re.pC.CLIENTS_VENDORS].length||t[Re.pC.CLIENTS_VENDORS].includes(e.fingerprintData?.fingerprint_device_vendor),[Re.pC.CLIENTS_DEVICE_TYPES]:(e,t)=>!t[Re.pC.CLIENTS_DEVICE_TYPES].length||t[Re.pC.CLIENTS_DEVICE_TYPES].includes(e.fingerprintData?.fingerprint_device_name)},dt=Object.values(mt),pt=e=>e[U.U.TOPOLOGY_VISUALIZATION],Et=(0,G.Mz)(pt,e=>e.isTrafficVisualizationEnabled),ft=(0,G.Mz)(pt,e=>e.filter),At=(0,G.Mz)(oe.ed,e=>!(e[se.XJ.CLIENTS_DISABLED]??!1)),ht=(0,G.Mz)(pt,e=>e.trafficLinkData),gt=(0,G.Mz)(pt,e=>e.isInfrastructureView),_t=(0,G.Mz)(pe.cW,Ee.mK,de.U$,(0,Ae.jN)(fe.Xj.MANAGED_SHADOW_MODE),(e,t,n,r)=>r||(0,me.T2C)(n)||e||t),Ct=(0,G.Mz)(pt,e=>e.hoveredNode),St=(0,j.WY)()((0,G.Mz)(pt,e=>Object.keys(e.trafficLinkData)),e=>e),bt=(0,G.Mz)(be.A8,e=>{const t={};return e.forEach(e=>{const n="virtual_network_override_id"in e?e.virtual_network_override_id:void 0;("virtual_network_override_enabled"in e?e.virtual_network_override_enabled:void 0)&&(t[n]||(t[n]=[]),t[n].push(e))}),t}),Ot=(0,G.Mz)(de.ID,re.zu,(e,t)=>{const n=e.filter(e=>(0,K.kL)(e.switch_caps?.feature_caps));return!(n.length<2)&&n.every(e=>{const n=t?.switch_exclusions?.includes(e?.mac)?e?.stp_version:t?.stp_version;return e.stp_priority&&e.stp_priority===_e.v&&n!==ne.uI.DISABLED})}),yt=(0,G.Mz)(Ot,e=>{const t=(0,X.A)(ce.W2.topologyViewSettings);return e?{...t,showStpPriority:!0}:t}),Nt=(0,G.Mz)(pt,e=>e.collapsedNodes),xt=(0,j.WY)()((0,G.Mz)(pt,e=>e.treeTransform),e=>e),Tt=(0,G.Mz)(pt,e=>e.wasTreeTransformSetInThisSession),It=(0,j.N2)(be.A8,b),vt=(0,G.Mz)(It,e=>e.filter(e=>e.type===Se.sK.WIRELESS||e.type===Se.sK.WIRED)),kt=(0,j.N2)(de.ID,b),Mt=e=>{if(!e.is_mlo)return e.signal;const t=(0,Ce.Wc)(e.mlo_details)?.signal;return t??e.signal},Lt=(0,G.Mz)(vt,ue.y1,ee,ae.nT,(e,t,{edges:n=[]},r)=>{const a=new Map;n.forEach(e=>{e.networkId=e.networkId||r?._id,a.set(e.downlinkMac,e)});const i=new Map;return e.forEach(e=>{const n={mac:e.mac,"rx_bytes-r":e["rx_bytes-r"],"tx_bytes-r":e["tx_bytes-r"],uplink_mac:e.uplink_mac,sw_port:"sw_port"in e?e.sw_port:void 0,detailed_states:"detailed_states"in e?e.detailed_states:void 0,fixed_ip:"fixed_ip"in e?e.fixed_ip:void 0,use_fixedip:"use_fixedip"in e?e.use_fixedip:void 0,signal:e.type===Se.sK.WIRELESS?Mt(e):void 0,fingerprintData:(0,be.lP)(t,e.fingerprint),edge:a.get(e.mac)};i.set(e.mac,n)}),i}),Dt=(0,G.Mz)([Lt],e=>Array.from(e.values())),wt=(0,G.Mz)(kt,e=>{const t=new Map,n=e.reduce((e,t)=>t.peer_ubb?e.concat(t.peer_ubb):e,[]);return e.concat(n).forEach(e=>{const n={mac:e.mac,state:e.state,port_table:e.port_table?.map(e=>({port_idx:e.port_idx,"rx_bytes-r":Math.round(e["rx_bytes-r"]),"tx_bytes-r":Math.round(e["tx_bytes-r"])})),uplink:{"rx_bytes-r":Math.round(e.uplink?.["rx_bytes-r"]),"tx_bytes-r":Math.round(e.uplink?.["tx_bytes-r"]),uplink_mac:e.uplink?.uplink_mac,uplink_remote_port:e.uplink?.uplink_remote_port},detailed_states:e.detailed_states,vbms_table:e.vbms_table,stp_version:e.stp_version,switch_caps:e.switch_caps,stp_priority:e.stp_priority,model:e.model,name:e.name,type:e.type,radio_table:e.radio_table,radio_table_stats:e.radio_table_stats,vap_table:e.vap_table,default:e.default,"system-stats":e["system-stats"]};t.set(e.mac,n)}),t}),$t=(0,G.Mz)([wt],e=>Array.from(e.values())),Rt=(0,G.Mz)($t,e=>e.filter(e=>(0,me.Syn)(e)||(0,me.Fp0)(e))),Pt=(0,G.Mz)($t,e=>e.filter(e=>(0,me.m_j)(e))),Ft=(0,G.Mz)([ee,ft,Lt,wt,At],(e,t,n,r,a)=>{let{vertices:i=[]}=e;const l=Array.from(r.values()).filter(e=>(0,me.Syn)(e)||(0,me.Fp0)(e)).map(e=>e.mac);l.length>0&&(i=i.filter(e=>!l.includes(e.mac)));const o=i.filter(e=>{if(e.type===B.INVISIBLE_ROOT||e.type===B.ISP)return!0;const i=(l=e,l?.type===B.CLIENT);var l;if(i){if(e.unifiDevice)return!0;const r=n.get(e.mac);return a&&r&&((e,t)=>dt.every(n=>n(e,t)))(r,t)}if(!i){const n=r.get(e.mac);return n&&((e,t)=>We.every(n=>n(e,t)))(n,t)}return!1});return{...e,vertices:o}}),zt=(0,G.Mz)(Ft,Dt,(e,t)=>{const{filteredClientList:n,filteredDeviceList:r}=e.vertices.reduce((e,n)=>((e=>e.type===B.CLIENT&&t.find(t=>e.mac===t.mac))(n)?e.filteredClientList.push(n.mac):(({type:e,state:t})=>e===B.DEVICE&&e===B.DEVICE&&(0,he.kG)(t)===ge.g.CONNECTED)(n)&&e.filteredDeviceList.push(n.mac),e),{filteredClientList:[],filteredDeviceList:[]});return{onlineClientsCount:n.length,onlineDevicesCount:r.length}}),Vt=(0,G.Mz)(Ft,Z.kX,le.vc,ie.D,Rt,Oe.D5,(e,t,n,r,a,i)=>{const l=Qe(e,r),o=qe(l,i),s=st(o),c=tt(s,t,n,a);return c.length>1||0===c.length?et(c):c[0]}),Yt=(0,G.Mz)(Vt,Lt,wt,ie.D,Et,(e,t,n,r,a)=>{if(!a)return e;const i=e=>{const a=e.type===B.CLIENT,l=e.children?.map(i)||[],o=t.get(e.mac),s={rx:0,tx:0,sum:0};if(a)s.rx=o&&o["rx_bytes-r"]||0,s.tx=o&&o["tx_bytes-r"]||0,s.sum=(o&&o["rx_bytes-r"]||0)+(o&&o["tx_bytes-r"]||0);else{let t;if(t=e.mcLagBottomSwitchMac?$e(e.mac,e.mcLagBottomSwitchMac,Array.from(n.values())):we(e,Array.from(n.values()),r),t)s.rx=t.topRx+t.bottomRx,s.tx=t.topTx+t.bottomTx,s.sum=t.topSum+t.bottomSum,s.topRx=t.topRx,s.topTx=t.topTx,s.topSum=t.topSum,s.bottomRx=t.bottomRx,s.bottomTx=t.bottomTx,s.bottomSum=t.bottomSum;else for(let e=0;e<l.length;e+=1)s.rx+=l[e].traffic&&l[e].traffic.rx||0,s.tx+=l[e].traffic&&l[e].traffic.tx||0,s.sum+=l[e].traffic&&l[e].traffic.sum||0}return{...e,children:l,traffic:s}};return i(e)}),Wt=(0,G.Mz)(Yt,e=>e.traffic?.sum||1),Bt=e=>(0,G.Mz)(wt,t=>t.get(e)),Gt=(0,G.Mz)(pt,e=>e.controlMode),Ht=(0,G.Mz)(oe.ed,e=>at(e)),Ut=(0,G.Mz)(oe.ed,e=>e.rotateMap),Xt=e=>e[U.U.VISUAL_PROGRAMMING],jt=(0,G.Mz)(Xt,e=>e.selectedDevices),Zt=e=>(0,G.Mz)(Xt,t=>{const{selectedDevices:n}=t;return n.some(t=>t.mac===e)}),Kt=(0,G.Mz)(Xt,e=>e.selectedNetworkId),qt=(0,G.Mz)(Xt,e=>e.sidePanelOpen),Qt=e=>(0,G.Mz)(Kt,Dt,ae.Ct,(t,n,r)=>{const a=r.find(e=>e._id===t);if(!a)return!0;const i=n.find(t=>t.mac===e);if(!i)return!0;const{fixed_ip:l,use_fixedip:o}=i;return!o||(!(o&&l&&a.ip_subnet)||(0,H.xc)(a.ip_subnet,l))});var Jt=n(511975),en=n(14198),tn=n(271856),nn=n(927099),rn=n(758649),an=n(200619),ln=n(566723),on=n(313437),sn=n(329109),cn=n(137625),un=n(143811),mn=n(391855),dn=n(294303),pn=n(970658),En=n(689965),fn=n(699784),An=n(424226),hn=n(153933),gn=n(349107),_n=n(703447),Cn=n(435325),Sn=n(765562);const bn=()=>a.createElement(dn.A,{gap:ln.kc,alignItems:"center"},a.createElement(An.A,{isActive:!0,size:"large"}),a.createElement(nn.A,{size:"body",color:"secondary"},a.createElement(fn.sA,{id:"TOPOLOGY_VP_SIDEPANEL_EMPTY_DEVICES"}))),On=({item:{mac:e,name:t}})=>{const n=(0,r.useSelector)((0,a.useMemo)(()=>(0,be.og)(e),[e])),i=(0,r.useSelector)((0,a.useMemo)(()=>(0,Cn.i7)(e),[e]));return a.createElement(dn.A,{alignItems:"center",gap:ln.xO,height:"100%"},a.createElement(dn.A,{height:"100%",minWidth:30,maxWidth:30,alignItems:"center",justifyContent:"center"},a.createElement(_n.A,{client:Object.keys(n).length?n:i})),a.createElement(nn.A,{size:"inherit",truncate:!0},t))},yn=()=>{const[e,t]=(0,a.useState)(!1),n=(0,r.useSelector)(jt),i=(0,r.useDispatch)();return n.length>0?a.createElement(hn.Ay,{idField:"mac",multiSelectMode:!0,disableColumnFilters:!0,columns:[{id:"mac",label:a.createElement(fn.sA,{id:"COMMON_NAME"}),renderCell:e=>a.createElement(On,{item:e})}],items:n,isRemovable:()=>!0,removeItems:async e=>{e.forEach(e=>{i((0,en.X8)(e))})},renderManageButton:({onClick:n,children:r,isManaging:i,...l})=>a.createElement(cn.A,{title:"COMMON_ACTIONS_PROCEED_CONFIRM_TITLE",buttonMessage:"COMMON_ACTION_PROCEED",handleClose:t,handleConfirm:n,isOpen:e,body:a.createElement(nn.A,{size:"inherit"},a.createElement(fn.sA,{id:"COMMON_IP_NETWORK_OVERRIDE_CONFIRM_MESSAGE",values:{link:a.createElement(gn.A,{href:Sn.A.virtualNetworkCreateGuide,id:"COMMON_LEARN_MORE",noWrap:!0})}}))},a.createElement(rn.A,{type:"button",...l,onClick:()=>i?n():t(!0)},r))}):a.createElement(bn,null)},Nn=()=>{const{values:e,initialValues:t,submitForm:n,setValues:i}=(0,R.j7)(),l=(0,r.useDispatch)(),o=(0,r.useSelector)(jt),s=(0,r.useSelector)(ee).vertices?.map(Y),c=(0,r.useSelector)(bt),u=(0,r.useSelector)(Kt),m=(0,r.useSelector)(ae.Ct),{forceDeleteModal:d,removeNetworks:p}=(0,pn.G)({genericErrorMessage:"COMMON_NETWORKS_MANAGE_REMOVE_ERROR",deletionSuccessCallback:()=>{l((0,en.nx)(Jt.T)),l((0,en.ev)(!1))}}),[E,f]=(0,a.useState)(!1),[A,h]=(0,a.useState)({...t,device_mac_list:[],client_mac_list:[]}),g=(0,a.useCallback)(()=>{p([{_id:u,name:A.name}])},[p,u,A.name]),_=(0,a.useMemo)(()=>{const{device_mac_list:t,client_mac_list:n}=V(o);return e.name!==A.name||e.internet_access_enabled!==A.internet_access_enabled||e.network_isolation_enabled!==A.network_isolation_enabled||!(0,an.L)(t,A.device_mac_list)||!(0,an.L)(n,A.client_mac_list)},[e,o,A]),C=(0,a.useCallback)(()=>{const{device_mac_list:t,client_mac_list:r}=V(o);h({name:e.name,network_isolation_enabled:e.network_isolation_enabled,internet_access_enabled:e.internet_access_enabled,device_mac_list:t,client_mac_list:r,id:u}),n()},[o,e.name,e.network_isolation_enabled,e.internet_access_enabled,u,n]),S=(0,a.useRef)(0),b=(0,a.useCallback)(()=>{let n={...Jt.g};const r=m.find(e=>e._id===u);if(u!==Jt.T&&r){const e=((e,t,n)=>{const r=(t[e]||[]).map(e=>e.id);return n.filter(e=>r.includes(e.mac))})(u,c,s),{client_mac_list:a,device_mac_list:i}=V(e);l((0,en.Vq)(e)),S.current=a.length+i.length,n={network_isolation_enabled:r?.network_isolation_enabled??t.network_isolation_enabled,internet_access_enabled:r?.internet_access_enabled??t.internet_access_enabled,name:r?.name??t.name,device_mac_list:i,client_mac_list:a,id:u}}i({...e,id:u,network_isolation_enabled:n.network_isolation_enabled,internet_access_enabled:n.internet_access_enabled,name:n.name}),h(n)},[m,u,i,e,c,s,l,t.network_isolation_enabled,t.internet_access_enabled,t.name]);return(0,a.useEffect)(()=>{u!==Jt.T&&(c[u]?.length??0)!==S.current&&b()},[u,c]),(0,a.useEffect)(()=>{u!==A.id&&b()},[u]),a.createElement(a.Fragment,null,a.createElement(En.A,null,a.createElement(dn.A,{flexDirection:"column",gap:ln.Ln},a.createElement(un.A,{label:"COMMON_NETWORK_NAME",name:"name",full:!0,variant:"secondary"}),a.createElement(un.A,{name:"network_isolation_enabled",type:"realCheckbox"},a.createElement(dn.A,{alignItems:"center",gap:ln.YC},a.createElement(fn.sA,{id:"COMMON_ISOLATE_NETWORK"}),a.createElement(tn.A,{description:a.createElement(fn.sA,{id:"TOPOLOGY_VP_SIDEPANEL_NETWORK_ISOLATION_TOOLTIP"}),position:"bottom",width:200},a.createElement(on.a,{isActive:!0,size:"original"})))),a.createElement(un.A,{name:"internet_access_enabled",type:"realCheckbox"},a.createElement(fn.sA,{id:"COMMON_ALLOW_INTERNET_ACCESS"})))),a.createElement(En.A,null,a.createElement(yn,null)),u!==Jt.T&&a.createElement(En.A,null,a.createElement(dn.A,null,a.createElement(cn.A,{title:"COMMON_QUESTION_REMOVE",titleValues:{name:A.name},buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",handleClose:f,handleConfirm:g,isOpen:E,body:a.createElement(nn.A,{size:"inherit"},a.createElement(fn.sA,{id:"COMMON_QUESTION_ARE_YOU_SURE_YOU_WANT_TO_REMOVE",values:{name:A.name}}))},a.createElement(rn.A,{type:"button",variant:"inline",size:"medium",onClick:()=>f(!0)},a.createElement(nn.A,{size:"body",color:"danger"},a.createElement(fn.sA,{id:"COMMON_ACTION_REMOVE"})))))),a.createElement(sn.A,{isDirty:_,onFormCancel:()=>{i({...e,name:A.name,internet_access_enabled:A.internet_access_enabled,network_isolation_enabled:A.network_isolation_enabled});const t=[...A.device_mac_list,...A.client_mac_list],n=s.filter(e=>t.includes(e.mac));l((0,en.Vq)(n))},applyButton:a.createElement(mn.A,{showWarning:!0,onSubmit:C})}),d)},xn=({isExistingRecord:e})=>a.createElement(nn.A,{weight:"bold",size:"header-xs"},a.createElement(fn.sA,{id:e?"TOPOLOGY_VP_VIRTUAL_NETWORK":"TOPOLOGY_VP_CREATE_VIRTUAL_NETWORK"})),Tn=F.A.object().shape({name:z,network_isolation_enabled:F.A.boolean().required(),internet_access_enabled:F.A.boolean().required()}),In=l.AH`
  header {
    border: none;
  }
`,vn=()=>{const e=(0,r.useDispatch)(),t=(0,r.useSelector)(jt),n=(0,r.useSelector)(qt),i=(0,r.useSelector)(Kt),l=(0,r.useSelector)(ae.Ct).find(e=>e._id===i),o=(0,a.useCallback)(()=>{e((0,en.ev)(!1))},[e]),s=(0,a.useCallback)(n=>{const{device_mac_list:r,client_mac_list:a}=V(Object.values(t)),l=i===Jt.T?void 0:i;e((0,en.P$)({...n,device_mac_list:r,client_mac_list:a,id:l})).then(t=>{const n=l||t?.data?.networkconf?._id;e((0,en.nx)(n))})},[e,t,i]);return a.createElement(R.l1,{initialValues:{...Jt.g,internet_access_enabled:!0,network_isolation_enabled:!1},validationSchema:Tn,onSubmit:s,key:i},a.createElement(P.A,{in:n,onClose:o,header:a.createElement(xn,{isExistingRecord:Boolean(l)}),className:In},a.createElement(Nn,null)))};var kn=n(429252),Mn=n.n(kn),Ln=n(17441),Dn=n(9535),wn=n(736388),$n=n(391413),Rn=n(264863),Pn=n(223463),Fn=n(697204),zn=n(823318),Vn=n(727319),Yn=n(764195),Wn=n(966784),Bn=n(325752);const Gn=110,Hn=240,Un=[280,190],Xn=50,jn=e=>{const{x:t,y:n,parent:r,data:a}=e||{},{id:i,state:l,type:o,mac:s,name:c,model:u}=a||{};return{x:t,y:n,parentX:r?.x||0,parentY:r?.y||0,id:i,state:l,type:o,mac:s,name:c,model:u}},Zn=(e,t,n,r,a,i,l,o,s,c,u,m)=>{const d=t.get(e.data.mac),p=n.get(e.data.mac),E=d?.["system-stats"],f=e.data.mac,A=r.filter(e=>e.target.mac===f),h=r.filter(e=>e.source.mac===f),g=(e,t)=>p?e.map(e=>{const n=t?e.edge?.downlinkPortNumber:e.edge?.uplinkPortNumber;if(void 0===n)return null;const r=p.port_table?.find(e=>e.port_idx===n);return r?(0,Wn.vT)(r,p,a,i,l,o,s):null}).filter(e=>null!==e):[];let _=g(A,!0);const C=g(h,!1);if(p?.ethernet_overrides){const e=(p.port_table||[]).map(e=>{if(!e.ifname)return null;if((0,Wn.$k)(e.ifname,p).includes(Bn.Vd.WAN)&&e.up){const t=(0,Wn.vT)(e,p,a,i,l,o,s);return t.icon!==Bn.FZ.ERROR&&t.icon!==Bn.FZ.WARNING&&(t.icon=Bn.FZ.WAN),t}return null}).filter(e=>null!==e),t=new Set(_.map(e=>e.id)),n=e.filter(e=>!t.has(e.id));_=[..._,...n]}let S,b,O;if(e.data.type===B.ISP){const e=u?.[0];if(e){b=e.ip;const{networkgroup:t}=e;O=t;const n=m?.find(e=>e.id===t);void 0!==n?.uptime?S=n.uptime:void 0!==c?.uptime_stats?.[t]?.uptime&&(S=c.uptime_stats[t].uptime)}}return{mem:E?.mem,cpu:E?.cpu,stp_priority:d?.stp_priority,isp_uptime:S,isp_wan_ip:b,isp_wan_networkgroup:O,uplinkLinks:A,uplinkExtendedPorts:_,downlinkLinks:h,downlinkExtendedPorts:C}};var Kn=n(156472),qn=n(559639);const Qn=(0,G.Mz)(ee,wt,(e,t)=>{const n=(e.vertices||[]).filter(e=>!(e=>(0,me.Syn)({model:e.model})||(0,me.Fp0)({model:e.model}))(e)&&!(e=>e?.type===B.CLIENT)(e)&&!(e=>{const n=t.get(e.mac);return!!n&&(0,me.ioy)({type:n.type})})(e));return{...e,vertices:n}}),Jn=(0,G.Mz)(Qn,Z.kX,le.vc,ie.D,Rt,Oe.D5,(e,t,n,r,a,i)=>{const l=Qe(e,r),o=qe(l,i),s=st(o),c=tt(s,t,n,a);return c.length>1||0===c.length?et(c):c[0]}),er=(0,G.Mz)(Jn,le.vc,wt,de.ID,ie.D,Oe.D5,ae.nT,Ae.pB,Kn.G,de.U$,de.DN,qn.Y5,(e,t,n,r,a,i,l,o,s,c,u,m)=>{if(!e)return{nodes:[],links:[]};const d=new Map(r.map(e=>[e.mac,e])),p=(0,Be.Ay)(e,e=>e.children),E=(0,Ge.A)().nodeSize(Un).separation(()=>1)(p),f=((e,t)=>{const n=e.find(e=>e.data.type===B.ISP)||e.find(e=>{if(e.data.type===B.DEVICE&&t){const n=He[e.data.model]?.type;return(0,me.moU)({model:e.data.model,type:n})&&t===e.data.mac}return!1})||e.find(e=>e.data.type===B.DEVICE),r=n?-n.x:0,a=n?-n.y:0;return e.forEach(e=>{e.x+=r,e.y+=a}),e})(E.descendants().filter(e=>e.data.type!==B.INVISIBLE_ROOT),t),A=E.links().map(e=>(e=>{const{source:t,target:n}=e||{};return{source:{id:t.data.id,x:t.x,y:t.y,mac:t.data.mac,type:t.data.type},target:{id:n.data.id,x:n.x,y:n.y,mac:n.data.mac,type:n.data.type},edge:n.data.edge,sourcePortNumber:n.data.edge?.uplinkPortNumber}})(e));return{nodes:f.map(e=>({...jn(e),...Zn(e,n,d,A,a,i,l?._id||"",o,s,c,u,m)})),links:A}});var tr=n(286085);const nr=(0,a.createContext)({treeTransformRef:{current:tr.w},containerSize:null,setContainerSize:()=>{}}),rr=({children:e})=>{const t=(0,r.useSelector)(xt),n=(0,a.useRef)({x:t.x,y:t.y,k:t.k}),[i,l]=(0,a.useState)({containerHeight:0,containerWidth:0,offsetAdjustment:0}),o=(0,a.useMemo)(()=>({treeTransformRef:n,containerSize:i,setContainerSize:l}),[n,i]);return a.createElement(nr.Provider,{value:o},e)},ar=()=>(0,a.useContext)(nr),ir=()=>{const{containerSize:e,setContainerSize:t}=(0,a.useContext)(nr);return{containerSize:e,setContainerSize:t}},lr=(0,a.createContext)({isAnimationBlocked:!1,isTopologyVisible:!0,blockAnimation:()=>{},unblockAnimation:()=>{},blockAnimationTemporarily:()=>{},hideTopology:()=>{},showTopology:()=>{}}),or=({children:e})=>{const[t,n]=(0,a.useState)(!1),[r,i]=(0,a.useState)(!0),l=(0,a.useRef)(null),o=(0,a.useRef)(null),s=(0,a.useCallback)(()=>{l.current&&(clearTimeout(l.current),l.current=null),n(!0)},[]),c=(0,a.useCallback)(()=>{l.current&&(clearTimeout(l.current),l.current=null),n(!1)},[]),u=(0,a.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null),i(!1)},[]),m=(0,a.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null),i(!0)},[]),d=(0,a.useCallback)((e,t=50,n=je.xt)=>{s(),setTimeout(()=>{e()},t),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{c(),l.current=null},n+200)},[s,c]),p=(0,a.useMemo)(()=>({isAnimationBlocked:t,isTopologyVisible:r,blockAnimation:s,unblockAnimation:c,blockAnimationTemporarily:d,hideTopology:u,showTopology:m}),[t,r,s,c,d,u,m]);return a.createElement(lr.Provider,{value:p},e)},sr=()=>(0,a.useContext)(lr);var cr=n(300477);const ur=e=>{const[t,n]=(0,a.useState)((0,cr.A)()),r=(0,a.useCallback)(()=>{n((0,cr.A)())},[]);return(0,a.useEffect)(()=>{const t=setInterval(r,e);return()=>{clearInterval(t)}},[e,r]),t},mr=e=>{const t=e.attr("stroke");e.attr("stroke","rgba(0,0,0,0)"===t?"rgba(255,255,255,0)":"rgba(0,0,0,0)")},dr=()=>{const[e,t]=(0,a.useState)(!1),n=(0,a.useRef)(null);(0,a.useEffect)(()=>{n.current=document.querySelector(`.${je.M_}`)},[]);const r=()=>{t(!1)};return(0,a.useEffect)(()=>{const e=e=>{"Space"!==e.code||e.repeat||t(!0)},n=e=>{"Space"===e.code&&t(!1)};return window.addEventListener("keydown",e),window.addEventListener("keyup",n),window.addEventListener("blur",r),document.addEventListener("visibilitychange",()=>{document.hidden&&r()}),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",n),window.removeEventListener("blur",r),document.removeEventListener("visibilitychange",r)}},[]),e},pr=(e,t,n=!1)=>{const r=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(Vn.T.isSafari&&!n){const n=(0,Fn.A)(`.${je.M_}`),a=a=>{a.preventDefault();const i=a.scale-r.current;if(r.current&&Math.abs(i)>.085){const l=1+i,o=(0,ye.qE)(e.current.k*l,je.ku.min,je.ku.max);n.call(t.current.scaleTo,o),r.current=a.scale}},i=e=>{e.preventDefault(),r.current=e.scale},l=e=>{e.preventDefault(),r.current=null};return document.addEventListener("gesturestart",i),document.addEventListener("gesturechange",a),document.addEventListener("gestureend",l),()=>{document.removeEventListener("gesturestart",i),document.removeEventListener("gesturechange",a),document.removeEventListener("gestureend",l)}}return()=>{}},[e,t,n])},{isSafari:Er}=Vn.T,fr=e=>`translate(${e.x}px, ${e.y}px) scale(${e.k})`,Ar=(e,t)=>{e.style("--d3-zoom-scale",t.toString())},hr=(e,t)=>{const n=`${t.k}`,r=`${e}`,a=(0,Fn.A)(`.${je.M_}`);a.transition("zoom-out").styleTween("--d3-zoom-scale",()=>(0,zn.A)(n,r)).call(()=>mr(a))},gr=(e,t,n)=>{const r=(0,Fn.A)(`.${je.M_}`),a=(0,Fn.A)(`.${je.q3}`);r.on(".zoom",null),r.call(t);const i=Pn.GS.translate(n.current.x,n.current.y).scale(n.current.k);e&&a.style("transform",fr(n.current)),r.call(t.transform,i)},_r=e=>e?.ctrlKey||e?.metaKey,Cr=()=>{const e=(0,r.useSelector)(Gt),{containerSize:t}=ir(),n=(0,r.useSelector)(gt),{showTopology:i}=sr(),{treeTransformRef:l}=ar(),o=dr(),s=(0,r.useSelector)(oe.ed),c=(0,r.useDispatch)();(0,a.useEffect)(()=>{const t=s?.[se.XJ.CONTROL_MODE]||Yn.Z.HAND;t&&t!==e&&c((0,$n.js)(t))},[s,e,c]);const u=(0,a.useRef)({}),m=(0,a.useRef)(null),d=(0,a.useRef)(!1),p=(0,a.useRef)(s.rotateMap),E=(0,a.useRef)(null);pr(l,m,n);const f=(0,a.useRef)(e);(0,a.useEffect)(()=>{f.current=e},[e]);const A=(0,a.useRef)(!1),h=(0,a.useCallback)(()=>{const e=(0,Fn.A)(`.${je.M_}`);if(m.current){const t=Pn.GS.translate(l.current.x,l.current.y).scale(l.current.k);e.call(m.current.transform,t)}},[l]),g=(0,a.useCallback)(e=>{const t=4&e?.buttons;return f.current===Yn.Z.POINTER&&(o||t)?Yn.Z.HAND:f.current},[o]),[_,C]=(0,a.useState)(null);(0,a.useEffect)(()=>{const e=(0,Fn.A)(`.${je.M_}`),t=(0,Fn.A)(`.${je.q3}`),r=e.node();if(!r)return()=>{};const a=r=>{const a=r;if(f.current===Yn.Z.HAND||f.current===Yn.Z.POINTER&&(a.ctrlKey||a.metaKey))return void(A.current&&(h(),A.current=!1));a.preventDefault(),a.stopPropagation(),A.current=!0;const i=.5*a.deltaX,o=.5*a.deltaY,s=l.current.x-i,c=l.current.y-o,u=l.current.k;if(l.current={x:s,y:c,k:u},n)t.style("transform",fr(l.current));else{const n=Pn.GS.translate(s,c).scale(u);t.attr("transform",n.toString()),Er&&(mr(e),Ar(e,u))}};return r.addEventListener("wheel",a,{passive:!1}),()=>{r.removeEventListener("wheel",a)}},[l,h,n]);const S=(0,a.useCallback)(e=>{const t=g(e);return C(t),u.current={effectiveMode:t,originalEvent:e,eventTime:Date.now(),isTrackpad:!1},("wheel"===e.type&&_r(e)||!("wheel"===e.type&&f.current===Yn.Z.POINTER&&!_r(e)))&&(A.current&&setTimeout(()=>{h(),A.current=!1},0),!0)},[g,h]),b=(0,a.useCallback)(({transform:e,sourceEvent:t})=>{const r=(0,Fn.A)(`.${je.M_}`),a=(0,Fn.A)(`.${je.q3}`),i=t||u.current.originalEvent;i?.preventDefault(),i?.stopPropagation();const o=t?g(i):_;C(o);const s=(0,X.A)(e);A.current||(Er&&!n&&(mr(r),Ar(r,s.k)),l.current=s,n?a.style("transform",fr(s)):a.attr("transform",s.toString()),u.current={})},[g,_,l,n]),O=(0,a.useCallback)(e=>(0,Pn.s_)().scaleExtent([je.ku.min,je.ku.max]).on("zoom",e).filter(S),[S]);(0,a.useEffect)(()=>{if(m.current=O(b),m.current&&(gr(n,m.current,l),!n)){(0,Fn.A)(`.${je.M_}`).on("dblclick.zoom",null)}},[O,b,e,l,n]);const y=(0,a.useCallback)(e=>{A.current=!1;const t=(0,Fn.A)(`.${je.M_}`);if(m.current){const n=t.transition();n.call(m.current.scaleBy,e),n.on("end",()=>{setTimeout(()=>{h()},10)})}if(Er&&!n){const t=(0,ye.qE)(l.current.k*e,je.ku.min,je.ku.max);hr(t,l.current)}},[l,h,n]),N=(0,r.useSelector)(Vt),x=(0,r.useSelector)(Nt),T=(0,r.useSelector)(le.vc),I=(0,r.useSelector)(de.CZ),v=(0,r.useSelector)(de.Gi),k=(0,r.useSelector)(Z.RE),M=(0,r.useSelector)(wt),L=(0,r.useSelector)(Lt),D=(0,r.useSelector)(n?er:()=>({nodes:[],links:[]})),{nodes:w}=n?D:{nodes:[]},$=(0,a.useCallback)((e=s)=>{const r=e.rotateMap,a=at(e);let i;if(n)i=((e,t,n,r,a=0)=>{const i=(0,Ue.m4)().range([je.ku.min,je.ku.max]).domain([je.ku.min,je.ku.max]).clamp(!0),l=(n||[]).reduce((e,t)=>(t.type===B.INVISIBLE_ROOT||(e.minX=Math.min(e.minX,t.x-120),e.maxX=Math.max(e.maxX,t.x+120),e.minY=Math.min(e.minY,t.y-55),e.maxY=Math.max(e.maxY,t.y+55)),e),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0}),o=l.maxX-l.minX,s=l.maxY-l.minY,c=t*je.Zm,u=e*je.ZZ,m=(l.minY+l.maxY)/2,d=(l.minX+l.maxX)/2;let p=Math.min(c/o,u/s);p=i(p);let E=t/2,f=e/2;return E-=d*p,f-=r?a/2:m*p,{k:p,x:f,y:E}})(t?.containerWidth??0,t?.containerHeight??0,w,r,t?.offsetAdjustment??0);else{const{nodes:e}=rt(N,x,a,r,T,I,v?.mac,k?.id,M,L);i=((e,t,n,r,a,i=0)=>{const l=(0,Ue.m4)().range([je.ku.min,je.ku.max]).domain([je.ku.min,je.ku.max]).clamp(!0),o=nt(a),s=(n||[]).reduce((e,t)=>t.type===B.INVISIBLE_ROOT?e:t.type===B.ISP?(e.minX=Math.min(e.minX,t.x-je.hD/2+(r?0:o)),e.maxX=Math.max(e.maxX,t.x+je.hD/2),e.minY=Math.min(e.minY,t.y-je.hD/2)+(r?o:0),e.maxY=Math.max(e.maxY,t.y+je.hD/2),e):(e.minX=Math.min(e.minX,t.x-je.hD/2),e.maxX=Math.max(e.maxX,t.x+je.hD/2),e.minY=Math.min(e.minY,t.y-je.hD/2),e.maxY=Math.max(e.maxY,t.y+je.hD/2),e),{minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0}),c=s.maxX-s.minX,u=s.maxY-s.minY,m=t*je.Zm,d=e*je.ZZ,p=(s.minY+s.maxY)/2,E=(s.minX+s.maxX)/2;let f=Math.min(m/c,d/u);f=l(f);let A=t/2,h=e/2;return A-=E*f,h-=r?i/2:p*f,{k:f,x:h,y:A}})(t?.containerWidth??0,t?.containerHeight??0,e,r,a,t?.offsetAdjustment??0)}A.current=!1;const o=(0,Fn.A)(`.${je.M_}`),u=(0,Fn.A)(`.${je.q3}`);if(m.current){const e=Pn.GS.translate(i.x,i.y).scale(i.k);l.current={x:i.x,y:i.y,k:i.k},n?u.transition().duration(0).style("transform",fr(i)).on("end",()=>{setTimeout(()=>{h()},10)}):o.transition().duration(0).call(m.current.transform,e).on("end",()=>{setTimeout(()=>{h()},10)})}Er&&!n&&(hr(i.k,l.current),mr(o)),c((0,$n.zF)({x:l.current.x,y:l.current.y,k:l.current.k}))},[s,N,x,t.containerWidth,t.containerHeight,t.offsetAdjustment,c,l,h,n,T,I,v?.mac,k?.id,M,L,w]);(0,a.useEffect)(()=>{(d.current||p.current!==s.rotateMap)&&(E.current=s.rotateMap,d.current=!1,p.current=s.rotateMap),null!==E.current&&E.current===s.rotateMap&&(E.current=null,requestAnimationFrame(()=>{$(s),requestAnimationFrame(()=>{i()})}))},[s.rotateMap,$,s,i,N,x,T,I,v?.mac,k?.id,M,L,t.containerWidth,t.containerHeight,t.offsetAdjustment,w]);const R=(0,a.useCallback)(()=>{d.current=!0},[]);return(0,a.useEffect)(()=>{m.current&&gr(n,m.current,l)},[l,n]),{zoomBehaviour:m.current,resetZoomTransform:$,onZoomButtonClick:y,requestResetZoomAfterUpdate:R}};var Sr=n(436017),br=n(928085),Or=n(196010),yr=n(959341),Nr=n(445535);const xr=()=>{const e=(0,r.useDispatch)(),t=(0,r.useSelector)(ft),n=(0,r.useSelector)(At),i=(0,br.A)(`${yr.bB}/${yr.Uy.CYBERSECURE}`),l=(0,r.useSelector)(Et),{onlineClientsCount:o,onlineDevicesCount:s}=(0,r.useSelector)(zt),c=(0,r.useSelector)(re.JY),u=(0,a.useCallback)(()=>{e((0,$n.o4)(!l))},[e,l]),[m,d]=(0,a.useState)(!1),[p,E]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!c.enabled)return void d(!1);const t=Boolean(s+o>je.aC);E(t),d(!t),t&&e((0,$n.o4)(!1))},[e,c.enabled,n,t[Re.pC.DEVICES_STATUS]]);const f=(0,a.useMemo)(()=>c.enabled?p?"TOPOLOGY_TRAFFIC_VISUALIZATION_CONTROL_TOO_MANY_NODES":null:"TOPOLOGY_TRAFFIC_IDENTIFICATION_CONTROL_DISABLED",[c.enabled,p]);return a.createElement(Nr.A,null,a.createElement(tn.A,{isInteractive:!c.enabled,description:m?null:a.createElement(fn.sA,{id:f,values:{deviceThreshold:je.aC,link:a.createElement(rn.A,{type:"button",size:"inherit",variant:"inline",component:Or.A,to:i},a.createElement(fn.sA,{id:"COMMON_TRAFFIC_IDENTIFICATION"}))}}),position:"bottom",portal:!0},a.createElement(Sr.A,{onChange:u,checked:l,full:!0,size:"small",disabled:!m&&!l},a.createElement(fn.sA,{id:"TOPOLOGY_TRAFFIC_VISUALIZATION_CONTROL_SHOW"}))))};var Tr=n(156870),Ir=n(727678);const vr=(0,a.memo)(()=>{const{formatMessage:e}=(0,fn.tz)(),t=(0,r.useSelector)(oe.ed),n=(0,r.useDispatch)(),i=(0,a.useMemo)(()=>[{id:se.XJ.SHOW_SSID,title:e({id:"COMMON_SSID"}),type:"CHECKBOX",children:[]},{id:se.XJ.SHOW_SIGNAL,title:e({id:"COMMON_SIGNAL"}),type:"CHECKBOX",children:[]},{id:se.XJ.SHOW_RADIO_CHANNEL,title:e({id:"COMMON_CHANNEL"}),type:"CHECKBOX",children:[]},{id:se.XJ.SHOW_WIFI_STANDARDS,title:e({id:"COMMON_WIFI"}),type:"CHECKBOX",children:[]},{id:se.XJ.SHOW_WIRED,title:e({id:"COMMON_WIRED"}),type:"CHECKBOX",children:[]},{id:se.XJ.SHOW_STP_PRIORITY,title:e({id:"COMMON_STP_PRIORITY"}),type:"CHECKBOX",children:[]}],[e]),l=(0,a.useMemo)(()=>new Set(i.filter(e=>Boolean(t[e.id])).map(e=>e.id)),[i,t]),o=(0,a.useCallback)(e=>{const r=Array.from(e),a=i.find(e=>r.some(t=>t===e.id)!==t[e.id]);a&&n((0,v.bh)({...t,[a.id]:!t[a.id]}))},[i,t,n]);return i.length?a.createElement(Ir.A,{label:a.createElement(fn.sA,{id:"COMMON_LABELS"}),isSingleColumn:!0},a.createElement(Tr.A.Simplified,{items:i,selectedKeys:l,onSelectionChange:o})):null});var kr,Mr=n(773033),Lr=n(888964);!function(e){e[e.DEVICES_STATUS=Re.pC.DEVICES_STATUS]="DEVICES_STATUS"}(kr||(kr={}));var Dr;!function(e){e.COUNT="count",e.ID="id"}(Dr||(Dr={}));const wr=(0,j.WY)()((0,G.Mz)($t,($r=[kr.DEVICES_STATUS],(0,j.WY)()((0,G.Mz)($t,ft,(e,t)=>{return n=Object.values((r=$r,(0,Pe.A)(Ye,r))),e.filter(e=>n.every(n=>n(e,t)));var n,r}),e=>e)),(e,t)=>{const n={},r=e.length;for(let t=0;t<r;t+=1){const r=e[t],a=r?Ve(r):null;a&&(n[a]={[Dr.ID]:a,[Dr.COUNT]:0})}const a=t.length;for(let e=0;e<a;e+=1){const r=t[e],a=r?Ve(r):null;a&&n[a]&&(n[a]={...n[a],[Dr.COUNT]:n[a][Dr.COUNT]+1})}return n}),e=>e);var $r;const Rr=(0,G.Mz)(ft,e=>e[Re.pC.DEVICES_STATUS]),Pr={[Re.sf.ONLINE]:"COMMON_ONLINE",[Re.sf.OFFLINE]:"COMMON_OFFLINE",[Re.sf.ISOLATED]:"COMMON_ISOLATED",[Re.sf.PENDING_ADOPTION]:"COMMON_DEVICE_STATE_PENDING",[Re.sf.MANAGED_BY_ANOTHER_CONSOLE]:"COMMON_DEVICE_STATE_MANAGED_BY_OTHER"},Fr={[Re.sf.ONLINE]:1,[Re.sf.OFFLINE]:2,[Re.sf.ISOLATED]:3,[Re.sf.PENDING_ADOPTION]:4,[Re.sf.MANAGED_BY_ANOTHER_CONSOLE]:5},zr=(0,a.memo)(()=>{const e=(0,r.useDispatch)(),{formatMessage:t}=(0,fn.tz)(),n=(0,r.useSelector)(wr),i=(0,r.useSelector)(Rr),l=(0,a.useMemo)(()=>Object.values(n),[n]),o=(0,a.useMemo)(()=>l.map(e=>e[Dr.ID]),[l]),s=(0,a.useCallback)(t=>{e((0,$n.ym)(Array.from(t)))},[e]),c=(0,a.useCallback)(t=>{e((0,$n.ym)(Array.from(t)))},[e]),u=(0,a.useCallback)(()=>{e((0,$n.ym)([]))},[e]),m=(0,a.useMemo)(()=>l.sort((e,t)=>Fr[e[Dr.ID]]-Fr[t[Dr.ID]]).map(e=>({id:e[Dr.ID],type:"CHECKBOX",title:t({id:Pr[e[Dr.ID]]}),checkboxProps:{count:e[Dr.COUNT],isTruncated:!0},children:[]})),[l,t]),d=(0,a.useMemo)(()=>i.length===l.length?"all":new Set(i),[i,l.length]),p=(0,a.useMemo)(()=>new Set(l.filter(e=>!i.includes(e[Dr.ID])&&!n[e[Dr.ID]][Dr.COUNT]).map(e=>e[Dr.ID])),[l,n,i]);return(0,Mr.A)(i,o,$n.ym),l.length?a.createElement(Nr.A,{id:Lr.R.TOPOLOGY_DEVICES_STATUS,label:a.createElement(fn.sA,{id:"COMMON_STATUS"})},a.createElement(Tr.A,{id:Lr.R.TOPOLOGY_DEVICES_STATUS,items:m,selectedKeys:d,disabledKeys:p,onSelectionChange:s,onSelectAll:c,onDeselectAll:u})):null});var Vr=n(705145),Yr=n(718073),Wr=n(309447),Br=n(97244),Gr=n(149647),Hr=n(71479),Ur=n(160087);const Xr=(0,Hr.A)(dn.A)`
  padding: 2px;
  border-radius: 6px;
  border: ${({theme:{themeName:e}})=>Ne.Ay[`desktop-border-divider-${e}`]};
`,jr=()=>{const e=(0,r.useDispatch)(),t=(0,r.useSelector)(Gt),n=(0,a.useCallback)(()=>{e((0,$n.Yf)(Yn.Z.POINTER))},[e]),i=(0,a.useCallback)(()=>{e((0,$n.Yf)(Yn.Z.HAND))},[e]),l=t===Yn.Z.POINTER;return a.createElement(Ur.s,{gap:"0px !important"},a.createElement(dn.A,{alignItems:"center",justifyContent:"space-between"},a.createElement(Vr.A,{size:"small",weight:"bold",color:"text-1"},a.createElement(fn.sA,{id:"TOPOLOGY_NAVIGATION_MODE"})),a.createElement(Xr,null,a.createElement(Yr.A,{description:a.createElement(fn.sA,{id:"TOPOLOGY_NAVIGATION_MODE_POINTER_TOOLTIP"})},a.createElement(Wr.A,{onPress:n,variant:l?"emphasis":"neutral",size:"small"},a.createElement(Br.A,null))),a.createElement(Yr.A,{description:a.createElement(fn.sA,{id:"TOPOLOGY_NAVIGATION_MODE_HAND_TOOLTIP"})},a.createElement(Wr.A,{onPress:i,variant:l?"neutral":"emphasis",size:"small"},a.createElement(Gr.A,null))))))},Zr={[Re.pC.CLIENTS_VLANS]:[],[Re.pC.CLIENTS_BROADCAST]:[],[Re.pC.CLIENTS_CONNECTION]:[],[Re.pC.CLIENTS_VENDORS]:[],[Re.pC.CLIENTS_DEVICE_TYPES]:[],[Re.pC.DEVICES_STATUS]:[]},Kr=(0,Hr.A)(dn.A)`
  > div:first-child {
    /** This is trick to avoid seeing topology on left/top side of the filter. */
    margin-left: -${ln.xO};
    margin-top: -${ln.xO};
    padding-top: ${ln.xO};
    padding-left: ${ln.xO};
    background-color: ${u.L};
  }
`;var qr,Qr;!function(e){e[e.CLIENTS_CONNECTION=Re.pC.CLIENTS_CONNECTION]="CLIENTS_CONNECTION",e[e.CLIENTS_BROADCAST=Re.pC.CLIENTS_BROADCAST]="CLIENTS_BROADCAST",e[e.CLIENTS_VLANS=Re.pC.CLIENTS_VLANS]="CLIENTS_VLANS",e[e.CLIENTS_VENDORS=Re.pC.CLIENTS_VENDORS]="CLIENTS_VENDORS",e[e.CLIENTS_DEVICE_TYPES=Re.pC.CLIENTS_DEVICE_TYPES]="CLIENTS_DEVICE_TYPES"}(qr||(qr={})),function(e){e.NAME="name",e.COUNT="count",e.ID="id"}(Qr||(Qr={}));const Jr=e=>(0,j.WY)()((0,G.Mz)(Dt,ft,(t,n)=>{return r=Object.values((a=e,(0,Pe.A)(mt,a))),t.filter(e=>r.every(t=>t(e,n)));var r,a}),e=>e),ea=(0,j.WY)()((0,G.Mz)(Dt,Jr([qr.CLIENTS_VLANS]),ae.L4,(e,t,n)=>{const r={},a=e.length;for(let t=0;t<a;t+=1){const a=e[t];if(a.edge?.networkId){const e=n.find(({_id:e})=>e===a.edge?.networkId);e&&(r[a.edge?.networkId]={[Qr.NAME]:e.name,[Qr.ID]:e._id,[Qr.COUNT]:0})}}const i=t.length;for(let e=0;e<i;e+=1){const n=t[e];n.edge?.networkId&&r[n.edge?.networkId]&&(r[n.edge?.networkId]={...r[n.edge?.networkId],[Qr.COUNT]:r[n.edge?.networkId][Qr.COUNT]+1})}return r}),e=>e),ta=(0,G.Mz)(ft,e=>e[Re.pC.CLIENTS_VLANS]),na=(0,a.memo)(()=>{const e=(0,r.useDispatch)(),t=(0,r.useSelector)(ea),n=(0,r.useSelector)(ta),i=(0,a.useMemo)(()=>Object.values(t),[t]),l=(0,a.useMemo)(()=>i.map(e=>e[Qr.ID]),[i]),o=(0,a.useCallback)(t=>{e((0,$n.Zg)(Array.from(t)))},[e]),s=(0,a.useCallback)(t=>{e((0,$n.Zg)(Array.from(t)))},[e]),c=(0,a.useCallback)(()=>{e((0,$n.Zg)([]))},[e]),u=(0,a.useMemo)(()=>i.sort((e,t)=>t[Qr.COUNT]-e[Qr.COUNT]).map(e=>({id:e[Qr.ID],type:"CHECKBOX",title:e[Qr.NAME],checkboxProps:{count:e[Qr.COUNT],isTruncated:!0},children:[]})),[i]),m=(0,a.useMemo)(()=>n.length===i.length?"all":new Set(n),[n,i.length]),d=(0,a.useMemo)(()=>new Set(i.filter(e=>!n.includes(e[Qr.ID])&&!t[e[Qr.ID]][Qr.COUNT]).map(e=>e[Qr.ID])),[i,t,n]);return(0,Mr.A)(n,l,$n.Zg),i.length?a.createElement(Nr.A,{id:Lr.R.TOPOLOGY_CLIENTS_VLANS,label:a.createElement(fn.sA,{id:"COMMON_VLANS"})},a.createElement(Tr.A,{id:Lr.R.TOPOLOGY_CLIENTS_VLANS,items:u,selectedKeys:m,disabledKeys:d,onSelectionChange:o,onSelectAll:s,onDeselectAll:c})):null});var ra;!function(e){e.NAME="name",e.COUNT="count"}(ra||(ra={}));const aa=(0,j.WY)()((0,G.Mz)(Dt,Jr([qr.CLIENTS_VENDORS]),(e,t)=>{const n={},r=e.length;for(let t=0;t<r;t+=1){const r=e[t];r.fingerprintData?.fingerprint_device_vendor&&(n[r.fingerprintData?.fingerprint_device_vendor]={[ra.NAME]:r.fingerprintData?.fingerprint_device_vendor,[ra.COUNT]:0})}const a=t.length;for(let e=0;e<a;e+=1){const r=t[e];r.fingerprintData?.fingerprint_device_vendor&&n[r.fingerprintData?.fingerprint_device_vendor]&&(n[r.fingerprintData?.fingerprint_device_vendor]={...n[r.fingerprintData?.fingerprint_device_vendor],[ra.COUNT]:n[r.fingerprintData?.fingerprint_device_vendor][ra.COUNT]+1})}return n}),e=>e),ia=(0,G.Mz)(ft,e=>e[Re.pC.CLIENTS_VENDORS]),la=(0,a.memo)(()=>{const e=(0,r.useDispatch)(),t=(0,r.useSelector)(aa),n=(0,r.useSelector)(ia),i=(0,a.useMemo)(()=>Object.values(t),[t]),l=(0,a.useMemo)(()=>i.map(e=>e[ra.NAME]),[i]),o=(0,a.useCallback)(t=>{e((0,$n._Q)(Array.from(t)))},[e]),s=(0,a.useCallback)(t=>{e((0,$n._Q)(Array.from(t)))},[e]),c=(0,a.useCallback)(()=>{e((0,$n._Q)([]))},[e]),u=(0,a.useMemo)(()=>i.sort((e,t)=>t[ra.COUNT]-e[ra.COUNT]).map(e=>({id:e[ra.NAME],type:"CHECKBOX",title:e[ra.NAME],checkboxProps:{count:e[ra.COUNT],isTruncated:!0},children:[]})),[i]),m=(0,a.useMemo)(()=>n.length===i.length?"all":new Set(n),[n,i.length]),d=(0,a.useMemo)(()=>new Set(i.filter(e=>!n.includes(e[ra.NAME])&&!t[e[ra.NAME]][ra.COUNT]).map(e=>e[ra.NAME])),[i,t,n]);return(0,Mr.A)(n,l,$n._Q),i.length?a.createElement(Nr.A,{id:Lr.R.TOPOLOGY_CLIENTS_VENDORS,label:a.createElement(fn.sA,{id:"COMMON_VENDORS"})},a.createElement(Tr.A,{id:Lr.R.TOPOLOGY_CLIENTS_VENDORS,items:u,selectedKeys:m,disabledKeys:d,onSelectionChange:o,onSelectAll:s,onDeselectAll:c,treeProps:{selectionMode:"single"}})):null});var oa;!function(e){e.NAME="name",e.COUNT="count"}(oa||(oa={}));const sa=(0,j.WY)()((0,G.Mz)(Dt,Jr([qr.CLIENTS_DEVICE_TYPES]),(e,t)=>{const n={},r=e.length;for(let t=0;t<r;t+=1){const r=e[t];r.fingerprintData?.fingerprint_device_name&&(n[r.fingerprintData?.fingerprint_device_name]={[oa.NAME]:r.fingerprintData?.fingerprint_device_name,[oa.COUNT]:0})}const a=t.length;for(let e=0;e<a;e+=1){const r=t[e];r.fingerprintData?.fingerprint_device_name&&n[r.fingerprintData?.fingerprint_device_name]&&(n[r.fingerprintData?.fingerprint_device_name]={...n[r.fingerprintData?.fingerprint_device_name],[oa.COUNT]:n[r.fingerprintData?.fingerprint_device_name][oa.COUNT]+1})}return n}),e=>e),ca=(0,G.Mz)(ft,e=>e[Re.pC.CLIENTS_DEVICE_TYPES]),ua=(0,a.memo)(()=>{const e=(0,r.useDispatch)(),t=(0,r.useSelector)(sa),n=(0,r.useSelector)(ca),i=(0,a.useMemo)(()=>Object.values(t),[t]),l=(0,a.useMemo)(()=>i.map(e=>e[oa.NAME]),[i]),o=(0,a.useCallback)(t=>{e((0,$n.Rj)(Array.from(t)))},[e]),s=(0,a.useCallback)(t=>{e((0,$n.Rj)(Array.from(t)))},[e]),c=(0,a.useCallback)(()=>{e((0,$n.Rj)([]))},[e]),u=(0,a.useMemo)(()=>i.sort((e,t)=>t[oa.COUNT]-e[oa.COUNT]).map(e=>({id:e[oa.NAME],type:"CHECKBOX",title:e[oa.NAME],checkboxProps:{count:e[oa.COUNT],isTruncated:!0},children:[]})),[i]),m=(0,a.useMemo)(()=>n.length===i.length?"all":new Set(n),[n,i.length]),d=(0,a.useMemo)(()=>new Set(i.filter(e=>!n.includes(e[oa.NAME])&&!t[e[oa.NAME]][oa.COUNT]).map(e=>e[oa.NAME])),[i,t,n]);return(0,Mr.A)(n,l,$n.Rj),i.length?a.createElement(Nr.A,{id:Lr.R.TOPOLOGY_CLIENTS_FINGERPRINT_DEVICE_NAMES,label:a.createElement(fn.sA,{id:"COMMON_DEVICE_TYPE"})},a.createElement(Tr.A,{id:Lr.R.TOPOLOGY_CLIENTS_FINGERPRINT_DEVICE_NAMES,items:u,selectedKeys:m,disabledKeys:d,onSelectionChange:o,onSelectAll:s,onDeselectAll:c})):null});var ma;!function(e){e.NAME="name",e.COUNT="count"}(ma||(ma={}));const da=(0,j.WY)()((0,G.Mz)(Dt,Jr([qr.CLIENTS_CONNECTION]),(e,t)=>{const n={},r=e.length;for(let t=0;t<r;t+=1){const r=e[t],a=ut(r);a&&(n[a]={[ma.NAME]:a,[ma.COUNT]:0})}const a=t.length;for(let e=0;e<a;e+=1){const r=t[e],a=ut(r);a&&n[a]&&(n[a]={...n[a],[ma.COUNT]:n[a][ma.COUNT]+1})}return n}),e=>e),pa=(0,G.Mz)(ft,e=>e[Re.pC.CLIENTS_CONNECTION]),Ea=l.AH`
  & > div {
    margin: 0 !important;
  }
`,fa=()=>{const e=(0,r.useSelector)(At),t=(0,r.useDispatch)(),{requestResetZoomAfterUpdate:n}=Cr(),i=(0,a.useCallback)(e=>{t((0,$n.TC)(e.target.checked)),e.target.checked||(t((0,$n.gM)([])),t((0,$n.Zg)([])),t((0,$n._Q)([])),t((0,$n.$N)([])),t((0,$n.Rj)([]))),n()},[t,n]);return a.createElement(Sr.A,{onChange:i,checked:e,size:"small",className:Ea})},Aa={[Re.$o.CONNECTION_WIRED]:"COMMON_WIRED",[Re.$o.CONNECTION_2G]:"TOPOLOGY_FILTER_SHOW_2G_CLIENTS",[Re.$o.CONNECTION_5G]:"TOPOLOGY_FILTER_SHOW_5G_CLIENTS",[Re.$o.CONNECTION_6G]:"TOPOLOGY_FILTER_SHOW_6G_CLIENTS"},ha={[Re.$o.CONNECTION_WIRED]:1,[Re.$o.CONNECTION_2G]:2,[Re.$o.CONNECTION_5G]:3,[Re.$o.CONNECTION_6G]:4},ga=(0,a.memo)(()=>{const e=(0,r.useDispatch)(),{formatMessage:t}=(0,fn.tz)(),n=(0,r.useSelector)(da),i=(0,r.useSelector)(pa),l=(0,a.useMemo)(()=>Object.values(n),[n]),o=(0,a.useMemo)(()=>l.map(e=>e[ma.NAME]),[l]),s=(0,a.useCallback)(t=>{const n=Array.from(t);e((0,$n.gM)(n)),n.length>0&&e((0,$n.TC)(!0))},[e]),c=(0,a.useMemo)(()=>l.sort((e,t)=>ha[e[ma.NAME]]-ha[t[ma.NAME]]).map(e=>({id:e[ma.NAME],type:"CHECKBOX",title:t({id:Aa[e[ma.NAME]]}),checkboxProps:{count:e[ma.COUNT],isTruncated:!0},children:[]})),[l,t]),u=(0,a.useMemo)(()=>i.length===l.length?"all":new Set(i),[i,l.length]),m=(0,a.useMemo)(()=>new Set(l.filter(e=>!i.includes(e[ma.NAME])&&!n[e[ma.NAME]][ma.COUNT]).map(e=>e[ma.NAME])),[l,n,i]);return(0,Mr.A)(i,o,$n.gM),l.length?a.createElement(Ir.A,{label:a.createElement(dn.A,{alignItems:"center",gap:ln.kc,justifyContent:"space-between",width:"100%"},a.createElement(Vr.A,{size:"small",weight:"bold",color:"text-1"},a.createElement(fn.sA,{id:"COMMON_CLIENT_DEVICES"})),a.createElement(fa,null)),isSingleColumn:!0,isStatic:!0},a.createElement(Tr.A.Simplified,{items:c,selectedKeys:u,disabledKeys:m,onSelectionChange:s})):null});var _a,Ca=n(477544);!function(e){e.NAME="name",e.COUNT="count"}(_a||(_a={}));const Sa=(0,j.WY)()((0,G.Mz)(Dt,Jr([qr.CLIENTS_BROADCAST]),Ca.Ag,(e,t,n)=>{const r={},a=e.length;for(let t=0;t<a;t+=1){const a=e[t];if(a.edge?.essid){const e=n.find(({name:e})=>e===a.edge?.essid);e&&(r[a.edge?.essid]={[_a.NAME]:e.name,[_a.COUNT]:0})}}const i=t.length;for(let e=0;e<i;e+=1){const n=t[e];n.edge?.essid&&r[n.edge?.essid]&&(r[n.edge?.essid]={...r[n.edge?.essid],[_a.COUNT]:r[n.edge?.essid][_a.COUNT]+1})}return r}),e=>e),ba=(0,G.Mz)(ft,e=>e[Re.pC.CLIENTS_BROADCAST]),Oa=(0,a.memo)(()=>{const e=(0,r.useDispatch)(),t=(0,r.useSelector)(Sa),n=(0,r.useSelector)(ba),i=(0,a.useMemo)(()=>Object.values(t),[t]),l=(0,a.useMemo)(()=>i.map(e=>e[_a.NAME]),[i]),o=(0,a.useCallback)(t=>{e((0,$n.$N)(Array.from(t)))},[e]),s=(0,a.useCallback)(t=>{e((0,$n.$N)(Array.from(t)))},[e]),c=(0,a.useCallback)(()=>{e((0,$n.$N)([]))},[e]),u=(0,a.useMemo)(()=>i.sort((e,t)=>t[_a.COUNT]-e[_a.COUNT]).map(e=>({id:e[_a.NAME],type:"CHECKBOX",title:e[_a.NAME],checkboxProps:{count:e[_a.COUNT],isTruncated:!0},children:[]})),[i]),m=(0,a.useMemo)(()=>n.length===i.length?"all":new Set(n),[n,i.length]),d=(0,a.useMemo)(()=>new Set(i.filter(e=>!n.includes(e[_a.NAME])&&!t[e[_a.NAME]][_a.COUNT]).map(e=>e[_a.NAME])),[i,t,n]);return(0,Mr.A)(n,l,$n.$N),i.length?a.createElement(Nr.A,{id:Lr.R.TOPOLOGY_CLIENTS_WIFI_BROADCASTS,label:a.createElement(fn.sA,{id:"COMMON_WIFI_BROADCASTS"})},a.createElement(Tr.A,{id:Lr.R.TOPOLOGY_CLIENTS_WIFI_BROADCASTS,items:u,selectedKeys:m,disabledKeys:d,onSelectionChange:o,onSelectAll:s,onDeselectAll:c})):null});var ya,Na=n(35993),xa=n(83427),Ta=n(900752);!function(e){e.TOPOLOGY="TOPOLOGY",e.INFRASTRUCTURE="INFRASTRUCTURE"}(ya||(ya={}));const Ia=[{icon:a.createElement(Na.A,{size:"original"}),label:a.createElement(fn.sA,{id:"COMMON_SIDE_NAV_TOPOLOGY"}),id:ya.TOPOLOGY},{icon:a.createElement(xa.A,{size:"original"}),label:a.createElement(fn.sA,{id:"TOPOLOGY_INFRASTRUCTURE"}),id:ya.INFRASTRUCTURE}],va=(0,a.memo)(()=>{const e=(0,r.useDispatch)(),t=(0,r.useSelector)(gt),n=(0,r.useSelector)(_t),[i,l]=(0,a.useState)("#infrastructure"===window.location.hash);(0,a.useEffect)(()=>{const e=()=>{l("#infrastructure"===window.location.hash)};return e(),window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[]);const o=(0,a.useMemo)(()=>i&&n?Ia:Ia.filter(e=>e.id===ya.TOPOLOGY),[i,n]),s=t?ya.INFRASTRUCTURE:ya.TOPOLOGY,c=(0,a.useCallback)(t=>{(t.id!==ya.INFRASTRUCTURE||i&&n)&&e((0,$n.J_)(t.id===ya.INFRASTRUCTURE))},[e,i,n]);return a.createElement(Ta.A,{tabs:o,selectedTab:s,onSelectTab:c})}),ka=()=>{const{requestResetZoomAfterUpdate:e}=Cr(),t=(0,r.useDispatch)(),n=(0,r.useSelector)(ft),i=(0,r.useSelector)(At),l=(0,a.useCallback)(()=>{t((0,$n.IB)()),e()},[t,e]),o=(0,a.useMemo)(()=>Mn()(n,Zr),[n]),s=(0,r.useSelector)(gt);return a.createElement(Kr,null,a.createElement(wn.A,{leftFilterPageId:m.g1.TOPOLOGY,footer:a.createElement(Ln.A,null,a.createElement(Dn.A,{onClear:l,disabled:o})),tabs:a.createElement(va,null)},a.createElement(dn.A,{flexDirection:"column"},s?null:a.createElement(a.Fragment,null,a.createElement(Rn.A,null,a.createElement(xr,null)),a.createElement(zr,null),a.createElement(ga,null),i?a.createElement(a.Fragment,null,a.createElement(na,null),a.createElement(Oa,null),a.createElement(la,null),a.createElement(ua,null)):null,a.createElement(vr,null)),a.createElement(Rn.A,null,a.createElement(jr,null)))))};var Ma=n(340936);const La=e=>{const t=(0,r.useDispatch)(),{treeTransformRef:n,containerSize:i}=ar(),l=(0,r.useSelector)(Tt);(0,a.useEffect)(()=>{const r=Mn()(n.current,tr.w);l&&!r||0===i.containerWidth||0===i.containerHeight||(e(),t((0,$n.Zi)(!0)))},[t,e,n,l,i])},Da=()=>{const e=(0,r.useDispatch)(),{treeTransformRef:t}=ar();(0,a.useEffect)(()=>{const n=setInterval(()=>{e((0,$n.zF)({x:t.current.x,y:t.current.y,k:t.current.k}))},je.hY);return()=>clearInterval(n)},[e,t])},wa=(e,t,n=[])=>{const r=n=>{n.key===e&&(n.metaKey||n.ctrlKey)&&(t(n),n.preventDefault(),n.stopPropagation())};(0,a.useEffect)(()=>(document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}),n)};var $a=n(515289),Ra=n(75585),Pa=n(212178),Fa=n(825032),za=n(845030),Va=n(601021),Ya=n(501524);const Wa=(0,Hr.A)(dn.A)`
  align-items: center;
  width: 100%;
  height: 100%;
  z-index: 600; // Side panel has 700. This container should be over topology content, but under side panel.
  gap: ${ln.kc};
`,Ba=l.AH`
  overflow: hidden;
  gap: 8px;
  max-width: 300px;
  height: 24px;

  &:hover {
    overflow-x: auto;
    &::-webkit-scrollbar-thumb,
    &::-webkit-scrollbar-track {
      border: none;
    }
    &::-webkit-scrollbar {
      height: 4px;
    }
  }

  > * {
    flex-shrink: 0;
  }
`,Ga=(0,Hr.A)("div",{shouldForwardProp:e=>!["blurLeft","blurRight"].includes(e)})`
  position: relative;
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    ${({blurLeft:e})=>`width: ${e}px;`}
    height: 100%;
    background: linear-gradient(
      to right,
      ${({theme:{motifPalette:{neutral00:e}}})=>e}
        0%,
      rgba(255, 255, 255, 0) 100%
    );
    z-index: 1;
  }

  &::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    ${({blurRight:e})=>`width: ${e}px;`}
    height: 100%;
    background: linear-gradient(
      to left,
      ${({theme:{motifPalette:{neutral00:e}}})=>e}
        0%,
      rgba(255, 255, 255, 0) 100%
    );
    z-index: 1;
  }
`,Ha=(0,Hr.A)($a.A,{shouldForwardProp:e=>!["bgColor"].includes(e)})`
  display: flex;
  justify-content: center;
  align-items: center;
  height: 24px;
  padding: 0 !important;
  margin: 0 !important;
  border: none;
  border-radius: 16px;
  background-color: ${({bgColor:e})=>e};

  & > span {
    display: block;
    margin: ${Ne.Ay["desktop-spacing-base-01"]} ${Ne.Ay["desktop-spacing-base-02"]} !important;
    padding: 0 !important;
    font-size: 12px !important;
    max-width: 130px;
  }
`,Ua=(0,a.memo)(()=>{const e=(0,r.useDispatch)(),{themeName:t,motifPalette:{uBlue08:n,uBlue01:l,neutral02:o}}=(0,i.u)(),s=(0,r.useSelector)(Ya.nd),c=(0,r.useSelector)(Kt),u=(0,r.useSelector)(le.EL),m=(0,a.useCallback)((t,n)=>{n?e((0,en.ev)(!1)):(e((0,Va.p)(!1)),e((0,en.nx)(t.value)),e((0,en.ev)(!0)),e((0,za.K5)()))},[e]),d=(0,a.useCallback)(()=>{e((0,Va.p)(!1)),e((0,za.K5)()),e((0,en.nx)(Jt.T)),e((0,en.ev)(!0))},[e]),[p,E]=(0,a.useState)(0),[f,A]=(0,a.useState)(0),h=(0,a.useRef)(null),g=(0,a.useCallback)(()=>{if(!h?.current)return;const e=h.current.scrollWidth-h.current.clientWidth,t=h.current.scrollLeft,n=e-h.current.scrollLeft;E((0,ye.qE)(Math.round(t),0,12)),A((0,ye.qE)(Math.round(n),0,12))},[]);(0,a.useLayoutEffect)(()=>{g()},[g]);const _=(0,Pa.A)(s);(0,a.useEffect)(()=>{_&&_.length!==s.length&&h?.current&&(h.current.scrollLeft=h.current.scrollWidth)},[s,_]);const C=(0,a.useCallback)(e=>()=>{m(e,e.value===c)},[m,c]);return a.createElement(Wa,null,u?null:a.createElement(tn.A,{description:a.createElement(fn.sA,{id:"TOPOLOGY_VP_CREATE_VIRTUAL_NETWORK"}),position:"bottom",portal:!0,offset:16},a.createElement(ii,{Icon:Ra.A,name:"add-vlan",onClick:d,size:"medium",variant:"tertiary"})),s.length?a.createElement(Ga,{blurLeft:p,blurRight:f},a.createElement(dn.A,{onScroll:g,className:Ba,ref:h},s.map(e=>a.createElement(Ha,{key:e.value,label:e.label,onClick:C(e),bgColor:e.value===c?t===Fa.S.DARK?n:l:o})))):null)});var Xa=n(954459),ja=n(317662),Za=n(518365),Ka=n(15005),qa=n(168496),Qa=n(720676),Ja=n(372088),ei=n(315249);const ti=(0,Hr.A)(Xa.A)`
  background: ${({theme:{motifPalette:{neutral00:e}}})=>e};
  bottom: ${ln.Ln};
  left: ${ln.Ln};
`,ni=(0,Hr.A)(ja.A)`
  gap: ${ln.kc};
  padding: ${ln.YC};
`,ri=(0,Hr.A)(Za.A,{shouldForwardProp:e=>"active"!==e})`
  background-color: ${({active:e,theme:{themeName:t,motifPalette:{uBlue09:n,uBlue01:r}}})=>e?t===Fa.S.DARK?n:r:"unset"} !important;
  border-radius: 4px !important;
  padding: 2px !important;
  width: 24px !important;
  height: 24px !important;
`,ai=({onZoomChange:e,onZoomReset:t,offsetAdjustment:n})=>{const{blockAnimationTemporarily:i,hideTopology:l}=sr(),{requestResetZoomAfterUpdate:o}=Cr(),s=(0,r.useDispatch)(),c=(0,r.useSelector)(oe.ed),u=(0,r.useSelector)(gt),m=(0,a.useRef)(0),d=(0,a.useCallback)(()=>{e(je.mD)},[e]),p=(0,a.useCallback)(()=>{e(je.Le)},[e]),E=(0,a.useCallback)(()=>{const e=Date.now();e-m.current<200||(m.current=e,l(),i(()=>{const e={...c,rotateMap:!c.rotateMap};o(),s((0,v.bh)(e))}))},[i,l,c,s,o]);return a.createElement(Ka.A,null,a.createElement(ti,{direction:"bottom",align:"left",style:{transform:`translateX(${n}px)`}},a.createElement(ni,{id:"zooms"},!u&&a.createElement(Yr.A,{description:a.createElement(fn.sA,{id:"TOPOLOGY_ROTATE_TOOLTIP"}),placement:"top"},a.createElement(ri,{icon:a.createElement(qa.A,{isActive:c.rotateMap}),iconProps:{isActive:c.rotateMap},onClick:E})),a.createElement(ri,{icon:a.createElement(Ja.A,{size:"original"}),onClick:()=>t()}),a.createElement(ri,{icon:a.createElement(ei.A,{size:"original"}),onClick:d}),a.createElement(ri,{icon:a.createElement(Qa.A,{size:"original"}),onClick:p}))))},ii=(0,Hr.A)(rn.A)`
  width: 24px;
  height: 24px;
  padding: 2px;
  color: ${({theme:{motifPalette:{neutral08:e}}})=>e};
  :active {
    color: ${({theme:{motifPalette:{neutral08:e}}})=>e};
  }
`,li=(0,Hr.A)(dn.A)`
  padding: ${Ne.Ay["desktop-spacing-base-01"]};
  box-shadow: ${({theme:{motifPalette:{shadowLow:e}}})=>e};
  border-radius: ${Ne.Ay["desktop-radius-base"]};
  gap: ${Ne.Ay["desktop-spacing-base-02"]};
  // todo: move into shared Z-indexes file
  z-index: 100;
  background-color: ${({theme:{motifPalette:{neutral00:e}}})=>e};
`,oi=(0,Hr.A)(dn.A)`
  position: absolute;
  bottom: ${Ne.Ay["desktop-spacing-base-04"]};
  left: 50%;
  transform: translateX(calc(-50% + ${({offsetAdjustment:e})=>+e/2}px));
  z-index: 100;
  gap: ${ln.kc};
  min-height: 32px;
`,si=({onZoomChange:e,onZoomReset:t,offsetAdjustment:n=0})=>{const i=(0,r.useSelector)((0,Ae.jN)(fe.Xj.VISUAL_PROGRAMMING)),l=(0,r.useSelector)(gt),o=(0,a.useCallback)(()=>{e(je.mD)},[e]),s=(0,a.useCallback)(()=>{e(je.Le)},[e]);return wa("=",o,[o]),wa("+",o,[o]),wa("-",s,[s]),wa("_",s,[s]),wa("0",()=>t(),[t]),a.createElement(a.Fragment,null,i&&!l?a.createElement(oi,{offsetAdjustment:n},a.createElement(li,null,a.createElement(Ua,null))):null,a.createElement(ai,{onZoomChange:e,onZoomReset:t,offsetAdjustment:n}))};var ci=n(217439),ui=n(590976),mi=n(970929),di=n(6176),pi=n(876250),Ei=n(6510),fi=n(568777),Ai=n(54317),hi=n(594827),gi=n(656432);const _i=(0,Hr.A)("div")`
  padding: 2px ${ln.YC};
  display: flex;
  align-items: center;
  gap: ${ln.kc};
  border-radius: ${ln.YC};
  background-color: ${({theme:{motifPalette:e}})=>e.neutral01};
  border: 1px solid ${({theme:{motifPalette:e}})=>e.neutral03};
  box-sizing: border-box;
  align-self: stretch;
  width: ${Xn}px;
  min-width: ${Xn}px;
`,Ci=({port:e})=>a.createElement(_i,null,a.createElement(gi.A,{port:e,isInteractive:!1}),a.createElement(ci.A,{size:"small"},e.port_idx));var Si=n(17437),bi=n(595235),Oi=n(874807),yi=n(548212),Ni=n(691108),xi=n(440503),Ti=n(994791);const Ii=(0,yi.xn)(6),vi=(0,Hr.A)(dn.A,{shouldForwardProp:e=>!["color","background","border","isLocating","isInteractive"].includes(e)})`
  align-items: center;
  color: ${({color:e})=>e};
  justify-content: center;
  position: relative;
  pointer-events: auto;
  cursor: ${({isInteractive:e})=>e?"pointer":"default"};
  width: 20px;
  height: 20px;
  border-radius: ${ln.YC};
  flex-shrink: 0;
  ${({background:e})=>e?`background: ${e};`:""}
  ${({border:e})=>e?`border: 1px solid ${e}; `:""}
  ${({isLocating:e})=>e?Si.AH`
          animation: ${Ii} 1s cubic-bezier(0.5, 1, 0, 1) infinite alternate;
        `:""}
`,ki=({port:e,isInteractive:t})=>{const n=(0,r.useSelector)(e.port_idx?(0,Ti.JX)(e.port_idx,e.device.mac):Oi.wE),{background:l,border:o,text:s}=(0,a.useMemo)(()=>(0,yi.PI)(e),[e]),{themeName:c}=(0,i.u)(),u=e.icon!==Bn.FZ.ERROR&&e.icon!==Bn.FZ.WARNING;return a.createElement(Ni.A,{port:e,position:"right"},u?a.createElement(vi,{color:(0,Wn.oX)(s,c),background:(0,Wn.oX)(l,c),border:(0,Wn.oX)(o,c),isLocating:n,isInteractive:t},a.createElement(bi.A,{size:"original"})):a.createElement(xi.A,{background:l,border:o,text:s,icon:e.icon,isLocating:n,isInteractive:t}))},Mi=(0,Hr.A)("div")`
  padding: 2px ${ln.YC};
  display: flex;
  align-items: center;
  gap: ${ln.kc};
  border-radius: ${ln.YC};
  background-color: ${({theme:{motifPalette:e}})=>e.neutral01};
  border: 1px solid ${({theme:{motifPalette:e}})=>e.neutral03};
  box-sizing: border-box;
  align-self: stretch;
  width: ${Xn}px;
  min-width: ${Xn}px;
`,Li=({port:e})=>a.createElement(Mi,null,a.createElement(ki,{port:e,isInteractive:!1}),a.createElement(ci.A,{size:"small"},e.port_idx)),Di=(0,Hr.A)("div")`
  padding: 2px ${ln.YC};
  display: flex;
  align-items: center;
  justify-content: center;
  gap: ${ln.kc};
  border-radius: ${ln.YC};
  background-color: ${({theme:{motifPalette:e}})=>e.neutral01};
  border: 1px solid ${({theme:{motifPalette:e}})=>e.neutral03};
  box-sizing: border-box;
  align-self: stretch;
  min-height: 100%;
  width: ${Xn}px;
  min-width: ${Xn}px;
`,wi=({remainingPorts:e})=>a.createElement(Di,null,a.createElement(ci.A,{size:"small"},"...")),$i=(0,Hr.A)("div")`
  position: absolute;
  width: ${Hn}px;
  height: ${Gn}px;
  left: ${({x:e})=>e}px;
  top: ${({y:e})=>e}px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  gap: ${ln.YC};
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
`,Ri=(0,Hr.A)("div")`
  display: flex;
  align-items: center;
  justify-content: center;
  gap: ${8}px;
  padding: 0 ${8}px;
  box-sizing: border-box;
  height: 26px;
`,Pi=(0,Hr.A)("div")`
  display: flex;
  align-items: center;
  padding: ${4}px ${8}px;
  gap: ${4}px;
  box-sizing: border-box;
  background-color: ${({theme:{motifPalette:e}})=>e.neutral01};
  border: 1px solid ${({theme:{motifPalette:e}})=>e.neutral03};
  border-radius: 8px;
`,Fi=(0,Hr.A)("div")`
  width: ${40}px;
  height: ${40}px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
`,zi=(0,Hr.A)("div")`
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
`,Vi=(0,Hr.A)("div")`
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  align-items: flex-end;
  color: ${({theme:{themeName:e}})=>Ne.Ay[`desktop-color-neutral-08-${e}`]};
`,Yi=(0,Hr.A)("div")`
  display: flex;
  align-items: stretch;
  gap: ${8}px;
  padding: 0 ${8}px;
  box-sizing: border-box;
  overflow: hidden;
  justify-content: center;
`,Wi=({nodeAttributes:e})=>{const{x:t,y:n,name:i,model:l,mem:o,cpu:s,stp_priority:c,mac:u,type:m,uplinkExtendedPorts:d,downlinkExtendedPorts:p,isp_uptime:E,isp_wan_ip:f,isp_wan_networkgroup:A}=e,{formatMessage:h}=(0,fn.tz)(),g=m===B.ISP,_=(0,r.useSelector)(de.CZ),C=(0,r.useSelector)(de.Gi),S=(0,r.useSelector)(Z.sN),b=(0,r.useSelector)(Z.Vw),O=(_?C?.lte_networkoperator:S.find(e=>e.isActive)?.serviceProviderName)||h({id:"COMMON_ISP"}),y=g&&1===b.length&&A?(0,hi.qY)(A,h):null;return a.createElement($i,{x:t,y:n},a.createElement(Ri,null,d?.map(e=>a.createElement(Ci,{key:e.id,port:e}))),a.createElement(Pi,null,a.createElement(Fi,null,g?a.createElement(a.Fragment,null,_&&C?a.createElement(di.A,{model:C.model,width:je.Ps,height:je.Ps}):a.createElement(fi.A,{asn:S[0]?.serviceProviderAsn,name:S[0]?.serviceProviderName||"",style:{userSelect:"none",height:`${je.Ps}px`,width:`${je.Ps}px`,objectFit:"contain",margin:"0 auto"},useFallback:!0})):a.createElement(di.A,{size:pi.Xh.MEDIUM,variant:pi.Hx.TOPOLOGY,model:l})),a.createElement(zi,null,a.createElement(ci.A,{size:"small",weight:"bold",isTruncated:!0},g?O:(0,Ei.Q)({name:i,model:l,mac:u})),g&&y?a.createElement(Vr.A,{size:"small",color:"text-3",isTruncated:!0},y):c?a.createElement(Vr.A,{size:"small",color:"text-3",isTruncated:!0},a.createElement(fn.sA,{id:"COMMON_STP_PRIORITY"}),": ",c):a.createElement(Vr.A,{size:"small"})),g?(void 0!==E||f)&&a.createElement(Vi,null,void 0!==E?a.createElement(dn.A,null,a.createElement(Vr.A,{size:"small",color:(0,Ai.A)(E)},E,"%")):null,f?a.createElement(dn.A,null,a.createElement(Vr.A,{size:"small",color:"inherit"},f)):null):(o||s)&&a.createElement(Vi,null,s?a.createElement(dn.A,null,a.createElement(Vr.A,{size:"small",color:"inherit"},s,"%"),a.createElement(ui.A,null)):null,o?a.createElement(dn.A,null,a.createElement(Vr.A,{size:"small",color:"inherit"},o,"%"),a.createElement(mi.A,null)):null)),p&&p.length>0&&a.createElement(Yi,null,p.slice(0,3).map(e=>a.createElement(Li,{key:e.id,port:e})),p.length>3&&a.createElement(wi,{remainingPorts:p.slice(3)})))},Bi=(0,Hr.A)("svg")`
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
`,Gi=(0,Hr.A)("path")`
  stroke: ${({theme:{motifPalette:e}})=>e.uBlue06};
  stroke-width: 0.5;
  fill: none;
  pointer-events: none;
  stroke-linecap: round;
  stroke-linejoin: round;
`,Hi=({link:e,sourceNode:t,targetNode:n})=>{const{source:r,target:i,sourcePortNumber:l}=e;let o=0;if(t&&void 0!==l&&t.downlinkExtendedPorts){const e=t.downlinkExtendedPorts,n=e.slice(0,3),r=e.length>3;let a=n.findIndex(e=>e.port_idx===l);if(-1===a&&r){e.slice(3).some(e=>e.port_idx===l)&&(a=3)}if(-1!==a){o=((e,t,n,r)=>{if(0===t)return 0;if(1===t)return 0;const a=(e-(t-1)/2)*n,i=0===e||e===t-1?1.5*r:.5*r;return 0===e?a-i:e===t-1?a+i:a+(e<t/2?-i:i)})(a,r?4:n.length,Xn,8)}}const s=t?.downlinkExtendedPorts&&t.downlinkExtendedPorts.length>0?55:23,c=[r.x+o,r.y+s],u=n?.uplinkExtendedPorts&&n.uplinkExtendedPorts.length>0?55:23,m=[i.x,i.y-u],d=m[0]-c[0];if(Math.abs(d)<1){const e=`M ${c[0]} ${c[1]} L ${m[0]} ${m[1]}`;return a.createElement(Gi,{d:e})}const p=[c[0]+0,c[1]+0],E=[m[0]-0,m[1]-0],f=E[0]-p[0],A=E[1]-p[1],h=[p[0]+0*f/2,p[1]+1*A/2],g=[E[0]-0*f/2,E[1]-1*A/2],_=`M ${c[0]} ${c[1]} \n                    L ${p[0]} ${p[1]} \n                    C ${h[0]} ${h[1]}, ${g[0]} ${g[1]}, ${E[0]} ${E[1]} \n                    L ${m[0]} ${m[1]}`;return a.createElement(Gi,{d:_})},Ui=e=>!e.source.mac.includes(je.Aw)&&!e.target.mac.includes(je.Aw),Xi=({links:e,nodes:t,containerWidth:n,containerHeight:r})=>{const i=(0,a.useMemo)(()=>{const e=new Map;return t.forEach(t=>{e.set(t.mac,t)}),e},[t]);return a.createElement(Bi,{width:n,height:r},e.filter(Ui).map(e=>a.createElement(Hi,{key:`${e.source.mac}-${e.target.mac}`,link:e,sourceNode:i.get(e.source.mac),targetNode:i.get(e.target.mac)})))};var ji=n(343255),Zi=n(749177);const Ki=()=>{const[e,t]=(0,a.useState)(0),n=(0,Zi.A)(m.g1.TOPOLOGY);return(0,a.useEffect)(()=>{t(n?ji.b+33:0)},[n]),{offsetAdjustment:e,isLeftFilterOpen:n}},qi=(0,Hr.A)("div")`
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;

  &:active {
    cursor: move;
  }
`,Qi=(0,Hr.A)("div")`
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
`,Ji=({containerSize:e})=>{const{setContainerSize:t}=ir(),{nodes:n,links:i}=(0,r.useSelector)(er),{offsetAdjustment:l}=Ki(),o=e.containerWidth+l,{containerHeight:s}=e;(0,a.useEffect)(()=>{t({containerWidth:o,containerHeight:s,offsetAdjustment:l})},[o,s,t,l]);const{resetZoomTransform:c,onZoomButtonClick:u}=Cr();Da(),La(c);const m=(0,a.useCallback)(e=>{c(e)},[c]);return a.createElement(a.Fragment,null,a.createElement(si,{onZoomChange:u,onZoomReset:m,offsetAdjustment:l}),a.createElement(qi,{style:{position:"absolute",top:"0"}},a.createElement("div",{className:je.M_,style:{position:"absolute",width:`${e.containerWidth}px`,height:`${s}px`}},a.createElement(Qi,{className:je.q3},a.createElement(Xi,{links:i,nodes:n,containerWidth:e.containerWidth,containerHeight:s}),n.map(e=>a.createElement(Wi,{key:e.id||e.mac,nodeAttributes:e}))))))};var el=n(733712);const tl=()=>a.createElement(dn.A,{marginLeft:ln.ll},a.createElement(el.A,{title:a.createElement(fn.sA,{id:"COMMON_NO_DEVICES_TITLE"}),description:a.createElement(fn.sA,{id:"COMMON_NO_DEVICES_DETAILS"})})),nl=(0,Hr.A)("div")`
  width: 100%;
  height: 100%;
  position: relative;
`,rl=()=>{const{ref:e,width:t,height:n}=(0,Ma.A)(),i=(0,r.useSelector)(ee);return 0===i?.vertices?.length?a.createElement(tl,null):a.createElement(nl,{ref:e},e&&t&&n?a.createElement(Ji,{containerSize:{containerWidth:t,containerHeight:n,offsetAdjustment:0}}):null)};var al=n(968154),il=n(786256),ll=n(322618);const ol=(0,a.memo)(({id:e})=>{const{traffic:t,path:n,distance:i,inView:l}=(0,r.useSelector)((o=e,(0,G.Mz)(ht,e=>e[o])))||{};var o;const s=(0,a.useMemo)(()=>{const e=Math.max(1,(i||0)/150);return Math.min(Math.floor(Math.max(25*e,25)),80)},[i]),c=(0,a.useMemo)(()=>[...Array(s)].map((e,t)=>t/s*10),[s]),u=(0,a.useMemo)(()=>c.map((r,i)=>{const l=Me[t]||[],o=l[l.length>0?i%l.length:0],s=`-${r}s`;return a.createElement("g",{key:`${e}-${i}-${n}-${t}`},a.createElement("use",{href:`#${o}`}),a.createElement("animate",{key:`opacity-${e}-${i}`,attributeName:"opacity",dur:"10s",values:"0;1;1;0",keyTimes:"0;0.05;0.95;1",begin:s,repeatCount:"indefinite"}),a.createElement("animateMotion",{key:`motion-${e}-${i}-${t}`,dur:"10s",repeatCount:"indefinite",path:n,begin:s}))}),[c,t,e,n]);return t!==te.TRAFFIC_0&&l?a.createElement("g",{key:`${e}-${n}-${t}`},u):null}),sl=()=>{const e=(0,r.useSelector)(Et),[t,n]=(0,a.useState)(0);(0,a.useEffect)(()=>{n(e?1:0)},[e]);const i=(0,r.useSelector)(St),l=(0,a.useMemo)(()=>e?i.map(e=>a.createElement(ol,{key:e,id:e})):null,[e,i]);return a.createElement("g",{style:{opacity:t,transition:"opacity 2s ease-in-out",pointerEvents:"none"}},a.createElement("defs",null,ke),l)};var cl=n(709690);const ul=(0,Hr.A)(dn.A)`
  position: absolute;
  top: ${ln.Ln};
  left: 50%;
  transform: translateX(calc(-50%));
  min-height: 32px;
  z-index: 100;
`,ml=(0,Hr.A)(dn.A)`
  background-color: ${({theme:{motifPalette:{neutral01:e}}})=>e};
  gap: ${ln.YC};
  padding: ${ln.kc};
  border-radius: ${ln.YC};
`,dl=()=>{const{motifPalette:{info:e}}=(0,i.u)(),t=(0,r.useDispatch)(),n=(0,r.useSelector)(Ot),l=(0,r.useSelector)(oe.ed),o=(0,a.useRef)(l);o.current=l;const s=(0,a.useRef)(n);return s.current=n,(0,a.useEffect)(()=>{s.current&&!o.current.showStpPriority&&t((0,v.bh)({...o.current,showStpPriority:!0}))},[t]),n?a.createElement(ul,null,a.createElement(ml,null,a.createElement(cl.A,{size:"original",variant:"fill",color:e}),a.createElement(ci.A,null,a.createElement(fn.sA,{id:"TOPOLOGY_STP_WARNING",values:{link:a.createElement(gn.A,{href:Sn.A.addressingLoopsAndManagingRedundancy,id:"COMMON_LEARN_MORE",noWrap:!0})}})))):null};var pl=n(325898),El=n(19058),fl=n(740618),Al=n(398300),hl=n(646189),gl=n(399818),_l=n(211368);var Cl=n(880851);const Sl=(0,Hr.A)(dn.A)`
  background-color: ${({backgroundColor:e})=>e};
`,bl=e=>l.AH`
  background-color: ${e};
`,Ol={transition:`opacity ${je.xt}ms ${je.vf}`,opacity:0},yl={opacity:0},Nl={entering:{opacity:1},entered:{opacity:1}},xl={entered:{opacity:1}},Tl=({children:e,isVisible:t,isInstant:n,style:r,applyBackgroundStrip:l})=>{const o=(0,i.u)(),s=(0,u.L)({theme:o}),{isSafari:c}=Vn.T;return a.createElement(Cl.Ay,{in:t,timeout:n?0:je.xt,mountOnEnter:!0,unmountOnExit:!0},t=>{const i={...c||n?yl:Ol,...c?xl[t]:Nl[t]};return a.createElement("div",{style:{...i,...r},className:l?bl(s):void 0},e)})};n(605203);var Il=n(888170),vl=n(440961);const kl=({children:e,layerRef:t})=>(0,vl.createPortal)(e,t.current);var Ml=n(272017),Ll=n(407988),Dl=n(662965),wl=n(58867),$l=n(958883),Rl=n(127737),Pl=n(903216),Fl=n(115829),zl=n(553240);const Vl={transition:`translate ${je.xt}ms ${je.vf}`},Yl=({customStyle:e,children:t,id:n,isAnimationBlocked:r})=>{const i={...r?{transition:"none"}:Vl,...e};return a.createElement("g",{style:i,pointerEvents:"none",key:n,id:n},a.createElement("foreignObject",{x:0,y:0,width:1,height:1,style:{overflow:"visible"}},t))},{isSafari:Wl}=Vn.T,Bl=(0,Hr.A)(dn.A)`
  flex-direction: column;
  gap: ${je.sM}px;
  ${!Wl&&"transform: translateZ(0);"}
  pointer-events: auto;
`,Gl=(0,Hr.A)(dn.A)`
  flex-direction: column;
  gap: ${je.En}px;
  min-height: ${je.CH}px;
  min-width: ${je.VQ}px;
  ${!Wl&&"transform: translateZ(0);"}
  pointer-events: auto;
`,Hl=(0,Hr.A)(dn.A)`
  width: fit-content;
  max-width: ${je.VQ}px;
  min-height: ${je.CH}px;
  max-height: ${je.CH}px;
  color: ${({theme:{motifPalette:{uBlue06:e}}})=>e};
  padding: 0 ${ln.YC};
  background: ${u.L};
  border: 0.5px solid
    ${({theme:{motifPalette:{uBlue06:e}}})=>e};
  border-radius: 50px;
  box-sizing: content-box;
`,Ul=(0,Hr.A)(Fl.A)`
  white-space: nowrap;
`,Xl=e=>e===Se.xs.a||e===Se.xs.b||e===Se.xs.g,jl=({protocol:e})=>{if(!Xl(e)){if(e===Se.xs.na||e===Se.xs.ng)return a.createElement(wl.A,{size:"small"});if(e===Se.xs.ac||e===Se.xs.ad)return a.createElement($l.A,{size:"small"});if(e===Se.xs.ax)return a.createElement(Ml.A,{size:"small"});if(e===Se.xs.be)return a.createElement(Ll.A,{size:"small"})}return null},Zl=({protocol:e})=>e&&!Xl(e)?a.createElement(dn.A,{gap:je.T6,alignItems:"center"},a.createElement(jl,{protocol:e}),a.createElement(Ul,{color:"inherit",size:"small"},(0,Ce.z0)(e))):null,Kl=({essid:e})=>e?a.createElement(dn.A,{gap:je.T6,alignItems:"center",maxWidth:je.VQ},a.createElement(Dl.A,null),a.createElement(Fl.A,{color:"inherit",size:"small",position:"top"},e)):null,ql=({uplinkPortNumber:e})=>e?a.createElement(dn.A,{gap:je.T6},a.createElement(Rl.A,{size:"medium"}),a.createElement(ci.A,{color:"inherit",size:"small"},e)):null,Ql=({downlinkPortNumber:e})=>e?a.createElement(dn.A,{gap:je.T6},a.createElement(ci.A,{color:"inherit",size:"small"},"→"),a.createElement(ci.A,{color:"inherit",size:"small"},e)):null,Jl=({rateMbps:e})=>e?a.createElement(dn.A,{alignItems:"center"},a.createElement(Ul,{color:"inherit",size:"small"},(0,Pl.ir)(e))):null,eo=({stpPriority:e})=>void 0!==e?a.createElement(dn.A,{alignItems:"center"},a.createElement(Ul,{color:"inherit",size:"small"},a.createElement(fn.sA,{id:"COMMON_STP"})," ",e)):null,to=({activeChannels:e})=>e?a.createElement(dn.A,{alignItems:"center",width:"100%"},a.createElement(Ul,{color:"inherit",size:"small",position:"top"},a.createElement("span",{style:{textTransform:"capitalize"}},e))):null,no=(e,t,n)=>{const{edge:i,mac:l}=e,{downlinkPortNumber:o,uplinkPortNumber:s,rateMbps:c,essid:u,protocol:m}=i||{},d=(0,r.useSelector)(oe.ed),{showWiredPorts:p,showSSID:E,showWifiStandards:f,showStpPriority:A,showRadioChannel:h}=d,g=(0,r.useSelector)(Zt(l)),_=(0,r.useSelector)(Ct),C=g||((e,t)=>e.id===t)(e,_),S=(0,r.useSelector)(re.zu),b=(0,r.useSelector)(Bt(l)),{formatMessage:O}=(0,fn.tz)(),y=(0,a.useMemo)(()=>{const e=(0,zl.A)(b?.radio_table,b?.radio_table_stats,b?.vap_table),t=Object.values(e).flatMap(e=>e.filter(e=>void 0!==e.channel&&null!==e.channel&&("string"!=typeof e.channel||""!==e.channel.trim())).map(e=>O({id:"COMMON_CHANNEL_RADIO_CHANNEL"},{channel:e.channel})));return Array.from(new Set(t)).join(", ")},[b?.radio_table,b?.radio_table_stats,b?.vap_table,O]),N=S?.switch_exclusions?.includes(b?.mac)?b?.stp_version:S?.stp_version,x=b&&(0,K.kL)(b.switch_caps?.feature_caps)&&N!==ne.uI.DISABLED&&b.stp_priority?b.stp_priority:void 0,T=t===Cl.ze||t===Cl.kp,I=!T&&!C&&p,v=!T&&!C&&f&&Boolean(m)&&!Xl(m),k=!T&&!C&&E&&Boolean(u),M=!T&&!C&&h&&Boolean(y),L=!T&&!C&&A&&void 0!==x,D=I&&(n&&Boolean(o)||Boolean(s)||Boolean(c));return{areVisibleSSIDDescriptions:k,areVisibleProtocolDescriptions:v,areVisibleStpPriorityDescriptions:L,areVisibleActiveChannelsDescriptions:M,areWiredValuesDisplayedTop:D,stpPriorityValue:x,formattedActiveChannels:y,hasAnyVisibleLabel:D||v||L||k||M}},ro=({target:e,linkTransitionState:t})=>{const{edge:n}=e,{downlinkPortNumber:i,uplinkPortNumber:l,protocol:o,rateMbps:s}=n||{},c=(0,r.useSelector)(Bt(e.mac)),u=(0,me.Tbi)(c)||(0,me.iQS)(c?.model),{areWiredValuesDisplayedTop:m,areVisibleProtocolDescriptions:d}=no(e,t,u),p=u?i:void 0;return a.createElement(dn.A,{height:je.CH},m?a.createElement(Hl,{justifyContent:"start"},a.createElement(dn.A,{gap:ln.kc},a.createElement(dn.A,null,a.createElement(ql,{uplinkPortNumber:l}),a.createElement(Ql,{downlinkPortNumber:p})),a.createElement(Jl,{rateMbps:s}))):null,!m&&d?a.createElement(Hl,{justifyContent:"start"},a.createElement(Zl,{protocol:o})):null)},ao=({target:e,linkTransitionState:t})=>{const{edge:n}=e,{essid:i}=n||{},l=(0,r.useSelector)(Bt(e.mac)),o=(0,me.Tbi)(l)||(0,me.iQS)(l?.model),{areVisibleStpPriorityDescriptions:s,areVisibleSSIDDescriptions:c,areVisibleActiveChannelsDescriptions:u,formattedActiveChannels:m,stpPriorityValue:d}=no(e,t,o);return a.createElement(dn.A,null,s?a.createElement(Hl,{justifyContent:"start"},a.createElement(eo,{stpPriority:d})):null,!s&&c?a.createElement(Hl,{justifyContent:"start"},a.createElement(Kl,{essid:i})):null,s||c||!u?null:a.createElement(Hl,{justifyContent:"start"},a.createElement(to,{activeChannels:m})))},io=(e,t,n=!1)=>{let r=0,a=0;switch(!0){case t:r=e.y-je.VQ/2,a=e.x-je.BJ;break;case n:r=e.y,a=e.x-je.JJ;break;default:r=e.y-je.WS-je.VQ,a=e.x-je.sM/2-je.CH}return`${r}px ${a}px`},lo=({target:e,linkTransitionState:t})=>{const{isAnimationBlocked:n}=sr(),i=(0,r.useSelector)(Bt(e.mac)),l=!!i&&((0,me.Tbi)(i)||(0,me.iQS)(i?.model)),{hasAnyVisibleLabel:o}=no(e,t,l);if(!o)return null;const s=io(e,!0);return a.createElement("g",{id:`${e.mac}-link-vertical-descriptions`},a.createElement(Yl,{customStyle:{translate:s},id:e.mac,isAnimationBlocked:n},a.createElement(Gl,{alignItems:"center"},a.createElement(ro,{linkTransitionState:t,target:e}),a.createElement(ao,{linkTransitionState:t,target:e}))))},oo=({target:e,linkTransitionState:t})=>{const{isAnimationBlocked:n}=sr(),i=(0,r.useSelector)(Bt(e.mac)),l=!!i&&((0,me.Tbi)(i)||(0,me.iQS)(i?.model)),o=!!i&&(0,me.moU)(i),{hasAnyVisibleLabel:s}=no(e,t,l);if(!s)return null;const c=io(e,!1,o);return a.createElement("g",{id:`${e.mac}-link-horizontal-descriptions`},a.createElement(Yl,{customStyle:{translate:c},id:e.mac,isAnimationBlocked:n},a.createElement(Bl,{alignItems:o?"center":void 0},a.createElement(ro,{linkTransitionState:t,target:e}),a.createElement(ao,{linkTransitionState:t,target:e}))))},so=(0,Hr.A)("path")`
  filter: ${({isTrafficVisualizationEnabled:e})=>`blur(${e?"3px":"0px"})`};
  stroke: ${e=>e.isTrafficVisualizationEnabled?e.theme.themeName===Fa.S.LIGHT?e.theme.motifPalette.uBlue01:e.theme.motifPalette.uBlue10:(({type:e,radioBand:t})=>e===W.WIRELESS&&t===ct.sx.RADIO_NG?Il.Ay["blue-light-4"]:Il.Ay["blue-3"])(e)};
  stroke-width: ${({isTrafficVisualizationEnabled:e,trafficData:t})=>e?xe[t?.traffic??te.TRAFFIC_0].backgroundWidth:.5};
  fill: none;
  pointer-events: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: ${({type:e,isTrafficVisualizationEnabled:t})=>e!==W.WIRELESS||t?0:5};
  transition:
    filter 0.4s ease-in,
    stroke-width 0.4s ease-in,
    stroke 0.4s ${({isTrafficVisualizationEnabled:e})=>e?"ease-out":"ease-in"};
  opacity: ${({isTrafficVisualizationEnabled:e,theme:{themeName:t}})=>e&&t===Fa.S.DARK?.5:1};
`,co=(0,Hr.A)("line")`
  stroke: ${({theme:{motifPalette:{uBlue06:e}}})=>e};
  stroke-width: 0.5;
  fill: none;
  pointer-events: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    filter 0.4s ease-in,
    stroke-width 0.4s ease-in,
    stroke 0.4s ease-in;
`;var uo;!function(e){e.NORMAL="NORMAL",e.MC_LAG_LEFT="MC_LAG_LEFT",e.MC_LAG_RIGHT="MC_LAG_RIGHT"}(uo||(uo={}));const mo=(e,t,n,r,a,i)=>{let l;const o=i?je.cE:0,s=i?0:je.cE,c=i?0:je.OI;switch(a){case uo.MC_LAG_LEFT:l={x:r+o-c,y:n+s};break;case uo.MC_LAG_RIGHT:l={x:r-o-c,y:n-s};break;case uo.NORMAL:default:l={x:r,y:n}}const u=t,m=e,d=je.AD+je.hc,p={x:u+(i?0:d),y:m+(i?d:0)};let E,f,A,h,g,_;const C=1===Math.sign(i?l.x-u:l.y-m),S=i?u===l.x:m===l.y,b=a===uo.NORMAL&&S?je.E5:je.cE/2;return S?(E={x:p.x,y:p.y},f=E,A=E,h=E,g=E,_=E):(E={x:p.x+(i?0:je.NX),y:p.y+(i?je.NX:0)},f={x:E.x+(i?0:b),y:E.y+(i?b:0)},A={x:f.x+(i?C?b:-b:0),y:f.y+(i?0:C?b:-b)},i?(h={x:l.x+(C?-b:b),y:A.y},g={x:l.x,y:A.y},_={x:l.x,y:A.y+b}):(h={x:A.x,y:l.y+(C?-b:b)},g={x:h.x,y:l.y},_={x:h.x+b,y:l.y})),[`M ${u} ${m}`,`L ${E.x} ${E.y}`,`Q ${f.x} ${f.y}, ${A.x} ${A.y}`,`L ${h.x} ${h.y}`,`Q ${g.x} ${g.y}, ${_.x} ${_.y}`,`L ${l.x} ${l.y}`].join(" ")},po=(0,Hr.A)("g")`
  opacity: 0;
  pointer-events: none;
  transform-origin: center;
`,Eo=({transitionDuration:e,nextNodeListRef:t,prevNodeListRef:n,linkProps:l,labelWidth:o,labelLayerRef:s,visibleNodeIds:c,...u})=>{const m=(0,r.useDispatch)(),{isAnimationBlocked:d}=sr(),{target:p}=l||{};let{source:E}=l||{};const{x:f,y:A,mac:h,traffic:g}=p||{},{x:_,y:C}=E||{},{sum:S,bottomSum:b,topSum:O}=g||{},y=(0,a.useRef)(null),N=(0,a.useRef)(null),x=(0,a.useRef)(null),T=(0,a.useRef)(null),I=(0,a.useRef)(null),v=(0,r.useSelector)(Et),[k,M]=(0,a.useState)(void 0),[L,D]=(0,a.useState)(void 0),[w,$]=(0,a.useState)(void 0),[R,P]=(0,a.useState)(""),[F,z]=(0,a.useState)(""),[V,Y]=(0,a.useState)(""),G=(0,r.useSelector)(Wt),[H,U]=(0,a.useState)(!0),X=(0,i.u)(),j=(0,r.useSelector)(oe.ed),{rotateMap:Z}=j,K=(e=>{const{source:{mac:t},target:{mac:n,edge:i}}=e,{downlinkPortNumber:l,type:o,uplinkPortNumber:s}=i||{},c=(0,r.useSelector)(ie.D),{edges:u=[]}=(0,r.useSelector)(ee);return(0,a.useMemo)(()=>{if(o!==W.WIRED||e.source.type!==B.DEVICE&&e.source.type!==B.CLIENT||void 0===l||void 0===s||!c?.length)return!1;const r=c.find(e=>e.peers.bottom===t||e.peers.top===t);if(!r)return!1;const a=u.find(e=>e.downlinkMac===n)?.uplinkMac,i=r.peers.top===a;return r.target_links.some(e=>(i?e.top:e.bottom).includes(s))},[o,e.source.type,l,c,u,t,n,s])})(l);(e=>{const t=ur(Vn.T.isSafari?je.Hg:1e6);(0,a.useEffect)(()=>{Vn.T.isSafari&&e.current&&mr((0,Fn.A)(e.current))},[e,t])})(y),(0,a.useEffect)(()=>{d&&(x.current&&(0,Fn.A)(x.current).interrupt(),T.current&&(0,Fn.A)(T.current).interrupt(),N.current&&(0,Fn.A)(N.current).interrupt())},[d]),E.type===B.ISP&&(E={...E,y:E.y+je.Ps/2});const q=(0,a.useCallback)((t,n)=>{const r=(0,Fn.A)(t.current);d?(r.interrupt(),r.attr("d",()=>n)):(r.interrupt(),r.transition().duration(e).attr("d",()=>n))},[d,e]);(0,a.useEffect)(()=>{let e="",t="",n="";if(K?(t=mo(_,C,f,A,uo.MC_LAG_LEFT,Z),z(t),q(x,t),n=mo(_,C,f,A,uo.MC_LAG_RIGHT,Z),Y(n),q(T,n)):(e=mo(_,C,f,A,uo.NORMAL,Z),P(e),q(N,e)),v){const r=G>0?Le(100*(S??0)/G):te.TRAFFIC_0,a=G>0?Le(100*(b??0)/G):te.TRAFFIC_0,i=G>0?Le(100*(O??0)/G):te.TRAFFIC_0,l=Z?i:a,o=Z?a:i,s=((e,t,n,r)=>{const a=n-e,i=r-t;return Math.sqrt(a*a+i*i)})(_,C,f,A);if(e){const t={id:h,data:{path:e,inView:H,id:h,traffic:r,distance:s}};M(t.data),m((0,$n.oR)(t))}if(t){const e={id:h+je.dg,data:{path:t,inView:H,id:h,traffic:l,distance:s}};m((0,$n.oR)(e)),D(e.data)}if(n){const e={id:h+je.Sn,data:{path:n,inView:H,id:h,traffic:o,distance:s}};m((0,$n.oR)(e)),$(e.data)}}},[K,o,Z,_,C,f,A,e,v,G,S,b,O,h,H,m]),(0,a.useEffect)(()=>{I.current&&v&&(R&&m((0,$n.eZ)({id:p.mac,inView:H})),F&&m((0,$n.eZ)({id:p.mac+je.dg,inView:H})),V&&m((0,$n.eZ)({id:p.mac+je.Sn,inView:H})))},[R,F,V,I,v,H,p.mac,m]);const Q=(0,a.useMemo)(()=>new IntersectionObserver(e=>{e.forEach(e=>{U(e.isIntersecting)})}),[]);(0,a.useEffect)(()=>{const{current:e}=I;return(R||F||V)&&e&&v&&Q.observe(e),()=>{e&&Q.unobserve(e)}},[I.current,R,F,V,Q,v]),(0,a.useEffect)(()=>()=>{m((0,$n.Or)(p.mac)),K&&(m((0,$n.Or)(p.mac+je.dg)),m((0,$n.Or)(p.mac+je.Sn)))},[m,p.mac,K]);const J=(0,a.useMemo)(()=>{if((R||F||V)&&v){const e=Math.min(_,f),t=Math.max(_,f),n=Math.min(C,A),r=Math.max(C,A);return a.createElement("div",{style:{position:"absolute",top:e,left:n,height:t-e,width:r-n,pointerEvents:"none",opacity:0},ref:I})}return null},[R,F,V,v,_,C,f,A]);if(E.type===B.INVISIBLE_ROOT)return null;const ne=`${E.x}-${E.y}-${p.x}-${p.y}`;return a.createElement(Cl.Ay,{...u,timeout:{enter:e,exit:e},onExit:()=>{const n=t?.current?.find(e=>e.mac===E.mac),r=n||E;(0,Fn.A)(y.current).transition().duration(e/2).style("opacity",0);const a=mo(r.x,r.y,r.x,r.y,uo.NORMAL,Z);P(a),(0,Fn.A)(N.current).transition().duration(e).attr("d",a),v&&(m((0,$n.Or)(p.mac)),K&&(m((0,$n.Or)(p.mac+je.dg)),m((0,$n.Or)(p.mac+je.Sn))))},onEnter:()=>{const t=n?.current?.find(e=>e.mac===E.mac),r=t||E;if((0,Fn.A)(y.current).style("opacity",0).transition().delay(e/2).duration(e/2).style("opacity",1),K){const t=mo(r.x,r.y,p.x,p.y,uo.MC_LAG_LEFT,Z);z(t),(0,Fn.A)(x.current).attr("d",mo(r.x,r.y,r.x,r.y,uo.MC_LAG_LEFT,Z)).transition().duration(e).attr("d",t);const n=mo(r.x,r.y,p.x,p.y,uo.MC_LAG_RIGHT,Z);Y(n),(0,Fn.A)(T.current).attr("d",mo(r.x,r.y,r.x,r.y,uo.MC_LAG_RIGHT,Z)).transition().duration(e).attr("d",n)}else{const t=mo(E.x,E.y,p.x,p.y,uo.NORMAL,Z);P(t),(0,Fn.A)(N.current).attr("d",mo(r.x,r.y,r.x,r.y,uo.NORMAL,Z)).transition().duration(e).attr("d",t)}}},e=>a.createElement(po,{ref:y,key:`${E.mac}-${p.mac}`,id:`${E.mac}-${p.mac}`},K?a.createElement(a.Fragment,null,a.createElement(so,{ref:x,type:p.edge?.type,radioBand:p.edge?.radioBand,isTrafficVisualizationEnabled:v,trafficData:L,theme:X,key:`${ne}-left`}),a.createElement(so,{ref:T,type:p.edge?.type,radioBand:p.edge?.radioBand,isTrafficVisualizationEnabled:v,trafficData:w,theme:X,key:`${ne}-right`})):a.createElement(so,{ref:N,type:p.edge?.type,radioBand:p.edge?.radioBand,isTrafficVisualizationEnabled:v,trafficData:k,theme:X,key:`${ne}-straight`}),v&&(k?.traffic||L?.traffic||w?.traffic)&&a.createElement("foreignObject",{x:1,y:1,width:1,height:1,style:{overflow:"visible"}},J),s.current&&c&&c.includes(p.id)?a.createElement(kl,{layerRef:s},Z?a.createElement(lo,{target:p,linkTransitionState:e}):a.createElement(oo,{target:p,linkTransitionState:e})):null))},fo=(0,Hr.A)("g",{shouldForwardProp:e=>!["isVertical"].includes(e)})`
  cursor: pointer;
  transition:
    filter 0.2s ease-in,
    transform 0.2s ease-in;

  transform: translateZ(0);
  &:hover {
    filter: drop-shadow(0px 4.4px 4.4px rgba(0, 0, 0, 0.25));
    // fix button transformation behavior

    transform: ${({isVertical:e})=>e?"translateY":"translateX"}(-8px) scale(1.1, 1.1) translateZ(0);
  }
`,Ao=(0,Hr.A)("circle")`
  fill: ${({theme:{motifPalette:{uBlue06:e}}})=>e};
`,ho=({mac:e,id:t,setIsChildToggleHovered:n})=>{const i=(0,r.useDispatch)(),l=(0,r.useSelector)(Nt),o=(0,r.useSelector)(Ut),s=(0,r.useSelector)(Et),c=l.has(e),u=(0,a.useCallback)(e=>{if(c){const t=new Set(l);t.delete(e),i((0,$n.N2)(t))}else{const t=new Set(l);t.add(e),i((0,$n.N2)(t))}},[l,i,c]),m=c?ei.A:Qa.A,d=je.qx/2;let p={x1:0,y1:0,x2:je.AD-d,y2:0},E={cx:je.AD,cy:0},f={x:je.AD-d,y:-d};o&&(p={x1:0,y1:0,x2:0,y2:je.AD},E={cx:0,cy:je.AD},f={x:-d,y:je.AD-d});return a.createElement("g",null,c&&!s?a.createElement(co,{x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2}):null,a.createElement(fo,{onClick:e=>{u(t),e.stopPropagation(),e.preventDefault()},onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},isVertical:o},a.createElement(Ao,{cx:E.cx,cy:E.cy,r:je.hc}),a.createElement(m,{className:"toggle-icon",x:f.x,y:f.y,color:Ne.Ay["desktop-color-neutral-00-light"],width:je.qx,height:je.qx})))};var go=n(984290),_o=n(263842);const{isSafari:Co}=Vn.T,So=(0,Hr.A)(dn.A)`
  width: 100%;
  min-height: ${je.Bs}px;
  justify-content: center;
  ${!Co&&"transform: translateZ(0);"}
  gap: ${ln.YC}px;
  align-items: center;
  color: ${({theme:{motifPalette:{text03:e,text02:t},themeName:n}})=>n===Fa.S.LIGHT?e:t};
`,bo=()=>{const e=(0,r.useSelector)(de.Gi),t=(0,r.useSelector)(Z.sN),n=(0,r.useSelector)(Z.r2),i=t.length>1;return a.createElement(So,null,i?a.createElement(a.Fragment,null,a.createElement(_o.A,null),a.createElement(Vr.A,{color:"inherit",size:"small"},a.createElement(fn.sA,{id:"TOPOLOGY_MULTIPLE_WANS"}))):null,!i&&e?a.createElement(a.Fragment,null,a.createElement(go.A,null),n.length?null:a.createElement(Vr.A,{color:"inherit",size:"small"},a.createElement(fn.sA,{id:"TOPOLOGY_LFE_FO"}))):null)};var Oo=n(956883),yo=n(807407);const No=(0,Hr.A)(dn.A)`
  display: grid;
  grid-template-columns: 20px auto;
  gap: ${ln.YC};
  align-items: center;
`,xo=({device:e})=>a.createElement(a.Fragment,null,a.createElement(di.A,{model:e.model,size:pi.Xh.SMALL}),a.createElement(nn.A,{size:"inherit"},e.name)),To=({children:e})=>{const t=(0,r.useSelector)(Rt);return a.createElement(tn.A,{portal:!0,position:"top",isInteractive:!0,noWrap:!0,description:a.createElement(No,null,t.map(e=>a.createElement(xo,{key:e.mac,device:e}))),className:yo.Z},e)},Io=(0,Hr.A)(dn.A)`
  display: grid;
  grid-template-columns: 20px auto;
  gap: ${ln.YC};
  align-items: center;
`,vo=({device:e})=>a.createElement(a.Fragment,null,a.createElement(di.A,{model:e.model,size:pi.Xh.SMALL}),a.createElement(nn.A,{size:"inherit"},e.name)),ko=({children:e})=>{const t=(0,r.useSelector)(Pt);return a.createElement(tn.A,{portal:!0,position:"top",isInteractive:!0,noWrap:!0,description:a.createElement(Io,null,t.map(e=>a.createElement(vo,{key:e.mac,device:e}))),className:yo.Z},e)},Mo=({children:e,nodeType:t,noWrap:n=!1})=>t===B.USW_WAN?a.createElement(To,null,e):t===B.ISP?a.createElement(Oo.A,{noWrap:n},e):t===B.CABLE_INTERNET?a.createElement(ko,null,e):a.createElement(a.Fragment,null,e);var Lo=n(768195),Do=n(130851);const wo=(0,Hr.A)(di.A,{shouldForwardProp:e=>"isFaded"!==e})`
  user-select: none;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 ${ln.kc};
  object-fit: contain;
  margin: 0 auto;
  opacity: ${({isFaded:e})=>e?.4:1};
  cursor: pointer;
`,$o=(0,Hr.A)(wo,{shouldForwardProp:e=>"motif"!==e})`
  /* Dark theme we want black, light theme we want white background*/
  filter: grayscale(1) ${({motif:e})=>e===Fa.S.DARK?"brightness(0)":"brightness(100)"};
  position: absolute;
`,Ro=(0,Hr.A)(_n.A)`
  // !important needed to override default styling of fallback images
  user-select: none;
  display: block;
  height: ${je.Ps}px !important;
  width: ${je.Qb}px !important;
  object-fit: contain !important;
  margin: 0 auto !important;
  padding: 0 !important;
`,Po=(0,Hr.A)("img")`
  user-select: none;
  display: block;
  object-fit: contain !important;
  aspect-ratio: 1;
  width: unset;
  height: 100%;
`,Fo=(0,Hr.A)(Ro,{shouldForwardProp:e=>"motif"!==e})`
  /* Dark theme we want black, light theme we want white background */
  // this is not brightness 100%, but 10000%, intentionaly. We want the image non transparent within the shape, but transparent outside of it. This is to cover the blue line when main image has opacity.
  // imagine this by white "U" on transparent background (in the case of fallback)
  // greyscale improves brigtness scaing. The new UI logo has such dominant gradient that it cant be covered by brightness alone.
  filter: grayscale(1) ${({motif:e})=>e===Fa.S.DARK?"brightness(0)":"brightness(100)"};
  position: absolute;
`,zo={pointerEvents:"auto",opacity:.55},Vo=(0,a.memo)(({allowedInVisualProgramming:e,mac:t,isSafari:n})=>{const i=(0,r.useSelector)(qt),l=(0,r.useSelector)((0,a.useMemo)(()=>(0,be.og)(t),[t])),o=(0,r.useSelector)((0,a.useMemo)(()=>(0,Cn.i7)(t),[t])),s=Object.keys(l).length?l:o,{motif:c}=(0,pl.A)(),u=(0,r.useSelector)((0,a.useMemo)(()=>Qt(t),[t]));return(0,a.useMemo)(()=>!i||e&&u?a.createElement(Ro,{grid:!0,client:s,topology:!0}):a.createElement(tn.A,{portal:!0,position:"top",isInteractive:!0,noWrap:!0,description:a.createElement(fn.sA,{id:e?"TOPOLOGY_DISABLED_DEVICE_REASON_SUBNET":"TOPOLOGY_DISABLED_DEVICE_REASON_UNIFI"})},a.createElement(dn.A,{position:n?"unset":"relative"},n?null:a.createElement(Fo,{grid:!0,client:s,motif:c,topology:!0}),a.createElement(Ro,{grid:!0,client:s,style:n?void 0:zo,topology:!0}))),[e,s.id,u,i,c])},(e,t)=>e.mac===t.mac),Yo=(0,a.memo)(({model:e,isFaded:t,isSafari:n})=>{const{motif:r}=(0,pl.A)();return t&&!n?a.createElement(dn.A,{position:n?"static":"relative"},n?null:a.createElement($o,{motif:r,size:pi.Xh.MEDIUM,variant:pi.Hx.TOPOLOGY,model:e}),a.createElement(wo,{size:pi.Xh.MEDIUM,variant:pi.Hx.TOPOLOGY,model:e,isFaded:!0})):a.createElement(wo,{size:pi.Xh.MEDIUM,variant:pi.Hx.TOPOLOGY,model:e,isFaded:!1})},(e,t)=>e.isFaded===t.isFaded&&e.model===t.model),Wo=({allowedInVisualProgramming:e,mac:t,model:n,type:i,isFaded:l,isMclag:o})=>{const{isSafari:s}=Vn.T,c=(0,r.useSelector)(Do.p);return o?a.createElement(Po,{src:`${c}/topology/stacked.png`,alt:"stacked"}):!0==(i===B.DEVICE)?a.createElement(Yo,{model:n,isFaded:l,isSafari:s}):a.createElement(Vo,{allowedInVisualProgramming:e,mac:t,isSafari:s})},Bo=({isFaded:e})=>a.createElement(Yo,{model:Lo.W4.USWED74,isFaded:e,isSafari:Vn.T.isSafari}),Go=({isFaded:e})=>a.createElement(Yo,{model:Lo.W4.UCI,isFaded:e,isSafari:Vn.T.isSafari}),Ho=l.AH`
  opacity: ${je.pH};
`,Uo=()=>{const e=(0,r.useSelector)(de.CZ),t=(0,r.useSelector)(de.Gi),n=(0,r.useSelector)(Z.sN),i=(0,r.useSelector)(qt),{isSafari:l}=Vn.T,o=!l&&i;return a.createElement(a.Fragment,null,e&&t?a.createElement(di.A,{model:t.model,width:je.Ps,height:je.Ps,className:o?Ho:void 0}):a.createElement(fi.A,{asn:n[0]?.serviceProviderAsn,name:n[0]?.serviceProviderName||"",style:{userSelect:"none",height:`${je.Ps}px`,width:`${je.Ps}px`,objectFit:"contain",margin:"0 auto",opacity:o?je.pH:void 0,cursor:"pointer"},useFallback:!0}))};var Xo=n(930662),jo=n(823858),Zo=n(660950),Ko=n(533520),qo=n(30386),Qo=n(795537);const Jo=(0,Hr.A)(jo.A)`
  pointer-events: auto;
`,es=({children:e})=>a.createElement(tn.A,{portal:!0,position:"bottom",isInteractive:!0,description:e,className:yo.Z},a.createElement(Jo,{height:20,width:20,color:(0,i.u)().motifPalette.orange06})),ts=({uplinkMac:e,uplinkDisplayName:t})=>a.createElement(es,null,a.createElement(dn.A,{flexDirection:"column",alignItems:"start"},a.createElement(fn.sA,{id:"DEVICE_POE_ALMOST_OUT_OF_POWER",values:{deviceName:t}}),a.createElement(Qo.A,{mac:e},a.createElement(fn.sA,{id:"DEVICE_POE_SEE_DEVICE_DETAILS"})))),ns=(0,Hr.A)("div")`
  width: 26px;
  margin-right: ${ln.kc};
`,rs=({mac:e})=>{const t=(0,r.useSelector)((0,de.tG)(e)),{total_used_power:n}=t,i=(0,me.Cox)(t);return a.createElement(es,null,a.createElement(fn.sA,{id:"DEVICE_POE_APPROACHING_LIMIT",values:{action:a.createElement(Qo.A,{mac:e},a.createElement(fn.sA,{id:"DEVICE_POE_SEE_DEVICE_DETAILS"}))}}),a.createElement(dn.A,{alignItems:"center",marginTop:ln.kc},a.createElement(ns,null,a.createElement(Xo.A,{value:n/i*100,variant:"warning",size:"large"})),a.createElement(fn.sA,{id:"COMMON_UNIT_WATTS_SHORT",values:{value:`${(0,qo.A)(n)}/${(0,qo.A)(i)}`}})))},as=e=>a.createElement(es,null,a.createElement(Zo.A,{...e})),is=({deviceMac:e})=>{const t=(0,r.useSelector)(Bt(e)),n=(0,r.useSelector)((0,de.tG)(t?.uplink?.uplink_mac));return a.createElement(Ko.x,{mac:t.mac,uplinkMac:t.uplink.uplink_mac,uplinkDisplayName:(0,Ei.Q)(n),portNumber:t.uplink.uplink_remote_port,detailedStates:t.detailed_states,PortPowerLimitExceededWarning:as,UplinkNearPowerLimitWarning:ts,DeviceNearPowerLimitWarning:rs})},ls=({clientMac:e})=>{const t=(0,r.useSelector)((n=e,(0,G.Mz)(Lt,e=>e.get(n))));var n;const i=(0,r.useSelector)((0,de.tG)(t.uplink_mac));return a.createElement(Ko.x,{mac:t.mac,uplinkMac:t.uplink_mac,uplinkDisplayName:(0,Ei.Q)(i),portNumber:t.sw_port,detailedStates:t.detailed_states,PortPowerLimitExceededWarning:as,UplinkNearPowerLimitWarning:ts,DeviceNearPowerLimitWarning:rs})},os=({deviceMac:e,clientMac:t})=>{switch(!0){case!!e:return a.createElement(is,{deviceMac:e});case!!t:return a.createElement(ls,{clientMac:t});default:return null}};var ss=n(613870);const cs=(0,Hr.A)(Vr.A)`
  white-space: nowrap;
  text-align: center;
`,us=(0,Hr.A)(Fl.A)`
  max-width: 100%;
`,ms=({isHovered:e,backgroundColor:t})=>{const{motifPalette:{icon02:n,success:l,warning:o}}=(0,i.u)(),{formatMessage:s}=(0,fn.tz)(),c=(0,r.useSelector)(de.CZ),u=(0,r.useSelector)(de.Gi),m=(0,r.useSelector)(Z.sN),d=u?(0,me.KwR)(u):0,p=(0,r.useSelector)(Z.cc),E=(0,r.useSelector)(qt),{isSafari:f}=Vn.T,A=!f&&E,h=(c?u?.lte_networkoperator:m.find(e=>e.isActive)?.serviceProviderName)||s({id:"COMMON_ISP"});return a.createElement(dn.A,{flexDirection:"column",className:A?Ho:void 0,maxWidth:"100%"},a.createElement(Sl,{gap:ln.YC,alignItems:"center",justifyContent:"center",backgroundColor:t,textAlign:"center"},a.createElement(us,{size:"small",color:e?"ublue-06":"text-2",position:"bottom"},h),d&&c?a.createElement(ss.A,{inactiveColor:n,width:12,height:12,color:l,strength:d}):null,p?a.createElement(jo.A,{color:o}):null),p?a.createElement(Sl,{justifyContent:"center",gap:ln.YC,alignItems:"center",backgroundColor:t},a.createElement(cs,{color:"text-3",size:"small"},a.createElement(fn.sA,{values:{wan:s({id:"COMMON_WAN_NETWORKGROUP_WAN"},{number:(0,hi.si)(p.id)})},id:"TOPOLOGY_WAN_ACTIVE"}))):null)};var ds=n(84385),ps=n(311785),Es=n(11001);const fs=(0,Hr.A)(dn.A,(0,ps.A)("inTooltip"))`
  align-items: center;
  justify-content: ${({inTooltip:e})=>e?"center":"start"};
  gap: ${ln.YC};
`,As=({tx:e,rx:t,inTooltip:n})=>a.createElement(fs,{inTooltip:n},a.createElement(Es.A,{bytesPerSecond:e,direction:"down",size:"small"}),a.createElement(Es.A,{bytesPerSecond:t,direction:"up",size:"small"})),hs=({traffic:e,isHovered:t,backgroundColor:n})=>a.createElement(tn.A,{description:void 0!==e.bottomRx?a.createElement(dn.A,{flexDirection:"column",gap:ln.YC},a.createElement(dn.A,{flexDirection:"column"},a.createElement(Vr.A,{color:"text-2",size:"small",motif:"dark"},a.createElement(fn.sA,{id:"COMMON_MCLAG_TOP_SWITCH"})),a.createElement(As,{tx:e?.topTx,rx:e?.topRx,inTooltip:!0})),a.createElement(ds.A,{orientation:"horizontal",width:"100%"}),a.createElement(dn.A,{flexDirection:"column"},a.createElement(Vr.A,{color:"text-2",size:"small",motif:"dark"},a.createElement(fn.sA,{id:"COMMON_MCLAG_BOTTOM_SWITCH"})),a.createElement(As,{tx:e?.bottomTx,rx:e?.bottomRx,inTooltip:!0}))):null,isOpen:t,portal:!0,noWrap:!0,position:"bottom"},void 0===e.bottomRx?a.createElement(Sl,{backgroundColor:n,flexDirection:"column"},a.createElement(As,{tx:e?.tx,rx:e?.rx,inTooltip:!1})):a.createElement("div",null));var gs=n(832550);const _s=(0,Hr.A)(dn.A)`
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: ${je.hD-4}px;
`,Cs=(0,Hr.A)(gs.A)`
  margin-right: 2px;
`,Ss=({text:e,backgroundColor:t,isClientNode:n,isHovered:r,isOffline:l})=>{const{motifPalette:o}=(0,i.u)();return a.createElement(_s,{className:n?void 0:bl(t)},a.createElement(Vr.A,{isTruncated:!0,size:"small",color:r?"ublue-06":l?"text-4":"text-2",isFullWidth:!0},e),l?a.createElement(Cs,{size:"original",variant:"fill",color:o.warning}):null)},bs=(0,a.createContext)(null),Os=({transitionDuration:e,nodeAttributes:t,children:n,skipPositionAnimation:r=!1,...i})=>{const l=(0,a.useRef)(null),o=(0,a.useRef)(!0),s=(0,a.useRef)(!0),c=(0,a.useRef)(null),{isAnimationBlocked:u}=sr();(0,a.useEffect)(()=>{if(u&&l.current){const e=(0,Fn.A)(l.current);e.interrupt();const n=lt(t.parentY,t.parentX,t.y,t.x,!1);e.attr("transform",n).style("opacity",1)}},[u,t]);const m=(e,t,n=1,r=!1)=>{if(u)return(0,Fn.A)(l.current).attr("transform",e).style("opacity",n),void(s.current=!1);const a=(0,Fn.A)(l.current);c.current=a,a.interrupt();const i=a.transition().duration(t);r?i.style("opacity",n):i.attr("transform",e).style("opacity",n),i.on("end",()=>{s.current=!1})};(0,a.useEffect)(()=>{if(o.current)o.current=!1;else{const n=lt(t.parentY,t.parentX,t.y,t.x,!1);m(n,e,1)}},[e,t.y,t.x,t.parentY,t.parentX,u]);return a.createElement(bs.Provider,{value:l},a.createElement(Cl.Ay,{...i,timeout:{enter:e,exit:e},onExit:()=>{(e=>{if(r){const n=lt(t.parentY,t.parentX,t.y,t.x,!1);m(n,e,0,!0)}else{const n=lt(t.parentY,t.parentX,t.y,t.x,!0);m(n,e,0)}})(e)},onEnter:()=>{(e=>{if(r){const n=lt(t.parentY,t.parentX,t.y,t.x,!1);l.current&&(0,Fn.A)(l.current).style("opacity",0),m(n,e,1,!0)}else{const n=lt(t.parentY,t.parentX,t.y,t.x,!1);m(n,e,1)}})(e)},unmountOnExit:!0,mountOnEnter:!0},n))};var ys=n(532114);const Ns=(0,Hr.A)(dn.A)`
  width: 14px;
  height: 14px;
  background-color: ${u.L};
  border: 1px solid ${({theme:{themeName:e}})=>Ne.Ay[`desktop-color-neutral-08-${e}`]};
  border-radius: ${ln.YC};
  align-items: center;
  justify-content: center;
  padding-top: 1px;
};
`,xs=({stackCount:e})=>{const{themeName:t}=(0,i.u)();return a.createElement("foreignObject",{width:je.hD,height:je.hD,x:-42,y:-7,style:{overflow:"visible"}},a.createElement(Ns,null,a.createElement(ys.A,{size:"xsmall",colorOverride:Ne.Ay[`desktop-color-neutral-08-${t}`]},e)))},Ts={height:je.Sh,gap:ln.YC,alignItems:"center",display:"flex"},Is=(0,Hr.A)(dn.A)`
  position: absolute;
  top: 50%;
  left: 50%;
  align-items: center;
  justify-content: center;
`,vs=(0,Hr.A)(dn.A)`
  width: 100%;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  pointer-events: ${({disableInteraction:e})=>e?"none":"auto"};
  cursor: pointer !important;
  user-select: none;

  border-radius: 6px;
  border: ${({isSelected:e,theme:{motifPalette:{uBlue06:t}}})=>e?`1px solid ${t}`:"none"};
`,{isSafari:ks}=Vn.T,Ms=Si.AH`
  width: 100%;
  max-height: ${je.YM}px;
  height: ${je.YM}px;
  margin-top: ${je.Bs}px;
  justify-content: center;
  display: flex;
  align-items: center;
  transition: ${je.hK};
  ${!ks&&"transform: translateZ(0);"}
`,Ls=(0,Hr.A)(dn.A)`
  width: 100%;
  min-height: ${je.YP}px;
  max-height: ${je.YP}px;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  text-align: center;
  ${!ks&&"transform: translateZ(0);"}
`,Ds=(0,Hr.A)("div")`
  ${Ms}
  ${({isIspNode:e})=>e&&"margin-top: 0;"}

  height: ${({isHovered:e})=>e?je.Ps*je.WQ+"px":`${je.Ps}px`};

  /* Center children */
  & * {
    height: 100%;
    margin-top: 12px;
  }
`,ws=(0,Hr.A)("div")`
  ${Ms}
  ${({isIspNode:e})=>e&&"margin-top: 0;"}
  transform: translateZ(0) scale(${({isHovered:e})=>e?je.WQ:1});

  & * {
    height: 100%;
    max-height: 100%;
  }
`,$s=({isHovered:e,isDeviceNode:t,isIspNode:n,children:r})=>{const{isSafari:i}=Vn.T;return i||fl.gm?a.createElement(Ds,{isHovered:e,isDeviceNode:t,isIspNode:n},r):a.createElement(ws,{isHovered:e,isDeviceNode:t,isIspNode:n},r)},Rs=(0,a.memo)(({nodeAttributes:e})=>{const t=(0,r.useSelector)(oe.ed),{showSignal:n}=t,l=(0,r.useDispatch)(),o=(0,r.useSelector)(qt),s=(0,r.useSelector)(Et),{isAnimationBlocked:c}=sr(),{id:m,state:d,type:p,mac:E,allowedInVisualProgramming:f,name:A,traffic:h,model:g,hasChildren:_,mcLagBottomSwitchMac:C,stackingGroup:S,isLteActive:b,lteDeviceMac:O,wanId:y,hasPoeWarnings:N,hasSmartBattery:x,clientSignal:T,mcLagGroup:I}=e,v=(0,a.useContext)(bs),k=(0,i.u)(),{motifPalette:{orange06:M}}=k,{motif:L}=(0,pl.A)(),D=(0,r.useSelector)((0,a.useMemo)(()=>Zt(E),[E])),[w,$]=(0,a.useState)(lt(e.parentY,e.parentX,e.y,e.x,!0));(0,a.useEffect)(()=>{$(lt(e.parentY,e.parentX,e.y,e.x,!1))},[e.x,e.y,e.parentX,e.parentY]);const R=(0,a.useCallback)(({name:e,type:t,unifiDevice:n,mac:r})=>{l((0,Va.p)(!1)),t===B.USW_WAN||t===B.CABLE_INTERNET?l((0,za.XP)({type:Al.H.DEVICE,id:r})):t===B.ISP?l(b?(0,za.XP)({type:Al.H.DEVICE,id:O}):(0,za.XP)({type:Al.H.ISP_DETAILS,id:y})):l(o?(0,en.X8)({mac:r,type:t,name:e}):(0,za.XP)({type:S&&S._id?Al.H.STACKING:t===B.DEVICE?Al.H.DEVICE:t===B.CLIENT?n?Al.H.UNIFI_DEVICE_CLIENT:Al.H.CLIENT:void 0,id:S?._id||r}))},[l,b,o,O,S,y]),P=(0,a.useMemo)(()=>{const e={};return c&&Object.assign(e,ot),e},[c]),[F,z]=(0,a.useState)(!1),[V,Y]=(0,a.useState)(!1),W=(0,a.useMemo)(()=>F&&!V,[F,V]),G=ze((e=>{const t=e?.type===B.CLIENT?ge.g.CONNECTED:ge.g.UNKNOWN;return _l.q[e.state]||t})({state:d,type:p})),H=p===B.DEVICE,U=p===B.ISP,X=p===B.CLIENT,j=p===B.USW_WAN,Z=p===B.CABLE_INTERNET,K=(0,r.useSelector)((0,a.useMemo)(()=>Qt(E),[E])),q=o&&(!f||!K)&&!U,Q=q||G,J=n&&Boolean(T),ee=x||N||J,te=(0,u.L)({theme:k});return a.createElement("g",{id:m,key:E,ref:v,style:P,transform:w,onMouseEnter:()=>{z(!0)},onMouseLeave:()=>{z(!1)},onClick:()=>q?null:R(e)},a.createElement("g",{style:ot},!_||U||j||Z?null:a.createElement(ho,{mac:E,id:m,setIsChildToggleHovered:Y}),a.createElement("foreignObject",{width:je.hD,height:je.hD,x:-je.hD/2,y:-je.hD/2,style:{overflow:"visible"}},a.createElement(vs,{id:E,isSelected:D,motif:L,disableInteraction:q},!X||W||ks?null:a.createElement(Is,null,a.createElement(hl.A,{mac:E,size:je.Qb})),U?a.createElement(bo,null):null,a.createElement(Mo,{nodeType:p,noWrap:p===B.ISP},a.createElement($s,{isHovered:W,isIspNode:U},j?a.createElement(Bo,{isFaded:Q}):null,Z?a.createElement(Go,{isFaded:Q}):null,X||H?a.createElement(Wo,{allowedInVisualProgramming:f,mac:E,model:g,type:p,isFaded:Q,isMclag:Boolean(C)}):null,U?a.createElement(Uo,null):null)),a.createElement(Ls,null,X||H||Z||j?a.createElement(a.Fragment,null,a.createElement(Ss,{text:S?.name||I?.name||A||E||"",backgroundColor:te,isClientNode:X,isHovered:W,isOffline:G}),s&&Boolean(h?.tx||h?.rx)?a.createElement(hs,{isHovered:W,traffic:h,backgroundColor:te}):null,!s&&(x||N||J)?a.createElement(Tl,{isVisible:ee,style:Ts,applyBackgroundStrip:!0},x?a.createElement(El.A,{height:je.Sh,width:je.Sh,color:M}):null,N?a.createElement(os,{deviceMac:H?E:null,clientMac:X?E:null}):null,J?a.createElement(gl.S,{signal:T,size:"small"}):null):null):null,U?a.createElement(ms,{isHovered:W,backgroundColor:te}):null))),e.stackingGroup?a.createElement(xs,{stackCount:e.stackingGroup.units.length}):null))}),Ps=({onResetFilters:e})=>a.createElement(dn.A,{margin:`${ln.Yc} 0 0 ${ln.ll}`},a.createElement(el.A,{title:a.createElement(fn.sA,{id:"COMMON_NO_MATCH"}),description:a.createElement(fn.sA,{id:"TOPOLOGY_NO_MATCH_IN_FILTERS_DESCRIPTION",values:{button:a.createElement(rn.A,{type:"button",variant:"inline",onClick:e},a.createElement(fn.sA,{id:"COMMON_RESET_THEM_BUTTON_TEXT"}))}})})),Fs=(0,Hr.A)("div")`
  width: 100%;
  height: 100%;
  overflow: hidden;

  &:active {
    cursor: move;
  }

  /* d3-zoom-scale is used in safari to correctly scale transformed nodes
    inside foreignObject */
  .${je.M_} {
    --d3-zoom-scale: 1;
  }
`,zs=({containerSize:e})=>{const{setContainerSize:t}=ir(),{isTopologyVisible:n}=sr(),i=(0,a.useRef)(null),l=(0,r.useDispatch)(),o=(0,r.useSelector)(Ht),s=(0,r.useSelector)(Ut),c=(0,r.useSelector)(de.CZ),u=(0,r.useSelector)(de.Gi),m=(0,r.useSelector)(Z.RE),d=(0,r.useSelector)(wt),p=(0,r.useSelector)(Lt),{offsetAdjustment:E}=Ki(),f=e.containerWidth+E,{containerHeight:A}=e,h=(0,r.useSelector)(Nt),g=(0,r.useSelector)(Et),_=(0,r.useSelector)(le.vc),C=(0,r.useSelector)(g?Yt:Vt),S=(0,a.useRef)(null),b=(0,a.useRef)(null),[O,y]=(0,a.useState)(!0),N=O?0:je.xt;(0,a.useEffect)(()=>{O&&requestAnimationFrame(()=>{y(!1)})},[O]);const x=(0,a.useRef)(new Map),T=(0,a.useRef)(new Map),[I,k]=(0,a.useState)([]),[M,L]=(0,a.useState)([]);(0,a.useEffect)(()=>{const{nodes:e,links:t}=rt(C,h,o,s,_,c,u?.mac,m?.id,d,p);k(e.map(e=>e.id)),L(t.map(e=>it(e))),e.forEach(e=>{const t=x.current.get(e.id);t&&Mn()(t,e)||x.current.set(e.id,e)}),t.forEach(e=>{const t=T.current.get(it(e));t&&Mn()(t,e)||T.current.set(it(e),e)})},[C,h,o,s,_,c,u?.mac,m?.id,d,p]);const{resetZoomTransform:D,onZoomButtonClick:w}=Cr(),$=(0,r.useSelector)(xt);Da(),La(D);const{viewportBounds:R,cullingBounds:P}=(0,a.useMemo)(()=>{const t={x:200*Math.round($.x/200),y:200*Math.round($.y/200),k:Math.round(50*$.k)/50};if(!e.containerWidth||!e.containerHeight)return{viewportBounds:null,cullingBounds:null};const n=((e,t)=>{const{x:n,y:r,k:a}=e,{containerWidth:i,containerHeight:l}=t;return{minX:-n/a,minY:-r/a,maxX:(i-n)/a,maxY:(l-r)/a}})(t,e),r=((e,t)=>{const n=e.maxX-e.minX,r=e.maxY-e.minY,a=(e.minX+e.maxX)/2,i=(e.minY+e.maxY)/2,l=(e=>e<=100?4:e>=500?2.5:4-(e-100)/400*1.5)(t),o=n*l/2,s=r*l/2;return{minX:a-o,minY:i-s,maxX:a+o,maxY:i+s}})(n,I.length);return{viewportBounds:n,cullingBounds:r}},[$.x,$.y,$.k,e,I.length]),F=(0,a.useMemo)(()=>{if(!R||!P)return I;const e=[];return I.forEach(t=>{const n=x.current.get(t);n&&n.type!==B.INVISIBLE_ROOT&&((e,t,n)=>{const r=e>=n.minY&&e<=n.maxY,a=t>=n.minX&&t<=n.maxX;return r&&a})(n.x,n.y,P)&&e.push(t)}),e},[I,R,P]),z=I.length>100,V=(0,a.useCallback)(e=>{D(e)},[D]);(0,a.useEffect)(()=>{t({containerWidth:f,containerHeight:A,offsetAdjustment:E})},[f,A,E,t]);const Y=(0,r.useSelector)(yt),W=(0,a.useCallback)(()=>{l((0,v.bh)(Y))},[Y,l]),{linkElements:G,nodeElements:H}=(0,a.useMemo)(()=>{const e=M.map(e=>{const t=T.current.get(e);return t?a.createElement(Eo,{key:e,nextNodeListRef:S,prevNodeListRef:b,linkProps:t,transitionDuration:N,labelWidth:o,labelLayerRef:i,visibleNodeIds:F}):null}).filter(Boolean);return{nodeElements:F.map(e=>{const t=x.current.get(e);return t?a.createElement(Os,{nodeAttributes:t,transitionDuration:N,skipPositionAnimation:z,key:t.id},a.createElement(Rs,{nodeAttributes:t,key:t.id})):null}).filter(Boolean),linkElements:e}},[i,M,o,F,z,S,b,N,x,T]);return a.createElement(a.Fragment,null,a.createElement(si,{onZoomChange:w,onZoomReset:V,offsetAdjustment:E}),a.createElement(dl,null),C.id===je.Aw&&0===C.children?.length?a.createElement(Ps,{onResetFilters:W}):null,a.createElement(Fs,{style:{position:"absolute",top:"0"}},a.createElement("svg",{className:je.M_,width:`${e.containerWidth}px`,height:`${A}px`,strokeWidth:0,style:{position:"absolute",fontSize:ln.xO,opacity:n?1:0,transition:"opacity 0.1s ease-out"}},a.createElement("g",{className:je.q3,strokeWidth:0},a.createElement("g",{className:je.Oh},a.createElement(ll.A,{appear:!0,exit:!0,component:null},G)),a.createElement(sl,null),a.createElement("g",{className:je.RH},a.createElement(ll.A,{appear:!0,exit:!0,component:null},H)),a.createElement("g",{ref:i,id:je.nh,style:{outline:"none"}})))))},Vs=e=>{const t=(0,r.useSelector)(oe.We),n=(0,r.useDispatch)(),i=(0,r.useSelector)(oe.F3);(0,a.useEffect)(()=>{!i&&e&&e>je.bx&&(n((0,v.t3)({...t,[se.xz.PREFERENCES]:{...t[se.xz.PREFERENCES],[se.Lv.IS_TOPOLOGY_CLIENT_THRESHOLD_EVALUATED]:!0}})),n((0,$n.TC)(!1)))},[i,e,n,t])},Ys=(0,Hr.A)("div")`
  width: 100%;
  height: 100%;
  position: relative;
`;function Ws(){return a.createElement(al.m,null,a.createElement("style",null,`\n        #root > header {\n          position: fixed;\n          top: 0;\n        }\n        #root > main {\n          margin-top: 50px;\n        }\n        #root #app-main nav[class^="nav"] {\n          position: fixed;\n          top: 50px;\n          left: 0;\n          z-index: 12;\n        }\n        #root #app-main > div > .${il.b} {\n          margin-left: 50px;\n        }\n    `))}const Bs=()=>a.createElement(dn.A,{marginLeft:ln.ll},a.createElement(el.A,{title:a.createElement(fn.sA,{id:"COMMON_NO_DEVICES_TITLE"}),description:a.createElement(fn.sA,{id:"COMMON_NO_DEVICES_DETAILS"})})),Gs=()=>{const{ref:e,width:t,height:n}=(0,Ma.A)(),i=(0,r.useSelector)(ee),l=(0,r.useSelector)(Dt);return Vs(l.length),0===i?.vertices?.length?a.createElement(Bs,null):a.createElement(a.Fragment,null,Vn.T.isSafari?a.createElement(Ws,null):null,a.createElement(Ys,{ref:e},e&&t&&n?a.createElement(zs,{containerSize:{containerWidth:t,containerHeight:n,offsetAdjustment:0}}):null))},Hs=e=>l.AH`
  position: absolute !important;
  bottom: 0;
  top: 0;
  z-index: 1;
  background-color: ${(0,u.L)({theme:e})};
`,Us=()=>{const e=(0,r.useDispatch)(),t=(0,i.u)();(0,a.useEffect)(()=>(e(y),()=>{e((0,v.XH)()),e((0,s.NM)(y))}),[e]);const n=(0,r.useSelector)(gt);return(0,p.A)([O(),(0,w.$3)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,T.J4)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,$.d9)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,x.Sk)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,D.Uc)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,C.T)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,L.m)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,_.hh)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,g.F)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,I.QR)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,N.Uc)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),(0,h.uy)(void 0,{crudCacheStrategy:{type:o.e.CACHE}}),...k.wb.map(M.b),(0,d.Zi)(c.B.TOPOLOGY),(0,d.Zi)(c.B.DEVICES),(0,d.Zi)(c.B.UNIFI_DEVICES),(0,d.Zi)(c.B.CLIENTS)],a.createElement(E.A,null,a.createElement(rr,null,a.createElement(or,null,a.createElement(f.A,{leftFilterPageId:m.g1.TOPOLOGY,content:a.createElement(ka,null),overflow:"hidden",leftFilterContentContainerClassname:Hs(t)},n?a.createElement(rl,null):a.createElement(Gs,null)))),a.createElement(vn,null)),{trackingName:A.VO.TOPOLOGY})}},264863:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(296540),a=n(113851),i=n(362584),l=n(528552);const o=({children:e})=>{const{[i.A.IS_MAXIMIZED]:t}=(0,r.useContext)(l.A);return r.createElement(a.A,{isHidden:t},e)}},313437:(e,t,n)=>{n.d(t,{a:()=>a});var r=n(162420);const a=(0,n(71479).A)(r.A)`
  margin-bottom: 3px;
`},329109:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(296540),a=n(691441),i=n(71479),l=n(132196),o=n(373229);const s=(0,i.A)("div")`
  height: 66px;
`,c=l.AH`
  padding: 0px !important;
`,u=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:i,...l})=>e?r.createElement(a.A,null,r.createElement(o.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:i,className:c,...l})):r.createElement(s,null)},343255:(e,t,n)=>{n.d(t,{b:()=>r});const r=248},362584:(e,t,n)=>{var r;n.d(t,{A:()=>r}),function(e){e.IS_MAXIMIZED="isMaximized",e.MAXIMIZED_ID="maximizedId"}(r||(r={}))},373229:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(296540),a=n(758649),i=n(71479),l=n(566723),o=n(699784);const s=(0,i.A)("footer",{shouldForwardProp:e=>"hasFormResetButton"!==e})`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${l.S2} ${l.fS};
  gap: ${l.kc};
`,c=({allowCancel:e,isDirty:t,isInvalid:n,isSubmitting:i,onFormSubmit:l,onFormReset:c,onFormCancel:u,className:m,submitButtonText:d,customButton:p,applyButton:E,applyButtonFirst:f,hideCancelButton:A,form:h})=>{const g=(0,r.useMemo)(()=>E||r.createElement(a.A,{name:"submit",variant:"primary",type:"submit",onClick:l,disabled:!t||n||i,form:h},r.createElement(o.sA,{id:d||"COMMON_ACTION_APPLY_CHANGES"})),[E,h,t,n,i,l,d]);return r.createElement(s,{className:m,hasFormResetButton:!!c},f?g:p,A?null:r.createElement(a.A,{name:"cancel",variant:"default",type:"button",onClick:u,disabled:!e&&!t},r.createElement(o.sA,{id:"COMMON_ACTION_CANCEL"})),c?r.createElement(a.A,{name:"reset",variant:"default",type:"button",onClick:c,disabled:!t},r.createElement(o.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULTS"})):null,f?p:g)}},373934:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(296540),a=n(758649),i=n(216211);const l=({mac:e,port:t,children:n})=>{const{handleGoToPortsPage:l}=(0,i.e)(),o=(0,r.useCallback)(n=>{n.stopPropagation(),l(e,+t)},[l,e,t]);return r.createElement(a.A,{type:"button",size:"inherit",variant:"inline",onClick:o},n)}},445054:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(469733),a=n(296540),i=n(479503);const l=({leftFilterPageId:e,leftFilterColumnsId:t})=>(0,r.useSelector)((0,a.useMemo)(()=>(0,i.$R)(e,t),[e,t]))},445535:(e,t,n)=>{n.d(t,{A:()=>m});var r=n(296540),a=n(822336),i=n(809536),l=n(259836),o=n(998837),s=n(160087),c=n(528552),u=n(362584);const m=({id:e,label:t,initialExpanded:n=!0,hasPaddedContent:m=!1,isStatic:d=!1,isEditorOpen:p=!1,children:E})=>{const{themeName:f}=(0,o.u)(),[A,h]=(0,r.useState)(n),{[u.A.IS_MAXIMIZED]:g,[u.A.MAXIMIZED_ID]:_}=(0,r.useContext)(c.A),C=(0,r.useCallback)(e=>{h(e)},[h]),S=(0,r.useMemo)(()=>d?i.A:l.A,[d]),b=(0,r.useMemo)(()=>({background:p?a.Ay[`desktop-color-neutral-01-${f}`]:"inherit"}),[p,f]),{isLocked:O,isFullHeight:y,isHidden:N,hasDivider:x}=(0,r.useMemo)(()=>({isLocked:g&&_===e,isFullHeight:g&&_===e,isHidden:g&&_!==e,hasDivider:!(g&&_===e)}),[g,_,e]);return t?r.createElement(S,{label:t,size:"small",isExpanded:A,onExpandedChange:C,hasPaddedContent:m,style:b,isLocked:O,isFullHeight:y,isHidden:N,hasDivider:x},A?E:null):r.createElement(s.s,null,E)}},485897:(e,t,n)=>{n.d(t,{A:()=>a,v:()=>r});const r="32768",a=["0","4096","8192","12288","16384","20480","24576","28672","32768","36864","40960","45056","49152","53248","57344","61440"]},501524:(e,t,n)=>{n.d(t,{Zx:()=>u,nC:()=>c,nd:()=>s});var r=n(801081),a=n(524936),i=n(366188),l=n(780811),o=n(532419);const s=(0,r.Mz)(i.Ct,e=>e.filter(e=>!(0,a.nz)(e)&&(0,a.uN)(e)).map(({name:e,_id:t,ip_subnet:n})=>({label:e,value:t,ipSubnet:n}))),c=(0,r.Mz)(i.L4,e=>e.filter(({dhcpd_enabled:e})=>e)),u=(0,r.Mz)(c,o.U$,o.n_,(e,t,n)=>e.length>0&&((0,l.moU)(t)&&t.adopted||e.some(({gateway_device:e})=>n.find(t=>t.mac===e))))},528552:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(296540),a=n(362584);const i={[a.A.IS_MAXIMIZED]:!1,[a.A.MAXIMIZED_ID]:null},l=(0,r.createContext)(i)},533520:(e,t,n)=>{n.d(t,{x:()=>a});var r=n(296540);const a=({mac:e,detailedStates:t,uplinkDisplayName:n,portNumber:a,uplinkMac:i,PortPowerLimitExceededWarning:l,UplinkNearPowerLimitWarning:o,DeviceNearPowerLimitWarning:s=null})=>{switch(!0){case t.port_power_limit_exceeded:return r.createElement(l,{uplinkDisplayName:n,portNumber:a,uplinkMac:i});case t.uplink_near_power_limit:return r.createElement(o,{uplinkMac:i,uplinkDisplayName:n});case t.device_near_power_limit:return!!s&&r.createElement(s,{mac:e});default:return null}}},614054:(e,t,n)=>{n.d(t,{w:()=>r});const r=e=>!!e&&Object.values(e).some(Boolean)},660950:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(296540),a=n(852866),i=n(699784),l=n(373934);const o=({uplinkMac:e,portNumber:t,uplinkDisplayName:n})=>r.createElement(i.sA,{id:"DEVICE_POE_PORT_OUT_OF_POWER",values:{portName:r.createElement(l.A,{mac:e,port:t},`${(0,a.c)(n)} ${(0,i.tz)().formatMessage({id:"COMMON_PORT"})} ${t}`)}})},713769:(e,t,n)=>{n.d(t,{y:()=>l});var r=n(71479),a=n(566723),i=n(294303);const l=(0,r.A)(i.A)`
  flex-direction: column;
  gap: ${a.kc};
  margin: 0 0 ${a.Ln} ${a.kc};
`},727678:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(296540),a=n(445535),i=n(71479),l=n(566723),o=n(294303);const s=(0,i.A)(o.A)`
  display: grid;
  grid-template-columns: ${({columns:e=2})=>`repeat(${e}, calc((100% - ${e-1} * ${l.kc}) / ${e}))`};
  user-select: none;
  column-gap: ${l.kc};
  max-width: 100%;
`,c=(0,i.A)(o.A)`
  display: flex;
  flex-direction: column;
  user-select: none;
  max-width: 100%;
`,u=({label:e,height:t,isSingleColumn:n=!1,columns:i,isEditorOpen:l=!1,initialExpanded:o=!0,isStatic:u=!1,children:m,hasPaddedContent:d=!1})=>{const p=n?c:s;return r.createElement(a.A,{label:e,initialExpanded:o,isStatic:u,hasPaddedContent:d,isEditorOpen:l},r.createElement(p,{height:t,columns:i},m))}},736388:(e,t,n)=>{n.d(t,{A:()=>C});var r=n(296540),a=n(201384),i=n(340936),l=n(77247),o=n(968906),s=n(469733),c=n(479503);const u=e=>(0,s.useSelector)((0,r.useMemo)(()=>(0,c.tR)(e),[e]));var m=n(445054),d=n(67716),p=n(71479),E=n(566723),f=n(294303);const A=(0,p.A)(f.A,{shouldForwardProp:e=>!["isLeftFilterEditorOpen","isLeftFilterColumnsOpen"].includes(e)})`
  ${({isLeftFilterEditorOpen:e,isLeftFilterColumnsOpen:t})=>e||t?`padding-right: ${E.xO};`:""}
`;var h=n(362584),g=n(528552);const _=(0,r.forwardRef)(({children:e,isLeftFilterEditorOpen:t,isLeftFilterColumnsOpen:n,isMaximized:a,maximizedId:i},l)=>{const o=(0,r.useMemo)(()=>({[h.A.IS_MAXIMIZED]:a,[h.A.MAXIMIZED_ID]:i}),[a,i]);return r.createElement(g.A.Provider,{value:o},r.createElement(A,{ref:l,isLeftFilterEditorOpen:t,isLeftFilterColumnsOpen:n},e))}),C=({children:e,tabs:t,columns:n,editor:s,footer:c,leftFilterPageId:p,leftFilterColumnsId:E,contentTestId:f,footerTestId:A})=>{const{height:h,ref:g}=(0,i.A)(),C=(0,r.useRef)(null),S=(0,l.A)(C),b=u(p),O=(0,m.A)({leftFilterPageId:p,leftFilterColumnsId:E});return r.createElement(a.A,null,a=>r.createElement(_,{ref:g,isLeftFilterEditorOpen:b,isLeftFilterColumnsOpen:O,...a},r.createElement(d.fy,{height:h},t,r.createElement(d.yE,{ref:C,...f?o.A.addDataTestId(f):{}},e,r.createElement(d.Ot,{hasOverflow:S},c)),S?r.createElement(d.sN,{...A?o.A.addDataTestId(A):{}},r.createElement(d.d$,null),c):null),s&&b?r.createElement(d._G,null,s):null,n&&O?r.createElement(d.o2,{isLeftFilterEditorOpen:b},n):null))}},740618:(e,t,n)=>{n.d(t,{gm:()=>i,nr:()=>l});var r=n(146880);const a=n.n(r)().getParser(window.navigator.userAgent).getBrowserName().toLowerCase(),i="firefox"===a,l="safari"===a},773033:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(469733),a=n(296540),i=n(212178);const l=(e,t,n)=>{const l=(0,r.useDispatch)(),o=[JSON.stringify(e),JSON.stringify(t)].join(),s=(0,i.A)(o);return(0,a.useEffect)(()=>{if(o!==s){const r=[],a=e.length;for(let n=0;n<a;n+=1){const a=e[n];t.includes(a)||r.push(a)}r.length&&l(n(e.filter(e=>!r.includes(e))))}},[o,s,e,t,n,l]),null}},861878:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(296540),a=n(217439),i=n(592563),l=n(699784);const o=n(132196).AH`
  justify-content: flex-start;
`,s=({onPress:e,labelId:t,disabled:n})=>r.createElement(i.A,{type:"button",onPress:e,isDisabled:n,className:o},r.createElement(a.A,{size:"medium",color:"inherit"},r.createElement(l.sA,{id:t})))},900752:(e,t,n)=>{n.d(t,{A:()=>p});var r=n(296540),a=n(979106),i=n(67716),l=n(71479),o=n(566723);const s=(0,l.A)("div")`
  > nav > button {
    display: flex;
    flex-direction: row;
    gap: ${o.YC};
  }
`;var c=n(132196);const u=c.AH`
  height: 32px;
`,m=c.AH`
  padding: ${o.YC} !important;
`,d=c.AH`
  padding: ${o.YC} ${o.Ln} !important;
`,p=({selectedTab:e,tabs:t,...n})=>{const l=(0,r.useMemo)(()=>t.map(t=>e===t.id?t:{...t,label:void 0}),[t,e]);return l.length>1?r.createElement(i.T_,null,r.createElement(s,null,r.createElement(a.A,{variant:"capsule",stretched:!0,className:u,tabsClassName:u,tabClassName:m,selectedTabClassName:d,tabs:l,selectedTab:e,...n}))):null}}}]);