"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[63939],{800655(e,i,s){s.d(i,{A:()=>o});var t=s(602086),n=s(59831),a=s(472889),l=s(244137),d=s(713035);const o=t.forwardRef((e,i)=>{const{size:s="medium",shape:o="square",image:_,alt:r,acronym:c,acronymBackground:A,fallbackImage:E,style:I,className:T,motif:O,"data-testid":u}=e,{motif:p}=(0,d.A)(O);return(0,t.useMemo)(()=>{const e={size:s,shape:o};return _||c?"string"==typeof _?(r||console.error("Alt is required for Avatar image."),t.createElement(a.A,{src:_,alt:null!=r?r:"Avatar","data-testid":u,style:I,className:T,...e,ref:i})):c?t.createElement(l.A,{ref:i,size:s,shape:o,motif:p,acronym:c,backgroundColor:A}):t.createElement(a.A,{ref:i,style:I,"data-testid":u,className:T,...e},_):(r||console.error("Alt is required for Avatar image."),t.createElement(n.A,{alt:null!=r?r:"Avatar",fallbackImage:E,"data-testid":u,motif:p,ref:i,style:I,className:T,...e}))},[s,o,_,c,I,u,T,i,r,p,A,E])});o.displayName="Avatar_Static"},727609(e,i,s){s.d(i,{T:()=>o});var t=s(222102),n=s(15989),a=s(401042),l=s(558156);const d=(0,n.uh)((0,l.v)()),o=(0,t.Mz)(d,a.i6)},274484(e,i,s){s.d(i,{JT:()=>d,Uv:()=>A,_O:()=>r,cl:()=>_});var t=s(222102),n=s(15989),a=s(401042),l=s(380359);const d=e=>(0,t.Mz)((0,n.uh)((0,l.RU)(e)),a.kh),o=(0,t.Mz)((0,n.uh)((0,l.UC)()),a.i6),_=(0,t.Mz)(o,e=>e.available_ports||[]),r=(0,t.Mz)((0,n.uh)((0,l.WV)()),a.i6),c=(0,t.Mz)((0,n.uh)((0,l.go)()),a.kh),A=(0,t.Mz)(c,e=>e.map(e=>({_id:e._id,name:e.name,interface_ip:e.interface_ip,network_id:e.network_id})))},853136(e,i,s){s.d(i,{B:()=>n});var t=s(139847);const n=e=>[t.$P.APP,t.$P.APP_CATEGORY].includes(e)},555612(e,i,s){s.d(i,{A:()=>c});var t=s(274934),n=s(602086),a=s(281572),l=s(711950),d=s(247816),o=s(470070),_=s(669439);const r=(0,d.A)(l.A)`
  color: #ffffff;
`,c=(0,n.memo)(({isDisabled:e,showLoader:i,showWarning:s,showWarningIcon:n,warning:l,label:d="COMMON_ACTION_APPLY_CHANGES",onSubmit:c,form:A})=>(0,t.jsx)(_.A,{description:s?l??(0,t.jsx)(o.sA,{id:"COMMON_FORM_CHANGES_TRIGGER_PROVISION"}):null,children:(0,t.jsx)(a.A,{disabled:e,type:"submit",onClick:c,variant:"primary",Icon:s||n?(0,t.jsx)(r,{variant:"fill"}):null,loader:i?"loading":void 0,form:A,children:(0,t.jsx)(o.sA,{id:d})})}))},652347(e,i,s){s.d(i,{A:()=>d});var t=s(274934),n=s(843871),a=s(399935),l=s(318087);const d=({fieldName:e,validationMessageProps:i={}})=>{const{errors:s,touched:d,submitCount:o}=(0,n.j7)(),_=(0,l.t$)(e,s,d,o);return _?(0,t.jsx)(a.A,{isInvalid:!0,style:{padding:0},...i,label:_}):null}},317263(e,i,s){s.d(i,{A:()=>c});var t=s(274934),n=s(602086),a=s(843871),l=s(297305),d=s(717218),o=s(179102),_=s(309130),r=s(652347);const c=({fieldName:e,items:i,selected:s,transform:c,onChange:A,disabled:E,defaultExpanded:I,isExpanded:T,onExpandedChange:O,shouldCollapseOnInteractOutside:u,editSelectionIcon:p,localizationTexts:C,isVirtualized:N,hasSelectAllControl:S})=>{const{setFieldValue:m}=(0,a.j7)(),h=(0,n.useMemo)(()=>new Set(s),[s]),x=(0,n.useCallback)(s=>{const t="all"===s?(e=>e.filter(e=>"CHECKBOX"===e.type).map(e=>e.id))(i):Array.from(s),n=c?c(t):t;A?A(n):m(e,n)},[e,i,c,A,m]),j=(0,n.useMemo)(()=>i.filter(e=>"CHECKBOX"===e.type&&!e.checkboxProps?.isDisabled).map(e=>e.id),[i]),M=(0,n.useMemo)(()=>new Set(i.flatMap(e=>"CHECKBOX"===e.type&&e.checkboxProps?.isDisabled?[e.id]:[])),[i]),g=(0,n.useMemo)(()=>{const e=new Map;return i.forEach(i=>{"CHECKBOX"===i.type&&e.set(i.id,i.title)}),e},[i]),R=(0,n.useMemo)(()=>{const e=new Map;return i.forEach(i=>{"CHECKBOX"===i.type&&i.checkboxProps?.symbol&&e.set(i.id,i.checkboxProps.symbol)}),e},[i]),P=(0,n.useCallback)(()=>{x(new Set(j))},[x,j]),b=(0,n.useCallback)(()=>{x(new Set)},[x]),f=(0,n.useCallback)(()=>j.length>0&&h.size>=j.length,[j,h]),L=(0,n.useMemo)(()=>s.filter(e=>g.has(e)).map(e=>(0,t.jsx)(d.A,{isDisabled:E,style:E?{opacity:_.xN}:void 0,symbol:R.get(e),children:(0,t.jsx)(o.A,{color:"text-1",children:g.get(e)})},e)),[E,s,R,g]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.A,{items:i,selectedKeys:h,setSelectedKeys:x,onSelectionChange:x,onSelectAll:P,onDeselectAll:b,isAllSelected:f,chips:L,isDisabled:E,defaultExpanded:I,isExpanded:T,onExpandedChange:O,shouldCollapseOnInteractOutside:u,editSelectionIcon:p,localizationTexts:C,isVirtualized:N,hasSelectAllControl:S,treeProps:M.size>0?{disabledKeys:M}:void 0}),(0,t.jsx)(r.A,{fieldName:e})]})}},721398(e,i,s){s.d(i,{A:()=>d});var t=s(274934),n=s(548941),a=s(247368),l=s(470070);const d=({messageId:e,tooltipClassName:i,values:s,isInteractive:d,portal:o,variant:_="twoTone",size:r="medium"})=>(0,t.jsx)(n.A,{description:(0,t.jsx)(l.sA,{id:e,values:s}),width:210,isInteractive:d,portal:o,tooltipClassName:i,children:(0,t.jsx)(a.A,{isActive:!0,omitSvgMargin:!0,variant:_,size:r})})},956731(e,i,s){s.d(i,{A:()=>A,R:()=>c});var t=s(274934),n=s(505817),a=s(247816),l=s(669439),d=s(309130),o=s(100978),_=s(721398);const r=(0,a.A)(o.A)`
  flex-direction: column;
  height: ${48}px;
  border-bottom: ${({theme:{themeName:e}})=>n.Ay[`desktop-border-divider-${e}`]};
  padding: ${d.xO} 0;
  position: relative;
  .tooltip-position-fixer {
    margin-right: -${d.Ln};
  }
