"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[4802],{492421:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Ma});var n=a(71479),l=a(296540),r=a(325898),o=a(74750),i=a(956347),c=a(469733),s=a(349785),d=a(959341),m=a(459449),u=a(294303),E=a(928085),_=a(566723),A=a(211083),T=a(825032),I=a(498837),S=a(432680),O=a(949147),g=a(675359),N=a(742920),p=a(332431),f=a(861509),b=a(414783),C=a(915334),v=a(529888),M=a(551735),R=a(464265),L=a(598796),h=a(38671),D=a(46420),k=a(664475),w=a(822336),y=a(58891),U=a(61902);const P="-14px",Y=(0,n.A)("div")`
  display: flex;
  justify-content: center;
  align-items: center;
  border: ${({theme:{themeName:e}})=>w.Ay[`desktop-border-divider-${e}`]};
  width: ${_.Er};
  max-height: ${_.Er};
  border-radius: ${w.Ay["desktop-radius-base"]};
  margin-left: ${P};
  margin-right: ${P};
  margin-top: ${"19px"};
  background: ${U.L};
  z-index: 1;
`,G=(0,n.A)(y.A)`
  color: ${({theme:{themeName:e}})=>w.Ay[`desktop-color-neutral-05-${e}`]};
`,V=()=>l.createElement(Y,null,l.createElement(G,null));var x=a(424226),F=a(629318);const q=(0,a(51946).w)(e=>(0,l.createElement)("svg",(0,F.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 K=a(678853),W=a(698131),H=a(421289),B=a(132196),j=a(895424),$=a(454195),Q=a(72892),z=a(196010);const X=(0,n.A)(Q.A)`
  color: ${({theme:{themeName:e}})=>w.Ay[`desktop-color-neutral-08-${e}`]};
`,Z=(0,n.A)(z.A)`
  display: flex;
  align-items: center;
  width: ${_.S2};
`,J=({linkTo:e})=>l.createElement(Z,{to:e},l.createElement(X,{size:"large"}));var ee,te;!function(e){e.CLIENTS="clients",e.NETWORKS="networks",e.USERS="users"}(ee||(ee={})),function(e){e.INHERIT="INHERIT",e.ALLOWLIST="ALLOWLIST",e.BLOCKLIST="BLOCKLIST",e.QUARANTINE="QUARANTINE"}(te||(te={}));var ae=a(75585),ne=a(592563),le=a(141979),re=a(239417),oe=a(823084),ie=a(198494),ce=a(984652),se=a(592510),de=a(703447),me=a(951106),ue=a(845030),Ee=a(398300),_e=a(918060);const Ae=B.AH`
  display: flex;
  flex: 1;
  &,
  * {
    overflow: hidden;
  }
  div {
    max-width: 100%;
    display: flex;
    flex: 1;
  }
`,Te=(0,n.A)(u.A,{shouldForwardProp:e=>"isHovered"!==e})`
  width: 100%;
  margin-left: auto;
  visibility: ${({isHovered:e})=>e?"visible":"hidden"};
`,Ie={height:"429px"},Se={minHeight:"500px"},Oe="group",ge="mac",Ne=({form:e})=>{const{formatMessage:t}=(0,m.tz)(),a=(0,c.useDispatch)(),n=(0,c.useSelector)(ie.lW),r=(0,c.useSelector)(re.GB),o=(0,c.useSelector)(f.y),{field:i}=(0,s.as)({control:e.control,name:"source"}),E=i.value?.type===ee.CLIENTS?i.value.network_member_group_id:void 0,A=i.value?.type===ee.CLIENTS?i.value.macs:void 0,T=(0,l.useMemo)(()=>E?o.find(e=>e.id===E):void 0,[o,E]);(0,l.useEffect)(()=>{a((0,ce.$3)(void 0,{crudCacheStrategy:{type:se.e.CACHE}})),a((0,ce.QG)({queryParams:{withinHours:n}},{crudCacheStrategy:{type:se.e.CACHE}}))},[a,n]);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:`${Oe}${e.id}`,title:e.name,checkboxProps:{isDisabled:T&&T.id!==e.id,className:Ae,data:({isHovered:t})=>l.createElement(Te,{isHovered:t},l.createElement(le.A,{actionable:!0,size:"original",onClick:t=>{t.preventDefault(),t.stopPropagation(),a((0,ue.XP)({type:Ee.H.NETWORK_MEMBERS_GROUP,id:e.id}))}}))},children:[]})),{type:"CUSTOM",render:()=>l.createElement(ne.A,{onPress:()=>a((0,ue.XP)({type:Ee.H.NETWORK_MEMBERS_GROUP,id:d.R6})),fontSize:"medium"},l.createElement(u.A,{alignItems:"center",gap:_.kc},l.createElement(ae.A,null),l.createElement(m.sA,{id:"SETTINGS_CREATE_GROUP"}))),children:[],id:"create-item",title:t({id:"SETTINGS_CREATE_GROUP"})},{id:"clients",type:"SECTION",title:"Clients",children:[]},...I.map(e=>({type:"CHECKBOX",id:`${ge}${e.mac}`,title:(0,me.tn)(e)||e.mac,children:[],checkboxProps:{symbol:l.createElement(de.A,{client:e,width:20,height:20,style:{opacity:T?.4:void 0,width:"20px",height:"20px"}}),isDisabled:!!T}}))],[I,a,t,o,T]),O=(0,l.useMemo)(()=>new Set(i.value?.type===ee.CLIENTS?[...i.value.network_member_group_id?[`${Oe}${i.value.network_member_group_id}`]:(i.value.macs||[]).map(e=>`${ge}${e}`)]:[]),[i.value]),g=(0,l.useCallback)(e=>{const t=Array.from(e),a=t.find(e=>"string"==typeof e&&e.startsWith(Oe))?.replace(Oe,"")||void 0;a?i.onChange({...i.value,network_member_group_id:a}):!a&&i.value?.type===ee.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(ge)?[e.replace(ge,"")]:[])})},[i]),N=(0,l.useCallback)(()=>{const e=new Set(i.value?.type===ee.CLIENTS?i.value?.macs:[]);return I.every(t=>e?.has(t.mac))},[I,i.value]),b=(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(_e.A.Full,{items:S,selectedKeys:O,isAllSelected:N,onSelectionChange:g,onSelectAll:b,onDeselectAll:C,treeProps:Ie,style:Se})),l.createElement(p.A,{form:e,name:"source.macs"}),l.createElement(oe.A,null,l.createElement(m.sA,{id:"SETTINGS_OBJECT_DEVICE_INFO"})))};var pe=a(524936),fe=a(366188);const be=({form:e})=>{const t=(0,c.useSelector)(fe.Ct),a=(0,l.useMemo)(()=>t.filter(e=>(0,pe.xv)(e)&&(0,pe.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(_e.A.Full,{items:a,selectedKeys:t,onSelectionChange:t=>e.onChange(Array.from(t)),onSelectAll:()=>e.onChange(a.map(e=>e.id)),onDeselectAll:()=>e.onChange([]),isAllSelected:()=>a.every(e=>t.has(e.id)),treeProps:{height:"429px"},style:{minHeight:"500px"}})}}),l.createElement(p.A,{form:e,name:"source.network_ids"}))},Ce=B.AH`
  padding: ${_.xO} ${_.Ln};
