"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[58257,89965],{86571:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(296540),i=n(217439),a=n(699784);const l=({id:e,children:t,values:n})=>r.createElement(i.A,{color:"text-1",weight:"bold",size:"medium"},e?r.createElement(a.sA,{id:e,values:n}):null,t)},152e3:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(296540),i=n(436017),a=n(927099),l=n(314714),o=n(71479),c=n(566723),s=n(294303),m=n(699784);const d=(0,o.A)("div")`
  width: 100%;
  margin-bottom: ${c.Ln};
`,u={Toggle:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,noStyledRow:n})=>{const l=(0,r.useCallback)(({target:{checked:e}})=>{t(e)},[t]),o=r.createElement(i.A,{full:!0,checked:e,onChange:l},r.createElement(s.A,{width:"100%",alignItems:"center"},r.createElement(a.A,{size:"body"},r.createElement(m.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"}))));return n?o:r.createElement(d,null,o)},Checkbox:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,onChange:n,noStyledRow:i})=>{const o=(0,r.useCallback)(({target:{checked:e}})=>{t(e),n?.(e)},[n,t]),c=r.createElement(l.A,{id:"global-switch-settings-checkbox",checked:e,onChange:o},r.createElement(s.A,{width:"100%",alignItems:"center"},r.createElement(a.A,{size:"body"},r.createElement(m.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"}))));return i?c:r.createElement(d,null,c)}}},279675:(e,t,n)=>{n.d(t,{W:()=>R,A:()=>$});var r=n(868238),i=n(469733),a=n(296540),l=n(951272),o=n(429252),c=n.n(o),s=n(802),m=n(217439),d=n(71479),u=n(870443),_=n(566723),p=n(766624),E=n(389651),g=n(822336),A=n(870829),h=n(311785),b=n(294303),I=n(699784);const O=[0,90,180,270],v=(0,d.A)(b.A,(0,h.A)("isActive"))`
  border: 1px solid
    ${({theme:{motifPalette:{uBlue06:e,neutral03:t}},isActive:n})=>n?e:t};
  border-radius: ${g.Ay["desktop-radius-base"]};
  cursor: pointer;
`,S=(0,d.A)(A.A,(0,h.A)("degree"))`
  transform: rotate(${({degree:e})=>e}deg);
`,C=({degree:e,isActive:t,onClick:n})=>a.createElement(v,{padding:`${_.YC} ${_.kc}`,flex:1,gap:_.YC,alignItems:"center",isActive:t,onClick:n},a.createElement(S,{isActive:t,degree:e}),a.createElement(m.A,{color:"text-2"},e?`${e}°`:a.createElement(I.sA,{id:"COMMON_NONE"}))),f=()=>{const{values:{lcm_orientation_override:e},setFieldValue:t}=(0,l.j7)();return a.createElement("div",null,a.createElement(m.A,{color:"text-3",size:"small"},a.createElement(I.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_DISPLAY_ROTATION"})),a.createElement(b.A,{gap:_.kc,marginTop:_.YC,marginBottom:_.Ln},O.map(n=>a.createElement(C,{key:n,degree:n,isActive:n===e,onClick:()=>{t("lcm_orientation_override",n)}}))))};var x=n(143811),N=n(845030),y=n(302167),T=n(457311),M=n(602021),P=n(639188);const R="lcmScreen",k=(0,d.A)(b.A)`
  &:not(:last-child) {
    margin-bottom: ${_.S2};
  }
