"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[23889],{713882(e,t,a){a.d(t,{T:()=>s});var i=a(801081),n=a(25553),l=a(87485),r=a(889780);const o=(0,n.uh)((0,r.v)()),s=(0,i.Mz)(o,l.i6)},203035(e,t,a){a.d(t,{JT:()=>o,Uv:()=>E,_O:()=>c,cl:()=>_});var i=a(801081),n=a(25553),l=a(87485),r=a(932767);const o=e=>(0,i.Mz)((0,n.uh)((0,r.RU)(e)),l.kh),s=(0,i.Mz)((0,n.uh)((0,r.UC)()),l.i6),_=(0,i.Mz)(s,e=>e.available_ports||[]),c=(0,i.Mz)((0,n.uh)((0,r.WV)()),l.i6),d=(0,i.Mz)((0,n.uh)((0,r.go)()),l.kh),E=(0,i.Mz)(d,e=>e.map(e=>({_id:e._id,name:e.name,interface_ip:e.interface_ip,network_id:e.network_id})))},854925(e,t,a){a.d(t,{B:()=>n});var i=a(16914);const n=e=>[i.$P.APP,i.$P.APP_CATEGORY].includes(e)},391855(e,t,a){a.d(t,{A:()=>c});var i=a(296540),n=a(271856),l=a(858931),r=a(823858),o=a(71479),s=a(916537);const _=(0,o.A)(r.A)`
  color: #ffffff;
`,c=(0,i.memo)(({isDisabled:e,showLoader:t,showWarning:a,showWarningIcon:r,warning:o,label:c="COMMON_ACTION_APPLY_CHANGES",onSubmit:d,form:E})=>i.createElement(n.A,{description:a?o??i.createElement(s.sA,{id:"COMMON_FORM_CHANGES_TRIGGER_PROVISION"}):null,portal:!0,width:240},i.createElement(l.A,{disabled:e,type:"submit",onClick:d,variant:"primary",Icon:a||r?i.createElement(_,{variant:"fill"}):null,loader:t?"loading":void 0,form:E},i.createElement(s.sA,{id:c}))))},372382(e,t,a){a.d(t,{A:()=>o});var i=a(296540),n=a(951272),l=a(86838),r=a(79760);const o=({fieldName:e,validationMessageProps:t={}})=>{const{errors:a,touched:o,submitCount:s}=(0,n.j7)(),_=(0,r.t$)(e,a,o,s);return _?i.createElement(l.A,{isInvalid:!0,style:{padding:0},...t,label:_}):null}},926612(e,t,a){a.d(t,{A:()=>s});var i=a(296540),n=a(77610),l=a(57527),r=a(217439),o=a(372382);const s=({items:e,selectedKeys:t,onSelectionChange:a,disabled:s,defaultExpanded:_,editSelectionIcon:c,localizationTexts:d,fieldName:E})=>{const m=(0,i.useMemo)(()=>e.filter(e=>"CHECKBOX"===e.type).map(e=>e.id),[e]),A=(0,i.useMemo)(()=>{const t=new Map;return e.forEach(e=>{"CHECKBOX"===e.type&&t.set(e.id,e.title)}),t},[e]),I=(0,i.useCallback)(()=>{a(new Set(m))},[a,m]),T=(0,i.useCallback)(()=>{a(new Set)},[a]),u=(0,i.useCallback)(()=>0!==m.length&&("all"===t||t.size>=m.length),[m,t]),O=(0,i.useMemo)(()=>{var e,a;return(a=m,"all"===(e=t)?a:Array.from(e)).filter(e=>A.has(e)).map(e=>i.createElement(l.A,{key:e},i.createElement(r.A,{color:"text-1"},A.get(e))))},[t,m,A]);return i.createElement(i.Fragment,null,i.createElement(n.A,{items:e,selectedKeys:t,setSelectedKeys:a,onSelectionChange:a,onSelectAll:I,onDeselectAll:T,isAllSelected:u,chips:O,isDisabled:s,defaultExpanded:_,editSelectionIcon:c,localizationTexts:d}),E?i.createElement(o.A,{fieldName:E}):null)}},998386(e,t,a){a.d(t,{HV:()=>l,pm:()=>r,vF:()=>n});var i=a(765562);const n=e=>`${i.A.fabricsOrchestration}?orchestrationId=${e?.template_id||""}&orgId=${e?.organization_id||""}`,l=e=>`${i.A.fabricsDeviceTemplates}/${e?.template_id||""}?orgId=${e?.organization_id||""}`,r=()=>`${i.A.fabricsOrchestration}`},252093(e,t,a){a.d(t,{A:()=>o});var i=a(296540),n=a(271856),l=a(162420),r=a(916537);const o=({messageId:e,tooltipClassName:t,values:a,isInteractive:o,portal:s,variant:_="twoTone",size:c="medium"})=>i.createElement(n.A,{description:i.createElement(r.sA,{id:e,values:a}),width:210,isInteractive:o,portal:s,tooltipClassName:t},i.createElement(l.A,{isActive:!0,omitSvgMargin:!0,variant:_,size:c}))},813040(e,t,a){a.d(t,{A:()=>E,R:()=>d});var i=a(296540),n=a(822336),l=a(71479),r=a(180524),o=a(566723),s=a(294303),_=a(252093);const c=(0,l.A)(s.A)`
  flex-direction: column;
  height: ${48}px;
  border-bottom: ${({theme:{themeName:e}})=>n.Ay[`desktop-border-divider-${e}`]};
  padding: ${o.xO} 0;
  position: relative;
  .tooltip-position-fixer {
    margin-right: -${o.Ln};
  }