`,c=({tooltipId:e,disabledTooltip:i,children:s,tooltipProps:n={},...a})=>(0,t.jsx)(r,{...a,children:(0,t.jsxs)(o.A,{justifyContent:"space-between",alignItems:"center",children:[(0,t.jsx)(l.A,{description:i,placement:"left",children:(0,t.jsx)("span",{children:s})}),e?(0,t.jsx)(_.A,{messageId:e,tooltipClassName:"tooltip-position-fixer",variant:"outline",...n}):null]})}),A=c},663939(e,i,s){s.d(i,{A:()=>ki});var t=s(274934),n=s(977872),a=s(602086),l=s(843871),d=s(244081),o=s(159469),_=s(464920),r=s(593091),c=s(871808),A=s(449339),E=s(205521),I=s(700444),T=s(470070),O=s(427017),u=s(197571),p=s(897166),C=s(758698),N=s(149149),S=s(740190),m=s(655424),h=s(757637),x=s(95857),j=s(969288),M=s(420174),g=s(443444),R=s(548941),P=s(309130),b=s(756782),f=s(793442),L=s(100978),y=s(535322),v=s(853136),D=s(291935),Y=s(726831),G=s(877840),w=s(6276),F=s(956731),k=s(914049),U=s(250266),z=s(555612),V=s(139847),W=s(367148),H=s(371401);const B=({isDisabled:e,isLoading:i,isExistingRecord:s,values:l,submitForm:d,form:o})=>{const _=(0,n.d4)(N.Cw),r=(0,a.useMemo)(()=>_.find(e=>e.zone_key===C.o.GATEWAY),[_]),c=(0,a.useMemo)(()=>_.find(e=>e.zone_key===C.o.EXTERNAL),[_]),A=l.action===V.Dl.BLOCK||l.action===V.Dl.REJECT,E=A&&l.source_matching_target===W.y.ANY&&l.destination_matching_target===H.f.ANY&&l.source_port_matching_type===V.rl.ANY&&l.destination_port_matching_type===V.rl.ANY,I=A&&l.source_matching_target===W.y.ANY&&l.destination_matching_target===H.f.ANY&&!!l.destination_zone_id&&l.destination_zone_id===r?._id,O=E&&!!l.destination_zone_id&&l.destination_zone_id===c?._id,u=I||E||O,p=(0,a.useMemo)(()=>{let e="";return I?e="SETTINGS_SECURITY_POLICY_BLOCK_GATEWAY_CONFIRM_TITLE":O?e="SETTINGS_SECURITY_POLICY_BLOCK_INTERNET_CONFIRM_TITLE":E&&(e="SETTINGS_SECURITY_POLICY_BLOCK_TRAFFIC_CONFIRM_TITLE"),e},[I,O,E]),S=(0,a.useMemo)(()=>{let e="";return I?e="SETTINGS_SECURITY_POLICY_BLOCK_GATEWAY_CONFIRM_MESSAGE":O?e="SETTINGS_SECURITY_POLICY_BLOCK_INTERNET_CONFIRM_MESSAGE":E&&(e="SETTINGS_SECURITY_POLICY_BLOCK_TRAFFIC_CONFIRM_MESSAGE"),e},[I,O,E]),[m,h]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{m&&!u&&h(!1)},[m,u]),(0,t.jsx)(U.A,{isOpen:m,handleConfirm:()=>{h(!1),d()},handleCancel:()=>h(!1),handleClose:()=>h(!1),rootClose:!0,buttonVariant:"danger",buttonMessage:"COMMON_ACTION_PROCEED",title:p,body:(0,t.jsx)("div",{children:(0,t.jsx)(T.sA,{id:S,values:{link:(0,t.jsx)(f.A,{id:"COMMON_LEARN_MORE",noWrap:!0,href:Y.A.firewallPolicies})}})}),children:(0,t.jsx)(z.A,{isDisabled:e,showLoader:i,showWarningIcon:u,label:s?"COMMON_ACTION_APPLY_CHANGES":"SETTINGS_SECURITY_ADD_POLICY",form:o,onSubmit:e=>{u&&(e.preventDefault(),e.stopPropagation(),h(!0))}})})};var K=s(830990),q=s(43506),X=s(833466),$=s(120197),J=s(502129);const Z=({disabled:e})=>{const i=(0,q.A)(`${j.bB}/${j.Uy.TRAFFIC_LOGGING}`);return(0,t.jsx)(L.A,{alignItems:"center",minHeight:X.b,children:(0,t.jsxs)(L.A,{alignItems:"center",gap:P.YC,children:[(0,t.jsx)($.A,{type:"realCheckbox",name:"logging",disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_SYSLOG_LOGGING"})}),(0,t.jsx)(R.A,{isInteractive:!0,portal:!0,description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_SYSLOG_LOGGING_DESCRIPTION",values:{link:(0,t.jsx)(J.A,{to:i,style:{whiteSpace:"nowrap"},children:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_SYSLOG_LOGGING_DESCRIPTION_LINK_TEXT"})})}}),children:(0,t.jsx)(K.A,{size:"original",isActive:!0})})]})})};var Q=s(489714),ee=s(29218),ie=s(374309),se=s(625796),te=s(713942),ne=s(9306),ae=s(923898),le=s(274484),de=s(909790),oe=s(277822),_e=s(570866);const re=({disabled:e,fieldName:i,options:s,onFieldChange:n})=>{const{setFieldValue:d}=(0,l.j7)(),o=(0,a.useCallback)(e=>{d(i,e.value),n()},[d,i,n]);return(0,t.jsx)($.A,{type:"dropdown",variant:"secondary",name:i,options:s,disabled:e,onChange:o,full:!0})};var ce=s(179102),Ae=s(247368);const Ee=({disabled:e,fieldName:i,radioOptions:s})=>(0,t.jsxs)(L.A,{flexDirection:"column",children:[(0,t.jsxs)(L.A,{alignItems:"center",gap:P.YC,children:[(0,t.jsx)(ce.A,{size:"small",color:"text-3",children:(0,t.jsx)(T.sA,{id:"COMMON_PORT"})}),(0,t.jsx)(R.A,{description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_PORT_DESCRIPTION"}),portal:!0,style:{display:"flex",alignItems:"center"},children:(0,t.jsx)(Ae.A,{size:"original",isActive:!0})})]}),(0,t.jsx)(L.A,{gap:P.Ln,height:X.b,alignItems:"center",children:s.map(s=>(0,t.jsx)($.A,{type:"radio",name:i,value:s.value,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:s.label})})},`${i}_${s.value}`))})]});var Ie=s(787481),Te=s(846294);const Oe=({disabled:e,fieldName:i,hideIid:s=!1})=>{const{values:n}=(0,l.j7)(),a=n.ip_version===V.oi.IPV6,d=(0,c.A)(x.Xj.IPV6_INTERFACE_IDENTIFIER_FOR_FIREWALL_FILTER);return(0,t.jsxs)(Ie.A,{children:[(0,t.jsx)($.A,{type:"radio",name:i,value:V.qv.SPECIFIC,disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_SPECIFIC"})}),(0,t.jsx)($.A,{type:"radio",name:i,value:V.qv.OBJECT,disabled:e,children:(0,t.jsx)(T.sA,{id:"SETTINGS_LIST"})}),!s&&d?(0,t.jsx)(Te.A,{reason:a?void 0:(0,t.jsx)(T.sA,{id:"SETTINGS_IPV6_INTERFACE_ID_DISABLED_TOOLTIP"}),children:(0,t.jsx)("div",{children:(0,t.jsx)($.A,{type:"radio",name:i,value:V.qv.IID,disabled:e,tooltipMessage:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_ZONE_IPV6_INTERFACE_ID_TOOLTIP"}),children:(0,t.jsx)(T.sA,{id:"SETTINGS_IPV6_INTERFACE_ID"})})})}):null]})};var ue=s(277130),pe=s(505817),Ce=s(711950),Ne=s(263705),Se=s(753959);const me=()=>{const{themeName:e}=(0,Ne.u)();return(0,t.jsx)(Se.A,{icon:(0,t.jsx)(Ce.A,{variant:"fill",size:"original",color:pe.Ay[`desktop-color-orange-06-${e}`]}),children:(0,t.jsx)(T.sA,{id:"SETTINGS_POLICY_WILL_NOT_APPLY_WITH_SSL_INSPECTION",values:{link:(0,t.jsx)(f.A,{id:"COMMON_LEARN_MORE",href:Y.A.firewallPolicies,noWrap:!0})}})})},he=({disabled:e,name:i,labelId:s,descriptionId:n})=>(0,t.jsx)(L.A,{minHeight:X.b,alignItems:"center",children:(0,t.jsx)($.A,{disabled:e,type:"realCheckbox",name:i,tooltipMessage:(0,t.jsx)(T.sA,{id:n}),tooltipProps:{portal:!0,style:{display:"flex",alignItems:"center"}},children:(0,t.jsx)(L.A,{alignItems:"center",gap:P.YC,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:s})})})})});var xe=s(211932),je=s(733360),Me=s(423564);const ge=({disabled:e})=>{const{formatMessage:i}=(0,T.tz)(),{values:{source_zone_id:s,source_vpn_site_to_site_id:d}}=(0,l.j7)(),o=(0,n.d4)(N.Av),_=(0,n.d4)(N.Cw),r=(0,a.useMemo)(()=>_.find(({_id:e})=>e===s),[s,_]),c=(0,a.useMemo)(()=>o.filter(e=>d===e._id||r&&(0,g.c8)(e,r)&&(0,Me.u0)(e)).map(e=>({label:e.name,value:e._id,additionalInfo:e.sdwan_hub_spoke_local_wan_id?(0,je.qY)(e.sdwan_hub_spoke_local_wan_id,i):e.ip})),[o,i,r,d]);return(0,t.jsx)(L.A,{flexDirection:"column",width:"100%",children:(0,t.jsx)($.A,{disabled:e,name:"source_vpn_site_to_site_id",validated:!0,options:c,type:"dropdown",full:!0,variant:"secondary"})})};var Re=s(106005),Pe=s(317263);const be=({disabled:e,name:i})=>{const{formatMessage:s}=(0,T.tz)(),{values:d}=(0,l.j7)(),o=(0,n.d4)(N.Av),_=(0,n.d4)(N.Cw),r=(0,a.useMemo)(()=>_.find(({_id:e})=>e===d.source_zone_id),[d.source_zone_id,_]),c=(0,l.O6)(d,i),A=(0,a.useMemo)(()=>o.filter(e=>c.includes(e._id)||r&&(0,g.c8)(e,r)&&!(0,Me.u0)(e)),[c,o,r]),E=(0,a.useMemo)(()=>A.map(e=>({id:e._id,title:e.name,children:[],type:"CHECKBOX",checkboxProps:{data:e.sdwan_hub_spoke_local_wan_id?(0,je.qY)(e.sdwan_hub_spoke_local_wan_id,s):e.ip}})),[A,s]);return(0,t.jsx)(Pe.A,{fieldName:i,items:E,selected:c,disabled:e,defaultExpanded:0===c.length,editSelectionIcon:(0,t.jsx)(Re.A,{}),localizationTexts:{EDIT_SELECTION_LABEL:s({id:"COMMON_ACTION_SELECT_NETWORKS"})}})},fe={[W.y.ANY]:"COMMON_ANY",[W.y.CLIENT]:"COMMON_DEVICE",[W.y.NETWORK]:"COMMON_NETWORK",[W.y.VPN_SERVER]:"COMMON_SERVER",[W.y.VPN_SITE_TO_SITE]:"SETTINGS_NETWORKS_FORM_FIELD_VPN_TYPE_SITE_TO_SITE",[W.y.IP]:"COMMON_IP",[W.y.MAC]:"COMMON_MAC",[W.y.VPN_USER]:"COMMON_USER",[W.y.REGION]:"COMMON_REGION",[W.y.USER_IDENTITY]:"COMMON_IDENTITY"},Le=[W.y.ANY,W.y.VPN_SERVER,W.y.VPN_SITE_TO_SITE,W.y.IP],ye=[W.y.ANY,W.y.IP,W.y.MAC,W.y.REGION],ve=[W.y.ANY,W.y.CLIENT,W.y.NETWORK,W.y.IP,W.y.MAC],De=({disabled:e})=>{const{values:i}=(0,l.j7)(),s=(0,c.A)(x.Xj.FIREWALL_USER_IDENTITY_SUPPORT),d=(0,c.A)(x.Xj.ULP_FIREWALL_IDENTITY_SUPPORT),o=(0,c.A)(x.Xj.ONE_CLICK_VPN_FIREWALL_IDENTITY_SUPPORT),_=s&&d,r=(0,n.d4)(N.Cw),A=(0,n.d4)(N.Av),E=(0,a.useMemo)(()=>r.find(e=>e._id===i.source_zone_id),[i.source_zone_id,r]),I=(0,a.useMemo)(()=>{if(!E)return[W.y.ANY];let e=[];return E.zone_key===C.o.GATEWAY?[]:(E.zone_key===C.o.VPN&&(e=[...Le]),E.zone_key===C.o.EXTERNAL&&(e=[...ye]),e.length||(e=[...ve]),_&&(E.zone_key===C.o.INTERNAL||!E.default_zone||E.zone_key===C.o.VPN&&o)&&(e=[...e,W.y.USER_IDENTITY]),e)},[E,_,o]);return(0,t.jsx)(L.A,{gap:P.xO,rowGap:P.YC,paddingTop:P.YC,paddingBottom:P.YC,alignItems:"center",flexWrap:"wrap",children:I.map(i=>{const s=i===W.y.NETWORK&&E&&!A.some(e=>(0,g.c8)(e,E)),n=i===W.y.VPN_SERVER&&E&&!A.some(e=>(0,g.c8)(e,E)&&!(0,Me.u0)(e)),a=i===W.y.VPN_SITE_TO_SITE&&E&&!A.some(e=>(0,g.c8)(e,E)&&(0,Me.u0)(e));return(0,t.jsx)(R.A,{portal:!0,description:s||n||a?(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_NO_NETWORKS_FOR_ZONE_TOOLTIP"}):null,children:(0,t.jsx)($.A,{type:"radio",name:"source_matching_target",value:i,disabled:e||s||n||a,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:fe[i]})})})},`source_matching_target_${i}`)})})};var Ye=s(508659),Ge=s(117948),we=s(507718),Fe=s(415537),ke=s(254590),Ue=s(650632),ze=s(287196),Ve=s(831433),We=s(46497),He=s(506770);const Be=20,Ke=e=>(0,Fe.c)((0,Ve.tn)(e)||e.mac,35)||ke.L,qe=({disabled:e})=>{const{formatMessage:i}=(0,T.tz)(),{values:s}=(0,l.j7)(),d=(0,n.d4)(N.Cw),o=(0,n.d4)(ze.g),_=d.find(e=>e._id===s.source_zone_id),r=(0,a.useMemo)(()=>{const e=s.source_client_macs.filter(e=>!o.some(i=>i.mac===e)),[n,a]=(0,Ye.A)((0,Ge.A)(o,[e=>(0,Ve.tn)(e),e=>e.mac]),e=>e.network_id&&_?.network_ids.includes(e.network_id)),l=[];return n.length>0&&(l.push({id:"__zone_devices_section__",title:i({id:"SETTINGS_FIREWALL_RULE_ZONE_DEVICES"}),type:"SECTION"}),n.forEach(e=>{l.push({id:e.mac,title:Ke(e),children:[],type:"CHECKBOX",checkboxProps:{data:(0,t.jsx)(We.A,{mac:e?.mac}),symbol:(0,t.jsx)(Ue.A,{client:e,width:Be,height:Be})}})})),(a.length>0||e.length>0)&&(l.push({id:"__other_devices_section__",title:i({id:"SETTINGS_FIREWALL_RULE_OTHER_DEVICES"}),type:"SECTION"}),a.forEach(e=>{l.push({id:e.mac,title:Ke(e),children:[],type:"CHECKBOX",checkboxProps:{data:(0,t.jsx)(We.A,{mac:e.mac}),symbol:(0,t.jsx)(Ue.A,{client:e,width:Be,height:Be})}})}),e.forEach(e=>{l.push({id:e,title:Ke({mac:e}),children:[],type:"CHECKBOX",checkboxProps:{data:(0,t.jsx)(We.A,{mac:e}),symbol:(0,t.jsx)(Ue.A,{client:{mac:e},width:Be,height:Be})}})})),l},[_?.network_ids,o,s.source_client_macs,i]),c=(0,a.useMemo)(()=>(0,Ve.rd)(s.source_client_macs),[s.source_client_macs]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Pe.A,{fieldName:"source_client_macs",items:r,selected:s.source_client_macs,disabled:e,defaultExpanded:0===s.source_client_macs.length,editSelectionIcon:(0,t.jsx)(we.A,{size:"original"}),localizationTexts:{EDIT_SELECTION_LABEL:i({id:"COMMON_ACTION_SELECT_DEVICES"})}}),c?(0,t.jsx)(He.A,{}):null]})};var Xe=s(562829),$e=s(800655),Je=s(985368),Ze=s(89469),Qe=s(727609);const ei=({disabled:e})=>{const{formatMessage:i}=(0,T.tz)(),{values:s,setFieldValue:d}=(0,l.j7)(),{users:o=[],groups:_=[]}=(0,n.d4)(Qe.T),r=(0,a.useMemo)(()=>o.filter(e=>e.unique_id),[o]),c=(0,a.useMemo)(()=>_.filter(e=>e.unique_id),[_]),A=(0,a.useMemo)(()=>new Set(r.map(e=>e.unique_id)),[r]),E=(0,a.useMemo)(()=>{const e=[];return c.length>0&&(e.push({id:"__roles_section__",title:i({id:"COMMON_ROLES"}),type:"SECTION"}),c.forEach(i=>{e.push({id:i.unique_id,title:i.name,children:[],type:"CHECKBOX"})})),e.push({id:"__people_section__",title:i({id:"COMMON_PEOPLE"}),type:"SECTION"}),(0,Ge.A)(r.map(e=>{const i=e.full_name||e.unique_id;return{id:e.unique_id,title:i,children:[],type:"CHECKBOX",checkboxProps:{symbol:(0,t.jsx)($e.A,{acronym:(0,Xe.A)(i),size:20,image:e.avatar_url,shape:"square",alt:i})}}}),e=>e.title).forEach(i=>{e.push(i)}),e},[r,c,i]),I=(0,a.useMemo)(()=>[...s.source_identity_users,...s.source_identity_groups],[s.source_identity_users,s.source_identity_groups]),O=(0,a.useCallback)(e=>{d("source_identity_users",e.filter(e=>A.has(String(e)))),d("source_identity_groups",e.filter(e=>!A.has(String(e))))},[A,d]);return(0,t.jsx)(Ze.A,{children:(0,t.jsx)(Pe.A,{fieldName:"source_identity_users",items:E,selected:I,onChange:O,disabled:e,defaultExpanded:!(s.source_identity_users.length>0||s.source_identity_groups.length>0),editSelectionIcon:(0,t.jsx)(Je.A,{}),localizationTexts:{EDIT_SELECTION_LABEL:i({id:"COMMON_ACTION_SELECT_PEOPLE_OR_ROLES"})}})})},ii=({disabled:e})=>{const i=(0,n.d4)(N.Cw),s=(0,n.d4)(N.Av),d=(0,n.d4)(m.xK),o=(0,n.d4)(le.Uv),_=(0,n.d4)(de.YX),{formatMessage:r}=(0,T.tz)(),{values:{ip_version:c,source_zone_id:A,source_matching_target:E,source_matching_target_type:I,source_port_matching_type:O,source_ip_match_mac:u},setFieldValue:p}=(0,l.j7)(),S=(0,a.useMemo)(()=>i.filter(e=>e.zone_key!==C.o.GATEWAY).map(({_id:e,name:i,zone_key:s})=>({label:s?r({id:ie.F[s]}):i,value:e,labelClassName:ee.F})),[i,r]),h=i.find(({_id:e})=>e===A),x=(0,a.useMemo)(()=>(0,g.SH)(o,s),[o,s]),j=(0,a.useCallback)(e=>{p("source_ip_mac",(0,Q.Z)(e.currentTarget?.value))},[p]);return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(L.A,{flexDirection:"column",gap:P.kc,width:"100%",children:[(0,t.jsx)(re,{disabled:e,fieldName:"source_zone_id",options:S,onFieldChange:()=>{p("source_matching_target",d.source.matching_target),p("source_matching_target_type",d.source.matching_target_type),p("source_network_ids",[])}}),(0,t.jsx)(De,{disabled:e}),h?.zone_key===C.o.VPN&&E!==W.y.VPN_SERVER&&_?(0,t.jsx)(me,{}):null,E===W.y.CLIENT?(0,t.jsx)(qe,{disabled:e}):null,E===W.y.VPN_USER?(0,t.jsx)($.A,{disabled:e,name:"source_wireguard_user_ids",options:x,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0}):null,E===W.y.NETWORK?(0,t.jsx)(be,{name:"source_network_ids",disabled:e}):null,E===W.y.VPN_SERVER?(0,t.jsx)(be,{name:"source_vpn_server_ids",disabled:e}):null,E===W.y.VPN_SITE_TO_SITE?(0,t.jsx)(ge,{disabled:e}):null,[W.y.NETWORK,W.y.VPN_SERVER].includes(E)?(0,t.jsx)(he,{disabled:e,name:"source_match_opposite_networks",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_NETWORKS_DESCRIPTION"}):null,E===W.y.IP?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Oe,{disabled:e,fieldName:"source_matching_target_type"}),I===V.qv.SPECIFIC?(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(ae.A,{disabled:e,fieldName:"source_ips",labels:{fieldLabel:"SETTINGS_IP_ADDRESS_SUBNET",modalTitle:"SETTINGS_ADD_MULTIPLE_IPS",modalFieldPlaceholder:r({id:"SETTINGS_ADD_MULTIPLE_IPS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>r({id:"SETTINGS_DUPLICATE_IP_VALIDATION"}),validate:e=>(0,g.GH)(c,e,!0,r)},extraFieldConfig:{placeholder:"SETTINGS_IP_SUBNET_RANGE",placeholderValues:{version:c}}})}):null,I===V.qv.OBJECT?(0,t.jsx)(ne.A,{disabled:e,name:"source_ip_group_id",types:xe.$d,getDisabledReason:(0,g.Xe)(c)}):null,I===V.qv.IID?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ue.A,{disabled:e,name:"source_iid"}),(0,t.jsx)(he,{disabled:e,name:"source_match_opposite_iid",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})]}):(0,t.jsx)(he,{disabled:e,name:"source_match_opposite_ips",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})]}):null,[W.y.IP,W.y.NETWORK].includes(E)&&h?.zone_key!==C.o.VPN?(0,t.jsxs)(L.A,{flexDirection:"column",width:"100%",gap:P.kc,children:[(0,t.jsx)(he,{disabled:e,name:"source_ip_match_mac",labelId:"SETTINGS_MATCH_MAC_ADDRESS",descriptionId:"SETTINGS_MATCH_MAC_ADDRESS_DESCRIPTION"}),u?(0,t.jsx)($.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:j}):null]}):null,E===W.y.MAC?(0,t.jsx)(ae.A,{disabled:e,fieldName:"source_macs",labels:{fieldLabel:"COMMON_MAC_ADDRESS",modalTitle:"SETTINGS_SECURITY_ADD_MULTIPLE_MACS",modalFieldPlaceholder:r({id:"SETTINGS_SECURITY_MULTIPLE_MACS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>r({id:"SETTINGS_SECURITY_VALIDATION_DUPLICATE_MACS"}),validate:e=>!!e?.match(_e.b8)||r({id:"COMMON_VALIDATION_VALID_MAC"})},extraFieldConfig:{parser:(...e)=>(0,Q.Z)(e?.[0]?.[0].target?.value),placeholder:"COMMON_PLACEHOLDER_EG",placeholderValues:{value:"ab:cd:ef:12:34:56"}}}):null,E===W.y.USER_IDENTITY?(0,t.jsx)(ei,{disabled:e}):null,E===W.y.REGION?(0,t.jsx)($.A,{type:"picklist",name:"source_regions",options:se.Ay,triggerButtonText:"COMMON_SELECT",maxSelections:se.xn}):null,(0,t.jsx)(Ee,{disabled:e,fieldName:"source_port_matching_type",radioOptions:xe.o5}),O===V.rl.SPECIFIC?(0,t.jsx)(te.A,{customPortFieldName:"source_port",serviceFieldName:"source_port_service"}):null,O===V.rl.OBJECT?(0,t.jsx)(ne.A,{disabled:e,name:"source_port_group_id",types:[oe.B.PORT_GROUP]}):null,O!==V.rl.ANY?(0,t.jsx)(he,{disabled:e,name:"source_match_opposite_ports",labelId:"SETTINGS_MATCH_OPPOSITE_PORT",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_PORTS_DESCRIPTION"}):null]})})};var si=s(834700),ti=s(486061),ni=s(277660);const ai=({disabled:e})=>{const{values:{protocol:i,ip_version:s}}=(0,l.j7)(),{formatMessage:n}=(0,T.tz)(),d=(0,a.useMemo)(()=>(0,g.uj)(s,n,e,i),[s,n,e,i]),o=xe.Fb.map(e=>({label:(0,g.EH)(e),value:e})),_=xe.DT.map(e=>({label:(0,g.EH)(e),value:e})),r=!xe.vm.includes(i);return(0,t.jsxs)(L.A,{flexDirection:"column",width:"100%",children:[(0,t.jsx)(ni.A,{label:(0,t.jsx)(T.sA,{id:"COMMON_PROTOCOL"}),tooltip:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_PROTOCOL_DESCRIPTION"})}),(0,t.jsxs)(L.A,{flexDirection:"column",gap:P.kc,width:"100%",children:[(0,t.jsxs)(L.A,{gap:P.Ln,rowGap:P.YC,paddingTop:P.YC,paddingBottom:P.YC,alignItems:"center",flexWrap:"wrap",children:[(0,t.jsx)($.A,{type:"radio",name:"protocol",value:si.aS.ALL,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:"COMMON_ALL"})})}),(0,t.jsx)($.A,{type:"radio",name:"protocol",value:si.aS.TCP_UDP,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:"COMMON_TCP_AND_UDP"})})}),(0,t.jsx)($.A,{type:"radio",name:"protocol",value:si.aS.TCP,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:"COMMON_TCP"})})}),(0,t.jsx)($.A,{type:"radio",name:"protocol",value:si.aS.UDP,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:"COMMON_UDP"})})}),(0,t.jsx)($.A,{type:"radio",name:"protocol",value:"",disabled:e,checked:r,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:"COMMON_CUSTOM"})})})]}),r?(0,t.jsx)(L.A,{flexDirection:"column",width:ti.ng,children:(0,t.jsx)($.A,{type:"dropdown",variant:"secondary",name:"protocol",options:d,disabled:e,renderOption:g.in,full:!0,sortedDropdown:!0,searchable:!0,validated:!0,value:i})}):null,i===si.aS.ICMP?(0,t.jsx)(L.A,{flexDirection:"column",width:ti.ng,children:(0,t.jsx)($.A,{type:"dropdown",variant:"secondary",label:(0,t.jsx)(T.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,i===si.aS.ICMPV6?(0,t.jsx)(L.A,{flexDirection:"column",width:ti.ng,children:(0,t.jsx)($.A,{type:"dropdown",variant:"secondary",label:(0,t.jsx)(T.sA,{id:"COMMON_IPV6_ICMP_TYPE_NAME"}),name:"icmp_v6_typename",options:_,disabled:e,full:!0,sortedDropdown:!0,searchable:!0,translateOptions:!0,validated:!0})}):null,xe.hA.includes(i)?null:(0,t.jsxs)(L.A,{alignItems:"center",gap:P.YC,minHeight:X.b,children:[(0,t.jsx)($.A,{type:"realCheckbox",name:"match_opposite_protocol",disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_MATCH_OPPOSITE"})}),(0,t.jsx)(R.A,{description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_MATCH_OPPOSITE_PROTOCOL_DESCRIPTION"}),portal:!0,isInteractive:!0,style:{display:"flex",alignItems:"center"},children:(0,t.jsx)(Ae.A,{size:"original",isActive:!0})})]}),i===si.aS.NUMBER?(0,t.jsx)($.A,{type:"number",width:168,variant:"secondary",name:"protocol_number",min:xe.uY,max:xe.yz,disabled:e,placeholder:"SETTINGS_SECURITY_PROTOCOL_NUMBER_PLACEHOLDER",translatePlaceholder:!0}):null]})]})},li=({disabled:e})=>{const{setSharedName:i}=(0,M.H5)(),{setFieldValue:s}=(0,l.j7)();return(0,t.jsx)($.A,{full:!0,maxLength:xe.aC,name:"name",variant:"secondary",disabled:e,label:(0,t.jsx)(T.sA,{id:"COMMON_NAME"}),onChange:e=>{i(e.target.value),s("name",e.target.value)}})},di=({disabled:e})=>{const{values:{match_ip_sec:i}}=(0,l.j7)();return(0,t.jsxs)(L.A,{flexDirection:"column",width:"100%",children:[(0,t.jsxs)(L.A,{alignItems:"center",gap:P.YC,minHeight:X.b,children:[(0,t.jsx)($.A,{type:"realCheckbox",name:"match_ip_sec",disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_MATCH_IPSEC"})}),(0,t.jsx)(R.A,{description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_MATCH_IPSEC_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),isInteractive:!0,portal:!0,children:(0,t.jsx)(K.A,{isActive:!0,size:"original"})})]}),i?(0,t.jsxs)(L.A,{gap:P.Ln,rowGap:P.YC,flexWrap:"wrap",alignItems:"center",paddingTop:P.YC,paddingBottom:P.YC,children:[(0,t.jsx)($.A,{type:"radio",name:"match_ip_sec_type",value:V.kz.MATCH_IPSEC,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_ENCRYPTED"})})}),(0,t.jsx)($.A,{type:"radio",name:"match_ip_sec_type",value:V.kz.MATCH_NON_IPSEC,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_NOT_ENCRYPTED"})})})]}):null]})};var oi=s(694169);const _i=({disabled:e})=>{const{values:{ip_version:i,protocol:s,source_matching_target:d,source_matching_target_type:o,source_ip_group_id:_,source_ips:r,destination_matching_target:c,destination_matching_target_type:A,destination_ip_group_id:E,destination_ips:I},setFieldValue:O}=(0,l.j7)(),u=(0,n.d4)(oi.O9),p=(0,a.useMemo)(()=>(0,g.Ry)({ip_version:i,protocol:s,source_matching_target:d,source_matching_target_type:o,source_ip_group_id:_,source_ips:r,destination_matching_target:c,destination_matching_target_type:A,destination_ip_group_id:E,destination_ips:I},u,e),[e,u,i,s,d,o,_,r,c,A,E,I]),C=(0,a.useCallback)(e=>{O("ip_version",e),e!==V.oi.IPV6&&(c===H.f.IP&&A===V.qv.IID&&O("destination_matching_target_type",V.qv.SPECIFIC),d===W.y.IP&&o===V.qv.IID&&O("source_matching_target_type",V.qv.SPECIFIC))},[c,A,d,o,O]);return(0,t.jsxs)(L.A,{flexDirection:"column",width:"100%",children:[(0,t.jsx)(ni.A,{label:(0,t.jsx)(T.sA,{id:"COMMON_IP_VERSION"}),tooltip:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_IP_VERSION_DESCRIPTION"})}),(0,t.jsx)(L.A,{gap:P.Ln,paddingTop:P.YC,paddingBottom:P.YC,flexWrap:"wrap",rowGap:P.YC,children:p.map(e=>(0,t.jsx)(R.A,{description:e.disabled?e.tooltipDescription:void 0,portal:!0,children:(0,t.jsx)($.A,{type:"radio",name:"ip_version",value:e.value,disabled:e.disabled,onChange:()=>C(e.value),children:(0,t.jsxs)(L.A,{alignItems:"center",gap:P.kc,children:[(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:e.label})}),e.invalidProtocolWarning]})})},e.value))})]})};var ri=s(441778),ci=s(992949),Ai=s(78903);const Ei=({disabled:e})=>{const{formatMessage:i}=(0,T.tz)(),{values:{destination_zone_id:s,destination_vpn_site_to_site_id:d}}=(0,l.j7)(),o=(0,n.d4)(N.Cw),_=(0,n.d4)(N.Av),r=(0,a.useMemo)(()=>o.find(({_id:e})=>e===s),[o,s]),c=(0,a.useMemo)(()=>_.filter(e=>e._id===d||r&&(0,g.c8)(e,r)&&(0,Me.u0)(e)).map(e=>({label:e.name,value:e._id,additionalInfo:e.sdwan_hub_spoke_local_wan_id?(0,je.qY)(e.sdwan_hub_spoke_local_wan_id,i):e.ip})),[_,d,r,i]);return(0,t.jsx)(L.A,{flexDirection:"column",width:"100%",children:(0,t.jsx)($.A,{disabled:e,name:"destination_vpn_site_to_site_id",validated:!0,options:c,type:"dropdown",full:!0,variant:"secondary"})})},Ii={[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"},Ti=[H.f.ANY,H.f.IP],Oi=[H.f.ANY,H.f.APP,H.f.IP,H.f.WEB,H.f.REGION],ui=[H.f.ANY,H.f.VPN_SERVER,H.f.VPN_SITE_TO_SITE,H.f.IP],pi=[H.f.ANY,H.f.NETWORK,H.f.IP],Ci=({disabled:e})=>{const{values:i,setFieldValue:s}=(0,l.j7)(),d=(0,a.useCallback)(e=>{e===H.f.WEB&&i.destination_matching_target_type===V.qv.IID&&s("destination_matching_target_type",V.qv.SPECIFIC)},[i.destination_matching_target_type,s]),o=(0,n.d4)(N.Cw),_=(0,n.d4)(N.Av),r=(0,a.useMemo)(()=>o.find(e=>e._id===i.destination_zone_id),[i.destination_zone_id,o]),c=(0,a.useMemo)(()=>r?r.zone_key===C.o.GATEWAY?Ti:r.zone_key===C.o.EXTERNAL?Oi:r.zone_key===C.o.VPN?ui:pi:[H.f.ANY],[r]);return(0,t.jsx)(Ie.A,{children:c.map(i=>{const s=i===H.f.NETWORK&&r&&!_.some(e=>(0,g.c8)(e,r)),n=i===H.f.VPN_SERVER&&r&&!_.some(e=>(0,g.c8)(e,r)&&!(0,Me.u0)(e)),a=i===H.f.VPN_SITE_TO_SITE&&r&&!_.some(e=>(0,g.c8)(e,r)&&(0,Me.u0)(e));let l;return s||a||n?l=(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_NO_NETWORKS_FOR_ZONE_TOOLTIP"}):i===H.f.NETWORK?l=(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_DESTINATION_NETWORK_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}):i===H.f.IP&&(l=(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_DESTINATION_IP_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}})),(0,t.jsx)(R.A,{portal:!0,description:l,children:(0,t.jsx)($.A,{type:"radio",name:"destination_matching_target",value:i,afterChange:d,disabled:e||s||n||a,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:Ii[i]})})})},`destination_matching_target_${i}`)})})},Ni=({disabled:e,name:i})=>{const{formatMessage:s}=(0,T.tz)(),{values:d}=(0,l.j7)(),o=(0,n.d4)(N.Cw),_=(0,n.d4)(N.Av),r=o.find(({_id:e})=>e===d.destination_zone_id),c=(0,l.O6)(d,i),A=(0,a.useMemo)(()=>_.filter(e=>c.includes(e._id)||r&&(0,g.c8)(e,r)&&!(0,Me.u0)(e)).map(e=>({label:e.name,value:e._id,additionalInfo:e.sdwan_hub_spoke_local_wan_id?(0,je.qY)(e.sdwan_hub_spoke_local_wan_id,s):e.ip})),[_,c,r,s]);return(0,t.jsx)($.A,{disabled:e,name:i,options:A,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0})},Si=({disabled:e})=>(0,t.jsxs)(L.A,{gap:P.Ln,height:X.b,alignItems:"center",children:[(0,t.jsx)($.A,{type:"radio",name:"destination_app_type",value:H.f.APP,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:"COMMON_SPECIFIC"})})}),(0,t.jsx)($.A,{type:"radio",name:"destination_app_type",value:H.f.APP_CATEGORY,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:"COMMON_CATEGORY"})})})]}),mi=({disabled:e})=>{const i=(0,n.d4)(N.Cw),s=(0,n.d4)(de.YX),d=(0,n.d4)(N.Av),o=(0,n.d4)(m.xK),_=(0,n.d4)(le.Uv),{formatMessage:r}=(0,T.tz)(),{values:{ip_version:c,destination_matching_target:A,destination_matching_target_type:E,destination_port_matching_type:I,destination_app_type:O,destination_zone_id:u},setFieldValue:p}=(0,l.j7)(),S=(0,a.useMemo)(()=>i.map(({_id:e,name:i,zone_key:s})=>({label:s?r({id:ie.F[s]}):i,value:e,labelClassName:ee.F})),[i,r]),h=(0,a.useMemo)(()=>(0,g.SH)(_,d),[_,d]),x=(0,a.useMemo)(()=>i.find(e=>e._id===u),[u,i]);return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(L.A,{flexDirection:"column",gap:P.kc,width:"100%",children:[(0,t.jsx)(re,{disabled:e,fieldName:"destination_zone_id",options:S,onFieldChange:()=>{p("destination_matching_target",o.destination?.matching_target),p("destination_matching_target_type",o.destination?.matching_target_type),p("destination_network_ids",[])}}),(0,t.jsx)(Ci,{disabled:e}),x?.zone_key===C.o.VPN&&A!==H.f.VPN_SERVER&&s?(0,t.jsx)(me,{}):null,A===H.f.APP?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Si,{disabled:e}),O===H.f.APP?(0,t.jsx)(ri.A,{fieldName:"destination_app_ids"}):(0,t.jsx)(ci.A,{fieldName:"destination_app_category_ids"})]}):null,A===H.f.VPN_USER?(0,t.jsx)($.A,{disabled:e,name:"destination_wireguard_user_ids",options:h,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0}):null,A===H.f.NETWORK?(0,t.jsx)(Ni,{disabled:e,name:"destination_network_ids"}):null,A===H.f.VPN_SERVER?(0,t.jsx)(Ni,{disabled:e,name:"destination_vpn_server_ids"}):null,A===H.f.VPN_SITE_TO_SITE?(0,t.jsx)(Ei,{disabled:e}):null,[H.f.NETWORK,H.f.VPN_SERVER].includes(A)?(0,t.jsx)(he,{disabled:e,name:"destination_match_opposite_networks",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_NETWORKS_DESCRIPTION"}):null,A===H.f.IP?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Oe,{disabled:e,fieldName:"destination_matching_target_type"}),E===V.qv.SPECIFIC?(0,t.jsx)(ae.A,{disabled:e,fieldName:"destination_ips",labels:{fieldLabel:"SETTINGS_IP_ADDRESS_SUBNET",modalTitle:"SETTINGS_ADD_MULTIPLE_IPS",modalFieldPlaceholder:r({id:"SETTINGS_ADD_MULTIPLE_IPS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>r({id:"SETTINGS_DUPLICATE_IP_VALIDATION"}),validate:e=>(0,g.GH)(c,e,!0,r)},extraFieldConfig:{placeholder:"SETTINGS_IP_SUBNET_RANGE",placeholderValues:{version:c}}}):null,E===V.qv.OBJECT?(0,t.jsx)(ne.A,{disabled:e,name:"destination_ip_group_id",types:xe.$d,getDisabledReason:(0,g.Xe)(c)}):null,E===V.qv.IID?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ue.A,{disabled:e,name:"destination_iid"}),(0,t.jsx)(he,{disabled:e,name:"destination_match_opposite_iid",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})]}):(0,t.jsx)(he,{disabled:e,name:"destination_match_opposite_ips",labelId:"COMMON_MATCH_OPPOSITE",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_IPS_DESCRIPTION"})]}):null,A===H.f.REGION?(0,t.jsx)($.A,{type:"picklist",name:"destination_regions",options:se.Ay,triggerButtonText:"COMMON_SELECT",maxSelections:se.xn}):null,A===H.f.WEB?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Oe,{disabled:e,fieldName:"destination_matching_target_type",hideIid:!0}),E===V.qv.SPECIFIC?(0,t.jsx)(ae.A,{disabled:e,fieldName:"destination_web_domains",labels:{fieldLabel:"COMMON_DOMAIN",modalTitle:"SETTINGS_ADD_MULTIPLE_DOMAINS",modalFieldPlaceholder:r({id:"SETTINGS_ADD_MULTIPLE_DOMAINS_PLACEHOLDER"})},fieldValidation:{getDuplicationMessage:()=>r({id:"SETTINGS_SECURITY_DOMAINS_VALIDATION"}),validate:e=>!!e?.match(_e.yA)||(e?.startsWith(Ai.n4)?r({id:"SETTINGS_SECURITY_DOMAINS_WILDCARD_VALIDATION"}):r({id:"COMMON_DOMAIN_VALIDATION"}))},extraFieldConfig:{placeholder:"SETTINGS_SECURITY_DOMAINS_PLACEHOLDER"}}):null,E===V.qv.OBJECT?(0,t.jsx)(ne.A,{disabled:e,name:"destination_web_group_id",types:xe.Fd}):null]}):null,A!==H.f.APP?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Ee,{disabled:e,fieldName:"destination_port_matching_type",radioOptions:xe.o5}),I===V.rl.SPECIFIC?(0,t.jsx)(te.A,{customPortFieldName:"destination_port",serviceFieldName:"destination_port_service"}):null,I===V.rl.OBJECT?(0,t.jsx)(ne.A,{disabled:e,name:"destination_port_group_id",types:[oe.B.PORT_GROUP]}):null,I!==V.rl.ANY?(0,t.jsx)(he,{disabled:e,name:"destination_match_opposite_ports",labelId:"SETTINGS_MATCH_OPPOSITE_PORT",descriptionId:"SETTINGS_FIREWALL_MATCH_OPPOSITE_PORTS_DESCRIPTION"}):null]}):null]})})},hi=s(409844).AH`
  flex-direction: column;
  > span {
    position: static;
    transform: none;
  }
