"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[342],{610342:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Cn});var a=n(71479),l=n(296540),r=n(325898),o=n(74750),i=n(956347),c=n(469733),s=n(349785),d=n(959341),m=n(459449),u=n(294303),E=n(928085),_=n(566723),A=n(211083),T=n(825032),I=n(498837),S=n(432680),O=n(570868),g=n(675359),f=n(742920),b=n(332431),p=n(861509),N=n(414783),C=n(915334),v=n(529888),M=n(551735),L=n(464265),R=n(598796),h=n(38671),D=n(46420),k=n(412952),w=n(366188),Y=n(513180),y=n(822336),U=n(58891),P=n(61902);const V="-14px",G=(0,a.A)("div")`
  display: flex;
  justify-content: center;
  align-items: center;
  border: ${({theme:{themeName:e}})=>y.Ay[`desktop-border-divider-${e}`]};
  width: ${_.Er};
  max-height: ${_.Er};
  border-radius: ${y.Ay["desktop-radius-base"]};
  margin-left: ${V};
  margin-right: ${V};
  margin-top: ${"19px"};
  background: ${P.L};
  z-index: 1;
`,x=(0,a.A)(U.A)`
  color: ${({theme:{themeName:e}})=>y.Ay[`desktop-color-neutral-05-${e}`]};
`,q=()=>l.createElement(G,null,l.createElement(x,null));var F=n(424226),K=n(629318);const W=(0,n(51946).w)(e=>(0,l.createElement)("svg",(0,K.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,l.createElement)("path",{d:"M15 5.5H5a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-7a1 1 0 0 0-1-1Z",fill:"currentColor",className:e.twotonedclassname}),(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 3h11a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-1 0V4H5.5a.5.5 0 0 1 0-1ZM15 5.5v8a.5.5 0 0 1-.5.5H11v2h1.5a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1H7v-2H3.5a.5.5 0 0 1-.5-.5v-8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5ZM8 16h2v-2H8v2ZM4 6v7h10V6H4Z",fill:"currentColor",className:e.baseclassname}),(0,l.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 3h11a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-1 0V4H5.5a.5.5 0 0 1 0-1ZM15 5.5v8a.5.5 0 0 1-.5.5H11v2h1.5a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1H7v-2H3.5a.5.5 0 0 1-.5-.5v-8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5ZM8 16h2v-2H8v2Z",fill:"currentColor",className:e.fillclassname})));var H=n(678853),B=n(698131),j=n(896405),$=n(132196),z=n(217439),Q=n(998837),X=n(438794),Z=n(895424),J=n(454195),ee=n(72892),te=n(196010);const ne=(0,a.A)(ee.A)`
  color: ${({theme:{themeName:e}})=>y.Ay[`desktop-color-neutral-08-${e}`]};
`,ae=(0,a.A)(te.A)`
  display: flex;
  align-items: center;
  width: ${_.S2};
`,le=({linkTo:e})=>l.createElement(ae,{to:e},l.createElement(ne,{size:"large"}));var re,oe;!function(e){e.CLIENTS="clients",e.NETWORKS="networks",e.USERS="users"}(re||(re={})),function(e){e.INHERIT="INHERIT",e.ALLOWLIST="ALLOWLIST",e.BLOCKLIST="BLOCKLIST",e.QUARANTINE="QUARANTINE"}(oe||(oe={}));var ie=n(75585),ce=n(592563),se=n(141979),de=n(239417),me=n(823084),ue=n(198494),Ee=n(984652),_e=n(592510),Ae=n(703447),Te=n(951106),Ie=n(845030),Se=n(398300),Oe=n(980500);const ge=$.AH`
  display: flex;
  flex: 1;
  &,
  * {
    overflow: hidden;
  }
  div {
    max-width: 100%;
    display: flex;
    flex: 1;
  }
`,fe=(0,a.A)(u.A,{shouldForwardProp:e=>"isHovered"!==e})`
  width: 100%;
  margin-left: auto;
  visibility: ${({isHovered:e})=>e?"visible":"hidden"};
`,be={height:"429px"},pe={minHeight:"500px"},Ne="group",Ce="mac",ve=({form:e})=>{const{formatMessage:t}=(0,m.tz)(),n=(0,c.useDispatch)(),a=(0,c.useSelector)(ue.lW),r=(0,c.useSelector)(de.GB),o=(0,c.useSelector)(p.y),{field:i}=(0,s.as)({control:e.control,name:"source"}),E=i.value?.type===re.CLIENTS?i.value.network_member_group_id:void 0,A=i.value?.type===re.CLIENTS?i.value.macs:void 0,T=(0,l.useMemo)(()=>E?o.find(e=>e.id===E):void 0,[o,E]);(0,l.useEffect)(()=>{n((0,Ee.$3)(void 0,{crudCacheStrategy:{type:_e.e.CACHE}})),n((0,Ee.QG)({queryParams:{withinHours:a}},{crudCacheStrategy:{type:_e.e.CACHE}}))},[n,a]);const I=[...r,...(A||[]).filter(e=>!r.some(t=>"mac"in t&&t.mac===e)).map(e=>({mac:e,name:e}))].filter(e=>e.mac),S=(0,l.useMemo)(()=>[{id:"client-groups",type:"SECTION",title:"Client Groups",children:[]},...o.map(e=>({type:"CHECKBOX",id:`${Ne}${e.id}`,title:e.name,checkboxProps:{isDisabled:T&&T.id!==e.id,className:ge,data:({isHovered:t})=>l.createElement(fe,{isHovered:t},l.createElement(se.A,{actionable:!0,size:"original",onClick:t=>{t.preventDefault(),t.stopPropagation(),n((0,Ie.XP)({type:Se.H.NETWORK_MEMBERS_GROUP,id:e.id}))}}))},children:[]})),{type:"CUSTOM",render:()=>l.createElement(ce.A,{onPress:()=>n((0,Ie.XP)({type:Se.H.NETWORK_MEMBERS_GROUP,id:d.R6})),fontSize:"medium"},l.createElement(u.A,{alignItems:"center",gap:_.kc},l.createElement(ie.A,null),l.createElement(m.sA,{id:"COMMON_CREATE_GROUP"}))),children:[],id:"create-item",title:t({id:"COMMON_CREATE_GROUP"})},{id:"clients",type:"SECTION",title:"Clients",children:[]},...I.map(e=>({type:"CHECKBOX",id:`${Ce}${e.mac}`,title:(0,Te.tn)(e)||e.mac,children:[],checkboxProps:{symbol:l.createElement(Ae.A,{client:e,width:20,height:20,style:{opacity:T?.4:void 0,width:"20px",height:"20px"}}),isDisabled:!!T}}))],[I,n,t,o,T]),O=(0,l.useMemo)(()=>new Set(i.value?.type===re.CLIENTS?[...i.value.network_member_group_id?[`${Ne}${i.value.network_member_group_id}`]:(i.value.macs||[]).map(e=>`${Ce}${e}`)]:[]),[i.value]),g=(0,l.useCallback)(e=>{const t=Array.from(e),n=t.find(e=>"string"==typeof e&&e.startsWith(Ne))?.replace(Ne,"")||void 0;n?i.onChange({...i.value,network_member_group_id:n}):!n&&i.value?.type===re.CLIENTS&&i.value.network_member_group_id?i.onChange({...i.value,network_member_group_id:void 0}):i.onChange({...i.value,macs:t.flatMap(e=>"string"==typeof e&&e.startsWith(Ce)?[e.replace(Ce,"")]:[])})},[i]),f=(0,l.useCallback)(()=>{const e=new Set(i.value?.type===re.CLIENTS?i.value?.macs:[]);return I.every(t=>e?.has(t.mac))},[I,i.value]),N=(0,l.useCallback)(()=>i.onChange({...i.value,macs:I.map(e=>e.mac),network_member_group_id:void 0}),[I,i]),C=(0,l.useCallback)(()=>i.onChange({...i.value,macs:[],network_member_group_id:void 0}),[i]);return l.createElement(u.A,{flexDirection:"column",gap:_.kc},l.createElement(u.A,{flexDirection:"column",gap:_.YC,overflowX:"hidden",maxWidth:"100%"},l.createElement(Oe.A.Full,{items:S,selectedKeys:O,isAllSelected:f,onSelectionChange:g,onSelectAll:N,onDeselectAll:C,treeProps:be,style:pe})),l.createElement(b.A,{form:e,name:"source.macs"}),l.createElement(me.A,null,l.createElement(m.sA,{id:"SETTINGS_OBJECT_DEVICE_INFO"})))};var Me=n(524936);const Le=({form:e})=>{const t=(0,c.useSelector)(w.Ct),n=(0,l.useMemo)(()=>t.filter(e=>(0,Me.xv)(e)&&(0,Me.o1)(e)).map(e=>({type:"CHECKBOX",id:e._id,title:e.name,children:[]})),[t]);return l.createElement(u.A,{flexDirection:"column",gap:_.kc},l.createElement(s.xI,{control:e.control,name:"source.network_ids",render:({field:e})=>{const t=new Set(e.value||[]);return l.createElement(Oe.A.Full,{items:n,selectedKeys:t,onSelectionChange:t=>e.onChange(Array.from(t)),onSelectAll:()=>e.onChange(n.map(e=>e.id)),onDeselectAll:()=>e.onChange([]),isAllSelected:()=>n.every(e=>t.has(e.id)),treeProps:{height:"429px"},style:{minHeight:"500px"}})}}),l.createElement(b.A,{form:e,name:"source.network_ids"}))},Re=$.AH`
  padding: ${_.xO} ${_.Ln};
