try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},l=(new e.Error).stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="6d38b7f4-ee78-420f-ac90-0d2642561f1b",e._sentryDebugIdIdentifier="sentry-dbid-6d38b7f4-ee78-420f-ac90-0d2642561f1b")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"bbf0f036d26e8d5cdf711f08d224a9283a4dee0b"}}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[4484],{14484:(e,l,n)=>{n.r(l),n.d(l,{default:()=>w});var t=n(96540),i=n(63766),o=n(46587),s=n(43891),a=n(71282),r=n(42711),d=n(74848);const c=e=>{let{daysRemaining:l,onOptOutClick:n,isFailure:t}=e;return(0,d.jsx)(i.Flex,{column:!0,gap:4,width:{max:120},padding:[0,0,4,0],children:t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.TextBigger,{children:"Enrolment to 14-day free Business trial failed."}),(0,d.jsx)(i.TextBigger,{lineHeight:1.5,children:"Something unexpected happened when trying to enrol you to the free Business trial."})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(i.TextBigger,{lineHeight:1.5,strong:!0,children:["Enjoy ",l," days of all premium features \u2014 completely free!"]}),(0,d.jsxs)(i.TextBigger,{lineHeight:1.5,children:["After your trial ends, your space will"," ",(0,d.jsx)(i.TextBigger,{lineHeight:1.5,strong:!0,children:"automatically switch back to the Free Community plan. No credit card. No auto-charges."})]}),(0,d.jsx)(i.TextBigger,{lineHeight:1.5,children:"Happy monitoring!"}),"function"===typeof n&&(0,d.jsx)(r.A,{onOptOutClick:n})]})})};var u=n(6304),f=n(94404),g=n(60908),h=n(10444),p=n(10853),m=n(68399),y=n(53142),x=n(18739),b=n(24285);const j=(0,f.A)(i.Button),w=(0,t.memo)((()=>{const{trialWelcomeVisible:e,daysRemaining:l}=(0,p.A)(),n=(0,h.J)(),r=(0,o.uW)("email"),[f,,,w]=(0,u.A)(!0),[T,,C]=(0,u.A)(),{isFailure:_,reset:k}=(0,y.A)(),[A,,B,E]=(0,u.A)(),{refreshPlan:I}=(0,p.A)(),[,M]=(0,b.ng)("trialModalDismissed"),F=(0,x.i5)(),P=(0,t.useCallback)((()=>{B(),F({email:r}).then((()=>{setTimeout((()=>{I(),k(),E()}),2e3)})).catch((()=>{E()}))}),[r]),H=(0,t.useMemo)((()=>_?{feature:"CloseTrialEnrolmentErrorModal",label:"Close",flavour:"hollow"}:{feature:"TrialAccept",label:"OK",textTransform:"uppercase",flavour:"hollow",icon:"thumb_up"}),[_]);return e?T?(0,d.jsx)(a.A,{onDecline:C,onCancellingEnd:()=>{localStorage.setItem(m.$B,!0),C(),w()}}):f?(0,d.jsx)(i.Modal,{backdropProps:{backdropBlur:!0},children:(0,d.jsx)(g.Ay,{feature:"TrialWelcome",children:(0,d.jsxs)(s.P,{isMobile:n,children:[(0,d.jsx)(i.ModalHeader,{children:(0,d.jsxs)(i.Flex,{gap:2,alignItems:"center",children:[(0,d.jsx)(i.Icon,{name:"netdataPress",color:"text"}),(0,d.jsx)(i.H4,{children:"Welcome to Netdata!"})]})}),(0,d.jsx)(i.ModalBody,{children:(0,d.jsx)(c,{daysRemaining:l,isFailure:_})}),(0,d.jsx)(i.ModalFooter,{children:(0,d.jsxs)(i.Flex,{gap:4,justifyContent:"end",padding:[1,2],children:[_&&(0,d.jsx)(j,{feature:"RetryTrialEnrolment",label:"Retry",onClick:P,disabled:A,isLoading:A}),(0,d.jsx)(j,{onClick:()=>{w(),k(),localStorage.setItem(m.$B,!0),!_&&window.posthog?.setPersonProperties&&window.posthog?.setPersonProperties({netdata_cloud_trial_modal_seen:!0}),M(!0)},disabled:A,...H})]})})]})})}):null:null}))},43891:(e,l,n)=>{n.d(l,{K:()=>o,P:()=>s});var t=n(33185),i=n(63766);const o=t.default.ul.withConfig({displayName:"styled__StyledList",componentId:"sc-z791f1-0"})(["list-style:disc outside none;margin-left:16px;"]),s=(0,t.default)(i.ModalContent).attrs((e=>{let{isMobile:l}=e;return{width:l?{base:"95vw"}:{}}})).withConfig({displayName:"styled__TrialWelcomeModalContent",componentId:"sc-z791f1-1"})([""])}}]);