"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[89965,99285],{41488:(e,t,a)=>{a.d(t,{iw:()=>S,Zb:()=>d,N0:()=>c,uE:()=>O,Je:()=>m,od:()=>I});var i=a(387521),n=a(961386),r=a(263963),s=a(282214),o=a(303303);const E=(0,n.S)([o.m9,s.q],{message:(0,r.rn)("SETTINGS_IPV6_ADDRESS_OR_SUBNET_VALIDATION")});var _=a(242299),l=a(16914),T=a(867955);const d={[T.B.PORT_GROUP]:"SETTINGS_DUPLICATE_PORT_VALIDATION",[T.B.ADDRESS_GROUP]:"SETTINGS_DUPLICATE_IP_VALIDATION",[T.B.IPV6_ADDRESS_GROUP]:"SETTINGS_DUPLICATE_IP_VALIDATION"},O={[T.B.PORT_GROUP]:{id:"COMMON_PLACEHOLDER_EG",values:{value:"1-10"}},[T.B.ADDRESS_GROUP]:{id:"SETTINGS_IP_SUBNET_RANGE",values:{version:l.oi.IPV4}},[T.B.IPV6_ADDRESS_GROUP]:{id:"SETTINGS_IP_SUBNET_RANGE",values:{version:l.oi.IPV6}}},S=[T.B.PORT_GROUP,T.B.ADDRESS_GROUP,T.B.IPV6_ADDRESS_GROUP],I={[T.B.PORT_GROUP]:"COMMON_PORT",[T.B.ADDRESS_GROUP]:"SETTINGS_PROFILES_NETWORK_OBJECT_TYPE_ADDRESS_GROUP",[T.B.IPV6_ADDRESS_GROUP]:"SETTINGS_PROFILES_NETWORK_OBJECT_TYPE_IPV6_ADDRESS_GROUP"},c={[T.B.PORT_GROUP]:"COMMON_PORT",[T.B.ADDRESS_GROUP]:"COMMON_ADDRESS",[T.B.IPV6_ADDRESS_GROUP]:"COMMON_ADDRESS"},m={[T.B.PORT_GROUP]:i.C,[T.B.ADDRESS_GROUP]:_.q,[T.B.IPV6_ADDRESS_GROUP]:E}},48925:(e,t,a)=>{a.d(t,{A:()=>c});var i=a(296540),n=a(217439),r=a(71479),s=a(454195),o=a(566723),E=a(968906),_=a(199582),l=a(311785),T=a(766624),d=a(294303),O=a(689965),S=a(242366);const I=(0,r.A)(O.A,(0,l.A)("isOutlined"))`
  border: ${({theme:e,isOutlined:t})=>`1px solid ${t?e.motifPalette.uBlue06:"transparent"}`};
`,c=({children:e,title:t,tooltip:a,tooltipProps:r,[_.L]:l,titleAction:O,isOutlined:c})=>i.createElement(I,{marginBottom:"none",...E.A.addDataTestId(l),isOutlined:c},i.createElement(d.A,{flexDirection:"column",gap:o.Ln,width:"100%",minHeight:s.b},t?i.createElement(d.A,{alignItems:"center",gap:o.YC,justifyContent:"space-between",width:"100%"},i.createElement(d.A,{gap:o.YC,alignItems:"center"},i.createElement(n.A,{variant:"heading-medium"},t),a?i.createElement(T.A,{description:a,portal:!0,...r}):null),O?i.createElement(d.A,null,O):null):null,e?i.createElement(S.A,null,e):null))},79786:(e,t,a)=>{a.d(t,{m:()=>o});var i=a(349785),n=a(296540),r=a(59116),s=a(870893);function o({schema:e,defaultValues:t,presets:a}){const o=(0,n.useMemo)(()=>a?(0,r.A)(a,e=>e.defaultValues):{},[a]),E=(0,n.useMemo)(()=>({...t,...o}),[o,t]),_=(0,i.mN)({resolver:(0,s.u)(e),shouldFocusError:!0,defaultValues:E,shouldUseNativeValidation:!1,mode:"onTouched"}),l=(0,n.useRef)(E);l.current=E;const T=(0,n.useCallback)((...e)=>{const[t,...a]=e;return _.reset(t?{...t,...o}:l.current,...a)},[o,_]);return{..._,reset:T,formState:{..._.formState,isDirty:!!Object.keys(_.formState.dirtyFields).length,isSubmitting:_.formState.isSubmitting},handleSubmit:(...e)=>_.handleSubmit(e[0],(t,...a)=>{const i=Object.keys(t)[0];if(i)try{const e=document.getElementsByName(i)?.[0];e?.scrollIntoView?.({behavior:"smooth",block:"center"}),e?.focus?.({preventScroll:!0})}catch{}e[1]?.(t,...a)})}}},143985:(e,t,a)=>{a.d(t,{B:()=>s});var i=a(407814),n=a(620637),r=a(263963);const s=i.Yj({message:(0,r.rn)("COMMON_VALIDATION_VALID_IPV4")}).refine(e=>(0,n.isValidIpv4)(e),{message:(0,r.rn)("COMMON_VALIDATION_VALID_IPV4")})},169568:(e,t,a)=>{var i;a.d(t,{v:()=>i}),function(e){e.SETTINGS_WIFI="settingsWifi",e.SETTINGS_NETWORKS="settingsNetworks",e.SETTINGS_INTERNET="settingsInternet",e.SETTINGS_TELEPORT="settingsTeleport",e.SETTINGS_VPN="settingsVpn",e.SETTINGS_UID_VPN="settingsUidVpn",e.SETTING_ROUTING="settingsRouting",e.SETTINGS_SECURITY="settingsSecurity",e.SETTINGS_ETHERNET_PORTS="settingsEthernetPorts",e.SETTINGS_WIFI_SPEED_LIMIT_PROFILES="settingsWifiSpeedLimitProfiles",e.SETTINGS_RADIUS="settingsRadius",e.NETWORK_OBJECTS="settingsNetworkObjects",e.SETTINGS_PROFILES="settingsProfiles",e.SETTINGS_VPN_CLIENT="vpnClient",e.SETTINGS_CONTENT_FILTER="settingsContentFilter",e.SETTINGS_POLICY="settingsPolicy",e.SETTINGS_POLICY_ACL="settingsPolicyAcl",e.SETTINGS_POLICY_QOS="settingsPolicyQos",e.SETTINGS_POLICY_NAT="settingsPolicyNat",e.SETTINGS_POLICY_DNS="settingsPolicyDns",e.SETTINGS_POLICY_PORT_FORWARDING="settingsPolicyPortForwarding",e.SETTINGS_POLICY_FIREWALL="settingsPolicyFirewall",e.SETTINGS_POLICY_ROUTE="settingsPolicyRoute"}(i||(i={}))},199582:(e,t,a)=>{a.d(t,{L:()=>i});const i="data-testid"},210484:(e,t,a)=>{a.d(t,{A:()=>r});var i=a(71479),n=a(566723);const r=(0,i.A)("div")`
  div {
    flex-wrap: wrap;
  }

  svg {
    max-width: 20px;
    flex: 1;
  }
  span {
    flex: 1;
  }

  span + div:last-child {
    flex-basis: 100%;
    margin-left: ${n.ED};
  }
