/*
 * angular-confirm
 * https://github.com/Schlogen/angular-confirm
 * @version v1.2.1 - 2015-11-18
 * @license Apache
 */
/* commonjs package manager support (eg componentjs) */
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports) {
  module.exports = "angular-confirm";
}
(function(angular) {
angular.module('angular-confirm', ['ui.bootstrap.modal'])
  .controller('ConfirmModalController', function ($scope, $uibModalInstance, data) {
    $scope.data = angular.copy(data);

    $scope.ok = function () {
      $uibModalInstance.close();
    };

    $scope.cancel = function () {
      $uibModalInstance.dismiss('cancel');
    };

  })
  .value('$confirmModalDefaults', {
    template: '<div class="modal-header"><h3 class="modal-title">{{data.title}}</h3></div>' +
    '<div class="modal-body">{{data.text}}</div>' +
    '<div class="modal-footer">' +
    '<button class="btn btn-primary" ng-click="ok()">{{data.ok}}</button>' +
    '<button class="btn btn-default" ng-click="cancel()">{{data.cancel}}</button>' +
    '</div>',
    controller: 'ConfirmModalController',
    defaultLabels: {
      title: 'Confirm',
      ok: 'OK',
      cancel: 'Cancel'
    }
  })
  .factory('$confirm', function ($uibModal, $confirmModalDefaults) {
    return function (data, settings) {
      var defaults = angular.copy($confirmModalDefaults);
      settings = angular.extend(defaults, (settings || {}));
      
      data = angular.extend({}, settings.defaultLabels, data || {});

      if ('templateUrl' in settings && 'template' in settings) {
        delete settings.template;
      }

      settings.resolve = {
        data: function () {
          return data;
        }
      };

      return $uibModal.open(settings).result;
    };
  })
  .directive('confirm', function ($confirm) {
    return {
      priority: 1,
      restrict: 'A',
      scope: {
        confirmIf: "=",
        ngClick: '&',
        confirm: '@',
        confirmSettings: "=",
        confirmTitle: '@',
        confirmOk: '@',
        confirmCancel: '@'
      },
      link: function (scope, element, attrs) {

        element.unbind("click").bind("click", function ($event) {

          $event.preventDefault();

          if (angular.isUndefined(scope.confirmIf) || scope.confirmIf) {

            var data = {text: scope.confirm};
            if (scope.confirmTitle) {
              data.title = scope.confirmTitle;
            }
            if (scope.confirmOk) {
              data.ok = scope.confirmOk;
            }
            if (scope.confirmCancel) {
              data.cancel = scope.confirmCancel;
            }
            $confirm(data, scope.confirmSettings || {}).then(scope.ngClick);
          } else {

            scope.$apply(scope.ngClick);
          }
        });

      }
    }
  });
})(angular);
@@ -121,64 +121,192 @@
  */%0A
-/* commonjs package manager support (eg componentjs) */%0A
+(function (root, factory) %7B%0A  'use strict';%0A  if (typeof define === 'function' && define.amd) %7B%0A    // AMD. Register as an anonymous module.%0A    define(%5B'angular'%5D, factory);%0A  %7D else 
 if (
@@ -319,25 +319,25 @@
  module !== 
-%22
+'
 undefined%22 &
@@ -329,25 +329,25 @@
 = 'undefined
-%22
+'
  && typeof e
@@ -345,24 +345,31 @@
  typeof 
+module.
 exports 
 !== %22und
@@ -364,106 +364,407 @@
 rts 
-!== %22undefined%22 && module.exports === exports) %7B%0A  module.exports = %22angular-confirm%22;%0A%7D%0A(
+=== 'object') %7B%0A    // CommonJS support (for us webpack/browserify/ComponentJS folks)%0A    module.exports = factory(require('angular'));%0A  %7D else %7B%0A    // in the case of no module loading system%0A    // then don't worry about creating a global%0A    // variable like you would in normal UMD.%0A    // It's not really helpful... Just call your factory%0A    return factory(root.angular);%0A  %7D%0A%7D(this, 
 function
 (ang
@@ -759,16 +759,17 @@
 function
+ 
 (angular
@@ -3259,18 +3259,10 @@
   %7D);%0A%7D)
-(angular
 );

use improved module loading wrapper