import angular from 'angular';
import angularSvgRoundProgressBar from 'angular-svg-round-progressbar';
import 'angularjs-datepicker';

// Polyfills for ES6 stuff required by autonumeric 4.
// Really these should be peer deps. But until we are
// no longer consumed using bower we have to make sure
// our bundle includes the functionality.
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es7/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';
import 'core-js/es6/promise';
import 'core-js/fn/promise/finally';

import './index.scss';

import filterModule from './filters';
import formModule from './form';
import formattingModule from './formatting';
import layoutModule from './layout';
import progressCheckmarkModule from './progress-checkmark';
import twoPartAllocationBarModule from './two-part-allocation-bar';
import translationsModule from './translations';
import signaturePad from './signature-pad';
import cardLoadingIndicator from './card-loading-indicator';
import expander from './expander';
import carousel from './carousel';

const injectorName = 'ws.common';
export default injectorName;

angular.module(injectorName, [
  'ngAnimate',
  'pascalprecht.translate',
  '720kb.datepicker',
  angularSvgRoundProgressBar,
  translationsModule,
  filterModule,
  formModule,
  formattingModule,
  layoutModule,
  progressCheckmarkModule,
  twoPartAllocationBarModule,
  signaturePad,
  cardLoadingIndicator,
  expander,
  carousel,
])
.config(WsCommonModuleConfig);

WsCommonModuleConfig.$inject = ['$translateProvider'];
function WsCommonModuleConfig($translateProvider) {
  $translateProvider.preferredLanguage('en_CA');
  $translateProvider.useSanitizeValueStrategy('escapeParameters');
}
