"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[57950],{999183(e,t,r){r.d(t,{$3:()=>T,SD:()=>P});var i=r(274934),s=r(864308),o=r(938984),n=r(247816),d=r(51411),l=r(320509),a=r(347625),p=r(116045),c=r(100978),u=r(974390),m=r(650632),x=r(470070),_=r(110372),E=r(576024),A=r(314229),O=r(235279),h=r(956978),I=(r(950693),r(831433)),f=r(994177);const j=(0,n.A)(o.A)`
  padding-left: 10px;
  color: inherit;
  font-size: inherit;
`,C=(e,t)=>{if(t.poe_caps&&!(0,h.C6C)(e)){const e=(0,O.Ki)(t);return e?(0,i.jsx)(x.sA,{id:e,values:{power:t.poe_power}}):""}return t.up?(0,l.ap)(t?.speed||0)||(0,i.jsx)(x.sA,{id:"DEVICE_PORT_STATE_CONNECTED"}):(0,i.jsx)(x.sA,t.enable?{id:"COMMON_DISCONNECTED"}:{id:"COMMON_DISABLED"})},T=({activeItem:e,networkGroups:t,rest:r,hideStatus:o=!1})=>{const{diagram:n}=(0,f.j)(e.model),l=[(0,h.D6h)(e),(0,h.bf1)(e),(0,h.Bh_)(e)],{uplinkItems:x,..._}=r||{},O=(0,h.Tl7)(e)||(0,h.kYz)(e)||(0,h.vqp)(e),T=n.length?(0,E.sT)(n,e):(0,E.oJ)(e);return T?T.flat().reduce((r,n)=>{if(!n)return r;const E=(0,h.NF$)(n.portNumber,e);if((0,s.A)(E))return r;const f=(0,i.jsxs)(c.A,{alignItems:"center",children:[(0,i.jsx)(p.A,{cellData:E,activeItem:e,style:{minWidth:20},..._}),(0,i.jsx)(j,{isTruncated:!0,children:E.port_idx})]}),T=(0,i.jsxs)(c.A,{alignItems:"center",children:[(0,i.jsx)(p.A,{cellData:E,activeItem:e,style:{minWidth:20},disableOnPortClick:O,portSizeOverride:"20px",..._}),(0,i.jsx)(j,{isTruncated:!0,children:o?E.port_idx:C(e,E)})]}),P=(0,d.nL)(E.ifname,e,t),N="Internal"===P?.label,g=P?.id?.startsWith("LAN")||N,S=x?.find(e=>e.portIdx===E.port_idx)?.connected[0];let R=(0,i.jsx)(c.A,{});if(S){const e="device_id"in S?(0,a.Q)(S):(0,I.tn)(S),t="device_id"in S?(0,i.jsx)(u.A,{model:S.model,width:18,height:22}):(0,i.jsx)(c.A,{height:26,minWidth:22,maxWidth:22,justifyContent:"center",alignItems:"center",children:(0,i.jsx)(m.A,{client:S})});R=(0,i.jsxs)(c.A,{alignItems:"center",children:[(0,i.jsx)(c.A,{alignItems:"center",marginRight:"14px",children:t}),(0,i.jsx)(c.A,{alignItems:"center",flex:1,children:e})]})}const k={...E,id:E.port_idx?.toString()||E.ifname,defaultNetworkGroupLabel:(0,h.Xq1)(e,E),disabled:E.masked||(0,A.dC)(E.ifname),isInternalPort:N,isLanPort:g,isWanPort:!g,networkGroup:P?.id,portUplinkItemName:R,portStatus:T,portSymbol:f};return l.every(e=>!e)&&(k.macFilters=E.port_security_mac_address?.length),r.push(k),r},[]).sort(({port_idx:e},{port_idx:t})=>e-t):[]},P=e=>{const{isPoeOffSupported:t,isPoePassthroughSupported:r,isPoePassive24Supported:i,isPoeAutoSupported:s}=e,o=[];return t&&o.push(_.Gu.OFF),r&&o.push(_.Gu.PASSTHROUGH),!r&&i&&o.push(_.Gu.PASSIVE_24V),!r&&s&&o.push(_.Gu.AUTO),o}},250266(e,t,r){r.d(t,{A:()=>p});var i=r(274934),s=r(602086),o=r(696264),n=r(409844),d=r(521376),l=r(309130),a=r(470070);const p=({children:e=null,title:t,titleValues:r,message:p,messageValues:c,handleConfirm:u=()=>null,handleClose:m=()=>null,handleCancel:x,isOpen:_,buttonVariant:E="primary",cancelButtonVariant:A="tertiary",cancelButtonMessage:O="COMMON_ACTION_CANCEL",buttonMessage:h="COMMON_ACTION_CONFIRM",buttonDisabled:I=!1,position:f="top",offset:j,showHeaderClose:C=!1,contentClassName:T="",body:P,titleBody:N,className:g,rootClose:S=!1,footerActions:R})=>{const k=(0,s.useCallback)(e=>{_&&(e.stopPropagation(),e.key===d.U.ENTER?u():e.key===d.U.ESCAPE&&m(!1))},[_,u,m]);(0,s.useEffect)(()=>(window.addEventListener("keydown",k,!0),()=>{window.removeEventListener("keydown",k,!0)}),[k]);const b=(0,s.useCallback)(()=>{m(!1),x?.()},[m,x]),v=(0,s.useCallback)(()=>{m(!1),u()},[m,u]),D=(0,s.useMemo)(()=>[{text:(0,i.jsx)(a.sA,{id:O}),variant:A,onClick:b},{text:(0,i.jsx)(a.sA,{id:h}),disabled:I,variant:E,onClick:v}],[h,E,O,A,b,v,I]),M=(0,s.useCallback)(()=>{m(!1)},[m]),w=n.AH`
    ${t?"":`margin-top: ${l.xO}`}
  `;return(0,i.jsx)(o.A,{title:t?(0,i.jsx)(a.sA,{id:t,values:r}):N||null,...p?{body:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.sA,{id:p,values:c}),P]})}:{body:P},position:f,portal:!0,offset:j,actions:R||D,showHeaderClose:C,contentClassName:n.AH`
        ${w}
        ${T}
      `,onRequestClose:M,isOpen:_,allowOverflow:!0,rootClose:S,className:g,children:e})}},594492(e,t,r){r.d(t,{A:()=>c});var i=r(274934),s=r(602086),o=r(599110),n=r(247816),d=r(309130),l=r(470070),a=r(291508);const p=(0,n.A)("footer",(0,a.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${d.S2} ${d.fS};
  gap: ${d.kc};
`,c=({allowCancel:e,isDirty:t,isInvalid:r,isSubmitting:n,onFormSubmit:d,onFormReset:a,onFormCancel:c,className:u,submitButtonText:m,customButton:x,applyButton:_,applyButtonFirst:E,hideCancelButton:A,form:O})=>{const h=(0,s.useMemo)(()=>_||(0,i.jsx)(o.A,{name:"submit",variant:"primary",type:"submit",onClick:d,disabled:!t||r||n,form:O,children:(0,i.jsx)(l.sA,{id:m||"COMMON_ACTION_APPLY_CHANGES"})}),[_,O,t,r,n,d,m]);return(0,i.jsxs)(p,{className:u,hasFormResetButton:!!a,children:[E?h:x,A?null:(0,i.jsx)(o.A,{name:"cancel",variant:"default",type:"button",onClick:c,disabled:!e&&!t,children:(0,i.jsx)(l.sA,{id:"COMMON_ACTION_CANCEL"})}),a?(0,i.jsx)(o.A,{name:"reset",variant:"default",type:"button",onClick:a,disabled:!t,children:(0,i.jsx)(l.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})}):null,E?x:h]})}},857950(e,t,r){r.r(t),r.d(t,{default:()=>le});var i=r(274934),s=r(814557),o=r(418398),n=r(977872),d=r(843871),l=r(938984),a=r(600191),p=r(247816),c=r(51411),u=r(159469),m=r(197719),x=r(950804),_=r(254585),E=r(449339),A=r(309130),O=r(589650),h=r(100978),I=r(205521),f=r(470070),j=r(999183),C=r(581814),T=r(197571),P=r(956978),N=r(32549),g=r(795206),S=r(518764),R=r(602086),k=r(698782),b=r(601154),v=r(856639),D=r(594492),M=r(994177),w=r(120197),L=r(110372),y=r(469890);const V=(0,p.A)(l.A)`
  line-height: 2.4em;
`,W=(0,p.A)("div")`
  flex: 1;
  max-width: calc(50% - 8px);
`,z=({wanPortData:e})=>{const{formatMessage:t}=(0,f.tz)(),{portIdx:r,networkGroup:s,speed:o,...n}=e,d=(0,y.kO)(n),a=`ports[${r-1}].poe_mode`,p=(0,R.useMemo)(()=>{const{isPoeOffSupported:e,isPoePassthroughSupported:r,isPoeAutoSupported:i,isPoePlusPlusSupported:s,isPoePlusSupported:o}=d,n=[];if(e&&n.push({label:t({id:"COMMON_DEVICE_POE_MODE_OFF"}),value:L.Gu.OFF}),!r&&i){let e="";e=t(s?{id:"COMMON_DEVICE_POE_MODE_POE_PLUS_PLUS"}:o?{id:"COMMON_DEVICE_POE_MODE_AUTO"}:{id:"COMMON_DEVICE_POE_MODE_POE"}),n.push({label:e,value:L.Gu.AUTO})}return n},[t,d]);return(0,i.jsxs)(h.A,{justifyContent:"space-between",alignItems:"center",marginBottom:24,children:[(0,i.jsxs)(h.A,{padding:"0 8px",flexDirection:"column",children:[(0,i.jsx)(l.A,{size:"small",color:"text-3",children:(0,i.jsx)(f.sA,{id:"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP",values:{port:r,networkGroup:s}})}),(0,i.jsx)(V,{size:"medium",color:"text-1",children:(0,i.jsx)(f.sA,{id:"COMMON_DEVICE_POE_MODE_POE"})})]}),(0,i.jsx)(W,{children:(0,i.jsx)(w.A,{name:a,type:"dropdown",variant:"secondary",options:p,full:!0})})]})};var F=r(729736),G=r(320509),$=r(586566),U=r(95546),B=r(228765),H=r(291508);const Y=(0,p.A)(h.A,(0,H.A)("omitSpacing"))`
  margin-bottom: ${A.S2};
  ${({omitSpacing:e})=>e?"":`&:nth-of-type(3) {\n    padding-top: ${A.S2};\n  }`}
`,J=(0,p.A)("div")`
  flex: 1;
  max-width: calc(50% - 8px);
`,K=({activeItem:e,port:t,groupOptions:r,speedOptions:s,group:o,omitSpacing:n})=>{const d=(0,P.Dh3)(e)||!(0,P.oWO)(e)&&!(0,$.jP)(e),{bindWith:l}=(0,c.Nk)(e.model,t.ifname);return(0,i.jsxs)(Y,{justifyContent:"space-between",omitSpacing:n,children:[(0,i.jsx)(J,{children:(0,i.jsx)(w.A,{type:"dropdown",variant:"secondary",name:`ports[${t.portIdx-1}].networkGroup`,label:(0,P.lRq)(e)||(0,P.GJ5)(e)?"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP_SHORT":"DEVICE_PROPERTIES_PORT_WITH_NUMBER_AND_NETWORK_GROUP",translateLabel:!0,translateLabelValues:{port:(0,P.oWO)(e)?(0,M.j)(e.model).ports[t.ifname]:t.portIdx,networkGroup:o},options:r,readOnly:d,validated:!0,full:!0})}),s.length>0?(0,i.jsx)(J,{children:(0,i.jsx)(w.A,{label:"DEVICE_PROPERTIES_GATEWAY_PORTS_SPEED_DUPLEX",name:`ports[${t.portIdx-1}].speed`,type:"dropdown",variant:"secondary",full:!0,translateLabel:!0,translateOptions:!0,options:s,disabled:!!l&&l!==t.ifname})}):null]})},X=[8,9,10,11],q=({activeItem:e,ports:t})=>{const{formatMessage:r}=(0,f.tz)(),s=(0,n.d4)(_.n6),o=(0,n.d4)(T.LV),d=(0,P.UiL)(e)||(0,P.oaW)(e),l=(0,$.iw)(e),a=(0,P.lRq)(e),p=(0,P.oWO)(e),u=(0,R.useCallback)(({ifname:t})=>((0,c.Nk)(e.model,t)?.supportedValues||[]).filter(e=>!!S.A.linkNegotiationOptions[e]).map(e=>{const{speed:t=0,full_duplex:r=!1,autoneg:i}=S.A.linkNegotiationOptions[e],{value:s,unit:o}=(0,F.cS)((0,G.N8)(t),"bitrate"),n=`${s}${o}`;return{label:(0,B.K)(i,r),value:JSON.stringify({speed:t,full_duplex:r}),values:!i&&{speed:n}}}),[e.model]),m=(0,R.useMemo)(()=>s!==O.uj.WAN||l?o.filter(({id:e})=>e.startsWith("LAN")):[],[s,l,o]),x=(0,R.useMemo)(()=>r({id:"COMMON_DISABLED"}),[r]),E=(0,R.useCallback)(e=>[...[...o.filter(({id:e})=>e.startsWith("WAN")&&e!==C._4.WAN_LTE_FAILOVER),...m].filter(({id:r})=>l&&!p&&!!r.startsWith("LAN")||((e,t,r)=>!t.some(({networkGroup:t})=>t===e)||e===r.networkGroup)(r,t,e)).map(({id:e})=>({value:e,label:e})),{value:N.zJ,label:x}],[x,l,p,m,o,t]),A=(0,R.useMemo)(()=>t.filter(({isWanPort:e,media:t})=>s!==O.uj.WAN&&l?!(0,U.d4)({media:t}):e).sort((e,t)=>e.portIdx-t.portIdx),[l,t,s]),h=(0,R.useMemo)(()=>t.filter(({media:e})=>!(s===O.uj.WAN&&!d||!l)&&(0,U.d4)({media:e})),[l,d,t,s]);return d&&l?(0,i.jsx)(i.Fragment,{children:t.filter(({portIdx:e})=>X.includes(e)).map(t=>(0,i.jsx)(K,{activeItem:e,port:t,groupOptions:E(t),speedOptions:u(t),group:t.media||t.defaultNetworkGroupLabel,omitSpacing:!0},t.portIdx))}):(0,i.jsxs)(i.Fragment,{children:[A.map(t=>(0,i.jsx)(K,{activeItem:e,port:t,groupOptions:E(t),speedOptions:u(t),group:t.defaultNetworkGroupLabel||x,omitSpacing:!a},t.portIdx)),h.map(t=>(0,i.jsx)(K,{activeItem:e,port:t,groupOptions:E(t),speedOptions:u(t),group:t.media||t.defaultNetworkGroupLabel,omitSpacing:!a},t.portIdx))]})},Q=(0,p.A)(h.A)`
  position: relative;
  margin: -18px -30px 40px;
  padding: 12px 0;
  border-bottom: ${({theme:{themeName:e}})=>s.Ay[`desktop-border-divider-${e}`]};

  svg {
    position: absolute;
    left: 24px;
  }
`,Z=(0,p.A)(D.A,(0,H.A)("isFullPage"))`
  ${({isFullPage:e})=>e&&"\n    width: 100%;\n    justify-content: flex-end;  \n    gap:10px;\n  "};
`,ee=(0,p.A)(k.A)`
  & > div > span {
    flex: 1;
  }
`,te=(0,p.A)(l.A)`
  width: 100%;
  text-align: center;
`,re=(0,p.A)(h.A)`
  width: 100%;
  padding: 16px 30px;
`,ie=(0,p.A)(h.A)`
  margin-bottom: 24px;
`,se=(0,p.A)(a.A)`
  margin-right: 8px;
  color: ${({theme:{themeName:e}})=>s.Ay[`desktop-color-orange-06-${e}`]};
`,oe=(0,p.A)(a.A)`
  margin-right: ${A.kc};
  color: ${({theme:{themeName:e}})=>s.Ay[`desktop-color-red-06-${e}`]};
`,ne=[1,2,6],de=(0,d.bk)({enableReinitialize:!0,mapPropsToValues:({networkGroups:e,activeItem:t})=>{const r=(0,j.$3)({activeItem:t,networkGroups:e});return{ports:r.sort((e,t)=>e.portIdx-t.portIdx).map((e,i)=>{const{supportedValues:s=[],bindWith:o}=(0,c.Nk)(t.model,e.ifname),n=!("autoneg"in e?e.autoneg:S.A.autoneg)&&e.speed&&e.full_duplex?{speed:e.speed,full_duplex:e.full_duplex}:{speed:0,full_duplex:!1};if(o){const e=r.find(e=>e.ifname===o);n.speed=e.speed,n.full_duplex=e.full_duplex}const d=JSON.stringify(n),{portName:l,portStatus:a,portSymbol:p,portUplinkItemName:u,...m}=e;return{...m,networkGroup:e.networkGroup||N.zJ,...s.length?{speed:d}:{},itemIndex:i}})}},validationSchema:({intl:{formatMessage:e},activeItem:t,params:r})=>{const s=r?.subPanelId===O.uj.ALL;return x.A.object().shape({ports:x.A.array().of(x.A.object().shape({networkGroup:x.A.string().label(e({id:"COMMON_INTERFACE"})).oneOf([m.C.WAN,m.C.WAN2,N.zJ,...(0,c.m9)(t)]).required()})).test("has-default-network-groups",(0,i.jsxs)(h.A,{marginBottom:A.S2,children:[(0,i.jsx)(oe,{width:19,height:19}),(0,i.jsx)(l.A,{children:(0,i.jsx)(f.sA,{id:s?"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_NO_WAN_OR_LAN_WARNING":"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_NO_WAN_WARNING"})})]}),e=>e.some(e=>e.networkGroup===m.C.WAN)&&(!s||e.some(e=>e.networkGroup===C._4.LAN)))})},handleSubmit:({ports:e},{props:{networkGroups:t,updateDeviceWithIdEndpoint:r,showPropertyPanel:i,activeItem:{_id:s,port_overrides:o=[],mac:n},activeItem:d,onFormCloseAction:l,intl:{formatMessage:a},propertyPanelActiveItemTab:p}})=>{const c=(0,j.$3)({activeItem:d,networkGroups:t}),m=a({id:"DEVICE_PROPERTY_HEADER_PORTS"}),x=(0,P.ziy)({model:d.model}),_=x?e.filter(e=>ne.includes(e.portIdx)):e,A=x?(o||[]).filter(e=>ne.includes(e.port_idx)):o,O=[..._.map(e=>{const{speed:t,full_duplex:r}=JSON.parse(e.speed),{speed:i,full_duplex:s,...o}=A?.find(t=>t.port_idx===e.portIdx)||{};return{...o,...t?{speed:t,full_duplex:r}:{},...e.poe_mode!==c[e.portIdx-1].poe_mode?{poe_mode:e.poe_mode}:{},port_idx:e.portIdx,autoneg:!t}}),...(A||[])?.filter(e=>!_.some(t=>t.portIdx===e.port_idx))||[]],h=[];c.forEach(e=>{if(e.ifname.startsWith("eth")){const t=_.find(t=>t.ifname===e.ifname);if(t){if(t.networkGroup===N.zJ)return;h.push({ifname:t.ifname,networkgroup:t.networkGroup})}else e.networkGroup&&h.push({ifname:e.ifname,networkgroup:e.networkGroup})}}),r({port_overrides:O,ethernet_overrides:h},s,n,{failureToast:{icon:u.C.danger,message:"DEVICE_NOTICE_SAVE_ERROR",values:{section:m}},mergeAndOverrideKeys:["port_overrides","ethernet_overrides"],extend:!0}).then(()=>{l?l():i({type:E.H.DEVICE,id:d.mac,tab:p})})}}),le=(0,o.Zz)(f.j4,(0,n.Ng)((e,{onFormCloseAction:t})=>({networkGroups:(0,T.LV)(e),onFormCloseAction:t,propertyPanelActiveItemTab:(0,_.oI)(e)}),{updateDeviceWithIdEndpoint:g.ex,showPropertyPanel:I.XP}),de)(({activeItem:e,submitForm:t,resetForm:r,values:s,dirty:o,setFieldValue:d,errors:a,isFullPage:p,onFormCloseAction:c})=>{const u=(0,n.wA)(),m=(0,n.d4)(_.oI),x=(0,n.d4)(T.LV),{networkGroups:A}=(0,M.j)(e.model),O=()=>{r(),c?c():u((0,I.XP)({type:E.H.DEVICE,id:e.mac,tab:m}))},h=s.ports.filter(({isWanPort:e,port_poe:t})=>e&&t),j=(0,R.useMemo)(()=>s.ports.some(e=>JSON.parse(e.speed||"{}").speed),[s.ports]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(re,{flexDirection:"column",flex:"1 1 85%",children:[p?(0,i.jsx)(b.A,{padding:"none",children:(0,i.jsx)(ee,{title:(0,i.jsx)(f.sA,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"})})}):(0,i.jsxs)(Q,{alignItems:"center",children:[(0,i.jsx)(v.A,{onClick:O,style:{cursor:"pointer"}}),(0,i.jsx)(te,{size:"medium",weight:"bold",children:(0,i.jsx)(f.sA,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES"})})]}),(0,i.jsx)(q,{activeItem:e,ports:s.ports}),(0,R.isValidElement)(a.ports)?a.ports:null,j?(0,i.jsxs)(ie,{children:[(0,i.jsx)(se,{width:19,height:19}),(0,i.jsx)(l.A,{size:"medium",children:(0,i.jsx)(f.sA,{id:"DEVICE_PORTS_TABLE_CONFIGURE_INTERFACES_SPEED_WARNING"})})]}):null,h.length>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(k.A,{title:(0,i.jsx)(f.sA,{id:"DEVICE_PORT_PROFILE_OVERRIDE"})}),h.map(e=>(0,i.jsx)(z,{wanPortData:e},e.id))]}):null]}),(0,i.jsx)(Z,{isDirty:o,onFormSubmit:t,onFormCancel:O,onFormReset:()=>{d("ports",s.ports.map(e=>{const t=x.find(t=>t.id===A[e.ifname]);return{...e,networkGroup:t?.id||N.zJ,autoneg:!0,speed:JSON.stringify({speed:0,full_duplex:!1})}}))},submitButtonText:p?null:"COMMON_ACTION_APPLY",allowCancel:!0,isFullPage:!!p})]})})},228765(e,t,r){r.d(t,{K:()=>i});const i=(e,t)=>e?"COMMON_DEVICE_AUTONEG_FULL":t?"COMMON_DEVICE_DUPLEX_FULL":"COMMON_DEVICE_DUPLEX_HALF"},116045(e,t,r){r.d(t,{A:()=>v});var i=r(274934),s=r(602086),o=r(977872),n=r(938984),d=r(669439),l=r(590979),a=r(254585),p=r(449339),c=r(589650),u=r(684209),m=r(223104),x=r(250266),_=r(408402),E=r(205521),A=r(470070),O=r(940229),h=r(160286),I=r(110372),f=r(197571),j=r(874866),C=r(167933),T=r(576024),P=r(95546),N=r(956978),g=r(795206),S=r(68105),R=r(917236),k=r(818981);const b=({cellData:e,activeItem:t,activeItem:{mac:r,name:b,model:v},keyValue:D,portSize:M,portSizeOverride:w,disableOnPortClick:L=!1,centerIcon:y,tooltipPlacement:V="bottom"})=>{const W=(0,o.wA)(),z=(0,o.d4)(j.D),F=(0,o.d4)(a.oI),G=(0,o.d4)(h.D5),$=e||{},U=(0,o.d4)(f.wf),B=(0,o.d4)(C.pB),H=(0,o.d4)(S.qS),Y=(0,O.vT)($,t,z,G,U,B,[],H),[J,K]=(0,s.useState)(!1),X=(0,s.useCallback)(()=>{W((0,g.Fx)({mac:r,name:b},e.port_idx)),K(!1)},[r,b,e.port_idx,W]),q=Boolean(e.poe_enable&&!(0,N.ioy)({type:t.type}));return(0,i.jsx)(_.A,{condition:q,wrapper:t=>(0,i.jsx)(x.A,{title:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_TITLE",titleValues:{portId:e.port_idx},buttonMessage:"COMMON_ACTION_PROCEED",handleClose:K,handleConfirm:X,isOpen:J,rootClose:!0,body:(0,i.jsx)(n.A,{size:"inherit",children:(0,i.jsx)(A.sA,{id:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_BODY",values:{portId:e.port_idx}})}),children:t}),children:(0,i.jsx)(d.A,{description:(0,i.jsx)(R.A,{portData:$,showPowerCycleHeader:q,portName:$.name,device:t}),delay:0,closeDelay:0,isDisabled:J,placement:V,className:k.K5,children:(0,i.jsxs)(k.Dn,{onClick:i=>q?(K(!0),null):L||e.masked?null:(i.preventDefault(),i.stopPropagation(),(0,N.Cyy)(t)||(0,N.oWO)(t)?W((0,E.XP)({type:p.H.DEVICE,id:r,tab:F,subPanel:c.uY.PORTS,subId:$?.ifname})):W((0,E.XP)("wan"===$?.network_name||"wan2"===$?.network_name?{type:p.H.DEVICE,id:r,tab:F,subPanel:c.uY.PORTS,subId:c.uj.WAN}:$?.dns?{type:p.H.DEVICE,id:r,tab:F,subPanel:c.uY.PORTS,subId:c.uj.ALL}:{type:p.H.DEVICE,id:r,tab:F,subPanel:c.uY.PORTS,subId:$.op_mode===I.RC.AGGREGATE?$.portIdx||$.port_idx||$.ifname:(0,T.Cu)($)}))),...l.A.addDataTestId(l.A.TestId.SIDE_PANEL_TRIGGER),children:[(0,i.jsx)(k.MM,{centerIcon:y,colorInfo:(0,u.PI)(Y),portSize:M,portSizeOverride:w,hasTransparentBorder:(0,P._R)(e.port_idx,v),children:(0,i.jsx)(m.A,{icon:Y.icon,smallerIcons:!0})}),(0,P.jw)(e.port_idx,v)?(0,i.jsx)(k.lh,{}):null]})},D)})},v=({cellData:e,activeItem:t,keyValue:r,portSize:s,portSizeOverride:o,...n})=>e?(0,i.jsx)(b,{cellData:e,activeItem:t,keyValue:r,portSize:s,portSizeOverride:o,...n}):(0,N.ez9)(t)||(0,N.gE3)(t)?null:(0,i.jsx)(k.hK,{portSize:s,portSizeOverride:o},r)},917236(e,t,r){r.d(t,{A:()=>C});var i=r(274934),s=r(977872),o=r(814557),n=r(878151),d=r(938984),l=r(95032),a=r(247816),p=r(347625),c=r(309130),u=r(100978),m=r(470070),x=r(873247),_=r(576024),E=r(95546),A=r(235279),O=r(754924);const h=(0,a.A)("div")`
  display: flex;
  justify-content: space-between;
  gap: ${c.YC};

  & > :last-child {
    max-width: 60%;
    text-align: right;
  }
`,I=(0,a.A)(u.A)`
  margin-bottom: ${c.kc};
  padding-bottom: ${c.kc};
  border-bottom: ${({theme:{themeName:e}})=>o.Ay[`desktop-border-divider-${e}`]};
`,f=(0,a.A)(l.A)`
  white-space: nowrap;
`,j=e=>(0,i.jsx)(f,{size:"small",...e}),C=({portData:e,portName:t,showPowerCycleHeader:r=!1,device:o})=>{const{ifname:l,port_idx:a,tx_bytes:f,rx_bytes:C,sfp_txfault:T,sfp_rxfault:P,sfp_vendor:N,sfp_serial:g,sfp_part:S,sfp_rev:R,sfp_compliance:k,sfp_voltage:b,sfp_current:v,sfp_txpower:D,sfp_rxpower:M,sfp_temperature:w}=e||{},{formatMessage:L}=(0,m.tz)(),y=(0,s.d4)(x.wD),V=(0,E.Hn)(e,y),W=(0,s.d4)(O.ID),z=(0,_.Uz)(e.port_idx,o.mac,o.downlink_table,W),F=(0,_.RK)(e,o,W),G=e&&(0,E.d4)(e)&&e.sfp_found,$=(0,_.xx)(e,L),U=(0,_.m3)(e,L),B=(0,A.Ki)(e),H=[];return G&&(T&&H.push(L({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_TX_FAULT"})),P&&H.push(L({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_RX_FAULT"}))),(0,i.jsxs)(u.A,{flexDirection:"column",minWidth:100,children:[r?(0,i.jsx)(I,{children:(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_ACTIONS_PORT_CLICK_TO_POWER_CYCLE"})})}):null,(0,i.jsxs)(u.A,{gap:c.YC,flexDirection:"column",children:[e.masked||!a&&!l?null:(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_PORT"})}),(0,i.jsx)(j,{motif:"dark",children:(0,_.LS)(e,o.model)})]}),t?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_NAME"})}),(0,i.jsx)(j,{motif:"dark",isTruncated:!0,children:t})]}):null,$?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_SPEED"})}),(0,i.jsx)(j,{motif:"dark",isTruncated:!0,children:$})]}):null,U||H.length>0?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_STATUS"})}),(0,i.jsxs)(j,{motif:"dark",isTruncated:!0,children:[U,H.length>0?(0,i.jsx)(d.A,{color:"destructive",children:H.join(", ")}):null]})]}):null,f&&f>0?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_TX"})}),(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(n.A,{type:"bytes",input:f,motif:"dark"})})]}):null,C&&C>0?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_RX"})}),(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(n.A,{type:"bytes",input:C,motif:"dark"})})]}):null,B?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_DEVICE_POE_MODE_POE"})}),(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:B,values:{power:e.poe_power}})})]}):null,V?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PROFILE"})}),(0,i.jsx)(j,{motif:"dark",isTruncated:!0,children:V})]}):null,z?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_DOWNLINK"})}),(0,i.jsx)(j,{motif:"dark",isTruncated:!0,children:(0,p.Q)(z)})]}):null,F?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_UPLINK"})}),(0,i.jsx)(j,{motif:"dark",isTruncated:!0,children:(0,p.Q)(F)})]}):null,G?(0,i.jsxs)(i.Fragment,{children:[N?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_VENDOR"})}),(0,i.jsx)(j,{motif:"dark",children:String(N)})]}):null,g?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_SERIAL"})}),(0,i.jsx)(j,{motif:"dark",children:String(g)})]}):null,S?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PART_NUMBER"})}),(0,i.jsx)(j,{motif:"dark",children:String(S)})]}):null,R?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_REV"})}),(0,i.jsx)(j,{motif:"dark",children:String(R)})]}):null,k?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_COMPLIANCE"})}),(0,i.jsx)(j,{motif:"dark",isTruncated:!0,children:String(k)})]}):null,b?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_VOLTAGE"})}),(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_VOLTAGE",values:{voltage:Number(b||0).toFixed(2)}})})]}):null,v?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_CURRENT"})}),(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_CURRENT",values:{current:+v}})})]}):null,w?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"COMMON_TEMPERATURE"})}),(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:Number(w).toFixed(1)}})})]}):null,Number(D)?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_OUTPUT_POWER"})}),(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:Number(D).toFixed(2)}})})]}):null,Number(M)?(0,i.jsxs)(h,{children:[(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_INPUT_POWER"})}),(0,i.jsx)(j,{motif:"dark",children:(0,i.jsx)(m.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:Number(M).toFixed(2)}})})]}):null]}):null]})]})}},818981(e,t,r){r.d(t,{Dn:()=>_,K5:()=>E,MM:()=>u,hK:()=>m,lh:()=>x});var i=r(814557),s=r(247816),o=r(409844),n=r(309130),d=r(262170),l=r(100978),a=r(940229),p=r(940563),c=r(291508);const u=(0,s.A)(l.A,(0,c.A)("colorInfo","portSize","portSizeOverride","isDisabled","centerIcon","hasTransparentBorder"))`
  height: ${({portSizeOverride:e,portSize:t})=>e||t?.size||d.J.large.size};
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||d.J.large.size};
  ${({portSize:e})=>e?.marginSize?`margin-left: ${e.marginSize}`:""};
  ${({portSize:e,marginLeft:t})=>e?.marginSize||t?`margin-left: ${t||e?.marginSize};`:""};
  align-items: center;
  border-radius: 2px;
  justify-content: center;
  position: relative;
  pointer-events: auto;
  z-index: 3;

  ${({colorInfo:e,theme:{themeName:t}})=>e.background===p.A.DISABLED.background&&`border: ${(0,a.oX)(e.border,t)} 1px solid;`}
  background-color: ${({colorInfo:e,theme:{themeName:t}})=>(0,a.oX)(e.background,t)};
  color: ${({colorInfo:e,theme:{themeName:t}})=>(0,a.oX)(e.text,t)};

  /* Fix hover area of combo ports */
  ${({hasTransparentBorder:e})=>e&&"\n      position: relative;\n      &:before {\n        content: '';\n        position: absolute;\n        top: -3px;\n        right: -3px;\n        bottom: -3px;\n        left: -3px;   \n        background: transparent;\n        z-index: 2; \n      }\n  "}

  ${({centerIcon:e,portSize:t})=>e&&t?.spacing&&`transform: translateY(calc(50% + ${t?.spacing} / 2))`};
`,m=(0,s.A)("div",(0,c.A)("portSize","portSizeOverride"))`
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||d.J.large.size};
  flex-shrink: 0;
`,x=(0,s.A)("div",(0,c.A)("size"))`
  position: absolute;
  width: calc(${d.J.large.size} + ${d.J.large.size} + 8px);
  height: calc(${d.J.large.size} + 4px);
  top: -2px;
  left: -2px;
  z-index: 1;
  background: ${({theme:{themeName:e}})=>i.Ay[`desktop-color-ublue-01-${e}`]};
  border-radius: ${n.YC};
  border: 1px solid
    ${({theme:{themeName:e}})=>i.Ay[`desktop-color-ublue-04-${e}`]};
`,_=(0,s.A)(l.A)`
  position: relative;
  cursor: pointer;
`,E=o.AH`
  [data-uic-component='Tooltip.Arrow'] {
    pointer-events: none;
  }
`},262170(e,t,r){r.d(t,{J:()=>s});var i=r(309130);const s={large:{threshold:12,size:"24px",spacing:i.YC},medium:{threshold:15,size:"16px",spacing:i.YC},small:{threshold:20,size:"12px",spacing:i.YC},xsmall:{threshold:50,size:"11px",spacing:"1px"}}},521376(e,t,r){var i;r.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={}))}}]);