"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[44124],{535322(e,t,n){n.d(t,{A:()=>I,I:()=>r});var r,o=n(274934),s=n(814557),i=n(158885),a=n(247816),c=n(565527),l=n(309130),d=n(100978),A=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(r||(r={}));const u=(0,a.A)(d.A,(0,A.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${c.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${c.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${l.Ln}`:l.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||l.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}})=>s.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,E=(0,a.A)(i.A,(0,A.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||s.Ay[n===c.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${c.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${c.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||s.Ay[t===c.S.DARK?`desktop-color-neutral-01-${c.S.DARK}`:`desktop-color-neutral-00-${c.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${l.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${l.Ln} ${l.Ln};
      }
    }
  }
`,I=({type:e,marginBottom:t,margin:n,padding:s,flex:i,width:a,nested:c,...l})=>"items"in l?(0,o.jsx)(E,{marginBottom:t,margin:n,padding:s,flex:i,nested:c,...l}):(0,o.jsx)(u,{nested:c,width:a,marginBottom:t,margin:n,padding:s,flex:i,isButtonList:e===r.BUTTON_LIST,...l,children:l.children})},844124(e,t,n){n.r(t),n.d(t,{default:()=>we});var r=n(274934),o=n(535322),s=n(337960),i=n(247816),a=n(100978),c=n(309130);const l=(0,i.A)(a.A)`
  flex-direction: column;
  gap: ${c.kc};
`,d=(0,i.A)(a.A)`
  flex-direction: column;
  gap: ${c.Ln};
`;var A=n(602086),u=n(977872),E=(n(590979),n(470070)),I=n(205521),_=n(449339),C=n(814557);(0,i.A)(a.A)`
  border-radius: ${c.YC};
  background: ${({theme:{themeName:e}})=>C.Ay[`desktop-color-neutral-02-${e}`]};
  border: 1px solid
    ${({theme:{themeName:e}})=>C.Ay[`desktop-color-neutral-03-${e}`]};
  padding: ${c.xO};
`;const O=(0,A.memo)(()=>{const e=(0,u.wA)();return(0,A.useCallback)(()=>{e((0,I.XP)({type:_.H.DEVICE_UPDATES,id:"any"}))},[e]),null});var m=n(938984),D=n(263705),R=n(820633),N=n(897166),S=n(570801),p=(n(565527),n(291508));const g=(0,i.A)(a.A,(0,p.A)("showRevert"))`
  flex-direction: column;
  gap: ${c.YC};
  .${"DASHBOARD_WIFI_DOCTOR_OVERVIEW_HEADER_REVERT_ICON_CLASS_NAME"} {
    ${({showRevert:e})=>e?"\n    pointer-events: none;\n    opacity: 0.4;\n    ":""}
  }
`,T=((0,i.A)(a.A)`
  flex-direction: column;
  gap: ${c.Ln};
`,(0,i.A)(a.A)`
  align-items: center;
  gap: ${c.YC};
`,e=>e.some(({[s.Me.OPTIMIZATION_STATUS]:e})=>e===s.CK.IN_PROGRESS)),M=e=>e.every(({[s.Me.OPTIMIZATION_STATUS]:e})=>e===s.CK.COMPLETED);var h=n(596603),x=n(642687);const P=(0,i.A)(a.A)`
  flex-direction: column;
  border-radius: ${c.YC};
  border: 1px solid
    ${({theme:{themeName:e}})=>C.Ay[`desktop-color-neutral-03-${e}`]};
  gap: ${c.kc};
  padding: ${c.kc};
`,L=(0,i.A)(a.A)`
  height: 120px;
  flex-direction: column;
  gap: ${c.kc};
  border-radius: ${c.YC};
  background: ${({theme:{themeName:e}})=>C.Ay[`desktop-color-neutral-02-${e}`]};
  padding: ${c.kc};
  justify-content: space-between;
  textarea {
    border: 1px solid
      ${({theme:{themeName:e}})=>C.Ay[`desktop-color-neutral-02-${e}`]};
    background: ${({theme:{themeName:e}})=>C.Ay[`desktop-color-neutral-02-${e}`]};
    resize: none;
    outline: none;
    height: 100px;
    color: ${({theme:{themeName:e}})=>C.Ay[`desktop-color-text-1-${e}`]};
  }
