try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="edf6ef83-9eb2-4215-8256-e77a6c0afce1",e._sentryDebugIdIdentifier="sentry-dbid-edf6ef83-9eb2-4215-8256-e77a6c0afce1")}catch(e){}("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:{}).SENTRY_RELEASE={id:"13fef0030d956eda25f81a49c02cdf9f738e0982"};(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3439],{3203:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(58168),l=a(96540),r=a(3319);const o=e=>t=>{let{callback:a,feature:n,isStart:o,isSuccess:c,isFailure:d,eventReason:u,payload:i={},...s}=t;const{sendLog:f,isReady:g}=(0,r.A)(),b=(0,l.useCallback)((e=>{const t=s[a],l={feature:n,isStart:o,isSuccess:c,isFailure:d,eventReason:u,...i,...s["data-ga"]?{dataGa:s["data-ga"]}:{},...s.dataGa?{dataGa:s.dataGa}:{},...s["data-track"]?{dataTrack:s["data-track"]}:{},...s.label?{label:s.label}:{}};"function"===typeof t&&t(e),f(l,!0)}),[a,f,g,i,s]),p=(0,l.useMemo)((()=>({...s,[a]:b})),[s,a,b]);return l.createElement(e,p)};var c=a(81691);const d=e=>t=>{let{payload:a={},...r}=t;const d=o(e);return l.createElement(d,(0,n.A)({},r,{callback:"onClick",payload:{...a,action:c.o1.buttonClicked}}))}},33439:(e,t,a)=>{a.r(t),a.d(t,{Trust:()=>g,default:()=>b});a(98992),a(72577);var n=a(96540),l=a(86663),r=a(10302),o=a(72060),c=a(26363),d=a(55093),u=a(3203),i=a(3319),s=a(60908);const f=(0,u.A)(r.Button),g=()=>{const[e,t]=(0,n.useMemo)((()=>{const{search:e}=window.location,{redirect_uri:t,agent_uri:a}=l.parse(e);return[(0,o.A)(t),a]})),[a,u]=(0,n.useState)(),[g,b,p]=(0,c.LC)(),[m,y]=(0,c.Yr)({},[g]),{sendLog:h,isReady:E}=(0,i.A)();return(0,n.useEffect)((()=>{let a=!0,n=null;const l=m.find((e=>e.url===t));return l?h({feature:"TrustUrl",description:"Redirect due to trusted url"}).finally((()=>{location.replace(`/api/v1/auth/account/origins/${l.id}/redirect?redirect_uri=${encodeURIComponent(e)}&agent_uri=${encodeURIComponent(t)}`)})):n=setTimeout((()=>{a&&u(!0)}),1e3),()=>{a=!1,n&&(clearTimeout(n),n=null)}}),[e,t,m,E]),a?n.createElement(s.Ay,{feature:"TrustUrl"},n.createElement(r.Layer,{full:!0},n.createElement(r.Flex,{"data-testid":"trust",alignItems:"center",justifyContent:"center",column:!0,width:"100%",height:"100%",background:"mainBackground",gap:4},n.createElement(d.m,{animate:p}),n.createElement(r.Text,{textAlign:"center"},"Do you trust ",n.createElement(r.Text,{strong:!0},t),"?"),n.createElement(r.Flex,{column:!0,gap:2,alignItems:"center"},n.createElement(r.TextBig,null,"Authorizing this URL will allow it to request your Netdata data."),n.createElement(r.Flex,{gap:2},n.createElement(f,{flavour:"borderless",onClick:()=>window.location.replace(decodeURIComponent(e)),disabled:y||p,"data-ga":"url-authorization::click-cancel-button",feature:"TrustUrl",payload:{label:"Cancel"}},"Cancel"),n.createElement(f,{onClick:()=>b(t),disabled:y||p,isLoading:y||p,"data-ga":"url-authorization::click-yes-button",feature:"TrustUrl",payload:{label:"Yes"}},"Yes")))))):n.createElement(d.A,null)},b=g},72060:(t,a,n)=>{n.d(a,{A:()=>l});const l=t=>{try{if(!t)return null;const e=document.createElement("a");return e.href=t,/https?/.test(e.protocol)?new URL(e.protocol+"//"+e.host+e.pathname+e.search+e.hash).toString():null}catch(e){return null}}}}]);