"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[41508],{376892(e,r,s){s.d(r,{A:()=>o});var i=s(274934),t=s(938984),n=s(470070);const o=({id:e,children:r,values:s})=>(0,i.jsxs)(t.A,{color:"text-1",weight:"bold",size:"medium",children:[e?(0,i.jsx)(n.sA,{id:e,values:s}):null,r]})},643334(e,r,s){s.d(r,{A:()=>ee});var i=s(274934),t=s(602086),n=s(938984),o=s(954702),l=s(167953),a=s(409844),d=s(263705),c=s(977872),u=s(814557),m=s(87449),A=s(470070),h=s(100978),p=s(309130),x=s(968021),_=s(29472),E=s(430986);const v=`${s(290454).w}/device/{mac}/fw-revert-options`,j=(e,r={},s={})=>(0,_.Kd)("firmwareRevertOptions",(0,E.P)(v,{mac:e}),e,r,{idField:"mac",...s});var C=s(222102),g=s(656466),O=s(401042);var N=s(45978),f=s(724081),w=s(260610),I=s(642687),b=s(247816),T=s(669439),M=(s(232087),s(129402)),R=s(347625),k=s(807811),D=s(224012),L=s(743178),S=s(591256),H=s(594633),y=s(976458),U=s(696916),V=s(795206),$=s(898809),z=s(146215),G=s(930071);const P=(0,b.A)(G.A)`
  border-radius: 50%;
  padding: 1px;
  border: ${({theme:{themeName:e}})=>u.Ay[`desktop-border-divider-${e}`]};
  color: ${({theme:{themeName:e}})=>u.Ay[`desktop-color-neutral-08-${e}`]};
`,F=({model:e,version:r})=>{const s=(0,c.d4)(y.qf),n=(0,m.coerce)(r)?.version||r,o=(0,t.useCallback)(()=>{n&&s?.(e,n)},[s,e,n]);return(0,i.jsx)(T.A,{description:(0,i.jsx)(A.sA,{id:"COMMON_RELEASE_NOTES"}),children:(0,i.jsx)("span",{children:(0,i.jsx)(P,{actionable:!0,onClick:o,size:"original"})})})},q=()=>{const{themeName:e}=(0,d.u)();return(0,i.jsx)("svg",{viewBox:"0 0 93 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M92.3536 4.03715C92.5488 3.84189 92.5488 3.5253 92.3536 3.33004L89.1716 0.14806C88.9763 -0.0472023 88.6597 -0.0472023 88.4645 0.14806C88.2692 0.343322 88.2692 0.659904 88.4645 0.855167L91.2929 3.68359L88.4645 6.51202C88.2692 6.70728 88.2692 7.02387 88.4645 7.21913C88.6597 7.41439 88.9763 7.41439 89.1716 7.21913L92.3536 4.03715ZM0 3.68359V4.18359H92V3.68359V3.18359H0V3.68359Z",fill:u.Ay[`desktop-color-purple-06-${e}`]})})},B=(0,b.A)(h.A)`
  padding: ${p.xO};
  border: ${({theme:{themeName:e}})=>u.Ay[`desktop-border-divider-${e}`]};
  border-radius: 8px;
  margin-bottom: ${p.kc};
`,W=(0,b.A)(h.A)`
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background-color: ${({theme:{themeName:e}})=>u.Ay[`desktop-color-purple-06-${e}`]};
  z-index: 1;
`,Y=(0,b.A)(h.A)`
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  align-items: center;
`,K=(0,b.A)(h.A)`
  background-color: ${({theme:{themeName:e}})=>u.Ay[`desktop-color-neutral-02-${e}`]};
  border-radius: 4px;

  textarea {
    background-color: transparent;
    resize: none;
  }
