import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _nodeViewRenderers;
var _excluded = ["node"],
  _excluded2 = ["node"],
  _excluded3 = ["node"],
  _excluded4 = ["node"],
  _excluded5 = ["node"],
  _excluded6 = ["node"];
import loadable from "@loadable/component";
import React, { useMemo } from "react";
import { Node_Type } from "./../../../ricos-types/index.js";
var TableRenderer = function TableRenderer(_ref) {
  var node = _ref.node,
    props = _objectWithoutPropertiesLoose(_ref, _excluded);
  var Table = useMemo(function () {
    return loadable({
      resolved: {},
      chunkName: function chunkName() {
        return "ricos_plugin_table";
      },
      isReady: function isReady(props) {
        var key = this.resolve(props);
        if (this.resolved[key] !== true) {
          return false;
        }
        if (typeof __webpack_modules__ !== 'undefined') {
          return !!__webpack_modules__[key];
        }
        return false;
      },
      importAsync: function importAsync() {
        return import(/* webpackChunkName: "ricos_plugin_table" */"../table-loadable.js");
      },
      requireAsync: function requireAsync(props) {
        var _this = this;
        var key = this.resolve(props);
        this.resolved[key] = false;
        return this.importAsync(props).then(function (resolved) {
          _this.resolved[key] = true;
          return resolved;
        });
      },
      requireSync: function requireSync(props) {
        var id = this.resolve(props);
        if (typeof __webpack_require__ !== 'undefined') {
          return __webpack_require__(id);
        }
        return eval('module.require')(id);
      },
      resolve: function resolve() {
        if (require.resolveWeak) {
          return require.resolveWeak("../table-loadable.js");
        }
        return eval('require.resolve')("../table-loadable.js");
      }
    });
  }, []);
  return /* @__PURE__ */React.createElement(Table, _extends({
    key: node.id,
    node: node
  }, props));
};
var TableLoadable = function TableLoadable(_ref2) {
  var node = _ref2.node,
    props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
  return /* @__PURE__ */React.createElement(TableRenderer, _extends({
    key: node.id,
    node: node
  }, props));
};
var TableRowRenderer = function TableRowRenderer(_ref3) {
  var node = _ref3.node,
    props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
  var TableRow = useMemo(function () {
    return loadable({
      resolved: {},
      chunkName: function chunkName() {
        return "ricos_plugin_tableRow";
      },
      isReady: function isReady(props) {
        var key = this.resolve(props);
        if (this.resolved[key] !== true) {
          return false;
        }
        if (typeof __webpack_modules__ !== 'undefined') {
          return !!__webpack_modules__[key];
        }
        return false;
      },
      importAsync: function importAsync() {
        return import(/* webpackChunkName: "ricos_plugin_tableRow" */"../table-row-loadable.js");
      },
      requireAsync: function requireAsync(props) {
        var _this = this;
        var key = this.resolve(props);
        this.resolved[key] = false;
        return this.importAsync(props).then(function (resolved) {
          _this.resolved[key] = true;
          return resolved;
        });
      },
      requireSync: function requireSync(props) {
        var id = this.resolve(props);
        if (typeof __webpack_require__ !== 'undefined') {
          return __webpack_require__(id);
        }
        return eval('module.require')(id);
      },
      resolve: function resolve() {
        if (require.resolveWeak) {
          return require.resolveWeak("../table-row-loadable.js");
        }
        return eval('require.resolve')("../table-row-loadable.js");
      }
    });
  }, []);
  return /* @__PURE__ */React.createElement(TableRow, _extends({
    key: node.id,
    node: node
  }, props));
};
var TableRowLoadable = function TableRowLoadable(_ref4) {
  var node = _ref4.node,
    props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
  return /* @__PURE__ */React.createElement(TableRowRenderer, _extends({
    key: node.id,
    node: node
  }, props));
};
var TableCellRenderer = function TableCellRenderer(_ref5) {
  var node = _ref5.node,
    props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
  var TableCell = useMemo(function () {
    return loadable({
      resolved: {},
      chunkName: function chunkName() {
        return "ricos_plugin_tableCell";
      },
      isReady: function isReady(props) {
        var key = this.resolve(props);
        if (this.resolved[key] !== true) {
          return false;
        }
        if (typeof __webpack_modules__ !== 'undefined') {
          return !!__webpack_modules__[key];
        }
        return false;
      },
      importAsync: function importAsync() {
        return import(/* webpackChunkName: "ricos_plugin_tableCell" */"../table-cell-loadable.js");
      },
      requireAsync: function requireAsync(props) {
        var _this = this;
        var key = this.resolve(props);
        this.resolved[key] = false;
        return this.importAsync(props).then(function (resolved) {
          _this.resolved[key] = true;
          return resolved;
        });
      },
      requireSync: function requireSync(props) {
        var id = this.resolve(props);
        if (typeof __webpack_require__ !== 'undefined') {
          return __webpack_require__(id);
        }
        return eval('module.require')(id);
      },
      resolve: function resolve() {
        if (require.resolveWeak) {
          return require.resolveWeak("../table-cell-loadable.js");
        }
        return eval('require.resolve')("../table-cell-loadable.js");
      }
    });
  }, []);
  return /* @__PURE__ */React.createElement(TableCell, _extends({
    key: node.id,
    node: node
  }, props));
};
var TableCellLoadable = function TableCellLoadable(_ref6) {
  var node = _ref6.node,
    props = _objectWithoutPropertiesLoose(_ref6, _excluded6);
  return /* @__PURE__ */React.createElement(TableCellRenderer, _extends({
    key: node.id,
    node: node
  }, props));
};
var nodeViewRenderers = (_nodeViewRenderers = {}, _nodeViewRenderers[Node_Type.TABLE] = TableLoadable, _nodeViewRenderers[Node_Type.TABLE_ROW] = TableRowLoadable, _nodeViewRenderers[Node_Type.TABLE_CELL] = TableCellLoadable, _nodeViewRenderers);
export { nodeViewRenderers };