System.register(['../graphics.js'], function (_export, _context) {
  "use strict";

  var pt, rect;
  function setPosition(node, pos) {
    return lively.setPosition(node, pos);
  }

  _export('setPosition', setPosition);

  function getPosition(node) {
    return lively.getPosition(node);
  }

  _export('getPosition', getPosition);

  function getExtent(node) {
    var bounds = node.getBoundingClientRect();
    return _recorder_._src_client_morphic_node_helpers_js.pt(bounds.width, bounds.height);
  }

  _export('getExtent', getExtent);

  function setExtent(node, extent) {
    node.style.width = '' + extent.x + 'px';
    node.style.height = '' + extent.y + 'px';
  }

  _export('setExtent', setExtent);

  function getBounds(node) {
    var pos = _recorder_._src_client_morphic_node_helpers_js.getPosition(node);
    return _recorder_._src_client_morphic_node_helpers_js.rect(pos, pos.addPt(_recorder_._src_client_morphic_node_helpers_js.getExtent(node)));
  }

  _export('getBounds', getBounds);

  function globalPosition(node) {
    var left = 0;
    var top = 0;
    while (node && node !== document.body) {
      left += node.offsetLeft;
      top += node.offsetTop;
      node = node.offsetParent;
    }
    return _recorder_._src_client_morphic_node_helpers_js.pt(left, top);
  }

  _export('globalPosition', globalPosition);

  return {
    setters: [function (_graphicsJs) {
      pt = _graphicsJs.pt;
      rect = _graphicsJs.rect;
    }],
    execute: function () {
      _recorder_._src_client_morphic_node_helpers_js = _recorder_._src_client_morphic_node_helpers_js || {};
      _recorder_._src_client_morphic_node_helpers_js.globalPosition = globalPosition;
      _recorder_._src_client_morphic_node_helpers_js.getBounds = getBounds;
      _recorder_._src_client_morphic_node_helpers_js.setExtent = setExtent;
      _recorder_._src_client_morphic_node_helpers_js.getExtent = getExtent;
      _recorder_._src_client_morphic_node_helpers_js.getPosition = getPosition;
      _recorder_._src_client_morphic_node_helpers_js.setPosition = setPosition;
      _recorder_._src_client_morphic_node_helpers_js.rect = rect;
      _recorder_._src_client_morphic_node_helpers_js.pt = pt;
    }
  };
});