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