`,ve=({isSelected:e,onSelect:t,Icon:a,label:n,isDisabled:r})=>l.createElement(H.A,{description:r?l.createElement(m.sA,{id:"COMMON_BADGE_COMING_SOON"}):void 0},l.createElement(u.A,{flex:1},l.createElement(W.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(a,{size:"original",isActive:e}),n)))),Me=({form:e,hasObjects:t})=>{const a=(0,s.FH)({control:e.control,name:"source.type"}),n=(0,E.A)(d.Db);return l.createElement(K.A,{headerTitle:null,className:Ce},l.createElement(u.A,{flexDirection:"column",width:"100%",gap:_.kc},l.createElement(u.A,{alignItems:"flex-start"},t?l.createElement(u.A,{height:$.b,marginRight:_.kc},l.createElement(J,{linkTo:n})):null,l.createElement(j.A,{control:e.control,name:"name",placeholder:(0,m.tz)().formatMessage({id:"COMMON_NAME"})})),l.createElement(u.A,{width:"100%",gap:_.YC},l.createElement(ve,{isSelected:a===ee.CLIENTS,onSelect:()=>e.setValue("source.type",ee.CLIENTS),Icon:x.A,label:l.createElement(m.sA,{id:"COMMON_DEVICES"})}),l.createElement(ve,{isSelected:a===ee.NETWORKS,onSelect:()=>e.setValue("source.type",ee.NETWORKS),Icon:q,label:l.createElement(m.sA,{id:"COMMON_NETWORKS"})})),a===ee.CLIENTS?l.createElement(Ne,{form:e}):a===ee.NETWORKS?l.createElement(be,{form:e}):null))};var Re=a(604569),Le=a(998837),he=a(217439),De=a(641777),ke=a(897502);const we=({form:e,name:t,Icon:a,title:n,children:r,isDisabled:o})=>l.createElement(K.A,{headerTitle:l.createElement(ke.A,{control:e.control,name:`${t}.enabled`,onToggle:a=>{a||"route"!==t||e.trigger("route.network_id")}},l.createElement(u.A,{gap:_.YC,alignItems:"center",marginTop:1},l.createElement(a,{size:"original",color:(0,Le.u)().motifPalette.neutral08}),l.createElement(he.A,{variant:"heading-medium"},n)))},l.createElement(De.A,{isDisabled:!!o},r));var ye=a(907011),Ue=a(553432),Pe=a(610356),Ye=a(611717),Ge=a(977753),Ve=a(784045),xe=a(455155),Fe=a(318686),qe=a(994133),Ke=a(62170);const We=function({form:e,name:t,...a}){const n=(0,qe.e)(),r=(0,l.useMemo)(()=>(0,Ve.A)(Fe.hS.map(([e,{name:t,iconFileName:a}])=>({label:t,value:e,image:l.createElement(xe.A,{iconFileName:a})})),e=>e.label),[]);return l.createElement(Ke.A,{options:r,name:t,control:e.control,truncateLabels:!0,maxSelections:Fe.KW,isWindowed:!0,disabled:n,triggerButtonText:l.createElement(m.sA,{id:"COMMON_SELECT"}),...a})};var He=a(741821),Be=a(859510),je=a(263963),$e=a(360847),Qe=a(546391);const ze=$e.Yj({message:(0,je.rn)("COMMON_DOMAIN_VALIDATION")}).refine(e=>Qe.V2.test(e),{message:(0,je.rn)("COMMON_DOMAIN_VALIDATION")});const Xe=function({form:e,name:t}){const a=(0,qe.e)(),n=(0,je.L_)();return l.createElement(s.xI,{control:e.control,name:t,render:({field:e,fieldState:t,formState:r})=>l.createElement(Be.A,{disabled:a,value:e.value||[],onChange:t=>e.onChange(t),invalid:t.invalid?n((0,s.Jt)(r.errors,e.name)?.message)||!0:void 0,labels:{fieldLabel:"COMMON_DOMAIN_NAME",modalTitle:"SETTINGS_ADD_MULTIPLE_DOMAINS",modalFieldPlaceholder:["SETTINGS_ADD_MULTIPLE_DOMAINS_PLACEHOLDER"]},fieldValidation:{duplicateMessageId:"SETTINGS_VALUE_UNIQUE",validate:e=>{const t=ze.safeParse(e);if(t.success)return!0;const a=t.error.issues[0];return!a||l.createElement(l.Fragment,null,n(a.message))}},extraFieldConfig:{placeholder:"SETTINGS_NETWORKS_FORM_FIELD_DOMAIN_NAME_PLACEHOLDER"}})})};var Ze=a(242366),Je=a(958979);const et=function({form:e,name:t,...a}){const n=(0,qe.e)();return l.createElement(Ke.A,{options:Je.Ay,name:t,control:e.control,truncateLabels:!0,maxSelections:Fe.KW,isWindowed:!0,disabled:n,triggerButtonText:l.createElement(m.sA,{id:"COMMON_SELECT"}),...a})};var tt=a(961386),at=a(552315),nt=a(910778);const lt=(0,tt.S)([at.Z,nt.e],{message:(0,je.rn)("SETTINGS_IP_OR_SUBNET_REQUIRED")});var rt=a(208288),ot=a(349665),it=a(317672),ct=a(16914),st=a(12207),dt=a(515893),mt=a(596221),ut=a.n(mt);const Et=function({control:e,name:t,label:a,maxValue:n,minValue:r}){const o=(0,je.L_)();return l.createElement(s.xI,{control:e,name:t,render:({field:e,fieldState:i,formState:c})=>l.createElement(ot.A,null,l.createElement(dt.A,{label:a,value:e.value?{start:(0,rt.A)(ut()(e.value.start),"CalendarDate"),end:(0,rt.A)(ut()(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:n,isInvalid:i.invalid}),i.invalid?l.createElement(st.A,{style:{padding:0}},o((0,s.Jt)(c.errors,t)?.message)):null)})};var _t=a(660989),At=a(564981),Tt=a(446400);const It=function({control:e,name:t,label:a,maxValue:n,minValue:r}){const o=(0,je.L_)();return l.createElement(s.xI,{control:e,name:t,render:({field:e,fieldState:i,formState:c})=>l.createElement(ot.A,null,l.createElement(Tt.A,{label:a,value:e.value?(0,rt.A)(ut()(e.value),"CalendarDate"):void 0,onChange:t=>e.onChange(t?new Date(t.toString()):void 0),minValue:r,maxValue:n,isInvalid:i.invalid}),i.invalid?l.createElement(st.A,{style:{padding:0}},o((0,s.Jt)(c.errors,t)?.message)):null)})};var St=a(480024);const Ot=function({control:e,name:t,value:a,children:n,disabled:r}){const o=(0,qe.e)();return l.createElement(s.xI,{key:a,control:e,name:t,render:({field:e})=>{const i=r??o??e.disabled;return l.createElement(St.A,{key:a,id:t+a,name:t+a,type:"checkbox",toggleBoxVariant:"secondary",onChange:t=>{e.onChange(e.value?.includes(a)?e.value.filter(e=>e!==a):[...e.value||[],a])},checked:e.value?.includes(a),disabled:i,value:a},n)}})};var gt=a(143401);const Nt=function({control:e,name:t,label:a,width:n=70}){const r=(0,c.useSelector)(ie.jc),o=(0,qe.e)();return l.createElement(s.xI,{control:e,name:t,render:({field:e})=>l.createElement(u.A,{gap:_.YC},l.createElement(gt.A,{variant:"secondary",use24h:r,width:n,label:a,disabled:o,value:e.value,onChange:(t,a)=>e.onChange(a)}))})};var pt=a(888247);const ft={[At.g.MON]:"COMMON_DAY_SHORTER_MONDAY",[At.g.TUE]:"COMMON_DAY_SHORTER_TUESDAY",[At.g.WED]:"COMMON_DAY_SHORTER_WEDNESDAY",[At.g.THU]:"COMMON_DAY_SHORTER_THURSDAY",[At.g.FRI]:"COMMON_DAY_SHORTER_FRIDAY",[At.g.SAT]:"COMMON_DAY_SHORTER_SATURDAY",[At.g.SUN]:"COMMON_DAY_SHORTER_SUNDAY"},bt=({form:e,name:t})=>{const a=(0,qe.e)(),{formatMessage:n}=(0,m.tz)(),r=(0,R.A)(L.Xj.FIREWALL_SCHEDULING_AFTER_2038),o=(0,c.useSelector)(ie.jc),i=(0,s.FH)({control:e.control,name:`${t}.mode`}),d=(0,s.FH)({control:e.control,name:`${t}.time_range.all_day`});return l.createElement(Ze.A,null,l.createElement(ot.A,null,l.createElement(it.A,{wrapperProps:a?{opacity:_.xN}:void 0,htmlFor:t},l.createElement(m.sA,{id:"COMMON_SCHEDULE"})),l.createElement(Ue.A,null,l.createElement(Pe.A,{control:e.control,name:`${t}.mode`,value:ct.Td.ALWAYS},l.createElement(m.sA,{id:"COMMON_ALWAYS"})),l.createElement(Pe.A,{control:e.control,name:`${t}.mode`,value:ct.Td.EVERY_DAY},l.createElement(m.sA,{id:"COMMON_INTERVAL_DAILY"})),l.createElement(Pe.A,{control:e.control,name:`${t}.mode`,value:ct.Td.EVERY_WEEK},l.createElement(m.sA,{id:"COMMON_INTERVAL_WEEKLY"})),l.createElement(Pe.A,{control:e.control,name:`${t}.mode`,value:ct.Td.ONE_TIME_ONLY},l.createElement(m.sA,{id:"COMMON_INTERVAL_ONE_TIME"})),l.createElement(Pe.A,{control:e.control,name:`${t}.mode`,value:ct.Td.CUSTOM},l.createElement(m.sA,{id:"COMMON_CUSTOM"})))),i===ct.Td.CUSTOM?l.createElement(Et,{name:`${t}.date_range`,control:e.control,minValue:(0,rt.A)(new Date,"CalendarDate"),maxValue:r?void 0:(0,rt.A)(_t.R,"CalendarDate"),label:n({id:"COMMON_DATE_RANGE"})}):null,i===ct.Td.EVERY_WEEK||i===ct.Td.CUSTOM?l.createElement(ot.A,null,l.createElement(it.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(At.g).map(a=>l.createElement(Ot,{key:a,value:a,control:e.control,name:`${t}.days`},l.createElement(m.sA,{id:ft[a]})))),l.createElement(u.A,{minHeight:24,alignItems:"center"},l.createElement(ke.A,{control:e.control,name:`${t}.time_range.all_day`},l.createElement(pt.A,null,l.createElement(m.sA,{id:"COMMON_ALL_DAY"}))))),l.createElement(p.A,{form:e,name:`${t}.days`})):null,i===ct.Td.ONE_TIME_ONLY?l.createElement(It,{minValue:(0,rt.A)(new Date,"CalendarDate"),maxValue:r?void 0:(0,rt.A)(_t.R,"CalendarDate"),label:n({id:"COMMON_DATE"}),control:e.control,name:`${t}.date`}):null,i===ct.Td.EVERY_DAY||i===ct.Td.EVERY_WEEK&&!d||i===ct.Td.ONE_TIME_ONLY||i===ct.Td.CUSTOM&&!d?l.createElement(u.A,{gap:_.kc,flexDirection:o?"row":"column"},l.createElement(Nt,{width:"full",label:l.createElement(m.sA,{id:"COMMON_START_TIME"}),control:e.control,name:`${t}.time_range.start`}),l.createElement(Nt,{width:"full",label:l.createElement(m.sA,{id:"COMMON_END_TIME"}),control:e.control,name:`${t}.time_range.end`})):null)};var Ct=a(231755);const vt=({label:e,Icon:t})=>{const{motifPalette:{neutral03:a,neutral08:n}}=(0,Le.u)();return l.createElement(u.A,{height:$.b,alignItems:"center",width:"100%"},l.createElement(u.A,{gap:2,background:a,padding:"2px",paddingRight:_.kc,paddingLeft:_.YC,borderRadius:$.b,alignItems:"center",opacity:(0,qe.e)()?_.xN:void 0},l.createElement(t,{size:"medium",color:n}),l.createElement(he.A,{variant:"body-secondary",size:"small"},e)),l.createElement(Ct.A,{orientation:"horizontal",style:{flex:1}}))},Mt=({form:e})=>{const t=(0,O.k)((0,s.FH)({control:e.control,name:"secure.internet"}));return l.createElement(l.Fragment,null,l.createElement(vt,{label:l.createElement(m.sA,{id:"COMMON_INTERNET"}),Icon:ye.A}),l.createElement(Ue.A,null,l.createElement(Pe.A,{control:e.control,name:"secure.internet.mode",value:Ye.c_.BLOCKLIST},l.createElement(m.sA,{id:"SETTINGS_BLOCK_LIST"})),l.createElement(Pe.A,{control:e.control,name:"secure.internet.mode",value:Ye.c_.ALLOWLIST},l.createElement(m.sA,{id:"SETTINGS_ALLOW_LIST"})),l.createElement(Pe.A,{control:e.control,name:"secure.internet.mode",value:Ye.c_.TURN_OFF_INTERNET},l.createElement(m.sA,{id:"SETTINGS_TURN_OFF_INTERNET"}))),t.mode===Ye.c_.BLOCKLIST||t.mode===Ye.c_.ALLOWLIST?l.createElement(Ge.A,{rowGap:_.YC},l.createElement(ke.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(Ze.A,{gap:_.YC},l.createElement(ke.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"})),t.app?.enabled?l.createElement(We,{form:e,name:"secure.internet.app.app_ids",narrowTrigger:!0}):null),l.createElement(Ze.A,null,l.createElement(ke.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"})),t.domain?.enabled?l.createElement(Xe,{form:e,name:"secure.internet.domain.domains"}):null),l.createElement(ke.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"})),t.ip?.enabled?l.createElement(He.A,{form:e,name:"secure.internet.ip.ips",schema:lt,placeholder:"SETTINGS_IP_ADDRESS_OR_SUBNET"}):null,l.createElement(Ze.A,{gap:_.YC},l.createElement(ke.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"})),t.region?.enabled?l.createElement(et,{form:e,name:"secure.internet.region.regions",narrowTrigger:!0}):null)):null,l.createElement(p.A,{form:e,name:"secure.internet"}),l.createElement(bt,{form:e,name:"secure.internet.schedule"}))};var Rt=a(948177),Lt=a(803983),ht=a(21803),Dt=a(19607),kt=a(400261);const wt=function({form:e,name:t}){const a=(0,qe.e)(),n=(0,je.L_)();return l.createElement(s.xI,{control:e.control,name:t,render:({field:e,fieldState:t,formState:r})=>l.createElement(Be.A,{disabled:a,value:e.value||[],onChange:t=>e.onChange(t),invalid:t.invalid?n((0,s.Jt)(r.errors,e.name)?.message)||!0:void 0,labels:{fieldLabel:"COMMON_MAC_ADDRESS",modalTitle:"SETTINGS_SECURITY_ADD_MULTIPLE_MACS",modalFieldPlaceholder:["SETTINGS_SECURITY_MULTIPLE_MACS_PLACEHOLDER"]},fieldValidation:{duplicateMessageId:"SETTINGS_VALUE_UNIQUE",validate:e=>{const t=Dt.V.safeParse(e);if(t.success)return!0;const a=t.error.issues[0];return!a||l.createElement(l.Fragment,null,n(a.message))}},extraFieldConfig:{placeholder:"SETTINGS_COMMON_ENTER_MAC_ADDRESS",parser:e=>(0,kt.Z)(e?.[0].target?.value)}})})};var yt=a(504779);const Ut=({form:e})=>{const t=(0,O.k)((0,s.FH)({control:e.control,name:"secure.local"})||{}),a=(0,R.A)(L.Xj.SWITCH_CUSTOM_ACL_RULES);return l.createElement(l.Fragment,null,l.createElement(vt,{label:l.createElement(m.sA,{id:"COMMON_LOCAL"}),Icon:Rt.A}),l.createElement(Ue.A,null,l.createElement(Pe.A,{control:e.control,name:"secure.local.mode",value:te.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(yt.A,{reason:a||t.mode===te.BLOCKLIST?void 0:l.createElement(m.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"})},l.createElement(Pe.A,{control:e.control,name:"secure.local.mode",value:te.BLOCKLIST},l.createElement(m.sA,{id:"SETTINGS_BLOCK_LIST"}))),l.createElement(yt.A,{reason:a||t.mode===te.ALLOWLIST?void 0:l.createElement(m.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"})},l.createElement(Pe.A,{control:e.control,name:"secure.local.mode",value:te.ALLOWLIST},l.createElement(m.sA,{id:"SETTINGS_ALLOW_LIST"}))),l.createElement(yt.A,{reason:a||t.mode===te.QUARANTINE?void 0:l.createElement(m.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"})},l.createElement(Pe.A,{control:e.control,name:"secure.local.mode",value:te.QUARANTINE},l.createElement(m.sA,{id:"SETTINGS_QUARANTINE"})))),t.mode!==te.QUARANTINE?l.createElement(De.A,{isDisabled:t.mode===te.INHERIT},l.createElement(Ge.A,{rowGap:_.YC},l.createElement(ke.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(yt.A,{reason:a||t.device?.enabled?void 0:l.createElement(m.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"}),noWrap:!0},l.createElement(Ze.A,{gap:_.YC},l.createElement(ke.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(Lt.A,{form:e,name:"secure.local.device.device_macs",narrowTrigger:!0}):null)),l.createElement(Ze.A,{gap:_.YC},l.createElement(ke.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(ht.A,{form:e,name:"secure.local.network.ids",getIsNetworkVisible:e=>(0,pe.xv)(e)&&!(0,pe.$q)(e)&&!(0,pe.uH)(e),additionalInfo:"subnet",narrowTrigger:!0}):null),l.createElement(yt.A,{reason:a||t.mac_address?.enabled?void 0:l.createElement(m.sA,{id:"SETTINGS_POLICY_TYPE_ACL_UNSUPPORTED"}),noWrap:!0},l.createElement(Ze.A,{gap:_.YC},l.createElement(ke.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(wt,{form:e,name:"secure.local.mac_address.macs"}):null)),l.createElement(ke.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(He.A,{form:e,name:"secure.local.ip_address.ips",schema:lt,placeholder:"SETTINGS_IP_ADDRESS_OR_SUBNET"}):null)):null,l.createElement(p.A,{form:e,name:"secure.local"}))},Pt=({form:e})=>{const t=(0,s.FH)({control:e.control,name:"secure.enabled"});return l.createElement(we,{Icon:Re.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(Mt,{form:e}),l.createElement(Ut,{form:e})))};var Yt=a(1571),Gt=a(188738),Vt=a(532419),xt=a(430329),Ft=a(739354),qt=a(594827),Kt=a(118517);const Wt=function({form:e,name:t,label:a,tabs:n,tooltip:r}){const o=(0,qe.e)();return l.createElement(s.xI,{control:e.control,name:t,render:({field:i})=>l.createElement(ot.A,null,a?l.createElement(it.A,{labelProps:{disabled:o},htmlFor:t,tooltip:r,tooltipProps:{isDisabled:o,iconProps:{opacity:o?_.xN:void 0}}},a):null,l.createElement(u.A,{alignItems:"center",justifyContent:"flex-start"},l.createElement(Kt.A,{id:t,variant:"filter",tabs:n,selectedTab:i.value||null,onSelectTab:({id:e})=>i.onChange(e),disabled:o,ref:i.ref})),l.createElement(p.A,{form:e,name:t}))})},Ht=({form:e})=>{const{formatMessage:t}=(0,m.tz)(),a=(0,c.useSelector)(fe.Ct),n=(0,c.useSelector)(Vt.AL),r=(0,R.A)(L.Xj.OPENVPN_CLIENT_TRAFFIC_ROUTES),o=(0,R.A)(L.Xj.TRAFFIC_ROUTES_OPENVPN_S2S_VPN),i=(0,R.A)(L.Xj.TRAFFIC_ROUTES_IPSEC_S2S_VPN),s=(0,R.A)(L.Xj.TRAFFIC_ROUTES_WIREGUARD_S2S_VPN),d=(0,R.A)(L.Xj.WAN_MAGIC),u=(0,qe.e)(),E=(0,l.useMemo)(()=>({isOpenVpnTrafficRoutesSupported:r,isSiteToSiteOpenVpnTrafficRoutesSupported:o,isSiteToSiteIpsecTrafficRoutesSupported:i,isSiteToSiteWireguardTrafficRoutesSupported:s,networks:a}),[r,i,o,s,a]),A=(0,l.useMemo)(()=>a.filter(e=>(0,xt.kY)(e,E)&&!(0,pe.ok)(e)),[E,a]),T=(0,l.useMemo)(()=>{const e=a.filter(e=>{const t=(0,xt.kY)(e,E)&&!(0,pe.ok)(e),a=(0,xt.XD)(e,E);return!(!t&&!a)});return(0,Ft.MG)(e,t,n?.name,e=>{const t=(0,xt.XD)(e,E);return{disabled:!!t,tooltipDescription:t?l.createElement(m.sA,{id:t}):void 0}},d)},[a,t,n?.name,d,E]);return A.length<=3&&A.every(e=>(0,pe.jp)(e)&&!(0,pe._L)(e))?l.createElement(Wt,{form:e,name:"route.network_id",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"}),tabs:A.map(e=>({id:e._id,label:l.createElement(m.sA,{id:"COMMON_NETWORK_PURPOSE_WANX",values:{number:void 0!==e.wan_networkgroup?(0,qt.si)(e.wan_networkgroup):void 0}})}))}):l.createElement(Gt.A,{control:e.control,name:"route.network_id",options:T,label:l.createElement("span",{style:{opacity:u?_.xN:void 0}},l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_FORM_INTERFACE_S2S_VPN"})),tooltip:l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_SOURCE_INTERFACE_DESCRIPTION"}),tooltipProps:{isDisabled:u,iconProps:{style:{opacity:u?_.xN:void 0}}},placeholder:t({id:"SETTINGS_TRAFFIC_ROUTES_INTERFACE_SELECT"}),renderOption:Ft.Ku,portal:!0})},Bt=({form:e})=>{const t=(0,R.A)(L.Xj.TRAFFIC_ROUTE_KILL_SWITCH),a=(0,s.FH)({control:e.control,name:"route"}),n=(0,O.k)(a),r=!n?.enabled;return l.createElement(we,{Icon:Yt.A,form:e,name:"route",title:l.createElement(m.sA,{id:"COMMON_ROUTE"}),isDisabled:r},l.createElement(Ze.A,null,l.createElement(Ge.A,{rowGap:_.YC},l.createElement(ke.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(Ze.A,null,l.createElement(ke.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"})),n.traffic?.domain?.enabled?l.createElement(Xe,{form:e,name:"route.traffic.domain.domains"}):null),l.createElement(ke.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"})),n.traffic?.ip?.enabled?l.createElement(He.A,{form:e,name:"route.traffic.ip.ips",schema:lt,placeholder:"SETTINGS_IP_ADDRESS_OR_SUBNET"}):null,l.createElement(Ze.A,{gap:_.YC},l.createElement(ke.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"})),n.traffic?.region?.enabled?l.createElement(et,{form:e,name:"route.traffic.region.regions",narrowTrigger:!0}):null)),l.createElement(p.A,{form:e,name:"route.traffic"}),l.createElement(Ht,{form:e}),t?l.createElement(ke.A,{control:e.control,name:"route.kill_switch_enabled",tooltip:l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_FORM_FALLBACK_TOOLTIP"}),tooltipProps:{isDisabled:r,iconProps:{style:{opacity:r?_.xN:void 0}}}},l.createElement(m.sA,{id:"COMMON_KILL_SWITCH"})):null))};var jt=a(985550),$t=a(821580),Qt=a(66804),zt=a(222190),Xt=a(797336);const Zt=[1,10,25,50,75,100,250,500,750,1e3],Jt=({name:e,form:t})=>{const{formatMessage:a}=(0,m.tz)(),n=(0,s.FH)({control:t.control,name:e}),r=Zt.findIndex(e=>e>(n?.enabled&&n.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:$.b,alignItems:"center"},l.createElement(Qt.A,{step:1,value:o,minValue:0,maxValue:Zt.length-1,style:{width:"100%"},onChange:a=>t.setValue(`${e}.value`,Zt[Math.floor(Number(a))]||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(zt.A,{control:t.control,name:`${e}.value`})),l.createElement(u.A,{flex:1,flexDirection:"column"},l.createElement(Gt.A,{control:t.control,name:`${e}.unit`,options:[{value:Xt.FJ.MBPS,label:a({id:"SETTINGS_ROUTING_QOS_MBPS"})},{value:Xt.FJ.KBPS,label:a({id:"SETTINGS_ROUTING_QOS_KBPS"})}]}))),l.createElement(p.A,{form:t,name:e})))};var ea=a(942374),ta=a(513180);const aa=({form:e})=>{const{formatMessage:t}=(0,m.tz)(),a=e.formState.defaultValues?.qos?.network_id,n=(0,c.useSelector)(fe.Ct),r=(0,R.A)(L.Xj.WAN_MAGIC),o=(0,qe.e)(),i=(0,l.useMemo)(()=>(0,ea.v)(!0,n,t,r,a),[n,t,r,a]);return i.length<=5&&i.every(e=>e.value===ea.i||e.wan_networkgroup)?l.createElement(Wt,{form:e,name:"qos.network_id",label:l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_FORM_INTERFACE_S2S_VPN"}),tabs:i.map(e=>({id:e.value,label:e.value===ea.i||e?.wan_networkgroup===ta.C.WAN_MAGIC?e.label:l.createElement(m.sA,{id:"COMMON_NETWORK_PURPOSE_WANX",values:{number:void 0!==e.wan_networkgroup?(0,qt.si)(e.wan_networkgroup):void 0}})}))}):l.createElement(Gt.A,{portal:!0,control:e.control,name:"qos.network_id",options:i,label:l.createElement("span",{style:{opacity:o?_.xN:void 0}},l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_FORM_INTERFACE_S2S_VPN"})),tooltip:l.createElement(m.sA,{id:"SETTINGS_TRAFFIC_ROUTES_SOURCE_INTERFACE_DESCRIPTION"}),tooltipProps:{isDisabled:o,iconProps:{style:{opacity:o?_.xN:void 0}}},placeholder:t({id:"SETTINGS_TRAFFIC_ROUTES_INTERFACE_SELECT"}),renderOption:Ft.Ku})},na=({form:e})=>{const t=(0,s.FH)({control:e.control,name:"qos.enabled"}),a=(0,O.k)((0,s.FH)({control:e.control,name:"qos"}));return l.createElement(we,{Icon:jt.A,form:e,name:"qos",title:l.createElement(m.sA,{id:"COMMON_QOS"}),isDisabled:!t},l.createElement(Ze.A,null,l.createElement(ot.A,null,l.createElement(Ge.A,{rowGap:_.YC},l.createElement(ke.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(Ze.A,{gap:_.YC},l.createElement(ke.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(We,{form:e,name:"qos.traffic.app.app_ids",narrowTrigger:!0}):null),l.createElement(Ze.A,null,l.createElement(ke.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(Xe,{form:e,name:"qos.traffic.domain.domains"}):null),l.createElement(ke.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(He.A,{form:e,name:"qos.traffic.ip.ips",schema:lt,placeholder:"SETTINGS_IP_ADDRESS_OR_SUBNET"}):null,l.createElement(Ze.A,{gap:_.YC},l.createElement(ke.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(et,{form:e,name:"qos.traffic.region.regions",narrowTrigger:!0}):null)),l.createElement(p.A,{form:e,name:"qos.traffic"})),l.createElement(aa,{form:e}),l.createElement(Ue.A,null,l.createElement(Pe.A,{control:e.control,name:"qos.limit.mode",value:Ye.ku.LIMIT},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_LIMIT"})),l.createElement(Pe.A,{control:e.control,name:"qos.limit.mode",value:Ye.ku.PRIORITIZE},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_OBJECTIVE_PRIORITIZE"})),l.createElement(Pe.A,{control:e.control,name:"qos.limit.mode",value:Ye.ku.LIMIT_AND_PRIORITIZE},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_OBJECTIVE_PRIORITIZE_AND_LIMIT"}))),[Ye.ku.LIMIT,Ye.ku.LIMIT_AND_PRIORITIZE].includes(a.limit?.mode)?l.createElement(l.Fragment,null,l.createElement($t.A,null,l.createElement(ke.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(Jt,{name:"qos.limit.download",form:e}):null,a.limit?.download?.enabled?l.createElement(ot.A,null,l.createElement(it.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(Ue.A,null,l.createElement(Pe.A,{control:e.control,name:"qos.limit.download.burst",value:Ye.fP.DISABLED},l.createElement(m.sA,{id:"COMMON_OFF"})),l.createElement(Pe.A,{control:e.control,name:"qos.limit.download.burst",value:Ye.fP.SHORT},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_BURST_SHORT"})),l.createElement(Pe.A,{control:e.control,name:"qos.limit.download.burst",value:Ye.fP.LONG},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_BURST_LONG"})))):null,l.createElement($t.A,null,l.createElement(ke.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(Jt,{name:"qos.limit.upload",form:e}):null,a.limit?.upload?.enabled?l.createElement(ot.A,null,l.createElement(it.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(Ue.A,null,l.createElement(Pe.A,{control:e.control,name:"qos.limit.upload.burst",value:Ye.fP.DISABLED},l.createElement(m.sA,{id:"COMMON_OFF"})),l.createElement(Pe.A,{control:e.control,name:"qos.limit.upload.burst",value:Ye.fP.SHORT},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_BURST_SHORT"})),l.createElement(Pe.A,{control:e.control,name:"qos.limit.upload.burst",value:Ye.fP.LONG},l.createElement(m.sA,{id:"SETTINGS_ROUTING_QOS_BURST_LONG"})))):null):null,l.createElement(bt,{form:e,name:"qos.schedule"})))};var la=a(348466);const ra=(e,t=new Date)=>{try{return e?ut()(e,"YYYY-MM-DD",t):t}catch{return t}},oa=(e,t)=>{const a=e?.time_range_start?.split(la.oH)??["09","00"],n=e?.time_range_end?.split(la.oH)??["12","00"];return{mode:e?.mode??ct.Td.ALWAYS,date:ra(e?.date,t),time_range:{all_day:e?.time_all_day||!1,start:{hour:Number(a[0])||0,min:Number(a[1])||0},end:{hour:Number(n[0])||0,min:Number(n[1])||0}},date_range:{start:ra(e?.date_start,t),end:ra(e?.date_end,t)},days:e?.repeat_on_days||[]}};var ia=a(966353),ca=a.n(ia);const sa="YYYY-MM-DD",da=e=>e?`${(e.hour||0).toString().padStart(2,"0")}:${(e.min||0).toString().padStart(2,"0")}`:void 0,ma=e=>{switch(e.mode){case ct.Td.EVERY_DAY:return{mode:ct.Td.EVERY_DAY,time_range_start:da(e.time_range.start),time_range_end:da(e.time_range.end)};case ct.Td.EVERY_WEEK:return{mode:ct.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:da(e.time_range.start),time_range_end:e.time_range?.all_day||!("end"in e.time_range)?void 0:da(e.time_range.end)};case ct.Td.ONE_TIME_ONLY:return{mode:ct.Td.ONE_TIME_ONLY,date:e.date?ca()(e.date,sa):void 0,time_range_start:da(e.time_range.start),time_range_end:da(e.time_range.end)};case ct.Td.CUSTOM:return{mode:ct.Td.CUSTOM,date_start:e.date_range.start?ca()(e.date_range.start,sa):void 0,date_end:e.date_range.end?ca()(e.date_range.end,sa):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:da(e.time_range.start),time_range_end:e.time_range?.all_day||!("end"in e.time_range)?void 0:da(e.time_range.end)};default:return{mode:ct.Td.ALWAYS}}},ua=(0,Xt.ck)(10),Ea={enabled:!1,limit:ua,burst:Ye.fP.DISABLED},_a={[te.ALLOWLIST]:Ye.c_.ALLOWLIST,[te.BLOCKLIST]:Ye.c_.BLOCKLIST},Aa={[Ye.c_.ALLOWLIST]:te.ALLOWLIST,[Ye.c_.BLOCKLIST]:te.BLOCKLIST,[Ye.c_.QUARANTINE]:te.QUARANTINE,[Ye.c_.TURN_OFF_INTERNET]:te.QUARANTINE},Ta=e=>({name:e.name,target_type:e.source.type===ee.CLIENTS?e.source.network_member_group_id?Ye.zb.GROUPS:Ye.zb.CLIENTS:e.source.type===ee.NETWORKS?Ye.zb.NETWORKS:Ye.zb.USERS,targets:e.source.type===ee.CLIENTS?e.source.network_member_group_id?[e.source.network_member_group_id]:e.source.macs||[]:e.source.type===ee.NETWORKS?e.source.network_ids:e.source.user_ids,secure:{enabled:e.secure.enabled,internet:e.secure.enabled?e.secure.internet.mode===Ye.c_.TURN_OFF_INTERNET?{mode:Ye.c_.TURN_OFF_INTERNET,schedule:ma(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:ma(e.secure.internet.schedule)}:{mode:Ye.c_.BLOCKLIST,everything:!0},local:!e.secure.enabled||e.secure.local.mode!==te.ALLOWLIST&&e.secure.local.mode!==te.BLOCKLIST?e.secure.enabled&&e.secure.local.mode===te.QUARANTINE?{mode:Ye.c_.QUARANTINE}:void 0:{mode:_a[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!==ea.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:Ye.ku.LIMIT,download_limit:e.qos.enabled&&e.qos.limit.mode!==Ye.ku.PRIORITIZE&&e.qos.limit.download.enabled?{enabled:!0,limit:(0,Xt.AS)({unit:e.qos.limit.download.unit,value:e.qos.limit.download.value}),burst:e.qos.limit.download.burst}:Ea,upload_limit:e.qos.enabled&&e.qos.limit.mode!==Ye.ku.PRIORITIZE&&e.qos.limit.upload.enabled?{enabled:!0,limit:(0,Xt.AS)({unit:e.qos.limit.upload.unit,value:e.qos.limit.upload.value}),burst:e.qos.limit.upload.burst}:Ea,schedule:e.qos.enabled?ma(e.qos.schedule):void 0}}),Ia=e=>{const{unit:t,value:a}=(0,Xt.xN)(e?.limit??ua);return{enabled:e?.enabled||!1,burst:e?.burst||Ye.fP.DISABLED,value:a,unit:t}},Sa=(e,t)=>({enabled:e?.qos?.enabled??!1,network_id:e?.qos?.network_id??ea.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??Ye.ku.LIMIT,download:Ia(e?.qos?.download_limit),upload:Ia(e?.qos?.upload_limit)},schedule:oa(e?.qos?.schedule,t)}),Oa=(e,t,a)=>({name:e?.name||"",source:e?.target_type===Ye.zb.USERS?{type:ee.USERS,user_ids:e.targets||[]}:e?.target_type===Ye.zb.NETWORKS?{type:ee.NETWORKS,network_ids:e.targets||[]}:e?.target_type===Ye.zb.GROUPS?{type:ee.CLIENTS,network_member_group_id:e.targets?.[0],macs:t.find(t=>t.id===e.targets?.[0])?.members||[]}:{type:ee.CLIENTS,macs:e?.targets||[]},secure:{enabled:e?.secure?.enabled??!1,internet:{mode:e?.secure?.internet?.mode??Ye.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:oa(e?.secure?.internet?.schedule,a)},local:{mode:e?.secure?.local&&Aa[e.secure.local.mode]||te.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,kill_switch_enabled:e?.route?.kill_switch??!0,schedule:oa(e?.route?.schedule,a)},qos:Sa(e,a)});var ga=a(172972);const Na=$e.Ik({hour:$e.ai(),min:$e.ai()}),pa=e=>{let t=$e.p6({message:(0,je.rn)("SETTINGS_COMMON_DATE_VALIDATION")});return e||(t=t.max(ut()(_t.R),{message:(0,je.rn)("SETTINGS_COMMON_DATE_VALIDATION")})),t},fa=e=>$e.KC([$e.Ik({mode:$e.eu(ct.Td.ALWAYS)}),$e.Ik({mode:$e.eu(ct.Td.EVERY_DAY),time_range:$e.Ik({start:Na,end:Na})}),$e.Ik({mode:$e.eu(ct.Td.EVERY_WEEK),days:$e.YO($e.fc(At.g),{message:(0,je.rn)("SETTINGS_ROUTING_QOS_SCHEDULE_SELECT_DAY_VALIDATION")}).min(1,{message:(0,je.rn)("SETTINGS_ROUTING_QOS_SCHEDULE_SELECT_DAY_VALIDATION")}),time_range:$e.KC([$e.Ik({all_day:$e.eu(!0)}),$e.Ik({all_day:$e.eu(!1),start:Na,end:Na})])}),$e.Ik({mode:$e.eu(ct.Td.ONE_TIME_ONLY),date:pa(e),time_range:$e.Ik({start:Na,end:Na})}),$e.Ik({mode:$e.eu(ct.Td.CUSTOM),date_range:$e.Ik({start:pa(e),end:pa(e)}),days:$e.YO($e.fc(At.g),{message:(0,je.rn)("SETTINGS_ROUTING_QOS_SCHEDULE_SELECT_DAY_VALIDATION")}).min(1,{message:(0,je.rn)("SETTINGS_ROUTING_QOS_SCHEDULE_SELECT_DAY_VALIDATION")}),time_range:$e.KC([$e.Ik({all_day:$e.eu(!0)}),$e.Ik({all_day:$e.eu(!1),start:Na,end:Na})])})]);var ba=a(532305);const Ca=1680,va=(0,n.A)(A.A)`
  display: flex;