`,d=({tooltipId:e,disabledTooltip:t,children:a,tooltipProps:n={},...l})=>i.createElement(c,{...l},i.createElement(s.A,{justifyContent:"space-between",alignItems:"center"},i.createElement(r.A,{description:t,placement:"left"},i.createElement("span",null,a)),e?i.createElement(_.A,{messageId:e,tooltipClassName:"tooltip-position-fixer",variant:"outline",...n}):null)),E=d},623889(e,t,a){a.d(t,{A:()=>wt});var i=a(469733),n=a(296540),l=a(951272),r=a(592510),o=a(742920),s=a(38671),_=a(335928),c=a(464265),d=a(398300),E=a(845030),m=a(675359),A=a(916537),I=a(175165),T=a(366188),u=a(602021),O=a(589681),S=a(714610),p=a(707362),C=a(319797),N=a(414783),M=a(598796),R=a(959341),P=a(624461),g=a(703599),h=a(271856),b=a(566723),L=a(48925),f=a(349107),y=a(294303),v=a(689965),D=a(854925),Y=a(302167),G=a(765562),w=a(641777),F=a(446367),U=a(813040),k=a(352466),z=a(137625),V=a(391855),W=a(16914),x=a(482579),H=a(145520);const B=({isDisabled:e,isLoading:t,isExistingRecord:a,values:l,submitForm:r,form:o})=>{const s=(0,i.useSelector)(S.Cw),_=(0,n.useMemo)(()=>s.find(e=>e.zone_key===O.o.GATEWAY),[s]),c=(0,n.useMemo)(()=>s.find(e=>e.zone_key===O.o.EXTERNAL),[s]),d=l.action===W.Dl.BLOCK||l.action===W.Dl.REJECT,E=d&&l.source_matching_target===x.y.ANY&&l.destination_matching_target===H.f.ANY&&l.source_port_matching_type===W.rl.ANY&&l.destination_port_matching_type===W.rl.ANY,m=d&&l.source_matching_target===x.y.ANY&&l.destination_matching_target===H.f.ANY&&!!l.destination_zone_id&&l.destination_zone_id===_?._id,I=E&&!!l.destination_zone_id&&l.destination_zone_id===c?._id,T=m||E||I,u=(0,n.useMemo)(()=>{let e="";return m?e="SETTINGS_SECURITY_POLICY_BLOCK_GATEWAY_CONFIRM_TITLE":I?e="SETTINGS_SECURITY_POLICY_BLOCK_INTERNET_CONFIRM_TITLE":E&&(e="SETTINGS_SECURITY_POLICY_BLOCK_TRAFFIC_CONFIRM_TITLE"),e},[m,I,E]),p=(0,n.useMemo)(()=>{let e="";return m?e="SETTINGS_SECURITY_POLICY_BLOCK_GATEWAY_CONFIRM_MESSAGE":I?e="SETTINGS_SECURITY_POLICY_BLOCK_INTERNET_CONFIRM_MESSAGE":E&&(e="SETTINGS_SECURITY_POLICY_BLOCK_TRAFFIC_CONFIRM_MESSAGE"),e},[m,I,E]),[C,N]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{C&&!T&&N(!1)},[C,T]),n.createElement(z.A,{isOpen:C,handleConfirm:()=>{N(!1),r()},handleCancel:()=>N(!1),handleClose:()=>N(!1),rootClose:!0,buttonVariant:"danger",buttonMessage:"COMMON_ACTION_PROCEED",title:u,body:n.createElement("div",null,n.createElement(A.sA,{id:p,values:{link:n.createElement(f.A,{id:"COMMON_LEARN_MORE",noWrap:!0,href:G.A.firewallPolicies})}}))},n.createElement(V.A,{isDisabled:e,showLoader:t,showWarningIcon:T,label:a?"COMMON_ACTION_APPLY_CHANGES":"SETTINGS_SECURITY_ADD_POLICY",form:o,onSubmit:e=>{T&&(e.preventDefault(),e.stopPropagation(),N(!0))}}))};var K=a(709690),X=a(928085),j=a(454195),$=a(143811),q=a(196010);const J=({disabled:e})=>{const t=(0,X.A)(`${R.bB}/${R.Uy.TRAFFIC_LOGGING}`);return n.createElement(y.A,{alignItems:"center",minHeight:j.b},n.createElement(y.A,{alignItems:"center",gap:b.YC},n.createElement($.A,{type:"realCheckbox",name:"logging",disabled:e},n.createElement(A.sA,{id:"COMMON_SYSLOG_LOGGING"})),n.createElement(h.A,{isInteractive:!0,portal:!0,description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_SYSLOG_LOGGING_DESCRIPTION",values:{link:n.createElement(q.A,{to:t,style:{whiteSpace:"nowrap"}},n.createElement(A.sA,{id:"SETTINGS_SECURITY_SYSLOG_LOGGING_DESCRIPTION_LINK_TEXT"}))}})},n.createElement(K.A,{size:"original",isActive:!0}))))};var Z=a(400261),Q=a(405349),ee=a(902146),te=a(958979),ae=a(64449),ie=a(324697),ne=a(74805),le=a(203035),re=a(277517),oe=a(867955),se=a(546391);const _e=({disabled:e,fieldName:t,options:a,onFieldChange:i})=>{const{setFieldValue:r}=(0,l.j7)(),o=(0,n.useCallback)(e=>{r(t,e.value),i()},[r,t,i]);return n.createElement($.A,{type:"dropdown",variant:"secondary",name:t,options:a,disabled:e,onChange:o,full:!0})};var ce=a(217439),de=a(162420);const Ee=({disabled:e,fieldName:t,radioOptions:a})=>n.createElement(y.A,{flexDirection:"column"},n.createElement(y.A,{alignItems:"center",gap:b.YC},n.createElement(ce.A,{size:"small",color:"text-3"},n.createElement(A.sA,{id:"COMMON_PORT"})),n.createElement(h.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_PORT_DESCRIPTION"}),portal:!0,style:{display:"flex",alignItems:"center"}},n.createElement(de.A,{size:"original",isActive:!0}))),n.createElement(y.A,{gap:b.Ln,height:j.b,alignItems:"center"},a.map(a=>n.createElement($.A,{key:`${t}_${a.value}`,type:"radio",name:t,value:a.value,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:a.label}))))));var me=a(180524),Ae=a(553432);const Ie=({disabled:e,fieldName:t})=>{const{values:a}=(0,l.j7)(),i=a.ip_version===W.oi.IPV6,r=(0,c.A)(M.Xj.IPV6_INTERFACE_IDENTIFIER_FOR_FIREWALL_FILTER);return n.createElement(Ae.A,null,n.createElement($.A,{type:"radio",name:t,value:W.qv.SPECIFIC,disabled:e},n.createElement(A.sA,{id:"COMMON_SPECIFIC"})),n.createElement($.A,{type:"radio",name:t,value:W.qv.OBJECT,disabled:e},n.createElement(A.sA,{id:"SETTINGS_LIST"})),r?n.createElement(me.A,{description:i?void 0:n.createElement(A.sA,{id:"SETTINGS_IPV6_INTERFACE_ID_DISABLED_TOOLTIP"})},n.createElement("div",null,n.createElement($.A,{type:"radio",name:t,value:W.qv.IID,disabled:e||!i,tooltipMessage:n.createElement(A.sA,{id:"SETTINGS_SECURITY_ZONE_IPV6_INTERFACE_ID_TOOLTIP"})},n.createElement(A.sA,{id:"SETTINGS_IPV6_INTERFACE_ID"})))):null)};var Te=a(379509),ue=a(822336),Oe=a(823858),Se=a(382389),pe=a(823084);const Ce=()=>{const{themeName:e}=(0,Se.u)();return n.createElement(pe.A,{icon:n.createElement(Oe.A,{variant:"fill",size:"original",color:ue.Ay[`desktop-color-orange-06-${e}`]})},n.createElement(A.sA,{id:"SETTINGS_POLICY_WILL_NOT_APPLY_WITH_SSL_INSPECTION",values:{link:n.createElement(f.A,{id:"COMMON_LEARN_MORE",href:G.A.firewallPolicies,noWrap:!0})}}))},Ne=({disabled:e,name:t,labelId:a,descriptionId:i})=>n.createElement(y.A,{minHeight:j.b,alignItems:"center"},n.createElement($.A,{disabled:e,type:"realCheckbox",name:t,tooltipMessage:n.createElement(A.sA,{id:i}),tooltipProps:{portal:!0,style:{display:"flex",alignItems:"center"}}},n.createElement(y.A,{alignItems:"center",gap:b.YC},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:a})))));var Me=a(836349),Re=a(594827),Pe=a(959207);const ge=({disabled:e})=>{const{formatMessage:t}=(0,A.tz)(),{values:{source_zone_id:a,source_vpn_site_to_site_id:r}}=(0,l.j7)(),o=(0,i.useSelector)(S.Av),s=(0,i.useSelector)(S.Cw),_=(0,n.useMemo)(()=>s.find(({_id:e})=>e===a),[a,s]),c=(0,n.useMemo)(()=>o.filter(e=>r===e._id||_&&(0,g.c8)(e,_)&&(0,Pe.u0)(e)).map(e=>({label:e.name,value:e._id,additionalInfo:e.sdwan_hub_spoke_local_wan_id?(0,Re.qY)(e.sdwan_hub_spoke_local_wan_id,t):e.ip})),[o,t,_,r]);return n.createElement(y.A,{flexDirection:"column",width:"100%"},n.createElement($.A,{disabled:e,name:"source_vpn_site_to_site_id",validated:!0,options:c,type:"dropdown",full:!0,variant:"secondary"}))};var he=a(948177),be=a(926612);const Le=({disabled:e,name:t})=>{const{formatMessage:a}=(0,A.tz)(),{values:r,setFieldValue:o}=(0,l.j7)(),s=(0,i.useSelector)(S.Av),_=(0,i.useSelector)(S.Cw),c=(0,n.useMemo)(()=>_.find(({_id:e})=>e===r.source_zone_id),[r.source_zone_id,_]),d=(0,l.O6)(r,t),E=(0,n.useMemo)(()=>s.filter(e=>d.includes(e._id)||c&&(0,g.c8)(e,c)&&!(0,Pe.u0)(e)),[d,s,c]),m=(0,n.useMemo)(()=>E.map(e=>({id:e._id,title:e.name,children:[],type:"CHECKBOX",checkboxProps:{data:e.sdwan_hub_spoke_local_wan_id?(0,Re.qY)(e.sdwan_hub_spoke_local_wan_id,a):e.ip}})),[E,a]),I=(0,n.useMemo)(()=>new Set(d),[d]),T=(0,n.useCallback)(e=>{const a="all"===e?m.filter(e=>"CHECKBOX"===e.type).map(e=>e.id):Array.from(e);o(t,a)},[m,o,t]);return n.createElement(be.A,{items:m,selectedKeys:I,onSelectionChange:T,disabled:e,defaultExpanded:0===d.length,fieldName:t,editSelectionIcon:n.createElement(he.A,null),localizationTexts:{EDIT_SELECTION_LABEL:a({id:"COMMON_ACTION_SELECT_NETWORKS"})}})},fe={[x.y.ANY]:"COMMON_ANY",[x.y.CLIENT]:"COMMON_DEVICE",[x.y.NETWORK]:"COMMON_NETWORK",[x.y.VPN_SERVER]:"COMMON_SERVER",[x.y.VPN_SITE_TO_SITE]:"SETTINGS_NETWORKS_FORM_FIELD_VPN_TYPE_SITE_TO_SITE",[x.y.IP]:"COMMON_IP",[x.y.MAC]:"COMMON_MAC",[x.y.VPN_USER]:"COMMON_USER",[x.y.REGION]:"COMMON_REGION",[x.y.USER_IDENTITY]:"COMMON_IDENTITY"},ye=[x.y.ANY,x.y.VPN_SERVER,x.y.VPN_SITE_TO_SITE,x.y.IP],ve=[x.y.ANY,x.y.IP,x.y.MAC,x.y.REGION],De=[x.y.ANY,x.y.CLIENT,x.y.NETWORK,x.y.IP,x.y.MAC],Ye=({disabled:e})=>{const{values:t}=(0,l.j7)(),a=(0,c.A)(M.Xj.FIREWALL_USER_IDENTITY_SUPPORT),r=(0,c.A)(M.Xj.ULP_FIREWALL_IDENTITY_SUPPORT),o=(0,c.A)(M.Xj.ONE_CLICK_VPN_FIREWALL_IDENTITY_SUPPORT),s=a&&r,_=(0,i.useSelector)(S.Cw),d=(0,i.useSelector)(S.Av),E=(0,n.useMemo)(()=>_.find(e=>e._id===t.source_zone_id),[t.source_zone_id,_]),m=(0,n.useMemo)(()=>{if(!E)return[x.y.ANY];let e=[];return E.zone_key===O.o.GATEWAY?[]:(E.zone_key===O.o.VPN&&(e=[...ye]),E.zone_key===O.o.EXTERNAL&&(e=[...ve]),e.length||(e=[...De]),s&&(E.zone_key===O.o.INTERNAL||!E.default_zone||E.zone_key===O.o.VPN&&o)&&(e=[...e,x.y.USER_IDENTITY]),e)},[E,s,o]);return n.createElement(y.A,{gap:b.xO,rowGap:b.YC,paddingTop:b.YC,paddingBottom:b.YC,alignItems:"center",flexWrap:"wrap"},m.map(t=>{const a=t===x.y.NETWORK&&E&&!d.some(e=>(0,g.c8)(e,E)),i=t===x.y.VPN_SERVER&&E&&!d.some(e=>(0,g.c8)(e,E)&&!(0,Pe.u0)(e)),l=t===x.y.VPN_SITE_TO_SITE&&E&&!d.some(e=>(0,g.c8)(e,E)&&(0,Pe.u0)(e));return n.createElement(h.A,{portal:!0,description:a||i||l?n.createElement(A.sA,{id:"SETTINGS_SECURITY_NO_NETWORKS_FOR_ZONE_TOOLTIP"}):null,key:`source_matching_target_${t}`},n.createElement($.A,{type:"radio",name:"source_matching_target",value:t,disabled:e||a||i||l},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:fe[t]}))))}))};var Ge=a(712050),we=a(784045),Fe=a(424226),Ue=a(852866),ke=a(573531),ze=a(703447),Ve=a(618721),We=a(951106);const xe=e=>(0,Ue.c)((0,We.tn)(e)||e.mac,35)||ke.L,He=({disabled:e})=>{const{formatMessage:t}=(0,A.tz)(),{values:a,setFieldValue:r}=(0,l.j7)(),o=(0,i.useSelector)(S.Cw),s=(0,i.useSelector)(Ve.g),_=o.find(e=>e._id===a.source_zone_id),c=(0,n.useMemo)(()=>{const e=a.source_client_macs.filter(e=>!s.some(t=>t.mac===e)),[i,l]=(0,Ge.A)((0,we.A)(s,[e=>(0,We.tn)(e),e=>e.mac]),e=>e.network_id&&_?.network_ids.includes(e.network_id)),r=[];return i.length>0&&(r.push({id:"__zone_devices_section__",title:t({id:"SETTINGS_FIREWALL_RULE_ZONE_DEVICES"}),type:"SECTION"}),i.forEach(e=>{r.push({id:e.mac,title:xe(e),children:[],type:"CHECKBOX",checkboxProps:{data:e.mac,symbol:n.createElement(ze.A,{client:e,width:20,height:20})}})})),(l.length>0||e.length>0)&&(r.push({id:"__other_devices_section__",title:t({id:"SETTINGS_FIREWALL_RULE_OTHER_DEVICES"}),type:"SECTION"}),l.forEach(e=>{r.push({id:e.mac,title:xe(e),children:[],type:"CHECKBOX",checkboxProps:{data:e.mac,symbol:n.createElement(ze.A,{client:e,width:20,height:20})}})}),e.forEach(e=>{r.push({id:e,title:xe({mac:e}),children:[],type:"CHECKBOX",checkboxProps:{data:e,symbol:n.createElement(ze.A,{client:{mac:e},width:20,height:20})}})})),r},[_?.network_ids,s,a.source_client_macs,t]),d=(0,n.useMemo)(()=>new Set(a.source_client_macs),[a.source_client_macs]),E=(0,n.useCallback)(e=>{const t="all"===e?c.filter(e=>"CHECKBOX"===e.type).map(e=>e.id):Array.from(e);r("source_client_macs",t)},[c,r]);return n.createElement(be.A,{items:c,selectedKeys:d,onSelectionChange:E,disabled:e,defaultExpanded:0===a.source_client_macs.length,fieldName:"source_client_macs",editSelectionIcon:n.createElement(Fe.A,{size:"original"}),localizationTexts:{EDIT_SELECTION_LABEL:t({id:"COMMON_ACTION_SELECT_DEVICES"})}})};var Be=a(155212),Ke=a(867500),Xe=a(302396),je=a(242366),$e=a(713882);const qe=({disabled:e})=>{const{formatMessage:t}=(0,A.tz)(),{values:a,setFieldValue:r}=(0,l.j7)(),{users:o=[],groups:s=[]}=(0,i.useSelector)($e.T),_=(0,n.useMemo)(()=>o.filter(e=>e.unique_id),[o]),c=(0,n.useMemo)(()=>s.filter(e=>e.unique_id),[s]),d=(0,n.useMemo)(()=>new Set(_.map(e=>e.unique_id)),[_]),E=(0,n.useMemo)(()=>{const e=[];return c.length>0&&(e.push({id:"__roles_section__",title:t({id:"COMMON_ROLES"}),type:"SECTION"}),c.forEach(t=>{e.push({id:t.unique_id,title:t.name,children:[],type:"CHECKBOX"})})),e.push({id:"__people_section__",title:t({id:"COMMON_PEOPLE"}),type:"SECTION"}),(0,we.A)(_.map(e=>{const t=e.full_name||e.unique_id;return{id:e.unique_id,title:t,children:[],type:"CHECKBOX",checkboxProps:{symbol:n.createElement(Ke.A,{acronym:(0,Be.A)(t),size:20,image:e.avatar_url,shape:"square",alt:t})}}}),e=>e.title).forEach(t=>{e.push(t)}),e},[_,c,t]),m=(0,n.useMemo)(()=>new Set([...a.source_identity_users,...a.source_identity_groups]),[a.source_identity_users,a.source_identity_groups]),I=(0,n.useCallback)(e=>{const t="all"===e?E.filter(e=>"CHECKBOX"===e.type).map(e=>e.id):Array.from(e);r("source_identity_users",t.filter(e=>d.has(String(e)))),r("source_identity_groups",t.filter(e=>!d.has(String(e))))},[E,d,r]);return n.createElement(je.A,null,n.createElement(be.A,{items:E,selectedKeys:m,onSelectionChange:I,disabled:e,defaultExpanded:!(a.source_identity_users.length>0||a.source_identity_groups.length>0),fieldName:"source_identity_users",editSelectionIcon:n.createElement(Xe.A,null),localizationTexts:{EDIT_SELECTION_LABEL:t({id:"COMMON_ACTION_SELECT_PEOPLE_OR_ROLES"})}}))},Je=({disabled:e})=>{const t=(0,i.useSelector)(S.Cw),a=(0,i.useSelector)(S.Av),r=(0,i.useSelector)(C.xK),o=(0,i.useSelector)(le.Uv),s=(0,i.useSelector)(re.YX),{formatMessage:_}=(0,A.tz)(),{values:{ip_version:c,source_zone_id:d,source_matching_target:E,source_matching_target_type:m,source_port_matching_type:I,source_ip_match_mac:T},setFieldValue:u}=(0,l.j7)(),p=(0,n.useMemo)(()=>t.filter(e=>e.zone_key!==O.o.GATEWAY).map(({_id:e,name:t,zone_key:a})=>({label:a?_({id:ee.F[a]}):t,value:e,labelClassName:Q.F})),[t,_]),N=t.find(({_id:e})=>e===d),M=(0,n.useMemo)(()=>(0,g.SH)(o,a),[o,a]),R=(0,n.useCallback)(e=>{u("source_ip_mac",(0,Z.Z)(e.currentTarget?.value))},[u]);return n.createElement(n.Fragment,null,n.createElement(y.A,{flexDirection:"column",gap:b.kc,width:"100%"},n.createElement(_e,{disabled:e,fieldName:"source_zone_id",options:p,onFieldChange:()=>{u("source_matching_target",r.source.matching_target),u("source_matching_target_type",r.source.matching_target_type),u("source_network_ids",[])}}),n.createElement(Ye,{disabled:e}),N?.zone_key===O.o.VPN&&E!==x.y.VPN_SERVER&&s?n.createElement(Ce,null):null,E===x.y.CLIENT?n.createElement(He,{disabled:e}):null,E===x.y.VPN_USER?n.createElement($.A,{disabled:e,name:"source_wireguard_user_ids",options:M,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0}):null,E===x.y.NETWORK?n.createElement(Le,{name:"source_network_ids",disabled:e}):null,E===x.y.VPN_SERVER?n.createElement(Le,{name:"source_vpn_server_ids",disabled:e}):null,E===x.y.VPN_SITE_TO_SITE?n.createElement(ge,{disabled:e}):null,[x.y.NETWORK,x.y.VPN_SERVER].includes(E)?n.createElement(Ne,{disabled:e,name:"source_match_opposite_networks",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_NETWORKS_DESCRIPTION"}):null,E===x.y.IP?n.createElement(n.Fragment,null,n.createElement(Ie,{disabled:e,fieldName:"source_matching_target_type"}),m===W.qv.SPECIFIC?n.createElement(n.Fragment,null,n.createElement(ne.A,{disabled:e,fieldName:"source_ips",labels:{fieldLabel:"SETTINGS_IP_ADDRESS_SUBNET",modalTitle:"SETTINGS_ADD_MULTIPLE_IPS",modalFieldPlaceholder:_({id:"SETTINGS_ADD_MULTIPLE_IPS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>_({id:"SETTINGS_DUPLICATE_IP_VALIDATION"}),validate:e=>(0,g.GH)(c,e,!0)},extraFieldConfig:{placeholder:"SETTINGS_IP_SUBNET_RANGE",placeholderValues:{version:c}}})):null,m===W.qv.OBJECT?n.createElement(ie.A,{disabled:e,name:"source_ip_group_id",types:Me.$d,getDisabledReason:(0,g.Xe)(c)}):null,m===W.qv.IID?n.createElement(n.Fragment,null,n.createElement(Te.A,{disabled:e,name:"source_iid"}),n.createElement(Ne,{disabled:e,name:"source_match_opposite_iid",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})):n.createElement(Ne,{disabled:e,name:"source_match_opposite_ips",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})):null,[x.y.IP,x.y.NETWORK].includes(E)&&N?.zone_key!==O.o.VPN?n.createElement(y.A,{flexDirection:"column",width:"100%",gap:b.kc},n.createElement(Ne,{disabled:e,name:"source_ip_match_mac",labelId:"SETTINGS_MATCH_MAC_ADDRESS",descriptionId:"SETTINGS_MATCH_MAC_ADDRESS_DESCRIPTION"}),T?n.createElement($.A,{disabled:e,type:"text",name:"source_ip_mac",variant:"secondary",placeholder:"COMMON_PLACEHOLDER_EG",placeholderValues:{value:"ab:cd:ef:12:34:56"},translatePlaceholder:!0,onChange:R}):null):null,E===x.y.MAC?n.createElement(ne.A,{disabled:e,fieldName:"source_macs",labels:{fieldLabel:"COMMON_MAC_ADDRESS",modalTitle:"SETTINGS_SECURITY_ADD_MULTIPLE_MACS",modalFieldPlaceholder:_({id:"SETTINGS_SECURITY_MULTIPLE_MACS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>_({id:"SETTINGS_SECURITY_VALIDATION_DUPLICATE_MACS"}),validate:e=>!!e?.match(se.b8)||n.createElement(A.sA,{id:"COMMON_VALIDATION_VALID_MAC"})},extraFieldConfig:{parser:(...e)=>(0,Z.Z)(e?.[0]?.[0].target?.value),placeholder:"COMMON_PLACEHOLDER_EG",placeholderValues:{value:"ab:cd:ef:12:34:56"}}}):null,E===x.y.USER_IDENTITY?n.createElement(qe,{disabled:e}):null,E===x.y.REGION?n.createElement($.A,{type:"picklist",name:"source_regions",options:te.Ay,triggerButtonText:"COMMON_SELECT",maxSelections:te.xn}):null,n.createElement(Ee,{disabled:e,fieldName:"source_port_matching_type",radioOptions:Me.o5}),I===W.rl.SPECIFIC?n.createElement(ae.A,{customPortFieldName:"source_port",serviceFieldName:"source_port_service"}):null,I===W.rl.OBJECT?n.createElement(ie.A,{disabled:e,name:"source_port_group_id",types:[oe.B.PORT_GROUP]}):null,I!==W.rl.ANY?n.createElement(Ne,{disabled:e,name:"source_match_opposite_ports",labelId:"SETTINGS_MATCH_OPPOSITE_PORT",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_PORTS_DESCRIPTION"}):null))};var Ze=a(189643),Qe=a(705228),et=a(679783);const tt=({disabled:e})=>{const{values:{protocol:t,ip_version:a}}=(0,l.j7)(),{formatMessage:i}=(0,A.tz)(),r=(0,n.useMemo)(()=>(0,g.uj)(a,i,e,t),[a,i,e,t]),o=Me.Fb.map(e=>({label:(0,g.EH)(e),value:e})),s=Me.DT.map(e=>({label:(0,g.EH)(e),value:e})),_=!Me.vm.includes(t);return n.createElement(y.A,{flexDirection:"column",width:"100%"},n.createElement(et.A,{label:n.createElement(A.sA,{id:"COMMON_PROTOCOL"}),tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_PROTOCOL_DESCRIPTION"})}),n.createElement(y.A,{flexDirection:"column",gap:b.kc,width:"100%"},n.createElement(y.A,{gap:b.Ln,rowGap:b.YC,paddingTop:b.YC,paddingBottom:b.YC,alignItems:"center",flexWrap:"wrap"},n.createElement($.A,{type:"radio",name:"protocol",value:Ze.aS.ALL,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_ALL"}))),n.createElement($.A,{type:"radio",name:"protocol",value:Ze.aS.TCP_UDP,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_TCP_AND_UDP"}))),n.createElement($.A,{type:"radio",name:"protocol",value:Ze.aS.TCP,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_TCP"}))),n.createElement($.A,{type:"radio",name:"protocol",value:Ze.aS.UDP,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_UDP"}))),n.createElement($.A,{type:"radio",name:"protocol",value:"",disabled:e,checked:_},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_CUSTOM"})))),_?n.createElement(y.A,{flexDirection:"column",width:Qe.ng},n.createElement($.A,{type:"dropdown",variant:"secondary",name:"protocol",options:r,disabled:e,renderOption:g.in,full:!0,sortedDropdown:!0,searchable:!0,validated:!0,value:t})):null,t===Ze.aS.ICMP?n.createElement(y.A,{flexDirection:"column",width:Qe.ng},n.createElement($.A,{type:"dropdown",variant:"secondary",label:n.createElement(A.sA,{id:"COMMON_IPV4_ICMP_TYPE_NAME"}),name:"icmp_typename",options:o,disabled:e,full:!0,sortedDropdown:!0,searchable:!0,translateOptions:!0,validated:!0})):null,t===Ze.aS.ICMPV6?n.createElement(y.A,{flexDirection:"column",width:Qe.ng},n.createElement($.A,{type:"dropdown",variant:"secondary",label:n.createElement(A.sA,{id:"COMMON_IPV6_ICMP_TYPE_NAME"}),name:"icmp_v6_typename",options:s,disabled:e,full:!0,sortedDropdown:!0,searchable:!0,translateOptions:!0,validated:!0})):null,Me.hA.includes(t)?null:n.createElement(y.A,{alignItems:"center",gap:b.YC,minHeight:j.b},n.createElement($.A,{type:"realCheckbox",name:"match_opposite_protocol",disabled:e},n.createElement(A.sA,{id:"COMMON_MATCH_OPPOSITE"})),n.createElement(h.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_MATCH_OPPOSITE_PROTOCOL_DESCRIPTION"}),portal:!0,isInteractive:!0,style:{display:"flex",alignItems:"center"}},n.createElement(de.A,{size:"original",isActive:!0}))),t===Ze.aS.NUMBER?n.createElement($.A,{type:"number",width:168,variant:"secondary",name:"protocol_number",min:Me.uY,max:Me.yz,disabled:e,placeholder:"SETTINGS_SECURITY_PROTOCOL_NUMBER_PLACEHOLDER",translatePlaceholder:!0}):null))},at=({disabled:e})=>{const{setSharedName:t}=(0,P.H5)(),{setFieldValue:a}=(0,l.j7)();return n.createElement($.A,{full:!0,maxLength:Me.aC,name:"name",variant:"secondary",disabled:e,label:n.createElement(A.sA,{id:"COMMON_NAME"}),onChange:e=>{t(e.target.value),a("name",e.target.value)}})},it=({disabled:e})=>{const{values:{match_ip_sec:t}}=(0,l.j7)();return n.createElement(y.A,{flexDirection:"column",width:"100%"},n.createElement(y.A,{alignItems:"center",gap:b.YC,minHeight:j.b},n.createElement($.A,{type:"realCheckbox",name:"match_ip_sec",disabled:e},n.createElement(A.sA,{id:"COMMON_MATCH_IPSEC"})),n.createElement(h.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_MATCH_IPSEC_DESCRIPTION",values:{link:n.createElement(f.A,{href:G.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),isInteractive:!0,portal:!0},n.createElement(K.A,{isActive:!0,size:"original"}))),t?n.createElement(y.A,{gap:b.Ln,rowGap:b.YC,flexWrap:"wrap",alignItems:"center",paddingTop:b.YC,paddingBottom:b.YC},n.createElement($.A,{type:"radio",name:"match_ip_sec_type",value:W.kz.MATCH_IPSEC,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"SETTINGS_SECURITY_ENCRYPTED"}))),n.createElement($.A,{type:"radio",name:"match_ip_sec_type",value:W.kz.MATCH_NON_IPSEC,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"SETTINGS_SECURITY_NOT_ENCRYPTED"})))):null)};var nt=a(711748);const lt=({disabled:e})=>{const{values:{ip_version:t,protocol:a,source_matching_target:r,source_matching_target_type:o,source_ip_group_id:s,source_ips:_,destination_matching_target:c,destination_matching_target_type:d,destination_ip_group_id:E,destination_ips:m},setFieldValue:I}=(0,l.j7)(),T=(0,i.useSelector)(nt.O9),u=(0,n.useMemo)(()=>(0,g.Ry)({ip_version:t,protocol:a,source_matching_target:r,source_matching_target_type:o,source_ip_group_id:s,source_ips:_,destination_matching_target:c,destination_matching_target_type:d,destination_ip_group_id:E,destination_ips:m},T,e),[e,T,t,a,r,o,s,_,c,d,E,m]),O=(0,n.useCallback)(e=>{I("ip_version",e),e!==W.oi.IPV6&&(c===H.f.IP&&d===W.qv.IID&&I("destination_matching_target_type",W.qv.SPECIFIC),r===x.y.IP&&o===W.qv.IID&&I("source_matching_target_type",W.qv.SPECIFIC))},[c,d,r,o,I]);return n.createElement(y.A,{flexDirection:"column",width:"100%"},n.createElement(et.A,{label:n.createElement(A.sA,{id:"COMMON_IP_VERSION"}),tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_IP_VERSION_DESCRIPTION"})}),n.createElement(y.A,{gap:b.Ln,paddingTop:b.YC,paddingBottom:b.YC,flexWrap:"wrap",rowGap:b.YC},u.map(e=>n.createElement(h.A,{description:e.disabled?e.tooltipDescription:void 0,portal:!0,key:e.value},n.createElement($.A,{type:"radio",name:"ip_version",value:e.value,disabled:e.disabled,onChange:()=>O(e.value)},n.createElement(y.A,{alignItems:"center",gap:b.kc},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:e.label})),e.invalidProtocolWarning))))))};var rt=a(305721),ot=a(915752),st=a(854318);const _t=({disabled:e})=>{const{formatMessage:t}=(0,A.tz)(),{values:{destination_zone_id:a,destination_vpn_site_to_site_id:r}}=(0,l.j7)(),o=(0,i.useSelector)(S.Cw),s=(0,i.useSelector)(S.Av),_=(0,n.useMemo)(()=>o.find(({_id:e})=>e===a),[o,a]),c=(0,n.useMemo)(()=>s.filter(e=>e._id===r||_&&(0,g.c8)(e,_)&&(0,Pe.u0)(e)).map(e=>({label:e.name,value:e._id,additionalInfo:e.sdwan_hub_spoke_local_wan_id?(0,Re.qY)(e.sdwan_hub_spoke_local_wan_id,t):e.ip})),[s,r,_,t]);return n.createElement(y.A,{flexDirection:"column",width:"100%"},n.createElement($.A,{disabled:e,name:"destination_vpn_site_to_site_id",validated:!0,options:c,type:"dropdown",full:!0,variant:"secondary"}))},ct={[H.f.ANY]:"COMMON_ANY",[H.f.NETWORK]:"COMMON_NETWORK",[H.f.VPN_SERVER]:"COMMON_SERVER",[H.f.VPN_SITE_TO_SITE]:"SETTINGS_NETWORKS_FORM_FIELD_VPN_TYPE_SITE_TO_SITE",[H.f.IP]:"COMMON_IP",[H.f.APP]:"COMMON_APP",[H.f.REGION]:"COMMON_REGION",[H.f.WEB]:"COMMON_DOMAIN",[H.f.APP_CATEGORY]:"COMMON_CATEGORY",[H.f.VPN_USER]:"COMMON_USER"},dt=[H.f.ANY,H.f.IP],Et=[H.f.ANY,H.f.APP,H.f.IP,H.f.WEB,H.f.REGION],mt=[H.f.ANY,H.f.VPN_SERVER,H.f.VPN_SITE_TO_SITE,H.f.IP],At=[H.f.ANY,H.f.NETWORK,H.f.IP],It=({disabled:e})=>{const{values:t}=(0,l.j7)(),a=(0,i.useSelector)(S.Cw),r=(0,i.useSelector)(S.Av),o=(0,n.useMemo)(()=>a.find(e=>e._id===t.destination_zone_id),[t.destination_zone_id,a]),s=(0,n.useMemo)(()=>o?o.zone_key===O.o.GATEWAY?dt:o.zone_key===O.o.EXTERNAL?Et:o.zone_key===O.o.VPN?mt:At:[H.f.ANY],[o]);return n.createElement(Ae.A,null,s.map(t=>{const a=t===H.f.NETWORK&&o&&!r.some(e=>(0,g.c8)(e,o)),i=t===H.f.VPN_SERVER&&o&&!r.some(e=>(0,g.c8)(e,o)&&!(0,Pe.u0)(e)),l=t===H.f.VPN_SITE_TO_SITE&&o&&!r.some(e=>(0,g.c8)(e,o)&&(0,Pe.u0)(e));let s;return a||l||i?s=n.createElement(A.sA,{id:"SETTINGS_SECURITY_NO_NETWORKS_FOR_ZONE_TOOLTIP"}):t===H.f.NETWORK?s=n.createElement(A.sA,{id:"SETTINGS_SECURITY_DESTINATION_NETWORK_DESCRIPTION",values:{link:n.createElement(f.A,{href:G.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}):t===H.f.IP&&(s=n.createElement(A.sA,{id:"SETTINGS_SECURITY_DESTINATION_IP_DESCRIPTION",values:{link:n.createElement(f.A,{href:G.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}})),n.createElement(h.A,{key:`destination_matching_target_${t}`,portal:!0,description:s},n.createElement($.A,{type:"radio",name:"destination_matching_target",value:t,disabled:e||a||i||l},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:ct[t]}))))}))},Tt=({disabled:e,name:t})=>{const{formatMessage:a}=(0,A.tz)(),{values:r}=(0,l.j7)(),o=(0,i.useSelector)(S.Cw),s=(0,i.useSelector)(S.Av),_=o.find(({_id:e})=>e===r.destination_zone_id),c=(0,l.O6)(r,t),d=(0,n.useMemo)(()=>s.filter(e=>c.includes(e._id)||_&&(0,g.c8)(e,_)&&!(0,Pe.u0)(e)).map(e=>({label:e.name,value:e._id,additionalInfo:e.sdwan_hub_spoke_local_wan_id?(0,Re.qY)(e.sdwan_hub_spoke_local_wan_id,a):e.ip})),[s,c,_,a]);return n.createElement($.A,{disabled:e,name:t,options:d,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0})},ut=({disabled:e})=>n.createElement(y.A,{gap:b.Ln,height:j.b,alignItems:"center"},n.createElement($.A,{type:"radio",name:"destination_app_type",value:H.f.APP,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_SPECIFIC"}))),n.createElement($.A,{type:"radio",name:"destination_app_type",value:H.f.APP_CATEGORY,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:"COMMON_CATEGORY"})))),Ot=({disabled:e})=>{const t=(0,i.useSelector)(S.Cw),a=(0,i.useSelector)(re.YX),r=(0,i.useSelector)(S.Av),o=(0,i.useSelector)(C.xK),s=(0,i.useSelector)(le.Uv),{formatMessage:_}=(0,A.tz)(),{values:{ip_version:c,destination_matching_target:d,destination_matching_target_type:E,destination_port_matching_type:m,destination_app_type:I,destination_zone_id:T},setFieldValue:u}=(0,l.j7)(),p=(0,n.useMemo)(()=>t.map(({_id:e,name:t,zone_key:a})=>({label:a?_({id:ee.F[a]}):t,value:e,labelClassName:Q.F})),[t,_]),N=(0,n.useMemo)(()=>(0,g.SH)(s,r),[s,r]),M=(0,n.useMemo)(()=>t.find(e=>e._id===T),[T,t]);return n.createElement(n.Fragment,null,n.createElement(y.A,{flexDirection:"column",gap:b.kc,width:"100%"},n.createElement(_e,{disabled:e,fieldName:"destination_zone_id",options:p,onFieldChange:()=>{u("destination_matching_target",o.destination.matching_target),u("destination_matching_target_type",o.destination.matching_target_type),u("destination_network_ids",[])}}),n.createElement(It,{disabled:e}),M?.zone_key===O.o.VPN&&d!==H.f.VPN_SERVER&&a?n.createElement(Ce,null):null,d===H.f.APP?n.createElement(n.Fragment,null,n.createElement(ut,{disabled:e}),I===H.f.APP?n.createElement(rt.A,{fieldName:"destination_app_ids"}):n.createElement(ot.A,{fieldName:"destination_app_category_ids"})):null,d===H.f.VPN_USER?n.createElement($.A,{disabled:e,name:"destination_wireguard_user_ids",options:N,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0}):null,d===H.f.NETWORK?n.createElement(Tt,{disabled:e,name:"destination_network_ids"}):null,d===H.f.VPN_SERVER?n.createElement(Tt,{disabled:e,name:"destination_vpn_server_ids"}):null,d===H.f.VPN_SITE_TO_SITE?n.createElement(_t,{disabled:e}):null,[H.f.NETWORK,H.f.VPN_SERVER].includes(d)?n.createElement(Ne,{disabled:e,name:"destination_match_opposite_networks",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_NETWORKS_DESCRIPTION"}):null,d===H.f.IP?n.createElement(n.Fragment,null,n.createElement(Ie,{disabled:e,fieldName:"destination_matching_target_type"}),E===W.qv.SPECIFIC?n.createElement(ne.A,{disabled:e,fieldName:"destination_ips",labels:{fieldLabel:"SETTINGS_IP_ADDRESS_SUBNET",modalTitle:"SETTINGS_ADD_MULTIPLE_IPS",modalFieldPlaceholder:_({id:"SETTINGS_ADD_MULTIPLE_IPS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>_({id:"SETTINGS_DUPLICATE_IP_VALIDATION"}),validate:e=>(0,g.GH)(c,e,!0)},extraFieldConfig:{placeholder:"SETTINGS_IP_SUBNET_RANGE",placeholderValues:{version:c}}}):null,E===W.qv.OBJECT?n.createElement(ie.A,{disabled:e,name:"destination_ip_group_id",types:Me.$d,getDisabledReason:(0,g.Xe)(c)}):null,E===W.qv.IID?n.createElement(n.Fragment,null,n.createElement(Te.A,{disabled:e,name:"destination_iid"}),n.createElement(Ne,{disabled:e,name:"destination_match_opposite_iid",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})):n.createElement(Ne,{disabled:e,name:"destination_match_opposite_ips",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})):null,d===H.f.REGION?n.createElement($.A,{type:"picklist",name:"destination_regions",options:te.Ay,triggerButtonText:"COMMON_SELECT",maxSelections:te.xn}):null,d===H.f.WEB?n.createElement(ne.A,{disabled:e,fieldName:"destination_web_domains",labels:{fieldLabel:"COMMON_DOMAIN",modalTitle:"SETTINGS_ADD_MULTIPLE_DOMAINS",modalFieldPlaceholder:_({id:"SETTINGS_ADD_MULTIPLE_DOMAINS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>_({id:"SETTINGS_SECURITY_DOMAINS_VALIDATION"}),validate:e=>!!e?.match(se.yA)||(e?.startsWith(st.n4)?n.createElement(A.sA,{id:"SETTINGS_SECURITY_DOMAINS_WILDCARD_VALIDATION"}):n.createElement(A.sA,{id:"COMMON_DOMAIN_VALIDATION"}))},extraFieldConfig:{placeholder:"SETTINGS_SECURITY_DOMAINS_PLACEHOLDER"}}):null,d!==H.f.APP?n.createElement(n.Fragment,null,n.createElement(Ee,{disabled:e,fieldName:"destination_port_matching_type",radioOptions:Me.o5}),m===W.rl.SPECIFIC?n.createElement(ae.A,{customPortFieldName:"destination_port",serviceFieldName:"destination_port_service"}):null,m===W.rl.OBJECT?n.createElement(ie.A,{disabled:e,name:"destination_port_group_id",types:[oe.B.PORT_GROUP]}):null,m!==W.rl.ANY?n.createElement(Ne,{disabled:e,name:"destination_match_opposite_ports",labelId:"SETTINGS_MATCH_OPPOSITE_PORT",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_PORTS_DESCRIPTION"}):null):null))},St=a(132196).AH`
  flex-direction: column;
  > span {
    position: static;
    transform: none;
  }
