import y from "./index-extends.js";
import d from "./index-asyncToGenerator.js";
import s from "./index-defineProperty.js";
import f, { forwardRef as P, Component as x } from "react";
import C from "./index-getCurrentHref.js";
import v from "./index-clearUndefinedProperties.js";
import R from "./index-Process.js";
class u extends x {
  constructor(...t) {
    var e;
    super(...t), e = this, s(
      this,
      "handleClick",
      /* @__PURE__ */ (function() {
        var n = d(function* (r) {
          r.preventDefault();
          const {
            handleProcess: o
          } = e.props;
          return o(
            /* @__PURE__ */ (function() {
              var p = d(function* (i) {
                const {
                  href: c = C(),
                  display: l,
                  appId: m = i.getAppId(),
                  hashtag: h,
                  redirectURI: _,
                  quote: g,
                  mobileIframe: I
                } = e.props;
                return i.ui(v({
                  method: "share",
                  href: c,
                  display: l,
                  app_id: m,
                  hashtag: h,
                  redirect_uri: _,
                  quote: g,
                  mobile_iframe: I
                }));
              });
              return function(i) {
                return p.apply(this, arguments);
              };
            })()
          );
        });
        return function(r) {
          return n.apply(this, arguments);
        };
      })()
    );
  }
  render() {
    const {
      children: t,
      loading: e,
      error: n,
      data: r
    } = this.props;
    return t({
      loading: e,
      handleClick: this.handleClick,
      error: n,
      data: r
    });
  }
}
s(u, "defaultProps", {
  href: void 0,
  hashtag: void 0,
  quote: void 0,
  mobileIframe: void 0,
  display: void 0,
  appId: void 0,
  redirectURI: void 0
});
const A = P((a, t) => f.createElement(R, null, ({
  loading: e,
  handleProcess: n,
  data: r,
  error: o
}) => f.createElement(u, y({}, a, {
  loading: e,
  handleProcess: n,
  data: r,
  error: o,
  ref: t
}))));
export {
  A as default
};