`},242299:(e,t,a)=>{a.d(t,{q:()=>O});var i=a(961386),n=a(263963),r=a(950700),s=a(407814),o=a(620637),E=a(149133),_=a(546391),l=a(348466);const T=s.Yj({message:(0,n.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).refine(e=>{const t=e.split(l.jr),[a,i]=t;return 2===t.length&&a&&i&&_.zF.test(a)&&_.zF.test(i)&&(0,o.isValidIpv4)(a)&&(0,o.isValidIpv4)(i)&&(0,E.GQ)(a)<(0,E.GQ)(i)},{message:(0,n.rn)("COMMON_VALIDATION_IPV4_SUBNET")});var d=a(143985);const O=(0,i.S)([d.B,r.K,T],{message:(0,n.rn)("SETTINGS_ROUTING_NAT_FORM_IP_OR_SUBNET_OR_RANGE_VALIDATION")})},248543:(e,t,a)=>{a.d(t,{J:()=>i,g:()=>n});const i=()=>document.getElementById("modal-container"),n=()=>document.getElementById("modal-settings-container")},263130:(e,t,a)=>{a.d(t,{A:()=>l});var i=a(296540),n=a(927099),r=a(71479),s=a(998837),o=a(566723),E=a(294303);const _=(0,r.A)(n.A)`
  line-height: 20px;
