define('@cardstack/tools/components/cs-active-composition-panel', ['exports', '@cardstack/tools/templates/components/cs-active-composition-panel', 'ember-concurrency', '@cardstack/tools/scroll-to-bounds'], function (exports, _csActiveCompositionPanel, _emberConcurrency, _scrollToBounds) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = Ember.Component.extend({
    layout: _csActiveCompositionPanel.default,
    classNames: ['cs-active-composition-panel'],

    highlightAndScrollToField: (0, _emberConcurrency.task)( /*#__PURE__*/regeneratorRuntime.mark(function _callee(field) {
      return regeneratorRuntime.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              this.get('highlightField')(field);

              if (!field) {
                _context.next = 5;
                break;
              }

              _context.next = 4;
              return (0, _emberConcurrency.timeout)(500);

            case 4:
              (0, _scrollToBounds.default)(field.bounds());

            case 5:
            case 'end':
              return _context.stop();
          }
        }
      }, _callee, this);
    })).restartable()
  });
});