"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[17178],{595521(e,t,n){n.d(t,{A:()=>o});var i=n(602086),a=n(716155);const o=(0,n(302405).w)(e=>(0,i.createElement)("svg",(0,a.d)({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em"},e),(0,i.createElement)("rect",{x:3,y:3,width:18,height:18,rx:2,fill:"currentColor",className:e.twotonedclassname}),(0,i.createElement)("path",{d:"M5.781 5C5.35 5 5 5.336 5 5.75v3.5c0 .414.35.75.781.75H9.22c.431 0 .781-.336.781-.75v-3.5c0-.414-.35-.75-.781-.75H5.78Z",fill:"currentColor",className:e.baseclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V6Zm4-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3Z",fill:"currentColor",className:e.baseclassname}),(0,i.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 4.714A2.728 2.728 0 0 1 4.635 2h14.732a2.728 2.728 0 0 1 2.635 2.726v14.547A2.728 2.728 0 0 1 19.274 22H4.727A2.728 2.728 0 0 1 2 19.285V4.714Zm3 .91C5 5.28 5.291 5 5.651 5h3.698c.36 0 .651.28.651.625v3.75a.638.638 0 0 1-.651.625H5.65A.638.638 0 0 1 5 9.375v-3.75Z",fill:"currentColor",className:e.fillclassname})))},722682(e,t,n){n.d(t,{A:()=>o});var i=n(602086),a=n(716155);const o=(0,n(302405).w)(e=>(0,i.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,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})))},897015(e,t,n){n.d(t,{VG:()=>i,Vm:()=>o,z7:()=>a});const i=80,a="22:00",o="08:00"},446863(e,t,n){n.d(t,{H5:()=>l,Lq:()=>s,n0:()=>r});var i=n(909924),a=n(573534),o=n(172205);const r=e=>e[o.U.SHARED][a.N.PROPERTY_PANEL]?.[i.Io.TAB_GET_DATA_FUNCTION]||{},s=e=>e[o.U.SHARED][a.N.PROPERTY_PANEL]?.[i.Io.TAB_SUBMIT_FUNCTION]||{},l=e=>e[o.U.SHARED][a.N.PROPERTY_PANEL]?.[i.Io.TAB_RESET_FUNCTION]||{}},535322(e,t,n){n.d(t,{A:()=>h,I:()=>i});var i,a=n(274934),o=n(505817),r=n(753583),s=n(247816),l=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const _=(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||o.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${o.Ay[`desktop-border-divider-${t}`]};`:""}
  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}})=>o.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,s.A)(r.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||o.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${o.Ay[`desktop-border-divider-${t}`]};`:""}
  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,nested:t,theme:{themeName:n}})=>e||o.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.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:o,flex:r,width:s,nested:l,...d})=>"items"in d?(0,a.jsx)(u,{marginBottom:t,margin:n,padding:o,flex:r,nested:l,...d}):(0,a.jsx)(_,{nested:l,width:s,marginBottom:t,margin:n,padding:o,flex:r,isButtonList:e===i.BUTTON_LIST,...d,children:d.children})},250266(e,t,n){n.d(t,{A:()=>c});var i=n(274934),a=n(602086),o=n(13790),r=n(409844),s=n(521376),l=n(309130),d=n(470070);const c=({children:e=null,title:t,titleValues:n,message:c,messageValues:m,handleConfirm:_=()=>null,handleClose:u=()=>null,handleCancel:h,isOpen:A,buttonVariant:g="primary",cancelButtonVariant:v="tertiary",cancelButtonMessage:p="COMMON_ACTION_CANCEL",buttonMessage:N="COMMON_ACTION_CONFIRM",buttonDisabled:b=!1,position:C="top",offset:E,showHeaderClose:f=!1,contentClassName:x="",body:O,titleBody:I,className:M,rootClose:w=!1,footerActions:j})=>{const T=(0,a.useCallback)(e=>{A&&(e.stopPropagation(),e.key===s.U.ENTER?_():e.key===s.U.ESCAPE&&u(!1))},[A,_,u]);(0,a.useEffect)(()=>(window.addEventListener("keydown",T,!0),()=>{window.removeEventListener("keydown",T,!0)}),[T]);const k=(0,a.useCallback)(()=>{u(!1),h?.()},[u,h]),S=(0,a.useCallback)(()=>{u(!1),_()},[u,_]),y=(0,a.useMemo)(()=>[{text:(0,i.jsx)(d.sA,{id:p}),variant:v,onClick:k},{text:(0,i.jsx)(d.sA,{id:N}),disabled:b,variant:g,onClick:S}],[N,g,p,v,k,S,b]),R=(0,a.useCallback)(()=>{u(!1)},[u]),D=r.AH`
    ${t?"":`margin-top: ${l.xO}`}
  `;return(0,i.jsx)(o.A,{title:t?(0,i.jsx)(d.sA,{id:t,values:n}):I||null,...c?{body:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.sA,{id:c,values:m}),O]})}:{body:O},position:C,portal:!0,offset:E,actions:j||y,showHeaderClose:f,contentClassName:r.AH`
        ${D}
        ${x}
      `,onRequestClose:R,isOpen:A,allowOverflow:!0,rootClose:w,className:M,children:e})}},637084(e,t,n){n.d(t,{A:()=>N});var i=n(274934),a=n(602086),o=n(843871),r=n(977872),s=n(418398),l=n(396489),d=n.n(l),c=n(205521),m=n(232410),_=n(933671),u=n(260288),h=n(619619),A=n(702147),g=n(507792),v=n(621309);const p=(0,o.bk)({enableReinitialize:!0,mapPropsToValues:({powerSupervisor:e,device:t})=>({powerSupervisor:(0,h.f)(e,(0,g.lD)(t,e))}),handleSubmit:(e,{resetForm:t})=>t({values:e}),validationSchema:A.Ay}),N=(0,s.Zz)((0,r.Ng)((e,{device:{mac:t}})=>({powerSupervisor:(0,m.x0)(t)(e)})))(p(({powerSupervisor:e,device:t,setFormDirty:n,setFormInvalid:o,validateForm:s,values:l,resetForm:m,initialValues:h,dirty:A,isValid:g,formName:p=u.r8})=>{const N=(0,r.wA)();return(0,a.useEffect)(()=>(N((0,c.uo)({[p]:()=>({})})),N((0,c.Oo)({[p]:()=>{d()(l,h)||s().then(t=>{Object.keys(t).length||N((0,v.A)(e?.id,l.powerSupervisor))})}})),N((0,c.rW)({[p]:m})),()=>{N((0,c.uo)({[p]:null})),N((0,c.Oo)({[p]:null})),N((0,c.rW)({[p]:null}))}),[N,m,l.powerSupervisor,p,s,e?.id,l,h]),(0,a.useEffect)(()=>{n?.(p,A),o?.(p,!g)},[n,A,o,g,p]),(0,i.jsx)(_.A,{device:t})}))},148561(e,t,n){n.d(t,{A:()=>I,g:()=>x});var i=n(274934),a=n(418398),o=n(977872),r=n(602086),s=n(843871),l=n(179102),d=n(950804),c=n(309130),m=n(589650),_=n(977663),u=n(120197),h=n(100978),A=n(205521),g=n(470070),v=n(291935),p=n(197571),N=n(956978),b=n(34118),C=n(550521),E=n(21265),f=n(336128);const x="network",O=(0,s.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({activeItem:{config_network:e,model:t,ip:n,switch_vlan_enabled:i,mgmt_network_id:a,connection_network_id:o},nativeNetworks:r})=>({config_network:(0,N.frs)(e,n,r,o),mgmt_network_id:(0,N.ewD)(r,a),switch_vlan_enabled:i||!1,...((0,N.C6C)({model:t}),{})}),handleSubmit:(e,{resetForm:t})=>{t({values:e})},validationSchema:({honeypotNetworksIps:e,clients:t})=>d.A.object().shape({config_network:(0,_.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")})})}),I=(0,a.Zz)((0,o.Ng)(e=>({nativeNetworks:(0,p.Tn)(e),honeypotNetworksIps:(0,v.Yk)(e),clients:(0,b.A8)(e)})),O)(({setFormDirty:e,setFormInvalid:t,dirty:n,values:a,resetForm:s,isValid:d,initialValues:_,activeItem:v,nativeNetworks:p,hideNetworkOverride:b,formName:O=x})=>{const I=(0,o.wA)(),M=(0,N.iQS)(v.model),w=(0,N.C6C)(v);(0,r.useEffect)(()=>{e(x,n),t(x,!d)},[e,t,n,d]);const j=(0,N.moU)(v);(0,r.useEffect)(()=>(I((0,A.uo)({[O]:()=>{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 M&&(e.switch_vlan_enabled=a.switch_vlan_enabled,_.switch_vlan_enabled&&!a.switch_vlan_enabled&&v.port_overrides?.length&&(e.port_overrides=(v.port_overrides||[]).map(({portconf_id:e,...t})=>t))),e}})),I((0,A.Oo)({[O]:()=>s({values:a})})),I((0,A.rW)({[O]:s})),()=>{I((0,A.uo)({[O]:null})),I((0,A.Oo)({[O]:null})),I((0,A.rW)({[O]:null}))}),[I,s,a,O,v.port_overrides,_.switch_vlan_enabled,M,w]);const T=!b&&!j&&p.length>1&&!(0,N.q82)({model:v.model})&&!(0,N.xQi)({model:v.model});return(0,i.jsxs)(h.A,{flexDirection:"column",gap:c.S2,children:[T?(0,i.jsx)(C.A,{nativeNetworks:p,mac:v.mac}):null,(0,i.jsx)(f.A,{}),a.config_network?.type===m.NL.STATIC?(0,i.jsx)(E.A,{}):null,(0,N.xyH)(v)||(0,N.Eyk)(v)||(0,N._iI)(v)||(0,N.W46)(v)?(0,i.jsx)(h.A,{children:(0,i.jsx)(u.A,{name:"config_network.bonding_enabled",type:"realCheckbox",children:(0,i.jsx)(g.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_AGGREGATION"})})}):null,M?(0,i.jsxs)(h.A,{flexDirection:"column",gap:c.kc,children:[(0,i.jsx)(l.A,{weight:"bold",size:"medium",children:(0,i.jsx)(g.sA,{id:"COMMON_VLAN"})}),(0,i.jsxs)(h.A,{justifyContent:"space-between",children:[(0,i.jsx)(l.A,{size:"medium",children:(0,i.jsx)(g.sA,{id:"DEVICE_PROPERTIES_VALUES_ENABLE_PORT_VLAN"})}),(0,i.jsx)(u.A,{type:"checkbox",name:"switch_vlan_enabled"})]})]}):null,null]})})},505342(e,t,n){n.d(t,{A:()=>N});var i=n(274934),a=n(977872),o=n(602086),r=n(843871),s=n(179102),l=n(247816),d=n(641645),c=n(309130),m=n(120197),_=n(470070),u=n(570801),h=n(304151),A=n(100978);const g=(0,l.A)(A.A)`
  margin-bottom: 24px;
`,v=e=>{const[t,n]=e.split(":");return 60*Number(t)+Number(n)},p=e=>`${Math.floor(e/d.t).toString().padStart(2,"0")}:${(e%d.t).toString().padStart(2,"0")}`,N=(0,o.memo)(()=>{const{values:{lcm_night_mode_begins:e,lcm_night_mode_ends:t},setFieldValue:n}=(0,r.j7)(),{formatMessage:l}=(0,_.tz)(),N=(0,a.d4)(u.jc),b=(0,o.useMemo)(()=>(0,d.gy)(N,15,l),[N,l]),C=(0,o.useMemo)(()=>"string"==typeof e?v(e):e,[e]),E=(0,o.useMemo)(()=>"string"==typeof t?v(t):t,[t]),f=(0,o.useCallback)(({value:e})=>{n("lcm_night_mode_begins",p(+e))},[n]),x=(0,o.useCallback)(({value:e})=>{n("lcm_night_mode_ends",p(+e))},[n]);return!C&&0!==C||!E&&0!==E?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(A.A,{justifyContent:"flex-start",marginBottom:c.kc,alignItems:"center",gap:c.YC,children:[(0,i.jsx)(s.A,{color:"text-1",size:"medium",children:(0,i.jsx)(_.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE"})}),(0,i.jsx)(h.A,{description:(0,i.jsx)(_.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE_DESCRIPTION"})})]}),(0,i.jsx)(g,{justifyContent:"space-between",flexDirection:"column",children:(0,i.jsxs)(A.A,{gap:c.Ln,children:[(0,i.jsx)(m.A,{type:"dropdown",variant:"secondary",label:"COMMON_START_TIME",translateLabel:!0,name:"lcm_night_mode_begins",placeholder:b.some(({value:e})=>e===C)?void 0:(0,d.oP)({formatMessage:l,minuteOfDay:C,use24HourFormat:N}),translatePlaceholder:!1,options:b,value:C,onChange:f,full:!0}),(0,i.jsx)(m.A,{type:"dropdown",variant:"secondary",label:"COMMON_END_TIME",translateLabel:!0,name:"lcm_night_mode_ends",placeholder:b.some(({value:e})=>e===E)?void 0:(0,d.oP)({formatMessage:l,minuteOfDay:E,use24HourFormat:N}),translatePlaceholder:!1,options:b,value:E,onChange:x,full:!0})]})})]})})},78083(e,t,n){n.d(t,{A:()=>h});var i=n(274934),a=n(526744),o=n(146215),r=n(470070),s=n(602086),l=n(977872),d=n(969819),c=n(347625),m=n(423564),_=n(197571),u=n(754924);const h=({mac:e,mgmtNetworkId:t,onSubmit:n,isDisabled:h,renderInnerButton:A})=>{const g=((e,t)=>{const n=(0,l.d4)(u.Kh),i=(0,l.d4)(_.Tn),a=(0,l.d4)(_.wf),o=n.get(e),r=t&&t!==a,h=(0,d.ki)(o,r?t:void 0),{remotePort:A}=o?(0,d.uj)(o,n):{remotePort:void 0},g=A?.port_idx,v=o?.uplink?.uplink_mac??o?.last_uplink?.uplink_mac,p=v?n.get(v):void 0,N=(0,c.Q)(p??{mac:v}),b=i.find(e=>e._id===t),C=b?(0,m.gm)(b):t||"";return(0,s.useMemo)(()=>{if(r&&h.hasConflict&&null!=g)return{networkName:C,switchName:N,port:g}},[r,h.hasConflict,g,C,N])})(e,t);return g?(0,i.jsx)(o.A,{title:(0,i.jsx)(r.sA,{id:"COMMON_NETWORK_OVERRIDE_CONFIRM_TITLE"}),message:(0,i.jsx)(r.sA,{id:"COMMON_NETWORK_OVERRIDE_CONFIRM_DEVICE",values:{networkName:g.networkName,switchName:g.switchName,port:g.port}}),onConfirm:n,confirmButtonLabel:"COMMON_ACTION_PROCEED",trigger:A?A(()=>{},h):(0,i.jsx)(a.A,{name:"submit",variant:"primary",type:"button",disabled:h,children:(0,i.jsx)(r.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})})}):(0,i.jsx)(i.Fragment,{children:A?A(n,h):(0,i.jsx)(a.A,{name:"submit",variant:"primary",type:"submit",onClick:n,disabled:h,children:(0,i.jsx)(r.sA,{id:"COMMON_ACTION_APPLY_CHANGES"})})})}},336128(e,t,n){n.d(t,{A:()=>_});var i=n(274934),a=n(602086),o=n(179102),r=n(833466),s=n(309130),l=n(589650),d=n(120197),c=n(100978),m=n(470070);const _=(0,a.memo)(()=>(0,i.jsxs)(c.A,{flexDirection:"column",children:[(0,i.jsx)(o.A,{color:"text-3",size:"small",children:(0,i.jsx)(m.sA,{id:"COMMON_IP_CONFIGURATION"})}),(0,i.jsxs)(c.A,{height:r.b,alignItems:"center",gap:s.Ln,children:[(0,i.jsx)(d.A,{name:"config_network.type",type:"radio",value:l.NL.DHCP,children:(0,i.jsx)(m.sA,{id:"COMMON_DHCP"})}),(0,i.jsx)(d.A,{name:"config_network.type",type:"radio",value:l.NL.STATIC,children:(0,i.jsx)(m.sA,{id:"COMMON_STATIC"})})]})]}))},389592(e,t,n){n.d(t,{A:()=>i});const i=(e,t)=>e[t]?.()?.mgmt_network_id},451700(e,t,n){n.d(t,{W:()=>y,A:()=>$});var i=n(274934),a=n(418398),o=n(977872),r=n(602086),s=n(843871),l=n(396489),d=n.n(l),c=n(421819),m=n(179102),_=n(247816),u=n(950804),h=n(309130),A=n(304151),g=n(505342),v=n(505817),p=n(595521),N=n(291508),b=n(100978),C=n(470070);const E=[0,90,180,270],f=(0,_.A)(b.A,(0,N.A)("isActive"))`
  border: 1px solid
    ${({theme:{themeName:e},isActive:t})=>t?v.Ay[`desktop-color-ublue-06-${e}`]:v.Ay[`desktop-color-neutral-03-${e}`]};
  border-radius: ${v.Ay["desktop-radius-base"]};
  cursor: pointer;
`,x=(0,_.A)(p.A,(0,N.A)("degree"))`
  transform: rotate(${({degree:e})=>e}deg);
`,O=({degree:e,isActive:t,onClick:n})=>(0,i.jsxs)(f,{padding:`${h.YC} ${h.kc}`,flex:1,gap:h.YC,alignItems:"center",isActive:t,onClick:n,children:[(0,i.jsx)(x,{isActive:t,degree:e}),(0,i.jsx)(m.A,{color:"text-2",children:e?`${e}°`:(0,i.jsx)(C.sA,{id:"COMMON_NONE"})})]}),I=()=>{const{values:{lcm_orientation_override:e},setFieldValue:t}=(0,s.j7)();return(0,i.jsxs)("div",{children:[(0,i.jsx)(m.A,{color:"text-3",size:"small",children:(0,i.jsx)(C.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_DISPLAY_ROTATION"})}),(0,i.jsx)(b.A,{gap:h.kc,marginTop:h.YC,marginBottom:h.Ln,children:E.map(n=>(0,i.jsx)(O,{degree:n,isActive:n===e,onClick:()=>{t("lcm_orientation_override",n)}},n))})]})};var M=n(120197),w=n(205521),j=n(291935),T=n(598990),k=n(897166),S=n(897015);const y="lcmScreen",R=(0,_.A)(b.A)`
  &:not(:last-child) {
    margin-bottom: ${h.S2};
  }
`,D=(0,s.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({lcmSettings:e,activeItem:t,activeItem:{lcm_brightness:n=S.VG,lcm_brightness_override:i=!1,lcm_night_mode_enabled:a=!1,lcm_night_mode_begins:o=S.z7,lcm_night_mode_ends:r=S.Vm,lcm_orientation_override:s}})=>({lcm:e,lcm_brightness:n,lcm_brightness_override:i,lcm_night_mode_enabled:a,lcm_night_mode_begins:o,lcm_night_mode_ends:r,..."lcm_orientation_override"in t?{lcm_orientation_override:s}:{}}),validationSchema:u.A.object().shape({lcm:u.A.object().shape({sync:u.A.boolean()}),lcm_brightness_override:u.A.boolean(),lcm_brightness:u.A.number().label("COMMON_BRIGHTNESS").min(1).max(100).required(),lcm_night_mode_enabled:u.A.boolean(),lcm_night_mode_begins:u.A.string(),lcm_night_mode_ends:u.A.string(),lcm_orientation_override:u.A.number()}),handleSubmit:()=>null}),L=e=>(0,i.jsx)(m.A,{size:"medium",children:e}),$=(0,a.Zz)((0,o.Ng)(e=>({lcmSettings:(0,j.ml)(e)}),{}),D)(({values:e,setFieldValue:t,resetForm:n,setFormDirty:a,setFormInvalid:s,dirty:l,isValid:_,initialValues:u,activeItem:v,hideRackMultiScreenSync:p=!1})=>{const N=(0,o.wA)(),E=(0,o.d4)(k.EL);return(0,r.useEffect)(()=>{a(y,l),s(y,!_)},[a,s,_,l]),(0,r.useEffect)(()=>(N((0,w.uo)({[y]:()=>({...e,lcm_brightness_override:e.lcm_brightness!==S.VG,lcm_night_mode_begins:e.lcm_night_mode_begins,lcm_night_mode_ends:e.lcm_night_mode_ends,..."lcm_orientation_override"in e?{lcm_orientation_override:e.lcm_orientation_override}:{}})})),N((0,w.Oo)({[y]:()=>{d()(u.lcm,e.lcm)||N((0,T.vd)(e.lcm)),n({values:e})}})),N((0,w.rW)({[y]:n})),()=>{N((0,w.uo)({[y]:null})),N((0,w.Oo)({[y]:null})),N((0,w.rW)({[y]:null}))}),[N,n,e,u.lcm]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(R,{justifyContent:"space-between",children:[(0,i.jsx)(m.A,{color:"text-1",size:"medium",children:(0,i.jsx)(C.sA,{id:"COMMON_BRIGHTNESS"})}),(0,i.jsx)(c.A,{width:"50%",value:e.lcm_brightness||S.VG,withValueIndicator:!0,min:1,valueIndicatorPosition:"right",formatValueIndicatorContent:L,onChange:e=>{t("lcm_brightness",+e.target.value)},disabled:E})]}),"lcm_orientation_override"in v?(0,i.jsx)(I,{}):null,(0,i.jsx)(g.A,{}),p?null:(0,i.jsx)(R,{justifyContent:"space-between",alignItems:"center",children:(0,i.jsxs)(b.A,{alignItems:"center",gap:h.kc,children:[(0,i.jsxs)(b.A,{alignItems:"center",children:[(0,i.jsx)(M.A,{type:"realCheckbox",name:"lcm.sync",checked:e.lcm.sync}),(0,i.jsx)(m.A,{color:"text-1",size:"medium",children:(0,i.jsx)(C.sA,{id:"COMMON_RACK_MULTI_SCREEN_SYNC"})})]}),(0,i.jsx)(A.A,{description:(0,i.jsx)(C.sA,{id:"DEVICE_PROPERTIES_LABEL_RACK_MULTI_SCREEN_SYNCHRONIZATION_TOOLTIP"})})]})})]})})},655122(e,t,n){n.r(t),n.d(t,{default:()=>y});var i,a=n(274934),o=n(418398),r=n(977872),s=n(602086),l=n(478961),d=n(630849),c=n(376892),m=n(535322),_=n(446863),u=n(291935),h=n(598990),A=n(714548),g=n(933007),v=n(956978),p=n(795206),N=n(586566),b=n(14683),C=n(996052),E=n(80345),f=n(449339),x=n(637084),O=n(461094),I=n(115114),M=n(389592),w=n(78083),j=n(148561),T=n(532635),k=n(795928);!function(e){e.NAME="name",e.NETWORK="network",e.MANAGE_DEVICE="manage-device"}(i||(i={}));var S=n(451700);const y=(0,o.Zz)((0,l.A)([i.NAME,i.NETWORK,i.MANAGE_DEVICE,b.L]))(({activeItem:e,setFormDirty:t,setFormInvalid:n,isDirty:o,isInvalid:l})=>{const y=(0,r.d4)(_.Lq),R=(0,r.d4)(_.H5),D=(0,r.d4)(_.n0),L=(0,r.wA)(),$=(0,d.I)(),[P,F]=(0,s.useState)(!1),V=(0,s.useMemo)(()=>(0,v.w2f)({model:e.model}),[e.model]),H=(0,r.d4)(u.aN),[B,G]=(0,s.useState)(H);(0,s.useEffect)(()=>{G(H)},[H]),(0,s.useEffect)(()=>{(0,N.z6)(e.switch_caps?.feature_caps)&&L((0,h.Uc)())},[L,e.switch_caps?.feature_caps]);const U=(0,s.useCallback)(async t=>{const n="string"==typeof t?t:void 0;F(!0);const i=Object.entries(D).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},{}),{ether_lighting:a,...o}=i,{etherlightingDeviceData:r,etherlightingSettingsToSubmit:s,hasEtherlightingChanges:l}=(0,A.E)({formData:{ether_lighting:a},etherlightingSettings:H,initialEtherlightingSettings:B}),d=[];(0,N.z6)(e.switch_caps?.feature_caps)&&l&&d.push(L((0,h.Ry)(s)).catch($)),d.push(L((0,p.ex)({...o,ether_lighting:r},e._id,e.mac,{extend:!0},n)).catch($)),await Promise.all(d).then(()=>{Object.values(y).forEach(e=>{"function"==typeof e&&e()})}).finally(()=>{F(!1),V&&L((0,g.Hq)())})},[L,e._id,e.mac,e.switch_caps?.feature_caps,D,y,$,V,H,B]),Z=(0,s.useCallback)(()=>{Object.values(R).forEach(e=>{"function"==typeof e&&e()})},[R]),z=(0,M.A)(D,j.g),W=(0,s.useCallback)(({[E.rx.TEST_CONFIG_ID]:e})=>U(e),[U]),{[E.$U.TEST_CONFIG_FOOTER]:K,[E.$U.IS_TESTING]:Y}=(0,C.A)({[E.e_.DEVICE]:e,[E.e_.MGMT_NETWORK_ID]:z,[E.e_.IS_INVALID]:l,[E.e_.SUBMIT]:W,[E.e_.ON_CANCEL]:Z,[E.e_.PANEL_TYPE]:f.H.DEVICE});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k.Ay,{activeItem:e,setFormDirty:t,setFormInvalid:n,formName:i.NAME,maxLength:O.U}),(0,N.z6)(e.switch_caps?.feature_caps)?(0,a.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:b.L,openByDefault:!0,label:(0,a.jsx)(c.A,{id:(0,N.Nr)(e)?"COMMON_PORT_LEDS":"COMMON_ETHERLIGHTING"}),renderContent:()=>(0,a.jsx)(b.A,{activeItem:e,etherlightingSettings:H,setFormDirty:t})}]}):null,(0,a.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:i.NETWORK,openByDefault:!0,label:(0,a.jsx)(c.A,{id:"COMMON_IP_SETTINGS"}),renderContent:()=>(0,a.jsx)(j.A,{activeItem:e,setFormDirty:t,setFormInvalid:n,formName:i.NETWORK,hideNetworkOverride:V})}]}),(0,a.jsx)(x.A,{device:e,setFormDirty:t,setFormInvalid:n}),(0,a.jsx)(m.A,{type:m.I.ACCORDION,items:[{id:i.MANAGE_DEVICE,openByDefault:!0,label:(0,a.jsx)(c.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.A,{activeItem:e,setFormDirty:t,setFormInvalid:n}),(0,a.jsx)(T.A,{activeItem:e})]})}]}),(0,a.jsx)(I.A,{isDirty:o||Y,isInvalid:l,isSubmitting:P,onFormSubmit:U,onFormCancel:Z,testConfigFooter:K,applyButton:V?void 0:(0,a.jsx)(w.A,{mac:e.mac,mgmtNetworkId:z,onSubmit:U,isDisabled:!o||l||P})})]})})},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:()=>o});var i=n(274934),a=n(602086);const o=function(e){return t=>n=>{const[o,r]=(0,a.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[s,l]=(0,a.useState)(Object.fromEntries(e.map(e=>[e,!1]))),d=(0,a.useCallback)((e,t)=>{r(n=>({...n,[e]:t}))},[]),c=(0,a.useCallback)((e,t)=>{l(n=>({...n,[e]:t}))},[]),m=!!Object.values(o).find(e=>e),_=!!Object.values(s).find(e=>e);return(0,i.jsx)(t,{isDirty:m,isInvalid:_,formStates:o,setFormDirty:d,setFormInvalid:c,...n})}}},641645(e,t,n){n.d(t,{EJ:()=>d,gy:()=>s,oP:()=>r,pi:()=>o,q8:()=>l,t:()=>a});var i=n(477909);const a=60,o=24,r=({minuteOfDay:e,use24HourFormat:t,formatMessage:n})=>{const i=Math.floor(e/60);return`${String(t?i:i%12||12).padStart(2,"0")}:${String(e%a).padStart(2,"0")}${t?"":` ${n({id:i>=12?"COMMON_PM":"COMMON_AM"})}`}`},s=(e,t,n)=>{const o=Math.max(1,Math.min(60,Math.floor(60/t))),s=Math.floor(60/o);return(0,i.A)(0,24).flatMap(t=>(0,i.A)(o).map(i=>{const o=i*s;return{label:r({use24HourFormat:e,formatMessage:n,minuteOfDay:t*a+o}),value:60*t+ +o}}))},l=e=>6e4*Math.round(e/6e4),d=(e,t)=>{const n=+(e/1e3).toFixed(1),i=+(n/1e3).toFixed(1),a=+(n/6e4).toFixed(1);return n<1e3?`${n} ${t({id:"COMMON_UNIT_MS"})}`:i<60?`${i} ${t({id:"COMMON_UNIT_S"})}`:`${a} ${t({id:"COMMON_UNIT_MIN"})}`}}}]);