"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[58606],{249452(e,t,n){n.d(t,{A:()=>r});var i=n(602086),o=n(141992);const r=(0,n(272338).w)(e=>(0,i.createElement)("svg",(0,o.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,i.createElement)("circle",{cx:10,cy:10,r:8,fill:"currentColor",className:e.twotonedclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.818 3.243a.477.477 0 0 1 .23-.68A8 8 0 0 1 15.81 15.5H17a.5.5 0 0 1 0 .999h-3v-3a.5.5 0 0 1 1 0v1.399a7 7 0 0 0-7.524-11.43.53.53 0 0 1-.658-.226ZM3 4.5h1.19a8 8 0 0 0 8.761 12.938.477.477 0 0 0 .23-.681.53.53 0 0 0-.657-.226A7 7 0 0 1 5 5.101V6.5a.5.5 0 0 0 1 0v-3H3a.5.5 0 0 0 0 1Zm6.34 6.34-.62 3.358c-.05.26.31.41.5.21l4.71-4.838c.16-.16.03-.42-.22-.42h-3.09l.65-3.348c.05-.26-.31-.41-.5-.21l-4.7 4.828c-.16.16-.03.42.22.42h3.05Z",fill:"currentColor",className:e.baseclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.8 6.25V6.1a6.5 6.5 0 0 0 6.772 10.21c.373-.094.775.062.948.406.2.4.012.888-.419 1.005A8 8 0 0 1 3.755 5H3.55a.75.75 0 0 1 0-1.5H6.3v2.75a.75.75 0 0 1-1.5 0Zm2.68-2.966c-.2-.4-.012-.888.419-1.005A8 8 0 0 1 16.245 15h.205a.75.75 0 0 1 0 1.5H13.7v-2.75a.75.75 0 0 1 1.5 0v.15A6.5 6.5 0 0 0 8.428 3.69c-.373.094-.775-.062-.948-.406Zm1.86 7.556-.62 3.358c-.05.26.31.41.5.21l4.71-4.838c.16-.16.03-.42-.22-.42h-3.09l.65-3.348c.05-.26-.31-.41-.5-.21l-4.7 4.828c-.16.16-.03.42.22.42h3.05Z",fill:"currentColor",className:e.fillclassname})))},815879(e,t,n){n.d(t,{A:()=>r});var i=n(602086),o=n(141992);const r=(0,n(272338).w)(e=>(0,i.createElement)("svg",(0,o.d)({viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,i.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,i.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,i.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})))},595778(e,t,n){n.d(t,{I:()=>o,U:()=>r});var i=n(241365);const o=(0,n(419284).Wj)(i.Ay["blue-0"]),r=100},446863(e,t,n){n.d(t,{H5:()=>a,Lq:()=>s,n0:()=>l});var i=n(909924),o=n(573534),r=n(172205);const l=e=>e[r.U.SHARED][o.N.PROPERTY_PANEL]?.[i.Io.TAB_GET_DATA_FUNCTION]||{},s=e=>e[r.U.SHARED][o.N.PROPERTY_PANEL]?.[i.Io.TAB_SUBMIT_FUNCTION]||{},a=e=>e[r.U.SHARED][o.N.PROPERTY_PANEL]?.[i.Io.TAB_RESET_FUNCTION]||{}},535322(e,t,n){n.d(t,{A:()=>h,I:()=>i});var i,o=n(274934),r=n(814557),l=n(158885),s=n(247816),a=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const u=(0,s.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||r.Ay[n===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${d.Ln}`:d.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||d.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}})=>r.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,A=(0,s.A)(l.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||r.Ay[n===a.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${a.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${a.S.LIGHT}`]};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||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:t}})=>e||r.Ay[t===a.S.DARK?`desktop-color-neutral-01-${a.S.DARK}`:`desktop-color-neutral-00-${a.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,h=({type:e,marginBottom:t,margin:n,padding:r,flex:l,width:s,nested:a,...d})=>"items"in d?(0,o.jsx)(A,{marginBottom:t,margin:n,padding:r,flex:l,nested:a,...d}):(0,o.jsx)(u,{nested:a,width:s,marginBottom:t,margin:n,padding:r,flex:l,isButtonList:e===i.BUTTON_LIST,...d,children:d.children})},796091(e,t,n){n.d(t,{A:()=>s});var i=n(274934),o=n(833466),r=n(309130),l=n(100978);const s=e=>(0,i.jsx)(l.A,{paddingTop:r.YC,paddingBottom:r.YC,gap:r.Ln,rowGap:r.YC,flexWrap:"wrap",minHeight:o.b,alignItems:"center",...e})},89469(e,t,n){n.d(t,{A:()=>s});var i=n(274934),o=n(602086),r=n(309130),l=n(100978);const s=(0,o.forwardRef)((e,t)=>(0,i.jsx)(l.A,{ref:t,flexDirection:"column",gap:r.kc,width:"100%",...e}))},250266(e,t,n){n.d(t,{A:()=>c});var i=n(274934),o=n(602086),r=n(696264),l=n(409844),s=n(521376),a=n(309130),d=n(470070);const c=({children:e=null,title:t,titleValues:n,message:c,messageValues:m,handleConfirm:u=()=>null,handleClose:A=()=>null,handleCancel:h,isOpen:_,buttonVariant:x="primary",cancelButtonVariant:v="tertiary",cancelButtonMessage:p="COMMON_ACTION_CANCEL",buttonMessage:g="COMMON_ACTION_CONFIRM",buttonDisabled:b=!1,position:C="top",offset:f,showHeaderClose:O=!1,contentClassName:j="",body:E,titleBody:w,className:N,rootClose:I=!1,footerActions:y})=>{const T=(0,o.useCallback)(e=>{_&&(e.stopPropagation(),e.key===s.U.ENTER?u():e.key===s.U.ESCAPE&&A(!1))},[_,u,A]);(0,o.useEffect)(()=>(window.addEventListener("keydown",T,!0),()=>{window.removeEventListener("keydown",T,!0)}),[T]);const k=(0,o.useCallback)(()=>{A(!1),h?.()},[A,h]),R=(0,o.useCallback)(()=>{A(!1),u()},[A,u]),L=(0,o.useMemo)(()=>[{text:(0,i.jsx)(d.sA,{id:p}),variant:v,onClick:k},{text:(0,i.jsx)(d.sA,{id:g}),disabled:b,variant:x,onClick:R}],[g,x,p,v,k,R,b]),M=(0,o.useCallback)(()=>{A(!1)},[A]),D=l.AH`
    ${t?"":`margin-top: ${a.xO}`}
  `;return(0,i.jsx)(r.A,{title:t?(0,i.jsx)(d.sA,{id:t,values:n}):w||null,...c?{body:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.sA,{id:c,values:m}),E]})}:{body:E},position:C,portal:!0,offset:f,actions:y||L,showHeaderClose:O,contentClassName:l.AH`
        ${D}
        ${j}
      `,onRequestClose:M,isOpen:_,allowOverflow:!0,rootClose:I,className:N,children:e})}},637084(e,t,n){n.d(t,{A:()=>v});var i=n(274934),o=n(602086),r=n(843871),l=n(977872),s=n(418398),a=n(205521),d=n(232410),c=n(1469),m=n(260288),u=n(619619),A=n(876809),h=n(113454),_=n(621309);const x=(0,r.bk)({enableReinitialize:!0,mapPropsToValues:({powerSupervisor:e,device:t})=>({powerSupervisor:(0,u.f)(e,(0,h.lD)(t,e))}),handleSubmit:(e,{resetForm:t})=>t({values:e}),validationSchema:A.A}),v=(0,s.Zz)((0,l.Ng)((e,{device:{mac:t}})=>({powerSupervisor:(0,d.x0)(t)(e)})))(x(({powerSupervisor:e,device:t,setFormDirty:n,setFormInvalid:r,validateForm:s,values:d,resetForm:u,dirty:A,isValid:h,formName:x=m.r8})=>{const v=(0,l.wA)();return(0,o.useEffect)(()=>(v((0,a.uo)({[x]:()=>({})})),v((0,a.Oo)({[x]:()=>{s().then(t=>{Object.keys(t).length||v((0,_.A)(e?.id,d.powerSupervisor))})}})),v((0,a.rW)({[x]:u})),()=>{v((0,a.uo)({[x]:null})),v((0,a.Oo)({[x]:null})),v((0,a.rW)({[x]:null}))}),[v,u,d.powerSupervisor,x,s,e?.id]),(0,o.useEffect)(()=>{n?.(x,A),r?.(x,!h)},[n,A,r,h,x]),(0,i.jsx)(c.A,{device:t})}))},876809(e,t,n){n.d(t,{A:()=>r,q:()=>o});var i=n(950804);const o=i.A.object().shape({power_sources:i.A.array().transform(e=>e.filter(e=>e.power_source_mac)).of(i.A.object().shape({client_psu_index:i.A.number().required(),power_source_mac:i.A.string().label("COMMON_POWER_SOURCE").required(),power_source_index:i.A.string().label("COMMON_OUTLET").required()})).label("COMMON_POWER_SOURCE").min(1)}).optional(),r=i.A.object().shape({powerSupervisor:o})},376892(e,t,n){n.d(t,{A:()=>l});var i=n(274934),o=n(938984),r=n(470070);const l=({id:e,children:t,values:n})=>(0,i.jsxs)(o.A,{color:"text-1",weight:"bold",size:"medium",children:[e?(0,i.jsx)(r.sA,{id:e,values:n}):null,t]})},148561(e,t,n){n.d(t,{A:()=>w,g:()=>j});var i=n(274934),o=n(418398),r=n(977872),l=n(602086),s=n(843871),a=n(938984),d=n(950804),c=n(309130),m=n(589650),u=n(977663),A=n(120197),h=n(100978),_=n(205521),x=n(470070),v=n(291935),p=n(197571),g=n(956978),b=n(34118),C=n(550521),f=n(21265),O=n(336128);const j="network",E=(0,s.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:{config_network:e,model:t,ip:n,switch_vlan_enabled:i,mgmt_network_id:o,connection_network_id:r},nativeNetworks:l})=>{const s=(0,g.U$e)(l,r);return{config_network:{type:e?.type||m.NL.DHCP,ip:e?.ip||n||"",netmask:e?.netmask||s?.netmask||"",gateway:e?.gateway||s?.ip||"",dns1:e?.dns1||s?.dns1||"",dns2:e?.dns2||s?.dns2||"",dnssuffix:e?.dnssuffix||"",bonding_enabled:e?.bonding_enabled||!1},mgmt_network_id:(0,g.ewD)(l,o),switch_vlan_enabled:i||!1,...((0,g.C6C)({model:t}),{})}},handleSubmit:(e,{resetForm:t})=>{t({values:e})},validationSchema:({honeypotNetworksIps:e,clients:t})=>d.A.object().shape({config_network:(0,u.d)(e,t),mgmt_network_id:d.A.string(),lte_limit_enabled:d.A.boolean().label("COMMON_LTE_DATA_LIMIT"),lte_limit:d.A.number().integer().label("COMMON_DATA_LIMIT").when("lte_limit_enabled",{is:!0,then:d.A.number().min(1).required().label("COMMON_DATA_LIMIT")})})}),w=(0,o.Zz)((0,r.Ng)(e=>({nativeNetworks:(0,p.Tn)(e),honeypotNetworksIps:(0,v.Yk)(e),clients:(0,b.A8)(e)})),E)(({setFormDirty:e,setFormInvalid:t,dirty:n,values:o,resetForm:s,isValid:d,initialValues:u,activeItem:v,nativeNetworks:p,hideNetworkOverride:b,formName:E=j})=>{const w=(0,r.wA)(),N=(0,g.iQS)(v.model),I=(0,g.C6C)(v);(0,l.useEffect)(()=>{e(j,n),t(j,!d)},[e,t,n,d]);const y=(0,g.moU)(v);(0,l.useEffect)(()=>(w((0,_.uo)({[E]:()=>{const e={config_network:o.config_network?.type===m.NL.STATIC?o.config_network:{type:m.NL.DHCP,bonding_enabled:o.config_network?.bonding_enabled},mgmt_network_id:o.mgmt_network_id};return N&&(e.switch_vlan_enabled=o.switch_vlan_enabled,u.switch_vlan_enabled&&!o.switch_vlan_enabled&&v.port_overrides?.length&&(e.port_overrides=(v.port_overrides||[]).map(({portconf_id:e,...t})=>t))),e}})),w((0,_.Oo)({[E]:()=>s({values:o})})),w((0,_.rW)({[E]:s})),()=>{w((0,_.uo)({[E]:null})),w((0,_.Oo)({[E]:null})),w((0,_.rW)({[E]:null}))}),[w,s,o,E,v.port_overrides,u.switch_vlan_enabled,N,I]);const T=!b&&!y&&p.length>1&&!(0,g.q82)({model:v.model})&&!(0,g.xQi)({model:v.model});return(0,i.jsxs)(h.A,{flexDirection:"column",gap:c.S2,children:[T?(0,i.jsx)(C.A,{nativeNetworks:p,activeItemMac:v.mac}):null,(0,i.jsx)(O.A,{}),o.config_network?.type===m.NL.STATIC?(0,i.jsx)(f.A,{}):null,(0,g.xyH)(v)||(0,g.Eyk)(v)||(0,g._iI)(v)||(0,g.W46)(v)?(0,i.jsx)(h.A,{children:(0,i.jsx)(A.A,{name:"config_network.bonding_enabled",type:"realCheckbox",children:(0,i.jsx)(x.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_AGGREGATION"})})}):null,N?(0,i.jsxs)(h.A,{flexDirection:"column",gap:c.kc,children:[(0,i.jsx)(a.A,{weight:"bold",size:"medium",children:(0,i.jsx)(x.sA,{id:"COMMON_VLAN"})}),(0,i.jsxs)(h.A,{justifyContent:"space-between",children:[(0,i.jsx)(a.A,{size:"medium",children:(0,i.jsx)(x.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_VLAN"})}),(0,i.jsx)(A.A,{type:"checkbox",name:"switch_vlan_enabled"})]})]}):null,null]})})},594492(e,t,n){n.d(t,{A:()=>m});var i=n(274934),o=n(602086),r=n(599110),l=n(247816),s=n(309130),a=n(470070),d=n(291508);const c=(0,l.A)("footer",(0,d.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${s.S2} ${s.fS};
  gap: ${s.kc};
`,m=({allowCancel:e,isDirty:t,isInvalid:n,isSubmitting:l,onFormSubmit:s,onFormReset:d,onFormCancel:m,className:u,submitButtonText:A,customButton:h,applyButton:_,applyButtonFirst:x,hideCancelButton:v,form:p})=>{const g=(0,o.useMemo)(()=>_||(0,i.jsx)(r.A,{name:"submit",variant:"primary",type:"submit",onClick:s,disabled:!t||n||l,form:p,children:(0,i.jsx)(a.sA,{id:A||"COMMON_ACTION_APPLY_CHANGES"})}),[_,p,t,n,l,s,A]);return(0,i.jsxs)(c,{className:u,hasFormResetButton:!!d,children:[x?g:h,v?null:(0,i.jsx)(r.A,{name:"cancel",variant:"default",type:"button",onClick:m,disabled:!e&&!t,children:(0,i.jsx)(a.sA,{id:"COMMON_ACTION_CANCEL"})}),d?(0,i.jsx)(r.A,{name:"reset",variant:"default",type:"button",onClick:d,disabled:!t,children:(0,i.jsx)(a.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})}):null,x?h:g]})}},554598(e,t,n){n.d(t,{A:()=>c});var i=n(274934),o=n(725989),r=n(938984),l=n(470070),s=n(100978),a=n(595778),d=n(662986);const c=({value:e=a.U,onChange:t})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.A,{flexDirection:"column",width:"100%",children:[(0,i.jsx)(s.A,{flexDirection:"row",alignItems:"center",children:(0,i.jsx)(r.A,{variant:"caption",children:(0,i.jsx)(l.sA,{id:"COMMON_BRIGHTNESS"})})}),(0,i.jsx)(o.A,{value:e,minValue:1,onChange:t})]}),(0,i.jsx)(s.A,{flexDirection:"column",children:(0,i.jsx)(r.A,{variant:"body-primary",children:(0,d.A)(e)})})]})},785616(e,t,n){n.d(t,{A:()=>x});var i=n(274934),o=n(602086),r=n(60927),l=n(419284),s=n(100978),a=n(420528),d=n(247816),c=n(291508);const m=(0,d.A)(s.A)`
  cursor: pointer;
`,u=(0,d.A)("div",(0,c.A)("color"))`
  background-color: ${({color:e})=>e};
  border-radius: 3px;
  width: 34px;
  height: 20px;
`,A=({color:e})=>(0,i.jsxs)(m,{width:"55px",height:"24px",padding:"2px 0",alignItems:"center",justifyContent:"space-between",flexShrink:0,children:[(0,i.jsx)(u,{color:e}),(0,i.jsx)(a.A,{})]});var h=n(595778);const _=[{id:"hue",channel:"hue"}],x=({value:e,onChange:t})=>{const n=(0,o.useCallback)(e=>{t((0,l.E6)(e.toString())||h.I)},[t]),a=e||h.I;return(0,i.jsx)(s.A,{flexDirection:"column",children:(0,i.jsx)(r.A,{value:a,onChange:n,sliders:_,colorSpace:"hex",children:(0,i.jsx)("span",{children:(0,i.jsx)(A,{color:a})})})})}},115114(e,t,n){n.d(t,{A:()=>c});var i=n(274934),o=n(232932),r=n(247816),l=n(409844),s=n(594492);const a=(0,r.A)("div")`
  height: 66px;
`,d=l.AH`
  padding: 0px !important;
`,c=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:r,...l})=>e?(0,i.jsx)(o.A,{children:(0,i.jsx)(s.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:r,className:d,...l})}):(0,i.jsx)(a,{})},663216(e,t,n){n.d(t,{Ay:()=>f,Cg:()=>b});var i=n(274934),o=n(418398),r=n(977872),l=n(602086),s=n(487763),a=n(843871),d=n(950804),c=n(586566),m=n(309130),u=n(120197),A=n(100978),h=n(205521),_=n(470070),x=n(857780),v=n(595778),p=n(554598),g=n(785616);const b="screen",C=(0,a.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:e,formName:t=b})=>({[t]:{led_override:e.led_override||x.c_.ON,led_override_color_brightness:e.led_override_color_brightness||v.U,led_override_color:e.led_override_color||v.I}}),validationSchema:d.A.object().shape({led_override:d.A.string(),led_override_color_brightness:d.A.number(),led_override_color:d.A.string()}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),f=(0,o.Zz)(C)(({activeItem:e,setFormDirty:t,values:n,dirty:o,resetForm:a,setFieldValue:d,formName:C=b,disableLedOverrideColor:f,disableLedBrightnessField:O})=>{const j=(0,r.wA)(),E=(0,c.lp)(e);(0,l.useEffect)(()=>{t(C,o)},[t,o,C]),(0,l.useEffect)(()=>(j((0,h.uo)({[C]:()=>{const e=(0,s.A)(n,C);return{...n[C],...e}}})),j((0,h.Oo)({[C]:()=>{a({values:n})}})),j((0,h.rW)({[C]:a})),()=>{j((0,h.uo)({[C]:null})),j((0,h.Oo)({[C]:null})),j((0,h.rW)({[C]:null}))}),[j,C,a,n]);const w=(0,l.useCallback)(e=>{d(`${C}.led_override_color`,e)},[d,C]);return(0,i.jsxs)(A.A,{alignItems:"center",marginBottom:m.Ln,gap:m.Ln,children:[(0,i.jsx)(A.A,{children:(0,i.jsx)(u.A,{name:"led_override",type:"realCheckbox",checked:n[C].led_override===x.c_.ON,onChange:({target:{checked:e}})=>{d(`${C}.led_override`,e?x.c_.ON:x.c_.OFF)},children:(0,i.jsx)(_.sA,{id:"COMMON_LED"})})}),E&&!f?(0,i.jsx)(g.A,{value:n[C].led_override_color||v.I,onChange:w}):null,!O&&E?(0,i.jsx)(p.A,{value:n[C].led_override_color_brightness??v.U,onChange:e=>{d(`${C}.led_override_color_brightness`,e)}}):null]})})},336128(e,t,n){n.d(t,{A:()=>u});var i=n(274934),o=n(602086),r=n(938984),l=n(833466),s=n(309130),a=n(589650),d=n(120197),c=n(100978),m=n(470070);const u=(0,o.memo)(()=>(0,i.jsxs)(c.A,{flexDirection:"column",children:[(0,i.jsx)(r.A,{color:"text-3",size:"small",children:(0,i.jsx)(m.sA,{id:"COMMON_IP_CONFIGURATION"})}),(0,i.jsxs)(c.A,{height:l.b,alignItems:"center",gap:s.Ln,children:[(0,i.jsx)(d.A,{name:"config_network.type",type:"radio",value:a.NL.DHCP,children:(0,i.jsx)(m.sA,{id:"COMMON_DHCP"})}),(0,i.jsx)(d.A,{name:"config_network.type",type:"radio",value:a.NL.STATIC,children:(0,i.jsx)(m.sA,{id:"COMMON_STATIC"})})]})]}))},728877(e,t,n){n.r(t),n.d(t,{default:()=>M});var i=n(274934),o=n(418398),r=n(977872),l=n(478961),s=n(630849),a=n(376892),d=n(535322),c=n(446863),m=n(795206),u=n(637084),A=n(115114),h=n(663216),_=n(148561),x=n(532635),v=n(602086),p=n(843871),g=n(125799),b=n(938984),C=n(599110),f=n(249452),O=n(247816),j=n(120197),E=n(100978),w=n(408402),N=n(205521),I=n(470070),y=n(754924);const T="general",k=(0,O.A)(E.A)`
  margin-bottom: 24px;
  justify-content: space-between;
`,R=(0,O.A)(C.A)`
  margin-top: 12px;
  justify-content: flex-end;
`,L=(0,p.bk)({enableReinitialize:!0,mapPropsToValues:({activeItem:{name:e,mac:t,outlet_table:n=[],outlet_overrides:i=[]}})=>({name:e!==t?e:"",outlet_overrides:[{...n[0],...i[0]}]}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}})(({activeItem:e,submitForm:t,values:n,dirty:o,isValid:l,resetForm:s,setFormDirty:a,setFormInvalid:d})=>{const c=(0,r.wA)(),u=(0,r.d4)(y.m9);return(0,v.useEffect)(()=>{a(T,o),d(T,!l)},[a,d,o,l]),(0,v.useEffect)(()=>(c((0,N.uo)({[T]:()=>n})),c((0,N.Oo)({[T]:t})),c((0,N.rW)({[T]:s})),()=>{c((0,N.uo)({[T]:null})),c((0,N.Oo)({[T]:null})),c((0,N.rW)({[T]:null}))}),[c,s,t,n]),(0,i.jsxs)(E.A,{flexDirection:"column",children:[(0,i.jsx)(k,{flexDirection:"column",children:(0,i.jsx)(j.A,{full:!0,name:"name",variant:"secondary",label:"COMMON_NAME"})}),(0,i.jsxs)(k,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,i.jsxs)(E.A,{flexDirection:"column",flex:"0 1 65%",children:[(0,i.jsx)(b.A,{color:"text-1",size:"medium",weight:"bold",children:(0,i.jsx)(I.sA,{id:"COMMON_OUTLET_POWER"})}),(0,i.jsx)(b.A,{size:"medium",color:"text-2",children:(0,i.jsx)(I.sA,{id:"DEVICE_PROPERTIES_OUTLET_RELAY_STATE_LABEL_DESCRIPTION"})})]}),(0,i.jsx)(j.A,{type:"checkbox",name:"outlet_overrides[0].relay_state"})]}),(0,i.jsx)(k,{alignItems:"flex-start",justifyContent:"space-between",children:(0,i.jsx)(w.A,{condition:!u,wrapper:e=>(0,i.jsx)(g.A,{description:(0,i.jsx)(I.sA,{id:"COMMON_REQUIRES_GATEWAY"}),width:200,children:e}),children:(0,i.jsx)(j.A,{type:"checkbox",name:"outlet_overrides[0].cycle_enabled",disabled:!u,children:(0,i.jsxs)(E.A,{flexDirection:"column",flex:"0 1 65%",children:[(0,i.jsx)(b.A,{color:"text-1",size:"medium",weight:"bold",children:(0,i.jsx)(I.sA,{id:"COMMON_MODEM_POWER_CYCLE"})}),(0,i.jsx)(b.A,{size:"medium",color:"text-2",children:(0,i.jsx)(I.sA,{id:"DEVICE_PROPERTIES_OUTLET_CTL_POWER_CYCLE_DESCRIPTION"})})]})})})}),(0,i.jsxs)(k,{flexDirection:"column",children:[(0,i.jsxs)(E.A,{flexDirection:"column",width:"65%",children:[(0,i.jsx)(b.A,{color:"text-1",size:"medium",weight:"bold",children:(0,i.jsx)(I.sA,{id:"DEVICE_PROPERTIES_OUTLET_MANUAL_POWER_CYCLE"})}),(0,i.jsx)(b.A,{size:"medium",color:"text-2",children:(0,i.jsx)(I.sA,{id:"DEVICE_PROPERTIES_OUTLET_MANUAL_POWER_CYCLE_DESCRIPTION"})})]}),(0,i.jsx)(R,{variant:"link",onClick:()=>c((0,m.t)(e,n.outlet_overrides[0])),Icon:(0,i.jsx)(f.A,{}),children:(0,i.jsx)(I.sA,{id:"COMMON_POWER_CYCLE"})})]})]})}),M=(0,o.Zz)((0,l.A)([T,_.g,h.Cg,x.f]))(({activeItem:{mac:e,_id:t},activeItem:n,setFormDirty:o,setFormInvalid:l,isDirty:v,isInvalid:p})=>{const g=(0,r.wA)(),b=(0,r.d4)(c.n0),C=(0,r.d4)(c.Lq),f=(0,r.d4)(c.H5),O=(0,s.I)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.A,{type:d.I.ACCORDION,items:[{id:T,openByDefault:!0,label:(0,i.jsx)(a.A,{id:"COMMON_NAME"}),renderContent:()=>(0,i.jsx)(L,{activeItem:n,setFormDirty:o,setFormInvalid:l})}]}),(0,i.jsx)(d.A,{type:d.I.ACCORDION,items:[{id:h.Cg,openByDefault:!0,label:(0,i.jsx)(a.A,{id:"COMMON_LED"}),renderContent:()=>(0,i.jsx)(h.Ay,{activeItem:n,setFormDirty:o,disableLedBrightnessField:!0,disableLedOverrideColor:!0})}]}),(0,i.jsx)(d.A,{type:d.I.ACCORDION,items:[{id:_.g,openByDefault:!0,label:(0,i.jsx)(a.A,{id:"COMMON_IP_SETTINGS"}),renderContent:()=>(0,i.jsx)(_.A,{activeItem:n,setFormDirty:o,setFormInvalid:l})}]}),(0,i.jsx)(u.A,{device:n,setFormDirty:o,setFormInvalid:l}),(0,i.jsx)(d.A,{type:d.I.ACCORDION,items:[{id:x.f,openByDefault:!0,label:(0,i.jsx)(a.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>(0,i.jsx)(x.A,{activeItem:n})}]}),(0,i.jsx)(A.A,{isDirty:v,isInvalid:p,onFormSubmit:()=>{const n=Object.entries(b).reduce((e,[t,n])=>{if("function"==typeof n){const t=n();if("object"==typeof t&&t&&Object.keys(t).length)return{...e,...t}}return e},{});g((0,m.ex)(n,t,e,{extend:!0})).then(()=>{Object.values(C).forEach(e=>{"function"==typeof e&&e()})}).catch(O)},onFormCancel:()=>{Object.values(f).forEach(e=>{"function"==typeof e&&e()})}})]})})},378767(e,t,n){n.d(t,{A:()=>l});var i=n(274934),o=n(977872),r=n(897166);const l=({children:e=null})=>(0,o.d4)(r.EL)?null:(0,i.jsx)(i.Fragment,{children:e})},521376(e,t,n){var i;n.d(t,{U:()=>i}),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"}(i||(i={}))},478961(e,t,n){n.d(t,{A:()=>r});var i=n(274934),o=n(602086);const r=function(e){return t=>n=>{const[r,l]=(0,o.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[s,a]=(0,o.useState)(Object.fromEntries(e.map(e=>[e,!1]))),d=(0,o.useCallback)((e,t)=>{l(n=>({...n,[e]:t}))},[]),c=(0,o.useCallback)((e,t)=>{a(n=>({...n,[e]:t}))},[]),m=!!Object.values(r).find(e=>e),u=!!Object.values(s).find(e=>e);return(0,i.jsx)(t,{isDirty:m,isInvalid:u,formStates:r,setFormDirty:d,setFormInvalid:c,...n})}}}}]);