"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[88257],{31208:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(296540),r=n(71479),i=n(566723),l=n(143811);const s=(0,r.A)("div")`
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
  row-gap: ${i.kc};
  column-gap: ${i.Ln};
`,o=(0,a.memo)(({prefix:e=""})=>a.createElement(s,null,a.createElement(l.A,{label:"COMMON_IP_ADDRESS",name:`${e}config_network.ip`,variant:"secondary",full:!0}),a.createElement(l.A,{label:"COMMON_PREFERRED_DNS",name:`${e}config_network.dns1`,variant:"secondary",full:!0}),a.createElement(l.A,{label:"COMMON_SUBNET_MASK",name:`${e}config_network.netmask`,variant:"secondary",full:!0}),a.createElement(l.A,{label:"COMMON_ALTERNATE_DNS",name:`${e}config_network.dns2`,variant:"secondary",full:!0}),a.createElement(l.A,{label:"COMMON_GATEWAY",name:`${e}config_network.gateway`,variant:"secondary",full:!0}),a.createElement(l.A,{label:"COMMON_DNS_SUFFIX",name:`${e}config_network.dnssuffix`,variant:"secondary",full:!0})))},62227:(e,t,n)=>{n.d(t,{d:()=>A});var a=n(296540),r=n(149133),i=n(870443),l=n(699784),s=n(546391);const o=i.A.string().matches(s.Q0,{message:a.createElement(l.sA,{id:"COMMON_VALIDATION_VALID_IPV4_MASK"})});var c=n(167761),m=n(582e3),d=n(94456);const A=(e,t)=>i.A.object().shape({type:i.A.string(),ip:i.A.string().when("type",{is:"static",then:c.A.required(a.createElement(l.sA,{id:"COMMON_VALIDATION_FIELD_REQUIRED"})).test({name:"isHoneypotIp",test:(t,{createError:n})=>!e.includes(t)||n({message:a.createElement(l.sA,{id:"API_ERROR_IP_ALREADY_USED_BY_HONEYPOT",values:{link:a.createElement(m.A,null)}})})}).test({name:"isFixedIpNotUsedByClient",test:(e,{createError:n})=>{if(!e)return!0;const r=t.find(t=>[t.ip,"use_fixedip"in t&&t.use_fixedip&&"fixed_ip"in t&&t.fixed_ip].includes(e));return!r||n({message:a.createElement(l.sA,{id:"API_ERROR_IP_ALREADY_USED",values:{link:a.createElement(d.A,{mac:"mac"in r&&r.mac,name:r.name,display_name:r.display_name})}})})}}).test({name:"gateway-ip-not-equal-to-ip",test:(e,{createError:t,parent:n})=>e!==n.gateway||t({message:a.createElement(l.sA,{id:"API_ERROR_IP_SAME_AS_GATEWAY"})})})}),netmask:i.A.string().when("type",{is:"static",then:o.required(a.createElement(l.sA,{id:"COMMON_VALIDATION_FIELD_REQUIRED"}))}).when("ip",(e,t)=>e?t.test("is-valid-subnet-mask",a.createElement(l.sA,{id:"COMMON_VALIDATION_VALID_IPV4_MASK"}),t=>(0,r.qW)(e,t)):t),gateway:i.A.string().when("type",{is:"static",then:c.A.required(a.createElement(l.sA,{id:"COMMON_VALIDATION_FIELD_REQUIRED"}))}),dns1:i.A.string().when("type",{is:"static",then:c.A.required(a.createElement(l.sA,{id:"COMMON_VALIDATION_FIELD_REQUIRED"}))}),dns2:c.A.when("dns1",{is:e=>!!e,then:c.A}),bonding_enabled:i.A.boolean(),dnssuffix:i.A.string(),mgmt_network_id:i.A.string(),snmp_location:i.A.string(),snmp_contact:i.A.string()})},94456:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(469733),r=n(296540),i=n(758649),l=n(398300),s=n(845030),o=n(951106);const c=(0,r.memo)(({mac:e,name:t,display_name:n})=>{const c=(0,a.useDispatch)(),m=(0,r.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),c((0,s.XP)({type:l.H.CLIENT,id:e}))},[c,e]);return r.createElement(i.A,{type:"button",variant:"inline",size:"inherit",onClick:m},(0,o.tn)({name:t,display_name:n})||e)})},113658:(e,t,n)=>{n.d(t,{v:()=>o});var a=n(296540),r=n(271856),i=n(927099);const l={size:"inherit",color:"inherit"},s={portal:!0,maxWidth:"unset",width:"auto",style:{display:"flex",alignItems:"center"}},o=({text:e,textElement:t,textProps:n,tooltipProps:o,isTooltipDisabled:c=!1})=>{const m=t||a.createElement(i.A,{...l,...n},e);return c?m:a.createElement(r.A,{...s,description:e,...o},m)}},167761:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(296540),r=n(699784),i=n(546391);const l=n(870443).A.string().matches(i.zF,{message:a.createElement(r.sA,{id:"COMMON_VALIDATION_VALID_IPV4"})})},203157:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(296540),r=n(271856),i=n(400270),l=n(566723),s=n(294303),o=n(699784);const c=({enabled:e})=>a.createElement(s.A,{opacity:e?void 0:l.xN},a.createElement(r.A,{description:a.createElement(o.sA,{id:"COMMON_MATCH_OPPOSITE"}),portal:!0},a.createElement(i.A,{size:"original"})))},269889:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(296540),r=n(927099);const i=({enabled:e,color:t,children:n,...i})=>a.createElement(r.A,{color:!1===e?"disabled":t||"inherit",size:"inherit",...i},n)},424135:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(296540),r=n(566723),i=n(294303);const l=({children:e,tooltip:t})=>a.createElement(i.A,{maxWidth:"100%",overflow:"hidden",gap:r.YC,alignItems:"center"},a.createElement(i.A,{flex:1,overflow:"hidden"},e),t)},506538:(e,t,n)=>{n.d(t,{p:()=>r});var a=n(71479);n(132196).AH`
  th {
    span {
      font-size: 14px;
      font-weight: 600;
    }
    svg {
      width: 16px;
      height: 16px;
    }
  }
