"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[8032],{688032:(e,t,n)=>{n.r(t),n.d(t,{default:()=>U});var a=n(296540),r=n(54227),l=n(469733),c=n(553432),s=n(459449),i=n(582724),o=n(464265),d=n(598796),S=n(504779),u=n(959341),E=n(649594),p=n(532419),_=n(419042),m=n(602021),P=n(472926),G=n(49748),A=n(830137),I=n(467802),T=n(547913),O=n(473714),N=n(921266);const f={[P.Z.BGP]:"SETTINGS_ROUTING_BGP_NAME",[P.Z.OSPF]:"SETTINGS_ROUTING_OSPF_NAME"},R={[P.Z.BGP]:A.default,[P.Z.OSPF]:G.default},v={[P.Z.BGP]:I.default.dependencies,[P.Z.OSPF]:T.default.dependencies},y=({type:e,typeSelector:t})=>{const n=R[e],r=a.createElement(n,{typeSelector:t,activeItem:{_id:u.R6}});return(0,i.A)(v[e]||[],r,{renderKey:e,placeholder:a.createElement(a.Fragment,{key:"fallback"},r),pastDelay:0})},F=({activeItem:e})=>{const t=(0,o.A)(d.Xj.OSPF_ROUTING),n=(0,o.A)(d.Xj.BGP_ROUTING),i=(0,o.A)(d.Xj.SWITCH_BGP_ROUTING),u=(0,l.useSelector)(E.Z0),P=(0,l.useSelector)(_._V),G=(0,l.useSelector)(p.UV),A=(0,l.useSelector)(m.vc),I=(0,a.useMemo)(()=>N.A.map(e=>({option:e,disabledReason:(0,O.x)(e,u,P,G,A,n,i,t)})),[P,G,n,t,i,u,A]),[T,R]=(0,a.useState)(e.type||I.filter(({disabledReason:e})=>!e)[0]?.option);return a.createElement(y,{type:T,typeSelector:a.createElement(c.A,null,I.map(({option:e,disabledReason:t})=>a.createElement(S.A,{key:e,reason:T!==e&&t},a.createElement(r.A,{value:e,id:e,checked:T===e,onChange:()=>R(e),disabled:!!t&&T!==e},a.createElement(s.sA,{id:f[e]}))))),key:T})},U=({activeItem:e})=>a.createElement(F,{key:e.type,activeItem:e})},921266:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(472926);const r=[a.Z.OSPF,a.Z.BGP]},473714:(e,t,n)=>{n.d(t,{x:()=>s});var a=n(296540),r=n(459449),l=n(271751),c=n(472926);const s=(e,t,n,s,i,o,d,S)=>{if(e===c.Z.OSPF&&!S)return a.createElement(r.sA,{id:"SETTINGS_OSPF_NOT_SUPPORTED"});if(e===c.Z.OSPF&&t.length>=l.XM)return a.createElement(r.sA,{id:"SETTINGS_OSPF_MAX_CONFIGURATIONS_REACHED"});if(e===c.Z.BGP&&!o&&!d)return a.createElement(r.sA,{id:"SETTINGS_BGP_NOT_SUPPORTED"});if(e===c.Z.BGP){if(!s.map(({mac:e})=>e).concat(o&&i?[i]:[]).some(e=>!n.some(({device_mac:t})=>t===e)))return a.createElement(r.sA,{id:"SETTINGS_ROUTING_BGP_ALREADY_CONFIGURED_DEVICES"})}return null}},504779:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(271856),r=n(296540),l=n(641777),c=n(284428);const s=({reasons:e,reason:t,children:n,isInteractive:s,noWrap:i})=>{const o=(0,c.pv)(),d=[t,...e||[]].filter(Boolean)[0]||null,S=!!d;return r.createElement(l.A,{isDisabled:{fields:S,labels:S,tooltipIcons:S,tooltipPopovers:!o.fields&&S}},r.createElement(a.A,{description:o.fields?null:d,portal:!0,isInteractive:s,noWrap:i},n))}}}]);