import{__assign as e}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsxs as t,jsx as a,Fragment as i}from"react/jsx-runtime";import{useState as o,useEffect as r,useRef as n}from"react";import s from"classnames";import{makeStyles as l}from"@material-ui/core";import p from"../../DevCenter/AppHeader/AppHeader.js";var c=300,d=400,m={appNotSubscribed:{title:"No Subscription exists for this app.",subtitle:"Contact your Corva Account rep to get access to this app."},appNotSubscribedForAsset:{title:"No Subscription exists for this asset.",subtitle:"Contact your Corva Account rep to get access to this asset."},internalAppError:{title:"App Loading Error"},appPackageWasNotFound:{title:"App package was not found",subtitle:"Please choose another version in the app settings menu or delete and add app again on your dashboard"},fracFleetWasNotFound:{title:"Frac fleet was not found"},fracFleetHasNoPad:{title:"Frac fleet has no active pad"},padHasNoWells:{title:"This pad has no wells"},appComponentWasNotFound:{title:"App component was not found"},noAssetData:{title:"No asset data found"},assetNotAvailable:{title:"Asset unavailable"}},u={empty:"empty",error:"error",noData:"noData",noSubscription:"noSubscription"},f={empty:"/static/media/e607e3aa0a4603bb7ae7f83a2148511e.svg",error:"/static/media/9b185a425ea91b6c2beedfef39c06663.svg",noData:"/static/media/1bfc6e5d9cbb531a554ab8d025fa23e9.svg",noSubscription:"/static/media/76e3ee12638391cba164716321509ad7.svg"},g=l((function(e){var t=e.palette;return{wrapper:{display:"flex",flexDirection:"column",textAlign:"center",alignItems:"center",justifyContent:"center",height:"100%",padding:24,overflow:"auto"},title:{color:t.primary.text7,fontSize:32,lineHeight:"38px",marginBottom:8,"&.medium":{fontSize:24,lineHeight:"28px"},"&.small":{fontSize:24,lineHeight:"28px"},fontStyle:"italic"},subtitle:{color:t.primary.text6,fontSize:16,lineHeight:"22px",marginBottom:24,"&.medium":{fontSize:14,lineHeight:"20px"},"&.small":{fontSize:14,lineHeight:"20px"}},imageWrapper:{display:"flex",flexGrow:1,maxWidth:390,maxHeight:300,width:"100%","&.medium":{maxidth:260,maxHeight:200}},backgroundImage:{width:"100%",backgroundImage:function(e){return"url(".concat([f[e.state]],")")},backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain"},appHeader:{display:"flex",padding:"12px",flexWrap:"wrap",justifyContent:"space-between"},container:{height:"100%",flexDirection:"column",display:"flex"}}})),b=function(l){var c=l.title,d=l.subtitle,m=void 0===d?"":d,u=l.state,f=void 0===u?"empty":u,b=l.withAppHeader,h=void 0!==b&&b,v=l.app,x=l.actions,S=void 0===x?null:x,A=g({state:f}),y=o(!1),H=y[0],N=y[1];r((function(){N(!0)}),[]);var w=n(null),k=w.current,C=(null==k?void 0:k.offsetHeight)<300,E=(null==k?void 0:k.offsetHeight)<400;return t("div",e({className:A.container},{children:[h&&a(p,{app:v,classes:{appHeader:A.appHeader}}),a("div",e({className:A.wrapper,ref:w},{children:H&&t(i,{children:[a("div",e({"data-testid":"".concat("EmptyAppView","_title"),className:s(A.title,E&&"medium",C&&"small")},{children:c})),S,m&&a("div",e({"data-testid":"".concat("EmptyAppView","_subtitle"),className:s(A.subtitle,E&&"medium",C&&"small")},{children:m})),!C&&a("div",e({className:s(A.imageWrapper,E&&"medium")},{children:a("div",{className:A.backgroundImage})}))]})}))]}))};b.APP_MESSAGES=m,b.EMPTY_STATES=u;export{m as APP_MESSAGES,u as EMPTY_STATES,d as HEIGHT_MEDIUM_BREAKPOINT,c as HEIGHT_SMALL_BREAKPOINT,b as default};
