"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[90818],{79786:(e,t,o)=>{o.d(t,{m:()=>i});var n=o(349785),r=o(296540),l=o(59116),a=o(870893);function i({schema:e,defaultValues:t,presets:o}){const i=(0,r.useMemo)(()=>o?(0,l.A)(o,e=>e.defaultValues):{},[o]),s=(0,r.useMemo)(()=>({...t,...i}),[i,t]),c=(0,n.mN)({resolver:(0,a.u)(e),shouldFocusError:!0,defaultValues:s,shouldUseNativeValidation:!1,mode:"onTouched"}),d=(0,r.useRef)(s);d.current=s;const p=(0,r.useCallback)((...e)=>{const[t,...o]=e;return c.reset(t?{...t,...i}:d.current,...o)},[i,c]);return{...c,reset:p,formState:{...c.formState,isDirty:!!Object.keys(c.formState.dirtyFields).length,isSubmitting:c.formState.isSubmitting},handleSubmit:(...e)=>c.handleSubmit(e[0],(t,...o)=>{const n=Object.keys(t)[0];if(n)try{const e=document.getElementsByName(n)?.[0];e?.scrollIntoView?.({behavior:"smooth",block:"center"}),e?.focus?.({preventScroll:!0})}catch{}e[1]?.(t,...o)})}}},188738:(e,t,o)=>{o.d(t,{A:()=>m});var n=o(436331),r=o(349785),l=o(296540),a=o(704025),i=o(317672),s=o(349665),c=o(199582),d=o(263963),p=o(284428);const m=function({control:e,name:t,label:o,options:m,tooltip:u,tooltipProps:f,placeholder:v,renderOption:A,onChange:h,onAfterChange:g,searchable:b,portal:I,maxHeight:E,disableValidationMessage:C,[c.L]:y}){const S=(0,p.mQ)(),P=(0,d.L_)();return l.createElement(r.xI,{control:e,name:t,render:({field:e,fieldState:c,formState:d})=>l.createElement(s.A,{gap:2},o?l.createElement(i.A,{htmlFor:t,tooltip:u,tooltipProps:{portal:!0,...f}},o):null,l.createElement(n.A,{variant:"secondary",width:"100%",renderOption:A??a.i,options:m,...e,disabled:S,onChange:(t,o)=>{const n=h?h(o,{field:e,fieldState:c,formState:d}):e.onChange(o);return g?.(o),n},value:e.value??"",invalid:c.invalid&&!C?P((0,r.Jt)(d.errors,t)?.message)||!0:void 0,placeholder:v,searchable:b,portal:I,"data-testid":y,maxHeight:E}))})}},222190:(e,t,o)=>{o.d(t,{A:()=>c});var n=o(349785),r=o(296540),l=o(438628),a=o(566723),i=o(263963),s=o(284428);const c=function({control:e,name:t,label:o,placeholder:c,tooltip:d,tooltipProps:p,contentAfter:m,arrowSize:u,min:f,max:v,step:A,value:h,iconBefore:g,onAfterChange:b,onChange:I}){const E=(0,s.mQ)(),C=(0,i.L_)();return r.createElement(n.xI,{control:e,name:t,render:({field:{ref:e,...i},fieldState:s,formState:y})=>r.createElement(l.A,{type:"number",variant:"secondary",width:"100%",...i,value:h??i.value??"",onChange:e=>{I?I(e,y):i.onChange(e.target.value?.length?+e.target.value:null),b?.(e)},disabled:E,invalid:s.invalid?C((0,n.Jt)(y.errors,t)?.message)||!0:void 0,labelTooltip:d,labelTooltipProps:{style:{opacity:E?a.xN:void 0,...p?.style},...p},label:o,placeholder:c,arrowSize:u,contentAfter:m,iconBefore:g,step:A,min:f,max:v})})}},242366:(e,t,o)=>{o.d(t,{A:()=>a});var n=o(296540),r=o(566723),l=o(294303);const a=(0,n.forwardRef)((e,t)=>n.createElement(l.A,{ref:t,flexDirection:"column",gap:r.kc,width:"100%",...e}))},284428:(e,t,o)=>{o.d(t,{Im:()=>s,iL:()=>c,mQ:()=>a,pv:()=>l,q:()=>i});var n=o(296540),r=o(451449);function l(){return(0,n.useContext)(r.I)}function a(){return l().fields}function i(){return l().tooltipPopovers}function s(){return l().tooltipIcons}function c(){return l().labels}},317672:(e,t,o)=>{o.d(t,{A:()=>c});var n=o(296540),r=o(498577),l=o(284428),a=o(566723),i=o(766624),s=o(294303);const c=({tooltip:e,htmlFor:t,children:o,labelProps:c,wrapperProps:d,tooltipProps:p})=>{const m=(0,l.iL)();return n.createElement(s.A,{alignItems:"center",gap:a.YC,...d},n.createElement(r.A,{htmlFor:t,color:"tertiary",...c,style:{opacity:m?a.xN:void 0,...c?.style}},o),e?n.createElement(i.A,{description:e,...p}):null)}},329109:(e,t,o)=>{o.d(t,{A:()=>d});var n=o(296540),r=o(691441),l=o(71479),a=o(132196),i=o(373229);const s=(0,l.A)("div")`
  height: 66px;
