"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[71016],{636432(e,t,n){n.d(t,{iw:()=>A,Zb:()=>u,N0:()=>h,uE:()=>_,Je:()=>I,od:()=>g});var o=n(756275),s=n(995304),i=n(627625),r=n(260334),a=n(403263),d=n(199220);const l=(0,i.S)([d.m9,a.q],{message:(0,r.rn)("SETTINGS_IPV6_ADDRESS_OR_SUBNET_VALIDATION")});var c=n(962946),p=n(139847),m=n(277822);const u={[m.B.PORT_GROUP]:"SETTINGS_DUPLICATE_PORT_VALIDATION",[m.B.ADDRESS_GROUP]:"SETTINGS_DUPLICATE_IP_VALIDATION",[m.B.IPV6_ADDRESS_GROUP]:"SETTINGS_DUPLICATE_IP_VALIDATION"},_={[m.B.PORT_GROUP]:{id:"COMMON_PLACEHOLDER_EG",values:{value:"1-10"}},[m.B.ADDRESS_GROUP]:{id:"SETTINGS_IP_SUBNET_RANGE",values:{version:p.oi.IPV4}},[m.B.IPV6_ADDRESS_GROUP]:{id:"SETTINGS_IP_SUBNET_RANGE",values:{version:p.oi.IPV6}}},A=[m.B.PORT_GROUP,m.B.ADDRESS_GROUP,m.B.IPV6_ADDRESS_GROUP],g={[m.B.PORT_GROUP]:"COMMON_PORT",[m.B.ADDRESS_GROUP]:"SETTINGS_PROFILES_NETWORK_OBJECT_TYPE_ADDRESS_GROUP",[m.B.IPV6_ADDRESS_GROUP]:"SETTINGS_PROFILES_NETWORK_OBJECT_TYPE_IPV6_ADDRESS_GROUP"},h={[m.B.PORT_GROUP]:"COMMON_PORT",[m.B.ADDRESS_GROUP]:"COMMON_ADDRESS",[m.B.IPV6_ADDRESS_GROUP]:"COMMON_ADDRESS"},I={[m.B.PORT_GROUP]:(0,i.S)([o.L,s.i],{message:(0,r.rn)("SETTINGS_COMMON_PORT_LIST_VALIDATION_REQUIRED")}),[m.B.ADDRESS_GROUP]:c.q.refine(e=>!e.endsWith("/32"),{message:(0,r.rn)("SETTINGS_REMOVE_SUBNET_SUFFIX",{subnet:32})}),[m.B.IPV6_ADDRESS_GROUP]:l.refine(e=>!e.endsWith("/128"),{message:(0,r.rn)("SETTINGS_REMOVE_SUBNET_SUFFIX",{subnet:128})})}},277822(e,t,n){var o;n.d(t,{B:()=>o}),function(e){e.PORT_GROUP="port-group",e.ADDRESS_GROUP="address-group",e.IPV6_ADDRESS_GROUP="ipv6-address-group"}(o||(o={}))},847212(e,t,n){n.d(t,{b:()=>s});var o=n(198273);const s=(0,n(247816).A)(o.A)`
  ${({column:e})=>e?"justify-content: center;":"align-items: center;"}
`},547967(e,t,n){n.d(t,{AC:()=>u,D7:()=>_,Ie:()=>O,JL:()=>I,JX:()=>T,KY:()=>A,O2:()=>m,Op:()=>p,Rm:()=>g,e$:()=>E,t7:()=>h,yr:()=>S});var o=n(938984),s=n(814557),i=n(247816),r=n(409844),a=n(291508),d=n(61322),l=n(309130),c=n(100978);const p=(0,i.A)(c.A,(0,a.A)("inline","wrap"))`
  position: relative;
  flex: ${({inline:e})=>e?"1 1 0":"0 0 100%"};
  align-items: flex-start;
  flex-flow: ${({wrap:e})=>"row "+(e?"wrap":"nowrap")};
  gap: ${l.kc};
`,m=(0,i.A)(c.A,(0,a.A)("editMaxHeight","editFieldWrap"))`
  flex-direction: column;
  max-height: ${({editMaxHeight:e})=>`${e||300}px`};
  overflow-y: auto;
  overflow-x: hidden;
  gap: ${l.YC};

  ${({editFieldWrap:e,theme:{themeName:t}})=>e?`\n    gap: 0;\n\n    > * {\n      border-bottom: ${s.Ay[`desktop-border-divider-${t}`]};\n      padding-bottom: ${l.kc};\n      padding-top: ${l.kc};\n    }\n\n    > *:first-child {\n      padding-top: 0;\n    }\n\n    > *:last-child {\n      border-bottom: none;\n      padding-bottom: 0;\n    }\n  `:""}
