"use strict";var W=Object.create;var a=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var D=Object.getPrototypeOf;var H=Object.prototype.hasOwnProperty;var h=(t,e)=>a(t,"name",{value:e,configurable:true});var R=(t,e)=>{for(var o in e)a(t,o,{get:e[o],enumerable:true})};var v=(t,e,o,r)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let i of k(e))if(!H.call(t,i)&&i!==o)a(t,i,{get:()=>e[i],enumerable:!(r=f(e,i))||r.enumerable})}return t};var p=(t,e,o)=>(o=t!=null?W(D(t)):{},v(e||!t||!t.__esModule?a(o,"default",{value:t,enumerable:true}):o,t));var x=t=>v(a({},"__esModule",{value:true}),t);var g=(t,e,o,r)=>{var i=r>1?void 0:r?f(e,o):e;for(var l=t.length-1,c;l>=0;l--)if(c=t[l])i=(r?c(e,o,i):c(i))||i;if(r&&i)a(e,o,i);return i};var L={};R(L,{default:()=>U});module.exports=x(L);var s=require("react/jsx-runtime");var b=require("mobx-react");var S=p(require("ms"));var w=require("react");var y=p(require("react-confetti"));var m=require("react-intl");var I=p(require("react-jss"));var T=require("react-router-dom");var u=p(require("../../ui/effects/Appear"));var C=p(require("./ServiceView"));const A=(0,m.defineMessages)({getStarted:{id:"services.getStarted",defaultMessage:"Get started"},login:{id:"services.login",defaultMessage:"Please login to use Ferdium."},serverless:{id:"services.serverless",defaultMessage:"Use Ferdium without an Account"},serverInfo:{id:"services.serverInfo",defaultMessage:"Optionally, you can change your Ferdium server by clicking the cog in the bottom left corner. If you are switching over (from one of the hosted servers) to using Ferdium without an account, please be informed that you can export your data from that server and subsequently import it using the Help menu to resurrect all your workspaces and configured services!"}});const F={confettiContainer:{position:"absolute",width:"100%",zIndex:9999,pointerEvents:"none"}};let d=class extends w.Component{confettiTimeout=null;constructor(e){super(e);this.state={showConfetti:true}}componentDidMount(){this.confettiTimeout=window.setTimeout(()=>{this.setState({showConfetti:false})},(0,S.default)("8s"))}componentWillUnmount(){if(this.confettiTimeout){clearTimeout(this.confettiTimeout)}}render(){const{services:e=[],setWebviewReference:o,detachService:r,reload:i,openSettings:l,update:c,userHasCompletedSignup:P,classes:E,isSpellcheckerEnabled:N,intl:O}=this.props;const{showConfetti:M}=this.state;return(0,s.jsxs)("div",{className:"services",children:[P&&(0,s.jsx)("div",{className:E.confettiContainer,children:(0,s.jsx)(y.default,{width:window.innerWidth,height:window.innerHeight,numberOfPieces:M?200:0})}),e.length===0&&(0,s.jsx)(u.default,{transitionName:"slideUp",children:(0,s.jsxs)("div",{className:"services__no-service",children:[(0,s.jsx)("img",{src:"./assets/images/logo-beard-only.svg",alt:"Logo",style:{maxHeight:"50vh"}}),(0,s.jsx)(u.default,{transitionName:"slideUp",children:(0,s.jsx)(T.Link,{to:"/settings/recipes",className:"button",children:O.formatMessage(A.getStarted)})})]})}),e.filter(n=>!n.isTodosService).map(n=>(0,s.jsx)(C.default,{service:n,setWebviewRef:o,detachService:r,reload:()=>i({serviceId:n.id}),edit:()=>l({path:`services/edit/${n.id}`}),enable:()=>c({serviceId:n.id,serviceData:{isEnabled:true},redirect:false}),isSpellcheckerEnabled:N},n.id))]})}};h(d,"Services");d=g([b.observer],d);var U=(0,m.injectIntl)((0,I.default)(F,{injectTheme:true})(d));