`,c=a.AH`
  padding: 0px !important;
`,d=({isDirty:e,onFormSubmit:t,onFormCancel:o,isInvalid:l,...a})=>e?n.createElement(r.A,null,n.createElement(i.A,{isDirty:e,onFormCancel:o,onFormSubmit:t,isInvalid:l,className:c,...a})):n.createElement(s,null)},349665:(e,t,o)=>{o.d(t,{A:()=>a});var n=o(296540),r=o(705228),l=o(294303);const a=({maxWidth:e,...t})=>n.createElement(l.A,{flexDirection:"column",width:"100%",maxWidth:"settingsGridContent"===e?r.ng:e,...t})},353731:(e,t,o)=>{o.r(t),o.d(t,{default:()=>l});var n=o(296540),r=o(963384);const l=({activeItem:e})=>n.createElement(r.A,{activeItem:e,key:e?._id})},373229:(e,t,o)=>{o.d(t,{A:()=>c});var n=o(296540),r=o(758649),l=o(71479),a=o(566723),i=o(699784);const s=(0,l.A)("footer",{shouldForwardProp:e=>"hasFormResetButton"!==e})`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${a.S2} ${a.fS};
  gap: ${a.kc};
`,c=({allowCancel:e,isDirty:t,isInvalid:o,isSubmitting:l,onFormSubmit:a,onFormReset:c,onFormCancel:d,className:p,submitButtonText:m,customButton:u,applyButton:f,applyButtonFirst:v,hideCancelButton:A,form:h})=>{const g=(0,n.useMemo)(()=>f||n.createElement(r.A,{name:"submit",variant:"primary",type:"submit",onClick:a,disabled:!t||o||l,form:h},n.createElement(i.sA,{id:m||"COMMON_ACTION_APPLY_CHANGES"})),[f,h,t,o,l,a,m]);return n.createElement(s,{className:p,hasFormResetButton:!!c},v?g:u,A?null:n.createElement(r.A,{name:"cancel",variant:"default",type:"button",onClick:d,disabled:!e&&!t},n.createElement(i.sA,{id:"COMMON_ACTION_CANCEL"})),c?n.createElement(r.A,{name:"reset",variant:"default",type:"button",onClick:c,disabled:!t},n.createElement(i.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULTS"})):null,v?u:g)}},451449:(e,t,o)=>{o.d(t,{I:()=>n});const n=(0,o(296540).createContext)({fields:!1,labels:!1,tooltipPopovers:!1,tooltipIcons:!1})},454195:(e,t,o)=>{o.d(t,{b:()=>n});const n=32},470591:(e,t,o)=>{o.d(t,{A:()=>n});const n=(0,o(296540).createContext)({isStandalone:!0,header:[null,()=>{}],footer:[null,()=>{}]})},504779:(e,t,o)=>{o.d(t,{A:()=>i});var n=o(296540),r=o(271856),l=o(284428),a=o(641777);const i=({reasons:e,reason:t,children:o,isInteractive:i,noWrap:s})=>{const c=(0,l.pv)(),d=[t,...e||[]].filter(Boolean)[0]||null,p=!!d;return n.createElement(a.A,{isDisabled:{fields:p,labels:p,tooltipIcons:p,tooltipPopovers:!c.fields&&p}},n.createElement(r.A,{description:c.fields?null:d,portal:!0,isInteractive:i,noWrap:s},o))}},552315:(e,t,o)=>{o.d(t,{Z:()=>i});var n=o(407814),r=o(620637),l=o(383653),a=o(263963);const i=n.Yj({message:(0,a.rn)("SETTINGS_IP_INVALID")}).refine(e=>(0,r.isValidIpv6)(e)||(0,r.isValidIpv4)(e),{message:(0,a.rn)("SETTINGS_IP_INVALID")}).refine(e=>!(0,l.m0)(e),{message:(0,a.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID")}).refine(e=>!(0,l.aN)(e),{message:(0,a.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID")})},553432:(e,t,o)=>{o.d(t,{A:()=>i});var n=o(296540),r=o(454195),l=o(566723),a=o(294303);const i=e=>n.createElement(a.A,{paddingTop:l.YC,paddingBottom:l.YC,gap:l.Ln,rowGap:l.YC,flexWrap:"wrap",minHeight:r.b,alignItems:"center",...e})},610356:(e,t,o)=>{o.d(t,{A:()=>d});var n=o(349785),r=o(296540),l=o(54227),a=o(566723),i=o(766624),s=o(294303),c=o(284428);const d=(0,r.forwardRef)(function({control:e,name:t,children:o,tooltip:d,tooltipProps:p,value:m,onCheck:u,...f},v){const A=(0,c.mQ)();return r.createElement(n.xI,{control:e,name:t,render:({field:e})=>r.createElement(s.A,{gap:a.YC,alignItems:"center",ref:v,...f},r.createElement(l.A,{id:e.name,onChange:({target:{checked:t}})=>{t&&(e.onChange(m),u?.())},checked:e.value===m,disabled:A,value:e.value},o),d?r.createElement(i.A,{description:d,...p}):null)})})},641777:(e,t,o)=>{o.d(t,{A:()=>a});var n=o(296540),r=o(284428),l=o(451449);const a=({isDisabled:e,isAdditive:t=!0,children:o})=>{const a=(0,r.pv)(),i=(0,n.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),s=(0,n.useMemo)(()=>({fields:t?i.fields||a.fields:i.fields,labels:t?i.labels||a.labels:i.labels,tooltipIcons:t?i.tooltipIcons||a.tooltipIcons:i.tooltipIcons,tooltipPopovers:t?i.tooltipPopovers||a.tooltipPopovers:i.tooltipPopovers}),[t,i.fields,i.labels,i.tooltipIcons,i.tooltipPopovers,a.fields,a.labels,a.tooltipIcons,a.tooltipPopovers]);return n.createElement(l.I.Provider,{value:s},o)}},691441:(e,t,o)=>{o.d(t,{A:()=>l});var n=o(296540),r=o(470591);function l(e){const{children:t}=e,{isStandalone:o,footer:[,l]}=(0,n.useContext)(r.A);return(0,n.useLayoutEffect)(()=>{if(!o)return l(t),()=>l(null)},[o,t]),n.createElement(n.Fragment,null,o&&t)}},704025:(e,t,o)=>{o.d(t,{i:()=>a});var n=o(296540),r=o(271856),l=o(805837);const a=e=>n.createElement(r.A,{description:e.option&&"tooltipDescription"in e.option?e.option.tooltipDescription:null,position:"left",portal:!0},n.createElement(l.q,{...e}))},705228:(e,t,o)=>{o.d(t,{KA:()=>i,VT:()=>a,i9:()=>r,ng:()=>s,nt:()=>l});var n=o(888170);const r=o(132196).AH`
  font-size: ${n.Ay["font-size-m"]};
  font-weight: normal;
  border-radius: 0;