`,pt=({disabled:e})=>n.createElement($.A,{type:"textarea",name:"description",variant:"secondary",disabled:e,resize:!1,className:St,rows:3,full:!0,label:n.createElement(et.A,{label:n.createElement(A.sA,{id:"COMMON_DESCRIPTION"}),tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_FIREWALL_DESCRIPTION"})})});var Ct=a(86838),Nt=a(79760),Mt=a(418543);const Rt=[W.KN.NEW,W.KN.INVALID,W.KN.ESTABLISHED,W.KN.RELATED],Pt=({disabled:e})=>{const{values:{connection_state_type:t,connection_states:a},setFieldValue:i,errors:r,touched:o,submitCount:s}=(0,l.j7)(),_=(0,n.useCallback)(({currentTarget:{id:e,checked:t}})=>{i("connection_states",t?[...a,e]:a.filter(t=>t!==e))},[a,i]),c=(0,Nt.t$)("connection_states",r,o,s);return n.createElement(y.A,{flexDirection:"column",width:"100%"},n.createElement(et.A,{label:n.createElement(A.sA,{id:"COMMON_CONNECTION_STATE"}),tooltipProps:{isInteractive:!0},tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_CONNECTION_STATE_DESCRIPTION",values:{link:n.createElement(f.A,{href:G.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}})}),n.createElement(y.A,{flexDirection:"column"},n.createElement(y.A,{gap:b.Ln,rowGap:b.YC,paddingTop:b.YC,paddingBottom:b.YC,minHeight:j.b,alignItems:"center",flexWrap:"wrap"},n.createElement($.A,{type:"radio",name:"connection_state_type",value:W.kU.ALL,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:Mt.ER[W.kU.ALL]}))),n.createElement($.A,{type:"radio",name:"connection_state_type",value:W.kU.RESPOND_ONLY,disabled:e},n.createElement(y.A,{alignItems:"center",gap:b.YC},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:Mt.ER[W.kU.RESPOND_ONLY]})),n.createElement(h.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_RETURN_TRAFFIC_DESCRIPTION",values:{link:n.createElement(f.A,{href:G.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),portal:!0,isInteractive:!0,style:{display:"flex",alignItems:"center"}},n.createElement(de.A,{size:"original",isActive:!0})))),n.createElement($.A,{type:"radio",name:"connection_state_type",value:W.kU.CUSTOM,disabled:e},n.createElement(ce.A,{size:"inherit",color:"inherit"},n.createElement(A.sA,{id:Mt.ER[W.kU.CUSTOM]})))),t===W.kU.CUSTOM?n.createElement(y.A,{flexDirection:"column",width:"100%"},n.createElement(y.A,{gap:b.Ln,rowGap:b.YC,paddingTop:b.YC,paddingBottom:b.YC,minHeight:j.b,alignItems:"center",flexWrap:"wrap"},Rt.map(e=>n.createElement($.A,{key:e,name:e,type:"realCheckbox",checked:a.includes(e),onChange:_},n.createElement(A.sA,{id:Mt.VE[e]})))),c?n.createElement(Ct.A,{style:{padding:0},isInvalid:!0,label:c}):null):null))},gt=({disabled:e})=>{const{values:t}=(0,l.j7)(),a=(0,i.useSelector)(S.Cw),r=!(0,g.oS)(t,a),o=a.find(e=>e._id===t.destination_zone_id);return n.createElement(y.A,{flexDirection:"column",width:"100%",gap:b.kc},n.createElement(y.A,{flexDirection:"row",gap:b.Ln,minHeight:j.b,alignItems:"center"},n.createElement($.A,{type:"radio",name:"action",value:W.Dl.BLOCK,disabled:e},n.createElement(A.sA,{id:"COMMON_ACTION_BLOCK"})),n.createElement($.A,{type:"radio",name:"action",value:W.Dl.ALLOW,disabled:e},n.createElement(A.sA,{id:"COMMON_ACTION_ALLOW"})),n.createElement(y.A,{alignItems:"center",gap:b.YC},n.createElement($.A,{type:"radio",name:"action",value:W.Dl.REJECT,disabled:e},n.createElement(A.sA,{id:"SETTINGS_SECURITY_REJECT"})),n.createElement(h.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_FIREWALL_REJECT_DESCRIPTION"}),portal:!0,style:{display:"flex",alignItems:"center"}},n.createElement(de.A,{size:"original",isActive:!0})))),t.action===W.Dl.ALLOW?n.createElement(y.A,{minHeight:j.b,alignItems:"center",gap:b.YC},n.createElement(h.A,{description:r?n.createElement(A.sA,{id:o?.zone_key===O.o.EXTERNAL?"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DISABLED_EXTERNAL":o?.zone_key===O.o.GATEWAY?"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DISABLED_GATEWAY":"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DISABLED",values:{link:n.createElement(f.A,{id:"COMMON_LEARN_MORE",noWrap:!0,href:G.A.firewallPolicies})}}):null,isInteractive:!0,portal:!0},n.createElement($.A,{type:"realCheckbox",name:"create_allow_respond",disabled:r,checked:!r&&void 0},n.createElement(A.sA,{id:"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC"}))),n.createElement(h.A,{description:n.createElement(A.sA,{id:"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DESCRIPTION",values:{link:n.createElement(f.A,{href:G.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),isInteractive:!0,portal:!0},n.createElement(de.A,{size:"original",isActive:!0}))):null)};var ht=a(329109),bt=a(734707);const Lt=({id:e,disabled:t})=>{const a=(0,i.useDispatch)();return n.createElement(bt.Ay,{disabled:t,type:"button",variant:"link",size:"medium",onClick:async()=>{await a((0,N.Ad)([{_id:e,enabled:!0}])),a((0,N.fn)())}},n.createElement(A.sA,{id:"COMMON_ACTION_RESUME"}))},ft=({name:e,id:t})=>{const a=(0,i.useDispatch)(),[l,r]=(0,n.useState)(!1);return n.createElement(z.A,{isOpen:l,title:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_TITLE",titleValues:{count:1},buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",body:n.createElement(A.sA,{id:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_SINGLE_MESSAGE",values:{name:e}}),handleCancel:()=>r(!1),handleConfirm:async()=>{await a((0,N.Ee)([t])),a((0,N.fn)()),a((0,p.WO)()),r(!1),a((0,E.K5)())},handleClose:()=>r(!1),rootClose:!0},n.createElement(bt.Ay,{type:"button",variant:"link",size:"medium",onClick:()=>r(!0)},n.createElement(ce.A,{variant:"inherit",color:"destructive"},n.createElement(A.sA,{id:"COMMON_ACTION_REMOVE"}))))},yt=({name:e,id:t})=>{const a=(0,i.useDispatch)(),[l,r]=(0,n.useState)(!1);return n.createElement(z.A,{isOpen:l,title:"SETTINGS_SECURITY_PAUSE_FIREWALL_POLICY_TITLE",titleValues:{count:1},buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",body:n.createElement(A.sA,{id:"SETTINGS_SECURITY_PAUSE_FIREWALL_POLICY_MESSAGE_SINGLE",values:{name:e}}),handleCancel:()=>{r(!1)},handleConfirm:async()=>{await a((0,N.Ad)([{_id:t,enabled:!1}])),a((0,N.fn)()),r(!1)},handleClose:()=>{r(!1)},rootClose:!0},n.createElement(bt.Ay,{type:"button",variant:"link",onClick:()=>r(!0)},n.createElement(A.sA,{id:"COMMON_ACTION_PAUSE"})))};var vt=a(998386);const Dt=({existingRecord:e})=>n.createElement(pe.A,null,n.createElement(y.A,{flexDirection:"column"},n.createElement(A.sA,{id:"COMMON_MANAGED_BY_FABRIC",values:{feature:n.createElement(A.sA,{id:"COMMON_FIREWALL_POLICY"})}}),n.createElement(f.A,{id:"COMMON_VIEW_IN_SITE_MANAGER",href:(0,vt.vF)(e?.cloud_template),noWrap:!0}))),Yt="firewallPolicyForm",Gt=({disabled:e,existingRecord:t,typeSelector:a})=>{const{resetForm:r,handleSubmit:o,dirty:s,isSubmitting:_,submitForm:c,values:d,isValid:E}=(0,l.j7)(),m=!(!(0,i.useSelector)(Y.kD)||!(0,D.B)(d.destination_matching_target)),{sharedName:I}=(0,P.H5)();return n.createElement("form",{onSubmit:o,style:{height:"100%"},id:Yt},n.createElement(w.A,{isDisabled:!!t&&(0,F.A)(t)},n.createElement(y.A,{flexDirection:"column",gap:b.xO,width:"100%",overflow:"hidden"},n.createElement(L.A,null,t&&(0,F.A)(t)?n.createElement(Dt,{existingRecord:t}):null,a,n.createElement(at,{disabled:e})),n.createElement(L.A,{title:n.createElement(A.sA,{id:"COMMON_SOURCE_ZONE"}),tooltipProps:{isInteractive:!0},tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_SOURCE_ZONE_DESCRIPTION",values:{link:n.createElement(f.A,{href:G.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}})},n.createElement(Je,{disabled:e})),n.createElement(L.A,{title:n.createElement(A.sA,{id:"COMMON_ACTION"}),tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_FIREWALL_ACTION_DESCRIPTION"})},n.createElement(gt,{disabled:e})),n.createElement(L.A,{title:n.createElement(A.sA,{id:"COMMON_DESTINATION_ZONE"}),tooltip:n.createElement(A.sA,{id:"SETTINGS_SECURITY_DESTINATION_ZONE_DESCRIPTION",values:{link:n.createElement(f.A,{href:G.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),tooltipProps:{isInteractive:!0}},n.createElement(Ot,{disabled:e})),n.createElement(L.A,null,n.createElement(lt,{disabled:e}),n.createElement(tt,{disabled:e}),n.createElement(Pt,{disabled:e}),n.createElement(it,{disabled:e}),n.createElement(J,{disabled:e}),n.createElement(k.A,{disabled:e}),n.createElement(pt,{disabled:e})),e||!t||(0,F.A)(t)?null:n.createElement(v.A,{type:v.I.BUTTON_LIST},n.createElement(U.R,null,!t.enabled||m?n.createElement(h.A,{portal:!0,description:m?n.createElement(A.sA,{id:"SETTINGS_APP_BLOCKING_IDENTIFICATION_DISABLED_ROW_DESCRIPTION"}):null},n.createElement(Lt,{id:t._id,disabled:m})):n.createElement(yt,{name:t.name||"",id:t._id})),n.createElement(U.R,null,n.createElement(ft,{name:t.name||"",id:t._id}))))),n.createElement(ht.A,{onFormCancel:r,allowCancel:s,applyButton:n.createElement(B,{isDisabled:e,isExistingRecord:!!t,isLoading:_,submitForm:c,values:d,form:Yt},n.createElement(A.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})),isDirty:s||Boolean(I),isSubmitting:_,isInvalid:!E}))},wt=({activeItem:e,typeSelector:t})=>{const a=e?._id===R.R6?void 0:e,{formatMessage:h}=(0,A.tz)(),b=(0,i.useDispatch)(),L=(0,i.useSelector)(u.EL),f=(0,i.useSelector)(S.Cw),y=(0,i.useSelector)(T.Ct),v=(0,i.useSelector)(C.xK),D=(0,c.A)(M.Xj.FIREWALL_SCHEDULING_AFTER_2038),{sharedName:Y}=(0,P.H5)(),G=(0,n.useMemo)(()=>a?.source?.zone_id||e?.source?.zone_id||f.find(e=>e.zone_key===O.o.INTERNAL)?._id||"",[e?.source?.zone_id,a?.source?.zone_id,f]),w=(0,n.useMemo)(()=>a?.destination?.zone_id||e?.destination?.zone_id||f.find(e=>e.zone_key===O.o.EXTERNAL)?._id||"",[e?.destination?.zone_id,a?.destination?.zone_id,f]),F=(0,n.useMemo)(()=>new Date,[]),U=(0,n.useMemo)(()=>(0,g.xE)(v,G,w,a,f,y,F,Y),[v,G,w,a,f,y,F,Y]),k=(0,n.useMemo)(()=>(0,g.tH)(f,h,D),[h,f,D]),z=(0,n.useCallback)((e,{setSubmitting:t,resetForm:i})=>(t(!0),b((0,N.Vh)((0,g.GJ)(a,e,f),void 0,{fetchConfig:{getAllPostData:!0}})).then(async e=>(await b((0,N.fn)(void 0,{resolveWithExisting:!1})),e)).then(t=>{b((0,E.SQ)(!1)),b((0,E.XP)({type:d.H.CUSTOM_FIREWALL_POLICY,id:t._id})),b((0,p.WO)()),i({values:e})}).catch(e=>{const t=(0,s.F)(e)?e:void 0;b((0,m.ox)({icon:o.C.danger,message:"SETTINGS_UNABLE_TO_APPLY_CHANGES",errorMessage:t?.msg}))}).finally(()=>t(!1))),[b,a,f]);return(0,n.useEffect)(()=>{a?._id&&a?._id!==R.R6&&b((0,N.L9)(a?._id))},[b,a?._id]),(0,n.useEffect)(()=>{b((0,I.mW)(void 0,{crudCacheStrategy:{type:r.e.CACHE}}))},[b]),n.createElement(l.l1,{initialValues:U,onSubmit:z,validationSchema:k},n.createElement(n.Fragment,null,n.createElement(_.A,null),n.createElement(Gt,{existingRecord:a,disabled:L,typeSelector:t})))}},405349(e,t,a){a.d(t,{F:()=>i});const i=a(132196).AH`
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
`},400261(e,t,a){a.d(t,{Z:()=>n});var i=a(546391);const n=e=>e?e.replace(i.SD,"").replace(i.fA,"$&:").substring(0,17).toLowerCase():e}}]);