`,D=(0,l.bk)({enableReinitialize:!0,isInitialValid:!0,mapPropsToValues:({lcmSettings:e,activeItem:t,activeItem:{lcm_brightness:n=P.VG,lcm_brightness_override:r=!1,lcm_night_mode_enabled:i=!1,lcm_night_mode_begins:a=P.z7,lcm_night_mode_ends:l=P.Vm,lcm_orientation_override:o}})=>({lcm:e,lcm_brightness:n,lcm_brightness_override:r,lcm_night_mode_enabled:i,lcm_night_mode_begins:a,lcm_night_mode_ends:l,..."lcm_orientation_override"in t?{lcm_orientation_override:o}:{}}),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}),w=e=>a.createElement(m.A,{size:"medium"},e),$=(0,r.Zz)((0,i.connect)(e=>({lcmSettings:(0,y.ml)(e)}),{}),D)(({values:e,setFieldValue:t,resetForm:n,setFormDirty:r,setFormInvalid:l,dirty:o,isValid:d,initialValues:u,activeItem:g,hideRackMultiScreenSync:A=!1})=>{const h=(0,i.useDispatch)(),O=(0,i.useSelector)(M.EL);return(0,a.useEffect)(()=>{r(R,o),l(R,!d)},[r,l,d,o]),(0,a.useEffect)(()=>(h((0,N.uo)({[R]:()=>({...e,lcm_brightness_override:e.lcm_brightness!==P.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}:{}})})),h((0,N.Oo)({[R]:()=>{c()(u.lcm,e.lcm)||h((0,T.vd)(e.lcm)),n({values:e})}})),h((0,N.rW)({[R]:n})),()=>{h((0,N.uo)({[R]:null})),h((0,N.Oo)({[R]:null})),h((0,N.rW)({[R]:null}))}),[h,n,e,u.lcm]),a.createElement(a.Fragment,null,a.createElement(k,{justifyContent:"space-between"},a.createElement(m.A,{color:"text-1",size:"medium"},a.createElement(I.sA,{id:"COMMON_BRIGHTNESS"})),a.createElement(s.A,{width:"50%",value:e.lcm_brightness||P.VG,withValueIndicator:!0,min:1,valueIndicatorPosition:"right",formatValueIndicatorContent:w,onChange:e=>{t("lcm_brightness",+e.target.value)},disabled:O})),"lcm_orientation_override"in g?a.createElement(f,null):null,a.createElement(E.A,null),A?null:a.createElement(k,{justifyContent:"space-between",alignItems:"center"},a.createElement(b.A,{alignItems:"center",gap:_.kc},a.createElement(b.A,{alignItems:"center"},a.createElement(x.A,{type:"realCheckbox",name:"lcm.sync",checked:e.lcm.sync}),a.createElement(m.A,{color:"text-1",size:"medium"},a.createElement(I.sA,{id:"COMMON_RACK_MULTI_SCREEN_SYNC"}))),a.createElement(p.A,{description:a.createElement(I.sA,{id:"DEVICE_PROPERTIES_LABEL_RACK_MULTI_SCREEN_SYNCHRONIZATION_TOOLTIP"})}))))})},319826:(e,t,n)=>{n.d(t,{$3:()=>v,SD:()=>N,b5:()=>S,nR:()=>x,sD:()=>f,yz:()=>C});var r=n(296540),i=n(566401),a=n(927099),l=n(71479),o=n(316144),c=n(137298),s=n(6510),m=n(266714),d=n(294303),u=n(6176),_=n(703447),p=n(699784),E=n(768941),g=n(962669),A=n(757167),h=n(552020),b=n(780811),I=(n(154828),n(951106));const O=(0,l.A)(a.A)`
  padding-left: 10px;
  color: inherit;
  font-size: inherit;