`,$=(0,i.A)(a.A)`
  align-items: center;
  gap: ${c.kc};
`,f=((0,A.memo)(({setShowRevert:e})=>{const{formatMessage:t}=(0,E.tz)(),[n,o]=(0,A.useState)(""),[s,i]=(0,A.useState)(!0),a=(0,A.useCallback)(()=>{e(!1)},[e]),c=(0,A.useCallback)(()=>{e(!1)},[e]),l=(0,A.useCallback)(({target:{value:e}})=>{o(e)},[]),d=(0,A.useCallback)(e=>{i(e)},[]);return(0,r.jsxs)(P,{children:[(0,r.jsxs)(L,{children:[(0,r.jsx)("textarea",{placeholder:t({id:"DASHBOARD_WIFI_DOCTOR_REVERT_PLACEHOLDER"}),onChange:l,spellCheck:!1}),(0,r.jsx)(h.A,{label:t({id:"DASHBOARD_INCLUDE_SUPPORT_FILE"}),onChange:d,isSelected:s})]}),(0,r.jsxs)($,{children:[(0,r.jsx)(x.A,{type:"button",onClick:a,size:"small",children:(0,r.jsx)(E.sA,{id:"COMMON_ACTION_REVERT_NOW"})}),(0,r.jsx)(x.A,{type:"button",onClick:c,variant:"tertiary-neutral",size:"small",children:(0,r.jsx)(E.sA,{id:"COMMON_ACTION_CANCEL"})})]})]})}),(0,A.memo)(({[s.Ss.ACTIONS]:e})=>{const[t,n]=(0,A.useState)(!1),o=((0,D.u)(),(0,u.d4)(R.zi)),i=(0,u.d4)(S.BQ),a=(0,u.d4)(N.hq),c=(0,A.useMemo)(()=>M(e),[e]);return(0,A.useMemo)(()=>new Intl.DateTimeFormat(o,{hourCycle:i,timeZone:a,month:"long",day:"numeric",year:"numeric"}),[o,i,a]),(0,A.useCallback)(()=>{n(!0)},[]),(0,r.jsxs)(g,{showRevert:t,children:[(0,r.jsx)(m.A,{weight:"bold",size:"medium",color:"text-1",children:(0,r.jsx)(E.sA,{id:c?"DASHBOARD_WIFI_OPTIMIZATION_COMPLETE":"DASHBOARD_WIFI_OPTIMIZATION_AVAILABLE"})}),(0,r.jsxs)(m.A,{size:"medium",color:"text-3",children:[(0,r.jsx)(E.sA,{id:c?"DASHBOARD_RECOMMENDED_OPTIMIZATIONS_APPLIED":"DASHBOARD_RECOMMENDED_OPTIMIZATIONS"}),c?"":":"]})]})})),k=(0,i.A)(a.A)`
  flex-direction: column;
  gap: ${c.kc};
