"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[63939],{727609(e,i,s){s.d(i,{T:()=>o});var t=s(222102),n=s(656466),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(656466),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})))},992949(e,i,s){s.d(i,{A:()=>_});var t=s(274934),n=s(602086),a=s(117948),l=s(120197),d=s(880080),o=s(470070);const _=({fieldName:e,disabled:i})=>{const{formatMessage:s}=(0,o.tz)(),_=(0,n.useMemo)(()=>(0,a.A)(d._O.map(e=>({label:s({id:d.QK[e]}),value:e})),({label:e})=>e),[s]);return(0,t.jsx)(l.A,{type:"picklist",options:_,name:e,truncateLabels:!0,triggerButtonText:"COMMON_SELECT",isWindowed:!0,disabled:i,isFullWidth:!0})}},441778(e,i,s){s.d(i,{A:()=>_});var t=s(274934),n=s(602086),a=s(117948),l=s(609553),d=s(16944),o=s(120197);const _=({fieldName:e,disabled:i})=>{const s=(0,n.useMemo)(()=>(0,a.A)(l.hS.map(([e,{name:i,iconFileName:s}])=>({label:i,value:e,image:(0,t.jsx)(d.A,{iconFileName:s})})),e=>e.label),[]);return(0,t.jsx)(o.A,{type:"picklist",options:s,name:e,truncateLabels:!0,maxSelections:l.KW,triggerButtonText:"COMMON_SELECT",isWindowed:!0,disabled:i,isFullWidth:!0})}},9306(e,i,s){s.d(i,{A:()=>S});var t=s(274934),n=s(602086),a=s(977872),l=s(117948),d=s(843871),o=s(125799),_=s(864217),r=s(599110),c=s(318087),A=s(833466),E=s(309130),I=s(859513),T=s(120197),u=s(100978),p=s(470070),O=s(694169),C=s(79568);const N=e=>(0,t.jsx)(o.A,{description:e.option.tooltipDescription,portal:!0,position:"left",children:(0,t.jsx)(_.p,{...e})}),S=({types:e,name:i,disabled:s,getDisabledReason:o})=>{const{setFieldValue:_,touched:S,errors:m,submitCount:h}=(0,d.j7)(),x=(0,a.d4)(O.O9),[j,M]=(0,n.useState)(!1),R=(0,n.useMemo)(()=>(0,l.A)(x.filter(({group_type:i})=>e.includes(i)),({name:e})=>e,"asc").map(({_id:e,name:i,group_type:s})=>{const t=o?.({group_type:s});return{value:e,label:i,disabled:!!t,tooltipDescription:t}}),[o,x,e]),g=(0,c.t$)(i,m,S,h);return(0,t.jsxs)(u.A,{flexDirection:"column",width:"100%",children:[(0,t.jsxs)(u.A,{gap:E.kc,alignItems:"flex-start",children:[R.length?(0,t.jsx)(u.A,{flexDirection:"column",width:"100%",flex:1,children:(0,t.jsx)(T.A,{type:"dropdown",variant:"secondary",name:i,renderOption:N,searchable:!0,full:!0,options:R})}):null,(0,t.jsx)(u.A,{height:A.b,children:(0,t.jsx)(r.A,{type:"button",variant:"inline",size:"medium",disabled:s,onClick:()=>{M(!0)},children:(0,t.jsx)(p.sA,{id:R.length?"COMMON_NEW":"COMMON_CREATE_NEW"})})})]}),g?(0,t.jsx)(I.A,{visible:!s,children:g}):null,j?(0,t.jsx)(C.A,{hideModal:()=>{M(!1)},handleGroupField:s=>{s?.group_type&&e.includes(s.group_type)&&_(i,s._id)},types:e}):null]})}},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)},593091(e,i,s){s.d(i,{A:()=>a});var t=s(843871),n=s(531984);const a=()=>{const{dirty:e}=(0,t.j7)();return(0,n.w)(e),null}},555612(e,i,s){s.d(i,{A:()=>c});var t=s(274934),n=s(602086),a=s(244762),l=s(600191),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(104669),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}},250266(e,i,s){s.d(i,{A:()=>r});var t=s(274934),n=s(602086),a=s(696264),l=s(409844),d=s(521376),o=s(309130),_=s(470070);const r=({children:e=null,title:i,titleValues:s,message:r,messageValues:c,handleConfirm:A=()=>null,handleClose:E=()=>null,handleCancel:I,isOpen:T,buttonVariant:u="primary",cancelButtonVariant:p="tertiary",cancelButtonMessage:O="COMMON_ACTION_CANCEL",buttonMessage:C="COMMON_ACTION_CONFIRM",buttonDisabled:N=!1,position:S="top",offset:m,showHeaderClose:h=!1,contentClassName:x="",body:j,titleBody:M,className:R,rootClose:g=!1,footerActions:P})=>{const b=(0,n.useCallback)(e=>{T&&(e.stopPropagation(),e.key===d.U.ENTER?A():e.key===d.U.ESCAPE&&E(!1))},[T,A,E]);(0,n.useEffect)(()=>(window.addEventListener("keydown",b,!0),()=>{window.removeEventListener("keydown",b,!0)}),[b]);const f=(0,n.useCallback)(()=>{E(!1),I?.()},[E,I]),L=(0,n.useCallback)(()=>{E(!1),A()},[E,A]),y=(0,n.useMemo)(()=>[{text:(0,t.jsx)(_.sA,{id:O}),variant:p,onClick:f},{text:(0,t.jsx)(_.sA,{id:C}),disabled:N,variant:u,onClick:L}],[C,u,O,p,f,L,N]),v=(0,n.useCallback)(()=>{E(!1)},[E]),D=l.AH`
    ${i?"":`margin-top: ${o.xO}`}
  `;return(0,t.jsx)(a.A,{title:i?(0,t.jsx)(_.sA,{id:i,values:s}):M||null,...r?{body:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.sA,{id:r,values:c}),j]})}:{body:j},position:S,portal:!0,offset:m,actions:P||y,showHeaderClose:h,contentClassName:l.AH`
        ${D}
        ${x}
      `,onRequestClose:v,isOpen:T,allowOverflow:!0,rootClose:g,className:R,children:e})}},317263(e,i,s){s.d(i,{A:()=>_});var t=s(274934),n=s(602086),a=s(579987),l=s(897688),d=s(938984),o=s(652347);const _=({items:e,selectedKeys:i,onSelectionChange:s,disabled:_,defaultExpanded:r,shouldCollapseOnInteractOutside:c,editSelectionIcon:A,localizationTexts:E,fieldName:I})=>{const T=(0,n.useMemo)(()=>e.filter(e=>"CHECKBOX"===e.type&&!e.checkboxProps?.isDisabled).map(e=>e.id),[e]),u=(0,n.useMemo)(()=>new Set(e.flatMap(e=>"CHECKBOX"===e.type&&e.checkboxProps?.isDisabled?[e.id]:[])),[e]),p=(0,n.useMemo)(()=>{const i=new Map;return e.forEach(e=>{"CHECKBOX"===e.type&&i.set(e.id,e.title)}),i},[e]),O=(0,n.useCallback)(()=>{s(new Set(T))},[s,T]),C=(0,n.useCallback)(()=>{s(new Set)},[s]),N=(0,n.useCallback)(()=>0!==T.length&&("all"===i||i.size>=T.length),[T,i]),S=(0,n.useMemo)(()=>{var e,s;return(s=T,"all"===(e=i)?s:Array.from(e)).filter(e=>p.has(e)).map(e=>(0,t.jsx)(l.A,{children:(0,t.jsx)(d.A,{color:"text-1",children:p.get(e)})},e))},[i,T,p]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.A,{items:e,selectedKeys:i,setSelectedKeys:s,onSelectionChange:s,onSelectAll:O,onDeselectAll:C,isAllSelected:N,chips:S,isDisabled:_,defaultExpanded:r,shouldCollapseOnInteractOutside:c,editSelectionIcon:A,localizationTexts:E,treeProps:u.size>0?{disabledKeys:u}:void 0}),I?(0,t.jsx)(o.A,{fieldName:I}):null]})}},859513(e,i,s){s.d(i,{A:()=>r});var t=s(274934),n=s(814557),a=s(247816),l=s(409844),d=s(470070),o=s(291508);const _=(0,a.A)("div",(0,o.A)("align"))`
  ${({align:e})=>e&&`text-align: ${e}`};
  color: ${({theme:{themeName:e}})=>n.Ay[`desktop-color-red-06-${e}`]};
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
  line-height: 20px;