`,v=({activeItem:e,networkGroups:t,rest:n})=>{const{diagram:a}=(0,b.joB)(e.model),l=[(0,b.D6h)(e),(0,b.bf1)(e),(0,b.Bh_)(e)],{uplinkItems:E,...v}=n||{},S=(0,b.Tl7)(e)||(0,b.kYz)(e)||(0,b.vqp)(e),C=a.length?(0,g.sT)(a,e):(0,g.oJ)(e);return C?C.flat().reduce((n,a)=>{if(!a)return n;const g=(0,b.NF$)(a.portNumber,e);if((0,i.A)(g))return n;const C=r.createElement(d.A,{alignItems:"center"},r.createElement(m.A,{cellData:g,activeItem:e,style:{minWidth:20},...v}),r.createElement(O,{truncate:!0},g.port_idx)),f=r.createElement(d.A,{alignItems:"center"},r.createElement(m.A,{cellData:g,activeItem:e,style:{minWidth:20},disableOnPortClick:S,...v}),r.createElement(O,{truncate:!0},((e,t)=>{if(t.poe_caps&&!(0,b.C6C)(e)){const e=(0,h.Ki)(t);return e?r.createElement(p.sA,{id:e,values:{power:t.poe_power}}):""}return t.up?(0,c.ap)(t?.speed||0)||r.createElement(p.sA,{id:"DEVICE_PORT_STATE_CONNECTED"}):t.enable?r.createElement(p.sA,{id:"COMMON_DISCONNECTED"}):r.createElement(p.sA,{id:"COMMON_DISABLED"})})(e,g))),x=(0,o.nL)(g.ifname,e,t),N="Internal"===x?.label,y=x?.id?.startsWith("LAN")||N,T=E?.find(e=>e.portIdx===g.port_idx)?.connected[0];let M=r.createElement(d.A,null);if(T){const e="device_id"in T?(0,s.Q)(T):(0,I.tn)(T),t="device_id"in T?r.createElement(u.A,{model:T.model,width:18,height:22}):r.createElement(d.A,{height:26,minWidth:22,maxWidth:22,justifyContent:"center",alignItems:"center"},r.createElement(_.A,{client:T}));M=r.createElement(d.A,{alignItems:"center"},r.createElement(d.A,{alignItems:"center",marginRight:"14px"},t),r.createElement(d.A,{alignItems:"center",flex:1},e))}const P={...g,id:g.port_idx?.toString()||g.ifname,defaultNetworkGroupLabel:(0,b.Xq1)(e,g),disabled:g.masked||(0,A.dC)(g.ifname),isInternalPort:N,isLanPort:y,isWanPort:!y,networkGroup:x?.id,portUplinkItemName:M,portStatus:f,portSymbol:C};return l.every(e=>!e)&&(P.macFilters=g.port_security_mac_address?.length),n.push(P),n},[]).sort(({port_idx:e},{port_idx:t})=>e-t):[]},S=e=>e.isWanPort,C=e=>e.isLanPort,f=e=>e.filter(({disabled:e})=>!e).map(({port_idx:e})=>String(e)),x=(e,t)=>e.map(e=>{const n=t.find(t=>e.port_idx===t.portIdx);if(!n)return e;const{rx_broadcast:r,rx_bytes:i,rx_dropped:a,rx_errors:l,rx_multicast:o,rx_packets:c,tx_broadcast:s,tx_bytes:m,tx_dropped:d,tx_errors:u,tx_multicast:_,tx_packets:p}=n;return{...e,rx_broadcast:r,rx_bytes:i,rx_dropped:a,rx_errors:l,rx_multicast:o,rx_packets:c,tx_broadcast:s,tx_bytes:m,tx_dropped:d,tx_errors:u,tx_multicast:_,tx_packets:p}}),N=e=>{const{isPoeOffSupported:t,isPoePassthroughSupported:n,isPoePassive24Supported:r,isPoeAutoSupported:i}=e,a=[];return t&&a.push(E.Gu.OFF),n&&a.push(E.Gu.PASSTHROUGH),!n&&r&&a.push(E.Gu.PASSIVE_24V),!n&&i&&a.push(E.Gu.AUTO),a}},389651:(e,t,n)=>{n.d(t,{A:()=>O});var r=n(469733),i=n(296540),a=n(951272),l=n(271856),o=n(927099),c=n(162420),s=n(71479),m=n(834042),d=n(566723),u=n(143811),_=n(699784),p=n(198494),E=n(294303);const g=(0,s.A)(E.A)`
  margin-bottom: 24px;
`,A=(0,s.A)(l.A)`
  top: 2px;
`,h=(0,s.A)(c.A)`
  margin-left: 6px;
  margin-bottom: 3px;
