"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[88032],{473714:(e,t,n)=>{n.d(t,{x:()=>i});var a=n(296540),r=n(699784),l=n(271751),c=n(472926);const i=(e,t,n,i,o,s,d,p)=>{if(e===c.Z.OSPF&&!p)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&&!s&&!d)return a.createElement(r.sA,{id:"SETTINGS_BGP_NOT_SUPPORTED"});if(e===c.Z.BGP){if(!i.map(({mac:e})=>e).concat(s&&o?[o]:[]).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:()=>i});var a=n(296540),r=n(271856),l=n(284428),c=n(641777);const i=({reasons:e,reason:t,children:n,isInteractive:i,noWrap:o})=>{const s=(0,l.pv)(),d=[t,...e||[]].filter(Boolean)[0]||null,p=!!d;return a.createElement(c.A,{isDisabled:{fields:p,labels:p,tooltipIcons:p,tooltipPopovers:!s.fields&&p}},a.createElement(r.A,{description:s.fields?null:d,portal:!0,isInteractive:i,noWrap:o},n))}},553432:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(296540),r=n(454195),l=n(566723),c=n(294303);const i=e=>a.createElement(c.A,{paddingTop:l.YC,paddingBottom:l.YC,gap:l.Ln,rowGap:l.YC,flexWrap:"wrap",minHeight:r.b,alignItems:"center",...e})},688032:(e,t,n)=>{n.r(t),n.d(t,{default:()=>F});var a=n(296540),r=n(469733),l=n(54227),c=n(582724),i=n(464265),o=n(504779),s=n(553432),d=n(699784),p=n(649594),S=n(602021),m=n(598796),E=n(532419),u=n(419042),_=n(959341),A=n(472926),G=n(49748),P=n(547913),I=n(467802),T=n(992432),O=n(473714),f=n(921266);const N={[A.Z.BGP]:"SETTINGS_ROUTING_BGP_NAME",[A.Z.OSPF]:"SETTINGS_ROUTING_OSPF_NAME"},v={[A.Z.BGP]:T.default,[A.Z.OSPF]:G.default},R={[A.Z.BGP]:I.default.dependencies,[A.Z.OSPF]:P.default.dependencies},y=({type:e,typeSelector:t})=>{const n=v[e],r=a.createElement(n,{typeSelector:t,activeItem:{_id:_.R6}});return(0,c.A)(R[e]||[],r,{renderKey:e,placeholder:a.createElement(a.Fragment,{key:"fallback"},r),pastDelay:0})},B=({activeItem:e})=>{const t=(0,i.A)(m.Xj.OSPF_ROUTING),n=(0,i.A)(m.Xj.BGP_ROUTING),c=(0,i.A)(m.Xj.SWITCH_BGP_ROUTING),_=(0,r.useSelector)(p.Z0),A=(0,r.useSelector)(u._V),G=(0,r.useSelector)(E.UV),P=(0,r.useSelector)(S.vc),I=(0,a.useMemo)(()=>f.A.map(e=>({option:e,disabledReason:(0,O.x)(e,_,A,G,P,n,c,t)})),[A,G,n,t,c,_,P]),[T,v]=(0,a.useState)(e.type||I.filter(({disabledReason:e})=>!e)[0]?.option);return a.createElement(y,{type:T,typeSelector:a.createElement(s.A,null,I.map(({option:e,disabledReason:t})=>a.createElement(o.A,{key:e,reason:T!==e&&t},a.createElement(l.A,{value:e,id:e,checked:T===e,onChange:()=>v(e),disabled:!!t&&T!==e},a.createElement(d.sA,{id:N[e]}))))),key:T})},F=({activeItem:e})=>a.createElement(B,{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]}}]);