File: //opt/netdata/usr/local/local/share/netdata/web/v3/5030.71a892eade62a4f6af86.chunk.js
try{!function(){var 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]="a8b69993-70e2-4105-9337-935d72b4fffa",e._sentryDebugIdIdentifier="sentry-dbid-a8b69993-70e2-4105-9337-935d72b4fffa")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"71e6cd07d3b7cc35c33cc0937670fa3dc3e40c07"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[5030],{75030:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});var a=n(96540),r=n(52035),o=n(34843),i=n(84929),s=n(41394),c=n(32370),d=n(45710),l=n(42539),u=n(52365),f=n(75156),h=n(92516),p=n(1108),m=n(5305),b=n(96054),g=n(61501),w=n(10911),x=n(91349);function D(e,t,n){const a=(0,h.q)(),r=n?.locale??a.locale??f.c,o=(0,b.z)(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const i=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[s,c]=(0,m.x)(n?.in,...o>0?[t,e]:[e,t]),d=(0,x.O)(c,s),l=((0,p.G)(c)-(0,p.G)(s))/1e3,u=Math.round((d-l)/60);let D;if(u<2)return n?.includeSeconds?d<5?r.formatDistance("lessThanXSeconds",5,i):d<10?r.formatDistance("lessThanXSeconds",10,i):d<20?r.formatDistance("lessThanXSeconds",20,i):d<40?r.formatDistance("halfAMinute",0,i):d<60?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",1,i):0===u?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",u,i);if(u<45)return r.formatDistance("xMinutes",u,i);if(u<90)return r.formatDistance("aboutXHours",1,i);if(u<g.F6){const e=Math.round(u/60);return r.formatDistance("aboutXHours",e,i)}if(u<2520)return r.formatDistance("xDays",1,i);if(u<g.Nw){const e=Math.round(u/g.F6);return r.formatDistance("xDays",e,i)}if(u<2*g.Nw)return D=Math.round(u/g.Nw),r.formatDistance("aboutXMonths",D,i);if(D=(0,w.W)(c,s),D<12){const e=Math.round(u/g.Nw);return r.formatDistance("xMonths",e,i)}{const e=D%12,t=Math.trunc(D/12);return e<3?r.formatDistance("aboutXYears",t,i):e<9?r.formatDistance("overXYears",t,i):r.formatDistance("almostXYears",t+1,i)}}function y(e,t){return D(e,(0,u.A)(e),t)}var I=n(85577),S=n(91130),M=n(63766),j=n(56171),T=n(79748),k=n(6304),X=n(74848);const P=(0,r.eU)((()=>S.A.get("/api/v1/license").then((e=>e.data)).catch((()=>null)))),A=()=>{const e=(0,o.md)((0,i.Rq)(P)),[t,n]=(0,k.A)(),[r,u]=(0,a.useState)(),[f,h]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{if("hasValue"!==e.state)return;const t=e.data?.data;if(!t)return;const a=(0,s.H)(t.exp);if(u(a),!(0,c.f)(a))return;const r=parseInt((a-new Date)/1e3/60/60/24);if(r>30)return;const o=localStorage.getItem("dismissLicenceWarning");o&&(0,c.f)((0,s.H)(o))&&!(0,d.R)((0,s.H)(o))&&r>0||(n(!0),r<0&&h(!0))}),[e]),window.envSettings.onprem&&t?f?(0,X.jsx)(M.Layer,{full:!0,backdropProps:{backdropBlur:"3px"},children:(0,X.jsx)(j.A,{testId:"onprem-banner",width:"100%",background:"errorBackground",position:"absolute",top:"0",tooltipProps:{align:"top"},zIndex:20,children:(0,X.jsx)(M.Flex,{justifyContent:"center",alignItems:"center",width:"100%",gap:2,children:(0,X.jsxs)(M.Text,{children:["Your Netdata Enterprise On-prem License has expired on ",(0,I.GP)(r,"PPPP"),". Please contact your admin /"," ",(0,X.jsx)(T.A,{"data-testid":"renew",href:"mailto:billing@netdata.cloud",as:"a",cursor:"pointer",textDecoration:"underline",color:"main",children:"billing@netdata.cloud"})," ","to renew your license."]})})})}):(0,X.jsx)(j.A,{testId:"onprem-banner",width:"100%",background:"warningBackground",position:"absolute",top:"0",onClose:()=>{n(),localStorage.setItem("dismissLicenceWarning",(0,l.W)(new Date,{days:1}).toISOString())},tooltipProps:{align:"top"},zIndex:20,children:(0,X.jsx)(M.Flex,{justifyContent:"center",alignItems:"center",width:"100%",gap:2,children:(0,X.jsxs)(M.Text,{children:["Your Netdata Enterprise On-prem License will expire in ",y(r),". Please contact your admin /"," ",(0,X.jsx)(T.A,{"data-testid":"renew",href:"mailto:billing@netdata.cloud",as:"a",cursor:"pointer",textDecoration:"underline",color:"main",children:"billing@netdata.cloud"})," ","to renew your license."]})})}):null}}}]);