`,b=e=>{const[t,n]=e.split(":");return 60*Number(t)+Number(n)},I=e=>`${Math.floor(e/m.t).toString().padStart(2,"0")}:${(e%m.t).toString().padStart(2,"0")}`,O=(0,i.memo)(()=>{const{values:{lcm_night_mode_begins:e,lcm_night_mode_ends:t},setFieldValue:n}=(0,a.j7)(),{formatMessage:l}=(0,_.tz)(),c=(0,r.useSelector)(p.jc),s=(0,i.useMemo)(()=>(0,m.gy)(c,15,l),[c,l]),O=(0,i.useMemo)(()=>"string"==typeof e?b(e):e,[e]),v=(0,i.useMemo)(()=>"string"==typeof t?b(t):t,[t]),S=(0,i.useCallback)(({value:e})=>{n("lcm_night_mode_begins",I(+e))},[n]),C=(0,i.useCallback)(({value:e})=>{n("lcm_night_mode_ends",I(+e))},[n]);return(O||0===O)&&(v||0===v)?i.createElement(i.Fragment,null,i.createElement(E.A,{justifyContent:"flex-start",marginBottom:8},i.createElement(o.A,{color:"primary",size:"body"},i.createElement(_.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE"})),i.createElement(A,{width:200,description:i.createElement(_.sA,{id:"DEVICE_PROPERTIES_LABEL_LCM_NIGHT_MODE_DESCRIPTION"})},i.createElement(h,{size:"original",isActive:!0}))),i.createElement(g,{justifyContent:"space-between",flexDirection:"column"},i.createElement(E.A,{gap:d.Ln},i.createElement(u.A,{type:"dropdown",variant:"secondary",label:"COMMON_START_TIME",translateLabel:!0,name:"lcm_night_mode_begins",placeholder:s.some(({value:e})=>e===O)?void 0:(0,m.oP)({formatMessage:l,minuteOfDay:O,use24HourFormat:c}),translatePlaceholder:!1,options:s,value:O,onChange:S,full:!0}),i.createElement(u.A,{type:"dropdown",variant:"secondary",label:"COMMON_END_TIME",translateLabel:!0,name:"lcm_night_mode_ends",placeholder:s.some(({value:e})=>e===v)?void 0:(0,m.oP)({formatMessage:l,minuteOfDay:v,use24HourFormat:c}),translatePlaceholder:!1,options:s,value:v,onChange:C,full:!0})))):null})},449688:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(296540);const i=function(e){return t=>n=>{const[i,a]=(0,r.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[l,o]=(0,r.useState)(Object.fromEntries(e.map(e=>[e,!1]))),c=(0,r.useCallback)((e,t)=>{a(n=>({...n,[e]:t}))},[]),s=(0,r.useCallback)((e,t)=>{o(n=>({...n,[e]:t}))},[]),m=!!Object.values(i).find(e=>e),d=!!Object.values(l).find(e=>e);return r.createElement(t,{isDirty:m,isInvalid:d,formStates:i,setFormDirty:c,setFormInvalid:s,...n})}}},639188:(e,t,n)=>{n.d(t,{VG:()=>r,Vm:()=>a,z7:()=>i});const r=80,i="22:00",a="08:00"},689965:(e,t,n)=>{n.d(t,{A:()=>_,I:()=>r});var r,i=n(296540),a=n(822336),l=n(427853),o=n(71479),c=n(825032),s=n(566723),m=n(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const d=(0,o.A)(m.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({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}})=>a.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,o.A)(l.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-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||a.Ay[t===c.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${s.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${s.Ln} ${s.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,_=({type:e,marginBottom:t,margin:n,padding:a,flex:l,width:o,nested:c,...s})=>"items"in s?i.createElement(u,{marginBottom:t,margin:n,padding:a,flex:l,nested:c,...s}):i.createElement(d,{nested:c,width:o,marginBottom:t,margin:n,padding:a,flex:l,isButtonList:e===r.BUTTON_LIST,...s},s.children)},799552:(e,t,n)=>{n.d(t,{A:()=>h});var r=n(296540),i=n(23514),a=n(162420),l=n(71479),o=n(132196),c=n(566723),s=n(294303),m=n(699784),d=n(962669),u=n(780811),_=n(266714),p=n(335165);const E=(0,l.A)(s.A)`
  font-size: ${({theme:{fontSizes:e}})=>e[0]}px;
