"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),s=require("react/jsx-runtime"),o=require("react"),n=require("classnames"),i=require("../Button/components/Button/index.js");require("moment-timezone"),require("@material-ui/core");var c=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/MoreApp.js"),require("../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js"),require("../Button/components/LiveButton/styles.js");var r=require("../Typography.js"),t=require("../Popper/Popper.js"),u=require("../IconButton/index.js"),l=require("./styles.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=a(n);exports.Hint=function(n){var a=l.useStyles(),d=o.useRef(),j=o.useState(),q=j[0],p=j[1],h=o.useState(),I=h[0],f=h[1];if(o.useEffect((function(){setTimeout((function(){return f(n.open?n.anchorEl||d.current:void 0)}),100)})),!n.anchorEl&&o.Children.count(n.children)>1)throw new Error("Hint expects a single reffable element as a child");var x=n.anchorEl?n.children:o.Children.map(n.children,(function(e){return o.isValidElement(e)?o.cloneElement(e,{ref:d}):e}));return s.jsxs(s.Fragment,{children:[x,s.jsxs(t.Popper,e.__assign({className:m.default(a.popper,n.className),transition:!0,open:!!I,anchorEl:I,placement:n.placement,modifiers:{flip:{enabled:!0},arrow:{enabled:!!q,element:q}}},{children:[s.jsx("div",{ref:p,className:a.arrow}),s.jsxs("div",e.__assign({className:a.tooltip},{children:[n.title&&s.jsx("span",e.__assign({className:m.default(a.title,n.onClose&&a.hasClose)},{children:n.title})),n.onClose&&s.jsx(u,e.__assign({onClick:n.onClose,className:a.close,size:"small"},{children:s.jsx(c.CloseIcon,{})})),n.content&&s.jsx(r.Regular14,e.__assign({className:a.content},{children:n.content})),n.onConfirm&&s.jsx(i,e.__assign({color:"inherit",className:a.button,onClick:n.onConfirm},{children:n.confirmText||"Got It"}))]}))]}))]})};