`,r=({align:e="left",children:i=null,className:s=null,translation:n=null,visible:a=!1})=>a?(0,t.jsxs)(_,{align:e,className:(0,l.cx)(s),children:[n?(0,t.jsx)(d.sA,{id:n}):null,i]}):null},914049(e,i,s){s.d(i,{A:()=>r});var t=s(274934),n=s(977872),a=s(100978),l=s(470070),d=s(385927),o=s(570801),_=s(277660);const r=()=>{const e=(0,n.d4)(o.jc);return(0,t.jsxs)(a.A,{flexDirection:"column",width:"100%",children:[(0,t.jsx)(_.A,{label:(0,t.jsx)(l.sA,{id:"COMMON_SCHEDULE"}),tooltip:(0,t.jsx)(l.sA,{id:"SETTINGS_SECURITY_SCHEDULE_DESCRIPTION"})}),(0,t.jsx)(d.A,{stackTimeInputs:!e})]})}},721398(e,i,s){s.d(i,{A:()=>d});var t=s(274934),n=s(125799),a=s(853777),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(814557),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:()=>Gi});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),u=s(427017),p=s(197571),O=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),R=s(443444),g=s(125799),P=s(309130),b=s(756782),f=s(793442),L=s(100978),y=s(535322),v=s(853136),D=s(291935),w=s(726831),G=s(877840),Y=s(6276),F=s(956731),k=s(914049),U=s(250266),W=s(555612),z=s(139847),V=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===z.Dl.BLOCK||l.action===z.Dl.REJECT,E=A&&l.source_matching_target===V.y.ANY&&l.destination_matching_target===H.f.ANY&&l.source_port_matching_type===z.rl.ANY&&l.destination_port_matching_type===z.rl.ANY,I=A&&l.source_matching_target===V.y.ANY&&l.destination_matching_target===H.f.ANY&&!!l.destination_zone_id&&l.destination_zone_id===r?._id,u=E&&!!l.destination_zone_id&&l.destination_zone_id===c?._id,p=I||E||u,O=(0,a.useMemo)(()=>{let e="";return I?e="SETTINGS_SECURITY_POLICY_BLOCK_GATEWAY_CONFIRM_TITLE":u?e="SETTINGS_SECURITY_POLICY_BLOCK_INTERNET_CONFIRM_TITLE":E&&(e="SETTINGS_SECURITY_POLICY_BLOCK_TRAFFIC_CONFIRM_TITLE"),e},[I,u,E]),S=(0,a.useMemo)(()=>{let e="";return I?e="SETTINGS_SECURITY_POLICY_BLOCK_GATEWAY_CONFIRM_MESSAGE":u?e="SETTINGS_SECURITY_POLICY_BLOCK_INTERNET_CONFIRM_MESSAGE":E&&(e="SETTINGS_SECURITY_POLICY_BLOCK_TRAFFIC_CONFIRM_MESSAGE"),e},[I,u,E]),[m,h]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{m&&!p&&h(!1)},[m,p]),(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:O,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:w.A.firewallPolicies})}})}),children:(0,t.jsx)(W.A,{isDisabled:e,showLoader:i,showWarningIcon:p,label:s?"COMMON_ACTION_APPLY_CHANGES":"SETTINGS_SECURITY_ADD_POLICY",form:o,onSubmit:e=>{p&&(e.preventDefault(),e.stopPropagation(),h(!0))}})})};var K=s(831721),X=s(43506),$=s(833466),q=s(120197),Z=s(502129);const J=({disabled:e})=>{const i=(0,X.A)(`${j.bB}/${j.Uy.TRAFFIC_LOGGING}`);return(0,t.jsx)(L.A,{alignItems:"center",minHeight:$.b,children:(0,t.jsxs)(L.A,{alignItems:"center",gap:P.YC,children:[(0,t.jsx)(q.A,{type:"realCheckbox",name:"logging",disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_SYSLOG_LOGGING"})}),(0,t.jsx)(g.A,{isInteractive:!0,portal:!0,description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_SYSLOG_LOGGING_DESCRIPTION",values:{link:(0,t.jsx)(Z.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)(q.A,{type:"dropdown",variant:"secondary",name:i,options:s,disabled:e,onChange:o,full:!0})};var ce=s(938984),Ae=s(853777);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)(g.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:$.b,alignItems:"center",children:s.map(s=>(0,t.jsx)(q.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 ue=({disabled:e,fieldName:i})=>{const{values:s}=(0,l.j7)(),n=s.ip_version===z.oi.IPV6,a=(0,c.A)(x.Xj.IPV6_INTERFACE_IDENTIFIER_FOR_FIREWALL_FILTER);return(0,t.jsxs)(Ie.A,{children:[(0,t.jsx)(q.A,{type:"radio",name:i,value:z.qv.SPECIFIC,disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_SPECIFIC"})}),(0,t.jsx)(q.A,{type:"radio",name:i,value:z.qv.OBJECT,disabled:e,children:(0,t.jsx)(T.sA,{id:"SETTINGS_LIST"})}),a?(0,t.jsx)(Te.A,{reason:n?void 0:(0,t.jsx)(T.sA,{id:"SETTINGS_IPV6_INTERFACE_ID_DISABLED_TOOLTIP"}),children:(0,t.jsx)("div",{children:(0,t.jsx)(q.A,{type:"radio",name:i,value:z.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 pe=s(277130),Oe=s(814557),Ce=s(600191),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:Oe.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:w.A.firewallPolicies,noWrap:!0})}})})},he=({disabled:e,name:i,labelId:s,descriptionId:n})=>(0,t.jsx)(L.A,{minHeight:$.b,alignItems:"center",children:(0,t.jsx)(q.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 Re=({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,R.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)(q.A,{disabled:e,name:"source_vpn_site_to_site_id",validated:!0,options:c,type:"dropdown",full:!0,variant:"secondary"})})};var ge=s(707096),Pe=s(317263);const be=({disabled:e,name:i})=>{const{formatMessage:s}=(0,T.tz)(),{values:d,setFieldValue:o}=(0,l.j7)(),_=(0,n.d4)(N.Av),r=(0,n.d4)(N.Cw),c=(0,a.useMemo)(()=>r.find(({_id:e})=>e===d.source_zone_id),[d.source_zone_id,r]),A=(0,l.O6)(d,i),E=(0,a.useMemo)(()=>_.filter(e=>A.includes(e._id)||c&&(0,R.c8)(e,c)&&!(0,Me.u0)(e)),[A,_,c]),I=(0,a.useMemo)(()=>E.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}})),[E,s]),u=(0,a.useMemo)(()=>new Set(A),[A]),p=(0,a.useCallback)(e=>{const s="all"===e?I.filter(e=>"CHECKBOX"===e.type).map(e=>e.id):Array.from(e);o(i,s)},[I,o,i]);return(0,t.jsx)(Pe.A,{items:I,selectedKeys:u,onSelectionChange:p,disabled:e,defaultExpanded:0===A.length,fieldName:i,editSelectionIcon:(0,t.jsx)(ge.A,{}),localizationTexts:{EDIT_SELECTION_LABEL:s({id:"COMMON_ACTION_SELECT_NETWORKS"})}})},fe={[V.y.ANY]:"COMMON_ANY",[V.y.CLIENT]:"COMMON_DEVICE",[V.y.NETWORK]:"COMMON_NETWORK",[V.y.VPN_SERVER]:"COMMON_SERVER",[V.y.VPN_SITE_TO_SITE]:"SETTINGS_NETWORKS_FORM_FIELD_VPN_TYPE_SITE_TO_SITE",[V.y.IP]:"COMMON_IP",[V.y.MAC]:"COMMON_MAC",[V.y.VPN_USER]:"COMMON_USER",[V.y.REGION]:"COMMON_REGION",[V.y.USER_IDENTITY]:"COMMON_IDENTITY"},Le=[V.y.ANY,V.y.VPN_SERVER,V.y.VPN_SITE_TO_SITE,V.y.IP],ye=[V.y.ANY,V.y.IP,V.y.MAC,V.y.REGION],ve=[V.y.ANY,V.y.CLIENT,V.y.NETWORK,V.y.IP,V.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[V.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,V.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===V.y.NETWORK&&E&&!A.some(e=>(0,R.c8)(e,E)),n=i===V.y.VPN_SERVER&&E&&!A.some(e=>(0,R.c8)(e,E)&&!(0,Me.u0)(e)),a=i===V.y.VPN_SITE_TO_SITE&&E&&!A.some(e=>(0,R.c8)(e,E)&&(0,Me.u0)(e));return(0,t.jsx)(g.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)(q.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 we=s(508659),Ge=s(117948),Ye=s(920679),Fe=s(415537),ke=s(254590),Ue=s(650632),We=s(287196),ze=s(831433);const Ve=e=>(0,Fe.c)((0,ze.tn)(e)||e.mac,35)||ke.L,He=({disabled:e})=>{const{formatMessage:i}=(0,T.tz)(),{values:s,setFieldValue:d}=(0,l.j7)(),o=(0,n.d4)(N.Cw),_=(0,n.d4)(We.g),r=o.find(e=>e._id===s.source_zone_id),c=(0,a.useMemo)(()=>{const e=s.source_client_macs.filter(e=>!_.some(i=>i.mac===e)),[n,a]=(0,we.A)((0,Ge.A)(_,[e=>(0,ze.tn)(e),e=>e.mac]),e=>e.network_id&&r?.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:Ve(e),children:[],type:"CHECKBOX",checkboxProps:{data:e.mac,symbol:(0,t.jsx)(Ue.A,{client:e,width:20,height:20})}})})),(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:Ve(e),children:[],type:"CHECKBOX",checkboxProps:{data:e.mac,symbol:(0,t.jsx)(Ue.A,{client:e,width:20,height:20})}})}),e.forEach(e=>{l.push({id:e,title:Ve({mac:e}),children:[],type:"CHECKBOX",checkboxProps:{data:e,symbol:(0,t.jsx)(Ue.A,{client:{mac:e},width:20,height:20})}})})),l},[r?.network_ids,_,s.source_client_macs,i]),A=(0,a.useMemo)(()=>new Set(s.source_client_macs),[s.source_client_macs]),E=(0,a.useCallback)(e=>{const i="all"===e?c.filter(e=>"CHECKBOX"===e.type).map(e=>e.id):Array.from(e);d("source_client_macs",i)},[c,d]);return(0,t.jsx)(Pe.A,{items:c,selectedKeys:A,onSelectionChange:E,disabled:e,defaultExpanded:0===s.source_client_macs.length,fieldName:"source_client_macs",editSelectionIcon:(0,t.jsx)(Ye.A,{size:"original"}),localizationTexts:{EDIT_SELECTION_LABEL:i({id:"COMMON_ACTION_SELECT_DEVICES"})}})};var Be=s(972427),Ke=s(381261),Xe=s(826651),$e=s(89469),qe=s(727609);const Ze=({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)(Ke.A,{acronym:(0,Be.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)(()=>new Set([...s.source_identity_users,...s.source_identity_groups]),[s.source_identity_users,s.source_identity_groups]),u=(0,a.useCallback)(e=>{const i="all"===e?E.filter(e=>"CHECKBOX"===e.type).map(e=>e.id):Array.from(e);d("source_identity_users",i.filter(e=>A.has(String(e)))),d("source_identity_groups",i.filter(e=>!A.has(String(e))))},[E,A,d]);return(0,t.jsx)($e.A,{children:(0,t.jsx)(Pe.A,{items:E,selectedKeys:I,onSelectionChange:u,disabled:e,defaultExpanded:!(s.source_identity_users.length>0||s.source_identity_groups.length>0),fieldName:"source_identity_users",editSelectionIcon:(0,t.jsx)(Xe.A,{}),localizationTexts:{EDIT_SELECTION_LABEL:i({id:"COMMON_ACTION_SELECT_PEOPLE_OR_ROLES"})}})})},Je=({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:u,source_ip_match_mac:p},setFieldValue:O}=(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,R.SH)(o,s),[o,s]),j=(0,a.useCallback)(e=>{O("source_ip_mac",(0,Q.Z)(e.currentTarget?.value))},[O]);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:()=>{O("source_matching_target",d.source.matching_target),O("source_matching_target_type",d.source.matching_target_type),O("source_network_ids",[])}}),(0,t.jsx)(De,{disabled:e}),h?.zone_key===C.o.VPN&&E!==V.y.VPN_SERVER&&_?(0,t.jsx)(me,{}):null,E===V.y.CLIENT?(0,t.jsx)(He,{disabled:e}):null,E===V.y.VPN_USER?(0,t.jsx)(q.A,{disabled:e,name:"source_wireguard_user_ids",options:x,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0}):null,E===V.y.NETWORK?(0,t.jsx)(be,{name:"source_network_ids",disabled:e}):null,E===V.y.VPN_SERVER?(0,t.jsx)(be,{name:"source_vpn_server_ids",disabled:e}):null,E===V.y.VPN_SITE_TO_SITE?(0,t.jsx)(Re,{disabled:e}):null,[V.y.NETWORK,V.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===V.y.IP?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ue,{disabled:e,fieldName:"source_matching_target_type"}),I===z.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,R.GH)(c,e,!0,r)},extraFieldConfig:{placeholder:"SETTINGS_IP_SUBNET_RANGE",placeholderValues:{version:c}}})}):null,I===z.qv.OBJECT?(0,t.jsx)(ne.A,{disabled:e,name:"source_ip_group_id",types:xe.$d,getDisabledReason:(0,R.Xe)(c)}):null,I===z.qv.IID?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(pe.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,[V.y.IP,V.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"}),p?(0,t.jsx)(q.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===V.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===V.y.USER_IDENTITY?(0,t.jsx)(Ze,{disabled:e}):null,E===V.y.REGION?(0,t.jsx)(q.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}),u===z.rl.SPECIFIC?(0,t.jsx)(te.A,{customPortFieldName:"source_port",serviceFieldName:"source_port_service"}):null,u===z.rl.OBJECT?(0,t.jsx)(ne.A,{disabled:e,name:"source_port_group_id",types:[oe.B.PORT_GROUP]}):null,u!==z.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 Qe=s(834700),ei=s(486061),ii=s(277660);const si=({disabled:e})=>{const{values:{protocol:i,ip_version:s}}=(0,l.j7)(),{formatMessage:n}=(0,T.tz)(),d=(0,a.useMemo)(()=>(0,R.uj)(s,n,e,i),[s,n,e,i]),o=xe.Fb.map(e=>({label:(0,R.EH)(e),value:e})),_=xe.DT.map(e=>({label:(0,R.EH)(e),value:e})),r=!xe.vm.includes(i);return(0,t.jsxs)(L.A,{flexDirection:"column",width:"100%",children:[(0,t.jsx)(ii.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)(q.A,{type:"radio",name:"protocol",value:Qe.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)(q.A,{type:"radio",name:"protocol",value:Qe.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)(q.A,{type:"radio",name:"protocol",value:Qe.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)(q.A,{type:"radio",name:"protocol",value:Qe.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)(q.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:ei.ng,children:(0,t.jsx)(q.A,{type:"dropdown",variant:"secondary",name:"protocol",options:d,disabled:e,renderOption:R.in,full:!0,sortedDropdown:!0,searchable:!0,validated:!0,value:i})}):null,i===Qe.aS.ICMP?(0,t.jsx)(L.A,{flexDirection:"column",width:ei.ng,children:(0,t.jsx)(q.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===Qe.aS.ICMPV6?(0,t.jsx)(L.A,{flexDirection:"column",width:ei.ng,children:(0,t.jsx)(q.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:$.b,children:[(0,t.jsx)(q.A,{type:"realCheckbox",name:"match_opposite_protocol",disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_MATCH_OPPOSITE"})}),(0,t.jsx)(g.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===Qe.aS.NUMBER?(0,t.jsx)(q.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]})]})},ti=({disabled:e})=>{const{setSharedName:i}=(0,M.H5)(),{setFieldValue:s}=(0,l.j7)();return(0,t.jsx)(q.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)}})},ni=({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:$.b,children:[(0,t.jsx)(q.A,{type:"realCheckbox",name:"match_ip_sec",disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_MATCH_IPSEC"})}),(0,t.jsx)(g.A,{description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_MATCH_IPSEC_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:w.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)(q.A,{type:"radio",name:"match_ip_sec_type",value:z.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)(q.A,{type:"radio",name:"match_ip_sec_type",value:z.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 ai=s(694169);const li=({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:u}=(0,l.j7)(),p=(0,n.d4)(ai.O9),O=(0,a.useMemo)(()=>(0,R.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},p,e),[e,p,i,s,d,o,_,r,c,A,E,I]),C=(0,a.useCallback)(e=>{u("ip_version",e),e!==z.oi.IPV6&&(c===H.f.IP&&A===z.qv.IID&&u("destination_matching_target_type",z.qv.SPECIFIC),d===V.y.IP&&o===z.qv.IID&&u("source_matching_target_type",z.qv.SPECIFIC))},[c,A,d,o,u]);return(0,t.jsxs)(L.A,{flexDirection:"column",width:"100%",children:[(0,t.jsx)(ii.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:O.map(e=>(0,t.jsx)(g.A,{description:e.disabled?e.tooltipDescription:void 0,portal:!0,children:(0,t.jsx)(q.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 di=s(441778),oi=s(992949),_i=s(78903);const ri=({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,R.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)(q.A,{disabled:e,name:"destination_vpn_site_to_site_id",validated:!0,options:c,type:"dropdown",full:!0,variant:"secondary"})})},ci={[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"},Ai=[H.f.ANY,H.f.IP],Ei=[H.f.ANY,H.f.APP,H.f.IP,H.f.WEB,H.f.REGION],Ii=[H.f.ANY,H.f.VPN_SERVER,H.f.VPN_SITE_TO_SITE,H.f.IP],Ti=[H.f.ANY,H.f.NETWORK,H.f.IP],ui=({disabled:e})=>{const{values:i}=(0,l.j7)(),s=(0,n.d4)(N.Cw),d=(0,n.d4)(N.Av),o=(0,a.useMemo)(()=>s.find(e=>e._id===i.destination_zone_id),[i.destination_zone_id,s]),_=(0,a.useMemo)(()=>o?o.zone_key===C.o.GATEWAY?Ai:o.zone_key===C.o.EXTERNAL?Ei:o.zone_key===C.o.VPN?Ii:Ti:[H.f.ANY],[o]);return(0,t.jsx)(Ie.A,{children:_.map(i=>{const s=i===H.f.NETWORK&&o&&!d.some(e=>(0,R.c8)(e,o)),n=i===H.f.VPN_SERVER&&o&&!d.some(e=>(0,R.c8)(e,o)&&!(0,Me.u0)(e)),a=i===H.f.VPN_SITE_TO_SITE&&o&&!d.some(e=>(0,R.c8)(e,o)&&(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:w.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:w.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}})),(0,t.jsx)(g.A,{portal:!0,description:l,children:(0,t.jsx)(q.A,{type:"radio",name:"destination_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:ci[i]})})})},`destination_matching_target_${i}`)})})},pi=({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,R.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)(q.A,{disabled:e,name:i,options:A,type:"picklist",triggerButtonText:"COMMON_SELECT",isFullWidth:!0,truncateLabels:!0})},Oi=({disabled:e})=>(0,t.jsxs)(L.A,{gap:P.Ln,height:$.b,alignItems:"center",children:[(0,t.jsx)(q.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)(q.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"})})})]}),Ci=({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:u,destination_zone_id:p},setFieldValue:O}=(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,R.SH)(_,d),[_,d]),x=(0,a.useMemo)(()=>i.find(e=>e._id===p),[p,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:()=>{O("destination_matching_target",o.destination?.matching_target),O("destination_matching_target_type",o.destination?.matching_target_type),O("destination_network_ids",[])}}),(0,t.jsx)(ui,{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)(Oi,{disabled:e}),u===H.f.APP?(0,t.jsx)(di.A,{fieldName:"destination_app_ids"}):(0,t.jsx)(oi.A,{fieldName:"destination_app_category_ids"})]}):null,A===H.f.VPN_USER?(0,t.jsx)(q.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)(pi,{disabled:e,name:"destination_network_ids"}):null,A===H.f.VPN_SERVER?(0,t.jsx)(pi,{disabled:e,name:"destination_vpn_server_ids"}):null,A===H.f.VPN_SITE_TO_SITE?(0,t.jsx)(ri,{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)(ue,{disabled:e,fieldName:"destination_matching_target_type"}),E===z.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,R.GH)(c,e,!0,r)},extraFieldConfig:{placeholder:"SETTINGS_IP_SUBNET_RANGE",placeholderValues:{version:c}}}):null,E===z.qv.OBJECT?(0,t.jsx)(ne.A,{disabled:e,name:"destination_ip_group_id",types:xe.$d,getDisabledReason:(0,R.Xe)(c)}):null,E===z.qv.IID?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(pe.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)(q.A,{type:"picklist",name:"destination_regions",options:se.Ay,triggerButtonText:"COMMON_SELECT",maxSelections:se.xn}):null,A===H.f.WEB?(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(_i.n4)?r({id:"SETTINGS_SECURITY_DOMAINS_WILDCARD_VALIDATION"}):r({id:"COMMON_DOMAIN_VALIDATION"}))},extraFieldConfig:{placeholder:"SETTINGS_SECURITY_DOMAINS_PLACEHOLDER"}}):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===z.rl.SPECIFIC?(0,t.jsx)(te.A,{customPortFieldName:"destination_port",serviceFieldName:"destination_port_service"}):null,I===z.rl.OBJECT?(0,t.jsx)(ne.A,{disabled:e,name:"destination_port_group_id",types:[oe.B.PORT_GROUP]}):null,I!==z.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]})})},Ni=s(409844).AH`
  flex-direction: column;
  > span {
    position: static;
    transform: none;
  }