`,u=(0,i.A)("div",(0,a.A)("isWindowsTable","rows","tableMaxHeight","marginTop"))`
  width: 100%;
  // windows table inherits height from parent container
  height: ${({rows:e,isWindowsTable:t})=>t&&`${d.I.ROW_HEIGHT*e+d.I.HEADER_HEIGHT}`}px;
  max-height: ${({tableMaxHeight:e})=>e?`${e}px`:"auto"};
  margin-top: ${({marginTop:e})=>e||l.Ln};

  table {
    td {
      max-width: 170px;

      span {
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
`,_=(0,i.A)(o.A)`
  margin-right: ${l.YC};
`,A=r.AH`
  :first-of-type {
    padding: 0 ${l.fS} 0 0px;
  }
`,g="drag-and-drop-table-row-placeholder",h=(0,i.A)(c.A)`
  flex-direction: column;

  /* Adjust weird padding on the right side for the ID column when right aligned (drag & drop table) */
  table > thead > tr > th:last-of-type {
    padding-right: ${l.kc};
  }

  /* Add missing border between drag and drop groups (tbody elements) */
  table > tbody {
    border-bottom: ${({theme:{themeName:e}})=>s.Ay[`desktop-border-divider-${e}`]};
  }
  /* Last cell in table is hover content which is not used in this table */
  table > tbody[data-rbd-droppable-context-id] td:not(:last-of-type),
  table > thead > tr > th {
    /* Align drag & drop table cell padding to regular table padding */
    padding-right: ${l.kc} !important;
  }
  /* Align drop zone placeholder row when a row is dragged to matched the CSS overrides for drag and drop table we use */
  table .${g} {
    display: flex;
  }
`,I=r.AH`
  /* This is default for the table rows, so we need it for the header. */
  display: flex;
  width: 100%;

  > th:first-child {
    /* Since we flex the header, we must specify this to align with the table rows. */
    width: 24px;
  }
  > th:not(:first-child) {
    /* Something inside UIC sets the padding to 8px for table header and 5px for table rows. This aligns it to make flex work. */
    padding-right: ${l.kc} !important;
  }
`,E=r.AH`
  /* Override the padding-right of the first column to align with manage + drop modes. */
  > th:first-child {
    padding-right: ${l.kc} !important;
  }
  > th:first-child:has(> label) {
    padding-right: 1px !important;
    width: 36px;
  }
`,S=r.AH`
  /* UIC already does this for some table states, like drag and drop and when in manage mode. If we just use this ALWAYS, we're avoiding many issues related to using different alignment techniques in different places. */
  display: flex;
`,T=r.AH`
  tbody {
    display: flex;
    flex-direction: column;
  }
`;function O(e,t){return r.AH`
    width: ${t.width?`${t.width}px`:"auto"};
    min-width: ${t.minWidth?`${t.minWidth}px`:"0px"};
    flex: ${t.growthFactor||0} !important;
    padding-left: ${l.kc} !important;
    padding-right: ${l.kc} !important;
  `}},256468(e,t,n){var o;n.d(t,{EE:()=>i,Uh:()=>o,Vf:()=>s}),function(e){e.SINGLE="single",e.PLURAL="plural"}(o||(o={}));const s="editActive",i=20},923898(e,t,n){n.d(t,{A:()=>a});var o=n(274934),s=n(843871),i=n(318087),r=n(680163);const a=function({fieldName:e,...t}){const{values:n,setFieldValue:a,errors:d,touched:l,submitCount:c}=(0,s.j7)();return(0,o.jsx)(r.A,{...t,value:(0,s.O6)(n,e),invalid:(0,i.t$)(e,d,l,c),onChange:t=>a(e,t)})}},79568(e,t,n){n.d(t,{A:()=>L});var o=n(274934),s=n(602086),i=n(977872),r=n(843871),a=n(247816),d=n(159469),l=n(826600),c=n(384783),p=n(700444),m=n(470070),u=n(694169),_=n(309100),A=n(897166),g=n(950804),h=n(260334);const I=(e,t)=>n=>{const o=e.safeParse(n);return!!o.success||(0,h.MS)(t,o.error.issues[0]?.message)};var E=n(277822),S=n(636432);const T=e=>g.A.object({name:g.A.string().label("COMMON_NAME").max(64,(0,o.jsx)(m.sA,{id:"SETTINGS_COMMON_FIELD_SHOULD_NOT_EXCEED_MAX_LENGTH",values:{name:(0,o.jsx)(m.sA,{id:"COMMON_NAME"}),limit:64}})).test("isUnique",(0,o.jsx)(m.sA,{id:"COMMON_PLEASE_ENTER_UNIQUE_NAME"}),t=>t&&!e.some(e=>e.name===t)).required(),group_type:g.A.string(),group_members:g.A.array().when("group_type",{is:E.B.PORT_GROUP,then:g.A.array().min(1,(0,o.jsx)(m.sA,{id:"SETTINGS_PROFILES_PORT_IP_GROUPS_FORM_FIELD_GROUP_MEMBERS_PORT_MIN"}))}).when("group_type",{is:E.B.ADDRESS_GROUP,then:g.A.array().min(1,(0,o.jsx)(m.sA,{id:"SETTINGS_PROFILES_PORT_IP_GROUPS_FORM_FIELD_GROUP_MEMBERS_ADDRESS_MIN"}))}).when("group_type",{is:E.B.IPV6_ADDRESS_GROUP,then:g.A.array().min(1,(0,o.jsx)(m.sA,{id:"SETTINGS_PROFILES_PORT_IP_GROUPS_FORM_FIELD_GROUP_MEMBERS_ADDRESS_MIN"}))})}),O=(e,t,n)=>{const o=S.uE[t],s=S.Je[t];return{disabled:e,fieldName:"group_members",labels:{fieldLabel:S.N0[t],modalTitle:"SETTINGS_ADD_MULTIPLE_NETWORK_LIST_VALUES",modalFieldPlaceholder:n({id:o.id},o.values)},extraFieldConfig:{placeholder:o.id,placeholderValues:o.values},fieldValidation:{validate:I(s,{formatMessage:n}),getDuplicationMessage:()=>n({id:S.Zb[t]})}}};var R=n(713804),f=n(198273),x=n(601154),N=n(277660),v=n(787481),b=n(120197),P=n(923898),D=n(847212);const M=({types:e,disabled:t})=>{const{values:n,initialValues:i}=(0,r.j7)(),{formatMessage:a}=(0,m.tz)(),d=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),l=(0,s.useMemo)(()=>e?.length?S.iw.filter(t=>e.includes(t)):S.iw,[e]),c=(0,s.useMemo)(()=>i.group_type===n.group_type&&l.length<=1&&l.includes(n.group_type),[l,i.group_type,n.group_type]);return(0,o.jsxs)(x.A,{padding:"none",children:[(0,o.jsx)(R.A,{children:(0,o.jsx)(f.A,{column:!0,children:(0,o.jsx)(b.A,{full:!0,name:"name",variant:"secondary",label:"COMMON_NAME",fast:!0})})}),c?null:(0,o.jsx)(R.A,{children:(0,o.jsxs)(D.b,{column:!0,style:{flex:1},children:[(0,o.jsx)(N.A,{label:(0,o.jsx)(m.sA,{id:"COMMON_TYPE"}),tooltip:(0,o.jsx)(m.sA,{id:"SETTINGS_PROFILES_NETWORK_LIST_TYPE_DESCRIPTION"})}),(0,o.jsx)(v.A,{children:l.map(e=>(0,o.jsx)(b.A,{name:"group_type",type:"radio",value:e,disabled:n.group_members.length>0,children:(0,o.jsx)(m.sA,{id:S.od[e]})},e))})]})}),(0,o.jsx)(R.A,{children:(0,o.jsx)(f.A,{children:(0,o.jsx)("form",{style:{width:"100%"},onSubmit:d,children:n.group_type?(0,o.jsx)(P.A,{...O(t,n.group_type,a)}):null},n.group_type)})})]})},C=(0,a.A)(c.A)`
  width: 400px !important;
  padding: 0 !important;
`,L=({hideModal:e,handleGroupField:t,types:n,initialValues:a={}})=>{const c=(0,i.wA)(),g=(0,i.d4)(A.EL),h=(0,i.d4)(u.O9),I=(0,s.useMemo)(()=>T(h),[h]),E=(0,s.useCallback)((n,{setSubmitting:o})=>c((0,_.Qe)({...n,group_members:(n.group_members||[]).filter(e=>!!e)})).then(e=>{t?.(e)}).then(e).catch(e=>{c((0,p.ox)({errorMessage:e.msg,errorValues:e,icon:d.C.danger,message:"SETTINGS_PROFILES_NETWORK_OBJECT_FORM_SAVE_FAILURE",values:{name:n.name}})),o(!1)}),[c,e,t]),S=(0,s.useMemo)(()=>({name:"",group_type:n?.[0],group_members:[],...a}),[a,n]);return(0,o.jsx)(r.l1,{onSubmit:E,initialValues:S,validationSchema:I,children:({handleSubmit:t,isSubmitting:s})=>(0,o.jsx)(C,{parentSelector:l.J,isOpen:!0,title:(0,o.jsx)(m.sA,{id:"SETTINGS_NEW_LIST"}),actions:[{text:(0,o.jsx)(m.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",onClick:e},{text:(0,o.jsx)(m.sA,{id:"COMMON_ACTION_CREATE"}),type:"submit",variant:"primary",disabled:g||s,loader:s?"spinner":void 0,onClick:()=>t()}],shouldFocusAfterRender:!0,allowOverflow:!0,children:(0,o.jsx)(M,{types:n,disabled:g})})})}},531984(e,t,n){n.d(t,{w:()=>r});var o=n(602086),s=n(977872),i=n(205521);const r=e=>{const t=(0,s.wA)();(0,o.useEffect)(()=>{t((0,i.SQ)(e))},[t,e])}},762542(e,t,n){n.d(t,{y:()=>s});var o=n(531984);const s=e=>(0,o.w)(e.formState.isDirty)},612389(e,t,n){n.d(t,{A:()=>p});var o=n(274934),s=n(814557),i=n(938984),r=n(247816),a=n(263705),d=n(309130),l=n(100978);const c=(0,r.A)(i.A)`
  line-height: 20px;
`,p=({icon:e,description:t,action:n,footer:i,background:r,...p})=>{const{themeName:m}=(0,a.u)();return(0,o.jsxs)(l.A,{flexGrow:1,borderRadius:d.YC,padding:d.kc,background:r||s.Ay[`desktop-color-neutral-01-${m}`],gap:d.kc,flexDirection:"column",...p,children:[(0,o.jsxs)(l.A,{flexGrow:1,gap:d.kc,children:[e,t?(0,o.jsx)(c,{size:"medium",children:t}):null,n?(0,o.jsx)(l.A,{marginLeft:"auto",children:(0,o.jsx)(c,{size:"medium",children:n})}):null]}),i]})}},753959(e,t,n){n.d(t,{A:()=>d});var o=n(274934),s=n(814557),i=n(853777),r=n(263705),a=n(612389);const d=({children:e,icon:t,background:n,...d})=>{const{themeName:l}=(0,r.u)();return(0,o.jsx)(a.A,{icon:t||(0,o.jsx)(i.A,{variant:"fill",size:"original",color:s.Ay[`desktop-color-ublue-06-${l}`]}),description:e,background:n,...d})}},535322(e,t,n){n.d(t,{A:()=>_,I:()=>o});var o,s=n(274934),i=n(814557),r=n(158885),a=n(247816),d=n(565527),l=n(309130),c=n(100978),p=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(o||(o={}));const m=(0,a.A)(c.A,(0,p.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===d.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${d.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${d.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${l.Ln}`:l.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||l.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>i.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,a.A)(r.A,(0,p.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||i.Ay[n===d.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${d.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${d.S.LIGHT}`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:t}})=>e||i.Ay[t===d.S.DARK?`desktop-color-neutral-01-${d.S.DARK}`:`desktop-color-neutral-00-${d.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${l.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${l.Ln} ${l.Ln};
      }
    }
  }
`,_=({type:e,marginBottom:t,margin:n,padding:i,flex:r,width:a,nested:d,...l})=>"items"in l?(0,s.jsx)(u,{marginBottom:t,margin:n,padding:i,flex:r,nested:d,...l}):(0,s.jsx)(m,{nested:d,width:a,marginBottom:t,margin:n,padding:i,flex:r,isButtonList:e===o.BUTTON_LIST,...l,children:l.children})},796091(e,t,n){n.d(t,{A:()=>a});var o=n(274934),s=n(833466),i=n(309130),r=n(100978);const a=e=>(0,o.jsx)(r.A,{paddingTop:i.YC,paddingBottom:i.YC,gap:i.Ln,rowGap:i.YC,flexWrap:"wrap",minHeight:s.b,alignItems:"center",...e})},199742(e,t,n){n.d(t,{A:()=>l});var o=n(274934),s=n(602086),i=n(558948),r=n(309130),a=n(100978),d=n(535322);const l=({actions:e})=>(0,o.jsx)(d.A,{marginBottom:"none",children:(0,o.jsx)(a.A,{flexDirection:"column",gap:r.kc,width:"100%",children:e.filter(Boolean).map((e,t,n)=>(0,o.jsxs)(s.Fragment,{children:[e,t<n.length-1?(0,o.jsx)(a.A,{width:"100%",flexDirection:"column",paddingTop:r.YC,paddingBottom:r.YC,children:(0,o.jsx)(i.A,{orientation:"horizontal"})}):null]},[t,e.toString()].join()))})})},963428(e,t,n){n.d(t,{A:()=>c});var o=n(274934),s=n(977872),i=n(602086),r=n(954702),a=n(669439),d=n(897166),l=n(100978);const c=(0,i.forwardRef)(({allowReadOnly:e,disabledReason:t,...n},i)=>{const c=(0,s.d4)(d.EL)&&!e;return(0,o.jsx)(l.A,{alignItems:"center",children:(0,o.jsx)(a.A,{description:t,placement:"left",children:(0,o.jsx)(r.A,{fontSize:"medium",type:"button",...n,isDisabled:c||n.isDisabled||!!t,ref:i})})})})},480562(e,t,n){n.d(t,{i:()=>r});var o=n(274934),s=n(125799),i=n(767822);const r=e=>(0,o.jsx)(s.A,{description:e.option&&"tooltipDescription"in e.option?e.option.tooltipDescription:null,position:"left",portal:!0,children:(0,o.jsx)(i.q,{...e})})},384783(e,t,n){n.d(t,{A:()=>r});var o=n(274934),s=n(832162),i=n(826600);const r=({children:e=null,hideModal:t,onRequestClose:n,portalSelector:r=i.J,forwardedRef:a=null,...d})=>(0,o.jsx)(s.A,{isOpen:!0,shouldCloseOnEsc:!0,onRequestClose:n||t,parentSelector:r,ref:a,...d,children:e})},826600(e,t,n){n.d(t,{J:()=>o,g:()=>s});const o=()=>document.getElementById("modal-container"),s=()=>document.getElementById("modal-settings-container")},277660(e,t,n){n.d(t,{A:()=>l});var o=n(274934),s=n(125799),i=n(938984),r=n(831721),a=n(309130),d=n(100978);const l=({label:e,tooltip:t,tooltipProps:n,style:l})=>(0,o.jsxs)(d.A,{alignItems:"center",gap:a.YC,style:l,children:[(0,o.jsx)(i.A,{size:"small",color:"text-3",children:e}),t?(0,o.jsx)(s.A,{description:t,portal:!0,style:{display:"flex",alignItems:"center"},...n,children:(0,o.jsx)(r.A,{size:"original",isActive:!0})}):null]})},92900(e,t,n){n.r(t),n.d(t,{default:()=>i});var o=n(274934),s=n(811115);const i=({activeItem:e})=>(0,o.jsx)(s.A,{activeItem:e},e?._id)},420174(e,t,n){n.d(t,{H5:()=>r,ZS:()=>a});var o=n(274934),s=n(602086);const i=(0,s.createContext)(void 0),r=()=>{const e=(0,s.useContext)(i);return void 0===e?{sharedName:"",setSharedName:()=>{}}:e},a=({children:e})=>{const[t,n]=(0,s.useState)(""),r=(0,s.useMemo)(()=>({sharedName:t,setSharedName:n}),[t]);return(0,o.jsx)(i.Provider,{value:r,children:e})}},61322(e,t,n){n.d(t,{I:()=>o});const o={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,t,n,o){return Math.min((o||this.ROW_HEIGHT)*e+(n??this.HEADER_HEIGHT),(o||this.ROW_HEIGHT)*t+(n??this.HEADER_HEIGHT))},getEditContainerHeight(e,t,n){return Math.min((n||this.EDIT_FIELD_HEIGHT)*e,(n||this.EDIT_FIELD_HEIGHT)*t)}}},846294(e,t,n){n.d(t,{A:()=>l});var o=n(274934),s=n(125799),i=n(409844),r=n(184931),a=n(877840);const d=i.AH`
  width: fit-content;
`,l=({reasons:e,reason:t,children:n,isInteractive:i,noWrap:l,position:c,fitContent:p})=>{const m=(0,r.pv)(),u=[t,...e||[]].filter(Boolean)[0]||null,_=!!u;return(0,o.jsx)(a.A,{isDisabled:{fields:_,labels:_,tooltipIcons:_,tooltipPopovers:!m.fields&&_},children:(0,o.jsx)(s.A,{description:m.fields?null:u,portal:!0,isInteractive:i,noWrap:l,position:c,className:p?d:void 0,children:n})})}},877840(e,t,n){n.d(t,{A:()=>a});var o=n(274934),s=n(602086),i=n(184931),r=n(712642);const a=({isDisabled:e,isAdditive:t=!0,children:n})=>{const a=(0,i.pv)(),d=(0,s.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),l=(0,s.useMemo)(()=>({fields:t?d.fields||a.fields:d.fields,labels:t?d.labels||a.labels:d.labels,tooltipIcons:t?d.tooltipIcons||a.tooltipIcons:d.tooltipIcons,tooltipPopovers:t?d.tooltipPopovers||a.tooltipPopovers:d.tooltipPopovers}),[t,d.fields,d.labels,d.tooltipIcons,d.tooltipPopovers,a.fields,a.labels,a.tooltipIcons,a.tooltipPopovers]);return(0,o.jsx)(r.I.Provider,{value:l,children:n})}},625133(e,t,n){n.d(t,{A:()=>c});var o=n(274934),s=n(42220),i=n(762705),r=n(309130),a=n(304151),d=n(100978),l=n(184931);const c=function({control:e,name:t,children:n,tooltip:c,tooltipProps:p,onToggle:m,renderCheckbox:u,inputClassName:_}){const A=(0,l.mQ)();return(0,o.jsx)(s.xI,{control:e,name:t,render:({field:e})=>{const t=(0,o.jsx)(i.A,{id:e.name,onChange:({target:{checked:t}})=>{e.onChange(t),m?.(t)},checked:!!e.value,disabled:A,inputClassName:_,children:n});return(0,o.jsxs)(d.A,{gap:r.YC,alignItems:"center",children:[u?u(t,e):t,c?(0,o.jsx)(a.A,{description:c,...p}):null]})}})}},689941(e,t,n){n.d(t,{A:()=>m});var o=n(274934),s=n(693371),i=n(42220),r=n(480562),a=n(164487),d=n(597750),l=n(147045),c=n(260334),p=n(184931);const m=function({control:e,name:t,label:n,options:m,tooltip:u,tooltipProps:_,placeholder:A,renderOption:g,onChange:h,onAfterChange:I,searchable:E,searchableProps:S,portal:T,maxHeight:O,disableValidationMessage:R,isReadOnly:f,[l.L]:x}){const N=(0,p.mQ)(),v=(0,c.L_)();return(0,o.jsx)(i.xI,{control:e,name:t,render:({field:e,fieldState:l,formState:c})=>(0,o.jsxs)(d.A,{gap:2,children:[n?(0,o.jsx)(a.A,{htmlFor:t,tooltip:u,tooltipProps:{portal:!0,..._},children:n}):null,(0,o.jsx)(s.A,{variant:"secondary",width:"100%",renderOption:g??r.i,options:m,...e,readOnly:f,disabled:N,onChange:(t,n)=>{const o=h?h(n,{field:e,fieldState:l,formState:c}):e.onChange(n);return I?.(n),o},value:e.value??"",invalid:l.invalid&&!R?v((0,i.Jt)(c.errors,t)?.message)||!0:void 0,placeholder:A,searchable:E,searchableProps:S,portal:T,"data-testid":x,maxHeight:O})]})})}},482609(e,t,n){n.d(t,{A:()=>p});var o=n(274934),s=n(602086),i=n(42220),r=n(956976),a=n(309130),d=n(304151),l=n(100978),c=n(184931);const p=(0,s.forwardRef)(function({control:e,name:t,children:n,tooltip:s,tooltipProps:p,value:m,onCheck:u,..._},A){const g=(0,c.mQ)();return(0,o.jsx)(i.xI,{control:e,name:t,render:({field:e})=>(0,o.jsxs)(l.A,{gap:a.YC,alignItems:"center",ref:A,..._,children:[(0,o.jsx)(r.A,{id:e.name,onChange:({target:{checked:t}})=>{t&&(e.onChange(m),u?.())},checked:e.value===m,disabled:g,value:e.value,children:n}),s?(0,o.jsx)(d.A,{description:s,...p}):null]})})})},635891(e,t,n){n.d(t,{A:()=>c});var o=n(274934),s=n(42220),i=n(843615),r=n(95032),a=n(309130),d=n(260334),l=n(184931);const c=function({control:e,name:t,label:n,placeholder:c,tooltip:p,tooltipProps:m,autoFocus:u,motif:_,onChange:A,onBlur:g,onAfterChange:h,onPaste:I,onKeyDown:E,passwordToggle:S,type:T,helperMessage:O,autoComplete:R,contentBefore:f,contentAfter:x,onFocus:N,value:v,invalid:b}){const P=(0,l.mQ)(),D=(0,l.Im)(),M=(0,l.q)(),C=(0,d.L_)();return(0,o.jsx)(s.xI,{control:e,name:t,render:({field:e,fieldState:d,formState:l})=>(0,o.jsx)(i.A,{type:T||(S?"password":"text"),variant:"secondary",width:"100%",autoFocus:u,...e,onChange:t=>{A?A(t,e,l):e.onChange(t),h?.(t)},onBlur:t=>{g?g(t,e,l):e.onBlur()},onFocus:N,onPaste:I,disabled:P,value:v??e.value?.toString(),invalid:b||(d.invalid?(0,o.jsxs)(r.A,{variant:"inherit",style:{overflowWrap:"break-word"},children:[C((0,s.Jt)(l.errors,t)?.message)||!0," "]}):void 0),label:n,placeholder:c,labelTooltip:p,labelTooltipProps:{style:{opacity:D?a.xN:void 0,pointerEvents:M?"none":void 0,...m?.style},...m},motif:_,passwordToggle:S,helperMessage:O,autoComplete:R,onKeyDown:E,contentBefore:f,contentAfter:x})})}},149450(e,t,n){n.d(t,{B:()=>a,b:()=>r});var o=n(241792),s=n(745454),i=n(260334);const r=o.Yj({message:(0,i.rn)("COMMON_VALIDATION_VALID_IPV4")}).refine(e=>!e||(0,s.isValidIpv4)(e),{message:(0,i.rn)("COMMON_VALIDATION_VALID_IPV4")}),a=o.Yj({message:(0,i.rn)("COMMON_VALIDATION_VALID_IPV4")}).refine(e=>(0,s.isValidIpv4)(e),{message:(0,i.rn)("COMMON_VALIDATION_VALID_IPV4")})},962946(e,t,n){n.d(t,{q:()=>u});var o=n(627625),s=n(260334),i=n(847849),r=n(241792),a=n(745454),d=n(810024),l=n(570866),c=n(635187);const p=r.Yj({message:(0,s.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).refine(e=>{const t=e.split(c.jr),[n,o]=t;return 2===t.length&&n&&o&&l.zF.test(n)&&l.zF.test(o)&&(0,a.isValidIpv4)(n)&&(0,a.isValidIpv4)(o)&&(0,d.GQ)(n)<(0,d.GQ)(o)},{message:(0,s.rn)("COMMON_VALIDATION_IPV4_SUBNET")});var m=n(149450);const u=(0,o.S)([m.B,i.K,p],{message:(0,s.rn)("SETTINGS_ROUTING_NAT_FORM_IP_OR_SUBNET_OR_RANGE_VALIDATION")})},847849(e,t,n){n.d(t,{K:()=>a});var o=n(241792),s=n(810024),i=n(570866),r=n(260334);const a=o.Yj({message:(0,r.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).regex(i.wK,{message:(0,r.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).refine(s.N7,{message:(0,r.rn)("COMMON_VALIDATION_IPV4_SUBNET")})},199220(e,t,n){n.d(t,{Jh:()=>a,XK:()=>r,m9:()=>d});var o=n(241792),s=n(640708),i=n(260334);const r=o.Yj().ip({version:"v6",message:(0,i.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_INVALID")}).refine(e=>!e||!e.includes("%"),{message:(0,i.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_INVALID")}),a=o.KC([o.Yj().ip({version:"v6",message:(0,i.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_INVALID")}),o.eu("")]).optional().refine(e=>!e||!e.includes("%"),{message:(0,i.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_INVALID")}),d=r.refine(e=>!(0,s.m0)(e),{message:(0,i.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID")}).refine(e=>!(0,s.aN)(e),{message:(0,i.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID")})},403263(e,t,n){n.d(t,{q:()=>r});var o=n(241792),s=n(640708),i=n(260334);const r=o.Yj({message:(0,i.rn)("COMMON_VALIDATION_IPV6_SUBNET")}).refine(s.In,{message:(0,i.rn)("COMMON_VALIDATION_IPV6_SUBNET")})},995304(e,t,n){n.d(t,{i:()=>a});var o=n(241792),s=n(635187),i=n(260334),r=n(756275);const a=o.Yj().refine(e=>{const t=e.split(s.jr);return 2===t.length&&(0,r.w)(t[0])&&(0,r.w)(t[1])&&Number(t[0])<Number(t[1])},{message:(0,i.rn)("SETTINGS_COMMON_SINGLE_PORT_RANGE_VALIDATION_REQUIRED")})},756275(e,t,n){n.d(t,{L:()=>a,w:()=>r});var o=n(241792),s=n(260334);const i=/^\d+$/,r=e=>{if(!i.test(e)||e.startsWith("0"))return!1;const t=Number.parseInt(e,10);return!Number.isNaN(t)&&Number.isInteger(t)&&t>=1&&t<=65535},a=o.Yj().refine(e=>r(e),{message:(0,s.rn)("SETTINGS_COMMON_SINGLE_PORT_VALIDATION_REQUIRED")})},627625(e,t,n){n.d(t,{S:()=>s});var o=n(241792);function s(e,{message:t}){return o.Ie(t=>o.KC(e).safeParse(t).success,{message:t})}},509927(e,t,n){n.d(t,{V:()=>r});var o=n(602086),s=n(603606);const i=e=>{const t=(0,o.useRef)(e);return(0,o.useEffect)(()=>{t.current=e},[e]),(0,o.useCallback)((...e)=>t.current(...e),[])};function r(e,t){const n=(0,o.useRef)([]),[,r]=(0,o.useState)(0),[a,d]=(0,o.useState)(null);(0,o.useEffect)(()=>{const e=setInterval(()=>{n.current.length&&t?.estimatedDurationMs&&r(e=>e+1)},1e3);return()=>clearInterval(e)},[t?.estimatedDurationMs]);const l=t?.dedupe??!1,c=i(t?.onSuccess||(()=>{})),p=i(t?.onError||(()=>{})),m=(0,o.useCallback)((...o)=>{if(l&&n.current.length)return Promise.reject();const i=(async()=>e(...o))();return n.current.push({promise:i,startedAt:Date.now()}),r(e=>e+1),i.then(e=>(c?.(e),d(e),e)).catch(async e=>{if(t?.delayOnErrorMs&&await(0,s.u)(t.delayOnErrorMs),d(null),!p)throw e;p(e)}).finally(async()=>{n.current=n.current.filter(e=>e.promise!==i),r(e=>e+1)})},[e,l,p,c,t?.delayOnErrorMs]),u=n.current.at(-1),_=u&&t?.estimatedDurationMs?Math.min((Date.now()-u.startedAt)/t.estimatedDurationMs,.9):void 0;return{execute:m,isLoading:!!n.current.length,lastData:a,estimatedProgress:_}}},871808(e,t,n){n.d(t,{A:()=>r});var o=n(602086),s=n(977872),i=n(167933);const r=e=>(0,s.d4)((0,o.useMemo)(()=>(0,i.jN)(e),[e]))},292027(e,t,n){n.d(t,{A:()=>g});var o=n(274934),s=n(199742),i=n(977872),r=n(159469),a=n(464920),d=n(509927),l=n(963428),c=n(700444),p=n(470070);const m=({onResume:e,disabledReason:t})=>{const n=(0,i.wA)(),s=(0,d.V)(()=>e(),{onError:e=>{const t=(0,a.F)(e)?e:void 0;return n((0,c.ox)({icon:r.C.danger,message:"SETTINGS_POLICY_RESUME_FAILURE",values:{count:1},errorMessage:t?.msg,errorValues:t}))}});return(0,o.jsx)(l.A,{onPress:s.execute,isDisabled:s.isLoading,disabledReason:t,children:(0,o.jsx)(p.sA,{id:"COMMON_ACTION_RESUME"})})};var u=n(404056),_=n(146215);const A=({name:e,onPause:t,disabledReason:n})=>{const s=(0,i.wA)(),m=(0,d.V)(()=>t(),{onError:e=>{const t=(0,a.F)(e)?e:void 0;return s((0,c.ox)({icon:r.C.danger,message:"SETTINGS_POLICY_PAUSE_FAILURE",values:{count:1},errorMessage:t?.msg,errorValues:t}))}});return(0,o.jsx)(_.A,{trigger:(0,o.jsx)(l.A,{isDisabled:m.isLoading,disabledReason:n,children:(0,o.jsx)(p.sA,{id:"COMMON_ACTION_PAUSE"})}),confirmButtonVariant:"emphasis",title:(0,o.jsx)(p.sA,{id:"SETTINGS_SECURITY_PAUSE_POLICY_TITLE",values:{count:1}}),message:(0,o.jsx)(p.sA,{id:"SETTINGS_SECURITY_PAUSE_FIREWALL_POLICY_MESSAGE_SINGLE",values:{name:e}}),onConfirm:()=>m.execute()})},g=({enabled:e,name:t,onPause:n,pauseDisabledReason:i,onResume:r,resumeDisabledReason:a,onRemove:d,removeDisabledReason:l,removeAdditionalMessage:c})=>(0,o.jsx)(s.A,{actions:[e?(0,o.jsx)(A,{name:t,onPause:n,disabledReason:i}):(0,o.jsx)(m,{onResume:r,disabledReason:a}),(0,o.jsx)(u.A,{name:t,onRemove:d,disabledReason:l,additionalMessage:c})]})},404056(e,t,n){n.d(t,{A:()=>_});var o=n(274934),s=n(977872),i=n(159469),r=n(464920),a=n(509927),d=n(963428),l=n(146215),c=n(700444),p=n(470070),m=n(100978),u=n(309130);const _=({onRemove:e,name:t,disabledReason:n,additionalMessage:_})=>{const A=(0,s.wA)(),g=(0,a.V)(()=>e(),{onError:e=>{const t=(0,r.F)(e)?e:void 0;return A((0,c.ox)({icon:i.C.danger,message:"SETTINGS_POLICY_DELETE_FAILURE",values:{count:1},errorMessage:t?.msg,errorValues:t}))}});return(0,o.jsx)(l.A,{trigger:(0,o.jsx)(d.A,{variant:"destructive",disabledReason:n,children:(0,o.jsx)(p.sA,{id:"COMMON_ACTION_REMOVE"})}),title:(0,o.jsx)(p.sA,{id:"SETTINGS_SECURITY_REMOVE_POLICY_TITLE",values:{count:1}}),message:_?(0,o.jsxs)(m.A,{flexDirection:"column",gap:u.kc,children:[(0,o.jsx)(p.sA,{id:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_SINGLE_MESSAGE",values:{name:t}}),_]}):(0,o.jsx)(p.sA,{id:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_SINGLE_MESSAGE",values:{name:t}}),onConfirm:()=>g.execute()})}},603606(e,t,n){n.d(t,{u:()=>o});const o=e=>new Promise(t=>{setTimeout(t,e)})}}]);