"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[30497],{132650(e,t,n){var l;n.d(t,{A:()=>a}),function(e){e.AUTO="auto",e.POE="8023af",e.POE_PLUS="8023at",e.POE_PLUS_PLUS="poe-injector",e.ADAPTER="adapter"}(l||(l={}));const a=l},485897(e,t,n){n.d(t,{Ay:()=>o,L3:()=>a,v3:()=>l});const l="32768",a=e=>null!=e?String(e):l,o=["0","4096","8192","12288","16384","20480","24576","28672","32768","36864","40960","45056","49152","53248","57344","61440"]},543791(e,t,n){n.d(t,{A:()=>r});var l=n(296540),a=n(271856),o=n(916537);const r=({show:e,children:t,position:n})=>l.createElement(a.A,{position:n||"topStart",description:e?l.createElement(o.sA,{id:"DEVICE_DISABLE_GLOBAL_SWITCH_SETTINGS"}):void 0},l.createElement("span",null,t))},263262(e,t,n){n.d(t,{A:()=>P,g:()=>g});var l=n(82960),a=n(469733),o=n(296540),r=n(951272),i=n(217439),d=n(870443),s=n(566723),c=n(855019),_=n(62227),m=n(143811),E=n(294303),A=n(845030),u=n(916537),p=n(302167),b=n(366188),O=n(780811),f=n(239417),v=n(785146),w=n(31208),I=n(726317);const g="network",C=(0,r.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:{config_network:e,model:t,ip:n,switch_vlan_enabled:l,mgmt_network_id:a,connection_network_id:o},nativeNetworks:r})=>{const i=(0,O.U$e)(r,o);return{config_network:{type:e?.type||c.NL.DHCP,ip:e?.ip||n||"",netmask:e?.netmask||i?.netmask||"",gateway:e?.gateway||i?.ip||"",dns1:e?.dns1||i?.dns1||"",dns2:e?.dns2||i?.dns2||"",dnssuffix:e?.dnssuffix||"",bonding_enabled:e?.bonding_enabled||!1},mgmt_network_id:(0,O.ewD)(r,a),switch_vlan_enabled:l||!1,...((0,O.C6C)({model:t}),{})}},handleSubmit:(e,{resetForm:t})=>{t({values:e})},validationSchema:({honeypotNetworksIps:e,clients:t})=>d.A.object().shape({config_network:(0,_.d)(e,t),mgmt_network_id:d.A.string(),lte_limit_enabled:d.A.boolean().label("COMMON_LTE_DATA_LIMIT"),lte_limit:d.A.number().integer().label("COMMON_DATA_LIMIT").when("lte_limit_enabled",{is:!0,then:d.A.number().min(1).required().label("COMMON_DATA_LIMIT")})})}),P=(0,l.Zz)((0,a.connect)(e=>({nativeNetworks:(0,b.Tn)(e),honeypotNetworksIps:(0,p.Yk)(e),clients:(0,f.A8)(e)})),C)(({setFormDirty:e,setFormInvalid:t,dirty:n,values:l,resetForm:r,isValid:d,initialValues:_,activeItem:p,nativeNetworks:b,hideNetworkOverride:f,formName:C=g})=>{const P=(0,a.useDispatch)(),R=(0,O.iQS)(p.model),S=(0,O.C6C)(p);(0,o.useEffect)(()=>{e(g,n),t(g,!d)},[e,t,n,d]);const T=(0,O.moU)(p);(0,o.useEffect)(()=>(P((0,A.uo)({[C]:()=>{const e={config_network:l.config_network?.type===c.NL.STATIC?l.config_network:{type:c.NL.DHCP,bonding_enabled:l.config_network?.bonding_enabled},mgmt_network_id:l.mgmt_network_id};return R&&(e.switch_vlan_enabled=l.switch_vlan_enabled,_.switch_vlan_enabled&&!l.switch_vlan_enabled&&p.port_overrides?.length&&(e.port_overrides=(p.port_overrides||[]).map(({portconf_id:e,...t})=>t))),e}})),P((0,A.Oo)({[C]:()=>r({values:l})})),P((0,A.rW)({[C]:r})),()=>{P((0,A.uo)({[C]:null})),P((0,A.Oo)({[C]:null})),P((0,A.rW)({[C]:null}))}),[P,r,l,C,p.port_overrides,_.switch_vlan_enabled,R,S]);const h=!f&&!T&&b.length>1&&!(0,O.q82)({model:p.model})&&!(0,O.xQi)({model:p.model});return o.createElement(E.A,{flexDirection:"column",gap:s.S2},h?o.createElement(v.A,{nativeNetworks:b,activeItemMac:p.mac}):null,o.createElement(I.A,null),l.config_network?.type===c.NL.STATIC?o.createElement(w.A,null):null,(0,O.xyH)(p)||(0,O.Eyk)(p)||(0,O._iI)(p)||(0,O.W46)(p)?o.createElement(E.A,null,o.createElement(m.A,{name:"config_network.bonding_enabled",type:"realCheckbox"},o.createElement(u.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_AGGREGATION"}))):null,R?o.createElement(E.A,{flexDirection:"column",gap:s.kc},o.createElement(i.A,{weight:"bold",size:"medium"},o.createElement(u.sA,{id:"COMMON_VLAN"})),o.createElement(E.A,{justifyContent:"space-between"},o.createElement(i.A,{size:"medium"},o.createElement(u.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_VLAN"})),o.createElement(m.A,{type:"checkbox",name:"switch_vlan_enabled"}))):null,null)})},45062(e,t,n){n.d(t,{A:()=>le,q:()=>H});var l=n(82960),a=n(469733),o=n(296540),r=n(951272),i=n(271856),d=n(217439),s=n(758649),c=n(720561),_=n(162420),m=n(71479),E=n(968906),A=n(6510),u=n(592510),p=n(870443),b=n(790543),O=n(860631),f=n(398300),v=n(566723),w=n(543791),I=n(854246),g=n(143811),C=n(294303),P=n(845030),R=n(126457),S=n(86392),T=n(916537),h=n(823881),N=n(302167),D=n(457311),k=n(609695),L=n(140614),M=n(366188),y=n(780811),x=n(927806),U=n(768195),V=n(532419),F=n(485897),B=n(132650),z=n(171073),W=n(959341),G=n(398146),j=n(311785);const H="services",$=(0,m.A)(d.A)`
  align-items: center;
  justify-content: center;
  margin-bottom: ${v.Ln};
`,K=(0,m.A)(d.A)`
  flex: 1;
  margin-right: ${v.xO};
`,X=(0,m.A)("div",(0,j.A)("marginBottom","marginTop"))`
  margin-bottom: ${({marginBottom:e})=>e||0}px;
  margin-top: ${({marginTop:e})=>e||0}px;
`,Q=(0,m.A)(C.A)`
  margin-bottom: ${e=>e.marginBottom||0}px;
  justify-content: space-between;
`,Y=(0,m.A)(_.A)`
  margin-bottom: 2px;
`,q=(0,m.A)(i.A,(0,j.A)("disabled"))`
  ${({disabled:e})=>e&&"opacity: 0.4; pointer-events: none;"}
`,J=(0,m.A)("div")`
  margin-right: 6px;
`,Z=(0,m.A)("div")`
  > div {
    margin-top: ${v.YC};
    > span {
      line-height: 20px;
    }
  }
`,ee=(0,r.bk)({enableReinitialize:!0,mapPropsToValues:({switchDeviceData:{jumboframe_enabled:e=!1,flowctrl_enabled:t=!1,stp_version:n=h.uI.RSTP,stp_priority:l,dot1x_portctrl_enabled:a=!1,radiusprofile_id:o,dot1x_fallback_networkconf_id:r="",snmp_location:i="",snmp_contact:d="",lowpfmode_override:s,lowpfmode:c,outdoor_mode_override:_=U.Gi.DEFAULT,power_source_ctrl:m=B.A.AUTO,power_source_ctrl_enabled:E=!1},defaultRadiusProfile:A})=>({jumboframe_enabled:e,flowctrl_enabled:t,stp_version:n,stp_priority:(0,F.L3)(l),dot1x_portctrl_enabled:a,radiusprofile_id:o||A?._id||"",dot1x_fallback_networkconf_id:r,snmp_location:i,snmp_contact:d,snmpEnabled:Boolean(i||d),outdoor_mode_override:_,lowpfmode_override:s||c,power_source_ctrl:m,power_source_ctrl_enabled:E}),validationSchema:({defaultRadiusProfile:e})=>p.A.object().shape({flowctrl_enabled:p.A.boolean(),stp_version:p.A.string(),stp_priority:p.A.string(),dot1x_portctrl_enabled:p.A.boolean(),lowpfmode_override:p.A.boolean(),...G.U,radiusprofile_id:p.A.string().when("dot1x_portctrl_enabled",{is:!0,then:p.A.string().test({name:"isDefaultRadiusProfileEnabled",test:t=>t!==e._id||e.enabled,message:o.createElement(T.sA,{id:"COMMON_VALIDATION_VALID_DEFAULT_RADIUS_PROFILE"})})}),radiusProfiles:p.A.array().of(p.A.object()),radiusSettings:p.A.object(),dot1x_fallback_networkconf_id:p.A.string(),outdoor_mode_override:p.A.string(),power_source_ctrl:p.A.string(),power_source_ctrl_enabled:p.A.boolean()}),handleSubmit:()=>null}),te=[{label:"DEVICE_PROPERTIES_VALUES_SPANNING_TREE_STP",value:"stp"},{label:"DEVICE_PROPERTIES_VALUES_SPANNING_TREE_RSTP",value:"rstp"},{label:"COMMON_DISABLED",value:"disabled"}],ne=F.Ay.map(e=>({label:e,value:e})),le=(0,l.Zz)((0,a.connect)((e,{activeItem:t})=>({nativeNetworks:(0,M.Tn)(e),switchDeviceData:(0,V.tG)(t.mac)(e),radiusOptions:(0,k.selectAllRadiusOptions)(e),radiusProfiles:(0,k.selectAllRadiusProfiles)(e),radiusSettings:(0,N.QC)(e),globalSwitchSettings:(0,N.zu)(e)}),{updateDevice:z.c8,fetchRadiusProfiles:L.fetchRadiusProfiles,fetchSettings:D.Uc}),ee,(0,b.A)(({fetchRadiusProfiles:e,fetchSettings:t})=>Promise.all([e(void 0,{crudCacheStrategy:{type:u.e.CACHE}}),t(void 0,{crudCacheStrategy:{type:u.e.CACHE}})])))(({activeItem:e,values:t,errors:n,resetForm:l,dirty:r,setFormDirty:m,setFormInvalid:u,setFieldValue:p,nativeNetworks:b=[],isValid:N,hideFlowControl:D,formName:L=H,globalSwitchSettings:M,isGlobalSwitchSettingsEnabled:F})=>{const{formatMessage:z}=(0,T.tz)(),j=(0,a.useDispatch)(),ee=((0,y.Tbi)(e)||(0,y.moU)(e)&&(0,y.rm3)(e))&&F,le=(0,O.kL)(e.switch_caps?.feature_caps),ae=(0,O.R8)(e.switch_caps?.feature_caps),oe=(0,y.KKO)(e.model,"outdoorModeSupport"),re=(0,y.moU)(e),ie=(0,a.useSelector)(V.ID),de=(0,O.CB)(e),se=(0,x.$Y)({device:e,devices:ie}),ce=e.lowpfmode,_e=(0,O.gU)(e,se),me=(0,y.J2F)(e),Ee=(0,a.useSelector)(k.selectAllRadiusOptions),Ae=(0,o.useCallback)(()=>{j((0,P.XP)({type:f.H.NETWORK,id:W.R6}))},[j]);(0,o.useEffect)(()=>{m(L,r),u(L,!N)},[u,m,r,N,L]),(0,o.useEffect)(()=>(j((0,P.uo)({[L]:()=>({snmp_contact:t.snmpEnabled?t.snmp_contact:"",snmp_location:t.snmpEnabled?t.snmp_location:"",...ee?{}:{...!D&&{jumboframe_enabled:t.jumboframe_enabled,flowctrl_enabled:t.flowctrl_enabled},...le&&{stp_version:t.stp_version,stp_priority:t.stp_priority},...ae&&{dot1x_portctrl_enabled:t.dot1x_portctrl_enabled},...t.dot1x_portctrl_enabled&&ae&&{radiusprofile_id:t.radiusprofile_id,dot1x_fallback_networkconf_id:t.dot1x_fallback_networkconf_id}},...oe&&{outdoor_mode_override:t.outdoor_mode_override},...ce&&{lowpfmode_override:t.lowpfmode_override},...de&&{power_source_ctrl:t.power_source_ctrl,power_source_ctrl_enabled:t.power_source_ctrl!==B.A.AUTO}})})),j((0,P.Oo)({[L]:()=>l({values:t})})),j((0,P.rW)({[L]:l})),()=>{j((0,P.uo)({[L]:null})),j((0,P.Oo)({[L]:null})),j((0,P.rW)({[L]:null}))}),[e._id,j,l,t,L,ae,le,re,D,oe,de,ee,ce]);const ue=(0,o.useMemo)(()=>b.map(e=>({value:e._id,label:e.name})),[b]);return o.createElement(C.A,{width:"100%",flexDirection:"column",flex:"1 1 85%"},o.createElement(w.A,{show:ee},o.createElement(C.A,{flexDirection:"column"},D?null:o.createElement(o.Fragment,null,o.createElement(Q,{marginBottom:16},o.createElement(K,{size:"medium",color:ee?"disabled":void 0},o.createElement(T.sA,{id:"COMMON_JUMBO_FRAMES"})),o.createElement(g.A,{name:"jumboframe_enabled",type:"checkbox",checked:ee?M.jumboframe_enabled:t.jumboframe_enabled,disabled:ee})),o.createElement(Q,{marginBottom:16},o.createElement(K,{size:"medium",color:ee?"disabled":void 0},o.createElement(T.sA,{id:"COMMON_FLOW_CONTROL"})),o.createElement(g.A,{name:"flowctrl_enabled",type:"checkbox",checked:ee?M.flowctrl_enabled:t.flowctrl_enabled,disabled:ee}))),le?o.createElement(o.Fragment,null,o.createElement(X,{marginBottom:16},o.createElement(g.A,{label:"COMMON_DEVICE_CAP_SWITCH_CAP_STP",name:"stp_version",full:!0,type:"dropdown",variant:"secondary",translateOptions:!0,translateLabel:!0,options:te,value:ee?M.stp_version:t.stp_version,disabled:ee})),t.stp_version!==h.uI.DISABLED?o.createElement(X,{marginBottom:16},o.createElement(g.A,{label:"COMMON_PRIORITY",name:"stp_priority",type:"dropdown",variant:"secondary",full:!0,validated:!0,options:ne,translateLabel:!0,value:t.stp_priority,disabled:ee})):null):null,ae?o.createElement(o.Fragment,null,o.createElement(Q,{marginBottom:16},o.createElement(K,{size:"medium",color:ee?"disabled":void 0},o.createElement(C.A,{alignItems:"center"},o.createElement(J,null,o.createElement(T.sA,{id:"COMMON_DEVICE_CAP_SWITCH_CAP_DOT1X"})),o.createElement(q,{width:200,description:o.createElement(T.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_8021X_CONTROL_D"}),disabled:ee},o.createElement(Y,{size:"original",isActive:!0,disabled:ee})))),o.createElement(g.A,{label:"COMMON_DEVICE_CAP_SWITCH_CAP_DOT1X",name:"dot1x_portctrl_enabled",type:"checkbox",checked:ee?M.dot1x_portctrl_enabled:t.dot1x_portctrl_enabled,disabled:ee})),t.dot1x_portctrl_enabled?o.createElement(o.Fragment,null,o.createElement(X,{marginBottom:8},o.createElement(g.A,{label:"COMMON_RADIUS_PROFILE",name:"radiusprofile_id",type:"dropdown",variant:"secondary",full:!0,options:Ee,invalid:!!n.radiusprofile_id,translateLabel:!0,value:ee?M.radiusprofile_id:t.radiusprofile_id,disabled:ee}),n.radiusprofile_id?o.createElement(Z,null,o.createElement(I.A,{align:"left",visible:!0},n.radiusprofile_id)):null),o.createElement(Q,{marginBottom:16},o.createElement(s.A,{size:"small",type:"button",variant:"inline",onClick:()=>{j((0,P.XP)({type:f.H.CUSTOM_RADIUS_PROFILE,id:W.R6}))},...E.A.addDataTestId(E.A.TestId.SIDE_PANEL_TRIGGER),Icon:c.A,iconProps:{isActive:!0}},o.createElement(d.A,{color:"inherit",size:"medium"},o.createElement(T.sA,{id:"COMMON_CREATE_NEW_RADIUS_PROFILE"})))),o.createElement(X,{marginBottom:8},o.createElement(g.A,{label:"DEVICE_PROPERTIES_LABEL_FALLBACK_VLAN",name:"dot1x_fallback_networkconf_id",type:"dropdown",variant:"secondary",full:!0,validated:!0,options:[{label:z({id:"COMMON_NONE"}),value:""},...ue],translateLabel:!0,value:ee?M.dot1x_fallback_networkconf_id:t.dot1x_fallback_networkconf_id,disabled:ee})),o.createElement(Q,{marginBottom:16},o.createElement(s.A,{size:"small",type:"button",variant:"inline",onClick:Ae,...E.A.addDataTestId(E.A.TestId.SIDE_PANEL_TRIGGER),Icon:c.A,iconProps:{isActive:!0}},o.createElement(d.A,{color:"inherit",size:"medium"},o.createElement(T.sA,{id:"COMMON_CREATE_NEW_NETWORK"}))))):null):null)),(0,O.A6)(e)?o.createElement(G.A,null):null,de?o.createElement(o.Fragment,null,o.createElement($,{weight:"bold"},o.createElement(T.sA,{id:"DEVICE_PROPERTIES_LABEL_POWER_SOURCE"})),o.createElement(X,{marginBottom:oe?24:0},o.createElement(C.A,{gap:v.Ln},o.createElement(g.A,{type:"radio",name:"power_source_ctrl",value:B.A.AUTO},o.createElement(d.A,null,o.createElement(T.sA,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_AUTO"}))),o.createElement(g.A,{type:"radio",name:"power_source_ctrl",value:B.A.POE},o.createElement(d.A,null,o.createElement(T.sA,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_POE_8023AF"}))),o.createElement(g.A,{type:"radio",name:"power_source_ctrl",value:B.A.POE_PLUS_PLUS},o.createElement(d.A,null,o.createElement(T.sA,{id:"DEVICE_PROPERTIES_VALUES_POWER_SOURCE_POE_INJECTOR"})))))):null,oe?o.createElement(C.A,{justifyContent:"space-between",alignItems:"flex-start"},o.createElement(C.A,{alignItems:"center"},o.createElement(d.A,{size:"medium"},o.createElement(J,null,o.createElement(T.sA,{id:"COMMON_OUTDOOR_MODE"}))),o.createElement(i.A,{width:200,description:o.createElement(T.sA,{id:"DEVICE_PROPERTIES_LABEL_OUTDOOR_MODE_DESCRIPTION"})},o.createElement(_.A,{isActive:!0,size:"original"}))),o.createElement(g.A,{type:"checkbox",name:"outdoor_mode_override",value:t.outdoor_mode_override===U.Gi.ON,afterChange:e=>{me&&e?j((0,S.E)({title:"DEVICE_PROPERTIES_LABEL_OUTDOOR_MODE_CONFIRM_TITLE",message:"DEVICE_PROPERTIES_LABEL_OUTDOOR_MODE_CONFIRM_MESSAGE",onConfirm:()=>{j((0,R.AS)()),p("outdoor_mode_override",U.Gi.ON)}})):p("outdoor_mode_override",e?U.Gi.ON:U.Gi.OFF)}})):null,ce?o.createElement(C.A,{justifyContent:"space-between",alignItems:"flex-start"},o.createElement(C.A,{alignItems:"center"},o.createElement(d.A,{size:"medium"},o.createElement(J,null,o.createElement(T.sA,{id:"COMMON_LOW_PERFORMANCE_MODE"}))),o.createElement(i.A,{width:200,description:o.createElement(T.sA,{id:_e,values:{name:(0,A.Q)(e)}})},o.createElement(_.A,{isActive:!0,size:"original"}))),o.createElement(g.A,{type:"checkbox",name:"lowpfmode_override"})):null)})},726317(e,t,n){n.d(t,{A:()=>_});var l=n(296540),a=n(217439),o=n(454195),r=n(566723),i=n(855019),d=n(143811),s=n(294303),c=n(916537);const _=(0,l.memo)(()=>l.createElement(s.A,{flexDirection:"column"},l.createElement(a.A,{color:"text-3",size:"small"},l.createElement(c.sA,{id:"COMMON_IP_CONFIGURATION"})),l.createElement(s.A,{height:o.b,alignItems:"center",gap:r.Ln},l.createElement(d.A,{name:"config_network.type",type:"radio",value:i.NL.DHCP},l.createElement(c.sA,{id:"COMMON_DHCP"})),l.createElement(d.A,{name:"config_network.type",type:"radio",value:i.NL.STATIC},l.createElement(c.sA,{id:"COMMON_STATIC"})))))},790543(e,t,n){n.d(t,{A:()=>a});var l=n(296540);const a=(e,t=()=>null,n=null,a=!1)=>o=>class extends l.Component{isCanceled=!1;state={loaded:!1};UNSAFE_componentWillMount(){n&&performance.mark(`ufsdn.${n}:start`)}componentDidMount(){Promise.resolve(e(this.props)).then(()=>{this.isCanceled||(this.setState({loaded:!0}),n&&performance.measure(`ufsdn.${n}-rendered`,`ufsdn.${n}:start`))})}componentWillUnmount(){this.isCanceled=!0}render(){return a?l.createElement(o,{...this.props,isLoaded:this.state.loaded}):this.state.loaded?l.createElement(o,{...this.props}):l.createElement(t,null)}}}}]);