!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]="72025a98-dc3e-442a-87d0-742bf6ddeaf5",e._sentryDebugIdIdentifier="sentry-dbid-72025a98-dc3e-442a-87d0-742bf6ddeaf5")}catch(e){}}();var _global="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};_global.SENTRY_RELEASE={id:"833aaee1cc06f5081274f22d18347a1cce30fb04"},(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[9768],{39768:function(e,t,n){n.r(t),n.d(t,{default:function(){return A}});var r=n(45987),o=n(29439),a=(n(92222),n(9170),n(66992),n(41539),n(88674),n(34668),n(78783),n(33948),n(21249),n(57640),n(9924),n(69826),n(31672),n(2490),n(59461),n(26699),n(32023),n(74916),n(64765),n(15306),n(67294)),i=n(89250),c=n(17563),s=n(26398),u=n(62200),d=n(13477),f=n(25819),l=n(93017),p=n(76201),g=n(74059),v=n(6308),w=n(4942);n(47941),n(82526),n(57327),n(88449),n(59849),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},r=e.origin,o=e.id,a=e.name;if(r){var i=decodeURIComponent(o),c=decodeURIComponent(r);(0,E.kq)(o).then((function(e){var r=e.data,o=void 0===r?[]:r;return n(i,c,a),o.length?s.Z.get(u.MC).then((function(e){var t=e.data;return Promise.any(t.map((function(e){return s.Z.get((0,O.W)({spaceId:e.id})).then((function(t){var n=t.data;return Promise.any(n.map((function(t){return(0,f.Fz)({roomId:t.id,spaceId:e.id}).then((function(n){var r=n.nodes.find((function(e){var t=e.id;return o.includes(t)}));if(!r)throw new Error("can't find matching node");var a=window.location,i=a.protocol,c=a.host;return"".concat(i,"//").concat(c,"/spaces/").concat(e.slug,"/rooms/").concat(t.slug,"/nodes/").concat(r.id)}))})))}))})))})).catch((function(){})):(0,E.YZ)(i).then((function(e){var n=e.data.claimed;throw t(n?{errorMsgKey:"ErrForbidden",errorMessage:"You tried to access this Node on Netdata and you don't have access to it. Please contact your Space admin to give you access to it."}:{errorMsgKey:"ErrForbidden",errorMessage:"This Node isn't connected to Netdata. Please connect it, if you have permission for it, or contact your Space admin."}),"no access"}))})).then((function(e){e&&setTimeout(location.assign(e))})).catch((function(){}))}}),[])}(),h=(0,P.Z)();if(!e||h.isFetching||h.hasAccess&&!w||n)return null;var _=window.location,A=_.pathname,C=_.search,D=_.hash,R=c.parse(D),N=R.error_retry,U=R.token,F=c.parse(C),T=F.cloudRoute,z=F.redirect_uri,M=(0,r.Z)(F,x);if(!t&&N)return a.createElement(Z,{errorRetry:N,token:U,redirectUri:z});if(!t&&w){if(T){var L=T.includes("join-callback")?decodeURI(T):T,H=Array.isArray(L)?L[0]:L;return a.createElement(i.Fg,{replace:!0,to:H})}return z?(m(M),window.location.replace(decodeURIComponent(z)),null):a.createElement(i.Fg,{replace:!0,to:"/spaces"})}if(I.ZP)return null;if(t&&!w){var G=D.includes("join-callback")?D:encodeURIComponent(D),K="".concat(C).concat(C?"&":"?","cloudRoute=").concat(A);return a.createElement(i.Fg,{replace:!0,to:{pathname:"/sign-in",search:K,hash:G}})}return null}},7335:function(e,t,n){n.d(t,{aG:function(){return E},H3:function(){return _},XU:function(){return O},DH:function(){return k},z2:function(){return y},lL:function(){return b}});var r=n(29439),o=n(93433),a=n(15861),i=n(4942),c=n(64687),s=n.n(c),u=(n(21249),n(57640),n(9924),n(85827),n(41539),n(25387),n(2490),n(72608),n(57327),n(88449),n(59849),n(26699),n(32023),n(92222),n(66992),n(70189),n(78783),n(88921),n(96248),n(13599),n(11477),n(64362),n(15389),n(90401),n(45164),n(91238),n(54837),n(87485),n(56767),n(76651),n(61437),n(35285),n(39865),n(33948),n(69826),n(31672),n(59461),n(2707),n(47941),n(82526),n(38880),n(15581),n(34514),n(54747),n(49337),n(33321),n(69070),n(67294)),d=n(4480),f=n(89250),l=n(13477),p=(0,d.xu)({key:"visitedNodes",default:function(){return[]}}),g=n(97945),v=n(18761);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{}).autoFetch,t=void 0===e||e,n=(0,l.Iy)(),o=n.id,a=n.isAnonymous,i=(0,d.FV)(p(o)),c=(0,r.Z)(i,2)[1],s=(0,u.useState)(0),f=(0,r.Z)(s,2),g=f[0],w=f[1],m=(0,u.useCallback)((function(){w((function(e){return e+1}))}),[w]);return(0,u.useEffect)((function(){if(o&&(t||g))if(a){var e=(window.visitedNodes||[]).sort((function(e,t){return new Date(t.lastAccessTime)-new Date(e.lastAccessTime)}));c(e)}else(0,v.Fz)(o).then((function(e){if(e){var t=e.data.results.sort((function(e,t){return new Date(t.lastAccessTime)-new Date(e.lastAccessTime)}));c(t)}}))}),[t,g,o,a]),m},O=function(){var e=(0,l.jr)(),t=p(e);return(0,d._8)((function(e){var n=e.snapshot,r=e.set;return function(){var e=(0,a.Z)(s().mark((function e(o){var a,i,c,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.getPromise((0,g.$E)(o));case 2:return a=e.sent,i=a.map((function(e){return e.machineGUID})),e.next=6,n.getPromise(t);case 6:c=e.sent,(u=c.filter((function(e){return!i.includes(e.id)}))).length!==c.length&&r(t,u);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),[e])}},11060:function(e,t,n){var r=n(1702),o=Error,a=r("".replace),i=String(new o("zxcasd").stack),c=/\n\s*at [^:]*:[^\n]*/,s=c.test(i);e.exports=function(e,t){if(s&&"string"==typeof e&&!o.prepareStackTrace)for(;t--;)e=a(e,c,"");return e}},5392:function(e,t,n){var r=n(68880),o=n(11060),a=n(22914),i=Error.captureStackTrace;e.exports=function(e,t,n,c){a&&(i?i(e,t):r(e,"stack",o(n,c)))}},22914:function(e,t,n){var r=n(47293),o=n(79114);e.exports=!r((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",o(1,7)),7!==e.stack)}))},58340:function(e,t,n){var r=n(70111),o=n(68880);e.exports=function(e,t){r(t)&&"cause"in t&&o(e,"cause",t.cause)}},56277:function(e,t,n){var r=n(41340);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},56967:function(e,t,n){var r=n(82109),o=n(47976),a=n(79518),i=n(27674),c=n(99920),s=n(70030),u=n(68880),d=n(79114),f=n(58340),l=n(5392),p=n(20408),g=n(56277),v=n(5112)("toStringTag"),w=Error,m=[].push,h=function(e,t){var n,r=o(y,this);i?n=i(new w,r?a(this):y):(n=r?this:s(y),u(n,v,"Error")),void 0!==t&&u(n,"message",g(t)),l(n,h,n.stack,1),arguments.length>2&&f(n,arguments[2]);var c=[];return p(e,m,{that:c}),u(n,"errors",c),n};i?i(h,w):c(h,w,{name:!0});var y=h.prototype=s(w.prototype,{constructor:d(1,h),message:d(1,""),name:d(1,"AggregateError")});r({global:!0,constructor:!0,arity:2},{AggregateError:h})},9170:function(e,t,n){n(56967)},34668:function(e,t,n){var r=n(82109),o=n(46916),a=n(19662),i=n(35005),c=n(78523),s=n(12534),u=n(20408),d=n(80612),f="No one promise resolved";r({target:"Promise",stat:!0,forced:d},{any:function(e){var t=this,n=i("AggregateError"),r=c.f(t),d=r.resolve,l=r.reject,p=s((function(){var r=a(t.resolve),i=[],c=0,s=1,p=!1;u(e,(function(e){var a=c++,u=!1;s++,o(r,t,e).then((function(e){u||p||(p=!0,d(e))}),(function(e){u||p||(u=!0,i[a]=e,--s||l(new n(i,f)))}))})),--s||l(new n(i,f))}));return p.error&&l(p.value),r.promise}})}}]);