`,xi=({disabled:e})=>(0,t.jsx)($.A,{type:"textarea",name:"description",variant:"secondary",disabled:e,minWidth:"100%",maxWidth:"100%",className:hi,rows:3,full:!0,label:(0,t.jsx)(ni.A,{label:(0,t.jsx)(T.sA,{id:"COMMON_DESCRIPTION"}),tooltip:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_FIREWALL_DESCRIPTION"})})});var ji=s(399935),Mi=s(318087),gi=s(527528);const Ri=[V.KN.NEW,V.KN.INVALID,V.KN.ESTABLISHED,V.KN.RELATED],Pi=({disabled:e})=>{const{values:{connection_state_type:i,connection_states:s},setFieldValue:n,errors:d,touched:o,submitCount:_}=(0,l.j7)(),r=(0,a.useCallback)(({currentTarget:{id:e,checked:i}})=>{n("connection_states",i?[...s,e]:s.filter(i=>i!==e))},[s,n]),c=(0,Mi.t$)("connection_states",d,o,_);return(0,t.jsxs)(L.A,{flexDirection:"column",width:"100%",children:[(0,t.jsx)(ni.A,{label:(0,t.jsx)(T.sA,{id:"COMMON_CONNECTION_STATE"}),tooltipProps:{isInteractive:!0},tooltip:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_CONNECTION_STATE_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}})}),(0,t.jsxs)(L.A,{flexDirection:"column",children:[(0,t.jsxs)(L.A,{gap:P.Ln,rowGap:P.YC,paddingTop:P.YC,paddingBottom:P.YC,minHeight:X.b,alignItems:"center",flexWrap:"wrap",children:[(0,t.jsx)($.A,{type:"radio",name:"connection_state_type",value:V.kU.ALL,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:gi.ER[V.kU.ALL]})})}),(0,t.jsx)($.A,{type:"radio",name:"connection_state_type",value:V.kU.RESPOND_ONLY,disabled:e,children:(0,t.jsxs)(L.A,{alignItems:"center",gap:P.YC,children:[(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:gi.ER[V.kU.RESPOND_ONLY]})}),(0,t.jsx)(R.A,{description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_RETURN_TRAFFIC_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),portal:!0,isInteractive:!0,style:{display:"flex",alignItems:"center"},children:(0,t.jsx)(Ae.A,{size:"original",isActive:!0})})]})}),(0,t.jsx)($.A,{type:"radio",name:"connection_state_type",value:V.kU.CUSTOM,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:gi.ER[V.kU.CUSTOM]})})})]}),i===V.kU.CUSTOM?(0,t.jsxs)(L.A,{flexDirection:"column",width:"100%",children:[(0,t.jsx)(L.A,{gap:P.Ln,rowGap:P.YC,paddingTop:P.YC,paddingBottom:P.YC,minHeight:X.b,alignItems:"center",flexWrap:"wrap",children:Ri.map(e=>(0,t.jsx)($.A,{name:e,type:"realCheckbox",checked:s.includes(e),onChange:r,children:(0,t.jsx)(T.sA,{id:gi.VE[e]})},e))}),c?(0,t.jsx)(ji.A,{style:{padding:0},isInvalid:!0,label:c}):null]}):null]})]})},bi=({disabled:e})=>{const{values:i}=(0,l.j7)(),s=(0,n.d4)(N.Cw),a=!(0,g.oS)(i,s),d=s.find(e=>e._id===i.destination_zone_id);return(0,t.jsxs)(L.A,{flexDirection:"column",width:"100%",gap:P.kc,children:[(0,t.jsxs)(L.A,{flexDirection:"row",gap:P.Ln,minHeight:X.b,alignItems:"center",children:[(0,t.jsx)($.A,{type:"radio",name:"action",value:V.Dl.BLOCK,disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_BLOCK"})}),(0,t.jsx)($.A,{type:"radio",name:"action",value:V.Dl.ALLOW,disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_ALLOW"})}),(0,t.jsxs)(L.A,{alignItems:"center",gap:P.YC,children:[(0,t.jsx)($.A,{type:"radio",name:"action",value:V.Dl.REJECT,disabled:e,children:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_REJECT"})}),(0,t.jsx)(R.A,{description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_FIREWALL_REJECT_DESCRIPTION"}),portal:!0,style:{display:"flex",alignItems:"center"},children:(0,t.jsx)(Ae.A,{size:"original",isActive:!0})})]})]}),i.action===V.Dl.ALLOW?(0,t.jsxs)(L.A,{minHeight:X.b,alignItems:"center",gap:P.YC,children:[(0,t.jsx)(R.A,{description:a?(0,t.jsx)(T.sA,{id:d?.zone_key===C.o.EXTERNAL?"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DISABLED_EXTERNAL":d?.zone_key===C.o.GATEWAY?"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DISABLED_GATEWAY":"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DISABLED",values:{link:(0,t.jsx)(f.A,{id:"COMMON_LEARN_MORE",noWrap:!0,href:Y.A.firewallPolicies})}}):null,isInteractive:!0,portal:!0,children:(0,t.jsx)($.A,{type:"realCheckbox",name:"create_allow_respond",disabled:a,checked:!a&&void 0,children:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC"})})}),(0,t.jsx)(R.A,{description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),isInteractive:!0,portal:!0,children:(0,t.jsx)(Ae.A,{size:"original",isActive:!0})})]}):null]})};var fi=s(115114),Li=s(648576);const yi=({id:e,disabled:i})=>{const s=(0,n.wA)();return(0,t.jsx)(Li.Ay,{disabled:i,type:"button",variant:"link",size:"medium",onClick:async()=>{await s((0,h.Ad)([{_id:e,enabled:!0}])),s((0,h.fn)())},children:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_RESUME"})})},vi=({name:e,id:i})=>{const s=(0,n.wA)(),[l,d]=(0,a.useState)(!1);return(0,t.jsx)(U.A,{isOpen:l,title:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_TITLE",titleValues:{count:1},buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",body:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_SINGLE_MESSAGE",values:{name:e}}),handleCancel:()=>d(!1),handleConfirm:async()=>{await s((0,h.Ee)([i])),s((0,h.fn)()),s((0,S.WO)()),d(!1),s((0,E.K5)())},handleClose:()=>d(!1),rootClose:!0,children:(0,t.jsx)(Li.Ay,{type:"button",variant:"link",size:"medium",onClick:()=>d(!0),children:(0,t.jsx)(ce.A,{variant:"inherit",color:"destructive",children:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_REMOVE"})})})})},Di=({name:e,id:i})=>{const s=(0,n.wA)(),[l,d]=(0,a.useState)(!1);return(0,t.jsx)(U.A,{isOpen:l,title:"SETTINGS_SECURITY_PAUSE_FIREWALL_POLICY_TITLE",titleValues:{count:1},buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",body:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_PAUSE_FIREWALL_POLICY_MESSAGE_SINGLE",values:{name:e}}),handleCancel:()=>{d(!1)},handleConfirm:async()=>{await s((0,h.Ad)([{_id:i,enabled:!1}])),s((0,h.fn)()),d(!1)},handleClose:()=>{d(!1)},rootClose:!0,children:(0,t.jsx)(Li.Ay,{type:"button",variant:"link",onClick:()=>d(!0),children:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_PAUSE"})})})};var Yi=s(341699);const Gi=({existingRecord:e})=>(0,t.jsx)(Se.A,{children:(0,t.jsxs)(L.A,{flexDirection:"column",children:[(0,t.jsx)(T.sA,{id:"COMMON_MANAGED_BY_FABRIC",values:{feature:(0,t.jsx)(T.sA,{id:"COMMON_FIREWALL_POLICY"})}}),(0,t.jsx)(f.A,{id:"COMMON_VIEW_IN_SITE_MANAGER",href:(0,Yi.vF)(e?.cloud_template),noWrap:!0})]})}),wi="firewallPolicyForm",Fi=({disabled:e,existingRecord:i,typeSelector:s})=>{const{resetForm:a,handleSubmit:d,dirty:o,isSubmitting:_,submitForm:r,values:c,isValid:A}=(0,l.j7)(),E=!(!(0,n.d4)(D.kD)||!(0,v.B)(c.destination_matching_target)),{sharedName:I}=(0,M.H5)();return(0,t.jsxs)("form",{onSubmit:d,style:{height:"100%"},id:wi,children:[(0,t.jsx)(G.A,{isDisabled:!!i&&(0,w.A)(i),children:(0,t.jsxs)(L.A,{flexDirection:"column",gap:P.xO,width:"100%",overflow:"hidden",children:[(0,t.jsxs)(b.A,{children:[i&&(0,w.A)(i)?(0,t.jsx)(Gi,{existingRecord:i}):null,s,(0,t.jsx)(li,{disabled:e})]}),(0,t.jsx)(b.A,{title:(0,t.jsx)(T.sA,{id:"COMMON_SOURCE_ZONE"}),tooltipProps:{isInteractive:!0},tooltip:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_SOURCE_ZONE_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),children:(0,t.jsx)(ii,{disabled:e})}),(0,t.jsx)(b.A,{title:(0,t.jsx)(T.sA,{id:"COMMON_ACTION"}),tooltip:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_FIREWALL_ACTION_DESCRIPTION"}),children:(0,t.jsx)(bi,{disabled:e})}),(0,t.jsx)(b.A,{title:(0,t.jsx)(T.sA,{id:"COMMON_DESTINATION_ZONE"}),tooltip:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_DESTINATION_ZONE_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:Y.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),tooltipProps:{isInteractive:!0},children:(0,t.jsx)(mi,{disabled:e})}),(0,t.jsxs)(b.A,{children:[(0,t.jsx)(_i,{disabled:e}),(0,t.jsx)(ai,{disabled:e}),(0,t.jsx)(Pi,{disabled:e}),(0,t.jsx)(di,{disabled:e}),(0,t.jsx)(Z,{disabled:e}),(0,t.jsx)(k.A,{disabled:e}),(0,t.jsx)(xi,{disabled:e})]}),e||!i||(0,w.A)(i)?null:(0,t.jsxs)(y.A,{type:y.I.BUTTON_LIST,children:[(0,t.jsx)(F.R,!i.enabled||E?{children:(0,t.jsx)(R.A,{portal:!0,description:E?(0,t.jsx)(T.sA,{id:"SETTINGS_APP_BLOCKING_IDENTIFICATION_DISABLED_ROW_DESCRIPTION"}):null,children:(0,t.jsx)(yi,{id:i._id,disabled:E})})}:{children:(0,t.jsx)(Di,{name:i.name||"",id:i._id})}),(0,t.jsx)(F.R,{children:(0,t.jsx)(vi,{name:i.name||"",id:i._id})})]})]})}),(0,t.jsx)(fi.A,{onFormCancel:a,allowCancel:o,applyButton:(0,t.jsx)(B,{isDisabled:e,isExistingRecord:!!i,isLoading:_,submitForm:r,values:c,form:wi,children:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})}),isDirty:o||Boolean(I),isSubmitting:_,isInvalid:!A})]})},ki=({activeItem:e,typeSelector:i})=>{const s=e?._id===j.R6?void 0:e,{formatMessage:R}=(0,T.tz)(),P=(0,n.wA)(),b=(0,n.d4)(p.EL),f=(0,n.d4)(N.Cw),L=(0,n.d4)(u.Ct),y=(0,n.d4)(m.xK),v=(0,c.A)(x.Xj.FIREWALL_SCHEDULING_AFTER_2038),{sharedName:D}=(0,M.H5)(),Y=(0,a.useMemo)(()=>s?.source?.zone_id||e?.source?.zone_id||f.find(e=>e.zone_key===C.o.INTERNAL)?._id||"",[e?.source?.zone_id,s?.source?.zone_id,f]),G=(0,a.useMemo)(()=>s?.destination?.zone_id||e?.destination?.zone_id||f.find(e=>e.zone_key===C.o.EXTERNAL)?._id||"",[e?.destination?.zone_id,s?.destination?.zone_id,f]),w=(0,a.useMemo)(()=>new Date,[]),F=(0,a.useMemo)(()=>(0,g.xE)(y,Y,G,s,f,L,w,D),[y,Y,G,s,f,L,w,D]),k=(0,a.useMemo)(()=>(0,g.tH)(f,R,v),[R,f,v]),U=(0,a.useCallback)((e,{setSubmitting:i,resetForm:t})=>(i(!0),P((0,h.Vh)((0,g.GJ)(s,e,f),void 0,{fetchConfig:{getAllPostData:!0}})).then(async e=>(await P((0,h.fn)(void 0,{resolveWithExisting:!1})),e)).then(i=>{P((0,E.SQ)(!1)),P((0,E.XP)({type:A.H.CUSTOM_FIREWALL_POLICY,id:i._id})),P((0,S.WO)()),t({values:e})}).catch(e=>{const i=(0,_.F)(e)?e:void 0;P((0,I.ox)({icon:o.C.danger,message:"SETTINGS_UNABLE_TO_APPLY_CHANGES",errorMessage:i?.msg}))}).finally(()=>i(!1))),[P,s,f]);return(0,a.useEffect)(()=>{s?._id&&s?._id!==j.R6&&P((0,h.L9)(s?._id,void 0,{extend:!0}))},[P,s?._id]),(0,a.useEffect)(()=>{P((0,O.mW)(void 0,{crudCacheStrategy:{type:d.e.CACHE}}))},[P]),(0,t.jsx)(l.l1,{initialValues:F,onSubmit:U,validationSchema:k,children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.A,{}),(0,t.jsx)(Fi,{existingRecord:s,disabled:b,typeSelector:i})]})})}},29218(e,i,s){s.d(i,{F:()=>t});const t=s(409844).AH`
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
`},489714(e,i,s){s.d(i,{Z:()=>n});var t=s(570866);const n=e=>e?e.replace(t.SD,"").replace(t.fA,"$&:").substring(0,17).toLowerCase():e}}]);