`,Si=({disabled:e})=>(0,t.jsx)(q.A,{type:"textarea",name:"description",variant:"secondary",disabled:e,resize:!1,className:Ni,rows:3,full:!0,label:(0,t.jsx)(ii.A,{label:(0,t.jsx)(T.sA,{id:"COMMON_DESCRIPTION"}),tooltip:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_FIREWALL_DESCRIPTION"})})});var mi=s(104669),hi=s(318087),xi=s(527528);const ji=[z.KN.NEW,z.KN.INVALID,z.KN.ESTABLISHED,z.KN.RELATED],Mi=({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,hi.t$)("connection_states",d,o,_);return(0,t.jsxs)(L.A,{flexDirection:"column",width:"100%",children:[(0,t.jsx)(ii.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:w.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:$.b,alignItems:"center",flexWrap:"wrap",children:[(0,t.jsx)(q.A,{type:"radio",name:"connection_state_type",value:z.kU.ALL,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:xi.ER[z.kU.ALL]})})}),(0,t.jsx)(q.A,{type:"radio",name:"connection_state_type",value:z.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:xi.ER[z.kU.RESPOND_ONLY]})}),(0,t.jsx)(g.A,{description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_RETURN_TRAFFIC_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:w.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)(q.A,{type:"radio",name:"connection_state_type",value:z.kU.CUSTOM,disabled:e,children:(0,t.jsx)(ce.A,{size:"inherit",color:"inherit",children:(0,t.jsx)(T.sA,{id:xi.ER[z.kU.CUSTOM]})})})]}),i===z.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:$.b,alignItems:"center",flexWrap:"wrap",children:ji.map(e=>(0,t.jsx)(q.A,{name:e,type:"realCheckbox",checked:s.includes(e),onChange:r,children:(0,t.jsx)(T.sA,{id:xi.VE[e]})},e))}),c?(0,t.jsx)(mi.A,{style:{padding:0},isInvalid:!0,label:c}):null]}):null]})]})},Ri=({disabled:e})=>{const{values:i}=(0,l.j7)(),s=(0,n.d4)(N.Cw),a=!(0,R.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:$.b,alignItems:"center",children:[(0,t.jsx)(q.A,{type:"radio",name:"action",value:z.Dl.BLOCK,disabled:e,children:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_BLOCK"})}),(0,t.jsx)(q.A,{type:"radio",name:"action",value:z.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)(q.A,{type:"radio",name:"action",value:z.Dl.REJECT,disabled:e,children:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_REJECT"})}),(0,t.jsx)(g.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===z.Dl.ALLOW?(0,t.jsxs)(L.A,{minHeight:$.b,alignItems:"center",gap:P.YC,children:[(0,t.jsx)(g.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:w.A.firewallPolicies})}}):null,isInteractive:!0,portal:!0,children:(0,t.jsx)(q.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)(g.A,{description:(0,t.jsx)(T.sA,{id:"SETTINGS_SECURITY_AUTO_ALLOW_RETURN_TRAFFIC_DESCRIPTION",values:{link:(0,t.jsx)(f.A,{href:w.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),isInteractive:!0,portal:!0,children:(0,t.jsx)(Ae.A,{size:"original",isActive:!0})})]}):null]})};var gi=s(115114),Pi=s(648576);const bi=({id:e,disabled:i})=>{const s=(0,n.wA)();return(0,t.jsx)(Pi.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"})})},fi=({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)(Pi.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"})})})})},Li=({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)(Pi.Ay,{type:"button",variant:"link",onClick:()=>d(!0),children:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_PAUSE"})})})};var yi=s(341699);const vi=({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})]})}),Di="firewallPolicyForm",wi=({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:Di,children:[(0,t.jsx)(G.A,{isDisabled:!!i&&(0,Y.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,Y.A)(i)?(0,t.jsx)(vi,{existingRecord:i}):null,s,(0,t.jsx)(ti,{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:w.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),children:(0,t.jsx)(Je,{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)(Ri,{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:w.A.firewallPolicies,id:"COMMON_LEARN_MORE",noWrap:!0})}}),tooltipProps:{isInteractive:!0},children:(0,t.jsx)(Ci,{disabled:e})}),(0,t.jsxs)(b.A,{children:[(0,t.jsx)(li,{disabled:e}),(0,t.jsx)(si,{disabled:e}),(0,t.jsx)(Mi,{disabled:e}),(0,t.jsx)(ni,{disabled:e}),(0,t.jsx)(J,{disabled:e}),(0,t.jsx)(k.A,{disabled:e}),(0,t.jsx)(Si,{disabled:e})]}),e||!i||(0,Y.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)(g.A,{portal:!0,description:E?(0,t.jsx)(T.sA,{id:"SETTINGS_APP_BLOCKING_IDENTIFICATION_DISABLED_ROW_DESCRIPTION"}):null,children:(0,t.jsx)(bi,{id:i._id,disabled:E})})}:{children:(0,t.jsx)(Li,{name:i.name||"",id:i._id})}),(0,t.jsx)(F.R,{children:(0,t.jsx)(fi,{name:i.name||"",id:i._id})})]})]})}),(0,t.jsx)(gi.A,{onFormCancel:a,allowCancel:o,applyButton:(0,t.jsx)(B,{isDisabled:e,isExistingRecord:!!i,isLoading:_,submitForm:r,values:c,form:Di,children:(0,t.jsx)(T.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})}),isDirty:o||Boolean(I),isSubmitting:_,isInvalid:!A})]})},Gi=({activeItem:e,typeSelector:i})=>{const s=e?._id===j.R6?void 0:e,{formatMessage:g}=(0,T.tz)(),P=(0,n.wA)(),b=(0,n.d4)(O.EL),f=(0,n.d4)(N.Cw),L=(0,n.d4)(p.Ct),y=(0,n.d4)(m.xK),v=(0,c.A)(x.Xj.FIREWALL_SCHEDULING_AFTER_2038),{sharedName:D}=(0,M.H5)(),w=(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]),Y=(0,a.useMemo)(()=>new Date,[]),F=(0,a.useMemo)(()=>(0,R.xE)(y,w,G,s,f,L,Y,D),[y,w,G,s,f,L,Y,D]),k=(0,a.useMemo)(()=>(0,R.tH)(f,g,v),[g,f,v]),U=(0,a.useCallback)((e,{setSubmitting:i,resetForm:t})=>(i(!0),P((0,h.Vh)((0,R.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))},[P,s?._id]),(0,a.useEffect)(()=>{P((0,u.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)(wi,{existingRecord:s,disabled:b,typeSelector:i})]})})}},277130(e,i,s){s.d(i,{A:()=>a});var t=s(274934),n=s(120197);const a=({disabled:e,name:i})=>(0,t.jsx)(n.A,{full:!0,variant:"secondary",name:i,disabled:e,placeholder:"SETTINGS_SECURITY_ZONE_IPV6_INTERFACE_ID_PLACEHOLDER"})},521376(e,i,s){var t;s.d(i,{U:()=>t}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(t||(t={}))},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}}]);