`,l=({icon:e,description:t,action:a,footer:n,background:r,...l})=>{const T=(0,s.u)().motifPalette.neutral01;return i.createElement(E.A,{flexGrow:1,borderRadius:o.YC,padding:o.kc,background:r||T,gap:o.kc,flexDirection:"column",...l},i.createElement(E.A,{flexGrow:1,gap:o.kc},e,t?i.createElement(_,{size:"body"},t):null,a?i.createElement(E.A,{marginLeft:"auto"},i.createElement(_,{size:"body"},a)):null),n)}},263963:(e,t,a)=>{a.d(t,{L_:()=>l,MS:()=>_,rn:()=>E});var i=a(117958),n=a(215616),r=a(296540),s=a(699784);const o="{::}",E=(e,t)=>`${e}${o}${JSON.stringify(t??{})}`,_=(e,t)=>{if("string"!=typeof t)return;const[a,...i]=t.split(o);if(!a||!i.length)return t;let n={};try{n=Object.fromEntries(Object.entries(JSON.parse(i.join(o))).map(([t,a])=>[t,"string"==typeof a?_(e,a):a]))}catch{0}return e.formatMessage({id:a},n)};function l(){const{formatMessage:e}=(0,s.tz)();return(0,r.useCallback)(t=>_({formatMessage:e},t),[e])}i.pJ((e,t)=>e.message?{message:e.message}:e.code===n.eq.too_small&&"string"===e.type?{message:E("COMMON_MIN_CHARS",{min:Number(e.minimum)})}:e.code===n.eq.too_big&&"string"===e.type?{message:E("COMMON_MAX_CHARS",{name:E("COMMON_VALUE"),max:Number(e.maximum)})}:e.code===n.eq.invalid_type&&"array"===e.expected&&"undefined"===e.received?{message:E("COMMON_SELECT_AT_LEAST_ONE_ITEM")}:e.code===n.eq.too_small&&"array"===e.type?{message:E("COMMON_ADD_AT_LEAST_X_ITEMS",{min:Number(e.minimum)})}:e.code===n.eq.invalid_type&&"undefined"===e.received?{message:E("COMMON_VALIDATION_VALUE_REQUIRED")}:e.code===n.eq.invalid_type&&"number"===e.expected?{message:E("COMMON_VALIDATION_PLEASE_ENTER_A_NUMBER")}:{message:t.defaultError})},267691:(e,t,a)=>{a.d(t,{u:()=>o});var i=a(469733),n=a(296540),r=a(528644),s=a(674319);function o(e){const t=(0,i.useSelector)(r.C);return(0,n.useMemo)(()=>(0,s.TM)(e,t),[e,t])}},282214:(e,t,a)=>{a.d(t,{q:()=>s});var i=a(407814),n=a(383653),r=a(263963);const s=i.Yj({message:(0,r.rn)("COMMON_VALIDATION_IPV6_SUBNET")}).refine(n.In,{message:(0,r.rn)("COMMON_VALIDATION_IPV6_SUBNET")})},303303:(e,t,a)=>{a.d(t,{XK:()=>s,m9:()=>o});var i=a(407814),n=a(383653),r=a(263963);const s=i.Yj().ip({version:"v6",message:(0,r.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_INVALID")}).refine(e=>!(e&&e.includes("%")),{message:(0,r.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_INVALID")}),o=s.refine(e=>!(0,n.m0)(e),{message:(0,r.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID")}).refine(e=>!(0,n.aN)(e),{message:(0,r.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID")})},333422:(e,t,a)=>{a.d(t,{AC:()=>O,D7:()=>S,Ie:()=>u,JL:()=>N,JX:()=>p,KY:()=>I,O2:()=>d,Op:()=>T,Rm:()=>c,e$:()=>A,t7:()=>m,yr:()=>R});var i=a(927099),n=a(822336),r=a(71479),s=a(132196),o=a(311785),E=a(596441),_=a(566723),l=a(294303);const T=(0,r.A)(l.A,(0,o.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: ${_.kc};
`,d=(0,r.A)(l.A,{shouldForwardProp:e=>"editMaxHeight"!==e})`
  flex-direction: column;
  max-height: ${({editMaxHeight:e})=>`${e||300}px`};
  overflow-y: auto;
  overflow-x: hidden;
  gap: ${_.YC};
`,O=(0,r.A)("div",{shouldForwardProp:e=>!["isWindowsTable","rows","tableMaxHeight","marginTop"].includes(e)})`
  width: 100%;
  // windows table inherits height from parent container
  height: ${({rows:e,isWindowsTable:t})=>t&&`${E.I.ROW_HEIGHT*e+E.I.HEADER_HEIGHT}`}px;
  max-height: ${({tableMaxHeight:e})=>`${e}px`||"auto"};
  margin-top: ${({marginTop:e})=>e||_.Ln};

  table {
    td {
      max-width: 170px;

      span {
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
`,S=(0,r.A)(i.A)`
  margin-right: ${_.YC};
`,I=s.AH`
  :first-of-type {
    padding: 0 ${_.fS} 0 0px;
  }
`,c="drag-and-drop-table-row-placeholder",m=(0,r.A)(l.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: ${_.kc};
  }

  /* Add missing border between drag and drop groups (tbody elements) */
  table > tbody {
    border-bottom: ${({theme:{themeName:e}})=>n.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: ${_.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 .${c} {
    display: flex;
  }
`,N=s.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: ${_.kc} !important;
  }
`,A=s.AH`
  /* Override the padding-right of the first column to align with manage + drop modes. */
  > th:first-child {
    padding-right: ${_.kc} !important;
  }
  > th:first-child:has(> label) {
    padding-right: 1px !important;
    width: 36px;
  }
`,R=s.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;
`,p=s.AH`
  tbody {
    display: flex;
    flex-direction: column;
  }
`;function u(e,t){return s.AH`
    width: ${t.width?`${t.width}px`:"auto"};
    min-width: ${t.minWidth?`${t.minWidth}px`:"0px"};
    flex: ${t.growthFactor||0} !important;
    padding-left: ${_.kc} !important;
    padding-right: ${_.kc} !important;
  `}},383725:(e,t,a)=>{var i;a.d(t,{b:()=>i}),function(e){e.DASHBOARD_WAN_GRAPH="dashboard-wan-graph",e.DASHBOARD_WIFI_GRAPH="dashboard-wifi-graph",e.DASHBOARD_FLOWS_GRAPH="dashboard-flows-graph",e.DASHBOARD_PANEL_LIVE_ACTIVITY="dashboard-panel-live-activity",e.DASHBOARD_PANEL_SPEED_TEST_ACTIVITY="dashboard-panel-speed-test-activity",e.INTERNET_HEALTH="internet-health",e.ISP_UPTIME="isp-uptime",e.SYSTEM_UPTIME="system-uptime",e.NETWORK_DASHBOARD="network-dashboard",e.DASHBOARD_LOADER="dashboard-loader",e.DASHBOARD_UNIFI_OS_VERSION="dashboard-unifi-os-version",e.DASHBOARD_NETWORK_VERSION="dashboard-network-version",e.HOTSPOT_PORTAL_MINIMIZER="hotspot-portal-minimizer",e.HOTSPOT_PORTAL_SETTINGS_RESTORE_DEFAULT="hotspot-portal-settings-restore-default",e.HOTSPOT_PORTAL_PREVIEW_BACKGROUND="hotspot-portal-preview-background",e.HOTSPOT_PORTAL_PREVIEW_CONTAINER="hotspot-portal-preview-container",e.HOTSPOT_PORTAL_PREVIEW_LOGO="hotspot-portal-preview-logo",e.HOTSPOT_PORTAL_PREVIEW_LANGUAGE="hotspot-portal-preview-language",e.HOTSPOT_PORTAL_PREVIEW_TITLE="hotspot-portal-preview-title",e.HOTSPOT_PORTAL_PREVIEW_WELCOME_TEXT="hotspot-portal-preview-welcome-text",e.HOTSPOT_PORTAL_PREVIEW_AUTHENTICATION_TEXT="hotspot-portal-preview-authentication-text",e.HOTSPOT_PORTAL_PREVIEW_BUTTON_TEXT="hotspot-portal-preview-button-text",e.HOTSPOT_PORTAL_PREVIEW_HOTSPOT_PACKAGES="hotspot-portal-preview-hotspot-packages",e.HOTSPOT_PORTAL_PREVIEW_FACEBOOK="hotspot-portal-preview-facebook",e.HOTSPOT_PORTAL_PREVIEW_VOUCHER="hotspot-portal-preview-voucher",e.HOTSPOT_PORTAL_PREVIEW_PASSWORD="hotspot-portal-preview-password",e.HOTSPOT_PORTAL_PREVIEW_RADIUS="hotspot-portal-preview-radius",e.HOTSPOT_PORTAL_BRANDING_INFORMATION="hotspot-portal-branding-information",e.HOTSPOT_PORTAL_BRANDING_SUCCESS="hotspot-portal-branding-success",e.HOTSPOT_PORTAL_BRANDING_LOGO="hotspot-portal-branding-logo",e.WATCHLIST_TABLE="watchlist-table",e.PROBLEMATIC_CLIENTS_TABLE="problematic-clients-table",e.NETWORK_VERSION="network-version",e.PLAY_PAUSE_BUTTON="play-pause-button",e.CONTROL_PANEL_HEADER="control-panel-header",e.CONTROL_PANEL_HEADER_FILTER_BUTTON="control-panel-header-filter-button",e.HEADER_SIGNOUT_BUTTON="header-signout-button",e.HEADER_USERICON="header_usericon",e.RESTORE_COLUMNS_BUTTON="restore-columns-button",e.WIFI_SECURITY_PROTOCOLS="wifi-security-protocols",e.WIFI_BANDWIDTH_PROFILE="wifi-bandwidth-profile",e.WIFI_PMF_MODE="wifi-pmf-mode",e.WIFI_VLAN_BANDS="wifi-vlan-bands",e.NETWORKCONF_ID="networkconf-id",e.APS_TABLE="aps-table",e.AP_GROUPS_TABLE="ap-groups-table",e.IP_ADDRESS_DROPDOWN="ip-address-dropdown",e.TUNNEL_SUBNET="tunnel-subnet",e.COPY_WIREGUARD_PUBLIC_KEY="copy-wireguard-public-key",e.IPSEC_ESP_LIFETIME_CONTAINER="ipsec-esp-lifetime-container",e.IPSEC_ESP_DH_GROUP_CONTAINER="ipsec-esp-dh-group-container",e.IPSEC_ESP_HASH_CONTAINER="ipsec-esp-hash-container",e.IPSEC_ESP_ENCRYPTION_CONTAINER="ipsec-esp-encryption-container",e.IPSEC_IKE_LIFETIME_CONTAINER="ipsec-ike-lifetime-container",e.IPSEC_IKE_HASH_CONTAINER="ipsec-ike-hash-container",e.IPSEC_IKE_ENCRYPTION_CONTAINER="ipsec-ike-encryption-container",e.EXTRAS_CONTAINER="extras-container",e.TELEPORT_LINK_EXPIRY="teleport-link-expiry",e.TELEPORT_TOKEN_TABLE="teleport-token-table",e.NETWORK_SUBNET_DROPDOWN="network-subnet-dropdown",e.NETWORKS_TABLE="networks-table",e.WS_USERS_TABLE="ws-users-table",e.TOGGLE_DHCP_MANAGEMENT="toggle-dhcp-management",e.DHCP_MODE_DROPDOWN="dhcp-mode-dropdown",e.ADD_NEW_DHCP_OPTION="add-new-dhcp-option",e.TOPOLOGY_FILTER_CONTROL="topology-filter-control",e.TOPOLOGY_ROTATION="topology-rotation",e.SETTINGS_DEVICE_UPDATE_CACHE="settings-device-update-cache",e.SETTINGS_DEVICE_UPDATE_SCHEDULE="settings-device-update-schedule",e.SETTINGS_DEVICE_FIRMWARE="settings-device-firmware",e.SETTINGS_DEVICE_FIRMWARE_RELEASE_CHANNEL="settings-device-firmware-release-channel",e.SETTINGS_EARLY_ACCESS_RELEASE_CHANNELS="settings-early-access-release-channels",e.SETTINGS_NETWORKS_NEW_VIRTUAL_NETWORK="settings-networks-new-virtual-network",e.LOGS_CATEGORY_PICKER="logs-category-picker",e.LOGS_SUBCATEGORY_PICKER="logs-subcategory-picker",e.LOGS_EVENT_PICKER="logs-event-picker",e.LOGS_SETTINGS="logs-settings",e.LOGS_RELOAD="logs-reload",e.PUSH_NOTIFICATIONS_PICKER="push-notifications-picker",e.VIEWER_NETWORK="viewer-network",e.VIEWER_INTERNET="viewer-internet",e.VIEWER_VPN_SERVER="viewer-vpn-server",e.VIEWER_VPN_CLIENT="viewer-vpn-client",e.VIEWER_POLICY_BASED_ROUTING="viewer-policy-based-routing",e.VIEWER_FIREWALL_RULES="viewer-firewall-rules",e.VIEWER_NAT="viewer-nat",e.VIEWER_SITE_TO_SITE_VPN="viewer-site-to-site-vpn",e.VIEWER_WIFI="viewer-wifi",e.CREATE_FIREWALL_ZONE_BUTTON="create-firewall-zone-button",e.CREATE_FIREWALL_POLICY_BUTTON="create-firewall-policy-button",e.FIREWALL_POLICY_ORDER_BUTTON="firewall-policy-order-button",e.POLICY_BASED_ROUTES_DOMAIN="editable-grid-table-wrapper-domains",e.ACL_POLICY_FORM_TYPE="acl-policy-form-type",e.ACL_POLICY_FORM_SOURCE="acl-policy-form-source",e.ACL_POLICY_FORM_ACTION="acl-policy-form-action",e.ACL_POLICY_FORM_DESTINATION="acl-policy-form-destination",e.VIEWER_CONTENT_FILTER="viewer-content-filter",e.CLIENTS_FILTER_FOOTER="clients-filter-footer",e.CLIENTS_FILTER_CONTENT="clients-filter-content",e.VIEWER_ETHERNET_PORTS_PROFILE="viewer-ethernet-ports-profile",e.VIEWER_WAN_SLA="viewer-wan-sla",e.VIEWER_NETWORK_LISTS="viewer-network-lists",e.VIEWER_WIFI_SPEED_LIMIT_PROFILE="viewer-wifi-speed-limit-profile",e.VIEWER_RADIUS_PROFILE="viewer-radius-profile"}(i||(i={}))},387521:(e,t,a)=>{a.d(t,{C:()=>E});var i=a(407814),n=a(348466),r=a(263963),s=a(976118),o=a(790163);const E=i.Yj({message:(0,r.rn)("SETTINGS_COMMON_PORT_VALIDATION_REQUIRED")}).refine(e=>{const t=e.split(n.KE);return t.length>0&&t.every(e=>{const t=s.L.safeParse(e),a=o.i.safeParse(e);return t.success||a.success})},{message:(0,r.rn)("SETTINGS_COMMON_PORT_VALIDATION_REQUIRED")})},465543:(e,t,a)=>{a.d(t,{w:()=>s});var i=a(469733),n=a(296540),r=a(845030);const s=e=>{const t=(0,i.useDispatch)();(0,n.useEffect)(()=>{t((0,r.SQ)(e))},[t,e])}},528644:(e,t,a)=>{a.d(t,{C:()=>o});var i=a(801081),n=a(198494),r=a(792072),s=a(532419);const o=(0,i.Mz)(s.$8,s.m9,s.N4,s.at,s.Tp,r.et,n.UP,s.IP,s.C$,(e,t,a,i,n,r,s,o,E)=>({devicesHaveLastFetchTime:e,hasSiteGateway:t,hasApAdopted:a,hasSwitchAdopted:i,hasL3SwitchAdopted:n,features:r,selfPreconfigureApprovals:s,siteGatewayInterfaces:o,isUsg:E}))},571569:(e,t,a)=>{a.r(t),a.d(t,{default:()=>B});var i=a(469733),n=a(296540),r=a(742920),s=a(853801),o=a(606081),E=a(675291),_=a(169568),l=a(895424),T=a(641777),d=a(79786),O=a(398300),S=a(566723),I=a(48925),c=a(294303),m=a(845030),N=a(675359),A=a(699784),R=a(210484),p=a(867955),u=a(711748),P=a(323013),L=a(959341),C=a(329109),h=a(407814),g=a(263963);const D=e=>h.Yj().max(64,{message:(0,g.rn)("SETTINGS_COMMON_FIELD_SHOULD_NOT_EXCEED_MAX_LENGTH",{name:(0,g.rn)("COMMON_NAME"),limit:64})}).refine(t=>!e.some(e=>e.name===t),{message:(0,g.rn)("COMMON_PLEASE_ENTER_UNIQUE_NAME")});var v=a(349785),G=a(610356),f=a(553432),M=a(317672),U=a(349665),b=a(41488);const F=({form:e,isExistingRecord:t})=>{const a=(0,v.FH)({control:e.control,name:"group_members"});return n.createElement(U.A,null,n.createElement(M.A,null,n.createElement(A.sA,{id:"COMMON_TYPE"})),n.createElement(T.A,{isDisabled:a.length>0||t},n.createElement(f.A,{flexDirection:"column",alignItems:"flex-start"},b.iw.map(t=>n.createElement(G.A,{key:t,control:e.control,name:"group_type",value:t},n.createElement(A.sA,{id:b.od[t]}))))))};var w=a(617883),W=a(383725),V=a(968906);const y=({form:e})=>{const{formatMessage:t}=(0,A.tz)(),a=(0,v.FH)({control:e.control,name:"group_type"}),i=b.N0[a],r=b.uE[a],s=t({id:r.id},r.values);return n.createElement(U.A,{...V.A.addDataTestId(W.b.POLICY_BASED_ROUTES_DOMAIN)},n.createElement(M.A,null,n.createElement(A.sA,{id:i})),n.createElement(w.A,{form:e,name:"group_members",fieldLabel:i,modalTitle:n.createElement(A.sA,{id:"SETTINGS_ADD_MULTIPLE_NETWORK_LIST_VALUES"}),modalFieldPlaceholder:s,itemSchema:b.Je[a],placeholder:s,getDuplicationMessage:()=>t({id:b.Zb[a]})}))},H="network-list-profile-form",B=({activeItem:e})=>{const t=(0,i.useDispatch)(),a=e._id===L.R6,v=(0,i.useSelector)(u.O9),G=(0,d.m)({schema:(f=v.filter(({_id:t})=>t!==e._id),h.KC([h.Ik({group_type:h.eu(p.B.PORT_GROUP),name:D(f),group_members:h.YO(h.Yj()).min(1,{message:(0,g.rn)("SETTINGS_PROFILES_PORT_IP_GROUPS_FORM_FIELD_GROUP_MEMBERS_PORT_MIN")})}),h.Ik({group_type:h.KC([h.eu(p.B.ADDRESS_GROUP),h.eu(p.B.IPV6_ADDRESS_GROUP)]),name:D(f),group_members:h.YO(h.Yj()).min(1,{message:(0,g.rn)("SETTINGS_PROFILES_PORT_IP_GROUPS_FORM_FIELD_GROUP_MEMBERS_ADDRESS_MIN")})})])),defaultValues:{group_type:e._id===L.R6?p.B.PORT_GROUP:e.group_type,name:e.name,group_members:e._id===L.R6?[]:e.group_members}});var f;const M=(0,o.S)(_.v.NETWORK_OBJECTS);(0,s.y)(G);const U=G.handleSubmit(async i=>{t((0,P.Qe)({...i,_id:a?null:e._id,group_members:(i.group_members||[]).filter(e=>!!e)})).then(e=>{t((0,m.SQ)(!1)),a&&t((0,m.XP)({id:e._id,type:O.H.NETWORK_LIST_PROFILE}))}).then(()=>{G.reset()}).catch(e=>{t((0,N.ox)({errorMessage:e.msg,errorValues:e,icon:r.C.danger,message:"SETTINGS_PROFILES_NETWORK_OBJECT_FORM_SAVE_FAILURE",values:{name:i.name}}))})});return n.createElement(T.A,{isDisabled:M},n.createElement("form",{onSubmit:U,id:H},n.createElement(c.A,{width:"100%",gap:S.Ln,flexDirection:"column"},n.createElement(E.A,{feature:_.v.NETWORK_OBJECTS,renderWarning:({children:e})=>n.createElement(R.A,null,n.createElement(I.A,null,e))}),n.createElement(I.A,null,n.createElement(l.A,{autoFocus:!0,control:G.control,name:"name",label:n.createElement(A.sA,{id:"COMMON_NAME"})})),n.createElement(I.A,null,n.createElement(F,{form:G,isExistingRecord:!a}),n.createElement(y,{form:G})),n.createElement(C.A,{onFormCancel:()=>G.reset(),isDirty:G.formState.isDirty||a&&!M,hideCancelButton:!G.formState.isDirty,submitButtonText:a?"COMMON_ACTION_ADD":void 0,form:H,isSubmitting:G.formState.isSubmitting}))))}},586371:(e,t,a)=>{var i;a.d(t,{EE:()=>r,Uh:()=>i,Vf:()=>n}),function(e){e.SINGLE="single",e.PLURAL="plural"}(i||(i={}));const n="editActive",r=20},596441:(e,t,a)=>{a.d(t,{I:()=>i});const i={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,t,a,i){return Math.min((i||this.ROW_HEIGHT)*e+(a??this.HEADER_HEIGHT),(i||this.ROW_HEIGHT)*t+(a??this.HEADER_HEIGHT))},getEditContainerHeight(e,t,a){return Math.min((a||this.EDIT_FIELD_HEIGHT)*e,(a||this.EDIT_FIELD_HEIGHT)*t)}}},606081:(e,t,a)=>{a.d(t,{S:()=>o});var i=a(469733),n=a(296540),r=a(528644),s=a(674319);function o(e){const t=(0,i.useSelector)(r.C);return(0,n.useMemo)(()=>!(0,s.TM)(e,t)&&!(0,s.A)(e,t),[e,t])}},610356:(e,t,a)=>{a.d(t,{A:()=>l});var i=a(349785),n=a(296540),r=a(54227),s=a(566723),o=a(766624),E=a(294303),_=a(284428);const l=(0,n.forwardRef)(function({control:e,name:t,children:a,tooltip:l,tooltipProps:T,value:d,onCheck:O,...S},I){const c=(0,_.mQ)();return n.createElement(i.xI,{control:e,name:t,render:({field:e})=>n.createElement(E.A,{gap:s.YC,alignItems:"center",ref:I,...S},n.createElement(r.A,{id:e.name,onChange:({target:{checked:t}})=>{t&&(e.onChange(d),O?.())},checked:e.value===d,disabled:c,value:e.value},a),l?n.createElement(o.A,{description:l,...T}):null)})})},617883:(e,t,a)=>{a.d(t,{A:()=>l});var i=a(349785),n=a(296540),r=a(263963),s=a(284428),o=a(294303),E=a(699784),_=a(859510);const l=function({form:e,name:t,fieldLabel:a,modalTitle:l,modalFieldPlaceholder:T,placeholder:d,itemSchema:O,transformValue:S,getDuplicationMessage:I,extraDisplayColumns:c,actions:m,max:N,disableMultiEdit:A=!1}){const R=(0,s.mQ)(),p=(0,r.L_)(),{formatMessage:u}=(0,E.tz)(),P=(0,n.useMemo)(()=>({fieldLabel:a,modalTitle:l,modalFieldPlaceholder:T}),[a,T,l]),L=(0,n.useMemo)(()=>({getDuplicationMessage:I??(()=>u({id:"SETTINGS_VALUE_UNIQUE"})),validate:e=>{const t=O.safeParse(e);return!!t.success||n.createElement(n.Fragment,null,p(t.error.issues[0]?.message))}}),[u,p,I,O]),C=(0,n.useMemo)(()=>({placeholder:d,translatePlaceholder:!1,parser:S?e=>S(e?.[0]?.target?.value):void 0}),[d,S]);return n.createElement(i.xI,{control:e.control,name:t,render:({field:e,fieldState:t,formState:a})=>n.createElement(o.A,{flexDirection:"column",width:"100%"},n.createElement(_.A,{disabled:R,labels:P,fieldValidation:L,extraFieldConfig:C,value:e.value||[],onChange:t=>e.onChange(t),invalid:t.invalid?p((0,i.Jt)(a.errors,e.name)?.message)||!0:void 0,extraDisplayColumns:c,actions:m,disableMultiEdit:A,max:N}))})}},641777:(e,t,a)=>{a.d(t,{A:()=>s});var i=a(296540),n=a(284428),r=a(451449);const s=({isDisabled:e,isAdditive:t=!0,children:a})=>{const s=(0,n.pv)(),o=(0,i.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),E=(0,i.useMemo)(()=>({fields:t?o.fields||s.fields:o.fields,labels:t?o.labels||s.labels:o.labels,tooltipIcons:t?o.tooltipIcons||s.tooltipIcons:o.tooltipIcons,tooltipPopovers:t?o.tooltipPopovers||s.tooltipPopovers:o.tooltipPopovers}),[t,o.fields,o.labels,o.tooltipIcons,o.tooltipPopovers,s.fields,s.labels,s.tooltipIcons,s.tooltipPopovers]);return i.createElement(r.I.Provider,{value:E},a)}},674319:(e,t,a)=>{a.d(t,{A:()=>o,TM:()=>l,f9:()=>_});var i=a(598796),n=a(780811),r=a(169568);const s={[r.v.SETTINGS_WIFI]:e=>!e.devicesHaveLastFetchTime||e.hasApAdopted,[r.v.SETTINGS_WIFI_SPEED_LIMIT_PROFILES]:e=>!e.devicesHaveLastFetchTime||e.hasApAdopted,[r.v.SETTINGS_NETWORKS]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasSwitchAdopted||e.hasApAdopted,[r.v.SETTINGS_INTERNET]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway,[r.v.SETTINGS_TELEPORT]:e=>e.features.has(i.Xj.TELEPORT),[r.v.SETTINGS_UID_VPN]:()=>!1,[r.v.SETTING_ROUTING]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasL3SwitchAdopted,[r.v.SETTINGS_SECURITY]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasL3SwitchAdopted,[r.v.SETTINGS_RADIUS]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway,[r.v.NETWORK_OBJECTS]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway,[r.v.SETTINGS_ETHERNET_PORTS]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasSwitchAdopted,[r.v.SETTINGS_PROFILES]:e=>!e.devicesHaveLastFetchTime||e.hasApAdopted||e.hasSiteGateway||e.hasSwitchAdopted,[r.v.SETTINGS_VPN]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway,[r.v.SETTINGS_VPN_CLIENT]:e=>e.hasSiteGateway&&!(0,n.oWO)({type:e.siteGatewayInterfaces.type})&&!(0,n.ziy)({model:e.siteGatewayInterfaces.model}),[r.v.SETTINGS_POLICY]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasL3SwitchAdopted||e.features.has(i.Xj.SWITCH_CUSTOM_ACL_RULES)||e.features.has(i.Xj.ZONE_BASED_FIREWALL)||e.features.has(i.Xj.USER_DEFINED_NAT_RULES)||e.features.has(i.Xj.STATIC_DNS),[r.v.SETTINGS_POLICY_ACL]:e=>!e.devicesHaveLastFetchTime||e.features.has(i.Xj.SWITCH_CUSTOM_ACL_RULES),[r.v.SETTINGS_POLICY_QOS]:e=>!e.devicesHaveLastFetchTime||e.features.has(i.Xj.ZONE_BASED_FIREWALL),[r.v.SETTINGS_POLICY_NAT]:e=>!e.devicesHaveLastFetchTime||e.features.has(i.Xj.USER_DEFINED_NAT_RULES),[r.v.SETTINGS_POLICY_DNS]:e=>!e.devicesHaveLastFetchTime||e.features.has(i.Xj.STATIC_DNS),[r.v.SETTINGS_POLICY_PORT_FORWARDING]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway,[r.v.SETTINGS_POLICY_FIREWALL]:e=>!e.devicesHaveLastFetchTime||e.features.has(i.Xj.ZONE_BASED_FIREWALL),[r.v.SETTINGS_POLICY_ROUTE]:e=>!e.devicesHaveLastFetchTime||e.hasSiteGateway||e.hasL3SwitchAdopted,[r.v.SETTINGS_CONTENT_FILTER]:e=>!e.devicesHaveLastFetchTime||e.features.has(i.Xj.CLOUDFLARE_CONTENT_FILTERING)},o=(e,t)=>!!s[e]?.(t),E={[r.v.SETTINGS_WIFI]:()=>!0,[r.v.SETTINGS_WIFI_SPEED_LIMIT_PROFILES]:()=>!0,[r.v.SETTINGS_NETWORKS]:()=>!0,[r.v.SETTINGS_INTERNET]:()=>!0,[r.v.SETTINGS_TELEPORT]:()=>!0,[r.v.SETTINGS_UID_VPN]:()=>!0,[r.v.SETTING_ROUTING]:()=>!0,[r.v.SETTINGS_SECURITY]:()=>!0,[r.v.SETTINGS_RADIUS]:()=>!0,[r.v.NETWORK_OBJECTS]:()=>!0,[r.v.SETTINGS_ETHERNET_PORTS]:()=>!0,[r.v.SETTINGS_PROFILES]:()=>!0,[r.v.SETTINGS_VPN]:()=>!0,[r.v.SETTINGS_VPN_CLIENT]:()=>!0,[r.v.SETTINGS_POLICY]:()=>!0,[r.v.SETTINGS_POLICY_ACL]:()=>!1,[r.v.SETTINGS_POLICY_QOS]:()=>!1,[r.v.SETTINGS_POLICY_NAT]:()=>!1,[r.v.SETTINGS_POLICY_DNS]:()=>!1,[r.v.SETTINGS_POLICY_PORT_FORWARDING]:()=>!0,[r.v.SETTINGS_POLICY_FIREWALL]:()=>!1,[r.v.SETTINGS_POLICY_ROUTE]:()=>!0,[r.v.SETTINGS_CONTENT_FILTER]:()=>!1},_=(e,t)=>E[e]?.(t),l=(e,t)=>!!t.selfPreconfigureApprovals?.includes(e)&&_(e,t)},675291:(e,t,a)=>{a.d(t,{A:()=>N});var i=a(469733),n=a(296540),r=a(847883),s=a(758649),o=a(162420),E=a(687370),_=a(958372),l=a(267691),T=a(675344),d=a(566723),O=a(294303),S=a(263130),I=a(699784),c=a(789768);const m={maxWidth:T.By,margin:`${d.Ln} 0 0 0`,style:{flex:0}},N=({feature:e,children:t,rowProps:a,skipApproval:T=!1,renderWarning:N})=>{const A=(0,i.useDispatch)(),R=(0,l.u)(e),p=(0,E.r)(e),u=(0,n.useCallback)(()=>A((0,c.ct)(e)),[A,e]),P=p?null:n.createElement(S.A,{icon:n.createElement(o.A,{variant:"fill",size:"original",isActive:!0}),description:n.createElement(I.sA,{id:_.b[e]?.(R||T)||"COMMON_LOCKED_FEATURE"}),action:R||T?null:n.createElement(s.A,{type:"button",onClick:u,variant:"inline"},n.createElement(I.sA,{id:"COMMON_LOCKED_PRECONFIGURE"}))});return n.createElement(n.Fragment,null,P?n.createElement(n.Fragment,null,N?N({children:P}):n.createElement(r.A,{unlimitedWidth:!0,...m,...a},P)):null,t?n.createElement(r.A,{unlimitedWidth:!0,disabled:!p&&!R&&!T,marginBottom:0},n.createElement(O.A,{width:"100%",flexDirection:"column",gap:d.Ln},t)):null)}},675344:(e,t,a)=>{a.d(t,{By:()=>i,Ko:()=>s,Qb:()=>r,uE:()=>n,xh:()=>o});const i="800px",n="832px",r="1362px",s="664px",o="100px"},687370:(e,t,a)=>{a.d(t,{r:()=>o});var i=a(469733),n=a(296540),r=a(528644),s=a(674319);function o(e){const t=(0,i.useSelector)(r.C);return(0,n.useMemo)(()=>(0,s.A)(e,t),[e,t])}},689965:(e,t,a)=>{a.d(t,{A:()=>O,I:()=>i});var i,n=a(296540),r=a(822336),s=a(427853),o=a(71479),E=a(825032),_=a(566723),l=a(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const T=(0,o.A)(l.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:a}})=>e||r.Ay[a===E.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:a})=>a||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({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}})=>r.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,d=(0,o.A)(s.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:a}})=>e||r.Ay[a===E.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-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||r.Ay[t===E.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${_.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${_.Ln} ${_.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,O=({type:e,marginBottom:t,margin:a,padding:r,flex:s,width:o,nested:E,..._})=>"items"in _?n.createElement(d,{marginBottom:t,margin:a,padding:r,flex:s,nested:E,..._}):n.createElement(T,{nested:E,width:o,marginBottom:t,margin:a,padding:r,flex:s,isButtonList:e===i.BUTTON_LIST,..._},_.children)},705426:(e,t,a)=>{a.d(t,{A:()=>s});var i=a(296540),n=a(617147),r=a(248543);const s=({children:e=null,hideModal:t,onRequestClose:a,portalSelector:s=r.J,forwardedRef:o=null,...E})=>i.createElement(n.A,{isOpen:!0,shouldCloseOnEsc:!0,onRequestClose:a||t,parentSelector:s,ref:o,...E},e)},790163:(e,t,a)=>{a.d(t,{i:()=>o});var i=a(407814),n=a(348466),r=a(263963),s=a(976118);const o=i.Yj().refine(e=>{const t=e.split(n.jr);return 2===t.length&&((0,s.w)(t[0])&&(0,s.w)(t[1])&&Number(t[0])<Number(t[1]))},{message:(0,r.rn)("SETTINGS_COMMON_SINGLE_PORT_RANGE_VALIDATION_REQUIRED")})},853801:(e,t,a)=>{a.d(t,{y:()=>r});var i=a(349785),n=a(465543);const r=e=>{const t=(0,i.lN)(e);return(0,n.w)(t.isDirty)}},859510:(e,t,a)=>{a.d(t,{A:()=>D});var i=a(296540),n=a(758649),r=a(870443),s=a(284428),o=a(454195),E=a(566723),_=a(294303),l=a(699784),T=a(369596),d=a(586371),O=a(588915),S=a(132196),I=a(258840),c=a(49992),m=a(143811),N=a(546391),A=a(115829),R=a(79760);const p=S.AH`
  max-width: 480px;
`,u="textContent",P=e=>(e||"").split(N.i_).map(e=>e?.trim()).filter(Boolean),L=({onDismiss:e,onSubmit:t,list:a,labels:s,textContentValidation:o})=>{const T=(0,i.useMemo)(()=>{return e=a,t=s.fieldLabel,n=o,r.A.object().shape({[u]:r.A.string().label(t).test({name:"noDuplicates",test:(t,a)=>{const r=P(t),s=[...e,...r];if(new Set(s).size!==s.length){const e=r.find(e=>s.filter(t=>t===e).length>1);if(e)return a.createError({message:i.createElement(_.A,{gap:E.YC},i.createElement(A.A,null,e,":"),n.batchDuplicateMessageId?i.createElement(l.sA,{id:n.batchDuplicateMessageId,values:{value:e}}):n.getDuplicationMessage(e))})}return!0}}).test({name:"areValuesValid",test:(e,t)=>{const a=P(e).map(e=>({item:e,result:n.validate(e)})).filter(({result:e})=>!0!==e);return!a.length||t.createError({message:i.createElement(_.A,{gap:E.YC},i.createElement(A.A,null,a[0]?.item,":"),a[0]?.result)})}})});var e,t,n},[a,s.fieldLabel,o]);return i.createElement(c.Ay,{initialValues:{[u]:""},onDismiss:e,onSubmit:e=>t(P(e[u])),title:"string"==typeof s.modalTitle?i.createElement(l.sA,{id:s.modalTitle}):s.modalTitle,submitAction:i.createElement(n.A,{type:"submit",variant:"primary"},i.createElement(l.sA,{id:"COMMON_ACTION_ADD"})),validationSchema:T,className:p},({setFieldValue:e,values:t,errors:a,touched:n,submitCount:r})=>{const o=(0,R.t$)(u,a,n,r);return i.createElement(_.A,{width:"100%",flexDirection:"column",gap:E.S2,overflow:"hidden"},i.createElement(m.A,{full:!0,type:"textarea",name:u,variant:"secondary",placeholder:s.modalFieldPlaceholder,resize:!1,rows:10,invalid:o?i.createElement(_.A,{overflow:"hidden",maxWidth:440},i.createElement(A.A,null,o)):null}),i.createElement(_.A,null,i.createElement(O.A,{accept:"text/plain",variant:"inline",onChange:async(a,i)=>{const n=!!i&&"current"in i&&i.current?.files?.[0];if(!n)return;const r=await(0,I.Gu)(n);r&&e(u,[...P(t[u]),...P(r)].join(";"))}},i.createElement(l.sA,{id:"SETTINGS_SECURITY_BATCH_ADD_IMPORT_FILE"}))))})},C="item_id",h="items",g=e=>({name:C,validated:!0,...e??{}});const D=function({disabled:e,labels:t,fieldValidation:a,extraFieldConfig:O,extraDisplayColumns:S,transformItem:I,value:c,onChange:m,invalid:N,actions:A,max:R,disableMultiEdit:p=!1}){const u=(0,s.mQ)(),[P,D]=(0,i.useState)(!1),v=(0,i.useMemo)(()=>((e,t)=>[{id:C,label:"string"==typeof e?i.createElement(l.sA,{id:e}):e,renderCell:e=>e[C]},...t||[]])(t.fieldLabel,S),[t.fieldLabel,S]),G=(0,i.useMemo)(()=>[g(O)],[O]),f=(0,i.useMemo)(()=>((e,t)=>r.A.object().shape({[d.Vf]:r.A.boolean(),[C]:r.A.string().when(d.Vf,{is:!1,then:r.A.string().label(e).test({name:"isValidValue",test:(e,a)=>{const i=t.validate(e);return!0===i||a.createError({message:i})}}).test({name:"noDuplicates",test:(e,a)=>!a.parent[h].some(t=>t[C]===e)||a.createError({message:t.getDuplicationMessage(e)})}).required()}),[h]:r.A.array().when(d.Vf,{is:!0,then:r.A.lazy(a=>r.A.array().of(r.A.object().shape({[C]:r.A.string().label(e).test({name:"isValidValue",test:(e,a)=>{const i=t.validate(e);return!0===i||a.createError({message:i})}}).test({name:"noDuplicates",test:(e,i)=>!(a.filter(t=>t[C]===e).length>1)||i.createError({message:t.getDuplicationMessage(e)})}).required()})))})}))(t.fieldLabel,a),[t.fieldLabel,a]),M=(0,i.useMemo)(()=>c.map(I?.from||(e=>e)),[I?.from,c]),U=(0,i.useCallback)(e=>m(e.map(I?.to||(e=>e))),[m,I?.to]),b=(0,i.useMemo)(()=>{return{[h]:(e=M,(e||[]).map(e=>({[C]:e}))),[C]:"",[d.Vf]:!1};var e},[M]);return i.createElement(_.A,{flexDirection:"column",width:"100%"},i.createElement(T.A,{fieldName:h,initialValues:b,editable:!0,isWindowTable:!0,validationSchema:f,items:b[h],invalid:N,idField:C,columns:v,newFields:G,onAddItem:e=>U([...M,e[C]]),onRemoveItem:e=>U(M.filter(t=>t!==e[C])),onEditSubmit:e=>U(e.map(e=>e[C])),isDisabledOverride:e||u,max:R},e||u||p?null:i.createElement(_.A,{marginTop:E.YC,height:o.b,alignItems:"center",gap:E.kc},i.createElement(n.A,{variant:"inline",onClick:()=>D(!0),type:"button",size:"medium"},i.createElement(l.sA,{id:"COMMON_ADD_MULTIPLE"})),A)),M.length?i.createElement(_.A,{height:o.b,alignItems:"center"},i.createElement(n.A,{variant:"inline",onClick:()=>U([]),size:"medium",type:"button",disabled:e||u},i.createElement(l.sA,{id:"COMMON_ACTION_CLEAR"}))):null,P?i.createElement(L,{list:M,onDismiss:()=>D(!1),onSubmit:e=>{U([...M,...e]),D(!1)},labels:t,textContentValidation:a}):null)}},867955:(e,t,a)=>{var i;a.d(t,{B:()=>i}),function(e){e.PORT_GROUP="port-group",e.ADDRESS_GROUP="address-group",e.IPV6_ADDRESS_GROUP="ipv6-address-group"}(i||(i={}))},895424:(e,t,a)=>{a.d(t,{A:()=>l});var i=a(349785),n=a(296540),r=a(438628),s=a(705145),o=a(566723),E=a(263963),_=a(284428);const l=function({control:e,name:t,label:a,placeholder:l,tooltip:T,tooltipProps:d,autoFocus:O,motif:S,onChange:I,onBlur:c,onAfterChange:m,onPaste:N,onKeyDown:A,passwordToggle:R,type:p,helperMessage:u,autoComplete:P,contentBefore:L,contentAfter:C,onFocus:h,value:g,invalid:D}){const v=(0,_.mQ)(),G=(0,_.Im)(),f=(0,_.q)(),M=(0,E.L_)();return n.createElement(i.xI,{control:e,name:t,render:({field:e,fieldState:E,formState:_})=>n.createElement(r.A,{type:p||(R?"password":"text"),variant:"secondary",width:"100%",autoFocus:O,...e,onChange:t=>{I?I(t,e,_):e.onChange(t),m?.(t)},onBlur:t=>{c?c(t,e,_):e.onBlur()},onFocus:h,onPaste:N,disabled:v,value:g??e.value?.toString(),invalid:D||(E.invalid?n.createElement(s.A,{variant:"inherit",style:{overflowWrap:"break-word"}},M((0,i.Jt)(_.errors,t)?.message)||!0," "):void 0),label:a,placeholder:l,labelTooltip:T,labelTooltipProps:{style:{opacity:G?o.xN:void 0,pointerEvents:f?"none":void 0,...d?.style},...d},motif:S,passwordToggle:R,helperMessage:u,autoComplete:P,onKeyDown:A,contentBefore:L,contentAfter:C})})}},950700:(e,t,a)=>{a.d(t,{K:()=>o});var i=a(407814),n=a(149133),r=a(546391),s=a(263963);const o=i.Yj({message:(0,s.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).regex(r.wK,{message:(0,s.rn)("COMMON_VALIDATION_IPV4_SUBNET")}).refine(n.N7,{message:(0,s.rn)("COMMON_VALIDATION_IPV4_SUBNET")})},958372:(e,t,a)=>{a.d(t,{D:()=>l,b:()=>T});var i=a(296540),n=a(169568),r=a(699784),s=a(196010),o=a(928085),E=a(959341);const _=()=>{const e=(0,o.A)(E.tz);return i.createElement(s.A,{to:e},i.createElement(r.sA,{id:"COMMON_ACTION_MANAGE"}))},l={[n.v.SETTINGS_POLICY_ACL]:i.createElement(r.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"}),[n.v.SETTINGS_POLICY_QOS]:i.createElement(r.sA,{id:"SETTINGS_ZONE_BASED_FIREWALL_REQUIRED",values:{link:i.createElement(_,null)}}),[n.v.SETTINGS_POLICY_FIREWALL]:i.createElement(r.sA,{id:"SETTINGS_ZONE_BASED_FIREWALL_REQUIRED",values:{link:i.createElement(_,null)}}),[n.v.SETTINGS_POLICY_NAT]:i.createElement(r.sA,{id:"SETTINGS_NAT_NOT_SUPPORTED"}),[n.v.SETTINGS_POLICY_DNS]:i.createElement(r.sA,{id:"SETTINGS_DNS_NOT_SUPPORTED"}),[n.v.SETTINGS_POLICY_PORT_FORWARDING]:i.createElement(r.sA,{id:"SETTINGS_PORT_FORWARDING_NOT_SUPPORTED"}),[n.v.SETTINGS_POLICY_ROUTE]:i.createElement(r.sA,{id:"SETTINGS_ROUTING_NOT_SUPPORTED"})},T={[n.v.SETTINGS_WIFI]:e=>e?"COMMON_LOCKED_FEATURE_AP_PRECONFIGURED":"COMMON_LOCKED_FEATURE_AP",[n.v.SETTINGS_NETWORKS]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW_OR_AP",[n.v.SETTINGS_INTERNET]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[n.v.SETTINGS_TELEPORT]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[n.v.SETTINGS_UID_VPN]:()=>"SETTINGS_VPN_UID_DESC",[n.v.SETTING_ROUTING]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[n.v.SETTINGS_SECURITY]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[n.v.SETTINGS_ETHERNET_PORTS]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[n.v.SETTINGS_WIFI_SPEED_LIMIT_PROFILES]:e=>e?"COMMON_LOCKED_FEATURE_AP_PRECONFIGURED":"COMMON_LOCKED_FEATURE_AP",[n.v.NETWORK_OBJECTS]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[n.v.SETTINGS_VPN]:e=>e?"COMMON_LOCKED_FEATURE_GW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW",[n.v.SETTINGS_POLICY]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[n.v.SETTINGS_POLICY_ACL]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[n.v.SETTINGS_POLICY_QOS]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[n.v.SETTINGS_POLICY_NAT]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[n.v.SETTINGS_POLICY_DNS]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[n.v.SETTINGS_POLICY_PORT_FORWARDING]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[n.v.SETTINGS_POLICY_FIREWALL]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW",[n.v.SETTINGS_POLICY_ROUTE]:e=>e?"COMMON_LOCKED_FEATURE_GW_OR_SW_PRECONFIGURED":"COMMON_LOCKED_FEATURE_GW_OR_SW"}},961386:(e,t,a)=>{a.d(t,{S:()=>n});var i=a(407814);function n(e,{message:t}){return i.Ie(t=>i.KC(e).safeParse(t).success,{message:t})}},968906:(e,t,a)=>{a.d(t,{A:()=>s});var i=a(383725),n=a(199582);class r{static addDataTestId(e){return{[n.L]:e}}}r.TestId=i.b;const s=r},976118:(e,t,a)=>{a.d(t,{L:()=>o,w:()=>s});var i=a(407814),n=a(263963);const r=/^\d+$/,s=e=>{if(!r.test(e))return!1;const t=parseInt(e,10);return!Number.isNaN(t)&&Number.isInteger(t)&&t>=1&&t<=65535},o=i.Yj().refine(e=>s(e),{message:(0,n.rn)("SETTINGS_COMMON_SINGLE_PORT_VALIDATION_REQUIRED")})}}]);