"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[43011],{443011:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var a=n(469733),r=n(296540),i=n(951272),c=n(217439),d=n(170121),s=n(874734),l=n(417378),o=n(778851);const m={[s.OH.PRD]:"6Ld47OUpAAAAALQ4AgR1gfk-hnSw27y3zIMKLOSw",[s.OH.STG]:"6LeKc-UpAAAAAN6YqRab29cPCbU-cfe7_EvchSvc",[s.OH.DEV]:"6LeocOUpAAAAANmIju4N9DzlkK4UNYdYThrUkK3y"},A=e=>{const[t,n]=(0,r.useState)(),i=(0,r.useRef)(),c=(0,a.useSelector)(l.S$),d=(0,o.GO)(c);return(0,r.useEffect)(()=>{const t=()=>{const{grecaptcha:a}=window;a.enterprise.ready(()=>n(()=>()=>a.enterprise.execute(m[d],{action:e}))),i.current?.removeEventListener("load",t)};return"grecaptcha"in window?t():(i.current=document.createElement("script"),i.current.src=(e=>`https://www.google.com/recaptcha/enterprise.js?render=${m[e]}`)(d),i.current.addEventListener("load",t),document.body.appendChild(i.current),(()=>{const e="hide-grecaptcha-badge";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.innerText=".grecaptcha-badge { visibility: hidden; }",document.head.appendChild(t)})()),()=>{i.current?.removeEventListener("load",t)}},[]),t};var E=n(870443),u=n(566723),p=n(126457),h=n(699784),C=n(143811),b=n(705426),O=n(294303);const f={feedback:""},S=E.A.object().shape({feedback:E.A.string().min(1).max(4096).required().label("COMMON_FEEDBACK")}),_=({onSubmit:e})=>{const t=(0,a.useDispatch)(),{formatMessage:n}=(0,h.tz)(),[s,l]=(0,r.useState)(!1),o=()=>t((0,p.AS)()),m=A("firmware_downgrade_feedback");return r.createElement(i.l1,{initialValues:f,validationSchema:S,onSubmit:async({feedback:t})=>{if(!s&&m){l(!0);try{const n=await m();e(t,n)}catch(e){0}finally{l(!1),o()}}}},({handleSubmit:e,dirty:t,isValid:a,isSubmitting:i})=>r.createElement(b.A,{actions:[{text:r.createElement(h.sA,{id:"COMMON_ACTION_SKIP"}),type:"button",onClick:o},{text:r.createElement(h.sA,{id:"COMMON_ACTION_CONTINUE"}),type:"button",variant:"primary",disabled:s||!t||!a||i,onClick:e}],title:r.createElement(d.A,{variant:"medium"},r.createElement(h.sA,{id:"DEVICE_ACTIONS_DOWNGRADE_FEEDBACK_TITLE"})),size:"small",onRequestClose:o,allowOverflow:!0},r.createElement(O.A,{gap:u.Ln,flexDirection:"column"},r.createElement(c.A,{variant:"body-primary"},r.createElement(h.sA,{id:"DEVICE_ACTIONS_DOWNGRADE_FEEDBACK_MESSAGE"})),r.createElement(C.A,{name:"feedback",type:"textarea",size:"body",placeholder:n({id:"DEVICE_ACTIONS_DOWNGRADE_FEEDBACK_PLACEHOLDER"}),minHeight:"76px",maxHeight:"200px",maxWidth:"360px",minWidth:"360px",resize:!0}))))}}}]);