`,he=({isSelected:e,onSelect:t,Icon:n,label:a,isDisabled:r,count:o})=>{const{motifPalette:{uBlue09:i,uBlue01:c},themeName:s}=(0,Q.u)();return l.createElement(j.A,{description:r?l.createElement(m.sA,{id:"COMMON_BADGE_COMING_SOON"}):void 0},l.createElement(u.A,{flex:1},l.createElement(B.A,{isSelected:e,onChange:t,isDisabled:r,style:{flex:1,textAlign:"center",justifyContent:"stretch",display:"flex"}},l.createElement(u.A,{gap:_.YC,width:"100%",justifyContent:"center",alignItems:"center",flex:1},l.createElement(n,{size:"original",isActive:e}),a,o&&e?l.createElement(u.A,{background:s===T.S.DARK?i:c,padding:`0 ${_.YC}`,alignItems:"center",justifyContent:"center",borderRadius:_.YC,minWidth:20,height:20},l.createElement(z.A,{size:"small",weight:"bold",color:"ublue-06"},o)):null))))},De=({form:e,hasObjects:t})=>{const n={...(0,X.k)((0,s.FH)({control:e.control,name:"source"}))},a=(0,E.A)(d.Db);return l.createElement(H.A,{headerTitle:null,className:Re},l.createElement(u.A,{flexDirection:"column",width:"100%",gap:_.kc},l.createElement(u.A,{alignItems:"flex-start"},t?l.createElement(u.A,{height:J.b,marginRight:_.kc},l.createElement(le,{linkTo:a})):null,l.createElement(Z.A,{control:e.control,name:"name",placeholder:(0,m.tz)().formatMessage({id:"COMMON_NAME"})})),l.createElement(u.A,{width:"100%",gap:_.YC},l.createElement(he,{isSelected:n?.type===re.CLIENTS,onSelect:()=>e.setValue("source.type",re.CLIENTS),Icon:F.A,label:l.createElement(m.sA,{id:"COMMON_DEVICES"}),count:n?.network_member_group_id?1:n?.macs?.length||0}),l.createElement(he,{isSelected:n?.type===re.NETWORKS,onSelect:()=>e.setValue("source.type",re.NETWORKS),Icon:W,label:l.createElement(m.sA,{id:"COMMON_NETWORKS"}),count:n?.network_ids?.length||0})),n?.type===re.CLIENTS?l.createElement(ve,{form:e}):n?.type===re.NETWORKS?l.createElement(Le,{form:e}):null))};var ke=n(604569),we=n(641777),Ye=n(897502);const ye=({form:e,name:t,Icon:n,title:a,children:r,isDisabled:o})=>l.createElement(H.A,{headerTitle:l.createElement(Ye.A,{control:e.control,name:`${t}.enabled`,onToggle:n=>{n||"route"!==t||e.trigger("route.network_id")}},l.createElement(u.A,{gap:_.YC,alignItems:"center",marginTop:1},l.createElement(n,{size:"original",color:(0,Q.u)().motifPalette.neutral08}),l.createElement(z.A,{variant:"heading-medium"},a)))},l.createElement(we.A,{isDisabled:!!o},r));var Ue=n(907011),Pe=n(553432),Ve=n(610356),Ge=n(611717),xe=n(977753),qe=n(784045),Fe=n(455155),Ke=n(411502),We=n(62170);const He=function({form:e,name:t,...n}){const a=(0,l.useMemo)(()=>(0,qe.A)(Ke.hS.map(([e,{name:t,iconFileName:n}])=>({label:t,value:e,image:l.createElement(Fe.A,{iconFileName:n})})),e=>e.label),[]);return l.createElement(We.A,{options:a,name:t,control:e.control,truncateLabels:!0,maxSelections:Ke.KW,isWindowed:!0,triggerButtonText:l.createElement(m.sA,{id:"COMMON_SELECT"}),...n})};var Be=n(741821),je=n(438083),$e=n(242366),ze=n(958979);const Qe=function({form:e,name:t,...n}){return l.createElement(We.A,{options:ze.Ay,name:t,control:e.control,truncateLabels:!0,maxSelections:Ke.KW,isWindowed:!0,triggerButtonText:l.createElement(m.sA,{id:"COMMON_SELECT"}),...n})};var Xe=n(263963),Ze=n(961386),Je=n(552315),et=n(910778);const tt=(0,Ze.S)([Je.Z,et.e],{message:(0,Xe.rn)("SETTINGS_IP_OR_SUBNET_REQUIRED")});var nt=n(208288),at=n(349665),lt=n(317672),rt=n(16914),ot=n(12207),it=n(696281),ct=n(596221),st=n.n(ct);const dt=function({control:e,name:t,label:n,maxValue:a,minValue:r}){const o=(0,Xe.L_)();return l.createElement(s.xI,{control:e,name:t,render:({field:e,fieldState:i,formState:c})=>l.createElement(at.A,null,l.createElement(it.A,{label:n,value:e.value?{start:(0,nt.A)(st()(e.value.start),"CalendarDate"),end:(0,nt.A)(st()(e.value.end),"CalendarDate")}:void 0,onChange:t=>{t?e.onChange({...e.value,start:new Date(t.start.toString()),end:new Date(t.end.toString())}):e.onChange(void 0)},minValue:r,maxValue:a,isInvalid:i.invalid}),i.invalid?l.createElement(ot.A,{style:{padding:0}},o((0,s.Jt)(c.errors,t)?.message)):null)})};var mt=n(660989),ut=n(564981),Et=n(446400);const _t=function({control:e,name:t,label:n,maxValue:a,minValue:r}){const o=(0,Xe.L_)();return l.createElement(s.xI,{control:e,name:t,render:({field:e,fieldState:i,formState:c})=>l.createElement(at.A,null,l.createElement(Et.A,{label:n,value:e.value?(0,nt.A)(st()(e.value),"CalendarDate"):void 0,onChange:t=>e.onChange(t?new Date(t.toString()):void 0),minValue:r,maxValue:a,isInvalid:i.invalid}),i.invalid?l.createElement(ot.A,{style:{padding:0}},o((0,s.Jt)(c.errors,t)?.message)):null)})};var At=n(480024),Tt=n(284428);const It=function({control:e,name:t,value:n,children:a}){const r=(0,Tt.mQ)();return l.createElement(s.xI,{key:n,control:e,name:t,render:({field:e})=>l.createElement(At.A,{key:n,id:t+n,name:t+n,type:"checkbox",toggleBoxVariant:"secondary",onChange:t=>{e.onChange(e.value?.includes(n)?e.value.filter(e=>e!==n):[...e.value||[],n])},checked:e.value?.includes(n),disabled:r,value:n},a)})};var St=n(143401);const Ot=function({control:e,name:t,label:n,width:a=70}){const r=(0,c.useSelector)(ue.jc),o=(0,Tt.mQ)();return l.createElement(s.xI,{control:e,name:t,render:({field:e})=>l.createElement(u.A,{gap:_.YC},l.createElement(St.A,{variant:"secondary",use24h:r,width:a,label:n,disabled:o,value:e.value,onChange:(t,n)=>e.onChange(n)}))})};var gt=n(115829);const ft={[ut.g.MON]:"COMMON_DAY_SHORTER_MONDAY",[ut.g.TUE]:"COMMON_DAY_SHORTER_TUESDAY",[ut.g.WED]:"COMMON_DAY_SHORTER_WEDNESDAY",[ut.g.THU]:"COMMON_DAY_SHORTER_THURSDAY",[ut.g.FRI]:"COMMON_DAY_SHORTER_FRIDAY",[ut.g.SAT]:"COMMON_DAY_SHORTER_SATURDAY",[ut.g.SUN]:"COMMON_DAY_SHORTER_SUNDAY"},bt=({form:e,name:t})=>{const{formatMessage:n}=(0,m.tz)(),a=(0,L.A)(R.Xj.FIREWALL_SCHEDULING_AFTER_2038),r=(0,c.useSelector)(ue.jc),o=(0,s.FH)({control:e.control,name:`${t}.mode`}),i=(0,s.FH)({control:e.control,name:`${t}.time_range.all_day`});return l.createElement($e.A,null,l.createElement(at.A,null,l.createElement(lt.A,{htmlFor:t},l.createElement(m.sA,{id:"COMMON_SCHEDULE"})),l.createElement(Pe.A,null,l.createElement(Ve.A,{control:e.control,name:`${t}.mode`,value:rt.Td.ALWAYS},l.createElement(m.sA,{id:"COMMON_ALWAYS"})),l.createElement(Ve.A,{control:e.control,name:`${t}.mode`,value:rt.Td.EVERY_DAY},l.createElement(m.sA,{id:"COMMON_INTERVAL_DAILY"})),l.createElement(Ve.A,{control:e.control,name:`${t}.mode`,value:rt.Td.EVERY_WEEK},l.createElement(m.sA,{id:"COMMON_INTERVAL_WEEKLY"})),l.createElement(Ve.A,{control:e.control,name:`${t}.mode`,value:rt.Td.ONE_TIME_ONLY},l.createElement(m.sA,{id:"COMMON_INTERVAL_ONE_TIME"})),l.createElement(Ve.A,{control:e.control,name:`${t}.mode`,value:rt.Td.CUSTOM},l.createElement(m.sA,{id:"COMMON_CUSTOM"})))),o===rt.Td.CUSTOM?l.createElement(dt,{name:`${t}.date_range`,control:e.control,minValue:(0,nt.A)(new Date,"CalendarDate"),maxValue:a?void 0:(0,nt.A)(mt.R,"CalendarDate"),label:n({id:"COMMON_DATE_RANGE"})}):null,o===rt.Td.EVERY_WEEK||o===rt.Td.CUSTOM?l.createElement(at.A,null,l.createElement(lt.A,{htmlFor:"schedule_repeat_on_days"},l.createElement(m.sA,{id:"COMMON_REPEAT_ON"})),l.createElement(u.A,{gap:_.YC,alignItems:"flex-end"},l.createElement(u.A,null,Object.values(ut.g).map(n=>l.createElement(It,{key:n,value:n,control:e.control,name:`${t}.days`},l.createElement(m.sA,{id:ft[n]})))),l.createElement(u.A,{minHeight:24,alignItems:"center"},l.createElement(Ye.A,{control:e.control,name:`${t}.time_range.all_day`},l.createElement(gt.A,null,l.createElement(m.sA,{id:"COMMON_ALL_DAY"}))))),l.createElement(b.A,{form:e,name:`${t}.days`})):null,o===rt.Td.ONE_TIME_ONLY?l.createElement(_t,{minValue:(0,nt.A)(new Date,"CalendarDate"),maxValue:a?void 0:(0,nt.A)(mt.R,"CalendarDate"),label:n({id:"COMMON_DATE"}),control:e.control,name:`${t}.date`}):null,o===rt.Td.EVERY_DAY||o===rt.Td.EVERY_WEEK&&!i||o===rt.Td.ONE_TIME_ONLY||o===rt.Td.CUSTOM&&!i?l.createElement(u.A,{gap:_.kc,flexDirection:r?"row":"column"},l.createElement(Ot,{width:"full",label:l.createElement(m.sA,{id:"COMMON_START_TIME"}),control:e.control,name:`${t}.time_range.start`}),l.createElement(Ot,{width:"full",label:l.createElement(m.sA,{id:"COMMON_END_TIME"}),control:e.control,name:`${t}.time_range.end`})):null)};var pt=n(231755);const Nt=({label:e,Icon:t})=>{const{motifPalette:{neutral03:n,neutral08:a}}=(0,Q.u)(),r=(0,Tt.mQ)();return l.createElement(u.A,{height:J.b,alignItems:"center",width:"100%"},l.createElement(u.A,{gap:2,background:n,padding:"2px",paddingRight:_.kc,paddingLeft:_.YC,borderRadius:J.b,alignItems:"center",opacity:r?_.xN:void 0},l.createElement(t,{size:"medium",color:a}),l.createElement(z.A,{variant:"body-secondary",size:"small"},e)),l.createElement(pt.A,{orientation:"horizontal",style:{flex:1}}))},Ct=({form:e})=>{const{formatMessage:t}=(0,m.tz)(),n=(0,X.k)((0,s.FH)({control:e.control,name:"secure.internet"}));return l.createElement(l.Fragment,null,l.createElement(Nt,{label:l.createElement(m.sA,{id:"COMMON_INTERNET"}),Icon:Ue.A}),l.createElement(Pe.A,null,l.createElement(Ve.A,{control:e.control,name:"secure.internet.mode",value:Ge.c_.BLOCKLIST},l.createElement(m.sA,{id:"SETTINGS_BLOCK_LIST"})),l.createElement(Ve.A,{control:e.control,name:"secure.internet.mode",value:Ge.c_.ALLOWLIST},l.createElement(m.sA,{id:"SETTINGS_ALLOW_LIST"})),l.createElement(Ve.A,{control:e.control,name:"secure.internet.mode",value:Ge.c_.TURN_OFF_INTERNET},l.createElement(m.sA,{id:"SETTINGS_TURN_OFF_INTERNET"}))),n.mode===Ge.c_.BLOCKLIST||n.mode===Ge.c_.ALLOWLIST?l.createElement(xe.A,{rowGap:_.YC},l.createElement(Ye.A,{control:e.control,name:"secure.internet.everything",onToggle:t=>{t&&(e.setValue("secure.internet.app.enabled",!1),e.setValue("secure.internet.domain.enabled",!1),e.setValue("secure.internet.ip.enabled",!1),e.setValue("secure.internet.region.enabled",!1),e.setValue("secure.internet.ad_block.enabled",!1),e.setValue("secure.internet.content_filter.enabled",!1))}},l.createElement(m.sA,{id:"SETTINGS_EVERYTHING"})),l.createElement($e.A,{gap:_.YC},l.createElement(Ye.A,{control:e.control,name:"secure.internet.app.enabled",onToggle:t=>{t&&e.setValue("secure.internet.everything",!1)}},l.createElement(m.sA,{id:"COMMON_APP"})),n.app?.enabled?l.createElement(He,{form:e,name:"secure.internet.app.app_ids",narrowTrigger:!0}):null),l.createElement($e.A,null,l.createElement(Ye.A,{control:e.control,name:"secure.internet.domain.enabled",onToggle:t=>{t&&e.setValue("secure.internet.everything",!1)}},l.createElement(m.sA,{id:"COMMON_DOMAIN"})),n.domain?.enabled?l.createElement(je.A,{form:e,name:"secure.internet.domain.domains"}):null),l.createElement(Ye.A,{control:e.control,name:"secure.internet.ip.enabled",onToggle:t=>{t&&e.setValue("secure.internet.everything",!1)}},l.createElement(m.sA,{id:"COMMON_IP_ADDRESS"})),n.ip?.enabled?l.createElement(Be.A,{form:e,name:"secure.internet.ip.ips",schema:tt,placeholder:t({id:"SETTINGS_IP_ADDRESS_OR_SUBNET"})}):null,l.createElement($e.A,{gap:_.YC},l.createElement(Ye.A,{control:e.control,name:"secure.internet.region.enabled",onToggle:t=>{t&&e.setValue("secure.internet.everything",!1)}},l.createElement(m.sA,{id:"COMMON_REGION"})),n.region?.enabled?l.createElement(Qe,{form:e,name:"secure.internet.region.regions",narrowTrigger:!0}):null)):null,l.createElement(b.A,{form:e,name:"secure.internet"}),l.createElement(bt,{form:e,name:"secure.internet.schedule"}))};var vt=n(948177),Mt=n(803983),Lt=n(21803),Rt=n(19607),ht=n(400261),Dt=n(617883);const kt=function({form:e,name:t}){const{formatMessage:n}=(0,m.tz)();return l.createElement(Dt.A,{form:e,name:t,fieldLabel:"COMMON_MAC_ADDRESS",itemSchema:Rt.V,modalTitle:l.createElement(m.sA,{id:"SETTINGS_SECURITY_ADD_MULTIPLE_MACS"}),modalFieldPlaceholder:n({id:"SETTINGS_SECURITY_MULTIPLE_MACS_PLACEHOLDER"}),placeholder:n({id:"SETTINGS_COMMON_ENTER_MAC_ADDRESS"}),transformValue:ht.Z})};var wt=n(504779);const Yt=({form:e})=>{const t=(0,X.k)((0,s.FH)({control:e.control,name:"secure.local"})||{}),n=(0,L.A)(R.Xj.SWITCH_CUSTOM_ACL_RULES),{formatMessage:a}=(0,m.tz)();return l.createElement(l.Fragment,null,l.createElement(Nt,{label:l.createElement(m.sA,{id:"COMMON_LOCAL"}),Icon:vt.A}),l.createElement(Pe.A,null,l.createElement(Ve.A,{control:e.control,name:"secure.local.mode",value:oe.INHERIT,onCheck:()=>{e.setValue("secure.local.device.enabled",!1),e.setValue("secure.local.network.enabled",!1),e.setValue("secure.local.mac_address.enabled",!1),e.setValue("secure.local.ip_address.enabled",!1),e.setValue("secure.local.everything",!0)}},l.createElement(m.sA,{id:"SETTINGS_INHERIT"})),l.createElement(wt.A,{reason:n||t.mode===oe.BLOCKLIST?void 0:l.createElement(m.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"})},l.createElement(Ve.A,{control:e.control,name:"secure.local.mode",value:oe.BLOCKLIST},l.createElement(m.sA,{id:"SETTINGS_BLOCK_LIST"}))),l.createElement(wt.A,{reason:n||t.mode===oe.ALLOWLIST?void 0:l.createElement(m.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"})},l.createElement(Ve.A,{control:e.control,name:"secure.local.mode",value:oe.ALLOWLIST},l.createElement(m.sA,{id:"SETTINGS_ALLOW_LIST"}))),l.createElement(wt.A,{reason:n||t.mode===oe.QUARANTINE?void 0:l.createElement(m.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"})},l.createElement(Ve.A,{control:e.control,name:"secure.local.mode",value:oe.QUARANTINE},l.createElement(m.sA,{id:"SETTINGS_QUARANTINE"})))),t.mode!==oe.QUARANTINE?l.createElement(we.A,{isDisabled:t.mode===oe.INHERIT},l.createElement(xe.A,{rowGap:_.YC},l.createElement(Ye.A,{control:e.control,name:"secure.local.everything",onToggle:t=>{t&&(e.setValue("secure.local.device.enabled",!1),e.setValue("secure.local.network.enabled",!1),e.setValue("secure.local.mac_address.enabled",!1),e.setValue("secure.local.ip_address.enabled",!1))}},l.createElement(m.sA,{id:"SETTINGS_EVERYTHING"})),l.createElement(wt.A,{reason:n||t.device?.enabled?void 0:l.createElement(m.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"}),noWrap:!0},l.createElement($e.A,{gap:_.YC},l.createElement(Ye.A,{control:e.control,name:"secure.local.device.enabled",onToggle:t=>{t&&e.setValue("secure.local.everything",!1)}},l.createElement(m.sA,{id:"COMMON_DEVICE"})),t.device?.enabled?l.createElement(Mt.A,{form:e,name:"secure.local.device.device_macs",narrowTrigger:!0}):null)),l.createElement($e.A,{gap:_.YC},l.createElement(Ye.A,{control:e.control,name:"secure.local.network.enabled",onToggle:t=>{t&&e.setValue("secure.local.everything",!1)}},l.createElement(m.sA,{id:"COMMON_NETWORK"})),t.network?.enabled?l.createElement(Lt.A,{form:e,name:"secure.local.network.ids",getIsNetworkVisible:e=>(0,Me.xv)(e)&&!(0,Me.$q)(e)&&!(0,Me.uH)(e),additionalInfo:"subnet",narrowTrigger:!0}):null),l.createElement(wt.A,{reason:n||t.mac_address?.enabled?void 0:l.createElement(m.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"}),noWrap:!0},l.createElement($e.A,{gap:_.YC},l.createElement(Ye.A,{control:e.control,name:"secure.local.mac_address.enabled",onToggle:t=>{t&&e.setValue("secure.local.everything",!1)}},l.createElement(m.sA,{id:"COMMON_MAC_ADDRESS"})),t.mac_address?.enabled?l.createElement(kt,{form:e,name:"secure.local.mac_address.macs"}):null)),l.createElement(Ye.A,{control:e.control,name:"secure.local.ip_address.enabled",onToggle:t=>{t&&e.setValue("secure.local.everything",!1)}},l.createElement(m.sA,{id:"COMMON_IP_ADDRESS"})),t.ip_address?.enabled?l.createElement(Be.A,{form:e,name:"secure.local.ip_address.ips",schema:tt,placeholder:a({id:"SETTINGS_IP_ADDRESS_OR_SUBNET"})}):null)):null,l.createElement(b.A,{form:e,name:"secure.local"}))},yt=({form:e})=>{const t=(0,s.FH)({control:e.control,name:"secure.enabled"});return l.createElement(ye,{Icon:ke.A,form:e,name:"secure",title:l.createElement(m.sA,{id:"SETTINGS_SECURE"}),isDisabled:!t},l.createElement(u.A,{gap:_.kc,flexDirection:"column",width:"100%"},l.createElement(Ct,{form:e}),l.createElement(Yt,{form:e})))};var Ut=n(1571),Pt=n(188738),Vt=n(532419),Gt=n(430329),xt=n(739354),qt=n(792072);const Ft=({form:e})=>{const{formatMessage:t}=(0,m.tz)(),n=(0,c.useSelector)(w.Ct),a=(0,c.useSelector)(Vt.AL),r=(0,c.useSelector)(qt.GW),o=(0,L.A)(R.Xj.TRAFFIC_ROUTES_OPENVPN_S2S_VPN),i=(0,L.A)(R.Xj.TRAFFIC_ROUTES_IPSEC_S2S_VPN),s=(0,L.A)(R.Xj.TRAFFIC_ROUTES_WIREGUARD_S2S_VPN),d=(0,L.A)(R.Xj.WAN_MAGIC),u=(0,l.useMemo)(()=>({isOpenVpnTrafficRoutesSupported:r,isSiteToSiteOpenVpnTrafficRoutesSupported:o,isSiteToSiteIpsecTrafficRoutesSupported:i,isSiteToSiteWireguardTrafficRoutesSupported:s,networks:n}),[r,i,o,s,n]),E=(0,l.useMemo)(()=>{const e=n.filter(e=>{const t=(0,Gt.kY)(e,u)&&!(0,Me.ok)(e),n=(0,Gt.XD)(e,u);return!(!t&&!n)});return(0,xt.MG)(e,t,a?.name,e=>{const t=(0,Gt.XD)(e,u);return{disabled:!!t,tooltipDescription:t?l.createElement(m.sA,{id:t}):void 0}},d)},[n,t,a?.name,d,u]);return l.createElement(Pt.A,{control:e.control,name:"route.network_id",options:E,label:l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_FORM_INTERFACE_S2S_VPN"}),tooltip:l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_SOURCE_INTERFACE_DESCRIPTION"}),placeholder:t({id:"SETTINGS_TRAFFIC_ROUTES_INTERFACE_SELECT"}),renderOption:xt.Ku,portal:!0})},Kt=({form:e})=>{const{formatMessage:t}=(0,m.tz)(),n=(0,L.A)(R.Xj.TRAFFIC_ROUTE_KILL_SWITCH),a=(0,s.FH)({control:e.control,name:"route"}),r=(0,X.k)(a),o=!r?.enabled;return l.createElement(ye,{Icon:Ut.A,form:e,name:"route",title:l.createElement(m.sA,{id:"COMMON_ROUTE"}),isDisabled:o},l.createElement($e.A,null,l.createElement(xe.A,{rowGap:_.YC},l.createElement(Ye.A,{control:e.control,name:"route.traffic.all",onToggle:t=>{t&&(e.setValue("route.traffic.domain.enabled",!1),e.setValue("route.traffic.ip.enabled",!1),e.setValue("route.traffic.region.enabled",!1))}},l.createElement(m.sA,{id:"COMMON_ALL_TRAFFIC"})),l.createElement($e.A,null,l.createElement(Ye.A,{control:e.control,name:"route.traffic.domain.enabled",onToggle:t=>{t&&e.setValue("route.traffic.all",!1)}},l.createElement(m.sA,{id:"COMMON_DOMAIN"})),r.traffic?.domain?.enabled?l.createElement(je.A,{form:e,name:"route.traffic.domain.domains"}):null),l.createElement(Ye.A,{control:e.control,name:"route.traffic.ip.enabled",onToggle:t=>{t&&e.setValue("route.traffic.all",!1)}},l.createElement(m.sA,{id:"COMMON_IP_ADDRESS"})),r.traffic?.ip?.enabled?l.createElement(Be.A,{form:e,name:"route.traffic.ip.ips",schema:tt,placeholder:t({id:"SETTINGS_IP_ADDRESS_OR_SUBNET"})}):null,l.createElement($e.A,{gap:_.YC},l.createElement(Ye.A,{control:e.control,name:"route.traffic.region.enabled",onToggle:t=>{t&&e.setValue("route.traffic.all",!1)}},l.createElement(m.sA,{id:"COMMON_REGION"})),r.traffic?.region?.enabled?l.createElement(Qe,{form:e,name:"route.traffic.region.regions",narrowTrigger:!0}):null)),l.createElement(b.A,{form:e,name:"route.traffic"}),l.createElement(Ft,{form:e}),n?l.createElement(Ye.A,{control:e.control,name:"route.kill_switch_enabled",tooltip:l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_FORM_FALLBACK_TOOLTIP"})},l.createElement(m.sA,{id:"COMMON_KILL_SWITCH"})):null))};var Wt=n(985550),Ht=n(821580),Bt=n(66804),jt=n(222190),$t=n(797336);const zt=[1,10,25,50,75,100,250,500,750,1e3],Qt=({name:e,form:t})=>{const{formatMessage:n}=(0,m.tz)(),a=(0,s.FH)({control:t.control,name:e}),r=zt.findIndex(e=>e>(a?.enabled&&a.value||0)),o=-1===r?zt.length-1:Math.max(0,r-1);return l.createElement(u.A,{gap:_.Ln,alignItems:"flex-start"},l.createElement(u.A,{flex:1,height:J.b,alignItems:"center"},l.createElement(Bt.A,{step:1,value:o,minValue:0,maxValue:zt.length-1,style:{width:"100%"},onChange:n=>t.setValue(`${e}.value`,zt[Math.floor(Number(n))]||0,{shouldDirty:!0,shouldTouch:!0})})),l.createElement(u.A,{alignItems:"flex-start",flexDirection:"column",flex:2},l.createElement(u.A,{justifyContent:"flex-start",gap:_.kc},l.createElement(u.A,{flex:1,flexDirection:"column"},l.createElement(jt.A,{control:t.control,name:`${e}.value`})),l.createElement(u.A,{flex:1,flexDirection:"column"},l.createElement(Pt.A,{control:t.control,name:`${e}.unit`,options:[{value:$t.FJ.MBPS,label:n({id:"SETTINGS_ROUTING_QOS_MBPS"})},{value:$t.FJ.KBPS,label:n({id:"SETTINGS_ROUTING_QOS_KBPS"})}]}))),l.createElement(b.A,{form:t,name:e})))};var Xt=n(942374);const Zt=({form:e})=>{const{formatMessage:t}=(0,m.tz)(),n=e.formState.defaultValues?.qos?.network_id,a=(0,c.useSelector)(w.Ct),r=(0,L.A)(R.Xj.WAN_MAGIC),o=(0,l.useMemo)(()=>(0,Xt.v)(!0,a,t,r,n),[a,t,r,n]);return l.createElement(Pt.A,{portal:!0,control:e.control,name:"qos.network_id",options:o,label:l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_FORM_INTERFACE_S2S_VPN"}),tooltip:l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_SOURCE_INTERFACE_DESCRIPTION"}),placeholder:t({id:"SETTINGS_TRAFFIC_ROUTES_INTERFACE_SELECT"}),renderOption:xt.Ku})},Jt=({form:e})=>{const{formatMessage:t}=(0,m.tz)(),n=(0,s.FH)({control:e.control,name:"qos.enabled"}),a=(0,X.k)((0,s.FH)({control:e.control,name:"qos"}));return l.createElement(ye,{Icon:Wt.A,form:e,name:"qos",title:l.createElement(m.sA,{id:"COMMON_QOS"}),isDisabled:!n},l.createElement($e.A,null,l.createElement(at.A,null,l.createElement(xe.A,{rowGap:_.YC},l.createElement(Ye.A,{control:e.control,name:"qos.traffic.all",onToggle:t=>{t&&(e.setValue("qos.traffic.app.enabled",!1),e.setValue("qos.traffic.domain.enabled",!1),e.setValue("qos.traffic.ip.enabled",!1),e.setValue("qos.traffic.region.enabled",!1))}},l.createElement(m.sA,{id:"COMMON_ALL_TRAFFIC"})),l.createElement($e.A,{gap:_.YC},l.createElement(Ye.A,{control:e.control,name:"qos.traffic.app.enabled",onToggle:t=>{t&&e.setValue("qos.traffic.all",!1)}},l.createElement(m.sA,{id:"COMMON_APP"})),a.traffic?.app?.enabled?l.createElement(He,{form:e,name:"qos.traffic.app.app_ids",narrowTrigger:!0}):null),l.createElement($e.A,null,l.createElement(Ye.A,{control:e.control,name:"qos.traffic.domain.enabled",onToggle:t=>{t&&e.setValue("qos.traffic.all",!1)}},l.createElement(m.sA,{id:"COMMON_DOMAIN"})),a.traffic?.domain?.enabled?l.createElement(je.A,{form:e,name:"qos.traffic.domain.domains"}):null),l.createElement(Ye.A,{control:e.control,name:"qos.traffic.ip.enabled",onToggle:t=>{t&&e.setValue("qos.traffic.all",!1)}},l.createElement(m.sA,{id:"COMMON_IP_ADDRESS"})),a.traffic?.ip?.enabled?l.createElement(Be.A,{form:e,name:"qos.traffic.ip.ips",schema:tt,placeholder:t({id:"SETTINGS_IP_ADDRESS_OR_SUBNET"})}):null,l.createElement($e.A,{gap:_.YC},l.createElement(Ye.A,{control:e.control,name:"qos.traffic.region.enabled",onToggle:t=>{t&&e.setValue("qos.traffic.all",!1)}},l.createElement(m.sA,{id:"COMMON_REGION"})),a.traffic?.region?.enabled?l.createElement(Qe,{form:e,name:"qos.traffic.region.regions",narrowTrigger:!0}):null)),l.createElement(b.A,{form:e,name:"qos.traffic"})),l.createElement(Zt,{form:e}),l.createElement(Pe.A,null,l.createElement(Ve.A,{control:e.control,name:"qos.limit.mode",value:Ge.ku.LIMIT},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_LIMIT"})),l.createElement(Ve.A,{control:e.control,name:"qos.limit.mode",value:Ge.ku.PRIORITIZE},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_OBJECTIVE_PRIORITIZE"})),l.createElement(Ve.A,{control:e.control,name:"qos.limit.mode",value:Ge.ku.LIMIT_AND_PRIORITIZE},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_OBJECTIVE_PRIORITIZE_AND_LIMIT"}))),[Ge.ku.LIMIT,Ge.ku.LIMIT_AND_PRIORITIZE].includes(a.limit?.mode)?l.createElement(l.Fragment,null,l.createElement(Ht.A,null,l.createElement(Ye.A,{control:e.control,name:"qos.limit.download.enabled",tooltip:l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_DOWNLOAD_BANDWIDTH_LIMIT"})},l.createElement(m.sA,{id:"COMMON_DOWNLOAD_LIMIT"}))),a.limit?.download?.enabled?l.createElement(Qt,{name:"qos.limit.download",form:e}):null,a.limit?.download?.enabled?l.createElement(at.A,null,l.createElement(lt.A,{htmlFor:"qos.limit.download.burst",tooltip:l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_BANDWIDTH_BURST_TOOLTIP"})},l.createElement(m.sA,{id:"SETTINGS_DOWNLOAD_BURST"})),l.createElement(Pe.A,null,l.createElement(Ve.A,{control:e.control,name:"qos.limit.download.burst",value:Ge.fP.DISABLED},l.createElement(m.sA,{id:"COMMON_OFF"})),l.createElement(Ve.A,{control:e.control,name:"qos.limit.download.burst",value:Ge.fP.SHORT},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_BURST_SHORT"})),l.createElement(Ve.A,{control:e.control,name:"qos.limit.download.burst",value:Ge.fP.LONG},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_BURST_LONG"})))):null,l.createElement(Ht.A,null,l.createElement(Ye.A,{control:e.control,name:"qos.limit.upload.enabled",tooltip:l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_UPLOAD_BANDWIDTH_LIMIT"})},l.createElement(m.sA,{id:"COMMON_UPLOAD_LIMIT"}))),a.limit?.upload?.enabled?l.createElement(Qt,{name:"qos.limit.upload",form:e}):null,a.limit?.upload?.enabled?l.createElement(at.A,null,l.createElement(lt.A,{htmlFor:"qos.limit.upload.burst",tooltip:l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_BANDWIDTH_BURST_TOOLTIP"})},l.createElement(m.sA,{id:"SETTINGS_UPLOAD_BURST"})),l.createElement(Pe.A,null,l.createElement(Ve.A,{control:e.control,name:"qos.limit.upload.burst",value:Ge.fP.DISABLED},l.createElement(m.sA,{id:"COMMON_OFF"})),l.createElement(Ve.A,{control:e.control,name:"qos.limit.upload.burst",value:Ge.fP.SHORT},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_BURST_SHORT"})),l.createElement(Ve.A,{control:e.control,name:"qos.limit.upload.burst",value:Ge.fP.LONG},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_BURST_LONG"})))):null):null,l.createElement(bt,{form:e,name:"qos.schedule"})))};var en=n(348466);const tn=(e,t=new Date)=>{try{return e?st()(e,"YYYY-MM-DD",t):t}catch{return t}},nn=(e,t)=>{const n=e?.time_range_start?.split(en.oH)??["09","00"],a=e?.time_range_end?.split(en.oH)??["12","00"];return{mode:e?.mode??rt.Td.ALWAYS,date:tn(e?.date,t),time_range:{all_day:e?.time_all_day||!1,start:{hour:Number(n[0])||0,min:Number(n[1])||0},end:{hour:Number(a[0])||0,min:Number(a[1])||0}},date_range:{start:tn(e?.date_start,t),end:tn(e?.date_end,t)},days:e?.repeat_on_days||[]}};var an=n(966353),ln=n.n(an);const rn="YYYY-MM-DD",on=e=>e?`${(e.hour||0).toString().padStart(2,"0")}:${(e.min||0).toString().padStart(2,"0")}`:void 0,cn=e=>{switch(e.mode){case rt.Td.EVERY_DAY:return{mode:rt.Td.EVERY_DAY,time_range_start:on(e.time_range.start),time_range_end:on(e.time_range.end)};case rt.Td.EVERY_WEEK:return{mode:rt.Td.EVERY_WEEK,repeat_on_days:e.days,time_all_day:e.time_range.all_day,time_range_start:e.time_range?.all_day||!("start"in e.time_range)?void 0:on(e.time_range.start),time_range_end:e.time_range?.all_day||!("end"in e.time_range)?void 0:on(e.time_range.end)};case rt.Td.ONE_TIME_ONLY:return{mode:rt.Td.ONE_TIME_ONLY,date:e.date?ln()(e.date,rn):void 0,time_range_start:on(e.time_range.start),time_range_end:on(e.time_range.end)};case rt.Td.CUSTOM:return{mode:rt.Td.CUSTOM,date_start:e.date_range.start?ln()(e.date_range.start,rn):void 0,date_end:e.date_range.end?ln()(e.date_range.end,rn):void 0,time_all_day:e.time_range.all_day,repeat_on_days:e.days,time_range_start:e.time_range?.all_day||!("start"in e.time_range)?void 0:on(e.time_range.start),time_range_end:e.time_range?.all_day||!("end"in e.time_range)?void 0:on(e.time_range.end)};default:return{mode:rt.Td.ALWAYS}}},sn=(0,$t.ck)(10),dn={enabled:!1,limit:sn,burst:Ge.fP.DISABLED},mn={[oe.ALLOWLIST]:Ge.c_.ALLOWLIST,[oe.BLOCKLIST]:Ge.c_.BLOCKLIST},un={[Ge.c_.ALLOWLIST]:oe.ALLOWLIST,[Ge.c_.BLOCKLIST]:oe.BLOCKLIST,[Ge.c_.QUARANTINE]:oe.QUARANTINE,[Ge.c_.TURN_OFF_INTERNET]:oe.QUARANTINE},En=e=>({name:e.name,target_type:e.source.type===re.CLIENTS?e.source.network_member_group_id?Ge.zb.GROUPS:Ge.zb.CLIENTS:e.source.type===re.NETWORKS?Ge.zb.NETWORKS:Ge.zb.USERS,targets:e.source.type===re.CLIENTS?e.source.network_member_group_id?[e.source.network_member_group_id]:e.source.macs||[]:e.source.type===re.NETWORKS?e.source.network_ids:e.source.user_ids,secure:{enabled:e.secure.enabled,internet:e.secure.enabled?e.secure.internet.mode===Ge.c_.TURN_OFF_INTERNET?{mode:Ge.c_.TURN_OFF_INTERNET,schedule:cn(e.secure.internet.schedule)}:{mode:e.secure.internet.mode,everything:e.secure.internet.everything,apps:{enabled:e.secure.internet.app.enabled,values:e.secure.internet.app.enabled?e.secure.internet.app.app_ids:[]},ip_addresses:{enabled:e.secure.internet.ip.enabled,values:e.secure.internet.ip.enabled?e.secure.internet.ip.ips:[]},domains:{enabled:e.secure.internet.domain.enabled,values:e.secure.internet.domain.enabled?e.secure.internet.domain.domains:[]},regions:{enabled:e.secure.internet.region.enabled,values:e.secure.internet.region.enabled?e.secure.internet.region.regions:[]},content_filter:e.secure.internet.content_filter.enabled?e.secure.internet.content_filter.id:void 0,schedule:cn(e.secure.internet.schedule)}:{mode:Ge.c_.BLOCKLIST,everything:!0},local:!e.secure.enabled||e.secure.local.mode!==oe.ALLOWLIST&&e.secure.local.mode!==oe.BLOCKLIST?e.secure.enabled&&e.secure.local.mode===oe.QUARANTINE?{mode:Ge.c_.QUARANTINE}:void 0:{mode:mn[e.secure.local.mode],everything:e.secure.local.everything,devices:{enabled:e.secure.local.device?.enabled??!1,values:e.secure.local.device?.enabled?e.secure.local.device.device_macs:[]},ip_addresses:{enabled:e.secure.local.ip_address?.enabled??!1,values:e.secure.local.ip_address?.enabled?e.secure.local.ip_address.ips:[]},mac_addresses:{enabled:e.secure.local.mac_address?.enabled??!1,values:e.secure.local.mac_address?.enabled?e.secure.local.mac_address.macs:[]},networks:{enabled:e.secure.local.network?.enabled??!1,values:e.secure.local.network?.enabled?e.secure.local.network.ids:[]}}},route:{enabled:e.route.enabled,all_traffic:e.route.enabled?e.route.traffic.all:void 0,apps:{enabled:!1,values:[]},domains:e.route.enabled&&!e.route.traffic.all&&e.route.traffic.domain.enabled?{enabled:!0,values:e.route.traffic.domain.domains}:{enabled:!1,values:[]},ip_addresses:e.route.enabled&&!e.route.traffic.all&&e.route.traffic.ip.enabled?{enabled:!0,values:e.route.traffic.ip.ips}:{enabled:!1,values:[]},regions:e.route.enabled&&!e.route.traffic.all&&e.route.traffic.region.enabled?{enabled:!0,values:e.route.traffic.region.regions}:{enabled:!1,values:[]},kill_switch:e.route?.enabled?e.route.kill_switch_enabled:void 0,network_id:e.route?.enabled?e.route.network_id:void 0},qos:{enabled:e.qos.enabled,network_id:e.qos.enabled&&e.qos.network_id!==Xt.i?e.qos.network_id:void 0,all_traffic:!e.qos.enabled||e.qos.traffic.all,apps:e.qos.enabled&&e.qos.traffic.app.enabled?{enabled:!0,values:e.qos.traffic.app.app_ids}:{enabled:!1,values:[]},domains:e.qos.enabled&&e.qos.traffic.domain.enabled?{enabled:!0,values:e.qos.traffic.domain.domains}:{enabled:!1,values:[]},ip_addresses:e.qos.enabled&&e.qos.traffic.ip.enabled?{enabled:!0,values:e.qos.traffic.ip.ips}:{enabled:!1,values:[]},regions:e.qos.enabled&&e.qos.traffic.region.enabled?{enabled:!0,values:e.qos.traffic.region.regions}:{enabled:!1,values:[]},mode:e.qos.enabled?e.qos.limit.mode:Ge.ku.LIMIT,download_limit:e.qos.enabled&&e.qos.limit.mode!==Ge.ku.PRIORITIZE&&e.qos.limit.download.enabled?{enabled:!0,limit:(0,$t.AS)({unit:e.qos.limit.download.unit,value:e.qos.limit.download.value}),burst:e.qos.limit.download.burst}:dn,upload_limit:e.qos.enabled&&e.qos.limit.mode!==Ge.ku.PRIORITIZE&&e.qos.limit.upload.enabled?{enabled:!0,limit:(0,$t.AS)({unit:e.qos.limit.upload.unit,value:e.qos.limit.upload.value}),burst:e.qos.limit.upload.burst}:dn,schedule:e.qos.enabled?cn(e.qos.schedule):void 0}}),_n=e=>{const{unit:t,value:n}=(0,$t.xN)(e?.limit??sn);return{enabled:e?.enabled||!1,burst:e?.burst||Ge.fP.DISABLED,value:n,unit:t}},An=(e,t)=>({enabled:e?.qos?.enabled??!1,network_id:e?.qos?.network_id??Xt.i,traffic:{all:e?.qos?.all_traffic??!0,app:{enabled:e?.qos?.apps?.enabled??!1,app_ids:(e?.qos?.apps?.values||[]).map(e=>Number(e))},domain:{enabled:e?.qos?.domains?.enabled??!1,domains:e?.qos?.domains?.values||[]},ip:{enabled:e?.qos?.ip_addresses?.enabled??!1,ips:e?.qos?.ip_addresses?.values||[]},region:{enabled:e?.qos?.regions?.enabled??!1,regions:e?.qos?.regions?.values||[]}},limit:{mode:e?.qos?.mode??Ge.ku.LIMIT,download:_n(e?.qos?.download_limit),upload:_n(e?.qos?.upload_limit)},schedule:nn(e?.qos?.schedule,t)}),Tn=(e,t,n,a)=>({name:e?.name||"",source:e?.target_type===Ge.zb.USERS?{type:re.USERS,user_ids:e.targets||[]}:e?.target_type===Ge.zb.NETWORKS?{type:re.NETWORKS,network_ids:e.targets||[]}:e?.target_type===Ge.zb.GROUPS?{type:re.CLIENTS,network_member_group_id:e.targets?.[0],macs:t.find(t=>t.id===e.targets?.[0])?.members||[]}:{type:re.CLIENTS,macs:e?.targets||[]},secure:{enabled:e?.secure?.enabled??!1,internet:{mode:e?.secure?.internet?.mode??Ge.c_.BLOCKLIST,everything:e?.secure?.internet?.everything??!0,app:{enabled:e?.secure?.internet?.apps?.enabled??!1,app_ids:(e?.secure?.internet?.apps?.values||[]).map(e=>Number(e))},domain:{enabled:e?.secure?.internet?.domains?.enabled??!1,domains:e?.secure?.internet?.domains?.values||[]},ip:{enabled:e?.secure?.internet?.ip_addresses?.enabled??!1,ips:e?.secure?.internet?.ip_addresses?.values||[]},region:{enabled:e?.secure?.internet?.regions?.enabled??!1,regions:e?.secure?.internet?.regions?.values||[]},ad_block:{enabled:!1},content_filter:{enabled:!!e?.secure?.internet?.content_filter,id:e?.secure?.internet?.content_filter},schedule:nn(e?.secure?.internet?.schedule,n)},local:{mode:e?.secure?.local&&un[e.secure.local.mode]||oe.INHERIT,everything:e?.secure?.local?.everything??!0,device:{enabled:e?.secure?.local?.devices?.enabled??!1,device_macs:e?.secure?.local?.devices?.values||[]},network:{enabled:e?.secure?.local?.networks?.enabled??!1,ids:e?.secure?.local?.networks?.values||[]},ip_address:{enabled:e?.secure?.local?.ip_addresses?.enabled??!1,ips:e?.secure?.local?.ip_addresses?.values||[]},mac_address:{enabled:e?.secure?.local?.mac_addresses?.enabled??!1,macs:e?.secure?.local?.mac_addresses?.values||[]}}},route:{enabled:e?.route?.enabled??!1,traffic:e?.route?.all_traffic??1?{all:!0}:{all:!1,domain:{enabled:e?.route?.domains?.enabled??!1,domains:e?.route?.domains?.values||[]},ip:{enabled:e?.route?.ip_addresses?.enabled??!1,ips:e?.route?.ip_addresses?.values||[]},region:{enabled:e?.route?.regions?.enabled??!1,regions:e?.route?.regions?.values||[]}},network_id:e?.route?.network_id||a,kill_switch_enabled:e?.route?.kill_switch??!0,schedule:nn(e?.route?.schedule,n)},qos:An(e,n)});var In=n(407814),Sn=n(172972);const On=In.Ik({hour:In.ai(),min:In.ai()}),gn=e=>{let t=In.p6({message:(0,Xe.rn)("SETTINGS_COMMON_DATE_VALIDATION")});return e||(t=t.max(st()(mt.R),{message:(0,Xe.rn)("SETTINGS_COMMON_DATE_VALIDATION")})),t},fn=e=>In.KC([In.Ik({mode:In.eu(rt.Td.ALWAYS)}),In.Ik({mode:In.eu(rt.Td.EVERY_DAY),time_range:In.Ik({start:On,end:On})}),In.Ik({mode:In.eu(rt.Td.EVERY_WEEK),days:In.YO(In.fc(ut.g),{message:(0,Xe.rn)("SETTINGS_ROUTING_QOS_SCHEDULE_SELECT_DAY_VALIDATION")}).min(1,{message:(0,Xe.rn)("SETTINGS_ROUTING_QOS_SCHEDULE_SELECT_DAY_VALIDATION")}),time_range:In.KC([In.Ik({all_day:In.eu(!0)}),In.Ik({all_day:In.eu(!1),start:On,end:On})])}),In.Ik({mode:In.eu(rt.Td.ONE_TIME_ONLY),date:gn(e),time_range:In.Ik({start:On,end:On})}),In.Ik({mode:In.eu(rt.Td.CUSTOM),date_range:In.Ik({start:gn(e),end:gn(e)}),days:In.YO(In.fc(ut.g),{message:(0,Xe.rn)("SETTINGS_ROUTING_QOS_SCHEDULE_SELECT_DAY_VALIDATION")}).min(1,{message:(0,Xe.rn)("SETTINGS_ROUTING_QOS_SCHEDULE_SELECT_DAY_VALIDATION")}),time_range:In.KC([In.Ik({all_day:In.eu(!0)}),In.Ik({all_day:In.eu(!1),start:On,end:On})])})]);var bn=n(532305);const pn=1680,Nn=(0,a.A)(A.A)`
  display: flex;