`,g=(0,l.A)("div",{shouldForwardProp:e=>!["portSize","portSizeOverride"].includes(e)})`
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||p.J.large.size};
  flex-shrink: 0;
`,A=({spacing:e},t)=>o.AH`
  &:not(:first-child) {
    margin-top: ${c.YC};
  }
  &:nth-child(2n) {
    margin-top: ${e};
  }

  justify-content: ${t?"space-between":"unset"};
`,h=({activeItem:e,activeItem:{model:t},portSizeOverride:n,disableOnPortClick:l,isStacking:o})=>{const{diagram:c}=(0,u.joB)(t),h=c?.length?(0,d.sT)(c,e):(0,d.oJ)(e);if(!h||0===h.length)return r.createElement(E,null,r.createElement(a.A,{isActive:!0,className:"mr-2"}),r.createElement(m.sA,{id:"DEVICE_DIAGRAM_MISSING"}));const b=Number((0,i.A)(h.map(e=>e.length))),I=Object.values(p.J).find(e=>b<=e.threshold)||p.J.xsmall,O=I===p.J.xsmall;return r.createElement(r.Fragment,null,h.map((t,i)=>r.createElement(s.A,{"align-items":"flex-end",key:`PortLayoutRow-${i+1}`,className:A(I,o),flex:`1 1 ${n||I.size}`,gap:I?.spacing||p.J.large.spacing},t.map((t,a)=>{const o=`Port-${i+1}-${a+1}`,c=t&&e?.port_table?(0,u.NF$)(t.portNumber,e):null;return c?r.createElement(_.A,{cellData:c,activeItem:e,key:o,keyValue:o,portSize:I,portSizeOverride:n,disableOnPortClick:l}):O&&((e,t)=>{const n=!e[0]?.[t],r=0===e.length||!e[1]?.[t];if(!n||!r)return!1;if(t>0){const n=e[0]?.[t-1],r=e.length>1?e[1]?.[t-1]:null;if(!(n?.portType||"").includes("sfp")||!(r?.portType||"").includes("sfp"))return!1}return!0})(h,a)?null:r.createElement(g,{key:o,portSize:I,portSizeOverride:n})}))))}},834042:(e,t,n)=>{n.d(t,{EJ:()=>s,gy:()=>o,oP:()=>l,pi:()=>a,q8:()=>c,t:()=>i});var r=n(621690);const i=60,a=24,l=({minuteOfDay:e,use24HourFormat:t,formatMessage:n})=>{const r=Math.floor(e/60);return`${String(t?r:r%12||12).padStart(2,"0")}:${String(e%i).padStart(2,"0")}${t?"":` ${n({id:r>=12?"COMMON_PM":"COMMON_AM"})}`}`},o=(e,t,n)=>{const a=Math.max(1,Math.min(60,Math.floor(60/t))),o=Math.floor(60/a);return(0,r.A)(0,24).map(t=>(0,r.A)(a).map(r=>{const a=r*o;return{label:l({use24HourFormat:e,formatMessage:n,minuteOfDay:t*i+a}),value:60*t+ +a}})).flat()},c=e=>6e4*Math.round(e/6e4),s=(e,t)=>{const n=+(e/1e3).toFixed(1),r=+(n/1e3).toFixed(1),i=+(n/6e4).toFixed(1);return n<1e3?`${n} ${t({id:"COMMON_UNIT_MS"})}`:r<60?`${r} ${t({id:"COMMON_UNIT_S"})}`:`${i} ${t({id:"COMMON_UNIT_MIN"})}`}},858257:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var r=n(868238),i=n(469733),a=n(296540),l=n(592510),o=n(742920),c=n(582724),s=n(449688),m=n(96512),d=n(86571),u=n(689965),_=n(675359),p=n(302167),E=n(457311),g=n(889764),A=n(347524),h=n(171073),b=n(279675),I=n(949810),O=n(329109),v=n(152e3),S=n(45062),C=n(943089),f=n(263262),x=n(956619),N=n(89124);const y=(0,r.Zz)((0,s.A)([N.UH,b.W,S.q,f.g]))(({activeItem:e,setFormDirty:t,setFormInvalid:n,isDirty:r,isInvalid:s})=>{const y=(0,i.useSelector)(g.n0),T=(0,i.useSelector)(g.Lq),M=(0,i.useSelector)(g.H5),P=(0,i.useSelector)(p.zu),R=(0,i.useDispatch)(),[k,D]=(0,a.useState)(!P.switch_exclusions?.includes(e.mac)),w=(0,m.I)(),$=r||k!==!P.switch_exclusions?.includes(e.mac),L=(0,a.useCallback)(async()=>{if(k!==!P.switch_exclusions?.includes(e.mac)){const t=P.switch_exclusions.filter(t=>t!==e.mac);k||t.push(e.mac);try{await R((0,E.OD)({...P,switch_exclusions:t}))}catch(e){return void R((0,_.ox)({icon:o.C.danger,message:"DEVICE_NOTICE_SAVE_ERROR"}))}}const t=Object.entries(y).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},{}),{lcm:n,...r}=t;R((0,h.ex)(r,e._id,e.mac,{extend:!0})).then(()=>{Object.values(T).forEach(e=>{"function"==typeof e&&e()})}).catch(w)},[k,P,e.mac,e._id,y,R,w,T]),F=(0,a.useCallback)(()=>{D(!P.switch_exclusions?.includes(e.mac)),Object.values(M).forEach(e=>{"function"==typeof e&&e()})},[P.switch_exclusions,e.mac,M]);return(0,c.A)([(0,A.u)(void 0,{crudCacheStrategy:{type:l.e.CACHE}})],a.createElement(a.Fragment,null,a.createElement(N.Ay,{activeItem:e,setFormDirty:t,setFormInvalid:n}),a.createElement(u.A,{type:u.I.ACCORDION,items:[{id:"outlets",openByDefault:!0,label:a.createElement(d.A,{id:"COMMON_OUTLETS"}),renderContent:()=>a.createElement(a.Fragment,null,a.createElement(I.A,{activeItem:e,hidePorts:!0}),a.createElement(C.A,{hidePorts:!0,activeItem:e}))}]}),a.createElement(u.A,{type:u.I.ACCORDION,items:[{id:b.W,openByDefault:!0,label:a.createElement(d.A,{id:"DEVICE_PROPERTY_HEADER_TOUCHSCREEN"}),renderContent:()=>a.createElement(b.A,{activeItem:e,setFormDirty:t,setFormInvalid:n})}]}),a.createElement(u.A,{type:u.I.ACCORDION,items:[{id:S.q,openByDefault:!0,label:a.createElement(d.A,{id:"COMMON_SERVICES"}),renderContent:()=>a.createElement(a.Fragment,null,a.createElement(v.A.Toggle,{isGlobalSwitchSettingsEnabled:k,setGlobalSwitchSettingsEnabled:D}),a.createElement(S.A,{activeItem:e,setFormDirty:t,setFormInvalid:n,isGlobalSwitchSettingsEnabled:k}))}]}),a.createElement(u.A,{type:u.I.ACCORDION,items:[{id:f.g,openByDefault:!0,label:a.createElement(d.A,{id:"COMMON_IP_SETTINGS"}),renderContent:()=>a.createElement(f.A,{activeItem:e,setFormDirty:t,setFormInvalid:n})}]}),a.createElement(u.A,{type:u.I.ACCORDION,items:[{id:"manage",openByDefault:!0,label:a.createElement(d.A,{id:"COMMON_ACTION_MANAGE"}),renderContent:()=>a.createElement(x.A,{activeItem:e})}]}),a.createElement(O.A,{isDirty:$,isInvalid:s,onFormSubmit:L,onFormCancel:F})))})},889764:(e,t,n)=>{n.d(t,{H5:()=>c,Lq:()=>o,n0:()=>l});var r=n(849513),i=n(276907),a=n(919952);const l=e=>e[a.U.SHARED][i.N.PROPERTY_PANEL]?.[r.Io.TAB_GET_DATA_FUNCTION]||{},o=e=>e[a.U.SHARED][i.N.PROPERTY_PANEL]?.[r.Io.TAB_SUBMIT_FUNCTION]||{},c=e=>e[a.U.SHARED][i.N.PROPERTY_PANEL]?.[r.Io.TAB_RESET_FUNCTION]||{}},943089:(e,t,n)=>{n.d(t,{A:()=>x});var r=n(296540),i=n(469733),a=n(271856),l=n(927099),o=n(963070),c=n(897547),s=n(71479),m=n(960407),d=n(860631),u=n(398300),_=n(855019),p=n(294303),E=n(845030),g=n(699784),A=n(319826),h=n(170163),b=n(780811),I=n(953394),O=n(405639);const v=(0,s.A)("div")`
  font-size: ${({theme:{fontSizes:e}})=>e[2]}px;
  padding-left: 10px;
