"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.PolygonProvider = exports.PolygonObj = exports.PolygonContext = void 0;
var _react = _interopRequireWildcard(require("react"));
var _uuid = require("uuid");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var PolygonContext = /*#__PURE__*/_react["default"].createContext();
exports.PolygonContext = PolygonContext;
var PolygonObj = function PolygonObj() {
  return (0, _react.useContext)(PolygonContext);
};
exports.PolygonObj = PolygonObj;
var PolygonProvider = function PolygonProvider(_ref) {
  var children = _ref.children,
    woqlClient = _ref.woqlClient,
    newQueryPanelQuery = _ref.newQueryPanelQuery;
  // the only action that have to trigger an update is add polygon 
  var addPolygon = function addPolygon() {
    /*const obj = new PanelQueryObj(uuidv4())
    obj.updateEditorProps('query', query)
    if(query){
    		let js = query.prettyPrint()
    		obj.updateEditorProps('text', js)
    }
    queryPaneList[obj.id] = obj 
    setUpdateList(Date.now())*/
  };
  return /*#__PURE__*/_react["default"].createElement(PolygonContext.Provider, {
    value: {
      addPolygon: addPolygon
    }
  }, children);
};
exports.PolygonProvider = PolygonProvider;