!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0bd361dc-7e1f-4f7b-a41a-3ecf1102a949",e._sentryDebugIdIdentifier="sentry-dbid-0bd361dc-7e1f-4f7b-a41a-3ecf1102a949")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"79d3cd5525e22d657dc079bdf45a12ff56a6fdb3"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[3350],{92155:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(58168),r=a(96540),l=a(50876);const o=e=>(0,r.forwardRef)(((t,a)=>{let{callback:o,feature:c,isStart:d,isSuccess:u,isFailure:i,eventReason:s,payload:f={},...b}=t;const{sendLog:g,isReady:m}=(0,l.A)(),p=(0,r.useCallback)((e=>{const t=b[o],a={feature:c,isStart:d,isSuccess:u,isFailure:i,eventReason:s,...f,...b["data-ga"]?{dataGa:b["data-ga"]}:{},...b.dataGa?{dataGa:b.dataGa}:{},...b["data-track"]?{dataTrack:b["data-track"]}:{},...b.label?{label:b.label}:{}};"function"===typeof t&&t(e),g(a,!0)}),[o,g,m,f,b]),y=(0,r.useMemo)((()=>({...b,[o]:p})),[b,o,p]);return r.createElement(e,(0,n.A)({ref:a},y))}));var c=a(67276);const d=e=>(0,r.forwardRef)(((t,a)=>{let{payload:l={},...d}=t;const u=o(e);return r.createElement(u,(0,n.A)({},d,{ref:a,callback:"onClick",payload:{...l,action:c.o1.buttonClicked}}))}))},39347:(e,t,a)=>{a.d(t,{A:()=>n});const n=e=>{try{if(!e)return null;const t=document.createElement("a");return t.href=e,/https?/.test(t.protocol)?new URL(t.protocol+"//"+t.host+t.pathname+t.search+t.hash).toString():null}catch(t){return null}}},73350:(e,t,a)=>{a.r(t),a.d(t,{Trust:()=>b,default:()=>g});a(3064),a(98992),a(72577);var n=a(96540),r=a(86663),l=a(8573),o=a(39347),c=a(14096),d=a(28738),u=a(92155),i=a(50876),s=a(63314);const f=(0,u.A)(l.Button),b=()=>{const[e,t]=(0,n.useMemo)((()=>{const{search:e}=window.location,{redirect_uri:t,agent_uri:a}=r.parse(e);return[(0,o.A)(t),a]})),[a,u]=(0,n.useState)(),[b,g,m]=(0,c.LC)(),[p,y]=(0,c.Yr)({},[b]),{sendLog:h,isReady:w}=(0,i.A)();return(0,n.useEffect)((()=>{let a=!0,n=null;const r=p.find((e=>e.url===t));return r?h({feature:"TrustUrl",description:"Redirect due to trusted url"}).finally((()=>{location.replace(`/api/v1/auth/account/origins/${r.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,p,w]),a?n.createElement(s.Ay,{feature:"TrustUrl"},n.createElement(l.Layer,{full:!0},n.createElement(l.Flex,{"data-testid":"trust",alignItems:"center",justifyContent:"center",column:!0,width:"100%",height:"100%",background:"mainBackground",gap:4},n.createElement(d.m,{animate:m}),n.createElement(l.Text,{textAlign:"center"},"Do you trust ",n.createElement(l.Text,{strong:!0},t),"?"),n.createElement(l.Flex,{column:!0,gap:2,alignItems:"center"},n.createElement(l.TextBig,null,"Authorizing this URL will allow it to request your Netdata data."),n.createElement(l.Flex,{gap:2},n.createElement(f,{flavour:"borderless",onClick:()=>window.location.replace(decodeURIComponent(e)),disabled:y||m,"data-ga":"url-authorization::click-cancel-button",feature:"TrustUrl",payload:{label:"Cancel"}},"Cancel"),n.createElement(f,{onClick:()=>g(t),disabled:y||m,isLoading:y||m,"data-ga":"url-authorization::click-yes-button",feature:"TrustUrl",payload:{label:"Yes"}},"Yes")))))):n.createElement(d.A,null)},g=b}}]);