`,Ma=()=>{const{motif:e}=(0,r.A)(),t=(0,i.W6)(),a=(0,c.useDispatch)(),n=(0,c.useSelector)(I.z),A=(0,c.useSelector)(f.y),{[d.wS]:w}=(0,i.g)(),y=(0,l.useMemo)(()=>w?n.find(e=>e.id===w):void 0,[n,w]),U=(0,E.A)(d.Db),P=(0,R.A)(L.Xj.FIREWALL_SCHEDULING_AFTER_2038),Y=!!n.length,G=(0,l.useMemo)(()=>(e=>$e.Ik({global:$e.L5().optional(),name:$e.Yj({message:(0,je.rn)("SETTINGS_COMMON_NAME_REQUIRED")}).min(1,{message:(0,je.rn)("SETTINGS_COMMON_NAME_REQUIRED")}).max(100),source:$e.KC([$e.Ik({type:$e.eu(ee.CLIENTS),macs:$e.YO($e.Yj()).optional(),network_member_group_id:$e.Yj().optional()}).refine(e=>e.macs?.length||e.network_member_group_id,{message:(0,je.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM"),path:["macs"]}),$e.Ik({type:$e.eu(ee.NETWORKS),network_ids:$e.YO($e.Yj()).min(1)}),$e.Ik({type:$e.eu(ee.USERS),user_ids:$e.YO($e.Yj()).min(1)})]),secure:$e.KC([$e.Ik({enabled:$e.eu(!1)}),$e.Ik({enabled:$e.eu(!0),internet:$e.KC([$e.Ik({mode:$e.eu(Ye.c_.TURN_OFF_INTERNET),schedule:fa(e)}),$e.Ik({mode:$e.KC([$e.eu(Ye.c_.ALLOWLIST),$e.eu(Ye.c_.BLOCKLIST)]),everything:$e.zM(),app:$e.KC([$e.Ik({enabled:$e.eu(!0),app_ids:$e.YO($e.ai()).min(1).max(Fe.KW)}),$e.Ik({enabled:$e.eu(!1)})]),domain:$e.KC([$e.Ik({enabled:$e.eu(!0),domains:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1)})]),ip:$e.KC([$e.Ik({enabled:$e.eu(!0),ips:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1)})]),region:$e.KC([$e.Ik({enabled:$e.eu(!0),regions:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1)})]),ad_block:$e.KC([$e.Ik({enabled:$e.eu(!0)}),$e.Ik({enabled:$e.eu(!1)})]),content_filter:$e.KC([$e.Ik({enabled:$e.eu(!0),id:$e.Yj().min(1)}),$e.Ik({enabled:$e.eu(!1)})]),schedule:fa(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,je.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM")})]),local:$e.KC([$e.Ik({mode:$e.eu(te.INHERIT)}),$e.Ik({mode:$e.eu(te.QUARANTINE)}),$e.Ik({mode:$e.KC([$e.eu(te.ALLOWLIST),$e.eu(te.BLOCKLIST)]),everything:$e.zM(),device:$e.KC([$e.Ik({enabled:$e.eu(!0),device_macs:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1)})]),network:$e.KC([$e.Ik({enabled:$e.eu(!0),ids:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1)})]),mac_address:$e.KC([$e.Ik({enabled:$e.eu(!0),macs:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1)})]),ip_address:$e.KC([$e.Ik({enabled:$e.eu(!0),ips:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1)})])}).refine(e=>e.everything||e.device.enabled||e.network.enabled||e.mac_address.enabled||e.ip_address.enabled,{message:(0,je.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM")})])})]),route:$e.KC([$e.Ik({enabled:$e.eu(!1)}),$e.Ik({enabled:$e.eu(!0),traffic:$e.Ik({all:$e.zM(),domain:$e.KC([$e.Ik({enabled:$e.eu(!0),domains:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1).optional().default(!1)})]),ip:$e.KC([$e.Ik({enabled:$e.eu(!0),ips:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1).optional().default(!1)})]),region:$e.KC([$e.Ik({enabled:$e.eu(!0),regions:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1).optional().default(!1)})])}).refine(e=>e.all||e.domain.enabled||e.ip.enabled||e.region.enabled,{message:(0,je.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM")}),network_id:$e.Yj(),kill_switch_enabled:$e.zM().optional().default(!1),sla_id:$e.Yj().optional(),schedule:fa(e)})]),qos:$e.KC([$e.Ik({enabled:$e.eu(!1)}),$e.Ik({enabled:$e.eu(!0),network_id:$e.Yj(),traffic:$e.Ik({all:$e.zM(),app:$e.KC([$e.Ik({enabled:$e.eu(!0),app_ids:$e.YO($e.ai()).min(1).max(Fe.KW)}),$e.Ik({enabled:$e.eu(!1)})]),domain:$e.KC([$e.Ik({enabled:$e.eu(!0),domains:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1)})]),ip:$e.KC([$e.Ik({enabled:$e.eu(!0),ips:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1)})]),region:$e.KC([$e.Ik({enabled:$e.eu(!0),regions:$e.YO($e.Yj()).min(1)}),$e.Ik({enabled:$e.eu(!1)})])}).refine(e=>e.all||e.app.enabled||e.domain.enabled||e.ip.enabled||e.region.enabled,{message:(0,je.rn)("COMMON_SELECT_AT_LEAST_ONE_ITEM")}),limit:$e.KC([$e.Ik({mode:$e.eu(Ye.ku.PRIORITIZE)}),$e.Ik({mode:$e.KC([$e.eu(Ye.ku.LIMIT),$e.eu(Ye.ku.LIMIT_AND_PRIORITIZE)]),download:$e.KC([$e.Ik({enabled:$e.eu(!1)}),$e.Ik({enabled:$e.eu(!0),value:$e.ai().min(ga.oS),unit:$e.fc(Xt.FJ),burst:$e.fc(Ye.fP)}).refine(e=>(0,Xt.AS)({unit:e.unit,value:e.value})<=ga.Yf,{message:(0,je.rn)("SETTINGS_ROUTING_QOS_LIMIT_VALIDATION",{gbps:(0,Xt.gr)(ga.Yf)})})]),upload:$e.KC([$e.Ik({enabled:$e.eu(!1)}),$e.Ik({enabled:$e.eu(!0),value:$e.ai().min(ga.oS),unit:$e.fc(Xt.FJ),burst:$e.fc(Ye.fP)}).refine(e=>(0,Xt.AS)({unit:e.unit,value:e.value})<=ga.Yf,{message:(0,je.rn)("SETTINGS_ROUTING_QOS_LIMIT_VALIDATION",{gbps:(0,Xt.gr)(ga.Yf)})})])})]),schedule:fa(e)})])}).refine(e=>e.secure.enabled||e.route.enabled||e.qos.enabled,{message:(0,je.rn)("SETTINGS_VALIDATION_ONE_ACTION_REQUIRED"),path:["global"]}))(P),[P]),x=(0,O.m)({schema:G,defaultValues:Oa(y,A,new Date)}),F=(0,s.lN)(x),q=!!Object.keys(F.dirtyFields).length,K=x.handleSubmit(e=>a((0,S.ll)({id:y?.id,enabled:y?.enabled??!0,...Ta(e)})).then(()=>a((0,S.rt)(void 0,{resolveWithExisting:!1}))).then(()=>t.push(U)).then(()=>{a((0,b.fn)()),a((0,C.U9)()),a((0,v.EO)()),a((0,M.X6)())}).catch(e=>{const t=(0,h.F)(e)?e:void 0;a((0,g.ox)({icon:N.C.danger,message:"SETTINGS_OBJECT_MANAGER_FAILED_TO_SAVE",errorMessage:t?.msg,errorValues:t}))}));return l.createElement(l.Fragment,null,q&&!F.isSubmitting?l.createElement(k.A,null):null,l.createElement(D.R1,null,Y?null:l.createElement(D.Iq,{maxWidth:"1680px"},l.createElement(ba.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:Ca},l.createElement(u.A,{flex:"1 1 0",overflowX:"hidden",overflowY:"auto"},l.createElement(Me,{form:x,hasObjects:Y})),l.createElement(V,null),l.createElement(u.A,{flex:"1 1 0",overflowX:"hidden",overflowY:"auto"},l.createElement(Pt,{form:x})),l.createElement(u.A,{flex:"1 1 0",overflowX:"hidden",overflowY:"auto"},l.createElement(Bt,{form:x})),l.createElement(u.A,{flex:"1 1 0",overflowX:"hidden",overflowY:"auto"},l.createElement(na,{form:x})))),q||!y?l.createElement(va,{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(p.A,{form:x,name:"global"}),l.createElement(u.A,{justifyContent:"flex-start",width:"100%",alignItems:"center",gap:_.Ln},l.createElement(o.A,{onPress:()=>{F.isSubmitting||K()},isPending:F.isSubmitting},l.createElement(m.sA,{id:y?"COMMON_ACTION_SAVE":"COMMON_ACTION_ADD"})),q?l.createElement(o.A,{variant:"tertiary-neutral",onPress:()=>x.reset()},l.createElement(m.sA,{id:"COMMON_ACTION_CANCEL"})):null))):null))))}},803983:(e,t,a)=>{a.d(t,{A:()=>S});var n=a(296540),l=a(376618),r=a(784045),o=a(469733),i=a(349785),c=a(217439),s=a(62170),d=a(459449),m=a(239417),u=a(951106),E=a(294303),_=a(703447),A=a(454195);const T={threshold:.1},I=({children:e})=>n.createElement(E.A,{alignItems:"center",height:A.b},n.createElement(c.A,{size:"inherit",color:"inherit"},e));const S=function({form:e,name:t,additionalInfo:a="mac",excludeUnifiDevices:c,getGroup:A,groups:S,...O}){const{formatMessage:g}=(0,d.tz)(),N=(0,i.FH)({control:e.control,name:t}),p=(0,o.useSelector)(m.GB),f=(0,n.useMemo)(()=>{const e=p.filter(e=>!(c&&"unifi_device"in e&&e.unifi_device)),t=(N||[]).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:n.createElement(I,null,t),value:l,group:l,groupTitle:!0}]:[],...e.map(e=>({label:(0,u.tn)(e),value:e.mac,group:l,image:n.createElement(E.A,{maxWidth:24,maxHeight:24},n.createElement(_.A,{client:e})),additionalInfo:"mac"===a?e.mac:void 0}))])},[a,p.length,N,c]);return n.createElement(s.A,{control:e.control,name:t,options:f,truncateLabels:!0,isWindowed:!0,triggerButtonText:g({id:"COMMON_SELECT"}),searchOptions:T,...O})}},741821:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(296540),l=a(349785),r=a(16914),o=a(859510),i=a(994133),c=a(263963);const s=function({form:e,name:t,schema:a,placeholder:s}){const d=(0,i.e)(),m=(0,c.L_)();return n.createElement(l.xI,{control:e.control,name:t,render:({field:e,fieldState:t,formState:i})=>n.createElement(o.A,{disabled:d,value:e.value||[],onChange:t=>e.onChange(t),invalid:t.invalid?m((0,l.Jt)(i.errors,e.name)?.message)||!0:void 0,labels:{fieldLabel:"SETTINGS_IP_ADDRESS_SUBNET",modalTitle:"SETTINGS_ADD_MULTIPLE_IPS",modalFieldPlaceholder:["SETTINGS_ADD_MULTIPLE_IPS_PLACEHOLDER"]},fieldValidation:{duplicateMessageId:"SETTINGS_DUPLICATE_IP_VALIDATION",validate:e=>{const t=a.safeParse(e);if(t.success)return!0;const l=t.error.issues[0];return!l||n.createElement(n.Fragment,null,m(l.message))}},extraFieldConfig:{placeholder:s??"COMMON_ENTER_IP_ADDRESS",placeholderValues:{version:r.oi.IPV4}}})})}},910778:(e,t,a)=>{a.d(t,{e:()=>i});var n=a(360847),l=a(383653),r=a(149133),o=a(263963);const i=n.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,a)=>{a.d(t,{V:()=>o});var n=a(360847),l=a(546391),r=a(263963);const o=n.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")})},961386:(e,t,a)=>{a.d(t,{S:()=>l});var n=a(360847);function l(e,{message:t}){return n.Ie(t=>n.KC(e).safeParse(t).success,{message:t})}}}]);