`;var b=n(500715),j=n(688208),B=n(847399);const v=(e,t)=>`\n    @keyframes ${e} {\n      ${Array.from({length:100},(e,n)=>`\n      ${2*n}% {\n        background: conic-gradient(\n          from 0deg,\n          ${t} 0deg,\n          ${t} ${2*n*3.6}deg,\n          transparent ${2*n*3.6}deg,\n          transparent 360deg\n        );\n      }`).join("")}\n    }\n    &::before {\n      content: '';\n      position: absolute;\n      inset: -1px;\n      border-radius: ${c.fS};\n      animation: ${e} 1.5s ease-in-out infinite;\n      \n      -webkit-mask: \n        linear-gradient(#fff 0 0) content-box, \n        linear-gradient(#fff 0 0);\n      -webkit-mask-composite: xor;\n      mask: \n        linear-gradient(#fff 0 0) content-box, \n        linear-gradient(#fff 0 0);\n      mask-composite: exclude;\n      padding: 1px;\n      pointer-events: none;\n      z-index: 1;\n    }\n  `,U=(e,t)=>{switch(e){case s.CK.IN_PROGRESS:return C.Ay[`desktop-color-ublue-06-${t}`];case s.CK.FAILED:return C.Ay[`desktop-color-red-06-${t}`];case s.CK.COMPLETED:return C.Ay[`desktop-color-green-06-${t}`];default:return C.Ay[`desktop-color-ublue-06-${t}`]}},K=(0,i.A)(a.A,(0,p.A)("optimizationStatus"))`
  width: ${c.S2};
  height: ${c.S2};
  justify-content: center;
  align-items: center;
  border-radius: ${c.fS};
  position: relative;
  ${({optimizationStatus:e,theme:{themeName:t}})=>`\n    background-color: ${((e,t)=>{switch(e){case s.CK.COMPLETED:return C.Ay[`desktop-color-green-01-${t}`];case s.CK.FAILED:return C.Ay[`desktop-color-red-01-${t}`];default:return C.Ay[`desktop-color-ublue-01-${t}`]}})(e,t)};\n    border: 1px solid ${((e,t)=>{switch(e){case s.CK.COMPLETED:return C.Ay[`desktop-color-green-02-${t}`];case s.CK.FAILED:return C.Ay[`desktop-color-red-02-${t}`];default:return C.Ay[`desktop-color-ublue-02-${t}`]}})(e,t)};\n    ${((e,t)=>e===s.CK.IN_PROGRESS?v("optimization",C.Ay[`desktop-color-ublue-06-${t}`]):"")(e,t)}\n  `}
`,y=(0,A.memo)(({[s.Me.OPTIMIZATION_STATUS]:e})=>{const t=(0,A.useMemo)(()=>(e=>{switch(e){case s.CK.IN_PROGRESS:return j.A;case s.CK.FAILED:return B.A;case s.CK.COMPLETED:return b.A;default:return j.A}})(e),[e]);return(0,r.jsx)(K,{optimizationStatus:e,children:(0,r.jsx)(t,{color:U(e,(0,D.u)().themeName),size:"medium"})})}),w=(0,i.A)(a.A)`
  background-color: ${({theme:{themeName:e}})=>C.Ay[`desktop-color-neutral-02-${e}`]};
  border-radius: ${c.kc};
  padding: ${c.kc};
  flex-direction: column;
  gap: ${c.xO};
`,G=(0,i.A)(a.A)`
  justify-content: space-between;
  align-items: center;
`,W=(0,i.A)(a.A)`
  gap: ${c.kc};
  align-items: center;
`;var V=n(322596),z=n(794941),F=n(656705);const X=(0,i.A)(a.A)`
  width: 100%;
  height: 100%;
  flex-direction: column;
  thead {
    background: ${({theme:{themeName:e}})=>C.Ay[`desktop-color-neutral-02-${e}`]};
  }
  max-height: 351px;
  overflow: auto;
`;var Y,H,Z;!function(e){e.DEVICE="DEVICE",e.VERSION="VERSION"}(Y||(Y={})),function(e){e.UPGRADABLE_DEVICES_COLUMN="upgradableDevicesColumn"}(H||(H={})),function(e){e.UPGRADABLE_DEVICE="upgradableDevice"}(Z||(Z={}));const Q=({[H.UPGRADABLE_DEVICES_COLUMN]:e})=>(0,r.jsx)(E.sA,{id:ae[e]});var q=n(95032),J=n(347625),ee=n(974390);const te=(e,t)=>{switch(e){case s.CK.COMPLETED:return C.Ay[`desktop-color-green-06-${t}`];case s.CK.FAILED:return C.Ay[`desktop-color-red-06-${t}`];case s.CK.IN_PROGRESS:return C.Ay[`desktop-color-ublue-06-${t}`];default:return C.Ay[`desktop-color-neutral-06-${t}`]}},ne=(0,i.A)(a.A)`
  align-items: center;
  gap: ${c.YC};
  padding: 0 0 0 2px;
`,re=(0,i.A)(a.A,(0,p.A)("optimizationStatus"))`
  width: ${c.Ln};
  min-width: ${c.Ln};
  height: ${c.Ln};
  min-height: ${c.Ln};
  justify-content: center;
  align-items: center;
  ${({optimizationStatus:e,theme:{themeName:t}})=>`\n    border: 1px solid ${((e,t)=>{switch(e){case s.CK.COMPLETED:return C.Ay[`desktop-color-green-02-${t}`];case s.CK.FAILED:return C.Ay[`desktop-color-red-02-${t}`];case s.CK.IN_PROGRESS:return C.Ay[`desktop-color-ublue-02-${t}`];default:return C.Ay[`desktop-color-neutral-06-${t}`]}})(e,t)};\n    background-color: ${((e,t)=>{switch(e){case s.CK.COMPLETED:return C.Ay[`desktop-color-green-01-${t}`];case s.CK.FAILED:return C.Ay[`desktop-color-red-01-${t}`];case s.CK.IN_PROGRESS:return C.Ay[`desktop-color-ublue-01-${t}`];default:return"transparent"}})(e,t)};\n    ${((e,t)=>e===s.CK.IN_PROGRESS?v("upgradableDevice",C.Ay[`desktop-color-ublue-06-${t}`]):"")(e,t)}\n  `};

  border-radius: ${c.fS};
  position: relative;
  margin: 4px;
`;var oe=n(160446),se=n(87449);const ie=(0,i.A)(a.A)`
  align-items: center;
  gap: ${c.YC};
`,ae={[Y.DEVICE]:"COMMON_DEVICE",[Y.VERSION]:"COMMON_VERSION"},ce={[Y.DEVICE]:({[H.UPGRADABLE_DEVICES_COLUMN]:e})=>(0,r.jsx)(Q,{upgradableDevicesColumn:e}),[Y.VERSION]:({[H.UPGRADABLE_DEVICES_COLUMN]:e})=>(0,r.jsx)(Q,{upgradableDevicesColumn:e})},le={[Y.DEVICE]:{size:110,minSize:110,maxSize:1/0},[Y.VERSION]:{size:90,minSize:90,maxSize:1/0}},de={[Y.DEVICE]:({[Z.UPGRADABLE_DEVICE]:{[s.j0.MAC]:e,[s.j0.MODEL]:t,[s.j0.NAME]:n,[s.j0.OPTIMIZATION_STATUS]:o}})=>{const i=(0,A.useMemo)(()=>(e=>{switch(e){case s.CK.IN_PROGRESS:return j.A;case s.CK.FAILED:return B.A;case s.CK.COMPLETED:return b.A;default:return j.A}})(o),[o]);return(0,r.jsxs)(ne,{children:[(0,r.jsx)(re,{optimizationStatus:o,children:(0,r.jsx)(i,{color:te(o,(0,D.u)().themeName),size:"small"})}),(0,r.jsx)(ee.A,{model:t,width:20,height:20}),(0,r.jsx)(q.A,{isTruncated:!0,size:"medium",color:"text-2",children:(0,J.Q)({mac:e,model:t,name:n})})]})},[Y.VERSION]:({[Z.UPGRADABLE_DEVICE]:{[s.j0.CURRENT_VERSION]:e,[s.j0.UPGRADABLE_VERSION]:t}})=>(0,r.jsxs)(ie,{children:[(0,r.jsx)(m.A,{size:"medium",color:"text-2",children:(0,se.coerce)(e)?.version||(0,r.jsx)(E.sA,{id:"COMMON_UNKNOWN"})}),(0,r.jsx)(oe.A,{size:"original",style:{transform:"rotate(-90deg)"}}),(0,r.jsx)(m.A,{size:"medium",color:"text-2",children:(0,se.coerce)(t)?.version||(0,r.jsx)(E.sA,{id:"COMMON_UNKNOWN"})})]})},Ae=Object.values(Y),ue=e=>e,Ee=({header:{id:e}})=>ce[e]({[H.UPGRADABLE_DEVICES_COLUMN]:e}),Ie=e=>le[e],_e=({column:{id:e},getValue:t})=>de[e]({[Z.UPGRADABLE_DEVICE]:t()}),Ce={stickyHeader:!0,columns:Ae.map(e=>({id:e,accessorFn:ue,header:Ee,cell:_e,...Ie(e),enableResizing:!1,enableSorting:!1}))},Oe=(0,A.memo)(({[s.Me.UPGRADABLE_DEVICES]:e})=>(0,r.jsx)(X,{children:(0,r.jsx)(F.A,{data:e,...Ce})})),me=(0,A.memo)(({[s.Me.ID]:e,[s.Me.UPGRADABLE_DEVICES]:t})=>e===s.iR.UPDATE_DEVICE_FIRMWARE&&t.length?(0,r.jsx)(Oe,{upgradable_devices:t}):null);var De,Re=n(75627);!function(e){e.ID="id",e.UPGRADABLE_DEVICES="upgradable_devices",e.IS_EXPANDED="isExpanded",e.SET_IS_EXPANDED="setIsExpanded"}(De||(De={}));const Ne=(0,A.memo)(({[De.IS_EXPANDED]:e,[De.SET_IS_EXPANDED]:t})=>{const n=(0,A.useCallback)(()=>{t(e=>!e)},[t]);return(0,r.jsx)(Re.A,{style:{cursor:"pointer",transform:"rotate("+(e?"0deg":"180deg")},onClick:n,size:"original"})}),Se=(0,A.memo)(({[De.ID]:e,[De.UPGRADABLE_DEVICES]:t,[De.IS_EXPANDED]:n,[De.SET_IS_EXPANDED]:o})=>(0,A.useMemo)(()=>e===s.iR.UPDATE_DEVICE_FIRMWARE&&t.length>0,[e,t.length])?(0,r.jsx)(Ne,{isExpanded:n,setIsExpanded:o}):null),pe=(0,A.memo)(({[s.Me.ID]:e,[s.Me.OPTIMIZATION_STATUS]:t,[s.Me.UPGRADABLE_DEVICES]:n})=>{const[o,i]=(0,A.useState)(!1);return(0,r.jsxs)(w,{children:[(0,r.jsxs)(G,{children:[(0,r.jsxs)(W,{children:[(0,r.jsx)(y,{optimization_status:t}),(0,r.jsx)(m.A,{size:"medium",color:"text-2",children:z.V[e][V.a.GET_LABEL]({[V.K.UPGRADABLE_DEVICES]:n})})]}),(0,r.jsx)(Se,{id:e,upgradable_devices:n,isExpanded:o,setIsExpanded:i})]}),o?(0,r.jsx)(me,{id:e,upgradable_devices:n}):null]})}),ge=(0,A.memo)(({[s.Ss.ACTIONS]:e})=>(0,r.jsx)(k,{children:e.map(({[s.Me.ID]:e,[s.Me.OPTIMIZATION_STATUS]:t,[s.Me.UPGRADABLE_DEVICES]:n=[]})=>(0,r.jsx)(pe,{id:e,optimization_status:t,upgradable_devices:n},e))}));var Te=n(772609);const Me=(0,i.A)(a.A)`
  flex-direction: column;
`,he=e=>{const t=e.find(({[s.Me.OPTIMIZATION_STATUS]:e})=>e===s.CK.IN_PROGRESS);if(t){if(t[s.Me.ID]===s.iR.UPDATE_DEVICE_FIRMWARE){const e=t[s.Me.UPGRADABLE_DEVICES].find(({[s.j0.OPTIMIZATION_STATUS]:e})=>e===s.CK.IN_PROGRESS);return e?(0,r.jsx)(E.sA,{id:z.V[s.iR.UPDATE_DEVICE_FIRMWARE][V.a.DESCRIPTION],values:{deviceName:(0,J.Q)({mac:e[s.j0.MAC],model:e[s.j0.MODEL],name:e[s.j0.NAME]})}}):null}return(0,r.jsx)(E.sA,{id:z.V[t[s.Me.ID]][V.a.DESCRIPTION]})}return null},xe=(0,A.memo)(({[s.Ss.ACTIONS]:e})=>{const{percentage:t,optimizationInProgress:n}=(0,A.useMemo)(()=>{return{percentage:(t=e.reduce((e,{[s.Me.ID]:t,[s.Me.UPGRADABLE_DEVICES]:n=[]})=>t===s.iR.UPDATE_DEVICE_FIRMWARE?e+n.length:e+1,0),n=e.reduce((e,{[s.Me.ID]:t,[s.Me.UPGRADABLE_DEVICES]:n=[],[s.Me.OPTIMIZATION_STATUS]:r})=>t===s.iR.UPDATE_DEVICE_FIRMWARE?e+n.filter(({[s.j0.OPTIMIZATION_STATUS]:e})=>e!==s.CK.COMPLETED).length:e+(r!==s.CK.COMPLETED?1:0),0),t>0?100-Math.round(n/t*100):0),optimizationInProgress:T(e)};var t,n},[e]);return 100!==t&&n?(0,r.jsxs)(Me,{children:[(0,r.jsx)(Te.A,{value:t,variant:"primary",size:"large"}),(0,r.jsxs)(q.A,{isTruncated:!0,size:"medium",color:"text-3",children:[he(e),"..."]})]}):null});var Pe=n(669439),Le=n(947414),$e=n(774366),fe=n(29472),ke=n(571766);const be=`${n(290454).w}/wifi-doctor/optimization`,je=`${be}/start`,Be=`${be}/stop`;var ve,Ue=n(968021),Ke=n(146215);!function(e){e.LABEL="label",e.ON_CLICK="onClick"}(ve||(ve={}));const ye=(0,A.memo)(({[s.Ss.ACTIONS]:e,[s.Ss.IN_PROGRESS]:t,[s.Ss.IN_PROGRESS_IN_SITE]:n})=>{const o=(0,u.wA)(),[i,a]=(0,A.useState)(!1),{formatMessage:c}=(0,E.tz)(),l=(0,A.useCallback)(()=>{a(!0)},[]),d=(0,A.useCallback)(()=>{l(),o((0,fe.vB)(ke.aC,null,null,$e.A.POST,je,{},null,{}))},[o,l]),I=(0,A.useCallback)(()=>{l(),o((0,fe.vB)(ke.aC,null,null,$e.A.POST,Be,{},null,{}))},[o,l]),_=(0,A.useMemo)(()=>{return T(t=e)||M(t)?T(e)?s.CK.IN_PROGRESS:M(e)?s.CK.COMPLETED:void 0:s.CK.PENDING;var t},[e]),{[ve.LABEL]:C,[ve.ON_CLICK]:O}=(0,A.useMemo)(()=>{switch(_){case s.CK.PENDING:return{[ve.LABEL]:c({id:"DASHBOARD_CLICK_TO_OPTIMIZE"}),[ve.ON_CLICK]:d};case s.CK.IN_PROGRESS:return{[ve.LABEL]:c({id:"COMMON_STOP"}),[ve.ON_CLICK]:I};case s.CK.COMPLETED:return{[ve.LABEL]:"",[ve.ON_CLICK]:Le.P1};default:return{[ve.LABEL]:"",[ve.ON_CLICK]:Le.P1}}},[_,c,d,I]),m=(0,Ue.A)(_);(0,A.useEffect)(()=>{m!==_&&a(!1)},[_,m]);const D=n&&!t,R=(0,A.useMemo)(()=>_===s.CK.PENDING&&e.some(({[s.Me.ID]:e,[s.Me.OPTIMIZATION_STATUS]:t})=>e===s.iR.UPDATE_DEVICE_FIRMWARE&&t===s.CK.PENDING),[e,_]),N=(0,A.useCallback)((e=Le.P1)=>(0,r.jsx)(x.A,{type:"button",size:"medium",onClick:e,isDisabled:D||i,children:C}),[C,D,i]);return C?(0,r.jsx)(Pe.A,{description:D?(0,r.jsx)(E.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_ONE_PER_SITE"}):void 0,children:R?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Ke.A,{shouldCloseOnInteractOutside:!0,onConfirm:O,trigger:N(),title:(0,r.jsx)(E.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_CONFIRMATION_TITLE"}),message:(0,r.jsx)(E.sA,{id:"DASHBOARD_WIFI_DOCTOR_OPTIMIZATION_CONFIRMATION_DESCRIPTION"})})}):N(O)}):null}),we=({activeItem:{[s.Ss.ACTIONS]:e,[s.Ss.IN_PROGRESS]:t,[s.Ss.IN_PROGRESS_IN_SITE]:n}})=>{const i=(e=>{const[t,n]=(0,A.useState)(e),r=(0,A.useRef)(e),o=(0,A.useRef)(null);return(0,A.useEffect)(()=>{o.current&&(clearTimeout(o.current),o.current=null);const t=new Map(r.current.map(e=>[e[s.Me.ID],e]));return e.some(({[s.Me.ID]:e,[s.Me.OPTIMIZATION_STATUS]:n})=>{const r=t.get(e);return!!r&&r[s.Me.OPTIMIZATION_STATUS]!==n})?o.current=setTimeout(()=>{n(e),r.current=e},2500):(n(e),r.current=e),()=>{o.current&&clearTimeout(o.current)}},[e]),t})(e);return(0,r.jsxs)(l,{children:[(0,r.jsx)(O,{}),(0,r.jsx)(o.A,{children:(0,r.jsxs)(d,{children:[(0,r.jsx)(f,{actions:i}),(0,r.jsx)(ge,{actions:i}),(0,r.jsx)(xe,{actions:i}),(0,r.jsx)(ye,{actions:i,in_progress:t,in_progress_in_site:n})]})})]})}},521376(e,t,n){var r;n.d(t,{U:()=>r}),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"}(r||(r={}))},968021(e,t,n){n.d(t,{A:()=>o});var r=n(602086);const o=e=>{const t=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}},656705(e,t,n){n.d(t,{A:()=>O});var r,o,s,i,a,c=n(274934),l=n(602086);!function(e){e.TABLE="table"}(r||(r={})),function(e){e.ROW_ID_MAP_BY_INDEX="rowIdMapByIndex",e.INDEX_MAP_BY_ROW_ID="indexMapByRowId"}(o||(o={})),function(e){e.ON_KEY_DOWN="onKeyDown",e.INCOMING_ROW_PROPS="incomingRowProps",e.HAS_ON_ROW_CLICK="hasOnRowClick"}(s||(s={})),function(e){e.INCOMING_ON_ROW_CLICK="incomingOnRowClick",e.LOCAL_CURRENT_INDEX="localCurrentIndex"}(i||(i={})),function(e){e.DATA_MAP_REFERENCE="dataMapReference",e.ROW_ID_MAP_BY_INDEX="rowIdMapByIndex",e.INDEX_MAP_BY_ROW_ID="indexMapByRowId",e.INCOMING_ON_ROW_CLICK="incomingOnRowClick",e.LOCAL_CURRENT_INDEX="localCurrentIndex",e.MULTI_SELECT_MODE="multiSelectMode"}(a||(a={}));const d="data-row-id";var A=n(202730),u=n(147045);var E=n(521376);const I=e=>e?.children?.[1]?.children;var _=n(587389);const C=(0,n(247816).A)(_.A)`
  tr {
    outline: none;
  }
`,O=({data:e=[],rowProps:t,onRowClick:n,..._})=>{const O=(0,l.useRef)(null),m=(0,l.useRef)(null),{[o.ROW_ID_MAP_BY_INDEX]:D,[o.INDEX_MAP_BY_ROW_ID]:R}=(({[r.TABLE]:e})=>{const[t,n]=(0,l.useState)(()=>e?I(e):void 0);(0,l.useEffect)(()=>{e&&n(I(e))},[e]);const{[o.ROW_ID_MAP_BY_INDEX]:s,[o.INDEX_MAP_BY_ROW_ID]:i}=(0,l.useMemo)(()=>{const e=new Map,n=new Map,r=t?.length;if(t&&r)for(let o=0;o<r;o+=1){const r=t[o].getAttribute(d);r&&(e.set(r,o),n.set(o,r))}return{[o.ROW_ID_MAP_BY_INDEX]:e,[o.INDEX_MAP_BY_ROW_ID]:n}},[t]);return{[o.ROW_ID_MAP_BY_INDEX]:s,[o.INDEX_MAP_BY_ROW_ID]:i}})({[r.TABLE]:O.current}),N=(e=>{const t=(0,l.useRef)(new Map),n=(0,l.useRef)(void 0);if(n.current!==e){n.current=e,t.current.clear();const r=e.length;for(let n=0;n<r;n+=1)t.current.set(e[n].id,e[n])}return t})(e),S=(({[a.DATA_MAP_REFERENCE]:e,[a.ROW_ID_MAP_BY_INDEX]:t,[a.INDEX_MAP_BY_ROW_ID]:n,[a.INCOMING_ON_ROW_CLICK]:r,[a.LOCAL_CURRENT_INDEX]:o,[a.MULTI_SELECT_MODE]:s})=>{const i=(0,l.useCallback)(e=>{e.preventDefault()},[]),c=(0,l.useCallback)(()=>{const t=e.current.get(n.get(o.current+1));t&&(r?.(t),o.current+=1)},[n,o,r,e]),d=(0,l.useCallback)(()=>{const t=e.current.get(n.get(o.current-1));t&&(r?.(t),o.current-=1)},[n,o,r,e]);return(0,l.useCallback)((e,{id:n})=>e=>{if(!s&&r){const r=t.get(n);if(Number.isFinite(r))switch(null===o.current&&(o.current=r),e.key){case E.U.ARROW_DOWN:i(e),c();break;case E.U.ARROW_UP:i(e),d()}}},[r,o,s,i,t,c,d])})({[a.DATA_MAP_REFERENCE]:N,[a.ROW_ID_MAP_BY_INDEX]:D,[a.INDEX_MAP_BY_ROW_ID]:R,[a.INCOMING_ON_ROW_CLICK]:n,[a.LOCAL_CURRENT_INDEX]:m,[a.MULTI_SELECT_MODE]:_.multiSelectMode}),p=(({[s.INCOMING_ROW_PROPS]:e,[s.ON_KEY_DOWN]:t,[s.HAS_ON_ROW_CLICK]:n})=>(0,l.useCallback)((r,o)=>({...n?{[u.L]:A.b.SIDE_PANEL_TRIGGER}:{},...e?.(r,o),[d]:r.id,tabIndex:0,onKeyDown:t(r,o)}),[e,t,n]))({[s.INCOMING_ROW_PROPS]:t,[s.ON_KEY_DOWN]:S,[s.HAS_ON_ROW_CLICK]:Boolean(n)}),g=(({[i.INCOMING_ON_ROW_CLICK]:e,[i.LOCAL_CURRENT_INDEX]:t})=>{const n=(0,l.useCallback)(n=>{t.current=null,e?.(n)},[e,t]);return e?n:void 0})({[i.INCOMING_ON_ROW_CLICK]:n,[i.LOCAL_CURRENT_INDEX]:m});return(0,c.jsx)(C,{ref:O,data:e,rowProps:p,onRowClick:g,tableHeight:e.length?"100%":void 0,virtualize:!0,virtualizeColumn:!0,overscan:6,overscanColumn:1,stickyHeader:!0,..._})}}}]);