`,S=(0,s.A)("div")`
  table {
    tr {
      cursor: pointer;
    }
  }
`,C=(0,s.A)(c.A)`
  position: absolute;
  right: 8px;
  color: inherit;
`,f=(0,r.memo)(({activeItem:e,activeItem:{outlet_table:t},hidePorts:n,overrideNameHeader:c,onRowClick:s})=>{const f=(0,i.useDispatch)(),x=(0,i.useSelector)(m.oI),N=(0,h.Ib)(e.model),{outletsDiagram:y,primaryOutletGroupCount:T}=(0,b.joB)(e.model),M=t?.some(e=>(0,d.TT)(e,"POWER_METER")),P=(0,r.useMemo)(()=>((e,t,n)=>[{id:"name",label:n||r.createElement(g.sA,{id:"COMMON_NAME"}),renderCell:({name:e})=>r.createElement(a.A,{noWrap:!0,description:r.createElement(l.A,{truncate:!0,color:"inherit",size:"body",style:{whiteSpace:"nowrap"}},e)},r.createElement(l.A,{color:"inherit",size:"body",truncate:!0},e))},...e?[{id:"power",label:r.createElement(g.sA,{id:"DEVICE_PROPERTIES_LABEL_POWER"}),renderCell:({outlet_power:e})=>r.createElement(l.A,{color:"inherit",size:"body"},e?Number(e).toFixed(2):r.createElement(g.sA,{id:"COMMON_FALLBACK"}))}]:[],{id:"outletStatus",label:r.createElement(g.sA,{id:"COMMON_STATUS"}),width:45,renderCell:e=>r.createElement(r.Fragment,null,r.createElement(p.A,{alignItems:"center"},e.portStatus?r.createElement(l.A,{color:"inherit",size:"body"},e.portStatus):r.createElement(r.Fragment,null,r.createElement(O.A,{activeItemMac:t,cellData:e,iconRotation:e.iconRotation,tooltipPlacement:"top right"}),r.createElement(v,null,r.createElement(g.sA,{id:e.relay_state?"COMMON_ENABLED":"COMMON_DISABLED"})))),r.createElement(C,{size:"small"}))}])(M,e.mac,c),[M,e.mac,c]),R=y.length?(0,h.FP)(y,e.model):(0,h.ST)(T,e.model),k=(0,A.$3)({activeItem:e,networkGroups:[],rest:{position:"topRight"}}),D=(0,r.useMemo)(()=>[...R.flat().filter(e=>!!e&&[I.s.STANDARD,I.s.USB].includes(e.outletType)).sort(({outletNumber:e},{outletNumber:t})=>e-t),...n?[]:k],[n,k,R]).map(t=>{const n=(0,h.o3)(e,void 0,t.outletNumber);return{...t.portStatus?t:n,id:t.portStatus?`port-${t.id}`:t.outletNumber,outletType:t.portStatus?null:(0,h.I)(N,t.outletNumber),iconRotation:t?.iconRotation}}),w=(0,r.useCallback)(({index:t,port_idx:n,outletType:r})=>{if([I.s.STANDARD,I.s.USB].includes(r)){const r=String(t||n);s?s(r):f((0,E.XP)({type:u.H.DEVICE,id:e.mac,tab:x,subPanel:t?_.uY.OUTLETS:_.uY.PORTS,subId:r}))}},[f,x,e.mac,s]);return r.createElement(S,null,r.createElement(o.A,{columns:P,disableColumnFilters:!0,items:D,hideCellOverflow:!1,onRowClick:w,truncateHeaderCells:!0}))},({activeItem:e},{activeItem:t})=>e.model===t.model&&e.outlet_table===t.outlet_table&&e.outlet_overrides===t.outlet_overrides),x=({activeItem:e,hidePorts:t,overrideNameHeader:n,onRowClick:i})=>r.createElement(f,{activeItem:e,hidePorts:t,overrideNameHeader:n,onRowClick:i})},949810:(e,t,n)=>{n.d(t,{A:()=>v});var r=n(296540),i=n(927099),a=n(822336),l=n(823858),o=n(618983),c=n(71479),s=n(566723),m=n(294303),d=n(699784),u=n(170163),_=n(780811),p=n(837612),E=n(799552),g=n(377588),A=n(406816);const h=(0,c.A)("div")`
  display: flex;
  flex-direction: column;
