import React__default, { useEffect } from 'react';
import PropTypes from 'prop-types';
import { HelmetProvider, Helmet } from 'react-helmet-async';

/* eslint-disable jsx-a11y/anchor-is-valid */
/* eslint-disable no-script-url */
/* eslint-disable no-underscore-dangle */
/* eslint-disable func-names */

var defaultProps = {
  lang: 'en'
};
var propTypes = {
  /** Walkme path */
  path: PropTypes.string.isRequired,
  /** Language code */
  lang: PropTypes.string
};
var Walkme = function Walkme(_ref) {
  var path = _ref.path,
    lang = _ref.lang;
  useEffect(function () {
    window._walkmeConfig = {
      smartLoad: true
    };
  }, []);
  useEffect(function () {
    window.walkme_get_language = function () {
      return lang === 'en' ? '' : lang;
    };
  }, [lang]);
  return /*#__PURE__*/React__default.createElement(HelmetProvider, null, /*#__PURE__*/React__default.createElement(Helmet, null, /*#__PURE__*/React__default.createElement("script", {
    type: "text/javascript",
    src: path
  })));
};
Walkme.defaultProps = defaultProps;
Walkme.propTypes = propTypes;
Walkme.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "Walkme",
  "props": {
    "lang": {
      "defaultValue": {
        "value": "'en'",
        "computed": false
      },
      "description": "Language code",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "path": {
      "description": "Walkme path",
      "type": {
        "name": "string"
      },
      "required": true
    }
  }
};
var Walkme$1 = Walkme;

export { Walkme$1 as default };