`;const r=(0,a.A)("div")`
  width: 100%;
  .${"truncate-text-tooltip"} {
    display: flex;
  }
`},524803:(e,t,n)=>{n.d(t,{Po:()=>A,eX:()=>d,rR:()=>m});var a=n(296540),r=n(271856),i=n(699784),l=n(113658),s=n(506538),o=n(269889),c=n(802123);const m=(e,t,n={},l={})=>s=>a.createElement(r.A,{portal:!0,description:e?a.createElement(i.sA,{id:e,values:l}):t,...n},s),d=(e,t,n,r="default",i=!1)=>{const m=a.createElement(l.v,{text:t,textElement:a.createElement(o.A,{enabled:n,truncate:!0},t),tooltipProps:{cursorType:r}});return a.createElement(s.p,null,a.createElement(c.A,{label:m,tooltipItems:e,enabled:n,showMatchOppositeIcon:i}))},A=(e,t,n="default")=>a.createElement(l.v,{text:e,tooltipProps:{cursorType:n,style:{display:"grid"}},textProps:{truncate:!0,color:t?"inherit":"disabled",size:"inherit"}})},530813:(e,t,n)=>{n.d(t,{A:()=>E,d:()=>A});var a=n(296540),r=n(217439),i=n(705145),l=n(71479),s=n(311785),o=n(566723),c=n(699784),m=n(795097),d=n(294303);const A=(0,l.A)(m.A,(0,s.A)("showListMarkers","gap"))`
  padding-left: ${({showListMarkers:e})=>e?o.Ln:0};
  display: flex;
  flex-direction: column;
  gap: ${({gap:e})=>e??o.YC};

  > li {
    list-style-type: ${({showListMarkers:e})=>e?"disc":"none"};
  }
