define('ember-toolbars/components/toolbar-manager', ['exports', 'ember-toolbars/templates/components/toolbar-manager', 'ember-toolbars/transitions/swap-out', 'ember-toolbars/transitions/move-over', 'ember-toolbars/transitions/adapt-margin'], function (exports, _toolbarManager, _swapOut, _moveOver, _adaptMargin) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = Ember.Component.extend({
    layout: _toolbarManager.default,
    classNames: ['ember-toolbars'],
    animationDuration: 500,

    // You can set these to change the way corners are displayed. These
    // are not observed or animated.
    topLeftCornerBelongsTo: 'top',
    topRightCornerBelongsTo: 'top',
    bottomLeftCornerBelongsTo: 'bottom',
    bottomRightCornerBelongsTo: 'bottom',

    leftRules: Ember.computed('animationDuration', function () {
      var _this = this;
      return function leftRules() {
        var $elt = _this.$();
        var opts = {
          adjust: [{ element: $elt, property: 'margin-left' }],
          duration: _this.get('animationDuration')
        };

        if (_this.topLeftCornerBelongsTo !== 'top') {
          opts.adjust.push({
            element: $elt.children('.cst-top'),
            property: 'margin-left'
          });
        }

        if (_this.bottomLeftCornerBelongsTo !== 'bottom') {
          opts.adjust.push({
            element: $elt.children('.cst-bottom'),
            property: 'margin-left'
          });
        }

        this.transition(this.onInitialRender(), this.use(_adaptMargin.default, 'x', opts));
        this.transition(this.fromValue(false), this.toValue(true), this.use(_moveOver.default, 'x', 1, opts), this.reverse(_moveOver.default, 'x', -1, opts));
        this.transition(this.fromValue(true), this.toValue(true), this.use(_swapOut.default, 'x', 1, opts));
      };
    }),

    rightRules: Ember.computed('animationDuration', function () {
      var _this = this;
      return function rightRules() {
        var $elt = _this.$();
        var opts = {
          adjust: [{ element: $elt, property: 'margin-right' }],
          duration: _this.get('animationDuration')
        };

        if (_this.topRightCornerBelongsTo !== 'top') {
          opts.adjust.push({
            element: $elt.children('.cst-top'),
            property: 'margin-right'
          });
        }

        if (_this.bottomRightCornerBelongsTo !== 'bottom') {
          opts.adjust.push({
            element: $elt.children('.cst-bottom'),
            property: 'margin-right'
          });
        }

        this.transition(this.onInitialRender(), this.use(_adaptMargin.default, 'x', opts));
        this.transition(this.fromValue(true), this.toValue(false), this.use(_moveOver.default, 'x', 1, opts), this.reverse(_moveOver.default, 'x', -1, opts));
        this.transition(this.fromValue(true), this.toValue(true), this.use(_swapOut.default, 'x', -1, opts));
      };
    }),

    topRules: Ember.computed('animationDuration', function () {
      var _this = this;
      return function topRules() {
        var $elt = _this.$();
        var opts = {
          adjust: [{ element: $elt, property: 'margin-top' }],
          duration: _this.get('animationDuration')
        };

        if (_this.topLeftCornerBelongsTo !== 'left') {
          opts.adjust.push({
            element: $elt.children('.cst-left'),
            property: 'translateY'
          });
        }

        if (_this.topRightCornerBelongsTo !== 'right') {
          opts.adjust.push({
            element: $elt.children('.cst-right'),
            property: 'translateY'
          });
        }

        this.transition(this.onInitialRender(), this.use(_adaptMargin.default, 'y', opts));
        this.transition(this.fromValue(false), this.toValue(true), this.use(_moveOver.default, 'y', 1, opts), this.reverse(_moveOver.default, 'y', -1, opts));
        this.transition(this.fromValue(true), this.toValue(true), this.use(_swapOut.default, 'y', 1, opts));
      };
    }),

    bottomRules: Ember.computed('animationDuration', function () {
      var _this = this;
      return function bottomRules() {
        var $elt = _this.$();
        var opts = {
          adjust: [{ element: $elt, property: 'margin-bottom' }],
          duration: _this.get('animationDuration')
        };

        if (_this.bottomLeftCornerBelongsTo !== 'left') {
          opts.adjust.push({
            element: $elt.children('.cst-left'),
            property: 'bottom'
          });
        }

        if (_this.bottomRightCornerBelongsTo !== 'right') {
          opts.adjust.push({
            element: $elt.children('.cst-right'),
            property: 'bottom'
          });
        }

        this.transition(this.onInitialRender(), this.use(_adaptMargin.default, 'y', opts));
        this.transition(this.fromValue(true), this.toValue(false), this.use(_moveOver.default, 'y', 1, opts), this.reverse(_moveOver.default, 'y', -1, opts));
        this.transition(this.fromValue(true), this.toValue(true), this.use(_swapOut.default, 'y', -1, opts));
      };
    })

  });
});