`,Cn=()=>{const{motif:e}=(0,r.A)(),t=(0,i.W6)(),n=(0,c.useDispatch)(),a=(0,c.useSelector)(I.z),A=(0,c.useSelector)(p.y),y=(0,c.useSelector)(w.Ct),{[d.wS]:U}=(0,i.g)(),P=(0,l.useMemo)(()=>U?a.find(e=>e.id===U):void 0,[a,U]),V=y.find(({wan_networkgroup:e})=>e===Y.C.WAN),G=(0,E.A)(d.Db),x=(0,L.A)(R.Xj.FIREWALL_SCHEDULING_AFTER_2038),F=!!a.length,K=(0,l.useMemo)(()=>(e=>In.Ik({global:In.L5().optional(),name:In.Yj({message:(0,Xe.rn)("COMMON_VALIDATION_NAME_REQUIRED")}).min(1,{message:(0,Xe.rn)("COMMON_VALIDATION_NAME_REQUIRED")}).max(100),source:In.KC([In.Ik({type:In.eu(re.CLIENTS),macs:In.YO(In.Yj()).optional(),network_member_group_id:In.Yj().optional()}).refine(e=>e.macs?.length||e.network_member_group_id,{message:(0,Xe.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM"),path:["macs"]}),In.Ik({type:In.eu(re.NETWORKS),network_ids:In.YO(In.Yj()).min(1)}),In.Ik({type:In.eu(re.USERS),user_ids:In.YO(In.Yj()).min(1)})]),secure:In.KC([In.Ik({enabled:In.eu(!1)}),In.Ik({enabled:In.eu(!0),internet:In.KC([In.Ik({mode:In.eu(Ge.c_.TURN_OFF_INTERNET),schedule:fn(e)}),In.Ik({mode:In.KC([In.eu(Ge.c_.ALLOWLIST),In.eu(Ge.c_.BLOCKLIST)]),everything:In.zM(),app:In.KC([In.Ik({enabled:In.eu(!0),app_ids:In.YO(In.ai()).min(1).max(Ke.KW)}),In.Ik({enabled:In.eu(!1)})]),domain:In.KC([In.Ik({enabled:In.eu(!0),domains:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1)})]),ip:In.KC([In.Ik({enabled:In.eu(!0),ips:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1)})]),region:In.KC([In.Ik({enabled:In.eu(!0),regions:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1)})]),ad_block:In.KC([In.Ik({enabled:In.eu(!0)}),In.Ik({enabled:In.eu(!1)})]),content_filter:In.KC([In.Ik({enabled:In.eu(!0),id:In.Yj().min(1)}),In.Ik({enabled:In.eu(!1)})]),schedule:fn(e)}).refine(e=>e.everything||e.app.enabled||e.domain.enabled||e.ip.enabled||e.region.enabled||e.ad_block.enabled||e.content_filter.enabled,{message:(0,Xe.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM")})]),local:In.KC([In.Ik({mode:In.eu(oe.INHERIT)}),In.Ik({mode:In.eu(oe.QUARANTINE)}),In.Ik({mode:In.KC([In.eu(oe.ALLOWLIST),In.eu(oe.BLOCKLIST)]),everything:In.zM(),device:In.KC([In.Ik({enabled:In.eu(!0),device_macs:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1)})]),network:In.KC([In.Ik({enabled:In.eu(!0),ids:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1)})]),mac_address:In.KC([In.Ik({enabled:In.eu(!0),macs:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1)})]),ip_address:In.KC([In.Ik({enabled:In.eu(!0),ips:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1)})])}).refine(e=>e.everything||e.device.enabled||e.network.enabled||e.mac_address.enabled||e.ip_address.enabled,{message:(0,Xe.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM")})])})]),route:In.KC([In.Ik({enabled:In.eu(!1)}),In.Ik({enabled:In.eu(!0),traffic:In.Ik({all:In.zM(),domain:In.KC([In.Ik({enabled:In.eu(!0),domains:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1).optional().default(!1)})]),ip:In.KC([In.Ik({enabled:In.eu(!0),ips:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1).optional().default(!1)})]),region:In.KC([In.Ik({enabled:In.eu(!0),regions:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1).optional().default(!1)})])}).refine(e=>e.all||e.domain.enabled||e.ip.enabled||e.region.enabled,{message:(0,Xe.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM")}),network_id:In.Yj(),kill_switch_enabled:In.zM().optional().default(!1),sla_id:In.Yj().optional(),schedule:fn(e)})]),qos:In.KC([In.Ik({enabled:In.eu(!1),network_id:In.Yj()}),In.Ik({enabled:In.eu(!0),network_id:In.Yj(),traffic:In.Ik({all:In.zM(),app:In.KC([In.Ik({enabled:In.eu(!0),app_ids:In.YO(In.ai()).min(1).max(Ke.KW)}),In.Ik({enabled:In.eu(!1)})]),domain:In.KC([In.Ik({enabled:In.eu(!0),domains:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1)})]),ip:In.KC([In.Ik({enabled:In.eu(!0),ips:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1)})]),region:In.KC([In.Ik({enabled:In.eu(!0),regions:In.YO(In.Yj()).min(1)}),In.Ik({enabled:In.eu(!1)})])}).refine(e=>e.all||e.app.enabled||e.domain.enabled||e.ip.enabled||e.region.enabled,{message:(0,Xe.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM")}),limit:In.KC([In.Ik({mode:In.eu(Ge.ku.PRIORITIZE)}),In.Ik({mode:In.KC([In.eu(Ge.ku.LIMIT),In.eu(Ge.ku.LIMIT_AND_PRIORITIZE)]),download:In.KC([In.Ik({enabled:In.eu(!1)}),In.Ik({enabled:In.eu(!0),value:In.ai().min(Sn.oS),unit:In.fc($t.FJ),burst:In.fc(Ge.fP)}).refine(e=>(0,$t.AS)({unit:e.unit,value:e.value})<=Sn.Yf,{message:(0,Xe.rn)("SETTINGS_ROUTING_QOS_LIMIT_VALIDATION",{gbps:(0,$t.gr)(Sn.Yf)})})]),upload:In.KC([In.Ik({enabled:In.eu(!1)}),In.Ik({enabled:In.eu(!0),value:In.ai().min(Sn.oS),unit:In.fc($t.FJ),burst:In.fc(Ge.fP)}).refine(e=>(0,$t.AS)({unit:e.unit,value:e.value})<=Sn.Yf,{message:(0,Xe.rn)("SETTINGS_ROUTING_QOS_LIMIT_VALIDATION",{gbps:(0,$t.gr)(Sn.Yf)})})])})]),schedule:fn(e)})])}).refine(e=>e.secure.enabled||e.route.enabled||e.qos.enabled,{message:(0,Xe.rn)("SETTINGS_VALIDATION_ONE_ACTION_REQUIRED"),path:["global"]}))(x),[x]),W=(0,O.m)({schema:K,defaultValues:Tn(P,A,new Date,V?._id)}),H=(0,s.lN)(W),B=!!Object.keys(H.dirtyFields).length,j=W.handleSubmit(e=>n((0,S.ll)({id:P?.id,enabled:P?.enabled??!0,...En(e)})).then(()=>n((0,S.rt)(void 0,{resolveWithExisting:!1}))).then(()=>t.push(G)).then(()=>{n((0,N.fn)()),n((0,C.U9)()),n((0,v.EO)()),n((0,M.X6)())}).catch(e=>{const t=(0,h.F)(e)?e:void 0;n((0,g.ox)({icon:f.C.danger,message:"SETTINGS_OBJECT_MANAGER_FAILED_TO_SAVE",errorMessage:t?.msg,errorValues:t}))}));return l.createElement(l.Fragment,null,B&&!H.isSubmitting?l.createElement(k.A,null):null,l.createElement(D.R1,null,F?null:l.createElement(D.Iq,{maxWidth:"1680px"},l.createElement(bn.A,null)),l.createElement(D.Iq,{maxWidth:"1680px"},l.createElement("form",null,l.createElement(u.A,{flexDirection:"column",gap:_.Ln},l.createElement(u.A,{flexDirection:"row",width:"100%",gap:_.kc,maxWidth:pn},l.createElement(u.A,{flex:"1 1 0",overflowX:"hidden",overflowY:"auto"},l.createElement(De,{form:W,hasObjects:F})),l.createElement(q,null),l.createElement(u.A,{flex:"1 1 0",overflowX:"hidden",overflowY:"auto"},l.createElement(yt,{form:W})),l.createElement(u.A,{flex:"1 1 0",overflowX:"hidden",overflowY:"auto"},l.createElement(Kt,{form:W})),l.createElement(u.A,{flex:"1 1 0",overflowX:"hidden",overflowY:"auto"},l.createElement(Jt,{form:W})))),B||!P?l.createElement(Nn,{isDarkMode:e===T.S.DARK,active:!0},l.createElement(u.A,{flexDirection:"column",width:"100%",gap:_.kc,justifyContent:"flex-end",height:"100%",flex:1},l.createElement(b.A,{form:W,name:"global"}),l.createElement(u.A,{justifyContent:"flex-start",width:"100%",alignItems:"center",gap:_.Ln},l.createElement(o.A,{onPress:()=>{H.isSubmitting||j()},isPending:H.isSubmitting},l.createElement(m.sA,{id:P?"COMMON_ACTION_SAVE":"COMMON_ACTION_ADD"})),B?l.createElement(o.A,{variant:"tertiary-neutral",onPress:()=>W.reset()},l.createElement(m.sA,{id:"COMMON_ACTION_CANCEL"})):null))):null))))}},803983:(e,t,n)=>{n.d(t,{A:()=>S});var a=n(296540),l=n(376618),r=n(784045),o=n(469733),i=n(349785),c=n(217439),s=n(62170),d=n(459449),m=n(239417),u=n(951106),E=n(294303),_=n(703447),A=n(454195);const T={threshold:.1},I=({children:e})=>a.createElement(E.A,{alignItems:"center",height:A.b},a.createElement(c.A,{size:"inherit",color:"inherit"},e));const S=function({form:e,name:t,additionalInfo:n="mac",excludeUnifiDevices:c,getGroup:A,groups:S,...O}){const{formatMessage:g}=(0,d.tz)(),f=(0,i.FH)({control:e.control,name:t}),b=(0,o.useSelector)(m.GB),p=(0,a.useMemo)(()=>{const e=b.filter(e=>!(c&&"unifi_device"in e&&e.unifi_device)),t=(f||[]).filter(t=>!e.some(e=>"mac"in e&&e.mac===t)).map(e=>({mac:e,name:e})),o=[...e,...t].flatMap(e=>"mac"in e?[e]:[]);return(S&&A?(0,r.A)(Object.entries((0,l.A)(o,A)),([e])=>S[e]?.order??0).map(([e,t])=>({id:e,label:S[e]?.label,options:t})).filter(e=>e.options.length>0):[{id:void 0,label:void 0,options:o}]).flatMap(({options:e,label:t,id:l})=>[...t&&l?[{label:a.createElement(I,null,t),value:l,group:l,groupTitle:!0}]:[],...e.map(e=>({label:(0,u.tn)(e),value:e.mac,group:l,image:a.createElement(E.A,{maxWidth:24,maxHeight:24},a.createElement(_.A,{client:e})),additionalInfo:"mac"===n?e.mac:void 0}))])},[n,b.length,f,c]);return a.createElement(s.A,{control:e.control,name:t,options:p,truncateLabels:!0,isWindowed:!0,triggerButtonText:g({id:"COMMON_SELECT"}),searchOptions:T,...O})}},438083:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(296540),l=n(407814),r=n(546391),o=n(263963);const i=l.Yj({message:(0,o.rn)("COMMON_DOMAIN_VALIDATION")}).refine(e=>r.V2.test(e),{message:(0,o.rn)("COMMON_DOMAIN_VALIDATION")});var c=n(459449),s=n(617883);const d=function({form:e,name:t}){const{formatMessage:n}=(0,c.tz)();return a.createElement(s.A,{form:e,name:t,fieldLabel:"COMMON_DOMAIN_NAME",modalTitle:a.createElement(c.sA,{id:"SETTINGS_ADD_MULTIPLE_DOMAINS"}),modalFieldPlaceholder:n({id:"SETTINGS_ADD_MULTIPLE_DOMAINS_PLACEHOLDER"}),itemSchema:i,placeholder:n({id:"SETTINGS_NETWORKS_FORM_FIELD_DOMAIN_NAME_PLACEHOLDER"}),getDuplicationMessage:()=>n({id:"SETTINGS_SECURITY_DOMAINS_VALIDATION"})})}},741821:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(296540),l=n(459449),r=n(617883);const o=function({form:e,name:t,schema:n,placeholder:o,max:i,label:c="SETTINGS_IP_ADDRESS_SUBNET",disableMultiEdit:s=!1}){const{formatMessage:d}=(0,l.tz)();return a.createElement(r.A,{form:e,name:t,fieldLabel:c,modalTitle:a.createElement(l.sA,{id:"SETTINGS_ADD_MULTIPLE_IPS"}),modalFieldPlaceholder:d({id:"SETTINGS_ADD_MULTIPLE_IPS_PLACEHOLDER"}),getDuplicationMessage:()=>d({id:"SETTINGS_DUPLICATE_IP_VALIDATION"}),itemSchema:n,placeholder:o??d({id:"COMMON_ENTER_IP_ADDRESS"}),disableMultiEdit:s,max:i})}},21803:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(296540),l=n(469733),r=n(349785),o=n(366188),i=n(62170),c=n(524936),s=n(938325),d=n(459449);const m=function({form:e,name:t,getIsNetworkVisible:n,getDisabledReason:m,additionalInfo:u,getOptionLabel:E,..._}){const{formatMessage:A}=(0,d.tz)(),T=(0,l.useSelector)(o.Ct),I=(0,r.FH)({control:e.control,name:t}),S=(0,a.useMemo)(()=>T.filter(e=>n(e)||I?.includes(e._id)).map(e=>{const t=!!I?.includes(e._id)?void 0:m?.(e);return{label:E?.(e)||e.name,value:e._id,disabled:!!t,tooltipDescription:t,tooltipPosition:"left",tooltipPortal:!0,additionalInfo:"subnet"===u?(0,c.mC)(e):"vlan"===u?(0,s.mM)(e.vlan,(0,c.nz)(e))?.toString():void 0}}),[T,n,I,m,E,u]);return a.createElement(i.A,{control:e.control,name:t,options:S,truncateLabels:!0,..._,triggerButtonText:A({id:"COMMON_SELECT"})})}},438794:(e,t,n)=>{function a(e){return{...e}}n.d(t,{k:()=>a})},504779:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(271856),l=n(296540),r=n(641777),o=n(284428);const i=({reasons:e,reason:t,children:n,isInteractive:i,noWrap:c})=>{const s=(0,o.pv)(),d=[t,...e||[]].filter(Boolean)[0]||null,m=!!d;return l.createElement(r.A,{isDisabled:{fields:m,labels:m,tooltipIcons:m,tooltipPopovers:!s.fields&&m}},l.createElement(a.A,{description:s.fields?null:d,portal:!0,isInteractive:i,noWrap:c},n))}},910778:(e,t,n)=>{n.d(t,{e:()=>i});var a=n(407814),l=n(383653),r=n(149133),o=n(263963);const i=a.Yj({message:(0,o.rn)("COMMON_VALIDATION_IPV4_IPV6_SUBNET")}).refine(e=>(0,r.N7)(e)||(0,l.dS)(e),{message:(0,o.rn)("COMMON_VALIDATION_IPV4_IPV6_SUBNET")}).refine(e=>(0,r.N7)(e)||(0,l.vS)({excludeIpv4Mapped:!0})(e),{message:(0,o.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_IPV4_MAPPED_IPV6_INVALID")}).refine(e=>(0,r.N7)(e)||(0,l.vS)({excludeMulticast:!0})(e),{message:(0,o.rn)("SETTINGS_NETWORKS_IPV6_ADDRESS_MULTICAST_INVALID")})},19607:(e,t,n)=>{n.d(t,{V:()=>o});var a=n(407814),l=n(546391),r=n(263963);const o=a.Yj({message:(0,r.rn)("SETTINGS_ACL_RULES_MAC_VALIDATION_GENERIC")}).refine(e=>l.b8.test(e),{message:(0,r.rn)("SETTINGS_ACL_RULES_MAC_VALIDATION_GENERIC")})}}]);