`;const E=function({items:e,getItemKey:t,renderItem:n,maxItemCount:l=20,renderShowMore:s,showListMarkers:m,listGap:E}){return a.createElement(d.A,{flexDirection:"column",gap:o.YC},a.createElement(A,{showListMarkers:m,gap:E},e.slice(0,l).map((e,r)=>a.createElement("li",{key:t(e,r)},a.createElement(i.A,{variant:"inherit",isTruncated:!0},n(e))))),l&&e.length>l?s?s(e):a.createElement(r.A,{variant:"inherit"},a.createElement(c.sA,{id:"COMMON_X_MORE",values:{count:e.length-l}})):null)}},582e3:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(956347),r=n(296540),i=n(758649),l=n(928085),s=n(699784),o=n(959341);const c=(0,r.memo)(()=>{const e=(0,a.W6)(),t=(0,l.A)(o.bB),n=(0,r.useCallback)(()=>e.push(t),[e,t]);return r.createElement(i.A,{type:"button",style:{textTransform:"lowercase"},variant:"inline",size:"inherit",onClick:n},r.createElement(s.sA,{id:"COMMON_HONEYPOT"}))})},785146:(e,t,n)=>{n.d(t,{A:()=>f});var a=n(469733),r=n(296540),i=n(951272),l=n(927099),s=n(277184),o=n(314714),c=n(592510),m=n(566723),d=n(524803),A=n(137625),E=n(143811),p=n(349107),_=n(294303),u=n(955161),O=n(699784),M=n(524936),I=n(233187),h=n(741095),g=n(997344),v=n(915334),C=n(765562);const w=e=>r.createElement(u.A,{key:e.id,condition:!!e.option?.tooltip,wrapper:(0,d.rR)(void 0,e.option?.tooltip,{position:"right",portal:!0})},r.createElement(s.p,{...e})),f=({nativeNetworks:e,activeItemMac:t})=>{const{setFieldValue:n,values:s,dirty:d}=(0,i.j7)(),u=(0,a.useDispatch)(),f=(0,a.useSelector)(g.yT),y=(0,r.useMemo)(()=>e.find(M.nz)?._id,[e]),[N,k]=(0,r.useState)(s.mgmt_network_id&&s.mgmt_network_id!==y),[R,D]=(0,r.useState)(!1);(0,r.useEffect)(()=>{d||k(s.mgmt_network_id&&s.mgmt_network_id!==y)},[s.mgmt_network_id,y,d]);const b=(0,r.useCallback)(e=>{e||n("mgmt_network_id",y),k(e)},[y,n]),x=(0,r.useCallback)(({target:{checked:e}})=>{e?D(!0):b(e)},[b]);(0,r.useEffect)(()=>{u((0,v.U9)(void 0,{crudCacheStrategy:{type:c.e.CACHE}}))},[u]);const T=(0,r.useMemo)(()=>e.filter(e=>e.purpose!==I.rR.GUEST&&!(0,M.uH)(e)).map(e=>{const n=f.some(t=>t.type===h.xC.MAC&&t.mac_acl_network_id===e._id);return{value:e._id,label:e.name,disabled:n||t&&e.gateway_device&&e.gateway_device===t,tooltip:n?r.createElement(O.sA,{id:"DEVICE_NETWORK_OVERRIDE_VALIDATION_MAC_RULE"}):null}}),[e,f,t]);return r.createElement(_.A,{flexDirection:"column",gap:m.kc},r.createElement(_.A,null,r.createElement(A.A,{title:"COMMON_ACTIONS_PROCEED_CONFIRM_TITLE",buttonMessage:"COMMON_ACTION_PROCEED",handleClose:D,handleConfirm:()=>b(!0),isOpen:R,body:r.createElement(l.A,{size:"inherit"},r.createElement(O.sA,{id:"COMMON_IP_NETWORK_OVERRIDE_CONFIRM_MESSAGE",values:{link:r.createElement(p.A,{href:C.A.virtualNetworkCreateGuide,id:"COMMON_LEARN_MORE",noWrap:!0})}}))},r.createElement(o.A,{id:"hasOverride",checked:N,onChange:x},r.createElement(O.sA,{id:"COMMON_NETWORK_OVERRIDE"})))),N?r.createElement(_.A,null,r.createElement(E.A,{label:"COMMON_VIRTUAL_NETWORK",name:"mgmt_network_id",type:"dropdown",variant:"secondary",renderOption:w,full:!0,validated:!0,options:T,translateLabel:!0})):null)}},795097:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(71479),r=n(566723);const i=(0,a.A)("ul")`
  padding-left: ${r.Er};
  margin-bottom: 0;
  margin-top: 0;
`},802123:(e,t,n)=>{n.d(t,{A:()=>A});var a=n(296540),r=n(758649),i=n(566723),l=n(203157),s=n(294303),o=n(699784),c=n(115829),m=n(424135),d=n(819127);const A=({enabled:e,label:t,tooltipItems:n,neverShowListMarkers:A,limit:E=20,seeMoreCallback:p,isInteractive:_,title:u,showMatchOppositeIcon:O,listGap:M})=>a.createElement(s.A,{flex:1,overflow:"hidden",gap:i.YC},O?a.createElement(l.A,{enabled:e}):null,a.createElement(m.A,{tooltip:a.createElement(d.A,{title:u,position:"top",isInteractive:Boolean(p)||_,items:n,showListMarkers:!A,maxItemCount:E,getItemKey:(e,t)=>t,renderItem:e=>e,listGap:M,renderShowMore:p?()=>a.createElement(r.A,{variant:"inline",onClick:p},a.createElement(o.sA,{id:"COMMON_SEE_MORE"})):void 0})},t?a.createElement(c.A,{color:e?"inherit":"disabled"},t):null))},819127:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(296540),r=n(766624),i=n(530813);const l=function({items:e,getItemKey:t,renderItem:n,maxItemCount:l,renderShowMore:s,showListMarkers:o,title:c,position:m,isInteractive:d,cursorType:A,listGap:E}){return a.createElement(r.A,{title:c,position:m,isInteractive:d,cursorType:A,description:a.createElement(i.A,{items:e,getItemKey:t,renderItem:n,maxItemCount:l,listGap:E,renderShowMore:s,showListMarkers:o})})}}}]);