`,X=({onCancel:e,onSubmitSuccess:r,name:s,model:o,mac:x,displayable_version:_,uptime:E,revertOptions:v})=>{const j=(0,c.wA)(),{themeName:C}=(0,d.u)(),{formatMessage:g}=(0,A.tz)(),[O,N]=(0,t.useState)(""),f=(0,c.d4)(S.Eh),b=(0,c.d4)(H.S$),G=(0,L.GO)(b),P=(0,c.d4)(y.ap),X=(0,c.d4)(y.YL),Z=(0,U.A)("firmware_downgrade_feedback"),J=(0,R.Lm)(o),Q=(0,m.coerce)(_)?.version,ee=(0,m.coerce)(v.previous_firmware_version)?.version,re=(0,t.useCallback)(async(e,r)=>{const s=await Z(),i=`${k.DU}${D.Fx[G]}/v1/firmware-downgrade`;try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","X-Captcha":s},mode:"cors",body:JSON.stringify({message:e,applicationName:"Network",applicationVersion:f,deviceModel:J,deviceFirmwareCurrentVersion:(0,M._)(_),deviceFirmwareNewVersion:r,anonymousId:P})})}catch(e){}},[Z,G,f,_,P,J]),se=(0,t.useCallback)(()=>{if(j((0,V._1)({name:s,model:o,mac:x},v.previous_firmware_url)),X)return r();O&&re(O,v.previous_firmware_version),r()},[j,s,o,x,v.previous_firmware_url,v.previous_firmware_version,X,O,r,re]);return(0,i.jsxs)(B,{flexDirection:"column",gap:p.Ln,children:[(0,i.jsxs)(h.A,{gap:p.kc,width:"100%",children:[(0,i.jsxs)(h.A,{flexDirection:"column",alignItems:"center",width:"110px",flex:"0 0 110px",children:[(0,i.jsxs)(n.A,{color:"text-3",size:"small",children:[(0,i.jsx)(A.sA,{id:"COMMON_CURRENT_VERSION"}),":"]}),(0,i.jsxs)(h.A,{gap:p.YC,children:[(0,i.jsx)(T.A,{description:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(A.sA,{id:"DEVICE_TIME_RUNNING"}),": ",(0,$.Ay)(E).join("").trim()]}),children:(0,i.jsx)(n.A,{color:"text-2",size:"medium",children:Q})}),(0,i.jsx)(F,{model:o,version:_})]})]}),(0,i.jsxs)(h.A,{flex:1,alignItems:"center",justifyContent:"center",position:"relative",children:[(0,i.jsx)(Y,{children:(0,i.jsx)(q,{})}),(0,i.jsx)(W,{children:(0,i.jsx)(l.A,{size:"original",variant:"twoTone",color:"white",twoTonedClassname:a.AH`
                fill: ${u.Ay[`desktop-color-purple-06-${C}`]};
              `})})]}),(0,i.jsxs)(h.A,{flexDirection:"column",alignItems:"center",width:"110px",flex:"0 0 110px",children:[(0,i.jsxs)(n.A,{color:"text-3",size:"small",children:[(0,i.jsx)(A.sA,{id:"COMMON_REVERT_TO"}),":"]}),(0,i.jsxs)(h.A,{gap:p.YC,children:[(0,i.jsx)(n.A,{color:"text-2",size:"medium",children:ee}),(0,i.jsx)(F,{model:o,version:ee||""})]})]})]}),X?null:(0,i.jsx)(K,{flexDirection:"column",gap:p.YC,children:(0,i.jsx)(w.A,{resize:!1,style:{width:"100%"},placeholder:g({id:"COMMON_HELP_UNIFI_UNDERSTAND_REVERT_DESCRIPTION"}),value:O,onChange:e=>{N(e)}})}),(0,i.jsxs)(h.A,{gap:p.YC,width:"100%",children:[(0,i.jsx)(z.A,{title:(0,i.jsx)(A.sA,{id:"DEVICE_REVERT_NOW_CONFIRM_TITLE",values:{model:J}}),message:(0,i.jsx)(A.sA,{id:"DEVICE_REVERT_NOW_CONFIRM_MESSAGE",values:{model:J,version:ee||""}}),confirmButtonVariant:"emphasis",onConfirm:se,trigger:(0,i.jsx)(I.A,{size:"small",children:(0,i.jsx)(A.sA,{id:"COMMON_ACTION_REVERT_NOW"})})}),(0,i.jsx)(I.A,{size:"small",variant:"neutral",onClick:e,children:(0,i.jsx)(A.sA,{id:"COMMON_ACTION_CANCEL"})})]})]})};var Z=s(664092),J=s(857780);const Q=[J.bq.USW,J.bq.UAP,J.bq.UDB,J.bq.UBB,J.bq.UXG,J.bq.UBLE,J.bq.UAV,J.bq.UCI,J.bq.UACC],ee=({name:e,model:r,mac:s,displayable_version:_,uptime:E,type:v,flexProps:w,deviceState:I})=>{const b=(0,c.wA)(),[T,M]=(0,t.useState)(!1),{themeName:R}=(0,d.u)(),k=(0,c.d4)((0,t.useMemo)(()=>(e=>(0,C.Mz)((e=>(0,g.uh)(j(e)))(e),O.i6))(s),[s])),D=(0,x.A)(I);(0,t.useEffect)(()=>{D===N.g.UPGRADING&&I!==N.g.UPGRADING&&b(j(s))},[I,D,b,s]);const L=(0,t.useMemo)(()=>{const e=k.previous_firmware_version&&k.previous_firmware_url,r=_!==(0,m.coerce)(k.previous_firmware_version)?.version,s=I===N.g.UPGRADING;return Boolean(e)&&!s&&r&&Q.includes(v)},[k.previous_firmware_version,k.previous_firmware_url,_,I,v]),S=(0,f.A)(Q.includes(v)?[j(s,{},void 0)]:[],L?(0,i.jsxs)(o.A,{onPress:()=>{M(!0)},fontSize:"medium",children:[(0,i.jsx)(l.A,{size:"original",variant:"twoTone",color:u.Ay[`desktop-color-ublue-06-${R}`],twoTonedClassname:a.AH`
            fill: ${u.Ay[`desktop-color-ublue-01-${R}`]};
          `}),(0,i.jsx)(A.sA,{id:"COMMON_REVERT"})]}):null);return(0,i.jsxs)(i.Fragment,{children:[_?(0,i.jsxs)(Z.A,{flexProps:w,children:[(0,i.jsx)(n.A,{color:"text-2",size:"medium",children:(0,i.jsx)(A.sA,{id:"COMMON_DEVICE_VERSION"})}),(0,i.jsxs)(h.A,{gap:p.kc,alignItems:"flex-start",children:[(0,i.jsx)(n.A,{color:"text-3",size:"medium",children:_}),S]})]}):null,T?(0,i.jsx)(X,{onCancel:()=>{M(!1)},onSubmitSuccess:()=>{M(!1)},name:e,model:r,mac:s,displayable_version:_,uptime:E,revertOptions:k}):null]})}},645682(e,r,s){s.d(r,{A:()=>l});var i=s(274934),t=s(938984),n=s(100978),o=s(470070);const l=({color:e})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.A,{children:(0,i.jsx)(t.A,{weight:"bold",color:e,children:(0,i.jsx)(o.sA,{id:"AP_LOW_UPLINK_SPEED_NOTIFICATION_TITLE"})})}),(0,i.jsx)(n.A,{children:(0,i.jsx)(t.A,{color:e,children:(0,i.jsx)(o.sA,{id:"AP_LOW_UPLINK_SPEED_NOTIFICATION_BODY"})})})]})},61322(e,r,s){s.d(r,{I:()=>i});const i={HEADER_HEIGHT:32,ROW_HEIGHT:32,EDIT_FIELD_HEIGHT:36,getHeight(e,r,s,i){return Math.min((i||this.ROW_HEIGHT)*e+(s??this.HEADER_HEIGHT),(i||this.ROW_HEIGHT)*r+(s??this.HEADER_HEIGHT))},getEditContainerHeight(e,r,s){return Math.min((s||this.EDIT_FIELD_HEIGHT)*e,(s||this.EDIT_FIELD_HEIGHT)*r)}}},112104(e,r,s){s.d(r,{A:()=>c});var i=s(274934),t=s(602086),n=s(938984),o=s(599110),l=s(309130),a=s(100978),d=s(470070);const c=(e,r={})=>{const{formatMessage:s}=(0,d.tz)(),[c,u]=(0,t.useState)(!1),{defaultCount:m,label:{singular:A,plural:h}}=(0,t.useMemo)(()=>({defaultCount:r.defaultCount||6,label:{singular:s({id:r.label?.singular||"COMMON_DEVICE"}),plural:s({id:r.label?.plural||"COMMON_DEVICES"})}}),[r,s]),p=(0,t.useCallback)(()=>{u(e=>!e)},[]);return{rowLimit:e>m&&!c?m:e,renderFooter:e>m?(0,i.jsx)(a.A,{marginTop:l.kc,children:(0,i.jsxs)(n.A,{size:"medium",children:[(0,i.jsx)(d.sA,{id:"COMMON_ADV_TABLE_FOOTER",values:{length:e>m&&!c?m:e,total:e,singular:A,plural:h}}),(0,i.jsxs)(i.Fragment,{children:[" ",(0,i.jsxs)(o.A,{type:"button",variant:"inline",onClick:p,children:[(0,i.jsx)(d.sA,{id:"COMMON_SHOW"})," ",(0,i.jsx)(d.sA,{id:c?"COMMON_LESS":"COMMON_ALL"})]})]})]})}):null,setExpand:u}}},968021(e,r,s){s.d(r,{A:()=>t});var i=s(602086);const t=e=>{const r=(0,i.useRef)(void 0);return(0,i.useEffect)(()=>{r.current=e},[e]),r.current}},696916(e,r,s){s.d(r,{A:()=>d});var i=s(602086),t=s(977872),n=s(232087),o=s(594633),l=s(743178);const a={[n.OH.PRD]:"6Ld47OUpAAAAALQ4AgR1gfk-hnSw27y3zIMKLOSw",[n.OH.STG]:"6LeKc-UpAAAAAN6YqRab29cPCbU-cfe7_EvchSvc",[n.OH.DEV]:"6LeocOUpAAAAANmIju4N9DzlkK4UNYdYThrUkK3y"},d=e=>{const[r,s]=(0,i.useState)(),n=(0,i.useRef)(void 0),d=(0,t.d4)(o.S$),c=(0,l.GO)(d);return(0,i.useEffect)(()=>{const r=()=>{const{grecaptcha:i}=window;i?.enterprise.ready(()=>s(()=>()=>i.enterprise.execute(a[c],{action:e}))),n.current?.removeEventListener("load",r)};return"grecaptcha"in window?r():(n.current=document.createElement("script"),n.current.src=(e=>`https://www.google.com/recaptcha/enterprise.js?render=${a[e]}`)(c),n.current.addEventListener("load",r),document.body.appendChild(n.current),(()=>{const e="hide-grecaptcha-badge";if(document.getElementById(e))return;const r=document.createElement("style");r.id=e,r.innerText=".grecaptcha-badge { visibility: hidden; }",document.head.appendChild(r)})()),()=>{n.current?.removeEventListener("load",r)}},[]),r}}}]);