"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[28445],{815879(e,i,t){t.d(i,{A:()=>l});var n=t(602086),a=t(141992);const l=(0,t(272338).w)(e=>(0,n.createElement)("svg",(0,a.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H4Zm8 8a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-4Z",fill:"currentColor",className:e.twotonedclassname}),(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 4h4v4H4V4ZM3 4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4Zm9 8h4v4h-4v-4Zm-1 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-4Zm1.854-4.854L11.707 6H16v3.5a.5.5 0 0 0 1 0v-4a.5.5 0 0 0-.5-.5h-4.793l1.147-1.146a.5.5 0 0 0-.708-.708l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708ZM8.293 15H3.5a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 1 0V14h4.293l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L8.293 15Z",fill:"currentColor",className:e.baseclassname}),(0,n.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H4Zm7 9a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-4Zm1.854-4.854L11.707 6H16v3.5a.5.5 0 0 0 1 0v-4a.5.5 0 0 0-.5-.5h-4.793l1.147-1.146a.5.5 0 0 0-.708-.708l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708ZM8.293 15H3.5a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 1 0V14h4.293l-1.147-1.146a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L8.293 15Z",fill:"currentColor",className:e.fillclassname})))},446863(e,i,t){t.d(i,{H5:()=>o,Lq:()=>r,n0:()=>s});var n=t(909924),a=t(573534),l=t(172205);const s=e=>e[l.U.SHARED][a.N.PROPERTY_PANEL]?.[n.Io.TAB_GET_DATA_FUNCTION]||{},r=e=>e[l.U.SHARED][a.N.PROPERTY_PANEL]?.[n.Io.TAB_SUBMIT_FUNCTION]||{},o=e=>e[l.U.SHARED][a.N.PROPERTY_PANEL]?.[n.Io.TAB_RESET_FUNCTION]||{}},535322(e,i,t){t.d(i,{A:()=>u,I:()=>n});var n,a=t(274934),l=t(814557),s=t(158885),r=t(247816),o=t(565527),_=t(309130),d=t(100978),m=t(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const c=(0,r.A)(d.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:i,theme:{themeName:t}})=>e||l.Ay[t===o.S.DARK?`desktop-color-neutral-${i?"00":"01"}-${o.S.DARK}`:`desktop-color-neutral-${i?"01":"00"}-${o.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:i})=>i||(e?`0 ${_.Ln}`:_.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||_.Ln};
  ${({margin:e})=>e?`margin: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  width: ${({width:e="100%"})=>e};
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  ${({isButtonList:e})=>e?`\n    > div {\n      display: flex;\n      height: 48px;\n      border-bottom: ${({theme:{themeName:e}})=>l.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,A=(0,r.A)(s.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:i,theme:{themeName:t}})=>e||l.Ay[t===o.S.DARK?`desktop-color-neutral-${i?"00":"01"}-${o.S.DARK}`:`desktop-color-neutral-${i?"01":"00"}-${o.S.LIGHT}`]};
  margin-bottom: ${({theme:e,marginBottom:i})=>i||e.spacing["spacing-l"]};
  ${({margin:e})=>e?`margin: ${e};`:""}
  ${({padding:e})=>e?`padding: ${e};`:""}
  border-radius: 8px;
  flex-direction: column;
  flex: ${({flex:e=0})=>e};
  > :last-child {
    margin-bottom: 0;
  }
  thead {
    tr {
      height: 32px !important;
    }
    th {
      text-transform: none;
    }
  }
  > li {
    > div:first-child {
      background: ${({background:e,theme:{themeName:i}})=>e||l.Ay[i===o.S.DARK?`desktop-color-neutral-01-${o.S.DARK}`:`desktop-color-neutral-00-${o.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${_.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${_.Ln} ${_.Ln};
      }
    }
  }
`,u=({type:e,marginBottom:i,margin:t,padding:l,flex:s,width:r,nested:o,..._})=>"items"in _?(0,a.jsx)(A,{marginBottom:i,margin:t,padding:l,flex:s,nested:o,..._}):(0,a.jsx)(c,{nested:o,width:r,marginBottom:i,margin:t,padding:l,flex:s,isButtonList:e===n.BUTTON_LIST,..._,children:_.children})},250266(e,i,t){t.d(i,{A:()=>d});var n=t(274934),a=t(602086),l=t(696264),s=t(409844),r=t(521376),o=t(309130),_=t(470070);const d=({children:e=null,title:i,titleValues:t,message:d,messageValues:m,handleConfirm:c=()=>null,handleClose:A=()=>null,handleCancel:u,isOpen:p,buttonVariant:E="primary",cancelButtonVariant:h="tertiary",cancelButtonMessage:I="COMMON_ACTION_CANCEL",buttonMessage:b="COMMON_ACTION_CONFIRM",buttonDisabled:N=!1,position:O="top",offset:x,showHeaderClose:C=!1,contentClassName:f="",body:v,titleBody:T,className:g,rootClose:R=!1,footerActions:w})=>{const M=(0,a.useCallback)(e=>{p&&(e.stopPropagation(),e.key===r.U.ENTER?c():e.key===r.U.ESCAPE&&A(!1))},[p,c,A]);(0,a.useEffect)(()=>(window.addEventListener("keydown",M,!0),()=>{window.removeEventListener("keydown",M,!0)}),[M]);const j=(0,a.useCallback)(()=>{A(!1),u?.()},[A,u]),y=(0,a.useCallback)(()=>{A(!1),c()},[A,c]),D=(0,a.useMemo)(()=>[{text:(0,n.jsx)(_.sA,{id:I}),variant:h,onClick:j},{text:(0,n.jsx)(_.sA,{id:b}),disabled:N,variant:E,onClick:y}],[b,E,I,h,j,y,N]),L=(0,a.useCallback)(()=>{A(!1)},[A]),S=s.AH`
    ${i?"":`margin-top: ${o.xO}`}
  `;return(0,n.jsx)(l.A,{title:i?(0,n.jsx)(_.sA,{id:i,values:t}):T||null,...d?{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_.sA,{id:d,values:m}),v]})}:{body:v},position:O,portal:!0,offset:x,actions:w||D,showHeaderClose:C,contentClassName:s.AH`
        ${S}
        ${f}
      `,onRequestClose:L,isOpen:p,allowOverflow:!0,rootClose:R,className:g,children:e})}},637084(e,i,t){t.d(i,{A:()=>h});var n=t(274934),a=t(602086),l=t(843871),s=t(977872),r=t(418398),o=t(205521),_=t(232410),d=t(1469),m=t(260288),c=t(619619),A=t(876809),u=t(113454),p=t(621309);const E=(0,l.bk)({enableReinitialize:!0,mapPropsToValues:({powerSupervisor:e,device:i})=>({powerSupervisor:(0,c.f)(e,(0,u.lD)(i,e))}),handleSubmit:(e,{resetForm:i})=>i({values:e}),validationSchema:A.A}),h=(0,r.Zz)((0,s.Ng)((e,{device:{mac:i}})=>({powerSupervisor:(0,_.x0)(i)(e)})))(E(({powerSupervisor:e,device:i,setFormDirty:t,setFormInvalid:l,validateForm:r,values:_,resetForm:c,dirty:A,isValid:u,formName:E=m.r8})=>{const h=(0,s.wA)();return(0,a.useEffect)(()=>(h((0,o.uo)({[E]:()=>({})})),h((0,o.Oo)({[E]:()=>{r().then(i=>{Object.keys(i).length||h((0,p.A)(e?.id,_.powerSupervisor))})}})),h((0,o.rW)({[E]:c})),()=>{h((0,o.uo)({[E]:null})),h((0,o.Oo)({[E]:null})),h((0,o.rW)({[E]:null}))}),[h,c,_.powerSupervisor,E,r,e?.id]),(0,a.useEffect)(()=>{t?.(E,A),l?.(E,!u)},[t,A,l,u,E]),(0,n.jsx)(d.A,{device:i})}))},876809(e,i,t){t.d(i,{A:()=>l,q:()=>a});var n=t(950804);const a=n.A.object().shape({power_sources:n.A.array().transform(e=>e.filter(e=>e.power_source_mac)).of(n.A.object().shape({client_psu_index:n.A.number().required(),power_source_mac:n.A.string().label("COMMON_POWER_SOURCE").required(),power_source_index:n.A.string().label("COMMON_OUTLET").required()})).label("COMMON_POWER_SOURCE").min(1)}).optional(),l=n.A.object().shape({powerSupervisor:a})},148561(e,i,t){t.d(i,{A:()=>T,g:()=>f});var n=t(274934),a=t(418398),l=t(977872),s=t(602086),r=t(843871),o=t(938984),_=t(950804),d=t(309130),m=t(589650),c=t(977663),A=t(120197),u=t(100978),p=t(205521),E=t(470070),h=t(291935),I=t(197571),b=t(956978),N=t(34118),O=t(550521),x=t(21265),C=t(336128);const f="network",v=(0,r.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:{config_network:e,model:i,ip:t,switch_vlan_enabled:n,mgmt_network_id:a,connection_network_id:l},nativeNetworks:s})=>{const r=(0,b.U$e)(s,l);return{config_network:{type:e?.type||m.NL.DHCP,ip:e?.ip||t||"",netmask:e?.netmask||r?.netmask||"",gateway:e?.gateway||r?.ip||"",dns1:e?.dns1||r?.dns1||"",dns2:e?.dns2||r?.dns2||"",dnssuffix:e?.dnssuffix||"",bonding_enabled:e?.bonding_enabled||!1},mgmt_network_id:(0,b.ewD)(s,a),switch_vlan_enabled:n||!1,...((0,b.C6C)({model:i}),{})}},handleSubmit:(e,{resetForm:i})=>{i({values:e})},validationSchema:({honeypotNetworksIps:e,clients:i})=>_.A.object().shape({config_network:(0,c.d)(e,i),mgmt_network_id:_.A.string(),lte_limit_enabled:_.A.boolean().label("COMMON_LTE_DATA_LIMIT"),lte_limit:_.A.number().integer().label("COMMON_DATA_LIMIT").when("lte_limit_enabled",{is:!0,then:_.A.number().min(1).required().label("COMMON_DATA_LIMIT")})})}),T=(0,a.Zz)((0,l.Ng)(e=>({nativeNetworks:(0,I.Tn)(e),honeypotNetworksIps:(0,h.Yk)(e),clients:(0,N.A8)(e)})),v)(({setFormDirty:e,setFormInvalid:i,dirty:t,values:a,resetForm:r,isValid:_,initialValues:c,activeItem:h,nativeNetworks:I,hideNetworkOverride:N,formName:v=f})=>{const T=(0,l.wA)(),g=(0,b.iQS)(h.model),R=(0,b.C6C)(h);(0,s.useEffect)(()=>{e(f,t),i(f,!_)},[e,i,t,_]);const w=(0,b.moU)(h);(0,s.useEffect)(()=>(T((0,p.uo)({[v]:()=>{const e={config_network:a.config_network?.type===m.NL.STATIC?a.config_network:{type:m.NL.DHCP,bonding_enabled:a.config_network?.bonding_enabled},mgmt_network_id:a.mgmt_network_id};return g&&(e.switch_vlan_enabled=a.switch_vlan_enabled,c.switch_vlan_enabled&&!a.switch_vlan_enabled&&h.port_overrides?.length&&(e.port_overrides=(h.port_overrides||[]).map(({portconf_id:e,...i})=>i))),e}})),T((0,p.Oo)({[v]:()=>r({values:a})})),T((0,p.rW)({[v]:r})),()=>{T((0,p.uo)({[v]:null})),T((0,p.Oo)({[v]:null})),T((0,p.rW)({[v]:null}))}),[T,r,a,v,h.port_overrides,c.switch_vlan_enabled,g,R]);const M=!N&&!w&&I.length>1&&!(0,b.q82)({model:h.model})&&!(0,b.xQi)({model:h.model});return(0,n.jsxs)(u.A,{flexDirection:"column",gap:d.S2,children:[M?(0,n.jsx)(O.A,{nativeNetworks:I,activeItemMac:h.mac}):null,(0,n.jsx)(C.A,{}),a.config_network?.type===m.NL.STATIC?(0,n.jsx)(x.A,{}):null,(0,b.xyH)(h)||(0,b.Eyk)(h)||(0,b._iI)(h)||(0,b.W46)(h)?(0,n.jsx)(u.A,{children:(0,n.jsx)(A.A,{name:"config_network.bonding_enabled",type:"realCheckbox",children:(0,n.jsx)(E.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_AGGREGATION"})})}):null,g?(0,n.jsxs)(u.A,{flexDirection:"column",gap:d.kc,children:[(0,n.jsx)(o.A,{weight:"bold",size:"medium",children:(0,n.jsx)(E.sA,{id:"COMMON_VLAN"})}),(0,n.jsxs)(u.A,{justifyContent:"space-between",children:[(0,n.jsx)(o.A,{size:"medium",children:(0,n.jsx)(E.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_VLAN"})}),(0,n.jsx)(A.A,{type:"checkbox",name:"switch_vlan_enabled"})]})]}):null,null]})})},290298(e,i,t){t.d(i,{A:()=>f,I:()=>O});var n=t(274934),a=t(977872),l=t(602086),s=t(843871),r=t(729736),o=t(938984),_=t(831721),d=t(950804),m=t(309130),c=t(120197),A=t(796091),u=t(100978),p=t(205521),E=t(470070),h=t(333015),I=t(419151),b=t(171056),N=t(570866);const O="cellular",x=[...new Array(b.Ay.SOFT_LIMIT_MAX_GB)].map((e,i)=>({value:i+1,label:`${i+1} GB`})),C={[I.eX.Pap]:"COMMON_PAP",[I.eX.Chap]:"COMMON_CHAP",[I.eX.PapChap]:"COMMON_PAP_CHAP",[I.eX.None]:"COMMON_NONE"},f=(0,s.bk)({enableReinitialize:!0,mapPropsToValues:({limited:e,apn:i="",sim_pin:t,is_sim_pin_required:n,sim_pin_tries_left:a,username:l,password:s,auth_type:o,roaming:_,data_limit_enabled:d=!1,soft_limit:m=(e?x[0].value:0),data_warning_enabled:c=!1,hard_limit:A=0})=>({apn:i,is_sim_pin_required:n,sim_pin_tries_left:a,sim_pin:t,username:l,password:s,auth_type:o,roaming:_,data_limit_enabled:e||d,soft_limit:new r.Un(m,"bytes","IEC",3).value,data_warning_enabled:c,hard_limit:new r.Un(A,"bytes","IEC",3).value}),validationSchema:({limited:e=!1})=>d.A.lazy(()=>d.A.object().shape({apn:d.A.string().when("is_sim_pin_required",{is:!1,then:d.A.string().label("COMMON_APN_ADDRESS").matches(N._j,{message:(0,n.jsx)(E.sA,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_VALID_APN_ADDRESS"})}).required()}),sim_pin:d.A.string().when("is_sim_pin_required",{is:!0,then:d.A.string().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_PIN").matches(N.mw,{message:(0,n.jsx)(E.sA,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_VALID_PIN"})}).required()}),username:d.A.string().label("COMMON_LABEL_USERNAME"),password:d.A.string().label("COMMON_PASSWORD"),auth_type:d.A.string().label("COMMON_AUTH_TYPE").oneOf([I.eX.Pap,I.eX.Chap,I.eX.PapChap,I.eX.None]),roaming:d.A.boolean().label("COMMON_ROAMING").optional(),data_limit_enabled:d.A.boolean().label("COMMON_LTE_DATA_LIMIT"),soft_limit:d.A.number().integer((0,n.jsx)(E.sA,{id:"COMMON_VALIDATION_WHOLE_NUMBER"})).max(b.Ay.MAX_DATA_LIMIT_GB).when("data_limit_enabled",{is:!0,then:e?d.A.number().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_WARNING").oneOf(x.map(({value:e})=>e)).required():d.A.number().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_WARNING").min(0).required()}),data_warning_enabled:d.A.boolean().label("COMMON_LTE_DATA_WARNING"),hard_limit:d.A.number().max(b.Ay.MAX_DATA_LIMIT_GB).when("data_limit_enabled",{is:!0,then:d.A.number().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_LIMIT").min(0).required().integer((0,n.jsx)(E.sA,{id:"COMMON_VALIDATION_WHOLE_NUMBER"}))}).when(["soft_limit"],(i,t)=>t.min(e?0:i>=0&&i,(0,n.jsx)(E.sA,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_LIMIT_ERROR"})))})),handleSubmit:()=>null})(({mac:e,limited:i,values:t,dirty:s,isValid:r,errors:d,touched:b,resetForm:N,setFormDirty:f,setFormInvalid:v,setFieldTouched:T,setFieldValue:g,formName:R=O,isDirty:w,validateField:M,submitPayloadConverter:j,hideRoaming:y,onFormSubmit:D})=>{const L=(0,a.wA)(),{formatMessage:S}=(0,E.tz)(),P=(0,l.useMemo)(()=>Object.values(I.eX).map(e=>({label:S({id:C[e]||"COMMON_FALLBACK"}),value:e})),[S]);return(0,l.useEffect)(()=>{L((0,p.uo)({[R]:()=>{if(t.is_sim_pin_required)return null;const e={...t,soft_limit:(0,h.$C)(t.soft_limit),hard_limit:(0,h.$C)(i?(t.soft_limit||0)+2:t.hard_limit),data_warning_enabled:t.data_limit_enabled};return t.data_limit_enabled||(e.soft_limit=0,e.hard_limit=0),j(e)}})),L((0,p.Oo)({[R]:()=>{D?.(t),N({values:t})}})),L((0,p.rW)({[R]:N}))},[L,N,t,e,R,i,j,D]),(0,l.useEffect)(()=>{f(R,s),v(R,!r)},[s,f,v,r,R]),(0,l.useEffect)(()=>{w&&M("apn")},[w,M]),(0,n.jsx)(u.A,{flexDirection:"column",gap:m.Ln,children:(0,n.jsxs)(n.Fragment,i?{children:[(0,n.jsx)(u.A,{children:(0,n.jsx)(o.A,{color:"text-1",size:"medium",children:(0,n.jsx)(E.sA,{id:"COMMON_LTE_DATA_LIMIT"})})}),(0,n.jsxs)(u.A,{flexDirection:"column",gap:m.Ln,children:[(0,n.jsx)(c.A,{label:"COMMON_DATA_LIMIT",translateLabel:!0,full:!0,validated:!0,options:x,type:"dropdown",variant:"secondary",name:"soft_limit"}),(0,n.jsx)(o.A,{color:"text-2",size:"small",children:(0,n.jsx)(E.sA,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_LIMIT_DESCRIPTION"})})]})]}:{children:[t.is_sim_pin_required?(0,n.jsxs)(u.A,{flexDirection:"column",gap:m.YC,children:[(0,n.jsx)(c.A,{label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_PIN",name:"sim_pin",type:"password",variant:"secondary",autoComplete:"new-password",full:!0,passwordToggle:!0,invalid:b?.sim_pin&&d?.sim_pin}),d.sim_pin?null:(0,n.jsxs)(u.A,{alignItems:"center",gap:m.YC,children:[(0,n.jsx)(_.A,{isActive:!0,size:"original"}),(0,n.jsx)(o.A,{color:"text-2",size:"small",children:(0,n.jsx)(E.sA,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_SIM_CARD_TRIES",values:{count:t.sim_pin_tries_left}})})]})]}):null,(0,n.jsx)(u.A,{flexDirection:"column",children:(0,n.jsx)(c.A,{label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_APN_ADDRESS",variant:"secondary",name:"apn",full:!0,autoComplete:"off",invalid:w&&d?.apn?d?.apn:void 0,disabled:t.is_sim_pin_required})}),(0,n.jsx)(u.A,{flexDirection:"column",children:(0,n.jsx)(c.A,{label:"COMMON_LABEL_USERNAME",name:"username",variant:"secondary",full:!0,disabled:t.is_sim_pin_required})}),(0,n.jsx)(u.A,{flexDirection:"column",children:(0,n.jsx)(c.A,{label:"COMMON_PASSWORD",name:"password",type:"password",variant:"secondary",autoComplete:"new-password",passwordToggle:!0,full:!0,disabled:t.is_sim_pin_required})}),(0,n.jsx)(u.A,{flexDirection:"column",children:(0,n.jsx)(c.A,{name:"auth_type",type:"dropdown",variant:"secondary",label:"COMMON_AUTH_TYPE",options:P,validated:!0,translateLabel:!0,full:!0,disabled:t.is_sim_pin_required})}),y?null:(0,n.jsx)(A.A,{children:(0,n.jsx)(c.A,{type:"realCheckbox",name:"roaming",disabled:t.is_sim_pin_required,children:(0,n.jsx)(o.A,{color:"text-1",size:"medium",children:(0,n.jsx)(E.sA,{id:"COMMON_ROAMING"})})})}),(0,n.jsx)(A.A,{children:(0,n.jsx)(c.A,{type:"realCheckbox",name:"data_limit_enabled",disabled:t.is_sim_pin_required,children:(0,n.jsx)(o.A,{color:"text-1",size:"medium",children:(0,n.jsx)(E.sA,{id:"COMMON_DATA_LIMIT"})})})}),t.data_limit_enabled?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.A,{flexDirection:"column",children:(0,n.jsx)(c.A,{name:"hard_limit",label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_LIMIT",type:"number",variant:"secondary",full:!0,disabled:t.is_sim_pin_required})}),(0,n.jsx)(u.A,{justifyContent:"space-between",children:(0,n.jsx)(o.A,{color:"text-1",size:"medium",children:(0,n.jsx)(E.sA,{id:"COMMON_LTE_DATA_WARNING"})})}),(0,n.jsx)(u.A,{flexDirection:"column",children:(0,n.jsx)(c.A,{name:"soft_limit",label:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_DATA_WARNING",type:"number",variant:"secondary",full:!0,onChange:e=>{g("soft_limit",e.target.value),T("hard_limit")},disabled:t.is_sim_pin_required})})]}):null]})})})},336128(e,i,t){t.d(i,{A:()=>c});var n=t(274934),a=t(602086),l=t(938984),s=t(833466),r=t(309130),o=t(589650),_=t(120197),d=t(100978),m=t(470070);const c=(0,a.memo)(()=>(0,n.jsxs)(d.A,{flexDirection:"column",children:[(0,n.jsx)(l.A,{color:"text-3",size:"small",children:(0,n.jsx)(m.sA,{id:"COMMON_IP_CONFIGURATION"})}),(0,n.jsxs)(d.A,{height:s.b,alignItems:"center",gap:r.Ln,children:[(0,n.jsx)(_.A,{name:"config_network.type",type:"radio",value:o.NL.DHCP,children:(0,n.jsx)(m.sA,{id:"COMMON_DHCP"})}),(0,n.jsx)(_.A,{name:"config_network.type",type:"radio",value:o.NL.STATIC,children:(0,n.jsx)(m.sA,{id:"COMMON_STATIC"})})]})]}))},11780(e,i,t){t.r(i),t.d(i,{default:()=>y});var n=t(274934),a=t(418398),l=t(977872),s=t(602086),r=t(478961),o=t(630849),_=t(309130),d=t(376892),m=t(100978),c=t(535322),A=t(446863),u=t(956978),p=t(795206),E=t(637084),h=t(115114),I=t(148561),b=t(532635),N=t(795928),O=t(290298),x=t(843871),C=t(938984),f=t(950804),v=t(120197),T=t(205521),g=t(470070);const R=(0,x.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:{lte_ext_ant:e,lte_poe:i}})=>({lte_ext_ant:"string"==typeof e?"enabled"===e:e,lte_poe:"string"==typeof i?"enabled"===i:i}),validationSchema:()=>f.A.lazy(()=>f.A.object().shape({lte_ext_ant:f.A.boolean().label("DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_EXTERNAL_ANTENNA").required(),lte_poe:f.A.boolean().label("COMMON_POE_PASSTHROUGH").required()})),handleSubmit:()=>null}),w=(0,a.Zz)((0,l.Ng)(null),R)(({activeItem:e,values:i,dirty:t,isValid:a,resetForm:r,setFormDirty:o,setFormInvalid:d,formName:c="lte"})=>{const A=(0,l.wA)();return(0,s.useEffect)(()=>{A((0,T.uo)({[c]:()=>i})),A((0,T.Oo)({[c]:()=>r({values:i})})),A((0,T.rW)({[c]:r}))},[A,r,i,e._id,c]),(0,s.useEffect)(()=>{o(c,t),d(c,!a)},[t,o,d,a,c]),(0,n.jsxs)(m.A,{flexDirection:"column",gap:_.Ln,children:[(0,n.jsx)(m.A,{justifyContent:"space-between",children:(0,n.jsx)(v.A,{type:"realCheckbox",name:"lte_ext_ant",children:(0,n.jsx)(C.A,{color:"text-1",size:"medium",children:(0,n.jsx)(g.sA,{id:"DEVICE_PROPERTIES_CONFIGURE_UNIFI_LTE_EXTERNAL_ANTENNA"})})})}),(0,n.jsx)(m.A,{justifyContent:"space-between",children:(0,n.jsx)(v.A,{type:"realCheckbox",name:"lte_poe",children:(0,n.jsx)(C.A,{color:"text-1",size:"medium",children:(0,n.jsx)(g.sA,{id:"COMMON_POE_PASSTHROUGH"})})})})]})}),M=e=>({lte_apn:e.apn,lte_is_sim_pin_required:e.is_sim_pin_required,lte_sim_pin_tries_left:e.sim_pin_tries_left,lte_sim_pin:e.sim_pin,lte_username:e.username,lte_password:e.password,lte_auth_type:e.auth_type,lte_data_limit_enabled:e.data_limit_enabled,lte_data_warning_enabled:e.data_warning_enabled,lte_soft_limit:e.soft_limit,lte_hard_limit:e.hard_limit});var j;!function(e){e.NAME="name",e.LTE="lte",e.NETWORK="network",e.MANAGE_DEVICE="manage-device"}(j||(j={}));const y=(0,a.Zz)((0,r.A)([j.NAME,j.LTE,O.I,j.NETWORK,j.MANAGE_DEVICE]))(({activeItem:e,setFormDirty:i,setFormInvalid:t,isDirty:a,isInvalid:r})=>{const x=(0,l.d4)(A.Lq),C=(0,l.d4)(A.H5),f=(0,l.d4)(A.n0),v=(0,l.wA)(),T=(0,s.useMemo)(()=>!(0,u.mHb)(e)&&!(0,u.tBS)(e),[e.type]),g=(0,o.I)(),R=(0,s.useCallback)(({sim_pin:i})=>{i&&e.lte_is_sim_pin_required&&!e.lte_is_sim_pin_verified&&v((0,p.cx)(e,i))},[e,v]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N.Ay,{activeItem:e,setFormDirty:i,setFormInvalid:t,formName:j.NAME}),(0,n.jsx)(c.A,{type:c.I.ACCORDION,items:[{id:j.LTE,openByDefault:!0,label:(0,n.jsx)(d.A,{id:"COMMON_LTE"}),renderContent:()=>(0,n.jsxs)(m.A,{flexDirection:"column",gap:_.Ln,children:[(0,n.jsx)(w,{activeItem:e,setFormDirty:i,setFormInvalid:t,formName:j.LTE,isDirty:a}),(0,n.jsx)(O.A,{mac:e.mac,apn:e.lte_apn,is_sim_pin_required:e.lte_is_sim_pin_required&&!e.lte_is_sim_pin_verified,sim_pin_tries_left:e.lte_sim_pin_tries_left,sim_pin:e.lte_sim_pin,username:e.lte_username,password:e.lte_password,auth_type:e.lte_auth_type,data_limit_enabled:e.lte_data_limit_enabled,data_warning_enabled:e.lte_data_warning_enabled,hard_limit:e.lte_hard_limit,soft_limit:e.lte_soft_limit,setFormDirty:i,setFormInvalid:t,limited:T,formName:O.I,isDirty:a,submitPayloadConverter:M,onFormSubmit:R,hideRoaming:!0})]})}]}),(0,n.jsx)(c.A,{type:c.I.ACCORDION,items:[{id:j.NETWORK,openByDefault:!0,label:(0,n.jsx)(d.A,{id:"COMMON_IP_SETTINGS"}),renderContent:()=>(0,n.jsx)(I.A,{activeItem:e,setFormDirty:i,setFormInvalid:t,formName:j.NETWORK,hideNetworkOverride:!0})}]}),(0,n.jsx)(E.A,{device:e,setFormDirty:i,setFormInvalid:t}),(0,n.jsx)(c.A,{type:c.I.ACCORDION,items:[{id:j.MANAGE_DEVICE,openByDefault:!0,label:(0,n.jsx)(d.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>(0,n.jsx)(b.A,{activeItem:e})}]}),(0,n.jsx)(h.A,{isDirty:a,isInvalid:r,onFormSubmit:()=>{const i=Object.entries(f).reduce((e,[i,t])=>{if("function"==typeof t){const i=t();if("object"==typeof i&&i&&Object.keys(i).length)return{...e,...i}}return e},{});v((0,p.ex)(i,e._id,e.mac,{extend:!0})).then(()=>{Object.values(x).forEach(e=>{"function"==typeof e&&e()})}).catch(g)},onFormCancel:()=>{Object.values(C).forEach(e=>{"function"==typeof e&&e()})}})]})})},521376(e,i,t){var n;t.d(i,{U:()=>n}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(n||(n={}))},478961(e,i,t){t.d(i,{A:()=>l});var n=t(274934),a=t(602086);const l=function(e){return i=>t=>{const[l,s]=(0,a.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[r,o]=(0,a.useState)(Object.fromEntries(e.map(e=>[e,!1]))),_=(0,a.useCallback)((e,i)=>{s(t=>({...t,[e]:i}))},[]),d=(0,a.useCallback)((e,i)=>{o(t=>({...t,[e]:i}))},[]),m=!!Object.values(l).find(e=>e),c=!!Object.values(r).find(e=>e);return(0,n.jsx)(i,{isDirty:m,isInvalid:c,formStates:l,setFormDirty:_,setFormInvalid:d,...t})}}}}]);