import{__rest as o,__assign as s}from'./../../../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as i}from"react/jsx-runtime";import c from"moment-timezone";import{Tooltip as n}from"@material-ui/core";import e from"classnames";import{RightSmallIcon as m}from"../../../../icons/iconParkIcons.js";import"../../../../icons/customIcons/icons/AddMessage.js";import"../../../../icons/customIcons/icons/Attention.js";import"../../../../icons/customIcons/icons/Collapse.js";import"../../../../icons/customIcons/icons/Dashboard.js";import"../../../../icons/customIcons/icons/Expand.js";import"../../../../icons/customIcons/icons/FolderClosed.js";import"../../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../../icons/customIcons/icons/FolderOpened.js";import"../../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../../icons/customIcons/icons/LessOrEqual.js";import"../../../../icons/customIcons/icons/Search.js";import"../../../../icons/customIcons/icons/Wellhub.js";import"../../../../icons/customIcons/icons/MultiRuler.js";import"../../../../icons/customIcons/icons/Checkbox.js";import"../../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../../icons/customIcons/icons/Radio.js";import"../../../../icons/customIcons/icons/RadioChecked.js";import"../../../../icons/customIcons/icons/SimulFrac.js";import"../../../../icons/customIcons/icons/ZipperFrac.js";import"../../../../icons/customIcons/icons/CautionFilled.js";import"../../../../icons/customIcons/icons/MoreApp.js";import r from"../Button/index.js";import{LiveButtonState as a}from"./constants.js";export{LiveButtonState}from"./constants.js";import{LiveButtonStateIndicator as l}from"./components/LiveButtonStateIndicator/index.js";import{useStyles as p}from"./styles.js";var u=function(o,s){return o===a.Default?"Go to Live data":o===a.Live?"Data receiving in real-time":i("div",{children:["Asset isn't Live",t("br",{}),s&&"Last active: ".concat(c(s).format("MMM D YYYY, hh:mm A"))]})},d=function(c){var d,j=c.size,I=void 0===j?"medium":j,f=c.state,v=void 0===f?a.Default:f,h=c.startIcon,b=c.children,x=void 0===b?"Live":b,A=c.className,C=c.tooltipProps,L=c.lastActiveAt,F=o(c,["size","state","startIcon","children","className","tooltipProps","lastActiveAt"]),k=p({size:I}),z=k[I],D={placement:"bottom",title:u(v,L)},M=h||t(m,{size:"small"===I?20:24});return t(n,s({},D,C,{children:i(r,s({},F,{className:e(k.root,z,(d={},d[k.liveState]=v===a.Live,d[k.offlineState]=v===a.Offline,d),A),size:I,startIcon:v===a.Default&&M},{children:[x,t(l,{state:v})]}))}))};export{d as LiveButton,u as getTooltipText};
