"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[88257],{94456(e,t,n){n.d(t,{A:()=>d});var a=n(296540),r=n(469733),i=n(758649),l=n(398300),s=n(845030),o=n(951106),c=n(968906);const d=(0,a.memo)(({mac:e,name:t,display_name:n})=>{const d=(0,r.useDispatch)(),m=(0,a.useCallback)(t=>{t.preventDefault(),t.stopPropagation(),d((0,s.XP)({type:l.H.CLIENT,id:e}))},[d,e]);return a.createElement(i.A,{type:"button",variant:"inline",size:"inherit",onClick:m,...c.A.addDataTestId(c.A.TestId.SIDE_PANEL_TRIGGER)},(0,o.tn)({name:t,display_name:n})||e)})},582e3(e,t,n){n.d(t,{A:()=>c});var a=n(296540),r=n(956347),i=n(758649),l=n(928085),s=n(916537),o=n(959341);const c=(0,a.memo)(()=>{const e=(0,r.W6)(),t=(0,l.A)(o.bB),n=(0,a.useCallback)(()=>e.push(t),[e,t]);return a.createElement(i.A,{type:"button",style:{textTransform:"lowercase"},variant:"inline",size:"inherit",onClick:n},a.createElement(s.sA,{id:"COMMON_HONEYPOT"}))})},113658(e,t,n){n.d(t,{v:()=>o});var a=n(296540),r=n(271856),i=n(217439);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 d=t||a.createElement(i.A,{...l,...n},e);return c?d:a.createElement(r.A,{...s,description:e,...o},d)}},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(916537),c=n(115829),d=n(424135),m=n(819127);const A=({enabled:e,label:t,tooltipItems:n,neverShowListMarkers:A,limit:E=20,seeMoreCallback:p,isInteractive:_,title:u,showMatchOppositeIcon:O,listGap:I,iconProps:M})=>a.createElement(s.A,{flex:1,overflow:"hidden",gap:i.YC},O?a.createElement(l.A,{enabled:e}):null,a.createElement(d.A,{tooltip:a.createElement(m.A,{title:u,position:"top",isInteractive:Boolean(p)||_,items:n,showListMarkers:!A,maxItemCount:E,getItemKey:(e,t)=>t,renderItem:e=>e,listGap:I,renderShowMore:p?()=>a.createElement(r.A,{variant:"inline",onClick:p},a.createElement(o.sA,{id:"COMMON_SEE_MORE"})):void 0,iconProps:M})},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:d,isInteractive:m,cursorType:A,listGap:E,iconProps:p}){return a.createElement(r.A,{title:c,position:d,isInteractive:m,cursorType:A,description:a.createElement(i.A,{items:e,getItemKey:t,renderItem:n,maxItemCount:l,listGap:E,renderShowMore:s,showListMarkers:o}),iconProps:p})}},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(916537);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"})))},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"},e?a.createElement(i.A,{flex:1,overflow:"hidden"},e):null,t)},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(916537),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),d=n(582e3),m=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(d.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(m.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()})},785146(e,t,n){n.d(t,{A:()=>N});var a=n(469733),r=n(296540),i=n(951272),l=n(217439),s=n(277184),o=n(314714),c=n(592510),d=n(566723),m=n(524803),A=n(137625),E=n(143811),p=n(349107),_=n(294303),u=n(955161),O=n(916537),I=n(959207),M=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,m.rR)(void 0,e.option?.tooltip,{position:"right",portal:!0})},r.createElement(s.p,{...e})),N=({nativeNetworks:e,activeItemMac:t})=>{const{setFieldValue:n,values:s,dirty:m}=(0,i.j7)(),u=(0,a.useDispatch)(),N=(0,a.useSelector)(g.yT),f=(0,r.useMemo)(()=>e.find(I.nz)?._id,[e]),[y,R]=(0,r.useState)(s.mgmt_network_id&&s.mgmt_network_id!==f),[k,D]=(0,r.useState)(!1);(0,r.useEffect)(()=>{m||R(s.mgmt_network_id&&s.mgmt_network_id!==f)},[s.mgmt_network_id,f,m]);const T=(0,r.useCallback)(e=>{e||n("mgmt_network_id",f),R(e)},[f,n]),b=(0,r.useCallback)(({target:{checked:e}})=>{e?D(!0):T(e)},[T]);(0,r.useEffect)(()=>{u((0,v.U9)(void 0,{crudCacheStrategy:{type:c.e.CACHE}}))},[u]);const x=(0,r.useMemo)(()=>e.filter(e=>e.purpose!==M.rR.GUEST&&!(0,I.uH)(e)).map(e=>{const n=N.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,N,t]);return r.createElement(_.A,{flexDirection:"column",gap:d.kc},r.createElement(_.A,null,r.createElement(A.A,{title:"COMMON_ACTIONS_PROCEED_CONFIRM_TITLE",buttonMessage:"COMMON_ACTION_PROCEED",handleClose:D,handleConfirm:()=>T(!0),isOpen:k,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:y,onChange:b},r.createElement(O.sA,{id:"COMMON_NETWORK_OVERRIDE"})))),y?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:x,translateLabel:!0})):null)}},269889(e,t,n){n.d(t,{A:()=>i});var a=n(296540),r=n(217439);const i=({enabled:e,color:t,children:n,...i})=>a.createElement(r.A,{color:!1===e?"disabled":t||"inherit",size:"inherit",...i},n)},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:()=>m,rR:()=>d});var a=n(296540),r=n(271856),i=n(916537),l=n(113658),s=n(506538),o=n(269889),c=n(802123);const d=(e,t,n={},l={})=>s=>a.createElement(r.A,{portal:!0,description:e?a.createElement(i.sA,{id:e,values:l}):t,...n},s),m=(e,t,n,r="default",i=!1)=>{const d=a.createElement(l.v,{text:t,textElement:a.createElement(o.A,{enabled:n,isTruncated:!0},t),tooltipProps:{cursorType:r}});return a.createElement(s.p,null,a.createElement(c.A,{label:d,tooltipItems:e,enabled:n,showMatchOppositeIcon:i}))},A=(e,t,n="default")=>a.createElement(l.v,{text:e,tooltipProps:{cursorType:n,style:{display:"grid"}},textProps:{isTruncated:!0,color:t?"inherit":"disabled",size:"inherit"}})},167761(e,t,n){n.d(t,{A:()=>l});var a=n(296540),r=n(916537),i=n(546391);const l=n(870443).A.string().matches(i.zF,{message:a.createElement(r.sA,{id:"COMMON_VALIDATION_VALID_IPV4"})})}}]);