`,l=112,a=20,i=256,s=345},766624:(e,t,o)=>{o.d(t,{A:()=>s});var n=o(296540),r=o(271856),l=o(709690),a=o(284428),i=o(566723);const s=({description:e,isInteractive:t,portal:o=!0,cursorType:s,title:c,position:d,width:p,iconProps:m,disabled:u=!1})=>{const f=(0,a.Im)()||u,v=(0,a.q)();return n.createElement(r.A,{description:e,portal:o,isInteractive:t,style:{display:"flex",alignItems:"center"},cursorType:s,title:c,position:d,width:p,disableHover:v},n.createElement(l.A,{isActive:!0,size:"original",opacity:f?i.xN:void 0,...m}))}},853801:(e,t,o)=>{o.d(t,{y:()=>l});var n=o(349785),r=o(465543);const l=e=>{const t=(0,n.lN)(e);return(0,r.w)(t.isDirty)}},895424:(e,t,o)=>{o.d(t,{A:()=>d});var n=o(349785),r=o(296540),l=o(438628),a=o(705145),i=o(566723),s=o(263963),c=o(284428);const d=function({control:e,name:t,label:o,placeholder:d,tooltip:p,tooltipProps:m,autoFocus:u,motif:f,onChange:v,onBlur:A,onAfterChange:h,onPaste:g,onKeyDown:b,passwordToggle:I,type:E,helperMessage:C,autoComplete:y,contentBefore:S,contentAfter:P,onFocus:N,value:w,invalid:T}){const _=(0,c.mQ)(),x=(0,c.Im)(),D=(0,c.q)(),F=(0,s.L_)();return r.createElement(n.xI,{control:e,name:t,render:({field:e,fieldState:s,formState:c})=>r.createElement(l.A,{type:E||(I?"password":"text"),variant:"secondary",width:"100%",autoFocus:u,...e,onChange:t=>{v?v(t,e,c):e.onChange(t),h?.(t)},onBlur:t=>{A?A(t,e,c):e.onBlur()},onFocus:N,onPaste:g,disabled:_,value:w??e.value?.toString(),invalid:T||(s.invalid?r.createElement(a.A,{variant:"inherit",style:{overflowWrap:"break-word"}},F((0,n.Jt)(c.errors,t)?.message)||!0," "):void 0),label:o,placeholder:d,labelTooltip:p,labelTooltipProps:{style:{opacity:x?i.xN:void 0,pointerEvents:D?"none":void 0,...m?.style},...m},motif:f,passwordToggle:I,helperMessage:C,autoComplete:y,onKeyDown:b,contentBefore:S,contentAfter:P})})}}}]);