`,b=(0,c.A)("div")`
  margin-top: ${s.Ln};
  padding-top: ${s.Ln};
  border-top: ${({theme:{themeName:e}})=>a.Ay[`desktop-border-divider-${e}`]};

  div:first-child {
    margin-bottom: ${s.xO};
  }
`,I=(0,c.A)(l.A)`
  color: ${({theme:{motifPalette:{warning:e}}})=>e};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,O=(0,c.A)(o.A)`
  color: ${({theme:{motifPalette:{success:e}}})=>e};
  height: 18px;
  width: 18px;
  margin-right: 10px;
`,v=({activeItem:e,activeItem:{outlet_table:t,outlet_ac_power_budget:n,outlet_ac_power_consumption:a,port_table:l},hidePorts:o,noDivider:c,gap:v=s.xO,legend:S,verticalLegend:C,tooltipPlacement:f="bottom right"})=>{const{usedPower:x,maxPower:N}=(0,r.useMemo)(()=>(0,u.hf)({outlet_table:t,outlet_ac_power_budget:n,outlet_ac_power_consumption:a}),[t,n,a]),y=(0,_.Tl7)(e)||(0,_.kYz)(e);return r.createElement(h,null,r.createElement(m.A,{justifyContent:"center",gap:v,alignItems:C?"center":void 0},r.createElement(m.A,{flexDirection:"column",alignItems:"center"},r.createElement(g.A,{activeItem:e,tooltipPlacement:f,isEU:(0,_.KaR)(e)||(0,_.K30)(e),offline:(0,_.aK8)((0,p.S9)(e))})),l&&!o?r.createElement("div",null,r.createElement(E.A,{activeItem:e,portSizeOverride:"19px",disableOnPortClick:y})):null,C),C?null:S||r.createElement(A.Ay,{activeItem:e,noTopBorder:c}),x>N?r.createElement(b,null,r.createElement(m.A,{justifyContent:"space-between"},r.createElement(I,null),r.createElement(i.A,{size:"caption"},r.createElement(d.sA,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_WARNING"}))),r.createElement(m.A,{justifyContent:"space-between"},r.createElement(O,null),r.createElement(i.A,{size:"caption"},r.createElement(d.sA,{id:"DEVICE_PROPERTIES_OUTLET_POWER_OVERLOAD_INFO"})))):null)}}}]);