/* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@uirouter/angularjs/lib-esm/angular.js": /*!*************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/angular.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ng\": () => (/* binding */ ng)\n/* harmony export */ });\n/* harmony import */ var angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! angular */ \"./node_modules/angular/index.js\");\n/* harmony import */ var angular__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(angular__WEBPACK_IMPORTED_MODULE_0__);\n/** @publicapi @module ng1 */ /** */\r\n\r\n/** @hidden */ var ng_from_global = angular;\r\n/** @hidden */ var ng = angular__WEBPACK_IMPORTED_MODULE_0__ && angular__WEBPACK_IMPORTED_MODULE_0__.module ? angular__WEBPACK_IMPORTED_MODULE_0__ : ng_from_global;\r\n//# sourceMappingURL=angular.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/angular.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js": /*!********************************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js ***! \********************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../angular */ \"./node_modules/@uirouter/angularjs/lib-esm/angular.js\");\n/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @uirouter/core */ \"./node_modules/@uirouter/core/lib-esm/index.js\");\n/* eslint-disable @typescript-eslint/no-empty-interface */\r\n/* eslint-disable prefer-const */\r\n/**\r\n * # Angular 1 Directives\r\n *\r\n * These are the directives included in UI-Router for Angular 1.\r\n * These directives are used in templates to create viewports and link/navigate to states.\r\n *\r\n * @preferred @publicapi @module directives\r\n */ /** */\r\n\r\n\r\n/** @hidden */\r\nfunction parseStateRef(ref) {\r\n var paramsOnly = ref.match(/^\\s*({[^}]*})\\s*$/);\r\n if (paramsOnly)\r\n ref = '(' + paramsOnly[1] + ')';\r\n var parsed = ref.replace(/\\n/g, ' ').match(/^\\s*([^(]*?)\\s*(\\((.*)\\))?\\s*$/);\r\n if (!parsed || parsed.length !== 4)\r\n throw new Error(\"Invalid state ref '\" + ref + \"'\");\r\n return { state: parsed[1] || null, paramExpr: parsed[3] || null };\r\n}\r\n/** @hidden */\r\nfunction stateContext(el) {\r\n var $uiView = el.parent().inheritedData('$uiView');\r\n var path = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.parse)('$cfg.path')($uiView);\r\n return path ? (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.tail)(path).state.name : undefined;\r\n}\r\n/** @hidden */\r\nfunction processedDef($state, $element, def) {\r\n var uiState = def.uiState || $state.current.name;\r\n var uiStateOpts = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.extend)(defaultOpts($element, $state), def.uiStateOpts || {});\r\n var href = $state.href(uiState, def.uiStateParams, uiStateOpts);\r\n return { uiState: uiState, uiStateParams: def.uiStateParams, uiStateOpts: uiStateOpts, href: href };\r\n}\r\n/** @hidden */\r\nfunction getTypeInfo(el) {\r\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\r\n var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';\r\n var isForm = el[0].nodeName === 'FORM';\r\n return {\r\n attr: isForm ? 'action' : isSvg ? 'xlink:href' : 'href',\r\n isAnchor: el.prop('tagName').toUpperCase() === 'A',\r\n clickable: !isForm,\r\n };\r\n}\r\n/** @hidden */\r\nfunction clickHook(el, $state, $timeout, type, getDef) {\r\n return function (e) {\r\n var button = e.which || e.button, target = getDef();\r\n if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || el.attr('target'))) {\r\n // HACK: This is to allow ng-clicks to be processed before the transition is initiated:\r\n var transition_1 = $timeout(function () {\r\n if (!el.attr('disabled')) {\r\n $state.go(target.uiState, target.uiStateParams, target.uiStateOpts);\r\n }\r\n });\r\n e.preventDefault();\r\n // if the state has no URL, ignore one preventDefault from the directive.\r\n var ignorePreventDefaultCount_1 = type.isAnchor && !target.href ? 1 : 0;\r\n e.preventDefault = function () {\r\n if (ignorePreventDefaultCount_1-- <= 0)\r\n $timeout.cancel(transition_1);\r\n };\r\n }\r\n };\r\n}\r\n/** @hidden */\r\nfunction defaultOpts(el, $state) {\r\n return {\r\n relative: stateContext(el) || $state.$current,\r\n inherit: true,\r\n source: 'sref',\r\n };\r\n}\r\n/** @hidden */\r\nfunction bindEvents(element, scope, hookFn, uiStateOpts) {\r\n var events;\r\n if (uiStateOpts) {\r\n events = uiStateOpts.events;\r\n }\r\n if (!(0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(events)) {\r\n events = ['click'];\r\n }\r\n var on = element.on ? 'on' : 'bind';\r\n for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {\r\n var event_1 = events_1[_i];\r\n element[on](event_1, hookFn);\r\n }\r\n scope.$on('$destroy', function () {\r\n var off = element.off ? 'off' : 'unbind';\r\n for (var _i = 0, events_2 = events; _i < events_2.length; _i++) {\r\n var event_2 = events_2[_i];\r\n element[off](event_2, hookFn);\r\n }\r\n });\r\n}\r\n/**\r\n * `ui-sref`: A directive for linking to a state\r\n *\r\n * A directive which links to a state (and optionally, parameters).\r\n * When clicked, this directive activates the linked state with the supplied parameter values.\r\n *\r\n * ### Linked State\r\n * The attribute value of the `ui-sref` is the name of the state to link to.\r\n *\r\n * #### Example:\r\n * This will activate the `home` state when the link is clicked.\r\n * ```html\r\n * Home\r\n * ```\r\n *\r\n * ### Relative Links\r\n * You can also use relative state paths within `ui-sref`, just like a relative path passed to `$state.go()` ([[StateService.go]]).\r\n * You just need to be aware that the path is relative to the state that *created* the link.\r\n * This allows a state to create a relative `ui-sref` which always targets the same destination.\r\n *\r\n * #### Example:\r\n * Both these links are relative to the parent state, even when a child state is currently active.\r\n * ```html\r\n * child 1 state\r\n * child 2 state\r\n * ```\r\n *\r\n * This link activates the parent state.\r\n * ```html\r\n * Return\r\n * ```\r\n *\r\n * ### hrefs\r\n * If the linked state has a URL, the directive will automatically generate and\r\n * update the `href` attribute (using the [[StateService.href]] method).\r\n *\r\n * #### Example:\r\n * Assuming the `users` state has a url of `/users/`\r\n * ```html\r\n * Users\r\n * ```\r\n *\r\n * ### Parameter Values\r\n * In addition to the state name, a `ui-sref` can include parameter values which are applied when activating the state.\r\n * Param values can be provided in the `ui-sref` value after the state name, enclosed by parentheses.\r\n * The content inside the parentheses is an expression, evaluated to the parameter values.\r\n *\r\n * #### Example:\r\n * This example renders a list of links to users.\r\n * The state's `userId` parameter value comes from each user's `user.id` property.\r\n * ```html\r\n *
  • \r\n * {{ user.displayName }}\r\n *
  • \r\n * ```\r\n *\r\n * Note:\r\n * The parameter values expression is `$watch`ed for updates.\r\n *\r\n * ### Transition Options\r\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute.\r\n * Options are restricted to `location`, `inherit`, and `reload`.\r\n *\r\n * #### Example:\r\n * ```html\r\n * Home\r\n * ```\r\n *\r\n * ### Other DOM Events\r\n *\r\n * You can also customize which DOM events to respond to (instead of `click`) by\r\n * providing an `events` array in the `ui-sref-opts` attribute.\r\n *\r\n * #### Example:\r\n * ```html\r\n * \r\n * ```\r\n *\r\n * ### Highlighting the active link\r\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\r\n *\r\n * ### Examples\r\n * If you have the following template:\r\n *\r\n * ```html\r\n * Home\r\n * About\r\n * Next page\r\n *\r\n * \r\n * ```\r\n *\r\n * Then (assuming the current state is `contacts`) the rendered html including hrefs would be:\r\n *\r\n * ```html\r\n * Home\r\n * About\r\n * Next page\r\n *\r\n * \r\n *\r\n * Home\r\n * ```\r\n *\r\n * ### Notes\r\n *\r\n * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses.\r\n * #### Example:\r\n * Sets the `lang` parameter to `en` and remains on the same state.\r\n *\r\n * ```html\r\n * English\r\n * ```\r\n *\r\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\r\n *\r\n * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).\r\n * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.\r\n */\r\nvar uiSrefDirective;\r\nuiSrefDirective = [\r\n '$uiRouter',\r\n '$timeout',\r\n function $StateRefDirective($uiRouter, $timeout) {\r\n var $state = $uiRouter.stateService;\r\n return {\r\n restrict: 'A',\r\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\r\n link: function (scope, element, attrs, uiSrefActive) {\r\n var type = getTypeInfo(element);\r\n var active = uiSrefActive[1] || uiSrefActive[0];\r\n var unlinkInfoFn = null;\r\n var rawDef = {};\r\n var getDef = function () { return processedDef($state, element, rawDef); };\r\n var ref = parseStateRef(attrs.uiSref);\r\n rawDef.uiState = ref.state;\r\n rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {};\r\n function update() {\r\n var def = getDef();\r\n if (unlinkInfoFn)\r\n unlinkInfoFn();\r\n if (active)\r\n unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\r\n if (def.href != null)\r\n attrs.$set(type.attr, def.href);\r\n }\r\n if (ref.paramExpr) {\r\n scope.$watch(ref.paramExpr, function (val) {\r\n rawDef.uiStateParams = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.extend)({}, val);\r\n update();\r\n }, true);\r\n rawDef.uiStateParams = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.extend)({}, scope.$eval(ref.paramExpr));\r\n }\r\n update();\r\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\r\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\r\n if (!type.clickable)\r\n return;\r\n var hookFn = clickHook(element, $state, $timeout, type, getDef);\r\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\r\n },\r\n };\r\n },\r\n];\r\n/**\r\n * `ui-state`: A fully dynamic directive for linking to a state\r\n *\r\n * A directive which links to a state (and optionally, parameters).\r\n * When clicked, this directive activates the linked state with the supplied parameter values.\r\n *\r\n * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**\r\n *\r\n * A directive which links to a state (and optionally, parameters).\r\n * When clicked, this directive activates the linked state with the supplied parameter values.\r\n *\r\n * ### Linked State\r\n * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to.\r\n * **This is in contrast with `ui-sref`, which takes a state name as a string literal.**\r\n *\r\n * #### Example:\r\n * Create a list of links.\r\n * ```html\r\n *
  • \r\n * {{ link.displayName }}\r\n *
  • \r\n * ```\r\n *\r\n * ### Relative Links\r\n * If the expression evaluates to a relative path, it is processed like [[uiSref]].\r\n * You just need to be aware that the path is relative to the state that *created* the link.\r\n * This allows a state to create relative `ui-state` which always targets the same destination.\r\n *\r\n * ### hrefs\r\n * If the linked state has a URL, the directive will automatically generate and\r\n * update the `href` attribute (using the [[StateService.href]] method).\r\n *\r\n * ### Parameter Values\r\n * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state.\r\n * Param values should be provided using the `ui-state-params` attribute.\r\n * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression.\r\n *\r\n * #### Example:\r\n * This example renders a list of links with param values.\r\n * The state's `userId` parameter value comes from each user's `user.id` property.\r\n * ```html\r\n *
  • \r\n * {{ link.displayName }}\r\n *
  • \r\n * ```\r\n *\r\n * ### Transition Options\r\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute.\r\n * Options are restricted to `location`, `inherit`, and `reload`.\r\n * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression.\r\n *\r\n * #### Example:\r\n * ```html\r\n * Home\r\n * ```\r\n *\r\n * ### Other DOM Events\r\n *\r\n * You can also customize which DOM events to respond to (instead of `click`) by\r\n * providing an `events` array in the `ui-state-opts` attribute.\r\n *\r\n * #### Example:\r\n * ```html\r\n * \r\n * ```\r\n *\r\n * ### Highlighting the active link\r\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\r\n *\r\n * ### Notes\r\n *\r\n * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`.\r\n * However, it might be simpler to use [[uiSref]] parameter-only links.\r\n *\r\n * #### Example:\r\n * Sets the `lang` parameter to `en` and remains on the same state.\r\n *\r\n * ```html\r\n * English\r\n * ```\r\n *\r\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\r\n * ```\r\n */\r\nvar uiStateDirective;\r\nuiStateDirective = [\r\n '$uiRouter',\r\n '$timeout',\r\n function $StateRefDynamicDirective($uiRouter, $timeout) {\r\n var $state = $uiRouter.stateService;\r\n return {\r\n restrict: 'A',\r\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\r\n link: function (scope, element, attrs, uiSrefActive) {\r\n var type = getTypeInfo(element);\r\n var active = uiSrefActive[1] || uiSrefActive[0];\r\n var unlinkInfoFn = null;\r\n var hookFn;\r\n var rawDef = {};\r\n var getDef = function () { return processedDef($state, element, rawDef); };\r\n var inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts'];\r\n var watchDeregFns = inputAttrs.reduce(function (acc, attr) { return ((acc[attr] = _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.noop), acc); }, {});\r\n function update() {\r\n var def = getDef();\r\n if (unlinkInfoFn)\r\n unlinkInfoFn();\r\n if (active)\r\n unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\r\n if (def.href != null)\r\n attrs.$set(type.attr, def.href);\r\n }\r\n inputAttrs.forEach(function (field) {\r\n rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null;\r\n attrs.$observe(field, function (expr) {\r\n watchDeregFns[field]();\r\n watchDeregFns[field] = scope.$watch(expr, function (newval) {\r\n rawDef[field] = newval;\r\n update();\r\n }, true);\r\n });\r\n });\r\n update();\r\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\r\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\r\n if (!type.clickable)\r\n return;\r\n hookFn = clickHook(element, $state, $timeout, type, getDef);\r\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\r\n },\r\n };\r\n },\r\n];\r\n/**\r\n * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active\r\n *\r\n * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the\r\n * related directive's state is active (and remove them when it is inactive).\r\n *\r\n * The primary use-case is to highlight the active link in navigation menus,\r\n * distinguishing it from the inactive menu items.\r\n *\r\n * ### Linking to a `ui-sref` or `ui-state`\r\n * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element.\r\n * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**.\r\n *\r\n * ### Matching\r\n *\r\n * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**.\r\n * This is a \"fuzzy match\" which uses [[StateService.includes]].\r\n *\r\n * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active).\r\n * This is an \"exact match\" which uses [[StateService.is]].\r\n *\r\n * ### Parameter values\r\n * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.\r\n * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted.\r\n *\r\n * #### Example:\r\n * ```html\r\n *
  • \r\n * {{ user.lastName }}\r\n *
  • \r\n * ```\r\n *\r\n * ### Examples\r\n *\r\n * Given the following template:\r\n * #### Example:\r\n * ```html\r\n * \r\n * ```\r\n *\r\n * When the app state is `app.user` (or any child state),\r\n * and contains the state parameter \"user\" with value \"bilbobaggins\",\r\n * the resulting HTML will appear as (note the 'active' class):\r\n *\r\n * ```html\r\n * \r\n * ```\r\n *\r\n * ### Glob mode\r\n *\r\n * It is possible to pass `ui-sref-active` an expression that evaluates to an object.\r\n * The objects keys represent active class names and values represent the respective state names/globs.\r\n * `ui-sref-active` will match if the current active state **includes** any of\r\n * the specified state names/globs, even the abstract ones.\r\n *\r\n * #### Example:\r\n * Given the following template, with \"admin\" being an abstract state:\r\n * ```html\r\n *
    \r\n * Roles\r\n *
    \r\n * ```\r\n *\r\n * Arrays are also supported as values in the `ngClass`-like interface.\r\n * This allows multiple states to add `active` class.\r\n *\r\n * #### Example:\r\n * Given the following template, with \"admin.roles\" being the current state, the class will be added too:\r\n * ```html\r\n *
    \r\n * Roles\r\n *
    \r\n * ```\r\n *\r\n * When the current state is \"admin.roles\" the \"active\" class will be applied to both the `
    ` and `` elements.\r\n * It is important to note that the state names/globs passed to `ui-sref-active` override any state provided by a linked `ui-sref`.\r\n *\r\n * ### Notes:\r\n *\r\n * - The class name is interpolated **once** during the directives link time (any further changes to the\r\n * interpolated value are ignored).\r\n *\r\n * - Multiple classes may be specified in a space-separated format: `ui-sref-active='class1 class2 class3'`\r\n */\r\nvar uiSrefActiveDirective;\r\nuiSrefActiveDirective = [\r\n '$state',\r\n '$stateParams',\r\n '$interpolate',\r\n '$uiRouter',\r\n function $StateRefActiveDirective($state, $stateParams, $interpolate, $uiRouter) {\r\n return {\r\n restrict: 'A',\r\n controller: [\r\n '$scope',\r\n '$element',\r\n '$attrs',\r\n function ($scope, $element, $attrs) {\r\n var states = [];\r\n var activeEqClass;\r\n var uiSrefActive;\r\n // There probably isn't much point in $observing this\r\n // uiSrefActive and uiSrefActiveEq share the same directive object with some\r\n // slight difference in logic routing\r\n activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope);\r\n try {\r\n uiSrefActive = $scope.$eval($attrs.uiSrefActive);\r\n }\r\n catch (e) {\r\n // Do nothing. uiSrefActive is not a valid expression.\r\n // Fall back to using $interpolate below\r\n }\r\n uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope);\r\n setStatesFromDefinitionObject(uiSrefActive);\r\n // Allow uiSref to communicate with uiSrefActive[Equals]\r\n this.$$addStateInfo = function (newState, newParams) {\r\n // we already got an explicit state provided by ui-sref-active, so we\r\n // shadow the one that comes from ui-sref\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isObject)(uiSrefActive) && states.length > 0) {\r\n return;\r\n }\r\n var deregister = addState(newState, newParams, uiSrefActive);\r\n update();\r\n return deregister;\r\n };\r\n function updateAfterTransition(trans) {\r\n trans.promise.then(update, _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.noop);\r\n }\r\n $scope.$on('$destroy', setupEventListeners());\r\n if ($uiRouter.globals.transition) {\r\n updateAfterTransition($uiRouter.globals.transition);\r\n }\r\n function setupEventListeners() {\r\n var deregisterStatesChangedListener = $uiRouter.stateRegistry.onStatesChanged(handleStatesChanged);\r\n var deregisterOnStartListener = $uiRouter.transitionService.onStart({}, updateAfterTransition);\r\n var deregisterStateChangeSuccessListener = $scope.$on('$stateChangeSuccess', update);\r\n return function cleanUp() {\r\n deregisterStatesChangedListener();\r\n deregisterOnStartListener();\r\n deregisterStateChangeSuccessListener();\r\n };\r\n }\r\n function handleStatesChanged() {\r\n setStatesFromDefinitionObject(uiSrefActive);\r\n }\r\n function setStatesFromDefinitionObject(statesDefinition) {\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isObject)(statesDefinition)) {\r\n states = [];\r\n (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.forEach)(statesDefinition, function (stateOrName, activeClass) {\r\n // Helper function to abstract adding state.\r\n var addStateForClass = function (stateOrName, activeClass) {\r\n var ref = parseStateRef(stateOrName);\r\n addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);\r\n };\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isString)(stateOrName)) {\r\n // If state is string, just add it.\r\n addStateForClass(stateOrName, activeClass);\r\n }\r\n else if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(stateOrName)) {\r\n // If state is an array, iterate over it and add each array item individually.\r\n (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.forEach)(stateOrName, function (stateOrName) {\r\n addStateForClass(stateOrName, activeClass);\r\n });\r\n }\r\n });\r\n }\r\n }\r\n function addState(stateName, stateParams, activeClass) {\r\n var state = $state.get(stateName, stateContext($element));\r\n var stateInfo = {\r\n state: state || { name: stateName },\r\n params: stateParams,\r\n activeClass: activeClass,\r\n };\r\n states.push(stateInfo);\r\n return function removeState() {\r\n (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.removeFrom)(states)(stateInfo);\r\n };\r\n }\r\n // Update route state\r\n function update() {\r\n var splitClasses = function (str) { return str.split(/\\s/).filter(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.identity); };\r\n var getClasses = function (stateList) {\r\n return stateList\r\n .map(function (x) { return x.activeClass; })\r\n .map(splitClasses)\r\n .reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.unnestR, []);\r\n };\r\n var allClasses = getClasses(states).concat(splitClasses(activeEqClass)).reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.uniqR, []);\r\n var fuzzyClasses = getClasses(states.filter(function (x) { return $state.includes(x.state.name, x.params); }));\r\n var exactlyMatchesAny = !!states.filter(function (x) { return $state.is(x.state.name, x.params); }).length;\r\n var exactClasses = exactlyMatchesAny ? splitClasses(activeEqClass) : [];\r\n var addClasses = fuzzyClasses.concat(exactClasses).reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.uniqR, []);\r\n var removeClasses = allClasses.filter(function (cls) { return !(0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.inArray)(addClasses, cls); });\r\n $scope.$evalAsync(function () {\r\n addClasses.forEach(function (className) { return $element.addClass(className); });\r\n removeClasses.forEach(function (className) { return $element.removeClass(className); });\r\n });\r\n }\r\n update();\r\n },\r\n ],\r\n };\r\n },\r\n];\r\n_angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.state')\r\n .directive('uiSref', uiSrefDirective)\r\n .directive('uiSrefActive', uiSrefActiveDirective)\r\n .directive('uiSrefActiveEq', uiSrefActiveDirective)\r\n .directive('uiState', uiStateDirective);\r\n//# sourceMappingURL=stateDirectives.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js": /*!******************************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"uiView\": () => (/* binding */ uiView)\n/* harmony export */ });\n/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ \"./node_modules/@uirouter/core/lib-esm/index.js\");\n/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../angular */ \"./node_modules/@uirouter/angularjs/lib-esm/angular.js\");\n/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../services */ \"./node_modules/@uirouter/angularjs/lib-esm/services.js\");\n/* harmony import */ var _statebuilders_views__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../statebuilders/views */ \"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js\");\n/** @publicapi @module directives */ /** */\r\n\r\n\r\n\r\n\r\n/**\r\n * `ui-view`: A viewport directive which is filled in by a view from the active state.\r\n *\r\n * ### Attributes\r\n *\r\n * - `name`: (Optional) A view name.\r\n * The name should be unique amongst the other views in the same state.\r\n * You can have views of the same name that live in different states.\r\n * The ui-view can be targeted in a View using the name ([[Ng1StateDeclaration.views]]).\r\n *\r\n * - `autoscroll`: an expression. When it evaluates to true, the `ui-view` will be scrolled into view when it is activated.\r\n * Uses [[$uiViewScroll]] to do the scrolling.\r\n *\r\n * - `onload`: Expression to evaluate whenever the view updates.\r\n *\r\n * #### Example:\r\n * A view can be unnamed or named.\r\n * ```html\r\n * \r\n *
    \r\n *\r\n * \r\n *
    \r\n *\r\n * \r\n * \r\n * ```\r\n *\r\n * You can only have one unnamed view within any template (or root html). If you are only using a\r\n * single view and it is unnamed then you can populate it like so:\r\n *\r\n * ```html\r\n *
    \r\n * $stateProvider.state(\"home\", {\r\n * template: \"

    HELLO!

    \"\r\n * })\r\n * ```\r\n *\r\n * The above is a convenient shortcut equivalent to specifying your view explicitly with the\r\n * [[Ng1StateDeclaration.views]] config property, by name, in this case an empty name:\r\n *\r\n * ```js\r\n * $stateProvider.state(\"home\", {\r\n * views: {\r\n * \"\": {\r\n * template: \"

    HELLO!

    \"\r\n * }\r\n * }\r\n * })\r\n * ```\r\n *\r\n * But typically you'll only use the views property if you name your view or have more than one view\r\n * in the same template. There's not really a compelling reason to name a view if its the only one,\r\n * but you could if you wanted, like so:\r\n *\r\n * ```html\r\n *
    \r\n * ```\r\n *\r\n * ```js\r\n * $stateProvider.state(\"home\", {\r\n * views: {\r\n * \"main\": {\r\n * template: \"

    HELLO!

    \"\r\n * }\r\n * }\r\n * })\r\n * ```\r\n *\r\n * Really though, you'll use views to set up multiple views:\r\n *\r\n * ```html\r\n *
    \r\n *
    \r\n *
    \r\n * ```\r\n *\r\n * ```js\r\n * $stateProvider.state(\"home\", {\r\n * views: {\r\n * \"\": {\r\n * template: \"

    HELLO!

    \"\r\n * },\r\n * \"chart\": {\r\n * template: \"\"\r\n * },\r\n * \"data\": {\r\n * template: \"\"\r\n * }\r\n * }\r\n * })\r\n * ```\r\n *\r\n * #### Examples for `autoscroll`:\r\n * ```html\r\n * \r\n * \r\n *\r\n * \r\n * \r\n * \r\n * \r\n * ```\r\n *\r\n * Resolve data:\r\n *\r\n * The resolved data from the state's `resolve` block is placed on the scope as `$resolve` (this\r\n * can be customized using [[Ng1ViewDeclaration.resolveAs]]). This can be then accessed from the template.\r\n *\r\n * Note that when `controllerAs` is being used, `$resolve` is set on the controller instance *after* the\r\n * controller is instantiated. The `$onInit()` hook can be used to perform initialization code which\r\n * depends on `$resolve` data.\r\n *\r\n * #### Example:\r\n * ```js\r\n * $stateProvider.state('home', {\r\n * template: '',\r\n * resolve: {\r\n * user: function(UserService) { return UserService.fetchUser(); }\r\n * }\r\n * });\r\n * ```\r\n */\r\nvar uiView;\r\n// eslint-disable-next-line prefer-const\r\nuiView = [\r\n '$view',\r\n '$animate',\r\n '$uiViewScroll',\r\n '$interpolate',\r\n '$q',\r\n function $ViewDirective($view, $animate, $uiViewScroll, $interpolate, $q) {\r\n function getRenderer() {\r\n return {\r\n enter: function (element, target, cb) {\r\n if (_angular__WEBPACK_IMPORTED_MODULE_1__.ng.version.minor > 2) {\r\n $animate.enter(element, null, target).then(cb);\r\n }\r\n else {\r\n $animate.enter(element, null, target, cb);\r\n }\r\n },\r\n leave: function (element, cb) {\r\n if (_angular__WEBPACK_IMPORTED_MODULE_1__.ng.version.minor > 2) {\r\n $animate.leave(element).then(cb);\r\n }\r\n else {\r\n $animate.leave(element, cb);\r\n }\r\n },\r\n };\r\n }\r\n function configsEqual(config1, config2) {\r\n return config1 === config2;\r\n }\r\n var rootData = {\r\n $cfg: { viewDecl: { $context: $view._pluginapi._rootViewContext() } },\r\n $uiView: {},\r\n };\r\n var directive = {\r\n count: 0,\r\n restrict: 'ECA',\r\n terminal: true,\r\n priority: 400,\r\n transclude: 'element',\r\n compile: function (tElement, tAttrs, $transclude) {\r\n return function (scope, $element, attrs) {\r\n var onloadExp = attrs['onload'] || '', autoScrollExp = attrs['autoscroll'], renderer = getRenderer(), inherited = $element.inheritedData('$uiView') || rootData, name = $interpolate(attrs['uiView'] || attrs['name'] || '')(scope) || '$default';\r\n var previousEl, currentEl, currentScope, viewConfig;\r\n var activeUIView = {\r\n $type: 'ng1',\r\n id: directive.count++,\r\n name: name,\r\n fqn: inherited.$uiView.fqn ? inherited.$uiView.fqn + '.' + name : name,\r\n config: null,\r\n configUpdated: configUpdatedCallback,\r\n get creationContext() {\r\n // The context in which this ui-view \"tag\" was created\r\n var fromParentTagConfig = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.parse)('$cfg.viewDecl.$context')(inherited);\r\n // Allow \r\n // See https://github.com/angular-ui/ui-router/issues/3355\r\n var fromParentTag = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.parse)('$uiView.creationContext')(inherited);\r\n return fromParentTagConfig || fromParentTag;\r\n },\r\n };\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewEvent('Linking', activeUIView);\r\n function configUpdatedCallback(config) {\r\n if (config && !(config instanceof _statebuilders_views__WEBPACK_IMPORTED_MODULE_3__.Ng1ViewConfig))\r\n return;\r\n if (configsEqual(viewConfig, config))\r\n return;\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewConfigUpdated(activeUIView, config && config.viewDecl && config.viewDecl.$context);\r\n viewConfig = config;\r\n updateView(config);\r\n }\r\n $element.data('$uiView', { $uiView: activeUIView });\r\n updateView();\r\n var unregister = $view.registerUIView(activeUIView);\r\n scope.$on('$destroy', function () {\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewEvent('Destroying/Unregistering', activeUIView);\r\n unregister();\r\n });\r\n function cleanupLastView() {\r\n if (previousEl) {\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewEvent('Removing (previous) el', previousEl.data('$uiView'));\r\n previousEl.remove();\r\n previousEl = null;\r\n }\r\n if (currentScope) {\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewEvent('Destroying scope', activeUIView);\r\n currentScope.$destroy();\r\n currentScope = null;\r\n }\r\n if (currentEl) {\r\n var _viewData_1 = currentEl.data('$uiViewAnim');\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewEvent('Animate out', _viewData_1);\r\n renderer.leave(currentEl, function () {\r\n _viewData_1.$$animLeave.resolve();\r\n previousEl = null;\r\n });\r\n previousEl = currentEl;\r\n currentEl = null;\r\n }\r\n }\r\n function updateView(config) {\r\n var newScope = scope.$new();\r\n var animEnter = $q.defer(), animLeave = $q.defer();\r\n var $uiViewData = {\r\n $cfg: config,\r\n $uiView: activeUIView,\r\n };\r\n var $uiViewAnim = {\r\n $animEnter: animEnter.promise,\r\n $animLeave: animLeave.promise,\r\n $$animLeave: animLeave,\r\n };\r\n /**\r\n * @ngdoc event\r\n * @name ui.router.state.directive:ui-view#$viewContentLoading\r\n * @eventOf ui.router.state.directive:ui-view\r\n * @eventType emits on ui-view directive scope\r\n * @description\r\n *\r\n * Fired once the view **begins loading**, *before* the DOM is rendered.\r\n *\r\n * @param {Object} event Event object.\r\n * @param {string} viewName Name of the view.\r\n */\r\n newScope.$emit('$viewContentLoading', name);\r\n var cloned = $transclude(newScope, function (clone) {\r\n clone.data('$uiViewAnim', $uiViewAnim);\r\n clone.data('$uiView', $uiViewData);\r\n renderer.enter(clone, $element, function onUIViewEnter() {\r\n animEnter.resolve();\r\n if (currentScope)\r\n currentScope.$emit('$viewContentAnimationEnded');\r\n if (((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isDefined)(autoScrollExp) && !autoScrollExp) || scope.$eval(autoScrollExp)) {\r\n $uiViewScroll(clone);\r\n }\r\n });\r\n cleanupLastView();\r\n });\r\n currentEl = cloned;\r\n currentScope = newScope;\r\n /**\r\n * @ngdoc event\r\n * @name ui.router.state.directive:ui-view#$viewContentLoaded\r\n * @eventOf ui.router.state.directive:ui-view\r\n * @eventType emits on ui-view directive scope\r\n * @description *\r\n * Fired once the view is **loaded**, *after* the DOM is rendered.\r\n *\r\n * @param {Object} event Event object.\r\n */\r\n currentScope.$emit('$viewContentLoaded', config || viewConfig);\r\n currentScope.$eval(onloadExp);\r\n }\r\n };\r\n },\r\n };\r\n return directive;\r\n },\r\n];\r\n$ViewDirectiveFill.$inject = ['$compile', '$controller', '$transitions', '$view', '$q'];\r\n/** @hidden */\r\nfunction $ViewDirectiveFill($compile, $controller, $transitions, $view, $q) {\r\n var getControllerAs = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.parse)('viewDecl.controllerAs');\r\n var getResolveAs = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.parse)('viewDecl.resolveAs');\r\n return {\r\n restrict: 'ECA',\r\n priority: -400,\r\n compile: function (tElement) {\r\n var initial = tElement.html();\r\n tElement.empty();\r\n return function (scope, $element) {\r\n var data = $element.data('$uiView');\r\n if (!data) {\r\n $element.html(initial);\r\n $compile($element.contents())(scope);\r\n return;\r\n }\r\n var cfg = data.$cfg || { viewDecl: {}, getTemplate: _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.noop };\r\n var resolveCtx = cfg.path && new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.ResolveContext(cfg.path);\r\n $element.html(cfg.getTemplate($element, resolveCtx) || initial);\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceUIViewFill(data.$uiView, $element.html());\r\n var link = $compile($element.contents());\r\n var controller = cfg.controller;\r\n var controllerAs = getControllerAs(cfg);\r\n var resolveAs = getResolveAs(cfg);\r\n var locals = resolveCtx && (0,_services__WEBPACK_IMPORTED_MODULE_2__.getLocals)(resolveCtx);\r\n scope[resolveAs] = locals;\r\n if (controller) {\r\n var controllerInstance = ($controller(controller, (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.extend)({}, locals, { $scope: scope, $element: $element })));\r\n if (controllerAs) {\r\n scope[controllerAs] = controllerInstance;\r\n scope[controllerAs][resolveAs] = locals;\r\n }\r\n // TODO: Use $view service as a central point for registering component-level hooks\r\n // Then, when a component is created, tell the $view service, so it can invoke hooks\r\n // $view.componentLoaded(controllerInstance, { $scope: scope, $element: $element });\r\n // scope.$on('$destroy', () => $view.componentUnloaded(controllerInstance, { $scope: scope, $element: $element }));\r\n $element.data('$ngControllerController', controllerInstance);\r\n $element.children().data('$ngControllerController', controllerInstance);\r\n registerControllerCallbacks($q, $transitions, controllerInstance, scope, cfg);\r\n }\r\n // Wait for the component to appear in the DOM\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isString)(cfg.component)) {\r\n var kebobName = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.kebobString)(cfg.component);\r\n var tagRegexp_1 = new RegExp(\"^(x-|data-)?\" + kebobName + \"$\", 'i');\r\n var getComponentController = function () {\r\n var directiveEl = [].slice\r\n .call($element[0].children)\r\n .filter(function (el) { return el && el.tagName && tagRegexp_1.exec(el.tagName); });\r\n return directiveEl && _angular__WEBPACK_IMPORTED_MODULE_1__.ng.element(directiveEl).data(\"$\" + cfg.component + \"Controller\");\r\n };\r\n var deregisterWatch_1 = scope.$watch(getComponentController, function (ctrlInstance) {\r\n if (!ctrlInstance)\r\n return;\r\n registerControllerCallbacks($q, $transitions, ctrlInstance, scope, cfg);\r\n deregisterWatch_1();\r\n });\r\n }\r\n link(scope);\r\n };\r\n },\r\n };\r\n}\r\n/** @hidden */\r\nvar hasComponentImpl = typeof _angular__WEBPACK_IMPORTED_MODULE_1__.ng.module('ui.router')['component'] === 'function';\r\n/** @hidden incrementing id */\r\nvar _uiCanExitId = 0;\r\n/** @hidden TODO: move these callbacks to $view and/or `/hooks/components.ts` or something */\r\nfunction registerControllerCallbacks($q, $transitions, controllerInstance, $scope, cfg) {\r\n // Call $onInit() ASAP\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(controllerInstance.$onInit) &&\r\n !((cfg.viewDecl.component || cfg.viewDecl.componentProvider) && hasComponentImpl)) {\r\n controllerInstance.$onInit();\r\n }\r\n var viewState = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.tail)(cfg.path).state.self;\r\n var hookOptions = { bind: controllerInstance };\r\n // Add component-level hook for onUiParamsChanged\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(controllerInstance.uiOnParamsChanged)) {\r\n var resolveContext = new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.ResolveContext(cfg.path);\r\n var viewCreationTrans_1 = resolveContext.getResolvable('$transition$').data;\r\n // Fire callback on any successful transition\r\n var paramsUpdated = function ($transition$) {\r\n // Exit early if the $transition$ is the same as the view was created within.\r\n // Exit early if the $transition$ will exit the state the view is for.\r\n if ($transition$ === viewCreationTrans_1 || $transition$.exiting().indexOf(viewState) !== -1)\r\n return;\r\n var toParams = $transition$.params('to');\r\n var fromParams = $transition$.params('from');\r\n var getNodeSchema = function (node) { return node.paramSchema; };\r\n var toSchema = $transition$.treeChanges('to').map(getNodeSchema).reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.unnestR, []);\r\n var fromSchema = $transition$.treeChanges('from').map(getNodeSchema).reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.unnestR, []);\r\n // Find the to params that have different values than the from params\r\n var changedToParams = toSchema.filter(function (param) {\r\n var idx = fromSchema.indexOf(param);\r\n return idx === -1 || !fromSchema[idx].type.equals(toParams[param.id], fromParams[param.id]);\r\n });\r\n // Only trigger callback if a to param has changed or is new\r\n if (changedToParams.length) {\r\n var changedKeys_1 = changedToParams.map(function (x) { return x.id; });\r\n // Filter the params to only changed/new to params. `$transition$.params()` may be used to get all params.\r\n var newValues = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.filter)(toParams, function (val, key) { return changedKeys_1.indexOf(key) !== -1; });\r\n controllerInstance.uiOnParamsChanged(newValues, $transition$);\r\n }\r\n };\r\n $scope.$on('$destroy', $transitions.onSuccess({}, paramsUpdated, hookOptions));\r\n }\r\n // Add component-level hook for uiCanExit\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(controllerInstance.uiCanExit)) {\r\n var id_1 = _uiCanExitId++;\r\n var cacheProp_1 = '_uiCanExitIds';\r\n // Returns true if a redirect transition already answered truthy\r\n var prevTruthyAnswer_1 = function (trans) {\r\n return !!trans && ((trans[cacheProp_1] && trans[cacheProp_1][id_1] === true) || prevTruthyAnswer_1(trans.redirectedFrom()));\r\n };\r\n // If a user answered yes, but the transition was later redirected, don't also ask for the new redirect transition\r\n var wrappedHook = function (trans) {\r\n var promise;\r\n var ids = (trans[cacheProp_1] = trans[cacheProp_1] || {});\r\n if (!prevTruthyAnswer_1(trans)) {\r\n promise = $q.when(controllerInstance.uiCanExit(trans));\r\n promise.then(function (val) { return (ids[id_1] = val !== false); });\r\n }\r\n return promise;\r\n };\r\n var criteria = { exiting: viewState.name };\r\n $scope.$on('$destroy', $transitions.onBefore(criteria, wrappedHook, hookOptions));\r\n }\r\n}\r\n_angular__WEBPACK_IMPORTED_MODULE_1__.ng.module('ui.router.state').directive('uiView', uiView);\r\n_angular__WEBPACK_IMPORTED_MODULE_1__.ng.module('ui.router.state').directive('uiView', $ViewDirectiveFill);\r\n//# sourceMappingURL=viewDirective.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/index.js": /*!***********************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/index.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Ng1ViewConfig\": () => (/* reexport safe */ _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__.Ng1ViewConfig),\n/* harmony export */ \"StateProvider\": () => (/* reexport safe */ _stateProvider__WEBPACK_IMPORTED_MODULE_3__.StateProvider),\n/* harmony export */ \"UrlRouterProvider\": () => (/* reexport safe */ _urlRouterProvider__WEBPACK_IMPORTED_MODULE_4__.UrlRouterProvider),\n/* harmony export */ \"core\": () => (/* reexport module object */ _uirouter_core__WEBPACK_IMPORTED_MODULE_10__),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ \"getLocals\": () => (/* reexport safe */ _services__WEBPACK_IMPORTED_MODULE_1__.getLocals),\n/* harmony export */ \"getNg1ViewConfigFactory\": () => (/* reexport safe */ _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__.getNg1ViewConfigFactory),\n/* harmony export */ \"ng1ViewsBuilder\": () => (/* reexport safe */ _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__.ng1ViewsBuilder),\n/* harmony export */ \"watchDigests\": () => (/* reexport safe */ _services__WEBPACK_IMPORTED_MODULE_1__.watchDigests)\n/* harmony export */ });\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/angularjs/lib-esm/interface.js\");\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if([\"default\",\"core\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services */ \"./node_modules/@uirouter/angularjs/lib-esm/services.js\");\n/* harmony import */ var _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./statebuilders/views */ \"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js\");\n/* harmony import */ var _stateProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stateProvider */ \"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js\");\n/* harmony import */ var _urlRouterProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./urlRouterProvider */ \"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js\");\n/* harmony import */ var _injectables__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./injectables */ \"./node_modules/@uirouter/angularjs/lib-esm/injectables.js\");\n/* harmony import */ var _injectables__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_injectables__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _directives_stateDirectives__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./directives/stateDirectives */ \"./node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js\");\n/* harmony import */ var _stateFilters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./stateFilters */ \"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js\");\n/* harmony import */ var _directives_viewDirective__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./directives/viewDirective */ \"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js\");\n/* harmony import */ var _viewScroll__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./viewScroll */ \"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js\");\n/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @uirouter/core */ \"./node_modules/@uirouter/core/lib-esm/index.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _uirouter_core__WEBPACK_IMPORTED_MODULE_10__) if([\"default\",\"core\",\"getLocals\",\"watchDigests\",\"Ng1ViewConfig\",\"getNg1ViewConfigFactory\",\"ng1ViewsBuilder\",\"StateProvider\",\"UrlRouterProvider\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _uirouter_core__WEBPACK_IMPORTED_MODULE_10__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/**\r\n * Main entry point for angular 1.x build\r\n * @publicapi @module ng1\r\n */ /** */\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ('ui.router');\r\n\r\n\r\n\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/injectables.js": /*!*****************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/injectables.js ***! \*****************************************************************/ /***/ (() => { eval("/**\r\n * The current (or pending) State Parameters\r\n *\r\n * An injectable global **Service Object** which holds the state parameters for the latest **SUCCESSFUL** transition.\r\n *\r\n * The values are not updated until *after* a `Transition` successfully completes.\r\n *\r\n * **Also:** an injectable **Per-Transition Object** object which holds the pending state parameters for the pending `Transition` currently running.\r\n *\r\n * ### Deprecation warning:\r\n *\r\n * The value injected for `$stateParams` is different depending on where it is injected.\r\n *\r\n * - When injected into an angular service, the object injected is the global **Service Object** with the parameter values for the latest successful `Transition`.\r\n * - When injected into transition hooks, resolves, or view controllers, the object is the **Per-Transition Object** with the parameter values for the running `Transition`.\r\n *\r\n * Because of these confusing details, this service is deprecated.\r\n *\r\n * ### Instead of using the global `$stateParams` service object,\r\n * inject [[$uiRouterGlobals]] and use [[UIRouterGlobals.params]]\r\n *\r\n * ```js\r\n * MyService.$inject = ['$uiRouterGlobals'];\r\n * function MyService($uiRouterGlobals) {\r\n * return {\r\n * paramValues: function () {\r\n * return $uiRouterGlobals.params;\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * ### Instead of using the per-transition `$stateParams` object,\r\n * inject the current `Transition` (as [[$transition$]]) and use [[Transition.params]]\r\n *\r\n * ```js\r\n * MyController.$inject = ['$transition$'];\r\n * function MyController($transition$) {\r\n * var username = $transition$.params().username;\r\n * // .. do something with username\r\n * }\r\n * ```\r\n *\r\n * ---\r\n *\r\n * This object can be injected into other services.\r\n *\r\n * #### Deprecated Example:\r\n * ```js\r\n * SomeService.$inject = ['$http', '$stateParams'];\r\n * function SomeService($http, $stateParams) {\r\n * return {\r\n * getUser: function() {\r\n * return $http.get('/api/users/' + $stateParams.username);\r\n * }\r\n * }\r\n * };\r\n * angular.service('SomeService', SomeService);\r\n * ```\r\n * @deprecated\r\n */\r\nvar $stateParams;\r\n/**\r\n * Global UI-Router variables\r\n *\r\n * The router global state as a **Service Object** (injectable during runtime).\r\n *\r\n * This object contains globals such as the current state and current parameter values.\r\n */\r\nvar $uiRouterGlobals;\r\n/**\r\n * The UI-Router instance\r\n *\r\n * The [[UIRouter]] singleton (the router instance) as a **Service Object** (injectable during runtime).\r\n *\r\n * This object is the UI-Router singleton instance, created by angular dependency injection during application bootstrap.\r\n * It has references to the other UI-Router services\r\n *\r\n * #### Note: This object is also exposed as [[$uiRouterProvider]] for injection during angular config time.\r\n */\r\nvar $uiRouter;\r\n/**\r\n * The UI-Router instance\r\n *\r\n * The [[UIRouter]] singleton (the router instance) as a **Provider Object** (injectable during config phase).\r\n *\r\n * This object is the UI-Router singleton instance, created by angular dependency injection during application bootstrap.\r\n * It has references to the other UI-Router services\r\n *\r\n * #### Note: This object is also exposed as [[$uiRouter]] for injection during runtime.\r\n */\r\nvar $uiRouterProvider;\r\n/**\r\n * Transition debug/tracing\r\n *\r\n * The [[Trace]] singleton as a **Service Object** (injectable during runtime).\r\n *\r\n * Enables or disables Transition tracing which can help to debug issues.\r\n */\r\nvar $trace;\r\n/**\r\n * The Transition Service\r\n *\r\n * The [[TransitionService]] singleton as a **Service Object** (injectable during runtime).\r\n *\r\n * This angular service exposes the [[TransitionService]] singleton, which is primarily\r\n * used to register global transition hooks.\r\n *\r\n * #### Note: This object is also exposed as [[$transitionsProvider]] for injection during the config phase.\r\n */\r\nvar $transitions;\r\n/**\r\n * The Transition Service\r\n *\r\n * The [[TransitionService]] singleton as a **Provider Object** (injectable during config phase)\r\n *\r\n * This angular service exposes the [[TransitionService]] singleton, which is primarily\r\n * used to register global transition hooks.\r\n *\r\n * #### Note: This object is also exposed as [[$transitions]] for injection during runtime.\r\n */\r\nvar $transitionsProvider;\r\n/**\r\n * The current [[Transition]] object\r\n *\r\n * The current [[Transition]] object as a **Per-Transition Object** (injectable into Resolve, Hooks, Controllers)\r\n *\r\n * This object returns information about the current transition, including:\r\n *\r\n * - To/from states\r\n * - To/from parameters\r\n * - Transition options\r\n * - States being entered, exited, and retained\r\n * - Resolve data\r\n * - A Promise for the transition\r\n * - Any transition failure information\r\n * - An injector for both Service and Per-Transition Objects\r\n */\r\nvar $transition$;\r\n/**\r\n * The State Service\r\n *\r\n * The [[StateService]] singleton as a **Service Object** (injectable during runtime).\r\n *\r\n * This service used to manage and query information on registered states.\r\n * It exposes state related APIs including:\r\n *\r\n * - Start a [[Transition]]\r\n * - Imperatively lazy load states\r\n * - Check if a state is currently active\r\n * - Look up states by name\r\n * - Build URLs for a state+parameters\r\n * - Configure the global Transition error handler\r\n *\r\n * This angular service exposes the [[StateService]] singleton.\r\n */\r\nvar $state;\r\n/**\r\n * The State Registry\r\n *\r\n * The [[StateRegistry]] singleton as a **Service Object** (injectable during runtime).\r\n *\r\n * This service is used to register/deregister states.\r\n * It has state registration related APIs including:\r\n *\r\n * - Register/deregister states\r\n * - Listen for state registration/deregistration\r\n * - Get states by name\r\n * - Add state decorators (to customize the state creation process)\r\n *\r\n * #### Note: This object is also exposed as [[$stateRegistryProvider]] for injection during the config phase.\r\n */\r\nvar $stateRegistry;\r\n/**\r\n * The State Registry\r\n *\r\n * The [[StateRegistry]] singleton as a **Provider Object** (injectable during config time).\r\n *\r\n * This service is used to register/deregister states.\r\n * It has state registration related APIs including:\r\n *\r\n * - Register/deregister states\r\n * - Listen for state registration/deregistration\r\n * - Get states by name\r\n * - Add state decorators (to customize the state creation process)\r\n *\r\n * #### Note: This object is also exposed as [[$stateRegistry]] for injection during runtime.\r\n */\r\nvar $stateRegistryProvider;\r\n/**\r\n * The View Scroll provider\r\n *\r\n * The [[UIViewScrollProvider]] as a **Provider Object** (injectable during config time).\r\n *\r\n * This angular service exposes the [[UIViewScrollProvider]] singleton and is\r\n * used to disable UI-Router's scroll behavior.\r\n */\r\nvar $uiViewScrollProvider;\r\n/**\r\n * The View Scroll function\r\n *\r\n * The View Scroll function as a **Service Object** (injectable during runtime).\r\n *\r\n * This is a function that scrolls an element into view.\r\n * The element is scrolled after a `$timeout` so the DOM has time to refresh.\r\n *\r\n * If you prefer to rely on `$anchorScroll` to scroll the view to the anchor,\r\n * this can be enabled by calling [[UIViewScrollProvider.useAnchorScroll]].\r\n *\r\n * Note: this function is used by the [[directives.uiView]] when the `autoscroll` expression evaluates to true.\r\n */\r\nvar $uiViewScroll;\r\n/**\r\n * The StateProvider\r\n *\r\n * An angular1-only [[StateProvider]] as a **Provider Object** (injectable during config time).\r\n *\r\n * This angular service exposes the [[StateProvider]] singleton.\r\n *\r\n * The `StateProvider` is primarily used to register states or add custom state decorators.\r\n *\r\n * ##### Note: This provider is a ng1 vestige.\r\n * It is a passthrough to [[$stateRegistry]] and [[$state]].\r\n */\r\nvar $stateProvider;\r\n/**\r\n * The URL Service Provider\r\n *\r\n * The [[UrlService]] singleton as a **Provider Object** (injectable during the angular config phase).\r\n *\r\n * A service used to configure and interact with the URL.\r\n * It has URL related APIs including:\r\n *\r\n * - register custom Parameter types `UrlService.config.type` ([[UrlConfigApi.type]])\r\n * - add URL rules: `UrlService.rules.when` ([[UrlRulesApi.when]])\r\n * - configure behavior when no url matches: `UrlService.rules.otherwise` ([[UrlRulesApi.otherwise]])\r\n * - delay initial URL synchronization [[UrlService.deferIntercept]].\r\n * - get or set the current url: [[UrlService.url]]\r\n *\r\n * ##### Note: This service can also be injected during runtime as [[$urlService]].\r\n */\r\nvar $urlServiceProvider;\r\n/**\r\n * The URL Service\r\n *\r\n * The [[UrlService]] singleton as a **Service Object** (injectable during runtime).\r\n *\r\n * Note: This service can also be injected during the config phase as [[$urlServiceProvider]].\r\n *\r\n * Used to configure the URL.\r\n * It has URL related APIs including:\r\n *\r\n * - register custom Parameter types `UrlService.config.type` ([[UrlConfigApi.type]])\r\n * - add URL rules: `UrlService.rules.when` ([[UrlRulesApi.when]])\r\n * - configure behavior when no url matches: `UrlService.rules.otherwise` ([[UrlRulesApi.otherwise]])\r\n * - delay initial URL synchronization [[UrlService.deferIntercept]].\r\n * - get or set the current url: [[UrlService.url]]\r\n *\r\n * ##### Note: This service can also be injected during the config phase as [[$urlServiceProvider]].\r\n */\r\nvar $urlService;\r\n/**\r\n * The URL Router Provider\r\n *\r\n * ### Deprecation warning: This object is now considered internal. Use [[$urlServiceProvider]] instead.\r\n *\r\n * The [[UrlRouter]] singleton as a **Provider Object** (injectable during config time).\r\n *\r\n * #### Note: This object is also exposed as [[$urlRouter]] for injection during runtime.\r\n *\r\n * @deprecated\r\n */\r\nvar $urlRouterProvider;\r\n/**\r\n * The Url Router\r\n *\r\n * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead.\r\n *\r\n * The [[UrlRouter]] singleton as a **Service Object** (injectable during runtime).\r\n *\r\n * #### Note: This object is also exposed as [[$urlRouterProvider]] for injection during angular config time.\r\n *\r\n * @deprecated\r\n */\r\nvar $urlRouter;\r\n/**\r\n * The URL Matcher Factory\r\n *\r\n * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead.\r\n *\r\n * The [[UrlMatcherFactory]] singleton as a **Service Object** (injectable during runtime).\r\n *\r\n * This service is used to set url mapping options, define custom parameter types, and create [[UrlMatcher]] objects.\r\n *\r\n * #### Note: This object is also exposed as [[$urlMatcherFactoryProvider]] for injection during angular config time.\r\n *\r\n * @deprecated\r\n */\r\nvar $urlMatcherFactory;\r\n/**\r\n * The URL Matcher Factory\r\n *\r\n * ### Deprecation warning: This object is now considered internal. Use [[$urlService]] instead.\r\n *\r\n * The [[UrlMatcherFactory]] singleton as a **Provider Object** (injectable during config time).\r\n *\r\n * This service is used to set url mapping options, define custom parameter types, and create [[UrlMatcher]] objects.\r\n *\r\n * #### Note: This object is also exposed as [[$urlMatcherFactory]] for injection during runtime.\r\n *\r\n * @deprecated\r\n */\r\nvar $urlMatcherFactoryProvider;\r\n//# sourceMappingURL=injectables.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/injectables.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/interface.js": /*!***************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/interface.js ***! \***************************************************************/ /***/ (() => { eval("//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/interface.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/locationServices.js": /*!**********************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/locationServices.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Ng1LocationServices\": () => (/* binding */ Ng1LocationServices)\n/* harmony export */ });\n/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ \"./node_modules/@uirouter/core/lib-esm/index.js\");\n/** @publicapi @module ng1 */ /** */\r\n\r\n\r\n/**\r\n * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service\r\n * @internalapi\r\n */\r\nvar Ng1LocationServices = /** @class */ (function () {\r\n function Ng1LocationServices($locationProvider) {\r\n // .onChange() registry\r\n this._urlListeners = [];\r\n this.$locationProvider = $locationProvider;\r\n var _lp = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.val)($locationProvider);\r\n (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions)(_lp, this, _lp, ['hashPrefix']);\r\n }\r\n /**\r\n * Applys ng1-specific path parameter encoding\r\n *\r\n * The Angular 1 `$location` service is a bit weird.\r\n * It doesn't allow slashes to be encoded/decoded bi-directionally.\r\n *\r\n * See the writeup at https://github.com/angular-ui/ui-router/issues/2598\r\n *\r\n * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F\r\n *\r\n * @param router\r\n */\r\n Ng1LocationServices.monkeyPatchPathParameterType = function (router) {\r\n var pathType = router.urlMatcherFactory.type('path');\r\n pathType.encode = function (x) {\r\n return x != null ? x.toString().replace(/(~|\\/)/g, function (m) { return ({ '~': '~~', '/': '~2F' }[m]); }) : x;\r\n };\r\n pathType.decode = function (x) {\r\n return x != null ? x.toString().replace(/(~~|~2F)/g, function (m) { return ({ '~~': '~', '~2F': '/' }[m]); }) : x;\r\n };\r\n };\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n Ng1LocationServices.prototype.dispose = function () { };\r\n Ng1LocationServices.prototype.onChange = function (callback) {\r\n var _this = this;\r\n this._urlListeners.push(callback);\r\n return function () { return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(_this._urlListeners)(callback); };\r\n };\r\n Ng1LocationServices.prototype.html5Mode = function () {\r\n var html5Mode = this.$locationProvider.html5Mode();\r\n html5Mode = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isObject)(html5Mode) ? html5Mode.enabled : html5Mode;\r\n return html5Mode && this.$sniffer.history;\r\n };\r\n Ng1LocationServices.prototype.baseHref = function () {\r\n return this._baseHref || (this._baseHref = this.$browser.baseHref() || this.$window.location.pathname);\r\n };\r\n Ng1LocationServices.prototype.url = function (newUrl, replace, state) {\r\n if (replace === void 0) { replace = false; }\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isDefined)(newUrl))\r\n this.$location.url(newUrl);\r\n if (replace)\r\n this.$location.replace();\r\n if (state)\r\n this.$location.state(state);\r\n return this.$location.url();\r\n };\r\n Ng1LocationServices.prototype._runtimeServices = function ($rootScope, $location, $sniffer, $browser, $window) {\r\n var _this = this;\r\n this.$location = $location;\r\n this.$sniffer = $sniffer;\r\n this.$browser = $browser;\r\n this.$window = $window;\r\n // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange\r\n $rootScope.$on('$locationChangeSuccess', function (evt) { return _this._urlListeners.forEach(function (fn) { return fn(evt); }); });\r\n var _loc = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.val)($location);\r\n // Bind these LocationService functions to $location\r\n (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions)(_loc, this, _loc, ['replace', 'path', 'search', 'hash']);\r\n // Bind these LocationConfig functions to $location\r\n (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions)(_loc, this, _loc, ['port', 'protocol', 'host']);\r\n };\r\n return Ng1LocationServices;\r\n}());\r\n\r\n//# sourceMappingURL=locationServices.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/services.js": /*!**************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/services.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"getLocals\": () => (/* binding */ getLocals),\n/* harmony export */ \"watchDigests\": () => (/* binding */ watchDigests)\n/* harmony export */ });\n/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./angular */ \"./node_modules/@uirouter/angularjs/lib-esm/angular.js\");\n/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @uirouter/core */ \"./node_modules/@uirouter/core/lib-esm/index.js\");\n/* harmony import */ var _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./statebuilders/views */ \"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js\");\n/* harmony import */ var _templateFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./templateFactory */ \"./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js\");\n/* harmony import */ var _stateProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stateProvider */ \"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js\");\n/* harmony import */ var _statebuilders_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./statebuilders/onEnterExitRetain */ \"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js\");\n/* harmony import */ var _locationServices__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./locationServices */ \"./node_modules/@uirouter/angularjs/lib-esm/locationServices.js\");\n/* harmony import */ var _urlRouterProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./urlRouterProvider */ \"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js\");\n/* eslint-disable @typescript-eslint/no-empty-function */\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/**\r\n * # Angular 1 types\r\n *\r\n * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc.\r\n * The customizations to the core types for Angular UI-Router are documented here.\r\n *\r\n * The optional [[$resolve]] service is also documented here.\r\n *\r\n * @preferred @publicapi @module ng1\r\n */ /** */\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n_angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.angular1', []);\r\nvar mod_init = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.init', ['ng']);\r\nvar mod_util = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.util', ['ui.router.init']);\r\nvar mod_rtr = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.router', ['ui.router.util']);\r\nvar mod_state = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']);\r\nvar mod_main = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']);\r\nvar mod_cmpt = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.compat', ['ui.router']);\r\nvar router = null;\r\n$uiRouterProvider.$inject = ['$locationProvider'];\r\n/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */\r\nfunction $uiRouterProvider($locationProvider) {\r\n // Create a new instance of the Router when the $uiRouterProvider is initialized\r\n router = this.router = new _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.UIRouter();\r\n router.stateProvider = new _stateProvider__WEBPACK_IMPORTED_MODULE_4__.StateProvider(router.stateRegistry, router.stateService);\r\n // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties\r\n router.stateRegistry.decorator('views', _statebuilders_views__WEBPACK_IMPORTED_MODULE_2__.ng1ViewsBuilder);\r\n router.stateRegistry.decorator('onExit', (0,_statebuilders_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.getStateHookBuilder)('onExit'));\r\n router.stateRegistry.decorator('onRetain', (0,_statebuilders_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.getStateHookBuilder)('onRetain'));\r\n router.stateRegistry.decorator('onEnter', (0,_statebuilders_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.getStateHookBuilder)('onEnter'));\r\n router.viewService._pluginapi._viewConfigFactory('ng1', (0,_statebuilders_views__WEBPACK_IMPORTED_MODULE_2__.getNg1ViewConfigFactory)());\r\n // Disable decoding of params by UrlMatcherFactory because $location already handles this\r\n router.urlService.config._decodeParams = false;\r\n var ng1LocationService = (router.locationService = router.locationConfig = new _locationServices__WEBPACK_IMPORTED_MODULE_6__.Ng1LocationServices($locationProvider));\r\n _locationServices__WEBPACK_IMPORTED_MODULE_6__.Ng1LocationServices.monkeyPatchPathParameterType(router);\r\n // backwards compat: also expose router instance as $uiRouterProvider.router\r\n router['router'] = router;\r\n router['$get'] = $get;\r\n $get.$inject = ['$location', '$browser', '$window', '$sniffer', '$rootScope', '$http', '$templateCache'];\r\n function $get($location, $browser, $window, $sniffer, $rootScope, $http, $templateCache) {\r\n ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser, $window);\r\n delete router['router'];\r\n delete router['$get'];\r\n return router;\r\n }\r\n return router;\r\n}\r\nvar getProviderFor = function (serviceName) { return [\r\n '$uiRouterProvider',\r\n function ($urp) {\r\n var service = $urp.router[serviceName];\r\n service['$get'] = function () { return service; };\r\n return service;\r\n },\r\n]; };\r\n// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime)\r\nrunBlock.$inject = ['$injector', '$q', '$uiRouter'];\r\nfunction runBlock($injector, $q, $uiRouter) {\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$injector = $injector;\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$q = $q;\r\n // https://github.com/angular-ui/ui-router/issues/3678\r\n if (!Object.prototype.hasOwnProperty.call($injector, 'strictDi')) {\r\n try {\r\n $injector.invoke(function (checkStrictDi) { });\r\n }\r\n catch (error) {\r\n $injector.strictDi = !!/strict mode/.exec(error && error.toString());\r\n }\r\n }\r\n // The $injector is now available.\r\n // Find any resolvables that had dependency annotation deferred\r\n $uiRouter.stateRegistry\r\n .get()\r\n .map(function (x) { return x.$$state().resolvables; })\r\n .reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.unnestR, [])\r\n .filter(function (x) { return x.deps === 'deferred'; })\r\n .forEach(function (resolvable) { return (resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi)); });\r\n}\r\n// $urlRouter service and $urlRouterProvider\r\nvar getUrlRouterProvider = function (uiRouter) { return (uiRouter.urlRouterProvider = new _urlRouterProvider__WEBPACK_IMPORTED_MODULE_7__.UrlRouterProvider(uiRouter)); };\r\n// $state service and $stateProvider\r\n// $urlRouter service and $urlRouterProvider\r\nvar getStateProvider = function () { return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.extend)(router.stateProvider, { $get: function () { return router.stateService; } }); };\r\nwatchDigests.$inject = ['$rootScope'];\r\nfunction watchDigests($rootScope) {\r\n $rootScope.$watch(function () {\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.trace.approximateDigests++;\r\n });\r\n}\r\nmod_init.provider('$uiRouter', $uiRouterProvider);\r\nmod_rtr.provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);\r\nmod_util.provider('$urlService', getProviderFor('urlService'));\r\nmod_util.provider('$urlMatcherFactory', ['$uiRouterProvider', function () { return router.urlMatcherFactory; }]);\r\nmod_util.provider('$templateFactory', function () { return new _templateFactory__WEBPACK_IMPORTED_MODULE_3__.TemplateFactory(); });\r\nmod_state.provider('$stateRegistry', getProviderFor('stateRegistry'));\r\nmod_state.provider('$uiRouterGlobals', getProviderFor('globals'));\r\nmod_state.provider('$transitions', getProviderFor('transitionService'));\r\nmod_state.provider('$state', ['$uiRouterProvider', getStateProvider]);\r\nmod_state.factory('$stateParams', ['$uiRouter', function ($uiRouter) { return $uiRouter.globals.params; }]);\r\nmod_main.factory('$view', function () { return router.viewService; });\r\nmod_main.service('$trace', function () { return _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.trace; });\r\nmod_main.run(watchDigests);\r\nmod_util.run(['$urlMatcherFactory', function ($urlMatcherFactory) { }]);\r\nmod_state.run(['$state', function ($state) { }]);\r\nmod_rtr.run(['$urlRouter', function ($urlRouter) { }]);\r\nmod_init.run(runBlock);\r\n/** @hidden TODO: find a place to move this */\r\nvar getLocals = function (ctx) {\r\n var tokens = ctx.getTokens().filter(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isString);\r\n var tuples = tokens.map(function (key) {\r\n var resolvable = ctx.getResolvable(key);\r\n var waitPolicy = ctx.getPolicy(resolvable).async;\r\n return [key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data];\r\n });\r\n return tuples.reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.applyPairs, {});\r\n};\r\n//# sourceMappingURL=services.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/services.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js": /*!******************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"$IncludedByStateFilter\": () => (/* binding */ $IncludedByStateFilter),\n/* harmony export */ \"$IsStateFilter\": () => (/* binding */ $IsStateFilter)\n/* harmony export */ });\n/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./angular */ \"./node_modules/@uirouter/angularjs/lib-esm/angular.js\");\n/** @publicapi @module ng1 */ /** */\r\n\r\n/**\r\n * `isState` Filter: truthy if the current state is the parameter\r\n *\r\n * Translates to [[StateService.is]] `$state.is(\"stateName\")`.\r\n *\r\n * #### Example:\r\n * ```html\r\n *
    show if state is 'stateName'
    \r\n * ```\r\n */\r\n$IsStateFilter.$inject = ['$state'];\r\nfunction $IsStateFilter($state) {\r\n var isFilter = function (state, params, options) {\r\n return $state.is(state, params, options);\r\n };\r\n isFilter.$stateful = true;\r\n return isFilter;\r\n}\r\n/**\r\n * `includedByState` Filter: truthy if the current state includes the parameter\r\n *\r\n * Translates to [[StateService.includes]]` $state.is(\"fullOrPartialStateName\")`.\r\n *\r\n * #### Example:\r\n * ```html\r\n *
    show if state includes 'fullOrPartialStateName'
    \r\n * ```\r\n */\r\n$IncludedByStateFilter.$inject = ['$state'];\r\nfunction $IncludedByStateFilter($state) {\r\n var includesFilter = function (state, params, options) {\r\n return $state.includes(state, params, options);\r\n };\r\n includesFilter.$stateful = true;\r\n return includesFilter;\r\n}\r\n_angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.state').filter('isState', $IsStateFilter).filter('includedByState', $IncludedByStateFilter);\r\n\r\n//# sourceMappingURL=stateFilters.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js": /*!*******************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StateProvider\": () => (/* binding */ StateProvider)\n/* harmony export */ });\n/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ \"./node_modules/@uirouter/core/lib-esm/index.js\");\n/** @publicapi @module ng1 */ /** */\r\n\r\n/**\r\n * The Angular 1 `StateProvider`\r\n *\r\n * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely\r\n * on state.\r\n *\r\n * A state corresponds to a \"place\" in the application in terms of the overall UI and\r\n * navigation. A state describes (via the controller / template / view properties) what\r\n * the UI looks like and does at that place.\r\n *\r\n * States often have things in common, and the primary way of factoring out these\r\n * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\r\n * nested states.\r\n *\r\n * The `$stateProvider` provides interfaces to declare these states for your app.\r\n */\r\nvar StateProvider = /** @class */ (function () {\r\n function StateProvider(stateRegistry, stateService) {\r\n this.stateRegistry = stateRegistry;\r\n this.stateService = stateService;\r\n (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions)((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.val)(StateProvider.prototype), this, (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.val)(this));\r\n }\r\n /**\r\n * Decorates states when they are registered\r\n *\r\n * Allows you to extend (carefully) or override (at your own peril) the\r\n * `stateBuilder` object used internally by [[StateRegistry]].\r\n * This can be used to add custom functionality to ui-router,\r\n * for example inferring templateUrl based on the state name.\r\n *\r\n * When passing only a name, it returns the current (original or decorated) builder\r\n * function that matches `name`.\r\n *\r\n * The builder functions that can be decorated are listed below. Though not all\r\n * necessarily have a good use case for decoration, that is up to you to decide.\r\n *\r\n * In addition, users can attach custom decorators, which will generate new\r\n * properties within the state's internal definition. There is currently no clear\r\n * use-case for this beyond accessing internal states (i.e. $state.$current),\r\n * however, expect this to become increasingly relevant as we introduce additional\r\n * meta-programming features.\r\n *\r\n * **Warning**: Decorators should not be interdependent because the order of\r\n * execution of the builder functions in non-deterministic. Builder functions\r\n * should only be dependent on the state definition object and super function.\r\n *\r\n *\r\n * Existing builder functions and current return values:\r\n *\r\n * - **parent** `{object}` - returns the parent state object.\r\n * - **data** `{object}` - returns state data, including any inherited data that is not\r\n * overridden by own values (if any).\r\n * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\r\n * or `null`.\r\n * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is\r\n * navigable).\r\n * - **params** `{object}` - returns an array of state params that are ensured to\r\n * be a super-set of parent's params.\r\n * - **views** `{object}` - returns a views object where each key is an absolute view\r\n * name (i.e. \"viewName@stateName\") and each value is the config object\r\n * (template, controller) for the view. Even when you don't use the views object\r\n * explicitly on a state config, one is still created for you internally.\r\n * So by decorating this builder function you have access to decorating template\r\n * and controller properties.\r\n * - **ownParams** `{object}` - returns an array of params that belong to the state,\r\n * not including any params defined by ancestor states.\r\n * - **path** `{string}` - returns the full path from the root down to this state.\r\n * Needed for state activation.\r\n * - **includes** `{object}` - returns an object that includes every state that\r\n * would pass a `$state.includes()` test.\r\n *\r\n * #### Example:\r\n * Override the internal 'views' builder with a function that takes the state\r\n * definition, and a reference to the internal function being overridden:\r\n * ```js\r\n * $stateProvider.decorator('views', function (state, parent) {\r\n * let result = {},\r\n * views = parent(state);\r\n *\r\n * angular.forEach(views, function (config, name) {\r\n * let autoName = (state.name + '.' + name).replace('.', '/');\r\n * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\r\n * result[name] = config;\r\n * });\r\n * return result;\r\n * });\r\n *\r\n * $stateProvider.state('home', {\r\n * views: {\r\n * 'contact.list': { controller: 'ListController' },\r\n * 'contact.item': { controller: 'ItemController' }\r\n * }\r\n * });\r\n * ```\r\n *\r\n *\r\n * ```js\r\n * // Auto-populates list and item views with /partials/home/contact/list.html,\r\n * // and /partials/home/contact/item.html, respectively.\r\n * $state.go('home');\r\n * ```\r\n *\r\n * @param {string} name The name of the builder function to decorate.\r\n * @param {object} func A function that is responsible for decorating the original\r\n * builder function. The function receives two parameters:\r\n *\r\n * - `{object}` - state - The state config object.\r\n * - `{object}` - super - The original builder function.\r\n *\r\n * @return {object} $stateProvider - $stateProvider instance\r\n */\r\n StateProvider.prototype.decorator = function (name, func) {\r\n return this.stateRegistry.decorator(name, func) || this;\r\n };\r\n StateProvider.prototype.state = function (name, definition) {\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isObject)(name)) {\r\n definition = name;\r\n }\r\n else {\r\n definition.name = name;\r\n }\r\n this.stateRegistry.register(definition);\r\n return this;\r\n };\r\n /**\r\n * Registers an invalid state handler\r\n *\r\n * This is a passthrough to [[StateService.onInvalid]] for ng1.\r\n */\r\n StateProvider.prototype.onInvalid = function (callback) {\r\n return this.stateService.onInvalid(callback);\r\n };\r\n return StateProvider;\r\n}());\r\n\r\n//# sourceMappingURL=stateProvider.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js": /*!*************************************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js ***! \*************************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"getStateHookBuilder\": () => (/* binding */ getStateHookBuilder)\n/* harmony export */ });\n/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ \"./node_modules/@uirouter/core/lib-esm/index.js\");\n/* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../services */ \"./node_modules/@uirouter/angularjs/lib-esm/services.js\");\n/** @publicapi @module ng1 */ /** */\r\n\r\n\r\n/**\r\n * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,\r\n * `onRetain` callback hooks on a [[Ng1StateDeclaration]].\r\n *\r\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\r\n * ensures that those hooks are injectable for @uirouter/angularjs (ng1).\r\n *\r\n * @internalapi\r\n */\r\nvar getStateHookBuilder = function (hookName) {\r\n return function stateHookBuilder(stateObject) {\r\n var hook = stateObject[hookName];\r\n var pathname = hookName === 'onExit' ? 'from' : 'to';\r\n function decoratedNg1Hook(trans, state) {\r\n var resolveContext = new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.ResolveContext(trans.treeChanges(pathname));\r\n var subContext = resolveContext.subContext(state.$$state());\r\n var locals = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.extend)((0,_services__WEBPACK_IMPORTED_MODULE_1__.getLocals)(subContext), { $state$: state, $transition$: trans });\r\n return _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector.invoke(hook, this, locals);\r\n }\r\n return hook ? decoratedNg1Hook : undefined;\r\n };\r\n};\r\n//# sourceMappingURL=onEnterExitRetain.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js": /*!*************************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Ng1ViewConfig\": () => (/* binding */ Ng1ViewConfig),\n/* harmony export */ \"getNg1ViewConfigFactory\": () => (/* binding */ getNg1ViewConfigFactory),\n/* harmony export */ \"ng1ViewsBuilder\": () => (/* binding */ ng1ViewsBuilder)\n/* harmony export */ });\n/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ \"./node_modules/@uirouter/core/lib-esm/index.js\");\n/** @publicapi @module ng1 */ /** */\r\n\r\n/** @internalapi */\r\nfunction getNg1ViewConfigFactory() {\r\n var templateFactory = null;\r\n return function (path, view) {\r\n templateFactory = templateFactory || _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector.get('$templateFactory');\r\n return [new Ng1ViewConfig(path, view, templateFactory)];\r\n };\r\n}\r\n/** @internalapi */\r\nvar hasAnyKey = function (keys, obj) { return keys.reduce(function (acc, key) { return acc || (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isDefined)(obj[key]); }, false); };\r\n/**\r\n * This is a [[StateBuilder.builder]] function for angular1 `views`.\r\n *\r\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\r\n * handles the `views` property with logic specific to @uirouter/angularjs (ng1).\r\n *\r\n * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object\r\n * and applies the state-level configuration to a view named `$default`.\r\n *\r\n * @internalapi\r\n */\r\nfunction ng1ViewsBuilder(state) {\r\n // Do not process root state\r\n if (!state.parent)\r\n return {};\r\n var tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'], ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'], compKeys = ['component', 'bindings', 'componentProvider'], nonCompKeys = tplKeys.concat(ctrlKeys), allViewKeys = compKeys.concat(nonCompKeys);\r\n // Do not allow a state to have both state-level props and also a `views: {}` property.\r\n // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state.\r\n // However, the `$default` approach should not be mixed with a separate `views: ` block.\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isDefined)(state.views) && hasAnyKey(allViewKeys, state)) {\r\n throw new Error(\"State '\" + state.name + \"' has a 'views' object. \" +\r\n \"It cannot also have \\\"view properties\\\" at the state level. \" +\r\n \"Move the following properties into a view (in the 'views' object): \" +\r\n (\" \" + allViewKeys.filter(function (key) { return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isDefined)(state[key]); }).join(', ')));\r\n }\r\n var views = {}, viewsObject = state.views || { $default: (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.pick)(state, allViewKeys) };\r\n (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.forEach)(viewsObject, function (config, name) {\r\n // Account for views: { \"\": { template... } }\r\n name = name || '$default';\r\n // Account for views: { header: \"headerComponent\" }\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isString)(config))\r\n config = { component: config };\r\n // Make a shallow copy of the config object\r\n config = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.extend)({}, config);\r\n // Do not allow a view to mix props for component-style view with props for template/controller-style view\r\n if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {\r\n throw new Error(\"Cannot combine: \" + compKeys.join('|') + \" with: \" + nonCompKeys.join('|') + \" in stateview: '\" + name + \"@\" + state.name + \"'\");\r\n }\r\n config.resolveAs = config.resolveAs || '$resolve';\r\n config.$type = 'ng1';\r\n config.$context = state;\r\n config.$name = name;\r\n var normalized = _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.ViewService.normalizeUIViewTarget(config.$context, config.$name);\r\n config.$uiViewName = normalized.uiViewName;\r\n config.$uiViewContextAnchor = normalized.uiViewContextAnchor;\r\n views[name] = config;\r\n });\r\n return views;\r\n}\r\n/** @hidden */\r\nvar id = 0;\r\n/** @internalapi */\r\nvar Ng1ViewConfig = /** @class */ (function () {\r\n function Ng1ViewConfig(path, viewDecl, factory) {\r\n var _this = this;\r\n this.path = path;\r\n this.viewDecl = viewDecl;\r\n this.factory = factory;\r\n this.$id = id++;\r\n this.loaded = false;\r\n this.getTemplate = function (uiView, context) {\r\n return _this.component\r\n ? _this.factory.makeComponentTemplate(uiView, context, _this.component, _this.viewDecl.bindings)\r\n : _this.template;\r\n };\r\n }\r\n Ng1ViewConfig.prototype.load = function () {\r\n var _this = this;\r\n var $q = _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$q;\r\n var context = new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.ResolveContext(this.path);\r\n var params = this.path.reduce(function (acc, node) { return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.extend)(acc, node.paramValues); }, {});\r\n var promises = {\r\n template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),\r\n controller: $q.when(this.getController(context)),\r\n };\r\n return $q.all(promises).then(function (results) {\r\n _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.trace.traceViewServiceEvent('Loaded', _this);\r\n _this.controller = results.controller;\r\n (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.extend)(_this, results.template); // Either { template: \"tpl\" } or { component: \"cmpName\" }\r\n return _this;\r\n });\r\n };\r\n /**\r\n * Gets the controller for a view configuration.\r\n *\r\n * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller.\r\n */\r\n Ng1ViewConfig.prototype.getController = function (context) {\r\n var provider = this.viewDecl.controllerProvider;\r\n if (!(0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isInjectable)(provider))\r\n return this.viewDecl.controller;\r\n var deps = _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector.annotate(provider);\r\n var providerFn = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isArray)(provider) ? (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.tail)(provider) : provider;\r\n var resolvable = new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.Resolvable('', providerFn, deps);\r\n return resolvable.get(context);\r\n };\r\n return Ng1ViewConfig;\r\n}());\r\n\r\n//# sourceMappingURL=views.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js": /*!*********************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TemplateFactory\": () => (/* binding */ TemplateFactory)\n/* harmony export */ });\n/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./angular */ \"./node_modules/@uirouter/angularjs/lib-esm/angular.js\");\n/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @uirouter/core */ \"./node_modules/@uirouter/core/lib-esm/index.js\");\n/** @publicapi @module view */ /** */\r\n\r\n\r\n/**\r\n * Service which manages loading of templates from a ViewConfig.\r\n */\r\nvar TemplateFactory = /** @class */ (function () {\r\n function TemplateFactory() {\r\n var _this = this;\r\n /** @hidden */ this._useHttp = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.version.minor < 3;\r\n /** @hidden */ this.$get = [\r\n '$http',\r\n '$templateCache',\r\n '$injector',\r\n function ($http, $templateCache, $injector) {\r\n _this.$templateRequest = $injector.has && $injector.has('$templateRequest') && $injector.get('$templateRequest');\r\n _this.$http = $http;\r\n _this.$templateCache = $templateCache;\r\n return _this;\r\n },\r\n ];\r\n }\r\n /** @hidden */\r\n TemplateFactory.prototype.useHttpService = function (value) {\r\n this._useHttp = value;\r\n };\r\n /**\r\n * Creates a template from a configuration object.\r\n *\r\n * @param config Configuration object for which to load a template.\r\n * The following properties are search in the specified order, and the first one\r\n * that is defined is used to create the template:\r\n *\r\n * @param params Parameters to pass to the template function.\r\n * @param context The resolve context associated with the template's view\r\n *\r\n * @return {string|object} The template html as a string, or a promise for\r\n * that string,or `null` if no template is configured.\r\n */\r\n TemplateFactory.prototype.fromConfig = function (config, params, context) {\r\n var defaultTemplate = '';\r\n var asTemplate = function (result) { return _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(result).then(function (str) { return ({ template: str }); }); };\r\n var asComponent = function (result) { return _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(result).then(function (str) { return ({ component: str }); }); };\r\n return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(config.template)\r\n ? asTemplate(this.fromString(config.template, params))\r\n : (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(config.templateUrl)\r\n ? asTemplate(this.fromUrl(config.templateUrl, params))\r\n : (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(config.templateProvider)\r\n ? asTemplate(this.fromProvider(config.templateProvider, params, context))\r\n : (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(config.component)\r\n ? asComponent(config.component)\r\n : (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(config.componentProvider)\r\n ? asComponent(this.fromComponentProvider(config.componentProvider, params, context))\r\n : asTemplate(defaultTemplate);\r\n };\r\n /**\r\n * Creates a template from a string or a function returning a string.\r\n *\r\n * @param template html template as a string or function that returns an html template as a string.\r\n * @param params Parameters to pass to the template function.\r\n *\r\n * @return {string|object} The template html as a string, or a promise for that\r\n * string.\r\n */\r\n TemplateFactory.prototype.fromString = function (template, params) {\r\n return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isFunction)(template) ? template(params) : template;\r\n };\r\n /**\r\n * Loads a template from the a URL via `$http` and `$templateCache`.\r\n *\r\n * @param {string|Function} url url of the template to load, or a function\r\n * that returns a url.\r\n * @param {Object} params Parameters to pass to the url function.\r\n * @return {string|Promise.} The template html as a string, or a promise\r\n * for that string.\r\n */\r\n TemplateFactory.prototype.fromUrl = function (url, params) {\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isFunction)(url))\r\n url = url(params);\r\n if (url == null)\r\n return null;\r\n if (this._useHttp) {\r\n return this.$http\r\n .get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } })\r\n .then(function (response) {\r\n return response.data;\r\n });\r\n }\r\n return this.$templateRequest(url);\r\n };\r\n /**\r\n * Creates a template by invoking an injectable provider function.\r\n *\r\n * @param provider Function to invoke via `locals`\r\n * @param {Function} injectFn a function used to invoke the template provider\r\n * @return {string|Promise.} The template html as a string, or a promise\r\n * for that string.\r\n */\r\n TemplateFactory.prototype.fromProvider = function (provider, params, context) {\r\n var deps = _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$injector.annotate(provider);\r\n var providerFn = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(provider) ? (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.tail)(provider) : provider;\r\n var resolvable = new _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.Resolvable('', providerFn, deps);\r\n return resolvable.get(context);\r\n };\r\n /**\r\n * Creates a component's template by invoking an injectable provider function.\r\n *\r\n * @param provider Function to invoke via `locals`\r\n * @param {Function} injectFn a function used to invoke the template provider\r\n * @return {string} The template html as a string: \"\".\r\n */\r\n TemplateFactory.prototype.fromComponentProvider = function (provider, params, context) {\r\n var deps = _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$injector.annotate(provider);\r\n var providerFn = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(provider) ? (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.tail)(provider) : provider;\r\n var resolvable = new _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.Resolvable('', providerFn, deps);\r\n return resolvable.get(context);\r\n };\r\n /**\r\n * Creates a template from a component's name\r\n *\r\n * This implements route-to-component.\r\n * It works by retrieving the component (directive) metadata from the injector.\r\n * It analyses the component's bindings, then constructs a template that instantiates the component.\r\n * The template wires input and output bindings to resolves or from the parent component.\r\n *\r\n * @param uiView {object} The parent ui-view (for binding outputs to callbacks)\r\n * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)\r\n * @param component {string} Component's name in camel case.\r\n * @param bindings An object defining the component's bindings: {foo: '<'}\r\n * @return {string} The template as a string: \"\".\r\n */\r\n TemplateFactory.prototype.makeComponentTemplate = function (uiView, context, component, bindings) {\r\n bindings = bindings || {};\r\n // Bind once prefix\r\n var prefix = _angular__WEBPACK_IMPORTED_MODULE_0__.ng.version.minor >= 3 ? '::' : '';\r\n // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-`\r\n var kebob = function (camelCase) {\r\n var kebobed = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.kebobString)(camelCase);\r\n return /^(x|data)-/.exec(kebobed) ? \"x-\" + kebobed : kebobed;\r\n };\r\n var attributeTpl = function (input) {\r\n var name = input.name, type = input.type;\r\n var attrName = kebob(name);\r\n // If the ui-view has an attribute which matches a binding on the routed component\r\n // then pass that attribute through to the routed component template.\r\n // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:`\r\n if (uiView.attr(attrName) && !bindings[name])\r\n return attrName + \"='\" + uiView.attr(attrName) + \"'\";\r\n var resolveName = bindings[name] || name;\r\n // Pre-evaluate the expression for \"@\" bindings by enclosing in {{ }}\r\n // some-attr=\"{{ ::$resolve.someResolveName }}\"\r\n if (type === '@')\r\n return attrName + \"='{{\" + prefix + \"$resolve.\" + resolveName + \"}}'\";\r\n // Wire \"&\" callbacks to resolves that return a callback function\r\n // Get the result of the resolve (should be a function) and annotate it to get its arguments.\r\n // some-attr=\"$resolve.someResolveResultName(foo, bar)\"\r\n if (type === '&') {\r\n var res = context.getResolvable(resolveName);\r\n var fn = res && res.data;\r\n var args = (fn && _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$injector.annotate(fn)) || [];\r\n // account for array style injection, i.e., ['foo', function(foo) {}]\r\n var arrayIdxStr = (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(fn) ? \"[\" + (fn.length - 1) + \"]\" : '';\r\n return attrName + \"='$resolve.\" + resolveName + arrayIdxStr + \"(\" + args.join(',') + \")'\";\r\n }\r\n // some-attr=\"::$resolve.someResolveName\"\r\n return attrName + \"='\" + prefix + \"$resolve.\" + resolveName + \"'\";\r\n };\r\n var attrs = getComponentBindings(component).map(attributeTpl).join(' ');\r\n var kebobName = kebob(component);\r\n return \"<\" + kebobName + \" \" + attrs + \">\";\r\n };\r\n return TemplateFactory;\r\n}());\r\n\r\n// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&')\r\nfunction getComponentBindings(name) {\r\n var cmpDefs = _uirouter_core__WEBPACK_IMPORTED_MODULE_1__.services.$injector.get(name + 'Directive'); // could be multiple\r\n if (!cmpDefs || !cmpDefs.length)\r\n throw new Error(\"Unable to find component named '\" + name + \"'\");\r\n return cmpDefs.map(getBindings).reduce(_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.unnestR, []);\r\n}\r\n// Given a directive definition, find its object input attributes\r\n// Use different properties, depending on the type of directive (component, bindToController, normal)\r\nvar getBindings = function (def) {\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isObject)(def.bindToController))\r\n return scopeBindings(def.bindToController);\r\n return scopeBindings(def.scope);\r\n};\r\n// for ng 1.2 style, process the scope: { input: \"=foo\" }\r\n// for ng 1.3 through ng 1.5, process the component's bindToController: { input: \"=foo\" } object\r\nvar scopeBindings = function (bindingsObj) {\r\n return Object.keys(bindingsObj || {})\r\n // [ 'input', [ '=foo', '=', 'foo' ] ]\r\n .map(function (key) { return [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])]; })\r\n // skip malformed values\r\n .filter(function (tuple) { return (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isDefined)(tuple) && (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_1__.isArray)(tuple[1]); })\r\n // { name: ('foo' || 'input'), type: '=' }\r\n .map(function (tuple) { return ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] }); });\r\n};\r\n//# sourceMappingURL=templateFactory.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js": /*!***********************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UrlRouterProvider\": () => (/* binding */ UrlRouterProvider)\n/* harmony export */ });\n/* harmony import */ var _uirouter_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @uirouter/core */ \"./node_modules/@uirouter/core/lib-esm/index.js\");\n/** @publicapi @module url */ /** */\r\n\r\n\r\n/**\r\n * Manages rules for client-side URL\r\n *\r\n * ### Deprecation warning:\r\n * This class is now considered to be an internal API\r\n * Use the [[UrlService]] instead.\r\n * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].\r\n *\r\n * This class manages the router rules for what to do when the URL changes.\r\n *\r\n * This provider remains for backwards compatibility.\r\n *\r\n * @internalapi\r\n * @deprecated\r\n */\r\nvar UrlRouterProvider = /** @class */ (function () {\r\n /** @hidden */\r\n function UrlRouterProvider(/** @hidden */ router) {\r\n this.router = router;\r\n }\r\n UrlRouterProvider.injectableHandler = function (router, handler) {\r\n return function (match) { return _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params }); };\r\n };\r\n /** @hidden */\r\n UrlRouterProvider.prototype.$get = function () {\r\n var urlService = this.router.urlService;\r\n this.router.urlRouter.update(true);\r\n if (!urlService.interceptDeferred)\r\n urlService.listen();\r\n return this.router.urlRouter;\r\n };\r\n /**\r\n * Registers a url handler function.\r\n *\r\n * Registers a low level url handler (a `rule`).\r\n * A rule detects specific URL patterns and returns a redirect, or performs some action.\r\n *\r\n * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var app = angular.module('app', ['ui.router.router']);\r\n *\r\n * app.config(function ($urlRouterProvider) {\r\n * // Here's an example of how you might allow case insensitive urls\r\n * $urlRouterProvider.rule(function ($injector, $location) {\r\n * var path = $location.path(),\r\n * normalized = path.toLowerCase();\r\n *\r\n * if (path !== normalized) {\r\n * return normalized;\r\n * }\r\n * });\r\n * });\r\n * ```\r\n *\r\n * @param ruleFn\r\n * Handler function that takes `$injector` and `$location` services as arguments.\r\n * You can use them to detect a url and return a different url as a string.\r\n *\r\n * @return [[UrlRouterProvider]] (`this`)\r\n */\r\n UrlRouterProvider.prototype.rule = function (ruleFn) {\r\n var _this = this;\r\n if (!(0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(ruleFn))\r\n throw new Error(\"'rule' must be a function\");\r\n var match = function () { return ruleFn(_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector, _this.router.locationService); };\r\n var rule = new _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.BaseUrlRule(match, _uirouter_core__WEBPACK_IMPORTED_MODULE_0__.identity);\r\n this.router.urlService.rules.rule(rule);\r\n return this;\r\n };\r\n /**\r\n * Defines the path or behavior to use when no url can be matched.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var app = angular.module('app', ['ui.router.router']);\r\n *\r\n * app.config(function ($urlRouterProvider) {\r\n * // if the path doesn't match any of the urls you configured\r\n * // otherwise will take care of routing the user to the\r\n * // specified url\r\n * $urlRouterProvider.otherwise('/index');\r\n *\r\n * // Example of using function rule as param\r\n * $urlRouterProvider.otherwise(function ($injector, $location) {\r\n * return '/a/valid/url';\r\n * });\r\n * });\r\n * ```\r\n *\r\n * @param rule\r\n * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.\r\n * The function version is passed two params: `$injector` and `$location` services, and should return a url string.\r\n *\r\n * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\r\n */\r\n UrlRouterProvider.prototype.otherwise = function (rule) {\r\n var _this = this;\r\n var urlRules = this.router.urlService.rules;\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isString)(rule)) {\r\n urlRules.otherwise(rule);\r\n }\r\n else if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(rule)) {\r\n urlRules.otherwise(function () { return rule(_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.services.$injector, _this.router.locationService); });\r\n }\r\n else {\r\n throw new Error(\"'rule' must be a string or function\");\r\n }\r\n return this;\r\n };\r\n /**\r\n * Registers a handler for a given url matching.\r\n *\r\n * If the handler is a string, it is\r\n * treated as a redirect, and is interpolated according to the syntax of match\r\n * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\r\n *\r\n * If the handler is a function, it is injectable.\r\n * It gets invoked if `$location` matches.\r\n * You have the option of inject the match object as `$match`.\r\n *\r\n * The handler can return\r\n *\r\n * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\r\n * will continue trying to find another one that matches.\r\n * - **string** which is treated as a redirect and passed to `$location.url()`\r\n * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var app = angular.module('app', ['ui.router.router']);\r\n *\r\n * app.config(function ($urlRouterProvider) {\r\n * $urlRouterProvider.when($state.url, function ($match, $stateParams) {\r\n * if ($state.$current.navigable !== state ||\r\n * !equalForKeys($match, $stateParams) {\r\n * $state.transitionTo(state, $match, false);\r\n * }\r\n * });\r\n * });\r\n * ```\r\n *\r\n * @param what A pattern string to match, compiled as a [[UrlMatcher]].\r\n * @param handler The path (or function that returns a path) that you want to redirect your user to.\r\n * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]\r\n *\r\n * Note: the handler may also invoke arbitrary code, such as `$state.go()`\r\n */\r\n UrlRouterProvider.prototype.when = function (what, handler) {\r\n if ((0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isArray)(handler) || (0,_uirouter_core__WEBPACK_IMPORTED_MODULE_0__.isFunction)(handler)) {\r\n handler = UrlRouterProvider.injectableHandler(this.router, handler);\r\n }\r\n this.router.urlService.rules.when(what, handler);\r\n return this;\r\n };\r\n /**\r\n * Disables monitoring of the URL.\r\n *\r\n * Call this method before UI-Router has bootstrapped.\r\n * It will stop UI-Router from performing the initial url sync.\r\n *\r\n * This can be useful to perform some asynchronous initialization before the router starts.\r\n * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.\r\n *\r\n * #### Example:\r\n * ```js\r\n * var app = angular.module('app', ['ui.router']);\r\n *\r\n * app.config(function ($urlRouterProvider) {\r\n * // Prevent $urlRouter from automatically intercepting URL changes;\r\n * $urlRouterProvider.deferIntercept();\r\n * })\r\n *\r\n * app.run(function (MyService, $urlRouter, $http) {\r\n * $http.get(\"/stuff\").then(function(resp) {\r\n * MyService.doStuff(resp.data);\r\n * $urlRouter.listen();\r\n * $urlRouter.sync();\r\n * });\r\n * });\r\n * ```\r\n *\r\n * @param defer Indicates whether to defer location change interception.\r\n * Passing no parameter is equivalent to `true`.\r\n */\r\n UrlRouterProvider.prototype.deferIntercept = function (defer) {\r\n this.router.urlService.deferIntercept(defer);\r\n };\r\n return UrlRouterProvider;\r\n}());\r\n\r\n//# sourceMappingURL=urlRouterProvider.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js?"); /***/ }), /***/ "./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js": /*!****************************************************************!*\ !*** ./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _angular__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./angular */ \"./node_modules/@uirouter/angularjs/lib-esm/angular.js\");\n/** @publicapi @module ng1 */ /** */\r\n\r\n/** @hidden */\r\nfunction $ViewScrollProvider() {\r\n var useAnchorScroll = false;\r\n this.useAnchorScroll = function () {\r\n useAnchorScroll = true;\r\n };\r\n this.$get = [\r\n '$anchorScroll',\r\n '$timeout',\r\n function ($anchorScroll, $timeout) {\r\n if (useAnchorScroll) {\r\n return $anchorScroll;\r\n }\r\n return function ($element) {\r\n return $timeout(function () {\r\n $element[0].scrollIntoView();\r\n }, 0, false);\r\n };\r\n },\r\n ];\r\n}\r\n_angular__WEBPACK_IMPORTED_MODULE_0__.ng.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\r\n//# sourceMappingURL=viewScroll.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/common/common.js": /*!**************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/common/common.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"_extend\": () => (/* binding */ _extend),\n/* harmony export */ \"_inArray\": () => (/* binding */ _inArray),\n/* harmony export */ \"_pushTo\": () => (/* binding */ _pushTo),\n/* harmony export */ \"_removeFrom\": () => (/* binding */ _removeFrom),\n/* harmony export */ \"allTrueR\": () => (/* binding */ allTrueR),\n/* harmony export */ \"ancestors\": () => (/* binding */ ancestors),\n/* harmony export */ \"anyTrueR\": () => (/* binding */ anyTrueR),\n/* harmony export */ \"applyPairs\": () => (/* binding */ applyPairs),\n/* harmony export */ \"arrayTuples\": () => (/* binding */ arrayTuples),\n/* harmony export */ \"assertFn\": () => (/* binding */ assertFn),\n/* harmony export */ \"assertMap\": () => (/* binding */ assertMap),\n/* harmony export */ \"assertPredicate\": () => (/* binding */ assertPredicate),\n/* harmony export */ \"copy\": () => (/* binding */ copy),\n/* harmony export */ \"createProxyFunctions\": () => (/* binding */ createProxyFunctions),\n/* harmony export */ \"defaults\": () => (/* binding */ defaults),\n/* harmony export */ \"deregAll\": () => (/* binding */ deregAll),\n/* harmony export */ \"equals\": () => (/* binding */ equals),\n/* harmony export */ \"extend\": () => (/* binding */ extend),\n/* harmony export */ \"filter\": () => (/* binding */ filter),\n/* harmony export */ \"find\": () => (/* binding */ find),\n/* harmony export */ \"flatten\": () => (/* binding */ flatten),\n/* harmony export */ \"flattenR\": () => (/* binding */ flattenR),\n/* harmony export */ \"forEach\": () => (/* binding */ forEach),\n/* harmony export */ \"fromJson\": () => (/* binding */ fromJson),\n/* harmony export */ \"identity\": () => (/* binding */ identity),\n/* harmony export */ \"inArray\": () => (/* binding */ inArray),\n/* harmony export */ \"inherit\": () => (/* binding */ inherit),\n/* harmony export */ \"map\": () => (/* binding */ map),\n/* harmony export */ \"mapObj\": () => (/* binding */ mapObj),\n/* harmony export */ \"mergeR\": () => (/* binding */ mergeR),\n/* harmony export */ \"noop\": () => (/* binding */ noop),\n/* harmony export */ \"omit\": () => (/* binding */ omit),\n/* harmony export */ \"pairs\": () => (/* binding */ pairs),\n/* harmony export */ \"pick\": () => (/* binding */ pick),\n/* harmony export */ \"pluck\": () => (/* binding */ pluck),\n/* harmony export */ \"pushR\": () => (/* binding */ pushR),\n/* harmony export */ \"pushTo\": () => (/* binding */ pushTo),\n/* harmony export */ \"removeFrom\": () => (/* binding */ removeFrom),\n/* harmony export */ \"root\": () => (/* binding */ root),\n/* harmony export */ \"silenceUncaughtInPromise\": () => (/* binding */ silenceUncaughtInPromise),\n/* harmony export */ \"silentRejection\": () => (/* binding */ silentRejection),\n/* harmony export */ \"tail\": () => (/* binding */ tail),\n/* harmony export */ \"toJson\": () => (/* binding */ toJson),\n/* harmony export */ \"uniqR\": () => (/* binding */ uniqR),\n/* harmony export */ \"unnest\": () => (/* binding */ unnest),\n/* harmony export */ \"unnestR\": () => (/* binding */ unnestR),\n/* harmony export */ \"values\": () => (/* binding */ values)\n/* harmony export */ });\n/* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _coreservices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\nvar __spreadArrays = (undefined && undefined.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\n/**\n * Random utility functions used in the UI-Router code\n *\n * These functions are exported, but are subject to change without notice.\n *\n * @packageDocumentation\n * @preferred\n */\n\n\n\nvar root = (typeof self === 'object' && self.self === self && self) ||\n (typeof __webpack_require__.g === 'object' && __webpack_require__.g.global === __webpack_require__.g && __webpack_require__.g) ||\n undefined;\nvar angular = root.angular || {};\nvar fromJson = angular.fromJson || JSON.parse.bind(JSON);\nvar toJson = angular.toJson || JSON.stringify.bind(JSON);\nvar forEach = angular.forEach || _forEach;\nvar extend = Object.assign || _extend;\nvar equals = angular.equals || _equals;\nfunction identity(x) {\n return x;\n}\nfunction noop() { }\n/**\n * Builds proxy functions on the `to` object which pass through to the `from` object.\n *\n * For each key in `fnNames`, creates a proxy function on the `to` object.\n * The proxy function calls the real function on the `from` object.\n *\n *\n * #### Example:\n * This example creates an new class instance whose functions are prebound to the new'd object.\n * ```js\n * class Foo {\n * constructor(data) {\n * // Binds all functions from Foo.prototype to 'this',\n * // then copies them to 'this'\n * bindFunctions(Foo.prototype, this, this);\n * this.data = data;\n * }\n *\n * log() {\n * console.log(this.data);\n * }\n * }\n *\n * let myFoo = new Foo([1,2,3]);\n * var logit = myFoo.log;\n * logit(); // logs [1, 2, 3] from the myFoo 'this' instance\n * ```\n *\n * #### Example:\n * This example creates a bound version of a service function, and copies it to another object\n * ```\n *\n * var SomeService = {\n * this.data = [3, 4, 5];\n * this.log = function() {\n * console.log(this.data);\n * }\n * }\n *\n * // Constructor fn\n * function OtherThing() {\n * // Binds all functions from SomeService to SomeService,\n * // then copies them to 'this'\n * bindFunctions(SomeService, this, SomeService);\n * }\n *\n * let myOtherThing = new OtherThing();\n * myOtherThing.log(); // logs [3, 4, 5] from SomeService's 'this'\n * ```\n *\n * @param source A function that returns the source object which contains the original functions to be bound\n * @param target A function that returns the target object which will receive the bound functions\n * @param bind A function that returns the object which the functions will be bound to\n * @param fnNames The function names which will be bound (Defaults to all the functions found on the 'from' object)\n * @param latebind If true, the binding of the function is delayed until the first time it's invoked\n */\nfunction createProxyFunctions(source, target, bind, fnNames, latebind) {\n if (latebind === void 0) { latebind = false; }\n var bindFunction = function (fnName) { return source()[fnName].bind(bind()); };\n var makeLateRebindFn = function (fnName) {\n return function lateRebindFunction() {\n target[fnName] = bindFunction(fnName);\n return target[fnName].apply(null, arguments);\n };\n };\n fnNames = fnNames || Object.keys(source());\n return fnNames.reduce(function (acc, name) {\n acc[name] = latebind ? makeLateRebindFn(name) : bindFunction(name);\n return acc;\n }, target);\n}\n/**\n * prototypal inheritance helper.\n * Creates a new object which has `parent` object as its prototype, and then copies the properties from `extra` onto it\n */\nvar inherit = function (parent, extra) { return extend(Object.create(parent), extra); };\n/** Given an array, returns true if the object is found in the array, (using indexOf) */\nvar inArray = (0,_hof__WEBPACK_IMPORTED_MODULE_1__.curry)(_inArray);\nfunction _inArray(array, obj) {\n return array.indexOf(obj) !== -1;\n}\n/**\n * Given an array, and an item, if the item is found in the array, it removes it (in-place).\n * The same array is returned\n */\nvar removeFrom = (0,_hof__WEBPACK_IMPORTED_MODULE_1__.curry)(_removeFrom);\nfunction _removeFrom(array, obj) {\n var idx = array.indexOf(obj);\n if (idx >= 0)\n array.splice(idx, 1);\n return array;\n}\n/** pushes a values to an array and returns the value */\nvar pushTo = (0,_hof__WEBPACK_IMPORTED_MODULE_1__.curry)(_pushTo);\nfunction _pushTo(arr, val) {\n return arr.push(val), val;\n}\n/** Given an array of (deregistration) functions, calls all functions and removes each one from the source array */\nvar deregAll = function (functions) {\n return functions.slice().forEach(function (fn) {\n typeof fn === 'function' && fn();\n removeFrom(functions, fn);\n });\n};\n/**\n * Applies a set of defaults to an options object. The options object is filtered\n * to only those properties of the objects in the defaultsList.\n * Earlier objects in the defaultsList take precedence when applying defaults.\n */\nfunction defaults(opts) {\n var defaultsList = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n defaultsList[_i - 1] = arguments[_i];\n }\n var defaultVals = extend.apply(void 0, __spreadArrays([{}], defaultsList.reverse()));\n return extend(defaultVals, pick(opts || {}, Object.keys(defaultVals)));\n}\n/** Reduce function that merges each element of the list into a single object, using extend */\nvar mergeR = function (memo, item) { return extend(memo, item); };\n/**\n * Finds the common ancestor path between two states.\n *\n * @param {Object} first The first state.\n * @param {Object} second The second state.\n * @return {Array} Returns an array of state names in descending order, not including the root.\n */\nfunction ancestors(first, second) {\n var path = [];\n // tslint:disable-next-line:forin\n for (var n in first.path) {\n if (first.path[n] !== second.path[n])\n break;\n path.push(first.path[n]);\n }\n return path;\n}\n/**\n * Return a copy of the object only containing the whitelisted properties.\n *\n * #### Example:\n * ```\n * var foo = { a: 1, b: 2, c: 3 };\n * var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 }\n * ```\n * @param obj the source object\n * @param propNames an Array of strings, which are the whitelisted property names\n */\nfunction pick(obj, propNames) {\n var objCopy = {};\n for (var _prop in obj) {\n if (propNames.indexOf(_prop) !== -1) {\n objCopy[_prop] = obj[_prop];\n }\n }\n return objCopy;\n}\n/**\n * Return a copy of the object omitting the blacklisted properties.\n *\n * @example\n * ```\n *\n * var foo = { a: 1, b: 2, c: 3 };\n * var ab = omit(foo, ['a', 'b']); // { c: 3 }\n * ```\n * @param obj the source object\n * @param propNames an Array of strings, which are the blacklisted property names\n */\nfunction omit(obj, propNames) {\n return Object.keys(obj)\n .filter((0,_hof__WEBPACK_IMPORTED_MODULE_1__.not)(inArray(propNames)))\n .reduce(function (acc, key) { return ((acc[key] = obj[key]), acc); }, {});\n}\n/**\n * Maps an array, or object to a property (by name)\n */\nfunction pluck(collection, propName) {\n return map(collection, (0,_hof__WEBPACK_IMPORTED_MODULE_1__.prop)(propName));\n}\n/** Filters an Array or an Object's properties based on a predicate */\nfunction filter(collection, callback) {\n var arr = (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(collection), result = arr ? [] : {};\n var accept = arr ? function (x) { return result.push(x); } : function (x, key) { return (result[key] = x); };\n forEach(collection, function (item, i) {\n if (callback(item, i))\n accept(item, i);\n });\n return result;\n}\n/** Finds an object from an array, or a property of an object, that matches a predicate */\nfunction find(collection, callback) {\n var result;\n forEach(collection, function (item, i) {\n if (result)\n return;\n if (callback(item, i))\n result = item;\n });\n return result;\n}\n/** Given an object, returns a new object, where each property is transformed by the callback function */\nvar mapObj = map;\n/** Maps an array or object properties using a callback function */\nfunction map(collection, callback, target) {\n target = target || ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(collection) ? [] : {});\n forEach(collection, function (item, i) { return (target[i] = callback(item, i)); });\n return target;\n}\n/**\n * Given an object, return its enumerable property values\n *\n * @example\n * ```\n *\n * let foo = { a: 1, b: 2, c: 3 }\n * let vals = values(foo); // [ 1, 2, 3 ]\n * ```\n */\nvar values = function (obj) { return Object.keys(obj).map(function (key) { return obj[key]; }); };\n/**\n * Reduce function that returns true if all of the values are truthy.\n *\n * @example\n * ```\n *\n * let vals = [ 1, true, {}, \"hello world\"];\n * vals.reduce(allTrueR, true); // true\n *\n * vals.push(0);\n * vals.reduce(allTrueR, true); // false\n * ```\n */\nvar allTrueR = function (memo, elem) { return memo && elem; };\n/**\n * Reduce function that returns true if any of the values are truthy.\n *\n * * @example\n * ```\n *\n * let vals = [ 0, null, undefined ];\n * vals.reduce(anyTrueR, true); // false\n *\n * vals.push(\"hello world\");\n * vals.reduce(anyTrueR, true); // true\n * ```\n */\nvar anyTrueR = function (memo, elem) { return memo || elem; };\n/**\n * Reduce function which un-nests a single level of arrays\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * input.reduce(unnestR, []) // [ \"a\", \"b\", \"c\", \"d\", [ \"double, \"nested\" ] ]\n * ```\n */\nvar unnestR = function (memo, elem) { return memo.concat(elem); };\n/**\n * Reduce function which recursively un-nests all arrays\n *\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * input.reduce(unnestR, []) // [ \"a\", \"b\", \"c\", \"d\", \"double, \"nested\" ]\n * ```\n */\nvar flattenR = function (memo, elem) {\n return (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(elem) ? memo.concat(elem.reduce(flattenR, [])) : pushR(memo, elem);\n};\n/**\n * Reduce function that pushes an object to an array, then returns the array.\n * Mostly just for [[flattenR]] and [[uniqR]]\n */\nfunction pushR(arr, obj) {\n arr.push(obj);\n return arr;\n}\n/** Reduce function that filters out duplicates */\nvar uniqR = function (acc, token) { return (inArray(acc, token) ? acc : pushR(acc, token)); };\n/**\n * Return a new array with a single level of arrays unnested.\n *\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * unnest(input) // [ \"a\", \"b\", \"c\", \"d\", [ \"double, \"nested\" ] ]\n * ```\n */\nvar unnest = function (arr) { return arr.reduce(unnestR, []); };\n/**\n * Return a completely flattened version of an array.\n *\n * @example\n * ```\n *\n * let input = [ [ \"a\", \"b\" ], [ \"c\", \"d\" ], [ [ \"double\", \"nested\" ] ] ];\n * flatten(input) // [ \"a\", \"b\", \"c\", \"d\", \"double, \"nested\" ]\n * ```\n */\nvar flatten = function (arr) { return arr.reduce(flattenR, []); };\n/**\n * Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass.\n * @example\n * ```\n *\n * let isNumber = (obj) => typeof(obj) === 'number';\n * let allNumbers = [ 1, 2, 3, 4, 5 ];\n * allNumbers.filter(assertPredicate(isNumber)); //OK\n *\n * let oneString = [ 1, 2, 3, 4, \"5\" ];\n * oneString.filter(assertPredicate(isNumber, \"Not all numbers\")); // throws Error(\"\"Not all numbers\"\");\n * ```\n */\nvar assertPredicate = assertFn;\n/**\n * Given a .map function, builds a .map function which throws an error if any mapped elements do not pass a truthyness test.\n * @example\n * ```\n *\n * var data = { foo: 1, bar: 2 };\n *\n * let keys = [ 'foo', 'bar' ]\n * let values = keys.map(assertMap(key => data[key], \"Key not found\"));\n * // values is [1, 2]\n *\n * let keys = [ 'foo', 'bar', 'baz' ]\n * let values = keys.map(assertMap(key => data[key], \"Key not found\"));\n * // throws Error(\"Key not found\")\n * ```\n */\nvar assertMap = assertFn;\nfunction assertFn(predicateOrMap, errMsg) {\n if (errMsg === void 0) { errMsg = 'assert failure'; }\n return function (obj) {\n var result = predicateOrMap(obj);\n if (!result) {\n throw new Error((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isFunction)(errMsg) ? errMsg(obj) : errMsg);\n }\n return result;\n };\n}\n/**\n * Like _.pairs: Given an object, returns an array of key/value pairs\n *\n * @example\n * ```\n *\n * pairs({ foo: \"FOO\", bar: \"BAR }) // [ [ \"foo\", \"FOO\" ], [ \"bar\": \"BAR\" ] ]\n * ```\n */\nvar pairs = function (obj) { return Object.keys(obj).map(function (key) { return [key, obj[key]]; }); };\n/**\n * Given two or more parallel arrays, returns an array of tuples where\n * each tuple is composed of [ a[i], b[i], ... z[i] ]\n *\n * @example\n * ```\n *\n * let foo = [ 0, 2, 4, 6 ];\n * let bar = [ 1, 3, 5, 7 ];\n * let baz = [ 10, 30, 50, 70 ];\n * arrayTuples(foo, bar); // [ [0, 1], [2, 3], [4, 5], [6, 7] ]\n * arrayTuples(foo, bar, baz); // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ]\n * ```\n */\nfunction arrayTuples() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 0)\n return [];\n var maxArrayLen = args.reduce(function (min, arr) { return Math.min(arr.length, min); }, 9007199254740991); // aka 2^53 − 1 aka Number.MAX_SAFE_INTEGER\n var result = [];\n var _loop_1 = function (i) {\n // This is a hot function\n // Unroll when there are 1-4 arguments\n switch (args.length) {\n case 1:\n result.push([args[0][i]]);\n break;\n case 2:\n result.push([args[0][i], args[1][i]]);\n break;\n case 3:\n result.push([args[0][i], args[1][i], args[2][i]]);\n break;\n case 4:\n result.push([args[0][i], args[1][i], args[2][i], args[3][i]]);\n break;\n default:\n result.push(args.map(function (array) { return array[i]; }));\n break;\n }\n };\n for (var i = 0; i < maxArrayLen; i++) {\n _loop_1(i);\n }\n return result;\n}\n/**\n * Reduce function which builds an object from an array of [key, value] pairs.\n *\n * Each iteration sets the key/val pair on the memo object, then returns the memo for the next iteration.\n *\n * Each keyValueTuple should be an array with values [ key: string, value: any ]\n *\n * @example\n * ```\n *\n * var pairs = [ [\"fookey\", \"fooval\"], [\"barkey\", \"barval\"] ]\n *\n * var pairsToObj = pairs.reduce((memo, pair) => applyPairs(memo, pair), {})\n * // pairsToObj == { fookey: \"fooval\", barkey: \"barval\" }\n *\n * // Or, more simply:\n * var pairsToObj = pairs.reduce(applyPairs, {})\n * // pairsToObj == { fookey: \"fooval\", barkey: \"barval\" }\n * ```\n */\nfunction applyPairs(memo, keyValTuple) {\n var key, value;\n if ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(keyValTuple))\n key = keyValTuple[0], value = keyValTuple[1];\n if (!(0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(key))\n throw new Error('invalid parameters to applyPairs');\n memo[key] = value;\n return memo;\n}\n/** Get the last element of an array */\nfunction tail(arr) {\n return (arr.length && arr[arr.length - 1]) || undefined;\n}\n/**\n * shallow copy from src to dest\n */\nfunction copy(src, dest) {\n if (dest)\n Object.keys(dest).forEach(function (key) { return delete dest[key]; });\n if (!dest)\n dest = {};\n return extend(dest, src);\n}\n/** Naive forEach implementation works with Objects or Arrays */\nfunction _forEach(obj, cb, _this) {\n if ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(obj))\n return obj.forEach(cb, _this);\n Object.keys(obj).forEach(function (key) { return cb(obj[key], key); });\n}\nfunction _extend(toObj) {\n for (var i = 1; i < arguments.length; i++) {\n var obj = arguments[i];\n if (!obj)\n continue;\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; j++) {\n toObj[keys[j]] = obj[keys[j]];\n }\n }\n return toObj;\n}\nfunction _equals(o1, o2) {\n if (o1 === o2)\n return true;\n if (o1 === null || o2 === null)\n return false;\n if (o1 !== o1 && o2 !== o2)\n return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2;\n if (t1 !== t2 || t1 !== 'object')\n return false;\n var tup = [o1, o2];\n if ((0,_hof__WEBPACK_IMPORTED_MODULE_1__.all)(_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(tup))\n return _arraysEq(o1, o2);\n if ((0,_hof__WEBPACK_IMPORTED_MODULE_1__.all)(_predicates__WEBPACK_IMPORTED_MODULE_0__.isDate)(tup))\n return o1.getTime() === o2.getTime();\n if ((0,_hof__WEBPACK_IMPORTED_MODULE_1__.all)(_predicates__WEBPACK_IMPORTED_MODULE_0__.isRegExp)(tup))\n return o1.toString() === o2.toString();\n if ((0,_hof__WEBPACK_IMPORTED_MODULE_1__.all)(_predicates__WEBPACK_IMPORTED_MODULE_0__.isFunction)(tup))\n return true; // meh\n var predicates = [_predicates__WEBPACK_IMPORTED_MODULE_0__.isFunction, _predicates__WEBPACK_IMPORTED_MODULE_0__.isArray, _predicates__WEBPACK_IMPORTED_MODULE_0__.isDate, _predicates__WEBPACK_IMPORTED_MODULE_0__.isRegExp];\n if (predicates.map(_hof__WEBPACK_IMPORTED_MODULE_1__.any).reduce(function (b, fn) { return b || !!fn(tup); }, false))\n return false;\n var keys = {};\n // tslint:disable-next-line:forin\n for (var key in o1) {\n if (!_equals(o1[key], o2[key]))\n return false;\n keys[key] = true;\n }\n for (var key in o2) {\n if (!keys[key])\n return false;\n }\n return true;\n}\nfunction _arraysEq(a1, a2) {\n if (a1.length !== a2.length)\n return false;\n return arrayTuples(a1, a2).reduce(function (b, t) { return b && _equals(t[0], t[1]); }, true);\n}\n// issue #2676\nvar silenceUncaughtInPromise = function (promise) { return promise.catch(function (e) { return 0; }) && promise; };\nvar silentRejection = function (error) { return silenceUncaughtInPromise(_coreservices__WEBPACK_IMPORTED_MODULE_2__.services.$q.reject(error)); };\n//# sourceMappingURL=common.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/common/common.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/common/coreservices.js": /*!********************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/common/coreservices.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"makeStub\": () => (/* binding */ makeStub),\n/* harmony export */ \"services\": () => (/* binding */ services)\n/* harmony export */ });\nvar noImpl = function (fnname) { return function () {\n throw new Error(\"No implementation for \" + fnname + \". The framework specific code did not implement this method.\");\n}; };\nvar makeStub = function (service, methods) {\n return methods.reduce(function (acc, key) { return ((acc[key] = noImpl(service + \".\" + key + \"()\")), acc); }, {});\n};\nvar services = {\n $q: undefined,\n $injector: undefined,\n};\n\n//# sourceMappingURL=coreservices.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/common/coreservices.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/common/glob.js": /*!************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/common/glob.js ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Glob\": () => (/* binding */ Glob)\n/* harmony export */ });\n/**\n * Matches state names using glob-like pattern strings.\n *\n * Globs can be used in specific APIs including:\n *\n * - [[StateService.is]]\n * - [[StateService.includes]]\n * - The first argument to Hook Registration functions like [[TransitionService.onStart]]\n * - [[HookMatchCriteria]] and [[HookMatchCriterion]]\n *\n * A `Glob` string is a pattern which matches state names.\n * Nested state names are split into segments (separated by a dot) when processing.\n * The state named `foo.bar.baz` is split into three segments ['foo', 'bar', 'baz']\n *\n * Globs work according to the following rules:\n *\n * ### Exact match:\n *\n * The glob `'A.B'` matches the state named exactly `'A.B'`.\n *\n * | Glob |Matches states named|Does not match state named|\n * |:------------|:--------------------|:---------------------|\n * | `'A'` | `'A'` | `'B'` , `'A.C'` |\n * | `'A.B'` | `'A.B'` | `'A'` , `'A.B.C'` |\n * | `'foo'` | `'foo'` | `'FOO'` , `'foo.bar'`|\n *\n * ### Single star (`*`)\n *\n * A single star (`*`) is a wildcard that matches exactly one segment.\n *\n * | Glob |Matches states named |Does not match state named |\n * |:------------|:---------------------|:--------------------------|\n * | `'*'` | `'A'` , `'Z'` | `'A.B'` , `'Z.Y.X'` |\n * | `'A.*'` | `'A.B'` , `'A.C'` | `'A'` , `'A.B.C'` |\n * | `'A.*.*'` | `'A.B.C'` , `'A.X.Y'`| `'A'`, `'A.B'` , `'Z.Y.X'`|\n *\n * ### Double star (`**`)\n *\n * A double star (`'**'`) is a wildcard that matches *zero or more segments*\n *\n * | Glob |Matches states named |Does not match state named |\n * |:------------|:----------------------------------------------|:----------------------------------|\n * | `'**'` | `'A'` , `'A.B'`, `'Z.Y.X'` | (matches all states) |\n * | `'A.**'` | `'A'` , `'A.B'` , `'A.C.X'` | `'Z.Y.X'` |\n * | `'**.X'` | `'X'` , `'A.X'` , `'Z.Y.X'` | `'A'` , `'A.login.Z'` |\n * | `'A.**.X'` | `'A.X'` , `'A.B.X'` , `'A.B.C.X'` | `'A'` , `'A.B.C'` |\n *\n * @packageDocumentation\n */\nvar Glob = /** @class */ (function () {\n function Glob(text) {\n this.text = text;\n this.glob = text.split('.');\n var regexpString = this.text\n .split('.')\n .map(function (seg) {\n if (seg === '**')\n return '(?:|(?:\\\\.[^.]*)*)';\n if (seg === '*')\n return '\\\\.[^.]*';\n return '\\\\.' + seg;\n })\n .join('');\n this.regexp = new RegExp('^' + regexpString + '$');\n }\n /** Returns true if the string has glob-like characters in it */\n Glob.is = function (text) {\n return !!/[!,*]+/.exec(text);\n };\n /** Returns a glob from the string, or null if the string isn't Glob-like */\n Glob.fromString = function (text) {\n return Glob.is(text) ? new Glob(text) : null;\n };\n Glob.prototype.matches = function (name) {\n return this.regexp.test('.' + name);\n };\n return Glob;\n}());\n\n//# sourceMappingURL=glob.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/common/glob.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/common/hof.js": /*!***********************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/common/hof.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"all\": () => (/* binding */ all),\n/* harmony export */ \"and\": () => (/* binding */ and),\n/* harmony export */ \"any\": () => (/* binding */ any),\n/* harmony export */ \"compose\": () => (/* binding */ compose),\n/* harmony export */ \"curry\": () => (/* binding */ curry),\n/* harmony export */ \"eq\": () => (/* binding */ eq),\n/* harmony export */ \"invoke\": () => (/* binding */ invoke),\n/* harmony export */ \"is\": () => (/* binding */ is),\n/* harmony export */ \"not\": () => (/* binding */ not),\n/* harmony export */ \"or\": () => (/* binding */ or),\n/* harmony export */ \"parse\": () => (/* binding */ parse),\n/* harmony export */ \"pattern\": () => (/* binding */ pattern),\n/* harmony export */ \"pipe\": () => (/* binding */ pipe),\n/* harmony export */ \"prop\": () => (/* binding */ prop),\n/* harmony export */ \"propEq\": () => (/* binding */ propEq),\n/* harmony export */ \"val\": () => (/* binding */ val)\n/* harmony export */ });\n/**\n * Higher order functions\n *\n * These utility functions are exported, but are subject to change without notice.\n *\n * @packageDocumentation\n */\nvar __spreadArrays = (undefined && undefined.__spreadArrays) || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n};\n/**\n * Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function.\n *\n * Given a function with N parameters, returns a new function that supports partial application.\n * The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters,\n * where M is less than N, it returns a new function that accepts the remaining parameters. It continues to\n * accept more parameters until all N parameters have been supplied.\n *\n *\n * This contrived example uses a partially applied function as an predicate, which returns true\n * if an object is found in both arrays.\n * @example\n * ```\n * // returns true if an object is in both of the two arrays\n * function inBoth(array1, array2, object) {\n * return array1.indexOf(object) !== -1 &&\n * array2.indexOf(object) !== 1;\n * }\n * let obj1, obj2, obj3, obj4, obj5, obj6, obj7\n * let foos = [obj1, obj3]\n * let bars = [obj3, obj4, obj5]\n *\n * // A curried \"copy\" of inBoth\n * let curriedInBoth = curry(inBoth);\n * // Partially apply both the array1 and array2\n * let inFoosAndBars = curriedInBoth(foos, bars);\n *\n * // Supply the final argument; since all arguments are\n * // supplied, the original inBoth function is then called.\n * let obj1InBoth = inFoosAndBars(obj1); // false\n *\n * // Use the inFoosAndBars as a predicate.\n * // Filter, on each iteration, supplies the final argument\n * let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ];\n * let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ]\n *\n * ```\n *\n * @param fn\n * @returns {*|function(): (*|any)}\n */\nfunction curry(fn) {\n return function curried() {\n if (arguments.length >= fn.length) {\n return fn.apply(this, arguments);\n }\n var args = Array.prototype.slice.call(arguments);\n return curried.bind.apply(curried, __spreadArrays([this], args));\n };\n}\n/**\n * Given a varargs list of functions, returns a function that composes the argument functions, right-to-left\n * given: f(x), g(x), h(x)\n * let composed = compose(f,g,h)\n * then, composed is: f(g(h(x)))\n */\nfunction compose() {\n var args = arguments;\n var start = args.length - 1;\n return function () {\n var i = start, result = args[start].apply(this, arguments);\n while (i--)\n result = args[i].call(this, result);\n return result;\n };\n}\n/**\n * Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right\n * given: f(x), g(x), h(x)\n * let piped = pipe(f,g,h);\n * then, piped is: h(g(f(x)))\n */\nfunction pipe() {\n var funcs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n funcs[_i] = arguments[_i];\n }\n return compose.apply(null, [].slice.call(arguments).reverse());\n}\n/**\n * Given a property name, returns a function that returns that property from an object\n * let obj = { foo: 1, name: \"blarg\" };\n * let getName = prop(\"name\");\n * getName(obj) === \"blarg\"\n */\nvar prop = function (name) { return function (obj) { return obj && obj[name]; }; };\n/**\n * Given a property name and a value, returns a function that returns a boolean based on whether\n * the passed object has a property that matches the value\n * let obj = { foo: 1, name: \"blarg\" };\n * let getName = propEq(\"name\", \"blarg\");\n * getName(obj) === true\n */\nvar propEq = curry(function (name, _val, obj) { return obj && obj[name] === _val; });\n/**\n * Given a dotted property name, returns a function that returns a nested property from an object, or undefined\n * let obj = { id: 1, nestedObj: { foo: 1, name: \"blarg\" }, };\n * let getName = prop(\"nestedObj.name\");\n * getName(obj) === \"blarg\"\n * let propNotFound = prop(\"this.property.doesnt.exist\");\n * propNotFound(obj) === undefined\n */\nvar parse = function (name) { return pipe.apply(null, name.split('.').map(prop)); };\n/**\n * Given a function that returns a truthy or falsey value, returns a\n * function that returns the opposite (falsey or truthy) value given the same inputs\n */\nvar not = function (fn) { return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return !fn.apply(null, args);\n}; };\n/**\n * Given two functions that return truthy or falsey values, returns a function that returns truthy\n * if both functions return truthy for the given arguments\n */\nfunction and(fn1, fn2) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fn1.apply(null, args) && fn2.apply(null, args);\n };\n}\n/**\n * Given two functions that return truthy or falsey values, returns a function that returns truthy\n * if at least one of the functions returns truthy for the given arguments\n */\nfunction or(fn1, fn2) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fn1.apply(null, args) || fn2.apply(null, args);\n };\n}\n/**\n * Check if all the elements of an array match a predicate function\n *\n * @param fn1 a predicate function `fn1`\n * @returns a function which takes an array and returns true if `fn1` is true for all elements of the array\n */\nvar all = function (fn1) { return function (arr) { return arr.reduce(function (b, x) { return b && !!fn1(x); }, true); }; };\n// tslint:disable-next-line:variable-name\nvar any = function (fn1) { return function (arr) { return arr.reduce(function (b, x) { return b || !!fn1(x); }, false); }; };\n/** Given a class, returns a Predicate function that returns true if the object is of that class */\nvar is = function (ctor) { return function (obj) {\n return (obj != null && obj.constructor === ctor) || obj instanceof ctor;\n}; };\n/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */\nvar eq = function (value) { return function (other) { return value === other; }; };\n/** Given a value, returns a function which returns the value */\nvar val = function (v) { return function () { return v; }; };\nfunction invoke(fnName, args) {\n return function (obj) { return obj[fnName].apply(obj, args); };\n}\n/**\n * Sorta like Pattern Matching (a functional programming conditional construct)\n *\n * See http://c2.com/cgi/wiki?PatternMatching\n *\n * This is a conditional construct which allows a series of predicates and output functions\n * to be checked and then applied. Each predicate receives the input. If the predicate\n * returns truthy, then its matching output function (mapping function) is provided with\n * the input and, then the result is returned.\n *\n * Each combination (2-tuple) of predicate + output function should be placed in an array\n * of size 2: [ predicate, mapFn ]\n *\n * These 2-tuples should be put in an outer array.\n *\n * @example\n * ```\n *\n * // Here's a 2-tuple where the first element is the isString predicate\n * // and the second element is a function that returns a description of the input\n * let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];\n *\n * // Second tuple: predicate \"isNumber\", mapfn returns a description\n * let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];\n *\n * let third = [ (input) => input === null, (input) => `Oh, null...` ];\n *\n * let fourth = [ (input) => input === undefined, (input) => `notdefined` ];\n *\n * let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);\n *\n * console.log(descriptionOf(undefined)); // 'notdefined'\n * console.log(descriptionOf(55)); // '(55) That's a number!'\n * console.log(descriptionOf(\"foo\")); // 'Here's your string foo'\n * ```\n *\n * @param struct A 2D array. Each element of the array should be an array, a 2-tuple,\n * with a Predicate and a mapping/output function\n * @returns {function(any): *}\n */\nfunction pattern(struct) {\n return function (x) {\n for (var i = 0; i < struct.length; i++) {\n if (struct[i][0](x))\n return struct[i][1](x);\n }\n };\n}\n//# sourceMappingURL=hof.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/common/hof.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/common/index.js": /*!*************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/common/index.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Category\": () => (/* reexport safe */ _trace__WEBPACK_IMPORTED_MODULE_7__.Category),\n/* harmony export */ \"Glob\": () => (/* reexport safe */ _glob__WEBPACK_IMPORTED_MODULE_2__.Glob),\n/* harmony export */ \"Queue\": () => (/* reexport safe */ _queue__WEBPACK_IMPORTED_MODULE_5__.Queue),\n/* harmony export */ \"Trace\": () => (/* reexport safe */ _trace__WEBPACK_IMPORTED_MODULE_7__.Trace),\n/* harmony export */ \"_extend\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__._extend),\n/* harmony export */ \"_inArray\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__._inArray),\n/* harmony export */ \"_pushTo\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__._pushTo),\n/* harmony export */ \"_removeFrom\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__._removeFrom),\n/* harmony export */ \"all\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.all),\n/* harmony export */ \"allTrueR\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.allTrueR),\n/* harmony export */ \"ancestors\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.ancestors),\n/* harmony export */ \"and\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.and),\n/* harmony export */ \"any\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.any),\n/* harmony export */ \"anyTrueR\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.anyTrueR),\n/* harmony export */ \"applyPairs\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.applyPairs),\n/* harmony export */ \"arrayTuples\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.arrayTuples),\n/* harmony export */ \"assertFn\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.assertFn),\n/* harmony export */ \"assertMap\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.assertMap),\n/* harmony export */ \"assertPredicate\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.assertPredicate),\n/* harmony export */ \"beforeAfterSubstr\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.beforeAfterSubstr),\n/* harmony export */ \"compose\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.compose),\n/* harmony export */ \"copy\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.copy),\n/* harmony export */ \"createProxyFunctions\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions),\n/* harmony export */ \"curry\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.curry),\n/* harmony export */ \"defaults\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.defaults),\n/* harmony export */ \"deregAll\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.deregAll),\n/* harmony export */ \"eq\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.eq),\n/* harmony export */ \"equals\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.equals),\n/* harmony export */ \"extend\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.extend),\n/* harmony export */ \"filter\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.filter),\n/* harmony export */ \"find\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.find),\n/* harmony export */ \"flatten\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.flatten),\n/* harmony export */ \"flattenR\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.flattenR),\n/* harmony export */ \"fnToString\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.fnToString),\n/* harmony export */ \"forEach\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.forEach),\n/* harmony export */ \"fromJson\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.fromJson),\n/* harmony export */ \"functionToString\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.functionToString),\n/* harmony export */ \"hostRegex\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.hostRegex),\n/* harmony export */ \"identity\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.identity),\n/* harmony export */ \"inArray\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.inArray),\n/* harmony export */ \"inherit\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.inherit),\n/* harmony export */ \"invoke\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.invoke),\n/* harmony export */ \"is\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.is),\n/* harmony export */ \"isArray\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isArray),\n/* harmony export */ \"isDate\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isDate),\n/* harmony export */ \"isDefined\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isDefined),\n/* harmony export */ \"isFunction\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isFunction),\n/* harmony export */ \"isInjectable\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isInjectable),\n/* harmony export */ \"isNull\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isNull),\n/* harmony export */ \"isNullOrUndefined\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isNullOrUndefined),\n/* harmony export */ \"isNumber\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isNumber),\n/* harmony export */ \"isObject\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isObject),\n/* harmony export */ \"isPromise\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isPromise),\n/* harmony export */ \"isRegExp\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isRegExp),\n/* harmony export */ \"isString\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isString),\n/* harmony export */ \"isUndefined\": () => (/* reexport safe */ _predicates__WEBPACK_IMPORTED_MODULE_4__.isUndefined),\n/* harmony export */ \"joinNeighborsR\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.joinNeighborsR),\n/* harmony export */ \"kebobString\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.kebobString),\n/* harmony export */ \"makeStub\": () => (/* reexport safe */ _coreservices__WEBPACK_IMPORTED_MODULE_1__.makeStub),\n/* harmony export */ \"map\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.map),\n/* harmony export */ \"mapObj\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.mapObj),\n/* harmony export */ \"maxLength\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.maxLength),\n/* harmony export */ \"mergeR\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.mergeR),\n/* harmony export */ \"noop\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.noop),\n/* harmony export */ \"not\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.not),\n/* harmony export */ \"omit\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.omit),\n/* harmony export */ \"or\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.or),\n/* harmony export */ \"padString\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.padString),\n/* harmony export */ \"pairs\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.pairs),\n/* harmony export */ \"parse\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.parse),\n/* harmony export */ \"pattern\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.pattern),\n/* harmony export */ \"pick\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.pick),\n/* harmony export */ \"pipe\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.pipe),\n/* harmony export */ \"pluck\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.pluck),\n/* harmony export */ \"prop\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.prop),\n/* harmony export */ \"propEq\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.propEq),\n/* harmony export */ \"pushR\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.pushR),\n/* harmony export */ \"pushTo\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.pushTo),\n/* harmony export */ \"removeFrom\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.removeFrom),\n/* harmony export */ \"root\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.root),\n/* harmony export */ \"services\": () => (/* reexport safe */ _coreservices__WEBPACK_IMPORTED_MODULE_1__.services),\n/* harmony export */ \"silenceUncaughtInPromise\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.silenceUncaughtInPromise),\n/* harmony export */ \"silentRejection\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.silentRejection),\n/* harmony export */ \"splitEqual\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.splitEqual),\n/* harmony export */ \"splitHash\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.splitHash),\n/* harmony export */ \"splitOnDelim\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.splitOnDelim),\n/* harmony export */ \"splitQuery\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.splitQuery),\n/* harmony export */ \"stringify\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.stringify),\n/* harmony export */ \"stripLastPathElement\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.stripLastPathElement),\n/* harmony export */ \"tail\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.tail),\n/* harmony export */ \"toJson\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.toJson),\n/* harmony export */ \"trace\": () => (/* reexport safe */ _trace__WEBPACK_IMPORTED_MODULE_7__.trace),\n/* harmony export */ \"trimHashVal\": () => (/* reexport safe */ _strings__WEBPACK_IMPORTED_MODULE_6__.trimHashVal),\n/* harmony export */ \"uniqR\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.uniqR),\n/* harmony export */ \"unnest\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.unnest),\n/* harmony export */ \"unnestR\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.unnestR),\n/* harmony export */ \"val\": () => (/* reexport safe */ _hof__WEBPACK_IMPORTED_MODULE_3__.val),\n/* harmony export */ \"values\": () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.values)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _coreservices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n/* harmony import */ var _glob__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./glob */ \"./node_modules/@uirouter/core/lib-esm/common/glob.js\");\n/* harmony import */ var _hof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _queue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./queue */ \"./node_modules/@uirouter/core/lib-esm/common/queue.js\");\n/* harmony import */ var _strings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./strings */ \"./node_modules/@uirouter/core/lib-esm/common/strings.js\");\n/* harmony import */ var _trace__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./trace */ \"./node_modules/@uirouter/core/lib-esm/common/trace.js\");\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/common/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/common/predicates.js": /*!******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/common/predicates.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"isArray\": () => (/* binding */ isArray),\n/* harmony export */ \"isDate\": () => (/* binding */ isDate),\n/* harmony export */ \"isDefined\": () => (/* binding */ isDefined),\n/* harmony export */ \"isFunction\": () => (/* binding */ isFunction),\n/* harmony export */ \"isInjectable\": () => (/* binding */ isInjectable),\n/* harmony export */ \"isNull\": () => (/* binding */ isNull),\n/* harmony export */ \"isNullOrUndefined\": () => (/* binding */ isNullOrUndefined),\n/* harmony export */ \"isNumber\": () => (/* binding */ isNumber),\n/* harmony export */ \"isObject\": () => (/* binding */ isObject),\n/* harmony export */ \"isPromise\": () => (/* binding */ isPromise),\n/* harmony export */ \"isRegExp\": () => (/* binding */ isRegExp),\n/* harmony export */ \"isString\": () => (/* binding */ isString),\n/* harmony export */ \"isUndefined\": () => (/* binding */ isUndefined)\n/* harmony export */ });\n/* harmony import */ var _hof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/**\n * Predicates\n *\n * These predicates return true/false based on the input.\n * Although these functions are exported, they are subject to change without notice.\n *\n * @packageDocumentation\n */\n\nvar toStr = Object.prototype.toString;\nvar tis = function (t) { return function (x) { return typeof x === t; }; };\nvar isUndefined = tis('undefined');\nvar isDefined = (0,_hof__WEBPACK_IMPORTED_MODULE_0__.not)(isUndefined);\nvar isNull = function (o) { return o === null; };\nvar isNullOrUndefined = (0,_hof__WEBPACK_IMPORTED_MODULE_0__.or)(isNull, isUndefined);\nvar isFunction = tis('function');\nvar isNumber = tis('number');\nvar isString = tis('string');\nvar isObject = function (x) { return x !== null && typeof x === 'object'; };\nvar isArray = Array.isArray;\nvar isDate = (function (x) { return toStr.call(x) === '[object Date]'; });\nvar isRegExp = (function (x) { return toStr.call(x) === '[object RegExp]'; });\n/**\n * Predicate which checks if a value is injectable\n *\n * A value is \"injectable\" if it is a function, or if it is an ng1 array-notation-style array\n * where all the elements in the array are Strings, except the last one, which is a Function\n */\nfunction isInjectable(val) {\n if (isArray(val) && val.length) {\n var head = val.slice(0, -1), tail = val.slice(-1);\n return !(head.filter((0,_hof__WEBPACK_IMPORTED_MODULE_0__.not)(isString)).length || tail.filter((0,_hof__WEBPACK_IMPORTED_MODULE_0__.not)(isFunction)).length);\n }\n return isFunction(val);\n}\n/**\n * Predicate which checks if a value looks like a Promise\n *\n * It is probably a Promise if it's an object, and it has a `then` property which is a Function\n */\nvar isPromise = (0,_hof__WEBPACK_IMPORTED_MODULE_0__.and)(isObject, (0,_hof__WEBPACK_IMPORTED_MODULE_0__.pipe)((0,_hof__WEBPACK_IMPORTED_MODULE_0__.prop)('then'), isFunction));\n//# sourceMappingURL=predicates.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/common/predicates.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/common/queue.js": /*!*************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/common/queue.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Queue\": () => (/* binding */ Queue)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n\nvar Queue = /** @class */ (function () {\n function Queue(_items, _limit) {\n if (_items === void 0) { _items = []; }\n if (_limit === void 0) { _limit = null; }\n this._items = _items;\n this._limit = _limit;\n this._evictListeners = [];\n this.onEvict = (0,_common__WEBPACK_IMPORTED_MODULE_0__.pushTo)(this._evictListeners);\n }\n Queue.prototype.enqueue = function (item) {\n var items = this._items;\n items.push(item);\n if (this._limit && items.length > this._limit)\n this.evict();\n return item;\n };\n Queue.prototype.evict = function () {\n var item = this._items.shift();\n this._evictListeners.forEach(function (fn) { return fn(item); });\n return item;\n };\n Queue.prototype.dequeue = function () {\n if (this.size())\n return this._items.splice(0, 1)[0];\n };\n Queue.prototype.clear = function () {\n var current = this._items;\n this._items = [];\n return current;\n };\n Queue.prototype.size = function () {\n return this._items.length;\n };\n Queue.prototype.remove = function (item) {\n var idx = this._items.indexOf(item);\n return idx > -1 && this._items.splice(idx, 1)[0];\n };\n Queue.prototype.peekTail = function () {\n return this._items[this._items.length - 1];\n };\n Queue.prototype.peekHead = function () {\n if (this.size())\n return this._items[0];\n };\n return Queue;\n}());\n\n//# sourceMappingURL=queue.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/common/queue.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/common/safeConsole.js": /*!*******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/common/safeConsole.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"safeConsole\": () => (/* binding */ safeConsole)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/**\n * workaround for missing console object in IE9 when dev tools haven't been opened o_O\n * @packageDocumentation\n */\n/* tslint:disable:no-console */\n\nvar noopConsoleStub = { log: _common__WEBPACK_IMPORTED_MODULE_0__.noop, error: _common__WEBPACK_IMPORTED_MODULE_0__.noop, table: _common__WEBPACK_IMPORTED_MODULE_0__.noop };\nfunction ie9Console(console) {\n var bound = function (fn) { return Function.prototype.bind.call(fn, console); };\n return {\n log: bound(console.log),\n error: bound(console.log),\n table: bound(console.log),\n };\n}\nfunction fallbackConsole(console) {\n var log = console.log.bind(console);\n var error = console.error ? console.error.bind(console) : log;\n var table = console.table ? console.table.bind(console) : log;\n return { log: log, error: error, table: table };\n}\nfunction getSafeConsole() {\n // @ts-ignore\n var isIE9 = typeof document !== 'undefined' && document.documentMode && document.documentMode === 9;\n if (isIE9) {\n return window && window.console ? ie9Console(window.console) : noopConsoleStub;\n }\n else if (!console.table || !console.error) {\n return fallbackConsole(console);\n }\n else {\n return console;\n }\n}\nvar safeConsole = getSafeConsole();\n//# sourceMappingURL=safeConsole.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/common/strings.js": /*!***************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/common/strings.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"beforeAfterSubstr\": () => (/* binding */ beforeAfterSubstr),\n/* harmony export */ \"fnToString\": () => (/* binding */ fnToString),\n/* harmony export */ \"functionToString\": () => (/* binding */ functionToString),\n/* harmony export */ \"hostRegex\": () => (/* binding */ hostRegex),\n/* harmony export */ \"joinNeighborsR\": () => (/* binding */ joinNeighborsR),\n/* harmony export */ \"kebobString\": () => (/* binding */ kebobString),\n/* harmony export */ \"maxLength\": () => (/* binding */ maxLength),\n/* harmony export */ \"padString\": () => (/* binding */ padString),\n/* harmony export */ \"splitEqual\": () => (/* binding */ splitEqual),\n/* harmony export */ \"splitHash\": () => (/* binding */ splitHash),\n/* harmony export */ \"splitOnDelim\": () => (/* binding */ splitOnDelim),\n/* harmony export */ \"splitQuery\": () => (/* binding */ splitQuery),\n/* harmony export */ \"stringify\": () => (/* binding */ stringify),\n/* harmony export */ \"stripLastPathElement\": () => (/* binding */ stripLastPathElement),\n/* harmony export */ \"trimHashVal\": () => (/* binding */ trimHashVal)\n/* harmony export */ });\n/* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transition/rejectFactory */ \"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _hof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/**\n * Functions that manipulate strings\n *\n * Although these functions are exported, they are subject to change without notice.\n *\n * @packageDocumentation\n */\n\n\n\n\n/**\n * Returns a string shortened to a maximum length\n *\n * If the string is already less than the `max` length, return the string.\n * Else return the string, shortened to `max - 3` and append three dots (\"...\").\n *\n * @param max the maximum length of the string to return\n * @param str the input string\n */\nfunction maxLength(max, str) {\n if (str.length <= max)\n return str;\n return str.substr(0, max - 3) + '...';\n}\n/**\n * Returns a string, with spaces added to the end, up to a desired str length\n *\n * If the string is already longer than the desired length, return the string.\n * Else returns the string, with extra spaces on the end, such that it reaches `length` characters.\n *\n * @param length the desired length of the string to return\n * @param str the input string\n */\nfunction padString(length, str) {\n while (str.length < length)\n str += ' ';\n return str;\n}\nfunction kebobString(camelCase) {\n return camelCase\n .replace(/^([A-Z])/, function ($1) { return $1.toLowerCase(); }) // replace first char\n .replace(/([A-Z])/g, function ($1) { return '-' + $1.toLowerCase(); }); // replace rest\n}\nfunction functionToString(fn) {\n var fnStr = fnToString(fn);\n var namedFunctionMatch = fnStr.match(/^(function [^ ]+\\([^)]*\\))/);\n var toStr = namedFunctionMatch ? namedFunctionMatch[1] : fnStr;\n var fnName = fn['name'] || '';\n if (fnName && toStr.match(/function \\(/)) {\n return 'function ' + fnName + toStr.substr(9);\n }\n return toStr;\n}\nfunction fnToString(fn) {\n var _fn = (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(fn) ? fn.slice(-1)[0] : fn;\n return (_fn && _fn.toString()) || 'undefined';\n}\nfunction stringify(o) {\n var seen = [];\n var isRejection = _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_1__.Rejection.isRejectionPromise;\n var hasToString = function (obj) {\n return (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isObject)(obj) && !(0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isArray)(obj) && obj.constructor !== Object && (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isFunction)(obj.toString);\n };\n var stringifyPattern = (0,_hof__WEBPACK_IMPORTED_MODULE_3__.pattern)([\n [_predicates__WEBPACK_IMPORTED_MODULE_0__.isUndefined, (0,_hof__WEBPACK_IMPORTED_MODULE_3__.val)('undefined')],\n [_predicates__WEBPACK_IMPORTED_MODULE_0__.isNull, (0,_hof__WEBPACK_IMPORTED_MODULE_3__.val)('null')],\n [_predicates__WEBPACK_IMPORTED_MODULE_0__.isPromise, (0,_hof__WEBPACK_IMPORTED_MODULE_3__.val)('[Promise]')],\n [isRejection, function (x) { return x._transitionRejection.toString(); }],\n [hasToString, function (x) { return x.toString(); }],\n [_predicates__WEBPACK_IMPORTED_MODULE_0__.isInjectable, functionToString],\n [(0,_hof__WEBPACK_IMPORTED_MODULE_3__.val)(true), _common__WEBPACK_IMPORTED_MODULE_2__.identity],\n ]);\n function format(value) {\n if ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isObject)(value)) {\n if (seen.indexOf(value) !== -1)\n return '[circular ref]';\n seen.push(value);\n }\n return stringifyPattern(value);\n }\n if ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(o)) {\n // Workaround for IE & Edge Spec incompatibility where replacer function would not be called when JSON.stringify\n // is given `undefined` as value. To work around that, we simply detect `undefined` and bail out early by\n // manually stringifying it.\n return format(o);\n }\n return JSON.stringify(o, function (key, value) { return format(value); }).replace(/\\\\\"/g, '\"');\n}\n/** Returns a function that splits a string on a character or substring */\nvar beforeAfterSubstr = function (char) {\n return function (str) {\n if (!str)\n return ['', ''];\n var idx = str.indexOf(char);\n if (idx === -1)\n return [str, ''];\n return [str.substr(0, idx), str.substr(idx + 1)];\n };\n};\nvar hostRegex = new RegExp('^(?:[a-z]+:)?//[^/]+/');\nvar stripLastPathElement = function (str) { return str.replace(/\\/[^/]*$/, ''); };\nvar splitHash = beforeAfterSubstr('#');\nvar splitQuery = beforeAfterSubstr('?');\nvar splitEqual = beforeAfterSubstr('=');\nvar trimHashVal = function (str) { return (str ? str.replace(/^#/, '') : ''); };\n/**\n * Splits on a delimiter, but returns the delimiters in the array\n *\n * #### Example:\n * ```js\n * var splitOnSlashes = splitOnDelim('/');\n * splitOnSlashes(\"/foo\"); // [\"/\", \"foo\"]\n * splitOnSlashes(\"/foo/\"); // [\"/\", \"foo\", \"/\"]\n * ```\n */\nfunction splitOnDelim(delim) {\n var re = new RegExp('(' + delim + ')', 'g');\n return function (str) { return str.split(re).filter(_common__WEBPACK_IMPORTED_MODULE_2__.identity); };\n}\n/**\n * Reduce fn that joins neighboring strings\n *\n * Given an array of strings, returns a new array\n * where all neighboring strings have been joined.\n *\n * #### Example:\n * ```js\n * let arr = [\"foo\", \"bar\", 1, \"baz\", \"\", \"qux\" ];\n * arr.reduce(joinNeighborsR, []) // [\"foobar\", 1, \"bazqux\" ]\n * ```\n */\nfunction joinNeighborsR(acc, x) {\n if ((0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)((0,_common__WEBPACK_IMPORTED_MODULE_2__.tail)(acc)) && (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(x))\n return acc.slice(0, -1).concat((0,_common__WEBPACK_IMPORTED_MODULE_2__.tail)(acc) + x);\n return (0,_common__WEBPACK_IMPORTED_MODULE_2__.pushR)(acc, x);\n}\n//# sourceMappingURL=strings.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/common/strings.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/common/trace.js": /*!*************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/common/trace.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Category\": () => (/* binding */ Category),\n/* harmony export */ \"Trace\": () => (/* binding */ Trace),\n/* harmony export */ \"trace\": () => (/* binding */ trace)\n/* harmony export */ });\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./strings */ \"./node_modules/@uirouter/core/lib-esm/common/strings.js\");\n/* harmony import */ var _safeConsole__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./safeConsole */ \"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js\");\n/**\n * # Transition tracing (debug)\n *\n * Enable transition tracing to print transition information to the console,\n * in order to help debug your application.\n * Tracing logs detailed information about each Transition to your console.\n *\n * To enable tracing, import the [[Trace]] singleton and enable one or more categories.\n *\n * ### ES6\n * ```js\n * import {trace} from \"@uirouter/core\";\n * trace.enable(1, 5); // TRANSITION and VIEWCONFIG\n * ```\n *\n * ### CJS\n * ```js\n * let trace = require(\"@uirouter/core\").trace;\n * trace.enable(\"TRANSITION\", \"VIEWCONFIG\");\n * ```\n *\n * ### Globals\n * ```js\n * let trace = window[\"@uirouter/core\"].trace;\n * trace.enable(); // Trace everything (very verbose)\n * ```\n *\n * ### Angular 1:\n * ```js\n * app.run($trace => $trace.enable());\n * ```\n *\n * @packageDocumentation\n */\n\n\n\n\nfunction uiViewString(uiview) {\n if (!uiview)\n return 'ui-view (defunct)';\n var state = uiview.creationContext ? uiview.creationContext.name || '(root)' : '(none)';\n return \"[ui-view#\" + uiview.id + \" \" + uiview.$type + \":\" + uiview.fqn + \" (\" + uiview.name + \"@\" + state + \")]\";\n}\nvar viewConfigString = function (viewConfig) {\n var view = viewConfig.viewDecl;\n var state = view.$context.name || '(root)';\n return \"[View#\" + viewConfig.$id + \" from '\" + state + \"' state]: target ui-view: '\" + view.$uiViewName + \"@\" + view.$uiViewContextAnchor + \"'\";\n};\nfunction normalizedCat(input) {\n return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isNumber)(input) ? Category[input] : Category[Category[input]];\n}\n/**\n * Trace categories Enum\n *\n * Enable or disable a category using [[Trace.enable]] or [[Trace.disable]]\n *\n * `trace.enable(Category.TRANSITION)`\n *\n * These can also be provided using a matching string, or position ordinal\n *\n * `trace.enable(\"TRANSITION\")`\n *\n * `trace.enable(1)`\n */\nvar Category;\n(function (Category) {\n Category[Category[\"RESOLVE\"] = 0] = \"RESOLVE\";\n Category[Category[\"TRANSITION\"] = 1] = \"TRANSITION\";\n Category[Category[\"HOOK\"] = 2] = \"HOOK\";\n Category[Category[\"UIVIEW\"] = 3] = \"UIVIEW\";\n Category[Category[\"VIEWCONFIG\"] = 4] = \"VIEWCONFIG\";\n})(Category || (Category = {}));\n\nvar _tid = (0,_common_hof__WEBPACK_IMPORTED_MODULE_0__.parse)('$id');\nvar _rid = (0,_common_hof__WEBPACK_IMPORTED_MODULE_0__.parse)('router.$id');\nvar transLbl = function (trans) { return \"Transition #\" + _tid(trans) + \"-\" + _rid(trans); };\n/**\n * Prints UI-Router Transition trace information to the console.\n */\nvar Trace = /** @class */ (function () {\n /** @internal */\n function Trace() {\n /** @internal */\n this._enabled = {};\n this.approximateDigests = 0;\n }\n /** @internal */\n Trace.prototype._set = function (enabled, categories) {\n var _this = this;\n if (!categories.length) {\n categories = Object.keys(Category)\n .map(function (k) { return parseInt(k, 10); })\n .filter(function (k) { return !isNaN(k); })\n .map(function (key) { return Category[key]; });\n }\n categories.map(normalizedCat).forEach(function (category) { return (_this._enabled[category] = enabled); });\n };\n Trace.prototype.enable = function () {\n var categories = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n categories[_i] = arguments[_i];\n }\n this._set(true, categories);\n };\n Trace.prototype.disable = function () {\n var categories = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n categories[_i] = arguments[_i];\n }\n this._set(false, categories);\n };\n /**\n * Retrieves the enabled stateus of a [[Category]]\n *\n * ```js\n * trace.enabled(\"VIEWCONFIG\"); // true or false\n * ```\n *\n * @returns boolean true if the category is enabled\n */\n Trace.prototype.enabled = function (category) {\n return !!this._enabled[normalizedCat(category)];\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceTransitionStart = function (trans) {\n if (!this.enabled(Category.TRANSITION))\n return;\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + \": Started -> \" + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(trans));\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceTransitionIgnored = function (trans) {\n if (!this.enabled(Category.TRANSITION))\n return;\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + \": Ignored <> \" + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(trans));\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceHookInvocation = function (step, trans, options) {\n if (!this.enabled(Category.HOOK))\n return;\n var event = (0,_common_hof__WEBPACK_IMPORTED_MODULE_0__.parse)('traceData.hookType')(options) || 'internal', context = (0,_common_hof__WEBPACK_IMPORTED_MODULE_0__.parse)('traceData.context.state.name')(options) || (0,_common_hof__WEBPACK_IMPORTED_MODULE_0__.parse)('traceData.context')(options) || 'unknown', name = (0,_strings__WEBPACK_IMPORTED_MODULE_2__.functionToString)(step.registeredHook.callback);\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + \": Hook -> \" + event + \" context: \" + context + \", \" + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.maxLength)(200, name));\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceHookResult = function (hookResult, trans, transitionOptions) {\n if (!this.enabled(Category.HOOK))\n return;\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + \": <- Hook returned: \" + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.maxLength)(200, (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(hookResult)));\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceResolvePath = function (path, when, trans) {\n if (!this.enabled(Category.RESOLVE))\n return;\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + \": Resolving \" + path + \" (\" + when + \")\");\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceResolvableResolved = function (resolvable, trans) {\n if (!this.enabled(Category.RESOLVE))\n return;\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + \": <- Resolved \" + resolvable + \" to: \" + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.maxLength)(200, (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(resolvable.data)));\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceError = function (reason, trans) {\n if (!this.enabled(Category.TRANSITION))\n return;\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + \": <- Rejected \" + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(trans) + \", reason: \" + reason);\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceSuccess = function (finalState, trans) {\n if (!this.enabled(Category.TRANSITION))\n return;\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(transLbl(trans) + \": <- Success \" + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(trans) + \", final state: \" + finalState.name);\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceUIViewEvent = function (event, viewData, extra) {\n if (extra === void 0) { extra = ''; }\n if (!this.enabled(Category.UIVIEW))\n return;\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(\"ui-view: \" + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.padString)(30, event) + \" \" + uiViewString(viewData) + extra);\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceUIViewConfigUpdated = function (viewData, context) {\n if (!this.enabled(Category.UIVIEW))\n return;\n this.traceUIViewEvent('Updating', viewData, \" with ViewConfig from context='\" + context + \"'\");\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceUIViewFill = function (viewData, html) {\n if (!this.enabled(Category.UIVIEW))\n return;\n this.traceUIViewEvent('Fill', viewData, \" with: \" + (0,_strings__WEBPACK_IMPORTED_MODULE_2__.maxLength)(200, html));\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceViewSync = function (pairs) {\n if (!this.enabled(Category.VIEWCONFIG))\n return;\n var uivheader = 'uiview component fqn';\n var cfgheader = 'view config state (view name)';\n var mapping = pairs\n .map(function (_a) {\n var _b;\n var uiView = _a.uiView, viewConfig = _a.viewConfig;\n var uiv = uiView && uiView.fqn;\n var cfg = viewConfig && viewConfig.viewDecl.$context.name + \": (\" + viewConfig.viewDecl.$name + \")\";\n return _b = {}, _b[uivheader] = uiv, _b[cfgheader] = cfg, _b;\n })\n .sort(function (a, b) { return (a[uivheader] || '').localeCompare(b[uivheader] || ''); });\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.table(mapping);\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceViewServiceEvent = function (event, viewConfig) {\n if (!this.enabled(Category.VIEWCONFIG))\n return;\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(\"VIEWCONFIG: \" + event + \" \" + viewConfigString(viewConfig));\n };\n /** @internal called by ui-router code */\n Trace.prototype.traceViewServiceUIViewEvent = function (event, viewData) {\n if (!this.enabled(Category.VIEWCONFIG))\n return;\n _safeConsole__WEBPACK_IMPORTED_MODULE_3__.safeConsole.log(\"VIEWCONFIG: \" + event + \" \" + uiViewString(viewData));\n };\n return Trace;\n}());\n\n/**\n * The [[Trace]] singleton\n *\n * #### Example:\n * ```js\n * import {trace} from \"@uirouter/core\";\n * trace.enable(1, 5);\n * ```\n */\nvar trace = new Trace();\n\n//# sourceMappingURL=trace.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/common/trace.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/globals.js": /*!********************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/globals.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UIRouterGlobals\": () => (/* binding */ UIRouterGlobals)\n/* harmony export */ });\n/* harmony import */ var _params_stateParams__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./params/stateParams */ \"./node_modules/@uirouter/core/lib-esm/params/stateParams.js\");\n/* harmony import */ var _common_queue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/queue */ \"./node_modules/@uirouter/core/lib-esm/common/queue.js\");\n\n\n/**\n * Global router state\n *\n * This is where we hold the global mutable state such as current state, current\n * params, current transition, etc.\n */\nvar UIRouterGlobals = /** @class */ (function () {\n function UIRouterGlobals() {\n /**\n * Current parameter values\n *\n * The parameter values from the latest successful transition\n */\n this.params = new _params_stateParams__WEBPACK_IMPORTED_MODULE_0__.StateParams();\n /** @internal */\n this.lastStartedTransitionId = -1;\n /** @internal */\n this.transitionHistory = new _common_queue__WEBPACK_IMPORTED_MODULE_1__.Queue([], 1);\n /** @internal */\n this.successfulTransitions = new _common_queue__WEBPACK_IMPORTED_MODULE_1__.Queue([], 1);\n }\n UIRouterGlobals.prototype.dispose = function () {\n this.transitionHistory.clear();\n this.successfulTransitions.clear();\n this.transition = null;\n };\n return UIRouterGlobals;\n}());\n\n//# sourceMappingURL=globals.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/globals.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js": /*!**********************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"registerAddCoreResolvables\": () => (/* binding */ registerAddCoreResolvables),\n/* harmony export */ \"treeChangesCleanup\": () => (/* binding */ treeChangesCleanup)\n/* harmony export */ });\n/* harmony import */ var _transition_transition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../transition/transition */ \"./node_modules/@uirouter/core/lib-esm/transition/transition.js\");\n/* harmony import */ var _router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../router */ \"./node_modules/@uirouter/core/lib-esm/router.js\");\n/* harmony import */ var _resolve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../resolve */ \"./node_modules/@uirouter/core/lib-esm/resolve/index.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n\n\n\n\nfunction addCoreResolvables(trans) {\n trans.addResolvable(_resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData(_router__WEBPACK_IMPORTED_MODULE_1__.UIRouter, trans.router), '');\n trans.addResolvable(_resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData(_transition_transition__WEBPACK_IMPORTED_MODULE_0__.Transition, trans), '');\n trans.addResolvable(_resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData('$transition$', trans), '');\n trans.addResolvable(_resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData('$stateParams', trans.params()), '');\n trans.entering().forEach(function (state) {\n trans.addResolvable(_resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData('$state$', state), state);\n });\n}\nvar registerAddCoreResolvables = function (transitionService) {\n return transitionService.onCreate({}, addCoreResolvables);\n};\nvar TRANSITION_TOKENS = ['$transition$', _transition_transition__WEBPACK_IMPORTED_MODULE_0__.Transition];\nvar isTransition = (0,_common__WEBPACK_IMPORTED_MODULE_3__.inArray)(TRANSITION_TOKENS);\n// References to Transition in the treeChanges pathnodes makes all\n// previous Transitions reachable in memory, causing a memory leak\n// This function removes resolves for '$transition$' and `Transition` from the treeChanges.\n// Do not use this on current transitions, only on old ones.\nvar treeChangesCleanup = function (trans) {\n var nodes = (0,_common__WEBPACK_IMPORTED_MODULE_3__.values)(trans.treeChanges()).reduce(_common__WEBPACK_IMPORTED_MODULE_3__.unnestR, []).reduce(_common__WEBPACK_IMPORTED_MODULE_3__.uniqR, []);\n // If the resolvable is a Transition, return a new resolvable with null data\n var replaceTransitionWithNull = function (r) {\n return isTransition(r.token) ? _resolve__WEBPACK_IMPORTED_MODULE_2__.Resolvable.fromData(r.token, null) : r;\n };\n nodes.forEach(function (node) {\n node.resolvables = node.resolvables.map(replaceTransitionWithNull);\n });\n};\n//# sourceMappingURL=coreResolvables.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js": /*!************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"registerIgnoredTransitionHook\": () => (/* binding */ registerIgnoredTransitionHook)\n/* harmony export */ });\n/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/trace */ \"./node_modules/@uirouter/core/lib-esm/common/trace.js\");\n/* harmony import */ var _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transition/rejectFactory */ \"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js\");\n\n\n/**\n * A [[TransitionHookFn]] that skips a transition if it should be ignored\n *\n * This hook is invoked at the end of the onBefore phase.\n *\n * If the transition should be ignored (because no parameter or states changed)\n * then the transition is ignored and not processed.\n */\nfunction ignoredHook(trans) {\n var ignoredReason = trans._ignoredReason();\n if (!ignoredReason)\n return;\n _common_trace__WEBPACK_IMPORTED_MODULE_0__.trace.traceTransitionIgnored(trans);\n var pending = trans.router.globals.transition;\n // The user clicked a link going back to the *current state* ('A')\n // However, there is also a pending transition in flight (to 'B')\n // Abort the transition to 'B' because the user now wants to be back at 'A'.\n if (ignoredReason === 'SameAsCurrent' && pending) {\n pending.abort();\n }\n return _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_1__.Rejection.ignored().toPromise();\n}\nvar registerIgnoredTransitionHook = function (transitionService) {\n return transitionService.onBefore({}, ignoredHook, { priority: -9999 });\n};\n//# sourceMappingURL=ignoredTransition.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js": /*!************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"registerInvalidTransitionHook\": () => (/* binding */ registerInvalidTransitionHook)\n/* harmony export */ });\n/**\n * A [[TransitionHookFn]] that rejects the Transition if it is invalid\n *\n * This hook is invoked at the end of the onBefore phase.\n * If the transition is invalid (for example, param values do not validate)\n * then the transition is rejected.\n */\nfunction invalidTransitionHook(trans) {\n if (!trans.valid()) {\n throw new Error(trans.error().toString());\n }\n}\nvar registerInvalidTransitionHook = function (transitionService) {\n return transitionService.onBefore({}, invalidTransitionHook, { priority: -10000 });\n};\n//# sourceMappingURL=invalidTransition.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js": /*!***************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"lazyLoadState\": () => (/* binding */ lazyLoadState),\n/* harmony export */ \"registerLazyLoadHook\": () => (/* binding */ registerLazyLoadHook)\n/* harmony export */ });\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n\n/**\n * A [[TransitionHookFn]] that performs lazy loading\n *\n * When entering a state \"abc\" which has a `lazyLoad` function defined:\n * - Invoke the `lazyLoad` function (unless it is already in process)\n * - Flag the hook function as \"in process\"\n * - The function should return a promise (that resolves when lazy loading is complete)\n * - Wait for the promise to settle\n * - If the promise resolves to a [[LazyLoadResult]], then register those states\n * - Flag the hook function as \"not in process\"\n * - If the hook was successful\n * - Remove the `lazyLoad` function from the state declaration\n * - If all the hooks were successful\n * - Retry the transition (by returning a TargetState)\n *\n * ```\n * .state('abc', {\n * component: 'fooComponent',\n * lazyLoad: () => import('./fooComponent')\n * });\n * ```\n *\n * See [[StateDeclaration.lazyLoad]]\n */\nvar lazyLoadHook = function (transition) {\n var router = transition.router;\n function retryTransition() {\n if (transition.originalTransition().options().source !== 'url') {\n // The original transition was not triggered via url sync\n // The lazy state should be loaded now, so re-try the original transition\n var orig = transition.targetState();\n return router.stateService.target(orig.identifier(), orig.params(), orig.options());\n }\n // The original transition was triggered via url sync\n // Run the URL rules and find the best match\n var $url = router.urlService;\n var result = $url.match($url.parts());\n var rule = result && result.rule;\n // If the best match is a state, redirect the transition (instead\n // of calling sync() which supersedes the current transition)\n if (rule && rule.type === 'STATE') {\n var state = rule.state;\n var params = result.match;\n return router.stateService.target(state, params, transition.options());\n }\n // No matching state found, so let .sync() choose the best non-state match/otherwise\n router.urlService.sync();\n }\n var promises = transition\n .entering()\n .filter(function (state) { return !!state.$$state().lazyLoad; })\n .map(function (state) { return lazyLoadState(transition, state); });\n return _common_coreservices__WEBPACK_IMPORTED_MODULE_0__.services.$q.all(promises).then(retryTransition);\n};\nvar registerLazyLoadHook = function (transitionService) {\n return transitionService.onBefore({ entering: function (state) { return !!state.lazyLoad; } }, lazyLoadHook);\n};\n/**\n * Invokes a state's lazy load function\n *\n * @param transition a Transition context\n * @param state the state to lazy load\n * @returns A promise for the lazy load result\n */\nfunction lazyLoadState(transition, state) {\n var lazyLoadFn = state.$$state().lazyLoad;\n // Store/get the lazy load promise on/from the hookfn so it doesn't get re-invoked\n var promise = lazyLoadFn['_promise'];\n if (!promise) {\n var success = function (result) {\n delete state.lazyLoad;\n delete state.$$state().lazyLoad;\n delete lazyLoadFn['_promise'];\n return result;\n };\n var error = function (err) {\n delete lazyLoadFn['_promise'];\n return _common_coreservices__WEBPACK_IMPORTED_MODULE_0__.services.$q.reject(err);\n };\n promise = lazyLoadFn['_promise'] = _common_coreservices__WEBPACK_IMPORTED_MODULE_0__.services.$q.when(lazyLoadFn(transition, state))\n .then(updateStateRegistry)\n .then(success, error);\n }\n /** Register any lazy loaded state definitions */\n function updateStateRegistry(result) {\n if (result && Array.isArray(result.states)) {\n result.states.forEach(function (_state) { return transition.router.stateRegistry.register(_state); });\n }\n return result;\n }\n return promise;\n}\n//# sourceMappingURL=lazyLoad.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js": /*!************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"registerOnEnterHook\": () => (/* binding */ registerOnEnterHook),\n/* harmony export */ \"registerOnExitHook\": () => (/* binding */ registerOnExitHook),\n/* harmony export */ \"registerOnRetainHook\": () => (/* binding */ registerOnRetainHook)\n/* harmony export */ });\n/**\n * A factory which creates an onEnter, onExit or onRetain transition hook function\n *\n * The returned function invokes the (for instance) state.onEnter hook when the\n * state is being entered.\n */\nfunction makeEnterExitRetainHook(hookName) {\n return function (transition, state) {\n var _state = state.$$state();\n var hookFn = _state[hookName];\n return hookFn(transition, state);\n };\n}\n/**\n * The [[TransitionStateHookFn]] for onExit\n *\n * When the state is being exited, the state's .onExit function is invoked.\n *\n * Registered using `transitionService.onExit({ exiting: (state) => !!state.onExit }, onExitHook);`\n *\n * See: [[IHookRegistry.onExit]]\n */\nvar onExitHook = makeEnterExitRetainHook('onExit');\nvar registerOnExitHook = function (transitionService) {\n return transitionService.onExit({ exiting: function (state) { return !!state.onExit; } }, onExitHook);\n};\n/**\n * The [[TransitionStateHookFn]] for onRetain\n *\n * When the state was already entered, and is not being exited or re-entered, the state's .onRetain function is invoked.\n *\n * Registered using `transitionService.onRetain({ retained: (state) => !!state.onRetain }, onRetainHook);`\n *\n * See: [[IHookRegistry.onRetain]]\n */\nvar onRetainHook = makeEnterExitRetainHook('onRetain');\nvar registerOnRetainHook = function (transitionService) {\n return transitionService.onRetain({ retained: function (state) { return !!state.onRetain; } }, onRetainHook);\n};\n/**\n * The [[TransitionStateHookFn]] for onEnter\n *\n * When the state is being entered, the state's .onEnter function is invoked.\n *\n * Registered using `transitionService.onEnter({ entering: (state) => !!state.onEnter }, onEnterHook);`\n *\n * See: [[IHookRegistry.onEnter]]\n */\nvar onEnterHook = makeEnterExitRetainHook('onEnter');\nvar registerOnEnterHook = function (transitionService) {\n return transitionService.onEnter({ entering: function (state) { return !!state.onEnter; } }, onEnterHook);\n};\n//# sourceMappingURL=onEnterExitRetain.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js": /*!*****************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"registerRedirectToHook\": () => (/* binding */ registerRedirectToHook)\n/* harmony export */ });\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n/* harmony import */ var _state_targetState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../state/targetState */ \"./node_modules/@uirouter/core/lib-esm/state/targetState.js\");\n\n\n\n/**\n * A [[TransitionHookFn]] that redirects to a different state or params\n *\n * Registered using `transitionService.onStart({ to: (state) => !!state.redirectTo }, redirectHook);`\n *\n * See [[StateDeclaration.redirectTo]]\n */\nvar redirectToHook = function (trans) {\n var redirect = trans.to().redirectTo;\n if (!redirect)\n return;\n var $state = trans.router.stateService;\n function handleResult(result) {\n if (!result)\n return;\n if (result instanceof _state_targetState__WEBPACK_IMPORTED_MODULE_2__.TargetState)\n return result;\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(result))\n return $state.target(result, trans.params(), trans.options());\n if (result['state'] || result['params'])\n return $state.target(result['state'] || trans.to(), result['params'] || trans.params(), trans.options());\n }\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isFunction)(redirect)) {\n return _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(redirect(trans)).then(handleResult);\n }\n return handleResult(redirect);\n};\nvar registerRedirectToHook = function (transitionService) {\n return transitionService.onStart({ to: function (state) { return !!state.redirectTo; } }, redirectToHook);\n};\n//# sourceMappingURL=redirectTo.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/hooks/resolve.js": /*!**************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/hooks/resolve.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RESOLVE_HOOK_PRIORITY\": () => (/* binding */ RESOLVE_HOOK_PRIORITY),\n/* harmony export */ \"registerEagerResolvePath\": () => (/* binding */ registerEagerResolvePath),\n/* harmony export */ \"registerLazyResolveState\": () => (/* binding */ registerLazyResolveState),\n/* harmony export */ \"registerResolveRemaining\": () => (/* binding */ registerResolveRemaining)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../resolve/resolveContext */ \"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n\n\n\nvar RESOLVE_HOOK_PRIORITY = 1000;\n/**\n * A [[TransitionHookFn]] which resolves all EAGER Resolvables in the To Path\n *\n * Registered using `transitionService.onStart({}, eagerResolvePath, { priority: 1000 });`\n *\n * When a Transition starts, this hook resolves all the EAGER Resolvables, which the transition then waits for.\n *\n * See [[StateDeclaration.resolve]]\n */\nvar eagerResolvePath = function (trans) {\n return new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_1__.ResolveContext(trans.treeChanges().to).resolvePath('EAGER', trans).then(_common_common__WEBPACK_IMPORTED_MODULE_0__.noop);\n};\nvar registerEagerResolvePath = function (transitionService) {\n return transitionService.onStart({}, eagerResolvePath, { priority: RESOLVE_HOOK_PRIORITY });\n};\n/**\n * A [[TransitionHookFn]] which resolves all LAZY Resolvables for the state (and all its ancestors) in the To Path\n *\n * Registered using `transitionService.onEnter({ entering: () => true }, lazyResolveState, { priority: 1000 });`\n *\n * When a State is being entered, this hook resolves all the Resolvables for this state, which the transition then waits for.\n *\n * See [[StateDeclaration.resolve]]\n */\nvar lazyResolveState = function (trans, state) {\n return new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_1__.ResolveContext(trans.treeChanges().to).subContext(state.$$state()).resolvePath('LAZY', trans).then(_common_common__WEBPACK_IMPORTED_MODULE_0__.noop);\n};\nvar registerLazyResolveState = function (transitionService) {\n return transitionService.onEnter({ entering: (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.val)(true) }, lazyResolveState, { priority: RESOLVE_HOOK_PRIORITY });\n};\n/**\n * A [[TransitionHookFn]] which resolves any dynamically added (LAZY or EAGER) Resolvables.\n *\n * Registered using `transitionService.onFinish({}, eagerResolvePath, { priority: 1000 });`\n *\n * After all entering states have been entered, this hook resolves any remaining Resolvables.\n * These are typically dynamic resolves which were added by some Transition Hook using [[Transition.addResolvable]].\n *\n * See [[StateDeclaration.resolve]]\n */\nvar resolveRemaining = function (trans) {\n return new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_1__.ResolveContext(trans.treeChanges().to).resolvePath('LAZY', trans).then(_common_common__WEBPACK_IMPORTED_MODULE_0__.noop);\n};\nvar registerResolveRemaining = function (transitionService) {\n return transitionService.onFinish({}, resolveRemaining, { priority: RESOLVE_HOOK_PRIORITY });\n};\n//# sourceMappingURL=resolve.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js": /*!********************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"registerUpdateGlobalState\": () => (/* binding */ registerUpdateGlobalState)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n\n/**\n * A [[TransitionHookFn]] which updates global UI-Router state\n *\n * Registered using `transitionService.onBefore({}, updateGlobalState);`\n *\n * Before a [[Transition]] starts, updates the global value of \"the current transition\" ([[Globals.transition]]).\n * After a successful [[Transition]], updates the global values of \"the current state\"\n * ([[Globals.current]] and [[Globals.$current]]) and \"the current param values\" ([[Globals.params]]).\n *\n * See also the deprecated properties:\n * [[StateService.transition]], [[StateService.current]], [[StateService.params]]\n */\nvar updateGlobalState = function (trans) {\n var globals = trans.router.globals;\n var transitionSuccessful = function () {\n globals.successfulTransitions.enqueue(trans);\n globals.$current = trans.$to();\n globals.current = globals.$current.self;\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.copy)(trans.params(), globals.params);\n };\n var clearCurrentTransition = function () {\n // Do not clear globals.transition if a different transition has started in the meantime\n if (globals.transition === trans)\n globals.transition = null;\n };\n trans.onSuccess({}, transitionSuccessful, { priority: 10000 });\n trans.promise.then(clearCurrentTransition, clearCurrentTransition);\n};\nvar registerUpdateGlobalState = function (transitionService) {\n return transitionService.onCreate({}, updateGlobalState);\n};\n//# sourceMappingURL=updateGlobals.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/hooks/url.js": /*!**********************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/hooks/url.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"registerUpdateUrl\": () => (/* binding */ registerUpdateUrl)\n/* harmony export */ });\n/**\n * A [[TransitionHookFn]] which updates the URL after a successful transition\n *\n * Registered using `transitionService.onSuccess({}, updateUrl);`\n */\nvar updateUrl = function (transition) {\n var options = transition.options();\n var $state = transition.router.stateService;\n var $urlRouter = transition.router.urlRouter;\n // Dont update the url in these situations:\n // The transition was triggered by a URL sync (options.source === 'url')\n // The user doesn't want the url to update (options.location === false)\n // The destination state, and all parents have no navigable url\n if (options.source !== 'url' && options.location && $state.$current.navigable) {\n var urlOptions = { replace: options.location === 'replace' };\n $urlRouter.push($state.$current.navigable.url, $state.params, urlOptions);\n }\n $urlRouter.update(true);\n};\nvar registerUpdateUrl = function (transitionService) {\n return transitionService.onSuccess({}, updateUrl, { priority: 9999 });\n};\n//# sourceMappingURL=url.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/hooks/url.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/hooks/views.js": /*!************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/hooks/views.js ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"registerActivateViews\": () => (/* binding */ registerActivateViews),\n/* harmony export */ \"registerLoadEnteringViews\": () => (/* binding */ registerLoadEnteringViews)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n\n\n/**\n * A [[TransitionHookFn]] which waits for the views to load\n *\n * Registered using `transitionService.onStart({}, loadEnteringViews);`\n *\n * Allows the views to do async work in [[ViewConfig.load]] before the transition continues.\n * In angular 1, this includes loading the templates.\n */\nvar loadEnteringViews = function (transition) {\n var $q = _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q;\n var enteringViews = transition.views('entering');\n if (!enteringViews.length)\n return;\n return $q.all(enteringViews.map(function (view) { return $q.when(view.load()); })).then(_common_common__WEBPACK_IMPORTED_MODULE_0__.noop);\n};\nvar registerLoadEnteringViews = function (transitionService) {\n return transitionService.onFinish({}, loadEnteringViews);\n};\n/**\n * A [[TransitionHookFn]] which activates the new views when a transition is successful.\n *\n * Registered using `transitionService.onSuccess({}, activateViews);`\n *\n * After a transition is complete, this hook deactivates the old views from the previous state,\n * and activates the new views from the destination state.\n *\n * See [[ViewService]]\n */\nvar activateViews = function (transition) {\n var enteringViews = transition.views('entering');\n var exitingViews = transition.views('exiting');\n if (!enteringViews.length && !exitingViews.length)\n return;\n var $view = transition.router.viewService;\n exitingViews.forEach(function (vc) { return $view.deactivateViewConfig(vc); });\n enteringViews.forEach(function (vc) { return $view.activateViewConfig(vc); });\n $view.sync();\n};\nvar registerActivateViews = function (transitionService) {\n return transitionService.onSuccess({}, activateViews);\n};\n//# sourceMappingURL=views.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/hooks/views.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/index.js": /*!******************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/index.js ***! \******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Category\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.Category),\n/* harmony export */ \"Glob\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.Glob),\n/* harmony export */ \"HookBuilder\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.HookBuilder),\n/* harmony export */ \"NATIVE_INJECTOR_TOKEN\": () => (/* reexport safe */ _resolve_index__WEBPACK_IMPORTED_MODULE_3__.NATIVE_INJECTOR_TOKEN),\n/* harmony export */ \"PathNode\": () => (/* reexport safe */ _path_index__WEBPACK_IMPORTED_MODULE_2__.PathNode),\n/* harmony export */ \"PathUtils\": () => (/* reexport safe */ _path_index__WEBPACK_IMPORTED_MODULE_2__.PathUtils),\n/* harmony export */ \"Queue\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.Queue),\n/* harmony export */ \"RegisteredHook\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.RegisteredHook),\n/* harmony export */ \"RejectType\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.RejectType),\n/* harmony export */ \"Rejection\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.Rejection),\n/* harmony export */ \"Resolvable\": () => (/* reexport safe */ _resolve_index__WEBPACK_IMPORTED_MODULE_3__.Resolvable),\n/* harmony export */ \"ResolveContext\": () => (/* reexport safe */ _resolve_index__WEBPACK_IMPORTED_MODULE_3__.ResolveContext),\n/* harmony export */ \"Trace\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.Trace),\n/* harmony export */ \"Transition\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.Transition),\n/* harmony export */ \"TransitionEventType\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.TransitionEventType),\n/* harmony export */ \"TransitionHook\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.TransitionHook),\n/* harmony export */ \"TransitionHookPhase\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.TransitionHookPhase),\n/* harmony export */ \"TransitionHookScope\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.TransitionHookScope),\n/* harmony export */ \"TransitionService\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.TransitionService),\n/* harmony export */ \"UIRouter\": () => (/* reexport safe */ _router__WEBPACK_IMPORTED_MODULE_9__.UIRouter),\n/* harmony export */ \"UIRouterGlobals\": () => (/* reexport safe */ _globals__WEBPACK_IMPORTED_MODULE_8__.UIRouterGlobals),\n/* harmony export */ \"UIRouterPluginBase\": () => (/* reexport safe */ _interface__WEBPACK_IMPORTED_MODULE_11__.UIRouterPluginBase),\n/* harmony export */ \"_extend\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__._extend),\n/* harmony export */ \"_inArray\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__._inArray),\n/* harmony export */ \"_pushTo\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__._pushTo),\n/* harmony export */ \"_removeFrom\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__._removeFrom),\n/* harmony export */ \"all\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.all),\n/* harmony export */ \"allTrueR\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.allTrueR),\n/* harmony export */ \"ancestors\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.ancestors),\n/* harmony export */ \"and\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.and),\n/* harmony export */ \"any\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.any),\n/* harmony export */ \"anyTrueR\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.anyTrueR),\n/* harmony export */ \"applyPairs\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.applyPairs),\n/* harmony export */ \"arrayTuples\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.arrayTuples),\n/* harmony export */ \"assertFn\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.assertFn),\n/* harmony export */ \"assertMap\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.assertMap),\n/* harmony export */ \"assertPredicate\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.assertPredicate),\n/* harmony export */ \"beforeAfterSubstr\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.beforeAfterSubstr),\n/* harmony export */ \"compose\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.compose),\n/* harmony export */ \"copy\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.copy),\n/* harmony export */ \"createProxyFunctions\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions),\n/* harmony export */ \"curry\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.curry),\n/* harmony export */ \"defaultResolvePolicy\": () => (/* reexport safe */ _resolve_index__WEBPACK_IMPORTED_MODULE_3__.defaultResolvePolicy),\n/* harmony export */ \"defaultTransOpts\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.defaultTransOpts),\n/* harmony export */ \"defaults\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.defaults),\n/* harmony export */ \"deregAll\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.deregAll),\n/* harmony export */ \"eq\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.eq),\n/* harmony export */ \"equals\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.equals),\n/* harmony export */ \"extend\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.extend),\n/* harmony export */ \"filter\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.filter),\n/* harmony export */ \"find\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.find),\n/* harmony export */ \"flatten\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.flatten),\n/* harmony export */ \"flattenR\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.flattenR),\n/* harmony export */ \"fnToString\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.fnToString),\n/* harmony export */ \"forEach\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.forEach),\n/* harmony export */ \"fromJson\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.fromJson),\n/* harmony export */ \"functionToString\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.functionToString),\n/* harmony export */ \"hostRegex\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.hostRegex),\n/* harmony export */ \"identity\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.identity),\n/* harmony export */ \"inArray\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.inArray),\n/* harmony export */ \"inherit\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.inherit),\n/* harmony export */ \"invoke\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.invoke),\n/* harmony export */ \"is\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.is),\n/* harmony export */ \"isArray\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isArray),\n/* harmony export */ \"isDate\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isDate),\n/* harmony export */ \"isDefined\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isDefined),\n/* harmony export */ \"isFunction\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isFunction),\n/* harmony export */ \"isInjectable\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isInjectable),\n/* harmony export */ \"isNull\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isNull),\n/* harmony export */ \"isNullOrUndefined\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isNullOrUndefined),\n/* harmony export */ \"isNumber\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isNumber),\n/* harmony export */ \"isObject\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isObject),\n/* harmony export */ \"isPromise\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isPromise),\n/* harmony export */ \"isRegExp\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isRegExp),\n/* harmony export */ \"isString\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isString),\n/* harmony export */ \"isUndefined\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.isUndefined),\n/* harmony export */ \"joinNeighborsR\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.joinNeighborsR),\n/* harmony export */ \"kebobString\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.kebobString),\n/* harmony export */ \"makeEvent\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.makeEvent),\n/* harmony export */ \"makeStub\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.makeStub),\n/* harmony export */ \"map\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.map),\n/* harmony export */ \"mapObj\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.mapObj),\n/* harmony export */ \"matchState\": () => (/* reexport safe */ _transition_index__WEBPACK_IMPORTED_MODULE_5__.matchState),\n/* harmony export */ \"maxLength\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.maxLength),\n/* harmony export */ \"mergeR\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.mergeR),\n/* harmony export */ \"noop\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.noop),\n/* harmony export */ \"not\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.not),\n/* harmony export */ \"omit\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.omit),\n/* harmony export */ \"or\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.or),\n/* harmony export */ \"padString\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.padString),\n/* harmony export */ \"pairs\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pairs),\n/* harmony export */ \"parse\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.parse),\n/* harmony export */ \"pattern\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pattern),\n/* harmony export */ \"pick\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pick),\n/* harmony export */ \"pipe\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pipe),\n/* harmony export */ \"pluck\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pluck),\n/* harmony export */ \"prop\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.prop),\n/* harmony export */ \"propEq\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.propEq),\n/* harmony export */ \"pushR\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pushR),\n/* harmony export */ \"pushTo\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.pushTo),\n/* harmony export */ \"removeFrom\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.removeFrom),\n/* harmony export */ \"resolvePolicies\": () => (/* reexport safe */ _resolve_index__WEBPACK_IMPORTED_MODULE_3__.resolvePolicies),\n/* harmony export */ \"root\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.root),\n/* harmony export */ \"services\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.services),\n/* harmony export */ \"silenceUncaughtInPromise\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.silenceUncaughtInPromise),\n/* harmony export */ \"silentRejection\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.silentRejection),\n/* harmony export */ \"splitEqual\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.splitEqual),\n/* harmony export */ \"splitHash\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.splitHash),\n/* harmony export */ \"splitOnDelim\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.splitOnDelim),\n/* harmony export */ \"splitQuery\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.splitQuery),\n/* harmony export */ \"stringify\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.stringify),\n/* harmony export */ \"stripLastPathElement\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.stripLastPathElement),\n/* harmony export */ \"tail\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.tail),\n/* harmony export */ \"toJson\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.toJson),\n/* harmony export */ \"trace\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.trace),\n/* harmony export */ \"trimHashVal\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.trimHashVal),\n/* harmony export */ \"uniqR\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.uniqR),\n/* harmony export */ \"unnest\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.unnest),\n/* harmony export */ \"unnestR\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.unnestR),\n/* harmony export */ \"val\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.val),\n/* harmony export */ \"values\": () => (/* reexport safe */ _common_index__WEBPACK_IMPORTED_MODULE_0__.values)\n/* harmony export */ });\n/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common/index */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n/* harmony import */ var _params_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./params/index */ \"./node_modules/@uirouter/core/lib-esm/params/index.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _params_index__WEBPACK_IMPORTED_MODULE_1__) if([\"default\",\"Category\",\"Glob\",\"Queue\",\"Trace\",\"_extend\",\"_inArray\",\"_pushTo\",\"_removeFrom\",\"all\",\"allTrueR\",\"ancestors\",\"and\",\"any\",\"anyTrueR\",\"applyPairs\",\"arrayTuples\",\"assertFn\",\"assertMap\",\"assertPredicate\",\"beforeAfterSubstr\",\"compose\",\"copy\",\"createProxyFunctions\",\"curry\",\"defaults\",\"deregAll\",\"eq\",\"equals\",\"extend\",\"filter\",\"find\",\"flatten\",\"flattenR\",\"fnToString\",\"forEach\",\"fromJson\",\"functionToString\",\"hostRegex\",\"identity\",\"inArray\",\"inherit\",\"invoke\",\"is\",\"isArray\",\"isDate\",\"isDefined\",\"isFunction\",\"isInjectable\",\"isNull\",\"isNullOrUndefined\",\"isNumber\",\"isObject\",\"isPromise\",\"isRegExp\",\"isString\",\"isUndefined\",\"joinNeighborsR\",\"kebobString\",\"makeStub\",\"map\",\"mapObj\",\"maxLength\",\"mergeR\",\"noop\",\"not\",\"omit\",\"or\",\"padString\",\"pairs\",\"parse\",\"pattern\",\"pick\",\"pipe\",\"pluck\",\"prop\",\"propEq\",\"pushR\",\"pushTo\",\"removeFrom\",\"root\",\"services\",\"silenceUncaughtInPromise\",\"silentRejection\",\"splitEqual\",\"splitHash\",\"splitOnDelim\",\"splitQuery\",\"stringify\",\"stripLastPathElement\",\"tail\",\"toJson\",\"trace\",\"trimHashVal\",\"uniqR\",\"unnest\",\"unnestR\",\"val\",\"values\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _params_index__WEBPACK_IMPORTED_MODULE_1__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _path_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./path/index */ \"./node_modules/@uirouter/core/lib-esm/path/index.js\");\n/* harmony import */ var _resolve_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./resolve/index */ \"./node_modules/@uirouter/core/lib-esm/resolve/index.js\");\n/* harmony import */ var _state_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./state/index */ \"./node_modules/@uirouter/core/lib-esm/state/index.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _state_index__WEBPACK_IMPORTED_MODULE_4__) if([\"default\",\"Category\",\"Glob\",\"Queue\",\"Trace\",\"_extend\",\"_inArray\",\"_pushTo\",\"_removeFrom\",\"all\",\"allTrueR\",\"ancestors\",\"and\",\"any\",\"anyTrueR\",\"applyPairs\",\"arrayTuples\",\"assertFn\",\"assertMap\",\"assertPredicate\",\"beforeAfterSubstr\",\"compose\",\"copy\",\"createProxyFunctions\",\"curry\",\"defaults\",\"deregAll\",\"eq\",\"equals\",\"extend\",\"filter\",\"find\",\"flatten\",\"flattenR\",\"fnToString\",\"forEach\",\"fromJson\",\"functionToString\",\"hostRegex\",\"identity\",\"inArray\",\"inherit\",\"invoke\",\"is\",\"isArray\",\"isDate\",\"isDefined\",\"isFunction\",\"isInjectable\",\"isNull\",\"isNullOrUndefined\",\"isNumber\",\"isObject\",\"isPromise\",\"isRegExp\",\"isString\",\"isUndefined\",\"joinNeighborsR\",\"kebobString\",\"makeStub\",\"map\",\"mapObj\",\"maxLength\",\"mergeR\",\"noop\",\"not\",\"omit\",\"or\",\"padString\",\"pairs\",\"parse\",\"pattern\",\"pick\",\"pipe\",\"pluck\",\"prop\",\"propEq\",\"pushR\",\"pushTo\",\"removeFrom\",\"root\",\"services\",\"silenceUncaughtInPromise\",\"silentRejection\",\"splitEqual\",\"splitHash\",\"splitOnDelim\",\"splitQuery\",\"stringify\",\"stripLastPathElement\",\"tail\",\"toJson\",\"trace\",\"trimHashVal\",\"uniqR\",\"unnest\",\"unnestR\",\"val\",\"values\",\"DefType\",\"Param\",\"ParamType\",\"ParamTypes\",\"StateParams\",\"PathNode\",\"PathUtils\",\"NATIVE_INJECTOR_TOKEN\",\"Resolvable\",\"ResolveContext\",\"defaultResolvePolicy\",\"resolvePolicies\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _state_index__WEBPACK_IMPORTED_MODULE_4__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _transition_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./transition/index */ \"./node_modules/@uirouter/core/lib-esm/transition/index.js\");\n/* harmony import */ var _url_index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./url/index */ \"./node_modules/@uirouter/core/lib-esm/url/index.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _url_index__WEBPACK_IMPORTED_MODULE_6__) if([\"default\",\"Category\",\"Glob\",\"Queue\",\"Trace\",\"_extend\",\"_inArray\",\"_pushTo\",\"_removeFrom\",\"all\",\"allTrueR\",\"ancestors\",\"and\",\"any\",\"anyTrueR\",\"applyPairs\",\"arrayTuples\",\"assertFn\",\"assertMap\",\"assertPredicate\",\"beforeAfterSubstr\",\"compose\",\"copy\",\"createProxyFunctions\",\"curry\",\"defaults\",\"deregAll\",\"eq\",\"equals\",\"extend\",\"filter\",\"find\",\"flatten\",\"flattenR\",\"fnToString\",\"forEach\",\"fromJson\",\"functionToString\",\"hostRegex\",\"identity\",\"inArray\",\"inherit\",\"invoke\",\"is\",\"isArray\",\"isDate\",\"isDefined\",\"isFunction\",\"isInjectable\",\"isNull\",\"isNullOrUndefined\",\"isNumber\",\"isObject\",\"isPromise\",\"isRegExp\",\"isString\",\"isUndefined\",\"joinNeighborsR\",\"kebobString\",\"makeStub\",\"map\",\"mapObj\",\"maxLength\",\"mergeR\",\"noop\",\"not\",\"omit\",\"or\",\"padString\",\"pairs\",\"parse\",\"pattern\",\"pick\",\"pipe\",\"pluck\",\"prop\",\"propEq\",\"pushR\",\"pushTo\",\"removeFrom\",\"root\",\"services\",\"silenceUncaughtInPromise\",\"silentRejection\",\"splitEqual\",\"splitHash\",\"splitOnDelim\",\"splitQuery\",\"stringify\",\"stripLastPathElement\",\"tail\",\"toJson\",\"trace\",\"trimHashVal\",\"uniqR\",\"unnest\",\"unnestR\",\"val\",\"values\",\"DefType\",\"Param\",\"ParamType\",\"ParamTypes\",\"StateParams\",\"PathNode\",\"PathUtils\",\"NATIVE_INJECTOR_TOKEN\",\"Resolvable\",\"ResolveContext\",\"defaultResolvePolicy\",\"resolvePolicies\",\"StateBuilder\",\"StateMatcher\",\"StateObject\",\"StateQueueManager\",\"StateRegistry\",\"StateService\",\"TargetState\",\"resolvablesBuilder\",\"HookBuilder\",\"RegisteredHook\",\"RejectType\",\"Rejection\",\"Transition\",\"TransitionEventType\",\"TransitionHook\",\"TransitionHookPhase\",\"TransitionHookScope\",\"TransitionService\",\"defaultTransOpts\",\"makeEvent\",\"matchState\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _url_index__WEBPACK_IMPORTED_MODULE_6__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _view_index__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./view/index */ \"./node_modules/@uirouter/core/lib-esm/view/index.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _view_index__WEBPACK_IMPORTED_MODULE_7__) if([\"default\",\"Category\",\"Glob\",\"Queue\",\"Trace\",\"_extend\",\"_inArray\",\"_pushTo\",\"_removeFrom\",\"all\",\"allTrueR\",\"ancestors\",\"and\",\"any\",\"anyTrueR\",\"applyPairs\",\"arrayTuples\",\"assertFn\",\"assertMap\",\"assertPredicate\",\"beforeAfterSubstr\",\"compose\",\"copy\",\"createProxyFunctions\",\"curry\",\"defaults\",\"deregAll\",\"eq\",\"equals\",\"extend\",\"filter\",\"find\",\"flatten\",\"flattenR\",\"fnToString\",\"forEach\",\"fromJson\",\"functionToString\",\"hostRegex\",\"identity\",\"inArray\",\"inherit\",\"invoke\",\"is\",\"isArray\",\"isDate\",\"isDefined\",\"isFunction\",\"isInjectable\",\"isNull\",\"isNullOrUndefined\",\"isNumber\",\"isObject\",\"isPromise\",\"isRegExp\",\"isString\",\"isUndefined\",\"joinNeighborsR\",\"kebobString\",\"makeStub\",\"map\",\"mapObj\",\"maxLength\",\"mergeR\",\"noop\",\"not\",\"omit\",\"or\",\"padString\",\"pairs\",\"parse\",\"pattern\",\"pick\",\"pipe\",\"pluck\",\"prop\",\"propEq\",\"pushR\",\"pushTo\",\"removeFrom\",\"root\",\"services\",\"silenceUncaughtInPromise\",\"silentRejection\",\"splitEqual\",\"splitHash\",\"splitOnDelim\",\"splitQuery\",\"stringify\",\"stripLastPathElement\",\"tail\",\"toJson\",\"trace\",\"trimHashVal\",\"uniqR\",\"unnest\",\"unnestR\",\"val\",\"values\",\"DefType\",\"Param\",\"ParamType\",\"ParamTypes\",\"StateParams\",\"PathNode\",\"PathUtils\",\"NATIVE_INJECTOR_TOKEN\",\"Resolvable\",\"ResolveContext\",\"defaultResolvePolicy\",\"resolvePolicies\",\"StateBuilder\",\"StateMatcher\",\"StateObject\",\"StateQueueManager\",\"StateRegistry\",\"StateService\",\"TargetState\",\"resolvablesBuilder\",\"HookBuilder\",\"RegisteredHook\",\"RejectType\",\"Rejection\",\"Transition\",\"TransitionEventType\",\"TransitionHook\",\"TransitionHookPhase\",\"TransitionHookScope\",\"TransitionService\",\"defaultTransOpts\",\"makeEvent\",\"matchState\",\"BaseUrlRule\",\"ParamFactory\",\"UrlConfig\",\"UrlMatcher\",\"UrlMatcherFactory\",\"UrlRouter\",\"UrlRuleFactory\",\"UrlRules\",\"UrlService\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _view_index__WEBPACK_IMPORTED_MODULE_7__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./globals */ \"./node_modules/@uirouter/core/lib-esm/globals.js\");\n/* harmony import */ var _router__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./router */ \"./node_modules/@uirouter/core/lib-esm/router.js\");\n/* harmony import */ var _vanilla__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./vanilla */ \"./node_modules/@uirouter/core/lib-esm/vanilla.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _vanilla__WEBPACK_IMPORTED_MODULE_10__) if([\"default\",\"Category\",\"Glob\",\"Queue\",\"Trace\",\"_extend\",\"_inArray\",\"_pushTo\",\"_removeFrom\",\"all\",\"allTrueR\",\"ancestors\",\"and\",\"any\",\"anyTrueR\",\"applyPairs\",\"arrayTuples\",\"assertFn\",\"assertMap\",\"assertPredicate\",\"beforeAfterSubstr\",\"compose\",\"copy\",\"createProxyFunctions\",\"curry\",\"defaults\",\"deregAll\",\"eq\",\"equals\",\"extend\",\"filter\",\"find\",\"flatten\",\"flattenR\",\"fnToString\",\"forEach\",\"fromJson\",\"functionToString\",\"hostRegex\",\"identity\",\"inArray\",\"inherit\",\"invoke\",\"is\",\"isArray\",\"isDate\",\"isDefined\",\"isFunction\",\"isInjectable\",\"isNull\",\"isNullOrUndefined\",\"isNumber\",\"isObject\",\"isPromise\",\"isRegExp\",\"isString\",\"isUndefined\",\"joinNeighborsR\",\"kebobString\",\"makeStub\",\"map\",\"mapObj\",\"maxLength\",\"mergeR\",\"noop\",\"not\",\"omit\",\"or\",\"padString\",\"pairs\",\"parse\",\"pattern\",\"pick\",\"pipe\",\"pluck\",\"prop\",\"propEq\",\"pushR\",\"pushTo\",\"removeFrom\",\"root\",\"services\",\"silenceUncaughtInPromise\",\"silentRejection\",\"splitEqual\",\"splitHash\",\"splitOnDelim\",\"splitQuery\",\"stringify\",\"stripLastPathElement\",\"tail\",\"toJson\",\"trace\",\"trimHashVal\",\"uniqR\",\"unnest\",\"unnestR\",\"val\",\"values\",\"DefType\",\"Param\",\"ParamType\",\"ParamTypes\",\"StateParams\",\"PathNode\",\"PathUtils\",\"NATIVE_INJECTOR_TOKEN\",\"Resolvable\",\"ResolveContext\",\"defaultResolvePolicy\",\"resolvePolicies\",\"StateBuilder\",\"StateMatcher\",\"StateObject\",\"StateQueueManager\",\"StateRegistry\",\"StateService\",\"TargetState\",\"resolvablesBuilder\",\"HookBuilder\",\"RegisteredHook\",\"RejectType\",\"Rejection\",\"Transition\",\"TransitionEventType\",\"TransitionHook\",\"TransitionHookPhase\",\"TransitionHookScope\",\"TransitionService\",\"defaultTransOpts\",\"makeEvent\",\"matchState\",\"BaseUrlRule\",\"ParamFactory\",\"UrlConfig\",\"UrlMatcher\",\"UrlMatcherFactory\",\"UrlRouter\",\"UrlRuleFactory\",\"UrlRules\",\"UrlService\",\"ViewService\",\"UIRouterGlobals\",\"UIRouter\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _vanilla__WEBPACK_IMPORTED_MODULE_10__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/interface.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/interface.js": /*!**********************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/interface.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UIRouterPluginBase\": () => (/* binding */ UIRouterPluginBase)\n/* harmony export */ });\nvar UIRouterPluginBase = /** @class */ (function () {\n function UIRouterPluginBase() {\n }\n UIRouterPluginBase.prototype.dispose = function (router) { };\n return UIRouterPluginBase;\n}());\n\n//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/interface.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/params/index.js": /*!*************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/params/index.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DefType\": () => (/* reexport safe */ _param__WEBPACK_IMPORTED_MODULE_1__.DefType),\n/* harmony export */ \"Param\": () => (/* reexport safe */ _param__WEBPACK_IMPORTED_MODULE_1__.Param),\n/* harmony export */ \"ParamType\": () => (/* reexport safe */ _paramType__WEBPACK_IMPORTED_MODULE_4__.ParamType),\n/* harmony export */ \"ParamTypes\": () => (/* reexport safe */ _paramTypes__WEBPACK_IMPORTED_MODULE_2__.ParamTypes),\n/* harmony export */ \"StateParams\": () => (/* reexport safe */ _stateParams__WEBPACK_IMPORTED_MODULE_3__.StateParams)\n/* harmony export */ });\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/params/interface.js\");\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _param__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./param */ \"./node_modules/@uirouter/core/lib-esm/params/param.js\");\n/* harmony import */ var _paramTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./paramTypes */ \"./node_modules/@uirouter/core/lib-esm/params/paramTypes.js\");\n/* harmony import */ var _stateParams__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stateParams */ \"./node_modules/@uirouter/core/lib-esm/params/stateParams.js\");\n/* harmony import */ var _paramType__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./paramType */ \"./node_modules/@uirouter/core/lib-esm/params/paramType.js\");\n/**\n * This module contains code for State Parameters.\n *\n * See [[ParamDeclaration]]\n *\n * @packageDocumentation @preferred\n */\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/params/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/params/interface.js": /*!*****************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/params/interface.js ***! \*****************************************************************/ /***/ (() => { eval("//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/params/interface.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/params/param.js": /*!*************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/params/param.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DefType\": () => (/* binding */ DefType),\n/* harmony export */ \"Param\": () => (/* binding */ Param)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n/* harmony import */ var _paramType__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./paramType */ \"./node_modules/@uirouter/core/lib-esm/params/paramType.js\");\n\n\n\n\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar isShorthand = function (cfg) {\n return ['value', 'type', 'squash', 'array', 'dynamic'].filter(hasOwn.bind(cfg || {})).length === 0;\n};\nvar DefType;\n(function (DefType) {\n DefType[DefType[\"PATH\"] = 0] = \"PATH\";\n DefType[DefType[\"SEARCH\"] = 1] = \"SEARCH\";\n DefType[DefType[\"CONFIG\"] = 2] = \"CONFIG\";\n})(DefType || (DefType = {}));\n\nfunction getParamDeclaration(paramName, location, state) {\n var noReloadOnSearch = (state.reloadOnSearch === false && location === DefType.SEARCH) || undefined;\n var dynamic = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)([state.dynamic, noReloadOnSearch], _common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined);\n var defaultConfig = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(dynamic) ? { dynamic: dynamic } : {};\n var paramConfig = unwrapShorthand(state && state.params && state.params[paramName]);\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(defaultConfig, paramConfig);\n}\nfunction unwrapShorthand(cfg) {\n cfg = isShorthand(cfg) ? { value: cfg } : cfg;\n getStaticDefaultValue['__cacheable'] = true;\n function getStaticDefaultValue() {\n return cfg.value;\n }\n var $$fn = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isInjectable)(cfg.value) ? cfg.value : getStaticDefaultValue;\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(cfg, { $$fn: $$fn });\n}\nfunction getType(cfg, urlType, location, id, paramTypes) {\n if (cfg.type && urlType && urlType.name !== 'string')\n throw new Error(\"Param '\" + id + \"' has two type configurations.\");\n if (cfg.type && urlType && urlType.name === 'string' && paramTypes.type(cfg.type))\n return paramTypes.type(cfg.type);\n if (urlType)\n return urlType;\n if (!cfg.type) {\n var type = location === DefType.CONFIG\n ? 'any'\n : location === DefType.PATH\n ? 'path'\n : location === DefType.SEARCH\n ? 'query'\n : 'string';\n return paramTypes.type(type);\n }\n return cfg.type instanceof _paramType__WEBPACK_IMPORTED_MODULE_4__.ParamType ? cfg.type : paramTypes.type(cfg.type);\n}\n/** returns false, true, or the squash value to indicate the \"default parameter url squash policy\". */\nfunction getSquashPolicy(config, isOptional, defaultPolicy) {\n var squash = config.squash;\n if (!isOptional || squash === false)\n return false;\n if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(squash) || squash == null)\n return defaultPolicy;\n if (squash === true || (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(squash))\n return squash;\n throw new Error(\"Invalid squash policy: '\" + squash + \"'. Valid policies: false, true, or arbitrary string\");\n}\nfunction getReplace(config, arrayMode, isOptional, squash) {\n var defaultPolicy = [\n { from: '', to: isOptional || arrayMode ? undefined : '' },\n { from: null, to: isOptional || arrayMode ? undefined : '' },\n ];\n var replace = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isArray)(config.replace) ? config.replace : [];\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(squash))\n replace.push({ from: squash, to: undefined });\n var configuredKeys = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(replace, (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('from'));\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.filter)(defaultPolicy, function (item) { return configuredKeys.indexOf(item.from) === -1; }).concat(replace);\n}\nvar Param = /** @class */ (function () {\n function Param(id, type, location, urlConfig, state) {\n var config = getParamDeclaration(id, location, state);\n type = getType(config, type, location, id, urlConfig.paramTypes);\n var arrayMode = getArrayMode();\n type = arrayMode ? type.$asArray(arrayMode, location === DefType.SEARCH) : type;\n var isOptional = config.value !== undefined || location === DefType.SEARCH;\n var dynamic = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(config.dynamic) ? !!config.dynamic : !!type.dynamic;\n var raw = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(config.raw) ? !!config.raw : !!type.raw;\n var squash = getSquashPolicy(config, isOptional, urlConfig.defaultSquashPolicy());\n var replace = getReplace(config, arrayMode, isOptional, squash);\n var inherit = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(config.inherit) ? !!config.inherit : !!type.inherit;\n // array config: param name (param[]) overrides default settings. explicit config overrides param name.\n function getArrayMode() {\n var arrayDefaults = { array: location === DefType.SEARCH ? 'auto' : false };\n var arrayParamNomenclature = id.match(/\\[\\]$/) ? { array: true } : {};\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(arrayDefaults, arrayParamNomenclature, config).array;\n }\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this, { id: id, type: type, location: location, isOptional: isOptional, dynamic: dynamic, raw: raw, squash: squash, replace: replace, inherit: inherit, array: arrayMode, config: config });\n }\n Param.values = function (params, values) {\n if (values === void 0) { values = {}; }\n var paramValues = {};\n for (var _i = 0, params_1 = params; _i < params_1.length; _i++) {\n var param = params_1[_i];\n paramValues[param.id] = param.value(values[param.id]);\n }\n return paramValues;\n };\n /**\n * Finds [[Param]] objects which have different param values\n *\n * Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects\n *\n * @param params: The list of Param objects to filter\n * @param values1: The first set of parameter values\n * @param values2: the second set of parameter values\n *\n * @returns any Param objects whose values were different between values1 and values2\n */\n Param.changed = function (params, values1, values2) {\n if (values1 === void 0) { values1 = {}; }\n if (values2 === void 0) { values2 = {}; }\n return params.filter(function (param) { return !param.type.equals(values1[param.id], values2[param.id]); });\n };\n /**\n * Checks if two param value objects are equal (for a set of [[Param]] objects)\n *\n * @param params The list of [[Param]] objects to check\n * @param values1 The first set of param values\n * @param values2 The second set of param values\n *\n * @returns true if the param values in values1 and values2 are equal\n */\n Param.equals = function (params, values1, values2) {\n if (values1 === void 0) { values1 = {}; }\n if (values2 === void 0) { values2 = {}; }\n return Param.changed(params, values1, values2).length === 0;\n };\n /** Returns true if a the parameter values are valid, according to the Param definitions */\n Param.validates = function (params, values) {\n if (values === void 0) { values = {}; }\n return params.map(function (param) { return param.validates(values[param.id]); }).reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.allTrueR, true);\n };\n Param.prototype.isDefaultValue = function (value) {\n return this.isOptional && this.type.equals(this.value(), value);\n };\n /**\n * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the\n * default value, which may be the result of an injectable function.\n */\n Param.prototype.value = function (value) {\n var _this = this;\n /**\n * [Internal] Get the default value of a parameter, which may be an injectable function.\n */\n var getDefaultValue = function () {\n if (_this._defaultValueCache)\n return _this._defaultValueCache.defaultValue;\n if (!_common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$injector)\n throw new Error('Injectable functions cannot be called at configuration time');\n var defaultValue = _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$injector.invoke(_this.config.$$fn);\n if (defaultValue !== null && defaultValue !== undefined && !_this.type.is(defaultValue))\n throw new Error(\"Default value (\" + defaultValue + \") for parameter '\" + _this.id + \"' is not an instance of ParamType (\" + _this.type.name + \")\");\n if (_this.config.$$fn['__cacheable']) {\n _this._defaultValueCache = { defaultValue: defaultValue };\n }\n return defaultValue;\n };\n var replaceSpecialValues = function (val) {\n for (var _i = 0, _a = _this.replace; _i < _a.length; _i++) {\n var tuple = _a[_i];\n if (tuple.from === val)\n return tuple.to;\n }\n return val;\n };\n value = replaceSpecialValues(value);\n return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isUndefined)(value) ? getDefaultValue() : this.type.$normalize(value);\n };\n Param.prototype.isSearch = function () {\n return this.location === DefType.SEARCH;\n };\n Param.prototype.validates = function (value) {\n // There was no parameter value, but the param is optional\n if (((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isUndefined)(value) || value === null) && this.isOptional)\n return true;\n // The value was not of the correct ParamType, and could not be decoded to the correct ParamType\n var normalized = this.type.$normalize(value);\n if (!this.type.is(normalized))\n return false;\n // The value was of the correct type, but when encoded, did not match the ParamType's regexp\n var encoded = this.type.encode(normalized);\n return !((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(encoded) && !this.type.pattern.exec(encoded));\n };\n Param.prototype.toString = function () {\n return \"{Param:\" + this.id + \" \" + this.type + \" squash: '\" + this.squash + \"' optional: \" + this.isOptional + \"}\";\n };\n return Param;\n}());\n\n//# sourceMappingURL=param.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/params/param.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/params/paramType.js": /*!*****************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/params/paramType.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ParamType\": () => (/* binding */ ParamType)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n\n\n/**\n * An internal class which implements [[ParamTypeDefinition]].\n *\n * A [[ParamTypeDefinition]] is a plain javascript object used to register custom parameter types.\n * When a param type definition is registered, an instance of this class is created internally.\n *\n * This class has naive implementations for all the [[ParamTypeDefinition]] methods.\n *\n * Used by [[UrlMatcher]] when matching or formatting URLs, or comparing and validating parameter values.\n *\n * #### Example:\n * ```js\n * var paramTypeDef = {\n * decode: function(val) { return parseInt(val, 10); },\n * encode: function(val) { return val && val.toString(); },\n * equals: function(a, b) { return this.is(a) && a === b; },\n * is: function(val) { return angular.isNumber(val) && isFinite(val) && val % 1 === 0; },\n * pattern: /\\d+/\n * }\n *\n * var paramType = new ParamType(paramTypeDef);\n * ```\n */\nvar ParamType = /** @class */ (function () {\n /**\n * @param def A configuration object which contains the custom type definition. The object's\n * properties will override the default methods and/or pattern in `ParamType`'s public interface.\n * @returns a new ParamType object\n */\n function ParamType(def) {\n /** @inheritdoc */\n this.pattern = /.*/;\n /** @inheritdoc */\n this.inherit = true;\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this, def);\n }\n // consider these four methods to be \"abstract methods\" that should be overridden\n /** @inheritdoc */\n ParamType.prototype.is = function (val, key) {\n return true;\n };\n /** @inheritdoc */\n ParamType.prototype.encode = function (val, key) {\n return val;\n };\n /** @inheritdoc */\n ParamType.prototype.decode = function (val, key) {\n return val;\n };\n /** @inheritdoc */\n ParamType.prototype.equals = function (a, b) {\n // tslint:disable-next-line:triple-equals\n return a == b;\n };\n ParamType.prototype.$subPattern = function () {\n var sub = this.pattern.toString();\n return sub.substr(1, sub.length - 2);\n };\n ParamType.prototype.toString = function () {\n return \"{ParamType:\" + this.name + \"}\";\n };\n /** Given an encoded string, or a decoded object, returns a decoded object */\n ParamType.prototype.$normalize = function (val) {\n return this.is(val) ? val : this.decode(val);\n };\n /**\n * Wraps an existing custom ParamType as an array of ParamType, depending on 'mode'.\n * e.g.:\n * - urlmatcher pattern \"/path?{queryParam[]:int}\"\n * - url: \"/path?queryParam=1&queryParam=2\n * - $stateParams.queryParam will be [1, 2]\n * if `mode` is \"auto\", then\n * - url: \"/path?queryParam=1 will create $stateParams.queryParam: 1\n * - url: \"/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]\n */\n ParamType.prototype.$asArray = function (mode, isSearch) {\n if (!mode)\n return this;\n if (mode === 'auto' && !isSearch)\n throw new Error(\"'auto' array mode is for query parameters only\");\n return new ArrayType(this, mode);\n };\n return ParamType;\n}());\n\n/** Wraps up a `ParamType` object to handle array values. */\nfunction ArrayType(type, mode) {\n var _this = this;\n // Wrap non-array value as array\n function arrayWrap(val) {\n return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray)(val) ? val : (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(val) ? [val] : [];\n }\n // Unwrap array value for \"auto\" mode. Return undefined for empty array.\n function arrayUnwrap(val) {\n switch (val.length) {\n case 0:\n return undefined;\n case 1:\n return mode === 'auto' ? val[0] : val;\n default:\n return val;\n }\n }\n // Wraps type (.is/.encode/.decode) functions to operate on each value of an array\n function arrayHandler(callback, allTruthyMode) {\n return function handleArray(val) {\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray)(val) && val.length === 0)\n return val;\n var arr = arrayWrap(val);\n var result = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(arr, callback);\n return allTruthyMode === true ? (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.filter)(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);\n };\n }\n // Wraps type (.equals) functions to operate on each value of an array\n function arrayEqualsHandler(callback) {\n return function handleArray(val1, val2) {\n var left = arrayWrap(val1), right = arrayWrap(val2);\n if (left.length !== right.length)\n return false;\n for (var i = 0; i < left.length; i++) {\n if (!callback(left[i], right[i]))\n return false;\n }\n return true;\n };\n }\n ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {\n var paramTypeFn = type[name].bind(type);\n var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;\n _this[name] = wrapperFn(paramTypeFn);\n });\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this, {\n dynamic: type.dynamic,\n name: type.name,\n pattern: type.pattern,\n inherit: type.inherit,\n raw: type.raw,\n is: arrayHandler(type.is.bind(type), true),\n $arrayMode: mode,\n });\n}\n//# sourceMappingURL=paramType.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/params/paramType.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/params/paramTypes.js": /*!******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/params/paramTypes.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ParamTypes\": () => (/* binding */ ParamTypes)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n/* harmony import */ var _paramType__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./paramType */ \"./node_modules/@uirouter/core/lib-esm/params/paramType.js\");\n\n\n\n\n\n/**\n * A registry for parameter types.\n *\n * This registry manages the built-in (and custom) parameter types.\n *\n * The built-in parameter types are:\n *\n * - [[string]]\n * - [[path]]\n * - [[query]]\n * - [[hash]]\n * - [[int]]\n * - [[bool]]\n * - [[date]]\n * - [[json]]\n * - [[any]]\n *\n * To register custom parameter types, use [[UrlConfig.type]], i.e.,\n *\n * ```js\n * router.urlService.config.type(customType)\n * ```\n */\nvar ParamTypes = /** @class */ (function () {\n function ParamTypes() {\n this.enqueue = true;\n this.typeQueue = [];\n this.defaultTypes = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.pick)(ParamTypes.prototype, [\n 'hash',\n 'string',\n 'query',\n 'path',\n 'int',\n 'bool',\n 'date',\n 'json',\n 'any',\n ]);\n // Register default types. Store them in the prototype of this.types.\n var makeType = function (definition, name) { return new _paramType__WEBPACK_IMPORTED_MODULE_4__.ParamType((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({ name: name }, definition)); };\n this.types = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inherit)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(this.defaultTypes, makeType), {});\n }\n ParamTypes.prototype.dispose = function () {\n this.types = {};\n };\n /**\n * Registers a parameter type\n *\n * End users should call [[UrlMatcherFactory.type]], which delegates to this method.\n */\n ParamTypes.prototype.type = function (name, definition, definitionFn) {\n if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(definition))\n return this.types[name];\n if (this.types.hasOwnProperty(name))\n throw new Error(\"A type named '\" + name + \"' has already been defined.\");\n this.types[name] = new _paramType__WEBPACK_IMPORTED_MODULE_4__.ParamType((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({ name: name }, definition));\n if (definitionFn) {\n this.typeQueue.push({ name: name, def: definitionFn });\n if (!this.enqueue)\n this._flushTypeQueue();\n }\n return this;\n };\n ParamTypes.prototype._flushTypeQueue = function () {\n while (this.typeQueue.length) {\n var type = this.typeQueue.shift();\n if (type.pattern)\n throw new Error(\"You cannot override a type's .pattern at runtime.\");\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this.types[type.name], _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$injector.invoke(type.def));\n }\n };\n return ParamTypes;\n}());\n\nfunction initDefaultTypes() {\n var makeDefaultType = function (def) {\n var valToString = function (val) { return (val != null ? val.toString() : val); };\n var defaultTypeBase = {\n encode: valToString,\n decode: valToString,\n is: (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.is)(String),\n pattern: /.*/,\n // tslint:disable-next-line:triple-equals\n equals: function (a, b) { return a == b; },\n };\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, defaultTypeBase, def);\n };\n // Default Parameter Type Definitions\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(ParamTypes.prototype, {\n string: makeDefaultType({}),\n path: makeDefaultType({\n pattern: /[^/]*/,\n }),\n query: makeDefaultType({}),\n hash: makeDefaultType({\n inherit: false,\n }),\n int: makeDefaultType({\n decode: function (val) { return parseInt(val, 10); },\n is: function (val) {\n return !(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isNullOrUndefined)(val) && this.decode(val.toString()) === val;\n },\n pattern: /-?\\d+/,\n }),\n bool: makeDefaultType({\n encode: function (val) { return (val && 1) || 0; },\n decode: function (val) { return parseInt(val, 10) !== 0; },\n is: (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.is)(Boolean),\n pattern: /0|1/,\n }),\n date: makeDefaultType({\n encode: function (val) {\n return !this.is(val)\n ? undefined\n : [val.getFullYear(), ('0' + (val.getMonth() + 1)).slice(-2), ('0' + val.getDate()).slice(-2)].join('-');\n },\n decode: function (val) {\n if (this.is(val))\n return val;\n var match = this.capture.exec(val);\n return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;\n },\n is: function (val) { return val instanceof Date && !isNaN(val.valueOf()); },\n equals: function (l, r) {\n return ['getFullYear', 'getMonth', 'getDate'].reduce(function (acc, fn) { return acc && l[fn]() === r[fn](); }, true);\n },\n pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,\n capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/,\n }),\n json: makeDefaultType({\n encode: _common_common__WEBPACK_IMPORTED_MODULE_0__.toJson,\n decode: _common_common__WEBPACK_IMPORTED_MODULE_0__.fromJson,\n is: (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.is)(Object),\n equals: _common_common__WEBPACK_IMPORTED_MODULE_0__.equals,\n pattern: /[^/]*/,\n }),\n // does not encode/decode\n any: makeDefaultType({\n encode: _common_common__WEBPACK_IMPORTED_MODULE_0__.identity,\n decode: _common_common__WEBPACK_IMPORTED_MODULE_0__.identity,\n is: function () { return true; },\n equals: _common_common__WEBPACK_IMPORTED_MODULE_0__.equals,\n }),\n });\n}\ninitDefaultTypes();\n//# sourceMappingURL=paramTypes.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/params/stateParams.js": /*!*******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/params/stateParams.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StateParams\": () => (/* binding */ StateParams)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n\nvar StateParams = /** @class */ (function () {\n function StateParams(params) {\n if (params === void 0) { params = {}; }\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this, params);\n }\n /**\n * Merges a set of parameters with all parameters inherited between the common parents of the\n * current state and a given destination state.\n *\n * @param {Object} newParams The set of parameters which will be composited with inherited params.\n * @param {Object} $current Internal definition of object representing the current state.\n * @param {Object} $to Internal definition of object representing state to transition to.\n */\n StateParams.prototype.$inherit = function (newParams, $current, $to) {\n var parents = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.ancestors)($current, $to), inherited = {}, inheritList = [];\n for (var i in parents) {\n if (!parents[i] || !parents[i].params)\n continue;\n var parentParams = parents[i].params;\n var parentParamsKeys = Object.keys(parentParams);\n if (!parentParamsKeys.length)\n continue;\n for (var j in parentParamsKeys) {\n if (parentParams[parentParamsKeys[j]].inherit == false || inheritList.indexOf(parentParamsKeys[j]) >= 0)\n continue;\n inheritList.push(parentParamsKeys[j]);\n inherited[parentParamsKeys[j]] = this[parentParamsKeys[j]];\n }\n }\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, inherited, newParams);\n };\n return StateParams;\n}());\n\n//# sourceMappingURL=stateParams.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/params/stateParams.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/path/index.js": /*!***********************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/path/index.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PathNode\": () => (/* reexport safe */ _pathNode__WEBPACK_IMPORTED_MODULE_0__.PathNode),\n/* harmony export */ \"PathUtils\": () => (/* reexport safe */ _pathUtils__WEBPACK_IMPORTED_MODULE_1__.PathUtils)\n/* harmony export */ });\n/* harmony import */ var _pathNode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pathNode */ \"./node_modules/@uirouter/core/lib-esm/path/pathNode.js\");\n/* harmony import */ var _pathUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pathUtils */ \"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js\");\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/path/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/path/pathNode.js": /*!**************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/path/pathNode.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PathNode\": () => (/* binding */ PathNode)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _params_param__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../params/param */ \"./node_modules/@uirouter/core/lib-esm/params/param.js\");\n\n\n\n/**\n * A node in a [[TreeChanges]] path\n *\n * For a [[TreeChanges]] path, this class holds the stateful information for a single node in the path.\n * Each PathNode corresponds to a state being entered, exited, or retained.\n * The stateful information includes parameter values and resolve data.\n */\nvar PathNode = /** @class */ (function () {\n function PathNode(stateOrNode) {\n if (stateOrNode instanceof PathNode) {\n var node = stateOrNode;\n this.state = node.state;\n this.paramSchema = node.paramSchema.slice();\n this.paramValues = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, node.paramValues);\n this.resolvables = node.resolvables.slice();\n this.views = node.views && node.views.slice();\n }\n else {\n var state = stateOrNode;\n this.state = state;\n this.paramSchema = state.parameters({ inherit: false });\n this.paramValues = {};\n this.resolvables = state.resolvables.map(function (res) { return res.clone(); });\n }\n }\n PathNode.prototype.clone = function () {\n return new PathNode(this);\n };\n /** Sets [[paramValues]] for the node, from the values of an object hash */\n PathNode.prototype.applyRawParams = function (params) {\n var getParamVal = function (paramDef) { return [paramDef.id, paramDef.value(params[paramDef.id])]; };\n this.paramValues = this.paramSchema.reduce(function (memo, pDef) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.applyPairs)(memo, getParamVal(pDef)); }, {});\n return this;\n };\n /** Gets a specific [[Param]] metadata that belongs to the node */\n PathNode.prototype.parameter = function (name) {\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(this.paramSchema, (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.propEq)('id', name));\n };\n /**\n * @returns true if the state and parameter values for another PathNode are\n * equal to the state and param values for this PathNode\n */\n PathNode.prototype.equals = function (node, paramsFn) {\n var diff = this.diff(node, paramsFn);\n return diff && diff.length === 0;\n };\n /**\n * Finds Params with different parameter values on another PathNode.\n *\n * Given another node (of the same state), finds the parameter values which differ.\n * Returns the [[Param]] (schema objects) whose parameter values differ.\n *\n * Given another node for a different state, returns `false`\n *\n * @param node The node to compare to\n * @param paramsFn A function that returns which parameters should be compared.\n * @returns The [[Param]]s which differ, or null if the two nodes are for different states\n */\n PathNode.prototype.diff = function (node, paramsFn) {\n if (this.state !== node.state)\n return false;\n var params = paramsFn ? paramsFn(this) : this.paramSchema;\n return _params_param__WEBPACK_IMPORTED_MODULE_2__.Param.changed(params, this.paramValues, node.paramValues);\n };\n /**\n * Returns a clone of the PathNode\n * @deprecated use instance method `node.clone()`\n */\n PathNode.clone = function (node) { return node.clone(); };\n return PathNode;\n}());\n\n//# sourceMappingURL=pathNode.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/path/pathNode.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/path/pathUtils.js": /*!***************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/path/pathUtils.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PathUtils\": () => (/* binding */ PathUtils)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _state_targetState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../state/targetState */ \"./node_modules/@uirouter/core/lib-esm/state/targetState.js\");\n/* harmony import */ var _pathNode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pathNode */ \"./node_modules/@uirouter/core/lib-esm/path/pathNode.js\");\n\n\n\n\n/**\n * This class contains functions which convert TargetStates, Nodes and paths from one type to another.\n */\nvar PathUtils = /** @class */ (function () {\n function PathUtils() {\n }\n /** Given a PathNode[], create an TargetState */\n PathUtils.makeTargetState = function (registry, path) {\n var state = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.tail)(path).state;\n return new _state_targetState__WEBPACK_IMPORTED_MODULE_2__.TargetState(registry, state, path.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('paramValues')).reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.mergeR, {}), {});\n };\n PathUtils.buildPath = function (targetState) {\n var toParams = targetState.params();\n return targetState.$state().path.map(function (state) { return new _pathNode__WEBPACK_IMPORTED_MODULE_3__.PathNode(state).applyRawParams(toParams); });\n };\n /** Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[] */\n PathUtils.buildToPath = function (fromPath, targetState) {\n var toPath = PathUtils.buildPath(targetState);\n if (targetState.options().inherit) {\n return PathUtils.inheritParams(fromPath, toPath, Object.keys(targetState.params()));\n }\n return toPath;\n };\n /**\n * Creates ViewConfig objects and adds to nodes.\n *\n * On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state\n */\n PathUtils.applyViewConfigs = function ($view, path, states) {\n // Only apply the viewConfigs to the nodes for the given states\n path\n .filter(function (node) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(states, node.state); })\n .forEach(function (node) {\n var viewDecls = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.values)(node.state.views || {});\n var subPath = PathUtils.subPath(path, function (n) { return n === node; });\n var viewConfigs = viewDecls.map(function (view) { return $view.createViewConfig(subPath, view); });\n node.views = viewConfigs.reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []);\n });\n };\n /**\n * Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath\n *\n * For a parameter in a node to be inherited from the from path:\n * - The toPath's node must have a matching node in the fromPath (by state).\n * - The parameter name must not be found in the toKeys parameter array.\n *\n * Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some\n * caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams,\n * it is not inherited from the fromPath.\n */\n PathUtils.inheritParams = function (fromPath, toPath, toKeys) {\n if (toKeys === void 0) { toKeys = []; }\n function nodeParamVals(path, state) {\n var node = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(path, (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.propEq)('state', state));\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, node && node.paramValues);\n }\n var noInherit = fromPath\n .map(function (node) { return node.paramSchema; })\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])\n .filter(function (param) { return !param.inherit; })\n .map((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('id'));\n /**\n * Given an [[PathNode]] \"toNode\", return a new [[PathNode]] with param values inherited from the\n * matching node in fromPath. Only inherit keys that aren't found in \"toKeys\" from the node in \"fromPath\"\"\n */\n function makeInheritedParamsNode(toNode) {\n // All param values for the node (may include default key/vals, when key was not found in toParams)\n var toParamVals = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, toNode && toNode.paramValues);\n // limited to only those keys found in toParams\n var incomingParamVals = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.pick)(toParamVals, toKeys);\n toParamVals = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.omit)(toParamVals, toKeys);\n var fromParamVals = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.omit)(nodeParamVals(fromPath, toNode.state) || {}, noInherit);\n // extend toParamVals with any fromParamVals, then override any of those those with incomingParamVals\n var ownParamVals = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(toParamVals, fromParamVals, incomingParamVals);\n return new _pathNode__WEBPACK_IMPORTED_MODULE_3__.PathNode(toNode.state).applyRawParams(ownParamVals);\n }\n // The param keys specified by the incoming toParams\n return toPath.map(makeInheritedParamsNode);\n };\n /**\n * Computes the tree changes (entering, exiting) between a fromPath and toPath.\n */\n PathUtils.treeChanges = function (fromPath, toPath, reloadState) {\n var max = Math.min(fromPath.length, toPath.length);\n var keep = 0;\n var nodesMatch = function (node1, node2) { return node1.equals(node2, PathUtils.nonDynamicParams); };\n while (keep < max && fromPath[keep].state !== reloadState && nodesMatch(fromPath[keep], toPath[keep])) {\n keep++;\n }\n /** Given a retained node, return a new node which uses the to node's param values */\n function applyToParams(retainedNode, idx) {\n var cloned = retainedNode.clone();\n cloned.paramValues = toPath[idx].paramValues;\n return cloned;\n }\n var from, retained, exiting, entering, to;\n from = fromPath;\n retained = from.slice(0, keep);\n exiting = from.slice(keep);\n // Create a new retained path (with shallow copies of nodes) which have the params of the toPath mapped\n var retainedWithToParams = retained.map(applyToParams);\n entering = toPath.slice(keep);\n to = retainedWithToParams.concat(entering);\n return { from: from, to: to, retained: retained, retainedWithToParams: retainedWithToParams, exiting: exiting, entering: entering };\n };\n /**\n * Returns a new path which is: the subpath of the first path which matches the second path.\n *\n * The new path starts from root and contains any nodes that match the nodes in the second path.\n * It stops before the first non-matching node.\n *\n * Nodes are compared using their state property and their parameter values.\n * If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes.\n *\n * @param pathA the first path\n * @param pathB the second path\n * @param paramsFn a function which returns the parameters to consider when comparing\n *\n * @returns an array of PathNodes from the first path which match the nodes in the second path\n */\n PathUtils.matching = function (pathA, pathB, paramsFn) {\n var done = false;\n var tuples = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.arrayTuples)(pathA, pathB);\n return tuples.reduce(function (matching, _a) {\n var nodeA = _a[0], nodeB = _a[1];\n done = done || !nodeA.equals(nodeB, paramsFn);\n return done ? matching : matching.concat(nodeA);\n }, []);\n };\n /**\n * Returns true if two paths are identical.\n *\n * @param pathA\n * @param pathB\n * @param paramsFn a function which returns the parameters to consider when comparing\n * @returns true if the the states and parameter values for both paths are identical\n */\n PathUtils.equals = function (pathA, pathB, paramsFn) {\n return pathA.length === pathB.length && PathUtils.matching(pathA, pathB, paramsFn).length === pathA.length;\n };\n /**\n * Return a subpath of a path, which stops at the first matching node\n *\n * Given an array of nodes, returns a subset of the array starting from the first node,\n * stopping when the first node matches the predicate.\n *\n * @param path a path of [[PathNode]]s\n * @param predicate a [[Predicate]] fn that matches [[PathNode]]s\n * @returns a subpath up to the matching node, or undefined if no match is found\n */\n PathUtils.subPath = function (path, predicate) {\n var node = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(path, predicate);\n var elementIdx = path.indexOf(node);\n return elementIdx === -1 ? undefined : path.slice(0, elementIdx + 1);\n };\n PathUtils.nonDynamicParams = function (node) {\n return node.state.parameters({ inherit: false }).filter(function (param) { return !param.dynamic; });\n };\n /** Gets the raw parameter values from a path */\n PathUtils.paramValues = function (path) { return path.reduce(function (acc, node) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(acc, node.paramValues); }, {}); };\n return PathUtils;\n}());\n\n//# sourceMappingURL=pathUtils.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/resolve/index.js": /*!**************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/resolve/index.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"NATIVE_INJECTOR_TOKEN\": () => (/* reexport safe */ _resolveContext__WEBPACK_IMPORTED_MODULE_2__.NATIVE_INJECTOR_TOKEN),\n/* harmony export */ \"Resolvable\": () => (/* reexport safe */ _resolvable__WEBPACK_IMPORTED_MODULE_1__.Resolvable),\n/* harmony export */ \"ResolveContext\": () => (/* reexport safe */ _resolveContext__WEBPACK_IMPORTED_MODULE_2__.ResolveContext),\n/* harmony export */ \"defaultResolvePolicy\": () => (/* reexport safe */ _resolvable__WEBPACK_IMPORTED_MODULE_1__.defaultResolvePolicy),\n/* harmony export */ \"resolvePolicies\": () => (/* reexport safe */ _interface__WEBPACK_IMPORTED_MODULE_0__.resolvePolicies)\n/* harmony export */ });\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/resolve/interface.js\");\n/* harmony import */ var _resolvable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./resolvable */ \"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js\");\n/* harmony import */ var _resolveContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./resolveContext */ \"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js\");\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/resolve/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/resolve/interface.js": /*!******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/resolve/interface.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"resolvePolicies\": () => (/* binding */ resolvePolicies)\n/* harmony export */ });\nvar resolvePolicies = {\n when: {\n LAZY: 'LAZY',\n EAGER: 'EAGER',\n },\n async: {\n WAIT: 'WAIT',\n NOWAIT: 'NOWAIT',\n },\n};\n//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/resolve/interface.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js": /*!*******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Resolvable\": () => (/* binding */ Resolvable),\n/* harmony export */ \"defaultResolvePolicy\": () => (/* binding */ defaultResolvePolicy)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/trace */ \"./node_modules/@uirouter/core/lib-esm/common/trace.js\");\n/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/strings */ \"./node_modules/@uirouter/core/lib-esm/common/strings.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n\n\n\n\n\n\n// TODO: explicitly make this user configurable\nvar defaultResolvePolicy = {\n when: 'LAZY',\n async: 'WAIT',\n};\n/**\n * The basic building block for the resolve system.\n *\n * Resolvables encapsulate a state's resolve's resolveFn, the resolveFn's declared dependencies, the wrapped (.promise),\n * and the unwrapped-when-complete (.data) result of the resolveFn.\n *\n * Resolvable.get() either retrieves the Resolvable's existing promise, or else invokes resolve() (which invokes the\n * resolveFn) and returns the resulting promise.\n *\n * Resolvable.get() and Resolvable.resolve() both execute within a context path, which is passed as the first\n * parameter to those fns.\n */\nvar Resolvable = /** @class */ (function () {\n function Resolvable(arg1, resolveFn, deps, policy, data) {\n this.resolved = false;\n this.promise = undefined;\n if (arg1 instanceof Resolvable) {\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this, arg1);\n }\n else if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isFunction)(resolveFn)) {\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isNullOrUndefined)(arg1))\n throw new Error('new Resolvable(): token argument is required');\n if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isFunction)(resolveFn))\n throw new Error('new Resolvable(): resolveFn argument must be a function');\n this.token = arg1;\n this.policy = policy;\n this.resolveFn = resolveFn;\n this.deps = deps || [];\n this.data = data;\n this.resolved = data !== undefined;\n this.promise = this.resolved ? _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(this.data) : undefined;\n }\n else if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isObject)(arg1) && arg1.token && (arg1.hasOwnProperty('resolveFn') || arg1.hasOwnProperty('data'))) {\n var literal = arg1;\n return new Resolvable(literal.token, literal.resolveFn, literal.deps, literal.policy, literal.data);\n }\n }\n Resolvable.prototype.getPolicy = function (state) {\n var thisPolicy = this.policy || {};\n var statePolicy = (state && state.resolvePolicy) || {};\n return {\n when: thisPolicy.when || statePolicy.when || defaultResolvePolicy.when,\n async: thisPolicy.async || statePolicy.async || defaultResolvePolicy.async,\n };\n };\n /**\n * Asynchronously resolve this Resolvable's data\n *\n * Given a ResolveContext that this Resolvable is found in:\n * Wait for this Resolvable's dependencies, then invoke this Resolvable's function\n * and update the Resolvable's state\n */\n Resolvable.prototype.resolve = function (resolveContext, trans) {\n var _this = this;\n var $q = _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q;\n // Gets all dependencies from ResolveContext and wait for them to be resolved\n var getResolvableDependencies = function () {\n return $q.all(resolveContext.getDependencies(_this).map(function (resolvable) { return resolvable.get(resolveContext, trans); }));\n };\n // Invokes the resolve function passing the resolved dependencies as arguments\n var invokeResolveFn = function (resolvedDeps) { return _this.resolveFn.apply(null, resolvedDeps); };\n var node = resolveContext.findNode(this);\n var state = node && node.state;\n var asyncPolicy = this.getPolicy(state).async;\n var customAsyncPolicy = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isFunction)(asyncPolicy) ? asyncPolicy : _common_common__WEBPACK_IMPORTED_MODULE_0__.identity;\n // After the final value has been resolved, update the state of the Resolvable\n var applyResolvedValue = function (resolvedValue) {\n _this.data = resolvedValue;\n _this.resolved = true;\n _this.resolveFn = null;\n _common_trace__WEBPACK_IMPORTED_MODULE_2__.trace.traceResolvableResolved(_this, trans);\n return _this.data;\n };\n // Sets the promise property first, then getsResolvableDependencies in the context of the promise chain. Always waits one tick.\n return (this.promise = $q\n .when()\n .then(getResolvableDependencies)\n .then(invokeResolveFn)\n .then(customAsyncPolicy)\n .then(applyResolvedValue));\n };\n /**\n * Gets a promise for this Resolvable's data.\n *\n * Fetches the data and returns a promise.\n * Returns the existing promise if it has already been fetched once.\n */\n Resolvable.prototype.get = function (resolveContext, trans) {\n return this.promise || this.resolve(resolveContext, trans);\n };\n Resolvable.prototype.toString = function () {\n return \"Resolvable(token: \" + (0,_common_strings__WEBPACK_IMPORTED_MODULE_3__.stringify)(this.token) + \", requires: [\" + this.deps.map(_common_strings__WEBPACK_IMPORTED_MODULE_3__.stringify) + \"])\";\n };\n Resolvable.prototype.clone = function () {\n return new Resolvable(this);\n };\n Resolvable.fromData = function (token, data) { return new Resolvable(token, function () { return data; }, null, null, data); };\n return Resolvable;\n}());\n\n//# sourceMappingURL=resolvable.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js": /*!***********************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"NATIVE_INJECTOR_TOKEN\": () => (/* binding */ NATIVE_INJECTOR_TOKEN),\n/* harmony export */ \"ResolveContext\": () => (/* binding */ ResolveContext)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/trace */ \"./node_modules/@uirouter/core/lib-esm/common/trace.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/resolve/interface.js\");\n/* harmony import */ var _resolvable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./resolvable */ \"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js\");\n/* harmony import */ var _path_pathUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../path/pathUtils */ \"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js\");\n/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/strings */ \"./node_modules/@uirouter/core/lib-esm/common/strings.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n\n\n\n\n\n\n\n\n\nvar whens = _interface__WEBPACK_IMPORTED_MODULE_4__.resolvePolicies.when;\nvar ALL_WHENS = [whens.EAGER, whens.LAZY];\nvar EAGER_WHENS = [whens.EAGER];\n// tslint:disable-next-line:no-inferrable-types\nvar NATIVE_INJECTOR_TOKEN = 'Native Injector';\n/**\n * Encapsulates Dependency Injection for a path of nodes\n *\n * UI-Router states are organized as a tree.\n * A nested state has a path of ancestors to the root of the tree.\n * When a state is being activated, each element in the path is wrapped as a [[PathNode]].\n * A `PathNode` is a stateful object that holds things like parameters and resolvables for the state being activated.\n *\n * The ResolveContext closes over the [[PathNode]]s, and provides DI for the last node in the path.\n */\nvar ResolveContext = /** @class */ (function () {\n function ResolveContext(_path) {\n this._path = _path;\n }\n /** Gets all the tokens found in the resolve context, de-duplicated */\n ResolveContext.prototype.getTokens = function () {\n return this._path.reduce(function (acc, node) { return acc.concat(node.resolvables.map(function (r) { return r.token; })); }, []).reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.uniqR, []);\n };\n /**\n * Gets the Resolvable that matches the token\n *\n * Gets the last Resolvable that matches the token in this context, or undefined.\n * Throws an error if it doesn't exist in the ResolveContext\n */\n ResolveContext.prototype.getResolvable = function (token) {\n var matching = this._path\n .map(function (node) { return node.resolvables; })\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])\n .filter(function (r) { return r.token === token; });\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.tail)(matching);\n };\n /** Returns the [[ResolvePolicy]] for the given [[Resolvable]] */\n ResolveContext.prototype.getPolicy = function (resolvable) {\n var node = this.findNode(resolvable);\n return resolvable.getPolicy(node.state);\n };\n /**\n * Returns a ResolveContext that includes a portion of this one\n *\n * Given a state, this method creates a new ResolveContext from this one.\n * The new context starts at the first node (root) and stops at the node for the `state` parameter.\n *\n * #### Why\n *\n * When a transition is created, the nodes in the \"To Path\" are injected from a ResolveContext.\n * A ResolveContext closes over a path of [[PathNode]]s and processes the resolvables.\n * The \"To State\" can inject values from its own resolvables, as well as those from all its ancestor state's (node's).\n * This method is used to create a narrower context when injecting ancestor nodes.\n *\n * @example\n * `let ABCD = new ResolveContext([A, B, C, D]);`\n *\n * Given a path `[A, B, C, D]`, where `A`, `B`, `C` and `D` are nodes for states `a`, `b`, `c`, `d`:\n * When injecting `D`, `D` should have access to all resolvables from `A`, `B`, `C`, `D`.\n * However, `B` should only be able to access resolvables from `A`, `B`.\n *\n * When resolving for the `B` node, first take the full \"To Path\" Context `[A,B,C,D]` and limit to the subpath `[A,B]`.\n * `let AB = ABCD.subcontext(a)`\n */\n ResolveContext.prototype.subContext = function (state) {\n return new ResolveContext(_path_pathUtils__WEBPACK_IMPORTED_MODULE_6__.PathUtils.subPath(this._path, function (node) { return node.state === state; }));\n };\n /**\n * Adds Resolvables to the node that matches the state\n *\n * This adds a [[Resolvable]] (generally one created on the fly; not declared on a [[StateDeclaration.resolve]] block).\n * The resolvable is added to the node matching the `state` parameter.\n *\n * These new resolvables are not automatically fetched.\n * The calling code should either fetch them, fetch something that depends on them,\n * or rely on [[resolvePath]] being called when some state is being entered.\n *\n * Note: each resolvable's [[ResolvePolicy]] is merged with the state's policy, and the global default.\n *\n * @param newResolvables the new Resolvables\n * @param state Used to find the node to put the resolvable on\n */\n ResolveContext.prototype.addResolvables = function (newResolvables, state) {\n var node = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(this._path, (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.propEq)('state', state));\n var keys = newResolvables.map(function (r) { return r.token; });\n node.resolvables = node.resolvables.filter(function (r) { return keys.indexOf(r.token) === -1; }).concat(newResolvables);\n };\n /**\n * Returns a promise for an array of resolved path Element promises\n *\n * @param when\n * @param trans\n * @returns {Promise|any}\n */\n ResolveContext.prototype.resolvePath = function (when, trans) {\n var _this = this;\n if (when === void 0) { when = 'LAZY'; }\n // This option determines which 'when' policy Resolvables we are about to fetch.\n var whenOption = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(ALL_WHENS, when) ? when : 'LAZY';\n // If the caller specified EAGER, only the EAGER Resolvables are fetched.\n // if the caller specified LAZY, both EAGER and LAZY Resolvables are fetched.`\n var matchedWhens = whenOption === _interface__WEBPACK_IMPORTED_MODULE_4__.resolvePolicies.when.EAGER ? EAGER_WHENS : ALL_WHENS;\n // get the subpath to the state argument, if provided\n _common_trace__WEBPACK_IMPORTED_MODULE_2__.trace.traceResolvePath(this._path, when, trans);\n var matchesPolicy = function (acceptedVals, whenOrAsync) { return function (resolvable) {\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(acceptedVals, _this.getPolicy(resolvable)[whenOrAsync]);\n }; };\n // Trigger all the (matching) Resolvables in the path\n // Reduce all the \"WAIT\" Resolvables into an array\n var promises = this._path.reduce(function (acc, node) {\n var nodeResolvables = node.resolvables.filter(matchesPolicy(matchedWhens, 'when'));\n var nowait = nodeResolvables.filter(matchesPolicy(['NOWAIT'], 'async'));\n var wait = nodeResolvables.filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.not)(matchesPolicy(['NOWAIT'], 'async')));\n // For the matching Resolvables, start their async fetch process.\n var subContext = _this.subContext(node.state);\n var getResult = function (r) {\n return r\n .get(subContext, trans)\n // Return a tuple that includes the Resolvable's token\n .then(function (value) { return ({ token: r.token, value: value }); });\n };\n nowait.forEach(getResult);\n return acc.concat(wait.map(getResult));\n }, []);\n // Wait for all the \"WAIT\" resolvables\n return _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.all(promises);\n };\n ResolveContext.prototype.injector = function () {\n return this._injector || (this._injector = new UIInjectorImpl(this));\n };\n ResolveContext.prototype.findNode = function (resolvable) {\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(this._path, function (node) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(node.resolvables, resolvable); });\n };\n /**\n * Gets the async dependencies of a Resolvable\n *\n * Given a Resolvable, returns its dependencies as a Resolvable[]\n */\n ResolveContext.prototype.getDependencies = function (resolvable) {\n var _this = this;\n var node = this.findNode(resolvable);\n // Find which other resolvables are \"visible\" to the `resolvable` argument\n // subpath stopping at resolvable's node, or the whole path (if the resolvable isn't in the path)\n var subPath = _path_pathUtils__WEBPACK_IMPORTED_MODULE_6__.PathUtils.subPath(this._path, function (x) { return x === node; }) || this._path;\n var availableResolvables = subPath\n .reduce(function (acc, _node) { return acc.concat(_node.resolvables); }, []) // all of subpath's resolvables\n .filter(function (res) { return res !== resolvable; }); // filter out the `resolvable` argument\n var getDependency = function (token) {\n var matching = availableResolvables.filter(function (r) { return r.token === token; });\n if (matching.length)\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.tail)(matching);\n var fromInjector = _this.injector().getNative(token);\n if ((0,_common__WEBPACK_IMPORTED_MODULE_8__.isUndefined)(fromInjector)) {\n throw new Error('Could not find Dependency Injection token: ' + (0,_common_strings__WEBPACK_IMPORTED_MODULE_7__.stringify)(token));\n }\n return new _resolvable__WEBPACK_IMPORTED_MODULE_5__.Resolvable(token, function () { return fromInjector; }, [], fromInjector);\n };\n return resolvable.deps.map(getDependency);\n };\n return ResolveContext;\n}());\n\n/** @internal */\nvar UIInjectorImpl = /** @class */ (function () {\n function UIInjectorImpl(context) {\n this.context = context;\n this.native = this.get(NATIVE_INJECTOR_TOKEN) || _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$injector;\n }\n UIInjectorImpl.prototype.get = function (token) {\n var resolvable = this.context.getResolvable(token);\n if (resolvable) {\n if (this.context.getPolicy(resolvable).async === 'NOWAIT') {\n return resolvable.get(this.context);\n }\n if (!resolvable.resolved) {\n throw new Error('Resolvable async .get() not complete:' + (0,_common_strings__WEBPACK_IMPORTED_MODULE_7__.stringify)(resolvable.token));\n }\n return resolvable.data;\n }\n return this.getNative(token);\n };\n UIInjectorImpl.prototype.getAsync = function (token) {\n var resolvable = this.context.getResolvable(token);\n if (resolvable)\n return resolvable.get(this.context);\n return _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.when(this.native.get(token));\n };\n UIInjectorImpl.prototype.getNative = function (token) {\n return this.native && this.native.get(token);\n };\n return UIInjectorImpl;\n}());\n//# sourceMappingURL=resolveContext.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/router.js": /*!*******************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/router.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UIRouter\": () => (/* binding */ UIRouter)\n/* harmony export */ });\n/* harmony import */ var _url_urlMatcherFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./url/urlMatcherFactory */ \"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js\");\n/* harmony import */ var _url_urlRouter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./url/urlRouter */ \"./node_modules/@uirouter/core/lib-esm/url/urlRouter.js\");\n/* harmony import */ var _transition_transitionService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transition/transitionService */ \"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js\");\n/* harmony import */ var _view_view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./view/view */ \"./node_modules/@uirouter/core/lib-esm/view/view.js\");\n/* harmony import */ var _state_stateRegistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./state/stateRegistry */ \"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js\");\n/* harmony import */ var _state_stateService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./state/stateService */ \"./node_modules/@uirouter/core/lib-esm/state/stateService.js\");\n/* harmony import */ var _globals__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./globals */ \"./node_modules/@uirouter/core/lib-esm/globals.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _url_urlService__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./url/urlService */ \"./node_modules/@uirouter/core/lib-esm/url/urlService.js\");\n/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./common/trace */ \"./node_modules/@uirouter/core/lib-esm/common/trace.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n/** @internal */\nvar _routerInstance = 0;\n/** @internal */\nvar locSvcFns = ['url', 'path', 'search', 'hash', 'onChange'];\n/** @internal */\nvar locCfgFns = ['port', 'protocol', 'host', 'baseHref', 'html5Mode', 'hashPrefix'];\n/** @internal */\nvar locationServiceStub = (0,_common__WEBPACK_IMPORTED_MODULE_11__.makeStub)('LocationServices', locSvcFns);\n/** @internal */\nvar locationConfigStub = (0,_common__WEBPACK_IMPORTED_MODULE_11__.makeStub)('LocationConfig', locCfgFns);\n/**\n * An instance of UI-Router.\n *\n * This object contains references to service APIs which define your application's routing behavior.\n */\nvar UIRouter = /** @class */ (function () {\n /**\n * Creates a new `UIRouter` object\n *\n * @param locationService a [[LocationServices]] implementation\n * @param locationConfig a [[LocationConfig]] implementation\n * @internal\n */\n function UIRouter(locationService, locationConfig) {\n if (locationService === void 0) { locationService = locationServiceStub; }\n if (locationConfig === void 0) { locationConfig = locationConfigStub; }\n this.locationService = locationService;\n this.locationConfig = locationConfig;\n /** @internal */ this.$id = _routerInstance++;\n /** @internal */ this._disposed = false;\n /** @internal */ this._disposables = [];\n /** Enable/disable tracing to the javascript console */\n this.trace = _common_trace__WEBPACK_IMPORTED_MODULE_10__.trace;\n /** Provides services related to ui-view synchronization */\n this.viewService = new _view_view__WEBPACK_IMPORTED_MODULE_3__.ViewService(this);\n /** An object that contains global router state, such as the current state and params */\n this.globals = new _globals__WEBPACK_IMPORTED_MODULE_6__.UIRouterGlobals();\n /** A service that exposes global Transition Hooks */\n this.transitionService = new _transition_transitionService__WEBPACK_IMPORTED_MODULE_2__.TransitionService(this);\n /**\n * Deprecated for public use. Use [[urlService]] instead.\n * @deprecated Use [[urlService]] instead\n */\n this.urlMatcherFactory = new _url_urlMatcherFactory__WEBPACK_IMPORTED_MODULE_0__.UrlMatcherFactory(this);\n /**\n * Deprecated for public use. Use [[urlService]] instead.\n * @deprecated Use [[urlService]] instead\n */\n this.urlRouter = new _url_urlRouter__WEBPACK_IMPORTED_MODULE_1__.UrlRouter(this);\n /** Provides services related to the URL */\n this.urlService = new _url_urlService__WEBPACK_IMPORTED_MODULE_9__.UrlService(this);\n /** Provides a registry for states, and related registration services */\n this.stateRegistry = new _state_stateRegistry__WEBPACK_IMPORTED_MODULE_4__.StateRegistry(this);\n /** Provides services related to states */\n this.stateService = new _state_stateService__WEBPACK_IMPORTED_MODULE_5__.StateService(this);\n /** @internal plugin instances are registered here */\n this._plugins = {};\n this.viewService._pluginapi._rootViewContext(this.stateRegistry.root());\n this.globals.$current = this.stateRegistry.root();\n this.globals.current = this.globals.$current.self;\n this.disposable(this.globals);\n this.disposable(this.stateService);\n this.disposable(this.stateRegistry);\n this.disposable(this.transitionService);\n this.disposable(this.urlService);\n this.disposable(locationService);\n this.disposable(locationConfig);\n }\n /** Registers an object to be notified when the router is disposed */\n UIRouter.prototype.disposable = function (disposable) {\n this._disposables.push(disposable);\n };\n /**\n * Disposes this router instance\n *\n * When called, clears resources retained by the router by calling `dispose(this)` on all\n * registered [[disposable]] objects.\n *\n * Or, if a `disposable` object is provided, calls `dispose(this)` on that object only.\n *\n * @internal\n * @param disposable (optional) the disposable to dispose\n */\n UIRouter.prototype.dispose = function (disposable) {\n var _this = this;\n if (disposable && (0,_common_predicates__WEBPACK_IMPORTED_MODULE_8__.isFunction)(disposable.dispose)) {\n disposable.dispose(this);\n return undefined;\n }\n this._disposed = true;\n this._disposables.slice().forEach(function (d) {\n try {\n typeof d.dispose === 'function' && d.dispose(_this);\n (0,_common_common__WEBPACK_IMPORTED_MODULE_7__.removeFrom)(_this._disposables, d);\n }\n catch (ignored) { }\n });\n };\n /**\n * Adds a plugin to UI-Router\n *\n * This method adds a UI-Router Plugin.\n * A plugin can enhance or change UI-Router behavior using any public API.\n *\n * #### Example:\n * ```js\n * import { MyCoolPlugin } from \"ui-router-cool-plugin\";\n *\n * var plugin = router.addPlugin(MyCoolPlugin);\n * ```\n *\n * ### Plugin authoring\n *\n * A plugin is simply a class (or constructor function) which accepts a [[UIRouter]] instance and (optionally) an options object.\n *\n * The plugin can implement its functionality using any of the public APIs of [[UIRouter]].\n * For example, it may configure router options or add a Transition Hook.\n *\n * The plugin can then be published as a separate module.\n *\n * #### Example:\n * ```js\n * export class MyAuthPlugin implements UIRouterPlugin {\n * constructor(router: UIRouter, options: any) {\n * this.name = \"MyAuthPlugin\";\n * let $transitions = router.transitionService;\n * let $state = router.stateService;\n *\n * let authCriteria = {\n * to: (state) => state.data && state.data.requiresAuth\n * };\n *\n * function authHook(transition: Transition) {\n * let authService = transition.injector().get('AuthService');\n * if (!authService.isAuthenticated()) {\n * return $state.target('login');\n * }\n * }\n *\n * $transitions.onStart(authCriteria, authHook);\n * }\n * }\n * ```\n *\n * @param plugin one of:\n * - a plugin class which implements [[UIRouterPlugin]]\n * - a constructor function for a [[UIRouterPlugin]] which accepts a [[UIRouter]] instance\n * - a factory function which accepts a [[UIRouter]] instance and returns a [[UIRouterPlugin]] instance\n * @param options options to pass to the plugin class/factory\n * @returns the registered plugin instance\n */\n UIRouter.prototype.plugin = function (plugin, options) {\n if (options === void 0) { options = {}; }\n var pluginInstance = new plugin(this, options);\n if (!pluginInstance.name)\n throw new Error('Required property `name` missing on plugin: ' + pluginInstance);\n this._disposables.push(pluginInstance);\n return (this._plugins[pluginInstance.name] = pluginInstance);\n };\n UIRouter.prototype.getPlugin = function (pluginName) {\n return pluginName ? this._plugins[pluginName] : (0,_common_common__WEBPACK_IMPORTED_MODULE_7__.values)(this._plugins);\n };\n return UIRouter;\n}());\n\n//# sourceMappingURL=router.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/router.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/state/index.js": /*!************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/state/index.js ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StateBuilder\": () => (/* reexport safe */ _stateBuilder__WEBPACK_IMPORTED_MODULE_1__.StateBuilder),\n/* harmony export */ \"StateMatcher\": () => (/* reexport safe */ _stateMatcher__WEBPACK_IMPORTED_MODULE_3__.StateMatcher),\n/* harmony export */ \"StateObject\": () => (/* reexport safe */ _stateObject__WEBPACK_IMPORTED_MODULE_2__.StateObject),\n/* harmony export */ \"StateQueueManager\": () => (/* reexport safe */ _stateQueueManager__WEBPACK_IMPORTED_MODULE_4__.StateQueueManager),\n/* harmony export */ \"StateRegistry\": () => (/* reexport safe */ _stateRegistry__WEBPACK_IMPORTED_MODULE_5__.StateRegistry),\n/* harmony export */ \"StateService\": () => (/* reexport safe */ _stateService__WEBPACK_IMPORTED_MODULE_6__.StateService),\n/* harmony export */ \"TargetState\": () => (/* reexport safe */ _targetState__WEBPACK_IMPORTED_MODULE_7__.TargetState),\n/* harmony export */ \"resolvablesBuilder\": () => (/* reexport safe */ _stateBuilder__WEBPACK_IMPORTED_MODULE_1__.resolvablesBuilder)\n/* harmony export */ });\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/state/interface.js\");\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _stateBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stateBuilder */ \"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js\");\n/* harmony import */ var _stateObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stateObject */ \"./node_modules/@uirouter/core/lib-esm/state/stateObject.js\");\n/* harmony import */ var _stateMatcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stateMatcher */ \"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js\");\n/* harmony import */ var _stateQueueManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stateQueueManager */ \"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js\");\n/* harmony import */ var _stateRegistry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./stateRegistry */ \"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js\");\n/* harmony import */ var _stateService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stateService */ \"./node_modules/@uirouter/core/lib-esm/state/stateService.js\");\n/* harmony import */ var _targetState__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./targetState */ \"./node_modules/@uirouter/core/lib-esm/state/targetState.js\");\n/**\n * # The state subsystem\n *\n * This subsystem implements the ui-router state tree\n *\n * - The [[StateService]] has state-related service methods such as:\n * - [[StateService.get]]: Get a registered [[StateDeclaration]] object\n * - [[StateService.go]]: Transition from the current state to a new state\n * - [[StateService.reload]]: Reload the current state\n * - [[StateService.target]]: Get a [[TargetState]] (useful when redirecting from a Transition Hook)\n * - [[StateService.onInvalid]]: Register a callback for when a transition to an invalid state is started\n * - [[StateService.defaultErrorHandler]]: Register a global callback for when a transition errors\n * - The [[StateDeclaration]] interface defines the shape of a state declaration\n * - The [[StateRegistry]] contains all the registered states\n * - States can be added/removed using the [[StateRegistry.register]] and [[StateRegistry.deregister]]\n * - Note: Bootstrap state registration differs by front-end framework.\n * - Get notified of state registration/deregistration using [[StateRegistry.onStatesChanged]].\n *\n * @packageDocumentation\n */\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/state/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/state/interface.js": /*!****************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/state/interface.js ***! \****************************************************************/ /***/ (() => { eval("//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/state/interface.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js": /*!*******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StateBuilder\": () => (/* binding */ StateBuilder),\n/* harmony export */ \"resolvablesBuilder\": () => (/* binding */ resolvablesBuilder)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/strings */ \"./node_modules/@uirouter/core/lib-esm/common/strings.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../resolve/resolvable */ \"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n\n\n\n\n\n\nvar parseUrl = function (url) {\n if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(url))\n return false;\n var root = url.charAt(0) === '^';\n return { val: root ? url.substring(1) : url, root: root };\n};\nfunction nameBuilder(state) {\n return state.name;\n}\nfunction selfBuilder(state) {\n state.self.$$state = function () { return state; };\n return state.self;\n}\nfunction dataBuilder(state) {\n if (state.parent && state.parent.data) {\n state.data = state.self.data = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inherit)(state.parent.data, state.data);\n }\n return state.data;\n}\nvar getUrlBuilder = function ($urlMatcherFactoryProvider, root) {\n return function urlBuilder(stateObject) {\n var stateDec = stateObject.self;\n // For future states, i.e., states whose name ends with `.**`,\n // match anything that starts with the url prefix\n if (stateDec && stateDec.url && stateDec.name && stateDec.name.match(/\\.\\*\\*$/)) {\n var newStateDec = {};\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.copy)(stateDec, newStateDec);\n newStateDec.url += '{remainder:any}'; // match any path (.*)\n stateDec = newStateDec;\n }\n var parent = stateObject.parent;\n var parsed = parseUrl(stateDec.url);\n var url = !parsed ? stateDec.url : $urlMatcherFactoryProvider.compile(parsed.val, { state: stateDec });\n if (!url)\n return null;\n if (!$urlMatcherFactoryProvider.isMatcher(url))\n throw new Error(\"Invalid url '\" + url + \"' in state '\" + stateObject + \"'\");\n return parsed && parsed.root ? url : ((parent && parent.navigable) || root()).url.append(url);\n };\n};\nvar getNavigableBuilder = function (isRoot) {\n return function navigableBuilder(state) {\n return !isRoot(state) && state.url ? state : state.parent ? state.parent.navigable : null;\n };\n};\nvar getParamsBuilder = function (paramFactory) {\n return function paramsBuilder(state) {\n var makeConfigParam = function (config, id) { return paramFactory.fromConfig(id, null, state.self); };\n var urlParams = (state.url && state.url.parameters({ inherit: false })) || [];\n var nonUrlParams = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.values)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.mapObj)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.omit)(state.params || {}, urlParams.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('id'))), makeConfigParam));\n return urlParams\n .concat(nonUrlParams)\n .map(function (p) { return [p.id, p]; })\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.applyPairs, {});\n };\n};\nfunction pathBuilder(state) {\n return state.parent ? state.parent.path.concat(state) : /*root*/ [state];\n}\nfunction includesBuilder(state) {\n var includes = state.parent ? (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({}, state.parent.includes) : {};\n includes[state.name] = true;\n return includes;\n}\n/**\n * This is a [[StateBuilder.builder]] function for the `resolve:` block on a [[StateDeclaration]].\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * validates the `resolve` property and converts it to a [[Resolvable]] array.\n *\n * resolve: input value can be:\n *\n * {\n * // analyzed but not injected\n * myFooResolve: function() { return \"myFooData\"; },\n *\n * // function.toString() parsed, \"DependencyName\" dep as string (not min-safe)\n * myBarResolve: function(DependencyName) { return DependencyName.fetchSomethingAsPromise() },\n *\n * // Array split; \"DependencyName\" dep as string\n * myBazResolve: [ \"DependencyName\", function(dep) { return dep.fetchSomethingAsPromise() },\n *\n * // Array split; DependencyType dep as token (compared using ===)\n * myQuxResolve: [ DependencyType, function(dep) { return dep.fetchSometingAsPromise() },\n *\n * // val.$inject used as deps\n * // where:\n * // corgeResolve.$inject = [\"DependencyName\"];\n * // function corgeResolve(dep) { dep.fetchSometingAsPromise() }\n * // then \"DependencyName\" dep as string\n * myCorgeResolve: corgeResolve,\n *\n * // inject service by name\n * // When a string is found, desugar creating a resolve that injects the named service\n * myGraultResolve: \"SomeService\"\n * }\n *\n * or:\n *\n * [\n * new Resolvable(\"myFooResolve\", function() { return \"myFooData\" }),\n * new Resolvable(\"myBarResolve\", function(dep) { return dep.fetchSomethingAsPromise() }, [ \"DependencyName\" ]),\n * { provide: \"myBazResolve\", useFactory: function(dep) { dep.fetchSomethingAsPromise() }, deps: [ \"DependencyName\" ] }\n * ]\n */\nfunction resolvablesBuilder(state) {\n /** convert resolve: {} and resolvePolicy: {} objects to an array of tuples */\n var objects2Tuples = function (resolveObj, resolvePolicies) {\n return Object.keys(resolveObj || {}).map(function (token) { return ({\n token: token,\n val: resolveObj[token],\n deps: undefined,\n policy: resolvePolicies[token],\n }); });\n };\n /** fetch DI annotations from a function or ng1-style array */\n var annotate = function (fn) {\n var $injector = _common_coreservices__WEBPACK_IMPORTED_MODULE_5__.services.$injector;\n // ng1 doesn't have an $injector until runtime.\n // If the $injector doesn't exist, use \"deferred\" literal as a\n // marker indicating they should be annotated when runtime starts\n return fn['$inject'] || ($injector && $injector.annotate(fn, $injector.strictDi)) || 'deferred';\n };\n /** true if the object has both `token` and `resolveFn`, and is probably a [[ResolveLiteral]] */\n var isResolveLiteral = function (obj) { return !!(obj.token && obj.resolveFn); };\n /** true if the object looks like a provide literal, or a ng2 Provider */\n var isLikeNg2Provider = function (obj) {\n return !!((obj.provide || obj.token) && (obj.useValue || obj.useFactory || obj.useExisting || obj.useClass));\n };\n /** true if the object looks like a tuple from obj2Tuples */\n var isTupleFromObj = function (obj) {\n return !!(obj && obj.val && ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(obj.val) || (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray)(obj.val) || (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isFunction)(obj.val)));\n };\n /** extracts the token from a Provider or provide literal */\n var getToken = function (p) { return p.provide || p.token; };\n // prettier-ignore: Given a literal resolve or provider object, returns a Resolvable\n var literal2Resolvable = (0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pattern)([\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('resolveFn'), function (p) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(getToken(p), p.resolveFn, p.deps, p.policy); }],\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('useFactory'), function (p) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(getToken(p), p.useFactory, p.deps || p.dependencies, p.policy); }],\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('useClass'), function (p) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(getToken(p), function () { return new p.useClass(); }, [], p.policy); }],\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('useValue'), function (p) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(getToken(p), function () { return p.useValue; }, [], p.policy, p.useValue); }],\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('useExisting'), function (p) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(getToken(p), _common_common__WEBPACK_IMPORTED_MODULE_0__.identity, [p.useExisting], p.policy); }],\n ]);\n // prettier-ignore\n var tuple2Resolvable = (0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pattern)([\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pipe)((0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('val'), _common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString), function (tuple) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(tuple.token, _common_common__WEBPACK_IMPORTED_MODULE_0__.identity, [tuple.val], tuple.policy); }],\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pipe)((0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('val'), _common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray), function (tuple) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(tuple.token, (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.tail)(tuple.val), tuple.val.slice(0, -1), tuple.policy); }],\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pipe)((0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.prop)('val'), _common_predicates__WEBPACK_IMPORTED_MODULE_1__.isFunction), function (tuple) { return new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable(tuple.token, tuple.val, annotate(tuple.val), tuple.policy); }],\n ]);\n // prettier-ignore\n var item2Resolvable = (0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pattern)([\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.is)(_resolve_resolvable__WEBPACK_IMPORTED_MODULE_4__.Resolvable), function (r) { return r; }],\n [isResolveLiteral, literal2Resolvable],\n [isLikeNg2Provider, literal2Resolvable],\n [isTupleFromObj, tuple2Resolvable],\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.val)(true), function (obj) { throw new Error('Invalid resolve value: ' + (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(obj)); },],\n ]);\n // If resolveBlock is already an array, use it as-is.\n // Otherwise, assume it's an object and convert to an Array of tuples\n var decl = state.resolve;\n var items = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray)(decl) ? decl : objects2Tuples(decl, state.resolvePolicy || {});\n return items.map(item2Resolvable);\n}\n/**\n * A internal global service\n *\n * StateBuilder is a factory for the internal [[StateObject]] objects.\n *\n * When you register a state with the [[StateRegistry]], you register a plain old javascript object which\n * conforms to the [[StateDeclaration]] interface. This factory takes that object and builds the corresponding\n * [[StateObject]] object, which has an API and is used internally.\n *\n * Custom properties or API may be added to the internal [[StateObject]] object by registering a decorator function\n * using the [[builder]] method.\n */\nvar StateBuilder = /** @class */ (function () {\n function StateBuilder(matcher, urlMatcherFactory) {\n this.matcher = matcher;\n var self = this;\n var root = function () { return matcher.find(''); };\n var isRoot = function (state) { return state.name === ''; };\n function parentBuilder(state) {\n if (isRoot(state))\n return null;\n return matcher.find(self.parentName(state)) || root();\n }\n this.builders = {\n name: [nameBuilder],\n self: [selfBuilder],\n parent: [parentBuilder],\n data: [dataBuilder],\n // Build a URLMatcher if necessary, either via a relative or absolute URL\n url: [getUrlBuilder(urlMatcherFactory, root)],\n // Keep track of the closest ancestor state that has a URL (i.e. is navigable)\n navigable: [getNavigableBuilder(isRoot)],\n params: [getParamsBuilder(urlMatcherFactory.paramFactory)],\n // Each framework-specific ui-router implementation should define its own `views` builder\n // e.g., src/ng1/statebuilders/views.ts\n views: [],\n // Keep a full path from the root down to this state as this is needed for state activation.\n path: [pathBuilder],\n // Speed up $state.includes() as it's used a lot\n includes: [includesBuilder],\n resolvables: [resolvablesBuilder],\n };\n }\n StateBuilder.prototype.builder = function (name, fn) {\n var builders = this.builders;\n var array = builders[name] || [];\n // Backwards compat: if only one builder exists, return it, else return whole arary.\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(name) && !(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(fn))\n return array.length > 1 ? array : array[0];\n if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(name) || !(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isFunction)(fn))\n return;\n builders[name] = array;\n builders[name].push(fn);\n return function () { return builders[name].splice(builders[name].indexOf(fn, 1)) && null; };\n };\n /**\n * Builds all of the properties on an essentially blank State object, returning a State object which has all its\n * properties and API built.\n *\n * @param state an uninitialized State object\n * @returns the built State object\n */\n StateBuilder.prototype.build = function (state) {\n var _a = this, matcher = _a.matcher, builders = _a.builders;\n var parent = this.parentName(state);\n if (parent && !matcher.find(parent, undefined, false)) {\n return null;\n }\n for (var key in builders) {\n if (!builders.hasOwnProperty(key))\n continue;\n var chain = builders[key].reduce(function (parentFn, step) { return function (_state) { return step(_state, parentFn); }; }, _common_common__WEBPACK_IMPORTED_MODULE_0__.noop);\n state[key] = chain(state);\n }\n return state;\n };\n StateBuilder.prototype.parentName = function (state) {\n // name = 'foo.bar.baz.**'\n var name = state.name || '';\n // segments = ['foo', 'bar', 'baz', '.**']\n var segments = name.split('.');\n // segments = ['foo', 'bar', 'baz']\n var lastSegment = segments.pop();\n // segments = ['foo', 'bar'] (ignore .** segment for future states)\n if (lastSegment === '**')\n segments.pop();\n if (segments.length) {\n if (state.parent) {\n throw new Error(\"States that specify the 'parent:' property should not have a '.' in their name (\" + name + \")\");\n }\n // 'foo.bar'\n return segments.join('.');\n }\n if (!state.parent)\n return '';\n return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(state.parent) ? state.parent : state.parent.name;\n };\n StateBuilder.prototype.name = function (state) {\n var name = state.name;\n if (name.indexOf('.') !== -1 || !state.parent)\n return name;\n var parentName = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(state.parent) ? state.parent : state.parent.name;\n return parentName ? parentName + '.' + name : name;\n };\n return StateBuilder;\n}());\n\n//# sourceMappingURL=stateBuilder.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js": /*!*******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StateMatcher\": () => (/* binding */ StateMatcher)\n/* harmony export */ });\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_safeConsole__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/safeConsole */ \"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js\");\n\n\n\nvar StateMatcher = /** @class */ (function () {\n function StateMatcher(_states) {\n this._states = _states;\n }\n StateMatcher.prototype.isRelative = function (stateName) {\n stateName = stateName || '';\n return stateName.indexOf('.') === 0 || stateName.indexOf('^') === 0;\n };\n StateMatcher.prototype.find = function (stateOrName, base, matchGlob) {\n if (matchGlob === void 0) { matchGlob = true; }\n if (!stateOrName && stateOrName !== '')\n return undefined;\n var isStr = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(stateOrName);\n var name = isStr ? stateOrName : stateOrName.name;\n if (this.isRelative(name))\n name = this.resolvePath(name, base);\n var state = this._states[name];\n if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {\n return state;\n }\n else if (isStr && matchGlob) {\n var _states = (0,_common_common__WEBPACK_IMPORTED_MODULE_1__.values)(this._states);\n var matches = _states.filter(function (_state) { return _state.__stateObjectCache.nameGlob && _state.__stateObjectCache.nameGlob.matches(name); });\n if (matches.length > 1) {\n _common_safeConsole__WEBPACK_IMPORTED_MODULE_2__.safeConsole.error(\"stateMatcher.find: Found multiple matches for \" + name + \" using glob: \", matches.map(function (match) { return match.name; }));\n }\n return matches[0];\n }\n return undefined;\n };\n StateMatcher.prototype.resolvePath = function (name, base) {\n if (!base)\n throw new Error(\"No reference point given for path '\" + name + \"'\");\n var baseState = this.find(base);\n var splitName = name.split('.');\n var pathLength = splitName.length;\n var i = 0, current = baseState;\n for (; i < pathLength; i++) {\n if (splitName[i] === '' && i === 0) {\n current = baseState;\n continue;\n }\n if (splitName[i] === '^') {\n if (!current.parent)\n throw new Error(\"Path '\" + name + \"' not valid for state '\" + baseState.name + \"'\");\n current = current.parent;\n continue;\n }\n break;\n }\n var relName = splitName.slice(i).join('.');\n return current.name + (current.name && relName ? '.' : '') + relName;\n };\n return StateMatcher;\n}());\n\n//# sourceMappingURL=stateMatcher.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/state/stateObject.js": /*!******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/state/stateObject.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StateObject\": () => (/* binding */ StateObject)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _common_glob__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/glob */ \"./node_modules/@uirouter/core/lib-esm/common/glob.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n\n\n\n\n/**\n * Internal representation of a UI-Router state.\n *\n * Instances of this class are created when a [[StateDeclaration]] is registered with the [[StateRegistry]].\n *\n * A registered [[StateDeclaration]] is augmented with a getter ([[StateDeclaration.$$state]]) which returns the corresponding [[StateObject]] object.\n *\n * This class prototypally inherits from the corresponding [[StateDeclaration]].\n * Each of its own properties (i.e., `hasOwnProperty`) are built using builders from the [[StateBuilder]].\n */\nvar StateObject = /** @class */ (function () {\n /** @deprecated use State.create() */\n function StateObject(config) {\n return StateObject.create(config || {});\n }\n /**\n * Create a state object to put the private/internal implementation details onto.\n * The object's prototype chain looks like:\n * (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...)\n *\n * @param stateDecl the user-supplied State Declaration\n * @returns {StateObject} an internal State object\n */\n StateObject.create = function (stateDecl) {\n stateDecl = StateObject.isStateClass(stateDecl) ? new stateDecl() : stateDecl;\n var state = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inherit)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inherit)(stateDecl, StateObject.prototype));\n stateDecl.$$state = function () { return state; };\n state.self = stateDecl;\n state.__stateObjectCache = {\n nameGlob: _common_glob__WEBPACK_IMPORTED_MODULE_2__.Glob.fromString(state.name),\n };\n return state;\n };\n /**\n * Returns true if the provided parameter is the same state.\n *\n * Compares the identity of the state against the passed value, which is either an object\n * reference to the actual `State` instance, the original definition object passed to\n * `$stateProvider.state()`, or the fully-qualified name.\n *\n * @param ref Can be one of (a) a `State` instance, (b) an object that was passed\n * into `$stateProvider.state()`, (c) the fully-qualified name of a state as a string.\n * @returns Returns `true` if `ref` matches the current `State` instance.\n */\n StateObject.prototype.is = function (ref) {\n return this === ref || this.self === ref || this.fqn() === ref;\n };\n /**\n * @deprecated this does not properly handle dot notation\n * @returns Returns a dot-separated name of the state.\n */\n StateObject.prototype.fqn = function () {\n if (!this.parent || !(this.parent instanceof this.constructor))\n return this.name;\n var name = this.parent.fqn();\n return name ? name + '.' + this.name : this.name;\n };\n /**\n * Returns the root node of this state's tree.\n *\n * @returns The root of this state's tree.\n */\n StateObject.prototype.root = function () {\n return (this.parent && this.parent.root()) || this;\n };\n /**\n * Gets the state's `Param` objects\n *\n * Gets the list of [[Param]] objects owned by the state.\n * If `opts.inherit` is true, it also includes the ancestor states' [[Param]] objects.\n * If `opts.matchingKeys` exists, returns only `Param`s whose `id` is a key on the `matchingKeys` object\n *\n * @param opts options\n */\n StateObject.prototype.parameters = function (opts) {\n opts = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(opts, { inherit: true, matchingKeys: null });\n var inherited = (opts.inherit && this.parent && this.parent.parameters()) || [];\n return inherited\n .concat((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.values)(this.params))\n .filter(function (param) { return !opts.matchingKeys || opts.matchingKeys.hasOwnProperty(param.id); });\n };\n /**\n * Returns a single [[Param]] that is owned by the state\n *\n * If `opts.inherit` is true, it also searches the ancestor states` [[Param]]s.\n * @param id the name of the [[Param]] to return\n * @param opts options\n */\n StateObject.prototype.parameter = function (id, opts) {\n if (opts === void 0) { opts = {}; }\n return ((this.url && this.url.parameter(id, opts)) ||\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.values)(this.params), (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.propEq)('id', id)) ||\n (opts.inherit && this.parent && this.parent.parameter(id)));\n };\n StateObject.prototype.toString = function () {\n return this.fqn();\n };\n /** Predicate which returns true if the object is an class with @State() decorator */\n StateObject.isStateClass = function (stateDecl) {\n return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isFunction)(stateDecl) && stateDecl['__uiRouterState'] === true;\n };\n /** Predicate which returns true if the object is a [[StateDeclaration]] object */\n StateObject.isStateDeclaration = function (obj) { return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isFunction)(obj['$$state']); };\n /** Predicate which returns true if the object is an internal [[StateObject]] object */\n StateObject.isState = function (obj) { return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isObject)(obj['__stateObjectCache']); };\n return StateObject;\n}());\n\n//# sourceMappingURL=stateObject.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/state/stateObject.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js": /*!************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StateQueueManager\": () => (/* binding */ StateQueueManager)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n/* harmony import */ var _stateObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stateObject */ \"./node_modules/@uirouter/core/lib-esm/state/stateObject.js\");\n\n\nvar StateQueueManager = /** @class */ (function () {\n function StateQueueManager(router, states, builder, listeners) {\n this.router = router;\n this.states = states;\n this.builder = builder;\n this.listeners = listeners;\n this.queue = [];\n }\n StateQueueManager.prototype.dispose = function () {\n this.queue = [];\n };\n StateQueueManager.prototype.register = function (stateDecl) {\n var queue = this.queue;\n var state = _stateObject__WEBPACK_IMPORTED_MODULE_1__.StateObject.create(stateDecl);\n var name = state.name;\n if (!(0,_common__WEBPACK_IMPORTED_MODULE_0__.isString)(name))\n throw new Error('State must have a valid name');\n if (this.states.hasOwnProperty(name) || (0,_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(queue.map((0,_common__WEBPACK_IMPORTED_MODULE_0__.prop)('name')), name))\n throw new Error(\"State '\" + name + \"' is already defined\");\n queue.push(state);\n this.flush();\n return state;\n };\n StateQueueManager.prototype.flush = function () {\n var _this = this;\n var _a = this, queue = _a.queue, states = _a.states, builder = _a.builder;\n var registered = [], // states that got registered\n orphans = [], // states that don't yet have a parent registered\n previousQueueLength = {}; // keep track of how long the queue when an orphan was first encountered\n var getState = function (name) { return _this.states.hasOwnProperty(name) && _this.states[name]; };\n var notifyListeners = function () {\n if (registered.length) {\n _this.listeners.forEach(function (listener) {\n return listener('registered', registered.map(function (s) { return s.self; }));\n });\n }\n };\n while (queue.length > 0) {\n var state = queue.shift();\n var name_1 = state.name;\n var result = builder.build(state);\n var orphanIdx = orphans.indexOf(state);\n if (result) {\n var existingState = getState(name_1);\n if (existingState && existingState.name === name_1) {\n throw new Error(\"State '\" + name_1 + \"' is already defined\");\n }\n var existingFutureState = getState(name_1 + '.**');\n if (existingFutureState) {\n // Remove future state of the same name\n this.router.stateRegistry.deregister(existingFutureState);\n }\n states[name_1] = state;\n this.attachRoute(state);\n if (orphanIdx >= 0)\n orphans.splice(orphanIdx, 1);\n registered.push(state);\n continue;\n }\n var prev = previousQueueLength[name_1];\n previousQueueLength[name_1] = queue.length;\n if (orphanIdx >= 0 && prev === queue.length) {\n // Wait until two consecutive iterations where no additional states were dequeued successfully.\n // throw new Error(`Cannot register orphaned state '${name}'`);\n queue.push(state);\n notifyListeners();\n return states;\n }\n else if (orphanIdx < 0) {\n orphans.push(state);\n }\n queue.push(state);\n }\n notifyListeners();\n return states;\n };\n StateQueueManager.prototype.attachRoute = function (state) {\n if (state.abstract || !state.url)\n return;\n var rulesApi = this.router.urlService.rules;\n rulesApi.rule(rulesApi.urlRuleFactory.create(state));\n };\n return StateQueueManager;\n}());\n\n//# sourceMappingURL=stateQueueManager.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js": /*!********************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StateRegistry\": () => (/* binding */ StateRegistry)\n/* harmony export */ });\n/* harmony import */ var _stateMatcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./stateMatcher */ \"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js\");\n/* harmony import */ var _stateBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stateBuilder */ \"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js\");\n/* harmony import */ var _stateQueueManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stateQueueManager */ \"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n\n\n\n\n\n/**\n * A registry for all of the application's [[StateDeclaration]]s\n *\n * This API is found at `router.stateRegistry` ([[UIRouter.stateRegistry]])\n */\nvar StateRegistry = /** @class */ (function () {\n /** @internal */\n function StateRegistry(router) {\n this.router = router;\n this.states = {};\n /** @internal */\n this.listeners = [];\n this.matcher = new _stateMatcher__WEBPACK_IMPORTED_MODULE_0__.StateMatcher(this.states);\n this.builder = new _stateBuilder__WEBPACK_IMPORTED_MODULE_1__.StateBuilder(this.matcher, router.urlMatcherFactory);\n this.stateQueue = new _stateQueueManager__WEBPACK_IMPORTED_MODULE_2__.StateQueueManager(router, this.states, this.builder, this.listeners);\n this._registerRoot();\n }\n /** @internal */\n StateRegistry.prototype._registerRoot = function () {\n var rootStateDef = {\n name: '',\n url: '^',\n views: null,\n params: {\n '#': { value: null, type: 'hash', dynamic: true },\n },\n abstract: true,\n };\n var _root = (this._root = this.stateQueue.register(rootStateDef));\n _root.navigable = null;\n };\n /** @internal */\n StateRegistry.prototype.dispose = function () {\n var _this = this;\n this.stateQueue.dispose();\n this.listeners = [];\n this.get().forEach(function (state) { return _this.get(state) && _this.deregister(state); });\n };\n /**\n * Listen for a State Registry events\n *\n * Adds a callback that is invoked when states are registered or deregistered with the StateRegistry.\n *\n * #### Example:\n * ```js\n * let allStates = registry.get();\n *\n * // Later, invoke deregisterFn() to remove the listener\n * let deregisterFn = registry.onStatesChanged((event, states) => {\n * switch(event) {\n * case: 'registered':\n * states.forEach(state => allStates.push(state));\n * break;\n * case: 'deregistered':\n * states.forEach(state => {\n * let idx = allStates.indexOf(state);\n * if (idx !== -1) allStates.splice(idx, 1);\n * });\n * break;\n * }\n * });\n * ```\n *\n * @param listener a callback function invoked when the registered states changes.\n * The function receives two parameters, `event` and `state`.\n * See [[StateRegistryListener]]\n * @return a function that deregisters the listener\n */\n StateRegistry.prototype.onStatesChanged = function (listener) {\n this.listeners.push(listener);\n return function deregisterListener() {\n (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.removeFrom)(this.listeners)(listener);\n }.bind(this);\n };\n /**\n * Gets the implicit root state\n *\n * Gets the root of the state tree.\n * The root state is implicitly created by UI-Router.\n * Note: this returns the internal [[StateObject]] representation, not a [[StateDeclaration]]\n *\n * @return the root [[StateObject]]\n */\n StateRegistry.prototype.root = function () {\n return this._root;\n };\n /**\n * Adds a state to the registry\n *\n * Registers a [[StateDeclaration]] or queues it for registration.\n *\n * Note: a state will be queued if the state's parent isn't yet registered.\n *\n * @param stateDefinition the definition of the state to register.\n * @returns the internal [[StateObject]] object.\n * If the state was successfully registered, then the object is fully built (See: [[StateBuilder]]).\n * If the state was only queued, then the object is not fully built.\n */\n StateRegistry.prototype.register = function (stateDefinition) {\n return this.stateQueue.register(stateDefinition);\n };\n /** @internal */\n StateRegistry.prototype._deregisterTree = function (state) {\n var _this = this;\n var all = this.get().map(function (s) { return s.$$state(); });\n var getChildren = function (states) {\n var _children = all.filter(function (s) { return states.indexOf(s.parent) !== -1; });\n return _children.length === 0 ? _children : _children.concat(getChildren(_children));\n };\n var children = getChildren([state]);\n var deregistered = [state].concat(children).reverse();\n deregistered.forEach(function (_state) {\n var rulesApi = _this.router.urlService.rules;\n // Remove URL rule\n rulesApi\n .rules()\n .filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_4__.propEq)('state', _state))\n .forEach(function (rule) { return rulesApi.removeRule(rule); });\n // Remove state from registry\n delete _this.states[_state.name];\n });\n return deregistered;\n };\n /**\n * Removes a state from the registry\n *\n * This removes a state from the registry.\n * If the state has children, they are are also removed from the registry.\n *\n * @param stateOrName the state's name or object representation\n * @returns {StateObject[]} a list of removed states\n */\n StateRegistry.prototype.deregister = function (stateOrName) {\n var _state = this.get(stateOrName);\n if (!_state)\n throw new Error(\"Can't deregister state; not found: \" + stateOrName);\n var deregisteredStates = this._deregisterTree(_state.$$state());\n this.listeners.forEach(function (listener) {\n return listener('deregistered', deregisteredStates.map(function (s) { return s.self; }));\n });\n return deregisteredStates;\n };\n StateRegistry.prototype.get = function (stateOrName, base) {\n var _this = this;\n if (arguments.length === 0)\n return Object.keys(this.states).map(function (name) { return _this.states[name].self; });\n var found = this.matcher.find(stateOrName, base);\n return (found && found.self) || null;\n };\n /**\n * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).\n * More than one BuilderFunction can be registered for a given property.\n *\n * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects.\n *\n * @param property The name of the State property being registered for.\n * @param builderFunction The BuilderFunction which will be used to build the State property\n * @returns a function which deregisters the BuilderFunction\n */\n StateRegistry.prototype.decorator = function (property, builderFunction) {\n return this.builder.builder(property, builderFunction);\n };\n return StateRegistry;\n}());\n\n//# sourceMappingURL=stateRegistry.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/state/stateService.js": /*!*******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/state/stateService.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"StateService\": () => (/* binding */ StateService)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_queue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/queue */ \"./node_modules/@uirouter/core/lib-esm/common/queue.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n/* harmony import */ var _path_pathUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../path/pathUtils */ \"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js\");\n/* harmony import */ var _path_pathNode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../path/pathNode */ \"./node_modules/@uirouter/core/lib-esm/path/pathNode.js\");\n/* harmony import */ var _transition_transitionService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../transition/transitionService */ \"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js\");\n/* harmony import */ var _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../transition/rejectFactory */ \"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js\");\n/* harmony import */ var _targetState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./targetState */ \"./node_modules/@uirouter/core/lib-esm/state/targetState.js\");\n/* harmony import */ var _params_param__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../params/param */ \"./node_modules/@uirouter/core/lib-esm/params/param.js\");\n/* harmony import */ var _common_glob__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../common/glob */ \"./node_modules/@uirouter/core/lib-esm/common/glob.js\");\n/* harmony import */ var _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../resolve/resolveContext */ \"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js\");\n/* harmony import */ var _hooks_lazyLoad__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../hooks/lazyLoad */ \"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * Provides services related to ui-router states.\n *\n * This API is located at `router.stateService` ([[UIRouter.stateService]])\n */\nvar StateService = /** @class */ (function () {\n /** @internal */\n function StateService(/** @internal */ router) {\n this.router = router;\n /** @internal */\n this.invalidCallbacks = [];\n /** @internal */\n this._defaultErrorHandler = function $defaultErrorHandler($error$) {\n if ($error$ instanceof Error && $error$.stack) {\n console.error($error$);\n console.error($error$.stack);\n }\n else if ($error$ instanceof _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection) {\n console.error($error$.toString());\n if ($error$.detail && $error$.detail.stack)\n console.error($error$.detail.stack);\n }\n else {\n console.error($error$);\n }\n };\n var getters = ['current', '$current', 'params', 'transition'];\n var boundFns = Object.keys(StateService.prototype).filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_13__.not)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(getters)));\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.createProxyFunctions)((0,_common_hof__WEBPACK_IMPORTED_MODULE_13__.val)(StateService.prototype), this, (0,_common_hof__WEBPACK_IMPORTED_MODULE_13__.val)(this), boundFns);\n }\n Object.defineProperty(StateService.prototype, \"transition\", {\n /**\n * The [[Transition]] currently in progress (or null)\n *\n * @deprecated This is a passthrough through to [[UIRouterGlobals.transition]]\n */\n get: function () {\n return this.router.globals.transition;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"params\", {\n /**\n * The latest successful state parameters\n *\n * @deprecated This is a passthrough through to [[UIRouterGlobals.params]]\n */\n get: function () {\n return this.router.globals.params;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"current\", {\n /**\n * The current [[StateDeclaration]]\n *\n * @deprecated This is a passthrough through to [[UIRouterGlobals.current]]\n */\n get: function () {\n return this.router.globals.current;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateService.prototype, \"$current\", {\n /**\n * The current [[StateObject]] (an internal API)\n *\n * @deprecated This is a passthrough through to [[UIRouterGlobals.$current]]\n */\n get: function () {\n return this.router.globals.$current;\n },\n enumerable: false,\n configurable: true\n });\n /** @internal */\n StateService.prototype.dispose = function () {\n this.defaultErrorHandler(_common_common__WEBPACK_IMPORTED_MODULE_0__.noop);\n this.invalidCallbacks = [];\n };\n /**\n * Handler for when [[transitionTo]] is called with an invalid state.\n *\n * Invokes the [[onInvalid]] callbacks, in natural order.\n * Each callback's return value is checked in sequence until one of them returns an instance of TargetState.\n * The results of the callbacks are wrapped in $q.when(), so the callbacks may return promises.\n *\n * If a callback returns an TargetState, then it is used as arguments to $state.transitionTo() and the result returned.\n *\n * @internal\n */\n StateService.prototype._handleInvalidTargetState = function (fromPath, toState) {\n var _this = this;\n var fromState = _path_pathUtils__WEBPACK_IMPORTED_MODULE_4__.PathUtils.makeTargetState(this.router.stateRegistry, fromPath);\n var globals = this.router.globals;\n var latestThing = function () { return globals.transitionHistory.peekTail(); };\n var latest = latestThing();\n var callbackQueue = new _common_queue__WEBPACK_IMPORTED_MODULE_2__.Queue(this.invalidCallbacks.slice());\n var injector = new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_11__.ResolveContext(fromPath).injector();\n var checkForRedirect = function (result) {\n if (!(result instanceof _targetState__WEBPACK_IMPORTED_MODULE_8__.TargetState)) {\n return;\n }\n var target = result;\n // Recreate the TargetState, in case the state is now defined.\n target = _this.target(target.identifier(), target.params(), target.options());\n if (!target.valid()) {\n return _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.invalid(target.error()).toPromise();\n }\n if (latestThing() !== latest) {\n return _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.superseded().toPromise();\n }\n return _this.transitionTo(target.identifier(), target.params(), target.options());\n };\n function invokeNextCallback() {\n var nextCallback = callbackQueue.dequeue();\n if (nextCallback === undefined)\n return _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.invalid(toState.error()).toPromise();\n var callbackResult = _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.when(nextCallback(toState, fromState, injector));\n return callbackResult.then(checkForRedirect).then(function (result) { return result || invokeNextCallback(); });\n }\n return invokeNextCallback();\n };\n /**\n * Registers an Invalid State handler\n *\n * Registers a [[OnInvalidCallback]] function to be invoked when [[StateService.transitionTo]]\n * has been called with an invalid state reference parameter\n *\n * Example:\n * ```js\n * stateService.onInvalid(function(to, from, injector) {\n * if (to.name() === 'foo') {\n * let lazyLoader = injector.get('LazyLoadService');\n * return lazyLoader.load('foo')\n * .then(() => stateService.target('foo'));\n * }\n * });\n * ```\n *\n * @param {function} callback invoked when the toState is invalid\n * This function receives the (invalid) toState, the fromState, and an injector.\n * The function may optionally return a [[TargetState]] or a Promise for a TargetState.\n * If one is returned, it is treated as a redirect.\n *\n * @returns a function which deregisters the callback\n */\n StateService.prototype.onInvalid = function (callback) {\n this.invalidCallbacks.push(callback);\n return function deregisterListener() {\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(this.invalidCallbacks)(callback);\n }.bind(this);\n };\n /**\n * Reloads the current state\n *\n * A method that force reloads the current state, or a partial state hierarchy.\n * All resolves are re-resolved, and components reinstantiated.\n *\n * #### Example:\n * ```js\n * let app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * $state.reload();\n * }\n * });\n * ```\n *\n * Note: `reload()` is just an alias for:\n *\n * ```js\n * $state.transitionTo($state.current, $state.params, {\n * reload: true, inherit: false\n * });\n * ```\n *\n * @param reloadState A state name or a state object.\n * If present, this state and all its children will be reloaded, but ancestors will not reload.\n *\n * #### Example:\n * ```js\n * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item'\n * //and current state is 'contacts.detail.item'\n * let app angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.reload = function(){\n * //will reload 'contact.detail' and nested 'contact.detail.item' states\n * $state.reload('contact.detail');\n * }\n * });\n * ```\n *\n * @returns A promise representing the state of the new transition. See [[StateService.go]]\n */\n StateService.prototype.reload = function (reloadState) {\n return this.transitionTo(this.current, this.params, {\n reload: (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(reloadState) ? reloadState : true,\n inherit: false,\n notify: false,\n });\n };\n /**\n * Transition to a different state and/or parameters\n *\n * Convenience method for transitioning to a new state.\n *\n * `$state.go` calls `$state.transitionTo` internally but automatically sets options to\n * `{ location: true, inherit: true, relative: router.globals.$current, notify: true }`.\n * This allows you to use either an absolute or relative `to` argument (because of `relative: router.globals.$current`).\n * It also allows you to specify * only the parameters you'd like to update, while letting unspecified parameters\n * inherit from the current parameter values (because of `inherit: true`).\n *\n * #### Example:\n * ```js\n * let app = angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.changeState = function () {\n * $state.go('contact.detail');\n * };\n * });\n * ```\n *\n * @param to Absolute state name, state object, or relative state path (relative to current state).\n *\n * Some examples:\n *\n * - `$state.go('contact.detail')` - will go to the `contact.detail` state\n * - `$state.go('^')` - will go to the parent state\n * - `$state.go('^.sibling')` - if current state is `home.child`, will go to the `home.sibling` state\n * - `$state.go('.child.grandchild')` - if current state is home, will go to the `home.child.grandchild` state\n *\n * @param params A map of the parameters that will be sent to the state, will populate $stateParams.\n *\n * Any parameters that are not specified will be inherited from current parameter values (because of `inherit: true`).\n * This allows, for example, going to a sibling state that shares parameters defined by a parent state.\n *\n * @param options Transition options\n *\n * @returns {promise} A promise representing the state of the new transition.\n */\n StateService.prototype.go = function (to, params, options) {\n var defautGoOpts = { relative: this.$current, inherit: true };\n var transOpts = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, defautGoOpts, _transition_transitionService__WEBPACK_IMPORTED_MODULE_6__.defaultTransOpts);\n return this.transitionTo(to, params, transOpts);\n };\n /**\n * Creates a [[TargetState]]\n *\n * This is a factory method for creating a TargetState\n *\n * This may be returned from a Transition Hook to redirect a transition, for example.\n */\n StateService.prototype.target = function (identifier, params, options) {\n if (options === void 0) { options = {}; }\n // If we're reloading, find the state object to reload from\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isObject)(options.reload) && !options.reload.name)\n throw new Error('Invalid reload state object');\n var reg = this.router.stateRegistry;\n options.reloadState =\n options.reload === true ? reg.root() : reg.matcher.find(options.reload, options.relative);\n if (options.reload && !options.reloadState)\n throw new Error(\"No such reload state '\" + ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(options.reload) ? options.reload : options.reload.name) + \"'\");\n return new _targetState__WEBPACK_IMPORTED_MODULE_8__.TargetState(this.router.stateRegistry, identifier, params, options);\n };\n /** @internal */\n StateService.prototype.getCurrentPath = function () {\n var _this = this;\n var globals = this.router.globals;\n var latestSuccess = globals.successfulTransitions.peekTail();\n var rootPath = function () { return [new _path_pathNode__WEBPACK_IMPORTED_MODULE_5__.PathNode(_this.router.stateRegistry.root())]; };\n return latestSuccess ? latestSuccess.treeChanges().to : rootPath();\n };\n /**\n * Low-level method for transitioning to a new state.\n *\n * The [[go]] method (which uses `transitionTo` internally) is recommended in most situations.\n *\n * #### Example:\n * ```js\n * let app = angular.module('app', ['ui.router']);\n *\n * app.controller('ctrl', function ($scope, $state) {\n * $scope.changeState = function () {\n * $state.transitionTo('contact.detail');\n * };\n * });\n * ```\n *\n * @param to State name or state object.\n * @param toParams A map of the parameters that will be sent to the state,\n * will populate $stateParams.\n * @param options Transition options\n *\n * @returns A promise representing the state of the new transition. See [[go]]\n */\n StateService.prototype.transitionTo = function (to, toParams, options) {\n var _this = this;\n if (toParams === void 0) { toParams = {}; }\n if (options === void 0) { options = {}; }\n var router = this.router;\n var globals = router.globals;\n options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, _transition_transitionService__WEBPACK_IMPORTED_MODULE_6__.defaultTransOpts);\n var getCurrent = function () { return globals.transition; };\n options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(options, { current: getCurrent });\n var ref = this.target(to, toParams, options);\n var currentPath = this.getCurrentPath();\n if (!ref.exists())\n return this._handleInvalidTargetState(currentPath, ref);\n if (!ref.valid())\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.silentRejection)(ref.error());\n if (options.supercede === false && getCurrent()) {\n return (_transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.ignored('Another transition is in progress and supercede has been set to false in TransitionOptions for the transition. So the transition was ignored in favour of the existing one in progress.').toPromise());\n }\n /**\n * Special handling for Ignored, Aborted, and Redirected transitions\n *\n * The semantics for the transition.run() promise and the StateService.transitionTo()\n * promise differ. For instance, the run() promise may be rejected because it was\n * IGNORED, but the transitionTo() promise is resolved because from the user perspective\n * no error occurred. Likewise, the transition.run() promise may be rejected because of\n * a Redirect, but the transitionTo() promise is chained to the new Transition's promise.\n */\n var rejectedTransitionHandler = function (trans) { return function (error) {\n if (error instanceof _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection) {\n var isLatest = router.globals.lastStartedTransitionId <= trans.$id;\n if (error.type === _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.RejectType.IGNORED) {\n isLatest && router.urlRouter.update();\n // Consider ignored `Transition.run()` as a successful `transitionTo`\n return _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.when(globals.current);\n }\n var detail = error.detail;\n if (error.type === _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.RejectType.SUPERSEDED && error.redirected && detail instanceof _targetState__WEBPACK_IMPORTED_MODULE_8__.TargetState) {\n // If `Transition.run()` was redirected, allow the `transitionTo()` promise to resolve successfully\n // by returning the promise for the new (redirect) `Transition.run()`.\n var redirect = trans.redirect(detail);\n return redirect.run().catch(rejectedTransitionHandler(redirect));\n }\n if (error.type === _transition_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.RejectType.ABORTED) {\n isLatest && router.urlRouter.update();\n return _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.reject(error);\n }\n }\n var errorHandler = _this.defaultErrorHandler();\n errorHandler(error);\n return _common_coreservices__WEBPACK_IMPORTED_MODULE_3__.services.$q.reject(error);\n }; };\n var transition = this.router.transitionService.create(currentPath, ref);\n var transitionToPromise = transition.run().catch(rejectedTransitionHandler(transition));\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.silenceUncaughtInPromise)(transitionToPromise); // issue #2676\n // Return a promise for the transition, which also has the transition object on it.\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)(transitionToPromise, { transition: transition });\n };\n /**\n * Checks if the current state *is* the provided state\n *\n * Similar to [[includes]] but only checks for the full state name.\n * If params is supplied then it will be tested for strict equality against the current\n * active params object, so all params must match with none missing and no extras.\n *\n * #### Example:\n * ```js\n * $state.$current.name = 'contacts.details.item';\n *\n * // absolute name\n * $state.is('contact.details.item'); // returns true\n * $state.is(contactDetailItemStateObject); // returns true\n * ```\n *\n * // relative name (. and ^), typically from a template\n * // E.g. from the 'contacts.details' template\n * ```html\n *
    Item
    \n * ```\n *\n * @param stateOrName The state name (absolute or relative) or state object you'd like to check.\n * @param params A param object, e.g. `{sectionId: section.id}`, that you'd like\n * to test against the current active state.\n * @param options An options object. The options are:\n * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will\n * test relative to `options.relative` state (or name).\n *\n * @returns Returns true if it is the state.\n */\n StateService.prototype.is = function (stateOrName, params, options) {\n options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, { relative: this.$current });\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);\n if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(state))\n return undefined;\n if (this.$current !== state)\n return false;\n if (!params)\n return true;\n var schema = state.parameters({ inherit: true, matchingKeys: params });\n return _params_param__WEBPACK_IMPORTED_MODULE_9__.Param.equals(schema, _params_param__WEBPACK_IMPORTED_MODULE_9__.Param.values(schema, params), this.params);\n };\n /**\n * Checks if the current state *includes* the provided state\n *\n * A method to determine if the current active state is equal to or is the child of the\n * state stateName. If any params are passed then they will be tested for a match as well.\n * Not all the parameters need to be passed, just the ones you'd like to test for equality.\n *\n * #### Example when `$state.$current.name === 'contacts.details.item'`\n * ```js\n * // Using partial names\n * $state.includes(\"contacts\"); // returns true\n * $state.includes(\"contacts.details\"); // returns true\n * $state.includes(\"contacts.details.item\"); // returns true\n * $state.includes(\"contacts.list\"); // returns false\n * $state.includes(\"about\"); // returns false\n * ```\n *\n * #### Glob Examples when `* $state.$current.name === 'contacts.details.item.url'`:\n * ```js\n * $state.includes(\"*.details.*.*\"); // returns true\n * $state.includes(\"*.details.**\"); // returns true\n * $state.includes(\"**.item.**\"); // returns true\n * $state.includes(\"*.details.item.url\"); // returns true\n * $state.includes(\"*.details.*.url\"); // returns true\n * $state.includes(\"*.details.*\"); // returns false\n * $state.includes(\"item.**\"); // returns false\n * ```\n *\n * @param stateOrName A partial name, relative name, glob pattern,\n * or state object to be searched for within the current state name.\n * @param params A param object, e.g. `{sectionId: section.id}`,\n * that you'd like to test against the current active state.\n * @param options An options object. The options are:\n * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will\n * test relative to `options.relative` state (or name).\n *\n * @returns {boolean} Returns true if it does include the state\n */\n StateService.prototype.includes = function (stateOrName, params, options) {\n options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, { relative: this.$current });\n var glob = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(stateOrName) && _common_glob__WEBPACK_IMPORTED_MODULE_10__.Glob.fromString(stateOrName);\n if (glob) {\n if (!glob.matches(this.$current.name))\n return false;\n stateOrName = this.$current.name;\n }\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative), include = this.$current.includes;\n if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(state))\n return undefined;\n if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(include[state.name]))\n return false;\n if (!params)\n return true;\n var schema = state.parameters({ inherit: true, matchingKeys: params });\n return _params_param__WEBPACK_IMPORTED_MODULE_9__.Param.equals(schema, _params_param__WEBPACK_IMPORTED_MODULE_9__.Param.values(schema, params), this.params);\n };\n /**\n * Generates a URL for a state and parameters\n *\n * Returns the url for the given state populated with the given params.\n *\n * #### Example:\n * ```js\n * expect($state.href(\"about.person\", { person: \"bob\" })).toEqual(\"/about/bob\");\n * ```\n *\n * @param stateOrName The state name or state object you'd like to generate a url from.\n * @param params An object of parameter values to fill the state's required parameters.\n * @param options Options object. The options are:\n *\n * @returns {string} compiled state url\n */\n StateService.prototype.href = function (stateOrName, params, options) {\n var defaultHrefOpts = {\n lossy: true,\n inherit: true,\n absolute: false,\n relative: this.$current,\n };\n options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.defaults)(options, defaultHrefOpts);\n params = params || {};\n var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);\n if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(state))\n return null;\n if (options.inherit)\n params = this.params.$inherit(params, this.$current, state);\n var nav = state && options.lossy ? state.navigable : state;\n if (!nav || nav.url === undefined || nav.url === null) {\n return null;\n }\n return this.router.urlRouter.href(nav.url, params, { absolute: options.absolute });\n };\n /**\n * Sets or gets the default [[transitionTo]] error handler.\n *\n * The error handler is called when a [[Transition]] is rejected or when any error occurred during the Transition.\n * This includes errors caused by resolves and transition hooks.\n *\n * Note:\n * This handler does not receive certain Transition rejections.\n * Redirected and Ignored Transitions are not considered to be errors by [[StateService.transitionTo]].\n *\n * The built-in default error handler logs the error to the console.\n *\n * You can provide your own custom handler.\n *\n * #### Example:\n * ```js\n * stateService.defaultErrorHandler(function() {\n * // Do not log transitionTo errors\n * });\n * ```\n *\n * @param handler a global error handler function\n * @returns the current global error handler\n */\n StateService.prototype.defaultErrorHandler = function (handler) {\n return (this._defaultErrorHandler = handler || this._defaultErrorHandler);\n };\n StateService.prototype.get = function (stateOrName, base) {\n var reg = this.router.stateRegistry;\n if (arguments.length === 0)\n return reg.get();\n return reg.get(stateOrName, base || this.$current);\n };\n /**\n * Lazy loads a state\n *\n * Explicitly runs a state's [[StateDeclaration.lazyLoad]] function.\n *\n * @param stateOrName the state that should be lazy loaded\n * @param transition the optional Transition context to use (if the lazyLoad function requires an injector, etc)\n * Note: If no transition is provided, a noop transition is created using the from the current state to the current state.\n * This noop transition is not actually run.\n *\n * @returns a promise to lazy load\n */\n StateService.prototype.lazyLoad = function (stateOrName, transition) {\n var state = this.get(stateOrName);\n if (!state || !state.lazyLoad)\n throw new Error('Can not lazy load ' + stateOrName);\n var currentPath = this.getCurrentPath();\n var target = _path_pathUtils__WEBPACK_IMPORTED_MODULE_4__.PathUtils.makeTargetState(this.router.stateRegistry, currentPath);\n transition = transition || this.router.transitionService.create(currentPath, target);\n return (0,_hooks_lazyLoad__WEBPACK_IMPORTED_MODULE_12__.lazyLoadState)(transition, state);\n };\n return StateService;\n}());\n\n//# sourceMappingURL=stateService.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/state/stateService.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/state/targetState.js": /*!******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/state/targetState.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TargetState\": () => (/* binding */ TargetState)\n/* harmony export */ });\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/strings */ \"./node_modules/@uirouter/core/lib-esm/common/strings.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n\n\n\n/**\n * Encapsulate the target (destination) state/params/options of a [[Transition]].\n *\n * This class is frequently used to redirect a transition to a new destination.\n *\n * See:\n *\n * - [[HookResult]]\n * - [[TransitionHookFn]]\n * - [[TransitionService.onStart]]\n *\n * To create a `TargetState`, use [[StateService.target]].\n *\n * ---\n *\n * This class wraps:\n *\n * 1) an identifier for a state\n * 2) a set of parameters\n * 3) and transition options\n * 4) the registered state object (the [[StateDeclaration]])\n *\n * Many UI-Router APIs such as [[StateService.go]] take a [[StateOrName]] argument which can\n * either be a *state object* (a [[StateDeclaration]] or [[StateObject]]) or a *state name* (a string).\n * The `TargetState` class normalizes those options.\n *\n * A `TargetState` may be valid (the state being targeted exists in the registry)\n * or invalid (the state being targeted is not registered).\n */\nvar TargetState = /** @class */ (function () {\n /**\n * The TargetState constructor\n *\n * Note: Do not construct a `TargetState` manually.\n * To create a `TargetState`, use the [[StateService.target]] factory method.\n *\n * @param _stateRegistry The StateRegistry to use to look up the _definition\n * @param _identifier An identifier for a state.\n * Either a fully-qualified state name, or the object used to define the state.\n * @param _params Parameters for the target state\n * @param _options Transition options.\n *\n * @internal\n */\n function TargetState(_stateRegistry, _identifier, _params, _options) {\n this._stateRegistry = _stateRegistry;\n this._identifier = _identifier;\n this._identifier = _identifier;\n this._params = (0,_common__WEBPACK_IMPORTED_MODULE_2__.extend)({}, _params || {});\n this._options = (0,_common__WEBPACK_IMPORTED_MODULE_2__.extend)({}, _options || {});\n this._definition = _stateRegistry.matcher.find(_identifier, this._options.relative);\n }\n /** The name of the state this object targets */\n TargetState.prototype.name = function () {\n return (this._definition && this._definition.name) || this._identifier;\n };\n /** The identifier used when creating this TargetState */\n TargetState.prototype.identifier = function () {\n return this._identifier;\n };\n /** The target parameter values */\n TargetState.prototype.params = function () {\n return this._params;\n };\n /** The internal state object (if it was found) */\n TargetState.prototype.$state = function () {\n return this._definition;\n };\n /** The internal state declaration (if it was found) */\n TargetState.prototype.state = function () {\n return this._definition && this._definition.self;\n };\n /** The target options */\n TargetState.prototype.options = function () {\n return this._options;\n };\n /** True if the target state was found */\n TargetState.prototype.exists = function () {\n return !!(this._definition && this._definition.self);\n };\n /** True if the object is valid */\n TargetState.prototype.valid = function () {\n return !this.error();\n };\n /** If the object is invalid, returns the reason why */\n TargetState.prototype.error = function () {\n var base = this.options().relative;\n if (!this._definition && !!base) {\n var stateName = base.name ? base.name : base;\n return \"Could not resolve '\" + this.name() + \"' from state '\" + stateName + \"'\";\n }\n if (!this._definition)\n return \"No such state '\" + this.name() + \"'\";\n if (!this._definition.self)\n return \"State '\" + this.name() + \"' has an invalid definition\";\n };\n TargetState.prototype.toString = function () {\n return \"'\" + this.name() + \"'\" + (0,_common_strings__WEBPACK_IMPORTED_MODULE_1__.stringify)(this.params());\n };\n /**\n * Returns a copy of this TargetState which targets a different state.\n * The new TargetState has the same parameter values and transition options.\n *\n * @param state The new state that should be targeted\n */\n TargetState.prototype.withState = function (state) {\n return new TargetState(this._stateRegistry, state, this._params, this._options);\n };\n /**\n * Returns a copy of this TargetState, using the specified parameter values.\n *\n * @param params the new parameter values to use\n * @param replace When false (default) the new parameter values will be merged with the current values.\n * When true the parameter values will be used instead of the current values.\n */\n TargetState.prototype.withParams = function (params, replace) {\n if (replace === void 0) { replace = false; }\n var newParams = replace ? params : (0,_common__WEBPACK_IMPORTED_MODULE_2__.extend)({}, this._params, params);\n return new TargetState(this._stateRegistry, this._identifier, newParams, this._options);\n };\n /**\n * Returns a copy of this TargetState, using the specified Transition Options.\n *\n * @param options the new options to use\n * @param replace When false (default) the new options will be merged with the current options.\n * When true the options will be used instead of the current options.\n */\n TargetState.prototype.withOptions = function (options, replace) {\n if (replace === void 0) { replace = false; }\n var newOpts = replace ? options : (0,_common__WEBPACK_IMPORTED_MODULE_2__.extend)({}, this._options, options);\n return new TargetState(this._stateRegistry, this._identifier, this._params, newOpts);\n };\n /** Returns true if the object has a state property that might be a state or state name */\n TargetState.isDef = function (obj) {\n return obj && obj.state && ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(obj.state) || ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isObject)(obj.state) && (0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isString)(obj.state.name)));\n };\n return TargetState;\n}());\n\n//# sourceMappingURL=targetState.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/state/targetState.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js": /*!***********************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HookBuilder\": () => (/* binding */ HookBuilder)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/transition/interface.js\");\n/* harmony import */ var _transitionHook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./transitionHook */ \"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js\");\n\n\n\n\n/**\n * This class returns applicable TransitionHooks for a specific Transition instance.\n *\n * Hooks ([[RegisteredHook]]) may be registered globally, e.g., $transitions.onEnter(...), or locally, e.g.\n * myTransition.onEnter(...). The HookBuilder finds matching RegisteredHooks (where the match criteria is\n * determined by the type of hook)\n *\n * The HookBuilder also converts RegisteredHooks objects to TransitionHook objects, which are used to run a Transition.\n *\n * The HookBuilder constructor is given the $transitions service and a Transition instance. Thus, a HookBuilder\n * instance may only be used for one specific Transition object. (side note: the _treeChanges accessor is private\n * in the Transition class, so we must also provide the Transition's _treeChanges)\n */\nvar HookBuilder = /** @class */ (function () {\n function HookBuilder(transition) {\n this.transition = transition;\n }\n HookBuilder.prototype.buildHooksForPhase = function (phase) {\n var _this = this;\n var $transitions = this.transition.router.transitionService;\n return $transitions._pluginapi\n ._getEvents(phase)\n .map(function (type) { return _this.buildHooks(type); })\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])\n .filter(_common_common__WEBPACK_IMPORTED_MODULE_0__.identity);\n };\n /**\n * Returns an array of newly built TransitionHook objects.\n *\n * - Finds all RegisteredHooks registered for the given `hookType` which matched the transition's [[TreeChanges]].\n * - Finds [[PathNode]] (or `PathNode[]`) to use as the TransitionHook context(s)\n * - For each of the [[PathNode]]s, creates a TransitionHook\n *\n * @param hookType the type of the hook registration function, e.g., 'onEnter', 'onFinish'.\n */\n HookBuilder.prototype.buildHooks = function (hookType) {\n var transition = this.transition;\n var treeChanges = transition.treeChanges();\n // Find all the matching registered hooks for a given hook type\n var matchingHooks = this.getMatchingHooks(hookType, treeChanges, transition);\n if (!matchingHooks)\n return [];\n var baseHookOptions = {\n transition: transition,\n current: transition.options().current,\n };\n var makeTransitionHooks = function (hook) {\n // Fetch the Nodes that caused this hook to match.\n var matches = hook.matches(treeChanges, transition);\n // Select the PathNode[] that will be used as TransitionHook context objects\n var matchingNodes = matches[hookType.criteriaMatchPath.name];\n // Return an array of HookTuples\n return matchingNodes.map(function (node) {\n var _options = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)({\n bind: hook.bind,\n traceData: { hookType: hookType.name, context: node },\n }, baseHookOptions);\n var state = hookType.criteriaMatchPath.scope === _interface__WEBPACK_IMPORTED_MODULE_2__.TransitionHookScope.STATE ? node.state.self : null;\n var transitionHook = new _transitionHook__WEBPACK_IMPORTED_MODULE_3__.TransitionHook(transition, state, hook, _options);\n return { hook: hook, node: node, transitionHook: transitionHook };\n });\n };\n return matchingHooks\n .map(makeTransitionHooks)\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])\n .sort(tupleSort(hookType.reverseSort))\n .map(function (tuple) { return tuple.transitionHook; });\n };\n /**\n * Finds all RegisteredHooks from:\n * - The Transition object instance hook registry\n * - The TransitionService ($transitions) global hook registry\n *\n * which matched:\n * - the eventType\n * - the matchCriteria (to, from, exiting, retained, entering)\n *\n * @returns an array of matched [[RegisteredHook]]s\n */\n HookBuilder.prototype.getMatchingHooks = function (hookType, treeChanges, transition) {\n var isCreate = hookType.hookPhase === _interface__WEBPACK_IMPORTED_MODULE_2__.TransitionHookPhase.CREATE;\n // Instance and Global hook registries\n var $transitions = this.transition.router.transitionService;\n var registries = isCreate ? [$transitions] : [this.transition, $transitions];\n return registries\n .map(function (reg) { return reg.getHooks(hookType.name); }) // Get named hooks from registries\n .filter((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.assertPredicate)(_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isArray, \"broken event named: \" + hookType.name)) // Sanity check\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []) // Un-nest RegisteredHook[][] to RegisteredHook[] array\n .filter(function (hook) { return hook.matches(treeChanges, transition); }); // Only those satisfying matchCriteria\n };\n return HookBuilder;\n}());\n\n/**\n * A factory for a sort function for HookTuples.\n *\n * The sort function first compares the PathNode depth (how deep in the state tree a node is), then compares\n * the EventHook priority.\n *\n * @param reverseDepthSort a boolean, when true, reverses the sort order for the node depth\n * @returns a tuple sort function\n */\nfunction tupleSort(reverseDepthSort) {\n if (reverseDepthSort === void 0) { reverseDepthSort = false; }\n return function nodeDepthThenPriority(l, r) {\n var factor = reverseDepthSort ? -1 : 1;\n var depthDelta = (l.node.state.path.length - r.node.state.path.length) * factor;\n return depthDelta !== 0 ? depthDelta : r.hook.priority - l.hook.priority;\n };\n}\n//# sourceMappingURL=hookBuilder.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js": /*!************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RegisteredHook\": () => (/* binding */ RegisteredHook),\n/* harmony export */ \"makeEvent\": () => (/* binding */ makeEvent),\n/* harmony export */ \"matchState\": () => (/* binding */ matchState)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/transition/interface.js\");\n\n\n/**\n * Determines if the given state matches the matchCriteria\n *\n * @internal\n *\n * @param state a State Object to test against\n * @param criterion\n * - If a string, matchState uses the string as a glob-matcher against the state name\n * - If an array (of strings), matchState uses each string in the array as a glob-matchers against the state name\n * and returns a positive match if any of the globs match.\n * - If a function, matchState calls the function with the state and returns true if the function's result is truthy.\n * @returns {boolean}\n */\nfunction matchState(state, criterion, transition) {\n var toMatch = (0,_common__WEBPACK_IMPORTED_MODULE_0__.isString)(criterion) ? [criterion] : criterion;\n function matchGlobs(_state) {\n var globStrings = toMatch;\n for (var i = 0; i < globStrings.length; i++) {\n var glob = new _common__WEBPACK_IMPORTED_MODULE_0__.Glob(globStrings[i]);\n if ((glob && glob.matches(_state.name)) || (!glob && globStrings[i] === _state.name)) {\n return true;\n }\n }\n return false;\n }\n var matchFn = ((0,_common__WEBPACK_IMPORTED_MODULE_0__.isFunction)(toMatch) ? toMatch : matchGlobs);\n return !!matchFn(state, transition);\n}\n/**\n * The registration data for a registered transition hook\n */\nvar RegisteredHook = /** @class */ (function () {\n function RegisteredHook(tranSvc, eventType, callback, matchCriteria, removeHookFromRegistry, options) {\n if (options === void 0) { options = {}; }\n this.tranSvc = tranSvc;\n this.eventType = eventType;\n this.callback = callback;\n this.matchCriteria = matchCriteria;\n this.removeHookFromRegistry = removeHookFromRegistry;\n this.invokeCount = 0;\n this._deregistered = false;\n this.priority = options.priority || 0;\n this.bind = options.bind || null;\n this.invokeLimit = options.invokeLimit;\n }\n /**\n * Gets the matching [[PathNode]]s\n *\n * Given an array of [[PathNode]]s, and a [[HookMatchCriterion]], returns an array containing\n * the [[PathNode]]s that the criteria matches, or `null` if there were no matching nodes.\n *\n * Returning `null` is significant to distinguish between the default\n * \"match-all criterion value\" of `true` compared to a `() => true` function,\n * when the nodes is an empty array.\n *\n * This is useful to allow a transition match criteria of `entering: true`\n * to still match a transition, even when `entering === []`. Contrast that\n * with `entering: (state) => true` which only matches when a state is actually\n * being entered.\n */\n RegisteredHook.prototype._matchingNodes = function (nodes, criterion, transition) {\n if (criterion === true)\n return nodes;\n var matching = nodes.filter(function (node) { return matchState(node.state, criterion, transition); });\n return matching.length ? matching : null;\n };\n /**\n * Gets the default match criteria (all `true`)\n *\n * Returns an object which has all the criteria match paths as keys and `true` as values, i.e.:\n *\n * ```js\n * {\n * to: true,\n * from: true,\n * entering: true,\n * exiting: true,\n * retained: true,\n * }\n */\n RegisteredHook.prototype._getDefaultMatchCriteria = function () {\n return (0,_common__WEBPACK_IMPORTED_MODULE_0__.mapObj)(this.tranSvc._pluginapi._getPathTypes(), function () { return true; });\n };\n /**\n * Gets matching nodes as [[IMatchingNodes]]\n *\n * Create a IMatchingNodes object from the TransitionHookTypes that is roughly equivalent to:\n *\n * ```js\n * let matches: IMatchingNodes = {\n * to: _matchingNodes([tail(treeChanges.to)], mc.to),\n * from: _matchingNodes([tail(treeChanges.from)], mc.from),\n * exiting: _matchingNodes(treeChanges.exiting, mc.exiting),\n * retained: _matchingNodes(treeChanges.retained, mc.retained),\n * entering: _matchingNodes(treeChanges.entering, mc.entering),\n * };\n * ```\n */\n RegisteredHook.prototype._getMatchingNodes = function (treeChanges, transition) {\n var _this = this;\n var criteria = (0,_common__WEBPACK_IMPORTED_MODULE_0__.extend)(this._getDefaultMatchCriteria(), this.matchCriteria);\n var paths = (0,_common__WEBPACK_IMPORTED_MODULE_0__.values)(this.tranSvc._pluginapi._getPathTypes());\n return paths.reduce(function (mn, pathtype) {\n // STATE scope criteria matches against every node in the path.\n // TRANSITION scope criteria matches against only the last node in the path\n var isStateHook = pathtype.scope === _interface__WEBPACK_IMPORTED_MODULE_1__.TransitionHookScope.STATE;\n var path = treeChanges[pathtype.name] || [];\n var nodes = isStateHook ? path : [(0,_common__WEBPACK_IMPORTED_MODULE_0__.tail)(path)];\n mn[pathtype.name] = _this._matchingNodes(nodes, criteria[pathtype.name], transition);\n return mn;\n }, {});\n };\n /**\n * Determines if this hook's [[matchCriteria]] match the given [[TreeChanges]]\n *\n * @returns an IMatchingNodes object, or null. If an IMatchingNodes object is returned, its values\n * are the matching [[PathNode]]s for each [[HookMatchCriterion]] (to, from, exiting, retained, entering)\n */\n RegisteredHook.prototype.matches = function (treeChanges, transition) {\n var matches = this._getMatchingNodes(treeChanges, transition);\n // Check if all the criteria matched the TreeChanges object\n var allMatched = (0,_common__WEBPACK_IMPORTED_MODULE_0__.values)(matches).every(_common__WEBPACK_IMPORTED_MODULE_0__.identity);\n return allMatched ? matches : null;\n };\n RegisteredHook.prototype.deregister = function () {\n this.removeHookFromRegistry(this);\n this._deregistered = true;\n };\n return RegisteredHook;\n}());\n\n/** Return a registration function of the requested type. */\nfunction makeEvent(registry, transitionService, eventType) {\n // Create the object which holds the registered transition hooks.\n var _registeredHooks = (registry._registeredHooks = registry._registeredHooks || {});\n var hooks = (_registeredHooks[eventType.name] = []);\n var removeHookFn = (0,_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(hooks);\n // Create hook registration function on the IHookRegistry for the event\n registry[eventType.name] = hookRegistrationFn;\n function hookRegistrationFn(matchObject, callback, options) {\n if (options === void 0) { options = {}; }\n var registeredHook = new RegisteredHook(transitionService, eventType, callback, matchObject, removeHookFn, options);\n hooks.push(registeredHook);\n return registeredHook.deregister.bind(registeredHook);\n }\n return hookRegistrationFn;\n}\n//# sourceMappingURL=hookRegistry.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/transition/index.js": /*!*****************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/transition/index.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HookBuilder\": () => (/* reexport safe */ _hookBuilder__WEBPACK_IMPORTED_MODULE_1__.HookBuilder),\n/* harmony export */ \"RegisteredHook\": () => (/* reexport safe */ _hookRegistry__WEBPACK_IMPORTED_MODULE_2__.RegisteredHook),\n/* harmony export */ \"RejectType\": () => (/* reexport safe */ _rejectFactory__WEBPACK_IMPORTED_MODULE_3__.RejectType),\n/* harmony export */ \"Rejection\": () => (/* reexport safe */ _rejectFactory__WEBPACK_IMPORTED_MODULE_3__.Rejection),\n/* harmony export */ \"Transition\": () => (/* reexport safe */ _transition__WEBPACK_IMPORTED_MODULE_4__.Transition),\n/* harmony export */ \"TransitionEventType\": () => (/* reexport safe */ _transitionEventType__WEBPACK_IMPORTED_MODULE_6__.TransitionEventType),\n/* harmony export */ \"TransitionHook\": () => (/* reexport safe */ _transitionHook__WEBPACK_IMPORTED_MODULE_5__.TransitionHook),\n/* harmony export */ \"TransitionHookPhase\": () => (/* reexport safe */ _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookPhase),\n/* harmony export */ \"TransitionHookScope\": () => (/* reexport safe */ _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookScope),\n/* harmony export */ \"TransitionService\": () => (/* reexport safe */ _transitionService__WEBPACK_IMPORTED_MODULE_7__.TransitionService),\n/* harmony export */ \"defaultTransOpts\": () => (/* reexport safe */ _transitionService__WEBPACK_IMPORTED_MODULE_7__.defaultTransOpts),\n/* harmony export */ \"makeEvent\": () => (/* reexport safe */ _hookRegistry__WEBPACK_IMPORTED_MODULE_2__.makeEvent),\n/* harmony export */ \"matchState\": () => (/* reexport safe */ _hookRegistry__WEBPACK_IMPORTED_MODULE_2__.matchState)\n/* harmony export */ });\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/transition/interface.js\");\n/* harmony import */ var _hookBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hookBuilder */ \"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js\");\n/* harmony import */ var _hookRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hookRegistry */ \"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js\");\n/* harmony import */ var _rejectFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rejectFactory */ \"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js\");\n/* harmony import */ var _transition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./transition */ \"./node_modules/@uirouter/core/lib-esm/transition/transition.js\");\n/* harmony import */ var _transitionHook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./transitionHook */ \"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js\");\n/* harmony import */ var _transitionEventType__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transitionEventType */ \"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js\");\n/* harmony import */ var _transitionService__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./transitionService */ \"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js\");\n/**\n * # Transition subsystem\n *\n * This module contains APIs related to a Transition.\n *\n * See:\n * - [[TransitionService]]\n * - [[Transition]]\n * - [[HookFn]], [[TransitionHookFn]], [[TransitionStateHookFn]], [[HookMatchCriteria]], [[HookResult]]\n *\n * @packageDocumentation @preferred\n */\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/transition/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/transition/interface.js": /*!*********************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/transition/interface.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TransitionHookPhase\": () => (/* binding */ TransitionHookPhase),\n/* harmony export */ \"TransitionHookScope\": () => (/* binding */ TransitionHookScope)\n/* harmony export */ });\nvar TransitionHookPhase;\n(function (TransitionHookPhase) {\n TransitionHookPhase[TransitionHookPhase[\"CREATE\"] = 0] = \"CREATE\";\n TransitionHookPhase[TransitionHookPhase[\"BEFORE\"] = 1] = \"BEFORE\";\n TransitionHookPhase[TransitionHookPhase[\"RUN\"] = 2] = \"RUN\";\n TransitionHookPhase[TransitionHookPhase[\"SUCCESS\"] = 3] = \"SUCCESS\";\n TransitionHookPhase[TransitionHookPhase[\"ERROR\"] = 4] = \"ERROR\";\n})(TransitionHookPhase || (TransitionHookPhase = {}));\nvar TransitionHookScope;\n(function (TransitionHookScope) {\n TransitionHookScope[TransitionHookScope[\"TRANSITION\"] = 0] = \"TRANSITION\";\n TransitionHookScope[TransitionHookScope[\"STATE\"] = 1] = \"STATE\";\n})(TransitionHookScope || (TransitionHookScope = {}));\n\n//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/transition/interface.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js": /*!*************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RejectType\": () => (/* binding */ RejectType),\n/* harmony export */ \"Rejection\": () => (/* binding */ Rejection)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/strings */ \"./node_modules/@uirouter/core/lib-esm/common/strings.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n\n\n\n\n/** An enum for Transition Rejection reasons */\nvar RejectType;\n(function (RejectType) {\n /**\n * A new transition superseded this one.\n *\n * While this transition was running, a new transition started.\n * This transition is cancelled because it was superseded by new transition.\n */\n RejectType[RejectType[\"SUPERSEDED\"] = 2] = \"SUPERSEDED\";\n /**\n * The transition was aborted\n *\n * The transition was aborted by a hook which returned `false`\n */\n RejectType[RejectType[\"ABORTED\"] = 3] = \"ABORTED\";\n /**\n * The transition was invalid\n *\n * The transition was never started because it was invalid\n */\n RejectType[RejectType[\"INVALID\"] = 4] = \"INVALID\";\n /**\n * The transition was ignored\n *\n * The transition was ignored because it would have no effect.\n *\n * Either:\n *\n * - The transition is targeting the current state and parameter values\n * - The transition is targeting the same state and parameter values as the currently running transition.\n */\n RejectType[RejectType[\"IGNORED\"] = 5] = \"IGNORED\";\n /**\n * The transition errored.\n *\n * This generally means a hook threw an error or returned a rejected promise\n */\n RejectType[RejectType[\"ERROR\"] = 6] = \"ERROR\";\n})(RejectType || (RejectType = {}));\n\n/** @internal */\nvar id = 0;\nvar Rejection = /** @class */ (function () {\n function Rejection(type, message, detail) {\n /** @internal */\n this.$id = id++;\n this.type = type;\n this.message = message;\n this.detail = detail;\n }\n /** Returns true if the obj is a rejected promise created from the `asPromise` factory */\n Rejection.isRejectionPromise = function (obj) {\n return obj && typeof obj.then === 'function' && (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.is)(Rejection)(obj._transitionRejection);\n };\n /** Returns a Rejection due to transition superseded */\n Rejection.superseded = function (detail, options) {\n var message = 'The transition has been superseded by a different transition';\n var rejection = new Rejection(RejectType.SUPERSEDED, message, detail);\n if (options && options.redirected) {\n rejection.redirected = true;\n }\n return rejection;\n };\n /** Returns a Rejection due to redirected transition */\n Rejection.redirected = function (detail) {\n return Rejection.superseded(detail, { redirected: true });\n };\n /** Returns a Rejection due to invalid transition */\n Rejection.invalid = function (detail) {\n var message = 'This transition is invalid';\n return new Rejection(RejectType.INVALID, message, detail);\n };\n /** Returns a Rejection due to ignored transition */\n Rejection.ignored = function (detail) {\n var message = 'The transition was ignored';\n return new Rejection(RejectType.IGNORED, message, detail);\n };\n /** Returns a Rejection due to aborted transition */\n Rejection.aborted = function (detail) {\n var message = 'The transition has been aborted';\n return new Rejection(RejectType.ABORTED, message, detail);\n };\n /** Returns a Rejection due to aborted transition */\n Rejection.errored = function (detail) {\n var message = 'The transition errored';\n return new Rejection(RejectType.ERROR, message, detail);\n };\n /**\n * Returns a Rejection\n *\n * Normalizes a value as a Rejection.\n * If the value is already a Rejection, returns it.\n * Otherwise, wraps and returns the value as a Rejection (Rejection type: ERROR).\n *\n * @returns `detail` if it is already a `Rejection`, else returns an ERROR Rejection.\n */\n Rejection.normalize = function (detail) {\n return (0,_common_hof__WEBPACK_IMPORTED_MODULE_2__.is)(Rejection)(detail) ? detail : Rejection.errored(detail);\n };\n Rejection.prototype.toString = function () {\n var detailString = function (d) { return (d && d.toString !== Object.prototype.toString ? d.toString() : (0,_common_strings__WEBPACK_IMPORTED_MODULE_1__.stringify)(d)); };\n var detail = detailString(this.detail);\n var _a = this, $id = _a.$id, type = _a.type, message = _a.message;\n return \"Transition Rejection($id: \" + $id + \" type: \" + type + \", message: \" + message + \", detail: \" + detail + \")\";\n };\n Rejection.prototype.toPromise = function () {\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.extend)((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.silentRejection)(this), { _transitionRejection: this });\n };\n return Rejection;\n}());\n\n//# sourceMappingURL=rejectFactory.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/transition/transition.js": /*!**********************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/transition/transition.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Transition\": () => (/* binding */ Transition)\n/* harmony export */ });\n/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/trace */ \"./node_modules/@uirouter/core/lib-esm/common/trace.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/strings */ \"./node_modules/@uirouter/core/lib-esm/common/strings.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/transition/interface.js\");\n/* harmony import */ var _transitionHook__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./transitionHook */ \"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js\");\n/* harmony import */ var _hookRegistry__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./hookRegistry */ \"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js\");\n/* harmony import */ var _hookBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./hookBuilder */ \"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js\");\n/* harmony import */ var _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../path/pathUtils */ \"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js\");\n/* harmony import */ var _params_param__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../params/param */ \"./node_modules/@uirouter/core/lib-esm/params/param.js\");\n/* harmony import */ var _resolve_resolvable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../resolve/resolvable */ \"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js\");\n/* harmony import */ var _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../resolve/resolveContext */ \"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js\");\n/* harmony import */ var _rejectFactory__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./rejectFactory */ \"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n\n\n\n\n\n\n // has or is using\n\n\n\n\n\n\n\n\n\n/** @internal */\nvar stateSelf = (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('self');\n/**\n * Represents a transition between two states.\n *\n * When navigating to a state, we are transitioning **from** the current state **to** the new state.\n *\n * This object contains all contextual information about the to/from states, parameters, resolves.\n * It has information about all states being entered and exited as a result of the transition.\n */\nvar Transition = /** @class */ (function () {\n /**\n * Creates a new Transition object.\n *\n * If the target state is not valid, an error is thrown.\n *\n * @internal\n *\n * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`\n * encapsulates the \"from state\".\n * @param targetState The target state and parameters being transitioned to (also, the transition options)\n * @param router The [[UIRouter]] instance\n * @internal\n */\n function Transition(fromPath, targetState, router) {\n var _this = this;\n /** @internal */\n this._deferred = _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q.defer();\n /**\n * This promise is resolved or rejected based on the outcome of the Transition.\n *\n * When the transition is successful, the promise is resolved\n * When the transition is unsuccessful, the promise is rejected with the [[Rejection]] or javascript error\n */\n this.promise = this._deferred.promise;\n /** @internal Holds the hook registration functions such as those passed to Transition.onStart() */\n this._registeredHooks = {};\n /** @internal */\n this._hookBuilder = new _hookBuilder__WEBPACK_IMPORTED_MODULE_9__.HookBuilder(this);\n /** Checks if this transition is currently active/running. */\n this.isActive = function () { return _this.router.globals.transition === _this; };\n this.router = router;\n this._targetState = targetState;\n if (!targetState.valid()) {\n throw new Error(targetState.error());\n }\n // current() is assumed to come from targetState.options, but provide a naive implementation otherwise.\n this._options = (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.extend)({ current: (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.val)(this) }, targetState.options());\n this.$id = router.transitionService._transitionCount++;\n var toPath = _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.buildToPath(fromPath, targetState);\n this._treeChanges = _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.treeChanges(fromPath, toPath, this._options.reloadState);\n this.createTransitionHookRegFns();\n var onCreateHooks = this._hookBuilder.buildHooksForPhase(_interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.CREATE);\n _transitionHook__WEBPACK_IMPORTED_MODULE_7__.TransitionHook.invokeHooks(onCreateHooks, function () { return null; });\n this.applyViewConfigs(router);\n }\n /** @internal */\n Transition.prototype.onBefore = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onStart = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onExit = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onRetain = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onEnter = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onFinish = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onSuccess = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n Transition.prototype.onError = function (criteria, callback, options) {\n return;\n };\n /** @internal\n * Creates the transition-level hook registration functions\n * (which can then be used to register hooks)\n */\n Transition.prototype.createTransitionHookRegFns = function () {\n var _this = this;\n this.router.transitionService._pluginapi\n ._getEvents()\n .filter(function (type) { return type.hookPhase !== _interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.CREATE; })\n .forEach(function (type) { return (0,_hookRegistry__WEBPACK_IMPORTED_MODULE_8__.makeEvent)(_this, _this.router.transitionService, type); });\n };\n /** @internal */\n Transition.prototype.getHooks = function (hookName) {\n return this._registeredHooks[hookName];\n };\n Transition.prototype.applyViewConfigs = function (router) {\n var enteringStates = this._treeChanges.entering.map(function (node) { return node.state; });\n _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.applyViewConfigs(router.transitionService.$view, this._treeChanges.to, enteringStates);\n };\n /**\n * @internal\n * @returns the internal from [State] object\n */\n Transition.prototype.$from = function () {\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.tail)(this._treeChanges.from).state;\n };\n /**\n * @internal\n * @returns the internal to [State] object\n */\n Transition.prototype.$to = function () {\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.tail)(this._treeChanges.to).state;\n };\n /**\n * Returns the \"from state\"\n *\n * Returns the state that the transition is coming *from*.\n *\n * @returns The state declaration object for the Transition's (\"from state\").\n */\n Transition.prototype.from = function () {\n return this.$from().self;\n };\n /**\n * Returns the \"to state\"\n *\n * Returns the state that the transition is going *to*.\n *\n * @returns The state declaration object for the Transition's target state (\"to state\").\n */\n Transition.prototype.to = function () {\n return this.$to().self;\n };\n /**\n * Gets the Target State\n *\n * A transition's [[TargetState]] encapsulates the [[to]] state, the [[params]], and the [[options]] as a single object.\n *\n * @returns the [[TargetState]] of this Transition\n */\n Transition.prototype.targetState = function () {\n return this._targetState;\n };\n /**\n * Determines whether two transitions are equivalent.\n * @deprecated\n */\n Transition.prototype.is = function (compare) {\n if (compare instanceof Transition) {\n // TODO: Also compare parameters\n return this.is({ to: compare.$to().name, from: compare.$from().name });\n }\n return !((compare.to && !(0,_hookRegistry__WEBPACK_IMPORTED_MODULE_8__.matchState)(this.$to(), compare.to, this)) ||\n (compare.from && !(0,_hookRegistry__WEBPACK_IMPORTED_MODULE_8__.matchState)(this.$from(), compare.from, this)));\n };\n Transition.prototype.params = function (pathname) {\n if (pathname === void 0) { pathname = 'to'; }\n return Object.freeze(this._treeChanges[pathname].map((0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('paramValues')).reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.mergeR, {}));\n };\n Transition.prototype.paramsChanged = function () {\n var fromParams = this.params('from');\n var toParams = this.params('to');\n // All the parameters declared on both the \"to\" and \"from\" paths\n var allParamDescriptors = []\n .concat(this._treeChanges.to)\n .concat(this._treeChanges.from)\n .map(function (pathNode) { return pathNode.paramSchema; })\n .reduce(_common__WEBPACK_IMPORTED_MODULE_15__.flattenR, [])\n .reduce(_common__WEBPACK_IMPORTED_MODULE_15__.uniqR, []);\n var changedParamDescriptors = _params_param__WEBPACK_IMPORTED_MODULE_11__.Param.changed(allParamDescriptors, fromParams, toParams);\n return changedParamDescriptors.reduce(function (changedValues, descriptor) {\n changedValues[descriptor.id] = toParams[descriptor.id];\n return changedValues;\n }, {});\n };\n /**\n * Creates a [[UIInjector]] Dependency Injector\n *\n * Returns a Dependency Injector for the Transition's target state (to state).\n * The injector provides resolve values which the target state has access to.\n *\n * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2).\n *\n * #### Example:\n * ```js\n * .onEnter({ entering: 'myState' }, trans => {\n * var myResolveValue = trans.injector().get('myResolve');\n * // Inject a global service from the global/native injector (if it exists)\n * var MyService = trans.injector().get('MyService');\n * })\n * ```\n *\n * In some cases (such as `onBefore`), you may need access to some resolve data but it has not yet been fetched.\n * You can use [[UIInjector.getAsync]] to get a promise for the data.\n * #### Example:\n * ```js\n * .onBefore({}, trans => {\n * return trans.injector().getAsync('myResolve').then(myResolveValue =>\n * return myResolveValue !== 'ABORT';\n * });\n * });\n * ```\n *\n * If a `state` is provided, the injector that is returned will be limited to resolve values that the provided state has access to.\n * This can be useful if both a parent state `foo` and a child state `foo.bar` have both defined a resolve such as `data`.\n * #### Example:\n * ```js\n * .onEnter({ to: 'foo.bar' }, trans => {\n * // returns result of `foo` state's `myResolve` resolve\n * // even though `foo.bar` also has a `myResolve` resolve\n * var fooData = trans.injector('foo').get('myResolve');\n * });\n * ```\n *\n * If you need resolve data from the exiting states, pass `'from'` as `pathName`.\n * The resolve data from the `from` path will be returned.\n * #### Example:\n * ```js\n * .onExit({ exiting: 'foo.bar' }, trans => {\n * // Gets the resolve value of `myResolve` from the state being exited\n * var fooData = trans.injector(null, 'from').get('myResolve');\n * });\n * ```\n *\n *\n * @param state Limits the resolves provided to only the resolves the provided state has access to.\n * @param pathName Default: `'to'`: Chooses the path for which to create the injector. Use this to access resolves for `exiting` states.\n *\n * @returns a [[UIInjector]]\n */\n Transition.prototype.injector = function (state, pathName) {\n if (pathName === void 0) { pathName = 'to'; }\n var path = this._treeChanges[pathName];\n if (state)\n path = _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.subPath(path, function (node) { return node.state === state || node.state.name === state; });\n return new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_13__.ResolveContext(path).injector();\n };\n /**\n * Gets all available resolve tokens (keys)\n *\n * This method can be used in conjunction with [[injector]] to inspect the resolve values\n * available to the Transition.\n *\n * This returns all the tokens defined on [[StateDeclaration.resolve]] blocks, for the states\n * in the Transition's [[TreeChanges.to]] path.\n *\n * #### Example:\n * This example logs all resolve values\n * ```js\n * let tokens = trans.getResolveTokens();\n * tokens.forEach(token => console.log(token + \" = \" + trans.injector().get(token)));\n * ```\n *\n * #### Example:\n * This example creates promises for each resolve value.\n * This triggers fetches of resolves (if any have not yet been fetched).\n * When all promises have all settled, it logs the resolve values.\n * ```js\n * let tokens = trans.getResolveTokens();\n * let promise = tokens.map(token => trans.injector().getAsync(token));\n * Promise.all(promises).then(values => console.log(\"Resolved values: \" + values));\n * ```\n *\n * Note: Angular 1 users whould use `$q.all()`\n *\n * @param pathname resolve context's path name (e.g., `to` or `from`)\n *\n * @returns an array of resolve tokens (keys)\n */\n Transition.prototype.getResolveTokens = function (pathname) {\n if (pathname === void 0) { pathname = 'to'; }\n return new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_13__.ResolveContext(this._treeChanges[pathname]).getTokens();\n };\n /**\n * Dynamically adds a new [[Resolvable]] (i.e., [[StateDeclaration.resolve]]) to this transition.\n *\n * Allows a transition hook to dynamically add a Resolvable to this Transition.\n *\n * Use the [[Transition.injector]] to retrieve the resolved data in subsequent hooks ([[UIInjector.get]]).\n *\n * If a `state` argument is provided, the Resolvable is processed when that state is being entered.\n * If no `state` is provided then the root state is used.\n * If the given `state` has already been entered, the Resolvable is processed when any child state is entered.\n * If no child states will be entered, the Resolvable is processed during the `onFinish` phase of the Transition.\n *\n * The `state` argument also scopes the resolved data.\n * The resolved data is available from the injector for that `state` and any children states.\n *\n * #### Example:\n * ```js\n * transitionService.onBefore({}, transition => {\n * transition.addResolvable({\n * token: 'myResolve',\n * deps: ['MyService'],\n * resolveFn: myService => myService.getData()\n * });\n * });\n * ```\n *\n * @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]])\n * @param state the state in the \"to path\" which should receive the new resolve (otherwise, the root state)\n */\n Transition.prototype.addResolvable = function (resolvable, state) {\n if (state === void 0) { state = ''; }\n resolvable = (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.is)(_resolve_resolvable__WEBPACK_IMPORTED_MODULE_12__.Resolvable)(resolvable) ? resolvable : new _resolve_resolvable__WEBPACK_IMPORTED_MODULE_12__.Resolvable(resolvable);\n var stateName = typeof state === 'string' ? state : state.name;\n var topath = this._treeChanges.to;\n var targetNode = (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.find)(topath, function (node) { return node.state.name === stateName; });\n var resolveContext = new _resolve_resolveContext__WEBPACK_IMPORTED_MODULE_13__.ResolveContext(topath);\n resolveContext.addResolvables([resolvable], targetNode.state);\n };\n /**\n * Gets the transition from which this transition was redirected.\n *\n * If the current transition is a redirect, this method returns the transition that was redirected.\n *\n * #### Example:\n * ```js\n * let transitionA = $state.go('A').transition\n * transitionA.onStart({}, () => $state.target('B'));\n * $transitions.onSuccess({ to: 'B' }, (trans) => {\n * trans.to().name === 'B'; // true\n * trans.redirectedFrom() === transitionA; // true\n * });\n * ```\n *\n * @returns The previous Transition, or null if this Transition is not the result of a redirection\n */\n Transition.prototype.redirectedFrom = function () {\n return this._options.redirectedFrom || null;\n };\n /**\n * Gets the original transition in a redirect chain\n *\n * A transition might belong to a long chain of multiple redirects.\n * This method walks the [[redirectedFrom]] chain back to the original (first) transition in the chain.\n *\n * #### Example:\n * ```js\n * // states\n * registry.register({ name: 'A', redirectTo: 'B' });\n * registry.register({ name: 'B', redirectTo: 'C' });\n * registry.register({ name: 'C', redirectTo: 'D' });\n * registry.register({ name: 'D' });\n *\n * let transitionA = $state.go('A').transition\n *\n * $transitions.onSuccess({ to: 'D' }, (trans) => {\n * trans.to().name === 'D'; // true\n * trans.redirectedFrom().to().name === 'C'; // true\n * trans.originalTransition() === transitionA; // true\n * trans.originalTransition().to().name === 'A'; // true\n * });\n * ```\n *\n * @returns The original Transition that started a redirect chain\n */\n Transition.prototype.originalTransition = function () {\n var rf = this.redirectedFrom();\n return (rf && rf.originalTransition()) || this;\n };\n /**\n * Get the transition options\n *\n * @returns the options for this Transition.\n */\n Transition.prototype.options = function () {\n return this._options;\n };\n /**\n * Gets the states being entered.\n *\n * @returns an array of states that will be entered during this transition.\n */\n Transition.prototype.entering = function () {\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.map)(this._treeChanges.entering, (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('state')).map(stateSelf);\n };\n /**\n * Gets the states being exited.\n *\n * @returns an array of states that will be exited during this transition.\n */\n Transition.prototype.exiting = function () {\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.map)(this._treeChanges.exiting, (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('state')).map(stateSelf).reverse();\n };\n /**\n * Gets the states being retained.\n *\n * @returns an array of states that are already entered from a previous Transition, that will not be\n * exited during this Transition\n */\n Transition.prototype.retained = function () {\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.map)(this._treeChanges.retained, (0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('state')).map(stateSelf);\n };\n /**\n * Get the [[ViewConfig]]s associated with this Transition\n *\n * Each state can define one or more views (template/controller), which are encapsulated as `ViewConfig` objects.\n * This method fetches the `ViewConfigs` for a given path in the Transition (e.g., \"to\" or \"entering\").\n *\n * @param pathname the name of the path to fetch views for:\n * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)\n * @param state If provided, only returns the `ViewConfig`s for a single state in the path\n *\n * @returns a list of ViewConfig objects for the given path.\n */\n Transition.prototype.views = function (pathname, state) {\n if (pathname === void 0) { pathname = 'entering'; }\n var path = this._treeChanges[pathname];\n path = !state ? path : path.filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.propEq)('state', state));\n return path.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('views')).filter(_common_common__WEBPACK_IMPORTED_MODULE_3__.identity).reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.unnestR, []);\n };\n Transition.prototype.treeChanges = function (pathname) {\n return pathname ? this._treeChanges[pathname] : this._treeChanges;\n };\n /**\n * Creates a new transition that is a redirection of the current one.\n *\n * This transition can be returned from a [[TransitionService]] hook to\n * redirect a transition to a new state and/or set of parameters.\n *\n * @internal\n *\n * @returns Returns a new [[Transition]] instance.\n */\n Transition.prototype.redirect = function (targetState) {\n var redirects = 1, trans = this;\n // tslint:disable-next-line:no-conditional-assignment\n while ((trans = trans.redirectedFrom()) != null) {\n if (++redirects > 20)\n throw new Error(\"Too many consecutive Transition redirects (20+)\");\n }\n var redirectOpts = { redirectedFrom: this, source: 'redirect' };\n // If the original transition was caused by URL sync, then use { location: 'replace' }\n // on the new transition (unless the target state explicitly specifies location: false).\n // This causes the original url to be replaced with the url for the redirect target\n // so the original url disappears from the browser history.\n if (this.options().source === 'url' && targetState.options().location !== false) {\n redirectOpts.location = 'replace';\n }\n var newOptions = (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.extend)({}, this.options(), targetState.options(), redirectOpts);\n targetState = targetState.withOptions(newOptions, true);\n var newTransition = this.router.transitionService.create(this._treeChanges.from, targetState);\n var originalEnteringNodes = this._treeChanges.entering;\n var redirectEnteringNodes = newTransition._treeChanges.entering;\n // --- Re-use resolve data from original transition ---\n // When redirecting from a parent state to a child state where the parent parameter values haven't changed\n // (because of the redirect), the resolves fetched by the original transition are still valid in the\n // redirected transition.\n //\n // This allows you to define a redirect on a parent state which depends on an async resolve value.\n // You can wait for the resolve, then redirect to a child state based on the result.\n // The redirected transition does not have to re-fetch the resolve.\n // ---------------------------------------------------------\n var nodeIsReloading = function (reloadState) { return function (node) {\n return reloadState && node.state.includes[reloadState.name];\n }; };\n // Find any \"entering\" nodes in the redirect path that match the original path and aren't being reloaded\n var matchingEnteringNodes = _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.matching(redirectEnteringNodes, originalEnteringNodes, _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.nonDynamicParams).filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.not)(nodeIsReloading(targetState.options().reloadState)));\n // Use the existing (possibly pre-resolved) resolvables for the matching entering nodes.\n matchingEnteringNodes.forEach(function (node, idx) {\n node.resolvables = originalEnteringNodes[idx].resolvables;\n });\n return newTransition;\n };\n /** @internal If a transition doesn't exit/enter any states, returns any [[Param]] whose value changed */\n Transition.prototype._changedParams = function () {\n var tc = this._treeChanges;\n /** Return undefined if it's not a \"dynamic\" transition, for the following reasons */\n // If user explicitly wants a reload\n if (this._options.reload)\n return undefined;\n // If any states are exiting or entering\n if (tc.exiting.length || tc.entering.length)\n return undefined;\n // If to/from path lengths differ\n if (tc.to.length !== tc.from.length)\n return undefined;\n // If the to/from paths are different\n var pathsDiffer = (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.arrayTuples)(tc.to, tc.from)\n .map(function (tuple) { return tuple[0].state !== tuple[1].state; })\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.anyTrueR, false);\n if (pathsDiffer)\n return undefined;\n // Find any parameter values that differ\n var nodeSchemas = tc.to.map(function (node) { return node.paramSchema; });\n var _a = [tc.to, tc.from].map(function (path) { return path.map(function (x) { return x.paramValues; }); }), toValues = _a[0], fromValues = _a[1];\n var tuples = (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.arrayTuples)(nodeSchemas, toValues, fromValues);\n return tuples.map(function (_a) {\n var schema = _a[0], toVals = _a[1], fromVals = _a[2];\n return _params_param__WEBPACK_IMPORTED_MODULE_11__.Param.changed(schema, toVals, fromVals);\n }).reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.unnestR, []);\n };\n /**\n * Returns true if the transition is dynamic.\n *\n * A transition is dynamic if no states are entered nor exited, but at least one dynamic parameter has changed.\n *\n * @returns true if the Transition is dynamic\n */\n Transition.prototype.dynamic = function () {\n var changes = this._changedParams();\n return !changes ? false : changes.map(function (x) { return x.dynamic; }).reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.anyTrueR, false);\n };\n /**\n * Returns true if the transition is ignored.\n *\n * A transition is ignored if no states are entered nor exited, and no parameter values have changed.\n *\n * @returns true if the Transition is ignored.\n */\n Transition.prototype.ignored = function () {\n return !!this._ignoredReason();\n };\n /** @internal */\n Transition.prototype._ignoredReason = function () {\n var pending = this.router.globals.transition;\n var reloadState = this._options.reloadState;\n var same = function (pathA, pathB) {\n if (pathA.length !== pathB.length)\n return false;\n var matching = _path_pathUtils__WEBPACK_IMPORTED_MODULE_10__.PathUtils.matching(pathA, pathB);\n return pathA.length === matching.filter(function (node) { return !reloadState || !node.state.includes[reloadState.name]; }).length;\n };\n var newTC = this.treeChanges();\n var pendTC = pending && pending.treeChanges();\n if (pendTC && same(pendTC.to, newTC.to) && same(pendTC.exiting, newTC.exiting))\n return 'SameAsPending';\n if (newTC.exiting.length === 0 && newTC.entering.length === 0 && same(newTC.from, newTC.to))\n return 'SameAsCurrent';\n };\n /**\n * Runs the transition\n *\n * This method is generally called from the [[StateService.transitionTo]]\n *\n * @internal\n *\n * @returns a promise for a successful transition.\n */\n Transition.prototype.run = function () {\n var _this = this;\n var runAllHooks = _transitionHook__WEBPACK_IMPORTED_MODULE_7__.TransitionHook.runAllHooks;\n // Gets transition hooks array for the given phase\n var getHooksFor = function (phase) { return _this._hookBuilder.buildHooksForPhase(phase); };\n // When the chain is complete, then resolve or reject the deferred\n var transitionSuccess = function () {\n _common_trace__WEBPACK_IMPORTED_MODULE_0__.trace.traceSuccess(_this.$to(), _this);\n _this.success = true;\n _this._deferred.resolve(_this.to());\n runAllHooks(getHooksFor(_interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.SUCCESS));\n };\n var transitionError = function (reason) {\n _common_trace__WEBPACK_IMPORTED_MODULE_0__.trace.traceError(reason, _this);\n _this.success = false;\n _this._deferred.reject(reason);\n _this._error = reason;\n runAllHooks(getHooksFor(_interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.ERROR));\n };\n var runTransition = function () {\n // Wait to build the RUN hook chain until the BEFORE hooks are done\n // This allows a BEFORE hook to dynamically add additional RUN hooks via the Transition object.\n var allRunHooks = getHooksFor(_interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.RUN);\n var done = function () { return _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(undefined); };\n return _transitionHook__WEBPACK_IMPORTED_MODULE_7__.TransitionHook.invokeHooks(allRunHooks, done);\n };\n var startTransition = function () {\n var globals = _this.router.globals;\n globals.lastStartedTransitionId = _this.$id;\n globals.transition = _this;\n globals.transitionHistory.enqueue(_this);\n _common_trace__WEBPACK_IMPORTED_MODULE_0__.trace.traceTransitionStart(_this);\n return _common_coreservices__WEBPACK_IMPORTED_MODULE_1__.services.$q.when(undefined);\n };\n var allBeforeHooks = getHooksFor(_interface__WEBPACK_IMPORTED_MODULE_6__.TransitionHookPhase.BEFORE);\n _transitionHook__WEBPACK_IMPORTED_MODULE_7__.TransitionHook.invokeHooks(allBeforeHooks, startTransition)\n .then(runTransition)\n .then(transitionSuccess, transitionError);\n return this.promise;\n };\n /**\n * Checks if the Transition is valid\n *\n * @returns true if the Transition is valid\n */\n Transition.prototype.valid = function () {\n return !this.error() || this.success !== undefined;\n };\n /**\n * Aborts this transition\n *\n * Imperative API to abort a Transition.\n * This only applies to Transitions that are not yet complete.\n */\n Transition.prototype.abort = function () {\n // Do not set flag if the transition is already complete\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isUndefined)(this.success)) {\n this._aborted = true;\n }\n };\n /**\n * The Transition error reason.\n *\n * If the transition is invalid (and could not be run), returns the reason the transition is invalid.\n * If the transition was valid and ran, but was not successful, returns the reason the transition failed.\n *\n * @returns a transition rejection explaining why the transition is invalid, or the reason the transition failed.\n */\n Transition.prototype.error = function () {\n var state = this.$to();\n if (state.self.abstract) {\n return _rejectFactory__WEBPACK_IMPORTED_MODULE_14__.Rejection.invalid(\"Cannot transition to abstract state '\" + state.name + \"'\");\n }\n var paramDefs = state.parameters();\n var values = this.params();\n var invalidParams = paramDefs.filter(function (param) { return !param.validates(values[param.id]); });\n if (invalidParams.length) {\n var invalidValues = invalidParams.map(function (param) { return \"[\" + param.id + \":\" + (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(values[param.id]) + \"]\"; }).join(', ');\n var detail = \"The following parameter values are not valid for state '\" + state.name + \"': \" + invalidValues;\n return _rejectFactory__WEBPACK_IMPORTED_MODULE_14__.Rejection.invalid(detail);\n }\n if (this.success === false)\n return this._error;\n };\n /**\n * A string representation of the Transition\n *\n * @returns A string representation of the Transition\n */\n Transition.prototype.toString = function () {\n var fromStateOrName = this.from();\n var toStateOrName = this.to();\n var avoidEmptyHash = function (params) {\n return params['#'] !== null && params['#'] !== undefined ? params : (0,_common_common__WEBPACK_IMPORTED_MODULE_3__.omit)(params, ['#']);\n };\n // (X) means the to state is invalid.\n var id = this.$id, from = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isObject)(fromStateOrName) ? fromStateOrName.name : fromStateOrName, fromParams = (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(avoidEmptyHash(this._treeChanges.from.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_5__.prop)('paramValues')).reduce(_common_common__WEBPACK_IMPORTED_MODULE_3__.mergeR, {}))), toValid = this.valid() ? '' : '(X) ', to = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_4__.isObject)(toStateOrName) ? toStateOrName.name : toStateOrName, toParams = (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.stringify)(avoidEmptyHash(this.params()));\n return \"Transition#\" + id + \"( '\" + from + \"'\" + fromParams + \" -> \" + toValid + \"'\" + to + \"'\" + toParams + \" )\";\n };\n /** @internal */\n Transition.diToken = Transition;\n return Transition;\n}());\n\n//# sourceMappingURL=transition.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/transition/transition.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js": /*!*******************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js ***! \*******************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TransitionEventType\": () => (/* binding */ TransitionEventType)\n/* harmony export */ });\n/* harmony import */ var _transitionHook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transitionHook */ \"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js\");\n\n/**\n * This class defines a type of hook, such as `onBefore` or `onEnter`.\n * Plugins can define custom hook types, such as sticky states does for `onInactive`.\n */\nvar TransitionEventType = /** @class */ (function () {\n /* tslint:disable:no-inferrable-types */\n function TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {\n if (reverseSort === void 0) { reverseSort = false; }\n if (getResultHandler === void 0) { getResultHandler = _transitionHook__WEBPACK_IMPORTED_MODULE_0__.TransitionHook.HANDLE_RESULT; }\n if (getErrorHandler === void 0) { getErrorHandler = _transitionHook__WEBPACK_IMPORTED_MODULE_0__.TransitionHook.REJECT_ERROR; }\n if (synchronous === void 0) { synchronous = false; }\n this.name = name;\n this.hookPhase = hookPhase;\n this.hookOrder = hookOrder;\n this.criteriaMatchPath = criteriaMatchPath;\n this.reverseSort = reverseSort;\n this.getResultHandler = getResultHandler;\n this.getErrorHandler = getErrorHandler;\n this.synchronous = synchronous;\n }\n return TransitionEventType;\n}());\n\n//# sourceMappingURL=transitionEventType.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js": /*!**************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TransitionHook\": () => (/* binding */ TransitionHook)\n/* harmony export */ });\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/transition/interface.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/strings */ \"./node_modules/@uirouter/core/lib-esm/common/strings.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/trace */ \"./node_modules/@uirouter/core/lib-esm/common/trace.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n/* harmony import */ var _rejectFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./rejectFactory */ \"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js\");\n/* harmony import */ var _state_targetState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../state/targetState */ \"./node_modules/@uirouter/core/lib-esm/state/targetState.js\");\n\n\n\n\n\n\n\n\n\nvar defaultOptions = {\n current: _common_common__WEBPACK_IMPORTED_MODULE_1__.noop,\n transition: null,\n traceData: {},\n bind: null,\n};\nvar TransitionHook = /** @class */ (function () {\n function TransitionHook(transition, stateContext, registeredHook, options) {\n var _this = this;\n this.transition = transition;\n this.stateContext = stateContext;\n this.registeredHook = registeredHook;\n this.options = options;\n this.isSuperseded = function () { return _this.type.hookPhase === _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookPhase.RUN && !_this.options.transition.isActive(); };\n this.options = (0,_common_common__WEBPACK_IMPORTED_MODULE_1__.defaults)(options, defaultOptions);\n this.type = registeredHook.eventType;\n }\n /**\n * Chains together an array of TransitionHooks.\n *\n * Given a list of [[TransitionHook]] objects, chains them together.\n * Each hook is invoked after the previous one completes.\n *\n * #### Example:\n * ```js\n * var hooks: TransitionHook[] = getHooks();\n * let promise: Promise = TransitionHook.chain(hooks);\n *\n * promise.then(handleSuccess, handleError);\n * ```\n *\n * @param hooks the list of hooks to chain together\n * @param waitFor if provided, the chain is `.then()`'ed off this promise\n * @returns a `Promise` for sequentially invoking the hooks (in order)\n */\n TransitionHook.chain = function (hooks, waitFor) {\n // Chain the next hook off the previous\n var createHookChainR = function (prev, nextHook) { return prev.then(function () { return nextHook.invokeHook(); }); };\n return hooks.reduce(createHookChainR, waitFor || _common_coreservices__WEBPACK_IMPORTED_MODULE_6__.services.$q.when());\n };\n /**\n * Invokes all the provided TransitionHooks, in order.\n * Each hook's return value is checked.\n * If any hook returns a promise, then the rest of the hooks are chained off that promise, and the promise is returned.\n * If no hook returns a promise, then all hooks are processed synchronously.\n *\n * @param hooks the list of TransitionHooks to invoke\n * @param doneCallback a callback that is invoked after all the hooks have successfully completed\n *\n * @returns a promise for the async result, or the result of the callback\n */\n TransitionHook.invokeHooks = function (hooks, doneCallback) {\n for (var idx = 0; idx < hooks.length; idx++) {\n var hookResult = hooks[idx].invokeHook();\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isPromise)(hookResult)) {\n var remainingHooks = hooks.slice(idx + 1);\n return TransitionHook.chain(remainingHooks, hookResult).then(doneCallback);\n }\n }\n return doneCallback();\n };\n /**\n * Run all TransitionHooks, ignoring their return value.\n */\n TransitionHook.runAllHooks = function (hooks) {\n hooks.forEach(function (hook) { return hook.invokeHook(); });\n };\n TransitionHook.prototype.logError = function (err) {\n this.transition.router.stateService.defaultErrorHandler()(err);\n };\n TransitionHook.prototype.invokeHook = function () {\n var _this = this;\n var hook = this.registeredHook;\n if (hook._deregistered)\n return;\n var notCurrent = this.getNotCurrentRejection();\n if (notCurrent)\n return notCurrent;\n var options = this.options;\n _common_trace__WEBPACK_IMPORTED_MODULE_5__.trace.traceHookInvocation(this, this.transition, options);\n var invokeCallback = function () { return hook.callback.call(options.bind, _this.transition, _this.stateContext); };\n var normalizeErr = function (err) { return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.normalize(err).toPromise(); };\n var handleError = function (err) { return hook.eventType.getErrorHandler(_this)(err); };\n var handleResult = function (result) { return hook.eventType.getResultHandler(_this)(result); };\n try {\n var result = invokeCallback();\n if (!this.type.synchronous && (0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result)) {\n return result.catch(normalizeErr).then(handleResult, handleError);\n }\n else {\n return handleResult(result);\n }\n }\n catch (err) {\n // If callback throws (synchronously)\n return handleError(_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.normalize(err));\n }\n finally {\n if (hook.invokeLimit && ++hook.invokeCount >= hook.invokeLimit) {\n hook.deregister();\n }\n }\n };\n /**\n * This method handles the return value of a Transition Hook.\n *\n * A hook can return false (cancel), a TargetState (redirect),\n * or a promise (which may later resolve to false or a redirect)\n *\n * This also handles \"transition superseded\" -- when a new transition\n * was started while the hook was still running\n */\n TransitionHook.prototype.handleHookResult = function (result) {\n var _this = this;\n var notCurrent = this.getNotCurrentRejection();\n if (notCurrent)\n return notCurrent;\n // Hook returned a promise\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result)) {\n // Wait for the promise, then reprocess with the resulting value\n return result.then(function (val) { return _this.handleHookResult(val); });\n }\n _common_trace__WEBPACK_IMPORTED_MODULE_5__.trace.traceHookResult(result, this.transition, this.options);\n // Hook returned false\n if (result === false) {\n // Abort this Transition\n return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.aborted('Hook aborted transition').toPromise();\n }\n var isTargetState = (0,_common_hof__WEBPACK_IMPORTED_MODULE_4__.is)(_state_targetState__WEBPACK_IMPORTED_MODULE_8__.TargetState);\n // hook returned a TargetState\n if (isTargetState(result)) {\n // Halt the current Transition and redirect (a new Transition) to the TargetState.\n return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.redirected(result).toPromise();\n }\n };\n /**\n * Return a Rejection promise if the transition is no longer current due\n * to a stopped router (disposed), or a new transition has started and superseded this one.\n */\n TransitionHook.prototype.getNotCurrentRejection = function () {\n var router = this.transition.router;\n // The router is stopped\n if (router._disposed) {\n return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.aborted(\"UIRouter instance #\" + router.$id + \" has been stopped (disposed)\").toPromise();\n }\n if (this.transition._aborted) {\n return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.aborted().toPromise();\n }\n // This transition is no longer current.\n // Another transition started while this hook was still running.\n if (this.isSuperseded()) {\n // Abort this transition\n return _rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.superseded(this.options.current()).toPromise();\n }\n };\n TransitionHook.prototype.toString = function () {\n var _a = this, options = _a.options, registeredHook = _a.registeredHook;\n var event = (0,_common_hof__WEBPACK_IMPORTED_MODULE_4__.parse)('traceData.hookType')(options) || 'internal', context = (0,_common_hof__WEBPACK_IMPORTED_MODULE_4__.parse)('traceData.context.state.name')(options) || (0,_common_hof__WEBPACK_IMPORTED_MODULE_4__.parse)('traceData.context')(options) || 'unknown', name = (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.fnToString)(registeredHook.callback);\n return event + \" context: \" + context + \", \" + (0,_common_strings__WEBPACK_IMPORTED_MODULE_2__.maxLength)(200, name);\n };\n /**\n * These GetResultHandler(s) are used by [[invokeHook]] below\n * Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])\n */\n TransitionHook.HANDLE_RESULT = function (hook) { return function (result) {\n return hook.handleHookResult(result);\n }; };\n /**\n * If the result is a promise rejection, log it.\n * Otherwise, ignore the result.\n */\n TransitionHook.LOG_REJECTED_RESULT = function (hook) { return function (result) {\n (0,_common_predicates__WEBPACK_IMPORTED_MODULE_3__.isPromise)(result) && result.catch(function (err) { return hook.logError(_rejectFactory__WEBPACK_IMPORTED_MODULE_7__.Rejection.normalize(err)); });\n return undefined;\n }; };\n /**\n * These GetErrorHandler(s) are used by [[invokeHook]] below\n * Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])\n */\n TransitionHook.LOG_ERROR = function (hook) { return function (error) { return hook.logError(error); }; };\n TransitionHook.REJECT_ERROR = function (hook) { return function (error) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_1__.silentRejection)(error); }; };\n TransitionHook.THROW_ERROR = function (hook) { return function (error) {\n throw error;\n }; };\n return TransitionHook;\n}());\n\n//# sourceMappingURL=transitionHook.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/transition/transitionService.js": /*!*****************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/transition/transitionService.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TransitionService\": () => (/* binding */ TransitionService),\n/* harmony export */ \"defaultTransOpts\": () => (/* binding */ defaultTransOpts)\n/* harmony export */ });\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/transition/interface.js\");\n/* harmony import */ var _transition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transition */ \"./node_modules/@uirouter/core/lib-esm/transition/transition.js\");\n/* harmony import */ var _hookRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hookRegistry */ \"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js\");\n/* harmony import */ var _hooks_coreResolvables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hooks/coreResolvables */ \"./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js\");\n/* harmony import */ var _hooks_redirectTo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../hooks/redirectTo */ \"./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js\");\n/* harmony import */ var _hooks_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../hooks/onEnterExitRetain */ \"./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js\");\n/* harmony import */ var _hooks_resolve__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../hooks/resolve */ \"./node_modules/@uirouter/core/lib-esm/hooks/resolve.js\");\n/* harmony import */ var _hooks_views__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../hooks/views */ \"./node_modules/@uirouter/core/lib-esm/hooks/views.js\");\n/* harmony import */ var _hooks_updateGlobals__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../hooks/updateGlobals */ \"./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js\");\n/* harmony import */ var _hooks_url__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../hooks/url */ \"./node_modules/@uirouter/core/lib-esm/hooks/url.js\");\n/* harmony import */ var _hooks_lazyLoad__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../hooks/lazyLoad */ \"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js\");\n/* harmony import */ var _transitionEventType__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./transitionEventType */ \"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js\");\n/* harmony import */ var _transitionHook__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./transitionHook */ \"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _hooks_ignoredTransition__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../hooks/ignoredTransition */ \"./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js\");\n/* harmony import */ var _hooks_invalidTransition__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../hooks/invalidTransition */ \"./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The default [[Transition]] options.\n *\n * Include this object when applying custom defaults:\n * let reloadOpts = { reload: true, notify: true }\n * let options = defaults(theirOpts, customDefaults, defaultOptions);\n */\nvar defaultTransOpts = {\n location: true,\n relative: null,\n inherit: false,\n notify: true,\n reload: false,\n supercede: true,\n custom: {},\n current: function () { return null; },\n source: 'unknown',\n};\n/**\n * This class provides services related to Transitions.\n *\n * - Most importantly, it allows global Transition Hooks to be registered.\n * - It allows the default transition error handler to be set.\n * - It also has a factory function for creating new [[Transition]] objects, (used internally by the [[StateService]]).\n *\n * At bootstrap, [[UIRouter]] creates a single instance (singleton) of this class.\n *\n * This API is located at `router.transitionService` ([[UIRouter.transitionService]])\n */\nvar TransitionService = /** @class */ (function () {\n /** @internal */\n function TransitionService(_router) {\n /** @internal */\n this._transitionCount = 0;\n /** The transition hook types, such as `onEnter`, `onStart`, etc */\n this._eventTypes = [];\n /** @internal The registered transition hooks */\n this._registeredHooks = {};\n /** The paths on a criteria object */\n this._criteriaPaths = {};\n this._router = _router;\n this.$view = _router.viewService;\n this._deregisterHookFns = {};\n this._pluginapi = ((0,_common_common__WEBPACK_IMPORTED_MODULE_14__.createProxyFunctions)((0,_common_hof__WEBPACK_IMPORTED_MODULE_15__.val)(this), {}, (0,_common_hof__WEBPACK_IMPORTED_MODULE_15__.val)(this), [\n '_definePathType',\n '_defineEvent',\n '_getPathTypes',\n '_getEvents',\n 'getHooks',\n ]));\n this._defineCorePaths();\n this._defineCoreEvents();\n this._registerCoreTransitionHooks();\n _router.globals.successfulTransitions.onEvict(_hooks_coreResolvables__WEBPACK_IMPORTED_MODULE_3__.treeChangesCleanup);\n }\n /**\n * Registers a [[TransitionHookFn]], called *while a transition is being constructed*.\n *\n * Registers a transition lifecycle hook, which is invoked during transition construction.\n *\n * This low level hook should only be used by plugins.\n * This can be a useful time for plugins to add resolves or mutate the transition as needed.\n * The Sticky States plugin uses this hook to modify the treechanges.\n *\n * ### Lifecycle\n *\n * `onCreate` hooks are invoked *while a transition is being constructed*.\n *\n * ### Return value\n *\n * The hook's return value is ignored\n *\n * @internal\n * @param criteria defines which Transitions the Hook should be invoked for.\n * @param callback the hook function which will be invoked.\n * @param options the registration options\n * @returns a function which deregisters the hook.\n */\n TransitionService.prototype.onCreate = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onBefore = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onStart = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onExit = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onRetain = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onEnter = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onFinish = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onSuccess = function (criteria, callback, options) {\n return;\n };\n /** @inheritdoc */\n TransitionService.prototype.onError = function (criteria, callback, options) {\n return;\n };\n /**\n * dispose\n * @internal\n */\n TransitionService.prototype.dispose = function (router) {\n (0,_common_common__WEBPACK_IMPORTED_MODULE_14__.values)(this._registeredHooks).forEach(function (hooksArray) {\n return hooksArray.forEach(function (hook) {\n hook._deregistered = true;\n (0,_common_common__WEBPACK_IMPORTED_MODULE_14__.removeFrom)(hooksArray, hook);\n });\n });\n };\n /**\n * Creates a new [[Transition]] object\n *\n * This is a factory function for creating new Transition objects.\n * It is used internally by the [[StateService]] and should generally not be called by application code.\n *\n * @internal\n * @param fromPath the path to the current state (the from state)\n * @param targetState the target state (destination)\n * @returns a Transition\n */\n TransitionService.prototype.create = function (fromPath, targetState) {\n return new _transition__WEBPACK_IMPORTED_MODULE_1__.Transition(fromPath, targetState, this._router);\n };\n /** @internal */\n TransitionService.prototype._defineCoreEvents = function () {\n var Phase = _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookPhase;\n var TH = _transitionHook__WEBPACK_IMPORTED_MODULE_12__.TransitionHook;\n var paths = this._criteriaPaths;\n var NORMAL_SORT = false, REVERSE_SORT = true;\n var SYNCHRONOUS = true;\n this._defineEvent('onCreate', Phase.CREATE, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.THROW_ERROR, SYNCHRONOUS);\n this._defineEvent('onBefore', Phase.BEFORE, 0, paths.to);\n this._defineEvent('onStart', Phase.RUN, 0, paths.to);\n this._defineEvent('onExit', Phase.RUN, 100, paths.exiting, REVERSE_SORT);\n this._defineEvent('onRetain', Phase.RUN, 200, paths.retained);\n this._defineEvent('onEnter', Phase.RUN, 300, paths.entering);\n this._defineEvent('onFinish', Phase.RUN, 400, paths.to);\n this._defineEvent('onSuccess', Phase.SUCCESS, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS);\n this._defineEvent('onError', Phase.ERROR, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS);\n };\n /** @internal */\n TransitionService.prototype._defineCorePaths = function () {\n var STATE = _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookScope.STATE, TRANSITION = _interface__WEBPACK_IMPORTED_MODULE_0__.TransitionHookScope.TRANSITION;\n this._definePathType('to', TRANSITION);\n this._definePathType('from', TRANSITION);\n this._definePathType('exiting', STATE);\n this._definePathType('retained', STATE);\n this._definePathType('entering', STATE);\n };\n /** @internal */\n TransitionService.prototype._defineEvent = function (name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {\n if (reverseSort === void 0) { reverseSort = false; }\n if (getResultHandler === void 0) { getResultHandler = _transitionHook__WEBPACK_IMPORTED_MODULE_12__.TransitionHook.HANDLE_RESULT; }\n if (getErrorHandler === void 0) { getErrorHandler = _transitionHook__WEBPACK_IMPORTED_MODULE_12__.TransitionHook.REJECT_ERROR; }\n if (synchronous === void 0) { synchronous = false; }\n var eventType = new _transitionEventType__WEBPACK_IMPORTED_MODULE_11__.TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous);\n this._eventTypes.push(eventType);\n (0,_hookRegistry__WEBPACK_IMPORTED_MODULE_2__.makeEvent)(this, this, eventType);\n };\n /** @internal */\n TransitionService.prototype._getEvents = function (phase) {\n var transitionHookTypes = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_13__.isDefined)(phase)\n ? this._eventTypes.filter(function (type) { return type.hookPhase === phase; })\n : this._eventTypes.slice();\n return transitionHookTypes.sort(function (l, r) {\n var cmpByPhase = l.hookPhase - r.hookPhase;\n return cmpByPhase === 0 ? l.hookOrder - r.hookOrder : cmpByPhase;\n });\n };\n /**\n * Adds a Path to be used as a criterion against a TreeChanges path\n *\n * For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path.\n * It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)`\n * Each state in the exiting path is checked against the criteria and returned as part of the match.\n *\n * Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path.\n * It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)`\n * Only the tail of the `to` path is checked against the criteria and returned as part of the match.\n *\n * @internal\n */\n TransitionService.prototype._definePathType = function (name, hookScope) {\n this._criteriaPaths[name] = { name: name, scope: hookScope };\n };\n /** @internal */\n // tslint:disable-next-line\n TransitionService.prototype._getPathTypes = function () {\n return this._criteriaPaths;\n };\n /** @internal */\n TransitionService.prototype.getHooks = function (hookName) {\n return this._registeredHooks[hookName];\n };\n /** @internal */\n TransitionService.prototype._registerCoreTransitionHooks = function () {\n var fns = this._deregisterHookFns;\n fns.addCoreResolves = (0,_hooks_coreResolvables__WEBPACK_IMPORTED_MODULE_3__.registerAddCoreResolvables)(this);\n fns.ignored = (0,_hooks_ignoredTransition__WEBPACK_IMPORTED_MODULE_16__.registerIgnoredTransitionHook)(this);\n fns.invalid = (0,_hooks_invalidTransition__WEBPACK_IMPORTED_MODULE_17__.registerInvalidTransitionHook)(this);\n // Wire up redirectTo hook\n fns.redirectTo = (0,_hooks_redirectTo__WEBPACK_IMPORTED_MODULE_4__.registerRedirectToHook)(this);\n // Wire up onExit/Retain/Enter state hooks\n fns.onExit = (0,_hooks_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.registerOnExitHook)(this);\n fns.onRetain = (0,_hooks_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.registerOnRetainHook)(this);\n fns.onEnter = (0,_hooks_onEnterExitRetain__WEBPACK_IMPORTED_MODULE_5__.registerOnEnterHook)(this);\n // Wire up Resolve hooks\n fns.eagerResolve = (0,_hooks_resolve__WEBPACK_IMPORTED_MODULE_6__.registerEagerResolvePath)(this);\n fns.lazyResolve = (0,_hooks_resolve__WEBPACK_IMPORTED_MODULE_6__.registerLazyResolveState)(this);\n fns.resolveAll = (0,_hooks_resolve__WEBPACK_IMPORTED_MODULE_6__.registerResolveRemaining)(this);\n // Wire up the View management hooks\n fns.loadViews = (0,_hooks_views__WEBPACK_IMPORTED_MODULE_7__.registerLoadEnteringViews)(this);\n fns.activateViews = (0,_hooks_views__WEBPACK_IMPORTED_MODULE_7__.registerActivateViews)(this);\n // Updates global state after a transition\n fns.updateGlobals = (0,_hooks_updateGlobals__WEBPACK_IMPORTED_MODULE_8__.registerUpdateGlobalState)(this);\n // After globals.current is updated at priority: 10000\n fns.updateUrl = (0,_hooks_url__WEBPACK_IMPORTED_MODULE_9__.registerUpdateUrl)(this);\n // Lazy load state trees\n fns.lazyLoad = (0,_hooks_lazyLoad__WEBPACK_IMPORTED_MODULE_10__.registerLazyLoadHook)(this);\n };\n return TransitionService;\n}());\n\n//# sourceMappingURL=transitionService.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/url/index.js": /*!**********************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/url/index.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BaseUrlRule\": () => (/* reexport safe */ _urlRule__WEBPACK_IMPORTED_MODULE_4__.BaseUrlRule),\n/* harmony export */ \"ParamFactory\": () => (/* reexport safe */ _urlMatcherFactory__WEBPACK_IMPORTED_MODULE_2__.ParamFactory),\n/* harmony export */ \"UrlConfig\": () => (/* reexport safe */ _urlConfig__WEBPACK_IMPORTED_MODULE_7__.UrlConfig),\n/* harmony export */ \"UrlMatcher\": () => (/* reexport safe */ _urlMatcher__WEBPACK_IMPORTED_MODULE_1__.UrlMatcher),\n/* harmony export */ \"UrlMatcherFactory\": () => (/* reexport safe */ _urlMatcherFactory__WEBPACK_IMPORTED_MODULE_2__.UrlMatcherFactory),\n/* harmony export */ \"UrlRouter\": () => (/* reexport safe */ _urlRouter__WEBPACK_IMPORTED_MODULE_3__.UrlRouter),\n/* harmony export */ \"UrlRuleFactory\": () => (/* reexport safe */ _urlRule__WEBPACK_IMPORTED_MODULE_4__.UrlRuleFactory),\n/* harmony export */ \"UrlRules\": () => (/* reexport safe */ _urlRules__WEBPACK_IMPORTED_MODULE_6__.UrlRules),\n/* harmony export */ \"UrlService\": () => (/* reexport safe */ _urlService__WEBPACK_IMPORTED_MODULE_5__.UrlService)\n/* harmony export */ });\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/url/interface.js\");\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if([\"default\",\"UrlRules\",\"UrlConfig\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _urlMatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./urlMatcher */ \"./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js\");\n/* harmony import */ var _urlMatcherFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./urlMatcherFactory */ \"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js\");\n/* harmony import */ var _urlRouter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./urlRouter */ \"./node_modules/@uirouter/core/lib-esm/url/urlRouter.js\");\n/* harmony import */ var _urlRule__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./urlRule */ \"./node_modules/@uirouter/core/lib-esm/url/urlRule.js\");\n/* harmony import */ var _urlService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./urlService */ \"./node_modules/@uirouter/core/lib-esm/url/urlService.js\");\n/* harmony import */ var _urlRules__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./urlRules */ \"./node_modules/@uirouter/core/lib-esm/url/urlRules.js\");\n/* harmony import */ var _urlConfig__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./urlConfig */ \"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js\");\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/url/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/url/interface.js": /*!**************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/url/interface.js ***! \**************************************************************/ /***/ (() => { eval("//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/url/interface.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/url/urlConfig.js": /*!**************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/url/urlConfig.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UrlConfig\": () => (/* binding */ UrlConfig)\n/* harmony export */ });\n/* harmony import */ var _params__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../params */ \"./node_modules/@uirouter/core/lib-esm/params/index.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n\n\n/**\n * An API to customize the URL behavior and retrieve URL configuration\n *\n * This API is used to customize the behavior of the URL.\n * This includes optional trailing slashes ([[strictMode]]), case sensitivity ([[caseInsensitive]]),\n * and custom parameter encoding (custom [[type]]).\n *\n * It also has information about the location (url) configuration such as [[port]] and [[baseHref]].\n * This information can be used to build absolute URLs, such as\n * `https://example.com:443/basepath/state/substate?param1=a#hashvalue`;\n *\n * This API is found at `router.urlService.config` (see: [[UIRouter.urlService]], [[URLService.config]])\n */\nvar UrlConfig = /** @class */ (function () {\n /** @internal */ function UrlConfig(/** @internal */ router) {\n var _this = this;\n this.router = router;\n /** @internal */ this.paramTypes = new _params__WEBPACK_IMPORTED_MODULE_0__.ParamTypes();\n /** @internal */ this._decodeParams = true;\n /** @internal */ this._isCaseInsensitive = false;\n /** @internal */ this._isStrictMode = true;\n /** @internal */ this._defaultSquashPolicy = false;\n /** @internal */ this.dispose = function () { return _this.paramTypes.dispose(); };\n // Delegate these calls to the current LocationConfig implementation\n /**\n * Gets the base Href, e.g., `http://localhost/approot/`\n *\n * @return the application's base href\n */\n this.baseHref = function () { return _this.router.locationConfig.baseHref(); };\n /**\n * Gets or sets the hashPrefix\n *\n * This only applies when not running in [[html5Mode]] (pushstate mode)\n *\n * If the current url is `http://localhost/app#!/uirouter/path/#anchor`, it returns `!` which is the prefix for the \"hashbang\" portion.\n *\n * @return the hash prefix\n */\n this.hashPrefix = function (newprefix) { return _this.router.locationConfig.hashPrefix(newprefix); };\n /**\n * Gets the host, e.g., `localhost`\n *\n * @return the protocol\n */\n this.host = function () { return _this.router.locationConfig.host(); };\n /**\n * Returns true when running in pushstate mode\n *\n * @return true when running in html5 mode (pushstate mode).\n */\n this.html5Mode = function () { return _this.router.locationConfig.html5Mode(); };\n /**\n * Gets the port, e.g., `80`\n *\n * @return the port number\n */\n this.port = function () { return _this.router.locationConfig.port(); };\n /**\n * Gets the protocol, e.g., `http`\n *\n * @return the protocol\n */\n this.protocol = function () { return _this.router.locationConfig.protocol(); };\n }\n /**\n * Defines whether URL matching should be case sensitive (the default behavior), or not.\n *\n * #### Example:\n * ```js\n * // Allow case insensitive url matches\n * urlService.config.caseInsensitive(true);\n * ```\n *\n * @param value `false` to match URL in a case sensitive manner; otherwise `true`;\n * @returns the current value of caseInsensitive\n */\n UrlConfig.prototype.caseInsensitive = function (value) {\n return (this._isCaseInsensitive = (0,_common__WEBPACK_IMPORTED_MODULE_1__.isDefined)(value) ? value : this._isCaseInsensitive);\n };\n /**\n * Sets the default behavior when generating or matching URLs with default parameter values.\n *\n * #### Example:\n * ```js\n * // Remove default parameter values from the url\n * urlService.config.defaultSquashPolicy(true);\n * ```\n *\n * @param value A string that defines the default parameter URL squashing behavior.\n * - `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL\n * - `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the\n * parameter is surrounded by slashes, squash (remove) one slash from the URL\n * - any other string, e.g. \"~\": When generating an href with a default parameter value, squash (remove)\n * the parameter value from the URL and replace it with this string.\n * @returns the current value of defaultSquashPolicy\n */\n UrlConfig.prototype.defaultSquashPolicy = function (value) {\n if ((0,_common__WEBPACK_IMPORTED_MODULE_1__.isDefined)(value) && value !== true && value !== false && !(0,_common__WEBPACK_IMPORTED_MODULE_1__.isString)(value))\n throw new Error(\"Invalid squash policy: \" + value + \". Valid policies: false, true, arbitrary-string\");\n return (this._defaultSquashPolicy = (0,_common__WEBPACK_IMPORTED_MODULE_1__.isDefined)(value) ? value : this._defaultSquashPolicy);\n };\n /**\n * Defines whether URLs should match trailing slashes, or not (the default behavior).\n *\n * #### Example:\n * ```js\n * // Allow optional trailing slashes\n * urlService.config.strictMode(false);\n * ```\n *\n * @param value `false` to match trailing slashes in URLs, otherwise `true`.\n * @returns the current value of strictMode\n */\n UrlConfig.prototype.strictMode = function (value) {\n return (this._isStrictMode = (0,_common__WEBPACK_IMPORTED_MODULE_1__.isDefined)(value) ? value : this._isStrictMode);\n };\n /**\n * Creates and registers a custom [[ParamType]] object\n *\n * A custom parameter type can be used to generate URLs with typed parameters or custom encoding/decoding.\n *\n * #### Note: Register custom types *before using them* in a state definition.\n *\n * #### Example:\n * ```js\n * // Encode object parameter as JSON string\n * urlService.config.type('myjson', {\n * encode: (obj) => JSON.stringify(obj),\n * decode: (str) => JSON.parse(str),\n * is: (val) => typeof(val) === 'object',\n * pattern: /[^/]+/,\n * equals: (a, b) => _.isEqual(a, b),\n * });\n * ```\n *\n * See [[ParamTypeDefinition]] for more examples\n *\n * @param name The type name.\n * @param definition The type definition. See [[ParamTypeDefinition]] for information on the values accepted.\n * @param definitionFn A function that is injected before the app runtime starts.\n * The result of this function should be a [[ParamTypeDefinition]].\n * The result is merged into the existing `definition`.\n * See [[ParamType]] for information on the values accepted.\n *\n * @returns if only the `name` parameter was specified: the currently registered [[ParamType]] object, or undefined\n */\n UrlConfig.prototype.type = function (name, definition, definitionFn) {\n var type = this.paramTypes.type(name, definition, definitionFn);\n return !(0,_common__WEBPACK_IMPORTED_MODULE_1__.isDefined)(definition) ? type : this;\n };\n return UrlConfig;\n}());\n\n//# sourceMappingURL=urlConfig.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js": /*!***************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UrlMatcher\": () => (/* binding */ UrlMatcher)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _params_param__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../params/param */ \"./node_modules/@uirouter/core/lib-esm/params/param.js\");\n/* harmony import */ var _common_strings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/strings */ \"./node_modules/@uirouter/core/lib-esm/common/strings.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n\n\n\n\n\n\nfunction quoteRegExp(str, param) {\n var surroundPattern = ['', ''], result = str.replace(/[\\\\\\[\\]\\^$*+?.()|{}]/g, '\\\\$&');\n if (!param)\n return result;\n switch (param.squash) {\n case false:\n surroundPattern = ['(', ')' + (param.isOptional ? '?' : '')];\n break;\n case true:\n result = result.replace(/\\/$/, '');\n surroundPattern = ['(?:/(', ')|/)?'];\n break;\n default:\n surroundPattern = [\"(\" + param.squash + \"|\", ')?'];\n break;\n }\n return result + surroundPattern[0] + param.type.pattern.source + surroundPattern[1];\n}\nvar memoizeTo = function (obj, _prop, fn) { return (obj[_prop] = obj[_prop] || fn()); };\nvar splitOnSlash = (0,_common_strings__WEBPACK_IMPORTED_MODULE_4__.splitOnDelim)('/');\nvar defaultConfig = {\n state: { params: {} },\n strict: true,\n caseInsensitive: true,\n decodeParams: true,\n};\n/**\n * Matches URLs against patterns.\n *\n * Matches URLs against patterns and extracts named parameters from the path or the search\n * part of the URL.\n *\n * A URL pattern consists of a path pattern, optionally followed by '?' and a list of search (query)\n * parameters. Multiple search parameter names are separated by '&'. Search parameters\n * do not influence whether or not a URL is matched, but their values are passed through into\n * the matched parameters returned by [[UrlMatcher.exec]].\n *\n * - *Path parameters* are defined using curly brace placeholders (`/somepath/{param}`)\n * or colon placeholders (`/somePath/:param`).\n *\n * - *A parameter RegExp* may be defined for a param after a colon\n * (`/somePath/{param:[a-zA-Z0-9]+}`) in a curly brace placeholder.\n * The regexp must match for the url to be matched.\n * Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.\n *\n * Note: a RegExp parameter will encode its value using either [[ParamTypes.path]] or [[ParamTypes.query]].\n *\n * - *Custom parameter types* may also be specified after a colon (`/somePath/{param:int}`) in curly brace parameters.\n * See [[UrlMatcherFactory.type]] for more information.\n *\n * - *Catch-all parameters* are defined using an asterisk placeholder (`/somepath/*catchallparam`).\n * A catch-all * parameter value will contain the remainder of the URL.\n *\n * ---\n *\n * Parameter names may contain only word characters (latin letters, digits, and underscore) and\n * must be unique within the pattern (across both path and search parameters).\n * A path parameter matches any number of characters other than '/'. For catch-all\n * placeholders the path parameter matches any number of characters.\n *\n * Examples:\n *\n * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for\n * trailing slashes, and patterns have to match the entire path, not just a prefix.\n * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or\n * '/user/bob/details'. The second path segment will be captured as the parameter 'id'.\n * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.\n * * `'/user/{id:[^/]*}'` - Same as the previous example.\n * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id\n * parameter consists of 1 to 8 hex digits.\n * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the\n * path into the parameter 'path'.\n * * `'/files/*path'` - ditto.\n * * `'/calendar/{start:date}'` - Matches \"/calendar/2014-11-12\" (because the pattern defined\n * in the built-in `date` ParamType matches `2014-11-12`) and provides a Date object in $stateParams.start\n *\n */\nvar UrlMatcher = /** @class */ (function () {\n /**\n * @param pattern The pattern to compile into a matcher.\n * @param paramTypes The [[ParamTypes]] registry\n * @param paramFactory A [[ParamFactory]] object\n * @param config A [[UrlMatcherCompileConfig]] configuration object\n */\n function UrlMatcher(pattern, paramTypes, paramFactory, config) {\n var _this = this;\n /** @internal */\n this._cache = { path: [this] };\n /** @internal */\n this._children = [];\n /** @internal */\n this._params = [];\n /** @internal */\n this._segments = [];\n /** @internal */\n this._compiled = [];\n this.config = config = (0,_common__WEBPACK_IMPORTED_MODULE_5__.defaults)(config, defaultConfig);\n this.pattern = pattern;\n // Find all placeholders and create a compiled pattern, using either classic or curly syntax:\n // '*' name\n // ':' name\n // '{' name '}'\n // '{' name ':' regexp '}'\n // The regular expression is somewhat complicated due to the need to allow curly braces\n // inside the regular expression. The placeholder regexp breaks down as follows:\n // ([:*])([\\w\\[\\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case)\n // \\{([\\w\\[\\]]+)(?:\\:\\s*( ... ))?\\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case\n // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either\n // [^{}\\\\]+ - anything other than curly braces or backslash\n // \\\\. - a backslash escape\n // \\{(?:[^{}\\\\]+|\\\\.)*\\} - a matched set of curly braces containing other atoms\n var placeholder = /([:*])([\\w\\[\\]]+)|\\{([\\w\\[\\]]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g;\n var searchPlaceholder = /([:]?)([\\w\\[\\].-]+)|\\{([\\w\\[\\].-]+)(?:\\:\\s*((?:[^{}\\\\]+|\\\\.|\\{(?:[^{}\\\\]+|\\\\.)*\\})+))?\\}/g;\n var patterns = [];\n var last = 0;\n var matchArray;\n var checkParamErrors = function (id) {\n if (!UrlMatcher.nameValidator.test(id))\n throw new Error(\"Invalid parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n if ((0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(_this._params, (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.propEq)('id', id)))\n throw new Error(\"Duplicate parameter name '\" + id + \"' in pattern '\" + pattern + \"'\");\n };\n // Split into static segments separated by path parameter placeholders.\n // The number of segments is always 1 more than the number of parameters.\n var matchDetails = function (m, isSearch) {\n // IE[78] returns '' for unmatched groups instead of null\n var id = m[2] || m[3];\n var regexp = isSearch ? m[4] : m[4] || (m[1] === '*' ? '[\\\\s\\\\S]*' : null);\n var makeRegexpType = function (str) {\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inherit)(paramTypes.type(isSearch ? 'query' : 'path'), {\n pattern: new RegExp(str, _this.config.caseInsensitive ? 'i' : undefined),\n });\n };\n return {\n id: id,\n regexp: regexp,\n segment: pattern.substring(last, m.index),\n type: !regexp ? null : paramTypes.type(regexp) || makeRegexpType(regexp),\n };\n };\n var details;\n var segment;\n // tslint:disable-next-line:no-conditional-assignment\n while ((matchArray = placeholder.exec(pattern))) {\n details = matchDetails(matchArray, false);\n if (details.segment.indexOf('?') >= 0)\n break; // we're into the search part\n checkParamErrors(details.id);\n this._params.push(paramFactory.fromPath(details.id, details.type, config.state));\n this._segments.push(details.segment);\n patterns.push([details.segment, (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.tail)(this._params)]);\n last = placeholder.lastIndex;\n }\n segment = pattern.substring(last);\n // Find any search parameter names and remove them from the last segment\n var i = segment.indexOf('?');\n if (i >= 0) {\n var search = segment.substring(i);\n segment = segment.substring(0, i);\n if (search.length > 0) {\n last = 0;\n // tslint:disable-next-line:no-conditional-assignment\n while ((matchArray = searchPlaceholder.exec(search))) {\n details = matchDetails(matchArray, true);\n checkParamErrors(details.id);\n this._params.push(paramFactory.fromSearch(details.id, details.type, config.state));\n last = placeholder.lastIndex;\n // check if ?&\n }\n }\n }\n this._segments.push(segment);\n this._compiled = patterns.map(function (_pattern) { return quoteRegExp.apply(null, _pattern); }).concat(quoteRegExp(segment));\n }\n /** @internal */\n UrlMatcher.encodeDashes = function (str) {\n // Replace dashes with encoded \"\\-\"\n return encodeURIComponent(str).replace(/-/g, function (c) { return \"%5C%\" + c.charCodeAt(0).toString(16).toUpperCase(); });\n };\n /** @internal Given a matcher, return an array with the matcher's path segments and path params, in order */\n UrlMatcher.pathSegmentsAndParams = function (matcher) {\n var staticSegments = matcher._segments;\n var pathParams = matcher._params.filter(function (p) { return p.location === _params_param__WEBPACK_IMPORTED_MODULE_3__.DefType.PATH; });\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.arrayTuples)(staticSegments, pathParams.concat(undefined))\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])\n .filter(function (x) { return x !== '' && (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(x); });\n };\n /** @internal Given a matcher, return an array with the matcher's query params */\n UrlMatcher.queryParams = function (matcher) {\n return matcher._params.filter(function (p) { return p.location === _params_param__WEBPACK_IMPORTED_MODULE_3__.DefType.SEARCH; });\n };\n /**\n * Compare two UrlMatchers\n *\n * This comparison function converts a UrlMatcher into static and dynamic path segments.\n * Each static path segment is a static string between a path separator (slash character).\n * Each dynamic segment is a path parameter.\n *\n * The comparison function sorts static segments before dynamic ones.\n */\n UrlMatcher.compare = function (a, b) {\n /**\n * Turn a UrlMatcher and all its parent matchers into an array\n * of slash literals '/', string literals, and Param objects\n *\n * This example matcher matches strings like \"/foo/:param/tail\":\n * var matcher = $umf.compile(\"/foo\").append($umf.compile(\"/:param\")).append($umf.compile(\"/\")).append($umf.compile(\"tail\"));\n * var result = segments(matcher); // [ '/', 'foo', '/', Param, '/', 'tail' ]\n *\n * Caches the result as `matcher._cache.segments`\n */\n var segments = function (matcher) {\n return (matcher._cache.segments =\n matcher._cache.segments ||\n matcher._cache.path\n .map(UrlMatcher.pathSegmentsAndParams)\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])\n .reduce(_common_strings__WEBPACK_IMPORTED_MODULE_4__.joinNeighborsR, [])\n .map(function (x) { return ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(x) ? splitOnSlash(x) : x); })\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, []));\n };\n /**\n * Gets the sort weight for each segment of a UrlMatcher\n *\n * Caches the result as `matcher._cache.weights`\n */\n var weights = function (matcher) {\n return (matcher._cache.weights =\n matcher._cache.weights ||\n segments(matcher).map(function (segment) {\n // Sort slashes first, then static strings, the Params\n if (segment === '/')\n return 1;\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(segment))\n return 2;\n if (segment instanceof _params_param__WEBPACK_IMPORTED_MODULE_3__.Param)\n return 3;\n }));\n };\n /**\n * Pads shorter array in-place (mutates)\n */\n var padArrays = function (l, r, padVal) {\n var len = Math.max(l.length, r.length);\n while (l.length < len)\n l.push(padVal);\n while (r.length < len)\n r.push(padVal);\n };\n var weightsA = weights(a), weightsB = weights(b);\n padArrays(weightsA, weightsB, 0);\n var _pairs = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.arrayTuples)(weightsA, weightsB);\n var cmp, i;\n for (i = 0; i < _pairs.length; i++) {\n cmp = _pairs[i][0] - _pairs[i][1];\n if (cmp !== 0)\n return cmp;\n }\n return 0;\n };\n /**\n * Creates a new concatenated UrlMatcher\n *\n * Builds a new UrlMatcher by appending another UrlMatcher to this one.\n *\n * @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`.\n */\n UrlMatcher.prototype.append = function (url) {\n this._children.push(url);\n url._cache = {\n path: this._cache.path.concat(url),\n parent: this,\n pattern: null,\n };\n return url;\n };\n /** @internal */\n UrlMatcher.prototype.isRoot = function () {\n return this._cache.path[0] === this;\n };\n /** Returns the input pattern string */\n UrlMatcher.prototype.toString = function () {\n return this.pattern;\n };\n UrlMatcher.prototype._getDecodedParamValue = function (value, param) {\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isDefined)(value)) {\n if (this.config.decodeParams && !param.type.raw) {\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isArray)(value)) {\n value = value.map(function (paramValue) { return decodeURIComponent(paramValue); });\n }\n else {\n value = decodeURIComponent(value);\n }\n }\n value = param.type.decode(value);\n }\n return param.value(value);\n };\n /**\n * Tests the specified url/path against this matcher.\n *\n * Tests if the given url matches this matcher's pattern, and returns an object containing the captured\n * parameter values. Returns null if the path does not match.\n *\n * The returned object contains the values\n * of any search parameters that are mentioned in the pattern, but their value may be null if\n * they are not present in `search`. This means that search parameters are always treated\n * as optional.\n *\n * #### Example:\n * ```js\n * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {\n * x: '1', q: 'hello'\n * });\n * // returns { id: 'bob', q: 'hello', r: null }\n * ```\n *\n * @param path The URL path to match, e.g. `$location.path()`.\n * @param search URL search parameters, e.g. `$location.search()`.\n * @param hash URL hash e.g. `$location.hash()`.\n * @param options\n *\n * @returns The captured parameter values.\n */\n UrlMatcher.prototype.exec = function (path, search, hash, options) {\n var _this = this;\n if (search === void 0) { search = {}; }\n if (options === void 0) { options = {}; }\n var match = memoizeTo(this._cache, 'pattern', function () {\n return new RegExp([\n '^',\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.unnest)(_this._cache.path.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('_compiled'))).join(''),\n _this.config.strict === false ? '/?' : '',\n '$',\n ].join(''), _this.config.caseInsensitive ? 'i' : undefined);\n }).exec(path);\n if (!match)\n return null;\n // options = defaults(options, { isolate: false });\n var allParams = this.parameters(), pathParams = allParams.filter(function (param) { return !param.isSearch(); }), searchParams = allParams.filter(function (param) { return param.isSearch(); }), nPathSegments = this._cache.path.map(function (urlm) { return urlm._segments.length - 1; }).reduce(function (a, x) { return a + x; }), values = {};\n if (nPathSegments !== match.length - 1)\n throw new Error(\"Unbalanced capture group in route '\" + this.pattern + \"'\");\n function decodePathArray(paramVal) {\n var reverseString = function (str) { return str.split('').reverse().join(''); };\n var unquoteDashes = function (str) { return str.replace(/\\\\-/g, '-'); };\n var split = reverseString(paramVal).split(/-(?!\\\\)/);\n var allReversed = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(split, reverseString);\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(allReversed, unquoteDashes).reverse();\n }\n for (var i = 0; i < nPathSegments; i++) {\n var param = pathParams[i];\n var value = match[i + 1];\n // if the param value matches a pre-replace pair, replace the value before decoding.\n for (var j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === value)\n value = param.replace[j].to;\n }\n if (value && param.array === true)\n value = decodePathArray(value);\n values[param.id] = this._getDecodedParamValue(value, param);\n }\n searchParams.forEach(function (param) {\n var value = search[param.id];\n for (var j = 0; j < param.replace.length; j++) {\n if (param.replace[j].from === value)\n value = param.replace[j].to;\n }\n values[param.id] = _this._getDecodedParamValue(value, param);\n });\n if (hash)\n values['#'] = hash;\n return values;\n };\n /**\n * @internal\n * Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance.\n *\n * @returns {Array.} An array of [[Param]] objects. Must be treated as read-only. If the\n * pattern has no parameters, an empty array is returned.\n */\n UrlMatcher.prototype.parameters = function (opts) {\n if (opts === void 0) { opts = {}; }\n if (opts.inherit === false)\n return this._params;\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.unnest)(this._cache.path.map(function (matcher) { return matcher._params; }));\n };\n /**\n * @internal\n * Returns a single parameter from this UrlMatcher by id\n *\n * @param id\n * @param opts\n * @returns {T|Param|any|boolean|UrlMatcher|null}\n */\n UrlMatcher.prototype.parameter = function (id, opts) {\n var _this = this;\n if (opts === void 0) { opts = {}; }\n var findParam = function () {\n for (var _i = 0, _a = _this._params; _i < _a.length; _i++) {\n var param = _a[_i];\n if (param.id === id)\n return param;\n }\n };\n var parent = this._cache.parent;\n return findParam() || (opts.inherit !== false && parent && parent.parameter(id, opts)) || null;\n };\n /**\n * Validates the input parameter values against this UrlMatcher\n *\n * Checks an object hash of parameters to validate their correctness according to the parameter\n * types of this `UrlMatcher`.\n *\n * @param params The object hash of parameters to validate.\n * @returns Returns `true` if `params` validates, otherwise `false`.\n */\n UrlMatcher.prototype.validates = function (params) {\n var validParamVal = function (param, val) { return !param || param.validates(val); };\n params = params || {};\n // I'm not sure why this checks only the param keys passed in, and not all the params known to the matcher\n var paramSchema = this.parameters().filter(function (paramDef) { return params.hasOwnProperty(paramDef.id); });\n return paramSchema.map(function (paramDef) { return validParamVal(paramDef, params[paramDef.id]); }).reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.allTrueR, true);\n };\n /**\n * Given a set of parameter values, creates a URL from this UrlMatcher.\n *\n * Creates a URL that matches this pattern by substituting the specified values\n * for the path and search parameters.\n *\n * #### Example:\n * ```js\n * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });\n * // returns '/user/bob?q=yes'\n * ```\n *\n * @param values the values to substitute for the parameters in this pattern.\n * @returns the formatted URL (path and optionally search part).\n */\n UrlMatcher.prototype.format = function (values) {\n if (values === void 0) { values = {}; }\n // Build the full path of UrlMatchers (including all parent UrlMatchers)\n var urlMatchers = this._cache.path;\n // Extract all the static segments and Params (processed as ParamDetails)\n // into an ordered array\n var pathSegmentsAndParams = urlMatchers\n .map(UrlMatcher.pathSegmentsAndParams)\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])\n .map(function (x) { return ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(x) ? x : getDetails(x)); });\n // Extract the query params into a separate array\n var queryParams = urlMatchers\n .map(UrlMatcher.queryParams)\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])\n .map(getDetails);\n var isInvalid = function (param) { return param.isValid === false; };\n if (pathSegmentsAndParams.concat(queryParams).filter(isInvalid).length) {\n return null;\n }\n /**\n * Given a Param, applies the parameter value, then returns detailed information about it\n */\n function getDetails(param) {\n // Normalize to typed value\n var value = param.value(values[param.id]);\n var isValid = param.validates(value);\n var isDefaultValue = param.isDefaultValue(value);\n // Check if we're in squash mode for the parameter\n var squash = isDefaultValue ? param.squash : false;\n // Allow the Parameter's Type to encode the value\n var encoded = param.type.encode(value);\n return { param: param, value: value, isValid: isValid, isDefaultValue: isDefaultValue, squash: squash, encoded: encoded };\n }\n // Build up the path-portion from the list of static segments and parameters\n var pathString = pathSegmentsAndParams.reduce(function (acc, x) {\n // The element is a static segment (a raw string); just append it\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(x))\n return acc + x;\n // Otherwise, it's a ParamDetails.\n var squash = x.squash, encoded = x.encoded, param = x.param;\n // If squash is === true, try to remove a slash from the path\n if (squash === true)\n return acc.match(/\\/$/) ? acc.slice(0, -1) : acc;\n // If squash is a string, use the string for the param value\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(squash))\n return acc + squash;\n if (squash !== false)\n return acc; // ?\n if (encoded == null)\n return acc;\n // If this parameter value is an array, encode the value using encodeDashes\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isArray)(encoded))\n return acc + (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(encoded, UrlMatcher.encodeDashes).join('-');\n // If the parameter type is \"raw\", then do not encodeURIComponent\n if (param.raw)\n return acc + encoded;\n // Encode the value\n return acc + encodeURIComponent(encoded);\n }, '');\n // Build the query string by applying parameter values (array or regular)\n // then mapping to key=value, then flattening and joining using \"&\"\n var queryString = queryParams\n .map(function (paramDetails) {\n var param = paramDetails.param, squash = paramDetails.squash, encoded = paramDetails.encoded, isDefaultValue = paramDetails.isDefaultValue;\n if (encoded == null || (isDefaultValue && squash !== false))\n return;\n if (!(0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isArray)(encoded))\n encoded = [encoded];\n if (encoded.length === 0)\n return;\n if (!param.raw)\n encoded = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.map)(encoded, encodeURIComponent);\n return encoded.map(function (val) { return param.id + \"=\" + val; });\n })\n .filter(_common_common__WEBPACK_IMPORTED_MODULE_0__.identity)\n .reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])\n .join('&');\n // Concat the pathstring with the queryString (if exists) and the hashString (if exists)\n return pathString + (queryString ? \"?\" + queryString : '') + (values['#'] ? '#' + values['#'] : '');\n };\n /** @internal */\n UrlMatcher.nameValidator = /^\\w+([-.]+\\w+)*(?:\\[\\])?$/;\n return UrlMatcher;\n}());\n\n//# sourceMappingURL=urlMatcher.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js": /*!**********************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ParamFactory\": () => (/* binding */ ParamFactory),\n/* harmony export */ \"UrlMatcherFactory\": () => (/* binding */ UrlMatcherFactory)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n/* harmony import */ var _urlMatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./urlMatcher */ \"./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js\");\n/* harmony import */ var _params__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../params */ \"./node_modules/@uirouter/core/lib-esm/params/index.js\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\n\nvar ParamFactory = /** @class */ (function () {\n function ParamFactory(router) {\n this.router = router;\n }\n ParamFactory.prototype.fromConfig = function (id, type, state) {\n return new _params__WEBPACK_IMPORTED_MODULE_2__.Param(id, type, _params__WEBPACK_IMPORTED_MODULE_2__.DefType.CONFIG, this.router.urlService.config, state);\n };\n ParamFactory.prototype.fromPath = function (id, type, state) {\n return new _params__WEBPACK_IMPORTED_MODULE_2__.Param(id, type, _params__WEBPACK_IMPORTED_MODULE_2__.DefType.PATH, this.router.urlService.config, state);\n };\n ParamFactory.prototype.fromSearch = function (id, type, state) {\n return new _params__WEBPACK_IMPORTED_MODULE_2__.Param(id, type, _params__WEBPACK_IMPORTED_MODULE_2__.DefType.SEARCH, this.router.urlService.config, state);\n };\n return ParamFactory;\n}());\n\n/**\n * Factory for [[UrlMatcher]] instances.\n *\n * The factory is available to ng1 services as\n * `$urlMatcherFactory` or ng1 providers as `$urlMatcherFactoryProvider`.\n */\nvar UrlMatcherFactory = /** @class */ (function () {\n // TODO: move implementations to UrlConfig (urlService.config)\n function UrlMatcherFactory(/** @internal */ router) {\n var _this = this;\n this.router = router;\n /** Creates a new [[Param]] for a given location (DefType) */\n this.paramFactory = new ParamFactory(this.router);\n // TODO: Check if removal of this will break anything, then remove these\n this.UrlMatcher = _urlMatcher__WEBPACK_IMPORTED_MODULE_1__.UrlMatcher;\n this.Param = _params__WEBPACK_IMPORTED_MODULE_2__.Param;\n /** @deprecated use [[UrlConfig.caseInsensitive]] */\n this.caseInsensitive = function (value) { return _this.router.urlService.config.caseInsensitive(value); };\n /** @deprecated use [[UrlConfig.defaultSquashPolicy]] */\n this.defaultSquashPolicy = function (value) { return _this.router.urlService.config.defaultSquashPolicy(value); };\n /** @deprecated use [[UrlConfig.strictMode]] */\n this.strictMode = function (value) { return _this.router.urlService.config.strictMode(value); };\n /** @deprecated use [[UrlConfig.type]] */\n this.type = function (name, definition, definitionFn) {\n return _this.router.urlService.config.type(name, definition, definitionFn) || _this;\n };\n }\n /**\n * Creates a [[UrlMatcher]] for the specified pattern.\n *\n * @param pattern The URL pattern.\n * @param config The config object hash.\n * @returns The UrlMatcher.\n */\n UrlMatcherFactory.prototype.compile = function (pattern, config) {\n var urlConfig = this.router.urlService.config;\n // backward-compatible support for config.params -> config.state.params\n var params = config && !config.state && config.params;\n config = params ? __assign({ state: { params: params } }, config) : config;\n var globalConfig = {\n strict: urlConfig._isStrictMode,\n caseInsensitive: urlConfig._isCaseInsensitive,\n decodeParams: urlConfig._decodeParams,\n };\n return new _urlMatcher__WEBPACK_IMPORTED_MODULE_1__.UrlMatcher(pattern, urlConfig.paramTypes, this.paramFactory, (0,_common__WEBPACK_IMPORTED_MODULE_0__.extend)(globalConfig, config));\n };\n /**\n * Returns true if the specified object is a [[UrlMatcher]], or false otherwise.\n *\n * @param object The object to perform the type check against.\n * @returns `true` if the object matches the `UrlMatcher` interface, by\n * implementing all the same methods.\n */\n UrlMatcherFactory.prototype.isMatcher = function (object) {\n // TODO: typeof?\n if (!(0,_common__WEBPACK_IMPORTED_MODULE_0__.isObject)(object))\n return false;\n var result = true;\n (0,_common__WEBPACK_IMPORTED_MODULE_0__.forEach)(_urlMatcher__WEBPACK_IMPORTED_MODULE_1__.UrlMatcher.prototype, function (val, name) {\n if ((0,_common__WEBPACK_IMPORTED_MODULE_0__.isFunction)(val))\n result = result && (0,_common__WEBPACK_IMPORTED_MODULE_0__.isDefined)(object[name]) && (0,_common__WEBPACK_IMPORTED_MODULE_0__.isFunction)(object[name]);\n });\n return result;\n };\n /** @internal */\n UrlMatcherFactory.prototype.$get = function () {\n var urlConfig = this.router.urlService.config;\n urlConfig.paramTypes.enqueue = false;\n urlConfig.paramTypes._flushTypeQueue();\n return this;\n };\n return UrlMatcherFactory;\n}());\n\n//# sourceMappingURL=urlMatcherFactory.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/url/urlRouter.js": /*!**************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/url/urlRouter.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UrlRouter\": () => (/* binding */ UrlRouter)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n/* harmony import */ var _urlRule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./urlRule */ \"./node_modules/@uirouter/core/lib-esm/url/urlRule.js\");\n\n\nfunction appendBasePath(url, isHtml5, absolute, baseHref) {\n if (baseHref === '/')\n return url;\n if (isHtml5)\n return (0,_common__WEBPACK_IMPORTED_MODULE_0__.stripLastPathElement)(baseHref) + url;\n if (absolute)\n return baseHref.slice(1) + url;\n return url;\n}\n/**\n * Updates URL and responds to URL changes\n *\n * ### Deprecation warning:\n * This class is now considered to be an internal API\n * Use the [[UrlService]] instead.\n * For configuring URL rules, use the [[UrlRules]] which can be found as [[UrlService.rules]].\n */\nvar UrlRouter = /** @class */ (function () {\n /** @internal */\n function UrlRouter(/** @internal */ router) {\n var _this = this;\n this.router = router;\n // Delegate these calls to [[UrlService]]\n /** @deprecated use [[UrlService.sync]]*/\n this.sync = function (evt) { return _this.router.urlService.sync(evt); };\n /** @deprecated use [[UrlService.listen]]*/\n this.listen = function (enabled) { return _this.router.urlService.listen(enabled); };\n /** @deprecated use [[UrlService.deferIntercept]]*/\n this.deferIntercept = function (defer) { return _this.router.urlService.deferIntercept(defer); };\n /** @deprecated use [[UrlService.match]]*/\n this.match = function (urlParts) { return _this.router.urlService.match(urlParts); };\n // Delegate these calls to [[UrlRules]]\n /** @deprecated use [[UrlRules.initial]]*/\n this.initial = function (handler) {\n return _this.router.urlService.rules.initial(handler);\n };\n /** @deprecated use [[UrlRules.otherwise]]*/\n this.otherwise = function (handler) {\n return _this.router.urlService.rules.otherwise(handler);\n };\n /** @deprecated use [[UrlRules.removeRule]]*/\n this.removeRule = function (rule) { return _this.router.urlService.rules.removeRule(rule); };\n /** @deprecated use [[UrlRules.rule]]*/\n this.rule = function (rule) { return _this.router.urlService.rules.rule(rule); };\n /** @deprecated use [[UrlRules.rules]]*/\n this.rules = function () { return _this.router.urlService.rules.rules(); };\n /** @deprecated use [[UrlRules.sort]]*/\n this.sort = function (compareFn) { return _this.router.urlService.rules.sort(compareFn); };\n /** @deprecated use [[UrlRules.when]]*/\n this.when = function (matcher, handler, options) { return _this.router.urlService.rules.when(matcher, handler, options); };\n this.urlRuleFactory = new _urlRule__WEBPACK_IMPORTED_MODULE_1__.UrlRuleFactory(router);\n }\n /** Internal API. */\n UrlRouter.prototype.update = function (read) {\n var $url = this.router.locationService;\n if (read) {\n this.location = $url.url();\n return;\n }\n if ($url.url() === this.location)\n return;\n $url.url(this.location, true);\n };\n /**\n * Internal API.\n *\n * Pushes a new location to the browser history.\n *\n * @internal\n * @param urlMatcher\n * @param params\n * @param options\n */\n UrlRouter.prototype.push = function (urlMatcher, params, options) {\n var replace = options && !!options.replace;\n this.router.urlService.url(urlMatcher.format(params || {}), replace);\n };\n /**\n * Builds and returns a URL with interpolated parameters\n *\n * #### Example:\n * ```js\n * matcher = $umf.compile(\"/about/:person\");\n * params = { person: \"bob\" };\n * $bob = $urlRouter.href(matcher, params);\n * // $bob == \"/about/bob\";\n * ```\n *\n * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.\n * @param params An object of parameter values to fill the matcher's required parameters.\n * @param options Options object. The options are:\n *\n * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. \"http://www.example.com/fullurl\".\n *\n * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`\n */\n UrlRouter.prototype.href = function (urlMatcher, params, options) {\n var url = urlMatcher.format(params);\n if (url == null)\n return null;\n options = options || { absolute: false };\n var cfg = this.router.urlService.config;\n var isHtml5 = cfg.html5Mode();\n if (!isHtml5 && url !== null) {\n url = '#' + cfg.hashPrefix() + url;\n }\n url = appendBasePath(url, isHtml5, options.absolute, cfg.baseHref());\n if (!options.absolute || !url) {\n return url;\n }\n var slash = !isHtml5 && url ? '/' : '';\n var cfgPort = cfg.port();\n var port = (cfgPort === 80 || cfgPort === 443 ? '' : ':' + cfgPort);\n return [cfg.protocol(), '://', cfg.host(), port, slash, url].join('');\n };\n Object.defineProperty(UrlRouter.prototype, \"interceptDeferred\", {\n /** @deprecated use [[UrlService.interceptDeferred]]*/\n get: function () {\n return this.router.urlService.interceptDeferred;\n },\n enumerable: false,\n configurable: true\n });\n return UrlRouter;\n}());\n\n//# sourceMappingURL=urlRouter.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/url/urlRule.js": /*!************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/url/urlRule.js ***! \************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BaseUrlRule\": () => (/* binding */ BaseUrlRule),\n/* harmony export */ \"UrlRuleFactory\": () => (/* binding */ UrlRuleFactory)\n/* harmony export */ });\n/* harmony import */ var _urlMatcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./urlMatcher */ \"./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _state_stateObject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../state/stateObject */ \"./node_modules/@uirouter/core/lib-esm/state/stateObject.js\");\n\n\n\n\n\n/**\n * Creates a [[UrlRule]]\n *\n * Creates a [[UrlRule]] from a:\n *\n * - `string`\n * - [[UrlMatcher]]\n * - `RegExp`\n * - [[StateObject]]\n */\nvar UrlRuleFactory = /** @class */ (function () {\n function UrlRuleFactory(router) {\n this.router = router;\n }\n UrlRuleFactory.prototype.compile = function (str) {\n return this.router.urlMatcherFactory.compile(str);\n };\n UrlRuleFactory.prototype.create = function (what, handler) {\n var _this = this;\n var isState = _state_stateObject__WEBPACK_IMPORTED_MODULE_4__.StateObject.isState, isStateDeclaration = _state_stateObject__WEBPACK_IMPORTED_MODULE_4__.StateObject.isStateDeclaration;\n var makeRule = (0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.pattern)([\n [_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString, function (_what) { return makeRule(_this.compile(_what)); }],\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.is)(_urlMatcher__WEBPACK_IMPORTED_MODULE_0__.UrlMatcher), function (_what) { return _this.fromUrlMatcher(_what, handler); }],\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.or)(isState, isStateDeclaration), function (_what) { return _this.fromState(_what, _this.router); }],\n [(0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.is)(RegExp), function (_what) { return _this.fromRegExp(_what, handler); }],\n [_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isFunction, function (_what) { return new BaseUrlRule(_what, handler); }],\n ]);\n var rule = makeRule(what);\n if (!rule)\n throw new Error(\"invalid 'what' in when()\");\n return rule;\n };\n /**\n * A UrlRule which matches based on a UrlMatcher\n *\n * The `handler` may be either a `string`, a [[UrlRuleHandlerFn]] or another [[UrlMatcher]]\n *\n * ## Handler as a function\n *\n * If `handler` is a function, the function is invoked with:\n *\n * - matched parameter values ([[RawParams]] from [[UrlMatcher.exec]])\n * - url: the current Url ([[UrlParts]])\n * - router: the router object ([[UIRouter]])\n *\n * #### Example:\n * ```js\n * var urlMatcher = $umf.compile(\"/foo/:fooId/:barId\");\n * var rule = factory.fromUrlMatcher(urlMatcher, match => \"/home/\" + match.fooId + \"/\" + match.barId);\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\n * var result = rule.handler(match); // '/home/123/456'\n * ```\n *\n * ## Handler as UrlMatcher\n *\n * If `handler` is a UrlMatcher, the handler matcher is used to create the new url.\n * The `handler` UrlMatcher is formatted using the matched param from the first matcher.\n * The url is replaced with the result.\n *\n * #### Example:\n * ```js\n * var urlMatcher = $umf.compile(\"/foo/:fooId/:barId\");\n * var handler = $umf.compile(\"/home/:fooId/:barId\");\n * var rule = factory.fromUrlMatcher(urlMatcher, handler);\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\n * var result = rule.handler(match); // '/home/123/456'\n * ```\n */\n UrlRuleFactory.prototype.fromUrlMatcher = function (urlMatcher, handler) {\n var _handler = handler;\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(handler))\n handler = this.router.urlMatcherFactory.compile(handler);\n if ((0,_common_hof__WEBPACK_IMPORTED_MODULE_3__.is)(_urlMatcher__WEBPACK_IMPORTED_MODULE_0__.UrlMatcher)(handler))\n _handler = function (match) { return handler.format(match); };\n function matchUrlParamters(url) {\n var params = urlMatcher.exec(url.path, url.search, url.hash);\n return urlMatcher.validates(params) && params;\n }\n // Prioritize URLs, lowest to highest:\n // - Some optional URL parameters, but none matched\n // - No optional parameters in URL\n // - Some optional parameters, some matched\n // - Some optional parameters, all matched\n function matchPriority(params) {\n var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });\n if (!optional.length)\n return 0.000001;\n var matched = optional.filter(function (param) { return params[param.id]; });\n return matched.length / optional.length;\n }\n var details = { urlMatcher: urlMatcher, matchPriority: matchPriority, type: 'URLMATCHER' };\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_2__.extend)(new BaseUrlRule(matchUrlParamters, _handler), details);\n };\n /**\n * A UrlRule which matches a state by its url\n *\n * #### Example:\n * ```js\n * var rule = factory.fromState($state.get('foo'), router);\n * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }\n * var result = rule.handler(match);\n * // Starts a transition to 'foo' with params: { fooId: '123', barId: '456' }\n * ```\n */\n UrlRuleFactory.prototype.fromState = function (stateOrDecl, router) {\n var state = _state_stateObject__WEBPACK_IMPORTED_MODULE_4__.StateObject.isStateDeclaration(stateOrDecl) ? stateOrDecl.$$state() : stateOrDecl;\n /**\n * Handles match by transitioning to matched state\n *\n * First checks if the router should start a new transition.\n * A new transition is not required if the current state's URL\n * and the new URL are already identical\n */\n var handler = function (match) {\n var $state = router.stateService;\n var globals = router.globals;\n if ($state.href(state, match) !== $state.href(globals.current, globals.params)) {\n $state.transitionTo(state, match, { inherit: true, source: 'url' });\n }\n };\n var details = { state: state, type: 'STATE' };\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_2__.extend)(this.fromUrlMatcher(state.url, handler), details);\n };\n /**\n * A UrlRule which matches based on a regular expression\n *\n * The `handler` may be either a [[UrlRuleHandlerFn]] or a string.\n *\n * ## Handler as a function\n *\n * If `handler` is a function, the function is invoked with:\n *\n * - regexp match array (from `regexp`)\n * - url: the current Url ([[UrlParts]])\n * - router: the router object ([[UIRouter]])\n *\n * #### Example:\n * ```js\n * var rule = factory.fromRegExp(/^\\/foo\\/(bar|baz)$/, match => \"/home/\" + match[1])\n * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]\n * var result = rule.handler(match); // '/home/bar'\n * ```\n *\n * ## Handler as string\n *\n * If `handler` is a string, the url is *replaced by the string* when the Rule is invoked.\n * The string is first interpolated using `string.replace()` style pattern.\n *\n * #### Example:\n * ```js\n * var rule = factory.fromRegExp(/^\\/foo\\/(bar|baz)$/, \"/home/$1\")\n * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]\n * var result = rule.handler(match); // '/home/bar'\n * ```\n */\n UrlRuleFactory.prototype.fromRegExp = function (regexp, handler) {\n if (regexp.global || regexp.sticky)\n throw new Error('Rule RegExp must not be global or sticky');\n /**\n * If handler is a string, the url will be replaced by the string.\n * If the string has any String.replace() style variables in it (like `$2`),\n * they will be replaced by the captures from [[match]]\n */\n var redirectUrlTo = function (match) {\n // Interpolates matched values into $1 $2, etc using a String.replace()-style pattern\n return handler.replace(/\\$(\\$|\\d{1,2})/, function (m, what) { return match[what === '$' ? 0 : Number(what)]; });\n };\n var _handler = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isString)(handler) ? redirectUrlTo : handler;\n var matchParamsFromRegexp = function (url) { return regexp.exec(url.path); };\n var details = { regexp: regexp, type: 'REGEXP' };\n return (0,_common_common__WEBPACK_IMPORTED_MODULE_2__.extend)(new BaseUrlRule(matchParamsFromRegexp, _handler), details);\n };\n UrlRuleFactory.isUrlRule = function (obj) { return obj && ['type', 'match', 'handler'].every(function (key) { return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_1__.isDefined)(obj[key]); }); };\n return UrlRuleFactory;\n}());\n\n/**\n * A base rule which calls `match`\n *\n * The value from the `match` function is passed through to the `handler`.\n * @internal\n */\nvar BaseUrlRule = /** @class */ (function () {\n function BaseUrlRule(match, handler) {\n var _this = this;\n this.match = match;\n this.type = 'RAW';\n this.matchPriority = function (match) { return 0 - _this.$id; };\n this.handler = handler || _common_common__WEBPACK_IMPORTED_MODULE_2__.identity;\n }\n return BaseUrlRule;\n}());\n\n//# sourceMappingURL=urlRule.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/url/urlRule.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/url/urlRules.js": /*!*************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/url/urlRules.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UrlRules\": () => (/* binding */ UrlRules)\n/* harmony export */ });\n/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../state */ \"./node_modules/@uirouter/core/lib-esm/state/index.js\");\n/* harmony import */ var _urlMatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./urlMatcher */ \"./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n/* harmony import */ var _urlRule__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./urlRule */ \"./node_modules/@uirouter/core/lib-esm/url/urlRule.js\");\n\n\n\n\nvar prioritySort = function (a, b) { return (b.priority || 0) - (a.priority || 0); };\nvar typeSort = function (a, b) {\n var weights = { STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1 };\n return (weights[a.type] || 0) - (weights[b.type] || 0);\n};\nvar urlMatcherSort = function (a, b) {\n return !a.urlMatcher || !b.urlMatcher ? 0 : _urlMatcher__WEBPACK_IMPORTED_MODULE_1__.UrlMatcher.compare(a.urlMatcher, b.urlMatcher);\n};\nvar idSort = function (a, b) {\n // Identically sorted STATE and URLMATCHER best rule will be chosen by `matchPriority` after each rule matches the URL\n var useMatchPriority = { STATE: true, URLMATCHER: true };\n var equal = useMatchPriority[a.type] && useMatchPriority[b.type];\n return equal ? 0 : (a.$id || 0) - (b.$id || 0);\n};\n/**\n * Default rule priority sorting function.\n *\n * Sorts rules by:\n *\n * - Explicit priority (set rule priority using [[UrlRules.when]])\n * - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1)\n * - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule.\n * - Rule registration order (for rule types other than STATE and URLMATCHER)\n * - Equally sorted State and UrlMatcher rules will each match the URL.\n * Then, the *best* match is chosen based on how many parameter values were matched.\n */\nvar defaultRuleSortFn;\ndefaultRuleSortFn = function (a, b) {\n var cmp = prioritySort(a, b);\n if (cmp !== 0)\n return cmp;\n cmp = typeSort(a, b);\n if (cmp !== 0)\n return cmp;\n cmp = urlMatcherSort(a, b);\n if (cmp !== 0)\n return cmp;\n return idSort(a, b);\n};\nfunction getHandlerFn(handler) {\n if (!(0,_common__WEBPACK_IMPORTED_MODULE_2__.isFunction)(handler) && !(0,_common__WEBPACK_IMPORTED_MODULE_2__.isString)(handler) && !(0,_common__WEBPACK_IMPORTED_MODULE_2__.is)(_state__WEBPACK_IMPORTED_MODULE_0__.TargetState)(handler) && !_state__WEBPACK_IMPORTED_MODULE_0__.TargetState.isDef(handler)) {\n throw new Error(\"'handler' must be a string, function, TargetState, or have a state: 'newtarget' property\");\n }\n return (0,_common__WEBPACK_IMPORTED_MODULE_2__.isFunction)(handler) ? handler : (0,_common__WEBPACK_IMPORTED_MODULE_2__.val)(handler);\n}\n/**\n * API for managing URL rules\n *\n * This API is used to create and manage URL rules.\n * URL rules are a mechanism to respond to specific URL patterns.\n *\n * The most commonly used methods are [[otherwise]] and [[when]].\n *\n * This API is found at `router.urlService.rules` (see: [[UIRouter.urlService]], [[URLService.rules]])\n */\nvar UrlRules = /** @class */ (function () {\n /** @internal */\n function UrlRules(/** @internal */ router) {\n this.router = router;\n /** @internal */ this._sortFn = defaultRuleSortFn;\n /** @internal */ this._rules = [];\n /** @internal */ this._id = 0;\n this.urlRuleFactory = new _urlRule__WEBPACK_IMPORTED_MODULE_3__.UrlRuleFactory(router);\n }\n /** @internal */\n UrlRules.prototype.dispose = function (router) {\n this._rules = [];\n delete this._otherwiseFn;\n };\n /**\n * Defines the initial state, path, or behavior to use when the app starts.\n *\n * This rule defines the initial/starting state for the application.\n *\n * This rule is triggered the first time the URL is checked (when the app initially loads).\n * The rule is triggered only when the url matches either `\"\"` or `\"/\"`.\n *\n * Note: The rule is intended to be used when the root of the application is directly linked to.\n * When the URL is *not* `\"\"` or `\"/\"` and doesn't match other rules, the [[otherwise]] rule is triggered.\n * This allows 404-like behavior when an unknown URL is deep-linked.\n *\n * #### Example:\n * Start app at `home` state.\n * ```js\n * .initial({ state: 'home' });\n * ```\n *\n * #### Example:\n * Start app at `/home` (by url)\n * ```js\n * .initial('/home');\n * ```\n *\n * #### Example:\n * When no other url rule matches, go to `home` state\n * ```js\n * .initial((matchValue, url, router) => {\n * console.log('initial state');\n * return { state: 'home' };\n * })\n * ```\n *\n * @param handler The initial state or url path, or a function which returns the state or url path (or performs custom logic).\n */\n UrlRules.prototype.initial = function (handler) {\n var handlerFn = getHandlerFn(handler);\n var matchFn = function (urlParts, router) {\n return router.globals.transitionHistory.size() === 0 && !!/^\\/?$/.exec(urlParts.path);\n };\n this.rule(this.urlRuleFactory.create(matchFn, handlerFn));\n };\n /**\n * Defines the state, url, or behavior to use when no other rule matches the URL.\n *\n * This rule is matched when *no other rule* matches.\n * It is generally used to handle unknown URLs (similar to \"404\" behavior, but on the client side).\n *\n * - If `handler` a string, it is treated as a url redirect\n *\n * #### Example:\n * When no other url rule matches, redirect to `/index`\n * ```js\n * .otherwise('/index');\n * ```\n *\n * - If `handler` is an object with a `state` property, the state is activated.\n *\n * #### Example:\n * When no other url rule matches, redirect to `home` and provide a `dashboard` parameter value.\n * ```js\n * .otherwise({ state: 'home', params: { dashboard: 'default' } });\n * ```\n *\n * - If `handler` is a function, the function receives the current url ([[UrlParts]]) and the [[UIRouter]] object.\n * The function can perform actions, and/or return a value.\n *\n * #### Example:\n * When no other url rule matches, manually trigger a transition to the `home` state\n * ```js\n * .otherwise((matchValue, urlParts, router) => {\n * router.stateService.go('home');\n * });\n * ```\n *\n * #### Example:\n * When no other url rule matches, go to `home` state\n * ```js\n * .otherwise((matchValue, urlParts, router) => {\n * return { state: 'home' };\n * });\n * ```\n *\n * @param handler The url path to redirect to, or a function which returns the url path (or performs custom logic).\n */\n UrlRules.prototype.otherwise = function (handler) {\n var handlerFn = getHandlerFn(handler);\n this._otherwiseFn = this.urlRuleFactory.create((0,_common__WEBPACK_IMPORTED_MODULE_2__.val)(true), handlerFn);\n this._sorted = false;\n };\n /**\n * Remove a rule previously registered\n *\n * @param rule the matcher rule that was previously registered using [[rule]]\n */\n UrlRules.prototype.removeRule = function (rule) {\n (0,_common__WEBPACK_IMPORTED_MODULE_2__.removeFrom)(this._rules, rule);\n };\n /**\n * Manually adds a URL Rule.\n *\n * Usually, a url rule is added using [[StateDeclaration.url]] or [[when]].\n * This api can be used directly for more control (to register a [[BaseUrlRule]], for example).\n * Rules can be created using [[urlRuleFactory]], or created manually as simple objects.\n *\n * A rule should have a `match` function which returns truthy if the rule matched.\n * It should also have a `handler` function which is invoked if the rule is the best match.\n *\n * @return a function that deregisters the rule\n */\n UrlRules.prototype.rule = function (rule) {\n var _this = this;\n if (!_urlRule__WEBPACK_IMPORTED_MODULE_3__.UrlRuleFactory.isUrlRule(rule))\n throw new Error('invalid rule');\n rule.$id = this._id++;\n rule.priority = rule.priority || 0;\n this._rules.push(rule);\n this._sorted = false;\n return function () { return _this.removeRule(rule); };\n };\n /**\n * Gets all registered rules\n *\n * @returns an array of all the registered rules\n */\n UrlRules.prototype.rules = function () {\n this.ensureSorted();\n return this._rules.concat(this._otherwiseFn ? [this._otherwiseFn] : []);\n };\n /**\n * Defines URL Rule priorities\n *\n * More than one rule ([[UrlRule]]) might match a given URL.\n * This `compareFn` is used to sort the rules by priority.\n * Higher priority rules should sort earlier.\n *\n * The [[defaultRuleSortFn]] is used by default.\n *\n * You only need to call this function once.\n * The `compareFn` will be used to sort the rules as each is registered.\n *\n * If called without any parameter, it will re-sort the rules.\n *\n * ---\n *\n * Url rules may come from multiple sources: states's urls ([[StateDeclaration.url]]), [[when]], and [[rule]].\n * Each rule has a (user-provided) [[UrlRule.priority]], a [[UrlRule.type]], and a [[UrlRule.$id]]\n * The `$id` is is the order in which the rule was registered.\n *\n * The sort function should use these data, or data found on a specific type\n * of [[UrlRule]] (such as [[StateRule.state]]), to order the rules as desired.\n *\n * #### Example:\n * This compare function prioritizes rules by the order in which the rules were registered.\n * A rule registered earlier has higher priority.\n *\n * ```js\n * function compareFn(a, b) {\n * return a.$id - b.$id;\n * }\n * ```\n *\n * @param compareFn a function that compares to [[UrlRule]] objects.\n * The `compareFn` should abide by the `Array.sort` compare function rules.\n * Given two rules, `a` and `b`, return a negative number if `a` should be higher priority.\n * Return a positive number if `b` should be higher priority.\n * Return `0` if the rules are identical.\n *\n * See the [mozilla reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Description)\n * for details.\n */\n UrlRules.prototype.sort = function (compareFn) {\n var sorted = this.stableSort(this._rules, (this._sortFn = compareFn || this._sortFn));\n // precompute _sortGroup values and apply to each rule\n var group = 0;\n for (var i = 0; i < sorted.length; i++) {\n sorted[i]._group = group;\n if (i < sorted.length - 1 && this._sortFn(sorted[i], sorted[i + 1]) !== 0) {\n group++;\n }\n }\n this._rules = sorted;\n this._sorted = true;\n };\n /** @internal */\n UrlRules.prototype.ensureSorted = function () {\n this._sorted || this.sort();\n };\n /** @internal */\n UrlRules.prototype.stableSort = function (arr, compareFn) {\n var arrOfWrapper = arr.map(function (elem, idx) { return ({ elem: elem, idx: idx }); });\n arrOfWrapper.sort(function (wrapperA, wrapperB) {\n var cmpDiff = compareFn(wrapperA.elem, wrapperB.elem);\n return cmpDiff === 0 ? wrapperA.idx - wrapperB.idx : cmpDiff;\n });\n return arrOfWrapper.map(function (wrapper) { return wrapper.elem; });\n };\n /**\n * Registers a `matcher` and `handler` for custom URLs handling.\n *\n * The `matcher` can be:\n *\n * - a [[UrlMatcher]]: See: [[UrlMatcherFactory.compile]]\n * - a `string`: The string is compiled to a [[UrlMatcher]]\n * - a `RegExp`: The regexp is used to match the url.\n *\n * The `handler` can be:\n *\n * - a string: The url is redirected to the value of the string.\n * - a function: The url is redirected to the return value of the function.\n *\n * ---\n *\n * When the `handler` is a `string` and the `matcher` is a `UrlMatcher` (or string), the redirect\n * string is interpolated with parameter values.\n *\n * #### Example:\n * When the URL is `/foo/123` the rule will redirect to `/bar/123`.\n * ```js\n * .when(\"/foo/:param1\", \"/bar/:param1\")\n * ```\n *\n * ---\n *\n * When the `handler` is a string and the `matcher` is a `RegExp`, the redirect string is\n * interpolated with capture groups from the RegExp.\n *\n * #### Example:\n * When the URL is `/foo/123` the rule will redirect to `/bar/123`.\n * ```js\n * .when(new RegExp(\"^/foo/(.*)$\"), \"/bar/$1\");\n * ```\n *\n * ---\n *\n * When the handler is a function, it receives the matched value, the current URL, and the `UIRouter` object (See [[UrlRuleHandlerFn]]).\n * The \"matched value\" differs based on the `matcher`.\n * For [[UrlMatcher]]s, it will be the matched state params.\n * For `RegExp`, it will be the match array from `regexp.exec()`.\n *\n * If the handler returns a string, the URL is redirected to the string.\n *\n * #### Example:\n * When the URL is `/foo/123` the rule will redirect to `/bar/123`.\n * ```js\n * .when(new RegExp(\"^/foo/(.*)$\"), match => \"/bar/\" + match[1]);\n * ```\n *\n * Note: the `handler` may also invoke arbitrary code, such as `$state.go()`\n *\n * @param matcher A pattern `string` to match, compiled as a [[UrlMatcher]], or a `RegExp`.\n * @param handler The path to redirect to, or a function that returns the path.\n * @param options `{ priority: number }`\n *\n * @return the registered [[UrlRule]]\n */\n UrlRules.prototype.when = function (matcher, handler, options) {\n var rule = this.urlRuleFactory.create(matcher, handler);\n if ((0,_common__WEBPACK_IMPORTED_MODULE_2__.isDefined)(options && options.priority))\n rule.priority = options.priority;\n this.rule(rule);\n return rule;\n };\n return UrlRules;\n}());\n\n//# sourceMappingURL=urlRules.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/url/urlRules.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/url/urlService.js": /*!***************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/url/urlService.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UrlService\": () => (/* binding */ UrlService)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n/* harmony import */ var _urlRules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./urlRules */ \"./node_modules/@uirouter/core/lib-esm/url/urlRules.js\");\n/* harmony import */ var _urlConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./urlConfig */ \"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js\");\n/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../state */ \"./node_modules/@uirouter/core/lib-esm/state/index.js\");\n\n\n\n\n/**\n * API for URL management\n */\nvar UrlService = /** @class */ (function () {\n /** @internal */\n function UrlService(/** @internal */ router) {\n var _this = this;\n this.router = router;\n /** @internal */ this.interceptDeferred = false;\n /**\n * The nested [[UrlRules]] API for managing URL rules and rewrites\n *\n * See: [[UrlRules]] for details\n */\n this.rules = new _urlRules__WEBPACK_IMPORTED_MODULE_1__.UrlRules(this.router);\n /**\n * The nested [[UrlConfig]] API to configure the URL and retrieve URL information\n *\n * See: [[UrlConfig]] for details\n */\n this.config = new _urlConfig__WEBPACK_IMPORTED_MODULE_2__.UrlConfig(this.router);\n // Delegate these calls to the current LocationServices implementation\n /**\n * Gets the current url, or updates the url\n *\n * ### Getting the current URL\n *\n * When no arguments are passed, returns the current URL.\n * The URL is normalized using the internal [[path]]/[[search]]/[[hash]] values.\n *\n * For example, the URL may be stored in the hash ([[HashLocationServices]]) or\n * have a base HREF prepended ([[PushStateLocationServices]]).\n *\n * The raw URL in the browser might be:\n *\n * ```\n * http://mysite.com/somepath/index.html#/internal/path/123?param1=foo#anchor\n * ```\n *\n * or\n *\n * ```\n * http://mysite.com/basepath/internal/path/123?param1=foo#anchor\n * ```\n *\n * then this method returns:\n *\n * ```\n * /internal/path/123?param1=foo#anchor\n * ```\n *\n *\n * #### Example:\n * ```js\n * locationServices.url(); // \"/some/path?query=value#anchor\"\n * ```\n *\n * ### Updating the URL\n *\n * When `newurl` arguments is provided, changes the URL to reflect `newurl`\n *\n * #### Example:\n * ```js\n * locationServices.url(\"/some/path?query=value#anchor\", true);\n * ```\n *\n * @param newurl The new value for the URL.\n * This url should reflect only the new internal [[path]], [[search]], and [[hash]] values.\n * It should not include the protocol, site, port, or base path of an absolute HREF.\n * @param replace When true, replaces the current history entry (instead of appending it) with this new url\n * @param state The history's state object, i.e., pushState (if the LocationServices implementation supports it)\n *\n * @return the url (after potentially being processed)\n */\n this.url = function (newurl, replace, state) {\n return _this.router.locationService.url(newurl, replace, state);\n };\n /**\n * Gets the path part of the current url\n *\n * If the current URL is `/some/path?query=value#anchor`, this returns `/some/path`\n *\n * @return the path portion of the url\n */\n this.path = function () { return _this.router.locationService.path(); };\n /**\n * Gets the search part of the current url as an object\n *\n * If the current URL is `/some/path?query=value#anchor`, this returns `{ query: 'value' }`\n *\n * @return the search (query) portion of the url, as an object\n */\n this.search = function () { return _this.router.locationService.search(); };\n /**\n * Gets the hash part of the current url\n *\n * If the current URL is `/some/path?query=value#anchor`, this returns `anchor`\n *\n * @return the hash (anchor) portion of the url\n */\n this.hash = function () { return _this.router.locationService.hash(); };\n /**\n * @internal\n *\n * Registers a low level url change handler\n *\n * Note: Because this is a low level handler, it's not recommended for general use.\n *\n * #### Example:\n * ```js\n * let deregisterFn = locationServices.onChange((evt) => console.log(\"url change\", evt));\n * ```\n *\n * @param callback a function that will be called when the url is changing\n * @return a function that de-registers the callback\n */\n this.onChange = function (callback) { return _this.router.locationService.onChange(callback); };\n }\n /** @internal */\n UrlService.prototype.dispose = function () {\n this.listen(false);\n this.rules.dispose();\n };\n /**\n * Gets the current URL parts\n *\n * This method returns the different parts of the current URL (the [[path]], [[search]], and [[hash]]) as a [[UrlParts]] object.\n */\n UrlService.prototype.parts = function () {\n return { path: this.path(), search: this.search(), hash: this.hash() };\n };\n /**\n * Activates the best rule for the current URL\n *\n * Checks the current URL for a matching [[UrlRule]], then invokes that rule's handler.\n * This method is called internally any time the URL has changed.\n *\n * This effectively activates the state (or redirect, etc) which matches the current URL.\n *\n * #### Example:\n * ```js\n * urlService.deferIntercept();\n *\n * fetch('/states.json').then(resp => resp.json()).then(data => {\n * data.forEach(state => $stateRegistry.register(state));\n * urlService.listen();\n * // Find the matching URL and invoke the handler.\n * urlService.sync();\n * });\n * ```\n */\n UrlService.prototype.sync = function (evt) {\n if (evt && evt.defaultPrevented)\n return;\n var _a = this.router, urlService = _a.urlService, stateService = _a.stateService;\n var url = { path: urlService.path(), search: urlService.search(), hash: urlService.hash() };\n var best = this.match(url);\n var applyResult = (0,_common__WEBPACK_IMPORTED_MODULE_0__.pattern)([\n [_common__WEBPACK_IMPORTED_MODULE_0__.isString, function (newurl) { return urlService.url(newurl, true); }],\n [_state__WEBPACK_IMPORTED_MODULE_3__.TargetState.isDef, function (def) { return stateService.go(def.state, def.params, def.options); }],\n [(0,_common__WEBPACK_IMPORTED_MODULE_0__.is)(_state__WEBPACK_IMPORTED_MODULE_3__.TargetState), function (target) { return stateService.go(target.state(), target.params(), target.options()); }],\n ]);\n applyResult(best && best.rule.handler(best.match, url, this.router));\n };\n /**\n * Starts or stops listening for URL changes\n *\n * Call this sometime after calling [[deferIntercept]] to start monitoring the url.\n * This causes UI-Router to start listening for changes to the URL, if it wasn't already listening.\n *\n * If called with `false`, UI-Router will stop listening (call listen(true) to start listening again).\n *\n * #### Example:\n * ```js\n * urlService.deferIntercept();\n *\n * fetch('/states.json').then(resp => resp.json()).then(data => {\n * data.forEach(state => $stateRegistry.register(state));\n * // Start responding to URL changes\n * urlService.listen();\n * urlService.sync();\n * });\n * ```\n *\n * @param enabled `true` or `false` to start or stop listening to URL changes\n */\n UrlService.prototype.listen = function (enabled) {\n var _this = this;\n if (enabled === false) {\n this._stopListeningFn && this._stopListeningFn();\n delete this._stopListeningFn;\n }\n else {\n return (this._stopListeningFn =\n this._stopListeningFn || this.router.urlService.onChange(function (evt) { return _this.sync(evt); }));\n }\n };\n /**\n * Disables monitoring of the URL.\n *\n * Call this method before UI-Router has bootstrapped.\n * It will stop UI-Router from performing the initial url sync.\n *\n * This can be useful to perform some asynchronous initialization before the router starts.\n * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.\n *\n * #### Example:\n * ```js\n * // Prevent UI-Router from automatically intercepting URL changes when it starts;\n * urlService.deferIntercept();\n *\n * fetch('/states.json').then(resp => resp.json()).then(data => {\n * data.forEach(state => $stateRegistry.register(state));\n * urlService.listen();\n * urlService.sync();\n * });\n * ```\n *\n * @param defer Indicates whether to defer location change interception.\n * Passing no parameter is equivalent to `true`.\n */\n UrlService.prototype.deferIntercept = function (defer) {\n if (defer === undefined)\n defer = true;\n this.interceptDeferred = defer;\n };\n /**\n * Matches a URL\n *\n * Given a URL (as a [[UrlParts]] object), check all rules and determine the best matching rule.\n * Return the result as a [[MatchResult]].\n */\n UrlService.prototype.match = function (url) {\n var _this = this;\n url = (0,_common__WEBPACK_IMPORTED_MODULE_0__.extend)({ path: '', search: {}, hash: '' }, url);\n var rules = this.rules.rules();\n // Checks a single rule. Returns { rule: rule, match: match, weight: weight } if it matched, or undefined\n var checkRule = function (rule) {\n var match = rule.match(url, _this.router);\n return match && { match: match, rule: rule, weight: rule.matchPriority(match) };\n };\n // The rules are pre-sorted.\n // - Find the first matching rule.\n // - Find any other matching rule that sorted *exactly the same*, according to `.sort()`.\n // - Choose the rule with the highest match weight.\n var best;\n for (var i = 0; i < rules.length; i++) {\n // Stop when there is a 'best' rule and the next rule sorts differently than it.\n if (best && best.rule._group !== rules[i]._group)\n break;\n var current = checkRule(rules[i]);\n // Pick the best MatchResult\n best = !best || (current && current.weight > best.weight) ? current : best;\n }\n return best;\n };\n return UrlService;\n}());\n\n//# sourceMappingURL=urlService.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/url/urlService.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla.js": /*!********************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _vanilla_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vanilla/index */ \"./node_modules/@uirouter/core/lib-esm/vanilla/index.js\");\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _vanilla_index__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _vanilla_index__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n\n//# sourceMappingURL=vanilla.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js": /*!****************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js ***! \****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BaseLocationServices\": () => (/* binding */ BaseLocationServices)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js\");\n\n\n/** A base `LocationServices` */\nvar BaseLocationServices = /** @class */ (function () {\n function BaseLocationServices(router, fireAfterUpdate) {\n var _this = this;\n this.fireAfterUpdate = fireAfterUpdate;\n this._listeners = [];\n this._listener = function (evt) { return _this._listeners.forEach(function (cb) { return cb(evt); }); };\n this.hash = function () { return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.parseUrl)(_this._get()).hash; };\n this.path = function () { return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.parseUrl)(_this._get()).path; };\n this.search = function () { return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.getParams)((0,_utils__WEBPACK_IMPORTED_MODULE_1__.parseUrl)(_this._get()).search); };\n this._location = _common__WEBPACK_IMPORTED_MODULE_0__.root.location;\n this._history = _common__WEBPACK_IMPORTED_MODULE_0__.root.history;\n }\n BaseLocationServices.prototype.url = function (url, replace) {\n if (replace === void 0) { replace = true; }\n if ((0,_common__WEBPACK_IMPORTED_MODULE_0__.isDefined)(url) && url !== this._get()) {\n this._set(null, null, url, replace);\n if (this.fireAfterUpdate) {\n this._listeners.forEach(function (cb) { return cb({ url: url }); });\n }\n }\n return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.buildUrl)(this);\n };\n BaseLocationServices.prototype.onChange = function (cb) {\n var _this = this;\n this._listeners.push(cb);\n return function () { return (0,_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(_this._listeners, cb); };\n };\n BaseLocationServices.prototype.dispose = function (router) {\n (0,_common__WEBPACK_IMPORTED_MODULE_0__.deregAll)(this._listeners);\n };\n return BaseLocationServices;\n}());\n\n//# sourceMappingURL=baseLocationService.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js": /*!******************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BrowserLocationConfig\": () => (/* binding */ BrowserLocationConfig)\n/* harmony export */ });\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n\n/** A `LocationConfig` that delegates to the browser's `location` object */\nvar BrowserLocationConfig = /** @class */ (function () {\n function BrowserLocationConfig(router, _isHtml5) {\n if (_isHtml5 === void 0) { _isHtml5 = false; }\n this._isHtml5 = _isHtml5;\n this._baseHref = undefined;\n this._hashPrefix = '';\n }\n BrowserLocationConfig.prototype.port = function () {\n if (location.port) {\n return Number(location.port);\n }\n return this.protocol() === 'https' ? 443 : 80;\n };\n BrowserLocationConfig.prototype.protocol = function () {\n return location.protocol.replace(/:/g, '');\n };\n BrowserLocationConfig.prototype.host = function () {\n return location.hostname;\n };\n BrowserLocationConfig.prototype.html5Mode = function () {\n return this._isHtml5;\n };\n BrowserLocationConfig.prototype.hashPrefix = function (newprefix) {\n return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isDefined)(newprefix) ? (this._hashPrefix = newprefix) : this._hashPrefix;\n };\n BrowserLocationConfig.prototype.baseHref = function (href) {\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isDefined)(href))\n this._baseHref = href;\n if ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(this._baseHref))\n this._baseHref = this.getBaseHref();\n return this._baseHref;\n };\n BrowserLocationConfig.prototype.getBaseHref = function () {\n var baseTag = document.getElementsByTagName('base')[0];\n if (baseTag && baseTag.href) {\n return baseTag.href.replace(/^([^/:]*:)?\\/\\/[^/]*/, '');\n }\n return this._isHtml5 ? '/' : location.pathname || '/';\n };\n BrowserLocationConfig.prototype.dispose = function () { };\n return BrowserLocationConfig;\n}());\n\n//# sourceMappingURL=browserLocationConfig.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js": /*!****************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js ***! \****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HashLocationService\": () => (/* binding */ HashLocationService)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n/* harmony import */ var _baseLocationService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./baseLocationService */ \"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/** A `LocationServices` that uses the browser hash \"#\" to get/set the current location */\nvar HashLocationService = /** @class */ (function (_super) {\n __extends(HashLocationService, _super);\n function HashLocationService(router) {\n var _this = _super.call(this, router, false) || this;\n _common__WEBPACK_IMPORTED_MODULE_0__.root.addEventListener('hashchange', _this._listener, false);\n return _this;\n }\n HashLocationService.prototype._get = function () {\n return (0,_common__WEBPACK_IMPORTED_MODULE_0__.trimHashVal)(this._location.hash);\n };\n HashLocationService.prototype._set = function (state, title, url, replace) {\n this._location.hash = url;\n };\n HashLocationService.prototype.dispose = function (router) {\n _super.prototype.dispose.call(this, router);\n _common__WEBPACK_IMPORTED_MODULE_0__.root.removeEventListener('hashchange', this._listener);\n };\n return HashLocationService;\n}(_baseLocationService__WEBPACK_IMPORTED_MODULE_1__.BaseLocationServices));\n\n//# sourceMappingURL=hashLocationService.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/index.js": /*!**************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/index.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"$injector\": () => (/* reexport safe */ _injector__WEBPACK_IMPORTED_MODULE_2__.$injector),\n/* harmony export */ \"$q\": () => (/* reexport safe */ _q__WEBPACK_IMPORTED_MODULE_1__.$q),\n/* harmony export */ \"BaseLocationServices\": () => (/* reexport safe */ _baseLocationService__WEBPACK_IMPORTED_MODULE_3__.BaseLocationServices),\n/* harmony export */ \"BrowserLocationConfig\": () => (/* reexport safe */ _browserLocationConfig__WEBPACK_IMPORTED_MODULE_8__.BrowserLocationConfig),\n/* harmony export */ \"HashLocationService\": () => (/* reexport safe */ _hashLocationService__WEBPACK_IMPORTED_MODULE_4__.HashLocationService),\n/* harmony export */ \"MemoryLocationConfig\": () => (/* reexport safe */ _memoryLocationConfig__WEBPACK_IMPORTED_MODULE_7__.MemoryLocationConfig),\n/* harmony export */ \"MemoryLocationService\": () => (/* reexport safe */ _memoryLocationService__WEBPACK_IMPORTED_MODULE_5__.MemoryLocationService),\n/* harmony export */ \"PushStateLocationService\": () => (/* reexport safe */ _pushStateLocationService__WEBPACK_IMPORTED_MODULE_6__.PushStateLocationService),\n/* harmony export */ \"buildUrl\": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.buildUrl),\n/* harmony export */ \"getParams\": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.getParams),\n/* harmony export */ \"hashLocationPlugin\": () => (/* reexport safe */ _plugins__WEBPACK_IMPORTED_MODULE_10__.hashLocationPlugin),\n/* harmony export */ \"keyValsToObjectR\": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.keyValsToObjectR),\n/* harmony export */ \"locationPluginFactory\": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.locationPluginFactory),\n/* harmony export */ \"memoryLocationPlugin\": () => (/* reexport safe */ _plugins__WEBPACK_IMPORTED_MODULE_10__.memoryLocationPlugin),\n/* harmony export */ \"parseUrl\": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_9__.parseUrl),\n/* harmony export */ \"pushStateLocationPlugin\": () => (/* reexport safe */ _plugins__WEBPACK_IMPORTED_MODULE_10__.pushStateLocationPlugin),\n/* harmony export */ \"servicesPlugin\": () => (/* reexport safe */ _plugins__WEBPACK_IMPORTED_MODULE_10__.servicesPlugin)\n/* harmony export */ });\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/vanilla/interface.js\");\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _q__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./q */ \"./node_modules/@uirouter/core/lib-esm/vanilla/q.js\");\n/* harmony import */ var _injector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./injector */ \"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js\");\n/* harmony import */ var _baseLocationService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./baseLocationService */ \"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js\");\n/* harmony import */ var _hashLocationService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hashLocationService */ \"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js\");\n/* harmony import */ var _memoryLocationService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memoryLocationService */ \"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js\");\n/* harmony import */ var _pushStateLocationService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./pushStateLocationService */ \"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js\");\n/* harmony import */ var _memoryLocationConfig__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./memoryLocationConfig */ \"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js\");\n/* harmony import */ var _browserLocationConfig__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./browserLocationConfig */ \"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils */ \"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js\");\n/* harmony import */ var _plugins__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./plugins */ \"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js\");\n/**\n * Naive, pure JS implementation of core ui-router services\n *\n * @packageDocumentation\n */\n\n\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/injector.js": /*!*****************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/injector.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"$injector\": () => (/* binding */ $injector)\n/* harmony export */ });\n/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/index */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n\n// globally available injectables\nvar globals = {};\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/gm;\nvar ARGUMENT_NAMES = /([^\\s,]+)/g;\n/**\n * A basic angular1-like injector api\n *\n * This object implements four methods similar to the\n * [angular 1 dependency injector](https://docs.angularjs.org/api/auto/service/$injector)\n *\n * UI-Router evolved from an angular 1 library to a framework agnostic library.\n * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection.\n *\n * This object provides a naive implementation of a globally scoped dependency injection system.\n * It supports the following DI approaches:\n *\n * ### Function parameter names\n *\n * A function's `.toString()` is called, and the parameter names are parsed.\n * This only works when the parameter names aren't \"mangled\" by a minifier such as UglifyJS.\n *\n * ```js\n * function injectedFunction(FooService, BarService) {\n * // FooService and BarService are injected\n * }\n * ```\n *\n * ### Function annotation\n *\n * A function may be annotated with an array of dependency names as the `$inject` property.\n *\n * ```js\n * injectedFunction.$inject = [ 'FooService', 'BarService' ];\n * function injectedFunction(fs, bs) {\n * // FooService and BarService are injected as fs and bs parameters\n * }\n * ```\n *\n * ### Array notation\n *\n * An array provides the names of the dependencies to inject (as strings).\n * The function is the last element of the array.\n *\n * ```js\n * [ 'FooService', 'BarService', function (fs, bs) {\n * // FooService and BarService are injected as fs and bs parameters\n * }]\n * ```\n *\n * @type {$InjectorLike}\n */\nvar $injector = {\n /** Gets an object from DI based on a string token */\n get: function (name) { return globals[name]; },\n /** Returns true if an object named `name` exists in global DI */\n has: function (name) { return $injector.get(name) != null; },\n /**\n * Injects a function\n *\n * @param fn the function to inject\n * @param context the function's `this` binding\n * @param locals An object with additional DI tokens and values, such as `{ someToken: { foo: 1 } }`\n */\n invoke: function (fn, context, locals) {\n var all = (0,_common_index__WEBPACK_IMPORTED_MODULE_0__.extend)({}, globals, locals || {});\n var params = $injector.annotate(fn);\n var ensureExist = (0,_common_index__WEBPACK_IMPORTED_MODULE_0__.assertPredicate)(function (key) { return all.hasOwnProperty(key); }, function (key) { return \"DI can't find injectable: '\" + key + \"'\"; });\n var args = params.filter(ensureExist).map(function (x) { return all[x]; });\n if ((0,_common_index__WEBPACK_IMPORTED_MODULE_0__.isFunction)(fn))\n return fn.apply(context, args);\n else\n return fn.slice(-1)[0].apply(context, args);\n },\n /**\n * Returns a function's dependencies\n *\n * Analyzes a function (or array) and returns an array of DI tokens that the function requires.\n * @return an array of `string`s\n */\n annotate: function (fn) {\n if (!(0,_common_index__WEBPACK_IMPORTED_MODULE_0__.isInjectable)(fn))\n throw new Error(\"Not an injectable function: \" + fn);\n if (fn && fn.$inject)\n return fn.$inject;\n if ((0,_common_index__WEBPACK_IMPORTED_MODULE_0__.isArray)(fn))\n return fn.slice(0, -1);\n var fnStr = fn.toString().replace(STRIP_COMMENTS, '');\n var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES);\n return result || [];\n },\n};\n//# sourceMappingURL=injector.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/injector.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/interface.js": /*!******************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/interface.js ***! \******************************************************************/ /***/ (() => { eval("//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/interface.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js": /*!*****************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MemoryLocationConfig\": () => (/* binding */ MemoryLocationConfig)\n/* harmony export */ });\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n\n\n/** A `LocationConfig` mock that gets/sets all config from an in-memory object */\nvar MemoryLocationConfig = /** @class */ (function () {\n function MemoryLocationConfig() {\n var _this = this;\n this.dispose = _common_common__WEBPACK_IMPORTED_MODULE_1__.noop;\n this._baseHref = '';\n this._port = 80;\n this._protocol = 'http';\n this._host = 'localhost';\n this._hashPrefix = '';\n this.port = function () { return _this._port; };\n this.protocol = function () { return _this._protocol; };\n this.host = function () { return _this._host; };\n this.baseHref = function () { return _this._baseHref; };\n this.html5Mode = function () { return false; };\n this.hashPrefix = function (newval) { return ((0,_common_predicates__WEBPACK_IMPORTED_MODULE_0__.isDefined)(newval) ? (_this._hashPrefix = newval) : _this._hashPrefix); };\n }\n return MemoryLocationConfig;\n}());\n\n//# sourceMappingURL=memoryLocationConfig.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js": /*!******************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MemoryLocationService\": () => (/* binding */ MemoryLocationService)\n/* harmony export */ });\n/* harmony import */ var _baseLocationService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseLocationService */ \"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n/** A `LocationServices` that gets/sets the current location from an in-memory object */\nvar MemoryLocationService = /** @class */ (function (_super) {\n __extends(MemoryLocationService, _super);\n function MemoryLocationService(router) {\n return _super.call(this, router, true) || this;\n }\n MemoryLocationService.prototype._get = function () {\n return this._url;\n };\n MemoryLocationService.prototype._set = function (state, title, url, replace) {\n this._url = url;\n };\n return MemoryLocationService;\n}(_baseLocationService__WEBPACK_IMPORTED_MODULE_0__.BaseLocationServices));\n\n//# sourceMappingURL=memoryLocationService.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js": /*!****************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"hashLocationPlugin\": () => (/* binding */ hashLocationPlugin),\n/* harmony export */ \"memoryLocationPlugin\": () => (/* binding */ memoryLocationPlugin),\n/* harmony export */ \"pushStateLocationPlugin\": () => (/* binding */ pushStateLocationPlugin),\n/* harmony export */ \"servicesPlugin\": () => (/* binding */ servicesPlugin)\n/* harmony export */ });\n/* harmony import */ var _browserLocationConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browserLocationConfig */ \"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js\");\n/* harmony import */ var _hashLocationService__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hashLocationService */ \"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js\");\n/* harmony import */ var _pushStateLocationService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pushStateLocationService */ \"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js\");\n/* harmony import */ var _memoryLocationService__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./memoryLocationService */ \"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js\");\n/* harmony import */ var _memoryLocationConfig__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./memoryLocationConfig */ \"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js\");\n/* harmony import */ var _injector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./injector */ \"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js\");\n/* harmony import */ var _q__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./q */ \"./node_modules/@uirouter/core/lib-esm/vanilla/q.js\");\n/* harmony import */ var _common_coreservices__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/coreservices */ \"./node_modules/@uirouter/core/lib-esm/common/coreservices.js\");\n\n\n\n\n\n\n\n\n\nfunction servicesPlugin(router) {\n _common_coreservices__WEBPACK_IMPORTED_MODULE_8__.services.$injector = _injector__WEBPACK_IMPORTED_MODULE_6__.$injector;\n _common_coreservices__WEBPACK_IMPORTED_MODULE_8__.services.$q = _q__WEBPACK_IMPORTED_MODULE_7__.$q;\n return { name: 'vanilla.services', $q: _q__WEBPACK_IMPORTED_MODULE_7__.$q, $injector: _injector__WEBPACK_IMPORTED_MODULE_6__.$injector, dispose: function () { return null; } };\n}\n/** A `UIRouterPlugin` uses the browser hash to get/set the current location */\nvar hashLocationPlugin = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.locationPluginFactory)('vanilla.hashBangLocation', false, _hashLocationService__WEBPACK_IMPORTED_MODULE_1__.HashLocationService, _browserLocationConfig__WEBPACK_IMPORTED_MODULE_0__.BrowserLocationConfig);\n/** A `UIRouterPlugin` that gets/sets the current location using the browser's `location` and `history` apis */\nvar pushStateLocationPlugin = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.locationPluginFactory)('vanilla.pushStateLocation', true, _pushStateLocationService__WEBPACK_IMPORTED_MODULE_3__.PushStateLocationService, _browserLocationConfig__WEBPACK_IMPORTED_MODULE_0__.BrowserLocationConfig);\n/** A `UIRouterPlugin` that gets/sets the current location from an in-memory object */\nvar memoryLocationPlugin = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.locationPluginFactory)('vanilla.memoryLocation', false, _memoryLocationService__WEBPACK_IMPORTED_MODULE_4__.MemoryLocationService, _memoryLocationConfig__WEBPACK_IMPORTED_MODULE_5__.MemoryLocationConfig);\n//# sourceMappingURL=plugins.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js": /*!*********************************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js ***! \*********************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PushStateLocationService\": () => (/* binding */ PushStateLocationService)\n/* harmony export */ });\n/* harmony import */ var _baseLocationService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./baseLocationService */ \"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n/**\n * A `LocationServices` that gets/sets the current location using the browser's `location` and `history` apis\n *\n * Uses `history.pushState` and `history.replaceState`\n */\nvar PushStateLocationService = /** @class */ (function (_super) {\n __extends(PushStateLocationService, _super);\n function PushStateLocationService(router) {\n var _this = _super.call(this, router, true) || this;\n _this._config = router.urlService.config;\n _common__WEBPACK_IMPORTED_MODULE_1__.root.addEventListener('popstate', _this._listener, false);\n return _this;\n }\n /**\n * Gets the base prefix without:\n * - trailing slash\n * - trailing filename\n * - protocol and hostname\n *\n * If , this returns '/base'.\n * If , this returns '/foo/base'.\n * If , this returns '/base'.\n * If , this returns '/base'.\n * If , this returns ''.\n * If , this returns ''.\n * If , this returns ''.\n *\n * See: https://html.spec.whatwg.org/dev/semantics.html#the-base-element\n */\n PushStateLocationService.prototype._getBasePrefix = function () {\n return (0,_common__WEBPACK_IMPORTED_MODULE_1__.stripLastPathElement)(this._config.baseHref());\n };\n PushStateLocationService.prototype._get = function () {\n var _a = this._location, pathname = _a.pathname, hash = _a.hash, search = _a.search;\n search = (0,_common__WEBPACK_IMPORTED_MODULE_1__.splitQuery)(search)[1]; // strip ? if found\n hash = (0,_common__WEBPACK_IMPORTED_MODULE_1__.splitHash)(hash)[1]; // strip # if found\n var basePrefix = this._getBasePrefix();\n var exactBaseHrefMatch = pathname === this._config.baseHref();\n var startsWithBase = pathname.substr(0, basePrefix.length) === basePrefix;\n pathname = exactBaseHrefMatch ? '/' : startsWithBase ? pathname.substring(basePrefix.length) : pathname;\n return pathname + (search ? '?' + search : '') + (hash ? '#' + hash : '');\n };\n PushStateLocationService.prototype._set = function (state, title, url, replace) {\n var basePrefix = this._getBasePrefix();\n var slash = url && url[0] !== '/' ? '/' : '';\n var fullUrl = url === '' || url === '/' ? this._config.baseHref() : basePrefix + slash + url;\n if (replace) {\n this._history.replaceState(state, title, fullUrl);\n }\n else {\n this._history.pushState(state, title, fullUrl);\n }\n };\n PushStateLocationService.prototype.dispose = function (router) {\n _super.prototype.dispose.call(this, router);\n _common__WEBPACK_IMPORTED_MODULE_1__.root.removeEventListener('popstate', this._listener);\n };\n return PushStateLocationService;\n}(_baseLocationService__WEBPACK_IMPORTED_MODULE_0__.BaseLocationServices));\n\n//# sourceMappingURL=pushStateLocationService.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/q.js": /*!**********************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/q.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"$q\": () => (/* binding */ $q)\n/* harmony export */ });\n/* harmony import */ var _common_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/index */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n\n/**\n * An angular1-like promise api\n *\n * This object implements four methods similar to the\n * [angular 1 promise api](https://docs.angularjs.org/api/ng/service/$q)\n *\n * UI-Router evolved from an angular 1 library to a framework agnostic library.\n * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection.\n *\n * This API provides native ES6 promise support wrapped as a $q-like API.\n * Internally, UI-Router uses this $q object to perform promise operations.\n * The `angular-ui-router` (ui-router for angular 1) uses the $q API provided by angular.\n *\n * $q-like promise api\n */\nvar $q = {\n /** Normalizes a value as a promise */\n when: function (val) { return new Promise(function (resolve, reject) { return resolve(val); }); },\n /** Normalizes a value as a promise rejection */\n reject: function (val) {\n return new Promise(function (resolve, reject) {\n reject(val);\n });\n },\n /** @returns a deferred object, which has `resolve` and `reject` functions */\n defer: function () {\n var deferred = {};\n deferred.promise = new Promise(function (resolve, reject) {\n deferred.resolve = resolve;\n deferred.reject = reject;\n });\n return deferred;\n },\n /** Like Promise.all(), but also supports object key/promise notation like $q */\n all: function (promises) {\n if ((0,_common_index__WEBPACK_IMPORTED_MODULE_0__.isArray)(promises)) {\n return Promise.all(promises);\n }\n if ((0,_common_index__WEBPACK_IMPORTED_MODULE_0__.isObject)(promises)) {\n // Convert promises map to promises array.\n // When each promise resolves, map it to a tuple { key: key, val: val }\n var chain = Object.keys(promises).map(function (key) { return promises[key].then(function (val) { return ({ key: key, val: val }); }); });\n // Then wait for all promises to resolve, and convert them back to an object\n return $q.all(chain).then(function (values) {\n return values.reduce(function (acc, tuple) {\n acc[tuple.key] = tuple.val;\n return acc;\n }, {});\n });\n }\n },\n};\n//# sourceMappingURL=q.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/q.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/vanilla/utils.js": /*!**************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/vanilla/utils.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"buildUrl\": () => (/* binding */ buildUrl),\n/* harmony export */ \"getParams\": () => (/* binding */ getParams),\n/* harmony export */ \"keyValsToObjectR\": () => (/* binding */ keyValsToObjectR),\n/* harmony export */ \"locationPluginFactory\": () => (/* binding */ locationPluginFactory),\n/* harmony export */ \"parseUrl\": () => (/* binding */ parseUrl)\n/* harmony export */ });\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common */ \"./node_modules/@uirouter/core/lib-esm/common/index.js\");\n\nvar keyValsToObjectR = function (accum, _a) {\n var key = _a[0], val = _a[1];\n if (!accum.hasOwnProperty(key)) {\n accum[key] = val;\n }\n else if ((0,_common__WEBPACK_IMPORTED_MODULE_0__.isArray)(accum[key])) {\n accum[key].push(val);\n }\n else {\n accum[key] = [accum[key], val];\n }\n return accum;\n};\nvar getParams = function (queryString) {\n return queryString.split('&').filter(_common__WEBPACK_IMPORTED_MODULE_0__.identity).map(_common__WEBPACK_IMPORTED_MODULE_0__.splitEqual).reduce(keyValsToObjectR, {});\n};\nfunction parseUrl(url) {\n var orEmptyString = function (x) { return x || ''; };\n var _a = (0,_common__WEBPACK_IMPORTED_MODULE_0__.splitHash)(url).map(orEmptyString), beforehash = _a[0], hash = _a[1];\n var _b = (0,_common__WEBPACK_IMPORTED_MODULE_0__.splitQuery)(beforehash).map(orEmptyString), path = _b[0], search = _b[1];\n return { path: path, search: search, hash: hash, url: url };\n}\nvar buildUrl = function (loc) {\n var path = loc.path();\n var searchObject = loc.search();\n var hash = loc.hash();\n var search = Object.keys(searchObject)\n .map(function (key) {\n var param = searchObject[key];\n var vals = (0,_common__WEBPACK_IMPORTED_MODULE_0__.isArray)(param) ? param : [param];\n return vals.map(function (val) { return key + '=' + val; });\n })\n .reduce(_common__WEBPACK_IMPORTED_MODULE_0__.unnestR, [])\n .join('&');\n return path + (search ? '?' + search : '') + (hash ? '#' + hash : '');\n};\nfunction locationPluginFactory(name, isHtml5, serviceClass, configurationClass) {\n return function (uiRouter) {\n var service = (uiRouter.locationService = new serviceClass(uiRouter));\n var configuration = (uiRouter.locationConfig = new configurationClass(uiRouter, isHtml5));\n function dispose(router) {\n router.dispose(service);\n router.dispose(configuration);\n }\n return { name: name, service: service, configuration: configuration, dispose: dispose };\n };\n}\n//# sourceMappingURL=utils.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/view/index.js": /*!***********************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/view/index.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ViewService\": () => (/* reexport safe */ _view__WEBPACK_IMPORTED_MODULE_1__.ViewService)\n/* harmony export */ });\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interface */ \"./node_modules/@uirouter/core/lib-esm/view/interface.js\");\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_interface__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};\n/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _interface__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== \"default\") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _interface__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]\n/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);\n/* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view */ \"./node_modules/@uirouter/core/lib-esm/view/view.js\");\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/view/index.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/view/interface.js": /*!***************************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/view/interface.js ***! \***************************************************************/ /***/ (() => { eval("//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/view/interface.js?"); /***/ }), /***/ "./node_modules/@uirouter/core/lib-esm/view/view.js": /*!**********************************************************!*\ !*** ./node_modules/@uirouter/core/lib-esm/view/view.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ViewService\": () => (/* binding */ ViewService)\n/* harmony export */ });\n/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ \"./node_modules/@uirouter/core/lib-esm/common/common.js\");\n/* harmony import */ var _common_hof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hof */ \"./node_modules/@uirouter/core/lib-esm/common/hof.js\");\n/* harmony import */ var _common_predicates__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/predicates */ \"./node_modules/@uirouter/core/lib-esm/common/predicates.js\");\n/* harmony import */ var _common_trace__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/trace */ \"./node_modules/@uirouter/core/lib-esm/common/trace.js\");\n\n\n\n\n/**\n * The View service\n *\n * This service pairs existing `ui-view` components (which live in the DOM)\n * with view configs (from the state declaration objects: [[StateDeclaration.views]]).\n *\n * - After a successful Transition, the views from the newly entered states are activated via [[activateViewConfig]].\n * The views from exited states are deactivated via [[deactivateViewConfig]].\n * (See: the [[registerActivateViews]] Transition Hook)\n *\n * - As `ui-view` components pop in and out of existence, they register themselves using [[registerUIView]].\n *\n * - When the [[sync]] function is called, the registered `ui-view`(s) ([[ActiveUIView]])\n * are configured with the matching [[ViewConfig]](s)\n *\n */\nvar ViewService = /** @class */ (function () {\n /** @internal */\n function ViewService(/** @internal */ router) {\n var _this = this;\n this.router = router;\n /** @internal */ this._uiViews = [];\n /** @internal */ this._viewConfigs = [];\n /** @internal */ this._viewConfigFactories = {};\n /** @internal */ this._listeners = [];\n /** @internal */\n this._pluginapi = {\n _rootViewContext: this._rootViewContext.bind(this),\n _viewConfigFactory: this._viewConfigFactory.bind(this),\n _registeredUIView: function (id) { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.find)(_this._uiViews, function (view) { return _this.router.$id + \".\" + view.id === id; }); },\n _registeredUIViews: function () { return _this._uiViews; },\n _activeViewConfigs: function () { return _this._viewConfigs; },\n _onSync: function (listener) {\n _this._listeners.push(listener);\n return function () { return (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(_this._listeners, listener); };\n },\n };\n }\n /**\n * Normalizes a view's name from a state.views configuration block.\n *\n * This should be used by a framework implementation to calculate the values for\n * [[_ViewDeclaration.$uiViewName]] and [[_ViewDeclaration.$uiViewContextAnchor]].\n *\n * @param context the context object (state declaration) that the view belongs to\n * @param rawViewName the name of the view, as declared in the [[StateDeclaration.views]]\n *\n * @returns the normalized uiViewName and uiViewContextAnchor that the view targets\n */\n ViewService.normalizeUIViewTarget = function (context, rawViewName) {\n if (rawViewName === void 0) { rawViewName = ''; }\n // TODO: Validate incoming view name with a regexp to allow:\n // ex: \"view.name@foo.bar\" , \"^.^.view.name\" , \"view.name@^.^\" , \"\" ,\n // \"@\" , \"$default@^\" , \"!$default.$default\" , \"!foo.bar\"\n var viewAtContext = rawViewName.split('@');\n var uiViewName = viewAtContext[0] || '$default'; // default to unnamed view\n var uiViewContextAnchor = (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isString)(viewAtContext[1]) ? viewAtContext[1] : '^'; // default to parent context\n // Handle relative view-name sugar syntax.\n // Matches rawViewName \"^.^.^.foo.bar\" into array: [\"^.^.^.foo.bar\", \"^.^.^\", \"foo.bar\"],\n var relativeViewNameSugar = /^(\\^(?:\\.\\^)*)\\.(.*$)/.exec(uiViewName);\n if (relativeViewNameSugar) {\n // Clobbers existing contextAnchor (rawViewName validation will fix this)\n uiViewContextAnchor = relativeViewNameSugar[1]; // set anchor to \"^.^.^\"\n uiViewName = relativeViewNameSugar[2]; // set view-name to \"foo.bar\"\n }\n if (uiViewName.charAt(0) === '!') {\n uiViewName = uiViewName.substr(1);\n uiViewContextAnchor = ''; // target absolutely from root\n }\n // handle parent relative targeting \"^.^.^\"\n var relativeMatch = /^(\\^(?:\\.\\^)*)$/;\n if (relativeMatch.exec(uiViewContextAnchor)) {\n var anchorState = uiViewContextAnchor.split('.').reduce(function (anchor, x) { return anchor.parent; }, context);\n uiViewContextAnchor = anchorState.name;\n }\n else if (uiViewContextAnchor === '.') {\n uiViewContextAnchor = context.name;\n }\n return { uiViewName: uiViewName, uiViewContextAnchor: uiViewContextAnchor };\n };\n /** @internal */\n ViewService.prototype._rootViewContext = function (context) {\n return (this._rootContext = context || this._rootContext);\n };\n /** @internal */\n ViewService.prototype._viewConfigFactory = function (viewType, factory) {\n this._viewConfigFactories[viewType] = factory;\n };\n ViewService.prototype.createViewConfig = function (path, decl) {\n var cfgFactory = this._viewConfigFactories[decl.$type];\n if (!cfgFactory)\n throw new Error('ViewService: No view config factory registered for type ' + decl.$type);\n var cfgs = cfgFactory(path, decl);\n return (0,_common_predicates__WEBPACK_IMPORTED_MODULE_2__.isArray)(cfgs) ? cfgs : [cfgs];\n };\n /**\n * Deactivates a ViewConfig.\n *\n * This function deactivates a `ViewConfig`.\n * After calling [[sync]], it will un-pair from any `ui-view` with which it is currently paired.\n *\n * @param viewConfig The ViewConfig view to deregister.\n */\n ViewService.prototype.deactivateViewConfig = function (viewConfig) {\n _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceEvent('<- Removing', viewConfig);\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(this._viewConfigs, viewConfig);\n };\n ViewService.prototype.activateViewConfig = function (viewConfig) {\n _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceEvent('-> Registering', viewConfig);\n this._viewConfigs.push(viewConfig);\n };\n ViewService.prototype.sync = function () {\n var _this = this;\n var uiViewsByFqn = this._uiViews.map(function (uiv) { return [uiv.fqn, uiv]; }).reduce(_common_common__WEBPACK_IMPORTED_MODULE_0__.applyPairs, {});\n // Return a weighted depth value for a uiView.\n // The depth is the nesting depth of ui-views (based on FQN; times 10,000)\n // plus the depth of the state that is populating the uiView\n function uiViewDepth(uiView) {\n var stateDepth = function (context) { return (context && context.parent ? stateDepth(context.parent) + 1 : 1); };\n return uiView.fqn.split('.').length * 10000 + stateDepth(uiView.creationContext);\n }\n // Return the ViewConfig's context's depth in the context tree.\n function viewConfigDepth(config) {\n var context = config.viewDecl.$context, count = 0;\n while (++count && context.parent)\n context = context.parent;\n return count;\n }\n // Given a depth function, returns a compare function which can return either ascending or descending order\n var depthCompare = (0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.curry)(function (depthFn, posNeg, left, right) { return posNeg * (depthFn(left) - depthFn(right)); });\n var matchingConfigPair = function (uiView) {\n var matchingConfigs = _this._viewConfigs.filter(ViewService.matches(uiViewsByFqn, uiView));\n if (matchingConfigs.length > 1) {\n // This is OK. Child states can target a ui-view that the parent state also targets (the child wins)\n // Sort by depth and return the match from the deepest child\n // console.log(`Multiple matching view configs for ${uiView.fqn}`, matchingConfigs);\n matchingConfigs.sort(depthCompare(viewConfigDepth, -1)); // descending\n }\n return { uiView: uiView, viewConfig: matchingConfigs[0] };\n };\n var configureUIView = function (tuple) {\n // If a parent ui-view is reconfigured, it could destroy child ui-views.\n // Before configuring a child ui-view, make sure it's still in the active uiViews array.\n if (_this._uiViews.indexOf(tuple.uiView) !== -1)\n tuple.uiView.configUpdated(tuple.viewConfig);\n };\n // Sort views by FQN and state depth. Process uiviews nearest the root first.\n var uiViewTuples = this._uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair);\n var matchedViewConfigs = uiViewTuples.map(function (tuple) { return tuple.viewConfig; });\n var unmatchedConfigTuples = this._viewConfigs\n .filter(function (config) { return !(0,_common_common__WEBPACK_IMPORTED_MODULE_0__.inArray)(matchedViewConfigs, config); })\n .map(function (viewConfig) { return ({ uiView: undefined, viewConfig: viewConfig }); });\n uiViewTuples.forEach(configureUIView);\n var allTuples = uiViewTuples.concat(unmatchedConfigTuples);\n this._listeners.forEach(function (cb) { return cb(allTuples); });\n _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewSync(allTuples);\n };\n /**\n * Registers a `ui-view` component\n *\n * When a `ui-view` component is created, it uses this method to register itself.\n * After registration the [[sync]] method is used to ensure all `ui-view` are configured with the proper [[ViewConfig]].\n *\n * Note: the `ui-view` component uses the `ViewConfig` to determine what view should be loaded inside the `ui-view`,\n * and what the view's state context is.\n *\n * Note: There is no corresponding `deregisterUIView`.\n * A `ui-view` should hang on to the return value of `registerUIView` and invoke it to deregister itself.\n *\n * @param uiView The metadata for a UIView\n * @return a de-registration function used when the view is destroyed.\n */\n ViewService.prototype.registerUIView = function (uiView) {\n _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceUIViewEvent('-> Registering', uiView);\n var uiViews = this._uiViews;\n var fqnAndTypeMatches = function (uiv) { return uiv.fqn === uiView.fqn && uiv.$type === uiView.$type; };\n if (uiViews.filter(fqnAndTypeMatches).length)\n _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceUIViewEvent('!!!! duplicate uiView named:', uiView);\n uiViews.push(uiView);\n this.sync();\n return function () {\n var idx = uiViews.indexOf(uiView);\n if (idx === -1) {\n _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceUIViewEvent('Tried removing non-registered uiView', uiView);\n return;\n }\n _common_trace__WEBPACK_IMPORTED_MODULE_3__.trace.traceViewServiceUIViewEvent('<- Deregistering', uiView);\n (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.removeFrom)(uiViews)(uiView);\n };\n };\n /**\n * Returns the list of views currently available on the page, by fully-qualified name.\n *\n * @return {Array} Returns an array of fully-qualified view names.\n */\n ViewService.prototype.available = function () {\n return this._uiViews.map((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('fqn'));\n };\n /**\n * Returns the list of views on the page containing loaded content.\n *\n * @return {Array} Returns an array of fully-qualified view names.\n */\n ViewService.prototype.active = function () {\n return this._uiViews.filter((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('$config')).map((0,_common_hof__WEBPACK_IMPORTED_MODULE_1__.prop)('name'));\n };\n /**\n * Given a ui-view and a ViewConfig, determines if they \"match\".\n *\n * A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in\n * the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of.\n *\n * A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or\n * can be a segmented ui-view path, describing a portion of a ui-view fqn.\n *\n * In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type\n *\n * If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if:\n * - the ui-view's name matches the ViewConfig's target name\n * - the ui-view's context matches the ViewConfig's anchor\n *\n * If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if:\n * - There exists a parent ui-view where:\n * - the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name\n * - the parent ui-view's context matches the ViewConfig's anchor\n * - And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn\n *\n * Example:\n *\n * DOM:\n * \n * \n * \n * \n * \n * \n * \n * \n *\n * uiViews: [\n * { fqn: \"$default\", creationContext: { name: \"\" } },\n * { fqn: \"$default.foo\", creationContext: { name: \"A\" } },\n * { fqn: \"$default.foo.$default\", creationContext: { name: \"A.B\" } }\n * { fqn: \"$default.foo.$default.bar\", creationContext: { name: \"A.B.C\" } }\n * ]\n *\n * These four view configs all match the ui-view with the fqn: \"$default.foo.$default.bar\":\n *\n * - ViewConfig1: { uiViewName: \"bar\", uiViewContextAnchor: \"A.B.C\" }\n * - ViewConfig2: { uiViewName: \"$default.bar\", uiViewContextAnchor: \"A.B\" }\n * - ViewConfig3: { uiViewName: \"foo.$default.bar\", uiViewContextAnchor: \"A\" }\n * - ViewConfig4: { uiViewName: \"$default.foo.$default.bar\", uiViewContextAnchor: \"\" }\n *\n * Using ViewConfig3 as an example, it matches the ui-view with fqn \"$default.foo.$default.bar\" because:\n * - The ViewConfig's segmented target name is: [ \"foo\", \"$default\", \"bar\" ]\n * - There exists a parent ui-view (which has fqn: \"$default.foo\") where:\n * - the parent ui-view's name \"foo\" matches the first segment \"foo\" of the ViewConfig's target name\n * - the parent ui-view's context \"A\" matches the ViewConfig's anchor context \"A\"\n * - And the remaining segments [ \"$default\", \"bar\" ].join(\".\"_ of the ViewConfig's target name match\n * the tail of the ui-view's fqn \"default.bar\"\n *\n * @internal\n */\n ViewService.matches = function (uiViewsByFqn, uiView) { return function (viewConfig) {\n // Don't supply an ng1 ui-view with an ng2 ViewConfig, etc\n if (uiView.$type !== viewConfig.viewDecl.$type)\n return false;\n // Split names apart from both viewConfig and uiView into segments\n var vc = viewConfig.viewDecl;\n var vcSegments = vc.$uiViewName.split('.');\n var uivSegments = uiView.fqn.split('.');\n // Check if the tails of the segment arrays match. ex, these arrays' tails match:\n // vc: [\"foo\", \"bar\"], uiv fqn: [\"$default\", \"foo\", \"bar\"]\n if (!(0,_common_common__WEBPACK_IMPORTED_MODULE_0__.equals)(vcSegments, uivSegments.slice(0 - vcSegments.length)))\n return false;\n // Now check if the fqn ending at the first segment of the viewConfig matches the context:\n // [\"$default\", \"foo\"].join(\".\") == \"$default.foo\", does the ui-view $default.foo context match?\n var negOffset = 1 - vcSegments.length || undefined;\n var fqnToFirstSegment = uivSegments.slice(0, negOffset).join('.');\n var uiViewContext = uiViewsByFqn[fqnToFirstSegment].creationContext;\n return vc.$uiViewContextAnchor === (uiViewContext && uiViewContext.name);\n }; };\n return ViewService;\n}());\n\n//# sourceMappingURL=view.js.map\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/@uirouter/core/lib-esm/view/view.js?"); /***/ }), /***/ "./node_modules/angucomplete-alt/angucomplete-alt.js": /*!***********************************************************!*\ !*** ./node_modules/angucomplete-alt/angucomplete-alt.js ***! \***********************************************************/ /***/ ((module, exports, __webpack_require__) => { eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n * angucomplete-alt\n * Autocomplete directive for AngularJS\n * This is a fork of Daryl Rowland's angucomplete with some extra features.\n * By Hidenari Nozaki\n */\n\n/*! Copyright (c) 2014 Hidenari Nozaki and contributors | Licensed under the MIT license */\n\n(function (root, factory) {\n 'use strict';\n if ( true && module.exports) {\n // CommonJS\n module.exports = factory(__webpack_require__(/*! angular */ \"./node_modules/angular/index.js\"));\n } else if (true) {\n // AMD\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! angular */ \"./node_modules/angular/index.js\")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(window, function (angular) {\n 'use strict';\n\n angular.module('angucomplete-alt', []).directive('angucompleteAlt', ['$q', '$parse', '$http', '$sce', '$timeout', '$templateCache', '$interpolate', function ($q, $parse, $http, $sce, $timeout, $templateCache, $interpolate) {\n // keyboard events\n var KEY_DW = 40;\n var KEY_RT = 39;\n var KEY_UP = 38;\n var KEY_LF = 37;\n var KEY_ES = 27;\n var KEY_EN = 13;\n var KEY_TAB = 9;\n\n var MIN_LENGTH = 3;\n var MAX_LENGTH = 524288; // the default max length per the html maxlength attribute\n var PAUSE = 500;\n var BLUR_TIMEOUT = 200;\n\n // string constants\n var REQUIRED_CLASS = 'autocomplete-required';\n var TEXT_SEARCHING = 'Searching...';\n var TEXT_NORESULTS = 'No results found';\n var TEMPLATE_URL = '/angucomplete-alt/index.html';\n\n // Set the default template for this directive\n $templateCache.put(TEMPLATE_URL,\n '
    ' +\n ' ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    ' +\n ' ' +\n '
    ' +\n '
    ' +\n '
    ' +\n '
    {{ result.title }}
    ' +\n '
    ' +\n '
    {{result.description}}
    ' +\n '
    ' +\n '
    ' +\n '
    '\n );\n\n function link(scope, elem, attrs, ctrl) {\n var inputField = elem.find('input');\n var minlength = MIN_LENGTH;\n var searchTimer = null;\n var hideTimer;\n var requiredClassName = REQUIRED_CLASS;\n var responseFormatter;\n var validState = null;\n var httpCanceller = null;\n var httpCallInProgress = false;\n var dd = elem[0].querySelector('.angucomplete-dropdown');\n var isScrollOn = false;\n var mousedownOn = null;\n var unbindInitialValue;\n var displaySearching;\n var displayNoResults;\n\n elem.on('mousedown', function(event) {\n if (event.target.id) {\n mousedownOn = event.target.id;\n if (mousedownOn === scope.id + '_dropdown') {\n document.body.addEventListener('click', clickoutHandlerForDropdown);\n }\n }\n else {\n mousedownOn = event.target.className;\n }\n });\n\n scope.currentIndex = scope.focusFirst ? 0 : null;\n scope.searching = false;\n unbindInitialValue = scope.$watch('initialValue', function(newval) {\n if (newval) {\n // remove scope listener\n unbindInitialValue();\n // change input\n handleInputChange(newval, true);\n }\n });\n\n scope.$watch('fieldRequired', function(newval, oldval) {\n if (newval !== oldval) {\n if (!newval) {\n ctrl[scope.inputName].$setValidity(requiredClassName, true);\n }\n else if (!validState || scope.currentIndex === -1) {\n handleRequired(false);\n }\n else {\n handleRequired(true);\n }\n }\n });\n\n scope.$on('angucomplete-alt:clearInput', function (event, elementId) {\n if (!elementId || elementId === scope.id) {\n scope.searchStr = null;\n callOrAssign();\n handleRequired(false);\n clearResults();\n }\n });\n\n scope.$on('angucomplete-alt:changeInput', function (event, elementId, newval) {\n if (!!elementId && elementId === scope.id) {\n handleInputChange(newval);\n }\n });\n\n function handleInputChange(newval, initial) {\n if (newval) {\n if (typeof newval === 'object') {\n scope.searchStr = extractTitle(newval);\n callOrAssign({originalObject: newval});\n } else if (typeof newval === 'string' && newval.length > 0) {\n scope.searchStr = newval;\n } else {\n if (console && console.error) {\n console.error('Tried to set ' + (!!initial ? 'initial' : '') + ' value of angucomplete to', newval, 'which is an invalid value');\n }\n }\n\n handleRequired(true);\n }\n }\n\n // #194 dropdown list not consistent in collapsing (bug).\n function clickoutHandlerForDropdown(event) {\n mousedownOn = null;\n scope.hideResults(event);\n document.body.removeEventListener('click', clickoutHandlerForDropdown);\n }\n\n // for IE8 quirkiness about event.which\n function ie8EventNormalizer(event) {\n return event.which ? event.which : event.keyCode;\n }\n\n function callOrAssign(value) {\n if (typeof scope.selectedObject === 'function') {\n scope.selectedObject(value, scope.selectedObjectData);\n }\n else {\n scope.selectedObject = value;\n }\n\n if (value) {\n handleRequired(true);\n }\n else {\n handleRequired(false);\n }\n }\n\n function callFunctionOrIdentity(fn) {\n return function(data) {\n return scope[fn] ? scope[fn](data) : data;\n };\n }\n\n function setInputString(str) {\n callOrAssign({originalObject: str});\n\n if (scope.clearSelected) {\n scope.searchStr = null;\n }\n clearResults();\n }\n\n function extractTitle(data) {\n // split title fields and run extractValue for each and join with ' '\n return scope.titleField.split(',')\n .map(function(field) {\n return extractValue(data, field);\n })\n .join(' ');\n }\n\n function extractValue(obj, key) {\n var keys, result;\n if (key) {\n keys= key.split('.');\n result = obj;\n for (var i = 0; i < keys.length; i++) {\n result = result[keys[i]];\n }\n }\n else {\n result = obj;\n }\n return result;\n }\n\n function findMatchString(target, str) {\n var result, matches, re;\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n // Escape user input to be treated as a literal string within a regular expression\n re = new RegExp(str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'i');\n if (!target) { return; }\n if (!target.match || !target.replace) { target = target.toString(); }\n matches = target.match(re);\n if (matches) {\n result = target.replace(re,\n ''+ matches[0] +'');\n }\n else {\n result = target;\n }\n return $sce.trustAsHtml(result);\n }\n\n function handleRequired(valid) {\n scope.notEmpty = valid;\n validState = scope.searchStr;\n if (scope.fieldRequired && ctrl && scope.inputName) {\n ctrl[scope.inputName].$setValidity(requiredClassName, valid);\n }\n }\n\n function keyupHandler(event) {\n var which = ie8EventNormalizer(event);\n if (which === KEY_LF || which === KEY_RT) {\n // do nothing\n return;\n }\n\n if (which === KEY_UP || which === KEY_EN) {\n event.preventDefault();\n }\n else if (which === KEY_DW) {\n event.preventDefault();\n if (!scope.showDropdown && scope.searchStr && scope.searchStr.length >= minlength) {\n initResults();\n scope.searching = true;\n searchTimerComplete(scope.searchStr);\n }\n }\n else if (which === KEY_ES) {\n clearResults();\n scope.$apply(function() {\n inputField.val(scope.searchStr);\n });\n }\n else {\n if (minlength === 0 && !scope.searchStr) {\n return;\n }\n\n if (!scope.searchStr || scope.searchStr === '') {\n scope.showDropdown = false;\n } else if (scope.searchStr.length >= minlength) {\n initResults();\n\n if (searchTimer) {\n $timeout.cancel(searchTimer);\n }\n\n scope.searching = true;\n\n searchTimer = $timeout(function() {\n searchTimerComplete(scope.searchStr);\n }, scope.pause);\n }\n\n if (validState && validState !== scope.searchStr && !scope.clearSelected) {\n scope.$apply(function() {\n callOrAssign();\n });\n }\n }\n }\n\n function handleOverrideSuggestions(event) {\n if (scope.overrideSuggestions &&\n !(scope.selectedObject && scope.selectedObject.originalObject === scope.searchStr)) {\n if (event) {\n event.preventDefault();\n }\n\n // cancel search timer\n $timeout.cancel(searchTimer);\n // cancel http request\n cancelHttpRequest();\n\n setInputString(scope.searchStr);\n }\n }\n\n function dropdownRowOffsetHeight(row) {\n var css = getComputedStyle(row);\n return row.offsetHeight +\n parseInt(css.marginTop, 10) + parseInt(css.marginBottom, 10);\n }\n\n function dropdownHeight() {\n return dd.getBoundingClientRect().top +\n parseInt(getComputedStyle(dd).maxHeight, 10);\n }\n\n function dropdownRow() {\n return elem[0].querySelectorAll('.angucomplete-row')[scope.currentIndex];\n }\n\n function dropdownRowTop() {\n return dropdownRow().getBoundingClientRect().top -\n (dd.getBoundingClientRect().top +\n parseInt(getComputedStyle(dd).paddingTop, 10));\n }\n\n function dropdownScrollTopTo(offset) {\n dd.scrollTop = dd.scrollTop + offset;\n }\n\n function updateInputField(){\n var current = scope.results[scope.currentIndex];\n if (scope.matchClass) {\n inputField.val(extractTitle(current.originalObject));\n }\n else {\n inputField.val(current.title);\n }\n }\n\n function keydownHandler(event) {\n var which = ie8EventNormalizer(event);\n var row = null;\n var rowTop = null;\n\n if (which === KEY_EN && scope.results) {\n if (scope.currentIndex >= 0 && scope.currentIndex < scope.results.length) {\n event.preventDefault();\n scope.selectResult(scope.results[scope.currentIndex]);\n } else {\n handleOverrideSuggestions(event);\n clearResults();\n }\n scope.$apply();\n } else if (which === KEY_DW && scope.results) {\n event.preventDefault();\n if ((scope.currentIndex + 1) < scope.results.length && scope.showDropdown) {\n scope.$apply(function() {\n scope.currentIndex ++;\n updateInputField();\n });\n\n if (isScrollOn) {\n row = dropdownRow();\n if (dropdownHeight() < row.getBoundingClientRect().bottom) {\n dropdownScrollTopTo(dropdownRowOffsetHeight(row));\n }\n }\n }\n } else if (which === KEY_UP && scope.results) {\n event.preventDefault();\n if (scope.currentIndex >= 1) {\n scope.$apply(function() {\n scope.currentIndex --;\n updateInputField();\n });\n\n if (isScrollOn) {\n rowTop = dropdownRowTop();\n if (rowTop < 0) {\n dropdownScrollTopTo(rowTop - 1);\n }\n }\n }\n else if (scope.currentIndex === 0) {\n scope.$apply(function() {\n scope.currentIndex = -1;\n inputField.val(scope.searchStr);\n });\n }\n } else if (which === KEY_TAB) {\n if (scope.results && scope.results.length > 0 && scope.showDropdown) {\n if (scope.currentIndex === -1 && scope.overrideSuggestions) {\n // intentionally not sending event so that it does not\n // prevent default tab behavior\n handleOverrideSuggestions();\n }\n else {\n if (scope.currentIndex === -1) {\n scope.currentIndex = 0;\n }\n scope.selectResult(scope.results[scope.currentIndex]);\n scope.$digest();\n }\n }\n else {\n // no results\n // intentionally not sending event so that it does not\n // prevent default tab behavior\n if (scope.searchStr && scope.searchStr.length > 0) {\n handleOverrideSuggestions();\n }\n }\n } else if (which === KEY_ES) {\n // This is very specific to IE10/11 #272\n // without this, IE clears the input text\n event.preventDefault();\n }\n }\n\n function httpSuccessCallbackGen(str) {\n return function(responseData, status, headers, config) {\n // normalize return obejct from promise\n if (!status && !headers && !config && responseData.data) {\n responseData = responseData.data;\n }\n scope.searching = false;\n processResults(\n extractValue(responseFormatter(responseData), scope.remoteUrlDataField),\n str);\n };\n }\n\n function httpErrorCallback(errorRes, status, headers, config) {\n scope.searching = httpCallInProgress;\n\n // normalize return obejct from promise\n if (!status && !headers && !config) {\n status = errorRes.status;\n }\n\n // cancelled/aborted\n if (status === 0 || status === -1) { return; }\n if (scope.remoteUrlErrorCallback) {\n scope.remoteUrlErrorCallback(errorRes, status, headers, config);\n }\n else {\n if (console && console.error) {\n console.error('http error');\n }\n }\n }\n\n function cancelHttpRequest() {\n if (httpCanceller) {\n httpCanceller.resolve();\n }\n }\n\n function getRemoteResults(str) {\n var params = {},\n url = scope.remoteUrl + encodeURIComponent(str);\n if (scope.remoteUrlRequestFormatter) {\n params = {params: scope.remoteUrlRequestFormatter(str)};\n url = scope.remoteUrl;\n }\n if (!!scope.remoteUrlRequestWithCredentials) {\n params.withCredentials = true;\n }\n cancelHttpRequest();\n httpCanceller = $q.defer();\n params.timeout = httpCanceller.promise;\n httpCallInProgress = true;\n $http.get(url, params)\n .success(httpSuccessCallbackGen(str))\n .error(httpErrorCallback)\n .finally(function(){httpCallInProgress=false;});\n }\n\n function getRemoteResultsWithCustomHandler(str) {\n cancelHttpRequest();\n\n httpCanceller = $q.defer();\n\n scope.remoteApiHandler(str, httpCanceller.promise)\n .then(httpSuccessCallbackGen(str))\n .catch(httpErrorCallback);\n\n /* IE8 compatible\n scope.remoteApiHandler(str, httpCanceller.promise)\n ['then'](httpSuccessCallbackGen(str))\n ['catch'](httpErrorCallback);\n */\n }\n\n function clearResults() {\n scope.showDropdown = false;\n scope.results = [];\n if (dd) {\n dd.scrollTop = 0;\n }\n }\n\n function initResults() {\n scope.showDropdown = displaySearching;\n scope.currentIndex = scope.focusFirst ? 0 : -1;\n scope.results = [];\n }\n\n function getLocalResults(str) {\n var i, match, s, value,\n searchFields = scope.searchFields.split(','),\n matches = [];\n if (typeof scope.parseInput() !== 'undefined') {\n str = scope.parseInput()(str);\n }\n for (i = 0; i < scope.localData.length; i++) {\n match = false;\n\n for (s = 0; s < searchFields.length; s++) {\n value = extractValue(scope.localData[i], searchFields[s]) || '';\n match = match || (value.toString().toLowerCase().indexOf(str.toString().toLowerCase()) >= 0);\n }\n\n if (match) {\n matches[matches.length] = scope.localData[i];\n }\n }\n return matches;\n }\n\n function checkExactMatch(result, obj, str){\n if (!str) { return false; }\n for(var key in obj){\n if(obj[key].toLowerCase() === str.toLowerCase()){\n scope.selectResult(result);\n return true;\n }\n }\n return false;\n }\n\n function searchTimerComplete(str) {\n // Begin the search\n if (!str || str.length < minlength) {\n return;\n }\n if (scope.localData) {\n scope.$apply(function() {\n var matches;\n if (typeof scope.localSearch() !== 'undefined') {\n matches = scope.localSearch()(str, scope.localData);\n } else {\n matches = getLocalResults(str);\n }\n scope.searching = false;\n processResults(matches, str);\n });\n }\n else if (scope.remoteApiHandler) {\n getRemoteResultsWithCustomHandler(str);\n } else {\n getRemoteResults(str);\n }\n }\n\n function processResults(responseData, str) {\n var i, description, image, text, formattedText, formattedDesc;\n\n if (responseData && responseData.length > 0) {\n scope.results = [];\n\n for (i = 0; i < responseData.length; i++) {\n if (scope.titleField && scope.titleField !== '') {\n text = formattedText = extractTitle(responseData[i]);\n }\n\n description = '';\n if (scope.descriptionField) {\n description = formattedDesc = extractValue(responseData[i], scope.descriptionField);\n }\n\n image = '';\n if (scope.imageField) {\n image = extractValue(responseData[i], scope.imageField);\n }\n\n if (scope.matchClass) {\n formattedText = findMatchString(text, str);\n formattedDesc = findMatchString(description, str);\n }\n\n scope.results[scope.results.length] = {\n title: formattedText,\n description: formattedDesc,\n image: image,\n originalObject: responseData[i]\n };\n }\n\n } else {\n scope.results = [];\n }\n\n if (scope.autoMatch && scope.results.length === 1 &&\n checkExactMatch(scope.results[0],\n {title: text, desc: description || ''}, scope.searchStr)) {\n scope.showDropdown = false;\n } else if (scope.results.length === 0 && !displayNoResults) {\n scope.showDropdown = false;\n } else {\n scope.showDropdown = true;\n }\n }\n\n function showAll() {\n if (scope.localData) {\n scope.searching = false;\n processResults(scope.localData, '');\n }\n else if (scope.remoteApiHandler) {\n scope.searching = true;\n getRemoteResultsWithCustomHandler('');\n }\n else {\n scope.searching = true;\n getRemoteResults('');\n }\n }\n\n scope.onFocusHandler = function() {\n if (scope.focusIn) {\n scope.focusIn();\n }\n if (minlength === 0 && (!scope.searchStr || scope.searchStr.length === 0)) {\n scope.currentIndex = scope.focusFirst ? 0 : scope.currentIndex;\n scope.showDropdown = true;\n showAll();\n }\n };\n\n scope.hideResults = function() {\n if (mousedownOn &&\n (mousedownOn === scope.id + '_dropdown' ||\n mousedownOn.indexOf('angucomplete') >= 0)) {\n mousedownOn = null;\n }\n else {\n hideTimer = $timeout(function() {\n clearResults();\n scope.$apply(function() {\n if (scope.searchStr && scope.searchStr.length > 0) {\n inputField.val(scope.searchStr);\n }\n });\n }, BLUR_TIMEOUT);\n cancelHttpRequest();\n\n if (scope.focusOut) {\n scope.focusOut();\n }\n\n if (scope.overrideSuggestions) {\n if (scope.searchStr && scope.searchStr.length > 0 && scope.currentIndex === -1) {\n handleOverrideSuggestions();\n }\n }\n }\n };\n\n scope.resetHideResults = function() {\n if (hideTimer) {\n $timeout.cancel(hideTimer);\n }\n };\n\n scope.hoverRow = function(index) {\n scope.currentIndex = index;\n };\n\n scope.selectResult = function(result) {\n // Restore original values\n if (scope.matchClass) {\n result.title = extractTitle(result.originalObject);\n result.description = extractValue(result.originalObject, scope.descriptionField);\n }\n\n if (scope.clearSelected) {\n scope.searchStr = null;\n }\n else {\n scope.searchStr = result.title;\n }\n callOrAssign(result);\n clearResults();\n };\n\n scope.inputChangeHandler = function(str) {\n if (str.length < minlength) {\n cancelHttpRequest();\n clearResults();\n }\n else if (str.length === 0 && minlength === 0) {\n showAll();\n }\n\n if (scope.inputChanged) {\n str = scope.inputChanged(str);\n }\n return str;\n };\n\n // check required\n if (scope.fieldRequiredClass && scope.fieldRequiredClass !== '') {\n requiredClassName = scope.fieldRequiredClass;\n }\n\n // check min length\n if (scope.minlength && scope.minlength !== '') {\n minlength = parseInt(scope.minlength, 10);\n }\n\n // check pause time\n if (!scope.pause) {\n scope.pause = PAUSE;\n }\n\n // check clearSelected\n if (!scope.clearSelected) {\n scope.clearSelected = false;\n }\n\n // check override suggestions\n if (!scope.overrideSuggestions) {\n scope.overrideSuggestions = false;\n }\n\n // check required field\n if (scope.fieldRequired && ctrl) {\n // check initial value, if given, set validitity to true\n if (scope.initialValue) {\n handleRequired(true);\n }\n else {\n handleRequired(false);\n }\n }\n\n scope.inputType = attrs.type ? attrs.type : 'text';\n\n // set strings for \"Searching...\" and \"No results\"\n scope.textSearching = attrs.textSearching ? attrs.textSearching : TEXT_SEARCHING;\n scope.textNoResults = attrs.textNoResults ? attrs.textNoResults : TEXT_NORESULTS;\n displaySearching = scope.textSearching === 'false' ? false : true;\n displayNoResults = scope.textNoResults === 'false' ? false : true;\n\n // set max length (default to maxlength deault from html\n scope.maxlength = attrs.maxlength ? attrs.maxlength : MAX_LENGTH;\n\n // register events\n inputField.on('keydown', keydownHandler);\n inputField.on('keyup compositionend', keyupHandler);\n\n // set response formatter\n responseFormatter = callFunctionOrIdentity('remoteUrlResponseFormatter');\n\n // set isScrollOn\n $timeout(function() {\n var css = getComputedStyle(dd);\n isScrollOn = css.maxHeight && css.overflowY === 'auto';\n });\n }\n\n return {\n restrict: 'EA',\n require: '^?form',\n scope: {\n selectedObject: '=',\n selectedObjectData: '=',\n disableInput: '=',\n initialValue: '=',\n localData: '=',\n localSearch: '&',\n remoteUrlRequestFormatter: '=',\n remoteUrlRequestWithCredentials: '@',\n remoteUrlResponseFormatter: '=',\n remoteUrlErrorCallback: '=',\n remoteApiHandler: '=',\n id: '@',\n type: '@',\n placeholder: '@',\n textSearching: '@',\n textNoResults: '@',\n remoteUrl: '@',\n remoteUrlDataField: '@',\n titleField: '@',\n descriptionField: '@',\n imageField: '@',\n inputClass: '@',\n pause: '@',\n searchFields: '@',\n minlength: '@',\n matchClass: '@',\n clearSelected: '@',\n overrideSuggestions: '@',\n fieldRequired: '=',\n fieldRequiredClass: '@',\n inputChanged: '=',\n autoMatch: '@',\n focusOut: '&',\n focusIn: '&',\n fieldTabindex: '@',\n inputName: '@',\n focusFirst: '@',\n parseInput: '&'\n },\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || TEMPLATE_URL;\n },\n compile: function(tElement) {\n var startSym = $interpolate.startSymbol();\n var endSym = $interpolate.endSymbol();\n if (!(startSym === '{{' && endSym === '}}')) {\n var interpolatedHtml = tElement.html()\n .replace(/\\{\\{/g, startSym)\n .replace(/\\}\\}/g, endSym);\n tElement.html(interpolatedHtml);\n }\n return link;\n }\n };\n }]);\n\n}));\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angucomplete-alt/angucomplete-alt.js?"); /***/ }), /***/ "./node_modules/angular-animate/angular-animate.js": /*!*********************************************************!*\ !*** ./node_modules/angular-animate/angular-animate.js ***! \*********************************************************/ /***/ (() => { eval("/**\n * @license AngularJS v1.5.8\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\nvar ELEMENT_NODE = 1;\nvar COMMENT_NODE = 8;\n\nvar ADD_CLASS_SUFFIX = '-add';\nvar REMOVE_CLASS_SUFFIX = '-remove';\nvar EVENT_CLASS_PREFIX = 'ng-';\nvar ACTIVE_CLASS_SUFFIX = '-active';\nvar PREPARE_CLASS_SUFFIX = '-prepare';\n\nvar NG_ANIMATE_CLASSNAME = 'ng-animate';\nvar NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren';\n\n// Detect proper transitionend/animationend event names.\nvar CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;\n\n// If unprefixed events are not supported but webkit-prefixed are, use the latter.\n// Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.\n// Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`\n// but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.\n// Register both events in case `window.onanimationend` is not supported because of that,\n// do the same for `transitionend` as Safari is likely to exhibit similar behavior.\n// Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit\n// therefore there is no reason to test anymore for other vendor prefixes:\n// http://caniuse.com/#search=transition\nif ((window.ontransitionend === void 0) && (window.onwebkittransitionend !== void 0)) {\n CSS_PREFIX = '-webkit-';\n TRANSITION_PROP = 'WebkitTransition';\n TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';\n} else {\n TRANSITION_PROP = 'transition';\n TRANSITIONEND_EVENT = 'transitionend';\n}\n\nif ((window.onanimationend === void 0) && (window.onwebkitanimationend !== void 0)) {\n CSS_PREFIX = '-webkit-';\n ANIMATION_PROP = 'WebkitAnimation';\n ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';\n} else {\n ANIMATION_PROP = 'animation';\n ANIMATIONEND_EVENT = 'animationend';\n}\n\nvar DURATION_KEY = 'Duration';\nvar PROPERTY_KEY = 'Property';\nvar DELAY_KEY = 'Delay';\nvar TIMING_KEY = 'TimingFunction';\nvar ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';\nvar ANIMATION_PLAYSTATE_KEY = 'PlayState';\nvar SAFE_FAST_FORWARD_DURATION_VALUE = 9999;\n\nvar ANIMATION_DELAY_PROP = ANIMATION_PROP + DELAY_KEY;\nvar ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY;\nvar TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY;\nvar TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY;\n\nvar ngMinErr = angular.$$minErr('ng');\nfunction assertArg(arg, name, reason) {\n if (!arg) {\n throw ngMinErr('areq', \"Argument '{0}' is {1}\", (name || '?'), (reason || \"required\"));\n }\n return arg;\n}\n\nfunction mergeClasses(a,b) {\n if (!a && !b) return '';\n if (!a) return b;\n if (!b) return a;\n if (isArray(a)) a = a.join(' ');\n if (isArray(b)) b = b.join(' ');\n return a + ' ' + b;\n}\n\nfunction packageStyles(options) {\n var styles = {};\n if (options && (options.to || options.from)) {\n styles.to = options.to;\n styles.from = options.from;\n }\n return styles;\n}\n\nfunction pendClasses(classes, fix, isPrefix) {\n var className = '';\n classes = isArray(classes)\n ? classes\n : classes && isString(classes) && classes.length\n ? classes.split(/\\s+/)\n : [];\n forEach(classes, function(klass, i) {\n if (klass && klass.length > 0) {\n className += (i > 0) ? ' ' : '';\n className += isPrefix ? fix + klass\n : klass + fix;\n }\n });\n return className;\n}\n\nfunction removeFromArray(arr, val) {\n var index = arr.indexOf(val);\n if (val >= 0) {\n arr.splice(index, 1);\n }\n}\n\nfunction stripCommentsFromElement(element) {\n if (element instanceof jqLite) {\n switch (element.length) {\n case 0:\n return element;\n\n case 1:\n // there is no point of stripping anything if the element\n // is the only element within the jqLite wrapper.\n // (it's important that we retain the element instance.)\n if (element[0].nodeType === ELEMENT_NODE) {\n return element;\n }\n break;\n\n default:\n return jqLite(extractElementNode(element));\n }\n }\n\n if (element.nodeType === ELEMENT_NODE) {\n return jqLite(element);\n }\n}\n\nfunction extractElementNode(element) {\n if (!element[0]) return element;\n for (var i = 0; i < element.length; i++) {\n var elm = element[i];\n if (elm.nodeType == ELEMENT_NODE) {\n return elm;\n }\n }\n}\n\nfunction $$addClass($$jqLite, element, className) {\n forEach(element, function(elm) {\n $$jqLite.addClass(elm, className);\n });\n}\n\nfunction $$removeClass($$jqLite, element, className) {\n forEach(element, function(elm) {\n $$jqLite.removeClass(elm, className);\n });\n}\n\nfunction applyAnimationClassesFactory($$jqLite) {\n return function(element, options) {\n if (options.addClass) {\n $$addClass($$jqLite, element, options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n $$removeClass($$jqLite, element, options.removeClass);\n options.removeClass = null;\n }\n };\n}\n\nfunction prepareAnimationOptions(options) {\n options = options || {};\n if (!options.$$prepared) {\n var domOperation = options.domOperation || noop;\n options.domOperation = function() {\n options.$$domOperationFired = true;\n domOperation();\n domOperation = noop;\n };\n options.$$prepared = true;\n }\n return options;\n}\n\nfunction applyAnimationStyles(element, options) {\n applyAnimationFromStyles(element, options);\n applyAnimationToStyles(element, options);\n}\n\nfunction applyAnimationFromStyles(element, options) {\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n}\n\nfunction applyAnimationToStyles(element, options) {\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n}\n\nfunction mergeAnimationDetails(element, oldAnimation, newAnimation) {\n var target = oldAnimation.options || {};\n var newOptions = newAnimation.options || {};\n\n var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || '');\n var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || '');\n var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove);\n\n if (newOptions.preparationClasses) {\n target.preparationClasses = concatWithSpace(newOptions.preparationClasses, target.preparationClasses);\n delete newOptions.preparationClasses;\n }\n\n // noop is basically when there is no callback; otherwise something has been set\n var realDomOperation = target.domOperation !== noop ? target.domOperation : null;\n\n extend(target, newOptions);\n\n // TODO(matsko or sreeramu): proper fix is to maintain all animation callback in array and call at last,but now only leave has the callback so no issue with this.\n if (realDomOperation) {\n target.domOperation = realDomOperation;\n }\n\n if (classes.addClass) {\n target.addClass = classes.addClass;\n } else {\n target.addClass = null;\n }\n\n if (classes.removeClass) {\n target.removeClass = classes.removeClass;\n } else {\n target.removeClass = null;\n }\n\n oldAnimation.addClass = target.addClass;\n oldAnimation.removeClass = target.removeClass;\n\n return target;\n}\n\nfunction resolveElementClasses(existing, toAdd, toRemove) {\n var ADD_CLASS = 1;\n var REMOVE_CLASS = -1;\n\n var flags = {};\n existing = splitClassesToLookup(existing);\n\n toAdd = splitClassesToLookup(toAdd);\n forEach(toAdd, function(value, key) {\n flags[key] = ADD_CLASS;\n });\n\n toRemove = splitClassesToLookup(toRemove);\n forEach(toRemove, function(value, key) {\n flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;\n });\n\n var classes = {\n addClass: '',\n removeClass: ''\n };\n\n forEach(flags, function(val, klass) {\n var prop, allow;\n if (val === ADD_CLASS) {\n prop = 'addClass';\n allow = !existing[klass] || existing[klass + REMOVE_CLASS_SUFFIX];\n } else if (val === REMOVE_CLASS) {\n prop = 'removeClass';\n allow = existing[klass] || existing[klass + ADD_CLASS_SUFFIX];\n }\n if (allow) {\n if (classes[prop].length) {\n classes[prop] += ' ';\n }\n classes[prop] += klass;\n }\n });\n\n function splitClassesToLookup(classes) {\n if (isString(classes)) {\n classes = classes.split(' ');\n }\n\n var obj = {};\n forEach(classes, function(klass) {\n // sometimes the split leaves empty string values\n // incase extra spaces were applied to the options\n if (klass.length) {\n obj[klass] = true;\n }\n });\n return obj;\n }\n\n return classes;\n}\n\nfunction getDomNode(element) {\n return (element instanceof jqLite) ? element[0] : element;\n}\n\nfunction applyGeneratedPreparationClasses(element, event, options) {\n var classes = '';\n if (event) {\n classes = pendClasses(event, EVENT_CLASS_PREFIX, true);\n }\n if (options.addClass) {\n classes = concatWithSpace(classes, pendClasses(options.addClass, ADD_CLASS_SUFFIX));\n }\n if (options.removeClass) {\n classes = concatWithSpace(classes, pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX));\n }\n if (classes.length) {\n options.preparationClasses = classes;\n element.addClass(classes);\n }\n}\n\nfunction clearGeneratedClasses(element, options) {\n if (options.preparationClasses) {\n element.removeClass(options.preparationClasses);\n options.preparationClasses = null;\n }\n if (options.activeClasses) {\n element.removeClass(options.activeClasses);\n options.activeClasses = null;\n }\n}\n\nfunction blockTransitions(node, duration) {\n // we use a negative delay value since it performs blocking\n // yet it doesn't kill any existing transitions running on the\n // same element which makes this safe for class-based animations\n var value = duration ? '-' + duration + 's' : '';\n applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]);\n return [TRANSITION_DELAY_PROP, value];\n}\n\nfunction blockKeyframeAnimations(node, applyBlock) {\n var value = applyBlock ? 'paused' : '';\n var key = ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY;\n applyInlineStyle(node, [key, value]);\n return [key, value];\n}\n\nfunction applyInlineStyle(node, styleTuple) {\n var prop = styleTuple[0];\n var value = styleTuple[1];\n node.style[prop] = value;\n}\n\nfunction concatWithSpace(a,b) {\n if (!a) return b;\n if (!b) return a;\n return a + ' ' + b;\n}\n\nvar $$rAFSchedulerFactory = ['$$rAF', function($$rAF) {\n var queue, cancelFn;\n\n function scheduler(tasks) {\n // we make a copy since RAFScheduler mutates the state\n // of the passed in array variable and this would be difficult\n // to track down on the outside code\n queue = queue.concat(tasks);\n nextTick();\n }\n\n queue = scheduler.queue = [];\n\n /* waitUntilQuiet does two things:\n * 1. It will run the FINAL `fn` value only when an uncanceled RAF has passed through\n * 2. It will delay the next wave of tasks from running until the quiet `fn` has run.\n *\n * The motivation here is that animation code can request more time from the scheduler\n * before the next wave runs. This allows for certain DOM properties such as classes to\n * be resolved in time for the next animation to run.\n */\n scheduler.waitUntilQuiet = function(fn) {\n if (cancelFn) cancelFn();\n\n cancelFn = $$rAF(function() {\n cancelFn = null;\n fn();\n nextTick();\n });\n };\n\n return scheduler;\n\n function nextTick() {\n if (!queue.length) return;\n\n var items = queue.shift();\n for (var i = 0; i < items.length; i++) {\n items[i]();\n }\n\n if (!cancelFn) {\n $$rAF(function() {\n if (!cancelFn) nextTick();\n });\n }\n }\n}];\n\n/**\n * @ngdoc directive\n * @name ngAnimateChildren\n * @restrict AE\n * @element ANY\n *\n * @description\n *\n * ngAnimateChildren allows you to specify that children of this element should animate even if any\n * of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move`\n * (structural) animation, child elements that also have an active structural animation are not animated.\n *\n * Note that even if `ngAnimteChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation).\n *\n *\n * @param {string} ngAnimateChildren If the value is empty, `true` or `on`,\n * then child animations are allowed. If the value is `false`, child animations are not allowed.\n *\n * @example\n * \n \n
    \n \n \n
    \n
    \n
    \n List of items:\n
    Item {{item}}
    \n
    \n
    \n
    \n
    \n \n\n .container.ng-enter,\n .container.ng-leave {\n transition: all ease 1.5s;\n }\n\n .container.ng-enter,\n .container.ng-leave-active {\n opacity: 0;\n }\n\n .container.ng-leave,\n .container.ng-enter-active {\n opacity: 1;\n }\n\n .item {\n background: firebrick;\n color: #FFF;\n margin-bottom: 10px;\n }\n\n .item.ng-enter,\n .item.ng-leave {\n transition: transform 1.5s ease;\n }\n\n .item.ng-enter {\n transform: translateX(50px);\n }\n\n .item.ng-enter-active {\n transform: translateX(0);\n }\n \n \n angular.module('ngAnimateChildren', ['ngAnimate'])\n .controller('mainController', function() {\n this.animateChildren = false;\n this.enterElement = false;\n });\n \n
    \n */\nvar $$AnimateChildrenDirective = ['$interpolate', function($interpolate) {\n return {\n link: function(scope, element, attrs) {\n var val = attrs.ngAnimateChildren;\n if (isString(val) && val.length === 0) { //empty attribute\n element.data(NG_ANIMATE_CHILDREN_DATA, true);\n } else {\n // Interpolate and set the value, so that it is available to\n // animations that run right after compilation\n setData($interpolate(val)(scope));\n attrs.$observe('ngAnimateChildren', setData);\n }\n\n function setData(value) {\n value = value === 'on' || value === 'true';\n element.data(NG_ANIMATE_CHILDREN_DATA, value);\n }\n }\n };\n}];\n\nvar ANIMATE_TIMER_KEY = '$$animateCss';\n\n/**\n * @ngdoc service\n * @name $animateCss\n * @kind object\n *\n * @description\n * The `$animateCss` service is a useful utility to trigger customized CSS-based transitions/keyframes\n * from a JavaScript-based animation or directly from a directive. The purpose of `$animateCss` is NOT\n * to side-step how `$animate` and ngAnimate work, but the goal is to allow pre-existing animations or\n * directives to create more complex animations that can be purely driven using CSS code.\n *\n * Note that only browsers that support CSS transitions and/or keyframe animations are capable of\n * rendering animations triggered via `$animateCss` (bad news for IE9 and lower).\n *\n * ## Usage\n * Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that\n * is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,\n * any automatic control over cancelling animations and/or preventing animations from being run on\n * child elements will not be handled by Angular. For this to work as expected, please use `$animate` to\n * trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger\n * the CSS animation.\n *\n * The example below shows how we can create a folding animation on an element using `ng-if`:\n *\n * ```html\n * \n *
    \n * This element will go BOOM\n *
    \n * \n * ```\n *\n * Now we create the **JavaScript animation** that will trigger the CSS transition:\n *\n * ```js\n * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element, doneFn) {\n * var height = element[0].offsetHeight;\n * return $animateCss(element, {\n * from: { height:'0px' },\n * to: { height:height + 'px' },\n * duration: 1 // one second\n * });\n * }\n * }\n * }]);\n * ```\n *\n * ## More Advanced Uses\n *\n * `$animateCss` is the underlying code that ngAnimate uses to power **CSS-based animations** behind the scenes. Therefore CSS hooks\n * like `.ng-EVENT`, `.ng-EVENT-active`, `.ng-EVENT-stagger` are all features that can be triggered using `$animateCss` via JavaScript code.\n *\n * This also means that just about any combination of adding classes, removing classes, setting styles, dynamically setting a keyframe animation,\n * applying a hardcoded duration or delay value, changing the animation easing or applying a stagger animation are all options that work with\n * `$animateCss`. The service itself is smart enough to figure out the combination of options and examine the element styling properties in order\n * to provide a working animation that will run in CSS.\n *\n * The example below showcases a more advanced version of the `.fold-animation` from the example above:\n *\n * ```js\n * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element, doneFn) {\n * var height = element[0].offsetHeight;\n * return $animateCss(element, {\n * addClass: 'red large-text pulse-twice',\n * easing: 'ease-out',\n * from: { height:'0px' },\n * to: { height:height + 'px' },\n * duration: 1 // one second\n * });\n * }\n * }\n * }]);\n * ```\n *\n * Since we're adding/removing CSS classes then the CSS transition will also pick those up:\n *\n * ```css\n * /* since a hardcoded duration value of 1 was provided in the JavaScript animation code,\n * the CSS classes below will be transitioned despite them being defined as regular CSS classes */\n * .red { background:red; }\n * .large-text { font-size:20px; }\n *\n * /* we can also use a keyframe animation and $animateCss will make it work alongside the transition */\n * .pulse-twice {\n * animation: 0.5s pulse linear 2;\n * -webkit-animation: 0.5s pulse linear 2;\n * }\n *\n * @keyframes pulse {\n * from { transform: scale(0.5); }\n * to { transform: scale(1.5); }\n * }\n *\n * @-webkit-keyframes pulse {\n * from { -webkit-transform: scale(0.5); }\n * to { -webkit-transform: scale(1.5); }\n * }\n * ```\n *\n * Given this complex combination of CSS classes, styles and options, `$animateCss` will figure everything out and make the animation happen.\n *\n * ## How the Options are handled\n *\n * `$animateCss` is very versatile and intelligent when it comes to figuring out what configurations to apply to the element to ensure the animation\n * works with the options provided. Say for example we were adding a class that contained a keyframe value and we wanted to also animate some inline\n * styles using the `from` and `to` properties.\n *\n * ```js\n * var animator = $animateCss(element, {\n * from: { background:'red' },\n * to: { background:'blue' }\n * });\n * animator.start();\n * ```\n *\n * ```css\n * .rotating-animation {\n * animation:0.5s rotate linear;\n * -webkit-animation:0.5s rotate linear;\n * }\n *\n * @keyframes rotate {\n * from { transform: rotate(0deg); }\n * to { transform: rotate(360deg); }\n * }\n *\n * @-webkit-keyframes rotate {\n * from { -webkit-transform: rotate(0deg); }\n * to { -webkit-transform: rotate(360deg); }\n * }\n * ```\n *\n * The missing pieces here are that we do not have a transition set (within the CSS code nor within the `$animateCss` options) and the duration of the animation is\n * going to be detected from what the keyframe styles on the CSS class are. In this event, `$animateCss` will automatically create an inline transition\n * style matching the duration detected from the keyframe style (which is present in the CSS class that is being added) and then prepare both the transition\n * and keyframe animations to run in parallel on the element. Then when the animation is underway the provided `from` and `to` CSS styles will be applied\n * and spread across the transition and keyframe animation.\n *\n * ## What is returned\n *\n * `$animateCss` works in two stages: a preparation phase and an animation phase. Therefore when `$animateCss` is first called it will NOT actually\n * start the animation. All that is going on here is that the element is being prepared for the animation (which means that the generated CSS classes are\n * added and removed on the element). Once `$animateCss` is called it will return an object with the following properties:\n *\n * ```js\n * var animator = $animateCss(element, { ... });\n * ```\n *\n * Now what do the contents of our `animator` variable look like:\n *\n * ```js\n * {\n * // starts the animation\n * start: Function,\n *\n * // ends (aborts) the animation\n * end: Function\n * }\n * ```\n *\n * To actually start the animation we need to run `animation.start()` which will then return a promise that we can hook into to detect when the animation ends.\n * If we choose not to run the animation then we MUST run `animation.end()` to perform a cleanup on the element (since some CSS classes and styles may have been\n * applied to the element during the preparation phase). Note that all other properties such as duration, delay, transitions and keyframes are just properties\n * and that changing them will not reconfigure the parameters of the animation.\n *\n * ### runner.done() vs runner.then()\n * It is documented that `animation.start()` will return a promise object and this is true, however, there is also an additional method available on the\n * runner called `.done(callbackFn)`. The done method works the same as `.finally(callbackFn)`, however, it does **not trigger a digest to occur**.\n * Therefore, for performance reasons, it's always best to use `runner.done(callback)` instead of `runner.then()`, `runner.catch()` or `runner.finally()`\n * unless you really need a digest to kick off afterwards.\n *\n * Keep in mind that, to make this easier, ngAnimate has tweaked the JS animations API to recognize when a runner instance is returned from $animateCss\n * (so there is no need to call `runner.done(doneFn)` inside of your JavaScript animation code).\n * Check the {@link ngAnimate.$animateCss#usage animation code above} to see how this works.\n *\n * @param {DOMElement} element the element that will be animated\n * @param {object} options the animation-related options that will be applied during the animation\n *\n * * `event` - The DOM event (e.g. enter, leave, move). When used, a generated CSS class of `ng-EVENT` and `ng-EVENT-active` will be applied\n * to the element during the animation. Multiple events can be provided when spaces are used as a separator. (Note that this will not perform any DOM operation.)\n * * `structural` - Indicates that the `ng-` prefix will be added to the event class. Setting to `false` or omitting will turn `ng-EVENT` and\n * `ng-EVENT-active` in `EVENT` and `EVENT-active`. Unused if `event` is omitted.\n * * `easing` - The CSS easing value that will be applied to the transition or keyframe animation (or both).\n * * `transitionStyle` - The raw CSS transition style that will be used (e.g. `1s linear all`).\n * * `keyframeStyle` - The raw CSS keyframe animation style that will be used (e.g. `1s my_animation linear`).\n * * `from` - The starting CSS styles (a key/value object) that will be applied at the start of the animation.\n * * `to` - The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.\n * * `addClass` - A space separated list of CSS classes that will be added to the element and spread across the animation.\n * * `removeClass` - A space separated list of CSS classes that will be removed from the element and spread across the animation.\n * * `duration` - A number value representing the total duration of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `0`\n * is provided then the animation will be skipped entirely.\n * * `delay` - A number value representing the total delay of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `true` is\n * used then whatever delay value is detected from the CSS classes will be mirrored on the elements styles (e.g. by setting delay true then the style value\n * of the element will be `transition-delay: DETECTED_VALUE`). Using `true` is useful when you want the CSS classes and inline styles to all share the same\n * CSS delay value.\n * * `stagger` - A numeric time value representing the delay between successively animated elements\n * ({@link ngAnimate#css-staggering-animations Click here to learn how CSS-based staggering works in ngAnimate.})\n * * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a\n * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`)\n * * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occurring on the classes being added and removed.)\n * * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once\n * the animation is closed. This is useful for when the styles are used purely for the sake of\n * the animation and do not have a lasting visual effect on the element (e.g. a collapse and open animation).\n * By default this value is set to `false`.\n *\n * @return {object} an object with start and end methods and details about the animation.\n *\n * * `start` - The method to start the animation. This will return a `Promise` when called.\n * * `end` - This method will cancel the animation and remove all applied CSS classes and styles.\n */\nvar ONE_SECOND = 1000;\nvar BASE_TEN = 10;\n\nvar ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;\nvar CLOSING_TIME_BUFFER = 1.5;\n\nvar DETECT_CSS_PROPERTIES = {\n transitionDuration: TRANSITION_DURATION_PROP,\n transitionDelay: TRANSITION_DELAY_PROP,\n transitionProperty: TRANSITION_PROP + PROPERTY_KEY,\n animationDuration: ANIMATION_DURATION_PROP,\n animationDelay: ANIMATION_DELAY_PROP,\n animationIterationCount: ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY\n};\n\nvar DETECT_STAGGER_CSS_PROPERTIES = {\n transitionDuration: TRANSITION_DURATION_PROP,\n transitionDelay: TRANSITION_DELAY_PROP,\n animationDuration: ANIMATION_DURATION_PROP,\n animationDelay: ANIMATION_DELAY_PROP\n};\n\nfunction getCssKeyframeDurationStyle(duration) {\n return [ANIMATION_DURATION_PROP, duration + 's'];\n}\n\nfunction getCssDelayStyle(delay, isKeyframeAnimation) {\n var prop = isKeyframeAnimation ? ANIMATION_DELAY_PROP : TRANSITION_DELAY_PROP;\n return [prop, delay + 's'];\n}\n\nfunction computeCssStyles($window, element, properties) {\n var styles = Object.create(null);\n var detectedStyles = $window.getComputedStyle(element) || {};\n forEach(properties, function(formalStyleName, actualStyleName) {\n var val = detectedStyles[formalStyleName];\n if (val) {\n var c = val.charAt(0);\n\n // only numerical-based values have a negative sign or digit as the first value\n if (c === '-' || c === '+' || c >= 0) {\n val = parseMaxTime(val);\n }\n\n // by setting this to null in the event that the delay is not set or is set directly as 0\n // then we can still allow for negative values to be used later on and not mistake this\n // value for being greater than any other negative value.\n if (val === 0) {\n val = null;\n }\n styles[actualStyleName] = val;\n }\n });\n\n return styles;\n}\n\nfunction parseMaxTime(str) {\n var maxValue = 0;\n var values = str.split(/\\s*,\\s*/);\n forEach(values, function(value) {\n // it's always safe to consider only second values and omit `ms` values since\n // getComputedStyle will always handle the conversion for us\n if (value.charAt(value.length - 1) == 's') {\n value = value.substring(0, value.length - 1);\n }\n value = parseFloat(value) || 0;\n maxValue = maxValue ? Math.max(value, maxValue) : value;\n });\n return maxValue;\n}\n\nfunction truthyTimingValue(val) {\n return val === 0 || val != null;\n}\n\nfunction getCssTransitionDurationStyle(duration, applyOnlyDuration) {\n var style = TRANSITION_PROP;\n var value = duration + 's';\n if (applyOnlyDuration) {\n style += DURATION_KEY;\n } else {\n value += ' linear all';\n }\n return [style, value];\n}\n\nfunction createLocalCacheLookup() {\n var cache = Object.create(null);\n return {\n flush: function() {\n cache = Object.create(null);\n },\n\n count: function(key) {\n var entry = cache[key];\n return entry ? entry.total : 0;\n },\n\n get: function(key) {\n var entry = cache[key];\n return entry && entry.value;\n },\n\n put: function(key, value) {\n if (!cache[key]) {\n cache[key] = { total: 1, value: value };\n } else {\n cache[key].total++;\n }\n }\n };\n}\n\n// we do not reassign an already present style value since\n// if we detect the style property value again we may be\n// detecting styles that were added via the `from` styles.\n// We make use of `isDefined` here since an empty string\n// or null value (which is what getPropertyValue will return\n// for a non-existing style) will still be marked as a valid\n// value for the style (a falsy value implies that the style\n// is to be removed at the end of the animation). If we had a simple\n// \"OR\" statement then it would not be enough to catch that.\nfunction registerRestorableStyles(backup, node, properties) {\n forEach(properties, function(prop) {\n backup[prop] = isDefined(backup[prop])\n ? backup[prop]\n : node.style.getPropertyValue(prop);\n });\n}\n\nvar $AnimateCssProvider = ['$animateProvider', function($animateProvider) {\n var gcsLookup = createLocalCacheLookup();\n var gcsStaggerLookup = createLocalCacheLookup();\n\n this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout',\n '$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue',\n function($window, $$jqLite, $$AnimateRunner, $timeout,\n $$forceReflow, $sniffer, $$rAFScheduler, $$animateQueue) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n var parentCounter = 0;\n function gcsHashFn(node, extraClasses) {\n var KEY = \"$$ngAnimateParentKey\";\n var parentNode = node.parentNode;\n var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);\n return parentID + '-' + node.getAttribute('class') + '-' + extraClasses;\n }\n\n function computeCachedCssStyles(node, className, cacheKey, properties) {\n var timings = gcsLookup.get(cacheKey);\n\n if (!timings) {\n timings = computeCssStyles($window, node, properties);\n if (timings.animationIterationCount === 'infinite') {\n timings.animationIterationCount = 1;\n }\n }\n\n // we keep putting this in multiple times even though the value and the cacheKey are the same\n // because we're keeping an internal tally of how many duplicate animations are detected.\n gcsLookup.put(cacheKey, timings);\n return timings;\n }\n\n function computeCachedCssStaggerStyles(node, className, cacheKey, properties) {\n var stagger;\n\n // if we have one or more existing matches of matching elements\n // containing the same parent + CSS styles (which is how cacheKey works)\n // then staggering is possible\n if (gcsLookup.count(cacheKey) > 0) {\n stagger = gcsStaggerLookup.get(cacheKey);\n\n if (!stagger) {\n var staggerClassName = pendClasses(className, '-stagger');\n\n $$jqLite.addClass(node, staggerClassName);\n\n stagger = computeCssStyles($window, node, properties);\n\n // force the conversion of a null value to zero incase not set\n stagger.animationDuration = Math.max(stagger.animationDuration, 0);\n stagger.transitionDuration = Math.max(stagger.transitionDuration, 0);\n\n $$jqLite.removeClass(node, staggerClassName);\n\n gcsStaggerLookup.put(cacheKey, stagger);\n }\n }\n\n return stagger || {};\n }\n\n var cancelLastRAFRequest;\n var rafWaitQueue = [];\n function waitUntilQuiet(callback) {\n rafWaitQueue.push(callback);\n $$rAFScheduler.waitUntilQuiet(function() {\n gcsLookup.flush();\n gcsStaggerLookup.flush();\n\n // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable.\n // PLEASE EXAMINE THE `$$forceReflow` service to understand why.\n var pageWidth = $$forceReflow();\n\n // we use a for loop to ensure that if the queue is changed\n // during this looping then it will consider new requests\n for (var i = 0; i < rafWaitQueue.length; i++) {\n rafWaitQueue[i](pageWidth);\n }\n rafWaitQueue.length = 0;\n });\n }\n\n function computeTimings(node, className, cacheKey) {\n var timings = computeCachedCssStyles(node, className, cacheKey, DETECT_CSS_PROPERTIES);\n var aD = timings.animationDelay;\n var tD = timings.transitionDelay;\n timings.maxDelay = aD && tD\n ? Math.max(aD, tD)\n : (aD || tD);\n timings.maxDuration = Math.max(\n timings.animationDuration * timings.animationIterationCount,\n timings.transitionDuration);\n\n return timings;\n }\n\n return function init(element, initialOptions) {\n // all of the animation functions should create\n // a copy of the options data, however, if a\n // parent service has already created a copy then\n // we should stick to using that\n var options = initialOptions || {};\n if (!options.$$prepared) {\n options = prepareAnimationOptions(copy(options));\n }\n\n var restoreStyles = {};\n var node = getDomNode(element);\n if (!node\n || !node.parentNode\n || !$$animateQueue.enabled()) {\n return closeAndReturnNoopAnimator();\n }\n\n var temporaryStyles = [];\n var classes = element.attr('class');\n var styles = packageStyles(options);\n var animationClosed;\n var animationPaused;\n var animationCompleted;\n var runner;\n var runnerHost;\n var maxDelay;\n var maxDelayTime;\n var maxDuration;\n var maxDurationTime;\n var startTime;\n var events = [];\n\n if (options.duration === 0 || (!$sniffer.animations && !$sniffer.transitions)) {\n return closeAndReturnNoopAnimator();\n }\n\n var method = options.event && isArray(options.event)\n ? options.event.join(' ')\n : options.event;\n\n var isStructural = method && options.structural;\n var structuralClassName = '';\n var addRemoveClassName = '';\n\n if (isStructural) {\n structuralClassName = pendClasses(method, EVENT_CLASS_PREFIX, true);\n } else if (method) {\n structuralClassName = method;\n }\n\n if (options.addClass) {\n addRemoveClassName += pendClasses(options.addClass, ADD_CLASS_SUFFIX);\n }\n\n if (options.removeClass) {\n if (addRemoveClassName.length) {\n addRemoveClassName += ' ';\n }\n addRemoveClassName += pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX);\n }\n\n // there may be a situation where a structural animation is combined together\n // with CSS classes that need to resolve before the animation is computed.\n // However this means that there is no explicit CSS code to block the animation\n // from happening (by setting 0s none in the class name). If this is the case\n // we need to apply the classes before the first rAF so we know to continue if\n // there actually is a detected transition or keyframe animation\n if (options.applyClassesEarly && addRemoveClassName.length) {\n applyAnimationClasses(element, options);\n }\n\n var preparationClasses = [structuralClassName, addRemoveClassName].join(' ').trim();\n var fullClassName = classes + ' ' + preparationClasses;\n var activeClasses = pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX);\n var hasToStyles = styles.to && Object.keys(styles.to).length > 0;\n var containsKeyframeAnimation = (options.keyframeStyle || '').length > 0;\n\n // there is no way we can trigger an animation if no styles and\n // no classes are being applied which would then trigger a transition,\n // unless there a is raw keyframe value that is applied to the element.\n if (!containsKeyframeAnimation\n && !hasToStyles\n && !preparationClasses) {\n return closeAndReturnNoopAnimator();\n }\n\n var cacheKey, stagger;\n if (options.stagger > 0) {\n var staggerVal = parseFloat(options.stagger);\n stagger = {\n transitionDelay: staggerVal,\n animationDelay: staggerVal,\n transitionDuration: 0,\n animationDuration: 0\n };\n } else {\n cacheKey = gcsHashFn(node, fullClassName);\n stagger = computeCachedCssStaggerStyles(node, preparationClasses, cacheKey, DETECT_STAGGER_CSS_PROPERTIES);\n }\n\n if (!options.$$skipPreparationClasses) {\n $$jqLite.addClass(element, preparationClasses);\n }\n\n var applyOnlyDuration;\n\n if (options.transitionStyle) {\n var transitionStyle = [TRANSITION_PROP, options.transitionStyle];\n applyInlineStyle(node, transitionStyle);\n temporaryStyles.push(transitionStyle);\n }\n\n if (options.duration >= 0) {\n applyOnlyDuration = node.style[TRANSITION_PROP].length > 0;\n var durationStyle = getCssTransitionDurationStyle(options.duration, applyOnlyDuration);\n\n // we set the duration so that it will be picked up by getComputedStyle later\n applyInlineStyle(node, durationStyle);\n temporaryStyles.push(durationStyle);\n }\n\n if (options.keyframeStyle) {\n var keyframeStyle = [ANIMATION_PROP, options.keyframeStyle];\n applyInlineStyle(node, keyframeStyle);\n temporaryStyles.push(keyframeStyle);\n }\n\n var itemIndex = stagger\n ? options.staggerIndex >= 0\n ? options.staggerIndex\n : gcsLookup.count(cacheKey)\n : 0;\n\n var isFirst = itemIndex === 0;\n\n // this is a pre-emptive way of forcing the setup classes to be added and applied INSTANTLY\n // without causing any combination of transitions to kick in. By adding a negative delay value\n // it forces the setup class' transition to end immediately. We later then remove the negative\n // transition delay to allow for the transition to naturally do it's thing. The beauty here is\n // that if there is no transition defined then nothing will happen and this will also allow\n // other transitions to be stacked on top of each other without any chopping them out.\n if (isFirst && !options.skipBlocking) {\n blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE);\n }\n\n var timings = computeTimings(node, fullClassName, cacheKey);\n var relativeDelay = timings.maxDelay;\n maxDelay = Math.max(relativeDelay, 0);\n maxDuration = timings.maxDuration;\n\n var flags = {};\n flags.hasTransitions = timings.transitionDuration > 0;\n flags.hasAnimations = timings.animationDuration > 0;\n flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty == 'all';\n flags.applyTransitionDuration = hasToStyles && (\n (flags.hasTransitions && !flags.hasTransitionAll)\n || (flags.hasAnimations && !flags.hasTransitions));\n flags.applyAnimationDuration = options.duration && flags.hasAnimations;\n flags.applyTransitionDelay = truthyTimingValue(options.delay) && (flags.applyTransitionDuration || flags.hasTransitions);\n flags.applyAnimationDelay = truthyTimingValue(options.delay) && flags.hasAnimations;\n flags.recalculateTimingStyles = addRemoveClassName.length > 0;\n\n if (flags.applyTransitionDuration || flags.applyAnimationDuration) {\n maxDuration = options.duration ? parseFloat(options.duration) : maxDuration;\n\n if (flags.applyTransitionDuration) {\n flags.hasTransitions = true;\n timings.transitionDuration = maxDuration;\n applyOnlyDuration = node.style[TRANSITION_PROP + PROPERTY_KEY].length > 0;\n temporaryStyles.push(getCssTransitionDurationStyle(maxDuration, applyOnlyDuration));\n }\n\n if (flags.applyAnimationDuration) {\n flags.hasAnimations = true;\n timings.animationDuration = maxDuration;\n temporaryStyles.push(getCssKeyframeDurationStyle(maxDuration));\n }\n }\n\n if (maxDuration === 0 && !flags.recalculateTimingStyles) {\n return closeAndReturnNoopAnimator();\n }\n\n if (options.delay != null) {\n var delayStyle;\n if (typeof options.delay !== \"boolean\") {\n delayStyle = parseFloat(options.delay);\n // number in options.delay means we have to recalculate the delay for the closing timeout\n maxDelay = Math.max(delayStyle, 0);\n }\n\n if (flags.applyTransitionDelay) {\n temporaryStyles.push(getCssDelayStyle(delayStyle));\n }\n\n if (flags.applyAnimationDelay) {\n temporaryStyles.push(getCssDelayStyle(delayStyle, true));\n }\n }\n\n // we need to recalculate the delay value since we used a pre-emptive negative\n // delay value and the delay value is required for the final event checking. This\n // property will ensure that this will happen after the RAF phase has passed.\n if (options.duration == null && timings.transitionDuration > 0) {\n flags.recalculateTimingStyles = flags.recalculateTimingStyles || isFirst;\n }\n\n maxDelayTime = maxDelay * ONE_SECOND;\n maxDurationTime = maxDuration * ONE_SECOND;\n if (!options.skipBlocking) {\n flags.blockTransition = timings.transitionDuration > 0;\n flags.blockKeyframeAnimation = timings.animationDuration > 0 &&\n stagger.animationDelay > 0 &&\n stagger.animationDuration === 0;\n }\n\n if (options.from) {\n if (options.cleanupStyles) {\n registerRestorableStyles(restoreStyles, node, Object.keys(options.from));\n }\n applyAnimationFromStyles(element, options);\n }\n\n if (flags.blockTransition || flags.blockKeyframeAnimation) {\n applyBlocking(maxDuration);\n } else if (!options.skipBlocking) {\n blockTransitions(node, false);\n }\n\n // TODO(matsko): for 1.5 change this code to have an animator object for better debugging\n return {\n $$willAnimate: true,\n end: endFn,\n start: function() {\n if (animationClosed) return;\n\n runnerHost = {\n end: endFn,\n cancel: cancelFn,\n resume: null, //this will be set during the start() phase\n pause: null\n };\n\n runner = new $$AnimateRunner(runnerHost);\n\n waitUntilQuiet(start);\n\n // we don't have access to pause/resume the animation\n // since it hasn't run yet. AnimateRunner will therefore\n // set noop functions for resume and pause and they will\n // later be overridden once the animation is triggered\n return runner;\n }\n };\n\n function endFn() {\n close();\n }\n\n function cancelFn() {\n close(true);\n }\n\n function close(rejected) { // jshint ignore:line\n // if the promise has been called already then we shouldn't close\n // the animation again\n if (animationClosed || (animationCompleted && animationPaused)) return;\n animationClosed = true;\n animationPaused = false;\n\n if (!options.$$skipPreparationClasses) {\n $$jqLite.removeClass(element, preparationClasses);\n }\n $$jqLite.removeClass(element, activeClasses);\n\n blockKeyframeAnimations(node, false);\n blockTransitions(node, false);\n\n forEach(temporaryStyles, function(entry) {\n // There is only one way to remove inline style properties entirely from elements.\n // By using `removeProperty` this works, but we need to convert camel-cased CSS\n // styles down to hyphenated values.\n node.style[entry[0]] = '';\n });\n\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n\n if (Object.keys(restoreStyles).length) {\n forEach(restoreStyles, function(value, prop) {\n value ? node.style.setProperty(prop, value)\n : node.style.removeProperty(prop);\n });\n }\n\n // the reason why we have this option is to allow a synchronous closing callback\n // that is fired as SOON as the animation ends (when the CSS is removed) or if\n // the animation never takes off at all. A good example is a leave animation since\n // the element must be removed just after the animation is over or else the element\n // will appear on screen for one animation frame causing an overbearing flicker.\n if (options.onDone) {\n options.onDone();\n }\n\n if (events && events.length) {\n // Remove the transitionend / animationend listener(s)\n element.off(events.join(' '), onAnimationProgress);\n }\n\n //Cancel the fallback closing timeout and remove the timer data\n var animationTimerData = element.data(ANIMATE_TIMER_KEY);\n if (animationTimerData) {\n $timeout.cancel(animationTimerData[0].timer);\n element.removeData(ANIMATE_TIMER_KEY);\n }\n\n // if the preparation function fails then the promise is not setup\n if (runner) {\n runner.complete(!rejected);\n }\n }\n\n function applyBlocking(duration) {\n if (flags.blockTransition) {\n blockTransitions(node, duration);\n }\n\n if (flags.blockKeyframeAnimation) {\n blockKeyframeAnimations(node, !!duration);\n }\n }\n\n function closeAndReturnNoopAnimator() {\n runner = new $$AnimateRunner({\n end: endFn,\n cancel: cancelFn\n });\n\n // should flush the cache animation\n waitUntilQuiet(noop);\n close();\n\n return {\n $$willAnimate: false,\n start: function() {\n return runner;\n },\n end: endFn\n };\n }\n\n function onAnimationProgress(event) {\n event.stopPropagation();\n var ev = event.originalEvent || event;\n\n // we now always use `Date.now()` due to the recent changes with\n // event.timeStamp in Firefox, Webkit and Chrome (see #13494 for more info)\n var timeStamp = ev.$manualTimeStamp || Date.now();\n\n /* Firefox (or possibly just Gecko) likes to not round values up\n * when a ms measurement is used for the animation */\n var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));\n\n /* $manualTimeStamp is a mocked timeStamp value which is set\n * within browserTrigger(). This is only here so that tests can\n * mock animations properly. Real events fallback to event.timeStamp,\n * or, if they don't, then a timeStamp is automatically created for them.\n * We're checking to see if the timeStamp surpasses the expected delay,\n * but we're using elapsedTime instead of the timeStamp on the 2nd\n * pre-condition since animationPauseds sometimes close off early */\n if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {\n // we set this flag to ensure that if the transition is paused then, when resumed,\n // the animation will automatically close itself since transitions cannot be paused.\n animationCompleted = true;\n close();\n }\n }\n\n function start() {\n if (animationClosed) return;\n if (!node.parentNode) {\n close();\n return;\n }\n\n // even though we only pause keyframe animations here the pause flag\n // will still happen when transitions are used. Only the transition will\n // not be paused since that is not possible. If the animation ends when\n // paused then it will not complete until unpaused or cancelled.\n var playPause = function(playAnimation) {\n if (!animationCompleted) {\n animationPaused = !playAnimation;\n if (timings.animationDuration) {\n var value = blockKeyframeAnimations(node, animationPaused);\n animationPaused\n ? temporaryStyles.push(value)\n : removeFromArray(temporaryStyles, value);\n }\n } else if (animationPaused && playAnimation) {\n animationPaused = false;\n close();\n }\n };\n\n // checking the stagger duration prevents an accidentally cascade of the CSS delay style\n // being inherited from the parent. If the transition duration is zero then we can safely\n // rely that the delay value is an intentional stagger delay style.\n var maxStagger = itemIndex > 0\n && ((timings.transitionDuration && stagger.transitionDuration === 0) ||\n (timings.animationDuration && stagger.animationDuration === 0))\n && Math.max(stagger.animationDelay, stagger.transitionDelay);\n if (maxStagger) {\n $timeout(triggerAnimationStart,\n Math.floor(maxStagger * itemIndex * ONE_SECOND),\n false);\n } else {\n triggerAnimationStart();\n }\n\n // this will decorate the existing promise runner with pause/resume methods\n runnerHost.resume = function() {\n playPause(true);\n };\n\n runnerHost.pause = function() {\n playPause(false);\n };\n\n function triggerAnimationStart() {\n // just incase a stagger animation kicks in when the animation\n // itself was cancelled entirely\n if (animationClosed) return;\n\n applyBlocking(false);\n\n forEach(temporaryStyles, function(entry) {\n var key = entry[0];\n var value = entry[1];\n node.style[key] = value;\n });\n\n applyAnimationClasses(element, options);\n $$jqLite.addClass(element, activeClasses);\n\n if (flags.recalculateTimingStyles) {\n fullClassName = node.className + ' ' + preparationClasses;\n cacheKey = gcsHashFn(node, fullClassName);\n\n timings = computeTimings(node, fullClassName, cacheKey);\n relativeDelay = timings.maxDelay;\n maxDelay = Math.max(relativeDelay, 0);\n maxDuration = timings.maxDuration;\n\n if (maxDuration === 0) {\n close();\n return;\n }\n\n flags.hasTransitions = timings.transitionDuration > 0;\n flags.hasAnimations = timings.animationDuration > 0;\n }\n\n if (flags.applyAnimationDelay) {\n relativeDelay = typeof options.delay !== \"boolean\" && truthyTimingValue(options.delay)\n ? parseFloat(options.delay)\n : relativeDelay;\n\n maxDelay = Math.max(relativeDelay, 0);\n timings.animationDelay = relativeDelay;\n delayStyle = getCssDelayStyle(relativeDelay, true);\n temporaryStyles.push(delayStyle);\n node.style[delayStyle[0]] = delayStyle[1];\n }\n\n maxDelayTime = maxDelay * ONE_SECOND;\n maxDurationTime = maxDuration * ONE_SECOND;\n\n if (options.easing) {\n var easeProp, easeVal = options.easing;\n if (flags.hasTransitions) {\n easeProp = TRANSITION_PROP + TIMING_KEY;\n temporaryStyles.push([easeProp, easeVal]);\n node.style[easeProp] = easeVal;\n }\n if (flags.hasAnimations) {\n easeProp = ANIMATION_PROP + TIMING_KEY;\n temporaryStyles.push([easeProp, easeVal]);\n node.style[easeProp] = easeVal;\n }\n }\n\n if (timings.transitionDuration) {\n events.push(TRANSITIONEND_EVENT);\n }\n\n if (timings.animationDuration) {\n events.push(ANIMATIONEND_EVENT);\n }\n\n startTime = Date.now();\n var timerTime = maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime;\n var endTime = startTime + timerTime;\n\n var animationsData = element.data(ANIMATE_TIMER_KEY) || [];\n var setupFallbackTimer = true;\n if (animationsData.length) {\n var currentTimerData = animationsData[0];\n setupFallbackTimer = endTime > currentTimerData.expectedEndTime;\n if (setupFallbackTimer) {\n $timeout.cancel(currentTimerData.timer);\n } else {\n animationsData.push(close);\n }\n }\n\n if (setupFallbackTimer) {\n var timer = $timeout(onAnimationExpired, timerTime, false);\n animationsData[0] = {\n timer: timer,\n expectedEndTime: endTime\n };\n animationsData.push(close);\n element.data(ANIMATE_TIMER_KEY, animationsData);\n }\n\n if (events.length) {\n element.on(events.join(' '), onAnimationProgress);\n }\n\n if (options.to) {\n if (options.cleanupStyles) {\n registerRestorableStyles(restoreStyles, node, Object.keys(options.to));\n }\n applyAnimationToStyles(element, options);\n }\n }\n\n function onAnimationExpired() {\n var animationsData = element.data(ANIMATE_TIMER_KEY);\n\n // this will be false in the event that the element was\n // removed from the DOM (via a leave animation or something\n // similar)\n if (animationsData) {\n for (var i = 1; i < animationsData.length; i++) {\n animationsData[i]();\n }\n element.removeData(ANIMATE_TIMER_KEY);\n }\n }\n }\n };\n }];\n}];\n\nvar $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationProvider) {\n $$animationProvider.drivers.push('$$animateCssDriver');\n\n var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';\n var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';\n\n var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out';\n var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in';\n\n function isDocumentFragment(node) {\n return node.parentNode && node.parentNode.nodeType === 11;\n }\n\n this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$sniffer', '$$jqLite', '$document',\n function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $sniffer, $$jqLite, $document) {\n\n // only browsers that support these properties can render animations\n if (!$sniffer.animations && !$sniffer.transitions) return noop;\n\n var bodyNode = $document[0].body;\n var rootNode = getDomNode($rootElement);\n\n var rootBodyElement = jqLite(\n // this is to avoid using something that exists outside of the body\n // we also special case the doc fragment case because our unit test code\n // appends the $rootElement to the body after the app has been bootstrapped\n isDocumentFragment(rootNode) || bodyNode.contains(rootNode) ? rootNode : bodyNode\n );\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n return function initDriverFn(animationDetails) {\n return animationDetails.from && animationDetails.to\n ? prepareFromToAnchorAnimation(animationDetails.from,\n animationDetails.to,\n animationDetails.classes,\n animationDetails.anchors)\n : prepareRegularAnimation(animationDetails);\n };\n\n function filterCssClasses(classes) {\n //remove all the `ng-` stuff\n return classes.replace(/\\bng-\\S+\\b/g, '');\n }\n\n function getUniqueValues(a, b) {\n if (isString(a)) a = a.split(' ');\n if (isString(b)) b = b.split(' ');\n return a.filter(function(val) {\n return b.indexOf(val) === -1;\n }).join(' ');\n }\n\n function prepareAnchoredAnimation(classes, outAnchor, inAnchor) {\n var clone = jqLite(getDomNode(outAnchor).cloneNode(true));\n var startingClasses = filterCssClasses(getClassVal(clone));\n\n outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);\n inAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);\n\n clone.addClass(NG_ANIMATE_ANCHOR_CLASS_NAME);\n\n rootBodyElement.append(clone);\n\n var animatorIn, animatorOut = prepareOutAnimation();\n\n // the user may not end up using the `out` animation and\n // only making use of the `in` animation or vice-versa.\n // In either case we should allow this and not assume the\n // animation is over unless both animations are not used.\n if (!animatorOut) {\n animatorIn = prepareInAnimation();\n if (!animatorIn) {\n return end();\n }\n }\n\n var startingAnimator = animatorOut || animatorIn;\n\n return {\n start: function() {\n var runner;\n\n var currentAnimation = startingAnimator.start();\n currentAnimation.done(function() {\n currentAnimation = null;\n if (!animatorIn) {\n animatorIn = prepareInAnimation();\n if (animatorIn) {\n currentAnimation = animatorIn.start();\n currentAnimation.done(function() {\n currentAnimation = null;\n end();\n runner.complete();\n });\n return currentAnimation;\n }\n }\n // in the event that there is no `in` animation\n end();\n runner.complete();\n });\n\n runner = new $$AnimateRunner({\n end: endFn,\n cancel: endFn\n });\n\n return runner;\n\n function endFn() {\n if (currentAnimation) {\n currentAnimation.end();\n }\n }\n }\n };\n\n function calculateAnchorStyles(anchor) {\n var styles = {};\n\n var coords = getDomNode(anchor).getBoundingClientRect();\n\n // we iterate directly since safari messes up and doesn't return\n // all the keys for the coords object when iterated\n forEach(['width','height','top','left'], function(key) {\n var value = coords[key];\n switch (key) {\n case 'top':\n value += bodyNode.scrollTop;\n break;\n case 'left':\n value += bodyNode.scrollLeft;\n break;\n }\n styles[key] = Math.floor(value) + 'px';\n });\n return styles;\n }\n\n function prepareOutAnimation() {\n var animator = $animateCss(clone, {\n addClass: NG_OUT_ANCHOR_CLASS_NAME,\n delay: true,\n from: calculateAnchorStyles(outAnchor)\n });\n\n // read the comment within `prepareRegularAnimation` to understand\n // why this check is necessary\n return animator.$$willAnimate ? animator : null;\n }\n\n function getClassVal(element) {\n return element.attr('class') || '';\n }\n\n function prepareInAnimation() {\n var endingClasses = filterCssClasses(getClassVal(inAnchor));\n var toAdd = getUniqueValues(endingClasses, startingClasses);\n var toRemove = getUniqueValues(startingClasses, endingClasses);\n\n var animator = $animateCss(clone, {\n to: calculateAnchorStyles(inAnchor),\n addClass: NG_IN_ANCHOR_CLASS_NAME + ' ' + toAdd,\n removeClass: NG_OUT_ANCHOR_CLASS_NAME + ' ' + toRemove,\n delay: true\n });\n\n // read the comment within `prepareRegularAnimation` to understand\n // why this check is necessary\n return animator.$$willAnimate ? animator : null;\n }\n\n function end() {\n clone.remove();\n outAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);\n inAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);\n }\n }\n\n function prepareFromToAnchorAnimation(from, to, classes, anchors) {\n var fromAnimation = prepareRegularAnimation(from, noop);\n var toAnimation = prepareRegularAnimation(to, noop);\n\n var anchorAnimations = [];\n forEach(anchors, function(anchor) {\n var outElement = anchor['out'];\n var inElement = anchor['in'];\n var animator = prepareAnchoredAnimation(classes, outElement, inElement);\n if (animator) {\n anchorAnimations.push(animator);\n }\n });\n\n // no point in doing anything when there are no elements to animate\n if (!fromAnimation && !toAnimation && anchorAnimations.length === 0) return;\n\n return {\n start: function() {\n var animationRunners = [];\n\n if (fromAnimation) {\n animationRunners.push(fromAnimation.start());\n }\n\n if (toAnimation) {\n animationRunners.push(toAnimation.start());\n }\n\n forEach(anchorAnimations, function(animation) {\n animationRunners.push(animation.start());\n });\n\n var runner = new $$AnimateRunner({\n end: endFn,\n cancel: endFn // CSS-driven animations cannot be cancelled, only ended\n });\n\n $$AnimateRunner.all(animationRunners, function(status) {\n runner.complete(status);\n });\n\n return runner;\n\n function endFn() {\n forEach(animationRunners, function(runner) {\n runner.end();\n });\n }\n }\n };\n }\n\n function prepareRegularAnimation(animationDetails) {\n var element = animationDetails.element;\n var options = animationDetails.options || {};\n\n if (animationDetails.structural) {\n options.event = animationDetails.event;\n options.structural = true;\n options.applyClassesEarly = true;\n\n // we special case the leave animation since we want to ensure that\n // the element is removed as soon as the animation is over. Otherwise\n // a flicker might appear or the element may not be removed at all\n if (animationDetails.event === 'leave') {\n options.onDone = options.domOperation;\n }\n }\n\n // We assign the preparationClasses as the actual animation event since\n // the internals of $animateCss will just suffix the event token values\n // with `-active` to trigger the animation.\n if (options.preparationClasses) {\n options.event = concatWithSpace(options.event, options.preparationClasses);\n }\n\n var animator = $animateCss(element, options);\n\n // the driver lookup code inside of $$animation attempts to spawn a\n // driver one by one until a driver returns a.$$willAnimate animator object.\n // $animateCss will always return an object, however, it will pass in\n // a flag as a hint as to whether an animation was detected or not\n return animator.$$willAnimate ? animator : null;\n }\n }];\n}];\n\n// TODO(matsko): use caching here to speed things up for detection\n// TODO(matsko): add documentation\n// by the time...\n\nvar $$AnimateJsProvider = ['$animateProvider', function($animateProvider) {\n this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',\n function($injector, $$AnimateRunner, $$jqLite) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n // $animateJs(element, 'enter');\n return function(element, event, classes, options) {\n var animationClosed = false;\n\n // the `classes` argument is optional and if it is not used\n // then the classes will be resolved from the element's className\n // property as well as options.addClass/options.removeClass.\n if (arguments.length === 3 && isObject(classes)) {\n options = classes;\n classes = null;\n }\n\n options = prepareAnimationOptions(options);\n if (!classes) {\n classes = element.attr('class') || '';\n if (options.addClass) {\n classes += ' ' + options.addClass;\n }\n if (options.removeClass) {\n classes += ' ' + options.removeClass;\n }\n }\n\n var classesToAdd = options.addClass;\n var classesToRemove = options.removeClass;\n\n // the lookupAnimations function returns a series of animation objects that are\n // matched up with one or more of the CSS classes. These animation objects are\n // defined via the module.animation factory function. If nothing is detected then\n // we don't return anything which then makes $animation query the next driver.\n var animations = lookupAnimations(classes);\n var before, after;\n if (animations.length) {\n var afterFn, beforeFn;\n if (event == 'leave') {\n beforeFn = 'leave';\n afterFn = 'afterLeave'; // TODO(matsko): get rid of this\n } else {\n beforeFn = 'before' + event.charAt(0).toUpperCase() + event.substr(1);\n afterFn = event;\n }\n\n if (event !== 'enter' && event !== 'move') {\n before = packageAnimations(element, event, options, animations, beforeFn);\n }\n after = packageAnimations(element, event, options, animations, afterFn);\n }\n\n // no matching animations\n if (!before && !after) return;\n\n function applyOptions() {\n options.domOperation();\n applyAnimationClasses(element, options);\n }\n\n function close() {\n animationClosed = true;\n applyOptions();\n applyAnimationStyles(element, options);\n }\n\n var runner;\n\n return {\n $$willAnimate: true,\n end: function() {\n if (runner) {\n runner.end();\n } else {\n close();\n runner = new $$AnimateRunner();\n runner.complete(true);\n }\n return runner;\n },\n start: function() {\n if (runner) {\n return runner;\n }\n\n runner = new $$AnimateRunner();\n var closeActiveAnimations;\n var chain = [];\n\n if (before) {\n chain.push(function(fn) {\n closeActiveAnimations = before(fn);\n });\n }\n\n if (chain.length) {\n chain.push(function(fn) {\n applyOptions();\n fn(true);\n });\n } else {\n applyOptions();\n }\n\n if (after) {\n chain.push(function(fn) {\n closeActiveAnimations = after(fn);\n });\n }\n\n runner.setHost({\n end: function() {\n endAnimations();\n },\n cancel: function() {\n endAnimations(true);\n }\n });\n\n $$AnimateRunner.chain(chain, onComplete);\n return runner;\n\n function onComplete(success) {\n close(success);\n runner.complete(success);\n }\n\n function endAnimations(cancelled) {\n if (!animationClosed) {\n (closeActiveAnimations || noop)(cancelled);\n onComplete(cancelled);\n }\n }\n }\n };\n\n function executeAnimationFn(fn, element, event, options, onDone) {\n var args;\n switch (event) {\n case 'animate':\n args = [element, options.from, options.to, onDone];\n break;\n\n case 'setClass':\n args = [element, classesToAdd, classesToRemove, onDone];\n break;\n\n case 'addClass':\n args = [element, classesToAdd, onDone];\n break;\n\n case 'removeClass':\n args = [element, classesToRemove, onDone];\n break;\n\n default:\n args = [element, onDone];\n break;\n }\n\n args.push(options);\n\n var value = fn.apply(fn, args);\n if (value) {\n if (isFunction(value.start)) {\n value = value.start();\n }\n\n if (value instanceof $$AnimateRunner) {\n value.done(onDone);\n } else if (isFunction(value)) {\n // optional onEnd / onCancel callback\n return value;\n }\n }\n\n return noop;\n }\n\n function groupEventedAnimations(element, event, options, animations, fnName) {\n var operations = [];\n forEach(animations, function(ani) {\n var animation = ani[fnName];\n if (!animation) return;\n\n // note that all of these animations will run in parallel\n operations.push(function() {\n var runner;\n var endProgressCb;\n\n var resolved = false;\n var onAnimationComplete = function(rejected) {\n if (!resolved) {\n resolved = true;\n (endProgressCb || noop)(rejected);\n runner.complete(!rejected);\n }\n };\n\n runner = new $$AnimateRunner({\n end: function() {\n onAnimationComplete();\n },\n cancel: function() {\n onAnimationComplete(true);\n }\n });\n\n endProgressCb = executeAnimationFn(animation, element, event, options, function(result) {\n var cancelled = result === false;\n onAnimationComplete(cancelled);\n });\n\n return runner;\n });\n });\n\n return operations;\n }\n\n function packageAnimations(element, event, options, animations, fnName) {\n var operations = groupEventedAnimations(element, event, options, animations, fnName);\n if (operations.length === 0) {\n var a,b;\n if (fnName === 'beforeSetClass') {\n a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass');\n b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass');\n } else if (fnName === 'setClass') {\n a = groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass');\n b = groupEventedAnimations(element, 'addClass', options, animations, 'addClass');\n }\n\n if (a) {\n operations = operations.concat(a);\n }\n if (b) {\n operations = operations.concat(b);\n }\n }\n\n if (operations.length === 0) return;\n\n // TODO(matsko): add documentation\n return function startAnimation(callback) {\n var runners = [];\n if (operations.length) {\n forEach(operations, function(animateFn) {\n runners.push(animateFn());\n });\n }\n\n runners.length ? $$AnimateRunner.all(runners, callback) : callback();\n\n return function endFn(reject) {\n forEach(runners, function(runner) {\n reject ? runner.cancel() : runner.end();\n });\n };\n };\n }\n };\n\n function lookupAnimations(classes) {\n classes = isArray(classes) ? classes : classes.split(' ');\n var matches = [], flagMap = {};\n for (var i=0; i < classes.length; i++) {\n var klass = classes[i],\n animationFactory = $animateProvider.$$registeredAnimations[klass];\n if (animationFactory && !flagMap[klass]) {\n matches.push($injector.get(animationFactory));\n flagMap[klass] = true;\n }\n }\n return matches;\n }\n }];\n}];\n\nvar $$AnimateJsDriverProvider = ['$$animationProvider', function($$animationProvider) {\n $$animationProvider.drivers.push('$$animateJsDriver');\n this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {\n return function initDriverFn(animationDetails) {\n if (animationDetails.from && animationDetails.to) {\n var fromAnimation = prepareAnimation(animationDetails.from);\n var toAnimation = prepareAnimation(animationDetails.to);\n if (!fromAnimation && !toAnimation) return;\n\n return {\n start: function() {\n var animationRunners = [];\n\n if (fromAnimation) {\n animationRunners.push(fromAnimation.start());\n }\n\n if (toAnimation) {\n animationRunners.push(toAnimation.start());\n }\n\n $$AnimateRunner.all(animationRunners, done);\n\n var runner = new $$AnimateRunner({\n end: endFnFactory(),\n cancel: endFnFactory()\n });\n\n return runner;\n\n function endFnFactory() {\n return function() {\n forEach(animationRunners, function(runner) {\n // at this point we cannot cancel animations for groups just yet. 1.5+\n runner.end();\n });\n };\n }\n\n function done(status) {\n runner.complete(status);\n }\n }\n };\n } else {\n return prepareAnimation(animationDetails);\n }\n };\n\n function prepareAnimation(animationDetails) {\n // TODO(matsko): make sure to check for grouped animations and delegate down to normal animations\n var element = animationDetails.element;\n var event = animationDetails.event;\n var options = animationDetails.options;\n var classes = animationDetails.classes;\n return $$animateJs(element, event, classes, options);\n }\n }];\n}];\n\nvar NG_ANIMATE_ATTR_NAME = 'data-ng-animate';\nvar NG_ANIMATE_PIN_DATA = '$ngAnimatePin';\nvar $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {\n var PRE_DIGEST_STATE = 1;\n var RUNNING_STATE = 2;\n var ONE_SPACE = ' ';\n\n var rules = this.rules = {\n skip: [],\n cancel: [],\n join: []\n };\n\n function makeTruthyCssClassMap(classString) {\n if (!classString) {\n return null;\n }\n\n var keys = classString.split(ONE_SPACE);\n var map = Object.create(null);\n\n forEach(keys, function(key) {\n map[key] = true;\n });\n return map;\n }\n\n function hasMatchingClasses(newClassString, currentClassString) {\n if (newClassString && currentClassString) {\n var currentClassMap = makeTruthyCssClassMap(currentClassString);\n return newClassString.split(ONE_SPACE).some(function(className) {\n return currentClassMap[className];\n });\n }\n }\n\n function isAllowed(ruleType, element, currentAnimation, previousAnimation) {\n return rules[ruleType].some(function(fn) {\n return fn(element, currentAnimation, previousAnimation);\n });\n }\n\n function hasAnimationClasses(animation, and) {\n var a = (animation.addClass || '').length > 0;\n var b = (animation.removeClass || '').length > 0;\n return and ? a && b : a || b;\n }\n\n rules.join.push(function(element, newAnimation, currentAnimation) {\n // if the new animation is class-based then we can just tack that on\n return !newAnimation.structural && hasAnimationClasses(newAnimation);\n });\n\n rules.skip.push(function(element, newAnimation, currentAnimation) {\n // there is no need to animate anything if no classes are being added and\n // there is no structural animation that will be triggered\n return !newAnimation.structural && !hasAnimationClasses(newAnimation);\n });\n\n rules.skip.push(function(element, newAnimation, currentAnimation) {\n // why should we trigger a new structural animation if the element will\n // be removed from the DOM anyway?\n return currentAnimation.event == 'leave' && newAnimation.structural;\n });\n\n rules.skip.push(function(element, newAnimation, currentAnimation) {\n // if there is an ongoing current animation then don't even bother running the class-based animation\n return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural;\n });\n\n rules.cancel.push(function(element, newAnimation, currentAnimation) {\n // there can never be two structural animations running at the same time\n return currentAnimation.structural && newAnimation.structural;\n });\n\n rules.cancel.push(function(element, newAnimation, currentAnimation) {\n // if the previous animation is already running, but the new animation will\n // be triggered, but the new animation is structural\n return currentAnimation.state === RUNNING_STATE && newAnimation.structural;\n });\n\n rules.cancel.push(function(element, newAnimation, currentAnimation) {\n // cancel the animation if classes added / removed in both animation cancel each other out,\n // but only if the current animation isn't structural\n\n if (currentAnimation.structural) return false;\n\n var nA = newAnimation.addClass;\n var nR = newAnimation.removeClass;\n var cA = currentAnimation.addClass;\n var cR = currentAnimation.removeClass;\n\n // early detection to save the global CPU shortage :)\n if ((isUndefined(nA) && isUndefined(nR)) || (isUndefined(cA) && isUndefined(cR))) {\n return false;\n }\n\n return hasMatchingClasses(nA, cR) || hasMatchingClasses(nR, cA);\n });\n\n this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap',\n '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow',\n function($$rAF, $rootScope, $rootElement, $document, $$HashMap,\n $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow) {\n\n var activeAnimationsLookup = new $$HashMap();\n var disabledElementsLookup = new $$HashMap();\n var animationsEnabled = null;\n\n function postDigestTaskFactory() {\n var postDigestCalled = false;\n return function(fn) {\n // we only issue a call to postDigest before\n // it has first passed. This prevents any callbacks\n // from not firing once the animation has completed\n // since it will be out of the digest cycle.\n if (postDigestCalled) {\n fn();\n } else {\n $rootScope.$$postDigest(function() {\n postDigestCalled = true;\n fn();\n });\n }\n };\n }\n\n // Wait until all directive and route-related templates are downloaded and\n // compiled. The $templateRequest.totalPendingRequests variable keeps track of\n // all of the remote templates being currently downloaded. If there are no\n // templates currently downloading then the watcher will still fire anyway.\n var deregisterWatch = $rootScope.$watch(\n function() { return $templateRequest.totalPendingRequests === 0; },\n function(isEmpty) {\n if (!isEmpty) return;\n deregisterWatch();\n\n // Now that all templates have been downloaded, $animate will wait until\n // the post digest queue is empty before enabling animations. By having two\n // calls to $postDigest calls we can ensure that the flag is enabled at the\n // very end of the post digest queue. Since all of the animations in $animate\n // use $postDigest, it's important that the code below executes at the end.\n // This basically means that the page is fully downloaded and compiled before\n // any animations are triggered.\n $rootScope.$$postDigest(function() {\n $rootScope.$$postDigest(function() {\n // we check for null directly in the event that the application already called\n // .enabled() with whatever arguments that it provided it with\n if (animationsEnabled === null) {\n animationsEnabled = true;\n }\n });\n });\n }\n );\n\n var callbackRegistry = Object.create(null);\n\n // remember that the classNameFilter is set during the provider/config\n // stage therefore we can optimize here and setup a helper function\n var classNameFilter = $animateProvider.classNameFilter();\n var isAnimatableClassName = !classNameFilter\n ? function() { return true; }\n : function(className) {\n return classNameFilter.test(className);\n };\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function normalizeAnimationDetails(element, animation) {\n return mergeAnimationDetails(element, animation, {});\n }\n\n // IE9-11 has no method \"contains\" in SVG element and in Node.prototype. Bug #10259.\n var contains = window.Node.prototype.contains || function(arg) {\n // jshint bitwise: false\n return this === arg || !!(this.compareDocumentPosition(arg) & 16);\n // jshint bitwise: true\n };\n\n function findCallbacks(parent, element, event) {\n var targetNode = getDomNode(element);\n var targetParentNode = getDomNode(parent);\n\n var matches = [];\n var entries = callbackRegistry[event];\n if (entries) {\n forEach(entries, function(entry) {\n if (contains.call(entry.node, targetNode)) {\n matches.push(entry.callback);\n } else if (event === 'leave' && contains.call(entry.node, targetParentNode)) {\n matches.push(entry.callback);\n }\n });\n }\n\n return matches;\n }\n\n function filterFromRegistry(list, matchContainer, matchCallback) {\n var containerNode = extractElementNode(matchContainer);\n return list.filter(function(entry) {\n var isMatch = entry.node === containerNode &&\n (!matchCallback || entry.callback === matchCallback);\n return !isMatch;\n });\n }\n\n function cleanupEventListeners(phase, element) {\n if (phase === 'close' && !element[0].parentNode) {\n // If the element is not attached to a parentNode, it has been removed by\n // the domOperation, and we can safely remove the event callbacks\n $animate.off(element);\n }\n }\n\n var $animate = {\n on: function(event, container, callback) {\n var node = extractElementNode(container);\n callbackRegistry[event] = callbackRegistry[event] || [];\n callbackRegistry[event].push({\n node: node,\n callback: callback\n });\n\n // Remove the callback when the element is removed from the DOM\n jqLite(container).on('$destroy', function() {\n var animationDetails = activeAnimationsLookup.get(node);\n\n if (!animationDetails) {\n // If there's an animation ongoing, the callback calling code will remove\n // the event listeners. If we'd remove here, the callbacks would be removed\n // before the animation ends\n $animate.off(event, container, callback);\n }\n });\n },\n\n off: function(event, container, callback) {\n if (arguments.length === 1 && !isString(arguments[0])) {\n container = arguments[0];\n for (var eventType in callbackRegistry) {\n callbackRegistry[eventType] = filterFromRegistry(callbackRegistry[eventType], container);\n }\n\n return;\n }\n\n var entries = callbackRegistry[event];\n if (!entries) return;\n\n callbackRegistry[event] = arguments.length === 1\n ? null\n : filterFromRegistry(entries, container, callback);\n },\n\n pin: function(element, parentElement) {\n assertArg(isElement(element), 'element', 'not an element');\n assertArg(isElement(parentElement), 'parentElement', 'not an element');\n element.data(NG_ANIMATE_PIN_DATA, parentElement);\n },\n\n push: function(element, event, options, domOperation) {\n options = options || {};\n options.domOperation = domOperation;\n return queueAnimation(element, event, options);\n },\n\n // this method has four signatures:\n // () - global getter\n // (bool) - global setter\n // (element) - element getter\n // (element, bool) - element setter\n enabled: function(element, bool) {\n var argCount = arguments.length;\n\n if (argCount === 0) {\n // () - Global getter\n bool = !!animationsEnabled;\n } else {\n var hasElement = isElement(element);\n\n if (!hasElement) {\n // (bool) - Global setter\n bool = animationsEnabled = !!element;\n } else {\n var node = getDomNode(element);\n\n if (argCount === 1) {\n // (element) - Element getter\n bool = !disabledElementsLookup.get(node);\n } else {\n // (element, bool) - Element setter\n disabledElementsLookup.put(node, !bool);\n }\n }\n }\n\n return bool;\n }\n };\n\n return $animate;\n\n function queueAnimation(element, event, initialOptions) {\n // we always make a copy of the options since\n // there should never be any side effects on\n // the input data when running `$animateCss`.\n var options = copy(initialOptions);\n\n var node, parent;\n element = stripCommentsFromElement(element);\n if (element) {\n node = getDomNode(element);\n parent = element.parent();\n }\n\n options = prepareAnimationOptions(options);\n\n // we create a fake runner with a working promise.\n // These methods will become available after the digest has passed\n var runner = new $$AnimateRunner();\n\n // this is used to trigger callbacks in postDigest mode\n var runInNextPostDigestOrNow = postDigestTaskFactory();\n\n if (isArray(options.addClass)) {\n options.addClass = options.addClass.join(' ');\n }\n\n if (options.addClass && !isString(options.addClass)) {\n options.addClass = null;\n }\n\n if (isArray(options.removeClass)) {\n options.removeClass = options.removeClass.join(' ');\n }\n\n if (options.removeClass && !isString(options.removeClass)) {\n options.removeClass = null;\n }\n\n if (options.from && !isObject(options.from)) {\n options.from = null;\n }\n\n if (options.to && !isObject(options.to)) {\n options.to = null;\n }\n\n // there are situations where a directive issues an animation for\n // a jqLite wrapper that contains only comment nodes... If this\n // happens then there is no way we can perform an animation\n if (!node) {\n close();\n return runner;\n }\n\n var className = [node.className, options.addClass, options.removeClass].join(' ');\n if (!isAnimatableClassName(className)) {\n close();\n return runner;\n }\n\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n var documentHidden = $document[0].hidden;\n\n // this is a hard disable of all animations for the application or on\n // the element itself, therefore there is no need to continue further\n // past this point if not enabled\n // Animations are also disabled if the document is currently hidden (page is not visible\n // to the user), because browsers slow down or do not flush calls to requestAnimationFrame\n var skipAnimations = !animationsEnabled || documentHidden || disabledElementsLookup.get(node);\n var existingAnimation = (!skipAnimations && activeAnimationsLookup.get(node)) || {};\n var hasExistingAnimation = !!existingAnimation.state;\n\n // there is no point in traversing the same collection of parent ancestors if a followup\n // animation will be run on the same element that already did all that checking work\n if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state != PRE_DIGEST_STATE)) {\n skipAnimations = !areAnimationsAllowed(element, parent, event);\n }\n\n if (skipAnimations) {\n // Callbacks should fire even if the document is hidden (regression fix for issue #14120)\n if (documentHidden) notifyProgress(runner, event, 'start');\n close();\n if (documentHidden) notifyProgress(runner, event, 'close');\n return runner;\n }\n\n if (isStructural) {\n closeChildAnimations(element);\n }\n\n var newAnimation = {\n structural: isStructural,\n element: element,\n event: event,\n addClass: options.addClass,\n removeClass: options.removeClass,\n close: close,\n options: options,\n runner: runner\n };\n\n if (hasExistingAnimation) {\n var skipAnimationFlag = isAllowed('skip', element, newAnimation, existingAnimation);\n if (skipAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n close();\n return runner;\n } else {\n mergeAnimationDetails(element, existingAnimation, newAnimation);\n return existingAnimation.runner;\n }\n }\n var cancelAnimationFlag = isAllowed('cancel', element, newAnimation, existingAnimation);\n if (cancelAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n // this will end the animation right away and it is safe\n // to do so since the animation is already running and the\n // runner callback code will run in async\n existingAnimation.runner.end();\n } else if (existingAnimation.structural) {\n // this means that the animation is queued into a digest, but\n // hasn't started yet. Therefore it is safe to run the close\n // method which will call the runner methods in async.\n existingAnimation.close();\n } else {\n // this will merge the new animation options into existing animation options\n mergeAnimationDetails(element, existingAnimation, newAnimation);\n\n return existingAnimation.runner;\n }\n } else {\n // a joined animation means that this animation will take over the existing one\n // so an example would involve a leave animation taking over an enter. Then when\n // the postDigest kicks in the enter will be ignored.\n var joinAnimationFlag = isAllowed('join', element, newAnimation, existingAnimation);\n if (joinAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n normalizeAnimationDetails(element, newAnimation);\n } else {\n applyGeneratedPreparationClasses(element, isStructural ? event : null, options);\n\n event = newAnimation.event = existingAnimation.event;\n options = mergeAnimationDetails(element, existingAnimation, newAnimation);\n\n //we return the same runner since only the option values of this animation will\n //be fed into the `existingAnimation`.\n return existingAnimation.runner;\n }\n }\n }\n } else {\n // normalization in this case means that it removes redundant CSS classes that\n // already exist (addClass) or do not exist (removeClass) on the element\n normalizeAnimationDetails(element, newAnimation);\n }\n\n // when the options are merged and cleaned up we may end up not having to do\n // an animation at all, therefore we should check this before issuing a post\n // digest callback. Structural animations will always run no matter what.\n var isValidAnimation = newAnimation.structural;\n if (!isValidAnimation) {\n // animate (from/to) can be quickly checked first, otherwise we check if any classes are present\n isValidAnimation = (newAnimation.event === 'animate' && Object.keys(newAnimation.options.to || {}).length > 0)\n || hasAnimationClasses(newAnimation);\n }\n\n if (!isValidAnimation) {\n close();\n clearElementAnimationState(element);\n return runner;\n }\n\n // the counter keeps track of cancelled animations\n var counter = (existingAnimation.counter || 0) + 1;\n newAnimation.counter = counter;\n\n markElementAnimationState(element, PRE_DIGEST_STATE, newAnimation);\n\n $rootScope.$$postDigest(function() {\n var animationDetails = activeAnimationsLookup.get(node);\n var animationCancelled = !animationDetails;\n animationDetails = animationDetails || {};\n\n // if addClass/removeClass is called before something like enter then the\n // registered parent element may not be present. The code below will ensure\n // that a final value for parent element is obtained\n var parentElement = element.parent() || [];\n\n // animate/structural/class-based animations all have requirements. Otherwise there\n // is no point in performing an animation. The parent node must also be set.\n var isValidAnimation = parentElement.length > 0\n && (animationDetails.event === 'animate'\n || animationDetails.structural\n || hasAnimationClasses(animationDetails));\n\n // this means that the previous animation was cancelled\n // even if the follow-up animation is the same event\n if (animationCancelled || animationDetails.counter !== counter || !isValidAnimation) {\n // if another animation did not take over then we need\n // to make sure that the domOperation and options are\n // handled accordingly\n if (animationCancelled) {\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n }\n\n // if the event changed from something like enter to leave then we do\n // it, otherwise if it's the same then the end result will be the same too\n if (animationCancelled || (isStructural && animationDetails.event !== event)) {\n options.domOperation();\n runner.end();\n }\n\n // in the event that the element animation was not cancelled or a follow-up animation\n // isn't allowed to animate from here then we need to clear the state of the element\n // so that any future animations won't read the expired animation data.\n if (!isValidAnimation) {\n clearElementAnimationState(element);\n }\n\n return;\n }\n\n // this combined multiple class to addClass / removeClass into a setClass event\n // so long as a structural event did not take over the animation\n event = !animationDetails.structural && hasAnimationClasses(animationDetails, true)\n ? 'setClass'\n : animationDetails.event;\n\n markElementAnimationState(element, RUNNING_STATE);\n var realRunner = $$animation(element, event, animationDetails.options);\n\n // this will update the runner's flow-control events based on\n // the `realRunner` object.\n runner.setHost(realRunner);\n notifyProgress(runner, event, 'start', {});\n\n realRunner.done(function(status) {\n close(!status);\n var animationDetails = activeAnimationsLookup.get(node);\n if (animationDetails && animationDetails.counter === counter) {\n clearElementAnimationState(getDomNode(element));\n }\n notifyProgress(runner, event, 'close', {});\n });\n });\n\n return runner;\n\n function notifyProgress(runner, event, phase, data) {\n runInNextPostDigestOrNow(function() {\n var callbacks = findCallbacks(parent, element, event);\n if (callbacks.length) {\n // do not optimize this call here to RAF because\n // we don't know how heavy the callback code here will\n // be and if this code is buffered then this can\n // lead to a performance regression.\n $$rAF(function() {\n forEach(callbacks, function(callback) {\n callback(element, phase, data);\n });\n cleanupEventListeners(phase, element);\n });\n } else {\n cleanupEventListeners(phase, element);\n }\n });\n runner.progress(event, phase, data);\n }\n\n function close(reject) { // jshint ignore:line\n clearGeneratedClasses(element, options);\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n options.domOperation();\n runner.complete(!reject);\n }\n }\n\n function closeChildAnimations(element) {\n var node = getDomNode(element);\n var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');\n forEach(children, function(child) {\n var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME));\n var animationDetails = activeAnimationsLookup.get(child);\n if (animationDetails) {\n switch (state) {\n case RUNNING_STATE:\n animationDetails.runner.end();\n /* falls through */\n case PRE_DIGEST_STATE:\n activeAnimationsLookup.remove(child);\n break;\n }\n }\n });\n }\n\n function clearElementAnimationState(element) {\n var node = getDomNode(element);\n node.removeAttribute(NG_ANIMATE_ATTR_NAME);\n activeAnimationsLookup.remove(node);\n }\n\n function isMatchingElement(nodeOrElmA, nodeOrElmB) {\n return getDomNode(nodeOrElmA) === getDomNode(nodeOrElmB);\n }\n\n /**\n * This fn returns false if any of the following is true:\n * a) animations on any parent element are disabled, and animations on the element aren't explicitly allowed\n * b) a parent element has an ongoing structural animation, and animateChildren is false\n * c) the element is not a child of the body\n * d) the element is not a child of the $rootElement\n */\n function areAnimationsAllowed(element, parentElement, event) {\n var bodyElement = jqLite($document[0].body);\n var bodyElementDetected = isMatchingElement(element, bodyElement) || element[0].nodeName === 'HTML';\n var rootElementDetected = isMatchingElement(element, $rootElement);\n var parentAnimationDetected = false;\n var animateChildren;\n var elementDisabled = disabledElementsLookup.get(getDomNode(element));\n\n var parentHost = jqLite.data(element[0], NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n parentElement = parentHost;\n }\n\n parentElement = getDomNode(parentElement);\n\n while (parentElement) {\n if (!rootElementDetected) {\n // angular doesn't want to attempt to animate elements outside of the application\n // therefore we need to ensure that the rootElement is an ancestor of the current element\n rootElementDetected = isMatchingElement(parentElement, $rootElement);\n }\n\n if (parentElement.nodeType !== ELEMENT_NODE) {\n // no point in inspecting the #document element\n break;\n }\n\n var details = activeAnimationsLookup.get(parentElement) || {};\n // either an enter, leave or move animation will commence\n // therefore we can't allow any animations to take place\n // but if a parent animation is class-based then that's ok\n if (!parentAnimationDetected) {\n var parentElementDisabled = disabledElementsLookup.get(parentElement);\n\n if (parentElementDisabled === true && elementDisabled !== false) {\n // disable animations if the user hasn't explicitly enabled animations on the\n // current element\n elementDisabled = true;\n // element is disabled via parent element, no need to check anything else\n break;\n } else if (parentElementDisabled === false) {\n elementDisabled = false;\n }\n parentAnimationDetected = details.structural;\n }\n\n if (isUndefined(animateChildren) || animateChildren === true) {\n var value = jqLite.data(parentElement, NG_ANIMATE_CHILDREN_DATA);\n if (isDefined(value)) {\n animateChildren = value;\n }\n }\n\n // there is no need to continue traversing at this point\n if (parentAnimationDetected && animateChildren === false) break;\n\n if (!bodyElementDetected) {\n // we also need to ensure that the element is or will be a part of the body element\n // otherwise it is pointless to even issue an animation to be rendered\n bodyElementDetected = isMatchingElement(parentElement, bodyElement);\n }\n\n if (bodyElementDetected && rootElementDetected) {\n // If both body and root have been found, any other checks are pointless,\n // as no animation data should live outside the application\n break;\n }\n\n if (!rootElementDetected) {\n // If no rootElement is detected, check if the parentElement is pinned to another element\n parentHost = jqLite.data(parentElement, NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n // The pin target element becomes the next parent element\n parentElement = getDomNode(parentHost);\n continue;\n }\n }\n\n parentElement = parentElement.parentNode;\n }\n\n var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true;\n return allowAnimation && rootElementDetected && bodyElementDetected;\n }\n\n function markElementAnimationState(element, state, details) {\n details = details || {};\n details.state = state;\n\n var node = getDomNode(element);\n node.setAttribute(NG_ANIMATE_ATTR_NAME, state);\n\n var oldValue = activeAnimationsLookup.get(node);\n var newValue = oldValue\n ? extend(oldValue, details)\n : details;\n activeAnimationsLookup.put(node, newValue);\n }\n }];\n}];\n\nvar $$AnimationProvider = ['$animateProvider', function($animateProvider) {\n var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';\n\n var drivers = this.drivers = [];\n\n var RUNNER_STORAGE_KEY = '$$animationRunner';\n\n function setRunner(element, runner) {\n element.data(RUNNER_STORAGE_KEY, runner);\n }\n\n function removeRunner(element) {\n element.removeData(RUNNER_STORAGE_KEY);\n }\n\n function getRunner(element) {\n return element.data(RUNNER_STORAGE_KEY);\n }\n\n this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$HashMap', '$$rAFScheduler',\n function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$HashMap, $$rAFScheduler) {\n\n var animationQueue = [];\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function sortAnimations(animations) {\n var tree = { children: [] };\n var i, lookup = new $$HashMap();\n\n // this is done first beforehand so that the hashmap\n // is filled with a list of the elements that will be animated\n for (i = 0; i < animations.length; i++) {\n var animation = animations[i];\n lookup.put(animation.domNode, animations[i] = {\n domNode: animation.domNode,\n fn: animation.fn,\n children: []\n });\n }\n\n for (i = 0; i < animations.length; i++) {\n processNode(animations[i]);\n }\n\n return flatten(tree);\n\n function processNode(entry) {\n if (entry.processed) return entry;\n entry.processed = true;\n\n var elementNode = entry.domNode;\n var parentNode = elementNode.parentNode;\n lookup.put(elementNode, entry);\n\n var parentEntry;\n while (parentNode) {\n parentEntry = lookup.get(parentNode);\n if (parentEntry) {\n if (!parentEntry.processed) {\n parentEntry = processNode(parentEntry);\n }\n break;\n }\n parentNode = parentNode.parentNode;\n }\n\n (parentEntry || tree).children.push(entry);\n return entry;\n }\n\n function flatten(tree) {\n var result = [];\n var queue = [];\n var i;\n\n for (i = 0; i < tree.children.length; i++) {\n queue.push(tree.children[i]);\n }\n\n var remainingLevelEntries = queue.length;\n var nextLevelEntries = 0;\n var row = [];\n\n for (i = 0; i < queue.length; i++) {\n var entry = queue[i];\n if (remainingLevelEntries <= 0) {\n remainingLevelEntries = nextLevelEntries;\n nextLevelEntries = 0;\n result.push(row);\n row = [];\n }\n row.push(entry.fn);\n entry.children.forEach(function(childEntry) {\n nextLevelEntries++;\n queue.push(childEntry);\n });\n remainingLevelEntries--;\n }\n\n if (row.length) {\n result.push(row);\n }\n\n return result;\n }\n }\n\n // TODO(matsko): document the signature in a better way\n return function(element, event, options) {\n options = prepareAnimationOptions(options);\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n // there is no animation at the current moment, however\n // these runner methods will get later updated with the\n // methods leading into the driver's end/cancel methods\n // for now they just stop the animation from starting\n var runner = new $$AnimateRunner({\n end: function() { close(); },\n cancel: function() { close(true); }\n });\n\n if (!drivers.length) {\n close();\n return runner;\n }\n\n setRunner(element, runner);\n\n var classes = mergeClasses(element.attr('class'), mergeClasses(options.addClass, options.removeClass));\n var tempClasses = options.tempClasses;\n if (tempClasses) {\n classes += ' ' + tempClasses;\n options.tempClasses = null;\n }\n\n var prepareClassName;\n if (isStructural) {\n prepareClassName = 'ng-' + event + PREPARE_CLASS_SUFFIX;\n $$jqLite.addClass(element, prepareClassName);\n }\n\n animationQueue.push({\n // this data is used by the postDigest code and passed into\n // the driver step function\n element: element,\n classes: classes,\n event: event,\n structural: isStructural,\n options: options,\n beforeStart: beforeStart,\n close: close\n });\n\n element.on('$destroy', handleDestroyedElement);\n\n // we only want there to be one function called within the post digest\n // block. This way we can group animations for all the animations that\n // were apart of the same postDigest flush call.\n if (animationQueue.length > 1) return runner;\n\n $rootScope.$$postDigest(function() {\n var animations = [];\n forEach(animationQueue, function(entry) {\n // the element was destroyed early on which removed the runner\n // form its storage. This means we can't animate this element\n // at all and it already has been closed due to destruction.\n if (getRunner(entry.element)) {\n animations.push(entry);\n } else {\n entry.close();\n }\n });\n\n // now any future animations will be in another postDigest\n animationQueue.length = 0;\n\n var groupedAnimations = groupAnimations(animations);\n var toBeSortedAnimations = [];\n\n forEach(groupedAnimations, function(animationEntry) {\n toBeSortedAnimations.push({\n domNode: getDomNode(animationEntry.from ? animationEntry.from.element : animationEntry.element),\n fn: function triggerAnimationStart() {\n // it's important that we apply the `ng-animate` CSS class and the\n // temporary classes before we do any driver invoking since these\n // CSS classes may be required for proper CSS detection.\n animationEntry.beforeStart();\n\n var startAnimationFn, closeFn = animationEntry.close;\n\n // in the event that the element was removed before the digest runs or\n // during the RAF sequencing then we should not trigger the animation.\n var targetElement = animationEntry.anchors\n ? (animationEntry.from.element || animationEntry.to.element)\n : animationEntry.element;\n\n if (getRunner(targetElement)) {\n var operation = invokeFirstDriver(animationEntry);\n if (operation) {\n startAnimationFn = operation.start;\n }\n }\n\n if (!startAnimationFn) {\n closeFn();\n } else {\n var animationRunner = startAnimationFn();\n animationRunner.done(function(status) {\n closeFn(!status);\n });\n updateAnimationRunners(animationEntry, animationRunner);\n }\n }\n });\n });\n\n // we need to sort each of the animations in order of parent to child\n // relationships. This ensures that the child classes are applied at the\n // right time.\n $$rAFScheduler(sortAnimations(toBeSortedAnimations));\n });\n\n return runner;\n\n // TODO(matsko): change to reference nodes\n function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }\n\n function groupAnimations(animations) {\n var preparedAnimations = [];\n var refLookup = {};\n forEach(animations, function(animation, index) {\n var element = animation.element;\n var node = getDomNode(element);\n var event = animation.event;\n var enterOrMove = ['enter', 'move'].indexOf(event) >= 0;\n var anchorNodes = animation.structural ? getAnchorNodes(node) : [];\n\n if (anchorNodes.length) {\n var direction = enterOrMove ? 'to' : 'from';\n\n forEach(anchorNodes, function(anchor) {\n var key = anchor.getAttribute(NG_ANIMATE_REF_ATTR);\n refLookup[key] = refLookup[key] || {};\n refLookup[key][direction] = {\n animationID: index,\n element: jqLite(anchor)\n };\n });\n } else {\n preparedAnimations.push(animation);\n }\n });\n\n var usedIndicesLookup = {};\n var anchorGroups = {};\n forEach(refLookup, function(operations, key) {\n var from = operations.from;\n var to = operations.to;\n\n if (!from || !to) {\n // only one of these is set therefore we can't have an\n // anchor animation since all three pieces are required\n var index = from ? from.animationID : to.animationID;\n var indexKey = index.toString();\n if (!usedIndicesLookup[indexKey]) {\n usedIndicesLookup[indexKey] = true;\n preparedAnimations.push(animations[index]);\n }\n return;\n }\n\n var fromAnimation = animations[from.animationID];\n var toAnimation = animations[to.animationID];\n var lookupKey = from.animationID.toString();\n if (!anchorGroups[lookupKey]) {\n var group = anchorGroups[lookupKey] = {\n structural: true,\n beforeStart: function() {\n fromAnimation.beforeStart();\n toAnimation.beforeStart();\n },\n close: function() {\n fromAnimation.close();\n toAnimation.close();\n },\n classes: cssClassesIntersection(fromAnimation.classes, toAnimation.classes),\n from: fromAnimation,\n to: toAnimation,\n anchors: [] // TODO(matsko): change to reference nodes\n };\n\n // the anchor animations require that the from and to elements both have at least\n // one shared CSS class which effectively marries the two elements together to use\n // the same animation driver and to properly sequence the anchor animation.\n if (group.classes.length) {\n preparedAnimations.push(group);\n } else {\n preparedAnimations.push(fromAnimation);\n preparedAnimations.push(toAnimation);\n }\n }\n\n anchorGroups[lookupKey].anchors.push({\n 'out': from.element, 'in': to.element\n });\n });\n\n return preparedAnimations;\n }\n\n function cssClassesIntersection(a,b) {\n a = a.split(' ');\n b = b.split(' ');\n var matches = [];\n\n for (var i = 0; i < a.length; i++) {\n var aa = a[i];\n if (aa.substring(0,3) === 'ng-') continue;\n\n for (var j = 0; j < b.length; j++) {\n if (aa === b[j]) {\n matches.push(aa);\n break;\n }\n }\n }\n\n return matches.join(' ');\n }\n\n function invokeFirstDriver(animationDetails) {\n // we loop in reverse order since the more general drivers (like CSS and JS)\n // may attempt more elements, but custom drivers are more particular\n for (var i = drivers.length - 1; i >= 0; i--) {\n var driverName = drivers[i];\n var factory = $injector.get(driverName);\n var driver = factory(animationDetails);\n if (driver) {\n return driver;\n }\n }\n }\n\n function beforeStart() {\n element.addClass(NG_ANIMATE_CLASSNAME);\n if (tempClasses) {\n $$jqLite.addClass(element, tempClasses);\n }\n if (prepareClassName) {\n $$jqLite.removeClass(element, prepareClassName);\n prepareClassName = null;\n }\n }\n\n function updateAnimationRunners(animation, newRunner) {\n if (animation.from && animation.to) {\n update(animation.from.element);\n update(animation.to.element);\n } else {\n update(animation.element);\n }\n\n function update(element) {\n var runner = getRunner(element);\n if (runner) runner.setHost(newRunner);\n }\n }\n\n function handleDestroyedElement() {\n var runner = getRunner(element);\n if (runner && (event !== 'leave' || !options.$$domOperationFired)) {\n runner.end();\n }\n }\n\n function close(rejected) { // jshint ignore:line\n element.off('$destroy', handleDestroyedElement);\n removeRunner(element);\n\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n options.domOperation();\n\n if (tempClasses) {\n $$jqLite.removeClass(element, tempClasses);\n }\n\n element.removeClass(NG_ANIMATE_CLASSNAME);\n runner.complete(!rejected);\n }\n };\n }];\n}];\n\n/**\n * @ngdoc directive\n * @name ngAnimateSwap\n * @restrict A\n * @scope\n *\n * @description\n *\n * ngAnimateSwap is a animation-oriented directive that allows for the container to\n * be removed and entered in whenever the associated expression changes. A\n * common usecase for this directive is a rotating banner or slider component which\n * contains one image being present at a time. When the active image changes\n * then the old image will perform a `leave` animation and the new element\n * will be inserted via an `enter` animation.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|--------------------------------------|\n * | {@link ng.$animate#enter enter} | when the new element is inserted to the DOM |\n * | {@link ng.$animate#leave leave} | when the old element is removed from the DOM |\n *\n * @example\n * \n * \n *
    \n *
    \n * {{ number }}\n *
    \n *
    \n *
    \n * \n * angular.module('ngAnimateSwapExample', ['ngAnimate'])\n * .controller('AppCtrl', ['$scope', '$interval', function($scope, $interval) {\n * $scope.number = 0;\n * $interval(function() {\n * $scope.number++;\n * }, 1000);\n *\n * var colors = ['red','blue','green','yellow','orange'];\n * $scope.colorClass = function(number) {\n * return colors[number % colors.length];\n * };\n * }]);\n * \n * \n * .container {\n * height:250px;\n * width:250px;\n * position:relative;\n * overflow:hidden;\n * border:2px solid black;\n * }\n * .container .cell {\n * font-size:150px;\n * text-align:center;\n * line-height:250px;\n * position:absolute;\n * top:0;\n * left:0;\n * right:0;\n * border-bottom:2px solid black;\n * }\n * .swap-animation.ng-enter, .swap-animation.ng-leave {\n * transition:0.5s linear all;\n * }\n * .swap-animation.ng-enter {\n * top:-250px;\n * }\n * .swap-animation.ng-enter-active {\n * top:0px;\n * }\n * .swap-animation.ng-leave {\n * top:0px;\n * }\n * .swap-animation.ng-leave-active {\n * top:250px;\n * }\n * .red { background:red; }\n * .green { background:green; }\n * .blue { background:blue; }\n * .yellow { background:yellow; }\n * .orange { background:orange; }\n * \n *
    \n */\nvar ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $rootScope) {\n return {\n restrict: 'A',\n transclude: 'element',\n terminal: true,\n priority: 600, // we use 600 here to ensure that the directive is caught before others\n link: function(scope, $element, attrs, ctrl, $transclude) {\n var previousElement, previousScope;\n scope.$watchCollection(attrs.ngAnimateSwap || attrs['for'], function(value) {\n if (previousElement) {\n $animate.leave(previousElement);\n }\n if (previousScope) {\n previousScope.$destroy();\n previousScope = null;\n }\n if (value || value === 0) {\n previousScope = scope.$new();\n $transclude(previousScope, function(element) {\n previousElement = element;\n $animate.enter(element, null, $element);\n });\n }\n });\n }\n };\n}];\n\n/**\n * @ngdoc module\n * @name ngAnimate\n * @description\n *\n * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via\n * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an Angular app.\n *\n *
    \n *\n * # Usage\n * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based\n * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For\n * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within\n * the HTML element that the animation will be triggered on.\n *\n * ## Directive Support\n * The following directives are \"animation aware\":\n *\n * | Directive | Supported Animations |\n * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|\n * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave and move |\n * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave |\n * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |\n * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |\n * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |\n * | {@link ng.directive:ngClass#animations ngClass} | add and remove (the CSS class(es) present) |\n * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide} | add and remove (the ng-hide class value) |\n * | {@link ng.directive:form#animation-hooks form} & {@link ng.directive:ngModel#animation-hooks ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) |\n * | {@link module:ngMessages#animations ngMessages} | add and remove (ng-active & ng-inactive) |\n * | {@link module:ngMessages#animations ngMessage} | enter and leave |\n *\n * (More information can be found by visiting each the documentation associated with each directive.)\n *\n * ## CSS-based Animations\n *\n * CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML\n * and CSS code we can create an animation that will be picked up by Angular when an the underlying directive performs an operation.\n *\n * The example below shows how an `enter` animation can be made possible on an element using `ng-if`:\n *\n * ```html\n *
    \n * Fade me in out\n *
    \n * \n * \n * ```\n *\n * Notice the CSS class **fade**? We can now create the CSS transition code that references this class:\n *\n * ```css\n * /* The starting CSS styles for the enter animation */\n * .fade.ng-enter {\n * transition:0.5s linear all;\n * opacity:0;\n * }\n *\n * /* The finishing CSS styles for the enter animation */\n * .fade.ng-enter.ng-enter-active {\n * opacity:1;\n * }\n * ```\n *\n * The key thing to remember here is that, depending on the animation event (which each of the directives above trigger depending on what's going on) two\n * generated CSS classes will be applied to the element; in the example above we have `.ng-enter` and `.ng-enter-active`. For CSS transitions, the transition\n * code **must** be defined within the starting CSS class (in this case `.ng-enter`). The destination class is what the transition will animate towards.\n *\n * If for example we wanted to create animations for `leave` and `move` (ngRepeat triggers move) then we can do so using the same CSS naming conventions:\n *\n * ```css\n * /* now the element will fade out before it is removed from the DOM */\n * .fade.ng-leave {\n * transition:0.5s linear all;\n * opacity:1;\n * }\n * .fade.ng-leave.ng-leave-active {\n * opacity:0;\n * }\n * ```\n *\n * We can also make use of **CSS Keyframes** by referencing the keyframe animation within the starting CSS class:\n *\n * ```css\n * /* there is no need to define anything inside of the destination\n * CSS class since the keyframe will take charge of the animation */\n * .fade.ng-leave {\n * animation: my_fade_animation 0.5s linear;\n * -webkit-animation: my_fade_animation 0.5s linear;\n * }\n *\n * @keyframes my_fade_animation {\n * from { opacity:1; }\n * to { opacity:0; }\n * }\n *\n * @-webkit-keyframes my_fade_animation {\n * from { opacity:1; }\n * to { opacity:0; }\n * }\n * ```\n *\n * Feel free also mix transitions and keyframes together as well as any other CSS classes on the same element.\n *\n * ### CSS Class-based Animations\n *\n * Class-based animations (animations that are triggered via `ngClass`, `ngShow`, `ngHide` and some other directives) have a slightly different\n * naming convention. Class-based animations are basic enough that a standard transition or keyframe can be referenced on the class being added\n * and removed.\n *\n * For example if we wanted to do a CSS animation for `ngHide` then we place an animation on the `.ng-hide` CSS class:\n *\n * ```html\n *
    \n * Show and hide me\n *
    \n * \n *\n * \n * ```\n *\n * All that is going on here with ngShow/ngHide behind the scenes is the `.ng-hide` class is added/removed (when the hidden state is valid). Since\n * ngShow and ngHide are animation aware then we can match up a transition and ngAnimate handles the rest.\n *\n * In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods that we can use to further decorate the animation\n * with CSS styles.\n *\n * ```html\n *
    \n * Highlight this box\n *
    \n * \n *\n * \n * ```\n *\n * We can also make use of CSS keyframes by placing them within the CSS classes.\n *\n *\n * ### CSS Staggering Animations\n * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a\n * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be\n * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for\n * the animation. The style property expected within the stagger class can either be a **transition-delay** or an\n * **animation-delay** property (or both if your animation contains both transitions and keyframe animations).\n *\n * ```css\n * .my-animation.ng-enter {\n * /* standard transition code */\n * transition: 1s linear all;\n * opacity:0;\n * }\n * .my-animation.ng-enter-stagger {\n * /* this will have a 100ms delay between each successive leave animation */\n * transition-delay: 0.1s;\n *\n * /* As of 1.4.4, this must always be set: it signals ngAnimate\n * to not accidentally inherit a delay property from another CSS class */\n * transition-duration: 0s;\n * }\n * .my-animation.ng-enter.ng-enter-active {\n * /* standard transition styles */\n * opacity:1;\n * }\n * ```\n *\n * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations\n * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this\n * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation\n * will also be reset if one or more animation frames have passed since the multiple calls to `$animate` were fired.\n *\n * The following code will issue the **ng-leave-stagger** event on the element provided:\n *\n * ```js\n * var kids = parent.children();\n *\n * $animate.leave(kids[0]); //stagger index=0\n * $animate.leave(kids[1]); //stagger index=1\n * $animate.leave(kids[2]); //stagger index=2\n * $animate.leave(kids[3]); //stagger index=3\n * $animate.leave(kids[4]); //stagger index=4\n *\n * window.requestAnimationFrame(function() {\n * //stagger has reset itself\n * $animate.leave(kids[5]); //stagger index=0\n * $animate.leave(kids[6]); //stagger index=1\n *\n * $scope.$digest();\n * });\n * ```\n *\n * Stagger animations are currently only supported within CSS-defined animations.\n *\n * ### The `ng-animate` CSS class\n *\n * When ngAnimate is animating an element it will apply the `ng-animate` CSS class to the element for the duration of the animation.\n * This is a temporary CSS class and it will be removed once the animation is over (for both JavaScript and CSS-based animations).\n *\n * Therefore, animations can be applied to an element using this temporary class directly via CSS.\n *\n * ```css\n * .zipper.ng-animate {\n * transition:0.5s linear all;\n * }\n * .zipper.ng-enter {\n * opacity:0;\n * }\n * .zipper.ng-enter.ng-enter-active {\n * opacity:1;\n * }\n * .zipper.ng-leave {\n * opacity:1;\n * }\n * .zipper.ng-leave.ng-leave-active {\n * opacity:0;\n * }\n * ```\n *\n * (Note that the `ng-animate` CSS class is reserved and it cannot be applied on an element directly since ngAnimate will always remove\n * the CSS class once an animation has completed.)\n *\n *\n * ### The `ng-[event]-prepare` class\n *\n * This is a special class that can be used to prevent unwanted flickering / flash of content before\n * the actual animation starts. The class is added as soon as an animation is initialized, but removed\n * before the actual animation starts (after waiting for a $digest).\n * It is also only added for *structural* animations (`enter`, `move`, and `leave`).\n *\n * In practice, flickering can appear when nesting elements with structural animations such as `ngIf`\n * into elements that have class-based animations such as `ngClass`.\n *\n * ```html\n *
    \n *
    \n *
    \n *
    \n *
    \n * ```\n *\n * It is possible that during the `enter` animation, the `.message` div will be briefly visible before it starts animating.\n * In that case, you can add styles to the CSS that make sure the element stays hidden before the animation starts:\n *\n * ```css\n * .message.ng-enter-prepare {\n * opacity: 0;\n * }\n *\n * ```\n *\n * ## JavaScript-based Animations\n *\n * ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared\n * CSS class that is referenced in our HTML code) but in addition we need to register the JavaScript animation on the module. By making use of the\n * `module.animation()` module function we can register the animation.\n *\n * Let's see an example of a enter/leave animation using `ngRepeat`:\n *\n * ```html\n *
    \n * {{ item }}\n *
    \n * ```\n *\n * See the **slide** CSS class? Let's use that class to define an animation that we'll structure in our module code by using `module.animation`:\n *\n * ```js\n * myModule.animation('.slide', [function() {\n * return {\n * // make note that other events (like addClass/removeClass)\n * // have different function input parameters\n * enter: function(element, doneFn) {\n * jQuery(element).fadeIn(1000, doneFn);\n *\n * // remember to call doneFn so that angular\n * // knows that the animation has concluded\n * },\n *\n * move: function(element, doneFn) {\n * jQuery(element).fadeIn(1000, doneFn);\n * },\n *\n * leave: function(element, doneFn) {\n * jQuery(element).fadeOut(1000, doneFn);\n * }\n * }\n * }]);\n * ```\n *\n * The nice thing about JS-based animations is that we can inject other services and make use of advanced animation libraries such as\n * greensock.js and velocity.js.\n *\n * If our animation code class-based (meaning that something like `ngClass`, `ngHide` and `ngShow` triggers it) then we can still define\n * our animations inside of the same registered animation, however, the function input arguments are a bit different:\n *\n * ```html\n *
    \n * this box is moody\n *
    \n * \n * \n * \n * ```\n *\n * ```js\n * myModule.animation('.colorful', [function() {\n * return {\n * addClass: function(element, className, doneFn) {\n * // do some cool animation and call the doneFn\n * },\n * removeClass: function(element, className, doneFn) {\n * // do some cool animation and call the doneFn\n * },\n * setClass: function(element, addedClass, removedClass, doneFn) {\n * // do some cool animation and call the doneFn\n * }\n * }\n * }]);\n * ```\n *\n * ## CSS + JS Animations Together\n *\n * AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of Angular,\n * defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore the example below will only result in **JS animations taking\n * charge of the animation**:\n *\n * ```html\n *
    \n * Slide in and out\n *
    \n * ```\n *\n * ```js\n * myModule.animation('.slide', [function() {\n * return {\n * enter: function(element, doneFn) {\n * jQuery(element).slideIn(1000, doneFn);\n * }\n * }\n * }]);\n * ```\n *\n * ```css\n * .slide.ng-enter {\n * transition:0.5s linear all;\n * transform:translateY(-100px);\n * }\n * .slide.ng-enter.ng-enter-active {\n * transform:translateY(0);\n * }\n * ```\n *\n * Does this mean that CSS and JS animations cannot be used together? Do JS-based animations always have higher priority? We can make up for the\n * lack of CSS animations by using the `$animateCss` service to trigger our own tweaked-out, CSS-based animations directly from\n * our own JS-based animation code:\n *\n * ```js\n * myModule.animation('.slide', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element) {\n* // this will trigger `.slide.ng-enter` and `.slide.ng-enter-active`.\n * return $animateCss(element, {\n * event: 'enter',\n * structural: true\n * });\n * }\n * }\n * }]);\n * ```\n *\n * The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and we don't need to rely on a 3rd-party animation framework.\n *\n * The `$animateCss` service is very powerful since we can feed in all kinds of extra properties that will be evaluated and fed into a CSS transition or\n * keyframe animation. For example if we wanted to animate the height of an element while adding and removing classes then we can do so by providing that\n * data into `$animateCss` directly:\n *\n * ```js\n * myModule.animation('.slide', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element) {\n * return $animateCss(element, {\n * event: 'enter',\n * structural: true,\n * addClass: 'maroon-setting',\n * from: { height:0 },\n * to: { height: 200 }\n * });\n * }\n * }\n * }]);\n * ```\n *\n * Now we can fill in the rest via our transition CSS code:\n *\n * ```css\n * /* the transition tells ngAnimate to make the animation happen */\n * .slide.ng-enter { transition:0.5s linear all; }\n *\n * /* this extra CSS class will be absorbed into the transition\n * since the $animateCss code is adding the class */\n * .maroon-setting { background:red; }\n * ```\n *\n * And `$animateCss` will figure out the rest. Just make sure to have the `done()` callback fire the `doneFn` function to signal when the animation is over.\n *\n * To learn more about what's possible be sure to visit the {@link ngAnimate.$animateCss $animateCss service}.\n *\n * ## Animation Anchoring (via `ng-animate-ref`)\n *\n * ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between\n * structural areas of an application (like views) by pairing up elements using an attribute\n * called `ng-animate-ref`.\n *\n * Let's say for example we have two views that are managed by `ng-view` and we want to show\n * that there is a relationship between two components situated in within these views. By using the\n * `ng-animate-ref` attribute we can identify that the two components are paired together and we\n * can then attach an animation, which is triggered when the view changes.\n *\n * Say for example we have the following template code:\n *\n * ```html\n * \n *
    \n *
    \n *\n * \n *
    \n * \n * \n *\n * \n * \n * ```\n *\n * Now, when the view changes (once the link is clicked), ngAnimate will examine the\n * HTML contents to see if there is a match reference between any components in the view\n * that is leaving and the view that is entering. It will scan both the view which is being\n * removed (leave) and inserted (enter) to see if there are any paired DOM elements that\n * contain a matching ref value.\n *\n * The two images match since they share the same ref value. ngAnimate will now create a\n * transport element (which is a clone of the first image element) and it will then attempt\n * to animate to the position of the second image element in the next view. For the animation to\n * work a special CSS class called `ng-anchor` will be added to the transported element.\n *\n * We can now attach a transition onto the `.banner.ng-anchor` CSS class and then\n * ngAnimate will handle the entire transition for us as well as the addition and removal of\n * any changes of CSS classes between the elements:\n *\n * ```css\n * .banner.ng-anchor {\n * /* this animation will last for 1 second since there are\n * two phases to the animation (an `in` and an `out` phase) */\n * transition:0.5s linear all;\n * }\n * ```\n *\n * We also **must** include animations for the views that are being entered and removed\n * (otherwise anchoring wouldn't be possible since the new view would be inserted right away).\n *\n * ```css\n * .view-animation.ng-enter, .view-animation.ng-leave {\n * transition:0.5s linear all;\n * position:fixed;\n * left:0;\n * top:0;\n * width:100%;\n * }\n * .view-animation.ng-enter {\n * transform:translateX(100%);\n * }\n * .view-animation.ng-leave,\n * .view-animation.ng-enter.ng-enter-active {\n * transform:translateX(0%);\n * }\n * .view-animation.ng-leave.ng-leave-active {\n * transform:translateX(-100%);\n * }\n * ```\n *\n * Now we can jump back to the anchor animation. When the animation happens, there are two stages that occur:\n * an `out` and an `in` stage. The `out` stage happens first and that is when the element is animated away\n * from its origin. Once that animation is over then the `in` stage occurs which animates the\n * element to its destination. The reason why there are two animations is to give enough time\n * for the enter animation on the new element to be ready.\n *\n * The example above sets up a transition for both the in and out phases, but we can also target the out or\n * in phases directly via `ng-anchor-out` and `ng-anchor-in`.\n *\n * ```css\n * .banner.ng-anchor-out {\n * transition: 0.5s linear all;\n *\n * /* the scale will be applied during the out animation,\n * but will be animated away when the in animation runs */\n * transform: scale(1.2);\n * }\n *\n * .banner.ng-anchor-in {\n * transition: 1s linear all;\n * }\n * ```\n *\n *\n *\n *\n * ### Anchoring Demo\n *\n \n \n Home\n
    \n
    \n
    \n
    \n
    \n \n angular.module('anchoringExample', ['ngAnimate', 'ngRoute'])\n .config(['$routeProvider', function($routeProvider) {\n $routeProvider.when('/', {\n templateUrl: 'home.html',\n controller: 'HomeController as home'\n });\n $routeProvider.when('/profile/:id', {\n templateUrl: 'profile.html',\n controller: 'ProfileController as profile'\n });\n }])\n .run(['$rootScope', function($rootScope) {\n $rootScope.records = [\n { id:1, title: \"Miss Beulah Roob\" },\n { id:2, title: \"Trent Morissette\" },\n { id:3, title: \"Miss Ava Pouros\" },\n { id:4, title: \"Rod Pouros\" },\n { id:5, title: \"Abdul Rice\" },\n { id:6, title: \"Laurie Rutherford Sr.\" },\n { id:7, title: \"Nakia McLaughlin\" },\n { id:8, title: \"Jordon Blanda DVM\" },\n { id:9, title: \"Rhoda Hand\" },\n { id:10, title: \"Alexandrea Sauer\" }\n ];\n }])\n .controller('HomeController', [function() {\n //empty\n }])\n .controller('ProfileController', ['$rootScope', '$routeParams', function($rootScope, $routeParams) {\n var index = parseInt($routeParams.id, 10);\n var record = $rootScope.records[index - 1];\n\n this.title = record.title;\n this.id = record.id;\n }]);\n \n \n

    Welcome to the home page

    \n

    Please click on an element

    \n \n {{ record.title }}\n \n
    \n \n
    \n {{ profile.title }}\n
    \n
    \n \n .record {\n display:block;\n font-size:20px;\n }\n .profile {\n background:black;\n color:white;\n font-size:100px;\n }\n .view-container {\n position:relative;\n }\n .view-container > .view.ng-animate {\n position:absolute;\n top:0;\n left:0;\n width:100%;\n min-height:500px;\n }\n .view.ng-enter, .view.ng-leave,\n .record.ng-anchor {\n transition:0.5s linear all;\n }\n .view.ng-enter {\n transform:translateX(100%);\n }\n .view.ng-enter.ng-enter-active, .view.ng-leave {\n transform:translateX(0%);\n }\n .view.ng-leave.ng-leave-active {\n transform:translateX(-100%);\n }\n .record.ng-anchor-out {\n background:red;\n }\n \n
    \n *\n * ### How is the element transported?\n *\n * When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly where the starting\n * element is located on screen via absolute positioning. The cloned element will be placed inside of the root element\n * of the application (where ng-app was defined) and all of the CSS classes of the starting element will be applied. The\n * element will then animate into the `out` and `in` animations and will eventually reach the coordinates and match\n * the dimensions of the destination element. During the entire animation a CSS class of `.ng-animate-shim` will be applied\n * to both the starting and destination elements in order to hide them from being visible (the CSS styling for the class\n * is: `visibility:hidden`). Once the anchor reaches its destination then it will be removed and the destination element\n * will become visible since the shim class will be removed.\n *\n * ### How is the morphing handled?\n *\n * CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to figure out\n * what CSS classes differ between the starting element and the destination element. These different CSS classes\n * will be added/removed on the anchor element and a transition will be applied (the transition that is provided\n * in the anchor class). Long story short, ngAnimate will figure out what classes to add and remove which will\n * make the transition of the element as smooth and automatic as possible. Be sure to use simple CSS classes that\n * do not rely on DOM nesting structure so that the anchor element appears the same as the starting element (since\n * the cloned element is placed inside of root element which is likely close to the body element).\n *\n * Note that if the root element is on the `` element then the cloned node will be placed inside of body.\n *\n *\n * ## Using $animate in your directive code\n *\n * So far we've explored how to feed in animations into an Angular application, but how do we trigger animations within our own directives in our application?\n * By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's\n * imagine we have a greeting box that shows and hides itself when the data changes\n *\n * ```html\n * Hi there\n * ```\n *\n * ```js\n * ngModule.directive('greetingBox', ['$animate', function($animate) {\n * return function(scope, element, attrs) {\n * attrs.$observe('active', function(value) {\n * value ? $animate.addClass(element, 'on') : $animate.removeClass(element, 'on');\n * });\n * });\n * }]);\n * ```\n *\n * Now the `on` CSS class is added and removed on the greeting box component. Now if we add a CSS class on top of the greeting box element\n * in our HTML code then we can trigger a CSS or JS animation to happen.\n *\n * ```css\n * /* normally we would create a CSS class to reference on the element */\n * greeting-box.on { transition:0.5s linear all; background:green; color:white; }\n * ```\n *\n * The `$animate` service contains a variety of other methods like `enter`, `leave`, `animate` and `setClass`. To learn more about what's\n * possible be sure to visit the {@link ng.$animate $animate service API page}.\n *\n *\n * ## Callbacks and Promises\n *\n * When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger\n * an animation (within our directive code) then we can continue performing directive and scope related activities after the animation has\n * ended by chaining onto the returned promise that animation method returns.\n *\n * ```js\n * // somewhere within the depths of the directive\n * $animate.enter(element, parent).then(function() {\n * //the animation has completed\n * });\n * ```\n *\n * (Note that earlier versions of Angular prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case\n * anymore.)\n *\n * In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering\n * an event listener using the `$animate` service. Let's say for example that an animation was triggered on our view\n * routing controller to hook into that:\n *\n * ```js\n * ngModule.controller('HomePageController', ['$animate', function($animate) {\n * $animate.on('enter', ngViewElement, function(element) {\n * // the animation for this route has completed\n * }]);\n * }])\n * ```\n *\n * (Note that you will need to trigger a digest within the callback to get angular to notice any scope-related changes.)\n */\n\nvar copy;\nvar extend;\nvar forEach;\nvar isArray;\nvar isDefined;\nvar isElement;\nvar isFunction;\nvar isObject;\nvar isString;\nvar isUndefined;\nvar jqLite;\nvar noop;\n\n/**\n * @ngdoc service\n * @name $animate\n * @kind object\n *\n * @description\n * The ngAnimate `$animate` service documentation is the same for the core `$animate` service.\n *\n * Click here {@link ng.$animate to learn more about animations with `$animate`}.\n */\nangular.module('ngAnimate', [], function initAngularHelpers() {\n // Access helpers from angular core.\n // Do it inside a `config` block to ensure `window.angular` is available.\n noop = angular.noop;\n copy = angular.copy;\n extend = angular.extend;\n jqLite = angular.element;\n forEach = angular.forEach;\n isArray = angular.isArray;\n isString = angular.isString;\n isObject = angular.isObject;\n isUndefined = angular.isUndefined;\n isDefined = angular.isDefined;\n isFunction = angular.isFunction;\n isElement = angular.isElement;\n})\n .directive('ngAnimateSwap', ngAnimateSwapDirective)\n\n .directive('ngAnimateChildren', $$AnimateChildrenDirective)\n .factory('$$rAFScheduler', $$rAFSchedulerFactory)\n\n .provider('$$animateQueue', $$AnimateQueueProvider)\n .provider('$$animation', $$AnimationProvider)\n\n .provider('$animateCss', $AnimateCssProvider)\n .provider('$$animateCssDriver', $$AnimateCssDriverProvider)\n\n .provider('$$animateJs', $$AnimateJsProvider)\n .provider('$$animateJsDriver', $$AnimateJsDriverProvider);\n\n\n})(window, window.angular);\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-animate/angular-animate.js?"); /***/ }), /***/ "./node_modules/angular-animate/index.js": /*!***********************************************!*\ !*** ./node_modules/angular-animate/index.js ***! \***********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("__webpack_require__(/*! ./angular-animate */ \"./node_modules/angular-animate/angular-animate.js\");\nmodule.exports = 'ngAnimate';\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-animate/index.js?"); /***/ }), /***/ "./node_modules/angular-aria/angular-aria.js": /*!***************************************************!*\ !*** ./node_modules/angular-aria/angular-aria.js ***! \***************************************************/ /***/ (() => { eval("/**\n * @license AngularJS v1.5.8\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\n/**\n * @ngdoc module\n * @name ngAria\n * @description\n *\n * The `ngAria` module provides support for common\n * [ARIA](http://www.w3.org/TR/wai-aria/)\n * attributes that convey state or semantic information about the application for users\n * of assistive technologies, such as screen readers.\n *\n *
    \n *\n * ## Usage\n *\n * For ngAria to do its magic, simply include the module `ngAria` as a dependency. The following\n * directives are supported:\n * `ngModel`, `ngChecked`, `ngReadonly`, `ngRequired`, `ngValue`, `ngDisabled`, `ngShow`, `ngHide`, `ngClick`,\n * `ngDblClick`, and `ngMessages`.\n *\n * Below is a more detailed breakdown of the attributes handled by ngAria:\n *\n * | Directive | Supported Attributes |\n * |---------------------------------------------|----------------------------------------------------------------------------------------|\n * | {@link ng.directive:ngModel ngModel} | aria-checked, aria-valuemin, aria-valuemax, aria-valuenow, aria-invalid, aria-required, input roles |\n * | {@link ng.directive:ngDisabled ngDisabled} | aria-disabled |\n * | {@link ng.directive:ngRequired ngRequired} | aria-required\n * | {@link ng.directive:ngChecked ngChecked} | aria-checked\n * | {@link ng.directive:ngReadonly ngReadonly} | aria-readonly |\n * | {@link ng.directive:ngValue ngValue} | aria-checked |\n * | {@link ng.directive:ngShow ngShow} | aria-hidden |\n * | {@link ng.directive:ngHide ngHide} | aria-hidden |\n * | {@link ng.directive:ngDblclick ngDblclick} | tabindex |\n * | {@link module:ngMessages ngMessages} | aria-live |\n * | {@link ng.directive:ngClick ngClick} | tabindex, keypress event, button role |\n *\n * Find out more information about each directive by reading the\n * {@link guide/accessibility ngAria Developer Guide}.\n *\n * ## Example\n * Using ngDisabled with ngAria:\n * ```html\n * \n * ```\n * Becomes:\n * ```html\n * \n * ```\n *\n * ## Disabling Attributes\n * It's possible to disable individual attributes added by ngAria with the\n * {@link ngAria.$ariaProvider#config config} method. For more details, see the\n * {@link guide/accessibility Developer Guide}.\n */\n /* global -ngAriaModule */\nvar ngAriaModule = angular.module('ngAria', ['ng']).\n provider('$aria', $AriaProvider);\n\n/**\n* Internal Utilities\n*/\nvar nodeBlackList = ['BUTTON', 'A', 'INPUT', 'TEXTAREA', 'SELECT', 'DETAILS', 'SUMMARY'];\n\nvar isNodeOneOf = function(elem, nodeTypeArray) {\n if (nodeTypeArray.indexOf(elem[0].nodeName) !== -1) {\n return true;\n }\n};\n/**\n * @ngdoc provider\n * @name $ariaProvider\n *\n * @description\n *\n * Used for configuring the ARIA attributes injected and managed by ngAria.\n *\n * ```js\n * angular.module('myApp', ['ngAria'], function config($ariaProvider) {\n * $ariaProvider.config({\n * ariaValue: true,\n * tabindex: false\n * });\n * });\n *```\n *\n * ## Dependencies\n * Requires the {@link ngAria} module to be installed.\n *\n */\nfunction $AriaProvider() {\n var config = {\n ariaHidden: true,\n ariaChecked: true,\n ariaReadonly: true,\n ariaDisabled: true,\n ariaRequired: true,\n ariaInvalid: true,\n ariaValue: true,\n tabindex: true,\n bindKeypress: true,\n bindRoleForClick: true\n };\n\n /**\n * @ngdoc method\n * @name $ariaProvider#config\n *\n * @param {object} config object to enable/disable specific ARIA attributes\n *\n * - **ariaHidden** – `{boolean}` – Enables/disables aria-hidden tags\n * - **ariaChecked** – `{boolean}` – Enables/disables aria-checked tags\n * - **ariaReadonly** – `{boolean}` – Enables/disables aria-readonly tags\n * - **ariaDisabled** – `{boolean}` – Enables/disables aria-disabled tags\n * - **ariaRequired** – `{boolean}` – Enables/disables aria-required tags\n * - **ariaInvalid** – `{boolean}` – Enables/disables aria-invalid tags\n * - **ariaValue** – `{boolean}` – Enables/disables aria-valuemin, aria-valuemax and aria-valuenow tags\n * - **tabindex** – `{boolean}` – Enables/disables tabindex tags\n * - **bindKeypress** – `{boolean}` – Enables/disables keypress event binding on `div` and\n * `li` elements with ng-click\n * - **bindRoleForClick** – `{boolean}` – Adds role=button to non-interactive elements like `div`\n * using ng-click, making them more accessible to users of assistive technologies\n *\n * @description\n * Enables/disables various ARIA attributes\n */\n this.config = function(newConfig) {\n config = angular.extend(config, newConfig);\n };\n\n function watchExpr(attrName, ariaAttr, nodeBlackList, negate) {\n return function(scope, elem, attr) {\n var ariaCamelName = attr.$normalize(ariaAttr);\n if (config[ariaCamelName] && !isNodeOneOf(elem, nodeBlackList) && !attr[ariaCamelName]) {\n scope.$watch(attr[attrName], function(boolVal) {\n // ensure boolean value\n boolVal = negate ? !boolVal : !!boolVal;\n elem.attr(ariaAttr, boolVal);\n });\n }\n };\n }\n /**\n * @ngdoc service\n * @name $aria\n *\n * @description\n * @priority 200\n *\n * The $aria service contains helper methods for applying common\n * [ARIA](http://www.w3.org/TR/wai-aria/) attributes to HTML directives.\n *\n * ngAria injects common accessibility attributes that tell assistive technologies when HTML\n * elements are enabled, selected, hidden, and more. To see how this is performed with ngAria,\n * let's review a code snippet from ngAria itself:\n *\n *```js\n * ngAriaModule.directive('ngDisabled', ['$aria', function($aria) {\n * return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nodeBlackList, false);\n * }])\n *```\n * Shown above, the ngAria module creates a directive with the same signature as the\n * traditional `ng-disabled` directive. But this ngAria version is dedicated to\n * solely managing accessibility attributes on custom elements. The internal `$aria` service is\n * used to watch the boolean attribute `ngDisabled`. If it has not been explicitly set by the\n * developer, `aria-disabled` is injected as an attribute with its value synchronized to the\n * value in `ngDisabled`.\n *\n * Because ngAria hooks into the `ng-disabled` directive, developers do not have to do\n * anything to enable this feature. The `aria-disabled` attribute is automatically managed\n * simply as a silent side-effect of using `ng-disabled` with the ngAria module.\n *\n * The full list of directives that interface with ngAria:\n * * **ngModel**\n * * **ngChecked**\n * * **ngReadonly**\n * * **ngRequired**\n * * **ngDisabled**\n * * **ngValue**\n * * **ngShow**\n * * **ngHide**\n * * **ngClick**\n * * **ngDblclick**\n * * **ngMessages**\n *\n * Read the {@link guide/accessibility ngAria Developer Guide} for a thorough explanation of each\n * directive.\n *\n *\n * ## Dependencies\n * Requires the {@link ngAria} module to be installed.\n */\n this.$get = function() {\n return {\n config: function(key) {\n return config[key];\n },\n $$watchExpr: watchExpr\n };\n };\n}\n\n\nngAriaModule.directive('ngShow', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngShow', 'aria-hidden', [], true);\n}])\n.directive('ngHide', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngHide', 'aria-hidden', [], false);\n}])\n.directive('ngValue', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngValue', 'aria-checked', nodeBlackList, false);\n}])\n.directive('ngChecked', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngChecked', 'aria-checked', nodeBlackList, false);\n}])\n.directive('ngReadonly', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngReadonly', 'aria-readonly', nodeBlackList, false);\n}])\n.directive('ngRequired', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngRequired', 'aria-required', nodeBlackList, false);\n}])\n.directive('ngModel', ['$aria', function($aria) {\n\n function shouldAttachAttr(attr, normalizedAttr, elem, allowBlacklistEls) {\n return $aria.config(normalizedAttr) && !elem.attr(attr) && (allowBlacklistEls || !isNodeOneOf(elem, nodeBlackList));\n }\n\n function shouldAttachRole(role, elem) {\n // if element does not have role attribute\n // AND element type is equal to role (if custom element has a type equaling shape) <-- remove?\n // AND element is not INPUT\n return !elem.attr('role') && (elem.attr('type') === role) && (elem[0].nodeName !== 'INPUT');\n }\n\n function getShape(attr, elem) {\n var type = attr.type,\n role = attr.role;\n\n return ((type || role) === 'checkbox' || role === 'menuitemcheckbox') ? 'checkbox' :\n ((type || role) === 'radio' || role === 'menuitemradio') ? 'radio' :\n (type === 'range' || role === 'progressbar' || role === 'slider') ? 'range' : '';\n }\n\n return {\n restrict: 'A',\n require: 'ngModel',\n priority: 200, //Make sure watches are fired after any other directives that affect the ngModel value\n compile: function(elem, attr) {\n var shape = getShape(attr, elem);\n\n return {\n pre: function(scope, elem, attr, ngModel) {\n if (shape === 'checkbox') {\n //Use the input[checkbox] $isEmpty implementation for elements with checkbox roles\n ngModel.$isEmpty = function(value) {\n return value === false;\n };\n }\n },\n post: function(scope, elem, attr, ngModel) {\n var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem, false);\n\n function ngAriaWatchModelValue() {\n return ngModel.$modelValue;\n }\n\n function getRadioReaction(newVal) {\n var boolVal = (attr.value == ngModel.$viewValue);\n elem.attr('aria-checked', boolVal);\n }\n\n function getCheckboxReaction() {\n elem.attr('aria-checked', !ngModel.$isEmpty(ngModel.$viewValue));\n }\n\n switch (shape) {\n case 'radio':\n case 'checkbox':\n if (shouldAttachRole(shape, elem)) {\n elem.attr('role', shape);\n }\n if (shouldAttachAttr('aria-checked', 'ariaChecked', elem, false)) {\n scope.$watch(ngAriaWatchModelValue, shape === 'radio' ?\n getRadioReaction : getCheckboxReaction);\n }\n if (needsTabIndex) {\n elem.attr('tabindex', 0);\n }\n break;\n case 'range':\n if (shouldAttachRole(shape, elem)) {\n elem.attr('role', 'slider');\n }\n if ($aria.config('ariaValue')) {\n var needsAriaValuemin = !elem.attr('aria-valuemin') &&\n (attr.hasOwnProperty('min') || attr.hasOwnProperty('ngMin'));\n var needsAriaValuemax = !elem.attr('aria-valuemax') &&\n (attr.hasOwnProperty('max') || attr.hasOwnProperty('ngMax'));\n var needsAriaValuenow = !elem.attr('aria-valuenow');\n\n if (needsAriaValuemin) {\n attr.$observe('min', function ngAriaValueMinReaction(newVal) {\n elem.attr('aria-valuemin', newVal);\n });\n }\n if (needsAriaValuemax) {\n attr.$observe('max', function ngAriaValueMinReaction(newVal) {\n elem.attr('aria-valuemax', newVal);\n });\n }\n if (needsAriaValuenow) {\n scope.$watch(ngAriaWatchModelValue, function ngAriaValueNowReaction(newVal) {\n elem.attr('aria-valuenow', newVal);\n });\n }\n }\n if (needsTabIndex) {\n elem.attr('tabindex', 0);\n }\n break;\n }\n\n if (!attr.hasOwnProperty('ngRequired') && ngModel.$validators.required\n && shouldAttachAttr('aria-required', 'ariaRequired', elem, false)) {\n // ngModel.$error.required is undefined on custom controls\n attr.$observe('required', function() {\n elem.attr('aria-required', !!attr['required']);\n });\n }\n\n if (shouldAttachAttr('aria-invalid', 'ariaInvalid', elem, true)) {\n scope.$watch(function ngAriaInvalidWatch() {\n return ngModel.$invalid;\n }, function ngAriaInvalidReaction(newVal) {\n elem.attr('aria-invalid', !!newVal);\n });\n }\n }\n };\n }\n };\n}])\n.directive('ngDisabled', ['$aria', function($aria) {\n return $aria.$$watchExpr('ngDisabled', 'aria-disabled', nodeBlackList, false);\n}])\n.directive('ngMessages', function() {\n return {\n restrict: 'A',\n require: '?ngMessages',\n link: function(scope, elem, attr, ngMessages) {\n if (!elem.attr('aria-live')) {\n elem.attr('aria-live', 'assertive');\n }\n }\n };\n})\n.directive('ngClick',['$aria', '$parse', function($aria, $parse) {\n return {\n restrict: 'A',\n compile: function(elem, attr) {\n var fn = $parse(attr.ngClick, /* interceptorFn */ null, /* expensiveChecks */ true);\n return function(scope, elem, attr) {\n\n if (!isNodeOneOf(elem, nodeBlackList)) {\n\n if ($aria.config('bindRoleForClick') && !elem.attr('role')) {\n elem.attr('role', 'button');\n }\n\n if ($aria.config('tabindex') && !elem.attr('tabindex')) {\n elem.attr('tabindex', 0);\n }\n\n if ($aria.config('bindKeypress') && !attr.ngKeypress) {\n elem.on('keypress', function(event) {\n var keyCode = event.which || event.keyCode;\n if (keyCode === 32 || keyCode === 13) {\n scope.$apply(callback);\n }\n\n function callback() {\n fn(scope, { $event: event });\n }\n });\n }\n }\n };\n }\n };\n}])\n.directive('ngDblclick', ['$aria', function($aria) {\n return function(scope, elem, attr) {\n if ($aria.config('tabindex') && !elem.attr('tabindex') && !isNodeOneOf(elem, nodeBlackList)) {\n elem.attr('tabindex', 0);\n }\n };\n}]);\n\n\n})(window, window.angular);\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-aria/angular-aria.js?"); /***/ }), /***/ "./node_modules/angular-aria/index.js": /*!********************************************!*\ !*** ./node_modules/angular-aria/index.js ***! \********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("__webpack_require__(/*! ./angular-aria */ \"./node_modules/angular-aria/angular-aria.js\");\nmodule.exports = 'ngAria';\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-aria/index.js?"); /***/ }), /***/ "./node_modules/angular-clipboard/angular-clipboard.js": /*!*************************************************************!*\ !*** ./node_modules/angular-clipboard/angular-clipboard.js ***! \*************************************************************/ /***/ (function(module, exports, __webpack_require__) { eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) {\n /* istanbul ignore next */\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! angular */ \"./node_modules/angular/index.js\")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function (angular) {\n\nreturn angular.module('angular-clipboard', [])\n .factory('clipboard', ['$document', '$window', function ($document, $window) {\n function createNode(text, context) {\n var node = $document[0].createElement('textarea');\n node.style.position = 'absolute';\n node.textContent = text;\n node.style.left = '-10000px';\n node.style.top = ($window.pageYOffset || $document[0].documentElement.scrollTop) + 'px';\n return node;\n }\n\n function copyNode(node) {\n try {\n // Set inline style to override css styles\n $document[0].body.style.webkitUserSelect = 'initial';\n\n var selection = $document[0].getSelection();\n selection.removeAllRanges();\n node.select();\n\n if(!$document[0].execCommand('copy')) {\n throw('failure copy');\n }\n selection.removeAllRanges();\n } finally {\n // Reset inline style\n $document[0].body.style.webkitUserSelect = '';\n }\n }\n\n function copyText(text, context) {\n var node = createNode(text, context);\n $document[0].body.appendChild(node);\n copyNode(node);\n $document[0].body.removeChild(node);\n }\n\n return {\n copyText: copyText,\n supported: 'queryCommandSupported' in $document[0] && $document[0].queryCommandSupported('copy')\n };\n }])\n .directive('clipboard', ['clipboard', function (clipboard) {\n return {\n restrict: 'A',\n scope: {\n onCopied: '&',\n onError: '&',\n text: '=',\n supported: '=?'\n },\n link: function (scope, element) {\n scope.supported = clipboard.supported;\n\n element.on('click', function (event) {\n try {\n clipboard.copyText(scope.text, element[0]);\n if (angular.isFunction(scope.onCopied)) {\n scope.$evalAsync(scope.onCopied());\n }\n } catch (err) {\n if (angular.isFunction(scope.onError)) {\n scope.$evalAsync(scope.onError({err: err}));\n }\n }\n });\n }\n };\n }]);\n\n}));\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-clipboard/angular-clipboard.js?"); /***/ }), /***/ "./node_modules/angular-confirm/angular-confirm.js": /*!*********************************************************!*\ !*** ./node_modules/angular-confirm/angular-confirm.js ***! \*********************************************************/ /***/ (function(module, exports, __webpack_require__) { eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\r\n * angular-confirm\r\n * https://github.com/Schlogen/angular-confirm\r\n * @version v1.2.6 - 2016-09-06\r\n * @license Apache\r\n */\r\n(function (root, factory) {\r\n 'use strict';\r\n if (true) {\r\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! angular */ \"./node_modules/angular/index.js\")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n } else {}\r\n}(this, function (angular) {\r\nangular.module('angular-confirm', ['ui.bootstrap.modal'])\r\n .controller('ConfirmModalController', [\"$scope\", \"$uibModalInstance\", \"data\", function ($scope, $uibModalInstance, data) {\r\n $scope.data = angular.copy(data);\r\n\r\n $scope.ok = function (closeMessage) {\r\n $uibModalInstance.close(closeMessage);\r\n };\r\n\r\n $scope.cancel = function (dismissMessage) {\r\n if (angular.isUndefined(dismissMessage)) {\r\n dismissMessage = 'cancel';\r\n }\r\n $uibModalInstance.dismiss(dismissMessage);\r\n };\r\n\r\n }])\r\n .value('$confirmModalDefaults', {\r\n template: '

    {{data.title}}

    ' +\r\n '
    {{data.text}}
    ' +\r\n '
    ' +\r\n '' +\r\n '' +\r\n '
    ',\r\n controller: 'ConfirmModalController',\r\n defaultLabels: {\r\n title: 'Confirm',\r\n ok: 'OK',\r\n cancel: 'Cancel'\r\n },\r\n additionalTemplates: {}\r\n })\r\n .factory('$confirm', [\"$uibModal\", \"$confirmModalDefaults\", function ($uibModal, $confirmModalDefaults) {\r\n return function (data, settings) {\r\n var defaults = angular.copy($confirmModalDefaults);\r\n settings = angular.extend(defaults, (settings || {}));\r\n \r\n data = angular.extend({}, settings.defaultLabels, data || {});\r\n\r\n if(data.templateName){\r\n var customTemplateDefinition = settings.additionalTemplates[data.templateName];\r\n if(customTemplateDefinition != undefined) {\r\n settings.template = customTemplateDefinition.template;\r\n settings.templateUrl = customTemplateDefinition.templateUrl;\r\n }\r\n }\r\n\r\n if ('templateUrl' in settings && 'template' in settings) {\r\n delete settings.template;\r\n }\r\n\r\n settings.resolve = {\r\n data: function () {\r\n return data;\r\n }\r\n };\r\n\r\n return $uibModal.open(settings).result;\r\n };\r\n }])\r\n .directive('confirm', [\"$confirm\", \"$timeout\", function ($confirm, $timeout) {\r\n return {\r\n priority: 1,\r\n restrict: 'A',\r\n scope: {\r\n confirmIf: \"=\",\r\n ngClick: '&',\r\n confirm: '@',\r\n confirmSettings: \"=\",\r\n confirmTemplateName: \"@\",\r\n confirmTitle: '@',\r\n confirmOk: '@',\r\n confirmCancel: '@'\r\n },\r\n link: function (scope, element, attrs) {\r\n\r\n function onSuccess() {\r\n var rawEl = element[0];\r\n if ([\"checkbox\", \"radio\"].indexOf(rawEl.type) != -1) {\r\n var model = element.data('$ngModelController');\r\n if (model) {\r\n model.$setViewValue(!rawEl.checked);\r\n model.$render();\r\n } else {\r\n rawEl.checked = !rawEl.checked;\r\n }\r\n }\r\n scope.ngClick();\r\n }\r\n\r\n element.unbind(\"click\").bind(\"click\", function ($event) {\r\n\r\n $event.preventDefault();\r\n\r\n $timeout(function() {\r\n\r\n if (angular.isUndefined(scope.confirmIf) || scope.confirmIf) {\r\n var data = {text: scope.confirm};\r\n if (scope.confirmTitle) {\r\n data.title = scope.confirmTitle;\r\n }\r\n if (scope.confirmOk) {\r\n data.ok = scope.confirmOk;\r\n }\r\n if (scope.confirmCancel) {\r\n data.cancel = scope.confirmCancel;\r\n }\r\n if (scope.confirmTemplateName){\r\n data.templateName = scope.confirmTemplateName;\r\n }\r\n $confirm(data, scope.confirmSettings || {}).then(onSuccess);\r\n } else {\r\n scope.$apply(onSuccess);\r\n }\r\n\r\n });\r\n\r\n });\r\n\r\n }\r\n }\r\n }]);\r\n}));\r\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-confirm/angular-confirm.js?"); /***/ }), /***/ "./node_modules/angular-cookies/angular-cookies.js": /*!*********************************************************!*\ !*** ./node_modules/angular-cookies/angular-cookies.js ***! \*********************************************************/ /***/ (() => { eval("/**\n * @license AngularJS v1.5.8\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\n/**\n * @ngdoc module\n * @name ngCookies\n * @description\n *\n * # ngCookies\n *\n * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.\n *\n *\n *
    \n *\n * See {@link ngCookies.$cookies `$cookies`} for usage.\n */\n\n\nangular.module('ngCookies', ['ng']).\n /**\n * @ngdoc provider\n * @name $cookiesProvider\n * @description\n * Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service.\n * */\n provider('$cookies', [function $CookiesProvider() {\n /**\n * @ngdoc property\n * @name $cookiesProvider#defaults\n * @description\n *\n * Object containing default options to pass when setting cookies.\n *\n * The object may have following properties:\n *\n * - **path** - `{string}` - The cookie will be available only for this path and its\n * sub-paths. By default, this is the URL that appears in your `` tag.\n * - **domain** - `{string}` - The cookie will be available only for this domain and\n * its sub-domains. For security reasons the user agent will not accept the cookie\n * if the current domain is not a sub-domain of this domain or equal to it.\n * - **expires** - `{string|Date}` - String of the form \"Wdy, DD Mon YYYY HH:MM:SS GMT\"\n * or a Date object indicating the exact date/time this cookie will expire.\n * - **secure** - `{boolean}` - If `true`, then the cookie will only be available through a\n * secured connection.\n *\n * Note: By default, the address that appears in your `` tag will be used as the path.\n * This is important so that cookies will be visible for all routes when html5mode is enabled.\n *\n **/\n var defaults = this.defaults = {};\n\n function calcOptions(options) {\n return options ? angular.extend({}, defaults, options) : defaults;\n }\n\n /**\n * @ngdoc service\n * @name $cookies\n *\n * @description\n * Provides read/write access to browser's cookies.\n *\n *
    \n * Up until Angular 1.3, `$cookies` exposed properties that represented the\n * current browser cookie values. In version 1.4, this behavior has changed, and\n * `$cookies` now provides a standard api of getters, setters etc.\n *
    \n *\n * Requires the {@link ngCookies `ngCookies`} module to be installed.\n *\n * @example\n *\n * ```js\n * angular.module('cookiesExample', ['ngCookies'])\n * .controller('ExampleController', ['$cookies', function($cookies) {\n * // Retrieving a cookie\n * var favoriteCookie = $cookies.get('myFavorite');\n * // Setting a cookie\n * $cookies.put('myFavorite', 'oatmeal');\n * }]);\n * ```\n */\n this.$get = ['$$cookieReader', '$$cookieWriter', function($$cookieReader, $$cookieWriter) {\n return {\n /**\n * @ngdoc method\n * @name $cookies#get\n *\n * @description\n * Returns the value of given cookie key\n *\n * @param {string} key Id to use for lookup.\n * @returns {string} Raw cookie value.\n */\n get: function(key) {\n return $$cookieReader()[key];\n },\n\n /**\n * @ngdoc method\n * @name $cookies#getObject\n *\n * @description\n * Returns the deserialized value of given cookie key\n *\n * @param {string} key Id to use for lookup.\n * @returns {Object} Deserialized cookie value.\n */\n getObject: function(key) {\n var value = this.get(key);\n return value ? angular.fromJson(value) : value;\n },\n\n /**\n * @ngdoc method\n * @name $cookies#getAll\n *\n * @description\n * Returns a key value object with all the cookies\n *\n * @returns {Object} All cookies\n */\n getAll: function() {\n return $$cookieReader();\n },\n\n /**\n * @ngdoc method\n * @name $cookies#put\n *\n * @description\n * Sets a value for given cookie key\n *\n * @param {string} key Id for the `value`.\n * @param {string} value Raw value to be stored.\n * @param {Object=} options Options object.\n * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}\n */\n put: function(key, value, options) {\n $$cookieWriter(key, value, calcOptions(options));\n },\n\n /**\n * @ngdoc method\n * @name $cookies#putObject\n *\n * @description\n * Serializes and sets a value for given cookie key\n *\n * @param {string} key Id for the `value`.\n * @param {Object} value Value to be stored.\n * @param {Object=} options Options object.\n * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}\n */\n putObject: function(key, value, options) {\n this.put(key, angular.toJson(value), options);\n },\n\n /**\n * @ngdoc method\n * @name $cookies#remove\n *\n * @description\n * Remove given cookie\n *\n * @param {string} key Id of the key-value pair to delete.\n * @param {Object=} options Options object.\n * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}\n */\n remove: function(key, options) {\n $$cookieWriter(key, undefined, calcOptions(options));\n }\n };\n }];\n }]);\n\nangular.module('ngCookies').\n/**\n * @ngdoc service\n * @name $cookieStore\n * @deprecated\n * @requires $cookies\n *\n * @description\n * Provides a key-value (string-object) storage, that is backed by session cookies.\n * Objects put or retrieved from this storage are automatically serialized or\n * deserialized by angular's toJson/fromJson.\n *\n * Requires the {@link ngCookies `ngCookies`} module to be installed.\n *\n *
    \n * **Note:** The $cookieStore service is **deprecated**.\n * Please use the {@link ngCookies.$cookies `$cookies`} service instead.\n *
    \n *\n * @example\n *\n * ```js\n * angular.module('cookieStoreExample', ['ngCookies'])\n * .controller('ExampleController', ['$cookieStore', function($cookieStore) {\n * // Put cookie\n * $cookieStore.put('myFavorite','oatmeal');\n * // Get cookie\n * var favoriteCookie = $cookieStore.get('myFavorite');\n * // Removing a cookie\n * $cookieStore.remove('myFavorite');\n * }]);\n * ```\n */\n factory('$cookieStore', ['$cookies', function($cookies) {\n\n return {\n /**\n * @ngdoc method\n * @name $cookieStore#get\n *\n * @description\n * Returns the value of given cookie key\n *\n * @param {string} key Id to use for lookup.\n * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist.\n */\n get: function(key) {\n return $cookies.getObject(key);\n },\n\n /**\n * @ngdoc method\n * @name $cookieStore#put\n *\n * @description\n * Sets a value for given cookie key\n *\n * @param {string} key Id for the `value`.\n * @param {Object} value Value to be stored.\n */\n put: function(key, value) {\n $cookies.putObject(key, value);\n },\n\n /**\n * @ngdoc method\n * @name $cookieStore#remove\n *\n * @description\n * Remove given cookie\n *\n * @param {string} key Id of the key-value pair to delete.\n */\n remove: function(key) {\n $cookies.remove(key);\n }\n };\n\n }]);\n\n/**\n * @name $$cookieWriter\n * @requires $document\n *\n * @description\n * This is a private service for writing cookies\n *\n * @param {string} name Cookie name\n * @param {string=} value Cookie value (if undefined, cookie will be deleted)\n * @param {Object=} options Object with options that need to be stored for the cookie.\n */\nfunction $$CookieWriter($document, $log, $browser) {\n var cookiePath = $browser.baseHref();\n var rawDocument = $document[0];\n\n function buildCookieString(name, value, options) {\n var path, expires;\n options = options || {};\n expires = options.expires;\n path = angular.isDefined(options.path) ? options.path : cookiePath;\n if (angular.isUndefined(value)) {\n expires = 'Thu, 01 Jan 1970 00:00:00 GMT';\n value = '';\n }\n if (angular.isString(expires)) {\n expires = new Date(expires);\n }\n\n var str = encodeURIComponent(name) + '=' + encodeURIComponent(value);\n str += path ? ';path=' + path : '';\n str += options.domain ? ';domain=' + options.domain : '';\n str += expires ? ';expires=' + expires.toUTCString() : '';\n str += options.secure ? ';secure' : '';\n\n // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:\n // - 300 cookies\n // - 20 cookies per unique domain\n // - 4096 bytes per cookie\n var cookieLength = str.length + 1;\n if (cookieLength > 4096) {\n $log.warn(\"Cookie '\" + name +\n \"' possibly not set or overflowed because it was too large (\" +\n cookieLength + \" > 4096 bytes)!\");\n }\n\n return str;\n }\n\n return function(name, value, options) {\n rawDocument.cookie = buildCookieString(name, value, options);\n };\n}\n\n$$CookieWriter.$inject = ['$document', '$log', '$browser'];\n\nangular.module('ngCookies').provider('$$cookieWriter', function $$CookieWriterProvider() {\n this.$get = $$CookieWriter;\n});\n\n\n})(window, window.angular);\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-cookies/angular-cookies.js?"); /***/ }), /***/ "./node_modules/angular-cookies/index.js": /*!***********************************************!*\ !*** ./node_modules/angular-cookies/index.js ***! \***********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("__webpack_require__(/*! ./angular-cookies */ \"./node_modules/angular-cookies/angular-cookies.js\");\nmodule.exports = 'ngCookies';\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-cookies/index.js?"); /***/ }), /***/ "./node_modules/angular-material/angular-material.js": /*!***********************************************************!*\ !*** ./node_modules/angular-material/angular-material.js ***! \***********************************************************/ /***/ (() => { eval("/*!\n * Angular Material Design\n * https://github.com/angular/material\n * @license MIT\n * v0.10.1\n */\n(function( window, angular, undefined ){\n\"use strict\";\n\n(function(){\n\"use strict\";\n\nangular.module('ngMaterial', [\"ng\",\"ngAnimate\",\"ngAria\",\"material.core\",\"material.core.gestures\",\"material.core.theming.palette\",\"material.core.theming\",\"material.components.autocomplete\",\"material.components.bottomSheet\",\"material.components.backdrop\",\"material.components.card\",\"material.components.checkbox\",\"material.components.content\",\"material.components.button\",\"material.components.divider\",\"material.components.chips\",\"material.components.dialog\",\"material.components.fabSpeedDial\",\"material.components.fabActions\",\"material.components.fabToolbar\",\"material.components.fabTrigger\",\"material.components.gridList\",\"material.components.icon\",\"material.components.input\",\"material.components.list\",\"material.components.menu\",\"material.components.progressCircular\",\"material.components.progressLinear\",\"material.components.radioButton\",\"material.components.select\",\"material.components.sidenav\",\"material.components.slider\",\"material.components.sticky\",\"material.components.subheader\",\"material.components.swipe\",\"material.components.switch\",\"material.components.tabs\",\"material.components.toast\",\"material.components.toolbar\",\"material.components.tooltip\",\"material.components.virtualRepeat\",\"material.components.whiteframe\"]);\n})();\n(function(){\n\"use strict\";\n\n\n/**\n * Initialization function that validates environment\n * requirements.\n */\nangular\n .module('material.core', [ 'material.core.gestures', 'material.core.theming' ])\n .config( MdCoreConfigure );\n\n\nfunction MdCoreConfigure($provide, $mdThemingProvider) {\n\n $provide.decorator('$$rAF', [\"$delegate\", rAFDecorator]);\n\n $mdThemingProvider.theme('default')\n .primaryPalette('indigo')\n .accentPalette('pink')\n .warnPalette('red')\n .backgroundPalette('grey');\n}\nMdCoreConfigure.$inject = [\"$provide\", \"$mdThemingProvider\"];\n\nfunction rAFDecorator( $delegate ) {\n /**\n * Use this to throttle events that come in often.\n * The throttled function will always use the *last* invocation before the\n * coming frame.\n *\n * For example, window resize events that fire many times a second:\n * If we set to use an raf-throttled callback on window resize, then\n * our callback will only be fired once per frame, with the last resize\n * event that happened before that frame.\n *\n * @param {function} callback function to debounce\n */\n $delegate.throttle = function(cb) {\n var queuedArgs, alreadyQueued, queueCb, context;\n return function debounced() {\n queuedArgs = arguments;\n context = this;\n queueCb = cb;\n if (!alreadyQueued) {\n alreadyQueued = true;\n $delegate(function() {\n queueCb.apply(context, Array.prototype.slice.call(queuedArgs));\n alreadyQueued = false;\n });\n }\n };\n };\n return $delegate;\n}\n\n})();\n(function(){\n\"use strict\";\n\nangular\n .module('material.core')\n .factory('$$mdAnimate', [\"$$rAF\", \"$q\", \"$timeout\", \"$mdConstant\", function($$rAF, $q, $timeout, $mdConstant){\n\n // Since $$mdAnimate is injected into $mdUtil... use a wrapper function\n // to subsequently inject $mdUtil as an argument to the AnimateDomUtils\n\n return function($mdUtil) {\n return AnimateDomUtils( $mdUtil, $$rAF, $q, $timeout, $mdConstant);\n };\n }]);\n\n/**\n * Factory function that requires special injections\n */\nfunction AnimateDomUtils($mdUtil, $$rAF, $q, $timeout, $mdConstant) {\n var self;\n return self = {\n /**\n *\n */\n translate3d : function( target, from, to, options ) {\n // Set translate3d style to start at the `from` origin\n target.css(from);\n\n // Wait while CSS takes affect\n // Set the `to` styles and run the transition-in styles\n $$rAF(function () {\n target.css(to).addClass(options.transitionInClass);\n });\n\n return self\n .waitTransitionEnd(target)\n .then(function(){\n // Resolve with reverser function...\n return reverseTranslate;\n });\n\n /**\n * Specific reversal of the request translate animation above...\n */\n function reverseTranslate (newFrom) {\n target.removeClass(options.transitionInClass)\n .addClass(options.transitionOutClass)\n .css( newFrom || from );\n return self.waitTransitionEnd(target);\n }\n },\n\n /**\n * Listen for transitionEnd event (with optional timeout)\n * Announce completion or failure via promise handlers\n */\n waitTransitionEnd: function (element, opts) {\n var TIMEOUT = 3000; // fallback is 3 secs\n\n return $q(function(resolve, reject){\n opts = opts || { };\n\n var timer = $timeout(finished, opts.timeout || TIMEOUT);\n element.on($mdConstant.CSS.TRANSITIONEND, finished);\n\n /**\n * Upon timeout or transitionEnd, reject or resolve (respectively) this promise.\n * NOTE: Make sure this transitionEnd didn't bubble up from a child\n */\n function finished(ev) {\n if ( ev && ev.target !== element[0]) return;\n\n if ( ev ) $timeout.cancel(timer);\n element.off($mdConstant.CSS.TRANSITIONEND, finished);\n\n // Never reject since ngAnimate may cause timeouts due missed transitionEnd events\n resolve();\n\n }\n\n });\n },\n\n /**\n * Calculate the zoom transform from dialog to origin.\n *\n * We use this to set the dialog position immediately;\n * then the md-transition-in actually translates back to\n * `translate3d(0,0,0) scale(1.0)`...\n *\n * NOTE: all values are rounded to the nearest integer\n */\n calculateZoomToOrigin: function (element, originator) {\n var origin = originator.element;\n var zoomTemplate = \"translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )\";\n var buildZoom = angular.bind(null, $mdUtil.supplant, zoomTemplate);\n var zoomStyle = buildZoom({centerX: 0, centerY: 0, scaleX: 0.5, scaleY: 0.5});\n\n if (origin) {\n var originBnds = self.clientRect(origin) || self.copyRect(originator.bounds);\n var dialogRect = self.copyRect(element[0].getBoundingClientRect());\n var dialogCenterPt = self.centerPointFor(dialogRect);\n var originCenterPt = self.centerPointFor(originBnds);\n\n // Build the transform to zoom from the dialog center to the origin center\n\n zoomStyle = buildZoom({\n centerX: originCenterPt.x - dialogCenterPt.x,\n centerY: originCenterPt.y - dialogCenterPt.y,\n scaleX: Math.min(0.5, originBnds.width / dialogRect.width),\n scaleY: Math.min(0.5, originBnds.height / dialogRect.height)\n });\n }\n\n return zoomStyle;\n },\n\n /**\n * Convert the translate CSS value to key/value pair(s).\n */\n toTransformCss: function (transform, addTransition) {\n var css = {};\n angular.forEach($mdConstant.CSS.TRANSFORM.split(' '), function (key) {\n css[key] = transform;\n });\n\n if (addTransition) css['transition'] = \"all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important\";\n\n return css;\n },\n\n /**\n * Clone the Rect and calculate the height/width if needed\n */\n copyRect: function (source, destination) {\n if (!source) return null;\n\n destination = destination || {};\n\n angular.forEach('left top right bottom width height'.split(' '), function (key) {\n destination[key] = Math.round(source[key])\n });\n\n destination.width = destination.width || (destination.right - destination.left);\n destination.height = destination.height || (destination.bottom - destination.top);\n\n return destination;\n },\n\n /**\n * Calculate ClientRect of element; return null if hidden or zero size\n */\n clientRect: function (element) {\n var bounds = angular.element(element)[0].getBoundingClientRect();\n var isPositiveSizeClientRect = function (rect) {\n return rect && (rect.width > 0) && (rect.height > 0);\n };\n\n // If the event origin element has zero size, it has probably been hidden.\n return isPositiveSizeClientRect(bounds) ? self.copyRect(bounds) : null;\n },\n\n /**\n * Calculate 'rounded' center point of Rect\n */\n centerPointFor: function (targetRect) {\n return {\n x: Math.round(targetRect.left + (targetRect.width / 2)),\n y: Math.round(targetRect.top + (targetRect.height / 2))\n }\n }\n\n };\n};\n\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core')\n.factory('$mdConstant', MdConstantFactory);\n\nfunction MdConstantFactory($sniffer) {\n\n var webkit = /webkit/i.test($sniffer.vendorPrefix);\n function vendorProperty(name) {\n return webkit ? ('webkit' + name.charAt(0).toUpperCase() + name.substring(1)) : name;\n }\n\n return {\n KEY_CODE: {\n ENTER: 13,\n ESCAPE: 27,\n SPACE: 32,\n LEFT_ARROW : 37,\n UP_ARROW : 38,\n RIGHT_ARROW : 39,\n DOWN_ARROW : 40,\n TAB : 9,\n BACKSPACE: 8,\n DELETE: 46\n },\n CSS: {\n /* Constants */\n TRANSITIONEND: 'transitionend' + (webkit ? ' webkitTransitionEnd' : ''),\n ANIMATIONEND: 'animationend' + (webkit ? ' webkitAnimationEnd' : ''),\n\n TRANSFORM: vendorProperty('transform'),\n TRANSFORM_ORIGIN: vendorProperty('transformOrigin'),\n TRANSITION: vendorProperty('transition'),\n TRANSITION_DURATION: vendorProperty('transitionDuration'),\n ANIMATION_PLAY_STATE: vendorProperty('animationPlayState'),\n ANIMATION_DURATION: vendorProperty('animationDuration'),\n ANIMATION_NAME: vendorProperty('animationName'),\n ANIMATION_TIMING: vendorProperty('animationTimingFunction'),\n ANIMATION_DIRECTION: vendorProperty('animationDirection')\n },\n MEDIA: {\n 'sm': '(max-width: 599px)',\n 'gt-sm': '(min-width: 600px)',\n 'md': '(min-width: 600px) and (max-width: 959px)',\n 'gt-md': '(min-width: 960px)',\n 'lg': '(min-width: 960px) and (max-width: 1199px)',\n 'gt-lg': '(min-width: 1200px)'\n },\n MEDIA_PRIORITY: [\n 'gt-lg',\n 'lg',\n 'gt-md',\n 'md',\n 'gt-sm',\n 'sm'\n ]\n };\n}\nMdConstantFactory.$inject = [\"$sniffer\"];\n\n})();\n(function(){\n\"use strict\";\n\n angular\n .module('material.core')\n .config( [\"$provide\", function($provide){\n $provide.decorator('$mdUtil', ['$delegate', function ($delegate){\n /**\n * Inject the iterator facade to easily support iteration and accessors\n * @see iterator below\n */\n $delegate.iterator = MdIterator;\n\n return $delegate;\n }\n ]);\n }]);\n\n /**\n * iterator is a list facade to easily support iteration and accessors\n *\n * @param items Array list which this iterator will enumerate\n * @param reloop Boolean enables iterator to consider the list as an endless reloop\n */\n function MdIterator(items, reloop) {\n var trueFn = function() { return true; };\n\n if (items && !angular.isArray(items)) {\n items = Array.prototype.slice.call(items);\n }\n\n reloop = !!reloop;\n var _items = items || [ ];\n\n // Published API\n return {\n items: getItems,\n count: count,\n\n inRange: inRange,\n contains: contains,\n indexOf: indexOf,\n itemAt: itemAt,\n\n findBy: findBy,\n\n add: add,\n remove: remove,\n\n first: first,\n last: last,\n next: angular.bind(null, findSubsequentItem, false),\n previous: angular.bind(null, findSubsequentItem, true),\n\n hasPrevious: hasPrevious,\n hasNext: hasNext\n\n };\n\n /**\n * Publish copy of the enumerable set\n * @returns {Array|*}\n */\n function getItems() {\n return [].concat(_items);\n }\n\n /**\n * Determine length of the list\n * @returns {Array.length|*|number}\n */\n function count() {\n return _items.length;\n }\n\n /**\n * Is the index specified valid\n * @param index\n * @returns {Array.length|*|number|boolean}\n */\n function inRange(index) {\n return _items.length && ( index > -1 ) && (index < _items.length );\n }\n\n /**\n * Can the iterator proceed to the next item in the list; relative to\n * the specified item.\n *\n * @param item\n * @returns {Array.length|*|number|boolean}\n */\n function hasNext(item) {\n return item ? inRange(indexOf(item) + 1) : false;\n }\n\n /**\n * Can the iterator proceed to the previous item in the list; relative to\n * the specified item.\n *\n * @param item\n * @returns {Array.length|*|number|boolean}\n */\n function hasPrevious(item) {\n return item ? inRange(indexOf(item) - 1) : false;\n }\n\n /**\n * Get item at specified index/position\n * @param index\n * @returns {*}\n */\n function itemAt(index) {\n return inRange(index) ? _items[index] : null;\n }\n\n /**\n * Find all elements matching the key/value pair\n * otherwise return null\n *\n * @param val\n * @param key\n *\n * @return array\n */\n function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }\n\n /**\n * Add item to list\n * @param item\n * @param index\n * @returns {*}\n */\n function add(item, index) {\n if ( !item ) return -1;\n\n if (!angular.isNumber(index)) {\n index = _items.length;\n }\n\n _items.splice(index, 0, item);\n\n return indexOf(item);\n }\n\n /**\n * Remove item from list...\n * @param item\n */\n function remove(item) {\n if ( contains(item) ){\n _items.splice(indexOf(item), 1);\n }\n }\n\n /**\n * Get the zero-based index of the target item\n * @param item\n * @returns {*}\n */\n function indexOf(item) {\n return _items.indexOf(item);\n }\n\n /**\n * Boolean existence check\n * @param item\n * @returns {boolean}\n */\n function contains(item) {\n return item && (indexOf(item) > -1);\n }\n\n /**\n * Return first item in the list\n * @returns {*}\n */\n function first() {\n return _items.length ? _items[0] : null;\n }\n\n /**\n * Return last item in the list...\n * @returns {*}\n */\n function last() {\n return _items.length ? _items[_items.length - 1] : null;\n }\n\n /**\n * Find the next item. If reloop is true and at the end of the list, it will go back to the\n * first item. If given, the `validate` callback will be used to determine whether the next item\n * is valid. If not valid, it will try to find the next item again.\n *\n * @param {boolean} backwards Specifies the direction of searching (forwards/backwards)\n * @param {*} item The item whose subsequent item we are looking for\n * @param {Function=} validate The `validate` function\n * @param {integer=} limit The recursion limit\n *\n * @returns {*} The subsequent item or null\n */\n function findSubsequentItem(backwards, item, validate, limit) {\n validate = validate || trueFn;\n\n var curIndex = indexOf(item);\n while (true) {\n if (!inRange(curIndex)) return null;\n\n var nextIndex = curIndex + (backwards ? -1 : 1);\n var foundItem = null;\n if (inRange(nextIndex)) {\n foundItem = _items[nextIndex];\n } else if (reloop) {\n foundItem = backwards ? last() : first();\n nextIndex = indexOf(foundItem);\n }\n\n if ((foundItem === null) || (nextIndex === limit)) return null;\n if (validate(foundItem)) return foundItem;\n\n if (angular.isUndefined(limit)) limit = nextIndex;\n\n curIndex = nextIndex;\n }\n }\n }\n\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core')\n.factory('$mdMedia', mdMediaFactory);\n\n/**\n * @ngdoc service\n * @name $mdMedia\n * @module material.core\n *\n * @description\n * `$mdMedia` is used to evaluate whether a given media query is true or false given the\n * current device's screen / window size. The media query will be re-evaluated on resize, allowing\n * you to register a watch.\n *\n * `$mdMedia` also has pre-programmed support for media queries that match the layout breakpoints.\n * (`sm`, `gt-sm`, `md`, `gt-md`, `lg`, `gt-lg`).\n *\n * @returns {boolean} a boolean representing whether or not the given media query is true or false.\n *\n * @usage\n * \n * app.controller('MyController', function($mdMedia, $scope) {\n * $scope.$watch(function() { return $mdMedia('lg'); }, function(big) {\n * $scope.bigScreen = big;\n * });\n *\n * $scope.screenIsSmall = $mdMedia('sm');\n * $scope.customQuery = $mdMedia('(min-width: 1234px)');\n * $scope.anotherCustom = $mdMedia('max-width: 300px');\n * });\n * \n */\n\nfunction mdMediaFactory($mdConstant, $rootScope, $window) {\n var queries = {};\n var mqls = {};\n var results = {};\n var normalizeCache = {};\n\n $mdMedia.getResponsiveAttribute = getResponsiveAttribute;\n $mdMedia.getQuery = getQuery;\n $mdMedia.watchResponsiveAttributes = watchResponsiveAttributes;\n\n return $mdMedia;\n\n function $mdMedia(query) {\n var validated = queries[query];\n if (angular.isUndefined(validated)) {\n validated = queries[query] = validate(query);\n }\n\n var result = results[validated];\n if (angular.isUndefined(result)) {\n result = add(validated);\n }\n\n return result;\n }\n\n function validate(query) {\n return $mdConstant.MEDIA[query] ||\n ((query.charAt(0) !== '(') ? ('(' + query + ')') : query);\n }\n\n function add(query) {\n var result = mqls[query] = $window.matchMedia(query);\n result.addListener(onQueryChange);\n return (results[result.media] = !!result.matches);\n }\n\n function onQueryChange(query) {\n $rootScope.$evalAsync(function() {\n results[query.media] = !!query.matches;\n });\n }\n\n function getQuery(name) {\n return mqls[name];\n }\n\n function getResponsiveAttribute(attrs, attrName) {\n for (var i = 0; i < $mdConstant.MEDIA_PRIORITY.length; i++) {\n var mediaName = $mdConstant.MEDIA_PRIORITY[i];\n if (!mqls[queries[mediaName]].matches) {\n continue;\n }\n\n var normalizedName = getNormalizedName(attrs, attrName + '-' + mediaName);\n if (attrs[normalizedName]) {\n return attrs[normalizedName];\n }\n }\n\n // fallback on unprefixed\n return attrs[getNormalizedName(attrs, attrName)];\n }\n\n function watchResponsiveAttributes(attrNames, attrs, watchFn) {\n var unwatchFns = [];\n attrNames.forEach(function(attrName) {\n var normalizedName = getNormalizedName(attrs, attrName);\n if (attrs[normalizedName]) {\n unwatchFns.push(\n attrs.$observe(normalizedName, angular.bind(void 0, watchFn, null)));\n }\n\n for (var mediaName in $mdConstant.MEDIA) {\n normalizedName = getNormalizedName(attrs, attrName + '-' + mediaName);\n if (!attrs[normalizedName]) {\n return;\n }\n\n unwatchFns.push(attrs.$observe(normalizedName, angular.bind(void 0, watchFn, mediaName)));\n }\n });\n\n return function unwatch() {\n unwatchFns.forEach(function(fn) { fn(); })\n };\n }\n\n // Improves performance dramatically\n function getNormalizedName(attrs, attrName) {\n return normalizeCache[attrName] ||\n (normalizeCache[attrName] = attrs.$normalize(attrName));\n }\n}\nmdMediaFactory.$inject = [\"$mdConstant\", \"$rootScope\", \"$window\"];\n\n})();\n(function(){\n\"use strict\";\n\n/*\n * This var has to be outside the angular factory, otherwise when\n * there are multiple material apps on the same page, each app\n * will create its own instance of this array and the app's IDs\n * will not be unique.\n */\nvar nextUniqueId = 0;\n\nangular.module('material.core')\n .factory('$mdUtil', [\"$cacheFactory\", \"$document\", \"$timeout\", \"$q\", \"$compile\", \"$window\", \"$mdConstant\", \"$$rAF\", \"$rootScope\", \"$$mdAnimate\", function ($cacheFactory, $document, $timeout, $q, $compile, $window, $mdConstant, $$rAF, $rootScope, $$mdAnimate) {\n var $mdUtil = {\n dom : { },\n now: window.performance ?\n angular.bind(window.performance, window.performance.now) :\n Date.now,\n\n clientRect: function (element, offsetParent, isOffsetRect) {\n var node = getNode(element);\n offsetParent = getNode(offsetParent || node.offsetParent || document.body);\n var nodeRect = node.getBoundingClientRect();\n\n // The user can ask for an offsetRect: a rect relative to the offsetParent,\n // or a clientRect: a rect relative to the page\n var offsetRect = isOffsetRect ?\n offsetParent.getBoundingClientRect() :\n {left: 0, top: 0, width: 0, height: 0};\n return {\n left: nodeRect.left - offsetRect.left,\n top: nodeRect.top - offsetRect.top,\n width: nodeRect.width,\n height: nodeRect.height\n };\n },\n offsetRect: function (element, offsetParent) {\n return $mdUtil.clientRect(element, offsetParent, true);\n },\n\n // Annoying method to copy nodes to an array, thanks to IE\n nodesToArray: function (nodes) {\n nodes = nodes || [ ];\n\n var results = [];\n for (var i = 0; i < nodes.length; ++i) {\n results.push(nodes.item(i));\n }\n return results;\n },\n\n /**\n * Calculate the positive scroll offset\n * TODO: Check with pinch-zoom in IE/Chrome;\n * https://code.google.com/p/chromium/issues/detail?id=496285\n */\n scrollTop : function(element) {\n element = angular.element(element || $document[0].body);\n\n var body = (element[0] == $document[0].body) ? $document[0].body : undefined;\n var scrollTop = body ? body.scrollTop + body.parentElement.scrollTop : 0;\n\n // Calculate the positive scroll offset\n return scrollTop || Math.abs(element[0].getBoundingClientRect().top);\n },\n\n // Disables scroll around the passed element.\n disableScrollAround: function (element, parent) {\n $mdUtil.disableScrollAround._count = $mdUtil.disableScrollAround._count || 0;\n ++$mdUtil.disableScrollAround._count;\n if ($mdUtil.disableScrollAround._enableScrolling) return $mdUtil.disableScrollAround._enableScrolling;\n element = angular.element(element);\n var body = $document[0].body,\n restoreBody = disableBodyScroll(),\n restoreElement = disableElementScroll(parent);\n\n return $mdUtil.disableScrollAround._enableScrolling = function () {\n if (!--$mdUtil.disableScrollAround._count) {\n restoreBody();\n restoreElement();\n delete $mdUtil.disableScrollAround._enableScrolling;\n }\n };\n\n // Creates a virtual scrolling mask to absorb touchmove, keyboard, scrollbar clicking, and wheel events\n function disableElementScroll(element) {\n element = angular.element(element || body)[0];\n var zIndex = 50;\n var scrollMask = angular.element(\n '
    ' +\n '
    ' +\n '
    ');\n element.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete $mdUtil.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav(e) {\n //-- temporarily removed this logic, will possibly re-add at a later date\n return;\n if (!element[0].contains(e.target)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }\n\n // Converts the body to a position fixed block and translate it to the proper scroll\n // position\n function disableBodyScroll() {\n var htmlNode = body.parentNode;\n var restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n var restoreBodyStyle = body.getAttribute('style') || '';\n var scrollOffset = $mdUtil.scrollTop(body);\n var clientWidth = body.clientWidth;\n\n if (body.scrollHeight > body.clientHeight) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: -scrollOffset + 'px'\n });\n\n applyStyles(htmlNode, {\n overflowY: 'scroll'\n });\n }\n\n\n if (body.clientWidth < clientWidth) applyStyles(body, {overflow: 'hidden'});\n\n return function restoreScroll() {\n body.setAttribute('style', restoreBodyStyle);\n htmlNode.setAttribute('style', restoreHtmlStyle);\n body.scrollTop = scrollOffset;\n };\n }\n\n function applyStyles(el, styles) {\n for (var key in styles) {\n el.style[key] = styles[key];\n }\n }\n },\n enableScrolling: function () {\n var method = this.disableScrollAround._enableScrolling;\n method && method();\n },\n floatingScrollbars: function () {\n if (this.floatingScrollbars.cached === undefined) {\n var tempNode = angular.element('
    ');\n $document[0].body.appendChild(tempNode[0]);\n this.floatingScrollbars.cached = (tempNode[0].offsetWidth == tempNode[0].childNodes[0].offsetWidth);\n tempNode.remove();\n }\n return this.floatingScrollbars.cached;\n },\n\n // Mobile safari only allows you to set focus in click event listeners...\n forceFocus: function (element) {\n var node = element[0] || element;\n\n document.addEventListener('click', function focusOnClick(ev) {\n if (ev.target === node && ev.$focus) {\n node.focus();\n ev.stopImmediatePropagation();\n ev.preventDefault();\n node.removeEventListener('click', focusOnClick);\n }\n }, true);\n\n var newEvent = document.createEvent('MouseEvents');\n newEvent.initMouseEvent('click', false, true, window, {}, 0, 0, 0, 0,\n false, false, false, false, 0, null);\n newEvent.$material = true;\n newEvent.$focus = true;\n node.dispatchEvent(newEvent);\n },\n\n /**\n * facade to build md-backdrop element with desired styles\n * NOTE: Use $compile to trigger backdrop postLink function\n */\n createBackdrop : function(scope, addClass){\n return $compile( $mdUtil.supplant('',[addClass]) )(scope);\n },\n\n /**\n * supplant() method from Crockford's `Remedial Javascript`\n * Equivalent to use of $interpolate; without dependency on\n * interpolation symbols and scope. Note: the '{}' can\n * be property names, property chains, or array indices.\n */\n supplant : function( template, values, pattern ) {\n pattern = pattern || /\\{([^\\{\\}]*)\\}/g;\n return template.replace(pattern, function(a, b) {\n var p = b.split('.'),\n r = values;\n try {\n for (var s in p) { r = r[p[s]]; }\n } catch(e){\n r = a;\n }\n return (typeof r === 'string' || typeof r === 'number') ? r : a;\n });\n },\n\n fakeNgModel: function () {\n return {\n $fake: true,\n $setTouched: angular.noop,\n $setViewValue: function (value) {\n this.$viewValue = value;\n this.$render(value);\n this.$viewChangeListeners.forEach(function (cb) {\n cb();\n });\n },\n $isEmpty: function (value) {\n return ('' + value).length === 0;\n },\n $parsers: [],\n $formatters: [],\n $viewChangeListeners: [],\n $render: angular.noop\n };\n },\n\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds.\n // @param wait Integer value of msecs to delay (since last debounce reset); default value 10 msecs\n // @param invokeApply should the $timeout trigger $digest() dirty checking\n debounce: function (func, wait, scope, invokeApply) {\n var timer;\n\n return function debounced() {\n var context = scope,\n args = Array.prototype.slice.call(arguments);\n\n $timeout.cancel(timer);\n timer = $timeout(function () {\n\n timer = undefined;\n func.apply(context, args);\n\n }, wait || 10, invokeApply);\n };\n },\n\n // Returns a function that can only be triggered every `delay` milliseconds.\n // In other words, the function will not be called unless it has been more\n // than `delay` milliseconds since the last call.\n throttle: function throttle(func, delay) {\n var recent;\n return function throttled() {\n var context = this;\n var args = arguments;\n var now = $mdUtil.now();\n\n if (!recent || (now - recent > delay)) {\n func.apply(context, args);\n recent = now;\n }\n };\n },\n\n /**\n * Measures the number of milliseconds taken to run the provided callback\n * function. Uses a high-precision timer if available.\n */\n time: function time(cb) {\n var start = $mdUtil.now();\n cb();\n return $mdUtil.now() - start;\n },\n\n /**\n * Get a unique ID.\n *\n * @returns {string} an unique numeric string\n */\n nextUid: function () {\n return '' + nextUniqueId++;\n },\n\n // Stop watchers and events from firing on a scope without destroying it,\n // by disconnecting it from its parent and its siblings' linked lists.\n disconnectScope: function disconnectScope(scope) {\n if (!scope) return;\n\n // we can't destroy the root scope or a scope that has been already destroyed\n if (scope.$root === scope) return;\n if (scope.$$destroyed) return;\n\n var parent = scope.$parent;\n scope.$$disconnected = true;\n\n // See Scope.$destroy\n if (parent.$$childHead === scope) parent.$$childHead = scope.$$nextSibling;\n if (parent.$$childTail === scope) parent.$$childTail = scope.$$prevSibling;\n if (scope.$$prevSibling) scope.$$prevSibling.$$nextSibling = scope.$$nextSibling;\n if (scope.$$nextSibling) scope.$$nextSibling.$$prevSibling = scope.$$prevSibling;\n\n scope.$$nextSibling = scope.$$prevSibling = null;\n\n },\n\n // Undo the effects of disconnectScope above.\n reconnectScope: function reconnectScope(scope) {\n if (!scope) return;\n\n // we can't disconnect the root node or scope already disconnected\n if (scope.$root === scope) return;\n if (!scope.$$disconnected) return;\n\n var child = scope;\n\n var parent = child.$parent;\n child.$$disconnected = false;\n // See Scope.$new for this logic...\n child.$$prevSibling = parent.$$childTail;\n if (parent.$$childHead) {\n parent.$$childTail.$$nextSibling = child;\n parent.$$childTail = child;\n } else {\n parent.$$childHead = parent.$$childTail = child;\n }\n },\n\n /*\n * getClosest replicates jQuery.closest() to walk up the DOM tree until it finds a matching nodeName\n *\n * @param el Element to start walking the DOM from\n * @param tagName Tag name to find closest to el, such as 'form'\n */\n getClosest: function getClosest(el, tagName, onlyParent) {\n if (el instanceof angular.element) el = el[0];\n tagName = tagName.toUpperCase();\n if (onlyParent) el = el.parentNode;\n if (!el) return null;\n do {\n if (el.nodeName === tagName) {\n return el;\n }\n } while (el = el.parentNode);\n return null;\n },\n\n /**\n * Functional equivalent for $element.filter(‘md-bottom-sheet’)\n * useful with interimElements where the element and its container are important...\n */\n extractElementByName: function (element, nodeName) {\n for (var i = 0, len = element.length; i < len; i++) {\n if (element[i].nodeName.toLowerCase() === nodeName) {\n return angular.element(element[i]);\n }\n }\n return element;\n },\n\n /**\n * Give optional properties with no value a boolean true if attr provided or false otherwise\n */\n initOptionalProperties: function (scope, attr, defaults) {\n defaults = defaults || {};\n angular.forEach(scope.$$isolateBindings, function (binding, key) {\n if (binding.optional && angular.isUndefined(scope[key])) {\n var attrIsDefined = angular.isDefined(attr[binding.attrName]);\n scope[key] = angular.isDefined(defaults[key]) ? defaults[key] : attrIsDefined;\n }\n });\n },\n\n /**\n * Alternative to $timeout calls with 0 delay.\n * nextTick() coalesces all calls within a single frame\n * to minimize $digest thrashing\n *\n * @param callback\n * @param digest\n * @returns {*}\n */\n nextTick: function (callback, digest) {\n //-- grab function reference for storing state details\n var nextTick = $mdUtil.nextTick;\n var timeout = nextTick.timeout;\n var queue = nextTick.queue || [];\n\n //-- add callback to the queue\n queue.push(callback);\n\n //-- set default value for digest\n if (digest == null) digest = true;\n\n //-- store updated digest/queue values\n nextTick.digest = nextTick.digest || digest;\n nextTick.queue = queue;\n\n //-- either return existing timeout or create a new one\n return timeout || (nextTick.timeout = $timeout(processQueue, 0, false));\n\n /**\n * Grab a copy of the current queue\n * Clear the queue for future use\n * Process the existing queue\n * Trigger digest if necessary\n */\n function processQueue () {\n var queue = nextTick.queue;\n var digest = nextTick.digest;\n\n nextTick.queue = [];\n nextTick.timeout = null;\n nextTick.digest = false;\n\n queue.forEach(function (callback) { callback(); });\n\n if (digest) $rootScope.$digest();\n }\n }\n\n };\n\n // Instantiate other namespace utility methods\n\n $mdUtil.dom.animator = $$mdAnimate($mdUtil);\n\n return $mdUtil;\n\n function getNode(el) {\n return el[0] || el;\n }\n\n }]);\n\n/*\n * Since removing jQuery from the demos, some code that uses `element.focus()` is broken.\n *\n * We need to add `element.focus()`, because it's testable unlike `element[0].focus`.\n *\n * TODO(ajoslin): This should be added in a better place later.\n */\n\nangular.element.prototype.focus = angular.element.prototype.focus || function () {\n if (this.length) {\n this[0].focus();\n }\n return this;\n };\nangular.element.prototype.blur = angular.element.prototype.blur || function () {\n if (this.length) {\n this[0].blur();\n }\n return this;\n };\n\n})();\n(function(){\n\"use strict\";\n\n\nangular.module('material.core')\n .service('$mdAria', AriaService);\n\n/*\n * @ngInject\n */\nfunction AriaService($$rAF, $log, $window) {\n\n return {\n expect: expect,\n expectAsync: expectAsync,\n expectWithText: expectWithText\n };\n\n /**\n * Check if expected attribute has been specified on the target element or child\n * @param element\n * @param attrName\n * @param {optional} defaultValue What to set the attr to if no value is found\n */\n function expect(element, attrName, defaultValue) {\n var node = element[0] || element;\n\n // if node exists and neither it nor its children have the attribute\n if (node &&\n ((!node.hasAttribute(attrName) ||\n node.getAttribute(attrName).length === 0) &&\n !childHasAttribute(node, attrName))) {\n\n defaultValue = angular.isString(defaultValue) ? defaultValue.trim() : '';\n if (defaultValue.length) {\n element.attr(attrName, defaultValue);\n } else {\n $log.warn('ARIA: Attribute \"', attrName, '\", required for accessibility, is missing on node:', node);\n }\n\n }\n }\n\n function expectAsync(element, attrName, defaultValueGetter) {\n // Problem: when retrieving the element's contents synchronously to find the label,\n // the text may not be defined yet in the case of a binding.\n // There is a higher chance that a binding will be defined if we wait one frame.\n $$rAF(function() {\n expect(element, attrName, defaultValueGetter());\n });\n }\n\n function expectWithText(element, attrName) {\n expectAsync(element, attrName, function() {\n return getText(element);\n });\n }\n\n function getText(element) {\n return element.text().trim();\n }\n\n function childHasAttribute(node, attrName) {\n var hasChildren = node.hasChildNodes(),\n hasAttr = false;\n\n function isHidden(el) {\n var style = el.currentStyle ? el.currentStyle : $window.getComputedStyle(el);\n return (style.display === 'none');\n }\n\n if(hasChildren) {\n var children = node.childNodes;\n for(var i=0; i\n * $mdCompiler.compile({\n * templateUrl: 'modal.html',\n * controller: 'ModalCtrl',\n * locals: {\n * modal: myModalInstance;\n * }\n * }).then(function(compileData) {\n * compileData.element; // modal.html's template in an element\n * compileData.link(myScope); //attach controller & scope to element\n * });\n * \n */\n\n /*\n * @ngdoc method\n * @name $mdCompiler#compile\n * @description A helper to compile an HTML template/templateUrl with a given controller,\n * locals, and scope.\n * @param {object} options An options object, with the following properties:\n *\n * - `controller` - `{(string=|function()=}` Controller fn that should be associated with\n * newly created scope or the name of a registered controller if passed as a string.\n * - `controllerAs` - `{string=}` A controller alias name. If present the controller will be\n * published to scope under the `controllerAs` name.\n * - `template` - `{string=}` An html template as a string.\n * - `templateUrl` - `{string=}` A path to an html template.\n * - `transformTemplate` - `{function(template)=}` A function which transforms the template after\n * it is loaded. It will be given the template string as a parameter, and should\n * return a a new string representing the transformed template.\n * - `resolve` - `{Object.=}` - An optional map of dependencies which should\n * be injected into the controller. If any of these dependencies are promises, the compiler\n * will wait for them all to be resolved, or if one is rejected before the controller is\n * instantiated `compile()` will fail..\n * * `key` - `{string}`: a name of a dependency to be injected into the controller.\n * * `factory` - `{string|function}`: If `string` then it is an alias for a service.\n * Otherwise if function, then it is injected and the return value is treated as the\n * dependency. If the result is a promise, it is resolved before its value is \n * injected into the controller.\n *\n * @returns {object=} promise A promise, which will be resolved with a `compileData` object.\n * `compileData` has the following properties: \n *\n * - `element` - `{element}`: an uncompiled element matching the provided template.\n * - `link` - `{function(scope)}`: A link function, which, when called, will compile\n * the element and instantiate the provided controller (if given).\n * - `locals` - `{object}`: The locals which will be passed into the controller once `link` is\n * called. If `bindToController` is true, they will be coppied to the ctrl instead\n * - `bindToController` - `bool`: bind the locals to the controller, instead of passing them in.\n */\n this.compile = function(options) {\n var templateUrl = options.templateUrl;\n var template = options.template || '';\n var controller = options.controller;\n var controllerAs = options.controllerAs;\n var resolve = angular.extend({}, options.resolve || {});\n var locals = angular.extend({}, options.locals || {});\n var transformTemplate = options.transformTemplate || angular.identity;\n var bindToController = options.bindToController;\n\n // Take resolve values and invoke them. \n // Resolves can either be a string (value: 'MyRegisteredAngularConst'),\n // or an invokable 'factory' of sorts: (value: function ValueGetter($dependency) {})\n angular.forEach(resolve, function(value, key) {\n if (angular.isString(value)) {\n resolve[key] = $injector.get(value);\n } else {\n resolve[key] = $injector.invoke(value);\n }\n });\n //Add the locals, which are just straight values to inject\n //eg locals: { three: 3 }, will inject three into the controller\n angular.extend(resolve, locals);\n\n if (templateUrl) {\n resolve.$template = $http.get(templateUrl, {cache: $templateCache})\n .then(function(response) {\n return response.data;\n });\n } else {\n resolve.$template = $q.when(template);\n }\n\n // Wait for all the resolves to finish if they are promises\n return $q.all(resolve).then(function(locals) {\n\n var template = transformTemplate(locals.$template);\n var element = options.element || angular.element('
    ').html(template.trim()).contents();\n var linkFn = $compile(element);\n\n //Return a linking function that can be used later when the element is ready\n return {\n locals: locals,\n element: element,\n link: function link(scope) {\n locals.$scope = scope;\n\n //Instantiate controller if it exists, because we have scope\n if (controller) {\n var invokeCtrl = $controller(controller, locals, true);\n if (bindToController) {\n angular.extend(invokeCtrl.instance, locals);\n }\n var ctrl = invokeCtrl();\n //See angular-route source for this logic\n element.data('$ngControllerController', ctrl);\n element.children().data('$ngControllerController', ctrl);\n\n if (controllerAs) {\n scope[controllerAs] = ctrl;\n }\n }\n return linkFn(scope);\n }\n };\n });\n\n };\n}\nmdCompilerService.$inject = [\"$q\", \"$http\", \"$injector\", \"$compile\", \"$controller\", \"$templateCache\"];\n\n})();\n(function(){\n\"use strict\";\n\n var HANDLERS = {};\n /* The state of the current 'pointer'\n * The pointer represents the state of the current touch.\n * It contains normalized x and y coordinates from DOM events,\n * as well as other information abstracted from the DOM.\n */\n var pointer, lastPointer, forceSkipClickHijack = false;\n\n // Used to attach event listeners once when multiple ng-apps are running.\n var isInitialized = false;\n \n angular\n .module('material.core.gestures', [ ])\n .provider('$mdGesture', MdGestureProvider)\n .factory('$$MdGestureHandler', MdGestureHandler)\n .run( attachToDocument );\n\n /**\n * @ngdoc service\n * @name $mdGestureProvider\n * @module material.core.gestures\n *\n * @description\n * In some scenarios on Mobile devices (without jQuery), the click events should NOT be hijacked.\n * `$mdGestureProvider` is used to configure the Gesture module to ignore or skip click hijacking on mobile\n * devices.\n *\n * \n * app.config(function($mdGestureProvider) {\n *\n * // For mobile devices without jQuery loaded, do not\n * // intercept click events during the capture phase.\n * $mdGestureProvider.skipClickHijack();\n *\n * });\n * \n *\n */\n function MdGestureProvider() { }\n\n MdGestureProvider.prototype = {\n\n // Publish access to setter to configure a variable BEFORE the\n // $mdGesture service is instantiated...\n skipClickHijack: function() {\n return forceSkipClickHijack = true;\n },\n\n /**\n * $get is used to build an instance of $mdGesture\n * @ngInject\n */\n $get : [\"$$MdGestureHandler\", \"$$rAF\", \"$timeout\", function($$MdGestureHandler, $$rAF, $timeout) {\n return new MdGesture($$MdGestureHandler, $$rAF, $timeout);\n }]\n };\n\n\n\n /**\n * MdGesture factory construction function\n * @ngInject\n */\n function MdGesture($$MdGestureHandler, $$rAF, $timeout) {\n var userAgent = navigator.userAgent || navigator.vendor || window.opera;\n var isIos = userAgent.match(/ipad|iphone|ipod/i);\n var isAndroid = userAgent.match(/android/i);\n var hasJQuery = (typeof window.jQuery !== 'undefined') && (angular.element === window.jQuery);\n\n var self = {\n handler: addHandler,\n register: register,\n // On mobile w/out jQuery, we normally intercept clicks. Should we skip that?\n isHijackingClicks: (isIos || isAndroid) && !hasJQuery && !forceSkipClickHijack\n };\n\n if (self.isHijackingClicks) {\n self.handler('click', {\n options: {\n maxDistance: 6\n },\n onEnd: function (ev, pointer) {\n if (pointer.distance < this.state.options.maxDistance) {\n this.dispatchEvent(ev, 'click');\n }\n }\n });\n }\n\n /*\n * Register an element to listen for a handler.\n * This allows an element to override the default options for a handler.\n * Additionally, some handlers like drag and hold only dispatch events if\n * the domEvent happens inside an element that's registered to listen for these events.\n *\n * @see GestureHandler for how overriding of default options works.\n * @example $mdGesture.register(myElement, 'drag', { minDistance: 20, horziontal: false })\n */\n function register(element, handlerName, options) {\n var handler = HANDLERS[handlerName.replace(/^\\$md./, '')];\n if (!handler) {\n throw new Error('Failed to register element with handler ' + handlerName + '. ' +\n 'Available handlers: ' + Object.keys(HANDLERS).join(', '));\n }\n return handler.registerElement(element, options);\n }\n\n /*\n * add a handler to $mdGesture. see below.\n */\n function addHandler(name, definition) {\n var handler = new $$MdGestureHandler(name);\n angular.extend(handler, definition);\n HANDLERS[name] = handler;\n\n return self;\n }\n\n /*\n * Register handlers. These listen to touch/start/move events, interpret them,\n * and dispatch gesture events depending on options & conditions. These are all\n * instances of GestureHandler.\n * @see GestureHandler \n */\n return self\n /*\n * The press handler dispatches an event on touchdown/touchend.\n * It's a simple abstraction of touch/mouse/pointer start and end.\n */\n .handler('press', {\n onStart: function (ev, pointer) {\n this.dispatchEvent(ev, '$md.pressdown');\n },\n onEnd: function (ev, pointer) {\n this.dispatchEvent(ev, '$md.pressup');\n }\n })\n\n /*\n * The hold handler dispatches an event if the user keeps their finger within\n * the same area for ms.\n * The hold handler will only run if a parent of the touch target is registered\n * to listen for hold events through $mdGesture.register()\n */\n .handler('hold', {\n options: {\n maxDistance: 6,\n delay: 500\n },\n onCancel: function () {\n $timeout.cancel(this.state.timeout);\n },\n onStart: function (ev, pointer) {\n // For hold, require a parent to be registered with $mdGesture.register()\n // Because we prevent scroll events, this is necessary.\n if (!this.state.registeredParent) return this.cancel();\n\n this.state.pos = {x: pointer.x, y: pointer.y};\n this.state.timeout = $timeout(angular.bind(this, function holdDelayFn() {\n this.dispatchEvent(ev, '$md.hold');\n this.cancel(); //we're done!\n }), this.state.options.delay, false);\n },\n onMove: function (ev, pointer) {\n // Don't scroll while waiting for hold.\n // If we don't preventDefault touchmove events here, Android will assume we don't\n // want to listen to anymore touch events. It will start scrolling and stop sending\n // touchmove events.\n ev.preventDefault();\n\n // If the user moves greater than pixels, stop the hold timer\n // set in onStart\n var dx = this.state.pos.x - pointer.x;\n var dy = this.state.pos.y - pointer.y;\n if (Math.sqrt(dx * dx + dy * dy) > this.options.maxDistance) {\n this.cancel();\n }\n },\n onEnd: function () {\n this.onCancel();\n }\n })\n\n /*\n * The drag handler dispatches a drag event if the user holds and moves his finger greater than\n * px in the x or y direction, depending on options.horizontal.\n * The drag will be cancelled if the user moves his finger greater than * in\n * the perpindicular direction. Eg if the drag is horizontal and the user moves his finger *\n * pixels vertically, this handler won't consider the move part of a drag.\n */\n .handler('drag', {\n options: {\n minDistance: 6,\n horizontal: true,\n cancelMultiplier: 1.5\n },\n onStart: function (ev) {\n // For drag, require a parent to be registered with $mdGesture.register()\n if (!this.state.registeredParent) this.cancel();\n },\n onMove: function (ev, pointer) {\n var shouldStartDrag, shouldCancel;\n // Don't scroll while deciding if this touchmove qualifies as a drag event.\n // If we don't preventDefault touchmove events here, Android will assume we don't\n // want to listen to anymore touch events. It will start scrolling and stop sending\n // touchmove events.\n ev.preventDefault();\n\n if (!this.state.dragPointer) {\n if (this.state.options.horizontal) {\n shouldStartDrag = Math.abs(pointer.distanceX) > this.state.options.minDistance;\n shouldCancel = Math.abs(pointer.distanceY) > this.state.options.minDistance * this.state.options.cancelMultiplier;\n } else {\n shouldStartDrag = Math.abs(pointer.distanceY) > this.state.options.minDistance;\n shouldCancel = Math.abs(pointer.distanceX) > this.state.options.minDistance * this.state.options.cancelMultiplier;\n }\n\n if (shouldStartDrag) {\n // Create a new pointer representing this drag, starting at this point where the drag started.\n this.state.dragPointer = makeStartPointer(ev);\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.dragstart', this.state.dragPointer);\n\n } else if (shouldCancel) {\n this.cancel();\n }\n } else {\n this.dispatchDragMove(ev);\n }\n },\n // Only dispatch dragmove events every frame; any more is unnecessray\n dispatchDragMove: $$rAF.throttle(function (ev) {\n // Make sure the drag didn't stop while waiting for the next frame\n if (this.state.isRunning) {\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.drag', this.state.dragPointer);\n }\n }),\n onEnd: function (ev, pointer) {\n if (this.state.dragPointer) {\n updatePointerState(ev, this.state.dragPointer);\n this.dispatchEvent(ev, '$md.dragend', this.state.dragPointer);\n }\n }\n })\n\n /*\n * The swipe handler will dispatch a swipe event if, on the end of a touch,\n * the velocity and distance were high enough.\n * TODO: add vertical swiping with a `horizontal` option similar to the drag handler.\n */\n .handler('swipe', {\n options: {\n minVelocity: 0.65,\n minDistance: 10\n },\n onEnd: function (ev, pointer) {\n if (Math.abs(pointer.velocityX) > this.state.options.minVelocity &&\n Math.abs(pointer.distanceX) > this.state.options.minDistance) {\n var eventType = pointer.directionX == 'left' ? '$md.swipeleft' : '$md.swiperight';\n this.dispatchEvent(ev, eventType);\n }\n }\n });\n\n }\n MdGesture.$inject = [\"$$MdGestureHandler\", \"$$rAF\", \"$timeout\"];\n\n /**\n * MdGestureHandler\n * A GestureHandler is an object which is able to dispatch custom dom events\n * based on native dom {touch,pointer,mouse}{start,move,end} events.\n *\n * A gesture will manage its lifecycle through the start,move,end, and cancel\n * functions, which are called by native dom events.\n *\n * A gesture has the concept of 'options' (eg a swipe's required velocity), which can be\n * overridden by elements registering through $mdGesture.register()\n */\n function GestureHandler (name) {\n this.name = name;\n this.state = {};\n }\n\n function MdGestureHandler() {\n var hasJQuery = (typeof window.jQuery !== 'undefined') && (angular.element === window.jQuery);\n\n GestureHandler.prototype = {\n options: {},\n // jQuery listeners don't work with custom DOMEvents, so we have to dispatch events\n // differently when jQuery is loaded\n dispatchEvent: hasJQuery ? jQueryDispatchEvent : nativeDispatchEvent,\n\n // These are overridden by the registered handler\n onStart: angular.noop,\n onMove: angular.noop,\n onEnd: angular.noop,\n onCancel: angular.noop,\n\n // onStart sets up a new state for the handler, which includes options from the\n // nearest registered parent element of ev.target.\n start: function (ev, pointer) {\n if (this.state.isRunning) return;\n var parentTarget = this.getNearestParent(ev.target);\n // Get the options from the nearest registered parent\n var parentTargetOptions = parentTarget && parentTarget.$mdGesture[this.name] || {};\n\n this.state = {\n isRunning: true,\n // Override the default options with the nearest registered parent's options\n options: angular.extend({}, this.options, parentTargetOptions),\n // Pass in the registered parent node to the state so the onStart listener can use\n registeredParent: parentTarget\n };\n this.onStart(ev, pointer);\n },\n move: function (ev, pointer) {\n if (!this.state.isRunning) return;\n this.onMove(ev, pointer);\n },\n end: function (ev, pointer) {\n if (!this.state.isRunning) return;\n this.onEnd(ev, pointer);\n this.state.isRunning = false;\n },\n cancel: function (ev, pointer) {\n this.onCancel(ev, pointer);\n this.state = {};\n },\n\n // Find and return the nearest parent element that has been registered to\n // listen for this handler via $mdGesture.register(element, 'handlerName').\n getNearestParent: function (node) {\n var current = node;\n while (current) {\n if ((current.$mdGesture || {})[this.name]) {\n return current;\n }\n current = current.parentNode;\n }\n return null;\n },\n\n // Called from $mdGesture.register when an element reigsters itself with a handler.\n // Store the options the user gave on the DOMElement itself. These options will\n // be retrieved with getNearestParent when the handler starts.\n registerElement: function (element, options) {\n var self = this;\n element[0].$mdGesture = element[0].$mdGesture || {};\n element[0].$mdGesture[this.name] = options || {};\n element.on('$destroy', onDestroy);\n\n return onDestroy;\n\n function onDestroy() {\n delete element[0].$mdGesture[self.name];\n element.off('$destroy', onDestroy);\n }\n }\n };\n\n return GestureHandler;\n\n /*\n * Dispatch an event with jQuery\n * TODO: Make sure this sends bubbling events\n *\n * @param srcEvent the original DOM touch event that started this.\n * @param eventType the name of the custom event to send (eg 'click' or '$md.drag')\n * @param eventPointer the pointer object that matches this event.\n */\n function jQueryDispatchEvent(srcEvent, eventType, eventPointer) {\n eventPointer = eventPointer || pointer;\n var eventObj = new angular.element.Event(eventType);\n\n eventObj.$material = true;\n eventObj.pointer = eventPointer;\n eventObj.srcEvent = srcEvent;\n\n angular.extend(eventObj, {\n clientX: eventPointer.x,\n clientY: eventPointer.y,\n screenX: eventPointer.x,\n screenY: eventPointer.y,\n pageX: eventPointer.x,\n pageY: eventPointer.y,\n ctrlKey: srcEvent.ctrlKey,\n altKey: srcEvent.altKey,\n shiftKey: srcEvent.shiftKey,\n metaKey: srcEvent.metaKey\n });\n angular.element(eventPointer.target).trigger(eventObj);\n }\n\n /*\n * NOTE: nativeDispatchEvent is very performance sensitive.\n * @param srcEvent the original DOM touch event that started this.\n * @param eventType the name of the custom event to send (eg 'click' or '$md.drag')\n * @param eventPointer the pointer object that matches this event.\n */\n function nativeDispatchEvent(srcEvent, eventType, eventPointer) {\n eventPointer = eventPointer || pointer;\n var eventObj;\n\n if (eventType === 'click') {\n eventObj = document.createEvent('MouseEvents');\n eventObj.initMouseEvent(\n 'click', true, true, window, srcEvent.detail,\n eventPointer.x, eventPointer.y, eventPointer.x, eventPointer.y,\n srcEvent.ctrlKey, srcEvent.altKey, srcEvent.shiftKey, srcEvent.metaKey,\n srcEvent.button, srcEvent.relatedTarget || null\n );\n\n } else {\n eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent(eventType, true, true, {});\n }\n eventObj.$material = true;\n eventObj.pointer = eventPointer;\n eventObj.srcEvent = srcEvent;\n eventPointer.target.dispatchEvent(eventObj);\n }\n\n }\n\n /**\n * Attach Gestures: hook document and check shouldHijack clicks\n * @ngInject\n */\n function attachToDocument( $mdGesture, $$MdGestureHandler ) {\n\n // Polyfill document.contains for IE11.\n // TODO: move to util\n document.contains || (document.contains = function (node) {\n return document.body.contains(node);\n });\n\n if (!isInitialized && $mdGesture.isHijackingClicks ) {\n /*\n * If hijack clicks is true, we preventDefault any click that wasn't\n * sent by ngMaterial. This is because on older Android & iOS, a false, or 'ghost',\n * click event will be sent ~400ms after a touchend event happens.\n * The only way to know if this click is real is to prevent any normal\n * click events, and add a flag to events sent by material so we know not to prevent those.\n * \n * Two exceptions to click events that should be prevented are:\n * - click events sent by the keyboard (eg form submit)\n * - events that originate from an Ionic app\n */\n document.addEventListener('click', function clickHijacker(ev) {\n var isKeyClick = ev.clientX === 0 && ev.clientY === 0;\n if (!isKeyClick && !ev.$material && !ev.isIonicTap) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n }, true);\n \n isInitialized = true;\n }\n\n // Listen to all events to cover all platforms.\n var START_EVENTS = 'mousedown touchstart pointerdown';\n var MOVE_EVENTS = 'mousemove touchmove pointermove';\n var END_EVENTS = 'mouseup mouseleave touchend touchcancel pointerup pointercancel';\n\n angular.element(document)\n .on(START_EVENTS, gestureStart)\n .on(MOVE_EVENTS, gestureMove)\n .on(END_EVENTS, gestureEnd)\n // For testing\n .on('$$mdGestureReset', function gestureClearCache () {\n lastPointer = pointer = null;\n });\n\n /*\n * When a DOM event happens, run all registered gesture handlers' lifecycle\n * methods which match the DOM event.\n * Eg when a 'touchstart' event happens, runHandlers('start') will call and\n * run `handler.cancel()` and `handler.start()` on all registered handlers.\n */\n function runHandlers(handlerEvent, event) {\n var handler;\n for (var name in HANDLERS) {\n handler = HANDLERS[name];\n if( handler instanceof $$MdGestureHandler ) {\n\n if (handlerEvent === 'start') {\n // Run cancel to reset any handlers' state\n handler.cancel();\n }\n handler[handlerEvent](event, pointer);\n\n }\n }\n }\n\n /*\n * gestureStart vets if a start event is legitimate (and not part of a 'ghost click' from iOS/Android)\n * If it is legitimate, we initiate the pointer state and mark the current pointer's type\n * For example, for a touchstart event, mark the current pointer as a 'touch' pointer, so mouse events\n * won't effect it.\n */\n function gestureStart(ev) {\n // If we're already touched down, abort\n if (pointer) return;\n\n var now = +Date.now();\n\n // iOS & old android bug: after a touch event, a click event is sent 350 ms later.\n // If <400ms have passed, don't allow an event of a different type than the previous event\n if (lastPointer && !typesMatch(ev, lastPointer) && (now - lastPointer.endTime < 1500)) {\n return;\n }\n\n pointer = makeStartPointer(ev);\n\n runHandlers('start', ev);\n }\n /*\n * If a move event happens of the right type, update the pointer and run all the move handlers.\n * \"of the right type\": if a mousemove happens but our pointer started with a touch event, do nothing.\n */\n function gestureMove(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n runHandlers('move', ev);\n }\n /*\n * If an end event happens of the right type, update the pointer, run endHandlers, and save the pointer as 'lastPointer'\n */\n function gestureEnd(ev) {\n if (!pointer || !typesMatch(ev, pointer)) return;\n\n updatePointerState(ev, pointer);\n pointer.endTime = +Date.now();\n\n runHandlers('end', ev);\n\n lastPointer = pointer;\n pointer = null;\n }\n\n }\n attachToDocument.$inject = [\"$mdGesture\", \"$$MdGestureHandler\"];\n\n // ********************\n // Module Functions\n // ********************\n\n /*\n * Initiate the pointer. x, y, and the pointer's type.\n */\n function makeStartPointer(ev) {\n var point = getEventPoint(ev);\n var startPointer = {\n startTime: +Date.now(),\n target: ev.target,\n // 'p' for pointer events, 'm' for mouse, 't' for touch\n type: ev.type.charAt(0)\n };\n startPointer.startX = startPointer.x = point.pageX;\n startPointer.startY = startPointer.y = point.pageY;\n return startPointer;\n }\n\n /*\n * return whether the pointer's type matches the event's type.\n * Eg if a touch event happens but the pointer has a mouse type, return false.\n */\n function typesMatch(ev, pointer) {\n return ev && pointer && ev.type.charAt(0) === pointer.type;\n }\n\n /*\n * Update the given pointer based upon the given DOMEvent.\n * Distance, velocity, direction, duration, etc\n */\n function updatePointerState(ev, pointer) {\n var point = getEventPoint(ev);\n var x = pointer.x = point.pageX;\n var y = pointer.y = point.pageY;\n\n pointer.distanceX = x - pointer.startX;\n pointer.distanceY = y - pointer.startY;\n pointer.distance = Math.sqrt(\n pointer.distanceX * pointer.distanceX + pointer.distanceY * pointer.distanceY\n );\n\n pointer.directionX = pointer.distanceX > 0 ? 'right' : pointer.distanceX < 0 ? 'left' : '';\n pointer.directionY = pointer.distanceY > 0 ? 'up' : pointer.distanceY < 0 ? 'down' : '';\n\n pointer.duration = +Date.now() - pointer.startTime;\n pointer.velocityX = pointer.distanceX / pointer.duration;\n pointer.velocityY = pointer.distanceY / pointer.duration;\n }\n\n /*\n * Normalize the point where the DOM event happened whether it's touch or mouse.\n * @returns point event obj with pageX and pageY on it.\n */\n function getEventPoint(ev) {\n ev = ev.originalEvent || ev; // support jQuery events\n return (ev.touches && ev.touches[0]) ||\n (ev.changedTouches && ev.changedTouches[0]) ||\n ev;\n }\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core')\n .provider('$$interimElement', InterimElementProvider);\n\n/*\n * @ngdoc service\n * @name $$interimElement\n * @module material.core\n *\n * @description\n *\n * Factory that contructs `$$interimElement.$service` services.\n * Used internally in material design for elements that appear on screen temporarily.\n * The service provides a promise-like API for interacting with the temporary\n * elements.\n *\n * ```js\n * app.service('$mdToast', function($$interimElement) {\n * var $mdToast = $$interimElement(toastDefaultOptions);\n * return $mdToast;\n * });\n * ```\n * @param {object=} defaultOptions Options used by default for the `show` method on the service.\n *\n * @returns {$$interimElement.$service}\n *\n */\n\nfunction InterimElementProvider() {\n createInterimElementProvider.$get = InterimElementFactory;\n InterimElementFactory.$inject = [\"$document\", \"$q\", \"$rootScope\", \"$timeout\", \"$rootElement\", \"$animate\", \"$interpolate\", \"$mdCompiler\", \"$mdTheming\", \"$log\"];\n return createInterimElementProvider;\n\n /**\n * Returns a new provider which allows configuration of a new interimElement\n * service. Allows configuration of default options & methods for options,\n * as well as configuration of 'preset' methods (eg dialog.basic(): basic is a preset method)\n */\n function createInterimElementProvider(interimFactoryName) {\n var EXPOSED_METHODS = ['onHide', 'onShow', 'onRemove'];\n\n var customMethods = {};\n var providerConfig = {\n presets: {}\n };\n\n var provider = {\n setDefaults: setDefaults,\n addPreset: addPreset,\n addMethod: addMethod,\n $get: factory\n };\n\n /**\n * all interim elements will come with the 'build' preset\n */\n provider.addPreset('build', {\n methods: ['controller', 'controllerAs', 'resolve',\n 'template', 'templateUrl', 'themable', 'transformTemplate', 'parent']\n });\n\n factory.$inject = [\"$$interimElement\", \"$injector\"];\n return provider;\n\n /**\n * Save the configured defaults to be used when the factory is instantiated\n */\n function setDefaults(definition) {\n providerConfig.optionsFactory = definition.options;\n providerConfig.methods = (definition.methods || []).concat(EXPOSED_METHODS);\n return provider;\n }\n\n /**\n * Add a method to the factory that isn't specific to any interim element operations\n */\n\n function addMethod(name, fn) {\n customMethods[name] = fn;\n return provider;\n }\n\n /**\n * Save the configured preset to be used when the factory is instantiated\n */\n function addPreset(name, definition) {\n definition = definition || {};\n definition.methods = definition.methods || [];\n definition.options = definition.options || function() { return {}; };\n\n if (/^cancel|hide|show$/.test(name)) {\n throw new Error(\"Preset '\" + name + \"' in \" + interimFactoryName + \" is reserved!\");\n }\n if (definition.methods.indexOf('_options') > -1) {\n throw new Error(\"Method '_options' in \" + interimFactoryName + \" is reserved!\");\n }\n providerConfig.presets[name] = {\n methods: definition.methods.concat(EXPOSED_METHODS),\n optionsFactory: definition.options,\n argOption: definition.argOption\n };\n return provider;\n }\n\n /**\n * Create a factory that has the given methods & defaults implementing interimElement\n */\n /* @ngInject */\n function factory($$interimElement, $injector) {\n var defaultMethods;\n var defaultOptions;\n var interimElementService = $$interimElement();\n\n /*\n * publicService is what the developer will be using.\n * It has methods hide(), cancel(), show(), build(), and any other\n * presets which were set during the config phase.\n */\n var publicService = {\n hide: interimElementService.hide,\n cancel: interimElementService.cancel,\n show: showInterimElement\n };\n\n defaultMethods = providerConfig.methods || [];\n // This must be invoked after the publicService is initialized\n defaultOptions = invokeFactory(providerConfig.optionsFactory, {});\n\n // Copy over the simple custom methods\n angular.forEach(customMethods, function(fn, name) {\n publicService[name] = fn;\n });\n\n angular.forEach(providerConfig.presets, function(definition, name) {\n var presetDefaults = invokeFactory(definition.optionsFactory, {});\n var presetMethods = (definition.methods || []).concat(defaultMethods);\n\n // Every interimElement built with a preset has a field called `$type`,\n // which matches the name of the preset.\n // Eg in preset 'confirm', options.$type === 'confirm'\n angular.extend(presetDefaults, { $type: name });\n\n // This creates a preset class which has setter methods for every\n // method given in the `.addPreset()` function, as well as every\n // method given in the `.setDefaults()` function.\n //\n // @example\n // .setDefaults({\n // methods: ['hasBackdrop', 'clickOutsideToClose', 'escapeToClose', 'targetEvent'],\n // options: dialogDefaultOptions\n // })\n // .addPreset('alert', {\n // methods: ['title', 'ok'],\n // options: alertDialogOptions\n // })\n //\n // Set values will be passed to the options when interimElement.show() is called.\n function Preset(opts) {\n this._options = angular.extend({}, presetDefaults, opts);\n }\n angular.forEach(presetMethods, function(name) {\n Preset.prototype[name] = function(value) {\n this._options[name] = value;\n return this;\n };\n });\n\n // Create shortcut method for one-linear methods\n if (definition.argOption) {\n var methodName = 'show' + name.charAt(0).toUpperCase() + name.slice(1);\n publicService[methodName] = function(arg) {\n var config = publicService[name](arg);\n return publicService.show(config);\n };\n }\n\n // eg $mdDialog.alert() will return a new alert preset\n publicService[name] = function(arg) {\n // If argOption is supplied, eg `argOption: 'content'`, then we assume\n // if the argument is not an options object then it is the `argOption` option.\n //\n // @example `$mdToast.simple('hello')` // sets options.content to hello\n // // because argOption === 'content'\n if (arguments.length && definition.argOption && !angular.isObject(arg) &&\n !angular.isArray(arg)) {\n return (new Preset())[definition.argOption](arg);\n } else {\n return new Preset(arg);\n }\n\n };\n });\n\n return publicService;\n\n function showInterimElement(opts) {\n // opts is either a preset which stores its options on an _options field,\n // or just an object made up of options\n opts = opts || { };\n if (opts._options) opts = opts._options;\n\n return interimElementService.show(\n angular.extend({}, defaultOptions, opts)\n );\n }\n\n /**\n * Helper to call $injector.invoke with a local of the factory name for\n * this provider.\n * If an $mdDialog is providing options for a dialog and tries to inject\n * $mdDialog, a circular dependency error will happen.\n * We get around that by manually injecting $mdDialog as a local.\n */\n function invokeFactory(factory, defaultVal) {\n var locals = {};\n locals[interimFactoryName] = publicService;\n return $injector.invoke(factory || function() { return defaultVal; }, {}, locals);\n }\n\n }\n\n }\n\n /* @ngInject */\n function InterimElementFactory($document, $q, $rootScope, $timeout, $rootElement, $animate,\n $interpolate, $mdCompiler, $mdTheming, $log ) {\n var startSymbol = $interpolate.startSymbol(),\n endSymbol = $interpolate.endSymbol(),\n usesStandardSymbols = ((startSymbol === '{{') && (endSymbol === '}}')),\n processTemplate = usesStandardSymbols ? angular.identity : replaceInterpolationSymbols;\n\n return function createInterimElementService() {\n var SHOW_CANCELLED = false;\n var SHOW_CLOSED = true;\n\n /*\n * @ngdoc service\n * @name $$interimElement.$service\n *\n * @description\n * A service used to control inserting and removing an element into the DOM.\n *\n */\n var service, stack = [];\n\n // Publish instance $$interimElement service;\n // ... used as $mdDialog, $mdToast, $mdMenu, and $mdSelect\n\n return service = {\n show: show,\n hide: hide,\n cancel: cancel\n };\n\n /*\n * @ngdoc method\n * @name $$interimElement.$service#show\n * @kind function\n *\n * @description\n * Adds the `$interimElement` to the DOM and returns a special promise that will be resolved or rejected\n * with hide or cancel, respectively. To external cancel/hide, developers should use the\n *\n * @param {*} options is hashMap of settings\n * @returns a Promise\n *\n */\n function show(options) {\n var interimElement = new InterimElement(options);\n var hideExisting = stack.length ? service.hide() : $q.when(true);\n\n // This hide()s only the current interim element before showing the next, new one\n // NOTE: this is not reversible (e.g. interim elements are not stackable)\n\n hideExisting.finally(function() {\n\n stack.push(interimElement);\n interimElement\n .show()\n .catch(function( reason ) {\n // $log.error(\"InterimElement.show() error: \" + reason );\n });\n\n });\n\n // Return a promise that will be resolved when the interim\n // element is hidden or cancelled...\n\n return interimElement.deferred.promise;\n }\n\n /*\n * @ngdoc method\n * @name $$interimElement.$service#hide\n * @kind function\n *\n * @description\n * Removes the `$interimElement` from the DOM and resolves the promise returned from `show`\n *\n * @param {*} resolveParam Data to resolve the promise with\n * @returns a Promise that will be resolved after the element has been removed.\n *\n */\n function hide(reason) {\n var interim = stack.shift();\n if ( !interim ) return $q.when(reason);\n\n interim\n .remove(reason || SHOW_CLOSED, false)\n .catch(function( reason ) {\n // $log.error(\"InterimElement.hide() error: \" + reason );\n });\n\n return interim.deferred.promise;\n }\n\n /*\n * @ngdoc method\n * @name $$interimElement.$service#cancel\n * @kind function\n *\n * @description\n * Removes the `$interimElement` from the DOM and rejects the promise returned from `show`\n *\n * @param {*} reason Data to reject the promise with\n * @returns Promise that will be resolved after the element has been removed.\n *\n */\n function cancel(reason) {\n var interim = stack.shift();\n if ( !interim ) return $q.when(reason);\n\n interim\n .remove(reason || SHOW_CANCELLED, true)\n .catch(function( reason ) {\n // $log.error(\"InterimElement.cancel() error: \" + reason );\n });\n\n return interim.deferred.promise;\n }\n\n\n /*\n * Internal Interim Element Object\n * Used internally to manage the DOM element and related data\n */\n function InterimElement(options) {\n var self, element, showAction = $q.when(true);\n\n options = configureScopeAndTransitions(options);\n\n return self = {\n options : options,\n deferred: $q.defer(),\n show : createAndTransitionIn,\n remove : transitionOutAndRemove\n };\n\n /**\n * Compile, link, and show this interim element\n * Use optional autoHided and transition-in effects\n */\n function createAndTransitionIn() {\n return $q(function(resolve, reject){\n\n compileElement(options)\n .then(function( compiledData ) {\n element = linkElement( compiledData, options );\n\n showAction = showElement(element, options)\n .then(resolve, rejectAll );\n\n });\n\n function rejectAll(fault) {\n // Force the '$md.show()' promise to reject\n self.deferred.reject(fault);\n\n // Continue rejection propagation\n reject(fault);\n }\n });\n }\n\n /**\n * After the show process has finished/rejected:\n * - announce 'removing',\n * - perform the transition-out, and\n * - perform optional clean up scope.\n */\n function transitionOutAndRemove(response, isCancelled) {\n options.cancelAutoHide && options.cancelAutoHide();\n\n return $q(function(resolve, reject){\n\n $q.when(showAction).finally(function(){\n\n hideElement(options.element, options).then( function() {\n\n (isCancelled && rejectAll(response)) || resolveAll();\n\n }, rejectAll );\n\n });\n\n function resolveAll() {\n // The `show()` returns a promise that will be resolved when the interim\n // element is hidden or cancelled...\n self.deferred.resolve(response);\n\n // Now resolve the `.hide()` promise itself (optional)\n resolve(response);\n }\n\n function rejectAll(fault) {\n // Force the '$md.show()' promise to reject\n self.deferred.reject(fault);\n\n // Continue rejection propagation\n reject(fault);\n }\n\n });\n }\n\n /**\n * Prepare optional isolated scope and prepare $animate with default enter and leave\n * transitions for the new element instance.\n */\n function configureScopeAndTransitions(options) {\n options = options || { };\n if ( options.template ) {\n options.template = processTemplate(options.template);\n }\n\n return angular.extend({\n preserveScope: false,\n cancelAutoHide : angular.noop,\n scope: options.scope || $rootScope.$new(options.isolateScope),\n\n /**\n * Default usage to enable $animate to transition-in; can be easily overridden via 'options'\n */\n onShow: function transitionIn(scope, element, options) {\n return $animate.enter(element, options.parent);\n },\n\n /**\n * Default usage to enable $animate to transition-out; can be easily overridden via 'options'\n */\n onRemove: function transitionOut(scope, element) {\n // Element could be undefined if a new element is shown before\n // the old one finishes compiling.\n return element && $animate.leave(element) || $q.when();\n }\n }, options );\n\n }\n\n /**\n * Compile an element with a templateUrl, controller, and locals\n */\n function compileElement(options) {\n\n var compiled = !options.skipCompile ? $mdCompiler.compile(options) : null;\n\n return compiled || $q(function (resolve) {\n resolve({\n locals: {},\n link: function () {\n return options.element;\n }\n });\n });\n }\n\n /**\n * Link an element with compiled configuration\n */\n function linkElement(compileData, options){\n angular.extend(compileData.locals, options);\n\n var element = compileData.link(options.scope);\n\n // Search for parent at insertion time, if not specified\n options.element = element;\n options.parent = findParent(element, options);\n if (options.themable) $mdTheming(element);\n\n return element;\n }\n\n /**\n * Search for parent at insertion time, if not specified\n */\n function findParent(element, options) {\n var parent = options.parent;\n\n // Search for parent at insertion time, if not specified\n if (angular.isFunction(parent)) {\n parent = parent(options.scope, element, options);\n } else if (angular.isString(parent)) {\n parent = angular.element($document[0].querySelector(parent));\n } else {\n parent = angular.element(parent);\n }\n\n // If parent querySelector/getter function fails, or it's just null,\n // find a default.\n if (!(parent || {}).length) {\n var el;\n if ($rootElement[0] && $rootElement[0].querySelector) {\n el = $rootElement[0].querySelector(':not(svg) > body');\n }\n if (!el) el = $rootElement[0];\n if (el.nodeName == '#comment') {\n el = $document[0].body;\n }\n return angular.element(el);\n }\n\n return parent;\n }\n\n /**\n * If auto-hide is enabled, start timer and prepare cancel function\n */\n function startAutoHide() {\n var autoHideTimer, cancelAutoHide = angular.noop;\n\n if (options.hideDelay) {\n autoHideTimer = $timeout(service.hide, options.hideDelay) ;\n cancelAutoHide = function() {\n $timeout.cancel(autoHideTimer);\n }\n }\n\n // Cache for subsequent use\n options.cancelAutoHide = function() {\n cancelAutoHide();\n options.cancelAutoHide = undefined;\n }\n }\n\n /**\n * Show the element ( with transitions), notify complete and start\n * optional auto-Hide\n */\n function showElement(element, options) {\n // Trigger onComplete callback when the `show()` finishes\n var notifyComplete = options.onComplete || angular.noop;\n\n return $q(function (resolve, reject) {\n try {\n\n // Start transitionIn\n $q.when(options.onShow(options.scope, element, options))\n .then(function () {\n\n notifyComplete(options.scope, element, options);\n startAutoHide();\n\n resolve(element);\n\n }, reject );\n\n } catch(e) {\n reject(e.message);\n }\n });\n }\n\n function hideElement(element, options) {\n var announceRemoving = options.onRemoving || angular.noop;\n\n return $q(function (resolve, reject) {\n try {\n // Start transitionIn\n var action = $q.when(element ? options.onRemove(options.scope, element, options) : true);\n\n // Trigger callback *before* the remove operation starts\n announceRemoving(element, action);\n\n // Wait until transition-out is done\n action.then(function () {\n\n !options.preserveScope && options.scope.$destroy();\n resolve(element);\n\n }, reject );\n\n } catch(e) {\n reject(e.message);\n }\n });\n }\n\n }\n };\n\n /**\n * Replace `{{` and `}}` in a string (usually a template) with the actual start-/endSymbols used\n * for interpolation. This allows pre-defined templates (for components such as dialog, toast etc)\n * to continue to work in apps that use custom interpolation start-/endSymbols.\n *\n * @param {string} text The text in which to replace `{{` / `}}`\n * @returns {string} The modified string using the actual interpolation start-/endSymbols\n */\n function replaceInterpolationSymbols(text) {\n if (!text || !angular.isString(text)) return text;\n return text.replace(/\\{\\{/g, startSymbol).replace(/}}/g, endSymbol);\n }\n\n }\n\n}\n\n})();\n(function(){\n\"use strict\";\n\n /**\n * @ngdoc module\n * @name material.core.componentRegistry\n *\n * @description\n * A component instance registration service.\n * Note: currently this as a private service in the SideNav component.\n */\n angular.module('material.core')\n .factory('$mdComponentRegistry', ComponentRegistry);\n\n /*\n * @private\n * @ngdoc factory\n * @name ComponentRegistry\n * @module material.core.componentRegistry\n *\n */\n function ComponentRegistry($log, $q) {\n\n var self;\n var instances = [ ];\n var pendings = { };\n\n return self = {\n /**\n * Used to print an error when an instance for a handle isn't found.\n */\n notFoundError: function(handle) {\n $log.error('No instance found for handle', handle);\n },\n /**\n * Return all registered instances as an array.\n */\n getInstances: function() {\n return instances;\n },\n\n /**\n * Get a registered instance.\n * @param handle the String handle to look up for a registered instance.\n */\n get: function(handle) {\n if ( !isValidID(handle) ) return null;\n\n var i, j, instance;\n for(i = 0, j = instances.length; i < j; i++) {\n instance = instances[i];\n if(instance.$$mdHandle === handle) {\n return instance;\n }\n }\n return null;\n },\n\n /**\n * Register an instance.\n * @param instance the instance to register\n * @param handle the handle to identify the instance under.\n */\n register: function(instance, handle) {\n if ( !handle ) return angular.noop;\n\n instance.$$mdHandle = handle;\n instances.push(instance);\n resolveWhen();\n\n return deregister;\n\n /**\n * Remove registration for an instance\n */\n function deregister() {\n var index = instances.indexOf(instance);\n if (index !== -1) {\n instances.splice(index, 1);\n }\n }\n\n /**\n * Resolve any pending promises for this instance\n */\n function resolveWhen() {\n var dfd = pendings[handle];\n if ( dfd ) {\n dfd.resolve( instance );\n delete pendings[handle];\n }\n }\n },\n\n /**\n * Async accessor to registered component instance\n * If not available then a promise is created to notify\n * all listeners when the instance is registered.\n */\n when : function(handle) {\n if ( isValidID(handle) ) {\n var deferred = $q.defer();\n var instance = self.get(handle);\n\n if ( instance ) {\n deferred.resolve( instance );\n } else {\n pendings[handle] = deferred;\n }\n\n return deferred.promise;\n }\n return $q.reject(\"Invalid `md-component-id` value.\");\n }\n\n };\n\n function isValidID(handle){\n return handle && (handle !== \"\");\n }\n\n }\n ComponentRegistry.$inject = [\"$log\", \"$q\"];\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc service\n * @name $mdButtonInkRipple\n * @module material.core\n *\n * @description\n * Provides ripple effects for md-button. See $mdInkRipple service for all possible configuration options.\n *\n * @param {object=} scope Scope within the current context\n * @param {object=} element The element the ripple effect should be applied to\n * @param {object=} options (Optional) Configuration options to override the defaultripple configuration\n */\n\n angular.module('material.core')\n .factory('$mdButtonInkRipple', MdButtonInkRipple);\n\n function MdButtonInkRipple($mdInkRipple) {\n return {\n attach: attach\n };\n\n function attach(scope, element, options) {\n var elementOptions = optionsForElement(element);\n return $mdInkRipple.attach(scope, element, angular.extend(elementOptions, options));\n };\n\n function optionsForElement(element) {\n if (element.hasClass('md-icon-button')) {\n return {\n isMenuItem: element.hasClass('md-menu-item'),\n fitRipple: true,\n center: true\n };\n } else {\n return {\n isMenuItem: element.hasClass('md-menu-item'),\n dimBackground: true\n }\n }\n };\n }\n MdButtonInkRipple.$inject = [\"$mdInkRipple\"];;\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc service\n * @name $mdCheckboxInkRipple\n * @module material.core\n *\n * @description\n * Provides ripple effects for md-checkbox. See $mdInkRipple service for all possible configuration options.\n *\n * @param {object=} scope Scope within the current context\n * @param {object=} element The element the ripple effect should be applied to\n * @param {object=} options (Optional) Configuration options to override the defaultripple configuration\n */\n\n angular.module('material.core')\n .factory('$mdCheckboxInkRipple', MdCheckboxInkRipple);\n\n function MdCheckboxInkRipple($mdInkRipple) {\n return {\n attach: attach\n };\n\n function attach(scope, element, options) {\n return $mdInkRipple.attach(scope, element, angular.extend({\n center: true,\n dimBackground: false,\n fitRipple: true\n }, options));\n };\n }\n MdCheckboxInkRipple.$inject = [\"$mdInkRipple\"];;\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc service\n * @name $mdListInkRipple\n * @module material.core\n *\n * @description\n * Provides ripple effects for md-list. See $mdInkRipple service for all possible configuration options.\n *\n * @param {object=} scope Scope within the current context\n * @param {object=} element The element the ripple effect should be applied to\n * @param {object=} options (Optional) Configuration options to override the defaultripple configuration\n */\n\n angular.module('material.core')\n .factory('$mdListInkRipple', MdListInkRipple);\n\n function MdListInkRipple($mdInkRipple) {\n return {\n attach: attach\n };\n\n function attach(scope, element, options) {\n return $mdInkRipple.attach(scope, element, angular.extend({\n center: false,\n dimBackground: true,\n outline: false,\n rippleSize: 'full'\n }, options));\n };\n }\n MdListInkRipple.$inject = [\"$mdInkRipple\"];;\n})();\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core')\n .factory('$mdInkRipple', InkRippleService)\n .directive('mdInkRipple', InkRippleDirective)\n .directive('mdNoInk', attrNoDirective())\n .directive('mdNoBar', attrNoDirective())\n .directive('mdNoStretch', attrNoDirective());\n\nfunction InkRippleDirective($mdButtonInkRipple, $mdCheckboxInkRipple) {\n return {\n controller: angular.noop,\n link: function (scope, element, attr) {\n if (attr.hasOwnProperty('mdInkRippleCheckbox')) {\n $mdCheckboxInkRipple.attach(scope, element);\n } else {\n $mdButtonInkRipple.attach(scope, element);\n }\n }\n };\n}\nInkRippleDirective.$inject = [\"$mdButtonInkRipple\", \"$mdCheckboxInkRipple\"];\n\nfunction InkRippleService($window, $timeout, $mdUtil) {\n\n return {\n attach: attach\n };\n\n function attach(scope, element, options) {\n if (element.controller('mdNoInk')) return angular.noop;\n\n options = angular.extend({\n colorElement: element,\n mousedown: true,\n hover: true,\n focus: true,\n center: false,\n mousedownPauseTime: 150,\n dimBackground: false,\n outline: false,\n fullRipple: true,\n isMenuItem: false,\n fitRipple: false\n }, options);\n\n var rippleSize,\n controller = element.controller('mdInkRipple') || {},\n counter = 0,\n ripples = [],\n states = [],\n isActiveExpr = element.attr('md-highlight'),\n isActive = false,\n isHeld = false,\n node = element[0],\n rippleSizeSetting = element.attr('md-ripple-size'),\n color = parseColor(element.attr('md-ink-ripple')) || parseColor(options.colorElement.length && $window.getComputedStyle(options.colorElement[0]).color || 'rgb(0, 0, 0)');\n\n switch (rippleSizeSetting) {\n case 'full':\n options.fullRipple = true;\n break;\n case 'partial':\n options.fullRipple = false;\n break;\n }\n\n // expose onInput for ripple testing\n if (options.mousedown) {\n element.on('$md.pressdown', onPressDown)\n .on('$md.pressup', onPressUp);\n }\n\n controller.createRipple = createRipple;\n\n if (isActiveExpr) {\n scope.$watch(isActiveExpr, function watchActive(newValue) {\n isActive = newValue;\n if (isActive && !ripples.length) {\n $mdUtil.nextTick(function () { createRipple(0, 0); });\n }\n angular.forEach(ripples, updateElement);\n });\n }\n\n // Publish self-detach method if desired...\n return function detach() {\n element.off('$md.pressdown', onPressDown)\n .off('$md.pressup', onPressUp);\n getRippleContainer().remove();\n };\n\n /**\n * Gets the current ripple container\n * If there is no ripple container, it creates one and returns it\n *\n * @returns {angular.element} ripple container element\n */\n function getRippleContainer() {\n var container = element.data('$mdRippleContainer');\n if (container) return container;\n container = angular.element('
    ');\n element.append(container);\n element.data('$mdRippleContainer', container);\n return container;\n }\n\n function parseColor(color) {\n if (!color) return;\n if (color.indexOf('rgba') === 0) return color.replace(/\\d?\\.?\\d*\\s*\\)\\s*$/, '0.1)');\n if (color.indexOf('rgb') === 0) return rgbToRGBA(color);\n if (color.indexOf('#') === 0) return hexToRGBA(color);\n\n /**\n * Converts a hex value to an rgba string\n *\n * @param {string} hex value (3 or 6 digits) to be converted\n *\n * @returns {string} rgba color with 0.1 alpha\n */\n function hexToRGBA(color) {\n var hex = color.charAt(0) === '#' ? color.substr(1) : color,\n dig = hex.length / 3,\n red = hex.substr(0, dig),\n grn = hex.substr(dig, dig),\n blu = hex.substr(dig * 2);\n if (dig === 1) {\n red += red;\n grn += grn;\n blu += blu;\n }\n return 'rgba(' + parseInt(red, 16) + ',' + parseInt(grn, 16) + ',' + parseInt(blu, 16) + ',0.1)';\n }\n\n /**\n * Converts rgb value to rgba string\n *\n * @param {string} rgb color string\n *\n * @returns {string} rgba color with 0.1 alpha\n */\n function rgbToRGBA(color) {\n return color.replace(')', ', 0.1)').replace('(', 'a(');\n }\n\n }\n\n function removeElement(elem, wait) {\n ripples.splice(ripples.indexOf(elem), 1);\n if (ripples.length === 0) {\n getRippleContainer().css({ backgroundColor: '' });\n }\n $timeout(function () { elem.remove(); }, wait, false);\n }\n\n function updateElement(elem) {\n var index = ripples.indexOf(elem),\n state = states[index] || {},\n elemIsActive = ripples.length > 1 ? false : isActive,\n elemIsHeld = ripples.length > 1 ? false : isHeld;\n if (elemIsActive || state.animating || elemIsHeld) {\n elem.addClass('md-ripple-visible');\n } else if (elem) {\n elem.removeClass('md-ripple-visible');\n if (options.outline) {\n elem.css({\n width: rippleSize + 'px',\n height: rippleSize + 'px',\n marginLeft: (rippleSize * -1) + 'px',\n marginTop: (rippleSize * -1) + 'px'\n });\n }\n removeElement(elem, options.outline ? 450 : 650);\n }\n }\n\n /**\n * Creates a ripple at the provided coordinates\n *\n * @param {number} left cursor position\n * @param {number} top cursor position\n *\n * @returns {angular.element} the generated ripple element\n */\n function createRipple(left, top) {\n\n color = parseColor(element.attr('md-ink-ripple')) || parseColor($window.getComputedStyle(options.colorElement[0]).color || 'rgb(0, 0, 0)');\n\n var container = getRippleContainer(),\n size = getRippleSize(left, top),\n css = getRippleCss(size, left, top),\n elem = getRippleElement(css),\n index = ripples.indexOf(elem),\n state = states[index] || {};\n\n rippleSize = size;\n\n state.animating = true;\n\n $mdUtil.nextTick(function () {\n if (options.dimBackground) {\n container.css({ backgroundColor: color });\n }\n elem.addClass('md-ripple-placed md-ripple-scaled');\n if (options.outline) {\n elem.css({\n borderWidth: (size * 0.5) + 'px',\n marginLeft: (size * -0.5) + 'px',\n marginTop: (size * -0.5) + 'px'\n });\n } else {\n elem.css({ left: '50%', top: '50%' });\n }\n updateElement(elem);\n $timeout(function () {\n state.animating = false;\n updateElement(elem);\n }, (options.outline ? 450 : 225), false);\n });\n\n return elem;\n\n /**\n * Creates the ripple element with the provided css\n *\n * @param {object} css properties to be applied\n *\n * @returns {angular.element} the generated ripple element\n */\n function getRippleElement(css) {\n var elem = angular.element('
    ');\n ripples.unshift(elem);\n states.unshift({ animating: true });\n container.append(elem);\n css && elem.css(css);\n return elem;\n }\n\n /**\n * Calculate the ripple size\n *\n * @returns {number} calculated ripple diameter\n */\n function getRippleSize(left, top) {\n var width = container.prop('offsetWidth'),\n height = container.prop('offsetHeight'),\n multiplier, size, rect;\n if (options.isMenuItem) {\n size = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));\n } else if (options.outline) {\n rect = node.getBoundingClientRect();\n left -= rect.left;\n top -= rect.top;\n width = Math.max(left, width - left);\n height = Math.max(top, height - top);\n size = 2 * Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));\n } else {\n multiplier = options.fullRipple ? 1.1 : 0.8;\n size = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)) * multiplier;\n if (options.fitRipple) {\n size = Math.min(height, width, size);\n }\n }\n return size;\n }\n\n /**\n * Generates the ripple css\n *\n * @param {number} the diameter of the ripple\n * @param {number} the left cursor offset\n * @param {number} the top cursor offset\n *\n * @returns {{backgroundColor: string, borderColor: string, width: string, height: string}}\n */\n function getRippleCss(size, left, top) {\n var rect = node.getBoundingClientRect(),\n css = {\n backgroundColor: rgbaToRGB(color),\n borderColor: rgbaToRGB(color),\n width: size + 'px',\n height: size + 'px'\n };\n\n if (options.outline) {\n css.width = 0;\n css.height = 0;\n } else {\n css.marginLeft = css.marginTop = (size * -0.5) + 'px';\n }\n\n if (options.center) {\n css.left = css.top = '50%';\n } else {\n css.left = Math.round((left - rect.left) / container.prop('offsetWidth') * 100) + '%';\n css.top = Math.round((top - rect.top) / container.prop('offsetHeight') * 100) + '%';\n }\n\n return css;\n\n /**\n * Converts rgba string to rgb, removing the alpha value\n *\n * @param {string} rgba color\n *\n * @returns {string} rgb color\n */\n function rgbaToRGB(color) {\n return color.replace('rgba', 'rgb').replace(/,[^\\),]+\\)/, ')');\n }\n }\n }\n\n /**\n * Handles user input start and stop events\n *\n */\n function onPressDown(ev) {\n if (!isRippleAllowed()) return;\n\n createRipple(ev.pointer.x, ev.pointer.y);\n isHeld = true;\n }\n function onPressUp() {\n isHeld = false;\n var ripple = ripples[ ripples.length - 1 ];\n $mdUtil.nextTick(function () { updateElement(ripple); });\n }\n\n /**\n * Determines if the ripple is allowed\n *\n * @returns {boolean} true if the ripple is allowed, false if not\n */\n function isRippleAllowed() {\n var parent = node.parentNode;\n var grandparent = parent && parent.parentNode;\n var ancestor = grandparent && grandparent.parentNode;\n return !isDisabled(node) && !isDisabled(parent) && !isDisabled(grandparent) && !isDisabled(ancestor);\n function isDisabled (elem) {\n return elem && elem.hasAttribute && elem.hasAttribute('disabled');\n }\n }\n\n }\n}\nInkRippleService.$inject = [\"$window\", \"$timeout\", \"$mdUtil\"];\n\n/**\n * noink/nobar/nostretch directive: make any element that has one of\n * these attributes be given a controller, so that other directives can\n * `require:` these and see if there is a `no` parent attribute.\n *\n * @usage\n * \n * \n * \n * \n * \n * \n *\n * \n * myApp.directive('detectNo', function() {\n * return {\n * require: ['^?mdNoInk', ^?mdNoBar'],\n * link: function(scope, element, attr, ctrls) {\n * var noinkCtrl = ctrls[0];\n * var nobarCtrl = ctrls[1];\n * if (noInkCtrl) {\n * alert(\"the md-no-ink flag has been specified on an ancestor!\");\n * }\n * if (nobarCtrl) {\n * alert(\"the md-no-bar flag has been specified on an ancestor!\");\n * }\n * }\n * };\n * });\n * \n */\nfunction attrNoDirective() {\n return function() {\n return {\n controller: angular.noop\n };\n };\n}\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n /**\n * @ngdoc service\n * @name $mdTabInkRipple\n * @module material.core\n *\n * @description\n * Provides ripple effects for md-tabs. See $mdInkRipple service for all possible configuration options.\n *\n * @param {object=} scope Scope within the current context\n * @param {object=} element The element the ripple effect should be applied to\n * @param {object=} options (Optional) Configuration options to override the defaultripple configuration\n */\n\n angular.module('material.core')\n .factory('$mdTabInkRipple', MdTabInkRipple);\n\n function MdTabInkRipple($mdInkRipple) {\n return {\n attach: attach\n };\n\n function attach(scope, element, options) {\n return $mdInkRipple.attach(scope, element, angular.extend({\n center: false,\n dimBackground: true,\n outline: false,\n rippleSize: 'full'\n }, options));\n };\n }\n MdTabInkRipple.$inject = [\"$mdInkRipple\"];;\n})();\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core.theming.palette', [])\n.constant('$mdColorPalette', {\n 'red': {\n '50': '#ffebee',\n '100': '#ffcdd2',\n '200': '#ef9a9a',\n '300': '#e57373',\n '400': '#ef5350',\n '500': '#f44336',\n '600': '#e53935',\n '700': '#d32f2f',\n '800': '#c62828',\n '900': '#b71c1c',\n 'A100': '#ff8a80',\n 'A200': '#ff5252',\n 'A400': '#ff1744',\n 'A700': '#d50000',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 300 400 A100',\n 'contrastStrongLightColors': '500 600 700 A200 A400 A700'\n },\n 'pink': {\n '50': '#fce4ec',\n '100': '#f8bbd0',\n '200': '#f48fb1',\n '300': '#f06292',\n '400': '#ec407a',\n '500': '#e91e63',\n '600': '#d81b60',\n '700': '#c2185b',\n '800': '#ad1457',\n '900': '#880e4f',\n 'A100': '#ff80ab',\n 'A200': '#ff4081',\n 'A400': '#f50057',\n 'A700': '#c51162',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 300 400 A100',\n 'contrastStrongLightColors': '500 600 A200 A400 A700'\n },\n 'purple': {\n '50': '#f3e5f5',\n '100': '#e1bee7',\n '200': '#ce93d8',\n '300': '#ba68c8',\n '400': '#ab47bc',\n '500': '#9c27b0',\n '600': '#8e24aa',\n '700': '#7b1fa2',\n '800': '#6a1b9a',\n '900': '#4a148c',\n 'A100': '#ea80fc',\n 'A200': '#e040fb',\n 'A400': '#d500f9',\n 'A700': '#aa00ff',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 A100',\n 'contrastStrongLightColors': '300 400 A200 A400 A700'\n },\n 'deep-purple': {\n '50': '#ede7f6',\n '100': '#d1c4e9',\n '200': '#b39ddb',\n '300': '#9575cd',\n '400': '#7e57c2',\n '500': '#673ab7',\n '600': '#5e35b1',\n '700': '#512da8',\n '800': '#4527a0',\n '900': '#311b92',\n 'A100': '#b388ff',\n 'A200': '#7c4dff',\n 'A400': '#651fff',\n 'A700': '#6200ea',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 A100',\n 'contrastStrongLightColors': '300 400 A200'\n },\n 'indigo': {\n '50': '#e8eaf6',\n '100': '#c5cae9',\n '200': '#9fa8da',\n '300': '#7986cb',\n '400': '#5c6bc0',\n '500': '#3f51b5',\n '600': '#3949ab',\n '700': '#303f9f',\n '800': '#283593',\n '900': '#1a237e',\n 'A100': '#8c9eff',\n 'A200': '#536dfe',\n 'A400': '#3d5afe',\n 'A700': '#304ffe',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 A100',\n 'contrastStrongLightColors': '300 400 A200 A400'\n },\n 'blue': {\n '50': '#e3f2fd',\n '100': '#bbdefb',\n '200': '#90caf9',\n '300': '#64b5f6',\n '400': '#42a5f5',\n '500': '#2196f3',\n '600': '#1e88e5',\n '700': '#1976d2',\n '800': '#1565c0',\n '900': '#0d47a1',\n 'A100': '#82b1ff',\n 'A200': '#448aff',\n 'A400': '#2979ff',\n 'A700': '#2962ff',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '100 200 300 400 A100',\n 'contrastStrongLightColors': '500 600 700 A200 A400 A700'\n },\n 'light-blue': {\n '50': '#e1f5fe',\n '100': '#b3e5fc',\n '200': '#81d4fa',\n '300': '#4fc3f7',\n '400': '#29b6f6',\n '500': '#03a9f4',\n '600': '#039be5',\n '700': '#0288d1',\n '800': '#0277bd',\n '900': '#01579b',\n 'A100': '#80d8ff',\n 'A200': '#40c4ff',\n 'A400': '#00b0ff',\n 'A700': '#0091ea',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '500 600 700 800 900 A700',\n 'contrastStrongLightColors': '500 600 700 800 A700'\n },\n 'cyan': {\n '50': '#e0f7fa',\n '100': '#b2ebf2',\n '200': '#80deea',\n '300': '#4dd0e1',\n '400': '#26c6da',\n '500': '#00bcd4',\n '600': '#00acc1',\n '700': '#0097a7',\n '800': '#00838f',\n '900': '#006064',\n 'A100': '#84ffff',\n 'A200': '#18ffff',\n 'A400': '#00e5ff',\n 'A700': '#00b8d4',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '500 600 700 800 900',\n 'contrastStrongLightColors': '500 600 700 800'\n },\n 'teal': {\n '50': '#e0f2f1',\n '100': '#b2dfdb',\n '200': '#80cbc4',\n '300': '#4db6ac',\n '400': '#26a69a',\n '500': '#009688',\n '600': '#00897b',\n '700': '#00796b',\n '800': '#00695c',\n '900': '#004d40',\n 'A100': '#a7ffeb',\n 'A200': '#64ffda',\n 'A400': '#1de9b6',\n 'A700': '#00bfa5',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '500 600 700 800 900',\n 'contrastStrongLightColors': '500 600 700'\n },\n 'green': {\n '50': '#e8f5e9',\n '100': '#c8e6c9',\n '200': '#a5d6a7',\n '300': '#81c784',\n '400': '#66bb6a',\n '500': '#4caf50',\n '600': '#43a047',\n '700': '#388e3c',\n '800': '#2e7d32',\n '900': '#1b5e20',\n 'A100': '#b9f6ca',\n 'A200': '#69f0ae',\n 'A400': '#00e676',\n 'A700': '#00c853',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '500 600 700 800 900',\n 'contrastStrongLightColors': '500 600 700'\n },\n 'light-green': {\n '50': '#f1f8e9',\n '100': '#dcedc8',\n '200': '#c5e1a5',\n '300': '#aed581',\n '400': '#9ccc65',\n '500': '#8bc34a',\n '600': '#7cb342',\n '700': '#689f38',\n '800': '#558b2f',\n '900': '#33691e',\n 'A100': '#ccff90',\n 'A200': '#b2ff59',\n 'A400': '#76ff03',\n 'A700': '#64dd17',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '800 900',\n 'contrastStrongLightColors': '800 900'\n },\n 'lime': {\n '50': '#f9fbe7',\n '100': '#f0f4c3',\n '200': '#e6ee9c',\n '300': '#dce775',\n '400': '#d4e157',\n '500': '#cddc39',\n '600': '#c0ca33',\n '700': '#afb42b',\n '800': '#9e9d24',\n '900': '#827717',\n 'A100': '#f4ff81',\n 'A200': '#eeff41',\n 'A400': '#c6ff00',\n 'A700': '#aeea00',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '900',\n 'contrastStrongLightColors': '900'\n },\n 'yellow': {\n '50': '#fffde7',\n '100': '#fff9c4',\n '200': '#fff59d',\n '300': '#fff176',\n '400': '#ffee58',\n '500': '#ffeb3b',\n '600': '#fdd835',\n '700': '#fbc02d',\n '800': '#f9a825',\n '900': '#f57f17',\n 'A100': '#ffff8d',\n 'A200': '#ffff00',\n 'A400': '#ffea00',\n 'A700': '#ffd600',\n 'contrastDefaultColor': 'dark'\n },\n 'amber': {\n '50': '#fff8e1',\n '100': '#ffecb3',\n '200': '#ffe082',\n '300': '#ffd54f',\n '400': '#ffca28',\n '500': '#ffc107',\n '600': '#ffb300',\n '700': '#ffa000',\n '800': '#ff8f00',\n '900': '#ff6f00',\n 'A100': '#ffe57f',\n 'A200': '#ffd740',\n 'A400': '#ffc400',\n 'A700': '#ffab00',\n 'contrastDefaultColor': 'dark'\n },\n 'orange': {\n '50': '#fff3e0',\n '100': '#ffe0b2',\n '200': '#ffcc80',\n '300': '#ffb74d',\n '400': '#ffa726',\n '500': '#ff9800',\n '600': '#fb8c00',\n '700': '#f57c00',\n '800': '#ef6c00',\n '900': '#e65100',\n 'A100': '#ffd180',\n 'A200': '#ffab40',\n 'A400': '#ff9100',\n 'A700': '#ff6d00',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '800 900',\n 'contrastStrongLightColors': '800 900'\n },\n 'deep-orange': {\n '50': '#fbe9e7',\n '100': '#ffccbc',\n '200': '#ffab91',\n '300': '#ff8a65',\n '400': '#ff7043',\n '500': '#ff5722',\n '600': '#f4511e',\n '700': '#e64a19',\n '800': '#d84315',\n '900': '#bf360c',\n 'A100': '#ff9e80',\n 'A200': '#ff6e40',\n 'A400': '#ff3d00',\n 'A700': '#dd2c00',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 300 400 A100 A200',\n 'contrastStrongLightColors': '500 600 700 800 900 A400 A700'\n },\n 'brown': {\n '50': '#efebe9',\n '100': '#d7ccc8',\n '200': '#bcaaa4',\n '300': '#a1887f',\n '400': '#8d6e63',\n '500': '#795548',\n '600': '#6d4c41',\n '700': '#5d4037',\n '800': '#4e342e',\n '900': '#3e2723',\n 'A100': '#d7ccc8',\n 'A200': '#bcaaa4',\n 'A400': '#8d6e63',\n 'A700': '#5d4037',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200',\n 'contrastStrongLightColors': '300 400'\n },\n 'grey': {\n '50': '#fafafa',\n '100': '#f5f5f5',\n '200': '#eeeeee',\n '300': '#e0e0e0',\n '400': '#bdbdbd',\n '500': '#9e9e9e',\n '600': '#757575',\n '700': '#616161',\n '800': '#424242',\n '900': '#212121',\n '1000': '#000000',\n 'A100': '#ffffff',\n 'A200': '#eeeeee',\n 'A400': '#bdbdbd',\n 'A700': '#616161',\n 'contrastDefaultColor': 'dark',\n 'contrastLightColors': '600 700 800 900'\n },\n 'blue-grey': {\n '50': '#eceff1',\n '100': '#cfd8dc',\n '200': '#b0bec5',\n '300': '#90a4ae',\n '400': '#78909c',\n '500': '#607d8b',\n '600': '#546e7a',\n '700': '#455a64',\n '800': '#37474f',\n '900': '#263238',\n 'A100': '#cfd8dc',\n 'A200': '#b0bec5',\n 'A400': '#78909c',\n 'A700': '#455a64',\n 'contrastDefaultColor': 'light',\n 'contrastDarkColors': '50 100 200 300',\n 'contrastStrongLightColors': '400 500'\n }\n});\n\n})();\n(function(){\n\"use strict\";\n\nangular.module('material.core.theming', ['material.core.theming.palette'])\n .directive('mdTheme', ThemingDirective)\n .directive('mdThemable', ThemableDirective)\n .provider('$mdTheming', ThemingProvider)\n .run(generateThemes);\n\n/**\n * @ngdoc provider\n * @name $mdThemingProvider\n * @module material.core\n *\n * @description Provider to configure the `$mdTheming` service.\n */\n\n/**\n * @ngdoc method\n * @name $mdThemingProvider#setDefaultTheme\n * @param {string} themeName Default theme name to be applied to elements. Default value is `default`.\n */\n\n/**\n * @ngdoc method\n * @name $mdThemingProvider#alwaysWatchTheme\n * @param {boolean} watch Whether or not to always watch themes for changes and re-apply\n * classes when they change. Default is `false`. Enabling can reduce performance.\n */\n\n/* Some Example Valid Theming Expressions\n * =======================================\n *\n * Intention group expansion: (valid for primary, accent, warn, background)\n *\n * {{primary-100}} - grab shade 100 from the primary palette\n * {{primary-100-0.7}} - grab shade 100, apply opacity of 0.7\n * {{primary-hue-1}} - grab the shade assigned to hue-1 from the primary palette\n * {{primary-hue-1-0.7}} - apply 0.7 opacity to primary-hue-1\n * {{primary-color}} - Generates .md-hue-1, .md-hue-2, .md-hue-3 with configured shades set for each hue\n * {{primary-color-0.7}} - Apply 0.7 opacity to each of the above rules\n * {{primary-contrast}} - Generates .md-hue-1, .md-hue-2, .md-hue-3 with configured contrast (ie. text) color shades set for each hue\n * {{primary-contrast-0.7}} - Apply 0.7 opacity to each of the above rules\n *\n * Foreground expansion: Applies rgba to black/white foreground text\n *\n * {{foreground-1}} - used for primary text\n * {{foreground-2}} - used for secondary text/divider\n * {{foreground-3}} - used for disabled text\n * {{foreground-4}} - used for dividers\n *\n */\n\n// In memory generated CSS rules; registered by theme.name\nvar GENERATED = { };\n\n// In memory storage of defined themes and color palettes (both loaded by CSS, and user specified)\nvar PALETTES;\nvar THEMES;\n\nvar DARK_FOREGROUND = {\n name: 'dark',\n '1': 'rgba(0,0,0,0.87)',\n '2': 'rgba(0,0,0,0.54)',\n '3': 'rgba(0,0,0,0.26)',\n '4': 'rgba(0,0,0,0.12)'\n};\nvar LIGHT_FOREGROUND = {\n name: 'light',\n '1': 'rgba(255,255,255,1.0)',\n '2': 'rgba(255,255,255,0.7)',\n '3': 'rgba(255,255,255,0.3)',\n '4': 'rgba(255,255,255,0.12)'\n};\n\nvar DARK_SHADOW = '1px 1px 0px rgba(0,0,0,0.4), -1px -1px 0px rgba(0,0,0,0.4)';\nvar LIGHT_SHADOW = '';\n\nvar DARK_CONTRAST_COLOR = colorToRgbaArray('rgba(0,0,0,0.87)');\nvar LIGHT_CONTRAST_COLOR = colorToRgbaArray('rgba(255,255,255,0.87');\nvar STRONG_LIGHT_CONTRAST_COLOR = colorToRgbaArray('rgb(255,255,255)');\n\nvar THEME_COLOR_TYPES = ['primary', 'accent', 'warn', 'background'];\nvar DEFAULT_COLOR_TYPE = 'primary';\n\n// A color in a theme will use these hues by default, if not specified by user.\nvar LIGHT_DEFAULT_HUES = {\n 'accent': {\n 'default': 'A200',\n 'hue-1': 'A100',\n 'hue-2': 'A400',\n 'hue-3': 'A700'\n },\n 'background': {\n 'default': 'A100',\n 'hue-1': '300',\n 'hue-2': '800',\n 'hue-3': '900'\n }\n};\n\nvar DARK_DEFAULT_HUES = {\n 'background': {\n 'default': '800',\n 'hue-1': '300',\n 'hue-2': '600',\n 'hue-3': '900'\n }\n};\nTHEME_COLOR_TYPES.forEach(function(colorType) {\n // Color types with unspecified default hues will use these default hue values\n var defaultDefaultHues = {\n 'default': '500',\n 'hue-1': '300',\n 'hue-2': '800',\n 'hue-3': 'A100'\n };\n if (!LIGHT_DEFAULT_HUES[colorType]) LIGHT_DEFAULT_HUES[colorType] = defaultDefaultHues;\n if (!DARK_DEFAULT_HUES[colorType]) DARK_DEFAULT_HUES[colorType] = defaultDefaultHues;\n});\n\nvar VALID_HUE_VALUES = [\n '50', '100', '200', '300', '400', '500', '600',\n '700', '800', '900', 'A100', 'A200', 'A400', 'A700'\n];\n\nfunction ThemingProvider($mdColorPalette) {\n PALETTES = { };\n THEMES = { };\n\n var themingProvider;\n var defaultTheme = 'default';\n var alwaysWatchTheme = false;\n\n // Load JS Defined Palettes\n angular.extend(PALETTES, $mdColorPalette);\n\n // Default theme defined in core.js\n\n ThemingService.$inject = [\"$rootScope\", \"$log\"];\n return themingProvider = {\n definePalette: definePalette,\n extendPalette: extendPalette,\n theme: registerTheme,\n\n setDefaultTheme: function(theme) {\n defaultTheme = theme;\n },\n alwaysWatchTheme: function(alwaysWatch) {\n alwaysWatchTheme = alwaysWatch;\n },\n $get: ThemingService,\n _LIGHT_DEFAULT_HUES: LIGHT_DEFAULT_HUES,\n _DARK_DEFAULT_HUES: DARK_DEFAULT_HUES,\n _PALETTES: PALETTES,\n _THEMES: THEMES,\n _parseRules: parseRules,\n _rgba: rgba\n };\n\n // Example: $mdThemingProvider.definePalette('neonRed', { 50: '#f5fafa', ... });\n function definePalette(name, map) {\n map = map || {};\n PALETTES[name] = checkPaletteValid(name, map);\n return themingProvider;\n }\n\n // Returns an new object which is a copy of a given palette `name` with variables from\n // `map` overwritten\n // Example: var neonRedMap = $mdThemingProvider.extendPalette('red', { 50: '#f5fafafa' });\n function extendPalette(name, map) {\n return checkPaletteValid(name, angular.extend({}, PALETTES[name] || {}, map) );\n }\n\n // Make sure that palette has all required hues\n function checkPaletteValid(name, map) {\n var missingColors = VALID_HUE_VALUES.filter(function(field) {\n return !map[field];\n });\n if (missingColors.length) {\n throw new Error(\"Missing colors %1 in palette %2!\"\n .replace('%1', missingColors.join(', '))\n .replace('%2', name));\n }\n\n return map;\n }\n\n // Register a theme (which is a collection of color palettes to use with various states\n // ie. warn, accent, primary )\n // Optionally inherit from an existing theme\n // $mdThemingProvider.theme('custom-theme').primaryPalette('red');\n function registerTheme(name, inheritFrom) {\n if (THEMES[name]) return THEMES[name];\n\n inheritFrom = inheritFrom || 'default';\n\n var parentTheme = typeof inheritFrom === 'string' ? THEMES[inheritFrom] : inheritFrom;\n var theme = new Theme(name);\n\n if (parentTheme) {\n angular.forEach(parentTheme.colors, function(color, colorType) {\n theme.colors[colorType] = {\n name: color.name,\n // Make sure a COPY of the hues is given to the child color,\n // not the same reference.\n hues: angular.extend({}, color.hues)\n };\n });\n }\n THEMES[name] = theme;\n\n return theme;\n }\n\n function Theme(name) {\n var self = this;\n self.name = name;\n self.colors = {};\n\n self.dark = setDark;\n setDark(false);\n\n function setDark(isDark) {\n isDark = arguments.length === 0 ? true : !!isDark;\n\n // If no change, abort\n if (isDark === self.isDark) return;\n\n self.isDark = isDark;\n\n self.foregroundPalette = self.isDark ? LIGHT_FOREGROUND : DARK_FOREGROUND;\n self.foregroundShadow = self.isDark ? DARK_SHADOW : LIGHT_SHADOW;\n\n // Light and dark themes have different default hues.\n // Go through each existing color type for this theme, and for every\n // hue value that is still the default hue value from the previous light/dark setting,\n // set it to the default hue value from the new light/dark setting.\n var newDefaultHues = self.isDark ? DARK_DEFAULT_HUES : LIGHT_DEFAULT_HUES;\n var oldDefaultHues = self.isDark ? LIGHT_DEFAULT_HUES : DARK_DEFAULT_HUES;\n angular.forEach(newDefaultHues, function(newDefaults, colorType) {\n var color = self.colors[colorType];\n var oldDefaults = oldDefaultHues[colorType];\n if (color) {\n for (var hueName in color.hues) {\n if (color.hues[hueName] === oldDefaults[hueName]) {\n color.hues[hueName] = newDefaults[hueName];\n }\n }\n }\n });\n\n return self;\n }\n\n THEME_COLOR_TYPES.forEach(function(colorType) {\n var defaultHues = (self.isDark ? DARK_DEFAULT_HUES : LIGHT_DEFAULT_HUES)[colorType];\n self[colorType + 'Palette'] = function setPaletteType(paletteName, hues) {\n var color = self.colors[colorType] = {\n name: paletteName,\n hues: angular.extend({}, defaultHues, hues)\n };\n\n Object.keys(color.hues).forEach(function(name) {\n if (!defaultHues[name]) {\n throw new Error(\"Invalid hue name '%1' in theme %2's %3 color %4. Available hue names: %4\"\n .replace('%1', name)\n .replace('%2', self.name)\n .replace('%3', paletteName)\n .replace('%4', Object.keys(defaultHues).join(', '))\n );\n }\n });\n Object.keys(color.hues).map(function(key) {\n return color.hues[key];\n }).forEach(function(hueValue) {\n if (VALID_HUE_VALUES.indexOf(hueValue) == -1) {\n throw new Error(\"Invalid hue value '%1' in theme %2's %3 color %4. Available hue values: %5\"\n .replace('%1', hueValue)\n .replace('%2', self.name)\n .replace('%3', colorType)\n .replace('%4', paletteName)\n .replace('%5', VALID_HUE_VALUES.join(', '))\n );\n }\n });\n return self;\n };\n\n self[colorType + 'Color'] = function() {\n var args = Array.prototype.slice.call(arguments);\n console.warn('$mdThemingProviderTheme.' + colorType + 'Color() has been deprecated. ' +\n 'Use $mdThemingProviderTheme.' + colorType + 'Palette() instead.');\n return self[colorType + 'Palette'].apply(self, args);\n };\n });\n }\n\n /**\n * @ngdoc service\n * @name $mdTheming\n *\n * @description\n *\n * Service that makes an element apply theming related classes to itself.\n *\n * ```js\n * app.directive('myFancyDirective', function($mdTheming) {\n * return {\n * restrict: 'e',\n * link: function(scope, el, attrs) {\n * $mdTheming(el);\n * }\n * };\n * });\n * ```\n * @param {el=} element to apply theming to\n */\n /* @ngInject */\n function ThemingService($rootScope, $log) {\n\n applyTheme.inherit = function(el, parent) {\n var ctrl = parent.controller('mdTheme');\n\n var attrThemeValue = el.attr('md-theme-watch');\n if ( (alwaysWatchTheme || angular.isDefined(attrThemeValue)) && attrThemeValue != 'false') {\n var deregisterWatch = $rootScope.$watch(function() {\n return ctrl && ctrl.$mdTheme || defaultTheme;\n }, changeTheme);\n el.on('$destroy', deregisterWatch);\n } else {\n var theme = ctrl && ctrl.$mdTheme || defaultTheme;\n changeTheme(theme);\n }\n\n function changeTheme(theme) {\n if (!registered(theme)) {\n $log.warn('Attempted to use unregistered theme \\'' + theme + '\\'. ' +\n 'Register it with $mdThemingProvider.theme().');\n }\n var oldTheme = el.data('$mdThemeName');\n if (oldTheme) el.removeClass('md-' + oldTheme +'-theme');\n el.addClass('md-' + theme + '-theme');\n el.data('$mdThemeName', theme);\n if (ctrl) {\n el.data('$mdThemeController', ctrl);\n }\n }\n };\n\n applyTheme.THEMES = angular.extend({}, THEMES);\n applyTheme.defaultTheme = function() { return defaultTheme; };\n applyTheme.registered = registered;\n\n return applyTheme;\n\n function registered(themeName) {\n if (themeName === undefined || themeName === '') return true;\n return applyTheme.THEMES[themeName] !== undefined;\n }\n\n function applyTheme(scope, el) {\n // Allow us to be invoked via a linking function signature.\n if (el === undefined) {\n el = scope;\n scope = undefined;\n }\n if (scope === undefined) {\n scope = $rootScope;\n }\n applyTheme.inherit(el, el);\n }\n }\n}\nThemingProvider.$inject = [\"$mdColorPalette\"];\n\nfunction ThemingDirective($mdTheming, $interpolate, $log) {\n return {\n priority: 100,\n link: {\n pre: function(scope, el, attrs) {\n var ctrl = {\n $setTheme: function(theme) {\n if (!$mdTheming.registered(theme)) {\n $log.warn('attempted to use unregistered theme \\'' + theme + '\\'');\n }\n ctrl.$mdTheme = theme;\n }\n };\n el.data('$mdThemeController', ctrl);\n ctrl.$setTheme($interpolate(attrs.mdTheme)(scope));\n attrs.$observe('mdTheme', ctrl.$setTheme);\n }\n }\n };\n}\nThemingDirective.$inject = [\"$mdTheming\", \"$interpolate\", \"$log\"];\n\nfunction ThemableDirective($mdTheming) {\n return $mdTheming;\n}\nThemableDirective.$inject = [\"$mdTheming\"];\n\nfunction parseRules(theme, colorType, rules) {\n checkValidPalette(theme, colorType);\n\n rules = rules.replace(/THEME_NAME/g, theme.name);\n var generatedRules = [];\n var color = theme.colors[colorType];\n\n var themeNameRegex = new RegExp('.md-' + theme.name + '-theme', 'g');\n // Matches '{{ primary-color }}', etc\n var hueRegex = new RegExp('(\\'|\")?{{\\\\s*(' + colorType + ')-(color|contrast)-?(\\\\d\\\\.?\\\\d*)?\\\\s*}}(\\\"|\\')?','g');\n var simpleVariableRegex = /'?\"?\\{\\{\\s*([a-zA-Z]+)-(A?\\d+|hue\\-[0-3]|shadow)-?(\\d\\.?\\d*)?\\s*\\}\\}'?\"?/g;\n var palette = PALETTES[color.name];\n\n // find and replace simple variables where we use a specific hue, not an entire palette\n // eg. \"{{primary-100}}\"\n //\\(' + THEME_COLOR_TYPES.join('\\|') + '\\)'\n rules = rules.replace(simpleVariableRegex, function(match, colorType, hue, opacity) {\n if (colorType === 'foreground') {\n if (hue == 'shadow') {\n return theme.foregroundShadow;\n } else {\n return theme.foregroundPalette[hue] || theme.foregroundPalette['1'];\n }\n }\n if (hue.indexOf('hue') === 0) {\n hue = theme.colors[colorType].hues[hue];\n }\n return rgba( (PALETTES[ theme.colors[colorType].name ][hue] || '').value, opacity );\n });\n\n // For each type, generate rules for each hue (ie. default, md-hue-1, md-hue-2, md-hue-3)\n angular.forEach(color.hues, function(hueValue, hueName) {\n var newRule = rules\n .replace(hueRegex, function(match, _, colorType, hueType, opacity) {\n return rgba(palette[hueValue][hueType === 'color' ? 'value' : 'contrast'], opacity);\n });\n if (hueName !== 'default') {\n newRule = newRule.replace(themeNameRegex, '.md-' + theme.name + '-theme.md-' + hueName);\n }\n\n // Don't apply a selector rule to the default theme, making it easier to override\n // styles of the base-component\n if (theme.name == 'default') {\n newRule = newRule.replace(/\\.md-default-theme/g, '');\n }\n generatedRules.push(newRule);\n });\n\n return generatedRules;\n}\n\n// Generate our themes at run time given the state of THEMES and PALETTES\nfunction generateThemes($injector) {\n\n var head = document.getElementsByTagName('head')[0];\n var firstChild = head ? head.firstElementChild : null;\n var themeCss = $injector.has('$MD_THEME_CSS') ? $injector.get('$MD_THEME_CSS') : '';\n\n if ( !firstChild ) return;\n if (themeCss.length === 0) return; // no rules, so no point in running this expensive task\n\n // Expose contrast colors for palettes to ensure that text is always readable\n angular.forEach(PALETTES, sanitizePalette);\n\n // MD_THEME_CSS is a string generated by the build process that includes all the themable\n // components as templates\n\n // Break the CSS into individual rules\n var rulesByType = {};\n var rules = themeCss\n .split(/\\}(?!(\\}|'|\"|;))/)\n .filter(function(rule) { return rule && rule.length; })\n .map(function(rule) { return rule.trim() + '}'; });\n\n\n var ruleMatchRegex = new RegExp('md-(' + THEME_COLOR_TYPES.join('|') + ')', 'g');\n\n THEME_COLOR_TYPES.forEach(function(type) {\n rulesByType[type] = '';\n });\n\n\n // Sort the rules based on type, allowing us to do color substitution on a per-type basis\n rules.forEach(function(rule) {\n var match = rule.match(ruleMatchRegex);\n // First: test that if the rule has '.md-accent', it goes into the accent set of rules\n for (var i = 0, type; type = THEME_COLOR_TYPES[i]; i++) {\n if (rule.indexOf('.md-' + type) > -1) {\n return rulesByType[type] += rule;\n }\n }\n\n // If no eg 'md-accent' class is found, try to just find 'accent' in the rule and guess from\n // there\n for (i = 0; type = THEME_COLOR_TYPES[i]; i++) {\n if (rule.indexOf(type) > -1) {\n return rulesByType[type] += rule;\n }\n }\n\n // Default to the primary array\n return rulesByType[DEFAULT_COLOR_TYPE] += rule;\n });\n\n // For each theme, use the color palettes specified for\n // `primary`, `warn` and `accent` to generate CSS rules.\n\n angular.forEach(THEMES, function(theme) {\n if ( !GENERATED[theme.name] ) {\n\n\n THEME_COLOR_TYPES.forEach(function(colorType) {\n var styleStrings = parseRules(theme, colorType, rulesByType[colorType]);\n while (styleStrings.length) {\n var style = document.createElement('style');\n style.setAttribute('type', 'text/css');\n style.appendChild(document.createTextNode(styleStrings.shift()));\n head.insertBefore(style, firstChild);\n }\n });\n\n\n if (theme.colors.primary.name == theme.colors.accent.name) {\n console.warn(\"$mdThemingProvider: Using the same palette for primary and\" +\n \" accent. This violates the material design spec.\");\n }\n\n GENERATED[theme.name] = true;\n }\n });\n\n\n // *************************\n // Internal functions\n // *************************\n\n // The user specifies a 'default' contrast color as either light or dark,\n // then explicitly lists which hues are the opposite contrast (eg. A100 has dark, A200 has light)\n function sanitizePalette(palette) {\n var defaultContrast = palette.contrastDefaultColor;\n var lightColors = palette.contrastLightColors || [];\n var strongLightColors = palette.contrastStrongLightColors || [];\n var darkColors = palette.contrastDarkColors || [];\n\n // These colors are provided as space-separated lists\n if (typeof lightColors === 'string') lightColors = lightColors.split(' ');\n if (typeof strongLightColors === 'string') strongLightColors = strongLightColors.split(' ');\n if (typeof darkColors === 'string') darkColors = darkColors.split(' ');\n\n // Cleanup after ourselves\n delete palette.contrastDefaultColor;\n delete palette.contrastLightColors;\n delete palette.contrastStrongLightColors;\n delete palette.contrastDarkColors;\n\n // Change { 'A100': '#fffeee' } to { 'A100': { value: '#fffeee', contrast:DARK_CONTRAST_COLOR }\n angular.forEach(palette, function(hueValue, hueName) {\n if (angular.isObject(hueValue)) return; // Already converted\n // Map everything to rgb colors\n var rgbValue = colorToRgbaArray(hueValue);\n if (!rgbValue) {\n throw new Error(\"Color %1, in palette %2's hue %3, is invalid. Hex or rgb(a) color expected.\"\n .replace('%1', hueValue)\n .replace('%2', palette.name)\n .replace('%3', hueName));\n }\n\n palette[hueName] = {\n value: rgbValue,\n contrast: getContrastColor()\n };\n function getContrastColor() {\n if (defaultContrast === 'light') {\n if (darkColors.indexOf(hueName) > -1) {\n return DARK_CONTRAST_COLOR;\n } else {\n return strongLightColors.indexOf(hueName) > -1 ? STRONG_LIGHT_CONTRAST_COLOR\n : LIGHT_CONTRAST_COLOR;\n }\n } else {\n if (lightColors.indexOf(hueName) > -1) {\n return strongLightColors.indexOf(hueName) > -1 ? STRONG_LIGHT_CONTRAST_COLOR\n : LIGHT_CONTRAST_COLOR;\n } else {\n return DARK_CONTRAST_COLOR;\n }\n }\n }\n });\n }\n\n\n}\ngenerateThemes.$inject = [\"$injector\"];\n\nfunction checkValidPalette(theme, colorType) {\n // If theme attempts to use a palette that doesnt exist, throw error\n if (!PALETTES[ (theme.colors[colorType] || {}).name ]) {\n throw new Error(\n \"You supplied an invalid color palette for theme %1's %2 palette. Available palettes: %3\"\n .replace('%1', theme.name)\n .replace('%2', colorType)\n .replace('%3', Object.keys(PALETTES).join(', '))\n );\n }\n}\n\nfunction colorToRgbaArray(clr) {\n if (angular.isArray(clr) && clr.length == 3) return clr;\n if (/^rgb/.test(clr)) {\n return clr.replace(/(^\\s*rgba?\\(|\\)\\s*$)/g, '').split(',').map(function(value, i) {\n return i == 3 ? parseFloat(value, 10) : parseInt(value, 10);\n });\n }\n if (clr.charAt(0) == '#') clr = clr.substring(1);\n if (!/^([a-fA-F0-9]{3}){1,2}$/g.test(clr)) return;\n\n var dig = clr.length / 3;\n var red = clr.substr(0, dig);\n var grn = clr.substr(dig, dig);\n var blu = clr.substr(dig * 2);\n if (dig === 1) {\n red += red;\n grn += grn;\n blu += blu;\n }\n return [parseInt(red, 16), parseInt(grn, 16), parseInt(blu, 16)];\n}\n\nfunction rgba(rgbArray, opacity) {\n if ( !rgbArray ) return \"rgb('0,0,0')\";\n\n if (rgbArray.length == 4) {\n rgbArray = angular.copy(rgbArray);\n opacity ? rgbArray.pop() : opacity = rgbArray.pop();\n }\n return opacity && (typeof opacity == 'number' || (typeof opacity == 'string' && opacity.length)) ?\n 'rgba(' + rgbArray.join(',') + ',' + opacity + ')' :\n 'rgb(' + rgbArray.join(',') + ')';\n}\n\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.autocomplete\n */\n/*\n * @see js folder for autocomplete implementation\n */\nangular.module('material.components.autocomplete', [\n 'material.core',\n 'material.components.icon'\n]);\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.bottomSheet\n * @description\n * BottomSheet\n */\nangular.module('material.components.bottomSheet', [\n 'material.core',\n 'material.components.backdrop'\n])\n .directive('mdBottomSheet', MdBottomSheetDirective)\n .provider('$mdBottomSheet', MdBottomSheetProvider);\n\nfunction MdBottomSheetDirective() {\n return {\n restrict: 'E'\n };\n}\n\n/**\n * @ngdoc service\n * @name $mdBottomSheet\n * @module material.components.bottomSheet\n *\n * @description\n * `$mdBottomSheet` opens a bottom sheet over the app and provides a simple promise API.\n *\n * ## Restrictions\n *\n * - The bottom sheet's template must have an outer `` element.\n * - Add the `md-grid` class to the bottom sheet for a grid layout.\n * - Add the `md-list` class to the bottom sheet for a list layout.\n *\n * @usage\n * \n *
    \n * \n * Open a Bottom Sheet!\n * \n *
    \n *
    \n * \n * var app = angular.module('app', ['ngMaterial']);\n * app.controller('MyController', function($scope, $mdBottomSheet) {\n * $scope.openBottomSheet = function() {\n * $mdBottomSheet.show({\n * template: 'Hello!'\n * });\n * };\n * });\n * \n */\n\n /**\n * @ngdoc method\n * @name $mdBottomSheet#show\n *\n * @description\n * Show a bottom sheet with the specified options.\n *\n * @param {object} options An options object, with the following properties:\n *\n * - `templateUrl` - `{string=}`: The url of an html template file that will\n * be used as the content of the bottom sheet. Restrictions: the template must\n * have an outer `md-bottom-sheet` element.\n * - `template` - `{string=}`: Same as templateUrl, except this is an actual\n * template string.\n * - `scope` - `{object=}`: the scope to link the template / controller to. If none is specified, it will create a new child scope.\n * This scope will be destroyed when the bottom sheet is removed unless `preserveScope` is set to true.\n * - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed. Default is false\n * - `controller` - `{string=}`: The controller to associate with this bottom sheet.\n * - `locals` - `{string=}`: An object containing key/value pairs. The keys will\n * be used as names of values to inject into the controller. For example,\n * `locals: {three: 3}` would inject `three` into the controller with the value\n * of 3.\n * - `targetEvent` - `{DOMClickEvent=}`: A click's event object. When passed in as an option,\n * the location of the click will be used as the starting point for the opening animation\n * of the the dialog.\n * - `resolve` - `{object=}`: Similar to locals, except it takes promises as values\n * and the bottom sheet will not open until the promises resolve.\n * - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope.\n * - `parent` - `{element=}`: The element to append the bottom sheet to. The `parent` may be a `function`, `string`,\n * `object`, or null. Defaults to appending to the body of the root element (or the root element) of the application.\n * e.g. angular.element(document.getElementById('content')) or \"#content\"\n * - `disableParentScroll` - `{boolean=}`: Whether to disable scrolling while the bottom sheet is open.\n * Default true.\n *\n * @returns {promise} A promise that can be resolved with `$mdBottomSheet.hide()` or\n * rejected with `$mdBottomSheet.cancel()`.\n */\n\n/**\n * @ngdoc method\n * @name $mdBottomSheet#hide\n *\n * @description\n * Hide the existing bottom sheet and resolve the promise returned from\n * `$mdBottomSheet.show()`. This call will close the most recently opened/current bottomsheet (if any).\n *\n * @param {*=} response An argument for the resolved promise.\n *\n */\n\n/**\n * @ngdoc method\n * @name $mdBottomSheet#cancel\n *\n * @description\n * Hide the existing bottom sheet and reject the promise returned from\n * `$mdBottomSheet.show()`.\n *\n * @param {*=} response An argument for the rejected promise.\n *\n */\n\nfunction MdBottomSheetProvider($$interimElementProvider) {\n // how fast we need to flick down to close the sheet, pixels/ms\n var CLOSING_VELOCITY = 0.5;\n var PADDING = 80; // same as css\n\n bottomSheetDefaults.$inject = [\"$animate\", \"$mdConstant\", \"$mdUtil\", \"$mdTheming\", \"$mdBottomSheet\", \"$rootElement\", \"$mdGesture\"];\n return $$interimElementProvider('$mdBottomSheet')\n .setDefaults({\n methods: ['disableParentScroll', 'escapeToClose', 'targetEvent'],\n options: bottomSheetDefaults\n });\n\n /* @ngInject */\n function bottomSheetDefaults($animate, $mdConstant, $mdUtil, $mdTheming, $mdBottomSheet, $rootElement, $mdGesture) {\n var backdrop;\n\n return {\n themable: true,\n targetEvent: null,\n onShow: onShow,\n onRemove: onRemove,\n escapeToClose: true,\n disableParentScroll: true\n };\n\n\n function onShow(scope, element, options) {\n\n element = $mdUtil.extractElementByName(element, 'md-bottom-sheet');\n\n // Add a backdrop that will close on click\n backdrop = $mdUtil.createBackdrop(scope, \"md-bottom-sheet-backdrop md-opaque\");\n backdrop.on('click', function() {\n $mdUtil.nextTick($mdBottomSheet.cancel,true);\n });\n $mdTheming.inherit(backdrop, options.parent);\n\n $animate.enter(backdrop, options.parent, null);\n\n var bottomSheet = new BottomSheet(element, options.parent);\n options.bottomSheet = bottomSheet;\n\n // Give up focus on calling item\n options.targetEvent && angular.element(options.targetEvent.target).blur();\n $mdTheming.inherit(bottomSheet.element, options.parent);\n\n if (options.disableParentScroll) {\n options.lastOverflow = options.parent.css('overflow');\n options.parent.css('overflow', 'hidden');\n }\n\n return $animate.enter(bottomSheet.element, options.parent)\n .then(function() {\n var focusable = angular.element(\n element[0].querySelector('button') ||\n element[0].querySelector('a') ||\n element[0].querySelector('[ng-click]')\n );\n focusable.focus();\n\n if (options.escapeToClose) {\n options.rootElementKeyupCallback = function(e) {\n if (e.keyCode === $mdConstant.KEY_CODE.ESCAPE) {\n $mdUtil.nextTick($mdBottomSheet.cancel,true);\n }\n };\n $rootElement.on('keyup', options.rootElementKeyupCallback);\n }\n });\n\n }\n\n function onRemove(scope, element, options) {\n\n var bottomSheet = options.bottomSheet;\n\n $animate.leave(backdrop);\n return $animate.leave(bottomSheet.element).then(function() {\n if (options.disableParentScroll) {\n options.parent.css('overflow', options.lastOverflow);\n delete options.lastOverflow;\n }\n\n bottomSheet.cleanup();\n\n // Restore focus\n options.targetEvent && angular.element(options.targetEvent.target).focus();\n });\n }\n\n /**\n * BottomSheet class to apply bottom-sheet behavior to an element\n */\n function BottomSheet(element, parent) {\n var deregister = $mdGesture.register(parent, 'drag', { horizontal: false });\n parent.on('$md.dragstart', onDragStart)\n .on('$md.drag', onDrag)\n .on('$md.dragend', onDragEnd);\n\n return {\n element: element,\n cleanup: function cleanup() {\n deregister();\n parent.off('$md.dragstart', onDragStart)\n .off('$md.drag', onDrag)\n .off('$md.dragend', onDragEnd);\n }\n };\n\n function onDragStart(ev) {\n // Disable transitions on transform so that it feels fast\n element.css($mdConstant.CSS.TRANSITION_DURATION, '0ms');\n }\n\n function onDrag(ev) {\n var transform = ev.pointer.distanceY;\n if (transform < 5) {\n // Slow down drag when trying to drag up, and stop after PADDING\n transform = Math.max(-PADDING, transform / 2);\n }\n element.css($mdConstant.CSS.TRANSFORM, 'translate3d(0,' + (PADDING + transform) + 'px,0)');\n }\n\n function onDragEnd(ev) {\n if (ev.pointer.distanceY > 0 &&\n (ev.pointer.distanceY > 20 || Math.abs(ev.pointer.velocityY) > CLOSING_VELOCITY)) {\n var distanceRemaining = element.prop('offsetHeight') - ev.pointer.distanceY;\n var transitionDuration = Math.min(distanceRemaining / ev.pointer.velocityY * 0.75, 500);\n element.css($mdConstant.CSS.TRANSITION_DURATION, transitionDuration + 'ms');\n $mdUtil.nextTick($mdBottomSheet.cancel,true);\n } else {\n element.css($mdConstant.CSS.TRANSITION_DURATION, '');\n element.css($mdConstant.CSS.TRANSFORM, '');\n }\n }\n }\n\n }\n\n}\nMdBottomSheetProvider.$inject = [\"$$interimElementProvider\"];\n\n})();\n(function(){\n\"use strict\";\n\n/*\n * @ngdoc module\n * @name material.components.backdrop\n * @description Backdrop\n */\n\n/**\n * @ngdoc directive\n * @name mdBackdrop\n * @module material.components.backdrop\n *\n * @restrict E\n *\n * @description\n * `` is a backdrop element used by other components, such as dialog and bottom sheet.\n * Apply class `opaque` to make the backdrop use the theme backdrop color.\n *\n */\n\nangular\n .module('material.components.backdrop', ['material.core'])\n .directive('mdBackdrop', [\"$mdTheming\", \"$animate\", \"$rootElement\", \"$window\", \"$log\", \"$$rAF\", \"$document\", function BackdropDirective($mdTheming, $animate, $rootElement, $window, $log, $$rAF, $document) {\n var ERROR_CSS_POSITION = \" may not work properly in a scrolled, static-positioned parent container.\";\n\n return {\n restrict: 'E',\n link: postLink\n };\n\n function postLink(scope, element, attrs) {\n\n // If body scrolling has been disabled using mdUtil.disableBodyScroll(),\n // adjust the 'backdrop' height to account for the fixed 'body' top offset\n var body = $window.getComputedStyle($document[0].body);\n if (body.position == 'fixed') {\n var hViewport = parseInt(body.height, 10) + Math.abs(parseInt(body.top, 10));\n element.css({\n height: hViewport + 'px'\n });\n }\n\n // backdrop may be outside the $rootElement, tell ngAnimate to animate regardless\n if ($animate.pin) $animate.pin(element, $rootElement);\n\n $$rAF(function () {\n\n // Often $animate.enter() is used to append the backDrop element\n // so let's wait until $animate is done...\n var parent = element.parent()[0];\n if (parent) {\n var styles = $window.getComputedStyle(parent);\n if (styles.position == 'static') {\n // backdrop uses position:absolute and will not work properly with parent position:static (default)\n $log.warn(ERROR_CSS_POSITION);\n }\n }\n\n $mdTheming.inherit(element, element.parent());\n });\n\n }\n\n }]);\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.card\n *\n * @description\n * Card components.\n */\nangular.module('material.components.card', [\n 'material.core'\n])\n .directive('mdCard', mdCardDirective);\n\n\n\n/**\n * @ngdoc directive\n * @name mdCard\n * @module material.components.card\n *\n * @restrict E\n *\n * @description\n * The `` directive is a container element used within `` containers.\n *\n * An image included as a direct descendant will fill the card's width, while the ``\n * container will wrap text content and provide padding. An `` element can be\n * optionally included to put content flush against the bottom edge of the card.\n *\n * Action buttons can be included in an element with the `.md-actions` class, also used in `md-dialog`.\n * You can then position buttons using layout attributes.\n *\n * Cards have constant width and variable heights; where the maximum height is limited to what can\n * fit within a single view on a platform, but it can temporarily expand as needed.\n *\n * @usage\n * ###Card with optional footer\n * \n * \n * \"image\n * \n *

    Card headline

    \n *

    Card content

    \n *
    \n * \n * Card footer\n * \n *
    \n *
    \n *\n * ###Card with actions\n * \n * \n * \"image\n * \n *

    Card headline

    \n *

    Card content

    \n *
    \n *
    \n * Action 1\n * Action 2\n *
    \n *
    \n *
    \n *\n */\nfunction mdCardDirective($mdTheming) {\n return {\n restrict: 'E',\n link: function($scope, $element, $attr) {\n $mdTheming($element);\n }\n };\n}\nmdCardDirective.$inject = [\"$mdTheming\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.checkbox\n * @description Checkbox module!\n */\nangular\n .module('material.components.checkbox', ['material.core'])\n .directive('mdCheckbox', MdCheckboxDirective);\n\n/**\n * @ngdoc directive\n * @name mdCheckbox\n * @module material.components.checkbox\n * @restrict E\n *\n * @description\n * The checkbox directive is used like the normal [angular checkbox](https://docs.angularjs.org/api/ng/input/input%5Bcheckbox%5D).\n *\n * As per the [material design spec](http://www.google.com/design/spec/style/color.html#color-ui-color-application)\n * the checkbox is in the accent color by default. The primary color palette may be used with\n * the `md-primary` class.\n *\n * @param {string} ng-model Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {expression=} ng-true-value The value to which the expression should be set when selected.\n * @param {expression=} ng-false-value The value to which the expression should be set when not selected.\n * @param {string=} ng-change Angular expression to be executed when input changes due to user interaction with the input element.\n * @param {boolean=} md-no-ink Use of attribute indicates use of ripple ink effects\n * @param {string=} aria-label Adds label to checkbox for accessibility.\n * Defaults to checkbox's text. If no default text is found, a warning will be logged.\n *\n * @usage\n * \n * \n * Finished ?\n * \n *\n * \n * No Ink Effects\n * \n *\n * \n * Disabled\n * \n *\n * \n *\n */\nfunction MdCheckboxDirective(inputDirective, $mdInkRipple, $mdAria, $mdConstant, $mdTheming, $mdUtil, $timeout) {\n inputDirective = inputDirective[0];\n var CHECKED_CSS = 'md-checked';\n\n return {\n restrict: 'E',\n transclude: true,\n require: '?ngModel',\n priority:210, // Run before ngAria\n template: \n '
    ' +\n '
    ' +\n '
    ' +\n '
    ',\n compile: compile\n };\n\n // **********************************************************\n // Private Methods\n // **********************************************************\n\n function compile (tElement, tAttrs) {\n\n tAttrs.type = 'checkbox';\n tAttrs.tabindex = tAttrs.tabindex || '0';\n tElement.attr('role', tAttrs.type);\n\n return function postLink(scope, element, attr, ngModelCtrl) {\n ngModelCtrl = ngModelCtrl || $mdUtil.fakeNgModel();\n $mdTheming(element);\n\n if (attr.ngChecked) {\n scope.$watch(\n scope.$eval.bind(scope, attr.ngChecked),\n ngModelCtrl.$setViewValue.bind(ngModelCtrl)\n );\n }\n $$watchExpr('ngDisabled', 'tabindex', {\n true: '-1',\n false: attr.tabindex\n });\n $mdAria.expectWithText(element, 'aria-label');\n\n // Reuse the original input[type=checkbox] directive from Angular core.\n // This is a bit hacky as we need our own event listener and own render\n // function.\n inputDirective.link.pre(scope, {\n on: angular.noop,\n 0: {}\n }, attr, [ngModelCtrl]);\n\n scope.mouseActive = false;\n element.on('click', listener)\n .on('keypress', keypressHandler)\n .on('mousedown', function() {\n scope.mouseActive = true;\n $timeout(function(){\n scope.mouseActive = false;\n }, 100);\n })\n .on('focus', function() {\n if(scope.mouseActive === false) { element.addClass('md-focused'); }\n })\n .on('blur', function() { element.removeClass('md-focused'); });\n\n ngModelCtrl.$render = render;\n\n function $$watchExpr(expr, htmlAttr, valueOpts) {\n if (attr[expr]) {\n scope.$watch(attr[expr], function(val) {\n if (valueOpts[val]) {\n element.attr(htmlAttr, valueOpts[val]);\n }\n });\n }\n }\n\n function keypressHandler(ev) {\n var keyCode = ev.which || ev.keyCode;\n if (keyCode === $mdConstant.KEY_CODE.SPACE || keyCode === $mdConstant.KEY_CODE.ENTER) {\n ev.preventDefault();\n if (!element.hasClass('md-focused')) { element.addClass('md-focused'); }\n listener(ev);\n }\n }\n function listener(ev) {\n if (element[0].hasAttribute('disabled')) return;\n\n scope.$apply(function() {\n // Toggle the checkbox value...\n var viewValue = attr.ngChecked ? attr.checked : !ngModelCtrl.$viewValue;\n\n ngModelCtrl.$setViewValue( viewValue, ev && ev.type);\n ngModelCtrl.$render();\n });\n }\n\n function render() {\n if(ngModelCtrl.$viewValue) {\n element.addClass(CHECKED_CSS);\n } else {\n element.removeClass(CHECKED_CSS);\n }\n }\n };\n }\n}\nMdCheckboxDirective.$inject = [\"inputDirective\", \"$mdInkRipple\", \"$mdAria\", \"$mdConstant\", \"$mdTheming\", \"$mdUtil\", \"$timeout\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.content\n *\n * @description\n * Scrollable content\n */\nangular.module('material.components.content', [\n 'material.core'\n])\n .directive('mdContent', mdContentDirective);\n\n/**\n * @ngdoc directive\n * @name mdContent\n * @module material.components.content\n *\n * @restrict E\n *\n * @description\n * The `` directive is a container element useful for scrollable content\n *\n * @usage\n *\n * - Add the `[layout-padding]` attribute to make the content padded.\n *\n * \n * \n * Lorem ipsum dolor sit amet, ne quod novum mei.\n * \n * \n *\n */\n\nfunction mdContentDirective($mdTheming) {\n return {\n restrict: 'E',\n controller: ['$scope', '$element', ContentController],\n link: function(scope, element, attr) {\n var node = element[0];\n\n $mdTheming(element);\n scope.$broadcast('$mdContentLoaded', element);\n\n iosScrollFix(element[0]);\n }\n };\n\n function ContentController($scope, $element) {\n this.$scope = $scope;\n this.$element = $element;\n }\n}\nmdContentDirective.$inject = [\"$mdTheming\"];\n\nfunction iosScrollFix(node) {\n // IOS FIX:\n // If we scroll where there is no more room for the webview to scroll,\n // by default the webview itself will scroll up and down, this looks really\n // bad. So if we are scrolling to the very top or bottom, add/subtract one\n angular.element(node).on('$md.pressdown', function(ev) {\n // Only touch events\n if (ev.pointer.type !== 't') return;\n // Don't let a child content's touchstart ruin it for us.\n if (ev.$materialScrollFixed) return;\n ev.$materialScrollFixed = true;\n\n if (node.scrollTop === 0) {\n node.scrollTop = 1;\n } else if (node.scrollHeight === node.scrollTop + node.offsetHeight) {\n node.scrollTop -= 1;\n }\n });\n}\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.button\n * @description\n *\n * Button\n */\nangular\n .module('material.components.button', [ 'material.core' ])\n .directive('mdButton', MdButtonDirective);\n\n/**\n * @ngdoc directive\n * @name mdButton\n * @module material.components.button\n *\n * @restrict E\n *\n * @description\n * `` is a button directive with optional ink ripples (default enabled).\n *\n * If you supply a `href` or `ng-href` attribute, it will become an `` element. Otherwise, it will\n * become a `';\n }\n\n function postLink(scope, element, attr) {\n var node = element[0];\n $mdTheming(element);\n $mdButtonInkRipple.attach(scope, element);\n\n var elementHasText = node.textContent.trim();\n if (!elementHasText) {\n $mdAria.expect(element, 'aria-label');\n }\n\n // For anchor elements, we have to set tabindex manually when the\n // element is disabled\n if (isAnchor(attr) && angular.isDefined(attr.ngDisabled) ) {\n scope.$watch(attr.ngDisabled, function(isDisabled) {\n element.attr('tabindex', isDisabled ? -1 : 0);\n });\n }\n\n // disabling click event when disabled is true\n element.on('click', function(e){\n if (attr.disabled === true) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n });\n\n // restrict focus styles to the keyboard\n scope.mouseActive = false;\n element.on('mousedown', function() {\n scope.mouseActive = true;\n $timeout(function(){\n scope.mouseActive = false;\n }, 100);\n })\n .on('focus', function() {\n if(scope.mouseActive === false) { element.addClass('md-focused'); }\n })\n .on('blur', function() { element.removeClass('md-focused'); });\n }\n\n}\nMdButtonDirective.$inject = [\"$mdButtonInkRipple\", \"$mdTheming\", \"$mdAria\", \"$timeout\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.divider\n * @description Divider module!\n */\nangular.module('material.components.divider', [\n 'material.core'\n])\n .directive('mdDivider', MdDividerDirective);\n\n/**\n * @ngdoc directive\n * @name mdDivider\n * @module material.components.divider\n * @restrict E\n *\n * @description\n * Dividers group and separate content within lists and page layouts using strong visual and spatial distinctions. This divider is a thin rule, lightweight enough to not distract the user from content.\n *\n * @param {boolean=} md-inset Add this attribute to activate the inset divider style.\n * @usage\n * \n * \n *\n * \n * \n *\n */\nfunction MdDividerDirective($mdTheming) {\n return {\n restrict: 'E',\n link: $mdTheming\n };\n}\nMdDividerDirective.$inject = [\"$mdTheming\"];\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.chips\n */\n/*\n * @see js folder for chips implementation\n */\nangular.module('material.components.chips', [\n 'material.core',\n 'material.components.autocomplete'\n]);\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.dialog\n */\nangular.module('material.components.dialog', [\n 'material.core',\n 'material.components.backdrop'\n])\n .directive('mdDialog', MdDialogDirective)\n .provider('$mdDialog', MdDialogProvider);\n\nfunction MdDialogDirective($$rAF, $mdTheming) {\n return {\n restrict: 'E',\n link: function (scope, element, attr) {\n $mdTheming(element);\n $$rAF(function () {\n var images;\n var content = element[0].querySelector('md-dialog-content');\n\n if (content) {\n images = content.getElementsByTagName('img');\n addOverflowClass();\n //-- delayed image loading may impact scroll height, check after images are loaded\n angular.element(images).on('load', addOverflowClass);\n }\n function addOverflowClass() {\n element.toggleClass('md-content-overflow', content.scrollHeight > content.clientHeight);\n }\n });\n }\n };\n}\nMdDialogDirective.$inject = [\"$$rAF\", \"$mdTheming\"];\n\n/**\n * @ngdoc service\n * @name $mdDialog\n * @module material.components.dialog\n *\n * @description\n * `$mdDialog` opens a dialog over the app to inform users about critical information or require\n * them to make decisions. There are two approaches for setup: a simple promise API\n * and regular object syntax.\n *\n * ## Restrictions\n *\n * - The dialog is always given an isolate scope.\n * - The dialog's template must have an outer `` element.\n * Inside, use an `` element for the dialog's content, and use\n * an element with class `md-actions` for the dialog's actions.\n * - Dialogs must cover the entire application to keep interactions inside of them.\n * Use the `parent` option to change where dialogs are appended.\n *\n * ## Sizing\n * - Complex dialogs can be sized with `flex=\"percentage\"`, i.e. `flex=\"66\"`.\n * - Default max-width is 80% of the `rootElement` or `parent`.\n *\n * @usage\n * \n *
    \n *
    \n * \n * Employee Alert!\n * \n *
    \n *
    \n * \n * Custom Dialog\n * \n *
    \n *
    \n * \n * Close Alert\n * \n *
    \n *
    \n * \n * Greet Employee\n * \n *
    \n *
    \n *
    \n *\n * ### JavaScript: object syntax\n * \n * (function(angular, undefined){\n * \"use strict\";\n *\n * angular\n * .module('demoApp', ['ngMaterial'])\n * .controller('AppCtrl', AppController);\n *\n * function AppController($scope, $mdDialog) {\n * var alert;\n * $scope.showAlert = showAlert;\n * $scope.showDialog = showDialog;\n * $scope.items = [1, 2, 3];\n *\n * // Internal method\n * function showAlert() {\n * alert = $mdDialog.alert({\n * title: 'Attention',\n * content: 'This is an example of how easy dialogs can be!',\n * ok: 'Close'\n * });\n *\n * $mdDialog\n * .show( alert )\n * .finally(function() {\n * alert = undefined;\n * });\n * }\n *\n * function showDialog($event) {\n * var parentEl = angular.element(document.body);\n * $mdDialog.show({\n * parent: parentEl,\n * targetEvent: $event,\n * template:\n * '' +\n * ' '+\n * ' '+\n * ' '+\n * '

    Number {{item}}

    ' +\n * ' '+\n * '
    '+\n * '
    ' +\n * '
    ' +\n * ' ' +\n * ' Close Dialog' +\n * ' ' +\n * '
    ' +\n * '
    ',\n * locals: {\n * items: $scope.items\n * },\n * controller: DialogController\n * });\n * function DialogController($scope, $mdDialog, items) {\n * $scope.items = items;\n * $scope.closeDialog = function() {\n * $mdDialog.hide();\n * }\n * }\n * }\n * }\n * })(angular);\n *
    \n *\n * ### JavaScript: promise API syntax, custom dialog template\n * \n * (function(angular, undefined){\n * \"use strict\";\n *\n * angular\n * .module('demoApp', ['ngMaterial'])\n * .controller('EmployeeController', EmployeeEditor)\n * .controller('GreetingController', GreetingController);\n *\n * // Fictitious Employee Editor to show how to use simple and complex dialogs.\n *\n * function EmployeeEditor($scope, $mdDialog) {\n * var alert;\n *\n * $scope.showAlert = showAlert;\n * $scope.closeAlert = closeAlert;\n * $scope.showGreeting = showCustomGreeting;\n *\n * $scope.hasAlert = function() { return !!alert };\n * $scope.userName = $scope.userName || 'Bobby';\n *\n * // Dialog #1 - Show simple alert dialog and cache\n * // reference to dialog instance\n *\n * function showAlert() {\n * alert = $mdDialog.alert()\n * .title('Attention, ' + $scope.userName)\n * .content('This is an example of how easy dialogs can be!')\n * .ok('Close');\n *\n * $mdDialog\n * .show( alert )\n * .finally(function() {\n * alert = undefined;\n * });\n * }\n *\n * // Close the specified dialog instance and resolve with 'finished' flag\n * // Normally this is not needed, just use '$mdDialog.hide()' to close\n * // the most recent dialog popup.\n *\n * function closeAlert() {\n * $mdDialog.hide( alert, \"finished\" );\n * alert = undefined;\n * }\n *\n * // Dialog #2 - Demonstrate more complex dialogs construction and popup.\n *\n * function showCustomGreeting($event) {\n * $mdDialog.show({\n * targetEvent: $event,\n * template:\n * '' +\n *\n * ' Hello {{ employee }}!' +\n *\n * '
    ' +\n * ' ' +\n * ' Close Greeting' +\n * ' ' +\n * '
    ' +\n * '
    ',\n * controller: 'GreetingController',\n * onComplete: afterShowAnimation,\n * locals: { employee: $scope.userName }\n * });\n *\n * // When the 'enter' animation finishes...\n *\n * function afterShowAnimation(scope, element, options) {\n * // post-show code here: DOM element focus, etc.\n * }\n * }\n *\n * // Dialog #3 - Demonstrate use of ControllerAs and passing $scope to dialog\n * // Here we used ng-controller=\"GreetingController as vm\" and\n * // $scope.vm === \n *\n * function showCustomGreeting() {\n *\n * $mdDialog.show({\n * clickOutsideToClose: true,\n *\n * scope: $scope, // use parent scope in template\n * preserveScope: true, // do not forget this if use parent scope\n\n * // Since GreetingController is instantiated with ControllerAs syntax\n * // AND we are passing the parent '$scope' to the dialog, we MUST\n * // use 'vm.' in the template markup\n *\n * template: '' +\n * ' ' +\n * ' Hi There {{vm.employee}}' +\n * ' ' +\n * '',\n *\n * controller: function DialogController($scope, $mdDialog) {\n * $scope.closeDialog = function() {\n * $mdDialog.hide();\n * }\n * }\n * });\n * }\n *\n * }\n *\n * // Greeting controller used with the more complex 'showCustomGreeting()' custom dialog\n *\n * function GreetingController($scope, $mdDialog, employee) {\n * // Assigned from construction locals options...\n * $scope.employee = employee;\n *\n * $scope.closeDialog = function() {\n * // Easily hides most recent dialog shown...\n * // no specific instance reference is needed.\n * $mdDialog.hide();\n * };\n * }\n *\n * })(angular);\n *
    \n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#alert\n *\n * @description\n * Builds a preconfigured dialog with the specified message.\n *\n * @returns {obj} an `$mdDialogPreset` with the chainable configuration methods:\n *\n * - $mdDialogPreset#title(string) - sets title to string\n * - $mdDialogPreset#content(string) - sets content / message to string\n * - $mdDialogPreset#ok(string) - sets okay button text to string\n * - $mdDialogPreset#theme(string) - sets the theme of the dialog\n *\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#confirm\n *\n * @description\n * Builds a preconfigured dialog with the specified message. You can call show and the promise returned\n * will be resolved only if the user clicks the confirm action on the dialog.\n *\n * @returns {obj} an `$mdDialogPreset` with the chainable configuration methods:\n *\n * Additionally, it supports the following methods:\n *\n * - $mdDialogPreset#title(string) - sets title to string\n * - $mdDialogPreset#content(string) - sets content / message to string\n * - $mdDialogPreset#ok(string) - sets okay button text to string\n * - $mdDialogPreset#cancel(string) - sets cancel button text to string\n * - $mdDialogPreset#theme(string) - sets the theme of the dialog\n *\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#show\n *\n * @description\n * Show a dialog with the specified options.\n *\n * @param {object} optionsOrPreset Either provide an `$mdDialogPreset` returned from `alert()`, and\n * `confirm()`, or an options object with the following properties:\n * - `templateUrl` - `{string=}`: The url of a template that will be used as the content\n * of the dialog.\n * - `template` - `{string=}`: Same as templateUrl, except this is an actual template string.\n * - `targetEvent` - `{DOMClickEvent=}`: A click's event object. When passed in as an option,\n * the location of the click will be used as the starting point for the opening animation\n * of the the dialog.\n * - `scope` - `{object=}`: the scope to link the template / controller to. If none is specified,\n * it will create a new isolate scope.\n * This scope will be destroyed when the dialog is removed unless `preserveScope` is set to true.\n * - `preserveScope` - `{boolean=}`: whether to preserve the scope when the element is removed. Default is false\n * - `disableParentScroll` - `{boolean=}`: Whether to disable scrolling while the dialog is open.\n * Default true.\n * - `hasBackdrop` - `{boolean=}`: Whether there should be an opaque backdrop behind the dialog.\n * Default true.\n * - `clickOutsideToClose` - `{boolean=}`: Whether the user can click outside the dialog to\n * close it. Default false.\n * - `escapeToClose` - `{boolean=}`: Whether the user can press escape to close the dialog.\n * Default true.\n * - `focusOnOpen` - `{boolean=}`: An option to override focus behavior on open. Only disable if\n * focusing some other way, as focus management is required for dialogs to be accessible.\n * Defaults to true.\n * - `controller` - `{string=}`: The controller to associate with the dialog. The controller\n * will be injected with the local `$mdDialog`, which passes along a scope for the dialog.\n * - `locals` - `{object=}`: An object containing key/value pairs. The keys will be used as names\n * of values to inject into the controller. For example, `locals: {three: 3}` would inject\n * `three` into the controller, with the value 3. If `bindToController` is true, they will be\n * copied to the controller instead.\n * - `bindToController` - `bool`: bind the locals to the controller, instead of passing them in.\n * These values will not be available until after initialization.\n * - `resolve` - `{object=}`: Similar to locals, except it takes promises as values, and the\n * dialog will not open until all of the promises resolve.\n * - `controllerAs` - `{string=}`: An alias to assign the controller to on the scope.\n * - `parent` - `{element=}`: The element to append the dialog to. Defaults to appending\n * to the root element of the application.\n * - `onComplete` `{function=}`: Callback function used to announce when the show() action is\n * finished.\n * - `onRemoving` `{function=} Callback function used to announce the close/hide() action is\n * starting. This allows developers to run custom animations in parallel the close animations.\n *\n * @returns {promise} A promise that can be resolved with `$mdDialog.hide()` or\n * rejected with `$mdDialog.cancel()`.\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#hide\n *\n * @description\n * Hide an existing dialog and resolve the promise returned from `$mdDialog.show()`.\n *\n * @param {*=} response An argument for the resolved promise.\n *\n * @returns {promise} A promise that is resolved when the dialog has been closed.\n */\n\n/**\n * @ngdoc method\n * @name $mdDialog#cancel\n *\n * @description\n * Hide an existing dialog and reject the promise returned from `$mdDialog.show()`.\n *\n * @param {*=} response An argument for the rejected promise.\n *\n * @returns {promise} A promise that is resolved when the dialog has been closed.\n */\n\nfunction MdDialogProvider($$interimElementProvider) {\n\n advancedDialogOptions.$inject = [\"$mdDialog\", \"$mdTheming\"];\n dialogDefaultOptions.$inject = [\"$mdDialog\", \"$mdAria\", \"$mdUtil\", \"$mdConstant\", \"$animate\", \"$document\", \"$window\", \"$rootElement\"];\n return $$interimElementProvider('$mdDialog')\n .setDefaults({\n methods: ['disableParentScroll', 'hasBackdrop', 'clickOutsideToClose', 'escapeToClose', 'targetEvent', 'parent'],\n options: dialogDefaultOptions\n })\n .addPreset('alert', {\n methods: ['title', 'content', 'ariaLabel', 'ok', 'theme'],\n options: advancedDialogOptions\n })\n .addPreset('confirm', {\n methods: ['title', 'content', 'ariaLabel', 'ok', 'cancel', 'theme'],\n options: advancedDialogOptions\n });\n\n /* @ngInject */\n function advancedDialogOptions($mdDialog, $mdTheming) {\n return {\n template: [\n '',\n ' ',\n '

    {{ dialog.title }}

    ',\n '

    {{ dialog.content }}

    ',\n '
    ',\n '
    ',\n ' ',\n ' {{ dialog.cancel }}',\n ' ',\n ' ',\n ' {{ dialog.ok }}',\n ' ',\n '
    ',\n '
    '\n ].join('').replace(/\\s\\s+/g, ''),\n controller: function mdDialogCtrl() {\n this.hide = function () {\n $mdDialog.hide(true);\n };\n this.abort = function () {\n $mdDialog.cancel();\n };\n },\n controllerAs: 'dialog',\n bindToController: true,\n theme: $mdTheming.defaultTheme()\n };\n }\n\n /* @ngInject */\n function dialogDefaultOptions($mdDialog, $mdAria, $mdUtil, $mdConstant, $animate, $document, $window, $rootElement) {\n return {\n hasBackdrop: true,\n isolateScope: true,\n onShow: onShow,\n onRemove: onRemove,\n clickOutsideToClose: false,\n escapeToClose: true,\n targetEvent: null,\n focusOnOpen: true,\n disableParentScroll: true,\n transformTemplate: function (template) {\n return '
    ' + template + '
    ';\n }\n };\n\n /**\n * Show method for dialogs\n */\n function onShow(scope, element, options) {\n element = $mdUtil.extractElementByName(element, 'md-dialog');\n angular.element($document[0].body).addClass('md-dialog-is-showing');\n\n captureSourceAndParent(element, options);\n configureAria(element.find('md-dialog'), options);\n showBackdrop(scope, element, options);\n\n return dialogPopIn(element, options)\n .then(function () {\n activateListeners(element, options);\n lockScreenReader(element, options);\n focusOnOpen();\n });\n\n /**\n * For alerts, focus on content... otherwise focus on\n * the close button (or equivalent)\n */\n function focusOnOpen() {\n if (options.focusOnOpen) {\n var target = (options.$type === 'alert') ? element.find('md-dialog-content') : findCloseButton();\n target.focus();\n }\n\n function findCloseButton() {\n //If no element with class dialog-close, try to find the last\n //button child in md-actions and assume it is a close button\n var closeButton = element[0].querySelector('.dialog-close');\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n return angular.element(closeButton);\n }\n }\n\n }\n\n /**\n * Remove function for all dialogs\n */\n function onRemove(scope, element, options) {\n options.deactivateListeners();\n options.unlockScreenReader();\n\n options.hideBackdrop();\n\n return dialogPopOut(element, options)\n .finally(function () {\n angular.element($document[0].body).removeClass('md-dialog-is-showing');\n element.remove();\n\n options.origin.focus();\n });\n }\n\n /**\n * Capture originator/trigger element information (if available)\n * and the parent container for the dialog; defaults to the $rootElement\n * unless overridden in the options.parent\n */\n function captureSourceAndParent(element, options) {\n var origin = {element: null, bounds: null, focus: angular.noop};\n options.origin = angular.extend({}, origin, options.origin || {});\n\n var source = angular.element((options.targetEvent || {}).target);\n if (source && source.length) {\n // Compute and save the target element's bounding rect, so that if the\n // element is hidden when the dialog closes, we can shrink the dialog\n // back to the same position it expanded from.\n options.origin.element = source;\n options.origin.bounds = source[0].getBoundingClientRect();\n options.origin.focus = function () {\n source.focus();\n }\n }\n\n // In case the user provides a raw dom element, always wrap it in jqLite\n options.parent = angular.element(options.parent || $rootElement);\n\n if (options.disableParentScroll) {\n options.restoreScroll = $mdUtil.disableScrollAround(element, options.parent);\n }\n }\n\n /**\n * Listen for escape keys and outside clicks to auto close\n */\n function activateListeners(element, options) {\n var removeListeners = [];\n var smartClose = function () {\n // Only 'confirm' dialogs have a cancel button... escape/clickOutside will\n // cancel or fallback to hide.\n var closeFn = ( options.$type == 'alert' ) ? $mdDialog.hide : $mdDialog.cancel;\n\n $mdUtil.nextTick(closeFn, true);\n };\n\n if (options.escapeToClose) {\n var target = options.parent;\n var keyHandlerFn = function (ev) {\n if (ev.keyCode === $mdConstant.KEY_CODE.ESCAPE) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add keyup listeners\n element.on('keyup', keyHandlerFn);\n target.on('keyup', keyHandlerFn);\n\n // Queue remove listeners function\n removeListeners.push(function () {\n element.off('keyup', keyHandlerFn);\n target.off('keyup', keyHandlerFn);\n });\n }\n if (options.clickOutsideToClose) {\n var target = element;\n var clickHandler = function (ev) {\n // Only close if we click the flex container outside on the backdrop\n if (ev.target === target[0]) {\n ev.stopPropagation();\n ev.preventDefault();\n\n smartClose();\n }\n };\n\n // Add click listeners\n target.on('click', clickHandler);\n\n // Queue remove listeners function\n removeListeners.push(function () {\n target.off('click', clickHandler);\n });\n }\n\n // Attach specific `remove` listener handler\n options.deactivateListeners = function () {\n removeListeners.forEach(function (removeFn) {\n removeFn();\n });\n options.deactivateListeners = null;\n };\n }\n\n /**\n * Show modal backdrop element...\n */\n function showBackdrop(scope, element, options) {\n\n if (options.hasBackdrop) {\n options.backdrop = $mdUtil.createBackdrop(scope, \"md-dialog-backdrop md-opaque\");\n $animate.enter(options.backdrop, options.parent);\n }\n\n /**\n * Hide modal backdrop element...\n */\n options.hideBackdrop = function hideBackdrop() {\n if (options.backdrop) {\n $animate.leave(options.backdrop);\n }\n if (options.disableParentScroll) {\n options.restoreScroll();\n }\n\n options.hideBackdrop = null;\n }\n }\n\n /**\n * Inject ARIA-specific attributes appropriate for Dialogs\n */\n function configureAria(element, options) {\n\n var role = (options.$type === 'alert') ? 'alertdialog' : 'dialog';\n var dialogContent = element.find('md-dialog-content');\n var dialogId = element.attr('id') || ('dialog_' + $mdUtil.nextUid());\n\n element.attr({\n 'role': role,\n 'tabIndex': '-1'\n });\n\n if (dialogContent.length === 0) {\n dialogContent = element;\n }\n\n dialogContent.attr('id', dialogId);\n element.attr('aria-describedby', dialogId);\n\n if (options.ariaLabel) {\n $mdAria.expect(element, 'aria-label', options.ariaLabel);\n }\n else {\n $mdAria.expectAsync(element, 'aria-label', function () {\n var words = dialogContent.text().split(/\\s+/);\n if (words.length > 3) words = words.slice(0, 3).concat('...');\n return words.join(' ');\n });\n }\n }\n\n /**\n * Prevents screen reader interaction behind modal window\n * on swipe interfaces\n */\n function lockScreenReader(element, options) {\n var isHidden = true;\n\n // get raw DOM node\n walkDOM(element[0]);\n\n options.unlockScreenReader = function () {\n isHidden = false;\n walkDOM(element[0]);\n\n options.unlockScreenReader = null;\n };\n\n /**\n * Walk DOM to apply or remove aria-hidden on sibling nodes\n * and parent sibling nodes\n *\n */\n function walkDOM(element) {\n while (element.parentNode) {\n if (element === document.body) {\n return;\n }\n var children = element.parentNode.children;\n for (var i = 0; i < children.length; i++) {\n // skip over child if it is an ascendant of the dialog\n // or a script or style tag\n if (element !== children[i] && !isNodeOneOf(children[i], ['SCRIPT', 'STYLE'])) {\n children[i].setAttribute('aria-hidden', isHidden);\n }\n }\n\n walkDOM(element = element.parentNode);\n }\n }\n }\n\n /**\n * Ensure the dialog container fill-stretches to the viewport\n */\n function stretchDialogContainerToViewport(container, options) {\n\n var isFixed = $window.getComputedStyle($document[0].body).position == 'fixed';\n var backdrop = options.backdrop ? $window.getComputedStyle(options.backdrop[0]) : null;\n var height = backdrop ? Math.ceil(Math.abs(parseInt(backdrop.height, 10))) : 0;\n\n container.css({\n top: (isFixed ? $mdUtil.scrollTop(options.parent) / 2 : 0) + 'px',\n height: height ? height + 'px' : '100%'\n });\n\n return container;\n }\n\n /**\n * Dialog open and pop-in animation\n */\n function dialogPopIn(container, options) {\n\n // Add the `md-dialog-container` to the DOM\n options.parent.append(container);\n stretchDialogContainerToViewport(container, options);\n\n var dialogEl = container.find('md-dialog');\n var animator = $mdUtil.dom.animator;\n var buildTranslateToOrigin = animator.calculateZoomToOrigin;\n var translateOptions = {transitionInClass: 'md-transition-in', transitionOutClass: 'md-transition-out'};\n var from = animator.toTransformCss(buildTranslateToOrigin(dialogEl, options.origin));\n var to = animator.toTransformCss(\"\"); // defaults to center display (or parent or $rootElement)\n\n return animator\n .translate3d(dialogEl, from, to, translateOptions)\n .then(function (animateReversal) {\n // Build a reversal translate function synched to this translation...\n options.reverseAnimate = function () {\n\n delete options.reverseAnimate;\n return animateReversal(\n animator.toTransformCss(\n // in case the origin element has moved or is hidden,\n // let's recalculate the translateCSS\n buildTranslateToOrigin(dialogEl, options.origin)\n )\n );\n\n };\n return true;\n });\n }\n\n /**\n * Dialog close and pop-out animation\n */\n function dialogPopOut(container, options) {\n return options.reverseAnimate();\n }\n\n /**\n * Utility function to filter out raw DOM nodes\n */\n function isNodeOneOf(elem, nodeTypeArray) {\n if (nodeTypeArray.indexOf(elem.nodeName) !== -1) {\n return true;\n }\n }\n\n }\n}\nMdDialogProvider.$inject = [\"$$interimElementProvider\"];\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n angular\n // Declare our module\n .module('material.components.fabSpeedDial', [\n 'material.core',\n 'material.components.fabTrigger',\n 'material.components.fabActions'\n ])\n\n // Register our directive\n .directive('mdFabSpeedDial', MdFabSpeedDialDirective)\n\n // Register our custom animations\n .animation('.md-fling', MdFabSpeedDialFlingAnimation)\n .animation('.md-scale', MdFabSpeedDialScaleAnimation)\n\n // Register a service for each animation so that we can easily inject them into unit tests\n .service('mdFabSpeedDialFlingAnimation', MdFabSpeedDialFlingAnimation)\n .service('mdFabSpeedDialScaleAnimation', MdFabSpeedDialScaleAnimation);\n\n /**\n * @ngdoc directive\n * @name mdFabSpeedDial\n * @module material.components.fabSpeedDial\n *\n * @restrict E\n *\n * @description\n * The `` directive is used to present a series of popup elements (usually\n * ``s) for quick access to common actions.\n *\n * There are currently two animations available by applying one of the following classes to\n * the component:\n *\n * - `md-fling` - The speed dial items appear from underneath the trigger and move into their\n * appropriate positions.\n * - `md-scale` - The speed dial items appear in their proper places by scaling from 0% to 100%.\n *\n * @usage\n * \n * \n * \n * \n * \n *\n * \n * \n * \n * \n *\n * \n * \n * \n * \n * \n * \n *\n * @param {string=} md-direction From which direction you would like the speed dial to appear\n * relative to the trigger element.\n * @param {expression=} md-open Programmatically control whether or not the speed-dial is visible.\n */\n function MdFabSpeedDialDirective() {\n FabSpeedDialController.$inject = [\"$scope\", \"$element\", \"$animate\", \"$mdUtil\"];\n return {\n restrict: 'E',\n\n scope: {\n direction: '@?mdDirection',\n isOpen: '=?mdOpen'\n },\n\n bindToController: true,\n controller: FabSpeedDialController,\n controllerAs: 'vm',\n\n link: FabSpeedDialLink\n };\n\n function FabSpeedDialLink(scope, element) {\n // Prepend an element to hold our CSS variables so we can use them in the animations below\n element.prepend('
    ');\n }\n\n function FabSpeedDialController($scope, $element, $animate, $mdUtil) {\n var vm = this;\n\n // Define our open/close functions\n // Note: Used by fabTrigger and fabActions directives\n vm.open = function() {\n // Async eval to avoid conflicts with existing digest loops\n $scope.$evalAsync(\"vm.isOpen = true\");\n };\n\n vm.close = function() {\n // Async eval to avoid conflicts with existing digest loops\n // Only close if we do not currently have mouse focus (since child elements can call this)\n !vm.moused && $scope.$evalAsync(\"vm.isOpen = false\");\n };\n\n vm.mouseenter = function() {\n vm.moused = true;\n vm.open();\n };\n\n vm.mouseleave = function() {\n vm.moused = false;\n vm.close();\n };\n\n setupDefaults();\n setupListeners();\n setupWatchers();\n\n // Fire the animations once in a separate digest loop to initialize them\n $mdUtil.nextTick(function() {\n $animate.addClass($element, 'md-noop');\n });\n\n // Set our default variables\n function setupDefaults() {\n // Set the default direction to 'down' if none is specified\n vm.direction = vm.direction || 'down';\n\n // Set the default to be closed\n vm.isOpen = vm.isOpen || false;\n }\n\n // Setup our event listeners\n function setupListeners() {\n $element.on('mouseenter', vm.mouseenter);\n $element.on('mouseleave', vm.mouseleave);\n }\n\n // Setup our watchers\n function setupWatchers() {\n // Watch for changes to the direction and update classes/attributes\n $scope.$watch('vm.direction', function(newDir, oldDir) {\n // Add the appropriate classes so we can target the direction in the CSS\n $animate.removeClass($element, 'md-' + oldDir);\n $animate.addClass($element, 'md-' + newDir);\n });\n\n\n // Watch for changes to md-open\n $scope.$watch('vm.isOpen', function(isOpen) {\n var toAdd = isOpen ? 'md-is-open' : '';\n var toRemove = isOpen ? '' : 'md-is-open';\n\n $animate.setClass($element, toAdd, toRemove);\n });\n }\n }\n }\n\n function MdFabSpeedDialFlingAnimation() {\n function runAnimation(element) {\n var el = element[0];\n var ctrl = element.controller('mdFabSpeedDial');\n var items = el.querySelectorAll('.md-fab-action-item');\n\n // Grab our element which stores CSS variables\n var variablesElement = el.querySelector('.md-css-variables');\n\n // Setup JS variables based on our CSS variables\n var startZIndex = variablesElement.style.zIndex;\n\n // Always reset the items to their natural position/state\n angular.forEach(items, function(item, index) {\n var styles = item.style;\n\n styles.transform = styles.webkitTransform = '';\n styles.transitionDelay = '';\n styles.opacity = 1;\n\n // Make the items closest to the trigger have the highest z-index\n styles.zIndex = (items.length - index) + startZIndex;\n });\n\n // If the control is closed, hide the items behind the trigger\n if (!ctrl.isOpen) {\n angular.forEach(items, function(item, index) {\n var newPosition, axis;\n var styles = item.style;\n\n switch (ctrl.direction) {\n case 'up':\n newPosition = item.scrollHeight * (index + 1);\n axis = 'Y';\n break;\n case 'down':\n newPosition = -item.scrollHeight * (index + 1);\n axis = 'Y';\n break;\n case 'left':\n newPosition = item.scrollWidth * (index + 1);\n axis = 'X';\n break;\n case 'right':\n newPosition = -item.scrollWidth * (index + 1);\n axis = 'X';\n break;\n }\n\n var newTranslate = 'translate' + axis + '(' + newPosition + 'px)';\n\n styles.transform = styles.webkitTransform = newTranslate;\n });\n }\n }\n\n return {\n addClass: function(element, className, done) {\n if (element.hasClass('md-fling')) {\n runAnimation(element);\n done();\n }\n },\n removeClass: function(element, className, done) {\n runAnimation(element);\n done();\n }\n }\n }\n\n function MdFabSpeedDialScaleAnimation() {\n var delay = 65;\n\n function runAnimation(element) {\n var el = element[0];\n var ctrl = element.controller('mdFabSpeedDial');\n var items = el.querySelectorAll('.md-fab-action-item');\n\n // Always reset the items to their natural position/state\n angular.forEach(items, function(item, index) {\n var styles = item.style,\n offsetDelay = index * delay;\n\n styles.opacity = ctrl.isOpen ? 1 : 0;\n styles.transform = styles.webkitTransform = ctrl.isOpen ? 'scale(1)' : 'scale(0)';\n styles.transitionDelay = (ctrl.isOpen ? offsetDelay : (items.length - offsetDelay)) + 'ms';\n });\n }\n\n return {\n addClass: function(element, className, done) {\n runAnimation(element);\n done();\n },\n\n removeClass: function(element, className, done) {\n runAnimation(element);\n done();\n }\n }\n }\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n angular\n .module('material.components.fabActions', ['material.core'])\n .directive('mdFabActions', MdFabActionsDirective);\n\n /**\n * @ngdoc directive\n * @name mdFabActions\n * @module material.components.fabSpeedDial\n *\n * @restrict E\n *\n * @description\n * The `` directive is used inside of a `` or\n * `` directive to mark the an element (or elements) as the actions and setup the\n * proper event listeners.\n *\n * @usage\n * See the `` or `` directives for example usage.\n */\n function MdFabActionsDirective() {\n return {\n restrict: 'E',\n\n require: ['^?mdFabSpeedDial', '^?mdFabToolbar'],\n\n compile: function(element, attributes) {\n var children = element.children();\n\n // Support both ng-repat and static content\n if (children.attr('ng-repeat')) {\n children.addClass('md-fab-action-item');\n } else {\n // Wrap every child in a new div and add a class that we can scale/fling independently\n children.wrap('
    ');\n }\n\n return function postLink(scope, element, attributes, controllers) {\n // Grab whichever parent controller is used\n var controller = controllers[0] || controllers[1];\n\n // Make the children open/close their parent directive\n if (controller) {\n angular.forEach(element.children(), function(child) {\n // Attach listeners to the `md-fab-action-item`\n child = angular.element(child).children()[0];\n\n angular.element(child).on('focus', controller.open);\n angular.element(child).on('blur', controller.close);\n });\n }\n }\n }\n }\n }\n\n})();\n\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n angular\n // Declare our module\n .module('material.components.fabToolbar', [\n 'material.core',\n 'material.components.fabTrigger',\n 'material.components.fabActions'\n ])\n\n // Register our directive\n .directive('mdFabToolbar', MdFabToolbarDirective)\n\n // Register our custom animations\n .animation('.md-fab-toolbar', MdFabToolbarAnimation)\n\n // Register a service for the animation so that we can easily inject it into unit tests\n .service('mdFabToolbarAnimation', MdFabToolbarAnimation);\n\n /**\n * @ngdoc directive\n * @name mdFabToolbar\n * @module material.components.fabToolbar\n *\n * @restrict E\n *\n * @description\n *\n * The `` directive is used present a toolbar of elements (usually ``s)\n * for quick access to common actions when a floating action button is activated (via hover or\n * keyboard navigation).\n *\n * @usage\n *\n * \n * \n * \n * \n * \n *\n * \n * \n * \n * \n *\n * \n * \n * \n * \n * \n * \n *\n * @param {expression=} md-open Programmatically control whether or not the toolbar is visible.\n */\n function MdFabToolbarDirective() {\n FabToolbarController.$inject = [\"$scope\", \"$element\", \"$animate\"];\n return {\n restrict: 'E',\n transclude: true,\n template:\n '
    ' +\n '
    ' +\n '
    ',\n\n scope: {\n isOpen: '=?mdOpen'\n },\n\n bindToController: true,\n controller: FabToolbarController,\n controllerAs: 'vm',\n\n link: link\n };\n\n function FabToolbarController($scope, $element, $animate) {\n var vm = this;\n\n // Set the default to be closed\n vm.isOpen = vm.isOpen || false;\n\n vm.open = function() {\n vm.isOpen = true;\n $scope.$apply();\n };\n\n vm.close = function() {\n vm.isOpen = false;\n $scope.$apply();\n };\n\n // Add our class so we can trigger the animation on start\n $element.addClass('md-fab-toolbar');\n\n // Setup some mouse events so the hover effect can be triggered\n // anywhere over the toolbar\n $element.on('mouseenter', vm.open);\n $element.on('mouseleave', vm.close);\n\n // Watch for changes to md-open and toggle our class\n $scope.$watch('vm.isOpen', function(isOpen) {\n var toAdd = isOpen ? 'md-is-open' : '';\n var toRemove = isOpen ? '' : 'md-is-open';\n\n $animate.setClass($element, toAdd, toRemove);\n });\n }\n\n function link(scope, element, attributes) {\n // Don't allow focus on the trigger\n element.find('md-fab-trigger').find('button').attr('tabindex', '-1');\n\n // Prepend the background element to the trigger's button\n element.find('md-fab-trigger').find('button')\n .prepend('
    ');\n }\n }\n\n function MdFabToolbarAnimation() {\n var originalIconDelay;\n\n function runAnimation(element, className, done) {\n var el = element[0];\n var ctrl = element.controller('mdFabToolbar');\n\n // Grab the relevant child elements\n var backgroundElement = el.querySelector('.md-fab-toolbar-background');\n var triggerElement = el.querySelector('md-fab-trigger button');\n var iconElement = el.querySelector('md-fab-trigger button md-icon');\n var actions = element.find('md-fab-actions').children();\n\n // If we have both elements, use them to position the new background\n if (triggerElement && backgroundElement) {\n // Get our variables\n var color = window.getComputedStyle(triggerElement).getPropertyValue('background-color');\n var width = el.offsetWidth;\n var height = el.offsetHeight;\n\n // Make a square\n var scale = width * 2;\n\n // Set some basic styles no matter what animation we're doing\n backgroundElement.style.backgroundColor = color;\n backgroundElement.style.borderRadius = width + 'px';\n\n // If we're open\n if (ctrl.isOpen) {\n\n // Set the width/height to take up the full toolbar width\n backgroundElement.style.width = scale + 'px';\n backgroundElement.style.height = scale + 'px';\n\n // Set the top/left to move up/left (or right) by the scale width/height\n backgroundElement.style.top = -(scale / 2) + 'px';\n\n if (element.hasClass('md-left')) {\n backgroundElement.style.left = -(scale / 2) + 'px';\n backgroundElement.style.right = null;\n }\n\n if (element.hasClass('md-right')) {\n backgroundElement.style.right = -(scale / 2) + 'px';\n backgroundElement.style.left = null;\n }\n\n // Set the next close animation to have the proper delays\n backgroundElement.style.transitionDelay = '0ms';\n iconElement && (iconElement.style.transitionDelay = '.3s');\n\n // Apply a transition delay to actions\n angular.forEach(actions, function(action, index) {\n action.style.transitionDelay = (actions.length - index) * 25 + 'ms';\n });\n } else {\n // Otherwise, set the width/height to the trigger's width/height\n backgroundElement.style.width = triggerElement.offsetWidth + 'px';\n backgroundElement.style.height = triggerElement.offsetHeight + 'px';\n\n // Reset the position\n backgroundElement.style.top = '0px';\n\n if (element.hasClass('md-left')) {\n backgroundElement.style.left = '0px';\n backgroundElement.style.right = null;\n }\n\n if (element.hasClass('md-right')) {\n backgroundElement.style.right = '0px';\n backgroundElement.style.left = null;\n }\n\n // Set the next open animation to have the proper delays\n backgroundElement.style.transitionDelay = '200ms';\n iconElement && (iconElement.style.transitionDelay = '0ms');\n\n // Apply a transition delay to actions\n angular.forEach(actions, function(action, index) {\n action.style.transitionDelay = (index * 25) + 'ms';\n });\n }\n }\n }\n\n return {\n addClass: function(element, className, done) {\n runAnimation(element, className, done);\n done();\n },\n\n removeClass: function(element, className, done) {\n runAnimation(element, className, done);\n done();\n }\n }\n }\n})();\n})();\n(function(){\n\"use strict\";\n\n(function() {\n 'use strict';\n\n angular\n .module('material.components.fabTrigger', [ 'material.core' ])\n .directive('mdFabTrigger', MdFabTriggerDirective);\n\n /**\n * @ngdoc directive\n * @name mdFabTrigger\n * @module material.components.fabSpeedDial\n *\n * @restrict E\n *\n * @description\n * The `` directive is used inside of a `` or\n * `` directive to mark the an element (or elements) as the trigger and setup the\n * proper event listeners.\n *\n * @usage\n * See the `` or `` directives for example usage.\n */\n function MdFabTriggerDirective() {\n return {\n restrict: 'E',\n\n require: ['^?mdFabSpeedDial', '^?mdFabToolbar'],\n\n link: function(scope, element, attributes, controllers) {\n // Grab whichever parent controller is used\n var controller = controllers[0] || controllers[1];\n\n // Make the children open/close their parent directive\n if (controller) {\n angular.forEach(element.children(), function(child) {\n angular.element(child).on('focus', controller.open);\n angular.element(child).on('blur', controller.close);\n });\n }\n }\n }\n }\n})();\n\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.gridList\n */\nangular.module('material.components.gridList', ['material.core'])\n .directive('mdGridList', GridListDirective)\n .directive('mdGridTile', GridTileDirective)\n .directive('mdGridTileFooter', GridTileCaptionDirective)\n .directive('mdGridTileHeader', GridTileCaptionDirective)\n .factory('$mdGridLayout', GridLayoutFactory);\n\n/**\n * @ngdoc directive\n * @name mdGridList\n * @module material.components.gridList\n * @restrict E\n * @description\n * Grid lists are an alternative to standard list views. Grid lists are distinct\n * from grids used for layouts and other visual presentations.\n *\n * A grid list is best suited to presenting a homogenous data type, typically\n * images, and is optimized for visual comprehension and differentiating between\n * like data types.\n *\n * A grid list is a continuous element consisting of tessellated, regular\n * subdivisions called cells that contain tiles (`md-grid-tile`).\n *\n * \"Concept\n * \"Grid\n *\n * Cells are arrayed vertically and horizontally within the grid.\n *\n * Tiles hold content and can span one or more cells vertically or horizontally.\n *\n * ### Responsive Attributes\n *\n * The `md-grid-list` directive supports \"responsive\" attributes, which allow\n * different `md-cols`, `md-gutter` and `md-row-height` values depending on the\n * currently matching media query (as defined in `$mdConstant.MEDIA`).\n *\n * In order to set a responsive attribute, first define the fallback value with\n * the standard attribute name, then add additional attributes with the\n * following convention: `{base-attribute-name}-{media-query-name}=\"{value}\"`\n * (ie. `md-cols-lg=\"8\"`)\n *\n * @param {number} md-cols Number of columns in the grid.\n * @param {string} md-row-height One of\n *
      \n *
    • CSS length - Fixed height rows (eg. `8px` or `1rem`)
    • \n *
    • `{width}:{height}` - Ratio of width to height (eg.\n * `md-row-height=\"16:9\"`)
    • \n *
    • `\"fit\"` - Height will be determined by subdividing the available\n * height by the number of rows
    • \n *
    \n * @param {string=} md-gutter The amount of space between tiles in CSS units\n * (default 1px)\n * @param {expression=} md-on-layout Expression to evaluate after layout. Event\n * object is available as `$event`, and contains performance information.\n *\n * @usage\n * Basic:\n * \n * \n * \n * \n * \n *\n * Fixed-height rows:\n * \n * \n * \n * \n * \n *\n * Fit rows:\n * \n * \n * \n * \n * \n *\n * Using responsive attributes:\n * \n * \n * \n * \n * \n */\nfunction GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {\n return {\n restrict: 'E',\n controller: GridListController,\n scope: {\n mdOnLayout: '&'\n },\n link: postLink\n };\n\n function postLink(scope, element, attrs, ctrl) {\n // Apply semantics\n element.attr('role', 'list');\n\n // Provide the controller with a way to trigger layouts.\n ctrl.layoutDelegate = layoutDelegate;\n\n var invalidateLayout = angular.bind(ctrl, ctrl.invalidateLayout),\n unwatchAttrs = watchMedia();\n scope.$on('$destroy', unwatchMedia);\n\n /**\n * Watches for changes in media, invalidating layout as necessary.\n */\n function watchMedia() {\n for (var mediaName in $mdConstant.MEDIA) {\n $mdMedia(mediaName); // initialize\n $mdMedia.getQuery($mdConstant.MEDIA[mediaName])\n .addListener(invalidateLayout);\n }\n return $mdMedia.watchResponsiveAttributes(\n ['md-cols', 'md-row-height'], attrs, layoutIfMediaMatch);\n }\n\n function unwatchMedia() {\n ctrl.layoutDelegate = angular.noop;\n\n unwatchAttrs();\n for (var mediaName in $mdConstant.MEDIA) {\n $mdMedia.getQuery($mdConstant.MEDIA[mediaName])\n .removeListener(invalidateLayout);\n }\n }\n\n /**\n * Performs grid layout if the provided mediaName matches the currently\n * active media type.\n */\n function layoutIfMediaMatch(mediaName) {\n if (mediaName == null) {\n // TODO(shyndman): It would be nice to only layout if we have\n // instances of attributes using this media type\n ctrl.invalidateLayout();\n } else if ($mdMedia(mediaName)) {\n ctrl.invalidateLayout();\n }\n }\n\n var lastLayoutProps;\n\n /**\n * Invokes the layout engine, and uses its results to lay out our\n * tile elements.\n *\n * @param {boolean} tilesInvalidated Whether tiles have been\n * added/removed/moved since the last layout. This is to avoid situations\n * where tiles are replaced with properties identical to their removed\n * counterparts.\n */\n function layoutDelegate(tilesInvalidated) {\n var tiles = getTileElements();\n var props = {\n tileSpans: getTileSpans(tiles),\n colCount: getColumnCount(),\n rowMode: getRowMode(),\n rowHeight: getRowHeight(),\n gutter: getGutter()\n };\n\n if (!tilesInvalidated && angular.equals(props, lastLayoutProps)) {\n return;\n }\n\n var performance =\n $mdGridLayout(props.colCount, props.tileSpans, tiles)\n .map(function(tilePositions, rowCount) {\n return {\n grid: {\n element: element,\n style: getGridStyle(props.colCount, rowCount,\n props.gutter, props.rowMode, props.rowHeight)\n },\n tiles: tilePositions.map(function(ps, i) {\n return {\n element: angular.element(tiles[i]),\n style: getTileStyle(ps.position, ps.spans,\n props.colCount, props.rowCount,\n props.gutter, props.rowMode, props.rowHeight)\n }\n })\n }\n })\n .reflow()\n .performance();\n\n // Report layout\n scope.mdOnLayout({\n $event: {\n performance: performance\n }\n });\n\n lastLayoutProps = props;\n }\n\n // Use $interpolate to do some simple string interpolation as a convenience.\n\n var startSymbol = $interpolate.startSymbol();\n var endSymbol = $interpolate.endSymbol();\n\n // Returns an expression wrapped in the interpolator's start and end symbols.\n function expr(exprStr) {\n return startSymbol + exprStr + endSymbol;\n }\n\n // The amount of space a single 1x1 tile would take up (either width or height), used as\n // a basis for other calculations. This consists of taking the base size percent (as would be\n // if evenly dividing the size between cells), and then subtracting the size of one gutter.\n // However, since there are no gutters on the edges, each tile only uses a fration\n // (gutterShare = numGutters / numCells) of the gutter size. (Imagine having one gutter per\n // tile, and then breaking up the extra gutter on the edge evenly among the cells).\n var UNIT = $interpolate(expr('share') + '% - (' + expr('gutter') + ' * ' + expr('gutterShare') + ')');\n\n // The horizontal or vertical position of a tile, e.g., the 'top' or 'left' property value.\n // The position comes the size of a 1x1 tile plus gutter for each previous tile in the\n // row/column (offset).\n var POSITION = $interpolate('calc((' + expr('unit') + ' + ' + expr('gutter') + ') * ' + expr('offset') + ')');\n\n // The actual size of a tile, e.g., width or height, taking rowSpan or colSpan into account.\n // This is computed by multiplying the base unit by the rowSpan/colSpan, and then adding back\n // in the space that the gutter would normally have used (which was already accounted for in\n // the base unit calculation).\n var DIMENSION = $interpolate('calc((' + expr('unit') + ') * ' + expr('span') + ' + (' + expr('span') + ' - 1) * ' + expr('gutter') + ')');\n\n /**\n * Gets the styles applied to a tile element described by the given parameters.\n * @param {{row: number, col: number}} position The row and column indices of the tile.\n * @param {{row: number, col: number}} spans The rowSpan and colSpan of the tile.\n * @param {number} colCount The number of columns.\n * @param {number} rowCount The number of rows.\n * @param {string} gutter The amount of space between tiles. This will be something like\n * '5px' or '2em'.\n * @param {string} rowMode The row height mode. Can be one of:\n * 'fixed': all rows have a fixed size, given by rowHeight,\n * 'ratio': row height defined as a ratio to width, or\n * 'fit': fit to the grid-list element height, divinding evenly among rows.\n * @param {string|number} rowHeight The height of a row. This is only used for 'fixed' mode and\n * for 'ratio' mode. For 'ratio' mode, this is the *ratio* of width-to-height (e.g., 0.75).\n * @returns {Object} Map of CSS properties to be applied to the style element. Will define\n * values for top, left, width, height, marginTop, and paddingTop.\n */\n function getTileStyle(position, spans, colCount, rowCount, gutter, rowMode, rowHeight) {\n // TODO(shyndman): There are style caching opportunities here.\n\n // Percent of the available horizontal space that one column takes up.\n var hShare = (1 / colCount) * 100;\n\n // Fraction of the gutter size that each column takes up.\n var hGutterShare = (colCount - 1) / colCount;\n\n // Base horizontal size of a column.\n var hUnit = UNIT({share: hShare, gutterShare: hGutterShare, gutter: gutter});\n\n // The width and horizontal position of each tile is always calculated the same way, but the\n // height and vertical position depends on the rowMode.\n var style = {\n left: POSITION({ unit: hUnit, offset: position.col, gutter: gutter }),\n width: DIMENSION({ unit: hUnit, span: spans.col, gutter: gutter }),\n // resets\n paddingTop: '',\n marginTop: '',\n top: '',\n height: ''\n };\n\n switch (rowMode) {\n case 'fixed':\n // In fixed mode, simply use the given rowHeight.\n style.top = POSITION({ unit: rowHeight, offset: position.row, gutter: gutter });\n style.height = DIMENSION({ unit: rowHeight, span: spans.row, gutter: gutter });\n break;\n\n case 'ratio':\n // Percent of the available vertical space that one row takes up. Here, rowHeight holds\n // the ratio value. For example, if the width:height ratio is 4:3, rowHeight = 1.333.\n var vShare = hShare / rowHeight;\n\n // Base veritcal size of a row.\n var vUnit = UNIT({ share: vShare, gutterShare: hGutterShare, gutter: gutter });\n\n // padidngTop and marginTop are used to maintain the given aspect ratio, as\n // a percentage-based value for these properties is applied to the *width* of the\n // containing block. See http://www.w3.org/TR/CSS2/box.html#margin-properties\n style.paddingTop = DIMENSION({ unit: vUnit, span: spans.row, gutter: gutter});\n style.marginTop = POSITION({ unit: vUnit, offset: position.row, gutter: gutter });\n break;\n\n case 'fit':\n // Fraction of the gutter size that each column takes up.\n var vGutterShare = (rowCount - 1) / rowCount;\n\n // Percent of the available vertical space that one row takes up.\n var vShare = (1 / rowCount) * 100;\n\n // Base vertical size of a row.\n var vUnit = UNIT({share: vShare, gutterShare: vGutterShare, gutter: gutter});\n\n style.top = POSITION({unit: vUnit, offset: position.row, gutter: gutter});\n style.height = DIMENSION({unit: vUnit, span: spans.row, gutter: gutter});\n break;\n }\n\n return style;\n }\n\n function getGridStyle(colCount, rowCount, gutter, rowMode, rowHeight) {\n var style = {\n height: '',\n paddingBottom: ''\n };\n\n switch(rowMode) {\n case 'fixed':\n style.height = DIMENSION({ unit: rowHeight, span: rowCount, gutter: gutter });\n break;\n\n case 'ratio':\n // rowHeight is width / height\n var hGutterShare = colCount === 1 ? 0 : (colCount - 1) / colCount,\n hShare = (1 / colCount) * 100,\n vShare = hShare * (1 / rowHeight),\n vUnit = UNIT({ share: vShare, gutterShare: hGutterShare, gutter: gutter });\n\n style.paddingBottom = DIMENSION({ unit: vUnit, span: rowCount, gutter: gutter});\n break;\n\n case 'fit':\n // noop, as the height is user set\n break;\n }\n\n return style;\n }\n\n function getTileElements() {\n return [].filter.call(element.children(), function(ele) {\n return ele.tagName == 'MD-GRID-TILE';\n });\n }\n\n /**\n * Gets an array of objects containing the rowspan and colspan for each tile.\n * @returns {Array<{row: number, col: number}>}\n */\n function getTileSpans(tileElements) {\n return [].map.call(tileElements, function(ele) {\n var ctrl = angular.element(ele).controller('mdGridTile');\n return {\n row: parseInt(\n $mdMedia.getResponsiveAttribute(ctrl.$attrs, 'md-rowspan'), 10) || 1,\n col: parseInt(\n $mdMedia.getResponsiveAttribute(ctrl.$attrs, 'md-colspan'), 10) || 1\n };\n });\n }\n\n function getColumnCount() {\n var colCount = parseInt($mdMedia.getResponsiveAttribute(attrs, 'md-cols'), 10);\n if (isNaN(colCount)) {\n throw 'md-grid-list: md-cols attribute was not found, or contained a non-numeric value';\n }\n return colCount;\n }\n\n function getGutter() {\n return applyDefaultUnit($mdMedia.getResponsiveAttribute(attrs, 'md-gutter') || 1);\n }\n\n function getRowHeight() {\n var rowHeight = $mdMedia.getResponsiveAttribute(attrs, 'md-row-height');\n switch (getRowMode()) {\n case 'fixed':\n return applyDefaultUnit(rowHeight);\n case 'ratio':\n var whRatio = rowHeight.split(':');\n return parseFloat(whRatio[0]) / parseFloat(whRatio[1]);\n case 'fit':\n return 0; // N/A\n }\n }\n\n function getRowMode() {\n var rowHeight = $mdMedia.getResponsiveAttribute(attrs, 'md-row-height');\n if (rowHeight == 'fit') {\n return 'fit';\n } else if (rowHeight.indexOf(':') !== -1) {\n return 'ratio';\n } else {\n return 'fixed';\n }\n }\n\n function applyDefaultUnit(val) {\n return /\\D$/.test(val) ? val : val + 'px';\n }\n }\n}\nGridListDirective.$inject = [\"$interpolate\", \"$mdConstant\", \"$mdGridLayout\", \"$mdMedia\"];\n\n/* @ngInject */\nfunction GridListController($mdUtil) {\n this.layoutInvalidated = false;\n this.tilesInvalidated = false;\n this.$timeout_ = $mdUtil.nextTick;\n this.layoutDelegate = angular.noop;\n}\nGridListController.$inject = [\"$mdUtil\"];\n\nGridListController.prototype = {\n invalidateTiles: function() {\n this.tilesInvalidated = true;\n this.invalidateLayout();\n },\n\n invalidateLayout: function() {\n if (this.layoutInvalidated) {\n return;\n }\n this.layoutInvalidated = true;\n this.$timeout_(angular.bind(this, this.layout));\n },\n\n layout: function() {\n try {\n this.layoutDelegate(this.tilesInvalidated);\n } finally {\n this.layoutInvalidated = false;\n this.tilesInvalidated = false;\n }\n }\n};\n\n\n/* @ngInject */\nfunction GridLayoutFactory($mdUtil) {\n var defaultAnimator = GridTileAnimator;\n\n /**\n * Set the reflow animator callback\n */\n GridLayout.animateWith = function(customAnimator) {\n defaultAnimator = !angular.isFunction(customAnimator) ? GridTileAnimator : customAnimator;\n };\n\n return GridLayout;\n\n /**\n * Publish layout function\n */\n function GridLayout(colCount, tileSpans) {\n var self, layoutInfo, gridStyles, layoutTime, mapTime, reflowTime;\n\n layoutTime = $mdUtil.time(function() {\n layoutInfo = calculateGridFor(colCount, tileSpans);\n });\n\n return self = {\n\n /**\n * An array of objects describing each tile's position in the grid.\n */\n layoutInfo: function() {\n return layoutInfo;\n },\n\n /**\n * Maps grid positioning to an element and a set of styles using the\n * provided updateFn.\n */\n map: function(updateFn) {\n mapTime = $mdUtil.time(function() {\n var info = self.layoutInfo();\n gridStyles = updateFn(info.positioning, info.rowCount);\n });\n return self;\n },\n\n /**\n * Default animator simply sets the element.css( ). An alternate\n * animator can be provided as an argument. The function has the following\n * signature:\n *\n * function({grid: {element: JQLite, style: Object}, tiles: Array<{element: JQLite, style: Object}>)\n */\n reflow: function(animatorFn) {\n reflowTime = $mdUtil.time(function() {\n var animator = animatorFn || defaultAnimator;\n animator(gridStyles.grid, gridStyles.tiles);\n });\n return self;\n },\n\n /**\n * Timing for the most recent layout run.\n */\n performance: function() {\n return {\n tileCount: tileSpans.length,\n layoutTime: layoutTime,\n mapTime: mapTime,\n reflowTime: reflowTime,\n totalTime: layoutTime + mapTime + reflowTime\n };\n }\n };\n }\n\n /**\n * Default Gridlist animator simple sets the css for each element;\n * NOTE: any transitions effects must be manually set in the CSS.\n * e.g.\n *\n * md-grid-tile {\n * transition: all 700ms ease-out 50ms;\n * }\n *\n */\n function GridTileAnimator(grid, tiles) {\n grid.element.css(grid.style);\n tiles.forEach(function(t) {\n t.element.css(t.style);\n })\n }\n\n /**\n * Calculates the positions of tiles.\n *\n * The algorithm works as follows:\n * An Array with length colCount (spaceTracker) keeps track of\n * available tiling positions, where elements of value 0 represents an\n * empty position. Space for a tile is reserved by finding a sequence of\n * 0s with length <= than the tile's colspan. When such a space has been\n * found, the occupied tile positions are incremented by the tile's\n * rowspan value, as these positions have become unavailable for that\n * many rows.\n *\n * If the end of a row has been reached without finding space for the\n * tile, spaceTracker's elements are each decremented by 1 to a minimum\n * of 0. Rows are searched in this fashion until space is found.\n */\n function calculateGridFor(colCount, tileSpans) {\n var curCol = 0,\n curRow = 0,\n spaceTracker = newSpaceTracker();\n\n return {\n positioning: tileSpans.map(function(spans, i) {\n return {\n spans: spans,\n position: reserveSpace(spans, i)\n };\n }),\n rowCount: curRow + Math.max.apply(Math, spaceTracker)\n };\n\n function reserveSpace(spans, i) {\n if (spans.col > colCount) {\n throw 'md-grid-list: Tile at position ' + i + ' has a colspan ' +\n '(' + spans.col + ') that exceeds the column count ' +\n '(' + colCount + ')';\n }\n\n var start = 0,\n end = 0;\n\n // TODO(shyndman): This loop isn't strictly necessary if you can\n // determine the minimum number of rows before a space opens up. To do\n // this, recognize that you've iterated across an entire row looking for\n // space, and if so fast-forward by the minimum rowSpan count. Repeat\n // until the required space opens up.\n while (end - start < spans.col) {\n if (curCol >= colCount) {\n nextRow();\n continue;\n }\n\n start = spaceTracker.indexOf(0, curCol);\n if (start === -1 || (end = findEnd(start + 1)) === -1) {\n start = end = 0;\n nextRow();\n continue;\n }\n\n curCol = end + 1;\n }\n\n adjustRow(start, spans.col, spans.row);\n curCol = start + spans.col;\n\n return {\n col: start,\n row: curRow\n };\n }\n\n function nextRow() {\n curCol = 0;\n curRow++;\n adjustRow(0, colCount, -1); // Decrement row spans by one\n }\n\n function adjustRow(from, cols, by) {\n for (var i = from; i < from + cols; i++) {\n spaceTracker[i] = Math.max(spaceTracker[i] + by, 0);\n }\n }\n\n function findEnd(start) {\n var i;\n for (i = start; i < spaceTracker.length; i++) {\n if (spaceTracker[i] !== 0) {\n return i;\n }\n }\n\n if (i === spaceTracker.length) {\n return i;\n }\n }\n\n function newSpaceTracker() {\n var tracker = [];\n for (var i = 0; i < colCount; i++) {\n tracker.push(0);\n }\n return tracker;\n }\n }\n}\nGridLayoutFactory.$inject = [\"$mdUtil\"];\n\n/**\n * @ngdoc directive\n * @name mdGridTile\n * @module material.components.gridList\n * @restrict E\n * @description\n * Tiles contain the content of an `md-grid-list`. They span one or more grid\n * cells vertically or horizontally, and use `md-grid-tile-{footer,header}` to\n * display secondary content.\n *\n * ### Responsive Attributes\n *\n * The `md-grid-tile` directive supports \"responsive\" attributes, which allow\n * different `md-rowspan` and `md-colspan` values depending on the currently\n * matching media query (as defined in `$mdConstant.MEDIA`).\n *\n * In order to set a responsive attribute, first define the fallback value with\n * the standard attribute name, then add additional attributes with the\n * following convention: `{base-attribute-name}-{media-query-name}=\"{value}\"`\n * (ie. `md-colspan-sm=\"4\"`)\n *\n * @param {number=} md-colspan The number of columns to span (default 1). Cannot\n * exceed the number of columns in the grid. Supports interpolation.\n * @param {number=} md-rowspan The number of rows to span (default 1). Supports\n * interpolation.\n *\n * @usage\n * With header:\n * \n * \n * \n *

    This is a header

    \n *
    \n *
    \n *
    \n *\n * With footer:\n * \n * \n * \n *

    This is a footer

    \n *
    \n *
    \n *
    \n *\n * Spanning multiple rows/columns:\n * \n * \n * \n * \n *\n * Responsive attributes:\n * \n * \n * \n * \n */\nfunction GridTileDirective($mdMedia) {\n return {\n restrict: 'E',\n require: '^mdGridList',\n template: '
    ',\n transclude: true,\n scope: {},\n // Simple controller that exposes attributes to the grid directive\n controller: [\"$attrs\", function($attrs) {\n this.$attrs = $attrs;\n }],\n link: postLink\n };\n\n function postLink(scope, element, attrs, gridCtrl) {\n // Apply semantics\n element.attr('role', 'listitem');\n\n // If our colspan or rowspan changes, trigger a layout\n var unwatchAttrs = $mdMedia.watchResponsiveAttributes(['md-colspan', 'md-rowspan'],\n attrs, angular.bind(gridCtrl, gridCtrl.invalidateLayout));\n\n // Tile registration/deregistration\n gridCtrl.invalidateTiles();\n scope.$on('$destroy', function() {\n unwatchAttrs();\n gridCtrl.invalidateLayout();\n });\n\n if (angular.isDefined(scope.$parent.$index)) {\n scope.$watch(function() { return scope.$parent.$index; },\n function indexChanged(newIdx, oldIdx) {\n if (newIdx === oldIdx) {\n return;\n }\n gridCtrl.invalidateTiles();\n });\n }\n }\n}\nGridTileDirective.$inject = [\"$mdMedia\"];\n\n\nfunction GridTileCaptionDirective() {\n return {\n template: '
    ',\n transclude: true\n };\n}\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.icon\n * @description\n * Icon\n */\nangular.module('material.components.icon', [\n 'material.core'\n ])\n .directive('mdIcon', mdIconDirective);\n\n/**\n * @ngdoc directive\n * @name mdIcon\n * @module material.components.icon\n *\n * @restrict E\n *\n * @description\n * The `md-icon` directive makes it easier to use vector-based icons in your app (as opposed to\n * raster-based icons types like PNG). The directive supports both icon fonts and SVG icons.\n *\n * Icons should be consider view-only elements that should not be used directly as buttons; instead nest a ``\n * inside a `md-button` to add hover and click features.\n *\n * ### Icon fonts\n * Icon fonts are a technique in which you use a font where the glyphs in the font are\n * your icons instead of text. Benefits include a straightforward way to bundle everything into a\n * single HTTP request, simple scaling, easy color changing, and more.\n *\n * `md-icon` let's you consume an icon font by letting you reference specific icons in that font\n * by name rather than character code.\n *\n * ### SVG\n * For SVGs, the problem with using `` or a CSS `background-image` is that you can't take\n * advantage of some SVG features, such as styling specific parts of the icon with CSS or SVG\n * animation.\n *\n * `md-icon` makes it easier to use SVG icons by *inlining* the SVG into an `` element in the\n * document. The most straightforward way of referencing an SVG icon is via URL, just like a\n * traditional ``. `$mdIconProvider`, as a convenience, let's you _name_ an icon so you can\n * reference it by name instead of URL throughout your templates.\n *\n * Additionally, you may not want to make separate HTTP requests for every icon, so you can bundle\n * your SVG icons together and pre-load them with $mdIconProvider as an icon set. An icon set can\n * also be given a name, which acts as a namespace for individual icons, so you can reference them\n * like `\"social:cake\"`.\n *\n * When using SVGs, both external SVGs (via URLs) or sets of SVGs [from icon sets] can be\n * easily loaded and used.When use font-icons, developers must following three (3) simple steps:\n *\n *
      \n *
    1. Load the font library. e.g.
      \n * <link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\"\n * rel=\"stylesheet\">\n *
    2. \n *
    3. Use either (a) font-icon class names or (b) font ligatures to render the font glyph by using its textual name
    4. \n *
    5. Use <md-icon md-font-icon=\"classname\" /> or
      \n * use <md-icon md-font-set=\"font library classname or alias\"> textual_name </md-icon> or
      \n * use <md-icon md-font-set=\"font library classname or alias\"> numerical_character_reference </md-icon>\n *
    6. \n *
    \n *\n * Full details for these steps can be found:\n *\n *
      \n *
    • http://google.github.io/material-design-icons/
    • \n *
    • http://google.github.io/material-design-icons/#icon-font-for-the-web
    • \n *
    \n *\n * The Material Design icon style .material-icons and the icon font references are published in\n * Material Design Icons:\n *\n *
      \n *
    • http://www.google.com/design/icons/
    • \n *
    • https://www.google.com/design/icons/#ic_accessibility
    • \n *
    \n *\n *

    Material Design Icons

    \n * Using the Material Design Icon-Selector, developers can easily and quickly search for a Material Design font-icon and\n * determine its textual name and character reference code. Click on any icon to see the slide-up information\n * panel with details regarding a SVG download or information on the font-icon usage.\n *\n * \n * \n * \n *\n * \n * Click on the image above to link to the\n * Material Design Icon-Selector.\n * \n *\n * @param {string} md-font-icon String name of CSS icon associated with the font-face will be used\n * to render the icon. Requires the fonts and the named CSS styles to be preloaded.\n * @param {string} md-font-set CSS style name associated with the font library; which will be assigned as\n * the class for the font-icon ligature. This value may also be an alias that is used to lookup the classname;\n * internally use `$mdIconProvider.fontSet()` to determine the style name.\n * @param {string} md-svg-src String URL (or expression) used to load, cache, and display an\n * external SVG.\n * @param {string} md-svg-icon md-svg-icon String name used for lookup of the icon from the internal cache;\n * interpolated strings or expressions may also be used. Specific set names can be used with\n * the syntax `:`.

    \n * To use icon sets, developers are required to pre-register the sets using the `$mdIconProvider` service.\n * @param {string=} aria-label Labels icon for accessibility. If an empty string is provided, icon\n * will be hidden from accessibility layer with `aria-hidden=\"true\"`. If there's no aria-label on the icon\n * nor a label on the parent element, a warning will be logged to the console.\n * @param {string=} alt Labels icon for accessibility. If an empty string is provided, icon\n * will be hidden from accessibility layer with `aria-hidden=\"true\"`. If there's no alt on the icon\n * nor a label on the parent element, a warning will be logged to the console. *\n * @usage\n * When using SVGs:\n * \n *\n * \n * \n *\n * \n * \n * \n *\n * \n *\n * Use the $mdIconProvider to configure your application with\n * svg iconsets.\n *\n * \n * angular.module('appSvgIconSets', ['ngMaterial'])\n * .controller('DemoCtrl', function($scope) {})\n * .config(function($mdIconProvider) {\n * $mdIconProvider\n * .iconSet('social', 'img/icons/sets/social-icons.svg', 24)\n * .defaultIconSet('img/icons/sets/core-icons.svg', 24);\n * });\n * \n *\n *\n * When using Font Icons with classnames:\n * \n *\n * \n * \n *\n * \n *\n * When using Material Font Icons with ligatures:\n * \n * \n * \n * face \n * face \n * #xE87C; \n * \n * face \n * \n *\n * When using other Font-Icon libraries:\n *\n * \n * // Specify a font-icon style alias\n * angular.config(function($mdIconProvider) {\n * $mdIconProvider.fontSet('fa', 'fontawesome');\n * });\n * \n *\n * \n * email\n * \n *\n */\nfunction mdIconDirective($mdIcon, $mdTheming, $mdAria ) {\n\n return {\n scope: {\n fontSet : '@mdFontSet',\n fontIcon: '@mdFontIcon',\n svgIcon : '@mdSvgIcon',\n svgSrc : '@mdSvgSrc'\n },\n restrict: 'E',\n link : postLink\n };\n\n\n /**\n * Directive postLink\n * Supports embedded SVGs, font-icons, & external SVGs\n */\n function postLink(scope, element, attr) {\n $mdTheming(element);\n\n prepareForFontIcon();\n\n // If using a font-icon, then the textual name of the icon itself\n // provides the aria-label.\n\n var label = attr.alt || scope.fontIcon || scope.svgIcon || element.text();\n var attrName = attr.$normalize(attr.$attr.mdSvgIcon || attr.$attr.mdSvgSrc || '');\n\n if ( !attr['aria-label'] ) {\n\n if (label != '' && !parentsHaveText() ) {\n\n $mdAria.expect(element, 'aria-label', label);\n $mdAria.expect(element, 'role', 'img');\n\n } else if ( !element.text() ) {\n // If not a font-icon with ligature, then\n // hide from the accessibility layer.\n\n $mdAria.expect(element, 'aria-hidden', 'true');\n }\n }\n\n if (attrName) {\n // Use either pre-configured SVG or URL source, respectively.\n attr.$observe(attrName, function(attrVal) {\n\n element.empty();\n if (attrVal) {\n $mdIcon(attrVal).then(function(svg) {\n element.append(svg);\n });\n }\n\n });\n }\n\n function parentsHaveText() {\n var parent = element.parent();\n if (parent.attr('aria-label') || parent.text()) {\n return true;\n }\n else if(parent.parent().attr('aria-label') || parent.parent().text()) {\n return true;\n }\n return false;\n }\n\n function prepareForFontIcon () {\n if (!scope.svgIcon && !scope.svgSrc) {\n\n if (scope.fontIcon) {\n element.addClass('md-font ' + scope.fontIcon);\n }\n\n if (scope.fontSet) {\n element.addClass($mdIcon.fontSet(scope.fontSet));\n }\n\n if (shouldUseDefaultFontSet()) {\n element.addClass($mdIcon.fontSet());\n }\n\n }\n\n function shouldUseDefaultFontSet() {\n return !scope.fontIcon && !scope.fontSet && !attr.hasOwnProperty('class');\n }\n }\n }\n}\nmdIconDirective.$inject = [\"$mdIcon\", \"$mdTheming\", \"$mdAria\"];\n\n})();\n(function(){\n\"use strict\";\n\n angular\n .module('material.components.icon' )\n .provider('$mdIcon', MdIconProvider);\n\n /**\n * @ngdoc service\n * @name $mdIconProvider\n * @module material.components.icon\n *\n * @description\n * `$mdIconProvider` is used only to register icon IDs with URLs. These configuration features allow\n * icons and icon sets to be pre-registered and associated with source URLs **before** the ``\n * directives are compiled.\n *\n * If using font-icons, the developer is repsonsible for loading the fonts.\n *\n * If using SVGs, loading of the actual svg files are deferred to on-demand requests and are loaded\n * internally by the `$mdIcon` service using the `$http` service. When an SVG is requested by name/ID,\n * the `$mdIcon` service searches its registry for the associated source URL;\n * that URL is used to on-demand load and parse the SVG dynamically.\n *\n * @usage\n * \n * app.config(function($mdIconProvider) {\n *\n * // Configure URLs for icons specified by [set:]id.\n *\n * $mdIconProvider\n * .defaultFontSet( 'fontawesome' )\n * .defaultIconSet('my/app/icons.svg') // Register a default set of SVG icons\n * .iconSet('social', 'my/app/social.svg') // Register a named icon set of SVGs\n * .icon('android', 'my/app/android.svg') // Register a specific icon (by name)\n * .icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set\n * });\n * \n *\n * SVG icons and icon sets can be easily pre-loaded and cached using either (a) a build process or (b) a runtime\n * **startup** process (shown below):\n *\n * \n * app.config(function($mdIconProvider) {\n *\n * // Register a default set of SVG icon definitions\n * $mdIconProvider.defaultIconSet('my/app/icons.svg')\n *\n * })\n * .run(function($http, $templateCache){\n *\n * // Pre-fetch icons sources by URL and cache in the $templateCache...\n * // subsequent $http calls will look there first.\n *\n * var urls = [ 'imy/app/icons.svg', 'img/icons/android.svg'];\n *\n * angular.forEach(urls, function(url) {\n * $http.get(url, {cache: $templateCache});\n * });\n *\n * });\n *\n * \n *\n * NOTE: the loaded SVG data is subsequently cached internally for future requests.\n *\n */\n\n /**\n * @ngdoc method\n * @name $mdIconProvider#icon\n *\n * @description\n * Register a source URL for a specific icon name; the name may include optional 'icon set' name prefix.\n * These icons will later be retrieved from the cache using `$mdIcon( )`\n *\n * @param {string} id Icon name/id used to register the icon\n * @param {string} url specifies the external location for the data file. Used internally by `$http` to load the\n * data or as part of the lookup in `$templateCache` if pre-loading was configured.\n * @param {number=} viewBoxSize Sets the width and height the icon's viewBox.\n * It is ignored for icons with an existing viewBox. Default size is 24.\n *\n * @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n * @usage\n * \n * app.config(function($mdIconProvider) {\n *\n * // Configure URLs for icons specified by [set:]id.\n *\n * $mdIconProvider\n * .icon('android', 'my/app/android.svg') // Register a specific icon (by name)\n * .icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set\n * });\n * \n *\n */\n /**\n * @ngdoc method\n * @name $mdIconProvider#iconSet\n *\n * @description\n * Register a source URL for a 'named' set of icons; group of SVG definitions where each definition\n * has an icon id. Individual icons can be subsequently retrieved from this cached set using\n * `$mdIcon(:)`\n *\n * @param {string} id Icon name/id used to register the iconset\n * @param {string} url specifies the external location for the data file. Used internally by `$http` to load the\n * data or as part of the lookup in `$templateCache` if pre-loading was configured.\n * @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set. \n * It is ignored for icons with an existing viewBox. All icons in the icon set should be the same size.\n * Default value is 24.\n *\n * @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n *\n * @usage\n * \n * app.config(function($mdIconProvider) {\n *\n * // Configure URLs for icons specified by [set:]id.\n *\n * $mdIconProvider\n * .iconSet('social', 'my/app/social.svg') // Register a named icon set\n * });\n * \n *\n */\n /**\n * @ngdoc method\n * @name $mdIconProvider#defaultIconSet\n *\n * @description\n * Register a source URL for the default 'named' set of icons. Unless explicitly registered,\n * subsequent lookups of icons will failover to search this 'default' icon set.\n * Icon can be retrieved from this cached, default set using `$mdIcon()`\n *\n * @param {string} url specifies the external location for the data file. Used internally by `$http` to load the\n * data or as part of the lookup in `$templateCache` if pre-loading was configured.\n * @param {number=} viewBoxSize Sets the width and height of the viewBox of all icons in the set. \n * It is ignored for icons with an existing viewBox. All icons in the icon set should be the same size.\n * Default value is 24.\n *\n * @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n * @usage\n * \n * app.config(function($mdIconProvider) {\n *\n * // Configure URLs for icons specified by [set:]id.\n *\n * $mdIconProvider\n * .defaultIconSet( 'my/app/social.svg' ) // Register a default icon set\n * });\n * \n *\n */\n /**\n * @ngdoc method\n * @name $mdIconProvider#defaultFontSet\n *\n * @description\n * When using Font-Icons, Angular Material assumes the the Material Design icons will be used and automatically\n * configures the default font-set == 'material-icons'. Note that the font-set references the font-icon library\n * class style that should be applied to the ``.\n *\n * Configuring the default means that the attributes\n * `md-font-set=\"material-icons\"` or `class=\"material-icons\"` do not need to be explicitly declared on the\n * `` markup. For example:\n *\n * ` face `\n * will render as\n * ` face `, and\n *\n * ` face `\n * will render as\n * ` face `\n *\n * @param {string} name of the font-library style that should be applied to the md-icon DOM element\n *\n * @usage\n * \n * app.config(function($mdIconProvider) {\n * $mdIconProvider.defaultFontSet( 'fontawesome' );\n * });\n * \n *\n */\n\n /**\n * @ngdoc method\n * @name $mdIconProvider#defaultViewBoxSize\n *\n * @description\n * While `` markup can also be style with sizing CSS, this method configures\n * the default width **and** height used for all icons; unless overridden by specific CSS.\n * The default sizing is (24px, 24px).\n * @param {number=} viewBoxSize Sets the width and height of the viewBox for an icon or an icon set.\n * All icons in a set should be the same size. The default value is 24.\n *\n * @returns {obj} an `$mdIconProvider` reference; used to support method call chains for the API\n *\n * @usage\n * \n * app.config(function($mdIconProvider) {\n *\n * // Configure URLs for icons specified by [set:]id.\n *\n * $mdIconProvider\n * .defaultViewBoxSize(36) // Register a default icon size (width == height)\n * });\n * \n *\n */\n\n var config = {\n defaultViewBoxSize: 24,\n defaultFontSet: 'material-icons',\n fontSets : [ ]\n };\n\n function MdIconProvider() { }\n\n MdIconProvider.prototype = {\n icon : function (id, url, viewBoxSize) {\n if ( id.indexOf(':') == -1 ) id = '$default:' + id;\n\n config[id] = new ConfigurationItem(url, viewBoxSize );\n return this;\n },\n\n iconSet : function (id, url, viewBoxSize) {\n config[id] = new ConfigurationItem(url, viewBoxSize );\n return this;\n },\n\n defaultIconSet : function (url, viewBoxSize) {\n var setName = '$default';\n\n if ( !config[setName] ) {\n config[setName] = new ConfigurationItem(url, viewBoxSize );\n }\n\n config[setName].viewBoxSize = viewBoxSize || config.defaultViewBoxSize;\n\n return this;\n },\n\n defaultViewBoxSize : function (viewBoxSize) {\n config.defaultViewBoxSize = viewBoxSize;\n return this;\n },\n \n /**\n * Register an alias name associated with a font-icon library style ;\n */\n fontSet : function fontSet(alias, className) {\n config.fontSets.push({\n alias : alias,\n fontSet : className || alias\n });\n return this;\n },\n\n /**\n * Specify a default style name associated with a font-icon library\n * fallback to Material Icons.\n *\n */\n defaultFontSet : function defaultFontSet(className) {\n config.defaultFontSet = !className ? '' : className;\n return this;\n },\n\n defaultIconSize : function defaultIconSize(iconSize) {\n config.defaultIconSize = iconSize;\n return this;\n },\n\n preloadIcons: function ($templateCache) {\n var iconProvider = this;\n var svgRegistry = [\n {\n id : 'md-tabs-arrow',\n url: 'md-tabs-arrow.svg',\n svg: ''\n },\n {\n id : 'md-close',\n url: 'md-close.svg',\n svg: ''\n },\n {\n id: 'md-cancel',\n url: 'md-cancel.svg',\n svg: ''\n },\n {\n id: 'md-menu',\n url: 'md-menu.svg',\n svg: ''\n },\n {\n id: 'md-toggle-arrow',\n url: 'md-toggle-arrow-svg',\n svg: ''\n }\n ];\n\n svgRegistry.forEach(function(asset){\n iconProvider.icon(asset.id, asset.url);\n $templateCache.put(asset.url, asset.svg);\n });\n\n },\n\n $get : ['$http', '$q', '$log', '$templateCache', function($http, $q, $log, $templateCache) {\n this.preloadIcons($templateCache);\n return MdIconService(config, $http, $q, $log, $templateCache);\n }]\n };\n\n /**\n * Configuration item stored in the Icon registry; used for lookups\n * to load if not already cached in the `loaded` cache\n */\n function ConfigurationItem(url, viewBoxSize) {\n this.url = url;\n this.viewBoxSize = viewBoxSize || config.defaultViewBoxSize;\n }\n\n /**\n * @ngdoc service\n * @name $mdIcon\n * @module material.components.icon\n *\n * @description\n * The `$mdIcon` service is a function used to lookup SVG icons.\n *\n * @param {string} id Query value for a unique Id or URL. If the argument is a URL, then the service will retrieve the icon element\n * from its internal cache or load the icon and cache it first. If the value is not a URL-type string, then an ID lookup is\n * performed. The Id may be a unique icon ID or may include an iconSet ID prefix.\n *\n * For the **id** query to work properly, this means that all id-to-URL mappings must have been previously configured\n * using the `$mdIconProvider`.\n *\n * @returns {obj} Clone of the initial SVG DOM element; which was created from the SVG markup in the SVG data file.\n *\n * @usage\n * \n * function SomeDirective($mdIcon) {\n *\n * // See if the icon has already been loaded, if not\n * // then lookup the icon from the registry cache, load and cache\n * // it for future requests.\n * // NOTE: ID queries require configuration with $mdIconProvider\n *\n * $mdIcon('android').then(function(iconEl) { element.append(iconEl); });\n * $mdIcon('work:chair').then(function(iconEl) { element.append(iconEl); });\n *\n * // Load and cache the external SVG using a URL\n *\n * $mdIcon('img/icons/android.svg').then(function(iconEl) {\n * element.append(iconEl);\n * });\n * };\n * \n *\n * NOTE: The ` ` directive internally uses the `$mdIcon` service to query, loaded, and instantiate\n * SVG DOM elements.\n */\n function MdIconService(config, $http, $q, $log, $templateCache) {\n var iconCache = {};\n var urlRegex = /[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:%_\\+.~#?&//=]*)?/i;\n\n Icon.prototype = { clone : cloneSVG, prepare: prepareAndStyle };\n getIcon.fontSet = findRegisteredFontSet;\n\n // Publish service...\n return getIcon;\n\n /**\n * Actual $mdIcon service is essentially a lookup function\n */\n function getIcon(id) {\n id = id || '';\n\n // If already loaded and cached, use a clone of the cached icon.\n // Otherwise either load by URL, or lookup in the registry and then load by URL, and cache.\n\n if ( iconCache[id] ) return $q.when( iconCache[id].clone() );\n if ( urlRegex.test(id) ) return loadByURL(id).then( cacheIcon(id) );\n if ( id.indexOf(':') == -1 ) id = '$default:' + id;\n\n return loadByID(id)\n .catch(loadFromIconSet)\n .catch(announceIdNotFound)\n .catch(announceNotFound)\n .then( cacheIcon(id) );\n }\n\n /**\n * Lookup registered fontSet style using its alias...\n * If not found,\n */\n function findRegisteredFontSet(alias) {\n var useDefault = angular.isUndefined(alias) || !(alias && alias.length);\n if ( useDefault ) return config.defaultFontSet;\n\n var result = alias;\n angular.forEach(config.fontSets, function(it){\n if ( it.alias == alias ) result = it.fontSet || result;\n });\n\n return result;\n }\n\n /**\n * Prepare and cache the loaded icon for the specified `id`\n */\n function cacheIcon( id ) {\n\n return function updateCache( icon ) {\n iconCache[id] = isIcon(icon) ? icon : new Icon(icon, config[id]);\n\n return iconCache[id].clone();\n };\n }\n\n /**\n * Lookup the configuration in the registry, if !registered throw an error\n * otherwise load the icon [on-demand] using the registered URL.\n *\n */\n function loadByID(id) {\n var iconConfig = config[id];\n\n return !iconConfig ? $q.reject(id) : loadByURL(iconConfig.url).then(function(icon) {\n return new Icon(icon, iconConfig);\n });\n }\n\n /**\n * Loads the file as XML and uses querySelector( ) to find\n * the desired node...\n */\n function loadFromIconSet(id) {\n var setName = id.substring(0, id.lastIndexOf(':')) || '$default';\n var iconSetConfig = config[setName];\n\n return !iconSetConfig ? $q.reject(id) : loadByURL(iconSetConfig.url).then(extractFromSet);\n\n function extractFromSet(set) {\n var iconName = id.slice(id.lastIndexOf(':') + 1);\n var icon = set.querySelector('#' + iconName);\n return !icon ? $q.reject(id) : new Icon(icon, iconSetConfig);\n }\n }\n\n /**\n * Load the icon by URL (may use the $templateCache).\n * Extract the data for later conversion to Icon\n */\n function loadByURL(url) {\n return $http\n .get(url, { cache: $templateCache })\n .then(function(response) {\n return angular.element('
    ').append(response.data).find('svg')[0];\n });\n }\n\n /**\n * User did not specify a URL and the ID has not been registered with the $mdIcon\n * registry\n */\n function announceIdNotFound(id) {\n var msg;\n\n if (angular.isString(id)) {\n msg = 'icon ' + id + ' not found';\n $log.warn(msg);\n }\n\n return $q.reject(msg || id);\n }\n\n /**\n * Catch HTTP or generic errors not related to incorrect icon IDs.\n */\n function announceNotFound(err) {\n var msg = angular.isString(err) ? err : (err.message || err.data || err.statusText);\n $log.warn(msg);\n\n return $q.reject(msg);\n }\n\n /**\n * Check target signature to see if it is an Icon instance.\n */\n function isIcon(target) {\n return angular.isDefined(target.element) && angular.isDefined(target.config);\n }\n\n /**\n * Define the Icon class\n */\n function Icon(el, config) {\n if (el.tagName != 'svg') {\n el = angular.element('').append(el)[0];\n }\n\n // Inject the namespace if not available...\n if ( !el.getAttribute('xmlns') ) {\n el.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n }\n\n this.element = el;\n this.config = config;\n this.prepare();\n }\n\n /**\n * Prepare the DOM element that will be cached in the\n * loaded iconCache store.\n */\n function prepareAndStyle() {\n var viewBoxSize = this.config ? this.config.viewBoxSize : config.defaultViewBoxSize;\n angular.forEach({\n 'fit' : '',\n 'height': '100%',\n 'width' : '100%',\n 'preserveAspectRatio': 'xMidYMid meet',\n 'viewBox' : this.element.getAttribute('viewBox') || ('0 0 ' + viewBoxSize + ' ' + viewBoxSize)\n }, function(val, attr) {\n this.element.setAttribute(attr, val);\n }, this);\n\n angular.forEach({\n 'pointer-events' : 'none',\n 'display' : 'block'\n }, function(val, style) {\n this.element.style[style] = val;\n }, this);\n }\n\n /**\n * Clone the Icon DOM element.\n */\n function cloneSVG(){\n return this.element.cloneNode(true);\n }\n\n }\n\n})();\n(function(){\n\"use strict\";\n\n/**\n * @ngdoc module\n * @name material.components.input\n */\n\nangular.module('material.components.input', [\n 'material.core'\n])\n .directive('mdInputContainer', mdInputContainerDirective)\n .directive('label', labelDirective)\n .directive('input', inputTextareaDirective)\n .directive('textarea', inputTextareaDirective)\n .directive('mdMaxlength', mdMaxlengthDirective)\n .directive('placeholder', placeholderDirective);\n\n/**\n * @ngdoc directive\n * @name mdInputContainer\n * @module material.components.input\n *\n * @restrict E\n *\n * @description\n * `` is the parent of any input or textarea element.\n *\n * Input and textarea elements will not behave properly unless the md-input-container\n * parent is provided.\n *\n * @param md-is-error {expression=} When the given expression evaluates to true, the input container will go into error state. Defaults to erroring if the input has been touched and is invalid.\n * @param md-no-float {boolean=} When present, placeholders will not be converted to floating labels\n *\n * @usage\n * \n *\n * \n * \n * \n *\n * \n * \n * \n * \n *\n * \n */\nfunction mdInputContainerDirective($mdTheming, $parse) {\n ContainerCtrl.$inject = [\"$scope\", \"$element\", \"$attrs\"];\n return {\n restrict: 'E',\n link: postLink,\n controller: ContainerCtrl\n };\n\n function postLink(scope, element, attr) {\n $mdTheming(element);\n }\n function ContainerCtrl($scope, $element, $attrs) {\n var self = this;\n\n self.isErrorGetter = $attrs.mdIsError && $parse($attrs.mdIsError);\n\n self.delegateClick = function() {\n self.input.focus();\n };\n self.element = $element;\n self.setFocused = function(isFocused) {\n $element.toggleClass('md-input-focused', !!isFocused);\n };\n self.setHasValue = function(hasValue) {\n $element.toggleClass('md-input-has-value', !!hasValue);\n };\n self.setInvalid = function(isInvalid) {\n $element.toggleClass('md-input-invalid', !!isInvalid);\n };\n $scope.$watch(function() {\n return self.label && self.input;\n }, function(hasLabelAndInput) {\n if (hasLabelAndInput && !self.label.attr('for')) {\n self.label.attr('for', self.input.attr('id'));\n }\n });\n }\n}\nmdInputContainerDirective.$inject = [\"$mdTheming\", \"$parse\"];\n\nfunction labelDirective() {\n return {\n restrict: 'E',\n require: '^?mdInputContainer',\n link: function(scope, element, attr, containerCtrl) {\n if (!containerCtrl || attr.mdNoFloat) return;\n\n containerCtrl.label = element;\n scope.$on('$destroy', function() {\n containerCtrl.label = null;\n });\n }\n };\n}\n\n/**\n * @ngdoc directive\n * @name mdInput\n * @restrict E\n * @module material.components.input\n *\n * @description\n * Use the `

    \n * The purpose of **`md-maxlength`** is exactly to show the max length counter text. If you don't want the counter text and only need \"plain\" validation, you can use the \"simple\" `ng-maxlength` or maxlength attributes.\n * @param {string=} aria-label Aria-label is required when no label is present. A warning message will be logged in the console if not present.\n * @param {string=} placeholder An alternative approach to using aria-label when the label is not present. The placeholder text is copied to the aria-label attribute.\n * @param md-no-autogrow {boolean=} When present, textareas will not grow automatically.\n *\n * @usage\n * \n * \n * \n * \n * \n * \n *

    With Errors

    \n *\n * \n *
    \n * \n * \n * \n *
    \n *
    This is required!
    \n *
    That's too long!
    \n *
    That's too short!
    \n *
    \n *
    \n * \n * \n * \n *
    \n *
    This is required!
    \n *
    That's too long!
    \n *
    \n *
    \n * \n * \n * \n * \n * \n * \n *
    \n *
    \n *\n * Requires [ngMessages](https://docs.angularjs.org/api/ngMessages).\n * Behaves like the [AngularJS input directive](https://docs.angularjs.org/api/ng/directive/input).\n *\n */\n\nfunction inputTextareaDirective($mdUtil, $window, $mdAria) {\n return {\n restrict: 'E',\n require: ['^?mdInputContainer', '?ngModel'],\n link: postLink\n };\n\n function postLink(scope, element, attr, ctrls) {\n\n var containerCtrl = ctrls[0];\n var ngModelCtrl = ctrls[1] || $mdUtil.fakeNgModel();\n var isReadonly = angular.isDefined(attr.readonly);\n\n if ( !containerCtrl ) return;\n if (containerCtrl.input) {\n throw new Error(\" can only have *one* , \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    DirectiveHowSourceRendered
    ng-bind-htmlAutomatically uses $sanitize
    <div ng-bind-html=\"snippet\">
    </div>
    ng-bind-htmlBypass $sanitize by explicitly trusting the dangerous value\n
    <div ng-bind-html=\"deliberatelyTrustDangerousSnippet()\">\n</div>
    \n
    ng-bindAutomatically escapes
    <div ng-bind=\"snippet\">
    </div>
    \n
    \n \n \n it('should sanitize the html snippet by default', function() {\n expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n toBe('

    an html\\nclick here\\nsnippet

    ');\n });\n\n it('should inline raw snippet if bound to a trusted value', function() {\n expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).\n toBe(\"

    an html\\n\" +\n \"click here\\n\" +\n \"snippet

    \");\n });\n\n it('should escape snippet without any filter', function() {\n expect(element(by.css('#bind-default div')).getInnerHtml()).\n toBe(\"<p style=\\\"color:blue\\\">an html\\n\" +\n \"<em onmouseover=\\\"this.textContent='PWN3D!'\\\">click here</em>\\n\" +\n \"snippet</p>\");\n });\n\n it('should update', function() {\n element(by.model('snippet')).clear();\n element(by.model('snippet')).sendKeys('new text');\n expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).\n toBe('new text');\n expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(\n 'new text');\n expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(\n \"new <b onclick=\\\"alert(1)\\\">text</b>\");\n });\n
    \n \n */\n\n\n/**\n * @ngdoc provider\n * @name $sanitizeProvider\n *\n * @description\n * Creates and configures {@link $sanitize} instance.\n */\nfunction $SanitizeProvider() {\n var svgEnabled = false;\n\n this.$get = ['$$sanitizeUri', function($$sanitizeUri) {\n if (svgEnabled) {\n extend(validElements, svgElements);\n }\n return function(html) {\n var buf = [];\n htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {\n return !/^unsafe:/.test($$sanitizeUri(uri, isImage));\n }));\n return buf.join('');\n };\n }];\n\n\n /**\n * @ngdoc method\n * @name $sanitizeProvider#enableSvg\n * @kind function\n *\n * @description\n * Enables a subset of svg to be supported by the sanitizer.\n *\n *
    \n *

    By enabling this setting without taking other precautions, you might expose your\n * application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned\n * outside of the containing element and be rendered over other elements on the page (e.g. a login\n * link). Such behavior can then result in phishing incidents.

    \n *\n *

    To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg\n * tags within the sanitized content:

    \n *\n *
    \n *\n *
    \n   *   .rootOfTheIncludedContent svg {\n   *     overflow: hidden !important;\n   *   }\n   *   
    \n *
    \n *\n * @param {boolean=} flag Enable or disable SVG support in the sanitizer.\n * @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called\n * without an argument or self for chaining otherwise.\n */\n this.enableSvg = function(enableSvg) {\n if (isDefined(enableSvg)) {\n svgEnabled = enableSvg;\n return this;\n } else {\n return svgEnabled;\n }\n };\n\n //////////////////////////////////////////////////////////////////////////////////////////////////\n // Private stuff\n //////////////////////////////////////////////////////////////////////////////////////////////////\n\n bind = angular.bind;\n extend = angular.extend;\n forEach = angular.forEach;\n isDefined = angular.isDefined;\n lowercase = angular.lowercase;\n noop = angular.noop;\n\n htmlParser = htmlParserImpl;\n htmlSanitizeWriter = htmlSanitizeWriterImpl;\n\n // Regular Expressions for parsing tags and attributes\n var SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\n // Match everything outside of normal chars and \" (quote character)\n NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n\n\n // Good source of info about elements and attributes\n // http://dev.w3.org/html5/spec/Overview.html#semantics\n // http://simon.html5.org/html-elements\n\n // Safe Void Elements - HTML5\n // http://dev.w3.org/html5/spec/Overview.html#void-elements\n var voidElements = toMap(\"area,br,col,hr,img,wbr\");\n\n // Elements that you can, intentionally, leave open (and which close themselves)\n // http://dev.w3.org/html5/spec/Overview.html#optional-tags\n var optionalEndTagBlockElements = toMap(\"colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr\"),\n optionalEndTagInlineElements = toMap(\"rp,rt\"),\n optionalEndTagElements = extend({},\n optionalEndTagInlineElements,\n optionalEndTagBlockElements);\n\n // Safe Block Elements - HTML5\n var blockElements = extend({}, optionalEndTagBlockElements, toMap(\"address,article,\" +\n \"aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,\" +\n \"h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul\"));\n\n // Inline Elements - HTML5\n var inlineElements = extend({}, optionalEndTagInlineElements, toMap(\"a,abbr,acronym,b,\" +\n \"bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,\" +\n \"samp,small,span,strike,strong,sub,sup,time,tt,u,var\"));\n\n // SVG Elements\n // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements\n // Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted.\n // They can potentially allow for arbitrary javascript to be executed. See #11290\n var svgElements = toMap(\"circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,\" +\n \"hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,\" +\n \"radialGradient,rect,stop,svg,switch,text,title,tspan\");\n\n // Blocked Elements (will be stripped)\n var blockedElements = toMap(\"script,style\");\n\n var validElements = extend({},\n voidElements,\n blockElements,\n inlineElements,\n optionalEndTagElements);\n\n //Attributes that have href and hence need to be sanitized\n var uriAttrs = toMap(\"background,cite,href,longdesc,src,xlink:href\");\n\n var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' +\n 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' +\n 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' +\n 'valign,value,vspace,width');\n\n // SVG attributes (without \"id\" and \"name\" attributes)\n // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes\n var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' +\n 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' +\n 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' +\n 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' +\n 'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' +\n 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' +\n 'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' +\n 'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' +\n 'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' +\n 'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' +\n 'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' +\n 'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' +\n 'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' +\n 'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' +\n 'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true);\n\n var validAttrs = extend({},\n uriAttrs,\n svgAttrs,\n htmlAttrs);\n\n function toMap(str, lowercaseKeys) {\n var obj = {}, items = str.split(','), i;\n for (i = 0; i < items.length; i++) {\n obj[lowercaseKeys ? lowercase(items[i]) : items[i]] = true;\n }\n return obj;\n }\n\n var inertBodyElement;\n (function(window) {\n var doc;\n if (window.document && window.document.implementation) {\n doc = window.document.implementation.createHTMLDocument(\"inert\");\n } else {\n throw $sanitizeMinErr('noinert', \"Can't create an inert html document\");\n }\n var docElement = doc.documentElement || doc.getDocumentElement();\n var bodyElements = docElement.getElementsByTagName('body');\n\n // usually there should be only one body element in the document, but IE doesn't have any, so we need to create one\n if (bodyElements.length === 1) {\n inertBodyElement = bodyElements[0];\n } else {\n var html = doc.createElement('html');\n inertBodyElement = doc.createElement('body');\n html.appendChild(inertBodyElement);\n doc.appendChild(html);\n }\n })(window);\n\n /**\n * @example\n * htmlParser(htmlString, {\n * start: function(tag, attrs) {},\n * end: function(tag) {},\n * chars: function(text) {},\n * comment: function(text) {}\n * });\n *\n * @param {string} html string\n * @param {object} handler\n */\n function htmlParserImpl(html, handler) {\n if (html === null || html === undefined) {\n html = '';\n } else if (typeof html !== 'string') {\n html = '' + html;\n }\n inertBodyElement.innerHTML = html;\n\n //mXSS protection\n var mXSSAttempts = 5;\n do {\n if (mXSSAttempts === 0) {\n throw $sanitizeMinErr('uinput', \"Failed to sanitize html because the input is unstable\");\n }\n mXSSAttempts--;\n\n // strip custom-namespaced attributes on IE<=11\n if (window.document.documentMode) {\n stripCustomNsAttrs(inertBodyElement);\n }\n html = inertBodyElement.innerHTML; //trigger mXSS\n inertBodyElement.innerHTML = html;\n } while (html !== inertBodyElement.innerHTML);\n\n var node = inertBodyElement.firstChild;\n while (node) {\n switch (node.nodeType) {\n case 1: // ELEMENT_NODE\n handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes));\n break;\n case 3: // TEXT NODE\n handler.chars(node.textContent);\n break;\n }\n\n var nextNode;\n if (!(nextNode = node.firstChild)) {\n if (node.nodeType == 1) {\n handler.end(node.nodeName.toLowerCase());\n }\n nextNode = node.nextSibling;\n if (!nextNode) {\n while (nextNode == null) {\n node = node.parentNode;\n if (node === inertBodyElement) break;\n nextNode = node.nextSibling;\n if (node.nodeType == 1) {\n handler.end(node.nodeName.toLowerCase());\n }\n }\n }\n }\n node = nextNode;\n }\n\n while (node = inertBodyElement.firstChild) {\n inertBodyElement.removeChild(node);\n }\n }\n\n function attrToMap(attrs) {\n var map = {};\n for (var i = 0, ii = attrs.length; i < ii; i++) {\n var attr = attrs[i];\n map[attr.name] = attr.value;\n }\n return map;\n }\n\n\n /**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n * @returns {string} escaped text\n */\n function encodeEntities(value) {\n return value.\n replace(/&/g, '&').\n replace(SURROGATE_PAIR_REGEXP, function(value) {\n var hi = value.charCodeAt(0);\n var low = value.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n }).\n replace(NON_ALPHANUMERIC_REGEXP, function(value) {\n return '&#' + value.charCodeAt(0) + ';';\n }).\n replace(//g, '>');\n }\n\n /**\n * create an HTML/XML writer which writes to buffer\n * @param {Array} buf use buf.join('') to get out sanitized html string\n * @returns {object} in the form of {\n * start: function(tag, attrs) {},\n * end: function(tag) {},\n * chars: function(text) {},\n * comment: function(text) {}\n * }\n */\n function htmlSanitizeWriterImpl(buf, uriValidator) {\n var ignoreCurrentElement = false;\n var out = bind(buf, buf.push);\n return {\n start: function(tag, attrs) {\n tag = lowercase(tag);\n if (!ignoreCurrentElement && blockedElements[tag]) {\n ignoreCurrentElement = tag;\n }\n if (!ignoreCurrentElement && validElements[tag] === true) {\n out('<');\n out(tag);\n forEach(attrs, function(value, key) {\n var lkey = lowercase(key);\n var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');\n if (validAttrs[lkey] === true &&\n (uriAttrs[lkey] !== true || uriValidator(value, isImage))) {\n out(' ');\n out(key);\n out('=\"');\n out(encodeEntities(value));\n out('\"');\n }\n });\n out('>');\n }\n },\n end: function(tag) {\n tag = lowercase(tag);\n if (!ignoreCurrentElement && validElements[tag] === true && voidElements[tag] !== true) {\n out('');\n }\n if (tag == ignoreCurrentElement) {\n ignoreCurrentElement = false;\n }\n },\n chars: function(chars) {\n if (!ignoreCurrentElement) {\n out(encodeEntities(chars));\n }\n }\n };\n }\n\n\n /**\n * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1' attribute to declare\n * ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo'). This is undesirable since we don't want\n * to allow any of these custom attributes. This method strips them all.\n *\n * @param node Root element to process\n */\n function stripCustomNsAttrs(node) {\n if (node.nodeType === window.Node.ELEMENT_NODE) {\n var attrs = node.attributes;\n for (var i = 0, l = attrs.length; i < l; i++) {\n var attrNode = attrs[i];\n var attrName = attrNode.name.toLowerCase();\n if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) {\n node.removeAttributeNode(attrNode);\n i--;\n l--;\n }\n }\n }\n\n var nextNode = node.firstChild;\n if (nextNode) {\n stripCustomNsAttrs(nextNode);\n }\n\n nextNode = node.nextSibling;\n if (nextNode) {\n stripCustomNsAttrs(nextNode);\n }\n }\n}\n\nfunction sanitizeText(chars) {\n var buf = [];\n var writer = htmlSanitizeWriter(buf, noop);\n writer.chars(chars);\n return buf.join('');\n}\n\n\n// define ngSanitize module and register $sanitize service\nangular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);\n\n/**\n * @ngdoc filter\n * @name linky\n * @kind function\n *\n * @description\n * Finds links in text input and turns them into html links. Supports `http/https/ftp/mailto` and\n * plain email address links.\n *\n * Requires the {@link ngSanitize `ngSanitize`} module to be installed.\n *\n * @param {string} text Input text.\n * @param {string} target Window (`_blank|_self|_parent|_top`) or named frame to open links in.\n * @param {object|function(url)} [attributes] Add custom attributes to the link element.\n *\n * Can be one of:\n *\n * - `object`: A map of attributes\n * - `function`: Takes the url as a parameter and returns a map of attributes\n *\n * If the map of attributes contains a value for `target`, it overrides the value of\n * the target parameter.\n *\n *\n * @returns {string} Html-linkified and {@link $sanitize sanitized} text.\n *\n * @usage\n \n *\n * @example\n \n \n
    \n Snippet: \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    FilterSourceRendered
    linky filter\n
    <div ng-bind-html=\"snippet | linky\">
    </div>
    \n
    \n
    \n
    linky target\n
    <div ng-bind-html=\"snippetWithSingleURL | linky:'_blank'\">
    </div>
    \n
    \n
    \n
    linky custom attributes\n
    <div ng-bind-html=\"snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}\">
    </div>
    \n
    \n
    \n
    no filter
    <div ng-bind=\"snippet\">
    </div>
    \n \n \n angular.module('linkyExample', ['ngSanitize'])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.snippet =\n 'Pretty text with some links:\\n'+\n 'http://angularjs.org/,\\n'+\n 'mailto:us@somewhere.org,\\n'+\n 'another@somewhere.org,\\n'+\n 'and one more: ftp://127.0.0.1/.';\n $scope.snippetWithSingleURL = 'http://angularjs.org/';\n }]);\n \n \n it('should linkify the snippet with urls', function() {\n expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).\n toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +\n 'another@somewhere.org, and one more: ftp://127.0.0.1/.');\n expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);\n });\n\n it('should not linkify snippet without the linky filter', function() {\n expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).\n toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +\n 'another@somewhere.org, and one more: ftp://127.0.0.1/.');\n expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);\n });\n\n it('should update', function() {\n element(by.model('snippet')).clear();\n element(by.model('snippet')).sendKeys('new http://link.');\n expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).\n toBe('new http://link.');\n expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);\n expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())\n .toBe('new http://link.');\n });\n\n it('should work with the target property', function() {\n expect(element(by.id('linky-target')).\n element(by.binding(\"snippetWithSingleURL | linky:'_blank'\")).getText()).\n toBe('http://angularjs.org/');\n expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');\n });\n\n it('should optionally add custom attributes', function() {\n expect(element(by.id('linky-custom-attributes')).\n element(by.binding(\"snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}\")).getText()).\n toBe('http://angularjs.org/');\n expect(element(by.css('#linky-custom-attributes a')).getAttribute('rel')).toEqual('nofollow');\n });\n \n \n */\nangular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {\n var LINKY_URL_REGEXP =\n /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"\\u201d\\u2019]/i,\n MAILTO_REGEXP = /^mailto:/i;\n\n var linkyMinErr = angular.$$minErr('linky');\n var isDefined = angular.isDefined;\n var isFunction = angular.isFunction;\n var isObject = angular.isObject;\n var isString = angular.isString;\n\n return function(text, target, attributes) {\n if (text == null || text === '') return text;\n if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text);\n\n var attributesFn =\n isFunction(attributes) ? attributes :\n isObject(attributes) ? function getAttributesObject() {return attributes;} :\n function getEmptyAttributesObject() {return {};};\n\n var match;\n var raw = text;\n var html = [];\n var url;\n var i;\n while ((match = raw.match(LINKY_URL_REGEXP))) {\n // We can not end in these as they are sometimes found at the end of the sentence\n url = match[0];\n // if we did not match ftp/http/www/mailto then assume mailto\n if (!match[2] && !match[4]) {\n url = (match[3] ? 'http://' : 'mailto:') + url;\n }\n i = match.index;\n addText(raw.substr(0, i));\n addLink(url, match[0].replace(MAILTO_REGEXP, ''));\n raw = raw.substring(i + match[0].length);\n }\n addText(raw);\n return $sanitize(html.join(''));\n\n function addText(text) {\n if (!text) {\n return;\n }\n html.push(sanitizeText(text));\n }\n\n function addLink(url, text) {\n var key, linkAttributes = attributesFn(url);\n html.push('');\n addText(text);\n html.push('');\n }\n };\n}]);\n\n\n})(window, window.angular);\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-sanitize/angular-sanitize.js?"); /***/ }), /***/ "./node_modules/angular-sanitize/index.js": /*!************************************************!*\ !*** ./node_modules/angular-sanitize/index.js ***! \************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("__webpack_require__(/*! ./angular-sanitize */ \"./node_modules/angular-sanitize/angular-sanitize.js\");\nmodule.exports = 'ngSanitize';\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-sanitize/index.js?"); /***/ }), /***/ "./node_modules/angular-segment-analytics/index.js": /*!*********************************************************!*\ !*** ./node_modules/angular-segment-analytics/index.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("__webpack_require__(/*! ./segment.js */ \"./node_modules/angular-segment-analytics/segment.js\");\nmodule.exports = 'ngSegment';\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-segment-analytics/index.js?"); /***/ }), /***/ "./node_modules/angular-segment-analytics/segment.js": /*!***********************************************************!*\ !*** ./node_modules/angular-segment-analytics/segment.js ***! \***********************************************************/ /***/ (() => { eval("angular.module('ngSegment', []);\n\nangular.module('ngSegment').constant('segmentDefaultConfig', {\n\n // API key: The https://segment.com API key to be used when loading analytics.js.\n // Must be set before loading the analytics.js script.\n apiKey: null,\n\n // Autoload: if true, analytics.js will be asynchronously\n // loaded after the app's .config() cycle has ended\n autoload: true,\n\n // Load delay: number of milliseconds to defer loading\n // analytics.js.\n loadDelay: 0,\n\n // Condition: callback function to be checked before making an API call\n // against segment. Can be dependency-injected, and is passed the method name\n // and arguments of the analytics.js call being made. Useful for disabling\n // certain or all analytics.js functionality for certain users or in certain\n // application states.\n condition: null,\n\n // Debug: turns debug statements on/off. Useful during development.\n debug: false,\n\n // Methods: the analytics.js methods that the service creates queueing stubs for.\n methods: [\n 'trackSubmit',\n 'trackClick',\n 'trackLink',\n 'trackForm',\n 'pageview',\n 'identify',\n 'reset',\n 'group',\n 'track',\n 'ready',\n 'alias',\n 'page',\n 'once',\n 'off',\n 'on',\n ],\n\n // Tag: the tag used in debug log statements\n tag: '[ngSegment] ',\n});\n\n(function (module) {\n\n function SegmentLoader(hasLoaded) {\n\n this.hasLoaded = hasLoaded || false;\n\n this.load = function (apiKey, delayMs) {\n if (window.analytics.initialized) {\n console.warn('Warning: Segment analytics has already been initialized. Did you already load the library?');\n }\n\n if (this.hasLoaded) {\n throw new Error('Attempting to load Segment twice.');\n } else {\n\n // Only load if we've been given or have set an API key\n if (apiKey) {\n\n // Prevent double .load() calls\n this.hasLoaded = true;\n\n window.setTimeout(function () {\n\n // Create an async script element based on your key.\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.src = (document.location.protocol === 'https:'\n ? 'https://' : 'http://')\n + 'cdn.segment.com/analytics.js/v1/'\n + apiKey + '/analytics.min.js';\n\n script.onerror = function () {\n console.error('Error loading Segment library.');\n };\n\n // Insert our script next to the first script element.\n var first = document.getElementsByTagName('script')[0];\n first.parentNode.insertBefore(script, first);\n }, delayMs);\n } else {\n throw new Error('Cannot load Analytics.js without an API key.');\n }\n }\n };\n }\n\n function SegmentLoaderProvider() {\n\n // Inherit .load()\n SegmentLoader.call(this);\n\n this.$get = function () {\n return new SegmentLoader(this.hasLoaded);\n };\n }\n\n // Register with Angular\n module.provider('segmentLoader', SegmentLoaderProvider);\n\n})(angular.module('ngSegment'));\n\n(function (module) {\n\n var analytics = window.analytics = window.analytics || [];\n\n // Invoked flag, to make sure the snippet\n // is never invoked twice.\n if (analytics.invoked) {\n console.error('Segment or ngSegment included twice.');\n } else {\n analytics.invoked = true;\n }\n\n // Define a factory to create stubs. These are placeholders\n // for methods in Analytics.js so that you never have to wait\n // for it to load to actually record data. The `method` is\n // stored as the first argument, so we can replay the data.\n analytics.factory = function (method) {\n return function () {\n var args = Array.prototype.slice.call(arguments);\n args.unshift(method);\n analytics.push(args);\n return analytics;\n };\n };\n\n /**\n * Segment service\n * @param config\n * @constructor\n */\n function Segment(config) {\n\n this.config = config;\n\n // Checks condition before calling Segment method\n this.factory = function (method) {\n var _this = this;\n return function () {\n\n // If a condition has been set, only call the Segment method if it returns true\n if (_this.config.condition && !_this.config.condition(method, arguments)) {\n _this.debug('Not calling method, condition returned false.', {\n method: method,\n arguments: arguments,\n });\n return;\n }\n\n // No condition set, call the Segment method\n _this.debug('Calling method ' + method + ' with arguments:', arguments);\n return window.analytics[method].apply(analytics, arguments);\n };\n };\n }\n\n /**\n * Methods available on both segment service and segmentProvider\n * @type {{init: Function, debug: Function}}\n */\n Segment.prototype = {\n\n // Creates analytics.js method stubs\n init: function () {\n for (var i = 0; i < this.config.methods.length; i++) {\n var key = this.config.methods[i];\n\n // Only create analytics stub if it doesn't already exist\n if (!analytics[key]) {\n analytics[key] = analytics.factory(key);\n }\n\n this[key] = this.factory(key);\n }\n },\n\n debug: function () {\n if (this.config.debug) {\n arguments[0] = this.config.tag + arguments[0];\n console.log.apply(console, arguments);\n return true;\n }\n },\n };\n\n /**\n * Segment provider available during .config() Angular app phase. Inherits from Segment prototype.\n * @param segmentDefaultConfig\n * @constructor\n * @extends Segment\n */\n function SegmentProvider(segmentDefaultConfig) {\n\n this.config = angular.copy(segmentDefaultConfig);\n\n // Stores any analytics.js method calls\n this.queue = [];\n\n // Overwrite Segment factory to queue up calls if condition has been set\n this.factory = function (method) {\n var queue = this.queue;\n return function () {\n\n // Defer calling analytics.js methods until the service is instantiated\n queue.push({ method: method, arguments: arguments });\n };\n };\n\n // Create method stubs using overridden factory\n this.init();\n\n this.setKey = function (apiKey) {\n this.config.apiKey = apiKey;\n this.validate('apiKey');\n return this;\n };\n\n this.setLoadDelay = function (milliseconds) {\n this.config.loadDelay = milliseconds;\n this.validate('loadDelay');\n return this;\n };\n\n this.setCondition = function (callback) {\n this.config.condition = callback;\n this.validate('condition');\n return this;\n };\n\n this.setEvents = function (events) {\n this.events = events;\n return this;\n };\n\n this.setConfig = function (config) {\n if (!angular.isObject(config)) {\n throw new Error(this.config.tag + 'Config must be an object.');\n }\n\n angular.extend(this.config, config);\n\n // Validate new settings\n var _this = this;\n Object.keys(config).forEach(function (key) {\n _this.validate(key);\n });\n\n return this;\n };\n\n this.setAutoload = function (bool) {\n this.config.autoload = !!bool;\n return this;\n };\n\n this.setDebug = function (bool) {\n this.config.debug = !!bool;\n return this;\n };\n\n var validations = {\n apiKey: function (config) {\n if (!angular.isString(config.apiKey) || !config.apiKey) {\n throw new Error(config.tag + 'API key must be a valid string.');\n }\n },\n\n loadDelay: function (config) {\n if (!angular.isNumber(config.loadDelay)) {\n throw new Error(config.tag + 'Load delay must be a number.');\n }\n },\n\n condition: function (config) {\n if (!angular.isFunction(config.condition) &&\n !(angular.isArray(config.condition) &&\n angular.isFunction(config.condition[config.condition.length - 1]))\n ) {\n throw new Error(config.tag + 'Condition callback must be a function or array.');\n }\n },\n };\n\n // Allows validating a specific property after set[Prop]\n // or all config after provider/constant config\n this.validate = function (property) {\n if (typeof validations[property] === 'function') {\n validations[property](this.config);\n }\n };\n\n this.createService = function ($injector, segmentLoader) {\n\n // Apply user-provided config constant if it exists\n if ($injector.has('segmentConfig')) {\n var constant = $injector.get('segmentConfig');\n if (!angular.isObject(constant)) {\n throw new Error(this.config.tag + 'Config constant must be an object.');\n }\n\n angular.extend(this.config, constant);\n this.debug('Found segment config constant');\n\n // Validate settings passed in by constant\n var _this = this;\n Object.keys(constant).forEach(function (key) {\n _this.validate(key);\n });\n }\n\n // Autoload Segment on service instantiation if an API key has been set via the provider\n if (this.config.autoload) {\n this.debug('Autoloading Analytics.js');\n if (this.config.apiKey) {\n segmentLoader.load(this.config.apiKey, this.config.loadDelay);\n } else {\n this.debug(this.config.tag + ' Warning: API key is not set and autoload is not disabled.');\n }\n }\n\n // Create dependency-injected condition\n if (typeof this.config.condition === 'function' ||\n (typeof this.config.condition === 'array' &&\n typeof this.config.condition[this.config.condition - 1] === 'function')\n ) {\n var condition = this.config.condition;\n this.config.condition = function (method, params) {\n return $injector.invoke(condition, condition, { method: method, params: params });\n };\n }\n\n // Pass any provider-set configuration down to the service\n var segment = new Segment(angular.copy(this.config));\n\n // Transfer events if set\n if (this.events) {\n segment.events = angular.copy(this.events);\n }\n\n // Set up service method stubs\n segment.init();\n\n // Play back any segment calls that were made against the provider now that the\n // condition callback has been injected with dependencies\n this.queue.forEach(function (item) {\n segment[item.method].apply(segment, item.arguments);\n });\n\n return segment;\n };\n\n // Returns segment service and creates dependency-injected condition callback, if provided\n this.$get = ['$injector', 'segmentLoader', this.createService];\n }\n\n SegmentProvider.prototype = Object.create(Segment.prototype);\n\n // Register with Angular\n module.provider('segment', ['segmentDefaultConfig', SegmentProvider]);\n\n})(angular.module('ngSegment'));\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-segment-analytics/segment.js?"); /***/ }), /***/ "./node_modules/angular-translate-loader-static-files/angular-translate-loader-static-files.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/angular-translate-loader-static-files/angular-translate-loader-static-files.js ***! \*****************************************************************************************************/ /***/ (function(module, exports) { eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * angular-translate - v2.12.1 - 2016-09-15\n * \n * Copyright (c) 2016 The angular-translate team, Pascal Precht; Licensed MIT\n */\n(function (root, factory) {\n if (true) {\n // AMD. Register as an anonymous module unless amdModuleId is set\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return (factory());\n }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function () {\n\n$translateStaticFilesLoader.$inject = ['$q', '$http'];\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc object\n * @name pascalprecht.translate.$translateStaticFilesLoader\n * @requires $q\n * @requires $http\n *\n * @description\n * Creates a loading function for a typical static file url pattern:\n * \"lang-en_US.json\", \"lang-de_DE.json\", etc. Using this builder,\n * the response of these urls must be an object of key-value pairs.\n *\n * @param {object} options Options object, which gets prefix, suffix and key.\n */\n.factory('$translateStaticFilesLoader', $translateStaticFilesLoader);\n\nfunction $translateStaticFilesLoader($q, $http) {\n\n 'use strict';\n\n return function (options) {\n\n if (!options || (!angular.isArray(options.files) && (!angular.isString(options.prefix) || !angular.isString(options.suffix)))) {\n throw new Error('Couldn\\'t load static files, no files and prefix or suffix specified!');\n }\n\n if (!options.files) {\n options.files = [{\n prefix: options.prefix,\n suffix: options.suffix\n }];\n }\n\n var load = function (file) {\n if (!file || (!angular.isString(file.prefix) || !angular.isString(file.suffix))) {\n throw new Error('Couldn\\'t load static file, no prefix or suffix specified!');\n }\n\n return $http(angular.extend({\n url: [\n file.prefix,\n options.key,\n file.suffix\n ].join(''),\n method: 'GET',\n params: ''\n }, options.$http))\n .then(function(result) {\n return result.data;\n }, function () {\n return $q.reject(options.key);\n });\n };\n\n var promises = [],\n length = options.files.length;\n\n for (var i = 0; i < length; i++) {\n promises.push(load({\n prefix: options.files[i].prefix,\n key: options.key,\n suffix: options.files[i].suffix\n }));\n }\n\n return $q.all(promises)\n .then(function (data) {\n var length = data.length,\n mergedData = {};\n\n for (var i = 0; i < length; i++) {\n for (var key in data[i]) {\n mergedData[key] = data[i][key];\n }\n }\n\n return mergedData;\n });\n };\n}\n\n$translateStaticFilesLoader.displayName = '$translateStaticFilesLoader';\nreturn 'pascalprecht.translate';\n\n}));\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-translate-loader-static-files/angular-translate-loader-static-files.js?"); /***/ }), /***/ "./node_modules/angular-translate/dist/angular-translate.js": /*!******************************************************************!*\ !*** ./node_modules/angular-translate/dist/angular-translate.js ***! \******************************************************************/ /***/ (function(module, exports) { eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * angular-translate - v2.12.1 - 2016-09-15\n * \n * Copyright (c) 2016 The angular-translate team, Pascal Precht; Licensed MIT\n */\n(function (root, factory) {\n if (true) {\n // AMD. Register as an anonymous module unless amdModuleId is set\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {\n return (factory());\n }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function () {\n\n/**\n * @ngdoc overview\n * @name pascalprecht.translate\n *\n * @description\n * The main module which holds everything together.\n */\nrunTranslate.$inject = ['$translate'];\n$translate.$inject = ['$STORAGE_KEY', '$windowProvider', '$translateSanitizationProvider', 'pascalprechtTranslateOverrider'];\n$translateDefaultInterpolation.$inject = ['$interpolate', '$translateSanitization'];\ntranslateDirective.$inject = ['$translate', '$interpolate', '$compile', '$parse', '$rootScope'];\ntranslateAttrDirective.$inject = ['$translate', '$rootScope'];\ntranslateCloakDirective.$inject = ['$translate', '$rootScope'];\ntranslateFilterFactory.$inject = ['$parse', '$translate'];\n$translationCache.$inject = ['$cacheFactory'];\nangular.module('pascalprecht.translate', ['ng'])\n .run(runTranslate);\n\nfunction runTranslate($translate) {\n\n 'use strict';\n\n var key = $translate.storageKey(),\n storage = $translate.storage();\n\n var fallbackFromIncorrectStorageValue = function () {\n var preferred = $translate.preferredLanguage();\n if (angular.isString(preferred)) {\n $translate.use(preferred);\n // $translate.use() will also remember the language.\n // So, we don't need to call storage.put() here.\n } else {\n storage.put(key, $translate.use());\n }\n };\n\n fallbackFromIncorrectStorageValue.displayName = 'fallbackFromIncorrectStorageValue';\n\n if (storage) {\n if (!storage.get(key)) {\n fallbackFromIncorrectStorageValue();\n } else {\n $translate.use(storage.get(key))['catch'](fallbackFromIncorrectStorageValue);\n }\n } else if (angular.isString($translate.preferredLanguage())) {\n $translate.use($translate.preferredLanguage());\n }\n}\n\nrunTranslate.displayName = 'runTranslate';\n\n/**\n * @ngdoc object\n * @name pascalprecht.translate.$translateSanitizationProvider\n *\n * @description\n *\n * Configurations for $translateSanitization\n */\nangular.module('pascalprecht.translate').provider('$translateSanitization', $translateSanitizationProvider);\n\nfunction $translateSanitizationProvider () {\n\n 'use strict';\n\n var $sanitize,\n $sce,\n currentStrategy = null, // TODO change to either 'sanitize', 'escape' or ['sanitize', 'escapeParameters'] in 3.0.\n hasConfiguredStrategy = false,\n hasShownNoStrategyConfiguredWarning = false,\n strategies;\n\n /**\n * Definition of a sanitization strategy function\n * @callback StrategyFunction\n * @param {string|object} value - value to be sanitized (either a string or an interpolated value map)\n * @param {string} mode - either 'text' for a string (translation) or 'params' for the interpolated params\n * @return {string|object}\n */\n\n /**\n * @ngdoc property\n * @name strategies\n * @propertyOf pascalprecht.translate.$translateSanitizationProvider\n *\n * @description\n * Following strategies are built-in:\n *
    \n *
    sanitize
    \n *
    Sanitizes HTML in the translation text using $sanitize
    \n *
    escape
    \n *
    Escapes HTML in the translation
    \n *
    sanitizeParameters
    \n *
    Sanitizes HTML in the values of the interpolation parameters using $sanitize
    \n *
    escapeParameters
    \n *
    Escapes HTML in the values of the interpolation parameters
    \n *
    escaped
    \n *
    Support legacy strategy name 'escaped' for backwards compatibility (will be removed in 3.0)
    \n *
    \n *\n */\n\n strategies = {\n sanitize: function (value, mode/*, context*/) {\n if (mode === 'text') {\n value = htmlSanitizeValue(value);\n }\n return value;\n },\n escape: function (value, mode/*, context*/) {\n if (mode === 'text') {\n value = htmlEscapeValue(value);\n }\n return value;\n },\n sanitizeParameters: function (value, mode/*, context*/) {\n if (mode === 'params') {\n value = mapInterpolationParameters(value, htmlSanitizeValue);\n }\n return value;\n },\n escapeParameters: function (value, mode/*, context*/) {\n if (mode === 'params') {\n value = mapInterpolationParameters(value, htmlEscapeValue);\n }\n return value;\n },\n sce: function (value, mode, context) {\n if (mode === 'text') {\n value = htmlTrustValue(value);\n } else if (mode === 'params') {\n if (context !== 'filter') {\n // do html escape in filter context #1101\n value = mapInterpolationParameters(value, htmlEscapeValue);\n }\n }\n return value;\n },\n sceParameters: function (value, mode/*, context*/) {\n if (mode === 'params') {\n value = mapInterpolationParameters(value, htmlTrustValue);\n }\n return value;\n }\n };\n // Support legacy strategy name 'escaped' for backwards compatibility.\n // TODO should be removed in 3.0\n strategies.escaped = strategies.escapeParameters;\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateSanitizationProvider#addStrategy\n * @methodOf pascalprecht.translate.$translateSanitizationProvider\n *\n * @description\n * Adds a sanitization strategy to the list of known strategies.\n *\n * @param {string} strategyName - unique key for a strategy\n * @param {StrategyFunction} strategyFunction - strategy function\n * @returns {object} this\n */\n this.addStrategy = function (strategyName, strategyFunction) {\n strategies[strategyName] = strategyFunction;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateSanitizationProvider#removeStrategy\n * @methodOf pascalprecht.translate.$translateSanitizationProvider\n *\n * @description\n * Removes a sanitization strategy from the list of known strategies.\n *\n * @param {string} strategyName - unique key for a strategy\n * @returns {object} this\n */\n this.removeStrategy = function (strategyName) {\n delete strategies[strategyName];\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateSanitizationProvider#useStrategy\n * @methodOf pascalprecht.translate.$translateSanitizationProvider\n *\n * @description\n * Selects a sanitization strategy. When an array is provided the strategies will be executed in order.\n *\n * @param {string|StrategyFunction|array} strategy The sanitization strategy / strategies which should be used. Either a name of an existing strategy, a custom strategy function, or an array consisting of multiple names and / or custom functions.\n * @returns {object} this\n */\n this.useStrategy = function (strategy) {\n hasConfiguredStrategy = true;\n currentStrategy = strategy;\n return this;\n };\n\n /**\n * @ngdoc object\n * @name pascalprecht.translate.$translateSanitization\n * @requires $injector\n * @requires $log\n *\n * @description\n * Sanitizes interpolation parameters and translated texts.\n *\n */\n this.$get = ['$injector', '$log', function ($injector, $log) {\n\n var cachedStrategyMap = {};\n\n var applyStrategies = function (value, mode, context, selectedStrategies) {\n angular.forEach(selectedStrategies, function (selectedStrategy) {\n if (angular.isFunction(selectedStrategy)) {\n value = selectedStrategy(value, mode, context);\n } else if (angular.isFunction(strategies[selectedStrategy])) {\n value = strategies[selectedStrategy](value, mode, context);\n } else if (angular.isString(strategies[selectedStrategy])) {\n if (!cachedStrategyMap[strategies[selectedStrategy]]) {\n try {\n cachedStrategyMap[strategies[selectedStrategy]] = $injector.get(strategies[selectedStrategy]);\n } catch (e) {\n cachedStrategyMap[strategies[selectedStrategy]] = function() {};\n throw new Error('pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: \\'' + selectedStrategy + '\\'');\n }\n }\n value = cachedStrategyMap[strategies[selectedStrategy]](value, mode, context);\n } else {\n throw new Error('pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: \\'' + selectedStrategy + '\\'');\n }\n });\n return value;\n };\n\n // TODO: should be removed in 3.0\n var showNoStrategyConfiguredWarning = function () {\n if (!hasConfiguredStrategy && !hasShownNoStrategyConfiguredWarning) {\n $log.warn('pascalprecht.translate.$translateSanitization: No sanitization strategy has been configured. This can have serious security implications. See http://angular-translate.github.io/docs/#/guide/19_security for details.');\n hasShownNoStrategyConfiguredWarning = true;\n }\n };\n\n if ($injector.has('$sanitize')) {\n $sanitize = $injector.get('$sanitize');\n }\n if ($injector.has('$sce')) {\n $sce = $injector.get('$sce');\n }\n\n return {\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateSanitization#useStrategy\n * @methodOf pascalprecht.translate.$translateSanitization\n *\n * @description\n * Selects a sanitization strategy. When an array is provided the strategies will be executed in order.\n *\n * @param {string|StrategyFunction|array} strategy The sanitization strategy / strategies which should be used. Either a name of an existing strategy, a custom strategy function, or an array consisting of multiple names and / or custom functions.\n */\n useStrategy: (function (self) {\n return function (strategy) {\n self.useStrategy(strategy);\n };\n })(this),\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateSanitization#sanitize\n * @methodOf pascalprecht.translate.$translateSanitization\n *\n * @description\n * Sanitizes a value.\n *\n * @param {string|object} value The value which should be sanitized.\n * @param {string} mode The current sanitization mode, either 'params' or 'text'.\n * @param {string|StrategyFunction|array} [strategy] Optional custom strategy which should be used instead of the currently selected strategy.\n * @param {string} [context] The context of this call: filter, service. Default is service\n * @returns {string|object} sanitized value\n */\n sanitize: function (value, mode, strategy, context) {\n if (!currentStrategy) {\n showNoStrategyConfiguredWarning();\n }\n\n if (!strategy && strategy !== null) {\n strategy = currentStrategy;\n }\n\n if (!strategy) {\n return value;\n }\n\n if (!context) {\n context = 'service';\n }\n\n var selectedStrategies = angular.isArray(strategy) ? strategy : [strategy];\n return applyStrategies(value, mode, context, selectedStrategies);\n }\n };\n }];\n\n var htmlEscapeValue = function (value) {\n var element = angular.element('
    ');\n element.text(value); // not chainable, see #1044\n return element.html();\n };\n\n var htmlSanitizeValue = function (value) {\n if (!$sanitize) {\n throw new Error('pascalprecht.translate.$translateSanitization: Error cannot find $sanitize service. Either include the ngSanitize module (https://docs.angularjs.org/api/ngSanitize) or use a sanitization strategy which does not depend on $sanitize, such as \\'escape\\'.');\n }\n return $sanitize(value);\n };\n\n var htmlTrustValue = function (value) {\n if (!$sce) {\n throw new Error('pascalprecht.translate.$translateSanitization: Error cannot find $sce service.');\n }\n return $sce.trustAsHtml(value);\n };\n\n var mapInterpolationParameters = function (value, iteratee, stack) {\n if (angular.isDate(value)) {\n return value;\n } else if (angular.isObject(value)) {\n var result = angular.isArray(value) ? [] : {};\n\n if (!stack) {\n stack = [];\n } else {\n if (stack.indexOf(value) > -1) {\n throw new Error('pascalprecht.translate.$translateSanitization: Error cannot interpolate parameter due recursive object');\n }\n }\n\n stack.push(value);\n angular.forEach(value, function (propertyValue, propertyKey) {\n\n /* Skipping function properties. */\n if (angular.isFunction(propertyValue)) {\n return;\n }\n\n result[propertyKey] = mapInterpolationParameters(propertyValue, iteratee, stack);\n });\n stack.splice(-1, 1); // remove last\n\n return result;\n } else if (angular.isNumber(value)) {\n return value;\n } else {\n return iteratee(value);\n }\n };\n}\n\n/**\n * @ngdoc object\n * @name pascalprecht.translate.$translateProvider\n * @description\n *\n * $translateProvider allows developers to register translation-tables, asynchronous loaders\n * and similar to configure translation behavior directly inside of a module.\n *\n */\nangular.module('pascalprecht.translate')\n.constant('pascalprechtTranslateOverrider', {})\n.provider('$translate', $translate);\n\nfunction $translate($STORAGE_KEY, $windowProvider, $translateSanitizationProvider, pascalprechtTranslateOverrider) {\n\n 'use strict';\n\n var $translationTable = {},\n $preferredLanguage,\n $availableLanguageKeys = [],\n $languageKeyAliases,\n $fallbackLanguage,\n $fallbackWasString,\n $uses,\n $nextLang,\n $storageFactory,\n $storageKey = $STORAGE_KEY,\n $storagePrefix,\n $missingTranslationHandlerFactory,\n $interpolationFactory,\n $interpolatorFactories = [],\n $loaderFactory,\n $cloakClassName = 'translate-cloak',\n $loaderOptions,\n $notFoundIndicatorLeft,\n $notFoundIndicatorRight,\n $postCompilingEnabled = false,\n $forceAsyncReloadEnabled = false,\n $nestedObjectDelimeter = '.',\n $isReady = false,\n $keepContent = false,\n loaderCache,\n directivePriority = 0,\n statefulFilter = true,\n postProcessFn,\n uniformLanguageTagResolver = 'default',\n languageTagResolver = {\n 'default': function (tag) {\n return (tag || '').split('-').join('_');\n },\n java: function (tag) {\n var temp = (tag || '').split('-').join('_');\n var parts = temp.split('_');\n return parts.length > 1 ? (parts[0].toLowerCase() + '_' + parts[1].toUpperCase()) : temp;\n },\n bcp47: function (tag) {\n var temp = (tag || '').split('_').join('-');\n var parts = temp.split('-');\n return parts.length > 1 ? (parts[0].toLowerCase() + '-' + parts[1].toUpperCase()) : temp;\n },\n 'iso639-1': function (tag) {\n var temp = (tag || '').split('_').join('-');\n var parts = temp.split('-');\n return parts[0].toLowerCase();\n }\n };\n\n var version = '2.12.1';\n\n // tries to determine the browsers language\n var getFirstBrowserLanguage = function () {\n\n // internal purpose only\n if (angular.isFunction(pascalprechtTranslateOverrider.getLocale)) {\n return pascalprechtTranslateOverrider.getLocale();\n }\n\n var nav = $windowProvider.$get().navigator,\n browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'],\n i,\n language;\n\n // support for HTML 5.1 \"navigator.languages\"\n if (angular.isArray(nav.languages)) {\n for (i = 0; i < nav.languages.length; i++) {\n language = nav.languages[i];\n if (language && language.length) {\n return language;\n }\n }\n }\n\n // support for other well known properties in browsers\n for (i = 0; i < browserLanguagePropertyKeys.length; i++) {\n language = nav[browserLanguagePropertyKeys[i]];\n if (language && language.length) {\n return language;\n }\n }\n\n return null;\n };\n getFirstBrowserLanguage.displayName = 'angular-translate/service: getFirstBrowserLanguage';\n\n // tries to determine the browsers locale\n var getLocale = function () {\n var locale = getFirstBrowserLanguage() || '';\n if (languageTagResolver[uniformLanguageTagResolver]) {\n locale = languageTagResolver[uniformLanguageTagResolver](locale);\n }\n return locale;\n };\n getLocale.displayName = 'angular-translate/service: getLocale';\n\n /**\n * @name indexOf\n * @private\n *\n * @description\n * indexOf polyfill. Kinda sorta.\n *\n * @param {array} array Array to search in.\n * @param {string} searchElement Element to search for.\n *\n * @returns {int} Index of search element.\n */\n var indexOf = function(array, searchElement) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === searchElement) {\n return i;\n }\n }\n return -1;\n };\n\n /**\n * @name trim\n * @private\n *\n * @description\n * trim polyfill\n *\n * @returns {string} The string stripped of whitespace from both ends\n */\n var trim = function() {\n return this.toString().replace(/^\\s+|\\s+$/g, '');\n };\n\n var negotiateLocale = function (preferred) {\n if(!preferred) {\n return;\n }\n\n var avail = [],\n locale = angular.lowercase(preferred),\n i = 0,\n n = $availableLanguageKeys.length;\n\n for (; i < n; i++) {\n avail.push(angular.lowercase($availableLanguageKeys[i]));\n }\n\n // Check for an exact match in our list of available keys\n if (indexOf(avail, locale) > -1) {\n return preferred;\n }\n\n if ($languageKeyAliases) {\n var alias;\n for (var langKeyAlias in $languageKeyAliases) {\n if ($languageKeyAliases.hasOwnProperty(langKeyAlias)) {\n var hasWildcardKey = false;\n var hasExactKey = Object.prototype.hasOwnProperty.call($languageKeyAliases, langKeyAlias) &&\n angular.lowercase(langKeyAlias) === angular.lowercase(preferred);\n\n if (langKeyAlias.slice(-1) === '*') {\n hasWildcardKey = langKeyAlias.slice(0, -1) === preferred.slice(0, langKeyAlias.length - 1);\n }\n if (hasExactKey || hasWildcardKey) {\n alias = $languageKeyAliases[langKeyAlias];\n if (indexOf(avail, angular.lowercase(alias)) > -1) {\n return alias;\n }\n }\n }\n }\n }\n\n // Check for a language code without region\n var parts = preferred.split('_');\n\n if (parts.length > 1 && indexOf(avail, angular.lowercase(parts[0])) > -1) {\n return parts[0];\n }\n\n // If everything fails, return undefined.\n return;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#translations\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Registers a new translation table for specific language key.\n *\n * To register a translation table for specific language, pass a defined language\n * key as first parameter.\n *\n *
    \n   *  // register translation table for language: 'de_DE'\n   *  $translateProvider.translations('de_DE', {\n   *    'GREETING': 'Hallo Welt!'\n   *  });\n   *\n   *  // register another one\n   *  $translateProvider.translations('en_US', {\n   *    'GREETING': 'Hello world!'\n   *  });\n   * 
    \n *\n * When registering multiple translation tables for for the same language key,\n * the actual translation table gets extended. This allows you to define module\n * specific translation which only get added, once a specific module is loaded in\n * your app.\n *\n * Invoking this method with no arguments returns the translation table which was\n * registered with no language key. Invoking it with a language key returns the\n * related translation table.\n *\n * @param {string} langKey A language key.\n * @param {object} translationTable A plain old JavaScript object that represents a translation table.\n *\n */\n var translations = function (langKey, translationTable) {\n\n if (!langKey && !translationTable) {\n return $translationTable;\n }\n\n if (langKey && !translationTable) {\n if (angular.isString(langKey)) {\n return $translationTable[langKey];\n }\n } else {\n if (!angular.isObject($translationTable[langKey])) {\n $translationTable[langKey] = {};\n }\n angular.extend($translationTable[langKey], flatObject(translationTable));\n }\n return this;\n };\n\n this.translations = translations;\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#cloakClassName\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n *\n * Let's you change the class name for `translate-cloak` directive.\n * Default class name is `translate-cloak`.\n *\n * @param {string} name translate-cloak class name\n */\n this.cloakClassName = function (name) {\n if (!name) {\n return $cloakClassName;\n }\n $cloakClassName = name;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#nestedObjectDelimeter\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n *\n * Let's you change the delimiter for namespaced translations.\n * Default delimiter is `.`.\n *\n * @param {string} delimiter namespace separator\n */\n this.nestedObjectDelimeter = function (delimiter) {\n if (!delimiter) {\n return $nestedObjectDelimeter;\n }\n $nestedObjectDelimeter = delimiter;\n return this;\n };\n\n /**\n * @name flatObject\n * @private\n *\n * @description\n * Flats an object. This function is used to flatten given translation data with\n * namespaces, so they are later accessible via dot notation.\n */\n var flatObject = function (data, path, result, prevKey) {\n var key, keyWithPath, keyWithShortPath, val;\n\n if (!path) {\n path = [];\n }\n if (!result) {\n result = {};\n }\n for (key in data) {\n if (!Object.prototype.hasOwnProperty.call(data, key)) {\n continue;\n }\n val = data[key];\n if (angular.isObject(val)) {\n flatObject(val, path.concat(key), result, key);\n } else {\n keyWithPath = path.length ? ('' + path.join($nestedObjectDelimeter) + $nestedObjectDelimeter + key) : key;\n if(path.length && key === prevKey){\n // Create shortcut path (foo.bar == foo.bar.bar)\n keyWithShortPath = '' + path.join($nestedObjectDelimeter);\n // Link it to original path\n result[keyWithShortPath] = '@:' + keyWithPath;\n }\n result[keyWithPath] = val;\n }\n }\n return result;\n };\n flatObject.displayName = 'flatObject';\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#addInterpolation\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Adds interpolation services to angular-translate, so it can manage them.\n *\n * @param {object} factory Interpolation service factory\n */\n this.addInterpolation = function (factory) {\n $interpolatorFactories.push(factory);\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useMessageFormatInterpolation\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use interpolation functionality of messageformat.js.\n * This is useful when having high level pluralization and gender selection.\n */\n this.useMessageFormatInterpolation = function () {\n return this.useInterpolation('$translateMessageFormatInterpolation');\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useInterpolation\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate which interpolation style to use as default, application-wide.\n * Simply pass a factory/service name. The interpolation service has to implement\n * the correct interface.\n *\n * @param {string} factory Interpolation service name.\n */\n this.useInterpolation = function (factory) {\n $interpolationFactory = factory;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useSanitizeStrategy\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Simply sets a sanitation strategy type.\n *\n * @param {string} value Strategy type.\n */\n this.useSanitizeValueStrategy = function (value) {\n $translateSanitizationProvider.useStrategy(value);\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#preferredLanguage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells the module which of the registered translation tables to use for translation\n * at initial startup by passing a language key. Similar to `$translateProvider#use`\n * only that it says which language to **prefer**.\n *\n * @param {string} langKey A language key.\n */\n this.preferredLanguage = function(langKey) {\n if (langKey) {\n setupPreferredLanguage(langKey);\n return this;\n }\n return $preferredLanguage;\n };\n var setupPreferredLanguage = function (langKey) {\n if (langKey) {\n $preferredLanguage = langKey;\n }\n return $preferredLanguage;\n };\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#translationNotFoundIndicator\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Sets an indicator which is used when a translation isn't found. E.g. when\n * setting the indicator as 'X' and one tries to translate a translation id\n * called `NOT_FOUND`, this will result in `X NOT_FOUND X`.\n *\n * Internally this methods sets a left indicator and a right indicator using\n * `$translateProvider.translationNotFoundIndicatorLeft()` and\n * `$translateProvider.translationNotFoundIndicatorRight()`.\n *\n * **Note**: These methods automatically add a whitespace between the indicators\n * and the translation id.\n *\n * @param {string} indicator An indicator, could be any string.\n */\n this.translationNotFoundIndicator = function (indicator) {\n this.translationNotFoundIndicatorLeft(indicator);\n this.translationNotFoundIndicatorRight(indicator);\n return this;\n };\n\n /**\n * ngdoc function\n * @name pascalprecht.translate.$translateProvider#translationNotFoundIndicatorLeft\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Sets an indicator which is used when a translation isn't found left to the\n * translation id.\n *\n * @param {string} indicator An indicator.\n */\n this.translationNotFoundIndicatorLeft = function (indicator) {\n if (!indicator) {\n return $notFoundIndicatorLeft;\n }\n $notFoundIndicatorLeft = indicator;\n return this;\n };\n\n /**\n * ngdoc function\n * @name pascalprecht.translate.$translateProvider#translationNotFoundIndicatorLeft\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Sets an indicator which is used when a translation isn't found right to the\n * translation id.\n *\n * @param {string} indicator An indicator.\n */\n this.translationNotFoundIndicatorRight = function (indicator) {\n if (!indicator) {\n return $notFoundIndicatorRight;\n }\n $notFoundIndicatorRight = indicator;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#fallbackLanguage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells the module which of the registered translation tables to use when missing translations\n * at initial startup by passing a language key. Similar to `$translateProvider#use`\n * only that it says which language to **fallback**.\n *\n * @param {string||array} langKey A language key.\n *\n */\n this.fallbackLanguage = function (langKey) {\n fallbackStack(langKey);\n return this;\n };\n\n var fallbackStack = function (langKey) {\n if (langKey) {\n if (angular.isString(langKey)) {\n $fallbackWasString = true;\n $fallbackLanguage = [ langKey ];\n } else if (angular.isArray(langKey)) {\n $fallbackWasString = false;\n $fallbackLanguage = langKey;\n }\n if (angular.isString($preferredLanguage) && indexOf($fallbackLanguage, $preferredLanguage) < 0) {\n $fallbackLanguage.push($preferredLanguage);\n }\n\n return this;\n } else {\n if ($fallbackWasString) {\n return $fallbackLanguage[0];\n } else {\n return $fallbackLanguage;\n }\n }\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#use\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Set which translation table to use for translation by given language key. When\n * trying to 'use' a language which isn't provided, it'll throw an error.\n *\n * You actually don't have to use this method since `$translateProvider#preferredLanguage`\n * does the job too.\n *\n * @param {string} langKey A language key.\n */\n this.use = function (langKey) {\n if (langKey) {\n if (!$translationTable[langKey] && (!$loaderFactory)) {\n // only throw an error, when not loading translation data asynchronously\n throw new Error('$translateProvider couldn\\'t find translationTable for langKey: \\'' + langKey + '\\'');\n }\n $uses = langKey;\n return this;\n }\n return $uses;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#resolveClientLocale\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * This returns the current browser/client's language key. The result is processed with the configured uniform tag resolver.\n *\n * @returns {string} the current client/browser language key\n */\n this.resolveClientLocale = function () {\n return getLocale();\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#storageKey\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells the module which key must represent the choosed language by a user in the storage.\n *\n * @param {string} key A key for the storage.\n */\n var storageKey = function(key) {\n if (!key) {\n if ($storagePrefix) {\n return $storagePrefix + $storageKey;\n }\n return $storageKey;\n }\n $storageKey = key;\n return this;\n };\n\n this.storageKey = storageKey;\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useUrlLoader\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use `$translateUrlLoader` extension service as loader.\n *\n * @param {string} url Url\n * @param {Object=} options Optional configuration object\n */\n this.useUrlLoader = function (url, options) {\n return this.useLoader('$translateUrlLoader', angular.extend({ url: url }, options));\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useStaticFilesLoader\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use `$translateStaticFilesLoader` extension service as loader.\n *\n * @param {Object=} options Optional configuration object\n */\n this.useStaticFilesLoader = function (options) {\n return this.useLoader('$translateStaticFilesLoader', options);\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useLoader\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use any other service as loader.\n *\n * @param {string} loaderFactory Factory name to use\n * @param {Object=} options Optional configuration object\n */\n this.useLoader = function (loaderFactory, options) {\n $loaderFactory = loaderFactory;\n $loaderOptions = options || {};\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useLocalStorage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use `$translateLocalStorage` service as storage layer.\n *\n */\n this.useLocalStorage = function () {\n return this.useStorage('$translateLocalStorage');\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useCookieStorage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use `$translateCookieStorage` service as storage layer.\n */\n this.useCookieStorage = function () {\n return this.useStorage('$translateCookieStorage');\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useStorage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use custom service as storage layer.\n */\n this.useStorage = function (storageFactory) {\n $storageFactory = storageFactory;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#storagePrefix\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Sets prefix for storage key.\n *\n * @param {string} prefix Storage key prefix\n */\n this.storagePrefix = function (prefix) {\n if (!prefix) {\n return prefix;\n }\n $storagePrefix = prefix;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useMissingTranslationHandlerLog\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to use built-in log handler when trying to translate\n * a translation Id which doesn't exist.\n *\n * This is actually a shortcut method for `useMissingTranslationHandler()`.\n *\n */\n this.useMissingTranslationHandlerLog = function () {\n return this.useMissingTranslationHandler('$translateMissingTranslationHandlerLog');\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useMissingTranslationHandler\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Expects a factory name which later gets instantiated with `$injector`.\n * This method can be used to tell angular-translate to use a custom\n * missingTranslationHandler. Just build a factory which returns a function\n * and expects a translation id as argument.\n *\n * Example:\n *
    \n   *  app.config(function ($translateProvider) {\n   *    $translateProvider.useMissingTranslationHandler('customHandler');\n   *  });\n   *\n   *  app.factory('customHandler', function (dep1, dep2) {\n   *    return function (translationId) {\n   *      // something with translationId and dep1 and dep2\n   *    };\n   *  });\n   * 
    \n *\n * @param {string} factory Factory name\n */\n this.useMissingTranslationHandler = function (factory) {\n $missingTranslationHandlerFactory = factory;\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#usePostCompiling\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * If post compiling is enabled, all translated values will be processed\n * again with AngularJS' $compile.\n *\n * Example:\n *
    \n   *  app.config(function ($translateProvider) {\n   *    $translateProvider.usePostCompiling(true);\n   *  });\n   * 
    \n *\n * @param {string} factory Factory name\n */\n this.usePostCompiling = function (value) {\n $postCompilingEnabled = !(!value);\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#forceAsyncReload\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * If force async reload is enabled, async loader will always be called\n * even if $translationTable already contains the language key, adding\n * possible new entries to the $translationTable.\n *\n * Example:\n *
    \n   *  app.config(function ($translateProvider) {\n   *    $translateProvider.forceAsyncReload(true);\n   *  });\n   * 
    \n *\n * @param {boolean} value - valid values are true or false\n */\n this.forceAsyncReload = function (value) {\n $forceAsyncReloadEnabled = !(!value);\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#uniformLanguageTag\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate which language tag should be used as a result when determining\n * the current browser language.\n *\n * This setting must be set before invoking {@link pascalprecht.translate.$translateProvider#methods_determinePreferredLanguage determinePreferredLanguage()}.\n *\n *
    \n   * $translateProvider\n   *   .uniformLanguageTag('bcp47')\n   *   .determinePreferredLanguage()\n   * 
    \n *\n * The resolver currently supports:\n * * default\n * (traditionally: hyphens will be converted into underscores, i.e. en-US => en_US)\n * en-US => en_US\n * en_US => en_US\n * en-us => en_us\n * * java\n * like default, but the second part will be always in uppercase\n * en-US => en_US\n * en_US => en_US\n * en-us => en_US\n * * BCP 47 (RFC 4646 & 4647)\n * en-US => en-US\n * en_US => en-US\n * en-us => en-US\n *\n * See also:\n * * http://en.wikipedia.org/wiki/IETF_language_tag\n * * http://www.w3.org/International/core/langtags/\n * * http://tools.ietf.org/html/bcp47\n *\n * @param {string|object} options - options (or standard)\n * @param {string} options.standard - valid values are 'default', 'bcp47', 'java'\n */\n this.uniformLanguageTag = function (options) {\n\n if (!options) {\n options = {};\n } else if (angular.isString(options)) {\n options = {\n standard: options\n };\n }\n\n uniformLanguageTagResolver = options.standard;\n\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#determinePreferredLanguage\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Tells angular-translate to try to determine on its own which language key\n * to set as preferred language. When `fn` is given, angular-translate uses it\n * to determine a language key, otherwise it uses the built-in `getLocale()`\n * method.\n *\n * The `getLocale()` returns a language key in the format `[lang]_[country]` or\n * `[lang]` depending on what the browser provides.\n *\n * Use this method at your own risk, since not all browsers return a valid\n * locale (see {@link pascalprecht.translate.$translateProvider#methods_uniformLanguageTag uniformLanguageTag()}).\n *\n * @param {Function=} fn Function to determine a browser's locale\n */\n this.determinePreferredLanguage = function (fn) {\n\n var locale = (fn && angular.isFunction(fn)) ? fn() : getLocale();\n\n if (!$availableLanguageKeys.length) {\n $preferredLanguage = locale;\n } else {\n $preferredLanguage = negotiateLocale(locale) || locale;\n }\n\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#registerAvailableLanguageKeys\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Registers a set of language keys the app will work with. Use this method in\n * combination with\n * {@link pascalprecht.translate.$translateProvider#determinePreferredLanguage determinePreferredLanguage}.\n * When available languages keys are registered, angular-translate\n * tries to find the best fitting language key depending on the browsers locale,\n * considering your language key convention.\n *\n * @param {object} languageKeys Array of language keys the your app will use\n * @param {object=} aliases Alias map.\n */\n this.registerAvailableLanguageKeys = function (languageKeys, aliases) {\n if (languageKeys) {\n $availableLanguageKeys = languageKeys;\n if (aliases) {\n $languageKeyAliases = aliases;\n }\n return this;\n }\n return $availableLanguageKeys;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#useLoaderCache\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Registers a cache for internal $http based loaders.\n * {@link pascalprecht.translate.$translationCache $translationCache}.\n * When false the cache will be disabled (default). When true or undefined\n * the cache will be a default (see $cacheFactory). When an object it will\n * be treat as a cache object itself: the usage is $http({cache: cache})\n *\n * @param {object} cache boolean, string or cache-object\n */\n this.useLoaderCache = function (cache) {\n if (cache === false) {\n // disable cache\n loaderCache = undefined;\n } else if (cache === true) {\n // enable cache using AJS defaults\n loaderCache = true;\n } else if (typeof(cache) === 'undefined') {\n // enable cache using default\n loaderCache = '$translationCache';\n } else if (cache) {\n // enable cache using given one (see $cacheFactory)\n loaderCache = cache;\n }\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#directivePriority\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Sets the default priority of the translate directive. The standard value is `0`.\n * Calling this function without an argument will return the current value.\n *\n * @param {number} priority for the translate-directive\n */\n this.directivePriority = function (priority) {\n if (priority === undefined) {\n // getter\n return directivePriority;\n } else {\n // setter with chaining\n directivePriority = priority;\n return this;\n }\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#statefulFilter\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * Since AngularJS 1.3, filters which are not stateless (depending at the scope)\n * have to explicit define this behavior.\n * Sets whether the translate filter should be stateful or stateless. The standard value is `true`\n * meaning being stateful.\n * Calling this function without an argument will return the current value.\n *\n * @param {boolean} state - defines the state of the filter\n */\n this.statefulFilter = function (state) {\n if (state === undefined) {\n // getter\n return statefulFilter;\n } else {\n // setter with chaining\n statefulFilter = state;\n return this;\n }\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#postProcess\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * The post processor will be intercept right after the translation result. It can modify the result.\n *\n * @param {object} fn Function or service name (string) to be called after the translation value has been set / resolved. The function itself will enrich every value being processed and then continue the normal resolver process\n */\n this.postProcess = function (fn) {\n if (fn) {\n postProcessFn = fn;\n } else {\n postProcessFn = undefined;\n }\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateProvider#keepContent\n * @methodOf pascalprecht.translate.$translateProvider\n *\n * @description\n * If keepContent is set to true than translate directive will always use innerHTML\n * as a default translation\n *\n * Example:\n *
    \n   *  app.config(function ($translateProvider) {\n   *    $translateProvider.keepContent(true);\n   *  });\n   * 
    \n *\n * @param {boolean} value - valid values are true or false\n */\n this.keepContent = function (value) {\n $keepContent = !(!value);\n return this;\n };\n\n /**\n * @ngdoc object\n * @name pascalprecht.translate.$translate\n * @requires $interpolate\n * @requires $log\n * @requires $rootScope\n * @requires $q\n *\n * @description\n * The `$translate` service is the actual core of angular-translate. It expects a translation id\n * and optional interpolate parameters to translate contents.\n *\n *
    \n   *  $translate('HEADLINE_TEXT').then(function (translation) {\n   *    $scope.translatedText = translation;\n   *  });\n   * 
    \n *\n * @param {string|array} translationId A token which represents a translation id\n * This can be optionally an array of translation ids which\n * results that the function returns an object where each key\n * is the translation id and the value the translation.\n * @param {object=} interpolateParams An object hash for dynamic values\n * @param {string} interpolationId The id of the interpolation to use\n * @param {string} defaultTranslationText the optional default translation text that is written as\n * as default text in case it is not found in any configured language\n * @param {string} forceLanguage A language to be used instead of the current language\n * @returns {object} promise\n */\n this.$get = [\n '$log',\n '$injector',\n '$rootScope',\n '$q',\n function ($log, $injector, $rootScope, $q) {\n\n var Storage,\n defaultInterpolator = $injector.get($interpolationFactory || '$translateDefaultInterpolation'),\n pendingLoader = false,\n interpolatorHashMap = {},\n langPromises = {},\n fallbackIndex,\n startFallbackIteration;\n\n var $translate = function (translationId, interpolateParams, interpolationId, defaultTranslationText, forceLanguage) {\n if (!$uses && $preferredLanguage) {\n $uses = $preferredLanguage;\n }\n var uses = (forceLanguage && forceLanguage !== $uses) ? // we don't want to re-negotiate $uses\n (negotiateLocale(forceLanguage) || forceLanguage) : $uses;\n\n // Check forceLanguage is present\n if (forceLanguage) {\n loadTranslationsIfMissing(forceLanguage);\n }\n\n // Duck detection: If the first argument is an array, a bunch of translations was requested.\n // The result is an object.\n if (angular.isArray(translationId)) {\n // Inspired by Q.allSettled by Kris Kowal\n // https://github.com/kriskowal/q/blob/b0fa72980717dc202ffc3cbf03b936e10ebbb9d7/q.js#L1553-1563\n // This transforms all promises regardless resolved or rejected\n var translateAll = function (translationIds) {\n var results = {}; // storing the actual results\n var promises = []; // promises to wait for\n // Wraps the promise a) being always resolved and b) storing the link id->value\n var translate = function (translationId) {\n var deferred = $q.defer();\n var regardless = function (value) {\n results[translationId] = value;\n deferred.resolve([translationId, value]);\n };\n // we don't care whether the promise was resolved or rejected; just store the values\n $translate(translationId, interpolateParams, interpolationId, defaultTranslationText, forceLanguage).then(regardless, regardless);\n return deferred.promise;\n };\n for (var i = 0, c = translationIds.length; i < c; i++) {\n promises.push(translate(translationIds[i]));\n }\n // wait for all (including storing to results)\n return $q.all(promises).then(function () {\n // return the results\n return results;\n });\n };\n return translateAll(translationId);\n }\n\n var deferred = $q.defer();\n\n // trim off any whitespace\n if (translationId) {\n translationId = trim.apply(translationId);\n }\n\n var promiseToWaitFor = (function () {\n var promise = $preferredLanguage ?\n langPromises[$preferredLanguage] :\n langPromises[uses];\n\n fallbackIndex = 0;\n\n if ($storageFactory && !promise) {\n // looks like there's no pending promise for $preferredLanguage or\n // $uses. Maybe there's one pending for a language that comes from\n // storage.\n var langKey = Storage.get($storageKey);\n promise = langPromises[langKey];\n\n if ($fallbackLanguage && $fallbackLanguage.length) {\n var index = indexOf($fallbackLanguage, langKey);\n // maybe the language from storage is also defined as fallback language\n // we increase the fallback language index to not search in that language\n // as fallback, since it's probably the first used language\n // in that case the index starts after the first element\n fallbackIndex = (index === 0) ? 1 : 0;\n\n // but we can make sure to ALWAYS fallback to preferred language at least\n if (indexOf($fallbackLanguage, $preferredLanguage) < 0) {\n $fallbackLanguage.push($preferredLanguage);\n }\n }\n }\n return promise;\n }());\n\n if (!promiseToWaitFor) {\n // no promise to wait for? okay. Then there's no loader registered\n // nor is a one pending for language that comes from storage.\n // We can just translate.\n determineTranslation(translationId, interpolateParams, interpolationId, defaultTranslationText, uses).then(deferred.resolve, deferred.reject);\n } else {\n var promiseResolved = function () {\n // $uses may have changed while waiting\n if (!forceLanguage) {\n uses = $uses;\n }\n determineTranslation(translationId, interpolateParams, interpolationId, defaultTranslationText, uses).then(deferred.resolve, deferred.reject);\n };\n promiseResolved.displayName = 'promiseResolved';\n\n promiseToWaitFor['finally'](promiseResolved);\n }\n return deferred.promise;\n };\n\n /**\n * @name applyNotFoundIndicators\n * @private\n *\n * @description\n * Applies not fount indicators to given translation id, if needed.\n * This function gets only executed, if a translation id doesn't exist,\n * which is why a translation id is expected as argument.\n *\n * @param {string} translationId Translation id.\n * @returns {string} Same as given translation id but applied with not found\n * indicators.\n */\n var applyNotFoundIndicators = function (translationId) {\n // applying notFoundIndicators\n if ($notFoundIndicatorLeft) {\n translationId = [$notFoundIndicatorLeft, translationId].join(' ');\n }\n if ($notFoundIndicatorRight) {\n translationId = [translationId, $notFoundIndicatorRight].join(' ');\n }\n return translationId;\n };\n\n /**\n * @name useLanguage\n * @private\n *\n * @description\n * Makes actual use of a language by setting a given language key as used\n * language and informs registered interpolators to also use the given\n * key as locale.\n *\n * @param {string} key Locale key.\n */\n var useLanguage = function (key) {\n $uses = key;\n\n // make sure to store new language key before triggering success event\n if ($storageFactory) {\n Storage.put($translate.storageKey(), $uses);\n }\n\n $rootScope.$emit('$translateChangeSuccess', {language: key});\n\n // inform default interpolator\n defaultInterpolator.setLocale($uses);\n\n var eachInterpolator = function (interpolator, id) {\n interpolatorHashMap[id].setLocale($uses);\n };\n eachInterpolator.displayName = 'eachInterpolatorLocaleSetter';\n\n // inform all others too!\n angular.forEach(interpolatorHashMap, eachInterpolator);\n $rootScope.$emit('$translateChangeEnd', {language: key});\n };\n\n /**\n * @name loadAsync\n * @private\n *\n * @description\n * Kicks of registered async loader using `$injector` and applies existing\n * loader options. When resolved, it updates translation tables accordingly\n * or rejects with given language key.\n *\n * @param {string} key Language key.\n * @return {Promise} A promise.\n */\n var loadAsync = function (key) {\n if (!key) {\n throw 'No language key specified for loading.';\n }\n\n var deferred = $q.defer();\n\n $rootScope.$emit('$translateLoadingStart', {language: key});\n pendingLoader = true;\n\n var cache = loaderCache;\n if (typeof(cache) === 'string') {\n // getting on-demand instance of loader\n cache = $injector.get(cache);\n }\n\n var loaderOptions = angular.extend({}, $loaderOptions, {\n key: key,\n $http: angular.extend({}, {\n cache: cache\n }, $loaderOptions.$http)\n });\n\n var onLoaderSuccess = function (data) {\n var translationTable = {};\n $rootScope.$emit('$translateLoadingSuccess', {language: key});\n\n if (angular.isArray(data)) {\n angular.forEach(data, function (table) {\n angular.extend(translationTable, flatObject(table));\n });\n } else {\n angular.extend(translationTable, flatObject(data));\n }\n pendingLoader = false;\n deferred.resolve({\n key: key,\n table: translationTable\n });\n $rootScope.$emit('$translateLoadingEnd', {language: key});\n };\n onLoaderSuccess.displayName = 'onLoaderSuccess';\n\n var onLoaderError = function (key) {\n $rootScope.$emit('$translateLoadingError', {language: key});\n deferred.reject(key);\n $rootScope.$emit('$translateLoadingEnd', {language: key});\n };\n onLoaderError.displayName = 'onLoaderError';\n\n $injector.get($loaderFactory)(loaderOptions)\n .then(onLoaderSuccess, onLoaderError);\n\n return deferred.promise;\n };\n\n if ($storageFactory) {\n Storage = $injector.get($storageFactory);\n\n if (!Storage.get || !Storage.put) {\n throw new Error('Couldn\\'t use storage \\'' + $storageFactory + '\\', missing get() or put() method!');\n }\n }\n\n // if we have additional interpolations that were added via\n // $translateProvider.addInterpolation(), we have to map'em\n if ($interpolatorFactories.length) {\n var eachInterpolationFactory = function (interpolatorFactory) {\n var interpolator = $injector.get(interpolatorFactory);\n // setting initial locale for each interpolation service\n interpolator.setLocale($preferredLanguage || $uses);\n // make'em recognizable through id\n interpolatorHashMap[interpolator.getInterpolationIdentifier()] = interpolator;\n };\n eachInterpolationFactory.displayName = 'interpolationFactoryAdder';\n\n angular.forEach($interpolatorFactories, eachInterpolationFactory);\n }\n\n /**\n * @name getTranslationTable\n * @private\n *\n * @description\n * Returns a promise that resolves to the translation table\n * or is rejected if an error occurred.\n *\n * @param langKey\n * @returns {Q.promise}\n */\n var getTranslationTable = function (langKey) {\n var deferred = $q.defer();\n if (Object.prototype.hasOwnProperty.call($translationTable, langKey)) {\n deferred.resolve($translationTable[langKey]);\n } else if (langPromises[langKey]) {\n var onResolve = function (data) {\n translations(data.key, data.table);\n deferred.resolve(data.table);\n };\n onResolve.displayName = 'translationTableResolver';\n langPromises[langKey].then(onResolve, deferred.reject);\n } else {\n deferred.reject();\n }\n return deferred.promise;\n };\n\n /**\n * @name getFallbackTranslation\n * @private\n *\n * @description\n * Returns a promise that will resolve to the translation\n * or be rejected if no translation was found for the language.\n * This function is currently only used for fallback language translation.\n *\n * @param langKey The language to translate to.\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {Q.promise}\n */\n var getFallbackTranslation = function (langKey, translationId, interpolateParams, Interpolator) {\n var deferred = $q.defer();\n\n var onResolve = function (translationTable) {\n if (Object.prototype.hasOwnProperty.call(translationTable, translationId)) {\n Interpolator.setLocale(langKey);\n var translation = translationTable[translationId];\n if (translation.substr(0, 2) === '@:') {\n getFallbackTranslation(langKey, translation.substr(2), interpolateParams, Interpolator)\n .then(deferred.resolve, deferred.reject);\n } else {\n var interpolatedValue = Interpolator.interpolate(translationTable[translationId], interpolateParams, 'service');\n interpolatedValue = applyPostProcessing(translationId, translationTable[translationId], interpolatedValue, interpolateParams, langKey);\n\n deferred.resolve(interpolatedValue);\n\n }\n Interpolator.setLocale($uses);\n } else {\n deferred.reject();\n }\n };\n onResolve.displayName = 'fallbackTranslationResolver';\n\n getTranslationTable(langKey).then(onResolve, deferred.reject);\n\n return deferred.promise;\n };\n\n /**\n * @name getFallbackTranslationInstant\n * @private\n *\n * @description\n * Returns a translation\n * This function is currently only used for fallback language translation.\n *\n * @param langKey The language to translate to.\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {string} translation\n */\n var getFallbackTranslationInstant = function (langKey, translationId, interpolateParams, Interpolator) {\n var result, translationTable = $translationTable[langKey];\n\n if (translationTable && Object.prototype.hasOwnProperty.call(translationTable, translationId)) {\n Interpolator.setLocale(langKey);\n result = Interpolator.interpolate(translationTable[translationId], interpolateParams, 'filter');\n result = applyPostProcessing(translationId, translationTable[translationId], result, interpolateParams, langKey);\n if (result.substr(0, 2) === '@:') {\n return getFallbackTranslationInstant(langKey, result.substr(2), interpolateParams, Interpolator);\n }\n Interpolator.setLocale($uses);\n }\n\n return result;\n };\n\n\n /**\n * @name translateByHandler\n * @private\n *\n * Translate by missing translation handler.\n *\n * @param translationId\n * @param interpolateParams\n * @param defaultTranslationText\n * @returns translation created by $missingTranslationHandler or translationId is $missingTranslationHandler is\n * absent\n */\n var translateByHandler = function (translationId, interpolateParams, defaultTranslationText) {\n // If we have a handler factory - we might also call it here to determine if it provides\n // a default text for a translationid that can't be found anywhere in our tables\n if ($missingTranslationHandlerFactory) {\n var resultString = $injector.get($missingTranslationHandlerFactory)(translationId, $uses, interpolateParams, defaultTranslationText);\n if (resultString !== undefined) {\n return resultString;\n } else {\n return translationId;\n }\n } else {\n return translationId;\n }\n };\n\n /**\n * @name resolveForFallbackLanguage\n * @private\n *\n * Recursive helper function for fallbackTranslation that will sequentially look\n * for a translation in the fallbackLanguages starting with fallbackLanguageIndex.\n *\n * @param fallbackLanguageIndex\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {Q.promise} Promise that will resolve to the translation.\n */\n var resolveForFallbackLanguage = function (fallbackLanguageIndex, translationId, interpolateParams, Interpolator, defaultTranslationText) {\n var deferred = $q.defer();\n\n if (fallbackLanguageIndex < $fallbackLanguage.length) {\n var langKey = $fallbackLanguage[fallbackLanguageIndex];\n getFallbackTranslation(langKey, translationId, interpolateParams, Interpolator).then(\n function (data) {\n deferred.resolve(data);\n },\n function () {\n // Look in the next fallback language for a translation.\n // It delays the resolving by passing another promise to resolve.\n return resolveForFallbackLanguage(fallbackLanguageIndex + 1, translationId, interpolateParams, Interpolator, defaultTranslationText).then(deferred.resolve, deferred.reject);\n }\n );\n } else {\n // No translation found in any fallback language\n // if a default translation text is set in the directive, then return this as a result\n if (defaultTranslationText) {\n deferred.resolve(defaultTranslationText);\n } else {\n // if no default translation is set and an error handler is defined, send it to the handler\n // and then return the result\n if ($missingTranslationHandlerFactory) {\n deferred.resolve(translateByHandler(translationId, interpolateParams));\n } else {\n deferred.reject(translateByHandler(translationId, interpolateParams));\n }\n\n }\n }\n return deferred.promise;\n };\n\n /**\n * @name resolveForFallbackLanguageInstant\n * @private\n *\n * Recursive helper function for fallbackTranslation that will sequentially look\n * for a translation in the fallbackLanguages starting with fallbackLanguageIndex.\n *\n * @param fallbackLanguageIndex\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {string} translation\n */\n var resolveForFallbackLanguageInstant = function (fallbackLanguageIndex, translationId, interpolateParams, Interpolator) {\n var result;\n\n if (fallbackLanguageIndex < $fallbackLanguage.length) {\n var langKey = $fallbackLanguage[fallbackLanguageIndex];\n result = getFallbackTranslationInstant(langKey, translationId, interpolateParams, Interpolator);\n if (!result) {\n result = resolveForFallbackLanguageInstant(fallbackLanguageIndex + 1, translationId, interpolateParams, Interpolator);\n }\n }\n return result;\n };\n\n /**\n * Translates with the usage of the fallback languages.\n *\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {Q.promise} Promise, that resolves to the translation.\n */\n var fallbackTranslation = function (translationId, interpolateParams, Interpolator, defaultTranslationText) {\n // Start with the fallbackLanguage with index 0\n return resolveForFallbackLanguage((startFallbackIteration>0 ? startFallbackIteration : fallbackIndex), translationId, interpolateParams, Interpolator, defaultTranslationText);\n };\n\n /**\n * Translates with the usage of the fallback languages.\n *\n * @param translationId\n * @param interpolateParams\n * @param Interpolator\n * @returns {String} translation\n */\n var fallbackTranslationInstant = function (translationId, interpolateParams, Interpolator) {\n // Start with the fallbackLanguage with index 0\n return resolveForFallbackLanguageInstant((startFallbackIteration>0 ? startFallbackIteration : fallbackIndex), translationId, interpolateParams, Interpolator);\n };\n\n var determineTranslation = function (translationId, interpolateParams, interpolationId, defaultTranslationText, uses) {\n\n var deferred = $q.defer();\n\n var table = uses ? $translationTable[uses] : $translationTable,\n Interpolator = (interpolationId) ? interpolatorHashMap[interpolationId] : defaultInterpolator;\n\n // if the translation id exists, we can just interpolate it\n if (table && Object.prototype.hasOwnProperty.call(table, translationId)) {\n var translation = table[translationId];\n\n // If using link, rerun $translate with linked translationId and return it\n if (translation.substr(0, 2) === '@:') {\n\n $translate(translation.substr(2), interpolateParams, interpolationId, defaultTranslationText, uses)\n .then(deferred.resolve, deferred.reject);\n } else {\n //\n var resolvedTranslation = Interpolator.interpolate(translation, interpolateParams, 'service');\n resolvedTranslation = applyPostProcessing(translationId, translation, resolvedTranslation, interpolateParams, uses);\n deferred.resolve(resolvedTranslation);\n }\n } else {\n var missingTranslationHandlerTranslation;\n // for logging purposes only (as in $translateMissingTranslationHandlerLog), value is not returned to promise\n if ($missingTranslationHandlerFactory && !pendingLoader) {\n missingTranslationHandlerTranslation = translateByHandler(translationId, interpolateParams, defaultTranslationText);\n }\n\n // since we couldn't translate the inital requested translation id,\n // we try it now with one or more fallback languages, if fallback language(s) is\n // configured.\n if (uses && $fallbackLanguage && $fallbackLanguage.length) {\n fallbackTranslation(translationId, interpolateParams, Interpolator, defaultTranslationText)\n .then(function (translation) {\n deferred.resolve(translation);\n }, function (_translationId) {\n deferred.reject(applyNotFoundIndicators(_translationId));\n });\n } else if ($missingTranslationHandlerFactory && !pendingLoader && missingTranslationHandlerTranslation) {\n // looks like the requested translation id doesn't exists.\n // Now, if there is a registered handler for missing translations and no\n // asyncLoader is pending, we execute the handler\n if (defaultTranslationText) {\n deferred.resolve(defaultTranslationText);\n } else {\n deferred.resolve(missingTranslationHandlerTranslation);\n }\n } else {\n if (defaultTranslationText) {\n deferred.resolve(defaultTranslationText);\n } else {\n deferred.reject(applyNotFoundIndicators(translationId));\n }\n }\n }\n return deferred.promise;\n };\n\n var determineTranslationInstant = function (translationId, interpolateParams, interpolationId, uses) {\n\n var result, table = uses ? $translationTable[uses] : $translationTable,\n Interpolator = defaultInterpolator;\n\n // if the interpolation id exists use custom interpolator\n if (interpolatorHashMap && Object.prototype.hasOwnProperty.call(interpolatorHashMap, interpolationId)) {\n Interpolator = interpolatorHashMap[interpolationId];\n }\n\n // if the translation id exists, we can just interpolate it\n if (table && Object.prototype.hasOwnProperty.call(table, translationId)) {\n var translation = table[translationId];\n\n // If using link, rerun $translate with linked translationId and return it\n if (translation.substr(0, 2) === '@:') {\n result = determineTranslationInstant(translation.substr(2), interpolateParams, interpolationId, uses);\n } else {\n result = Interpolator.interpolate(translation, interpolateParams, 'filter');\n result = applyPostProcessing(translationId, translation, result, interpolateParams, uses);\n }\n } else {\n var missingTranslationHandlerTranslation;\n // for logging purposes only (as in $translateMissingTranslationHandlerLog), value is not returned to promise\n if ($missingTranslationHandlerFactory && !pendingLoader) {\n missingTranslationHandlerTranslation = translateByHandler(translationId, interpolateParams);\n }\n\n // since we couldn't translate the inital requested translation id,\n // we try it now with one or more fallback languages, if fallback language(s) is\n // configured.\n if (uses && $fallbackLanguage && $fallbackLanguage.length) {\n fallbackIndex = 0;\n result = fallbackTranslationInstant(translationId, interpolateParams, Interpolator);\n } else if ($missingTranslationHandlerFactory && !pendingLoader && missingTranslationHandlerTranslation) {\n // looks like the requested translation id doesn't exists.\n // Now, if there is a registered handler for missing translations and no\n // asyncLoader is pending, we execute the handler\n result = missingTranslationHandlerTranslation;\n } else {\n result = applyNotFoundIndicators(translationId);\n }\n }\n\n return result;\n };\n\n var clearNextLangAndPromise = function(key) {\n if ($nextLang === key) {\n $nextLang = undefined;\n }\n langPromises[key] = undefined;\n };\n\n var applyPostProcessing = function (translationId, translation, resolvedTranslation, interpolateParams, uses) {\n var fn = postProcessFn;\n\n if (fn) {\n\n if (typeof(fn) === 'string') {\n // getting on-demand instance\n fn = $injector.get(fn);\n }\n if (fn) {\n return fn(translationId, translation, resolvedTranslation, interpolateParams, uses);\n }\n }\n\n return resolvedTranslation;\n };\n\n var loadTranslationsIfMissing = function (key) {\n if (!$translationTable[key] && $loaderFactory && !langPromises[key]) {\n langPromises[key] = loadAsync(key).then(function (translation) {\n translations(translation.key, translation.table);\n return translation;\n });\n }\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#preferredLanguage\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the language key for the preferred language.\n *\n * @param {string} langKey language String or Array to be used as preferredLanguage (changing at runtime)\n *\n * @return {string} preferred language key\n */\n $translate.preferredLanguage = function (langKey) {\n if(langKey) {\n setupPreferredLanguage(langKey);\n }\n return $preferredLanguage;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#cloakClassName\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the configured class name for `translate-cloak` directive.\n *\n * @return {string} cloakClassName\n */\n $translate.cloakClassName = function () {\n return $cloakClassName;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#nestedObjectDelimeter\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the configured delimiter for nested namespaces.\n *\n * @return {string} nestedObjectDelimeter\n */\n $translate.nestedObjectDelimeter = function () {\n return $nestedObjectDelimeter;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#fallbackLanguage\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the language key for the fallback languages or sets a new fallback stack.\n *\n * @param {string=} langKey language String or Array of fallback languages to be used (to change stack at runtime)\n *\n * @return {string||array} fallback language key\n */\n $translate.fallbackLanguage = function (langKey) {\n if (langKey !== undefined && langKey !== null) {\n fallbackStack(langKey);\n\n // as we might have an async loader initiated and a new translation language might have been defined\n // we need to add the promise to the stack also. So - iterate.\n if ($loaderFactory) {\n if ($fallbackLanguage && $fallbackLanguage.length) {\n for (var i = 0, len = $fallbackLanguage.length; i < len; i++) {\n if (!langPromises[$fallbackLanguage[i]]) {\n langPromises[$fallbackLanguage[i]] = loadAsync($fallbackLanguage[i]);\n }\n }\n }\n }\n $translate.use($translate.use());\n }\n if ($fallbackWasString) {\n return $fallbackLanguage[0];\n } else {\n return $fallbackLanguage;\n }\n\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#useFallbackLanguage\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Sets the first key of the fallback language stack to be used for translation.\n * Therefore all languages in the fallback array BEFORE this key will be skipped!\n *\n * @param {string=} langKey Contains the langKey the iteration shall start with. Set to false if you want to\n * get back to the whole stack\n */\n $translate.useFallbackLanguage = function (langKey) {\n if (langKey !== undefined && langKey !== null) {\n if (!langKey) {\n startFallbackIteration = 0;\n } else {\n var langKeyPosition = indexOf($fallbackLanguage, langKey);\n if (langKeyPosition > -1) {\n startFallbackIteration = langKeyPosition;\n }\n }\n\n }\n\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#proposedLanguage\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the language key of language that is currently loaded asynchronously.\n *\n * @return {string} language key\n */\n $translate.proposedLanguage = function () {\n return $nextLang;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#storage\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns registered storage.\n *\n * @return {object} Storage\n */\n $translate.storage = function () {\n return Storage;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#negotiateLocale\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns a language key based on available languages and language aliases. If a\n * language key cannot be resolved, returns undefined.\n *\n * If no or a falsy key is given, returns undefined.\n *\n * @param {string} [key] Language key\n * @return {string|undefined} Language key or undefined if no language key is found.\n */\n $translate.negotiateLocale = negotiateLocale;\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#use\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Tells angular-translate which language to use by given language key. This method is\n * used to change language at runtime. It also takes care of storing the language\n * key in a configured store to let your app remember the choosed language.\n *\n * When trying to 'use' a language which isn't available it tries to load it\n * asynchronously with registered loaders.\n *\n * Returns promise object with loaded language file data or string of the currently used language.\n *\n * If no or a falsy key is given it returns the currently used language key.\n * The returned string will be ```undefined``` if setting up $translate hasn't finished.\n * @example\n * $translate.use(\"en_US\").then(function(data){\n * $scope.text = $translate(\"HELLO\");\n * });\n *\n * @param {string} [key] Language key\n * @return {object|string} Promise with loaded language data or the language key if a falsy param was given.\n */\n $translate.use = function (key) {\n if (!key) {\n return $uses;\n }\n\n var deferred = $q.defer();\n\n $rootScope.$emit('$translateChangeStart', {language: key});\n\n // Try to get the aliased language key\n var aliasedKey = negotiateLocale(key);\n // Ensure only registered language keys will be loaded\n if ($availableLanguageKeys.length > 0 && !aliasedKey) {\n return $q.reject(key);\n }\n\n if (aliasedKey) {\n key = aliasedKey;\n }\n\n // if there isn't a translation table for the language we've requested,\n // we load it asynchronously\n $nextLang = key;\n if (($forceAsyncReloadEnabled || !$translationTable[key]) && $loaderFactory && !langPromises[key]) {\n langPromises[key] = loadAsync(key).then(function (translation) {\n translations(translation.key, translation.table);\n deferred.resolve(translation.key);\n if ($nextLang === key) {\n useLanguage(translation.key);\n }\n return translation;\n }, function (key) {\n $rootScope.$emit('$translateChangeError', {language: key});\n deferred.reject(key);\n $rootScope.$emit('$translateChangeEnd', {language: key});\n return $q.reject(key);\n });\n langPromises[key]['finally'](function () {\n clearNextLangAndPromise(key);\n });\n } else if (langPromises[key]) {\n // we are already loading this asynchronously\n // resolve our new deferred when the old langPromise is resolved\n langPromises[key].then(function (translation) {\n if ($nextLang === translation.key) {\n useLanguage(translation.key);\n }\n deferred.resolve(translation.key);\n return translation;\n }, function (key) {\n // find first available fallback language if that request has failed\n if (!$uses && $fallbackLanguage && $fallbackLanguage.length > 0 && $fallbackLanguage[0] !== key) {\n return $translate.use($fallbackLanguage[0]).then(deferred.resolve, deferred.reject);\n } else {\n return deferred.reject(key);\n }\n });\n } else {\n deferred.resolve(key);\n useLanguage(key);\n }\n\n return deferred.promise;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#resolveClientLocale\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * This returns the current browser/client's language key. The result is processed with the configured uniform tag resolver.\n *\n * @returns {string} the current client/browser language key\n */\n $translate.resolveClientLocale = function () {\n return getLocale();\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#storageKey\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the key for the storage.\n *\n * @return {string} storage key\n */\n $translate.storageKey = function () {\n return storageKey();\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#isPostCompilingEnabled\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns whether post compiling is enabled or not\n *\n * @return {bool} storage key\n */\n $translate.isPostCompilingEnabled = function () {\n return $postCompilingEnabled;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#isForceAsyncReloadEnabled\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns whether force async reload is enabled or not\n *\n * @return {boolean} forceAsyncReload value\n */\n $translate.isForceAsyncReloadEnabled = function () {\n return $forceAsyncReloadEnabled;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#isKeepContent\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns whether keepContent or not\n *\n * @return {boolean} keepContent value\n */\n $translate.isKeepContent = function () {\n return $keepContent;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#refresh\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Refreshes a translation table pointed by the given langKey. If langKey is not specified,\n * the module will drop all existent translation tables and load new version of those which\n * are currently in use.\n *\n * Refresh means that the module will drop target translation table and try to load it again.\n *\n * In case there are no loaders registered the refresh() method will throw an Error.\n *\n * If the module is able to refresh translation tables refresh() method will broadcast\n * $translateRefreshStart and $translateRefreshEnd events.\n *\n * @example\n * // this will drop all currently existent translation tables and reload those which are\n * // currently in use\n * $translate.refresh();\n * // this will refresh a translation table for the en_US language\n * $translate.refresh('en_US');\n *\n * @param {string} langKey A language key of the table, which has to be refreshed\n *\n * @return {promise} Promise, which will be resolved in case a translation tables refreshing\n * process is finished successfully, and reject if not.\n */\n $translate.refresh = function (langKey) {\n if (!$loaderFactory) {\n throw new Error('Couldn\\'t refresh translation table, no loader registered!');\n }\n\n var deferred = $q.defer();\n\n function resolve() {\n deferred.resolve();\n $rootScope.$emit('$translateRefreshEnd', {language: langKey});\n }\n\n function reject() {\n deferred.reject();\n $rootScope.$emit('$translateRefreshEnd', {language: langKey});\n }\n\n $rootScope.$emit('$translateRefreshStart', {language: langKey});\n\n if (!langKey) {\n // if there's no language key specified we refresh ALL THE THINGS!\n var tables = [], loadingKeys = {};\n\n // reload registered fallback languages\n if ($fallbackLanguage && $fallbackLanguage.length) {\n for (var i = 0, len = $fallbackLanguage.length; i < len; i++) {\n tables.push(loadAsync($fallbackLanguage[i]));\n loadingKeys[$fallbackLanguage[i]] = true;\n }\n }\n\n // reload currently used language\n if ($uses && !loadingKeys[$uses]) {\n tables.push(loadAsync($uses));\n }\n\n var allTranslationsLoaded = function (tableData) {\n $translationTable = {};\n angular.forEach(tableData, function (data) {\n translations(data.key, data.table);\n });\n if ($uses) {\n useLanguage($uses);\n }\n resolve();\n };\n allTranslationsLoaded.displayName = 'refreshPostProcessor';\n\n $q.all(tables).then(allTranslationsLoaded, reject);\n\n } else if ($translationTable[langKey]) {\n\n var oneTranslationsLoaded = function (data) {\n translations(data.key, data.table);\n if (langKey === $uses) {\n useLanguage($uses);\n }\n resolve();\n return data;\n };\n oneTranslationsLoaded.displayName = 'refreshPostProcessor';\n\n loadAsync(langKey).then(oneTranslationsLoaded, reject);\n\n } else {\n reject();\n }\n return deferred.promise;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#instant\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns a translation instantly from the internal state of loaded translation. All rules\n * regarding the current language, the preferred language of even fallback languages will be\n * used except any promise handling. If a language was not found, an asynchronous loading\n * will be invoked in the background.\n *\n * @param {string|array} translationId A token which represents a translation id\n * This can be optionally an array of translation ids which\n * results that the function's promise returns an object where\n * each key is the translation id and the value the translation.\n * @param {object} interpolateParams Params\n * @param {string} interpolationId The id of the interpolation to use\n * @param {string} forceLanguage A language to be used instead of the current language\n *\n * @return {string|object} translation\n */\n $translate.instant = function (translationId, interpolateParams, interpolationId, forceLanguage) {\n\n // we don't want to re-negotiate $uses\n var uses = (forceLanguage && forceLanguage !== $uses) ? // we don't want to re-negotiate $uses\n (negotiateLocale(forceLanguage) || forceLanguage) : $uses;\n\n // Detect undefined and null values to shorten the execution and prevent exceptions\n if (translationId === null || angular.isUndefined(translationId)) {\n return translationId;\n }\n\n // Check forceLanguage is present\n if (forceLanguage) {\n loadTranslationsIfMissing(forceLanguage);\n }\n\n // Duck detection: If the first argument is an array, a bunch of translations was requested.\n // The result is an object.\n if (angular.isArray(translationId)) {\n var results = {};\n for (var i = 0, c = translationId.length; i < c; i++) {\n results[translationId[i]] = $translate.instant(translationId[i], interpolateParams, interpolationId, forceLanguage);\n }\n return results;\n }\n\n // We discarded unacceptable values. So we just need to verify if translationId is empty String\n if (angular.isString(translationId) && translationId.length < 1) {\n return translationId;\n }\n\n // trim off any whitespace\n if (translationId) {\n translationId = trim.apply(translationId);\n }\n\n var result, possibleLangKeys = [];\n if ($preferredLanguage) {\n possibleLangKeys.push($preferredLanguage);\n }\n if (uses) {\n possibleLangKeys.push(uses);\n }\n if ($fallbackLanguage && $fallbackLanguage.length) {\n possibleLangKeys = possibleLangKeys.concat($fallbackLanguage);\n }\n for (var j = 0, d = possibleLangKeys.length; j < d; j++) {\n var possibleLangKey = possibleLangKeys[j];\n if ($translationTable[possibleLangKey]) {\n if (typeof $translationTable[possibleLangKey][translationId] !== 'undefined') {\n result = determineTranslationInstant(translationId, interpolateParams, interpolationId, uses);\n }\n }\n if (typeof result !== 'undefined') {\n break;\n }\n }\n\n if (!result && result !== '') {\n if ($notFoundIndicatorLeft || $notFoundIndicatorRight) {\n result = applyNotFoundIndicators(translationId);\n } else {\n // Return translation of default interpolator if not found anything.\n result = defaultInterpolator.interpolate(translationId, interpolateParams, 'filter');\n if ($missingTranslationHandlerFactory && !pendingLoader) {\n result = translateByHandler(translationId, interpolateParams);\n }\n }\n }\n\n return result;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#versionInfo\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the current version information for the angular-translate library\n *\n * @return {string} angular-translate version\n */\n $translate.versionInfo = function () {\n return version;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#loaderCache\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns the defined loaderCache.\n *\n * @return {boolean|string|object} current value of loaderCache\n */\n $translate.loaderCache = function () {\n return loaderCache;\n };\n\n // internal purpose only\n $translate.directivePriority = function () {\n return directivePriority;\n };\n\n // internal purpose only\n $translate.statefulFilter = function () {\n return statefulFilter;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#isReady\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns whether the service is \"ready\" to translate (i.e. loading 1st language).\n *\n * See also {@link pascalprecht.translate.$translate#methods_onReady onReady()}.\n *\n * @return {boolean} current value of ready\n */\n $translate.isReady = function () {\n return $isReady;\n };\n\n var $onReadyDeferred = $q.defer();\n $onReadyDeferred.promise.then(function () {\n $isReady = true;\n });\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#onReady\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * Returns whether the service is \"ready\" to translate (i.e. loading 1st language).\n *\n * See also {@link pascalprecht.translate.$translate#methods_isReady isReady()}.\n *\n * @param {Function=} fn Function to invoke when service is ready\n * @return {object} Promise resolved when service is ready\n */\n $translate.onReady = function (fn) {\n var deferred = $q.defer();\n if (angular.isFunction(fn)) {\n deferred.promise.then(fn);\n }\n if ($isReady) {\n deferred.resolve();\n } else {\n $onReadyDeferred.promise.then(deferred.resolve);\n }\n return deferred.promise;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translate#getAvailableLanguageKeys\n * @methodOf pascalprecht.translate.$translate\n *\n * @description\n * This function simply returns the registered language keys being defined before in the config phase\n * With this, an application can use the array to provide a language selection dropdown or similar\n * without any additional effort\n *\n * @returns {object} returns the list of possibly registered language keys and mapping or null if not defined\n */\n $translate.getAvailableLanguageKeys = function () {\n if ($availableLanguageKeys.length > 0) {\n return $availableLanguageKeys;\n }\n return null;\n };\n\n // Whenever $translateReady is being fired, this will ensure the state of $isReady\n var globalOnReadyListener = $rootScope.$on('$translateReady', function () {\n $onReadyDeferred.resolve();\n globalOnReadyListener(); // one time only\n globalOnReadyListener = null;\n });\n var globalOnChangeListener = $rootScope.$on('$translateChangeEnd', function () {\n $onReadyDeferred.resolve();\n globalOnChangeListener(); // one time only\n globalOnChangeListener = null;\n });\n\n if ($loaderFactory) {\n\n // If at least one async loader is defined and there are no\n // (default) translations available we should try to load them.\n if (angular.equals($translationTable, {})) {\n if ($translate.use()) {\n $translate.use($translate.use());\n }\n }\n\n // Also, if there are any fallback language registered, we start\n // loading them asynchronously as soon as we can.\n if ($fallbackLanguage && $fallbackLanguage.length) {\n var processAsyncResult = function (translation) {\n translations(translation.key, translation.table);\n $rootScope.$emit('$translateChangeEnd', { language: translation.key });\n return translation;\n };\n for (var i = 0, len = $fallbackLanguage.length; i < len; i++) {\n var fallbackLanguageId = $fallbackLanguage[i];\n if ($forceAsyncReloadEnabled || !$translationTable[fallbackLanguageId]) {\n langPromises[fallbackLanguageId] = loadAsync(fallbackLanguageId).then(processAsyncResult);\n }\n }\n }\n } else {\n $rootScope.$emit('$translateReady', { language: $translate.use() });\n }\n\n return $translate;\n }\n ];\n}\n\n$translate.displayName = 'displayName';\n\n/**\n * @ngdoc object\n * @name pascalprecht.translate.$translateDefaultInterpolation\n * @requires $interpolate\n *\n * @description\n * Uses angular's `$interpolate` services to interpolate strings against some values.\n *\n * Be aware to configure a proper sanitization strategy.\n *\n * See also:\n * * {@link pascalprecht.translate.$translateSanitization}\n *\n * @return {object} $translateDefaultInterpolation Interpolator service\n */\nangular.module('pascalprecht.translate').factory('$translateDefaultInterpolation', $translateDefaultInterpolation);\n\nfunction $translateDefaultInterpolation ($interpolate, $translateSanitization) {\n\n 'use strict';\n\n var $translateInterpolator = {},\n $locale,\n $identifier = 'default';\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateDefaultInterpolation#setLocale\n * @methodOf pascalprecht.translate.$translateDefaultInterpolation\n *\n * @description\n * Sets current locale (this is currently not use in this interpolation).\n *\n * @param {string} locale Language key or locale.\n */\n $translateInterpolator.setLocale = function (locale) {\n $locale = locale;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateDefaultInterpolation#getInterpolationIdentifier\n * @methodOf pascalprecht.translate.$translateDefaultInterpolation\n *\n * @description\n * Returns an identifier for this interpolation service.\n *\n * @returns {string} $identifier\n */\n $translateInterpolator.getInterpolationIdentifier = function () {\n return $identifier;\n };\n\n /**\n * @deprecated will be removed in 3.0\n * @see {@link pascalprecht.translate.$translateSanitization}\n */\n $translateInterpolator.useSanitizeValueStrategy = function (value) {\n $translateSanitization.useStrategy(value);\n return this;\n };\n\n /**\n * @ngdoc function\n * @name pascalprecht.translate.$translateDefaultInterpolation#interpolate\n * @methodOf pascalprecht.translate.$translateDefaultInterpolation\n *\n * @description\n * Interpolates given value agains given interpolate params using angulars\n * `$interpolate` service.\n *\n * Since AngularJS 1.5, `value` must not be a string but can be anything input.\n *\n * @returns {string} interpolated string.\n */\n $translateInterpolator.interpolate = function (value, interpolationParams, context) {\n interpolationParams = interpolationParams || {};\n interpolationParams = $translateSanitization.sanitize(interpolationParams, 'params', undefined, context);\n\n var interpolatedText;\n if (angular.isNumber(value)) {\n // numbers are safe\n interpolatedText = '' + value;\n } else if (angular.isString(value)) {\n // strings must be interpolated (that's the job here)\n interpolatedText = $interpolate(value)(interpolationParams);\n interpolatedText = $translateSanitization.sanitize(interpolatedText, 'text', undefined, context);\n } else {\n // neither a number or a string, cant interpolate => empty string\n interpolatedText = '';\n }\n\n return interpolatedText;\n };\n\n return $translateInterpolator;\n}\n\n$translateDefaultInterpolation.displayName = '$translateDefaultInterpolation';\n\nangular.module('pascalprecht.translate').constant('$STORAGE_KEY', 'NG_TRANSLATE_LANG_KEY');\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc directive\n * @name pascalprecht.translate.directive:translate\n * @requires $interpolate, \n * @requires $compile, \n * @requires $parse, \n * @requires $rootScope\n * @restrict AE\n *\n * @description\n * Translates given translation id either through attribute or DOM content.\n * Internally it uses $translate service to translate the translation id. It possible to\n * pass an optional `translate-values` object literal as string into translation id.\n *\n * @param {string=} translate Translation id which could be either string or interpolated string.\n * @param {string=} translate-values Values to pass into translation id. Can be passed as object literal string or interpolated object.\n * @param {string=} translate-attr-ATTR translate Translation id and put it into ATTR attribute.\n * @param {string=} translate-default will be used unless translation was successful\n * @param {boolean=} translate-compile (default true if present) defines locally activation of {@link pascalprecht.translate.$translateProvider#methods_usePostCompiling}\n * @param {boolean=} translate-keep-content (default true if present) defines that in case a KEY could not be translated, that the existing content is left in the innerHTML}\n *\n * @example\n \n \n
    \n\n
    \n        
    TRANSLATION_ID
    \n
    \n        
    \n        
    {{translationId}}
    \n
    \n        
    WITH_VALUES
    \n
    \n        
    WITH_VALUES
    \n
    \n        
    \n\n      
    \n
    \n \n angular.module('ngView', ['pascalprecht.translate'])\n\n .config(function ($translateProvider) {\n\n $translateProvider.translations('en',{\n 'TRANSLATION_ID': 'Hello there!',\n 'WITH_VALUES': 'The following value is dynamic: {{value}}',\n 'WITH_CAMEL_CASE_KEY': 'The interpolation key is camel cased: {{camelCaseKey}}'\n }).preferredLanguage('en');\n\n });\n\n angular.module('ngView').controller('TranslateCtrl', function ($scope) {\n $scope.translationId = 'TRANSLATION_ID';\n\n $scope.values = {\n value: 78\n };\n });\n \n \n it('should translate', function () {\n inject(function ($rootScope, $compile) {\n $rootScope.translationId = 'TRANSLATION_ID';\n\n element = $compile('

    ')($rootScope);\n $rootScope.$digest();\n expect(element.text()).toBe('Hello there!');\n\n element = $compile('

    ')($rootScope);\n $rootScope.$digest();\n expect(element.text()).toBe('Hello there!');\n\n element = $compile('

    TRANSLATION_ID

    ')($rootScope);\n $rootScope.$digest();\n expect(element.text()).toBe('Hello there!');\n\n element = $compile('

    {{translationId}}

    ')($rootScope);\n $rootScope.$digest();\n expect(element.text()).toBe('Hello there!');\n\n element = $compile('

    ')($rootScope);\n $rootScope.$digest();\n expect(element.attr('title')).toBe('Hello there!');\n\n element = $compile('

    ')($rootScope);\n $rootScope.$digest();\n expect(element.text()).toBe('The interpolation key is camel cased: Hello');\n });\n });\n
    \n
    \n */\n.directive('translate', translateDirective);\nfunction translateDirective($translate, $interpolate, $compile, $parse, $rootScope) {\n\n 'use strict';\n\n /**\n * @name trim\n * @private\n *\n * @description\n * trim polyfill\n *\n * @returns {string} The string stripped of whitespace from both ends\n */\n var trim = function() {\n return this.toString().replace(/^\\s+|\\s+$/g, '');\n };\n\n return {\n restrict: 'AE',\n scope: true,\n priority: $translate.directivePriority(),\n compile: function (tElement, tAttr) {\n\n var translateValuesExist = (tAttr.translateValues) ?\n tAttr.translateValues : undefined;\n\n var translateInterpolation = (tAttr.translateInterpolation) ?\n tAttr.translateInterpolation : undefined;\n\n var translateValueExist = tElement[0].outerHTML.match(/translate-value-+/i);\n\n var interpolateRegExp = '^(.*)(' + $interpolate.startSymbol() + '.*' + $interpolate.endSymbol() + ')(.*)',\n watcherRegExp = '^(.*)' + $interpolate.startSymbol() + '(.*)' + $interpolate.endSymbol() + '(.*)';\n\n return function linkFn(scope, iElement, iAttr) {\n\n scope.interpolateParams = {};\n scope.preText = '';\n scope.postText = '';\n scope.translateNamespace = getTranslateNamespace(scope);\n var translationIds = {};\n\n var initInterpolationParams = function (interpolateParams, iAttr, tAttr) {\n // initial setup\n if (iAttr.translateValues) {\n angular.extend(interpolateParams, $parse(iAttr.translateValues)(scope.$parent));\n }\n // initially fetch all attributes if existing and fill the params\n if (translateValueExist) {\n for (var attr in tAttr) {\n if (Object.prototype.hasOwnProperty.call(iAttr, attr) && attr.substr(0, 14) === 'translateValue' && attr !== 'translateValues') {\n var attributeName = angular.lowercase(attr.substr(14, 1)) + attr.substr(15);\n interpolateParams[attributeName] = tAttr[attr];\n }\n }\n }\n };\n\n // Ensures any change of the attribute \"translate\" containing the id will\n // be re-stored to the scope's \"translationId\".\n // If the attribute has no content, the element's text value (white spaces trimmed off) will be used.\n var observeElementTranslation = function (translationId) {\n\n // Remove any old watcher\n if (angular.isFunction(observeElementTranslation._unwatchOld)) {\n observeElementTranslation._unwatchOld();\n observeElementTranslation._unwatchOld = undefined;\n }\n\n if (angular.equals(translationId , '') || !angular.isDefined(translationId)) {\n var iElementText = trim.apply(iElement.text());\n\n // Resolve translation id by inner html if required\n var interpolateMatches = iElementText.match(interpolateRegExp);\n // Interpolate translation id if required\n if (angular.isArray(interpolateMatches)) {\n scope.preText = interpolateMatches[1];\n scope.postText = interpolateMatches[3];\n translationIds.translate = $interpolate(interpolateMatches[2])(scope.$parent);\n var watcherMatches = iElementText.match(watcherRegExp);\n if (angular.isArray(watcherMatches) && watcherMatches[2] && watcherMatches[2].length) {\n observeElementTranslation._unwatchOld = scope.$watch(watcherMatches[2], function (newValue) {\n translationIds.translate = newValue;\n updateTranslations();\n });\n }\n } else {\n // do not assigne the translation id if it is empty.\n translationIds.translate = !iElementText ? undefined : iElementText;\n }\n } else {\n translationIds.translate = translationId;\n }\n updateTranslations();\n };\n\n var observeAttributeTranslation = function (translateAttr) {\n iAttr.$observe(translateAttr, function (translationId) {\n translationIds[translateAttr] = translationId;\n updateTranslations();\n });\n };\n\n // initial setup with values\n initInterpolationParams(scope.interpolateParams, iAttr, tAttr);\n\n var firstAttributeChangedEvent = true;\n iAttr.$observe('translate', function (translationId) {\n if (typeof translationId === 'undefined') {\n // case of element \"xyz\"\n observeElementTranslation('');\n } else {\n // case of regular attribute\n if (translationId !== '' || !firstAttributeChangedEvent) {\n translationIds.translate = translationId;\n updateTranslations();\n }\n }\n firstAttributeChangedEvent = false;\n });\n\n for (var translateAttr in iAttr) {\n if (iAttr.hasOwnProperty(translateAttr) && translateAttr.substr(0, 13) === 'translateAttr' && translateAttr.length > 13) {\n observeAttributeTranslation(translateAttr);\n }\n }\n\n iAttr.$observe('translateDefault', function (value) {\n scope.defaultText = value;\n updateTranslations();\n });\n\n if (translateValuesExist) {\n iAttr.$observe('translateValues', function (interpolateParams) {\n if (interpolateParams) {\n scope.$parent.$watch(function () {\n angular.extend(scope.interpolateParams, $parse(interpolateParams)(scope.$parent));\n });\n }\n });\n }\n\n if (translateValueExist) {\n var observeValueAttribute = function (attrName) {\n iAttr.$observe(attrName, function (value) {\n var attributeName = angular.lowercase(attrName.substr(14, 1)) + attrName.substr(15);\n scope.interpolateParams[attributeName] = value;\n });\n };\n for (var attr in iAttr) {\n if (Object.prototype.hasOwnProperty.call(iAttr, attr) && attr.substr(0, 14) === 'translateValue' && attr !== 'translateValues') {\n observeValueAttribute(attr);\n }\n }\n }\n\n // Master update function\n var updateTranslations = function () {\n for (var key in translationIds) {\n if (translationIds.hasOwnProperty(key) && translationIds[key] !== undefined) {\n updateTranslation(key, translationIds[key], scope, scope.interpolateParams, scope.defaultText, scope.translateNamespace);\n }\n }\n };\n\n // Put translation processing function outside loop\n var updateTranslation = function(translateAttr, translationId, scope, interpolateParams, defaultTranslationText, translateNamespace) {\n if (translationId) {\n // if translation id starts with '.' and translateNamespace given, prepend namespace\n if (translateNamespace && translationId.charAt(0) === '.') {\n translationId = translateNamespace + translationId;\n }\n\n $translate(translationId, interpolateParams, translateInterpolation, defaultTranslationText, scope.translateLanguage)\n .then(function (translation) {\n applyTranslation(translation, scope, true, translateAttr);\n }, function (translationId) {\n applyTranslation(translationId, scope, false, translateAttr);\n });\n } else {\n // as an empty string cannot be translated, we can solve this using successful=false\n applyTranslation(translationId, scope, false, translateAttr);\n }\n };\n\n var applyTranslation = function (value, scope, successful, translateAttr) {\n if (!successful) {\n if (typeof scope.defaultText !== 'undefined') {\n value = scope.defaultText;\n }\n }\n if (translateAttr === 'translate') {\n // default translate into innerHTML\n if (successful || (!successful && !$translate.isKeepContent() && typeof iAttr.translateKeepContent === 'undefined')) {\n iElement.empty().append(scope.preText + value + scope.postText);\n }\n var globallyEnabled = $translate.isPostCompilingEnabled();\n var locallyDefined = typeof tAttr.translateCompile !== 'undefined';\n var locallyEnabled = locallyDefined && tAttr.translateCompile !== 'false';\n if ((globallyEnabled && !locallyDefined) || locallyEnabled) {\n $compile(iElement.contents())(scope);\n }\n } else {\n // translate attribute\n var attributeName = iAttr.$attr[translateAttr];\n if (attributeName.substr(0, 5) === 'data-') {\n // ensure html5 data prefix is stripped\n attributeName = attributeName.substr(5);\n }\n attributeName = attributeName.substr(15);\n iElement.attr(attributeName, value);\n }\n };\n\n if (translateValuesExist || translateValueExist || iAttr.translateDefault) {\n scope.$watch('interpolateParams', updateTranslations, true);\n }\n\n // Replaced watcher on translateLanguage with event listener\n scope.$on('translateLanguageChanged', updateTranslations);\n\n // Ensures the text will be refreshed after the current language was changed\n // w/ $translate.use(...)\n var unbind = $rootScope.$on('$translateChangeSuccess', updateTranslations);\n\n // ensure translation will be looked up at least one\n if (iElement.text().length) {\n if (iAttr.translate) {\n observeElementTranslation(iAttr.translate);\n } else {\n observeElementTranslation('');\n }\n } else if (iAttr.translate) {\n // ensure attribute will be not skipped\n observeElementTranslation(iAttr.translate);\n }\n updateTranslations();\n scope.$on('$destroy', unbind);\n };\n }\n };\n}\n\n/**\n * Returns the scope's namespace.\n * @private\n * @param scope\n * @returns {string}\n */\nfunction getTranslateNamespace(scope) {\n 'use strict';\n if (scope.translateNamespace) {\n return scope.translateNamespace;\n }\n if (scope.$parent) {\n return getTranslateNamespace(scope.$parent);\n }\n}\n\ntranslateDirective.displayName = 'translateDirective';\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc directive\n * @name pascalprecht.translate.directive:translate-attr\n * @restrict A\n *\n * @description\n * Translates attributes like translate-attr-ATTR, but with an object like ng-class.\n * Internally it uses `translate` service to translate translation id. It possible to\n * pass an optional `translate-values` object literal as string into translation id.\n *\n * @param {string=} translate-attr Object literal mapping attributes to translation ids.\n * @param {string=} translate-values Values to pass into the translation ids. Can be passed as object literal string.\n *\n * @example\n \n \n
    \n\n \n\n
    \n
    \n \n angular.module('ngView', ['pascalprecht.translate'])\n\n .config(function ($translateProvider) {\n\n $translateProvider.translations('en',{\n 'TRANSLATION_ID': 'Hello there!',\n 'WITH_VALUES': 'The following value is dynamic: {{value}}',\n }).preferredLanguage('en');\n\n });\n\n angular.module('ngView').controller('TranslateCtrl', function ($scope) {\n $scope.translationId = 'TRANSLATION_ID';\n\n $scope.values = {\n value: 78\n };\n });\n \n \n it('should translate', function () {\n inject(function ($rootScope, $compile) {\n $rootScope.translationId = 'TRANSLATION_ID';\n\n element = $compile('')($rootScope);\n $rootScope.$digest();\n expect(element.attr('placeholder)).toBe('Hello there!');\n expect(element.attr('title)).toBe('The following value is dynamic: 5');\n });\n });\n \n
    \n */\n.directive('translateAttr', translateAttrDirective);\nfunction translateAttrDirective($translate, $rootScope) {\n\n 'use strict';\n\n return {\n restrict: 'A',\n priority: $translate.directivePriority(),\n link: function linkFn(scope, element, attr) {\n\n var translateAttr,\n translateValues,\n previousAttributes = {};\n\n // Main update translations function\n var updateTranslations = function () {\n angular.forEach(translateAttr, function (translationId, attributeName) {\n if (!translationId) {\n return;\n }\n previousAttributes[attributeName] = true;\n\n // if translation id starts with '.' and translateNamespace given, prepend namespace\n if (scope.translateNamespace && translationId.charAt(0) === '.') {\n translationId = scope.translateNamespace + translationId;\n }\n $translate(translationId, translateValues, attr.translateInterpolation, undefined, scope.translateLanguage)\n .then(function (translation) {\n element.attr(attributeName, translation);\n }, function (translationId) {\n element.attr(attributeName, translationId);\n });\n });\n\n // Removing unused attributes that were previously used\n angular.forEach(previousAttributes, function (flag, attributeName) {\n if (!translateAttr[attributeName]) {\n element.removeAttr(attributeName);\n delete previousAttributes[attributeName];\n }\n });\n };\n\n // Watch for attribute changes\n watchAttribute(\n scope,\n attr.translateAttr,\n function (newValue) { translateAttr = newValue; },\n updateTranslations\n );\n // Watch for value changes\n watchAttribute(\n scope,\n attr.translateValues,\n function (newValue) { translateValues = newValue; },\n updateTranslations\n );\n\n if (attr.translateValues) {\n scope.$watch(attr.translateValues, updateTranslations, true);\n }\n\n // Replaced watcher on translateLanguage with event listener\n scope.$on('translateLanguageChanged', updateTranslations);\n\n // Ensures the text will be refreshed after the current language was changed\n // w/ $translate.use(...)\n var unbind = $rootScope.$on('$translateChangeSuccess', updateTranslations);\n\n updateTranslations();\n scope.$on('$destroy', unbind);\n }\n };\n}\n\nfunction watchAttribute(scope, attribute, valueCallback, changeCallback) {\n 'use strict';\n if (!attribute) {\n return;\n }\n if (attribute.substr(0, 2) === '::') {\n attribute = attribute.substr(2);\n } else {\n scope.$watch(attribute, function(newValue) {\n valueCallback(newValue);\n changeCallback();\n }, true);\n }\n valueCallback(scope.$eval(attribute));\n}\n\ntranslateAttrDirective.displayName = 'translateAttrDirective';\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc directive\n * @name pascalprecht.translate.directive:translateCloak\n * @requires $rootScope\n * @requires $translate\n * @restrict A\n *\n * $description\n * Adds a `translate-cloak` class name to the given element where this directive\n * is applied initially and removes it, once a loader has finished loading.\n *\n * This directive can be used to prevent initial flickering when loading translation\n * data asynchronously.\n *\n * The class name is defined in\n * {@link pascalprecht.translate.$translateProvider#cloakClassName $translate.cloakClassName()}.\n *\n * @param {string=} translate-cloak If a translationId is provided, it will be used for showing\n * or hiding the cloak. Basically it relies on the translation\n * resolve.\n */\n.directive('translateCloak', translateCloakDirective);\n\nfunction translateCloakDirective($translate, $rootScope) {\n\n 'use strict';\n\n return {\n compile: function (tElement) {\n var applyCloak = function () {\n tElement.addClass($translate.cloakClassName());\n },\n removeCloak = function () {\n tElement.removeClass($translate.cloakClassName());\n };\n $translate.onReady(function () {\n removeCloak();\n });\n applyCloak();\n\n return function linkFn(scope, iElement, iAttr) {\n if (iAttr.translateCloak && iAttr.translateCloak.length) {\n // Register a watcher for the defined translation allowing a fine tuned cloak\n iAttr.$observe('translateCloak', function (translationId) {\n $translate(translationId).then(removeCloak, applyCloak);\n });\n // Register for change events as this is being another indicicator revalidating the cloak)\n $rootScope.$on('$translateChangeSuccess', function () {\n $translate(iAttr.translateCloak).then(removeCloak, applyCloak);\n });\n }\n };\n }\n };\n}\n\ntranslateCloakDirective.displayName = 'translateCloakDirective';\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc directive\n * @name pascalprecht.translate.directive:translateNamespace\n * @restrict A\n *\n * @description\n * Translates given translation id either through attribute or DOM content.\n * Internally it uses `translate` filter to translate translation id. It possible to\n * pass an optional `translate-values` object literal as string into translation id.\n *\n * @param {string=} translate namespace name which could be either string or interpolated string.\n *\n * @example\n \n \n
    \n\n
    \n

    .HEADERS.TITLE

    \n

    .HEADERS.WELCOME

    \n
    \n\n
    \n

    .TITLE

    \n

    .WELCOME

    \n
    \n\n
    \n
    \n \n angular.module('ngView', ['pascalprecht.translate'])\n\n .config(function ($translateProvider) {\n\n $translateProvider.translations('en',{\n 'TRANSLATION_ID': 'Hello there!',\n 'CONTENT': {\n 'HEADERS': {\n TITLE: 'Title'\n }\n },\n 'CONTENT.HEADERS.WELCOME': 'Welcome'\n }).preferredLanguage('en');\n\n });\n\n \n
    \n */\n.directive('translateNamespace', translateNamespaceDirective);\n\nfunction translateNamespaceDirective() {\n\n 'use strict';\n\n return {\n restrict: 'A',\n scope: true,\n compile: function () {\n return {\n pre: function (scope, iElement, iAttrs) {\n scope.translateNamespace = getTranslateNamespace(scope);\n\n if (scope.translateNamespace && iAttrs.translateNamespace.charAt(0) === '.') {\n scope.translateNamespace += iAttrs.translateNamespace;\n } else {\n scope.translateNamespace = iAttrs.translateNamespace;\n }\n }\n };\n }\n };\n}\n\n/**\n * Returns the scope's namespace.\n * @private\n * @param scope\n * @returns {string}\n */\nfunction getTranslateNamespace(scope) {\n 'use strict';\n if (scope.translateNamespace) {\n return scope.translateNamespace;\n }\n if (scope.$parent) {\n return getTranslateNamespace(scope.$parent);\n }\n}\n\ntranslateNamespaceDirective.displayName = 'translateNamespaceDirective';\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc directive\n * @name pascalprecht.translate.directive:translateLanguage\n * @restrict A\n *\n * @description\n * Forces the language to the directives in the underlying scope.\n *\n * @param {string=} translate language that will be negotiated.\n *\n * @example\n \n \n
    \n\n
    \n

    HELLO

    \n
    \n\n
    \n

    HELLO

    \n
    \n\n
    \n
    \n \n angular.module('ngView', ['pascalprecht.translate'])\n\n .config(function ($translateProvider) {\n\n $translateProvider\n .translations('en',{\n 'HELLO': 'Hello world!'\n })\n .translations('de',{\n 'HELLO': 'Hallo Welt!'\n })\n .preferredLanguage('en');\n\n });\n\n \n
    \n */\n.directive('translateLanguage', translateLanguageDirective);\n\nfunction translateLanguageDirective() {\n\n 'use strict';\n\n return {\n restrict: 'A',\n scope: true,\n compile: function () {\n return function linkFn(scope, iElement, iAttrs) {\n\n iAttrs.$observe('translateLanguage', function (newTranslateLanguage) {\n scope.translateLanguage = newTranslateLanguage;\n });\n\n scope.$watch('translateLanguage', function(){\n scope.$broadcast('translateLanguageChanged');\n });\n };\n }\n };\n}\n\ntranslateLanguageDirective.displayName = 'translateLanguageDirective';\n\nangular.module('pascalprecht.translate')\n/**\n * @ngdoc filter\n * @name pascalprecht.translate.filter:translate\n * @requires $parse\n * @requires pascalprecht.translate.$translate\n * @function\n *\n * @description\n * Uses `$translate` service to translate contents. Accepts interpolate parameters\n * to pass dynamized values though translation.\n *\n * @param {string} translationId A translation id to be translated.\n * @param {*=} interpolateParams Optional object literal (as hash or string) to pass values into translation.\n *\n * @returns {string} Translated text.\n *\n * @example\n \n \n
    \n\n
    {{ 'TRANSLATION_ID' | translate }}
    \n
    {{ translationId | translate }}
    \n
    {{ 'WITH_VALUES' | translate:'{value: 5}' }}
    \n
    {{ 'WITH_VALUES' | translate:values }}
    \n\n
    \n
    \n \n angular.module('ngView', ['pascalprecht.translate'])\n\n .config(function ($translateProvider) {\n\n $translateProvider.translations('en', {\n 'TRANSLATION_ID': 'Hello there!',\n 'WITH_VALUES': 'The following value is dynamic: {{value}}'\n });\n $translateProvider.preferredLanguage('en');\n\n });\n\n angular.module('ngView').controller('TranslateCtrl', function ($scope) {\n $scope.translationId = 'TRANSLATION_ID';\n\n $scope.values = {\n value: 78\n };\n });\n \n
    \n */\n.filter('translate', translateFilterFactory);\n\nfunction translateFilterFactory($parse, $translate) {\n\n 'use strict';\n\n var translateFilter = function (translationId, interpolateParams, interpolation, forceLanguage) {\n if (!angular.isObject(interpolateParams)) {\n interpolateParams = $parse(interpolateParams)(this);\n }\n\n return $translate.instant(translationId, interpolateParams, interpolation, forceLanguage);\n };\n\n if ($translate.statefulFilter()) {\n translateFilter.$stateful = true;\n }\n\n return translateFilter;\n}\n\ntranslateFilterFactory.displayName = 'translateFilterFactory';\n\nangular.module('pascalprecht.translate')\n\n/**\n * @ngdoc object\n * @name pascalprecht.translate.$translationCache\n * @requires $cacheFactory\n *\n * @description\n * The first time a translation table is used, it is loaded in the translation cache for quick retrieval. You\n * can load translation tables directly into the cache by consuming the\n * `$translationCache` service directly.\n *\n * @return {object} $cacheFactory object.\n */\n .factory('$translationCache', $translationCache);\n\nfunction $translationCache($cacheFactory) {\n\n 'use strict';\n\n return $cacheFactory('translations');\n}\n\n$translationCache.displayName = '$translationCache';\nreturn 'pascalprecht.translate';\n\n}));\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-translate/dist/angular-translate.js?"); /***/ }), /***/ "./node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js": /*!*********************************************************************!*\ !*** ./node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js ***! \*********************************************************************/ /***/ (() => { eval("/*\n * angular-ui-bootstrap\n * http://angular-ui.github.io/bootstrap/\n\n * Version: 2.2.0 - 2016-10-10\n * License: MIT\n */angular.module(\"ui.bootstrap\", [\"ui.bootstrap.tpls\", \"ui.bootstrap.collapse\",\"ui.bootstrap.tabindex\",\"ui.bootstrap.accordion\",\"ui.bootstrap.alert\",\"ui.bootstrap.buttons\",\"ui.bootstrap.carousel\",\"ui.bootstrap.dateparser\",\"ui.bootstrap.isClass\",\"ui.bootstrap.datepicker\",\"ui.bootstrap.position\",\"ui.bootstrap.datepickerPopup\",\"ui.bootstrap.debounce\",\"ui.bootstrap.dropdown\",\"ui.bootstrap.stackedMap\",\"ui.bootstrap.modal\",\"ui.bootstrap.paging\",\"ui.bootstrap.pager\",\"ui.bootstrap.pagination\",\"ui.bootstrap.tooltip\",\"ui.bootstrap.popover\",\"ui.bootstrap.progressbar\",\"ui.bootstrap.rating\",\"ui.bootstrap.tabs\",\"ui.bootstrap.timepicker\",\"ui.bootstrap.typeahead\"]);\nangular.module(\"ui.bootstrap.tpls\", [\"uib/template/accordion/accordion-group.html\",\"uib/template/accordion/accordion.html\",\"uib/template/alert/alert.html\",\"uib/template/carousel/carousel.html\",\"uib/template/carousel/slide.html\",\"uib/template/datepicker/datepicker.html\",\"uib/template/datepicker/day.html\",\"uib/template/datepicker/month.html\",\"uib/template/datepicker/year.html\",\"uib/template/datepickerPopup/popup.html\",\"uib/template/modal/window.html\",\"uib/template/pager/pager.html\",\"uib/template/pagination/pagination.html\",\"uib/template/tooltip/tooltip-html-popup.html\",\"uib/template/tooltip/tooltip-popup.html\",\"uib/template/tooltip/tooltip-template-popup.html\",\"uib/template/popover/popover-html.html\",\"uib/template/popover/popover-template.html\",\"uib/template/popover/popover.html\",\"uib/template/progressbar/bar.html\",\"uib/template/progressbar/progress.html\",\"uib/template/progressbar/progressbar.html\",\"uib/template/rating/rating.html\",\"uib/template/tabs/tab.html\",\"uib/template/tabs/tabset.html\",\"uib/template/timepicker/timepicker.html\",\"uib/template/typeahead/typeahead-match.html\",\"uib/template/typeahead/typeahead-popup.html\"]);\nangular.module('ui.bootstrap.collapse', [])\n\n .directive('uibCollapse', ['$animate', '$q', '$parse', '$injector', function($animate, $q, $parse, $injector) {\n var $animateCss = $injector.has('$animateCss') ? $injector.get('$animateCss') : null;\n return {\n link: function(scope, element, attrs) {\n var expandingExpr = $parse(attrs.expanding),\n expandedExpr = $parse(attrs.expanded),\n collapsingExpr = $parse(attrs.collapsing),\n collapsedExpr = $parse(attrs.collapsed),\n horizontal = false,\n css = {},\n cssTo = {};\n\n init();\n\n function init() {\n horizontal = !!('horizontal' in attrs);\n if (horizontal) {\n css = {\n width: ''\n };\n cssTo = {width: '0'};\n } else {\n css = {\n height: ''\n };\n cssTo = {height: '0'};\n }\n if (!scope.$eval(attrs.uibCollapse)) {\n element.addClass('in')\n .addClass('collapse')\n .attr('aria-expanded', true)\n .attr('aria-hidden', false)\n .css(css);\n }\n }\n\n function getScrollFromElement(element) {\n if (horizontal) {\n return {width: element.scrollWidth + 'px'};\n }\n return {height: element.scrollHeight + 'px'};\n }\n\n function expand() {\n if (element.hasClass('collapse') && element.hasClass('in')) {\n return;\n }\n\n $q.resolve(expandingExpr(scope))\n .then(function() {\n element.removeClass('collapse')\n .addClass('collapsing')\n .attr('aria-expanded', true)\n .attr('aria-hidden', false);\n\n if ($animateCss) {\n $animateCss(element, {\n addClass: 'in',\n easing: 'ease',\n css: {\n overflow: 'hidden'\n },\n to: getScrollFromElement(element[0])\n }).start()['finally'](expandDone);\n } else {\n $animate.addClass(element, 'in', {\n css: {\n overflow: 'hidden'\n },\n to: getScrollFromElement(element[0])\n }).then(expandDone);\n }\n });\n }\n\n function expandDone() {\n element.removeClass('collapsing')\n .addClass('collapse')\n .css(css);\n expandedExpr(scope);\n }\n\n function collapse() {\n if (!element.hasClass('collapse') && !element.hasClass('in')) {\n return collapseDone();\n }\n\n $q.resolve(collapsingExpr(scope))\n .then(function() {\n element\n // IMPORTANT: The width must be set before adding \"collapsing\" class.\n // Otherwise, the browser attempts to animate from width 0 (in\n // collapsing class) to the given width here.\n .css(getScrollFromElement(element[0]))\n // initially all panel collapse have the collapse class, this removal\n // prevents the animation from jumping to collapsed state\n .removeClass('collapse')\n .addClass('collapsing')\n .attr('aria-expanded', false)\n .attr('aria-hidden', true);\n\n if ($animateCss) {\n $animateCss(element, {\n removeClass: 'in',\n to: cssTo\n }).start()['finally'](collapseDone);\n } else {\n $animate.removeClass(element, 'in', {\n to: cssTo\n }).then(collapseDone);\n }\n });\n }\n\n function collapseDone() {\n element.css(cssTo); // Required so that collapse works when animation is disabled\n element.removeClass('collapsing')\n .addClass('collapse');\n collapsedExpr(scope);\n }\n\n scope.$watch(attrs.uibCollapse, function(shouldCollapse) {\n if (shouldCollapse) {\n collapse();\n } else {\n expand();\n }\n });\n }\n };\n }]);\n\nangular.module('ui.bootstrap.tabindex', [])\n\n.directive('uibTabindexToggle', function() {\n return {\n restrict: 'A',\n link: function(scope, elem, attrs) {\n attrs.$observe('disabled', function(disabled) {\n attrs.$set('tabindex', disabled ? -1 : null);\n });\n }\n };\n});\n\nangular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse', 'ui.bootstrap.tabindex'])\n\n.constant('uibAccordionConfig', {\n closeOthers: true\n})\n\n.controller('UibAccordionController', ['$scope', '$attrs', 'uibAccordionConfig', function($scope, $attrs, accordionConfig) {\n // This array keeps track of the accordion groups\n this.groups = [];\n\n // Ensure that all the groups in this accordion are closed, unless close-others explicitly says not to\n this.closeOthers = function(openGroup) {\n var closeOthers = angular.isDefined($attrs.closeOthers) ?\n $scope.$eval($attrs.closeOthers) : accordionConfig.closeOthers;\n if (closeOthers) {\n angular.forEach(this.groups, function(group) {\n if (group !== openGroup) {\n group.isOpen = false;\n }\n });\n }\n };\n\n // This is called from the accordion-group directive to add itself to the accordion\n this.addGroup = function(groupScope) {\n var that = this;\n this.groups.push(groupScope);\n\n groupScope.$on('$destroy', function(event) {\n that.removeGroup(groupScope);\n });\n };\n\n // This is called from the accordion-group directive when to remove itself\n this.removeGroup = function(group) {\n var index = this.groups.indexOf(group);\n if (index !== -1) {\n this.groups.splice(index, 1);\n }\n };\n}])\n\n// The accordion directive simply sets up the directive controller\n// and adds an accordion CSS class to itself element.\n.directive('uibAccordion', function() {\n return {\n controller: 'UibAccordionController',\n controllerAs: 'accordion',\n transclude: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/accordion/accordion.html';\n }\n };\n})\n\n// The accordion-group directive indicates a block of html that will expand and collapse in an accordion\n.directive('uibAccordionGroup', function() {\n return {\n require: '^uibAccordion', // We need this directive to be inside an accordion\n transclude: true, // It transcludes the contents of the directive into the template\n restrict: 'A',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/accordion/accordion-group.html';\n },\n scope: {\n heading: '@', // Interpolate the heading attribute onto this scope\n panelClass: '@?', // Ditto with panelClass\n isOpen: '=?',\n isDisabled: '=?'\n },\n controller: function() {\n this.setHeading = function(element) {\n this.heading = element;\n };\n },\n link: function(scope, element, attrs, accordionCtrl) {\n element.addClass('panel');\n accordionCtrl.addGroup(scope);\n\n scope.openClass = attrs.openClass || 'panel-open';\n scope.panelClass = attrs.panelClass || 'panel-default';\n scope.$watch('isOpen', function(value) {\n element.toggleClass(scope.openClass, !!value);\n if (value) {\n accordionCtrl.closeOthers(scope);\n }\n });\n\n scope.toggleOpen = function($event) {\n if (!scope.isDisabled) {\n if (!$event || $event.which === 32) {\n scope.isOpen = !scope.isOpen;\n }\n }\n };\n\n var id = 'accordiongroup-' + scope.$id + '-' + Math.floor(Math.random() * 10000);\n scope.headingId = id + '-tab';\n scope.panelId = id + '-panel';\n }\n };\n})\n\n// Use accordion-heading below an accordion-group to provide a heading containing HTML\n.directive('uibAccordionHeading', function() {\n return {\n transclude: true, // Grab the contents to be used as the heading\n template: '', // In effect remove this element!\n replace: true,\n require: '^uibAccordionGroup',\n link: function(scope, element, attrs, accordionGroupCtrl, transclude) {\n // Pass the heading to the accordion-group controller\n // so that it can be transcluded into the right place in the template\n // [The second parameter to transclude causes the elements to be cloned so that they work in ng-repeat]\n accordionGroupCtrl.setHeading(transclude(scope, angular.noop));\n }\n };\n})\n\n// Use in the accordion-group template to indicate where you want the heading to be transcluded\n// You must provide the property on the accordion-group controller that will hold the transcluded element\n.directive('uibAccordionTransclude', function() {\n return {\n require: '^uibAccordionGroup',\n link: function(scope, element, attrs, controller) {\n scope.$watch(function() { return controller[attrs.uibAccordionTransclude]; }, function(heading) {\n if (heading) {\n var elem = angular.element(element[0].querySelector(getHeaderSelectors()));\n elem.html('');\n elem.append(heading);\n }\n });\n }\n };\n\n function getHeaderSelectors() {\n return 'uib-accordion-header,' +\n 'data-uib-accordion-header,' +\n 'x-uib-accordion-header,' +\n 'uib\\\\:accordion-header,' +\n '[uib-accordion-header],' +\n '[data-uib-accordion-header],' +\n '[x-uib-accordion-header]';\n }\n});\n\nangular.module('ui.bootstrap.alert', [])\n\n.controller('UibAlertController', ['$scope', '$element', '$attrs', '$interpolate', '$timeout', function($scope, $element, $attrs, $interpolate, $timeout) {\n $scope.closeable = !!$attrs.close;\n $element.addClass('alert');\n $attrs.$set('role', 'alert');\n if ($scope.closeable) {\n $element.addClass('alert-dismissible');\n }\n\n var dismissOnTimeout = angular.isDefined($attrs.dismissOnTimeout) ?\n $interpolate($attrs.dismissOnTimeout)($scope.$parent) : null;\n\n if (dismissOnTimeout) {\n $timeout(function() {\n $scope.close();\n }, parseInt(dismissOnTimeout, 10));\n }\n}])\n\n.directive('uibAlert', function() {\n return {\n controller: 'UibAlertController',\n controllerAs: 'alert',\n restrict: 'A',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/alert/alert.html';\n },\n transclude: true,\n scope: {\n close: '&'\n }\n };\n});\n\nangular.module('ui.bootstrap.buttons', [])\n\n.constant('uibButtonConfig', {\n activeClass: 'active',\n toggleEvent: 'click'\n})\n\n.controller('UibButtonsController', ['uibButtonConfig', function(buttonConfig) {\n this.activeClass = buttonConfig.activeClass || 'active';\n this.toggleEvent = buttonConfig.toggleEvent || 'click';\n}])\n\n.directive('uibBtnRadio', ['$parse', function($parse) {\n return {\n require: ['uibBtnRadio', 'ngModel'],\n controller: 'UibButtonsController',\n controllerAs: 'buttons',\n link: function(scope, element, attrs, ctrls) {\n var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n var uncheckableExpr = $parse(attrs.uibUncheckable);\n\n element.find('input').css({display: 'none'});\n\n //model -> UI\n ngModelCtrl.$render = function() {\n element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, scope.$eval(attrs.uibBtnRadio)));\n };\n\n //ui->model\n element.on(buttonsCtrl.toggleEvent, function() {\n if (attrs.disabled) {\n return;\n }\n\n var isActive = element.hasClass(buttonsCtrl.activeClass);\n\n if (!isActive || angular.isDefined(attrs.uncheckable)) {\n scope.$apply(function() {\n ngModelCtrl.$setViewValue(isActive ? null : scope.$eval(attrs.uibBtnRadio));\n ngModelCtrl.$render();\n });\n }\n });\n\n if (attrs.uibUncheckable) {\n scope.$watch(uncheckableExpr, function(uncheckable) {\n attrs.$set('uncheckable', uncheckable ? '' : undefined);\n });\n }\n }\n };\n}])\n\n.directive('uibBtnCheckbox', function() {\n return {\n require: ['uibBtnCheckbox', 'ngModel'],\n controller: 'UibButtonsController',\n controllerAs: 'button',\n link: function(scope, element, attrs, ctrls) {\n var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n element.find('input').css({display: 'none'});\n\n function getTrueValue() {\n return getCheckboxValue(attrs.btnCheckboxTrue, true);\n }\n\n function getFalseValue() {\n return getCheckboxValue(attrs.btnCheckboxFalse, false);\n }\n\n function getCheckboxValue(attribute, defaultValue) {\n return angular.isDefined(attribute) ? scope.$eval(attribute) : defaultValue;\n }\n\n //model -> UI\n ngModelCtrl.$render = function() {\n element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, getTrueValue()));\n };\n\n //ui->model\n element.on(buttonsCtrl.toggleEvent, function() {\n if (attrs.disabled) {\n return;\n }\n\n scope.$apply(function() {\n ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass) ? getFalseValue() : getTrueValue());\n ngModelCtrl.$render();\n });\n });\n }\n };\n});\n\nangular.module('ui.bootstrap.carousel', [])\n\n.controller('UibCarouselController', ['$scope', '$element', '$interval', '$timeout', '$animate', function($scope, $element, $interval, $timeout, $animate) {\n var self = this,\n slides = self.slides = $scope.slides = [],\n SLIDE_DIRECTION = 'uib-slideDirection',\n currentIndex = $scope.active,\n currentInterval, isPlaying, bufferedTransitions = [];\n\n var destroyed = false;\n $element.addClass('carousel');\n\n self.addSlide = function(slide, element) {\n slides.push({\n slide: slide,\n element: element\n });\n slides.sort(function(a, b) {\n return +a.slide.index - +b.slide.index;\n });\n //if this is the first slide or the slide is set to active, select it\n if (slide.index === $scope.active || slides.length === 1 && !angular.isNumber($scope.active)) {\n if ($scope.$currentTransition) {\n $scope.$currentTransition = null;\n }\n\n currentIndex = slide.index;\n $scope.active = slide.index;\n setActive(currentIndex);\n self.select(slides[findSlideIndex(slide)]);\n if (slides.length === 1) {\n $scope.play();\n }\n }\n };\n\n self.getCurrentIndex = function() {\n for (var i = 0; i < slides.length; i++) {\n if (slides[i].slide.index === currentIndex) {\n return i;\n }\n }\n };\n\n self.next = $scope.next = function() {\n var newIndex = (self.getCurrentIndex() + 1) % slides.length;\n\n if (newIndex === 0 && $scope.noWrap()) {\n $scope.pause();\n return;\n }\n\n return self.select(slides[newIndex], 'next');\n };\n\n self.prev = $scope.prev = function() {\n var newIndex = self.getCurrentIndex() - 1 < 0 ? slides.length - 1 : self.getCurrentIndex() - 1;\n\n if ($scope.noWrap() && newIndex === slides.length - 1) {\n $scope.pause();\n return;\n }\n\n return self.select(slides[newIndex], 'prev');\n };\n\n self.removeSlide = function(slide) {\n var index = findSlideIndex(slide);\n\n var bufferedIndex = bufferedTransitions.indexOf(slides[index]);\n if (bufferedIndex !== -1) {\n bufferedTransitions.splice(bufferedIndex, 1);\n }\n\n //get the index of the slide inside the carousel\n slides.splice(index, 1);\n if (slides.length > 0 && currentIndex === index) {\n if (index >= slides.length) {\n currentIndex = slides.length - 1;\n $scope.active = currentIndex;\n setActive(currentIndex);\n self.select(slides[slides.length - 1]);\n } else {\n currentIndex = index;\n $scope.active = currentIndex;\n setActive(currentIndex);\n self.select(slides[index]);\n }\n } else if (currentIndex > index) {\n currentIndex--;\n $scope.active = currentIndex;\n }\n\n //clean the active value when no more slide\n if (slides.length === 0) {\n currentIndex = null;\n $scope.active = null;\n clearBufferedTransitions();\n }\n };\n\n /* direction: \"prev\" or \"next\" */\n self.select = $scope.select = function(nextSlide, direction) {\n var nextIndex = findSlideIndex(nextSlide.slide);\n //Decide direction if it's not given\n if (direction === undefined) {\n direction = nextIndex > self.getCurrentIndex() ? 'next' : 'prev';\n }\n //Prevent this user-triggered transition from occurring if there is already one in progress\n if (nextSlide.slide.index !== currentIndex &&\n !$scope.$currentTransition) {\n goNext(nextSlide.slide, nextIndex, direction);\n } else if (nextSlide && nextSlide.slide.index !== currentIndex && $scope.$currentTransition) {\n bufferedTransitions.push(slides[nextIndex]);\n }\n };\n\n /* Allow outside people to call indexOf on slides array */\n $scope.indexOfSlide = function(slide) {\n return +slide.slide.index;\n };\n\n $scope.isActive = function(slide) {\n return $scope.active === slide.slide.index;\n };\n\n $scope.isPrevDisabled = function() {\n return $scope.active === 0 && $scope.noWrap();\n };\n\n $scope.isNextDisabled = function() {\n return $scope.active === slides.length - 1 && $scope.noWrap();\n };\n\n $scope.pause = function() {\n if (!$scope.noPause) {\n isPlaying = false;\n resetTimer();\n }\n };\n\n $scope.play = function() {\n if (!isPlaying) {\n isPlaying = true;\n restartTimer();\n }\n };\n\n $element.on('mouseenter', $scope.pause);\n $element.on('mouseleave', $scope.play);\n\n $scope.$on('$destroy', function() {\n destroyed = true;\n resetTimer();\n });\n\n $scope.$watch('noTransition', function(noTransition) {\n $animate.enabled($element, !noTransition);\n });\n\n $scope.$watch('interval', restartTimer);\n\n $scope.$watchCollection('slides', resetTransition);\n\n $scope.$watch('active', function(index) {\n if (angular.isNumber(index) && currentIndex !== index) {\n for (var i = 0; i < slides.length; i++) {\n if (slides[i].slide.index === index) {\n index = i;\n break;\n }\n }\n\n var slide = slides[index];\n if (slide) {\n setActive(index);\n self.select(slides[index]);\n currentIndex = index;\n }\n }\n });\n\n function clearBufferedTransitions() {\n while (bufferedTransitions.length) {\n bufferedTransitions.shift();\n }\n }\n\n function getSlideByIndex(index) {\n for (var i = 0, l = slides.length; i < l; ++i) {\n if (slides[i].index === index) {\n return slides[i];\n }\n }\n }\n\n function setActive(index) {\n for (var i = 0; i < slides.length; i++) {\n slides[i].slide.active = i === index;\n }\n }\n\n function goNext(slide, index, direction) {\n if (destroyed) {\n return;\n }\n\n angular.extend(slide, {direction: direction});\n angular.extend(slides[currentIndex].slide || {}, {direction: direction});\n if ($animate.enabled($element) && !$scope.$currentTransition &&\n slides[index].element && self.slides.length > 1) {\n slides[index].element.data(SLIDE_DIRECTION, slide.direction);\n var currentIdx = self.getCurrentIndex();\n\n if (angular.isNumber(currentIdx) && slides[currentIdx].element) {\n slides[currentIdx].element.data(SLIDE_DIRECTION, slide.direction);\n }\n\n $scope.$currentTransition = true;\n $animate.on('addClass', slides[index].element, function(element, phase) {\n if (phase === 'close') {\n $scope.$currentTransition = null;\n $animate.off('addClass', element);\n if (bufferedTransitions.length) {\n var nextSlide = bufferedTransitions.pop().slide;\n var nextIndex = nextSlide.index;\n var nextDirection = nextIndex > self.getCurrentIndex() ? 'next' : 'prev';\n clearBufferedTransitions();\n\n goNext(nextSlide, nextIndex, nextDirection);\n }\n }\n });\n }\n\n $scope.active = slide.index;\n currentIndex = slide.index;\n setActive(index);\n\n //every time you change slides, reset the timer\n restartTimer();\n }\n\n function findSlideIndex(slide) {\n for (var i = 0; i < slides.length; i++) {\n if (slides[i].slide === slide) {\n return i;\n }\n }\n }\n\n function resetTimer() {\n if (currentInterval) {\n $interval.cancel(currentInterval);\n currentInterval = null;\n }\n }\n\n function resetTransition(slides) {\n if (!slides.length) {\n $scope.$currentTransition = null;\n clearBufferedTransitions();\n }\n }\n\n function restartTimer() {\n resetTimer();\n var interval = +$scope.interval;\n if (!isNaN(interval) && interval > 0) {\n currentInterval = $interval(timerFn, interval);\n }\n }\n\n function timerFn() {\n var interval = +$scope.interval;\n if (isPlaying && !isNaN(interval) && interval > 0 && slides.length) {\n $scope.next();\n } else {\n $scope.pause();\n }\n }\n}])\n\n.directive('uibCarousel', function() {\n return {\n transclude: true,\n controller: 'UibCarouselController',\n controllerAs: 'carousel',\n restrict: 'A',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/carousel/carousel.html';\n },\n scope: {\n active: '=',\n interval: '=',\n noTransition: '=',\n noPause: '=',\n noWrap: '&'\n }\n };\n})\n\n.directive('uibSlide', ['$animate', function($animate) {\n return {\n require: '^uibCarousel',\n restrict: 'A',\n transclude: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/carousel/slide.html';\n },\n scope: {\n actual: '=?',\n index: '=?'\n },\n link: function (scope, element, attrs, carouselCtrl) {\n element.addClass('item');\n carouselCtrl.addSlide(scope, element);\n //when the scope is destroyed then remove the slide from the current slides array\n scope.$on('$destroy', function() {\n carouselCtrl.removeSlide(scope);\n });\n\n scope.$watch('active', function(active) {\n $animate[active ? 'addClass' : 'removeClass'](element, 'active');\n });\n }\n };\n}])\n\n.animation('.item', ['$animateCss',\nfunction($animateCss) {\n var SLIDE_DIRECTION = 'uib-slideDirection';\n\n function removeClass(element, className, callback) {\n element.removeClass(className);\n if (callback) {\n callback();\n }\n }\n\n return {\n beforeAddClass: function(element, className, done) {\n if (className === 'active') {\n var stopped = false;\n var direction = element.data(SLIDE_DIRECTION);\n var directionClass = direction === 'next' ? 'left' : 'right';\n var removeClassFn = removeClass.bind(this, element,\n directionClass + ' ' + direction, done);\n element.addClass(direction);\n\n $animateCss(element, {addClass: directionClass})\n .start()\n .done(removeClassFn);\n\n return function() {\n stopped = true;\n };\n }\n done();\n },\n beforeRemoveClass: function (element, className, done) {\n if (className === 'active') {\n var stopped = false;\n var direction = element.data(SLIDE_DIRECTION);\n var directionClass = direction === 'next' ? 'left' : 'right';\n var removeClassFn = removeClass.bind(this, element, directionClass, done);\n\n $animateCss(element, {addClass: directionClass})\n .start()\n .done(removeClassFn);\n\n return function() {\n stopped = true;\n };\n }\n done();\n }\n };\n}]);\n\nangular.module('ui.bootstrap.dateparser', [])\n\n.service('uibDateParser', ['$log', '$locale', 'dateFilter', 'orderByFilter', function($log, $locale, dateFilter, orderByFilter) {\n // Pulled from https://github.com/mbostock/d3/blob/master/src/format/requote.js\n var SPECIAL_CHARACTERS_REGEXP = /[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g;\n\n var localeId;\n var formatCodeToRegex;\n\n this.init = function() {\n localeId = $locale.id;\n\n this.parsers = {};\n this.formatters = {};\n\n formatCodeToRegex = [\n {\n key: 'yyyy',\n regex: '\\\\d{4}',\n apply: function(value) { this.year = +value; },\n formatter: function(date) {\n var _date = new Date();\n _date.setFullYear(Math.abs(date.getFullYear()));\n return dateFilter(_date, 'yyyy');\n }\n },\n {\n key: 'yy',\n regex: '\\\\d{2}',\n apply: function(value) { value = +value; this.year = value < 69 ? value + 2000 : value + 1900; },\n formatter: function(date) {\n var _date = new Date();\n _date.setFullYear(Math.abs(date.getFullYear()));\n return dateFilter(_date, 'yy');\n }\n },\n {\n key: 'y',\n regex: '\\\\d{1,4}',\n apply: function(value) { this.year = +value; },\n formatter: function(date) {\n var _date = new Date();\n _date.setFullYear(Math.abs(date.getFullYear()));\n return dateFilter(_date, 'y');\n }\n },\n {\n key: 'M!',\n regex: '0?[1-9]|1[0-2]',\n apply: function(value) { this.month = value - 1; },\n formatter: function(date) {\n var value = date.getMonth();\n if (/^[0-9]$/.test(value)) {\n return dateFilter(date, 'MM');\n }\n\n return dateFilter(date, 'M');\n }\n },\n {\n key: 'MMMM',\n regex: $locale.DATETIME_FORMATS.MONTH.join('|'),\n apply: function(value) { this.month = $locale.DATETIME_FORMATS.MONTH.indexOf(value); },\n formatter: function(date) { return dateFilter(date, 'MMMM'); }\n },\n {\n key: 'MMM',\n regex: $locale.DATETIME_FORMATS.SHORTMONTH.join('|'),\n apply: function(value) { this.month = $locale.DATETIME_FORMATS.SHORTMONTH.indexOf(value); },\n formatter: function(date) { return dateFilter(date, 'MMM'); }\n },\n {\n key: 'MM',\n regex: '0[1-9]|1[0-2]',\n apply: function(value) { this.month = value - 1; },\n formatter: function(date) { return dateFilter(date, 'MM'); }\n },\n {\n key: 'M',\n regex: '[1-9]|1[0-2]',\n apply: function(value) { this.month = value - 1; },\n formatter: function(date) { return dateFilter(date, 'M'); }\n },\n {\n key: 'd!',\n regex: '[0-2]?[0-9]{1}|3[0-1]{1}',\n apply: function(value) { this.date = +value; },\n formatter: function(date) {\n var value = date.getDate();\n if (/^[1-9]$/.test(value)) {\n return dateFilter(date, 'dd');\n }\n\n return dateFilter(date, 'd');\n }\n },\n {\n key: 'dd',\n regex: '[0-2][0-9]{1}|3[0-1]{1}',\n apply: function(value) { this.date = +value; },\n formatter: function(date) { return dateFilter(date, 'dd'); }\n },\n {\n key: 'd',\n regex: '[1-2]?[0-9]{1}|3[0-1]{1}',\n apply: function(value) { this.date = +value; },\n formatter: function(date) { return dateFilter(date, 'd'); }\n },\n {\n key: 'EEEE',\n regex: $locale.DATETIME_FORMATS.DAY.join('|'),\n formatter: function(date) { return dateFilter(date, 'EEEE'); }\n },\n {\n key: 'EEE',\n regex: $locale.DATETIME_FORMATS.SHORTDAY.join('|'),\n formatter: function(date) { return dateFilter(date, 'EEE'); }\n },\n {\n key: 'HH',\n regex: '(?:0|1)[0-9]|2[0-3]',\n apply: function(value) { this.hours = +value; },\n formatter: function(date) { return dateFilter(date, 'HH'); }\n },\n {\n key: 'hh',\n regex: '0[0-9]|1[0-2]',\n apply: function(value) { this.hours = +value; },\n formatter: function(date) { return dateFilter(date, 'hh'); }\n },\n {\n key: 'H',\n regex: '1?[0-9]|2[0-3]',\n apply: function(value) { this.hours = +value; },\n formatter: function(date) { return dateFilter(date, 'H'); }\n },\n {\n key: 'h',\n regex: '[0-9]|1[0-2]',\n apply: function(value) { this.hours = +value; },\n formatter: function(date) { return dateFilter(date, 'h'); }\n },\n {\n key: 'mm',\n regex: '[0-5][0-9]',\n apply: function(value) { this.minutes = +value; },\n formatter: function(date) { return dateFilter(date, 'mm'); }\n },\n {\n key: 'm',\n regex: '[0-9]|[1-5][0-9]',\n apply: function(value) { this.minutes = +value; },\n formatter: function(date) { return dateFilter(date, 'm'); }\n },\n {\n key: 'sss',\n regex: '[0-9][0-9][0-9]',\n apply: function(value) { this.milliseconds = +value; },\n formatter: function(date) { return dateFilter(date, 'sss'); }\n },\n {\n key: 'ss',\n regex: '[0-5][0-9]',\n apply: function(value) { this.seconds = +value; },\n formatter: function(date) { return dateFilter(date, 'ss'); }\n },\n {\n key: 's',\n regex: '[0-9]|[1-5][0-9]',\n apply: function(value) { this.seconds = +value; },\n formatter: function(date) { return dateFilter(date, 's'); }\n },\n {\n key: 'a',\n regex: $locale.DATETIME_FORMATS.AMPMS.join('|'),\n apply: function(value) {\n if (this.hours === 12) {\n this.hours = 0;\n }\n\n if (value === 'PM') {\n this.hours += 12;\n }\n },\n formatter: function(date) { return dateFilter(date, 'a'); }\n },\n {\n key: 'Z',\n regex: '[+-]\\\\d{4}',\n apply: function(value) {\n var matches = value.match(/([+-])(\\d{2})(\\d{2})/),\n sign = matches[1],\n hours = matches[2],\n minutes = matches[3];\n this.hours += toInt(sign + hours);\n this.minutes += toInt(sign + minutes);\n },\n formatter: function(date) {\n return dateFilter(date, 'Z');\n }\n },\n {\n key: 'ww',\n regex: '[0-4][0-9]|5[0-3]',\n formatter: function(date) { return dateFilter(date, 'ww'); }\n },\n {\n key: 'w',\n regex: '[0-9]|[1-4][0-9]|5[0-3]',\n formatter: function(date) { return dateFilter(date, 'w'); }\n },\n {\n key: 'GGGG',\n regex: $locale.DATETIME_FORMATS.ERANAMES.join('|').replace(/\\s/g, '\\\\s'),\n formatter: function(date) { return dateFilter(date, 'GGGG'); }\n },\n {\n key: 'GGG',\n regex: $locale.DATETIME_FORMATS.ERAS.join('|'),\n formatter: function(date) { return dateFilter(date, 'GGG'); }\n },\n {\n key: 'GG',\n regex: $locale.DATETIME_FORMATS.ERAS.join('|'),\n formatter: function(date) { return dateFilter(date, 'GG'); }\n },\n {\n key: 'G',\n regex: $locale.DATETIME_FORMATS.ERAS.join('|'),\n formatter: function(date) { return dateFilter(date, 'G'); }\n }\n ];\n };\n\n this.init();\n\n function createParser(format) {\n var map = [], regex = format.split('');\n\n // check for literal values\n var quoteIndex = format.indexOf('\\'');\n if (quoteIndex > -1) {\n var inLiteral = false;\n format = format.split('');\n for (var i = quoteIndex; i < format.length; i++) {\n if (inLiteral) {\n if (format[i] === '\\'') {\n if (i + 1 < format.length && format[i+1] === '\\'') { // escaped single quote\n format[i+1] = '$';\n regex[i+1] = '';\n } else { // end of literal\n regex[i] = '';\n inLiteral = false;\n }\n }\n format[i] = '$';\n } else {\n if (format[i] === '\\'') { // start of literal\n format[i] = '$';\n regex[i] = '';\n inLiteral = true;\n }\n }\n }\n\n format = format.join('');\n }\n\n angular.forEach(formatCodeToRegex, function(data) {\n var index = format.indexOf(data.key);\n\n if (index > -1) {\n format = format.split('');\n\n regex[index] = '(' + data.regex + ')';\n format[index] = '$'; // Custom symbol to define consumed part of format\n for (var i = index + 1, n = index + data.key.length; i < n; i++) {\n regex[i] = '';\n format[i] = '$';\n }\n format = format.join('');\n\n map.push({\n index: index,\n key: data.key,\n apply: data.apply,\n matcher: data.regex\n });\n }\n });\n\n return {\n regex: new RegExp('^' + regex.join('') + '$'),\n map: orderByFilter(map, 'index')\n };\n }\n\n function createFormatter(format) {\n var formatters = [];\n var i = 0;\n var formatter, literalIdx;\n while (i < format.length) {\n if (angular.isNumber(literalIdx)) {\n if (format.charAt(i) === '\\'') {\n if (i + 1 >= format.length || format.charAt(i + 1) !== '\\'') {\n formatters.push(constructLiteralFormatter(format, literalIdx, i));\n literalIdx = null;\n }\n } else if (i === format.length) {\n while (literalIdx < format.length) {\n formatter = constructFormatterFromIdx(format, literalIdx);\n formatters.push(formatter);\n literalIdx = formatter.endIdx;\n }\n }\n\n i++;\n continue;\n }\n\n if (format.charAt(i) === '\\'') {\n literalIdx = i;\n i++;\n continue;\n }\n\n formatter = constructFormatterFromIdx(format, i);\n\n formatters.push(formatter.parser);\n i = formatter.endIdx;\n }\n\n return formatters;\n }\n\n function constructLiteralFormatter(format, literalIdx, endIdx) {\n return function() {\n return format.substr(literalIdx + 1, endIdx - literalIdx - 1);\n };\n }\n\n function constructFormatterFromIdx(format, i) {\n var currentPosStr = format.substr(i);\n for (var j = 0; j < formatCodeToRegex.length; j++) {\n if (new RegExp('^' + formatCodeToRegex[j].key).test(currentPosStr)) {\n var data = formatCodeToRegex[j];\n return {\n endIdx: i + data.key.length,\n parser: data.formatter\n };\n }\n }\n\n return {\n endIdx: i + 1,\n parser: function() {\n return currentPosStr.charAt(0);\n }\n };\n }\n\n this.filter = function(date, format) {\n if (!angular.isDate(date) || isNaN(date) || !format) {\n return '';\n }\n\n format = $locale.DATETIME_FORMATS[format] || format;\n\n if ($locale.id !== localeId) {\n this.init();\n }\n\n if (!this.formatters[format]) {\n this.formatters[format] = createFormatter(format);\n }\n\n var formatters = this.formatters[format];\n\n return formatters.reduce(function(str, formatter) {\n return str + formatter(date);\n }, '');\n };\n\n this.parse = function(input, format, baseDate) {\n if (!angular.isString(input) || !format) {\n return input;\n }\n\n format = $locale.DATETIME_FORMATS[format] || format;\n format = format.replace(SPECIAL_CHARACTERS_REGEXP, '\\\\$&');\n\n if ($locale.id !== localeId) {\n this.init();\n }\n\n if (!this.parsers[format]) {\n this.parsers[format] = createParser(format, 'apply');\n }\n\n var parser = this.parsers[format],\n regex = parser.regex,\n map = parser.map,\n results = input.match(regex),\n tzOffset = false;\n if (results && results.length) {\n var fields, dt;\n if (angular.isDate(baseDate) && !isNaN(baseDate.getTime())) {\n fields = {\n year: baseDate.getFullYear(),\n month: baseDate.getMonth(),\n date: baseDate.getDate(),\n hours: baseDate.getHours(),\n minutes: baseDate.getMinutes(),\n seconds: baseDate.getSeconds(),\n milliseconds: baseDate.getMilliseconds()\n };\n } else {\n if (baseDate) {\n $log.warn('dateparser:', 'baseDate is not a valid date');\n }\n fields = { year: 1900, month: 0, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0 };\n }\n\n for (var i = 1, n = results.length; i < n; i++) {\n var mapper = map[i - 1];\n if (mapper.matcher === 'Z') {\n tzOffset = true;\n }\n\n if (mapper.apply) {\n mapper.apply.call(fields, results[i]);\n }\n }\n\n var datesetter = tzOffset ? Date.prototype.setUTCFullYear :\n Date.prototype.setFullYear;\n var timesetter = tzOffset ? Date.prototype.setUTCHours :\n Date.prototype.setHours;\n\n if (isValid(fields.year, fields.month, fields.date)) {\n if (angular.isDate(baseDate) && !isNaN(baseDate.getTime()) && !tzOffset) {\n dt = new Date(baseDate);\n datesetter.call(dt, fields.year, fields.month, fields.date);\n timesetter.call(dt, fields.hours, fields.minutes,\n fields.seconds, fields.milliseconds);\n } else {\n dt = new Date(0);\n datesetter.call(dt, fields.year, fields.month, fields.date);\n timesetter.call(dt, fields.hours || 0, fields.minutes || 0,\n fields.seconds || 0, fields.milliseconds || 0);\n }\n }\n\n return dt;\n }\n };\n\n // Check if date is valid for specific month (and year for February).\n // Month: 0 = Jan, 1 = Feb, etc\n function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }\n\n function toInt(str) {\n return parseInt(str, 10);\n }\n\n this.toTimezone = toTimezone;\n this.fromTimezone = fromTimezone;\n this.timezoneToOffset = timezoneToOffset;\n this.addDateMinutes = addDateMinutes;\n this.convertTimezoneToLocal = convertTimezoneToLocal;\n\n function toTimezone(date, timezone) {\n return date && timezone ? convertTimezoneToLocal(date, timezone) : date;\n }\n\n function fromTimezone(date, timezone) {\n return date && timezone ? convertTimezoneToLocal(date, timezone, true) : date;\n }\n\n //https://github.com/angular/angular.js/blob/622c42169699ec07fc6daaa19fe6d224e5d2f70e/src/Angular.js#L1207\n function timezoneToOffset(timezone, fallback) {\n timezone = timezone.replace(/:/g, '');\n var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n }\n\n function addDateMinutes(date, minutes) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n }\n\n function convertTimezoneToLocal(date, timezone, reverse) {\n reverse = reverse ? -1 : 1;\n var dateTimezoneOffset = date.getTimezoneOffset();\n var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));\n }\n}]);\n\n// Avoiding use of ng-class as it creates a lot of watchers when a class is to be applied to\n// at most one element.\nangular.module('ui.bootstrap.isClass', [])\n.directive('uibIsClass', [\n '$animate',\nfunction ($animate) {\n // 11111111 22222222\n var ON_REGEXP = /^\\s*([\\s\\S]+?)\\s+on\\s+([\\s\\S]+?)\\s*$/;\n // 11111111 22222222\n var IS_REGEXP = /^\\s*([\\s\\S]+?)\\s+for\\s+([\\s\\S]+?)\\s*$/;\n\n var dataPerTracked = {};\n\n return {\n restrict: 'A',\n compile: function(tElement, tAttrs) {\n var linkedScopes = [];\n var instances = [];\n var expToData = {};\n var lastActivated = null;\n var onExpMatches = tAttrs.uibIsClass.match(ON_REGEXP);\n var onExp = onExpMatches[2];\n var expsStr = onExpMatches[1];\n var exps = expsStr.split(',');\n\n return linkFn;\n\n function linkFn(scope, element, attrs) {\n linkedScopes.push(scope);\n instances.push({\n scope: scope,\n element: element\n });\n\n exps.forEach(function(exp, k) {\n addForExp(exp, scope);\n });\n\n scope.$on('$destroy', removeScope);\n }\n\n function addForExp(exp, scope) {\n var matches = exp.match(IS_REGEXP);\n var clazz = scope.$eval(matches[1]);\n var compareWithExp = matches[2];\n var data = expToData[exp];\n if (!data) {\n var watchFn = function(compareWithVal) {\n var newActivated = null;\n instances.some(function(instance) {\n var thisVal = instance.scope.$eval(onExp);\n if (thisVal === compareWithVal) {\n newActivated = instance;\n return true;\n }\n });\n if (data.lastActivated !== newActivated) {\n if (data.lastActivated) {\n $animate.removeClass(data.lastActivated.element, clazz);\n }\n if (newActivated) {\n $animate.addClass(newActivated.element, clazz);\n }\n data.lastActivated = newActivated;\n }\n };\n expToData[exp] = data = {\n lastActivated: null,\n scope: scope,\n watchFn: watchFn,\n compareWithExp: compareWithExp,\n watcher: scope.$watch(compareWithExp, watchFn)\n };\n }\n data.watchFn(scope.$eval(compareWithExp));\n }\n\n function removeScope(e) {\n var removedScope = e.targetScope;\n var index = linkedScopes.indexOf(removedScope);\n linkedScopes.splice(index, 1);\n instances.splice(index, 1);\n if (linkedScopes.length) {\n var newWatchScope = linkedScopes[0];\n angular.forEach(expToData, function(data) {\n if (data.scope === removedScope) {\n data.watcher = newWatchScope.$watch(data.compareWithExp, data.watchFn);\n data.scope = newWatchScope;\n }\n });\n } else {\n expToData = {};\n }\n }\n }\n };\n}]);\nangular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.isClass'])\n\n.value('$datepickerSuppressError', false)\n\n.value('$datepickerLiteralWarning', true)\n\n.constant('uibDatepickerConfig', {\n datepickerMode: 'day',\n formatDay: 'dd',\n formatMonth: 'MMMM',\n formatYear: 'yyyy',\n formatDayHeader: 'EEE',\n formatDayTitle: 'MMMM yyyy',\n formatMonthTitle: 'yyyy',\n maxDate: null,\n maxMode: 'year',\n minDate: null,\n minMode: 'day',\n monthColumns: 3,\n ngModelOptions: {},\n shortcutPropagation: false,\n showWeeks: true,\n yearColumns: 5,\n yearRows: 4\n})\n\n.controller('UibDatepickerController', ['$scope', '$element', '$attrs', '$parse', '$interpolate', '$locale', '$log', 'dateFilter', 'uibDatepickerConfig', '$datepickerLiteralWarning', '$datepickerSuppressError', 'uibDateParser',\n function($scope, $element, $attrs, $parse, $interpolate, $locale, $log, dateFilter, datepickerConfig, $datepickerLiteralWarning, $datepickerSuppressError, dateParser) {\n var self = this,\n ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl;\n ngModelOptions = {},\n watchListeners = [];\n\n $element.addClass('uib-datepicker');\n $attrs.$set('role', 'application');\n\n if (!$scope.datepickerOptions) {\n $scope.datepickerOptions = {};\n }\n\n // Modes chain\n this.modes = ['day', 'month', 'year'];\n\n [\n 'customClass',\n 'dateDisabled',\n 'datepickerMode',\n 'formatDay',\n 'formatDayHeader',\n 'formatDayTitle',\n 'formatMonth',\n 'formatMonthTitle',\n 'formatYear',\n 'maxDate',\n 'maxMode',\n 'minDate',\n 'minMode',\n 'monthColumns',\n 'showWeeks',\n 'shortcutPropagation',\n 'startingDay',\n 'yearColumns',\n 'yearRows'\n ].forEach(function(key) {\n switch (key) {\n case 'customClass':\n case 'dateDisabled':\n $scope[key] = $scope.datepickerOptions[key] || angular.noop;\n break;\n case 'datepickerMode':\n $scope.datepickerMode = angular.isDefined($scope.datepickerOptions.datepickerMode) ?\n $scope.datepickerOptions.datepickerMode : datepickerConfig.datepickerMode;\n break;\n case 'formatDay':\n case 'formatDayHeader':\n case 'formatDayTitle':\n case 'formatMonth':\n case 'formatMonthTitle':\n case 'formatYear':\n self[key] = angular.isDefined($scope.datepickerOptions[key]) ?\n $interpolate($scope.datepickerOptions[key])($scope.$parent) :\n datepickerConfig[key];\n break;\n case 'monthColumns':\n case 'showWeeks':\n case 'shortcutPropagation':\n case 'yearColumns':\n case 'yearRows':\n self[key] = angular.isDefined($scope.datepickerOptions[key]) ?\n $scope.datepickerOptions[key] : datepickerConfig[key];\n break;\n case 'startingDay':\n if (angular.isDefined($scope.datepickerOptions.startingDay)) {\n self.startingDay = $scope.datepickerOptions.startingDay;\n } else if (angular.isNumber(datepickerConfig.startingDay)) {\n self.startingDay = datepickerConfig.startingDay;\n } else {\n self.startingDay = ($locale.DATETIME_FORMATS.FIRSTDAYOFWEEK + 8) % 7;\n }\n\n break;\n case 'maxDate':\n case 'minDate':\n $scope.$watch('datepickerOptions.' + key, function(value) {\n if (value) {\n if (angular.isDate(value)) {\n self[key] = dateParser.fromTimezone(new Date(value), ngModelOptions.timezone);\n } else {\n if ($datepickerLiteralWarning) {\n $log.warn('Literal date support has been deprecated, please switch to date object usage');\n }\n\n self[key] = new Date(dateFilter(value, 'medium'));\n }\n } else {\n self[key] = datepickerConfig[key] ?\n dateParser.fromTimezone(new Date(datepickerConfig[key]), ngModelOptions.timezone) :\n null;\n }\n\n self.refreshView();\n });\n\n break;\n case 'maxMode':\n case 'minMode':\n if ($scope.datepickerOptions[key]) {\n $scope.$watch(function() { return $scope.datepickerOptions[key]; }, function(value) {\n self[key] = $scope[key] = angular.isDefined(value) ? value : $scope.datepickerOptions[key];\n if (key === 'minMode' && self.modes.indexOf($scope.datepickerOptions.datepickerMode) < self.modes.indexOf(self[key]) ||\n key === 'maxMode' && self.modes.indexOf($scope.datepickerOptions.datepickerMode) > self.modes.indexOf(self[key])) {\n $scope.datepickerMode = self[key];\n $scope.datepickerOptions.datepickerMode = self[key];\n }\n });\n } else {\n self[key] = $scope[key] = datepickerConfig[key] || null;\n }\n\n break;\n }\n });\n\n $scope.uniqueId = 'datepicker-' + $scope.$id + '-' + Math.floor(Math.random() * 10000);\n\n $scope.disabled = angular.isDefined($attrs.disabled) || false;\n if (angular.isDefined($attrs.ngDisabled)) {\n watchListeners.push($scope.$parent.$watch($attrs.ngDisabled, function(disabled) {\n $scope.disabled = disabled;\n self.refreshView();\n }));\n }\n\n $scope.isActive = function(dateObject) {\n if (self.compare(dateObject.date, self.activeDate) === 0) {\n $scope.activeDateId = dateObject.uid;\n return true;\n }\n return false;\n };\n\n this.init = function(ngModelCtrl_) {\n ngModelCtrl = ngModelCtrl_;\n ngModelOptions = ngModelCtrl_.$options ||\n $scope.datepickerOptions.ngModelOptions ||\n datepickerConfig.ngModelOptions;\n if ($scope.datepickerOptions.initDate) {\n self.activeDate = dateParser.fromTimezone($scope.datepickerOptions.initDate, ngModelOptions.timezone) || new Date();\n $scope.$watch('datepickerOptions.initDate', function(initDate) {\n if (initDate && (ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue) || ngModelCtrl.$invalid)) {\n self.activeDate = dateParser.fromTimezone(initDate, ngModelOptions.timezone);\n self.refreshView();\n }\n });\n } else {\n self.activeDate = new Date();\n }\n\n var date = ngModelCtrl.$modelValue ? new Date(ngModelCtrl.$modelValue) : new Date();\n this.activeDate = !isNaN(date) ?\n dateParser.fromTimezone(date, ngModelOptions.timezone) :\n dateParser.fromTimezone(new Date(), ngModelOptions.timezone);\n\n ngModelCtrl.$render = function() {\n self.render();\n };\n };\n\n this.render = function() {\n if (ngModelCtrl.$viewValue) {\n var date = new Date(ngModelCtrl.$viewValue),\n isValid = !isNaN(date);\n\n if (isValid) {\n this.activeDate = dateParser.fromTimezone(date, ngModelOptions.timezone);\n } else if (!$datepickerSuppressError) {\n $log.error('Datepicker directive: \"ng-model\" value must be a Date object');\n }\n }\n this.refreshView();\n };\n\n this.refreshView = function() {\n if (this.element) {\n $scope.selectedDt = null;\n this._refreshView();\n if ($scope.activeDt) {\n $scope.activeDateId = $scope.activeDt.uid;\n }\n\n var date = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;\n date = dateParser.fromTimezone(date, ngModelOptions.timezone);\n ngModelCtrl.$setValidity('dateDisabled', !date ||\n this.element && !this.isDisabled(date));\n }\n };\n\n this.createDateObject = function(date, format) {\n var model = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;\n model = dateParser.fromTimezone(model, ngModelOptions.timezone);\n var today = new Date();\n today = dateParser.fromTimezone(today, ngModelOptions.timezone);\n var time = this.compare(date, today);\n var dt = {\n date: date,\n label: dateParser.filter(date, format),\n selected: model && this.compare(date, model) === 0,\n disabled: this.isDisabled(date),\n past: time < 0,\n current: time === 0,\n future: time > 0,\n customClass: this.customClass(date) || null\n };\n\n if (model && this.compare(date, model) === 0) {\n $scope.selectedDt = dt;\n }\n\n if (self.activeDate && this.compare(dt.date, self.activeDate) === 0) {\n $scope.activeDt = dt;\n }\n\n return dt;\n };\n\n this.isDisabled = function(date) {\n return $scope.disabled ||\n this.minDate && this.compare(date, this.minDate) < 0 ||\n this.maxDate && this.compare(date, this.maxDate) > 0 ||\n $scope.dateDisabled && $scope.dateDisabled({date: date, mode: $scope.datepickerMode});\n };\n\n this.customClass = function(date) {\n return $scope.customClass({date: date, mode: $scope.datepickerMode});\n };\n\n // Split array into smaller arrays\n this.split = function(arr, size) {\n var arrays = [];\n while (arr.length > 0) {\n arrays.push(arr.splice(0, size));\n }\n return arrays;\n };\n\n $scope.select = function(date) {\n if ($scope.datepickerMode === self.minMode) {\n var dt = ngModelCtrl.$viewValue ? dateParser.fromTimezone(new Date(ngModelCtrl.$viewValue), ngModelOptions.timezone) : new Date(0, 0, 0, 0, 0, 0, 0);\n dt.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n dt = dateParser.toTimezone(dt, ngModelOptions.timezone);\n ngModelCtrl.$setViewValue(dt);\n ngModelCtrl.$render();\n } else {\n self.activeDate = date;\n setMode(self.modes[self.modes.indexOf($scope.datepickerMode) - 1]);\n\n $scope.$emit('uib:datepicker.mode');\n }\n\n $scope.$broadcast('uib:datepicker.focus');\n };\n\n $scope.move = function(direction) {\n var year = self.activeDate.getFullYear() + direction * (self.step.years || 0),\n month = self.activeDate.getMonth() + direction * (self.step.months || 0);\n self.activeDate.setFullYear(year, month, 1);\n self.refreshView();\n };\n\n $scope.toggleMode = function(direction) {\n direction = direction || 1;\n\n if ($scope.datepickerMode === self.maxMode && direction === 1 ||\n $scope.datepickerMode === self.minMode && direction === -1) {\n return;\n }\n\n setMode(self.modes[self.modes.indexOf($scope.datepickerMode) + direction]);\n\n $scope.$emit('uib:datepicker.mode');\n };\n\n // Key event mapper\n $scope.keys = { 13: 'enter', 32: 'space', 33: 'pageup', 34: 'pagedown', 35: 'end', 36: 'home', 37: 'left', 38: 'up', 39: 'right', 40: 'down' };\n\n var focusElement = function() {\n self.element[0].focus();\n };\n\n // Listen for focus requests from popup directive\n $scope.$on('uib:datepicker.focus', focusElement);\n\n $scope.keydown = function(evt) {\n var key = $scope.keys[evt.which];\n\n if (!key || evt.shiftKey || evt.altKey || $scope.disabled) {\n return;\n }\n\n evt.preventDefault();\n if (!self.shortcutPropagation) {\n evt.stopPropagation();\n }\n\n if (key === 'enter' || key === 'space') {\n if (self.isDisabled(self.activeDate)) {\n return; // do nothing\n }\n $scope.select(self.activeDate);\n } else if (evt.ctrlKey && (key === 'up' || key === 'down')) {\n $scope.toggleMode(key === 'up' ? 1 : -1);\n } else {\n self.handleKeyDown(key, evt);\n self.refreshView();\n }\n };\n\n $element.on('keydown', function(evt) {\n $scope.$apply(function() {\n $scope.keydown(evt);\n });\n });\n\n $scope.$on('$destroy', function() {\n //Clear all watch listeners on destroy\n while (watchListeners.length) {\n watchListeners.shift()();\n }\n });\n\n function setMode(mode) {\n $scope.datepickerMode = mode;\n $scope.datepickerOptions.datepickerMode = mode;\n }\n}])\n\n.controller('UibDaypickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {\n var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n this.step = { months: 1 };\n this.element = $element;\n function getDaysInMonth(year, month) {\n return month === 1 && year % 4 === 0 &&\n (year % 100 !== 0 || year % 400 === 0) ? 29 : DAYS_IN_MONTH[month];\n }\n\n this.init = function(ctrl) {\n angular.extend(ctrl, this);\n scope.showWeeks = ctrl.showWeeks;\n ctrl.refreshView();\n };\n\n this.getDates = function(startDate, n) {\n var dates = new Array(n), current = new Date(startDate), i = 0, date;\n while (i < n) {\n date = new Date(current);\n dates[i++] = date;\n current.setDate(current.getDate() + 1);\n }\n return dates;\n };\n\n this._refreshView = function() {\n var year = this.activeDate.getFullYear(),\n month = this.activeDate.getMonth(),\n firstDayOfMonth = new Date(this.activeDate);\n\n firstDayOfMonth.setFullYear(year, month, 1);\n\n var difference = this.startingDay - firstDayOfMonth.getDay(),\n numDisplayedFromPreviousMonth = difference > 0 ?\n 7 - difference : - difference,\n firstDate = new Date(firstDayOfMonth);\n\n if (numDisplayedFromPreviousMonth > 0) {\n firstDate.setDate(-numDisplayedFromPreviousMonth + 1);\n }\n\n // 42 is the number of days on a six-week calendar\n var days = this.getDates(firstDate, 42);\n for (var i = 0; i < 42; i ++) {\n days[i] = angular.extend(this.createDateObject(days[i], this.formatDay), {\n secondary: days[i].getMonth() !== month,\n uid: scope.uniqueId + '-' + i\n });\n }\n\n scope.labels = new Array(7);\n for (var j = 0; j < 7; j++) {\n scope.labels[j] = {\n abbr: dateFilter(days[j].date, this.formatDayHeader),\n full: dateFilter(days[j].date, 'EEEE')\n };\n }\n\n scope.title = dateFilter(this.activeDate, this.formatDayTitle);\n scope.rows = this.split(days, 7);\n\n if (scope.showWeeks) {\n scope.weekNumbers = [];\n var thursdayIndex = (4 + 7 - this.startingDay) % 7,\n numWeeks = scope.rows.length;\n for (var curWeek = 0; curWeek < numWeeks; curWeek++) {\n scope.weekNumbers.push(\n getISO8601WeekNumber(scope.rows[curWeek][thursdayIndex].date));\n }\n }\n };\n\n this.compare = function(date1, date2) {\n var _date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());\n var _date2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());\n _date1.setFullYear(date1.getFullYear());\n _date2.setFullYear(date2.getFullYear());\n return _date1 - _date2;\n };\n\n function getISO8601WeekNumber(date) {\n var checkDate = new Date(date);\n checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); // Thursday\n var time = checkDate.getTime();\n checkDate.setMonth(0); // Compare with Jan 1\n checkDate.setDate(1);\n return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;\n }\n\n this.handleKeyDown = function(key, evt) {\n var date = this.activeDate.getDate();\n\n if (key === 'left') {\n date = date - 1;\n } else if (key === 'up') {\n date = date - 7;\n } else if (key === 'right') {\n date = date + 1;\n } else if (key === 'down') {\n date = date + 7;\n } else if (key === 'pageup' || key === 'pagedown') {\n var month = this.activeDate.getMonth() + (key === 'pageup' ? - 1 : 1);\n this.activeDate.setMonth(month, 1);\n date = Math.min(getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth()), date);\n } else if (key === 'home') {\n date = 1;\n } else if (key === 'end') {\n date = getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth());\n }\n this.activeDate.setDate(date);\n };\n}])\n\n.controller('UibMonthpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {\n this.step = { years: 1 };\n this.element = $element;\n\n this.init = function(ctrl) {\n angular.extend(ctrl, this);\n ctrl.refreshView();\n };\n\n this._refreshView = function() {\n var months = new Array(12),\n year = this.activeDate.getFullYear(),\n date;\n\n for (var i = 0; i < 12; i++) {\n date = new Date(this.activeDate);\n date.setFullYear(year, i, 1);\n months[i] = angular.extend(this.createDateObject(date, this.formatMonth), {\n uid: scope.uniqueId + '-' + i\n });\n }\n\n scope.title = dateFilter(this.activeDate, this.formatMonthTitle);\n scope.rows = this.split(months, this.monthColumns);\n scope.yearHeaderColspan = this.monthColumns > 3 ? this.monthColumns - 2 : 1;\n };\n\n this.compare = function(date1, date2) {\n var _date1 = new Date(date1.getFullYear(), date1.getMonth());\n var _date2 = new Date(date2.getFullYear(), date2.getMonth());\n _date1.setFullYear(date1.getFullYear());\n _date2.setFullYear(date2.getFullYear());\n return _date1 - _date2;\n };\n\n this.handleKeyDown = function(key, evt) {\n var date = this.activeDate.getMonth();\n\n if (key === 'left') {\n date = date - 1;\n } else if (key === 'up') {\n date = date - this.monthColumns;\n } else if (key === 'right') {\n date = date + 1;\n } else if (key === 'down') {\n date = date + this.monthColumns;\n } else if (key === 'pageup' || key === 'pagedown') {\n var year = this.activeDate.getFullYear() + (key === 'pageup' ? - 1 : 1);\n this.activeDate.setFullYear(year);\n } else if (key === 'home') {\n date = 0;\n } else if (key === 'end') {\n date = 11;\n }\n this.activeDate.setMonth(date);\n };\n}])\n\n.controller('UibYearpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {\n var columns, range;\n this.element = $element;\n\n function getStartingYear(year) {\n return parseInt((year - 1) / range, 10) * range + 1;\n }\n\n this.yearpickerInit = function() {\n columns = this.yearColumns;\n range = this.yearRows * columns;\n this.step = { years: range };\n };\n\n this._refreshView = function() {\n var years = new Array(range), date;\n\n for (var i = 0, start = getStartingYear(this.activeDate.getFullYear()); i < range; i++) {\n date = new Date(this.activeDate);\n date.setFullYear(start + i, 0, 1);\n years[i] = angular.extend(this.createDateObject(date, this.formatYear), {\n uid: scope.uniqueId + '-' + i\n });\n }\n\n scope.title = [years[0].label, years[range - 1].label].join(' - ');\n scope.rows = this.split(years, columns);\n scope.columns = columns;\n };\n\n this.compare = function(date1, date2) {\n return date1.getFullYear() - date2.getFullYear();\n };\n\n this.handleKeyDown = function(key, evt) {\n var date = this.activeDate.getFullYear();\n\n if (key === 'left') {\n date = date - 1;\n } else if (key === 'up') {\n date = date - columns;\n } else if (key === 'right') {\n date = date + 1;\n } else if (key === 'down') {\n date = date + columns;\n } else if (key === 'pageup' || key === 'pagedown') {\n date += (key === 'pageup' ? - 1 : 1) * range;\n } else if (key === 'home') {\n date = getStartingYear(this.activeDate.getFullYear());\n } else if (key === 'end') {\n date = getStartingYear(this.activeDate.getFullYear()) + range - 1;\n }\n this.activeDate.setFullYear(date);\n };\n}])\n\n.directive('uibDatepicker', function() {\n return {\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/datepicker/datepicker.html';\n },\n scope: {\n datepickerOptions: '=?'\n },\n require: ['uibDatepicker', '^ngModel'],\n restrict: 'A',\n controller: 'UibDatepickerController',\n controllerAs: 'datepicker',\n link: function(scope, element, attrs, ctrls) {\n var datepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n datepickerCtrl.init(ngModelCtrl);\n }\n };\n})\n\n.directive('uibDaypicker', function() {\n return {\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/datepicker/day.html';\n },\n require: ['^uibDatepicker', 'uibDaypicker'],\n restrict: 'A',\n controller: 'UibDaypickerController',\n link: function(scope, element, attrs, ctrls) {\n var datepickerCtrl = ctrls[0],\n daypickerCtrl = ctrls[1];\n\n daypickerCtrl.init(datepickerCtrl);\n }\n };\n})\n\n.directive('uibMonthpicker', function() {\n return {\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/datepicker/month.html';\n },\n require: ['^uibDatepicker', 'uibMonthpicker'],\n restrict: 'A',\n controller: 'UibMonthpickerController',\n link: function(scope, element, attrs, ctrls) {\n var datepickerCtrl = ctrls[0],\n monthpickerCtrl = ctrls[1];\n\n monthpickerCtrl.init(datepickerCtrl);\n }\n };\n})\n\n.directive('uibYearpicker', function() {\n return {\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/datepicker/year.html';\n },\n require: ['^uibDatepicker', 'uibYearpicker'],\n restrict: 'A',\n controller: 'UibYearpickerController',\n link: function(scope, element, attrs, ctrls) {\n var ctrl = ctrls[0];\n angular.extend(ctrl, ctrls[1]);\n ctrl.yearpickerInit();\n\n ctrl.refreshView();\n }\n };\n});\n\nangular.module('ui.bootstrap.position', [])\n\n/**\n * A set of utility methods for working with the DOM.\n * It is meant to be used where we need to absolute-position elements in\n * relation to another element (this is the case for tooltips, popovers,\n * typeahead suggestions etc.).\n */\n .factory('$uibPosition', ['$document', '$window', function($document, $window) {\n /**\n * Used by scrollbarWidth() function to cache scrollbar's width.\n * Do not access this variable directly, use scrollbarWidth() instead.\n */\n var SCROLLBAR_WIDTH;\n /**\n * scrollbar on body and html element in IE and Edge overlay\n * content and should be considered 0 width.\n */\n var BODY_SCROLLBAR_WIDTH;\n var OVERFLOW_REGEX = {\n normal: /(auto|scroll)/,\n hidden: /(auto|scroll|hidden)/\n };\n var PLACEMENT_REGEX = {\n auto: /\\s?auto?\\s?/i,\n primary: /^(top|bottom|left|right)$/,\n secondary: /^(top|bottom|left|right|center)$/,\n vertical: /^(top|bottom)$/\n };\n var BODY_REGEX = /(HTML|BODY)/;\n\n return {\n\n /**\n * Provides a raw DOM element from a jQuery/jQLite element.\n *\n * @param {element} elem - The element to convert.\n *\n * @returns {element} A HTML element.\n */\n getRawNode: function(elem) {\n return elem.nodeName ? elem : elem[0] || elem;\n },\n\n /**\n * Provides a parsed number for a style property. Strips\n * units and casts invalid numbers to 0.\n *\n * @param {string} value - The style value to parse.\n *\n * @returns {number} A valid number.\n */\n parseStyle: function(value) {\n value = parseFloat(value);\n return isFinite(value) ? value : 0;\n },\n\n /**\n * Provides the closest positioned ancestor.\n *\n * @param {element} element - The element to get the offest parent for.\n *\n * @returns {element} The closest positioned ancestor.\n */\n offsetParent: function(elem) {\n elem = this.getRawNode(elem);\n\n var offsetParent = elem.offsetParent || $document[0].documentElement;\n\n function isStaticPositioned(el) {\n return ($window.getComputedStyle(el).position || 'static') === 'static';\n }\n\n while (offsetParent && offsetParent !== $document[0].documentElement && isStaticPositioned(offsetParent)) {\n offsetParent = offsetParent.offsetParent;\n }\n\n return offsetParent || $document[0].documentElement;\n },\n\n /**\n * Provides the scrollbar width, concept from TWBS measureScrollbar()\n * function in https://github.com/twbs/bootstrap/blob/master/js/modal.js\n * In IE and Edge, scollbar on body and html element overlay and should\n * return a width of 0.\n *\n * @returns {number} The width of the browser scollbar.\n */\n scrollbarWidth: function(isBody) {\n if (isBody) {\n if (angular.isUndefined(BODY_SCROLLBAR_WIDTH)) {\n var bodyElem = $document.find('body');\n bodyElem.addClass('uib-position-body-scrollbar-measure');\n BODY_SCROLLBAR_WIDTH = $window.innerWidth - bodyElem[0].clientWidth;\n BODY_SCROLLBAR_WIDTH = isFinite(BODY_SCROLLBAR_WIDTH) ? BODY_SCROLLBAR_WIDTH : 0;\n bodyElem.removeClass('uib-position-body-scrollbar-measure');\n }\n return BODY_SCROLLBAR_WIDTH;\n }\n\n if (angular.isUndefined(SCROLLBAR_WIDTH)) {\n var scrollElem = angular.element('
    ');\n $document.find('body').append(scrollElem);\n SCROLLBAR_WIDTH = scrollElem[0].offsetWidth - scrollElem[0].clientWidth;\n SCROLLBAR_WIDTH = isFinite(SCROLLBAR_WIDTH) ? SCROLLBAR_WIDTH : 0;\n scrollElem.remove();\n }\n\n return SCROLLBAR_WIDTH;\n },\n\n /**\n * Provides the padding required on an element to replace the scrollbar.\n *\n * @returns {object} An object with the following properties:\n *
      \n *
    • **scrollbarWidth**: the width of the scrollbar
    • \n *
    • **widthOverflow**: whether the the width is overflowing
    • \n *
    • **right**: the amount of right padding on the element needed to replace the scrollbar
    • \n *
    • **rightOriginal**: the amount of right padding currently on the element
    • \n *
    • **heightOverflow**: whether the the height is overflowing
    • \n *
    • **bottom**: the amount of bottom padding on the element needed to replace the scrollbar
    • \n *
    • **bottomOriginal**: the amount of bottom padding currently on the element
    • \n *
    \n */\n scrollbarPadding: function(elem) {\n elem = this.getRawNode(elem);\n\n var elemStyle = $window.getComputedStyle(elem);\n var paddingRight = this.parseStyle(elemStyle.paddingRight);\n var paddingBottom = this.parseStyle(elemStyle.paddingBottom);\n var scrollParent = this.scrollParent(elem, false, true);\n var scrollbarWidth = this.scrollbarWidth(BODY_REGEX.test(scrollParent.tagName));\n\n return {\n scrollbarWidth: scrollbarWidth,\n widthOverflow: scrollParent.scrollWidth > scrollParent.clientWidth,\n right: paddingRight + scrollbarWidth,\n originalRight: paddingRight,\n heightOverflow: scrollParent.scrollHeight > scrollParent.clientHeight,\n bottom: paddingBottom + scrollbarWidth,\n originalBottom: paddingBottom\n };\n },\n\n /**\n * Checks to see if the element is scrollable.\n *\n * @param {element} elem - The element to check.\n * @param {boolean=} [includeHidden=false] - Should scroll style of 'hidden' be considered,\n * default is false.\n *\n * @returns {boolean} Whether the element is scrollable.\n */\n isScrollable: function(elem, includeHidden) {\n elem = this.getRawNode(elem);\n\n var overflowRegex = includeHidden ? OVERFLOW_REGEX.hidden : OVERFLOW_REGEX.normal;\n var elemStyle = $window.getComputedStyle(elem);\n return overflowRegex.test(elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX);\n },\n\n /**\n * Provides the closest scrollable ancestor.\n * A port of the jQuery UI scrollParent method:\n * https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js\n *\n * @param {element} elem - The element to find the scroll parent of.\n * @param {boolean=} [includeHidden=false] - Should scroll style of 'hidden' be considered,\n * default is false.\n * @param {boolean=} [includeSelf=false] - Should the element being passed be\n * included in the scrollable llokup.\n *\n * @returns {element} A HTML element.\n */\n scrollParent: function(elem, includeHidden, includeSelf) {\n elem = this.getRawNode(elem);\n\n var overflowRegex = includeHidden ? OVERFLOW_REGEX.hidden : OVERFLOW_REGEX.normal;\n var documentEl = $document[0].documentElement;\n var elemStyle = $window.getComputedStyle(elem);\n if (includeSelf && overflowRegex.test(elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX)) {\n return elem;\n }\n var excludeStatic = elemStyle.position === 'absolute';\n var scrollParent = elem.parentElement || documentEl;\n\n if (scrollParent === documentEl || elemStyle.position === 'fixed') {\n return documentEl;\n }\n\n while (scrollParent.parentElement && scrollParent !== documentEl) {\n var spStyle = $window.getComputedStyle(scrollParent);\n if (excludeStatic && spStyle.position !== 'static') {\n excludeStatic = false;\n }\n\n if (!excludeStatic && overflowRegex.test(spStyle.overflow + spStyle.overflowY + spStyle.overflowX)) {\n break;\n }\n scrollParent = scrollParent.parentElement;\n }\n\n return scrollParent;\n },\n\n /**\n * Provides read-only equivalent of jQuery's position function:\n * http://api.jquery.com/position/ - distance to closest positioned\n * ancestor. Does not account for margins by default like jQuery position.\n *\n * @param {element} elem - The element to caclulate the position on.\n * @param {boolean=} [includeMargins=false] - Should margins be accounted\n * for, default is false.\n *\n * @returns {object} An object with the following properties:\n *
      \n *
    • **width**: the width of the element
    • \n *
    • **height**: the height of the element
    • \n *
    • **top**: distance to top edge of offset parent
    • \n *
    • **left**: distance to left edge of offset parent
    • \n *
    \n */\n position: function(elem, includeMagins) {\n elem = this.getRawNode(elem);\n\n var elemOffset = this.offset(elem);\n if (includeMagins) {\n var elemStyle = $window.getComputedStyle(elem);\n elemOffset.top -= this.parseStyle(elemStyle.marginTop);\n elemOffset.left -= this.parseStyle(elemStyle.marginLeft);\n }\n var parent = this.offsetParent(elem);\n var parentOffset = {top: 0, left: 0};\n\n if (parent !== $document[0].documentElement) {\n parentOffset = this.offset(parent);\n parentOffset.top += parent.clientTop - parent.scrollTop;\n parentOffset.left += parent.clientLeft - parent.scrollLeft;\n }\n\n return {\n width: Math.round(angular.isNumber(elemOffset.width) ? elemOffset.width : elem.offsetWidth),\n height: Math.round(angular.isNumber(elemOffset.height) ? elemOffset.height : elem.offsetHeight),\n top: Math.round(elemOffset.top - parentOffset.top),\n left: Math.round(elemOffset.left - parentOffset.left)\n };\n },\n\n /**\n * Provides read-only equivalent of jQuery's offset function:\n * http://api.jquery.com/offset/ - distance to viewport. Does\n * not account for borders, margins, or padding on the body\n * element.\n *\n * @param {element} elem - The element to calculate the offset on.\n *\n * @returns {object} An object with the following properties:\n *
      \n *
    • **width**: the width of the element
    • \n *
    • **height**: the height of the element
    • \n *
    • **top**: distance to top edge of viewport
    • \n *
    • **right**: distance to bottom edge of viewport
    • \n *
    \n */\n offset: function(elem) {\n elem = this.getRawNode(elem);\n\n var elemBCR = elem.getBoundingClientRect();\n return {\n width: Math.round(angular.isNumber(elemBCR.width) ? elemBCR.width : elem.offsetWidth),\n height: Math.round(angular.isNumber(elemBCR.height) ? elemBCR.height : elem.offsetHeight),\n top: Math.round(elemBCR.top + ($window.pageYOffset || $document[0].documentElement.scrollTop)),\n left: Math.round(elemBCR.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft))\n };\n },\n\n /**\n * Provides offset distance to the closest scrollable ancestor\n * or viewport. Accounts for border and scrollbar width.\n *\n * Right and bottom dimensions represent the distance to the\n * respective edge of the viewport element. If the element\n * edge extends beyond the viewport, a negative value will be\n * reported.\n *\n * @param {element} elem - The element to get the viewport offset for.\n * @param {boolean=} [useDocument=false] - Should the viewport be the document element instead\n * of the first scrollable element, default is false.\n * @param {boolean=} [includePadding=true] - Should the padding on the offset parent element\n * be accounted for, default is true.\n *\n * @returns {object} An object with the following properties:\n *
      \n *
    • **top**: distance to the top content edge of viewport element
    • \n *
    • **bottom**: distance to the bottom content edge of viewport element
    • \n *
    • **left**: distance to the left content edge of viewport element
    • \n *
    • **right**: distance to the right content edge of viewport element
    • \n *
    \n */\n viewportOffset: function(elem, useDocument, includePadding) {\n elem = this.getRawNode(elem);\n includePadding = includePadding !== false ? true : false;\n\n var elemBCR = elem.getBoundingClientRect();\n var offsetBCR = {top: 0, left: 0, bottom: 0, right: 0};\n\n var offsetParent = useDocument ? $document[0].documentElement : this.scrollParent(elem);\n var offsetParentBCR = offsetParent.getBoundingClientRect();\n\n offsetBCR.top = offsetParentBCR.top + offsetParent.clientTop;\n offsetBCR.left = offsetParentBCR.left + offsetParent.clientLeft;\n if (offsetParent === $document[0].documentElement) {\n offsetBCR.top += $window.pageYOffset;\n offsetBCR.left += $window.pageXOffset;\n }\n offsetBCR.bottom = offsetBCR.top + offsetParent.clientHeight;\n offsetBCR.right = offsetBCR.left + offsetParent.clientWidth;\n\n if (includePadding) {\n var offsetParentStyle = $window.getComputedStyle(offsetParent);\n offsetBCR.top += this.parseStyle(offsetParentStyle.paddingTop);\n offsetBCR.bottom -= this.parseStyle(offsetParentStyle.paddingBottom);\n offsetBCR.left += this.parseStyle(offsetParentStyle.paddingLeft);\n offsetBCR.right -= this.parseStyle(offsetParentStyle.paddingRight);\n }\n\n return {\n top: Math.round(elemBCR.top - offsetBCR.top),\n bottom: Math.round(offsetBCR.bottom - elemBCR.bottom),\n left: Math.round(elemBCR.left - offsetBCR.left),\n right: Math.round(offsetBCR.right - elemBCR.right)\n };\n },\n\n /**\n * Provides an array of placement values parsed from a placement string.\n * Along with the 'auto' indicator, supported placement strings are:\n *
      \n *
    • top: element on top, horizontally centered on host element.
    • \n *
    • top-left: element on top, left edge aligned with host element left edge.
    • \n *
    • top-right: element on top, lerightft edge aligned with host element right edge.
    • \n *
    • bottom: element on bottom, horizontally centered on host element.
    • \n *
    • bottom-left: element on bottom, left edge aligned with host element left edge.
    • \n *
    • bottom-right: element on bottom, right edge aligned with host element right edge.
    • \n *
    • left: element on left, vertically centered on host element.
    • \n *
    • left-top: element on left, top edge aligned with host element top edge.
    • \n *
    • left-bottom: element on left, bottom edge aligned with host element bottom edge.
    • \n *
    • right: element on right, vertically centered on host element.
    • \n *
    • right-top: element on right, top edge aligned with host element top edge.
    • \n *
    • right-bottom: element on right, bottom edge aligned with host element bottom edge.
    • \n *
    \n * A placement string with an 'auto' indicator is expected to be\n * space separated from the placement, i.e: 'auto bottom-left' If\n * the primary and secondary placement values do not match 'top,\n * bottom, left, right' then 'top' will be the primary placement and\n * 'center' will be the secondary placement. If 'auto' is passed, true\n * will be returned as the 3rd value of the array.\n *\n * @param {string} placement - The placement string to parse.\n *\n * @returns {array} An array with the following values\n *
      \n *
    • **[0]**: The primary placement.
    • \n *
    • **[1]**: The secondary placement.
    • \n *
    • **[2]**: If auto is passed: true, else undefined.
    • \n *
    \n */\n parsePlacement: function(placement) {\n var autoPlace = PLACEMENT_REGEX.auto.test(placement);\n if (autoPlace) {\n placement = placement.replace(PLACEMENT_REGEX.auto, '');\n }\n\n placement = placement.split('-');\n\n placement[0] = placement[0] || 'top';\n if (!PLACEMENT_REGEX.primary.test(placement[0])) {\n placement[0] = 'top';\n }\n\n placement[1] = placement[1] || 'center';\n if (!PLACEMENT_REGEX.secondary.test(placement[1])) {\n placement[1] = 'center';\n }\n\n if (autoPlace) {\n placement[2] = true;\n } else {\n placement[2] = false;\n }\n\n return placement;\n },\n\n /**\n * Provides coordinates for an element to be positioned relative to\n * another element. Passing 'auto' as part of the placement parameter\n * will enable smart placement - where the element fits. i.e:\n * 'auto left-top' will check to see if there is enough space to the left\n * of the hostElem to fit the targetElem, if not place right (same for secondary\n * top placement). Available space is calculated using the viewportOffset\n * function.\n *\n * @param {element} hostElem - The element to position against.\n * @param {element} targetElem - The element to position.\n * @param {string=} [placement=top] - The placement for the targetElem,\n * default is 'top'. 'center' is assumed as secondary placement for\n * 'top', 'left', 'right', and 'bottom' placements. Available placements are:\n *
      \n *
    • top
    • \n *
    • top-right
    • \n *
    • top-left
    • \n *
    • bottom
    • \n *
    • bottom-left
    • \n *
    • bottom-right
    • \n *
    • left
    • \n *
    • left-top
    • \n *
    • left-bottom
    • \n *
    • right
    • \n *
    • right-top
    • \n *
    • right-bottom
    • \n *
    \n * @param {boolean=} [appendToBody=false] - Should the top and left values returned\n * be calculated from the body element, default is false.\n *\n * @returns {object} An object with the following properties:\n *
      \n *
    • **top**: Value for targetElem top.
    • \n *
    • **left**: Value for targetElem left.
    • \n *
    • **placement**: The resolved placement.
    • \n *
    \n */\n positionElements: function(hostElem, targetElem, placement, appendToBody) {\n hostElem = this.getRawNode(hostElem);\n targetElem = this.getRawNode(targetElem);\n\n // need to read from prop to support tests.\n var targetWidth = angular.isDefined(targetElem.offsetWidth) ? targetElem.offsetWidth : targetElem.prop('offsetWidth');\n var targetHeight = angular.isDefined(targetElem.offsetHeight) ? targetElem.offsetHeight : targetElem.prop('offsetHeight');\n\n placement = this.parsePlacement(placement);\n\n var hostElemPos = appendToBody ? this.offset(hostElem) : this.position(hostElem);\n var targetElemPos = {top: 0, left: 0, placement: ''};\n\n if (placement[2]) {\n var viewportOffset = this.viewportOffset(hostElem, appendToBody);\n\n var targetElemStyle = $window.getComputedStyle(targetElem);\n var adjustedSize = {\n width: targetWidth + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginLeft) + this.parseStyle(targetElemStyle.marginRight))),\n height: targetHeight + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginTop) + this.parseStyle(targetElemStyle.marginBottom)))\n };\n\n placement[0] = placement[0] === 'top' && adjustedSize.height > viewportOffset.top && adjustedSize.height <= viewportOffset.bottom ? 'bottom' :\n placement[0] === 'bottom' && adjustedSize.height > viewportOffset.bottom && adjustedSize.height <= viewportOffset.top ? 'top' :\n placement[0] === 'left' && adjustedSize.width > viewportOffset.left && adjustedSize.width <= viewportOffset.right ? 'right' :\n placement[0] === 'right' && adjustedSize.width > viewportOffset.right && adjustedSize.width <= viewportOffset.left ? 'left' :\n placement[0];\n\n placement[1] = placement[1] === 'top' && adjustedSize.height - hostElemPos.height > viewportOffset.bottom && adjustedSize.height - hostElemPos.height <= viewportOffset.top ? 'bottom' :\n placement[1] === 'bottom' && adjustedSize.height - hostElemPos.height > viewportOffset.top && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom ? 'top' :\n placement[1] === 'left' && adjustedSize.width - hostElemPos.width > viewportOffset.right && adjustedSize.width - hostElemPos.width <= viewportOffset.left ? 'right' :\n placement[1] === 'right' && adjustedSize.width - hostElemPos.width > viewportOffset.left && adjustedSize.width - hostElemPos.width <= viewportOffset.right ? 'left' :\n placement[1];\n\n if (placement[1] === 'center') {\n if (PLACEMENT_REGEX.vertical.test(placement[0])) {\n var xOverflow = hostElemPos.width / 2 - targetWidth / 2;\n if (viewportOffset.left + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.right) {\n placement[1] = 'left';\n } else if (viewportOffset.right + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.left) {\n placement[1] = 'right';\n }\n } else {\n var yOverflow = hostElemPos.height / 2 - adjustedSize.height / 2;\n if (viewportOffset.top + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom) {\n placement[1] = 'top';\n } else if (viewportOffset.bottom + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.top) {\n placement[1] = 'bottom';\n }\n }\n }\n }\n\n switch (placement[0]) {\n case 'top':\n targetElemPos.top = hostElemPos.top - targetHeight;\n break;\n case 'bottom':\n targetElemPos.top = hostElemPos.top + hostElemPos.height;\n break;\n case 'left':\n targetElemPos.left = hostElemPos.left - targetWidth;\n break;\n case 'right':\n targetElemPos.left = hostElemPos.left + hostElemPos.width;\n break;\n }\n\n switch (placement[1]) {\n case 'top':\n targetElemPos.top = hostElemPos.top;\n break;\n case 'bottom':\n targetElemPos.top = hostElemPos.top + hostElemPos.height - targetHeight;\n break;\n case 'left':\n targetElemPos.left = hostElemPos.left;\n break;\n case 'right':\n targetElemPos.left = hostElemPos.left + hostElemPos.width - targetWidth;\n break;\n case 'center':\n if (PLACEMENT_REGEX.vertical.test(placement[0])) {\n targetElemPos.left = hostElemPos.left + hostElemPos.width / 2 - targetWidth / 2;\n } else {\n targetElemPos.top = hostElemPos.top + hostElemPos.height / 2 - targetHeight / 2;\n }\n break;\n }\n\n targetElemPos.top = Math.round(targetElemPos.top);\n targetElemPos.left = Math.round(targetElemPos.left);\n targetElemPos.placement = placement[1] === 'center' ? placement[0] : placement[0] + '-' + placement[1];\n\n return targetElemPos;\n },\n\n /**\n * Provides a way to adjust the top positioning after first\n * render to correctly align element to top after content\n * rendering causes resized element height\n *\n * @param {array} placementClasses - The array of strings of classes\n * element should have.\n * @param {object} containerPosition - The object with container\n * position information\n * @param {number} initialHeight - The initial height for the elem.\n * @param {number} currentHeight - The current height for the elem.\n */\n adjustTop: function(placementClasses, containerPosition, initialHeight, currentHeight) {\n if (placementClasses.indexOf('top') !== -1 && initialHeight !== currentHeight) {\n return {\n top: containerPosition.top - currentHeight + 'px'\n };\n }\n },\n\n /**\n * Provides a way for positioning tooltip & dropdown\n * arrows when using placement options beyond the standard\n * left, right, top, or bottom.\n *\n * @param {element} elem - The tooltip/dropdown element.\n * @param {string} placement - The placement for the elem.\n */\n positionArrow: function(elem, placement) {\n elem = this.getRawNode(elem);\n\n var innerElem = elem.querySelector('.tooltip-inner, .popover-inner');\n if (!innerElem) {\n return;\n }\n\n var isTooltip = angular.element(innerElem).hasClass('tooltip-inner');\n\n var arrowElem = isTooltip ? elem.querySelector('.tooltip-arrow') : elem.querySelector('.arrow');\n if (!arrowElem) {\n return;\n }\n\n var arrowCss = {\n top: '',\n bottom: '',\n left: '',\n right: ''\n };\n\n placement = this.parsePlacement(placement);\n if (placement[1] === 'center') {\n // no adjustment necessary - just reset styles\n angular.element(arrowElem).css(arrowCss);\n return;\n }\n\n var borderProp = 'border-' + placement[0] + '-width';\n var borderWidth = $window.getComputedStyle(arrowElem)[borderProp];\n\n var borderRadiusProp = 'border-';\n if (PLACEMENT_REGEX.vertical.test(placement[0])) {\n borderRadiusProp += placement[0] + '-' + placement[1];\n } else {\n borderRadiusProp += placement[1] + '-' + placement[0];\n }\n borderRadiusProp += '-radius';\n var borderRadius = $window.getComputedStyle(isTooltip ? innerElem : elem)[borderRadiusProp];\n\n switch (placement[0]) {\n case 'top':\n arrowCss.bottom = isTooltip ? '0' : '-' + borderWidth;\n break;\n case 'bottom':\n arrowCss.top = isTooltip ? '0' : '-' + borderWidth;\n break;\n case 'left':\n arrowCss.right = isTooltip ? '0' : '-' + borderWidth;\n break;\n case 'right':\n arrowCss.left = isTooltip ? '0' : '-' + borderWidth;\n break;\n }\n\n arrowCss[placement[1]] = borderRadius;\n\n angular.element(arrowElem).css(arrowCss);\n }\n };\n }]);\n\nangular.module('ui.bootstrap.datepickerPopup', ['ui.bootstrap.datepicker', 'ui.bootstrap.position'])\n\n.value('$datepickerPopupLiteralWarning', true)\n\n.constant('uibDatepickerPopupConfig', {\n altInputFormats: [],\n appendToBody: false,\n clearText: 'Clear',\n closeOnDateSelection: true,\n closeText: 'Done',\n currentText: 'Today',\n datepickerPopup: 'yyyy-MM-dd',\n datepickerPopupTemplateUrl: 'uib/template/datepickerPopup/popup.html',\n datepickerTemplateUrl: 'uib/template/datepicker/datepicker.html',\n html5Types: {\n date: 'yyyy-MM-dd',\n 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss',\n 'month': 'yyyy-MM'\n },\n onOpenFocus: true,\n showButtonBar: true,\n placement: 'auto bottom-left'\n})\n\n.controller('UibDatepickerPopupController', ['$scope', '$element', '$attrs', '$compile', '$log', '$parse', '$window', '$document', '$rootScope', '$uibPosition', 'dateFilter', 'uibDateParser', 'uibDatepickerPopupConfig', '$timeout', 'uibDatepickerConfig', '$datepickerPopupLiteralWarning',\nfunction($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $rootScope, $position, dateFilter, dateParser, datepickerPopupConfig, $timeout, datepickerConfig, $datepickerPopupLiteralWarning) {\n var cache = {},\n isHtml5DateInput = false;\n var dateFormat, closeOnDateSelection, appendToBody, onOpenFocus,\n datepickerPopupTemplateUrl, datepickerTemplateUrl, popupEl, datepickerEl, scrollParentEl,\n ngModel, ngModelOptions, $popup, altInputFormats, watchListeners = [];\n\n this.init = function(_ngModel_) {\n ngModel = _ngModel_;\n ngModelOptions = angular.isObject(_ngModel_.$options) ?\n _ngModel_.$options :\n {\n timezone: null\n };\n closeOnDateSelection = angular.isDefined($attrs.closeOnDateSelection) ?\n $scope.$parent.$eval($attrs.closeOnDateSelection) :\n datepickerPopupConfig.closeOnDateSelection;\n appendToBody = angular.isDefined($attrs.datepickerAppendToBody) ?\n $scope.$parent.$eval($attrs.datepickerAppendToBody) :\n datepickerPopupConfig.appendToBody;\n onOpenFocus = angular.isDefined($attrs.onOpenFocus) ?\n $scope.$parent.$eval($attrs.onOpenFocus) : datepickerPopupConfig.onOpenFocus;\n datepickerPopupTemplateUrl = angular.isDefined($attrs.datepickerPopupTemplateUrl) ?\n $attrs.datepickerPopupTemplateUrl :\n datepickerPopupConfig.datepickerPopupTemplateUrl;\n datepickerTemplateUrl = angular.isDefined($attrs.datepickerTemplateUrl) ?\n $attrs.datepickerTemplateUrl : datepickerPopupConfig.datepickerTemplateUrl;\n altInputFormats = angular.isDefined($attrs.altInputFormats) ?\n $scope.$parent.$eval($attrs.altInputFormats) :\n datepickerPopupConfig.altInputFormats;\n\n $scope.showButtonBar = angular.isDefined($attrs.showButtonBar) ?\n $scope.$parent.$eval($attrs.showButtonBar) :\n datepickerPopupConfig.showButtonBar;\n\n if (datepickerPopupConfig.html5Types[$attrs.type]) {\n dateFormat = datepickerPopupConfig.html5Types[$attrs.type];\n isHtml5DateInput = true;\n } else {\n dateFormat = $attrs.uibDatepickerPopup || datepickerPopupConfig.datepickerPopup;\n $attrs.$observe('uibDatepickerPopup', function(value, oldValue) {\n var newDateFormat = value || datepickerPopupConfig.datepickerPopup;\n // Invalidate the $modelValue to ensure that formatters re-run\n // FIXME: Refactor when PR is merged: https://github.com/angular/angular.js/pull/10764\n if (newDateFormat !== dateFormat) {\n dateFormat = newDateFormat;\n ngModel.$modelValue = null;\n\n if (!dateFormat) {\n throw new Error('uibDatepickerPopup must have a date format specified.');\n }\n }\n });\n }\n\n if (!dateFormat) {\n throw new Error('uibDatepickerPopup must have a date format specified.');\n }\n\n if (isHtml5DateInput && $attrs.uibDatepickerPopup) {\n throw new Error('HTML5 date input types do not support custom formats.');\n }\n\n // popup element used to display calendar\n popupEl = angular.element('
    ');\n\n popupEl.attr({\n 'ng-model': 'date',\n 'ng-change': 'dateSelection(date)',\n 'template-url': datepickerPopupTemplateUrl\n });\n\n // datepicker element\n datepickerEl = angular.element(popupEl.children()[0]);\n datepickerEl.attr('template-url', datepickerTemplateUrl);\n\n if (!$scope.datepickerOptions) {\n $scope.datepickerOptions = {};\n }\n\n if (isHtml5DateInput) {\n if ($attrs.type === 'month') {\n $scope.datepickerOptions.datepickerMode = 'month';\n $scope.datepickerOptions.minMode = 'month';\n }\n }\n\n datepickerEl.attr('datepicker-options', 'datepickerOptions');\n\n if (!isHtml5DateInput) {\n // Internal API to maintain the correct ng-invalid-[key] class\n ngModel.$$parserName = 'date';\n ngModel.$validators.date = validator;\n ngModel.$parsers.unshift(parseDate);\n ngModel.$formatters.push(function(value) {\n if (ngModel.$isEmpty(value)) {\n $scope.date = value;\n return value;\n }\n\n if (angular.isNumber(value)) {\n value = new Date(value);\n }\n\n $scope.date = dateParser.fromTimezone(value, ngModelOptions.timezone);\n\n return dateParser.filter($scope.date, dateFormat);\n });\n } else {\n ngModel.$formatters.push(function(value) {\n $scope.date = dateParser.fromTimezone(value, ngModelOptions.timezone);\n return value;\n });\n }\n\n // Detect changes in the view from the text box\n ngModel.$viewChangeListeners.push(function() {\n $scope.date = parseDateString(ngModel.$viewValue);\n });\n\n $element.on('keydown', inputKeydownBind);\n\n $popup = $compile(popupEl)($scope);\n // Prevent jQuery cache memory leak (template is now redundant after linking)\n popupEl.remove();\n\n if (appendToBody) {\n $document.find('body').append($popup);\n } else {\n $element.after($popup);\n }\n\n $scope.$on('$destroy', function() {\n if ($scope.isOpen === true) {\n if (!$rootScope.$$phase) {\n $scope.$apply(function() {\n $scope.isOpen = false;\n });\n }\n }\n\n $popup.remove();\n $element.off('keydown', inputKeydownBind);\n $document.off('click', documentClickBind);\n if (scrollParentEl) {\n scrollParentEl.off('scroll', positionPopup);\n }\n angular.element($window).off('resize', positionPopup);\n\n //Clear all watch listeners on destroy\n while (watchListeners.length) {\n watchListeners.shift()();\n }\n });\n };\n\n $scope.getText = function(key) {\n return $scope[key + 'Text'] || datepickerPopupConfig[key + 'Text'];\n };\n\n $scope.isDisabled = function(date) {\n if (date === 'today') {\n date = dateParser.fromTimezone(new Date(), ngModelOptions.timezone);\n }\n\n var dates = {};\n angular.forEach(['minDate', 'maxDate'], function(key) {\n if (!$scope.datepickerOptions[key]) {\n dates[key] = null;\n } else if (angular.isDate($scope.datepickerOptions[key])) {\n dates[key] = new Date($scope.datepickerOptions[key]);\n } else {\n if ($datepickerPopupLiteralWarning) {\n $log.warn('Literal date support has been deprecated, please switch to date object usage');\n }\n\n dates[key] = new Date(dateFilter($scope.datepickerOptions[key], 'medium'));\n }\n });\n\n return $scope.datepickerOptions &&\n dates.minDate && $scope.compare(date, dates.minDate) < 0 ||\n dates.maxDate && $scope.compare(date, dates.maxDate) > 0;\n };\n\n $scope.compare = function(date1, date2) {\n return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());\n };\n\n // Inner change\n $scope.dateSelection = function(dt) {\n $scope.date = dt;\n var date = $scope.date ? dateParser.filter($scope.date, dateFormat) : null; // Setting to NULL is necessary for form validators to function\n $element.val(date);\n ngModel.$setViewValue(date);\n\n if (closeOnDateSelection) {\n $scope.isOpen = false;\n $element[0].focus();\n }\n };\n\n $scope.keydown = function(evt) {\n if (evt.which === 27) {\n evt.stopPropagation();\n $scope.isOpen = false;\n $element[0].focus();\n }\n };\n\n $scope.select = function(date, evt) {\n evt.stopPropagation();\n\n if (date === 'today') {\n var today = new Date();\n if (angular.isDate($scope.date)) {\n date = new Date($scope.date);\n date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate());\n } else {\n date = dateParser.fromTimezone(today, ngModelOptions.timezone);\n date.setHours(0, 0, 0, 0);\n }\n }\n $scope.dateSelection(date);\n };\n\n $scope.close = function(evt) {\n evt.stopPropagation();\n\n $scope.isOpen = false;\n $element[0].focus();\n };\n\n $scope.disabled = angular.isDefined($attrs.disabled) || false;\n if ($attrs.ngDisabled) {\n watchListeners.push($scope.$parent.$watch($parse($attrs.ngDisabled), function(disabled) {\n $scope.disabled = disabled;\n }));\n }\n\n $scope.$watch('isOpen', function(value) {\n if (value) {\n if (!$scope.disabled) {\n $timeout(function() {\n positionPopup();\n\n if (onOpenFocus) {\n $scope.$broadcast('uib:datepicker.focus');\n }\n\n $document.on('click', documentClickBind);\n\n var placement = $attrs.popupPlacement ? $attrs.popupPlacement : datepickerPopupConfig.placement;\n if (appendToBody || $position.parsePlacement(placement)[2]) {\n scrollParentEl = scrollParentEl || angular.element($position.scrollParent($element));\n if (scrollParentEl) {\n scrollParentEl.on('scroll', positionPopup);\n }\n } else {\n scrollParentEl = null;\n }\n\n angular.element($window).on('resize', positionPopup);\n }, 0, false);\n } else {\n $scope.isOpen = false;\n }\n } else {\n $document.off('click', documentClickBind);\n if (scrollParentEl) {\n scrollParentEl.off('scroll', positionPopup);\n }\n angular.element($window).off('resize', positionPopup);\n }\n });\n\n function cameltoDash(string) {\n return string.replace(/([A-Z])/g, function($1) { return '-' + $1.toLowerCase(); });\n }\n\n function parseDateString(viewValue) {\n var date = dateParser.parse(viewValue, dateFormat, $scope.date);\n if (isNaN(date)) {\n for (var i = 0; i < altInputFormats.length; i++) {\n date = dateParser.parse(viewValue, altInputFormats[i], $scope.date);\n if (!isNaN(date)) {\n return date;\n }\n }\n }\n return date;\n }\n\n function parseDate(viewValue) {\n if (angular.isNumber(viewValue)) {\n // presumably timestamp to date object\n viewValue = new Date(viewValue);\n }\n\n if (!viewValue) {\n return null;\n }\n\n if (angular.isDate(viewValue) && !isNaN(viewValue)) {\n return viewValue;\n }\n\n if (angular.isString(viewValue)) {\n var date = parseDateString(viewValue);\n if (!isNaN(date)) {\n return dateParser.fromTimezone(date, ngModelOptions.timezone);\n }\n }\n\n return ngModel.$options && ngModel.$options.allowInvalid ? viewValue : undefined;\n }\n\n function validator(modelValue, viewValue) {\n var value = modelValue || viewValue;\n\n if (!$attrs.ngRequired && !value) {\n return true;\n }\n\n if (angular.isNumber(value)) {\n value = new Date(value);\n }\n\n if (!value) {\n return true;\n }\n\n if (angular.isDate(value) && !isNaN(value)) {\n return true;\n }\n\n if (angular.isString(value)) {\n return !isNaN(parseDateString(value));\n }\n\n return false;\n }\n\n function documentClickBind(event) {\n if (!$scope.isOpen && $scope.disabled) {\n return;\n }\n\n var popup = $popup[0];\n var dpContainsTarget = $element[0].contains(event.target);\n // The popup node may not be an element node\n // In some browsers (IE) only element nodes have the 'contains' function\n var popupContainsTarget = popup.contains !== undefined && popup.contains(event.target);\n if ($scope.isOpen && !(dpContainsTarget || popupContainsTarget)) {\n $scope.$apply(function() {\n $scope.isOpen = false;\n });\n }\n }\n\n function inputKeydownBind(evt) {\n if (evt.which === 27 && $scope.isOpen) {\n evt.preventDefault();\n evt.stopPropagation();\n $scope.$apply(function() {\n $scope.isOpen = false;\n });\n $element[0].focus();\n } else if (evt.which === 40 && !$scope.isOpen) {\n evt.preventDefault();\n evt.stopPropagation();\n $scope.$apply(function() {\n $scope.isOpen = true;\n });\n }\n }\n\n function positionPopup() {\n if ($scope.isOpen) {\n var dpElement = angular.element($popup[0].querySelector('.uib-datepicker-popup'));\n var placement = $attrs.popupPlacement ? $attrs.popupPlacement : datepickerPopupConfig.placement;\n var position = $position.positionElements($element, dpElement, placement, appendToBody);\n dpElement.css({top: position.top + 'px', left: position.left + 'px'});\n if (dpElement.hasClass('uib-position-measure')) {\n dpElement.removeClass('uib-position-measure');\n }\n }\n }\n\n $scope.$on('uib:datepicker.mode', function() {\n $timeout(positionPopup, 0, false);\n });\n}])\n\n.directive('uibDatepickerPopup', function() {\n return {\n require: ['ngModel', 'uibDatepickerPopup'],\n controller: 'UibDatepickerPopupController',\n scope: {\n datepickerOptions: '=?',\n isOpen: '=?',\n currentText: '@',\n clearText: '@',\n closeText: '@'\n },\n link: function(scope, element, attrs, ctrls) {\n var ngModel = ctrls[0],\n ctrl = ctrls[1];\n\n ctrl.init(ngModel);\n }\n };\n})\n\n.directive('uibDatepickerPopupWrap', function() {\n return {\n restrict: 'A',\n transclude: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/datepickerPopup/popup.html';\n }\n };\n});\n\nangular.module('ui.bootstrap.debounce', [])\n/**\n * A helper, internal service that debounces a function\n */\n .factory('$$debounce', ['$timeout', function($timeout) {\n return function(callback, debounceTime) {\n var timeoutPromise;\n\n return function() {\n var self = this;\n var args = Array.prototype.slice.call(arguments);\n if (timeoutPromise) {\n $timeout.cancel(timeoutPromise);\n }\n\n timeoutPromise = $timeout(function() {\n callback.apply(self, args);\n }, debounceTime);\n };\n };\n }]);\n\nangular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])\n\n.constant('uibDropdownConfig', {\n appendToOpenClass: 'uib-dropdown-open',\n openClass: 'open'\n})\n\n.service('uibDropdownService', ['$document', '$rootScope', function($document, $rootScope) {\n var openScope = null;\n\n this.open = function(dropdownScope, element) {\n if (!openScope) {\n $document.on('click', closeDropdown);\n }\n\n if (openScope && openScope !== dropdownScope) {\n openScope.isOpen = false;\n }\n\n openScope = dropdownScope;\n };\n\n this.close = function(dropdownScope, element) {\n if (openScope === dropdownScope) {\n $document.off('click', closeDropdown);\n $document.off('keydown', this.keybindFilter);\n openScope = null;\n }\n };\n\n var closeDropdown = function(evt) {\n // This method may still be called during the same mouse event that\n // unbound this event handler. So check openScope before proceeding.\n if (!openScope) { return; }\n\n if (evt && openScope.getAutoClose() === 'disabled') { return; }\n\n if (evt && evt.which === 3) { return; }\n\n var toggleElement = openScope.getToggleElement();\n if (evt && toggleElement && toggleElement[0].contains(evt.target)) {\n return;\n }\n\n var dropdownElement = openScope.getDropdownElement();\n if (evt && openScope.getAutoClose() === 'outsideClick' &&\n dropdownElement && dropdownElement[0].contains(evt.target)) {\n return;\n }\n\n openScope.focusToggleElement();\n openScope.isOpen = false;\n\n if (!$rootScope.$$phase) {\n openScope.$apply();\n }\n };\n\n this.keybindFilter = function(evt) {\n if (!openScope) {\n // see this.close as ESC could have been pressed which kills the scope so we can not proceed\n return;\n }\n\n var dropdownElement = openScope.getDropdownElement();\n var toggleElement = openScope.getToggleElement();\n var dropdownElementTargeted = dropdownElement && dropdownElement[0].contains(evt.target);\n var toggleElementTargeted = toggleElement && toggleElement[0].contains(evt.target);\n if (evt.which === 27) {\n evt.stopPropagation();\n openScope.focusToggleElement();\n closeDropdown();\n } else if (openScope.isKeynavEnabled() && [38, 40].indexOf(evt.which) !== -1 && openScope.isOpen && (dropdownElementTargeted || toggleElementTargeted)) {\n evt.preventDefault();\n evt.stopPropagation();\n openScope.focusDropdownEntry(evt.which);\n }\n };\n}])\n\n.controller('UibDropdownController', ['$scope', '$element', '$attrs', '$parse', 'uibDropdownConfig', 'uibDropdownService', '$animate', '$uibPosition', '$document', '$compile', '$templateRequest', function($scope, $element, $attrs, $parse, dropdownConfig, uibDropdownService, $animate, $position, $document, $compile, $templateRequest) {\n var self = this,\n scope = $scope.$new(), // create a child scope so we are not polluting original one\n templateScope,\n appendToOpenClass = dropdownConfig.appendToOpenClass,\n openClass = dropdownConfig.openClass,\n getIsOpen,\n setIsOpen = angular.noop,\n toggleInvoker = $attrs.onToggle ? $parse($attrs.onToggle) : angular.noop,\n appendToBody = false,\n appendTo = null,\n keynavEnabled = false,\n selectedOption = null,\n body = $document.find('body');\n\n $element.addClass('dropdown');\n\n this.init = function() {\n if ($attrs.isOpen) {\n getIsOpen = $parse($attrs.isOpen);\n setIsOpen = getIsOpen.assign;\n\n $scope.$watch(getIsOpen, function(value) {\n scope.isOpen = !!value;\n });\n }\n\n if (angular.isDefined($attrs.dropdownAppendTo)) {\n var appendToEl = $parse($attrs.dropdownAppendTo)(scope);\n if (appendToEl) {\n appendTo = angular.element(appendToEl);\n }\n }\n\n appendToBody = angular.isDefined($attrs.dropdownAppendToBody);\n keynavEnabled = angular.isDefined($attrs.keyboardNav);\n\n if (appendToBody && !appendTo) {\n appendTo = body;\n }\n\n if (appendTo && self.dropdownMenu) {\n appendTo.append(self.dropdownMenu);\n $element.on('$destroy', function handleDestroyEvent() {\n self.dropdownMenu.remove();\n });\n }\n };\n\n this.toggle = function(open) {\n scope.isOpen = arguments.length ? !!open : !scope.isOpen;\n if (angular.isFunction(setIsOpen)) {\n setIsOpen(scope, scope.isOpen);\n }\n\n return scope.isOpen;\n };\n\n // Allow other directives to watch status\n this.isOpen = function() {\n return scope.isOpen;\n };\n\n scope.getToggleElement = function() {\n return self.toggleElement;\n };\n\n scope.getAutoClose = function() {\n return $attrs.autoClose || 'always'; //or 'outsideClick' or 'disabled'\n };\n\n scope.getElement = function() {\n return $element;\n };\n\n scope.isKeynavEnabled = function() {\n return keynavEnabled;\n };\n\n scope.focusDropdownEntry = function(keyCode) {\n var elems = self.dropdownMenu ? //If append to body is used.\n angular.element(self.dropdownMenu).find('a') :\n $element.find('ul').eq(0).find('a');\n\n switch (keyCode) {\n case 40: {\n if (!angular.isNumber(self.selectedOption)) {\n self.selectedOption = 0;\n } else {\n self.selectedOption = self.selectedOption === elems.length - 1 ?\n self.selectedOption :\n self.selectedOption + 1;\n }\n break;\n }\n case 38: {\n if (!angular.isNumber(self.selectedOption)) {\n self.selectedOption = elems.length - 1;\n } else {\n self.selectedOption = self.selectedOption === 0 ?\n 0 : self.selectedOption - 1;\n }\n break;\n }\n }\n elems[self.selectedOption].focus();\n };\n\n scope.getDropdownElement = function() {\n return self.dropdownMenu;\n };\n\n scope.focusToggleElement = function() {\n if (self.toggleElement) {\n self.toggleElement[0].focus();\n }\n };\n\n scope.$watch('isOpen', function(isOpen, wasOpen) {\n if (appendTo && self.dropdownMenu) {\n var pos = $position.positionElements($element, self.dropdownMenu, 'bottom-left', true),\n css,\n rightalign,\n scrollbarPadding,\n scrollbarWidth = 0;\n\n css = {\n top: pos.top + 'px',\n display: isOpen ? 'block' : 'none'\n };\n\n rightalign = self.dropdownMenu.hasClass('dropdown-menu-right');\n if (!rightalign) {\n css.left = pos.left + 'px';\n css.right = 'auto';\n } else {\n css.left = 'auto';\n scrollbarPadding = $position.scrollbarPadding(appendTo);\n\n if (scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) {\n scrollbarWidth = scrollbarPadding.scrollbarWidth;\n }\n\n css.right = window.innerWidth - scrollbarWidth -\n (pos.left + $element.prop('offsetWidth')) + 'px';\n }\n\n // Need to adjust our positioning to be relative to the appendTo container\n // if it's not the body element\n if (!appendToBody) {\n var appendOffset = $position.offset(appendTo);\n\n css.top = pos.top - appendOffset.top + 'px';\n\n if (!rightalign) {\n css.left = pos.left - appendOffset.left + 'px';\n } else {\n css.right = window.innerWidth -\n (pos.left - appendOffset.left + $element.prop('offsetWidth')) + 'px';\n }\n }\n\n self.dropdownMenu.css(css);\n }\n\n var openContainer = appendTo ? appendTo : $element;\n var hasOpenClass = openContainer.hasClass(appendTo ? appendToOpenClass : openClass);\n\n if (hasOpenClass === !isOpen) {\n $animate[isOpen ? 'addClass' : 'removeClass'](openContainer, appendTo ? appendToOpenClass : openClass).then(function() {\n if (angular.isDefined(isOpen) && isOpen !== wasOpen) {\n toggleInvoker($scope, { open: !!isOpen });\n }\n });\n }\n\n if (isOpen) {\n if (self.dropdownMenuTemplateUrl) {\n $templateRequest(self.dropdownMenuTemplateUrl).then(function(tplContent) {\n templateScope = scope.$new();\n $compile(tplContent.trim())(templateScope, function(dropdownElement) {\n var newEl = dropdownElement;\n self.dropdownMenu.replaceWith(newEl);\n self.dropdownMenu = newEl;\n $document.on('keydown', uibDropdownService.keybindFilter);\n });\n });\n } else {\n $document.on('keydown', uibDropdownService.keybindFilter);\n }\n\n scope.focusToggleElement();\n uibDropdownService.open(scope, $element);\n } else {\n uibDropdownService.close(scope, $element);\n if (self.dropdownMenuTemplateUrl) {\n if (templateScope) {\n templateScope.$destroy();\n }\n var newEl = angular.element('
      ');\n self.dropdownMenu.replaceWith(newEl);\n self.dropdownMenu = newEl;\n }\n\n self.selectedOption = null;\n }\n\n if (angular.isFunction(setIsOpen)) {\n setIsOpen($scope, isOpen);\n }\n });\n}])\n\n.directive('uibDropdown', function() {\n return {\n controller: 'UibDropdownController',\n link: function(scope, element, attrs, dropdownCtrl) {\n dropdownCtrl.init();\n }\n };\n})\n\n.directive('uibDropdownMenu', function() {\n return {\n restrict: 'A',\n require: '?^uibDropdown',\n link: function(scope, element, attrs, dropdownCtrl) {\n if (!dropdownCtrl || angular.isDefined(attrs.dropdownNested)) {\n return;\n }\n\n element.addClass('dropdown-menu');\n\n var tplUrl = attrs.templateUrl;\n if (tplUrl) {\n dropdownCtrl.dropdownMenuTemplateUrl = tplUrl;\n }\n\n if (!dropdownCtrl.dropdownMenu) {\n dropdownCtrl.dropdownMenu = element;\n }\n }\n };\n})\n\n.directive('uibDropdownToggle', function() {\n return {\n require: '?^uibDropdown',\n link: function(scope, element, attrs, dropdownCtrl) {\n if (!dropdownCtrl) {\n return;\n }\n\n element.addClass('dropdown-toggle');\n\n dropdownCtrl.toggleElement = element;\n\n var toggleDropdown = function(event) {\n event.preventDefault();\n\n if (!element.hasClass('disabled') && !attrs.disabled) {\n scope.$apply(function() {\n dropdownCtrl.toggle();\n });\n }\n };\n\n element.bind('click', toggleDropdown);\n\n // WAI-ARIA\n element.attr({ 'aria-haspopup': true, 'aria-expanded': false });\n scope.$watch(dropdownCtrl.isOpen, function(isOpen) {\n element.attr('aria-expanded', !!isOpen);\n });\n\n scope.$on('$destroy', function() {\n element.unbind('click', toggleDropdown);\n });\n }\n };\n});\n\nangular.module('ui.bootstrap.stackedMap', [])\n/**\n * A helper, internal data structure that acts as a map but also allows getting / removing\n * elements in the LIFO order\n */\n .factory('$$stackedMap', function() {\n return {\n createNew: function() {\n var stack = [];\n\n return {\n add: function(key, value) {\n stack.push({\n key: key,\n value: value\n });\n },\n get: function(key) {\n for (var i = 0; i < stack.length; i++) {\n if (key === stack[i].key) {\n return stack[i];\n }\n }\n },\n keys: function() {\n var keys = [];\n for (var i = 0; i < stack.length; i++) {\n keys.push(stack[i].key);\n }\n return keys;\n },\n top: function() {\n return stack[stack.length - 1];\n },\n remove: function(key) {\n var idx = -1;\n for (var i = 0; i < stack.length; i++) {\n if (key === stack[i].key) {\n idx = i;\n break;\n }\n }\n return stack.splice(idx, 1)[0];\n },\n removeTop: function() {\n return stack.pop();\n },\n length: function() {\n return stack.length;\n }\n };\n }\n };\n });\nangular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap', 'ui.bootstrap.position'])\n/**\n * A helper, internal data structure that stores all references attached to key\n */\n .factory('$$multiMap', function() {\n return {\n createNew: function() {\n var map = {};\n\n return {\n entries: function() {\n return Object.keys(map).map(function(key) {\n return {\n key: key,\n value: map[key]\n };\n });\n },\n get: function(key) {\n return map[key];\n },\n hasKey: function(key) {\n return !!map[key];\n },\n keys: function() {\n return Object.keys(map);\n },\n put: function(key, value) {\n if (!map[key]) {\n map[key] = [];\n }\n\n map[key].push(value);\n },\n remove: function(key, value) {\n var values = map[key];\n\n if (!values) {\n return;\n }\n\n var idx = values.indexOf(value);\n\n if (idx !== -1) {\n values.splice(idx, 1);\n }\n\n if (!values.length) {\n delete map[key];\n }\n }\n };\n }\n };\n })\n\n/**\n * Pluggable resolve mechanism for the modal resolve resolution\n * Supports UI Router's $resolve service\n */\n .provider('$uibResolve', function() {\n var resolve = this;\n this.resolver = null;\n\n this.setResolver = function(resolver) {\n this.resolver = resolver;\n };\n\n this.$get = ['$injector', '$q', function($injector, $q) {\n var resolver = resolve.resolver ? $injector.get(resolve.resolver) : null;\n return {\n resolve: function(invocables, locals, parent, self) {\n if (resolver) {\n return resolver.resolve(invocables, locals, parent, self);\n }\n\n var promises = [];\n\n angular.forEach(invocables, function(value) {\n if (angular.isFunction(value) || angular.isArray(value)) {\n promises.push($q.resolve($injector.invoke(value)));\n } else if (angular.isString(value)) {\n promises.push($q.resolve($injector.get(value)));\n } else {\n promises.push($q.resolve(value));\n }\n });\n\n return $q.all(promises).then(function(resolves) {\n var resolveObj = {};\n var resolveIter = 0;\n angular.forEach(invocables, function(value, key) {\n resolveObj[key] = resolves[resolveIter++];\n });\n\n return resolveObj;\n });\n }\n };\n }];\n })\n\n/**\n * A helper directive for the $modal service. It creates a backdrop element.\n */\n .directive('uibModalBackdrop', ['$animate', '$injector', '$uibModalStack',\n function($animate, $injector, $modalStack) {\n return {\n restrict: 'A',\n compile: function(tElement, tAttrs) {\n tElement.addClass(tAttrs.backdropClass);\n return linkFn;\n }\n };\n\n function linkFn(scope, element, attrs) {\n if (attrs.modalInClass) {\n $animate.addClass(element, attrs.modalInClass);\n\n scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {\n var done = setIsAsync();\n if (scope.modalOptions.animation) {\n $animate.removeClass(element, attrs.modalInClass).then(done);\n } else {\n done();\n }\n });\n }\n }\n }])\n\n .directive('uibModalWindow', ['$uibModalStack', '$q', '$animateCss', '$document',\n function($modalStack, $q, $animateCss, $document) {\n return {\n scope: {\n index: '@'\n },\n restrict: 'A',\n transclude: true,\n templateUrl: function(tElement, tAttrs) {\n return tAttrs.templateUrl || 'uib/template/modal/window.html';\n },\n link: function(scope, element, attrs) {\n element.addClass(attrs.windowTopClass || '');\n scope.size = attrs.size;\n\n scope.close = function(evt) {\n var modal = $modalStack.getTop();\n if (modal && modal.value.backdrop &&\n modal.value.backdrop !== 'static' &&\n evt.target === evt.currentTarget) {\n evt.preventDefault();\n evt.stopPropagation();\n $modalStack.dismiss(modal.key, 'backdrop click');\n }\n };\n\n // moved from template to fix issue #2280\n element.on('click', scope.close);\n\n // This property is only added to the scope for the purpose of detecting when this directive is rendered.\n // We can detect that by using this property in the template associated with this directive and then use\n // {@link Attribute#$observe} on it. For more details please see {@link TableColumnResize}.\n scope.$isRendered = true;\n\n // Deferred object that will be resolved when this modal is rendered.\n var modalRenderDeferObj = $q.defer();\n // Resolve render promise post-digest\n scope.$$postDigest(function() {\n modalRenderDeferObj.resolve();\n });\n\n modalRenderDeferObj.promise.then(function() {\n var animationPromise = null;\n\n if (attrs.modalInClass) {\n animationPromise = $animateCss(element, {\n addClass: attrs.modalInClass\n }).start();\n\n scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {\n var done = setIsAsync();\n $animateCss(element, {\n removeClass: attrs.modalInClass\n }).start().then(done);\n });\n }\n\n\n $q.when(animationPromise).then(function() {\n // Notify {@link $modalStack} that modal is rendered.\n var modal = $modalStack.getTop();\n if (modal) {\n $modalStack.modalRendered(modal.key);\n }\n\n /**\n * If something within the freshly-opened modal already has focus (perhaps via a\n * directive that causes focus) then there's no need to try to focus anything.\n */\n if (!($document[0].activeElement && element[0].contains($document[0].activeElement))) {\n var inputWithAutofocus = element[0].querySelector('[autofocus]');\n /**\n * Auto-focusing of a freshly-opened modal element causes any child elements\n * with the autofocus attribute to lose focus. This is an issue on touch\n * based devices which will show and then hide the onscreen keyboard.\n * Attempts to refocus the autofocus element via JavaScript will not reopen\n * the onscreen keyboard. Fixed by updated the focusing logic to only autofocus\n * the modal element if the modal does not contain an autofocus element.\n */\n if (inputWithAutofocus) {\n inputWithAutofocus.focus();\n } else {\n element[0].focus();\n }\n }\n });\n });\n }\n };\n }])\n\n .directive('uibModalAnimationClass', function() {\n return {\n compile: function(tElement, tAttrs) {\n if (tAttrs.modalAnimation) {\n tElement.addClass(tAttrs.uibModalAnimationClass);\n }\n }\n };\n })\n\n .directive('uibModalTransclude', ['$animate', function($animate) {\n return {\n link: function(scope, element, attrs, controller, transclude) {\n transclude(scope.$parent, function(clone) {\n element.empty();\n $animate.enter(clone, element);\n });\n }\n };\n }])\n\n .factory('$uibModalStack', ['$animate', '$animateCss', '$document',\n '$compile', '$rootScope', '$q', '$$multiMap', '$$stackedMap', '$uibPosition',\n function($animate, $animateCss, $document, $compile, $rootScope, $q, $$multiMap, $$stackedMap, $uibPosition) {\n var OPENED_MODAL_CLASS = 'modal-open';\n\n var backdropDomEl, backdropScope;\n var openedWindows = $$stackedMap.createNew();\n var openedClasses = $$multiMap.createNew();\n var $modalStack = {\n NOW_CLOSING_EVENT: 'modal.stack.now-closing'\n };\n var topModalIndex = 0;\n var previousTopOpenedModal = null;\n var ARIA_HIDDEN_ATTRIBUTE_NAME = 'data-bootstrap-modal-aria-hidden-count';\n\n //Modal focus behavior\n var tabbableSelector = 'a[href], area[href], input:not([disabled]):not([tabindex=\\'-1\\']), ' +\n 'button:not([disabled]):not([tabindex=\\'-1\\']),select:not([disabled]):not([tabindex=\\'-1\\']), textarea:not([disabled]):not([tabindex=\\'-1\\']), ' +\n 'iframe, object, embed, *[tabindex]:not([tabindex=\\'-1\\']), *[contenteditable=true]';\n var scrollbarPadding;\n var SNAKE_CASE_REGEXP = /[A-Z]/g;\n\n // TODO: extract into common dependency with tooltip\n function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }\n\n function isVisible(element) {\n return !!(element.offsetWidth ||\n element.offsetHeight ||\n element.getClientRects().length);\n }\n\n function backdropIndex() {\n var topBackdropIndex = -1;\n var opened = openedWindows.keys();\n for (var i = 0; i < opened.length; i++) {\n if (openedWindows.get(opened[i]).value.backdrop) {\n topBackdropIndex = i;\n }\n }\n\n // If any backdrop exist, ensure that it's index is always\n // right below the top modal\n if (topBackdropIndex > -1 && topBackdropIndex < topModalIndex) {\n topBackdropIndex = topModalIndex;\n }\n return topBackdropIndex;\n }\n\n $rootScope.$watch(backdropIndex, function(newBackdropIndex) {\n if (backdropScope) {\n backdropScope.index = newBackdropIndex;\n }\n });\n\n function removeModalWindow(modalInstance, elementToReceiveFocus) {\n var modalWindow = openedWindows.get(modalInstance).value;\n var appendToElement = modalWindow.appendTo;\n\n //clean up the stack\n openedWindows.remove(modalInstance);\n previousTopOpenedModal = openedWindows.top();\n if (previousTopOpenedModal) {\n topModalIndex = parseInt(previousTopOpenedModal.value.modalDomEl.attr('index'), 10);\n }\n\n removeAfterAnimate(modalWindow.modalDomEl, modalWindow.modalScope, function() {\n var modalBodyClass = modalWindow.openedClass || OPENED_MODAL_CLASS;\n openedClasses.remove(modalBodyClass, modalInstance);\n var areAnyOpen = openedClasses.hasKey(modalBodyClass);\n appendToElement.toggleClass(modalBodyClass, areAnyOpen);\n if (!areAnyOpen && scrollbarPadding && scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) {\n if (scrollbarPadding.originalRight) {\n appendToElement.css({paddingRight: scrollbarPadding.originalRight + 'px'});\n } else {\n appendToElement.css({paddingRight: ''});\n }\n scrollbarPadding = null;\n }\n toggleTopWindowClass(true);\n }, modalWindow.closedDeferred);\n checkRemoveBackdrop();\n\n //move focus to specified element if available, or else to body\n if (elementToReceiveFocus && elementToReceiveFocus.focus) {\n elementToReceiveFocus.focus();\n } else if (appendToElement.focus) {\n appendToElement.focus();\n }\n }\n\n // Add or remove \"windowTopClass\" from the top window in the stack\n function toggleTopWindowClass(toggleSwitch) {\n var modalWindow;\n\n if (openedWindows.length() > 0) {\n modalWindow = openedWindows.top().value;\n modalWindow.modalDomEl.toggleClass(modalWindow.windowTopClass || '', toggleSwitch);\n }\n }\n\n function checkRemoveBackdrop() {\n //remove backdrop if no longer needed\n if (backdropDomEl && backdropIndex() === -1) {\n var backdropScopeRef = backdropScope;\n removeAfterAnimate(backdropDomEl, backdropScope, function() {\n backdropScopeRef = null;\n });\n backdropDomEl = undefined;\n backdropScope = undefined;\n }\n }\n\n function removeAfterAnimate(domEl, scope, done, closedDeferred) {\n var asyncDeferred;\n var asyncPromise = null;\n var setIsAsync = function() {\n if (!asyncDeferred) {\n asyncDeferred = $q.defer();\n asyncPromise = asyncDeferred.promise;\n }\n\n return function asyncDone() {\n asyncDeferred.resolve();\n };\n };\n scope.$broadcast($modalStack.NOW_CLOSING_EVENT, setIsAsync);\n\n // Note that it's intentional that asyncPromise might be null.\n // That's when setIsAsync has not been called during the\n // NOW_CLOSING_EVENT broadcast.\n return $q.when(asyncPromise).then(afterAnimating);\n\n function afterAnimating() {\n if (afterAnimating.done) {\n return;\n }\n afterAnimating.done = true;\n\n $animate.leave(domEl).then(function() {\n if (done) {\n done();\n }\n\n domEl.remove();\n if (closedDeferred) {\n closedDeferred.resolve();\n }\n });\n\n scope.$destroy();\n }\n }\n\n $document.on('keydown', keydownListener);\n\n $rootScope.$on('$destroy', function() {\n $document.off('keydown', keydownListener);\n });\n\n function keydownListener(evt) {\n if (evt.isDefaultPrevented()) {\n return evt;\n }\n\n var modal = openedWindows.top();\n if (modal) {\n switch (evt.which) {\n case 27: {\n if (modal.value.keyboard) {\n evt.preventDefault();\n $rootScope.$apply(function() {\n $modalStack.dismiss(modal.key, 'escape key press');\n });\n }\n break;\n }\n case 9: {\n var list = $modalStack.loadFocusElementList(modal);\n var focusChanged = false;\n if (evt.shiftKey) {\n if ($modalStack.isFocusInFirstItem(evt, list) || $modalStack.isModalFocused(evt, modal)) {\n focusChanged = $modalStack.focusLastFocusableElement(list);\n }\n } else {\n if ($modalStack.isFocusInLastItem(evt, list)) {\n focusChanged = $modalStack.focusFirstFocusableElement(list);\n }\n }\n\n if (focusChanged) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n break;\n }\n }\n }\n }\n\n $modalStack.open = function(modalInstance, modal) {\n var modalOpener = $document[0].activeElement,\n modalBodyClass = modal.openedClass || OPENED_MODAL_CLASS;\n\n toggleTopWindowClass(false);\n\n // Store the current top first, to determine what index we ought to use\n // for the current top modal\n previousTopOpenedModal = openedWindows.top();\n\n openedWindows.add(modalInstance, {\n deferred: modal.deferred,\n renderDeferred: modal.renderDeferred,\n closedDeferred: modal.closedDeferred,\n modalScope: modal.scope,\n backdrop: modal.backdrop,\n keyboard: modal.keyboard,\n openedClass: modal.openedClass,\n windowTopClass: modal.windowTopClass,\n animation: modal.animation,\n appendTo: modal.appendTo\n });\n\n openedClasses.put(modalBodyClass, modalInstance);\n\n var appendToElement = modal.appendTo,\n currBackdropIndex = backdropIndex();\n\n if (!appendToElement.length) {\n throw new Error('appendTo element not found. Make sure that the element passed is in DOM.');\n }\n\n if (currBackdropIndex >= 0 && !backdropDomEl) {\n backdropScope = $rootScope.$new(true);\n backdropScope.modalOptions = modal;\n backdropScope.index = currBackdropIndex;\n backdropDomEl = angular.element('
      ');\n backdropDomEl.attr({\n 'class': 'modal-backdrop',\n 'ng-style': '{\\'z-index\\': 1040 + (index && 1 || 0) + index*10}',\n 'uib-modal-animation-class': 'fade',\n 'modal-in-class': 'in'\n });\n if (modal.backdropClass) {\n backdropDomEl.addClass(modal.backdropClass);\n }\n\n if (modal.animation) {\n backdropDomEl.attr('modal-animation', 'true');\n }\n $compile(backdropDomEl)(backdropScope);\n $animate.enter(backdropDomEl, appendToElement);\n if ($uibPosition.isScrollable(appendToElement)) {\n scrollbarPadding = $uibPosition.scrollbarPadding(appendToElement);\n if (scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) {\n appendToElement.css({paddingRight: scrollbarPadding.right + 'px'});\n }\n }\n }\n\n var content;\n if (modal.component) {\n content = document.createElement(snake_case(modal.component.name));\n content = angular.element(content);\n content.attr({\n resolve: '$resolve',\n 'modal-instance': '$uibModalInstance',\n close: '$close($value)',\n dismiss: '$dismiss($value)'\n });\n } else {\n content = modal.content;\n }\n\n // Set the top modal index based on the index of the previous top modal\n topModalIndex = previousTopOpenedModal ? parseInt(previousTopOpenedModal.value.modalDomEl.attr('index'), 10) + 1 : 0;\n var angularDomEl = angular.element('
      ');\n angularDomEl.attr({\n 'class': 'modal',\n 'template-url': modal.windowTemplateUrl,\n 'window-top-class': modal.windowTopClass,\n 'role': 'dialog',\n 'aria-labelledby': modal.ariaLabelledBy,\n 'aria-describedby': modal.ariaDescribedBy,\n 'size': modal.size,\n 'index': topModalIndex,\n 'animate': 'animate',\n 'ng-style': '{\\'z-index\\': 1050 + $$topModalIndex*10, display: \\'block\\'}',\n 'tabindex': -1,\n 'uib-modal-animation-class': 'fade',\n 'modal-in-class': 'in'\n }).append(content);\n if (modal.windowClass) {\n angularDomEl.addClass(modal.windowClass);\n }\n\n if (modal.animation) {\n angularDomEl.attr('modal-animation', 'true');\n }\n\n appendToElement.addClass(modalBodyClass);\n if (modal.scope) {\n // we need to explicitly add the modal index to the modal scope\n // because it is needed by ngStyle to compute the zIndex property.\n modal.scope.$$topModalIndex = topModalIndex;\n }\n $animate.enter($compile(angularDomEl)(modal.scope), appendToElement);\n\n openedWindows.top().value.modalDomEl = angularDomEl;\n openedWindows.top().value.modalOpener = modalOpener;\n\n applyAriaHidden(angularDomEl);\n\n function applyAriaHidden(el) {\n if (!el || el[0].tagName === 'BODY') {\n return;\n }\n\n getSiblings(el).forEach(function(sibling) {\n var elemIsAlreadyHidden = sibling.getAttribute('aria-hidden') === 'true',\n ariaHiddenCount = parseInt(sibling.getAttribute(ARIA_HIDDEN_ATTRIBUTE_NAME), 10);\n\n if (!ariaHiddenCount) {\n ariaHiddenCount = elemIsAlreadyHidden ? 1 : 0; \n }\n\n sibling.setAttribute(ARIA_HIDDEN_ATTRIBUTE_NAME, ariaHiddenCount + 1);\n sibling.setAttribute('aria-hidden', 'true');\n });\n\n return applyAriaHidden(el.parent());\n\n function getSiblings(el) {\n var children = el.parent() ? el.parent().children() : [];\n\n return Array.prototype.filter.call(children, function(child) {\n return child !== el[0];\n });\n }\n }\n };\n\n function broadcastClosing(modalWindow, resultOrReason, closing) {\n return !modalWindow.value.modalScope.$broadcast('modal.closing', resultOrReason, closing).defaultPrevented;\n }\n\n function unhideBackgroundElements() {\n Array.prototype.forEach.call(\n document.querySelectorAll('[' + ARIA_HIDDEN_ATTRIBUTE_NAME + ']'),\n function(hiddenEl) {\n var ariaHiddenCount = parseInt(hiddenEl.getAttribute(ARIA_HIDDEN_ATTRIBUTE_NAME), 10),\n newHiddenCount = ariaHiddenCount - 1;\n hiddenEl.setAttribute(ARIA_HIDDEN_ATTRIBUTE_NAME, newHiddenCount);\n\n if (!newHiddenCount) {\n hiddenEl.removeAttribute(ARIA_HIDDEN_ATTRIBUTE_NAME);\n hiddenEl.removeAttribute('aria-hidden');\n }\n }\n );\n }\n \n $modalStack.close = function(modalInstance, result) {\n var modalWindow = openedWindows.get(modalInstance);\n unhideBackgroundElements();\n if (modalWindow && broadcastClosing(modalWindow, result, true)) {\n modalWindow.value.modalScope.$$uibDestructionScheduled = true;\n modalWindow.value.deferred.resolve(result);\n removeModalWindow(modalInstance, modalWindow.value.modalOpener);\n return true;\n }\n\n return !modalWindow;\n };\n\n $modalStack.dismiss = function(modalInstance, reason) {\n var modalWindow = openedWindows.get(modalInstance);\n unhideBackgroundElements();\n if (modalWindow && broadcastClosing(modalWindow, reason, false)) {\n modalWindow.value.modalScope.$$uibDestructionScheduled = true;\n modalWindow.value.deferred.reject(reason);\n removeModalWindow(modalInstance, modalWindow.value.modalOpener);\n return true;\n }\n return !modalWindow;\n };\n\n $modalStack.dismissAll = function(reason) {\n var topModal = this.getTop();\n while (topModal && this.dismiss(topModal.key, reason)) {\n topModal = this.getTop();\n }\n };\n\n $modalStack.getTop = function() {\n return openedWindows.top();\n };\n\n $modalStack.modalRendered = function(modalInstance) {\n var modalWindow = openedWindows.get(modalInstance);\n $modalStack.focusFirstFocusableElement($modalStack.loadFocusElementList(modalWindow));\n if (modalWindow) {\n modalWindow.value.renderDeferred.resolve();\n }\n };\n\n $modalStack.focusFirstFocusableElement = function(list) {\n if (list.length > 0) {\n list[0].focus();\n return true;\n }\n return false;\n };\n\n $modalStack.focusLastFocusableElement = function(list) {\n if (list.length > 0) {\n list[list.length - 1].focus();\n return true;\n }\n return false;\n };\n\n $modalStack.isModalFocused = function(evt, modalWindow) {\n if (evt && modalWindow) {\n var modalDomEl = modalWindow.value.modalDomEl;\n if (modalDomEl && modalDomEl.length) {\n return (evt.target || evt.srcElement) === modalDomEl[0];\n }\n }\n return false;\n };\n\n $modalStack.isFocusInFirstItem = function(evt, list) {\n if (list.length > 0) {\n return (evt.target || evt.srcElement) === list[0];\n }\n return false;\n };\n\n $modalStack.isFocusInLastItem = function(evt, list) {\n if (list.length > 0) {\n return (evt.target || evt.srcElement) === list[list.length - 1];\n }\n return false;\n };\n\n $modalStack.loadFocusElementList = function(modalWindow) {\n if (modalWindow) {\n var modalDomE1 = modalWindow.value.modalDomEl;\n if (modalDomE1 && modalDomE1.length) {\n var elements = modalDomE1[0].querySelectorAll(tabbableSelector);\n return elements ?\n Array.prototype.filter.call(elements, function(element) {\n return isVisible(element);\n }) : elements;\n }\n }\n };\n\n return $modalStack;\n }])\n\n .provider('$uibModal', function() {\n var $modalProvider = {\n options: {\n animation: true,\n backdrop: true, //can also be false or 'static'\n keyboard: true\n },\n $get: ['$rootScope', '$q', '$document', '$templateRequest', '$controller', '$uibResolve', '$uibModalStack',\n function ($rootScope, $q, $document, $templateRequest, $controller, $uibResolve, $modalStack) {\n var $modal = {};\n\n function getTemplatePromise(options) {\n return options.template ? $q.when(options.template) :\n $templateRequest(angular.isFunction(options.templateUrl) ?\n options.templateUrl() : options.templateUrl);\n }\n\n var promiseChain = null;\n $modal.getPromiseChain = function() {\n return promiseChain;\n };\n\n $modal.open = function(modalOptions) {\n var modalResultDeferred = $q.defer();\n var modalOpenedDeferred = $q.defer();\n var modalClosedDeferred = $q.defer();\n var modalRenderDeferred = $q.defer();\n\n //prepare an instance of a modal to be injected into controllers and returned to a caller\n var modalInstance = {\n result: modalResultDeferred.promise,\n opened: modalOpenedDeferred.promise,\n closed: modalClosedDeferred.promise,\n rendered: modalRenderDeferred.promise,\n close: function (result) {\n return $modalStack.close(modalInstance, result);\n },\n dismiss: function (reason) {\n return $modalStack.dismiss(modalInstance, reason);\n }\n };\n\n //merge and clean up options\n modalOptions = angular.extend({}, $modalProvider.options, modalOptions);\n modalOptions.resolve = modalOptions.resolve || {};\n modalOptions.appendTo = modalOptions.appendTo || $document.find('body').eq(0);\n\n //verify options\n if (!modalOptions.component && !modalOptions.template && !modalOptions.templateUrl) {\n throw new Error('One of component or template or templateUrl options is required.');\n }\n\n var templateAndResolvePromise;\n if (modalOptions.component) {\n templateAndResolvePromise = $q.when($uibResolve.resolve(modalOptions.resolve, {}, null, null));\n } else {\n templateAndResolvePromise =\n $q.all([getTemplatePromise(modalOptions), $uibResolve.resolve(modalOptions.resolve, {}, null, null)]);\n }\n\n function resolveWithTemplate() {\n return templateAndResolvePromise;\n }\n\n // Wait for the resolution of the existing promise chain.\n // Then switch to our own combined promise dependency (regardless of how the previous modal fared).\n // Then add to $modalStack and resolve opened.\n // Finally clean up the chain variable if no subsequent modal has overwritten it.\n var samePromise;\n samePromise = promiseChain = $q.all([promiseChain])\n .then(resolveWithTemplate, resolveWithTemplate)\n .then(function resolveSuccess(tplAndVars) {\n var providedScope = modalOptions.scope || $rootScope;\n\n var modalScope = providedScope.$new();\n modalScope.$close = modalInstance.close;\n modalScope.$dismiss = modalInstance.dismiss;\n\n modalScope.$on('$destroy', function() {\n if (!modalScope.$$uibDestructionScheduled) {\n modalScope.$dismiss('$uibUnscheduledDestruction');\n }\n });\n\n var modal = {\n scope: modalScope,\n deferred: modalResultDeferred,\n renderDeferred: modalRenderDeferred,\n closedDeferred: modalClosedDeferred,\n animation: modalOptions.animation,\n backdrop: modalOptions.backdrop,\n keyboard: modalOptions.keyboard,\n backdropClass: modalOptions.backdropClass,\n windowTopClass: modalOptions.windowTopClass,\n windowClass: modalOptions.windowClass,\n windowTemplateUrl: modalOptions.windowTemplateUrl,\n ariaLabelledBy: modalOptions.ariaLabelledBy,\n ariaDescribedBy: modalOptions.ariaDescribedBy,\n size: modalOptions.size,\n openedClass: modalOptions.openedClass,\n appendTo: modalOptions.appendTo\n };\n\n var component = {};\n var ctrlInstance, ctrlInstantiate, ctrlLocals = {};\n\n if (modalOptions.component) {\n constructLocals(component, false, true, false);\n component.name = modalOptions.component;\n modal.component = component;\n } else if (modalOptions.controller) {\n constructLocals(ctrlLocals, true, false, true);\n\n // the third param will make the controller instantiate later,private api\n // @see https://github.com/angular/angular.js/blob/master/src/ng/controller.js#L126\n ctrlInstantiate = $controller(modalOptions.controller, ctrlLocals, true, modalOptions.controllerAs);\n if (modalOptions.controllerAs && modalOptions.bindToController) {\n ctrlInstance = ctrlInstantiate.instance;\n ctrlInstance.$close = modalScope.$close;\n ctrlInstance.$dismiss = modalScope.$dismiss;\n angular.extend(ctrlInstance, {\n $resolve: ctrlLocals.$scope.$resolve\n }, providedScope);\n }\n\n ctrlInstance = ctrlInstantiate();\n\n if (angular.isFunction(ctrlInstance.$onInit)) {\n ctrlInstance.$onInit();\n }\n }\n\n if (!modalOptions.component) {\n modal.content = tplAndVars[0];\n }\n\n $modalStack.open(modalInstance, modal);\n modalOpenedDeferred.resolve(true);\n\n function constructLocals(obj, template, instanceOnScope, injectable) {\n obj.$scope = modalScope;\n obj.$scope.$resolve = {};\n if (instanceOnScope) {\n obj.$scope.$uibModalInstance = modalInstance;\n } else {\n obj.$uibModalInstance = modalInstance;\n }\n\n var resolves = template ? tplAndVars[1] : tplAndVars;\n angular.forEach(resolves, function(value, key) {\n if (injectable) {\n obj[key] = value;\n }\n\n obj.$scope.$resolve[key] = value;\n });\n }\n }, function resolveError(reason) {\n modalOpenedDeferred.reject(reason);\n modalResultDeferred.reject(reason);\n })['finally'](function() {\n if (promiseChain === samePromise) {\n promiseChain = null;\n }\n });\n\n return modalInstance;\n };\n\n return $modal;\n }\n ]\n };\n\n return $modalProvider;\n });\n\nangular.module('ui.bootstrap.paging', [])\n/**\n * Helper internal service for generating common controller code between the\n * pager and pagination components\n */\n.factory('uibPaging', ['$parse', function($parse) {\n return {\n create: function(ctrl, $scope, $attrs) {\n ctrl.setNumPages = $attrs.numPages ? $parse($attrs.numPages).assign : angular.noop;\n ctrl.ngModelCtrl = { $setViewValue: angular.noop }; // nullModelCtrl\n ctrl._watchers = [];\n\n ctrl.init = function(ngModelCtrl, config) {\n ctrl.ngModelCtrl = ngModelCtrl;\n ctrl.config = config;\n\n ngModelCtrl.$render = function() {\n ctrl.render();\n };\n\n if ($attrs.itemsPerPage) {\n ctrl._watchers.push($scope.$parent.$watch($attrs.itemsPerPage, function(value) {\n ctrl.itemsPerPage = parseInt(value, 10);\n $scope.totalPages = ctrl.calculateTotalPages();\n ctrl.updatePage();\n }));\n } else {\n ctrl.itemsPerPage = config.itemsPerPage;\n }\n\n $scope.$watch('totalItems', function(newTotal, oldTotal) {\n if (angular.isDefined(newTotal) || newTotal !== oldTotal) {\n $scope.totalPages = ctrl.calculateTotalPages();\n ctrl.updatePage();\n }\n });\n };\n\n ctrl.calculateTotalPages = function() {\n var totalPages = ctrl.itemsPerPage < 1 ? 1 : Math.ceil($scope.totalItems / ctrl.itemsPerPage);\n return Math.max(totalPages || 0, 1);\n };\n\n ctrl.render = function() {\n $scope.page = parseInt(ctrl.ngModelCtrl.$viewValue, 10) || 1;\n };\n\n $scope.selectPage = function(page, evt) {\n if (evt) {\n evt.preventDefault();\n }\n\n var clickAllowed = !$scope.ngDisabled || !evt;\n if (clickAllowed && $scope.page !== page && page > 0 && page <= $scope.totalPages) {\n if (evt && evt.target) {\n evt.target.blur();\n }\n ctrl.ngModelCtrl.$setViewValue(page);\n ctrl.ngModelCtrl.$render();\n }\n };\n\n $scope.getText = function(key) {\n return $scope[key + 'Text'] || ctrl.config[key + 'Text'];\n };\n\n $scope.noPrevious = function() {\n return $scope.page === 1;\n };\n\n $scope.noNext = function() {\n return $scope.page === $scope.totalPages;\n };\n\n ctrl.updatePage = function() {\n ctrl.setNumPages($scope.$parent, $scope.totalPages); // Readonly variable\n\n if ($scope.page > $scope.totalPages) {\n $scope.selectPage($scope.totalPages);\n } else {\n ctrl.ngModelCtrl.$render();\n }\n };\n\n $scope.$on('$destroy', function() {\n while (ctrl._watchers.length) {\n ctrl._watchers.shift()();\n }\n });\n }\n };\n}]);\n\nangular.module('ui.bootstrap.pager', ['ui.bootstrap.paging', 'ui.bootstrap.tabindex'])\n\n.controller('UibPagerController', ['$scope', '$attrs', 'uibPaging', 'uibPagerConfig', function($scope, $attrs, uibPaging, uibPagerConfig) {\n $scope.align = angular.isDefined($attrs.align) ? $scope.$parent.$eval($attrs.align) : uibPagerConfig.align;\n\n uibPaging.create(this, $scope, $attrs);\n}])\n\n.constant('uibPagerConfig', {\n itemsPerPage: 10,\n previousText: '« Previous',\n nextText: 'Next »',\n align: true\n})\n\n.directive('uibPager', ['uibPagerConfig', function(uibPagerConfig) {\n return {\n scope: {\n totalItems: '=',\n previousText: '@',\n nextText: '@',\n ngDisabled: '='\n },\n require: ['uibPager', '?ngModel'],\n restrict: 'A',\n controller: 'UibPagerController',\n controllerAs: 'pager',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/pager/pager.html';\n },\n link: function(scope, element, attrs, ctrls) {\n element.addClass('pager');\n var paginationCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n if (!ngModelCtrl) {\n return; // do nothing if no ng-model\n }\n\n paginationCtrl.init(ngModelCtrl, uibPagerConfig);\n }\n };\n}]);\n\nangular.module('ui.bootstrap.pagination', ['ui.bootstrap.paging', 'ui.bootstrap.tabindex'])\n.controller('UibPaginationController', ['$scope', '$attrs', '$parse', 'uibPaging', 'uibPaginationConfig', function($scope, $attrs, $parse, uibPaging, uibPaginationConfig) {\n var ctrl = this;\n // Setup configuration parameters\n var maxSize = angular.isDefined($attrs.maxSize) ? $scope.$parent.$eval($attrs.maxSize) : uibPaginationConfig.maxSize,\n rotate = angular.isDefined($attrs.rotate) ? $scope.$parent.$eval($attrs.rotate) : uibPaginationConfig.rotate,\n forceEllipses = angular.isDefined($attrs.forceEllipses) ? $scope.$parent.$eval($attrs.forceEllipses) : uibPaginationConfig.forceEllipses,\n boundaryLinkNumbers = angular.isDefined($attrs.boundaryLinkNumbers) ? $scope.$parent.$eval($attrs.boundaryLinkNumbers) : uibPaginationConfig.boundaryLinkNumbers,\n pageLabel = angular.isDefined($attrs.pageLabel) ? function(idx) { return $scope.$parent.$eval($attrs.pageLabel, {$page: idx}); } : angular.identity;\n $scope.boundaryLinks = angular.isDefined($attrs.boundaryLinks) ? $scope.$parent.$eval($attrs.boundaryLinks) : uibPaginationConfig.boundaryLinks;\n $scope.directionLinks = angular.isDefined($attrs.directionLinks) ? $scope.$parent.$eval($attrs.directionLinks) : uibPaginationConfig.directionLinks;\n\n uibPaging.create(this, $scope, $attrs);\n\n if ($attrs.maxSize) {\n ctrl._watchers.push($scope.$parent.$watch($parse($attrs.maxSize), function(value) {\n maxSize = parseInt(value, 10);\n ctrl.render();\n }));\n }\n\n // Create page object used in template\n function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }\n\n function getPages(currentPage, totalPages) {\n var pages = [];\n\n // Default page limits\n var startPage = 1, endPage = totalPages;\n var isMaxSized = angular.isDefined(maxSize) && maxSize < totalPages;\n\n // recompute if maxSize\n if (isMaxSized) {\n if (rotate) {\n // Current page is displayed in the middle of the visible ones\n startPage = Math.max(currentPage - Math.floor(maxSize / 2), 1);\n endPage = startPage + maxSize - 1;\n\n // Adjust if limit is exceeded\n if (endPage > totalPages) {\n endPage = totalPages;\n startPage = endPage - maxSize + 1;\n }\n } else {\n // Visible pages are paginated with maxSize\n startPage = (Math.ceil(currentPage / maxSize) - 1) * maxSize + 1;\n\n // Adjust last page if limit is exceeded\n endPage = Math.min(startPage + maxSize - 1, totalPages);\n }\n }\n\n // Add page number links\n for (var number = startPage; number <= endPage; number++) {\n var page = makePage(number, pageLabel(number), number === currentPage);\n pages.push(page);\n }\n\n // Add links to move between page sets\n if (isMaxSized && maxSize > 0 && (!rotate || forceEllipses || boundaryLinkNumbers)) {\n if (startPage > 1) {\n if (!boundaryLinkNumbers || startPage > 3) { //need ellipsis for all options unless range is too close to beginning\n var previousPageSet = makePage(startPage - 1, '...', false);\n pages.unshift(previousPageSet);\n }\n if (boundaryLinkNumbers) {\n if (startPage === 3) { //need to replace ellipsis when the buttons would be sequential\n var secondPageLink = makePage(2, '2', false);\n pages.unshift(secondPageLink);\n }\n //add the first page\n var firstPageLink = makePage(1, '1', false);\n pages.unshift(firstPageLink);\n }\n }\n\n if (endPage < totalPages) {\n if (!boundaryLinkNumbers || endPage < totalPages - 2) { //need ellipsis for all options unless range is too close to end\n var nextPageSet = makePage(endPage + 1, '...', false);\n pages.push(nextPageSet);\n }\n if (boundaryLinkNumbers) {\n if (endPage === totalPages - 2) { //need to replace ellipsis when the buttons would be sequential\n var secondToLastPageLink = makePage(totalPages - 1, totalPages - 1, false);\n pages.push(secondToLastPageLink);\n }\n //add the last page\n var lastPageLink = makePage(totalPages, totalPages, false);\n pages.push(lastPageLink);\n }\n }\n }\n return pages;\n }\n\n var originalRender = this.render;\n this.render = function() {\n originalRender();\n if ($scope.page > 0 && $scope.page <= $scope.totalPages) {\n $scope.pages = getPages($scope.page, $scope.totalPages);\n }\n };\n}])\n\n.constant('uibPaginationConfig', {\n itemsPerPage: 10,\n boundaryLinks: false,\n boundaryLinkNumbers: false,\n directionLinks: true,\n firstText: 'First',\n previousText: 'Previous',\n nextText: 'Next',\n lastText: 'Last',\n rotate: true,\n forceEllipses: false\n})\n\n.directive('uibPagination', ['$parse', 'uibPaginationConfig', function($parse, uibPaginationConfig) {\n return {\n scope: {\n totalItems: '=',\n firstText: '@',\n previousText: '@',\n nextText: '@',\n lastText: '@',\n ngDisabled:'='\n },\n require: ['uibPagination', '?ngModel'],\n restrict: 'A',\n controller: 'UibPaginationController',\n controllerAs: 'pagination',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/pagination/pagination.html';\n },\n link: function(scope, element, attrs, ctrls) {\n element.addClass('pagination');\n var paginationCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n if (!ngModelCtrl) {\n return; // do nothing if no ng-model\n }\n\n paginationCtrl.init(ngModelCtrl, uibPaginationConfig);\n }\n };\n}]);\n\n/**\n * The following features are still outstanding: animation as a\n * function, placement as a function, inside, support for more triggers than\n * just mouse enter/leave, html tooltips, and selector delegation.\n */\nangular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.stackedMap'])\n\n/**\n * The $tooltip service creates tooltip- and popover-like directives as well as\n * houses global options for them.\n */\n.provider('$uibTooltip', function() {\n // The default options tooltip and popover.\n var defaultOptions = {\n placement: 'top',\n placementClassPrefix: '',\n animation: true,\n popupDelay: 0,\n popupCloseDelay: 0,\n useContentExp: false\n };\n\n // Default hide triggers for each show trigger\n var triggerMap = {\n 'mouseenter': 'mouseleave',\n 'click': 'click',\n 'outsideClick': 'outsideClick',\n 'focus': 'blur',\n 'none': ''\n };\n\n // The options specified to the provider globally.\n var globalOptions = {};\n\n /**\n * `options({})` allows global configuration of all tooltips in the\n * application.\n *\n * var app = angular.module( 'App', ['ui.bootstrap.tooltip'], function( $tooltipProvider ) {\n * // place tooltips left instead of top by default\n * $tooltipProvider.options( { placement: 'left' } );\n * });\n */\n\tthis.options = function(value) {\n\t\tangular.extend(globalOptions, value);\n\t};\n\n /**\n * This allows you to extend the set of trigger mappings available. E.g.:\n *\n * $tooltipProvider.setTriggers( { 'openTrigger': 'closeTrigger' } );\n */\n this.setTriggers = function setTriggers(triggers) {\n angular.extend(triggerMap, triggers);\n };\n\n /**\n * This is a helper function for translating camel-case to snake_case.\n */\n function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }\n\n /**\n * Returns the actual instance of the $tooltip service.\n * TODO support multiple triggers\n */\n this.$get = ['$window', '$compile', '$timeout', '$document', '$uibPosition', '$interpolate', '$rootScope', '$parse', '$$stackedMap', function($window, $compile, $timeout, $document, $position, $interpolate, $rootScope, $parse, $$stackedMap) {\n var openedTooltips = $$stackedMap.createNew();\n $document.on('keyup', keypressListener);\n\n $rootScope.$on('$destroy', function() {\n $document.off('keyup', keypressListener);\n });\n\n function keypressListener(e) {\n if (e.which === 27) {\n var last = openedTooltips.top();\n if (last) {\n last.value.close();\n last = null;\n }\n }\n }\n\n return function $tooltip(ttType, prefix, defaultTriggerShow, options) {\n options = angular.extend({}, defaultOptions, globalOptions, options);\n\n /**\n * Returns an object of show and hide triggers.\n *\n * If a trigger is supplied,\n * it is used to show the tooltip; otherwise, it will use the `trigger`\n * option passed to the `$tooltipProvider.options` method; else it will\n * default to the trigger supplied to this directive factory.\n *\n * The hide trigger is based on the show trigger. If the `trigger` option\n * was passed to the `$tooltipProvider.options` method, it will use the\n * mapped trigger from `triggerMap` or the passed trigger if the map is\n * undefined; otherwise, it uses the `triggerMap` value of the show\n * trigger; else it will just use the show trigger.\n */\n function getTriggers(trigger) {\n var show = (trigger || options.trigger || defaultTriggerShow).split(' ');\n var hide = show.map(function(trigger) {\n return triggerMap[trigger] || trigger;\n });\n return {\n show: show,\n hide: hide\n };\n }\n\n var directiveName = snake_case(ttType);\n\n var startSym = $interpolate.startSymbol();\n var endSym = $interpolate.endSymbol();\n var template =\n '
      ' +\n '
      ';\n\n return {\n compile: function(tElem, tAttrs) {\n var tooltipLinker = $compile(template);\n\n return function link(scope, element, attrs, tooltipCtrl) {\n var tooltip;\n var tooltipLinkedScope;\n var transitionTimeout;\n var showTimeout;\n var hideTimeout;\n var positionTimeout;\n var adjustmentTimeout;\n var appendToBody = angular.isDefined(options.appendToBody) ? options.appendToBody : false;\n var triggers = getTriggers(undefined);\n var hasEnableExp = angular.isDefined(attrs[prefix + 'Enable']);\n var ttScope = scope.$new(true);\n var repositionScheduled = false;\n var isOpenParse = angular.isDefined(attrs[prefix + 'IsOpen']) ? $parse(attrs[prefix + 'IsOpen']) : false;\n var contentParse = options.useContentExp ? $parse(attrs[ttType]) : false;\n var observers = [];\n var lastPlacement;\n\n var positionTooltip = function() {\n // check if tooltip exists and is not empty\n if (!tooltip || !tooltip.html()) { return; }\n\n if (!positionTimeout) {\n positionTimeout = $timeout(function() {\n var ttPosition = $position.positionElements(element, tooltip, ttScope.placement, appendToBody);\n var initialHeight = angular.isDefined(tooltip.offsetHeight) ? tooltip.offsetHeight : tooltip.prop('offsetHeight');\n var elementPos = appendToBody ? $position.offset(element) : $position.position(element);\n tooltip.css({ top: ttPosition.top + 'px', left: ttPosition.left + 'px' });\n var placementClasses = ttPosition.placement.split('-');\n\n if (!tooltip.hasClass(placementClasses[0])) {\n tooltip.removeClass(lastPlacement.split('-')[0]);\n tooltip.addClass(placementClasses[0]);\n }\n\n if (!tooltip.hasClass(options.placementClassPrefix + ttPosition.placement)) {\n tooltip.removeClass(options.placementClassPrefix + lastPlacement);\n tooltip.addClass(options.placementClassPrefix + ttPosition.placement);\n }\n\n adjustmentTimeout = $timeout(function() {\n var currentHeight = angular.isDefined(tooltip.offsetHeight) ? tooltip.offsetHeight : tooltip.prop('offsetHeight');\n var adjustment = $position.adjustTop(placementClasses, elementPos, initialHeight, currentHeight);\n if (adjustment) {\n tooltip.css(adjustment);\n }\n adjustmentTimeout = null;\n }, 0, false);\n\n // first time through tt element will have the\n // uib-position-measure class or if the placement\n // has changed we need to position the arrow.\n if (tooltip.hasClass('uib-position-measure')) {\n $position.positionArrow(tooltip, ttPosition.placement);\n tooltip.removeClass('uib-position-measure');\n } else if (lastPlacement !== ttPosition.placement) {\n $position.positionArrow(tooltip, ttPosition.placement);\n }\n lastPlacement = ttPosition.placement;\n\n positionTimeout = null;\n }, 0, false);\n }\n };\n\n // Set up the correct scope to allow transclusion later\n ttScope.origScope = scope;\n\n // By default, the tooltip is not open.\n // TODO add ability to start tooltip opened\n ttScope.isOpen = false;\n\n function toggleTooltipBind() {\n if (!ttScope.isOpen) {\n showTooltipBind();\n } else {\n hideTooltipBind();\n }\n }\n\n // Show the tooltip with delay if specified, otherwise show it immediately\n function showTooltipBind() {\n if (hasEnableExp && !scope.$eval(attrs[prefix + 'Enable'])) {\n return;\n }\n\n cancelHide();\n prepareTooltip();\n\n if (ttScope.popupDelay) {\n // Do nothing if the tooltip was already scheduled to pop-up.\n // This happens if show is triggered multiple times before any hide is triggered.\n if (!showTimeout) {\n showTimeout = $timeout(show, ttScope.popupDelay, false);\n }\n } else {\n show();\n }\n }\n\n function hideTooltipBind() {\n cancelShow();\n\n if (ttScope.popupCloseDelay) {\n if (!hideTimeout) {\n hideTimeout = $timeout(hide, ttScope.popupCloseDelay, false);\n }\n } else {\n hide();\n }\n }\n\n // Show the tooltip popup element.\n function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }\n\n function cancelShow() {\n if (showTimeout) {\n $timeout.cancel(showTimeout);\n showTimeout = null;\n }\n\n if (positionTimeout) {\n $timeout.cancel(positionTimeout);\n positionTimeout = null;\n }\n }\n\n // Hide the tooltip popup element.\n function hide() {\n if (!ttScope) {\n return;\n }\n\n // First things first: we don't show it anymore.\n ttScope.$evalAsync(function() {\n if (ttScope) {\n ttScope.isOpen = false;\n assignIsOpen(false);\n // And now we remove it from the DOM. However, if we have animation, we\n // need to wait for it to expire beforehand.\n // FIXME: this is a placeholder for a port of the transitions library.\n // The fade transition in TWBS is 150ms.\n if (ttScope.animation) {\n if (!transitionTimeout) {\n transitionTimeout = $timeout(removeTooltip, 150, false);\n }\n } else {\n removeTooltip();\n }\n }\n });\n }\n\n function cancelHide() {\n if (hideTimeout) {\n $timeout.cancel(hideTimeout);\n hideTimeout = null;\n }\n\n if (transitionTimeout) {\n $timeout.cancel(transitionTimeout);\n transitionTimeout = null;\n }\n }\n\n function createTooltip() {\n // There can only be one tooltip element per directive shown at once.\n if (tooltip) {\n return;\n }\n\n tooltipLinkedScope = ttScope.$new();\n tooltip = tooltipLinker(tooltipLinkedScope, function(tooltip) {\n if (appendToBody) {\n $document.find('body').append(tooltip);\n } else {\n element.after(tooltip);\n }\n });\n\n openedTooltips.add(ttScope, {\n close: hide\n });\n\n prepObservers();\n }\n\n function removeTooltip() {\n cancelShow();\n cancelHide();\n unregisterObservers();\n\n if (tooltip) {\n tooltip.remove();\n \n tooltip = null;\n if (adjustmentTimeout) {\n $timeout.cancel(adjustmentTimeout);\n }\n }\n\n openedTooltips.remove(ttScope);\n \n if (tooltipLinkedScope) {\n tooltipLinkedScope.$destroy();\n tooltipLinkedScope = null;\n }\n }\n\n /**\n * Set the initial scope values. Once\n * the tooltip is created, the observers\n * will be added to keep things in sync.\n */\n function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n var placement = $position.parsePlacement(ttScope.placement);\n lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }\n\n function assignIsOpen(isOpen) {\n if (isOpenParse && angular.isFunction(isOpenParse.assign)) {\n isOpenParse.assign(scope, isOpen);\n }\n }\n\n ttScope.contentExp = function() {\n return ttScope.content;\n };\n\n /**\n * Observe the relevant attributes.\n */\n attrs.$observe('disabled', function(val) {\n if (val) {\n cancelShow();\n }\n\n if (val && ttScope.isOpen) {\n hide();\n }\n });\n\n if (isOpenParse) {\n scope.$watch(isOpenParse, function(val) {\n if (ttScope && !val === ttScope.isOpen) {\n toggleTooltipBind();\n }\n });\n }\n\n function prepObservers() {\n observers.length = 0;\n\n if (contentParse) {\n observers.push(\n scope.$watch(contentParse, function(val) {\n ttScope.content = val;\n if (!val && ttScope.isOpen) {\n hide();\n }\n })\n );\n\n observers.push(\n tooltipLinkedScope.$watch(function() {\n if (!repositionScheduled) {\n repositionScheduled = true;\n tooltipLinkedScope.$$postDigest(function() {\n repositionScheduled = false;\n if (ttScope && ttScope.isOpen) {\n positionTooltip();\n }\n });\n }\n })\n );\n } else {\n observers.push(\n attrs.$observe(ttType, function(val) {\n ttScope.content = val;\n if (!val && ttScope.isOpen) {\n hide();\n } else {\n positionTooltip();\n }\n })\n );\n }\n\n observers.push(\n attrs.$observe(prefix + 'Title', function(val) {\n ttScope.title = val;\n if (ttScope.isOpen) {\n positionTooltip();\n }\n })\n );\n\n observers.push(\n attrs.$observe(prefix + 'Placement', function(val) {\n ttScope.placement = val ? val : options.placement;\n if (ttScope.isOpen) {\n positionTooltip();\n }\n })\n );\n }\n\n function unregisterObservers() {\n if (observers.length) {\n angular.forEach(observers, function(observer) {\n observer();\n });\n observers.length = 0;\n }\n }\n\n // hide tooltips/popovers for outsideClick trigger\n function bodyHideTooltipBind(e) {\n if (!ttScope || !ttScope.isOpen || !tooltip) {\n return;\n }\n // make sure the tooltip/popover link or tool tooltip/popover itself were not clicked\n if (!element[0].contains(e.target) && !tooltip[0].contains(e.target)) {\n hideTooltipBind();\n }\n }\n\n var unregisterTriggers = function() {\n triggers.show.forEach(function(trigger) {\n if (trigger === 'outsideClick') {\n element.off('click', toggleTooltipBind);\n } else {\n element.off(trigger, showTooltipBind);\n element.off(trigger, toggleTooltipBind);\n }\n });\n triggers.hide.forEach(function(trigger) {\n if (trigger === 'outsideClick') {\n $document.off('click', bodyHideTooltipBind);\n } else {\n element.off(trigger, hideTooltipBind);\n }\n });\n };\n\n function prepTriggers() {\n var showTriggers = [], hideTriggers = [];\n var val = scope.$eval(attrs[prefix + 'Trigger']);\n unregisterTriggers();\n\n if (angular.isObject(val)) {\n Object.keys(val).forEach(function(key) {\n showTriggers.push(key);\n hideTriggers.push(val[key]);\n });\n triggers = {\n show: showTriggers,\n hide: hideTriggers\n };\n } else {\n triggers = getTriggers(val);\n }\n\n if (triggers.show !== 'none') {\n triggers.show.forEach(function(trigger, idx) {\n if (trigger === 'outsideClick') {\n element.on('click', toggleTooltipBind);\n $document.on('click', bodyHideTooltipBind);\n } else if (trigger === triggers.hide[idx]) {\n element.on(trigger, toggleTooltipBind);\n } else if (trigger) {\n element.on(trigger, showTooltipBind);\n element.on(triggers.hide[idx], hideTooltipBind);\n }\n\n element.on('keypress', function(e) {\n if (e.which === 27) {\n hideTooltipBind();\n }\n });\n });\n }\n }\n\n prepTriggers();\n\n var animation = scope.$eval(attrs[prefix + 'Animation']);\n ttScope.animation = angular.isDefined(animation) ? !!animation : options.animation;\n\n var appendToBodyVal;\n var appendKey = prefix + 'AppendToBody';\n if (appendKey in attrs && attrs[appendKey] === undefined) {\n appendToBodyVal = true;\n } else {\n appendToBodyVal = scope.$eval(attrs[appendKey]);\n }\n\n appendToBody = angular.isDefined(appendToBodyVal) ? appendToBodyVal : appendToBody;\n\n // Make sure tooltip is destroyed and removed.\n scope.$on('$destroy', function onDestroyTooltip() {\n unregisterTriggers();\n removeTooltip();\n ttScope = null;\n });\n };\n }\n };\n };\n }];\n})\n\n// This is mostly ngInclude code but with a custom scope\n.directive('uibTooltipTemplateTransclude', [\n '$animate', '$sce', '$compile', '$templateRequest',\nfunction ($animate, $sce, $compile, $templateRequest) {\n return {\n link: function(scope, elem, attrs) {\n var origScope = scope.$eval(attrs.tooltipTemplateTranscludeScope);\n\n var changeCounter = 0,\n currentScope,\n previousElement,\n currentElement;\n\n var cleanupLastIncludeContent = function() {\n if (previousElement) {\n previousElement.remove();\n previousElement = null;\n }\n\n if (currentScope) {\n currentScope.$destroy();\n currentScope = null;\n }\n\n if (currentElement) {\n $animate.leave(currentElement).then(function() {\n previousElement = null;\n });\n previousElement = currentElement;\n currentElement = null;\n }\n };\n\n scope.$watch($sce.parseAsResourceUrl(attrs.uibTooltipTemplateTransclude), function(src) {\n var thisChangeId = ++changeCounter;\n\n if (src) {\n //set the 2nd param to true to ignore the template request error so that the inner\n //contents and scope can be cleaned up.\n $templateRequest(src, true).then(function(response) {\n if (thisChangeId !== changeCounter) { return; }\n var newScope = origScope.$new();\n var template = response;\n\n var clone = $compile(template)(newScope, function(clone) {\n cleanupLastIncludeContent();\n $animate.enter(clone, elem);\n });\n\n currentScope = newScope;\n currentElement = clone;\n\n currentScope.$emit('$includeContentLoaded', src);\n }, function() {\n if (thisChangeId === changeCounter) {\n cleanupLastIncludeContent();\n scope.$emit('$includeContentError', src);\n }\n });\n scope.$emit('$includeContentRequested', src);\n } else {\n cleanupLastIncludeContent();\n }\n });\n\n scope.$on('$destroy', cleanupLastIncludeContent);\n }\n };\n}])\n\n/**\n * Note that it's intentional that these classes are *not* applied through $animate.\n * They must not be animated as they're expected to be present on the tooltip on\n * initialization.\n */\n.directive('uibTooltipClasses', ['$uibPosition', function($uibPosition) {\n return {\n restrict: 'A',\n link: function(scope, element, attrs) {\n // need to set the primary position so the\n // arrow has space during position measure.\n // tooltip.positionTooltip()\n if (scope.placement) {\n // // There are no top-left etc... classes\n // // in TWBS, so we need the primary position.\n var position = $uibPosition.parsePlacement(scope.placement);\n element.addClass(position[0]);\n }\n\n if (scope.popupClass) {\n element.addClass(scope.popupClass);\n }\n\n if (scope.animation) {\n element.addClass(attrs.tooltipAnimationClass);\n }\n }\n };\n}])\n\n.directive('uibTooltipPopup', function() {\n return {\n restrict: 'A',\n scope: { content: '@' },\n templateUrl: 'uib/template/tooltip/tooltip-popup.html'\n };\n})\n\n.directive('uibTooltip', [ '$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibTooltip', 'tooltip', 'mouseenter');\n}])\n\n.directive('uibTooltipTemplatePopup', function() {\n return {\n restrict: 'A',\n scope: { contentExp: '&', originScope: '&' },\n templateUrl: 'uib/template/tooltip/tooltip-template-popup.html'\n };\n})\n\n.directive('uibTooltipTemplate', ['$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibTooltipTemplate', 'tooltip', 'mouseenter', {\n useContentExp: true\n });\n}])\n\n.directive('uibTooltipHtmlPopup', function() {\n return {\n restrict: 'A',\n scope: { contentExp: '&' },\n templateUrl: 'uib/template/tooltip/tooltip-html-popup.html'\n };\n})\n\n.directive('uibTooltipHtml', ['$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibTooltipHtml', 'tooltip', 'mouseenter', {\n useContentExp: true\n });\n}]);\n\n/**\n * The following features are still outstanding: popup delay, animation as a\n * function, placement as a function, inside, support for more triggers than\n * just mouse enter/leave, and selector delegatation.\n */\nangular.module('ui.bootstrap.popover', ['ui.bootstrap.tooltip'])\n\n.directive('uibPopoverTemplatePopup', function() {\n return {\n restrict: 'A',\n scope: { uibTitle: '@', contentExp: '&', originScope: '&' },\n templateUrl: 'uib/template/popover/popover-template.html'\n };\n})\n\n.directive('uibPopoverTemplate', ['$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibPopoverTemplate', 'popover', 'click', {\n useContentExp: true\n });\n}])\n\n.directive('uibPopoverHtmlPopup', function() {\n return {\n restrict: 'A',\n scope: { contentExp: '&', uibTitle: '@' },\n templateUrl: 'uib/template/popover/popover-html.html'\n };\n})\n\n.directive('uibPopoverHtml', ['$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibPopoverHtml', 'popover', 'click', {\n useContentExp: true\n });\n}])\n\n.directive('uibPopoverPopup', function() {\n return {\n restrict: 'A',\n scope: { uibTitle: '@', content: '@' },\n templateUrl: 'uib/template/popover/popover.html'\n };\n})\n\n.directive('uibPopover', ['$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibPopover', 'popover', 'click');\n}]);\n\nangular.module('ui.bootstrap.progressbar', [])\n\n.constant('uibProgressConfig', {\n animate: true,\n max: 100\n})\n\n.controller('UibProgressController', ['$scope', '$attrs', 'uibProgressConfig', function($scope, $attrs, progressConfig) {\n var self = this,\n animate = angular.isDefined($attrs.animate) ? $scope.$parent.$eval($attrs.animate) : progressConfig.animate;\n\n this.bars = [];\n $scope.max = getMaxOrDefault();\n\n this.addBar = function(bar, element, attrs) {\n if (!animate) {\n element.css({'transition': 'none'});\n }\n\n this.bars.push(bar);\n\n bar.max = getMaxOrDefault();\n bar.title = attrs && angular.isDefined(attrs.title) ? attrs.title : 'progressbar';\n\n bar.$watch('value', function(value) {\n bar.recalculatePercentage();\n });\n\n bar.recalculatePercentage = function() {\n var totalPercentage = self.bars.reduce(function(total, bar) {\n bar.percent = +(100 * bar.value / bar.max).toFixed(2);\n return total + bar.percent;\n }, 0);\n\n if (totalPercentage > 100) {\n bar.percent -= totalPercentage - 100;\n }\n };\n\n bar.$on('$destroy', function() {\n element = null;\n self.removeBar(bar);\n });\n };\n\n this.removeBar = function(bar) {\n this.bars.splice(this.bars.indexOf(bar), 1);\n this.bars.forEach(function (bar) {\n bar.recalculatePercentage();\n });\n };\n\n //$attrs.$observe('maxParam', function(maxParam) {\n $scope.$watch('maxParam', function(maxParam) {\n self.bars.forEach(function(bar) {\n bar.max = getMaxOrDefault();\n bar.recalculatePercentage();\n });\n });\n\n function getMaxOrDefault () {\n return angular.isDefined($scope.maxParam) ? $scope.maxParam : progressConfig.max;\n }\n}])\n\n.directive('uibProgress', function() {\n return {\n replace: true,\n transclude: true,\n controller: 'UibProgressController',\n require: 'uibProgress',\n scope: {\n maxParam: '=?max'\n },\n templateUrl: 'uib/template/progressbar/progress.html'\n };\n})\n\n.directive('uibBar', function() {\n return {\n replace: true,\n transclude: true,\n require: '^uibProgress',\n scope: {\n value: '=',\n type: '@'\n },\n templateUrl: 'uib/template/progressbar/bar.html',\n link: function(scope, element, attrs, progressCtrl) {\n progressCtrl.addBar(scope, element, attrs);\n }\n };\n})\n\n.directive('uibProgressbar', function() {\n return {\n replace: true,\n transclude: true,\n controller: 'UibProgressController',\n scope: {\n value: '=',\n maxParam: '=?max',\n type: '@'\n },\n templateUrl: 'uib/template/progressbar/progressbar.html',\n link: function(scope, element, attrs, progressCtrl) {\n progressCtrl.addBar(scope, angular.element(element.children()[0]), {title: attrs.title});\n }\n };\n});\n\nangular.module('ui.bootstrap.rating', [])\n\n.constant('uibRatingConfig', {\n max: 5,\n stateOn: null,\n stateOff: null,\n enableReset: true,\n titles: ['one', 'two', 'three', 'four', 'five']\n})\n\n.controller('UibRatingController', ['$scope', '$attrs', 'uibRatingConfig', function($scope, $attrs, ratingConfig) {\n var ngModelCtrl = { $setViewValue: angular.noop },\n self = this;\n\n this.init = function(ngModelCtrl_) {\n ngModelCtrl = ngModelCtrl_;\n ngModelCtrl.$render = this.render;\n\n ngModelCtrl.$formatters.push(function(value) {\n if (angular.isNumber(value) && value << 0 !== value) {\n value = Math.round(value);\n }\n\n return value;\n });\n\n this.stateOn = angular.isDefined($attrs.stateOn) ? $scope.$parent.$eval($attrs.stateOn) : ratingConfig.stateOn;\n this.stateOff = angular.isDefined($attrs.stateOff) ? $scope.$parent.$eval($attrs.stateOff) : ratingConfig.stateOff;\n this.enableReset = angular.isDefined($attrs.enableReset) ?\n $scope.$parent.$eval($attrs.enableReset) : ratingConfig.enableReset;\n var tmpTitles = angular.isDefined($attrs.titles) ? $scope.$parent.$eval($attrs.titles) : ratingConfig.titles;\n this.titles = angular.isArray(tmpTitles) && tmpTitles.length > 0 ?\n tmpTitles : ratingConfig.titles;\n\n var ratingStates = angular.isDefined($attrs.ratingStates) ?\n $scope.$parent.$eval($attrs.ratingStates) :\n new Array(angular.isDefined($attrs.max) ? $scope.$parent.$eval($attrs.max) : ratingConfig.max);\n $scope.range = this.buildTemplateObjects(ratingStates);\n };\n\n this.buildTemplateObjects = function(states) {\n for (var i = 0, n = states.length; i < n; i++) {\n states[i] = angular.extend({ index: i }, { stateOn: this.stateOn, stateOff: this.stateOff, title: this.getTitle(i) }, states[i]);\n }\n return states;\n };\n\n this.getTitle = function(index) {\n if (index >= this.titles.length) {\n return index + 1;\n }\n\n return this.titles[index];\n };\n\n $scope.rate = function(value) {\n if (!$scope.readonly && value >= 0 && value <= $scope.range.length) {\n var newViewValue = self.enableReset && ngModelCtrl.$viewValue === value ? 0 : value;\n ngModelCtrl.$setViewValue(newViewValue);\n ngModelCtrl.$render();\n }\n };\n\n $scope.enter = function(value) {\n if (!$scope.readonly) {\n $scope.value = value;\n }\n $scope.onHover({value: value});\n };\n\n $scope.reset = function() {\n $scope.value = ngModelCtrl.$viewValue;\n $scope.onLeave();\n };\n\n $scope.onKeydown = function(evt) {\n if (/(37|38|39|40)/.test(evt.which)) {\n evt.preventDefault();\n evt.stopPropagation();\n $scope.rate($scope.value + (evt.which === 38 || evt.which === 39 ? 1 : -1));\n }\n };\n\n this.render = function() {\n $scope.value = ngModelCtrl.$viewValue;\n $scope.title = self.getTitle($scope.value - 1);\n };\n}])\n\n.directive('uibRating', function() {\n return {\n require: ['uibRating', 'ngModel'],\n restrict: 'A',\n scope: {\n readonly: '=?readOnly',\n onHover: '&',\n onLeave: '&'\n },\n controller: 'UibRatingController',\n templateUrl: 'uib/template/rating/rating.html',\n link: function(scope, element, attrs, ctrls) {\n var ratingCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n ratingCtrl.init(ngModelCtrl);\n }\n };\n});\n\nangular.module('ui.bootstrap.tabs', [])\n\n.controller('UibTabsetController', ['$scope', function ($scope) {\n var ctrl = this,\n oldIndex;\n ctrl.tabs = [];\n\n ctrl.select = function(index, evt) {\n if (!destroyed) {\n var previousIndex = findTabIndex(oldIndex);\n var previousSelected = ctrl.tabs[previousIndex];\n if (previousSelected) {\n previousSelected.tab.onDeselect({\n $event: evt,\n $selectedIndex: index\n });\n if (evt && evt.isDefaultPrevented()) {\n return;\n }\n previousSelected.tab.active = false;\n }\n\n var selected = ctrl.tabs[index];\n if (selected) {\n selected.tab.onSelect({\n $event: evt\n });\n selected.tab.active = true;\n ctrl.active = selected.index;\n oldIndex = selected.index;\n } else if (!selected && angular.isDefined(oldIndex)) {\n ctrl.active = null;\n oldIndex = null;\n }\n }\n };\n\n ctrl.addTab = function addTab(tab) {\n ctrl.tabs.push({\n tab: tab,\n index: tab.index\n });\n ctrl.tabs.sort(function(t1, t2) {\n if (t1.index > t2.index) {\n return 1;\n }\n\n if (t1.index < t2.index) {\n return -1;\n }\n\n return 0;\n });\n\n if (tab.index === ctrl.active || !angular.isDefined(ctrl.active) && ctrl.tabs.length === 1) {\n var newActiveIndex = findTabIndex(tab.index);\n ctrl.select(newActiveIndex);\n }\n };\n\n ctrl.removeTab = function removeTab(tab) {\n var index;\n for (var i = 0; i < ctrl.tabs.length; i++) {\n if (ctrl.tabs[i].tab === tab) {\n index = i;\n break;\n }\n }\n\n if (ctrl.tabs[index].index === ctrl.active) {\n var newActiveTabIndex = index === ctrl.tabs.length - 1 ?\n index - 1 : index + 1 % ctrl.tabs.length;\n ctrl.select(newActiveTabIndex);\n }\n\n ctrl.tabs.splice(index, 1);\n };\n\n $scope.$watch('tabset.active', function(val) {\n if (angular.isDefined(val) && val !== oldIndex) {\n ctrl.select(findTabIndex(val));\n }\n });\n\n var destroyed;\n $scope.$on('$destroy', function() {\n destroyed = true;\n });\n\n function findTabIndex(index) {\n for (var i = 0; i < ctrl.tabs.length; i++) {\n if (ctrl.tabs[i].index === index) {\n return i;\n }\n }\n }\n}])\n\n.directive('uibTabset', function() {\n return {\n transclude: true,\n replace: true,\n scope: {},\n bindToController: {\n active: '=?',\n type: '@'\n },\n controller: 'UibTabsetController',\n controllerAs: 'tabset',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/tabs/tabset.html';\n },\n link: function(scope, element, attrs) {\n scope.vertical = angular.isDefined(attrs.vertical) ?\n scope.$parent.$eval(attrs.vertical) : false;\n scope.justified = angular.isDefined(attrs.justified) ?\n scope.$parent.$eval(attrs.justified) : false;\n }\n };\n})\n\n.directive('uibTab', ['$parse', function($parse) {\n return {\n require: '^uibTabset',\n replace: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/tabs/tab.html';\n },\n transclude: true,\n scope: {\n heading: '@',\n index: '=?',\n classes: '@?',\n onSelect: '&select', //This callback is called in contentHeadingTransclude\n //once it inserts the tab's content into the dom\n onDeselect: '&deselect'\n },\n controller: function() {\n //Empty controller so other directives can require being 'under' a tab\n },\n controllerAs: 'tab',\n link: function(scope, elm, attrs, tabsetCtrl, transclude) {\n scope.disabled = false;\n if (attrs.disable) {\n scope.$parent.$watch($parse(attrs.disable), function(value) {\n scope.disabled = !! value;\n });\n }\n\n if (angular.isUndefined(attrs.index)) {\n if (tabsetCtrl.tabs && tabsetCtrl.tabs.length) {\n scope.index = Math.max.apply(null, tabsetCtrl.tabs.map(function(t) { return t.index; })) + 1;\n } else {\n scope.index = 0;\n }\n }\n\n if (angular.isUndefined(attrs.classes)) {\n scope.classes = '';\n }\n\n scope.select = function(evt) {\n if (!scope.disabled) {\n var index;\n for (var i = 0; i < tabsetCtrl.tabs.length; i++) {\n if (tabsetCtrl.tabs[i].tab === scope) {\n index = i;\n break;\n }\n }\n\n tabsetCtrl.select(index, evt);\n }\n };\n\n tabsetCtrl.addTab(scope);\n scope.$on('$destroy', function() {\n tabsetCtrl.removeTab(scope);\n });\n\n //We need to transclude later, once the content container is ready.\n //when this link happens, we're inside a tab heading.\n scope.$transcludeFn = transclude;\n }\n };\n}])\n\n.directive('uibTabHeadingTransclude', function() {\n return {\n restrict: 'A',\n require: '^uibTab',\n link: function(scope, elm) {\n scope.$watch('headingElement', function updateHeadingElement(heading) {\n if (heading) {\n elm.html('');\n elm.append(heading);\n }\n });\n }\n };\n})\n\n.directive('uibTabContentTransclude', function() {\n return {\n restrict: 'A',\n require: '^uibTabset',\n link: function(scope, elm, attrs) {\n var tab = scope.$eval(attrs.uibTabContentTransclude).tab;\n\n //Now our tab is ready to be transcluded: both the tab heading area\n //and the tab content area are loaded. Transclude 'em both.\n tab.$transcludeFn(tab.$parent, function(contents) {\n angular.forEach(contents, function(node) {\n if (isTabHeading(node)) {\n //Let tabHeadingTransclude know.\n tab.headingElement = node;\n } else {\n elm.append(node);\n }\n });\n });\n }\n };\n\n function isTabHeading(node) {\n return node.tagName && (\n node.hasAttribute('uib-tab-heading') ||\n node.hasAttribute('data-uib-tab-heading') ||\n node.hasAttribute('x-uib-tab-heading') ||\n node.tagName.toLowerCase() === 'uib-tab-heading' ||\n node.tagName.toLowerCase() === 'data-uib-tab-heading' ||\n node.tagName.toLowerCase() === 'x-uib-tab-heading' ||\n node.tagName.toLowerCase() === 'uib:tab-heading'\n );\n }\n});\n\nangular.module('ui.bootstrap.timepicker', [])\n\n.constant('uibTimepickerConfig', {\n hourStep: 1,\n minuteStep: 1,\n secondStep: 1,\n showMeridian: true,\n showSeconds: false,\n meridians: null,\n readonlyInput: false,\n mousewheel: true,\n arrowkeys: true,\n showSpinners: true,\n templateUrl: 'uib/template/timepicker/timepicker.html'\n})\n\n.controller('UibTimepickerController', ['$scope', '$element', '$attrs', '$parse', '$log', '$locale', 'uibTimepickerConfig', function($scope, $element, $attrs, $parse, $log, $locale, timepickerConfig) {\n var hoursModelCtrl, minutesModelCtrl, secondsModelCtrl;\n var selected = new Date(),\n watchers = [],\n ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl\n meridians = angular.isDefined($attrs.meridians) ? $scope.$parent.$eval($attrs.meridians) : timepickerConfig.meridians || $locale.DATETIME_FORMATS.AMPMS,\n padHours = angular.isDefined($attrs.padHours) ? $scope.$parent.$eval($attrs.padHours) : true;\n\n $scope.tabindex = angular.isDefined($attrs.tabindex) ? $attrs.tabindex : 0;\n $element.removeAttr('tabindex');\n\n this.init = function(ngModelCtrl_, inputs) {\n ngModelCtrl = ngModelCtrl_;\n ngModelCtrl.$render = this.render;\n\n ngModelCtrl.$formatters.unshift(function(modelValue) {\n return modelValue ? new Date(modelValue) : null;\n });\n\n var hoursInputEl = inputs.eq(0),\n minutesInputEl = inputs.eq(1),\n secondsInputEl = inputs.eq(2);\n\n hoursModelCtrl = hoursInputEl.controller('ngModel');\n minutesModelCtrl = minutesInputEl.controller('ngModel');\n secondsModelCtrl = secondsInputEl.controller('ngModel');\n\n var mousewheel = angular.isDefined($attrs.mousewheel) ? $scope.$parent.$eval($attrs.mousewheel) : timepickerConfig.mousewheel;\n\n if (mousewheel) {\n this.setupMousewheelEvents(hoursInputEl, minutesInputEl, secondsInputEl);\n }\n\n var arrowkeys = angular.isDefined($attrs.arrowkeys) ? $scope.$parent.$eval($attrs.arrowkeys) : timepickerConfig.arrowkeys;\n if (arrowkeys) {\n this.setupArrowkeyEvents(hoursInputEl, minutesInputEl, secondsInputEl);\n }\n\n $scope.readonlyInput = angular.isDefined($attrs.readonlyInput) ? $scope.$parent.$eval($attrs.readonlyInput) : timepickerConfig.readonlyInput;\n this.setupInputEvents(hoursInputEl, minutesInputEl, secondsInputEl);\n };\n\n var hourStep = timepickerConfig.hourStep;\n if ($attrs.hourStep) {\n watchers.push($scope.$parent.$watch($parse($attrs.hourStep), function(value) {\n hourStep = +value;\n }));\n }\n\n var minuteStep = timepickerConfig.minuteStep;\n if ($attrs.minuteStep) {\n watchers.push($scope.$parent.$watch($parse($attrs.minuteStep), function(value) {\n minuteStep = +value;\n }));\n }\n\n var min;\n watchers.push($scope.$parent.$watch($parse($attrs.min), function(value) {\n var dt = new Date(value);\n min = isNaN(dt) ? undefined : dt;\n }));\n\n var max;\n watchers.push($scope.$parent.$watch($parse($attrs.max), function(value) {\n var dt = new Date(value);\n max = isNaN(dt) ? undefined : dt;\n }));\n\n var disabled = false;\n if ($attrs.ngDisabled) {\n watchers.push($scope.$parent.$watch($parse($attrs.ngDisabled), function(value) {\n disabled = value;\n }));\n }\n\n $scope.noIncrementHours = function() {\n var incrementedSelected = addMinutes(selected, hourStep * 60);\n return disabled || incrementedSelected > max ||\n incrementedSelected < selected && incrementedSelected < min;\n };\n\n $scope.noDecrementHours = function() {\n var decrementedSelected = addMinutes(selected, -hourStep * 60);\n return disabled || decrementedSelected < min ||\n decrementedSelected > selected && decrementedSelected > max;\n };\n\n $scope.noIncrementMinutes = function() {\n var incrementedSelected = addMinutes(selected, minuteStep);\n return disabled || incrementedSelected > max ||\n incrementedSelected < selected && incrementedSelected < min;\n };\n\n $scope.noDecrementMinutes = function() {\n var decrementedSelected = addMinutes(selected, -minuteStep);\n return disabled || decrementedSelected < min ||\n decrementedSelected > selected && decrementedSelected > max;\n };\n\n $scope.noIncrementSeconds = function() {\n var incrementedSelected = addSeconds(selected, secondStep);\n return disabled || incrementedSelected > max ||\n incrementedSelected < selected && incrementedSelected < min;\n };\n\n $scope.noDecrementSeconds = function() {\n var decrementedSelected = addSeconds(selected, -secondStep);\n return disabled || decrementedSelected < min ||\n decrementedSelected > selected && decrementedSelected > max;\n };\n\n $scope.noToggleMeridian = function() {\n if (selected.getHours() < 12) {\n return disabled || addMinutes(selected, 12 * 60) > max;\n }\n\n return disabled || addMinutes(selected, -12 * 60) < min;\n };\n\n var secondStep = timepickerConfig.secondStep;\n if ($attrs.secondStep) {\n watchers.push($scope.$parent.$watch($parse($attrs.secondStep), function(value) {\n secondStep = +value;\n }));\n }\n\n $scope.showSeconds = timepickerConfig.showSeconds;\n if ($attrs.showSeconds) {\n watchers.push($scope.$parent.$watch($parse($attrs.showSeconds), function(value) {\n $scope.showSeconds = !!value;\n }));\n }\n\n // 12H / 24H mode\n $scope.showMeridian = timepickerConfig.showMeridian;\n if ($attrs.showMeridian) {\n watchers.push($scope.$parent.$watch($parse($attrs.showMeridian), function(value) {\n $scope.showMeridian = !!value;\n\n if (ngModelCtrl.$error.time) {\n // Evaluate from template\n var hours = getHoursFromTemplate(), minutes = getMinutesFromTemplate();\n if (angular.isDefined(hours) && angular.isDefined(minutes)) {\n selected.setHours(hours);\n refresh();\n }\n } else {\n updateTemplate();\n }\n }));\n }\n\n // Get $scope.hours in 24H mode if valid\n function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }\n\n function getMinutesFromTemplate() {\n var minutes = +$scope.minutes;\n var valid = minutes >= 0 && minutes < 60;\n if (!valid || $scope.minutes === '') {\n return undefined;\n }\n return minutes;\n }\n\n function getSecondsFromTemplate() {\n var seconds = +$scope.seconds;\n return seconds >= 0 && seconds < 60 ? seconds : undefined;\n }\n\n function pad(value, noPad) {\n if (value === null) {\n return '';\n }\n\n return angular.isDefined(value) && value.toString().length < 2 && !noPad ?\n '0' + value : value.toString();\n }\n\n // Respond on mousewheel spin\n this.setupMousewheelEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) {\n var isScrollingUp = function(e) {\n if (e.originalEvent) {\n e = e.originalEvent;\n }\n //pick correct delta variable depending on event\n var delta = e.wheelDelta ? e.wheelDelta : -e.deltaY;\n return e.detail || delta > 0;\n };\n\n hoursInputEl.bind('mousewheel wheel', function(e) {\n if (!disabled) {\n $scope.$apply(isScrollingUp(e) ? $scope.incrementHours() : $scope.decrementHours());\n }\n e.preventDefault();\n });\n\n minutesInputEl.bind('mousewheel wheel', function(e) {\n if (!disabled) {\n $scope.$apply(isScrollingUp(e) ? $scope.incrementMinutes() : $scope.decrementMinutes());\n }\n e.preventDefault();\n });\n\n secondsInputEl.bind('mousewheel wheel', function(e) {\n if (!disabled) {\n $scope.$apply(isScrollingUp(e) ? $scope.incrementSeconds() : $scope.decrementSeconds());\n }\n e.preventDefault();\n });\n };\n\n // Respond on up/down arrowkeys\n this.setupArrowkeyEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) {\n hoursInputEl.bind('keydown', function(e) {\n if (!disabled) {\n if (e.which === 38) { // up\n e.preventDefault();\n $scope.incrementHours();\n $scope.$apply();\n } else if (e.which === 40) { // down\n e.preventDefault();\n $scope.decrementHours();\n $scope.$apply();\n }\n }\n });\n\n minutesInputEl.bind('keydown', function(e) {\n if (!disabled) {\n if (e.which === 38) { // up\n e.preventDefault();\n $scope.incrementMinutes();\n $scope.$apply();\n } else if (e.which === 40) { // down\n e.preventDefault();\n $scope.decrementMinutes();\n $scope.$apply();\n }\n }\n });\n\n secondsInputEl.bind('keydown', function(e) {\n if (!disabled) {\n if (e.which === 38) { // up\n e.preventDefault();\n $scope.incrementSeconds();\n $scope.$apply();\n } else if (e.which === 40) { // down\n e.preventDefault();\n $scope.decrementSeconds();\n $scope.$apply();\n }\n }\n });\n };\n\n this.setupInputEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) {\n if ($scope.readonlyInput) {\n $scope.updateHours = angular.noop;\n $scope.updateMinutes = angular.noop;\n $scope.updateSeconds = angular.noop;\n return;\n }\n\n var invalidate = function(invalidHours, invalidMinutes, invalidSeconds) {\n ngModelCtrl.$setViewValue(null);\n ngModelCtrl.$setValidity('time', false);\n if (angular.isDefined(invalidHours)) {\n $scope.invalidHours = invalidHours;\n if (hoursModelCtrl) {\n hoursModelCtrl.$setValidity('hours', false);\n }\n }\n\n if (angular.isDefined(invalidMinutes)) {\n $scope.invalidMinutes = invalidMinutes;\n if (minutesModelCtrl) {\n minutesModelCtrl.$setValidity('minutes', false);\n }\n }\n\n if (angular.isDefined(invalidSeconds)) {\n $scope.invalidSeconds = invalidSeconds;\n if (secondsModelCtrl) {\n secondsModelCtrl.$setValidity('seconds', false);\n }\n }\n };\n\n $scope.updateHours = function() {\n var hours = getHoursFromTemplate(),\n minutes = getMinutesFromTemplate();\n\n ngModelCtrl.$setDirty();\n\n if (angular.isDefined(hours) && angular.isDefined(minutes)) {\n selected.setHours(hours);\n selected.setMinutes(minutes);\n if (selected < min || selected > max) {\n invalidate(true);\n } else {\n refresh('h');\n }\n } else {\n invalidate(true);\n }\n };\n\n hoursInputEl.bind('blur', function(e) {\n ngModelCtrl.$setTouched();\n if (modelIsEmpty()) {\n makeValid();\n } else if ($scope.hours === null || $scope.hours === '') {\n invalidate(true);\n } else if (!$scope.invalidHours && $scope.hours < 10) {\n $scope.$apply(function() {\n $scope.hours = pad($scope.hours, !padHours);\n });\n }\n });\n\n $scope.updateMinutes = function() {\n var minutes = getMinutesFromTemplate(),\n hours = getHoursFromTemplate();\n\n ngModelCtrl.$setDirty();\n\n if (angular.isDefined(minutes) && angular.isDefined(hours)) {\n selected.setHours(hours);\n selected.setMinutes(minutes);\n if (selected < min || selected > max) {\n invalidate(undefined, true);\n } else {\n refresh('m');\n }\n } else {\n invalidate(undefined, true);\n }\n };\n\n minutesInputEl.bind('blur', function(e) {\n ngModelCtrl.$setTouched();\n if (modelIsEmpty()) {\n makeValid();\n } else if ($scope.minutes === null) {\n invalidate(undefined, true);\n } else if (!$scope.invalidMinutes && $scope.minutes < 10) {\n $scope.$apply(function() {\n $scope.minutes = pad($scope.minutes);\n });\n }\n });\n\n $scope.updateSeconds = function() {\n var seconds = getSecondsFromTemplate();\n\n ngModelCtrl.$setDirty();\n\n if (angular.isDefined(seconds)) {\n selected.setSeconds(seconds);\n refresh('s');\n } else {\n invalidate(undefined, undefined, true);\n }\n };\n\n secondsInputEl.bind('blur', function(e) {\n if (modelIsEmpty()) {\n makeValid();\n } else if (!$scope.invalidSeconds && $scope.seconds < 10) {\n $scope.$apply( function() {\n $scope.seconds = pad($scope.seconds);\n });\n }\n });\n\n };\n\n this.render = function() {\n var date = ngModelCtrl.$viewValue;\n\n if (isNaN(date)) {\n ngModelCtrl.$setValidity('time', false);\n $log.error('Timepicker directive: \"ng-model\" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.');\n } else {\n if (date) {\n selected = date;\n }\n\n if (selected < min || selected > max) {\n ngModelCtrl.$setValidity('time', false);\n $scope.invalidHours = true;\n $scope.invalidMinutes = true;\n } else {\n makeValid();\n }\n updateTemplate();\n }\n };\n\n // Call internally when we know that model is valid.\n function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }\n\n function makeValid() {\n if (hoursModelCtrl) {\n hoursModelCtrl.$setValidity('hours', true);\n }\n\n if (minutesModelCtrl) {\n minutesModelCtrl.$setValidity('minutes', true);\n }\n\n if (secondsModelCtrl) {\n secondsModelCtrl.$setValidity('seconds', true);\n }\n\n ngModelCtrl.$setValidity('time', true);\n $scope.invalidHours = false;\n $scope.invalidMinutes = false;\n $scope.invalidSeconds = false;\n }\n\n function updateTemplate(keyboardChange) {\n if (!ngModelCtrl.$modelValue) {\n $scope.hours = null;\n $scope.minutes = null;\n $scope.seconds = null;\n $scope.meridian = meridians[0];\n } else {\n var hours = selected.getHours(),\n minutes = selected.getMinutes(),\n seconds = selected.getSeconds();\n\n if ($scope.showMeridian) {\n hours = hours === 0 || hours === 12 ? 12 : hours % 12; // Convert 24 to 12 hour system\n }\n\n $scope.hours = keyboardChange === 'h' ? hours : pad(hours, !padHours);\n if (keyboardChange !== 'm') {\n $scope.minutes = pad(minutes);\n }\n $scope.meridian = selected.getHours() < 12 ? meridians[0] : meridians[1];\n\n if (keyboardChange !== 's') {\n $scope.seconds = pad(seconds);\n }\n $scope.meridian = selected.getHours() < 12 ? meridians[0] : meridians[1];\n }\n }\n\n function addSecondsToSelected(seconds) {\n selected = addSeconds(selected, seconds);\n refresh();\n }\n\n function addMinutes(selected, minutes) {\n return addSeconds(selected, minutes*60);\n }\n\n function addSeconds(date, seconds) {\n var dt = new Date(date.getTime() + seconds * 1000);\n var newDate = new Date(date);\n newDate.setHours(dt.getHours(), dt.getMinutes(), dt.getSeconds());\n return newDate;\n }\n\n function modelIsEmpty() {\n return ($scope.hours === null || $scope.hours === '') &&\n ($scope.minutes === null || $scope.minutes === '') &&\n (!$scope.showSeconds || $scope.showSeconds && ($scope.seconds === null || $scope.seconds === ''));\n }\n\n $scope.showSpinners = angular.isDefined($attrs.showSpinners) ?\n $scope.$parent.$eval($attrs.showSpinners) : timepickerConfig.showSpinners;\n\n $scope.incrementHours = function() {\n if (!$scope.noIncrementHours()) {\n addSecondsToSelected(hourStep * 60 * 60);\n }\n };\n\n $scope.decrementHours = function() {\n if (!$scope.noDecrementHours()) {\n addSecondsToSelected(-hourStep * 60 * 60);\n }\n };\n\n $scope.incrementMinutes = function() {\n if (!$scope.noIncrementMinutes()) {\n addSecondsToSelected(minuteStep * 60);\n }\n };\n\n $scope.decrementMinutes = function() {\n if (!$scope.noDecrementMinutes()) {\n addSecondsToSelected(-minuteStep * 60);\n }\n };\n\n $scope.incrementSeconds = function() {\n if (!$scope.noIncrementSeconds()) {\n addSecondsToSelected(secondStep);\n }\n };\n\n $scope.decrementSeconds = function() {\n if (!$scope.noDecrementSeconds()) {\n addSecondsToSelected(-secondStep);\n }\n };\n\n $scope.toggleMeridian = function() {\n var minutes = getMinutesFromTemplate(),\n hours = getHoursFromTemplate();\n\n if (!$scope.noToggleMeridian()) {\n if (angular.isDefined(minutes) && angular.isDefined(hours)) {\n addSecondsToSelected(12 * 60 * (selected.getHours() < 12 ? 60 : -60));\n } else {\n $scope.meridian = $scope.meridian === meridians[0] ? meridians[1] : meridians[0];\n }\n }\n };\n\n $scope.blur = function() {\n ngModelCtrl.$setTouched();\n };\n\n $scope.$on('$destroy', function() {\n while (watchers.length) {\n watchers.shift()();\n }\n });\n}])\n\n.directive('uibTimepicker', ['uibTimepickerConfig', function(uibTimepickerConfig) {\n return {\n require: ['uibTimepicker', '?^ngModel'],\n restrict: 'A',\n controller: 'UibTimepickerController',\n controllerAs: 'timepicker',\n scope: {},\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || uibTimepickerConfig.templateUrl;\n },\n link: function(scope, element, attrs, ctrls) {\n var timepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n if (ngModelCtrl) {\n timepickerCtrl.init(ngModelCtrl, element.find('input'));\n }\n }\n };\n}]);\n\nangular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap.position'])\n\n/**\n * A helper service that can parse typeahead's syntax (string provided by users)\n * Extracted to a separate service for ease of unit testing\n */\n .factory('uibTypeaheadParser', ['$parse', function($parse) {\n // 000001111111100000000000002222222200000000000000003333333333333330000000000044444444000\n var TYPEAHEAD_REGEXP = /^\\s*([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?\\s+for\\s+(?:([\\$\\w][\\$\\w\\d]*))\\s+in\\s+([\\s\\S]+?)$/;\n return {\n parse: function(input) {\n var match = input.match(TYPEAHEAD_REGEXP);\n if (!match) {\n throw new Error(\n 'Expected typeahead specification in form of \"_modelValue_ (as _label_)? for _item_ in _collection_\"' +\n ' but got \"' + input + '\".');\n }\n\n return {\n itemName: match[3],\n source: $parse(match[4]),\n viewMapper: $parse(match[2] || match[1]),\n modelMapper: $parse(match[1])\n };\n }\n };\n }])\n\n .controller('UibTypeaheadController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$q', '$timeout', '$document', '$window', '$rootScope', '$$debounce', '$uibPosition', 'uibTypeaheadParser',\n function(originalScope, element, attrs, $compile, $parse, $q, $timeout, $document, $window, $rootScope, $$debounce, $position, typeaheadParser) {\n var HOT_KEYS = [9, 13, 27, 38, 40];\n var eventDebounceTime = 200;\n var modelCtrl, ngModelOptions;\n //SUPPORTED ATTRIBUTES (OPTIONS)\n\n //minimal no of characters that needs to be entered before typeahead kicks-in\n var minLength = originalScope.$eval(attrs.typeaheadMinLength);\n if (!minLength && minLength !== 0) {\n minLength = 1;\n }\n\n originalScope.$watch(attrs.typeaheadMinLength, function (newVal) {\n minLength = !newVal && newVal !== 0 ? 1 : newVal;\n });\n\n //minimal wait time after last character typed before typeahead kicks-in\n var waitTime = originalScope.$eval(attrs.typeaheadWaitMs) || 0;\n\n //should it restrict model values to the ones selected from the popup only?\n var isEditable = originalScope.$eval(attrs.typeaheadEditable) !== false;\n originalScope.$watch(attrs.typeaheadEditable, function (newVal) {\n isEditable = newVal !== false;\n });\n\n //binding to a variable that indicates if matches are being retrieved asynchronously\n var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop;\n\n //a function to determine if an event should cause selection\n var isSelectEvent = attrs.typeaheadShouldSelect ? $parse(attrs.typeaheadShouldSelect) : function(scope, vals) {\n var evt = vals.$event;\n return evt.which === 13 || evt.which === 9;\n };\n\n //a callback executed when a match is selected\n var onSelectCallback = $parse(attrs.typeaheadOnSelect);\n\n //should it select highlighted popup value when losing focus?\n var isSelectOnBlur = angular.isDefined(attrs.typeaheadSelectOnBlur) ? originalScope.$eval(attrs.typeaheadSelectOnBlur) : false;\n\n //binding to a variable that indicates if there were no results after the query is completed\n var isNoResultsSetter = $parse(attrs.typeaheadNoResults).assign || angular.noop;\n\n var inputFormatter = attrs.typeaheadInputFormatter ? $parse(attrs.typeaheadInputFormatter) : undefined;\n\n var appendToBody = attrs.typeaheadAppendToBody ? originalScope.$eval(attrs.typeaheadAppendToBody) : false;\n\n var appendTo = attrs.typeaheadAppendTo ?\n originalScope.$eval(attrs.typeaheadAppendTo) : null;\n\n var focusFirst = originalScope.$eval(attrs.typeaheadFocusFirst) !== false;\n\n //If input matches an item of the list exactly, select it automatically\n var selectOnExact = attrs.typeaheadSelectOnExact ? originalScope.$eval(attrs.typeaheadSelectOnExact) : false;\n\n //binding to a variable that indicates if dropdown is open\n var isOpenSetter = $parse(attrs.typeaheadIsOpen).assign || angular.noop;\n\n var showHint = originalScope.$eval(attrs.typeaheadShowHint) || false;\n\n //INTERNAL VARIABLES\n\n //model setter executed upon match selection\n var parsedModel = $parse(attrs.ngModel);\n var invokeModelSetter = $parse(attrs.ngModel + '($$$p)');\n var $setModelValue = function(scope, newValue) {\n if (angular.isFunction(parsedModel(originalScope)) &&\n ngModelOptions && ngModelOptions.$options && ngModelOptions.$options.getterSetter) {\n return invokeModelSetter(scope, {$$$p: newValue});\n }\n\n return parsedModel.assign(scope, newValue);\n };\n\n //expressions used by typeahead\n var parserResult = typeaheadParser.parse(attrs.uibTypeahead);\n\n var hasFocus;\n\n //Used to avoid bug in iOS webview where iOS keyboard does not fire\n //mousedown & mouseup events\n //Issue #3699\n var selected;\n\n //create a child scope for the typeahead directive so we are not polluting original scope\n //with typeahead-specific data (matches, query etc.)\n var scope = originalScope.$new();\n var offDestroy = originalScope.$on('$destroy', function() {\n scope.$destroy();\n });\n scope.$on('$destroy', offDestroy);\n\n // WAI-ARIA\n var popupId = 'typeahead-' + scope.$id + '-' + Math.floor(Math.random() * 10000);\n element.attr({\n 'aria-autocomplete': 'list',\n 'aria-expanded': false,\n 'aria-owns': popupId\n });\n\n var inputsContainer, hintInputElem;\n //add read-only input to show hint\n if (showHint) {\n inputsContainer = angular.element('
      ');\n inputsContainer.css('position', 'relative');\n element.after(inputsContainer);\n hintInputElem = element.clone();\n hintInputElem.attr('placeholder', '');\n hintInputElem.attr('tabindex', '-1');\n hintInputElem.val('');\n hintInputElem.css({\n 'position': 'absolute',\n 'top': '0px',\n 'left': '0px',\n 'border-color': 'transparent',\n 'box-shadow': 'none',\n 'opacity': 1,\n 'background': 'none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)',\n 'color': '#999'\n });\n element.css({\n 'position': 'relative',\n 'vertical-align': 'top',\n 'background-color': 'transparent'\n });\n\n if (hintInputElem.attr('id')) {\n hintInputElem.removeAttr('id'); // remove duplicate id if present.\n }\n inputsContainer.append(hintInputElem);\n hintInputElem.after(element);\n }\n\n //pop-up element used to display matches\n var popUpEl = angular.element('
      ');\n popUpEl.attr({\n id: popupId,\n matches: 'matches',\n active: 'activeIdx',\n select: 'select(activeIdx, evt)',\n 'move-in-progress': 'moveInProgress',\n query: 'query',\n position: 'position',\n 'assign-is-open': 'assignIsOpen(isOpen)',\n debounce: 'debounceUpdate'\n });\n //custom item template\n if (angular.isDefined(attrs.typeaheadTemplateUrl)) {\n popUpEl.attr('template-url', attrs.typeaheadTemplateUrl);\n }\n\n if (angular.isDefined(attrs.typeaheadPopupTemplateUrl)) {\n popUpEl.attr('popup-template-url', attrs.typeaheadPopupTemplateUrl);\n }\n\n var resetHint = function() {\n if (showHint) {\n hintInputElem.val('');\n }\n };\n\n var resetMatches = function() {\n scope.matches = [];\n scope.activeIdx = -1;\n element.attr('aria-expanded', false);\n resetHint();\n };\n\n var getMatchId = function(index) {\n return popupId + '-option-' + index;\n };\n\n // Indicate that the specified match is the active (pre-selected) item in the list owned by this typeahead.\n // This attribute is added or removed automatically when the `activeIdx` changes.\n scope.$watch('activeIdx', function(index) {\n if (index < 0) {\n element.removeAttr('aria-activedescendant');\n } else {\n element.attr('aria-activedescendant', getMatchId(index));\n }\n });\n\n var inputIsExactMatch = function(inputValue, index) {\n if (scope.matches.length > index && inputValue) {\n return inputValue.toUpperCase() === scope.matches[index].label.toUpperCase();\n }\n\n return false;\n };\n\n var getMatchesAsync = function(inputValue, evt) {\n var locals = {$viewValue: inputValue};\n isLoadingSetter(originalScope, true);\n isNoResultsSetter(originalScope, false);\n $q.when(parserResult.source(originalScope, locals)).then(function(matches) {\n //it might happen that several async queries were in progress if a user were typing fast\n //but we are interested only in responses that correspond to the current view value\n var onCurrentRequest = inputValue === modelCtrl.$viewValue;\n if (onCurrentRequest && hasFocus) {\n if (matches && matches.length > 0) {\n scope.activeIdx = focusFirst ? 0 : -1;\n isNoResultsSetter(originalScope, false);\n scope.matches.length = 0;\n\n //transform labels\n for (var i = 0; i < matches.length; i++) {\n locals[parserResult.itemName] = matches[i];\n scope.matches.push({\n id: getMatchId(i),\n label: parserResult.viewMapper(scope, locals),\n model: matches[i]\n });\n }\n\n scope.query = inputValue;\n //position pop-up with matches - we need to re-calculate its position each time we are opening a window\n //with matches as a pop-up might be absolute-positioned and position of an input might have changed on a page\n //due to other elements being rendered\n recalculatePosition();\n\n element.attr('aria-expanded', true);\n\n //Select the single remaining option if user input matches\n if (selectOnExact && scope.matches.length === 1 && inputIsExactMatch(inputValue, 0)) {\n if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) {\n $$debounce(function() {\n scope.select(0, evt);\n }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']);\n } else {\n scope.select(0, evt);\n }\n }\n\n if (showHint) {\n var firstLabel = scope.matches[0].label;\n if (angular.isString(inputValue) &&\n inputValue.length > 0 &&\n firstLabel.slice(0, inputValue.length).toUpperCase() === inputValue.toUpperCase()) {\n hintInputElem.val(inputValue + firstLabel.slice(inputValue.length));\n } else {\n hintInputElem.val('');\n }\n }\n } else {\n resetMatches();\n isNoResultsSetter(originalScope, true);\n }\n }\n if (onCurrentRequest) {\n isLoadingSetter(originalScope, false);\n }\n }, function() {\n resetMatches();\n isLoadingSetter(originalScope, false);\n isNoResultsSetter(originalScope, true);\n });\n };\n\n // bind events only if appendToBody params exist - performance feature\n if (appendToBody) {\n angular.element($window).on('resize', fireRecalculating);\n $document.find('body').on('scroll', fireRecalculating);\n }\n\n // Declare the debounced function outside recalculating for\n // proper debouncing\n var debouncedRecalculate = $$debounce(function() {\n // if popup is visible\n if (scope.matches.length) {\n recalculatePosition();\n }\n\n scope.moveInProgress = false;\n }, eventDebounceTime);\n\n // Default progress type\n scope.moveInProgress = false;\n\n function fireRecalculating() {\n if (!scope.moveInProgress) {\n scope.moveInProgress = true;\n scope.$digest();\n }\n\n debouncedRecalculate();\n }\n\n // recalculate actual position and set new values to scope\n // after digest loop is popup in right position\n function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }\n\n //we need to propagate user's query so we can higlight matches\n scope.query = undefined;\n\n //Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later\n var timeoutPromise;\n\n var scheduleSearchWithTimeout = function(inputValue) {\n timeoutPromise = $timeout(function() {\n getMatchesAsync(inputValue);\n }, waitTime);\n };\n\n var cancelPreviousTimeout = function() {\n if (timeoutPromise) {\n $timeout.cancel(timeoutPromise);\n }\n };\n\n resetMatches();\n\n scope.assignIsOpen = function (isOpen) {\n isOpenSetter(originalScope, isOpen);\n };\n\n scope.select = function(activeIdx, evt) {\n //called from within the $digest() cycle\n var locals = {};\n var model, item;\n\n selected = true;\n locals[parserResult.itemName] = item = scope.matches[activeIdx].model;\n model = parserResult.modelMapper(originalScope, locals);\n $setModelValue(originalScope, model);\n modelCtrl.$setValidity('editable', true);\n modelCtrl.$setValidity('parse', true);\n\n onSelectCallback(originalScope, {\n $item: item,\n $model: model,\n $label: parserResult.viewMapper(originalScope, locals),\n $event: evt\n });\n\n resetMatches();\n\n //return focus to the input element if a match was selected via a mouse click event\n // use timeout to avoid $rootScope:inprog error\n if (scope.$eval(attrs.typeaheadFocusOnSelect) !== false) {\n $timeout(function() { element[0].focus(); }, 0, false);\n }\n };\n\n //bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(27)\n element.on('keydown', function(evt) {\n //typeahead is open and an \"interesting\" key was pressed\n if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) {\n return;\n }\n\n var shouldSelect = isSelectEvent(originalScope, {$event: evt});\n\n /**\n * if there's nothing selected (i.e. focusFirst) and enter or tab is hit\n * or\n * shift + tab is pressed to bring focus to the previous element\n * then clear the results\n */\n if (scope.activeIdx === -1 && shouldSelect || evt.which === 9 && !!evt.shiftKey) {\n resetMatches();\n scope.$digest();\n return;\n }\n\n evt.preventDefault();\n var target;\n switch (evt.which) {\n case 27: // escape\n evt.stopPropagation();\n\n resetMatches();\n originalScope.$digest();\n break;\n case 38: // up arrow\n scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;\n scope.$digest();\n target = popUpEl[0].querySelectorAll('.uib-typeahead-match')[scope.activeIdx];\n target.parentNode.scrollTop = target.offsetTop;\n break;\n case 40: // down arrow\n scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length;\n scope.$digest();\n target = popUpEl[0].querySelectorAll('.uib-typeahead-match')[scope.activeIdx];\n target.parentNode.scrollTop = target.offsetTop;\n break;\n default:\n if (shouldSelect) {\n scope.$apply(function() {\n if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) {\n $$debounce(function() {\n scope.select(scope.activeIdx, evt);\n }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']);\n } else {\n scope.select(scope.activeIdx, evt);\n }\n });\n }\n }\n });\n\n element.bind('focus', function (evt) {\n hasFocus = true;\n if (minLength === 0 && !modelCtrl.$viewValue) {\n $timeout(function() {\n getMatchesAsync(modelCtrl.$viewValue, evt);\n }, 0);\n }\n });\n\n element.bind('blur', function(evt) {\n if (isSelectOnBlur && scope.matches.length && scope.activeIdx !== -1 && !selected) {\n selected = true;\n scope.$apply(function() {\n if (angular.isObject(scope.debounceUpdate) && angular.isNumber(scope.debounceUpdate.blur)) {\n $$debounce(function() {\n scope.select(scope.activeIdx, evt);\n }, scope.debounceUpdate.blur);\n } else {\n scope.select(scope.activeIdx, evt);\n }\n });\n }\n if (!isEditable && modelCtrl.$error.editable) {\n modelCtrl.$setViewValue();\n scope.$apply(function() {\n // Reset validity as we are clearing\n modelCtrl.$setValidity('editable', true);\n modelCtrl.$setValidity('parse', true);\n });\n element.val('');\n }\n hasFocus = false;\n selected = false;\n });\n\n // Keep reference to click handler to unbind it.\n var dismissClickHandler = function(evt) {\n // Issue #3973\n // Firefox treats right click as a click on document\n if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) {\n resetMatches();\n if (!$rootScope.$$phase) {\n originalScope.$digest();\n }\n }\n };\n\n $document.on('click', dismissClickHandler);\n\n originalScope.$on('$destroy', function() {\n $document.off('click', dismissClickHandler);\n if (appendToBody || appendTo) {\n $popup.remove();\n }\n\n if (appendToBody) {\n angular.element($window).off('resize', fireRecalculating);\n $document.find('body').off('scroll', fireRecalculating);\n }\n // Prevent jQuery cache memory leak\n popUpEl.remove();\n\n if (showHint) {\n inputsContainer.remove();\n }\n });\n\n var $popup = $compile(popUpEl)(scope);\n\n if (appendToBody) {\n $document.find('body').append($popup);\n } else if (appendTo) {\n angular.element(appendTo).eq(0).append($popup);\n } else {\n element.after($popup);\n }\n\n this.init = function(_modelCtrl, _ngModelOptions) {\n modelCtrl = _modelCtrl;\n ngModelOptions = _ngModelOptions;\n\n scope.debounceUpdate = modelCtrl.$options && $parse(modelCtrl.$options.debounce)(originalScope);\n\n //plug into $parsers pipeline to open a typeahead on view changes initiated from DOM\n //$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue\n modelCtrl.$parsers.unshift(function(inputValue) {\n hasFocus = true;\n\n if (minLength === 0 || inputValue && inputValue.length >= minLength) {\n if (waitTime > 0) {\n cancelPreviousTimeout();\n scheduleSearchWithTimeout(inputValue);\n } else {\n getMatchesAsync(inputValue);\n }\n } else {\n isLoadingSetter(originalScope, false);\n cancelPreviousTimeout();\n resetMatches();\n }\n\n if (isEditable) {\n return inputValue;\n }\n\n if (!inputValue) {\n // Reset in case user had typed something previously.\n modelCtrl.$setValidity('editable', true);\n return null;\n }\n\n modelCtrl.$setValidity('editable', false);\n return undefined;\n });\n\n modelCtrl.$formatters.push(function(modelValue) {\n var candidateViewValue, emptyViewValue;\n var locals = {};\n\n // The validity may be set to false via $parsers (see above) if\n // the model is restricted to selected values. If the model\n // is set manually it is considered to be valid.\n if (!isEditable) {\n modelCtrl.$setValidity('editable', true);\n }\n\n if (inputFormatter) {\n locals.$model = modelValue;\n return inputFormatter(originalScope, locals);\n }\n\n //it might happen that we don't have enough info to properly render input value\n //we need to check for this situation and simply return model value if we can't apply custom formatting\n locals[parserResult.itemName] = modelValue;\n candidateViewValue = parserResult.viewMapper(originalScope, locals);\n locals[parserResult.itemName] = undefined;\n emptyViewValue = parserResult.viewMapper(originalScope, locals);\n\n return candidateViewValue !== emptyViewValue ? candidateViewValue : modelValue;\n });\n };\n }])\n\n .directive('uibTypeahead', function() {\n return {\n controller: 'UibTypeaheadController',\n require: ['ngModel', '^?ngModelOptions', 'uibTypeahead'],\n link: function(originalScope, element, attrs, ctrls) {\n ctrls[2].init(ctrls[0], ctrls[1]);\n }\n };\n })\n\n .directive('uibTypeaheadPopup', ['$$debounce', function($$debounce) {\n return {\n scope: {\n matches: '=',\n query: '=',\n active: '=',\n position: '&',\n moveInProgress: '=',\n select: '&',\n assignIsOpen: '&',\n debounce: '&'\n },\n replace: true,\n templateUrl: function(element, attrs) {\n return attrs.popupTemplateUrl || 'uib/template/typeahead/typeahead-popup.html';\n },\n link: function(scope, element, attrs) {\n scope.templateUrl = attrs.templateUrl;\n\n scope.isOpen = function() {\n var isDropdownOpen = scope.matches.length > 0;\n scope.assignIsOpen({ isOpen: isDropdownOpen });\n return isDropdownOpen;\n };\n\n scope.isActive = function(matchIdx) {\n return scope.active === matchIdx;\n };\n\n scope.selectActive = function(matchIdx) {\n scope.active = matchIdx;\n };\n\n scope.selectMatch = function(activeIdx, evt) {\n var debounce = scope.debounce();\n if (angular.isNumber(debounce) || angular.isObject(debounce)) {\n $$debounce(function() {\n scope.select({activeIdx: activeIdx, evt: evt});\n }, angular.isNumber(debounce) ? debounce : debounce['default']);\n } else {\n scope.select({activeIdx: activeIdx, evt: evt});\n }\n };\n }\n };\n }])\n\n .directive('uibTypeaheadMatch', ['$templateRequest', '$compile', '$parse', function($templateRequest, $compile, $parse) {\n return {\n scope: {\n index: '=',\n match: '=',\n query: '='\n },\n link: function(scope, element, attrs) {\n var tplUrl = $parse(attrs.templateUrl)(scope.$parent) || 'uib/template/typeahead/typeahead-match.html';\n $templateRequest(tplUrl).then(function(tplContent) {\n var tplEl = angular.element(tplContent.trim());\n element.replaceWith(tplEl);\n $compile(tplEl)(scope);\n });\n }\n };\n }])\n\n .filter('uibTypeaheadHighlight', ['$sce', '$injector', '$log', function($sce, $injector, $log) {\n var isSanitizePresent;\n isSanitizePresent = $injector.has('$sanitize');\n\n function escapeRegexp(queryToEscape) {\n // Regex: capture the whole query string and replace it with the string that will be used to match\n // the results, for example if the capture is \"a\" the result will be \\a\n return queryToEscape.replace(/([.?*+^$[\\]\\\\(){}|-])/g, '\\\\$1');\n }\n\n function containsHtml(matchItem) {\n return /<.*>/g.test(matchItem);\n }\n\n return function(matchItem, query) {\n if (!isSanitizePresent && containsHtml(matchItem)) {\n $log.warn('Unsafe use of typeahead please use ngSanitize'); // Warn the user about the danger\n }\n matchItem = query ? ('' + matchItem).replace(new RegExp(escapeRegexp(query), 'gi'), '$&') : matchItem; // Replaces the capture string with a the same string inside of a \"strong\" tag\n if (!isSanitizePresent) {\n matchItem = $sce.trustAsHtml(matchItem); // If $sanitize is not present we pack the string in a $sce object for the ng-bind-html directive\n }\n return matchItem;\n };\n }]);\n\nangular.module(\"uib/template/accordion/accordion-group.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/accordion/accordion-group.html\",\n \"
      \\n\" +\n \"

      \\n\" +\n \" {{heading}}\\n\" +\n \"

      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/accordion/accordion.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/accordion/accordion.html\",\n \"
      \");\n}]);\n\nangular.module(\"uib/template/alert/alert.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/alert/alert.html\",\n \"\\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/carousel/carousel.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/carousel/carousel.html\",\n \"
      \\n\" +\n \" 1\\\">\\n\" +\n \" \\n\" +\n \" previous\\n\" +\n \"\\n\" +\n \" 1\\\">\\n\" +\n \" \\n\" +\n \" next\\n\" +\n \"\\n\" +\n \"
        1\\\">\\n\" +\n \"
      1. \\n\" +\n \" slide {{ $index + 1 }} of {{ slides.length }}, currently active\\n\" +\n \"
      2. \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/carousel/slide.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/carousel/slide.html\",\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepicker/datepicker.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/datepicker/datepicker.html\",\n \"
      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepicker/day.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/datepicker/day.html\",\n \"\\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
      {{::label.abbr}}
      {{ weekNumbers[$index] }}\\n\" +\n \" \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepicker/month.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/datepicker/month.html\",\n \"\\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
      \\n\" +\n \" \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepicker/year.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/datepicker/year.html\",\n \"\\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
      \\n\" +\n \" \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepickerPopup/popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/datepickerPopup/popup.html\",\n \"
        \\n\" +\n \"
      • \\n\" +\n \"
      • \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
      • \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/modal/window.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/modal/window.html\",\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/pager/pager.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/pager/pager.html\",\n \"
    • {{::getText('previous')}}
    • \\n\" +\n \"
    • {{::getText('next')}}
    • \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/pagination/pagination.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/pagination/pagination.html\",\n \"
    • {{::getText('first')}}
    • \\n\" +\n \"
    • {{::getText('previous')}}
    • \\n\" +\n \"
    • {{page.text}}
    • \\n\" +\n \"
    • {{::getText('next')}}
    • \\n\" +\n \"
    • {{::getText('last')}}
    • \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/tooltip/tooltip-html-popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/tooltip/tooltip-html-popup.html\",\n \"
      \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/tooltip/tooltip-popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/tooltip/tooltip-popup.html\",\n \"
      \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/tooltip/tooltip-template-popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/tooltip/tooltip-template-popup.html\",\n \"
      \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/popover/popover-html.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/popover/popover-html.html\",\n \"
      \\n\" +\n \"\\n\" +\n \"
      \\n\" +\n \"

      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/popover/popover-template.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/popover/popover-template.html\",\n \"
      \\n\" +\n \"\\n\" +\n \"
      \\n\" +\n \"

      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/popover/popover.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/popover/popover.html\",\n \"
      \\n\" +\n \"\\n\" +\n \"
      \\n\" +\n \"

      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/progressbar/bar.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/progressbar/bar.html\",\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/progressbar/progress.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/progressbar/progress.html\",\n \"
      \");\n}]);\n\nangular.module(\"uib/template/progressbar/progressbar.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/progressbar/progressbar.html\",\n \"
      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/rating/rating.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/rating/rating.html\",\n \"\\n\" +\n \" ({{ $index < value ? '*' : ' ' }})\\n\" +\n \" \\n\" +\n \"\\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/tabs/tab.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/tabs/tab.html\",\n \"
    • \\n\" +\n \" {{heading}}\\n\" +\n \"
    • \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/tabs/tabset.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/tabs/tabset.html\",\n \"
      \\n\" +\n \"
        \\n\" +\n \"
        \\n\" +\n \"
        \\n\" +\n \"
        \\n\" +\n \"
        \\n\" +\n \"
        \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/timepicker/timepicker.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/timepicker/timepicker.html\",\n \"\\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
          
        \\n\" +\n \" \\n\" +\n \" :\\n\" +\n \" \\n\" +\n \" :\\n\" +\n \" \\n\" +\n \"
          
        \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/typeahead/typeahead-match.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/typeahead/typeahead-match.html\",\n \"\\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/typeahead/typeahead-popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/typeahead/typeahead-popup.html\",\n \"
          \\n\" +\n \"
        • \\n\" +\n \"
          \\n\" +\n \"
        • \\n\" +\n \"
        \\n\" +\n \"\");\n}]);\nangular.module('ui.bootstrap.carousel').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibCarouselCss && angular.element(document).find('head').prepend(''); angular.$$uibCarouselCss = true; });\nangular.module('ui.bootstrap.datepicker').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibDatepickerCss && angular.element(document).find('head').prepend(''); angular.$$uibDatepickerCss = true; });\nangular.module('ui.bootstrap.position').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibPositionCss && angular.element(document).find('head').prepend(''); angular.$$uibPositionCss = true; });\nangular.module('ui.bootstrap.datepickerPopup').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibDatepickerpopupCss && angular.element(document).find('head').prepend(''); angular.$$uibDatepickerpopupCss = true; });\nangular.module('ui.bootstrap.tooltip').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTooltipCss && angular.element(document).find('head').prepend(''); angular.$$uibTooltipCss = true; });\nangular.module('ui.bootstrap.timepicker').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTimepickerCss && angular.element(document).find('head').prepend(''); angular.$$uibTimepickerCss = true; });\nangular.module('ui.bootstrap.typeahead').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTypeaheadCss && angular.element(document).find('head').prepend(''); angular.$$uibTypeaheadCss = true; });\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js?"); /***/ }), /***/ "./node_modules/angular-ui-bootstrap/index.js": /*!****************************************************!*\ !*** ./node_modules/angular-ui-bootstrap/index.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("__webpack_require__(/*! ./dist/ui-bootstrap-tpls */ \"./node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js\");\n\nmodule.exports = 'ui.bootstrap';\n\n\n//# sourceURL=webpack://delivery-tool-frontend/./node_modules/angular-ui-bootstrap/index.js?"); /***/ }), /***/ "./node_modules/angular/angular.js": /*!*****************************************!*\ !*** ./node_modules/angular/angular.js ***! \*****************************************/ /***/ (() => { eval("/**\n * @license AngularJS v1.5.8\n * (c) 2010-2016 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window) {'use strict';\n\n/**\n * @description\n *\n * This object provides a utility for producing rich Error messages within\n * Angular. It can be called as follows:\n *\n * var exampleMinErr = minErr('example');\n * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);\n *\n * The above creates an instance of minErr in the example namespace. The\n * resulting error will have a namespaced error code of example.one. The\n * resulting error will replace {0} with the value of foo, and {1} with the\n * value of bar. The object is not restricted in the number of arguments it can\n * take.\n *\n * If fewer arguments are specified than necessary for interpolation, the extra\n * interpolation markers will be preserved in the final string.\n *\n * Since data will be parsed statically during a build step, some restrictions\n * are applied with respect to how minErr instances are created and called.\n * Instances should have names of the form namespaceMinErr for a minErr created\n * using minErr('namespace') . Error codes, namespaces and template strings\n * should all be static strings, not variables or general expressions.\n *\n * @param {string} module The namespace to use for the new minErr instance.\n * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning\n * error from returned function, for cases when a particular type of error is useful.\n * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance\n */\n\nfunction minErr(module, ErrorConstructor) {\n ErrorConstructor = ErrorConstructor || Error;\n return function() {\n var SKIP_INDEXES = 2;\n\n var templateArgs = arguments,\n code = templateArgs[0],\n message = '[' + (module ? module + ':' : '') + code + '] ',\n template = templateArgs[1],\n paramPrefix, i;\n\n message += template.replace(/\\{\\d+\\}/g, function(match) {\n var index = +match.slice(1, -1),\n shiftedIndex = index + SKIP_INDEXES;\n\n if (shiftedIndex < templateArgs.length) {\n return toDebugString(templateArgs[shiftedIndex]);\n }\n\n return match;\n });\n\n message += '\\nhttp://errors.angularjs.org/1.5.8/' +\n (module ? module + '/' : '') + code;\n\n for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {\n message += paramPrefix + 'p' + (i - SKIP_INDEXES) + '=' +\n encodeURIComponent(toDebugString(templateArgs[i]));\n }\n\n return new ErrorConstructor(message);\n };\n}\n\n/* We need to tell jshint what variables are being exported */\n/* global angular: true,\n msie: true,\n jqLite: true,\n jQuery: true,\n slice: true,\n splice: true,\n push: true,\n toString: true,\n ngMinErr: true,\n angularModule: true,\n uid: true,\n REGEX_STRING_REGEXP: true,\n VALIDITY_STATE_PROPERTY: true,\n\n lowercase: true,\n uppercase: true,\n manualLowercase: true,\n manualUppercase: true,\n nodeName_: true,\n isArrayLike: true,\n forEach: true,\n forEachSorted: true,\n reverseParams: true,\n nextUid: true,\n setHashKey: true,\n extend: true,\n toInt: true,\n inherit: true,\n merge: true,\n noop: true,\n identity: true,\n valueFn: true,\n isUndefined: true,\n isDefined: true,\n isObject: true,\n isBlankObject: true,\n isString: true,\n isNumber: true,\n isDate: true,\n isArray: true,\n isFunction: true,\n isRegExp: true,\n isWindow: true,\n isScope: true,\n isFile: true,\n isFormData: true,\n isBlob: true,\n isBoolean: true,\n isPromiseLike: true,\n trim: true,\n escapeForRegexp: true,\n isElement: true,\n makeMap: true,\n includes: true,\n arrayRemove: true,\n copy: true,\n equals: true,\n csp: true,\n jq: true,\n concat: true,\n sliceArgs: true,\n bind: true,\n toJsonReplacer: true,\n toJson: true,\n fromJson: true,\n convertTimezoneToLocal: true,\n timezoneToOffset: true,\n startingTag: true,\n tryDecodeURIComponent: true,\n parseKeyValue: true,\n toKeyValue: true,\n encodeUriSegment: true,\n encodeUriQuery: true,\n angularInit: true,\n bootstrap: true,\n getTestability: true,\n snake_case: true,\n bindJQuery: true,\n assertArg: true,\n assertArgFn: true,\n assertNotHasOwnProperty: true,\n getter: true,\n getBlockNodes: true,\n hasOwnProperty: true,\n createMap: true,\n\n NODE_TYPE_ELEMENT: true,\n NODE_TYPE_ATTRIBUTE: true,\n NODE_TYPE_TEXT: true,\n NODE_TYPE_COMMENT: true,\n NODE_TYPE_DOCUMENT: true,\n NODE_TYPE_DOCUMENT_FRAGMENT: true,\n*/\n\n////////////////////////////////////\n\n/**\n * @ngdoc module\n * @name ng\n * @module ng\n * @installation\n * @description\n *\n * # ng (core module)\n * The ng module is loaded by default when an AngularJS application is started. The module itself\n * contains the essential components for an AngularJS application to function. The table below\n * lists a high level breakdown of each of the services/factories, filters, directives and testing\n * components available within this core module.\n *\n *
        \n */\n\nvar REGEX_STRING_REGEXP = /^\\/(.+)\\/([a-z]*)$/;\n\n// The name of a form control's ValidityState property.\n// This is used so that it's possible for internal tests to create mock ValidityStates.\nvar VALIDITY_STATE_PROPERTY = 'validity';\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};\nvar uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};\n\n\nvar manualLowercase = function(s) {\n /* jshint bitwise: false */\n return isString(s)\n ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})\n : s;\n};\nvar manualUppercase = function(s) {\n /* jshint bitwise: false */\n return isString(s)\n ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})\n : s;\n};\n\n\n// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish\n// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods\n// with correct but slower alternatives. See https://github.com/angular/angular.js/issues/11387\nif ('i' !== 'I'.toLowerCase()) {\n lowercase = manualLowercase;\n uppercase = manualUppercase;\n}\n\n\nvar\n msie, // holds major version number for IE, or NaN if UA is not IE.\n jqLite, // delay binding since jQuery could be loaded after us.\n jQuery, // delay binding\n slice = [].slice,\n splice = [].splice,\n push = [].push,\n toString = Object.prototype.toString,\n getPrototypeOf = Object.getPrototypeOf,\n ngMinErr = minErr('ng'),\n\n /** @name angular */\n angular = window.angular || (window.angular = {}),\n angularModule,\n uid = 0;\n\n/**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\nmsie = window.document.documentMode;\n\n\n/**\n * @private\n * @param {*} obj\n * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,\n * String ...)\n */\nfunction isArrayLike(obj) {\n\n // `null`, `undefined` and `window` are not array-like\n if (obj == null || isWindow(obj)) return false;\n\n // arrays, strings and jQuery/jqLite objects are array like\n // * jqLite is either the jQuery or jqLite constructor function\n // * we have to check the existence of jqLite first as this method is called\n // via the forEach method when constructing the jqLite object in the first place\n if (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite)) return true;\n\n // Support: iOS 8.2 (not reproducible in simulator)\n // \"length\" in obj used to prevent JIT error (gh-11508)\n var length = \"length\" in Object(obj) && obj.length;\n\n // NodeList objects (with `item` method) and\n // other objects with suitable length characteristics are array-like\n return isNumber(length) &&\n (length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item == 'function');\n\n}\n\n/**\n * @ngdoc function\n * @name angular.forEach\n * @module ng\n * @kind function\n *\n * @description\n * Invokes the `iterator` function once for each item in `obj` collection, which can be either an\n * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`\n * is the value of an object property or an array element, `key` is the object property key or\n * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.\n *\n * It is worth noting that `.forEach` does not iterate over inherited properties because it filters\n * using the `hasOwnProperty` method.\n *\n * Unlike ES262's\n * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),\n * providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just\n * return the value provided.\n *\n ```js\n var values = {name: 'misko', gender: 'male'};\n var log = [];\n angular.forEach(values, function(value, key) {\n this.push(key + ': ' + value);\n }, log);\n expect(log).toEqual(['name: misko', 'gender: male']);\n ```\n *\n * @param {Object|Array} obj Object to iterate over.\n * @param {Function} iterator Iterator function.\n * @param {Object=} context Object to become context (`this`) for the iterator function.\n * @returns {Object|Array} Reference to `obj`.\n */\n\nfunction forEach(obj, iterator, context) {\n var key, length;\n if (obj) {\n if (isFunction(obj)) {\n for (key in obj) {\n // Need to check if hasOwnProperty exists,\n // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function\n if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (isArray(obj) || isArrayLike(obj)) {\n var isPrimitive = typeof obj !== 'object';\n for (key = 0, length = obj.length; key < length; key++) {\n if (isPrimitive || key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (obj.forEach && obj.forEach !== forEach) {\n obj.forEach(iterator, context, obj);\n } else if (isBlankObject(obj)) {\n // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n for (key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n } else if (typeof obj.hasOwnProperty === 'function') {\n // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else {\n // Slow path for objects which do not have a method `hasOwnProperty`\n for (key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n }\n }\n return obj;\n}\n\nfunction forEachSorted(obj, iterator, context) {\n var keys = Object.keys(obj).sort();\n for (var i = 0; i < keys.length; i++) {\n iterator.call(context, obj[keys[i]], keys[i]);\n }\n return keys;\n}\n\n\n/**\n * when using forEach the params are value, key, but it is often useful to have key, value.\n * @param {function(string, *)} iteratorFn\n * @returns {function(*, string)}\n */\nfunction reverseParams(iteratorFn) {\n return function(value, key) {iteratorFn(key, value);};\n}\n\n/**\n * A consistent way of creating unique IDs in angular.\n *\n * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before\n * we hit number precision issues in JavaScript.\n *\n * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M\n *\n * @returns {number} an unique alpha-numeric string\n */\nfunction nextUid() {\n return ++uid;\n}\n\n\n/**\n * Set or clear the hashkey for an object.\n * @param obj object\n * @param h the hashkey (!truthy to delete the hashkey)\n */\nfunction setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n } else {\n delete obj.$$hashKey;\n }\n}\n\n\nfunction baseExtend(dst, objs, deep) {\n var h = dst.$$hashKey;\n\n for (var i = 0, ii = objs.length; i < ii; ++i) {\n var obj = objs[i];\n if (!isObject(obj) && !isFunction(obj)) continue;\n var keys = Object.keys(obj);\n for (var j = 0, jj = keys.length; j < jj; j++) {\n var key = keys[j];\n var src = obj[key];\n\n if (deep && isObject(src)) {\n if (isDate(src)) {\n dst[key] = new Date(src.valueOf());\n } else if (isRegExp(src)) {\n dst[key] = new RegExp(src);\n } else if (src.nodeName) {\n dst[key] = src.cloneNode(true);\n } else if (isElement(src)) {\n dst[key] = src.clone();\n } else {\n if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};\n baseExtend(dst[key], [src], true);\n }\n } else {\n dst[key] = src;\n }\n }\n }\n\n setHashKey(dst, h);\n return dst;\n}\n\n/**\n * @ngdoc function\n * @name angular.extend\n * @module ng\n * @kind function\n *\n * @description\n * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.\n *\n * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use\n * {@link angular.merge} for this.\n *\n * @param {Object} dst Destination object.\n * @param {...Object} src Source object(s).\n * @returns {Object} Reference to `dst`.\n */\nfunction extend(dst) {\n return baseExtend(dst, slice.call(arguments, 1), false);\n}\n\n\n/**\n* @ngdoc function\n* @name angular.merge\n* @module ng\n* @kind function\n*\n* @description\n* Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n* to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n* by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`.\n*\n* Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source\n* objects, performing a deep copy.\n*\n* @param {Object} dst Destination object.\n* @param {...Object} src Source object(s).\n* @returns {Object} Reference to `dst`.\n*/\nfunction merge(dst) {\n return baseExtend(dst, slice.call(arguments, 1), true);\n}\n\n\n\nfunction toInt(str) {\n return parseInt(str, 10);\n}\n\n\nfunction inherit(parent, extra) {\n return extend(Object.create(parent), extra);\n}\n\n/**\n * @ngdoc function\n * @name angular.noop\n * @module ng\n * @kind function\n *\n * @description\n * A function that performs no operations. This function can be useful when writing code in the\n * functional style.\n ```js\n function foo(callback) {\n var result = calculateResult();\n (callback || angular.noop)(result);\n }\n ```\n */\nfunction noop() {}\nnoop.$inject = [];\n\n\n/**\n * @ngdoc function\n * @name angular.identity\n * @module ng\n * @kind function\n *\n * @description\n * A function that returns its first argument. This function is useful when writing code in the\n * functional style.\n *\n ```js\n function transformer(transformationFn, value) {\n return (transformationFn || angular.identity)(value);\n };\n\n // E.g.\n function getResult(fn, input) {\n return (fn || angular.identity)(input);\n };\n\n getResult(function(n) { return n * 2; }, 21); // returns 42\n getResult(null, 21); // returns 21\n getResult(undefined, 21); // returns 21\n ```\n *\n * @param {*} value to be returned.\n * @returns {*} the value passed in.\n */\nfunction identity($) {return $;}\nidentity.$inject = [];\n\n\nfunction valueFn(value) {return function valueRef() {return value;};}\n\nfunction hasCustomToString(obj) {\n return isFunction(obj.toString) && obj.toString !== toString;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isUndefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is undefined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is undefined.\n */\nfunction isUndefined(value) {return typeof value === 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is defined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is defined.\n */\nfunction isDefined(value) {return typeof value !== 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isObject\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not\n * considered to be objects. Note that JavaScript arrays are objects.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Object` but not `null`.\n */\nfunction isObject(value) {\n // http://jsperf.com/isobject4\n return value !== null && typeof value === 'object';\n}\n\n\n/**\n * Determine if a value is an object with a null prototype\n *\n * @returns {boolean} True if `value` is an `Object` with a null prototype\n */\nfunction isBlankObject(value) {\n return value !== null && typeof value === 'object' && !getPrototypeOf(value);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isString\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `String`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `String`.\n */\nfunction isString(value) {return typeof value === 'string';}\n\n\n/**\n * @ngdoc function\n * @name angular.isNumber\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Number`.\n *\n * This includes the \"special\" numbers `NaN`, `+Infinity` and `-Infinity`.\n *\n * If you wish to exclude these then you can use the native\n * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)\n * method.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Number`.\n */\nfunction isNumber(value) {return typeof value === 'number';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDate\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a value is a date.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Date`.\n */\nfunction isDate(value) {\n return toString.call(value) === '[object Date]';\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isArray\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Array`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Array`.\n */\nvar isArray = Array.isArray;\n\n/**\n * @ngdoc function\n * @name angular.isFunction\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Function`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Function`.\n */\nfunction isFunction(value) {return typeof value === 'function';}\n\n\n/**\n * Determines if a value is a regular expression object.\n *\n * @private\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `RegExp`.\n */\nfunction isRegExp(value) {\n return toString.call(value) === '[object RegExp]';\n}\n\n\n/**\n * Checks if `obj` is a window object.\n *\n * @private\n * @param {*} obj Object to check\n * @returns {boolean} True if `obj` is a window obj.\n */\nfunction isWindow(obj) {\n return obj && obj.window === obj;\n}\n\n\nfunction isScope(obj) {\n return obj && obj.$evalAsync && obj.$watch;\n}\n\n\nfunction isFile(obj) {\n return toString.call(obj) === '[object File]';\n}\n\n\nfunction isFormData(obj) {\n return toString.call(obj) === '[object FormData]';\n}\n\n\nfunction isBlob(obj) {\n return toString.call(obj) === '[object Blob]';\n}\n\n\nfunction isBoolean(value) {\n return typeof value === 'boolean';\n}\n\n\nfunction isPromiseLike(obj) {\n return obj && isFunction(obj.then);\n}\n\n\nvar TYPED_ARRAY_REGEXP = /^\\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\\]$/;\nfunction isTypedArray(value) {\n return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value));\n}\n\nfunction isArrayBuffer(obj) {\n return toString.call(obj) === '[object ArrayBuffer]';\n}\n\n\nvar trim = function(value) {\n return isString(value) ? value.trim() : value;\n};\n\n// Copied from:\n// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021\n// Prereq: s is a string.\nvar escapeForRegexp = function(s) {\n return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#= 0) {\n array.splice(index, 1);\n }\n return index;\n}\n\n/**\n * @ngdoc function\n * @name angular.copy\n * @module ng\n * @kind function\n *\n * @description\n * Creates a deep copy of `source`, which should be an object or an array.\n *\n * * If no destination is supplied, a copy of the object or array is created.\n * * If a destination is provided, all of its elements (for arrays) or properties (for objects)\n * are deleted and then all elements/properties from the source are copied to it.\n * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.\n * * If `source` is identical to `destination` an exception will be thrown.\n *\n *
        \n *
        \n * Only enumerable properties are taken into account. Non-enumerable properties (both on `source`\n * and on `destination`) will be ignored.\n *
        \n *\n * @param {*} source The source that will be used to make a copy.\n * Can be any type, including primitives, `null`, and `undefined`.\n * @param {(Object|Array)=} destination Destination into which the source is copied. If\n * provided, must be of the same type as `source`.\n * @returns {*} The copy or updated `destination`, if `destination` was specified.\n *\n * @example\n \n \n
        \n
        \n
        \n
        \n Gender: \n
        \n \n \n
        \n
        form = {{user | json}}
        \n
        master = {{master | json}}
        \n
        \n
        \n \n // Module: copyExample\n angular.\n module('copyExample', []).\n controller('ExampleController', ['$scope', function($scope) {\n $scope.master = {};\n\n $scope.reset = function() {\n // Example with 1 argument\n $scope.user = angular.copy($scope.master);\n };\n\n $scope.update = function(user) {\n // Example with 2 arguments\n angular.copy(user, $scope.master);\n };\n\n $scope.reset();\n }]);\n \n
        \n */\nfunction copy(source, destination) {\n var stackSource = [];\n var stackDest = [];\n\n if (destination) {\n if (isTypedArray(destination) || isArrayBuffer(destination)) {\n throw ngMinErr('cpta', \"Can't copy! TypedArray destination cannot be mutated.\");\n }\n if (source === destination) {\n throw ngMinErr('cpi', \"Can't copy! Source and destination are identical.\");\n }\n\n // Empty the destination object\n if (isArray(destination)) {\n destination.length = 0;\n } else {\n forEach(destination, function(value, key) {\n if (key !== '$$hashKey') {\n delete destination[key];\n }\n });\n }\n\n stackSource.push(source);\n stackDest.push(destination);\n return copyRecurse(source, destination);\n }\n\n return copyElement(source);\n\n function copyRecurse(source, destination) {\n var h = destination.$$hashKey;\n var key;\n if (isArray(source)) {\n for (var i = 0, ii = source.length; i < ii; i++) {\n destination.push(copyElement(source[i]));\n }\n } else if (isBlankObject(source)) {\n // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n for (key in source) {\n destination[key] = copyElement(source[key]);\n }\n } else if (source && typeof source.hasOwnProperty === 'function') {\n // Slow path, which must rely on hasOwnProperty\n for (key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = copyElement(source[key]);\n }\n }\n } else {\n // Slowest path --- hasOwnProperty can't be called as a method\n for (key in source) {\n if (hasOwnProperty.call(source, key)) {\n destination[key] = copyElement(source[key]);\n }\n }\n }\n setHashKey(destination, h);\n return destination;\n }\n\n function copyElement(source) {\n // Simple values\n if (!isObject(source)) {\n return source;\n }\n\n // Already copied values\n var index = stackSource.indexOf(source);\n if (index !== -1) {\n return stackDest[index];\n }\n\n if (isWindow(source) || isScope(source)) {\n throw ngMinErr('cpws',\n \"Can't copy! Making copies of Window or Scope instances is not supported.\");\n }\n\n var needsRecurse = false;\n var destination = copyType(source);\n\n if (destination === undefined) {\n destination = isArray(source) ? [] : Object.create(getPrototypeOf(source));\n needsRecurse = true;\n }\n\n stackSource.push(source);\n stackDest.push(destination);\n\n return needsRecurse\n ? copyRecurse(source, destination)\n : destination;\n }\n\n function copyType(source) {\n switch (toString.call(source)) {\n case '[object Int8Array]':\n case '[object Int16Array]':\n case '[object Int32Array]':\n case '[object Float32Array]':\n case '[object Float64Array]':\n case '[object Uint8Array]':\n case '[object Uint8ClampedArray]':\n case '[object Uint16Array]':\n case '[object Uint32Array]':\n return new source.constructor(copyElement(source.buffer), source.byteOffset, source.length);\n\n case '[object ArrayBuffer]':\n //Support: IE10\n if (!source.slice) {\n var copied = new ArrayBuffer(source.byteLength);\n new Uint8Array(copied).set(new Uint8Array(source));\n return copied;\n }\n return source.slice(0);\n\n case '[object Boolean]':\n case '[object Number]':\n case '[object String]':\n case '[object Date]':\n return new source.constructor(source.valueOf());\n\n case '[object RegExp]':\n var re = new RegExp(source.source, source.toString().match(/[^\\/]*$/)[0]);\n re.lastIndex = source.lastIndex;\n return re;\n\n case '[object Blob]':\n return new source.constructor([source], {type: source.type});\n }\n\n if (isFunction(source.cloneNode)) {\n return source.cloneNode(true);\n }\n }\n}\n\n\n/**\n * @ngdoc function\n * @name angular.equals\n * @module ng\n * @kind function\n *\n * @description\n * Determines if two objects or two values are equivalent. Supports value types, regular\n * expressions, arrays and objects.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n * comparing them with `angular.equals`.\n * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)\n * * Both values represent the same regular expression (In JavaScript,\n * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual\n * representation matches).\n *\n * During a property comparison, properties of `function` type and properties with names\n * that begin with `$` are ignored.\n *\n * Scope and DOMWindow objects are being compared only by identify (`===`).\n *\n * @param {*} o1 Object or value to compare.\n * @param {*} o2 Object or value to compare.\n * @returns {boolean} True if arguments are equal.\n *\n * @example\n \n \n
        \n
        \n

        User 1

        \n Name: \n Age: \n\n

        User 2

        \n Name: \n Age: \n\n
        \n
        \n \n
        \n User 1:
        {{user1 | json}}
        \n User 2:
        {{user2 | json}}
        \n Equal:
        {{result}}
        \n
        \n
        \n
        \n \n angular.module('equalsExample', []).controller('ExampleController', ['$scope', function($scope) {\n $scope.user1 = {};\n $scope.user2 = {};\n $scope.result;\n $scope.compare = function() {\n $scope.result = angular.equals($scope.user1, $scope.user2);\n };\n }]);\n \n
        \n */\nfunction equals(o1, o2) {\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n if (t1 == t2 && t1 == 'object') {\n if (isArray(o1)) {\n if (!isArray(o2)) return false;\n if ((length = o1.length) == o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else if (isDate(o1)) {\n if (!isDate(o2)) return false;\n return equals(o1.getTime(), o2.getTime());\n } else if (isRegExp(o1)) {\n if (!isRegExp(o2)) return false;\n return o1.toString() == o2.toString();\n } else {\n if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||\n isArray(o2) || isDate(o2) || isRegExp(o2)) return false;\n keySet = createMap();\n for (key in o1) {\n if (key.charAt(0) === '$' || isFunction(o1[key])) continue;\n if (!equals(o1[key], o2[key])) return false;\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) &&\n key.charAt(0) !== '$' &&\n isDefined(o2[key]) &&\n !isFunction(o2[key])) return false;\n }\n return true;\n }\n }\n return false;\n}\n\nvar csp = function() {\n if (!isDefined(csp.rules)) {\n\n\n var ngCspElement = (window.document.querySelector('[ng-csp]') ||\n window.document.querySelector('[data-ng-csp]'));\n\n if (ngCspElement) {\n var ngCspAttribute = ngCspElement.getAttribute('ng-csp') ||\n ngCspElement.getAttribute('data-ng-csp');\n csp.rules = {\n noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1),\n noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1)\n };\n } else {\n csp.rules = {\n noUnsafeEval: noUnsafeEval(),\n noInlineStyle: false\n };\n }\n }\n\n return csp.rules;\n\n function noUnsafeEval() {\n try {\n /* jshint -W031, -W054 */\n new Function('');\n /* jshint +W031, +W054 */\n return false;\n } catch (e) {\n return true;\n }\n }\n};\n\n/**\n * @ngdoc directive\n * @module ng\n * @name ngJq\n *\n * @element ANY\n * @param {string=} ngJq the name of the library available under `window`\n * to be used for angular.element\n * @description\n * Use this directive to force the angular.element library. This should be\n * used to force either jqLite by leaving ng-jq blank or setting the name of\n * the jquery variable under window (eg. jQuery).\n *\n * Since angular looks for this directive when it is loaded (doesn't wait for the\n * DOMContentLoaded event), it must be placed on an element that comes before the script\n * which loads angular. Also, only the first instance of `ng-jq` will be used and all\n * others ignored.\n *\n * @example\n * This example shows how to force jqLite using the `ngJq` directive to the `html` tag.\n ```html\n \n \n ...\n ...\n \n ```\n * @example\n * This example shows how to use a jQuery based library of a different name.\n * The library name must be available at the top most 'window'.\n ```html\n \n \n ...\n ...\n \n ```\n */\nvar jq = function() {\n if (isDefined(jq.name_)) return jq.name_;\n var el;\n var i, ii = ngAttrPrefixes.length, prefix, name;\n for (i = 0; i < ii; ++i) {\n prefix = ngAttrPrefixes[i];\n if (el = window.document.querySelector('[' + prefix.replace(':', '\\\\:') + 'jq]')) {\n name = el.getAttribute(prefix + 'jq');\n break;\n }\n }\n\n return (jq.name_ = name);\n};\n\nfunction concat(array1, array2, index) {\n return array1.concat(slice.call(array2, index));\n}\n\nfunction sliceArgs(args, startIndex) {\n return slice.call(args, startIndex || 0);\n}\n\n\n/* jshint -W101 */\n/**\n * @ngdoc function\n * @name angular.bind\n * @module ng\n * @kind function\n *\n * @description\n * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for\n * `fn`). You can supply optional `args` that are prebound to the function. This feature is also\n * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as\n * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).\n *\n * @param {Object} self Context which `fn` should be evaluated in.\n * @param {function()} fn Function to be bound.\n * @param {...*} args Optional arguments to be prebound to the `fn` function call.\n * @returns {function()} Function that wraps the `fn` with all the specified bindings.\n */\n/* jshint +W101 */\nfunction bind(self, fn) {\n var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];\n if (isFunction(fn) && !(fn instanceof RegExp)) {\n return curryArgs.length\n ? function() {\n return arguments.length\n ? fn.apply(self, concat(curryArgs, arguments, 0))\n : fn.apply(self, curryArgs);\n }\n : function() {\n return arguments.length\n ? fn.apply(self, arguments)\n : fn.call(self);\n };\n } else {\n // In IE, native methods are not functions so they cannot be bound (note: they don't need to be).\n return fn;\n }\n}\n\n\nfunction toJsonReplacer(key, value) {\n var val = value;\n\n if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {\n val = undefined;\n } else if (isWindow(value)) {\n val = '$WINDOW';\n } else if (value && window.document === value) {\n val = '$DOCUMENT';\n } else if (isScope(value)) {\n val = '$SCOPE';\n }\n\n return val;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.toJson\n * @module ng\n * @kind function\n *\n * @description\n * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be\n * stripped since angular uses this notation internally.\n *\n * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.\n * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.\n * If set to an integer, the JSON output will contain that many spaces per indentation.\n * @returns {string|undefined} JSON-ified string representing `obj`.\n * @knownIssue\n *\n * The Safari browser throws a `RangeError` instead of returning `null` when it tries to stringify a `Date`\n * object with an invalid date value. The only reliable way to prevent this is to monkeypatch the\n * `Date.prototype.toJSON` method as follows:\n *\n * ```\n * var _DatetoJSON = Date.prototype.toJSON;\n * Date.prototype.toJSON = function() {\n * try {\n * return _DatetoJSON.call(this);\n * } catch(e) {\n * if (e instanceof RangeError) {\n * return null;\n * }\n * throw e;\n * }\n * };\n * ```\n *\n * See https://github.com/angular/angular.js/pull/14221 for more information.\n */\nfunction toJson(obj, pretty) {\n if (isUndefined(obj)) return undefined;\n if (!isNumber(pretty)) {\n pretty = pretty ? 2 : null;\n }\n return JSON.stringify(obj, toJsonReplacer, pretty);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.fromJson\n * @module ng\n * @kind function\n *\n * @description\n * Deserializes a JSON string.\n *\n * @param {string} json JSON string to deserialize.\n * @returns {Object|Array|string|number} Deserialized JSON string.\n */\nfunction fromJson(json) {\n return isString(json)\n ? JSON.parse(json)\n : json;\n}\n\n\nvar ALL_COLONS = /:/g;\nfunction timezoneToOffset(timezone, fallback) {\n // IE/Edge do not \"understand\" colon (`:`) in timezone\n timezone = timezone.replace(ALL_COLONS, '');\n var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n}\n\n\nfunction addDateMinutes(date, minutes) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n}\n\n\nfunction convertTimezoneToLocal(date, timezone, reverse) {\n reverse = reverse ? -1 : 1;\n var dateTimezoneOffset = date.getTimezoneOffset();\n var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));\n}\n\n\n/**\n * @returns {string} Returns the string representation of the element.\n */\nfunction startingTag(element) {\n element = jqLite(element).clone();\n try {\n // turns out IE does not let you set .html() on elements which\n // are not allowed to have children. So we just ignore it.\n element.empty();\n } catch (e) {}\n var elemHtml = jqLite('
        ').append(element).html();\n try {\n return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :\n elemHtml.\n match(/^(<[^>]+>)/)[1].\n replace(/^<([\\w\\-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);});\n } catch (e) {\n return lowercase(elemHtml);\n }\n\n}\n\n\n/////////////////////////////////////////////////\n\n/**\n * Tries to decode the URI component without throwing an exception.\n *\n * @private\n * @param str value potential URI component to check.\n * @returns {boolean} True if `value` can be decoded\n * with the decodeURIComponent function.\n */\nfunction tryDecodeURIComponent(value) {\n try {\n return decodeURIComponent(value);\n } catch (e) {\n // Ignore any invalid uri component.\n }\n}\n\n\n/**\n * Parses an escaped url query string into key-value pairs.\n * @returns {Object.}\n */\nfunction parseKeyValue(/**string*/keyValue) {\n var obj = {};\n forEach((keyValue || \"\").split('&'), function(keyValue) {\n var splitPoint, key, val;\n if (keyValue) {\n key = keyValue = keyValue.replace(/\\+/g,'%20');\n splitPoint = keyValue.indexOf('=');\n if (splitPoint !== -1) {\n key = keyValue.substring(0, splitPoint);\n val = keyValue.substring(splitPoint + 1);\n }\n key = tryDecodeURIComponent(key);\n if (isDefined(key)) {\n val = isDefined(val) ? tryDecodeURIComponent(val) : true;\n if (!hasOwnProperty.call(obj, key)) {\n obj[key] = val;\n } else if (isArray(obj[key])) {\n obj[key].push(val);\n } else {\n obj[key] = [obj[key],val];\n }\n }\n }\n });\n return obj;\n}\n\nfunction toKeyValue(obj) {\n var parts = [];\n forEach(obj, function(value, key) {\n if (isArray(value)) {\n forEach(value, function(arrayValue) {\n parts.push(encodeUriQuery(key, true) +\n (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));\n });\n } else {\n parts.push(encodeUriQuery(key, true) +\n (value === true ? '' : '=' + encodeUriQuery(value, true)));\n }\n });\n return parts.length ? parts.join('&') : '';\n}\n\n\n/**\n * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path\n * segments:\n * segment = *pchar\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n}\n\n\n/**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n * query = *( pchar / \"/\" / \"?\" )\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}\n\nvar ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];\n\nfunction getNgAttribute(element, ngAttr) {\n var attr, i, ii = ngAttrPrefixes.length;\n for (i = 0; i < ii; ++i) {\n attr = ngAttrPrefixes[i] + ngAttr;\n if (isString(attr = element.getAttribute(attr))) {\n return attr;\n }\n }\n return null;\n}\n\n/**\n * @ngdoc directive\n * @name ngApp\n * @module ng\n *\n * @element ANY\n * @param {angular.Module} ngApp an optional application\n * {@link angular.module module} name to load.\n * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be\n * created in \"strict-di\" mode. This means that the application will fail to invoke functions which\n * do not use explicit function annotation (and are thus unsuitable for minification), as described\n * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in\n * tracking down the root of these bugs.\n *\n * @description\n *\n * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive\n * designates the **root element** of the application and is typically placed near the root element\n * of the page - e.g. on the `` or `` tags.\n *\n * There are a few things to keep in mind when using `ngApp`:\n * - only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`\n * found in the document will be used to define the root element to auto-bootstrap as an\n * application. To run multiple applications in an HTML document you must manually bootstrap them using\n * {@link angular.bootstrap} instead.\n * - AngularJS applications cannot be nested within each other.\n * - Do not use a directive that uses {@link ng.$compile#transclusion transclusion} on the same element as `ngApp`.\n * This includes directives such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and\n * {@link ngRoute.ngView `ngView`}.\n * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},\n * causing animations to stop working and making the injector inaccessible from outside the app.\n *\n * You can specify an **AngularJS module** to be used as the root module for the application. This\n * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It\n * should contain the application code needed or have dependencies on other modules that will\n * contain the code. See {@link angular.module} for more information.\n *\n * In the example below if the `ngApp` directive were not placed on the `html` element then the\n * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`\n * would not be resolved to `3`.\n *\n * `ngApp` is the easiest, and most common way to bootstrap an application.\n *\n \n \n
        \n I can add: {{a}} + {{b}} = {{ a+b }}\n
        \n
        \n \n angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n });\n \n
        \n *\n * Using `ngStrictDi`, you would see something like this:\n *\n \n \n
        \n
        \n I can add: {{a}} + {{b}} = {{ a+b }}\n\n

        This renders because the controller does not fail to\n instantiate, by using explicit annotation style (see\n script.js for details)\n

        \n
        \n\n
        \n Name:
        \n Hello, {{name}}!\n\n

        This renders because the controller does not fail to\n instantiate, by using explicit annotation style\n (see script.js for details)\n

        \n
        \n\n
        \n I can add: {{a}} + {{b}} = {{ a+b }}\n\n

        The controller could not be instantiated, due to relying\n on automatic function annotations (which are disabled in\n strict mode). As such, the content of this section is not\n interpolated, and there should be an error in your web console.\n

        \n
        \n
        \n
        \n \n angular.module('ngAppStrictDemo', [])\n // BadController will fail to instantiate, due to relying on automatic function annotation,\n // rather than an explicit annotation\n .controller('BadController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n })\n // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,\n // due to using explicit annotations using the array style and $inject property, respectively.\n .controller('GoodController1', ['$scope', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n }])\n .controller('GoodController2', GoodController2);\n function GoodController2($scope) {\n $scope.name = \"World\";\n }\n GoodController2.$inject = ['$scope'];\n \n \n div[ng-controller] {\n margin-bottom: 1em;\n -webkit-border-radius: 4px;\n border-radius: 4px;\n border: 1px solid;\n padding: .5em;\n }\n div[ng-controller^=Good] {\n border-color: #d6e9c6;\n background-color: #dff0d8;\n color: #3c763d;\n }\n div[ng-controller^=Bad] {\n border-color: #ebccd1;\n background-color: #f2dede;\n color: #a94442;\n margin-bottom: 0;\n }\n \n
        \n */\nfunction angularInit(element, bootstrap) {\n var appElement,\n module,\n config = {};\n\n // The element `element` has priority over any other element.\n forEach(ngAttrPrefixes, function(prefix) {\n var name = prefix + 'app';\n\n if (!appElement && element.hasAttribute && element.hasAttribute(name)) {\n appElement = element;\n module = element.getAttribute(name);\n }\n });\n forEach(ngAttrPrefixes, function(prefix) {\n var name = prefix + 'app';\n var candidate;\n\n if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\\\:') + ']'))) {\n appElement = candidate;\n module = candidate.getAttribute(name);\n }\n });\n if (appElement) {\n config.strictDi = getNgAttribute(appElement, \"strict-di\") !== null;\n bootstrap(appElement, module ? [module] : [], config);\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.bootstrap\n * @module ng\n * @description\n * Use this function to manually start up angular application.\n *\n * For more information, see the {@link guide/bootstrap Bootstrap guide}.\n *\n * Angular will detect if it has been loaded into the browser more than once and only allow the\n * first loaded script to be bootstrapped and will report a warning to the browser console for\n * each of the subsequent scripts. This prevents strange results in applications, where otherwise\n * multiple instances of Angular try to work on the DOM.\n *\n *
        \n * **Note:** Protractor based end-to-end tests cannot use this function to bootstrap manually.\n * They must use {@link ng.directive:ngApp ngApp}.\n *
        \n *\n *
        \n * **Note:** Do not bootstrap the app on an element with a directive that uses {@link ng.$compile#transclusion transclusion},\n * such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and {@link ngRoute.ngView `ngView`}.\n * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},\n * causing animations to stop working and making the injector inaccessible from outside the app.\n *
        \n *\n * ```html\n * \n * \n * \n *
        \n * {{greeting}}\n *
        \n *\n * \n * \n * \n * \n * ```\n *\n * @param {DOMElement} element DOM element which is the root of angular application.\n * @param {Array=} modules an array of modules to load into the application.\n * Each item in the array should be the name of a predefined module or a (DI annotated)\n * function that will be invoked by the injector as a `config` block.\n * See: {@link angular.module modules}\n * @param {Object=} config an object for defining configuration options for the application. The\n * following keys are supported:\n *\n * * `strictDi` - disable automatic function annotation for the application. This is meant to\n * assist in finding bugs which break minified code. Defaults to `false`.\n *\n * @returns {auto.$injector} Returns the newly created injector for this app.\n */\nfunction bootstrap(element, modules, config) {\n if (!isObject(config)) config = {};\n var defaultConfig = {\n strictDi: false\n };\n config = extend(defaultConfig, config);\n var doBootstrap = function() {\n element = jqLite(element);\n\n if (element.injector()) {\n var tag = (element[0] === window.document) ? 'document' : startingTag(element);\n // Encode angle brackets to prevent input from being sanitized to empty string #8683.\n throw ngMinErr(\n 'btstrpd',\n \"App already bootstrapped with this element '{0}'\",\n tag.replace(//,'>'));\n }\n\n modules = modules || [];\n modules.unshift(['$provide', function($provide) {\n $provide.value('$rootElement', element);\n }]);\n\n if (config.debugInfoEnabled) {\n // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.\n modules.push(['$compileProvider', function($compileProvider) {\n $compileProvider.debugInfoEnabled(true);\n }]);\n }\n\n modules.unshift('ng');\n var injector = createInjector(modules, config.strictDi);\n injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',\n function bootstrapApply(scope, element, compile, injector) {\n scope.$apply(function() {\n element.data('$injector', injector);\n compile(element)(scope);\n });\n }]\n );\n return injector;\n };\n\n var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;\n var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;\n\n if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {\n config.debugInfoEnabled = true;\n window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');\n }\n\n if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {\n return doBootstrap();\n }\n\n window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');\n angular.resumeBootstrap = function(extraModules) {\n forEach(extraModules, function(module) {\n modules.push(module);\n });\n return doBootstrap();\n };\n\n if (isFunction(angular.resumeDeferredBootstrap)) {\n angular.resumeDeferredBootstrap();\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.reloadWithDebugInfo\n * @module ng\n * @description\n * Use this function to reload the current application with debug information turned on.\n * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.\n *\n * See {@link ng.$compileProvider#debugInfoEnabled} for more.\n */\nfunction reloadWithDebugInfo() {\n window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;\n window.location.reload();\n}\n\n/**\n * @name angular.getTestability\n * @module ng\n * @description\n * Get the testability service for the instance of Angular on the given\n * element.\n * @param {DOMElement} element DOM element which is the root of angular application.\n */\nfunction getTestability(rootElement) {\n var injector = angular.element(rootElement).injector();\n if (!injector) {\n throw ngMinErr('test',\n 'no injector found for element argument to getTestability');\n }\n return injector.get('$$testability');\n}\n\nvar SNAKE_CASE_REGEXP = /[A-Z]/g;\nfunction snake_case(name, separator) {\n separator = separator || '_';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n}\n\nvar bindJQueryFired = false;\nfunction bindJQuery() {\n var originalCleanData;\n\n if (bindJQueryFired) {\n return;\n }\n\n // bind to jQuery if present;\n var jqName = jq();\n jQuery = isUndefined(jqName) ? window.jQuery : // use jQuery (if present)\n !jqName ? undefined : // use jqLite\n window[jqName]; // use jQuery specified by `ngJq`\n\n // Use jQuery if it exists with proper functionality, otherwise default to us.\n // Angular 1.2+ requires jQuery 1.7+ for on()/off() support.\n // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older\n // versions. It will not work for sure with jQuery <1.7, though.\n if (jQuery && jQuery.fn.on) {\n jqLite = jQuery;\n extend(jQuery.fn, {\n scope: JQLitePrototype.scope,\n isolateScope: JQLitePrototype.isolateScope,\n controller: JQLitePrototype.controller,\n injector: JQLitePrototype.injector,\n inheritedData: JQLitePrototype.inheritedData\n });\n\n // All nodes removed from the DOM via various jQuery APIs like .remove()\n // are passed through jQuery.cleanData. Monkey-patch this method to fire\n // the $destroy event on all removed nodes.\n originalCleanData = jQuery.cleanData;\n jQuery.cleanData = function(elems) {\n var events;\n for (var i = 0, elem; (elem = elems[i]) != null; i++) {\n events = jQuery._data(elem, \"events\");\n if (events && events.$destroy) {\n jQuery(elem).triggerHandler('$destroy');\n }\n }\n originalCleanData(elems);\n };\n } else {\n jqLite = JQLite;\n }\n\n angular.element = jqLite;\n\n // Prevent double-proxying.\n bindJQueryFired = true;\n}\n\n/**\n * throw error if the argument is falsy.\n */\nfunction assertArg(arg, name, reason) {\n if (!arg) {\n throw ngMinErr('areq', \"Argument '{0}' is {1}\", (name || '?'), (reason || \"required\"));\n }\n return arg;\n}\n\nfunction assertArgFn(arg, name, acceptArrayAnnotation) {\n if (acceptArrayAnnotation && isArray(arg)) {\n arg = arg[arg.length - 1];\n }\n\n assertArg(isFunction(arg), name, 'not a function, got ' +\n (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));\n return arg;\n}\n\n/**\n * throw error if the name given is hasOwnProperty\n * @param {String} name the name to test\n * @param {String} context the context in which the name is used, such as module or directive\n */\nfunction assertNotHasOwnProperty(name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', \"hasOwnProperty is not a valid {0} name\", context);\n }\n}\n\n/**\n * Return the value accessible from the object by path. Any undefined traversals are ignored\n * @param {Object} obj starting object\n * @param {String} path path to traverse\n * @param {boolean} [bindFnToScope=true]\n * @returns {Object} value as accessible by path\n */\n//TODO(misko): this function needs to be removed\nfunction getter(obj, path, bindFnToScope) {\n if (!path) return obj;\n var keys = path.split('.');\n var key;\n var lastInstance = obj;\n var len = keys.length;\n\n for (var i = 0; i < len; i++) {\n key = keys[i];\n if (obj) {\n obj = (lastInstance = obj)[key];\n }\n }\n if (!bindFnToScope && isFunction(obj)) {\n return bind(lastInstance, obj);\n }\n return obj;\n}\n\n/**\n * Return the DOM siblings between the first and last node in the given array.\n * @param {Array} array like object\n * @returns {Array} the inputted object or a jqLite collection containing the nodes\n */\nfunction getBlockNodes(nodes) {\n // TODO(perf): update `nodes` instead of creating a new object?\n var node = nodes[0];\n var endNode = nodes[nodes.length - 1];\n var blockNodes;\n\n for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {\n if (blockNodes || nodes[i] !== node) {\n if (!blockNodes) {\n blockNodes = jqLite(slice.call(nodes, 0, i));\n }\n blockNodes.push(node);\n }\n }\n\n return blockNodes || nodes;\n}\n\n\n/**\n * Creates a new object without a prototype. This object is useful for lookup without having to\n * guard against prototypically inherited properties via hasOwnProperty.\n *\n * Related micro-benchmarks:\n * - http://jsperf.com/object-create2\n * - http://jsperf.com/proto-map-lookup/2\n * - http://jsperf.com/for-in-vs-object-keys2\n *\n * @returns {Object}\n */\nfunction createMap() {\n return Object.create(null);\n}\n\nvar NODE_TYPE_ELEMENT = 1;\nvar NODE_TYPE_ATTRIBUTE = 2;\nvar NODE_TYPE_TEXT = 3;\nvar NODE_TYPE_COMMENT = 8;\nvar NODE_TYPE_DOCUMENT = 9;\nvar NODE_TYPE_DOCUMENT_FRAGMENT = 11;\n\n/**\n * @ngdoc type\n * @name angular.Module\n * @module ng\n * @description\n *\n * Interface for configuring angular {@link angular.module modules}.\n */\n\nfunction setupModuleLoader(window) {\n\n var $injectorMinErr = minErr('$injector');\n var ngMinErr = minErr('ng');\n\n function ensure(obj, name, factory) {\n return obj[name] || (obj[name] = factory());\n }\n\n var angular = ensure(window, 'angular', Object);\n\n // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap\n angular.$$minErr = angular.$$minErr || minErr;\n\n return ensure(angular, 'module', function() {\n /** @type {Object.} */\n var modules = {};\n\n /**\n * @ngdoc function\n * @name angular.module\n * @module ng\n * @description\n *\n * The `angular.module` is a global place for creating, registering and retrieving Angular\n * modules.\n * All modules (angular core or 3rd party) that should be available to an application must be\n * registered using this mechanism.\n *\n * Passing one argument retrieves an existing {@link angular.Module},\n * whereas passing more than one argument creates a new {@link angular.Module}\n *\n *\n * # Module\n *\n * A module is a collection of services, directives, controllers, filters, and configuration information.\n * `angular.module` is used to configure the {@link auto.$injector $injector}.\n *\n * ```js\n * // Create a new module\n * var myModule = angular.module('myModule', []);\n *\n * // register a new service\n * myModule.value('appName', 'MyCoolApp');\n *\n * // configure existing services inside initialization blocks.\n * myModule.config(['$locationProvider', function($locationProvider) {\n * // Configure existing providers\n * $locationProvider.hashPrefix('!');\n * }]);\n * ```\n *\n * Then you can create an injector and load your modules like this:\n *\n * ```js\n * var injector = angular.injector(['ng', 'myModule'])\n * ```\n *\n * However it's more likely that you'll just use\n * {@link ng.directive:ngApp ngApp} or\n * {@link angular.bootstrap} to simplify this process for you.\n *\n * @param {!string} name The name of the module to create or retrieve.\n * @param {!Array.=} requires If specified then new module is being created. If\n * unspecified then the module is being retrieved for further configuration.\n * @param {Function=} configFn Optional configuration function for the module. Same as\n * {@link angular.Module#config Module#config()}.\n * @returns {angular.Module} new module with the {@link angular.Module} api.\n */\n return function module(name, requires, configFn) {\n var assertNotHasOwnProperty = function(name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n }\n };\n\n assertNotHasOwnProperty(name, 'module');\n if (requires && modules.hasOwnProperty(name)) {\n modules[name] = null;\n }\n return ensure(modules, name, function() {\n if (!requires) {\n throw $injectorMinErr('nomod', \"Module '{0}' is not available! You either misspelled \" +\n \"the module name or forgot to load it. If registering a module ensure that you \" +\n \"specify the dependencies as the second argument.\", name);\n }\n\n /** @type {!Array.>} */\n var invokeQueue = [];\n\n /** @type {!Array.} */\n var configBlocks = [];\n\n /** @type {!Array.} */\n var runBlocks = [];\n\n var config = invokeLater('$injector', 'invoke', 'push', configBlocks);\n\n /** @type {angular.Module} */\n var moduleInstance = {\n // Private state\n _invokeQueue: invokeQueue,\n _configBlocks: configBlocks,\n _runBlocks: runBlocks,\n\n /**\n * @ngdoc property\n * @name angular.Module#requires\n * @module ng\n *\n * @description\n * Holds the list of modules which the injector will load before the current module is\n * loaded.\n */\n requires: requires,\n\n /**\n * @ngdoc property\n * @name angular.Module#name\n * @module ng\n *\n * @description\n * Name of the module.\n */\n name: name,\n\n\n /**\n * @ngdoc method\n * @name angular.Module#provider\n * @module ng\n * @param {string} name service name\n * @param {Function} providerType Construction function for creating new instance of the\n * service.\n * @description\n * See {@link auto.$provide#provider $provide.provider()}.\n */\n provider: invokeLaterAndSetModuleName('$provide', 'provider'),\n\n /**\n * @ngdoc method\n * @name angular.Module#factory\n * @module ng\n * @param {string} name service name\n * @param {Function} providerFunction Function for creating new instance of the service.\n * @description\n * See {@link auto.$provide#factory $provide.factory()}.\n */\n factory: invokeLaterAndSetModuleName('$provide', 'factory'),\n\n /**\n * @ngdoc method\n * @name angular.Module#service\n * @module ng\n * @param {string} name service name\n * @param {Function} constructor A constructor function that will be instantiated.\n * @description\n * See {@link auto.$provide#service $provide.service()}.\n */\n service: invokeLaterAndSetModuleName('$provide', 'service'),\n\n /**\n * @ngdoc method\n * @name angular.Module#value\n * @module ng\n * @param {string} name service name\n * @param {*} object Service instance object.\n * @description\n * See {@link auto.$provide#value $provide.value()}.\n */\n value: invokeLater('$provide', 'value'),\n\n /**\n * @ngdoc method\n * @name angular.Module#constant\n * @module ng\n * @param {string} name constant name\n * @param {*} object Constant value.\n * @description\n * Because the constants are fixed, they get applied before other provide methods.\n * See {@link auto.$provide#constant $provide.constant()}.\n */\n constant: invokeLater('$provide', 'constant', 'unshift'),\n\n /**\n * @ngdoc method\n * @name angular.Module#decorator\n * @module ng\n * @param {string} name The name of the service to decorate.\n * @param {Function} decorFn This function will be invoked when the service needs to be\n * instantiated and should return the decorated service instance.\n * @description\n * See {@link auto.$provide#decorator $provide.decorator()}.\n */\n decorator: invokeLaterAndSetModuleName('$provide', 'decorator'),\n\n /**\n * @ngdoc method\n * @name angular.Module#animation\n * @module ng\n * @param {string} name animation name\n * @param {Function} animationFactory Factory function for creating new instance of an\n * animation.\n * @description\n *\n * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.\n *\n *\n * Defines an animation hook that can be later used with\n * {@link $animate $animate} service and directives that use this service.\n *\n * ```js\n * module.animation('.animation-name', function($inject1, $inject2) {\n * return {\n * eventName : function(element, done) {\n * //code to run the animation\n * //once complete, then run done()\n * return function cancellationFunction(element) {\n * //code to cancel the animation\n * }\n * }\n * }\n * })\n * ```\n *\n * See {@link ng.$animateProvider#register $animateProvider.register()} and\n * {@link ngAnimate ngAnimate module} for more information.\n */\n animation: invokeLaterAndSetModuleName('$animateProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#filter\n * @module ng\n * @param {string} name Filter name - this must be a valid angular expression identifier\n * @param {Function} filterFactory Factory function for creating new instance of filter.\n * @description\n * See {@link ng.$filterProvider#register $filterProvider.register()}.\n *\n *
        \n * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n *
        \n */\n filter: invokeLaterAndSetModuleName('$filterProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#controller\n * @module ng\n * @param {string|Object} name Controller name, or an object map of controllers where the\n * keys are the names and the values are the constructors.\n * @param {Function} constructor Controller constructor function.\n * @description\n * See {@link ng.$controllerProvider#register $controllerProvider.register()}.\n */\n controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#directive\n * @module ng\n * @param {string|Object} name Directive name, or an object map of directives where the\n * keys are the names and the values are the factories.\n * @param {Function} directiveFactory Factory function for creating new instance of\n * directives.\n * @description\n * See {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),\n\n /**\n * @ngdoc method\n * @name angular.Module#component\n * @module ng\n * @param {string} name Name of the component in camel-case (i.e. myComp which will match as my-comp)\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object})\n *\n * @description\n * See {@link ng.$compileProvider#component $compileProvider.component()}.\n */\n component: invokeLaterAndSetModuleName('$compileProvider', 'component'),\n\n /**\n * @ngdoc method\n * @name angular.Module#config\n * @module ng\n * @param {Function} configFn Execute this function on module load. Useful for service\n * configuration.\n * @description\n * Use this method to register work which needs to be performed on module loading.\n * For more about how to configure services, see\n * {@link providers#provider-recipe Provider Recipe}.\n */\n config: config,\n\n /**\n * @ngdoc method\n * @name angular.Module#run\n * @module ng\n * @param {Function} initializationFn Execute this function after injector creation.\n * Useful for application initialization.\n * @description\n * Use this method to register work which should be performed when the injector is done\n * loading all modules.\n */\n run: function(block) {\n runBlocks.push(block);\n return this;\n }\n };\n\n if (configFn) {\n config(configFn);\n }\n\n return moduleInstance;\n\n /**\n * @param {string} provider\n * @param {string} method\n * @param {String=} insertMethod\n * @returns {angular.Module}\n */\n function invokeLater(provider, method, insertMethod, queue) {\n if (!queue) queue = invokeQueue;\n return function() {\n queue[insertMethod || 'push']([provider, method, arguments]);\n return moduleInstance;\n };\n }\n\n /**\n * @param {string} provider\n * @param {string} method\n * @returns {angular.Module}\n */\n function invokeLaterAndSetModuleName(provider, method) {\n return function(recipeName, factoryFunction) {\n if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;\n invokeQueue.push([provider, method, arguments]);\n return moduleInstance;\n };\n }\n });\n };\n });\n\n}\n\n/* global shallowCopy: true */\n\n/**\n * Creates a shallow copy of an object, an array or a primitive.\n *\n * Assumes that there are no proto properties for objects.\n */\nfunction shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for (var i = 0, ii = src.length; i < ii; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}\n\n/* global toDebugString: true */\n\nfunction serializeObject(obj) {\n var seen = [];\n\n return JSON.stringify(obj, function(key, val) {\n val = toJsonReplacer(key, val);\n if (isObject(val)) {\n\n if (seen.indexOf(val) >= 0) return '...';\n\n seen.push(val);\n }\n return val;\n });\n}\n\nfunction toDebugString(obj) {\n if (typeof obj === 'function') {\n return obj.toString().replace(/ \\{[\\s\\S]*$/, '');\n } else if (isUndefined(obj)) {\n return 'undefined';\n } else if (typeof obj !== 'string') {\n return serializeObject(obj);\n }\n return obj;\n}\n\n/* global angularModule: true,\n version: true,\n\n $CompileProvider,\n\n htmlAnchorDirective,\n inputDirective,\n inputDirective,\n formDirective,\n scriptDirective,\n selectDirective,\n styleDirective,\n optionDirective,\n ngBindDirective,\n ngBindHtmlDirective,\n ngBindTemplateDirective,\n ngClassDirective,\n ngClassEvenDirective,\n ngClassOddDirective,\n ngCloakDirective,\n ngControllerDirective,\n ngFormDirective,\n ngHideDirective,\n ngIfDirective,\n ngIncludeDirective,\n ngIncludeFillContentDirective,\n ngInitDirective,\n ngNonBindableDirective,\n ngPluralizeDirective,\n ngRepeatDirective,\n ngShowDirective,\n ngStyleDirective,\n ngSwitchDirective,\n ngSwitchWhenDirective,\n ngSwitchDefaultDirective,\n ngOptionsDirective,\n ngTranscludeDirective,\n ngModelDirective,\n ngListDirective,\n ngChangeDirective,\n patternDirective,\n patternDirective,\n requiredDirective,\n requiredDirective,\n minlengthDirective,\n minlengthDirective,\n maxlengthDirective,\n maxlengthDirective,\n ngValueDirective,\n ngModelOptionsDirective,\n ngAttributeAliasDirectives,\n ngEventDirectives,\n\n $AnchorScrollProvider,\n $AnimateProvider,\n $CoreAnimateCssProvider,\n $$CoreAnimateJsProvider,\n $$CoreAnimateQueueProvider,\n $$AnimateRunnerFactoryProvider,\n $$AnimateAsyncRunFactoryProvider,\n $BrowserProvider,\n $CacheFactoryProvider,\n $ControllerProvider,\n $DateProvider,\n $DocumentProvider,\n $ExceptionHandlerProvider,\n $FilterProvider,\n $$ForceReflowProvider,\n $InterpolateProvider,\n $IntervalProvider,\n $$HashMapProvider,\n $HttpProvider,\n $HttpParamSerializerProvider,\n $HttpParamSerializerJQLikeProvider,\n $HttpBackendProvider,\n $xhrFactoryProvider,\n $jsonpCallbacksProvider,\n $LocationProvider,\n $LogProvider,\n $ParseProvider,\n $RootScopeProvider,\n $QProvider,\n $$QProvider,\n $$SanitizeUriProvider,\n $SceProvider,\n $SceDelegateProvider,\n $SnifferProvider,\n $TemplateCacheProvider,\n $TemplateRequestProvider,\n $$TestabilityProvider,\n $TimeoutProvider,\n $$RAFProvider,\n $WindowProvider,\n $$jqLiteProvider,\n $$CookieReaderProvider\n*/\n\n\n/**\n * @ngdoc object\n * @name angular.version\n * @module ng\n * @description\n * An object that contains information about the current AngularJS version.\n *\n * This object has the following properties:\n *\n * - `full` – `{string}` – Full version string, such as \"0.9.18\".\n * - `major` – `{number}` – Major version number, such as \"0\".\n * - `minor` – `{number}` – Minor version number, such as \"9\".\n * - `dot` – `{number}` – Dot version number, such as \"18\".\n * - `codeName` – `{string}` – Code name of the release, such as \"jiggling-armfat\".\n */\nvar version = {\n full: '1.5.8', // all of these placeholder strings will be replaced by grunt's\n major: 1, // package task\n minor: 5,\n dot: 8,\n codeName: 'arbitrary-fallbacks'\n};\n\n\nfunction publishExternalAPI(angular) {\n extend(angular, {\n 'bootstrap': bootstrap,\n 'copy': copy,\n 'extend': extend,\n 'merge': merge,\n 'equals': equals,\n 'element': jqLite,\n 'forEach': forEach,\n 'injector': createInjector,\n 'noop': noop,\n 'bind': bind,\n 'toJson': toJson,\n 'fromJson': fromJson,\n 'identity': identity,\n 'isUndefined': isUndefined,\n 'isDefined': isDefined,\n 'isString': isString,\n 'isFunction': isFunction,\n 'isObject': isObject,\n 'isNumber': isNumber,\n 'isElement': isElement,\n 'isArray': isArray,\n 'version': version,\n 'isDate': isDate,\n 'lowercase': lowercase,\n 'uppercase': uppercase,\n 'callbacks': {$$counter: 0},\n 'getTestability': getTestability,\n '$$minErr': minErr,\n '$$csp': csp,\n 'reloadWithDebugInfo': reloadWithDebugInfo\n });\n\n angularModule = setupModuleLoader(window);\n\n angularModule('ng', ['ngLocale'], ['$provide',\n function ngModule($provide) {\n // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.\n $provide.provider({\n $$sanitizeUri: $$SanitizeUriProvider\n });\n $provide.provider('$compile', $CompileProvider).\n directive({\n a: htmlAnchorDirective,\n input: inputDirective,\n textarea: inputDirective,\n form: formDirective,\n script: scriptDirective,\n select: selectDirective,\n style: styleDirective,\n option: optionDirective,\n ngBind: ngBindDirective,\n ngBindHtml: ngBindHtmlDirective,\n ngBindTemplate: ngBindTemplateDirective,\n ngClass: ngClassDirective,\n ngClassEven: ngClassEvenDirective,\n ngClassOdd: ngClassOddDirective,\n ngCloak: ngCloakDirective,\n ngController: ngControllerDirective,\n ngForm: ngFormDirective,\n ngHide: ngHideDirective,\n ngIf: ngIfDirective,\n ngInclude: ngIncludeDirective,\n ngInit: ngInitDirective,\n ngNonBindable: ngNonBindableDirective,\n ngPluralize: ngPluralizeDirective,\n ngRepeat: ngRepeatDirective,\n ngShow: ngShowDirective,\n ngStyle: ngStyleDirective,\n ngSwitch: ngSwitchDirective,\n ngSwitchWhen: ngSwitchWhenDirective,\n ngSwitchDefault: ngSwitchDefaultDirective,\n ngOptions: ngOptionsDirective,\n ngTransclude: ngTranscludeDirective,\n ngModel: ngModelDirective,\n ngList: ngListDirective,\n ngChange: ngChangeDirective,\n pattern: patternDirective,\n ngPattern: patternDirective,\n required: requiredDirective,\n ngRequired: requiredDirective,\n minlength: minlengthDirective,\n ngMinlength: minlengthDirective,\n maxlength: maxlengthDirective,\n ngMaxlength: maxlengthDirective,\n ngValue: ngValueDirective,\n ngModelOptions: ngModelOptionsDirective\n }).\n directive({\n ngInclude: ngIncludeFillContentDirective\n }).\n directive(ngAttributeAliasDirectives).\n directive(ngEventDirectives);\n $provide.provider({\n $anchorScroll: $AnchorScrollProvider,\n $animate: $AnimateProvider,\n $animateCss: $CoreAnimateCssProvider,\n $$animateJs: $$CoreAnimateJsProvider,\n $$animateQueue: $$CoreAnimateQueueProvider,\n $$AnimateRunner: $$AnimateRunnerFactoryProvider,\n $$animateAsyncRun: $$AnimateAsyncRunFactoryProvider,\n $browser: $BrowserProvider,\n $cacheFactory: $CacheFactoryProvider,\n $controller: $ControllerProvider,\n $document: $DocumentProvider,\n $exceptionHandler: $ExceptionHandlerProvider,\n $filter: $FilterProvider,\n $$forceReflow: $$ForceReflowProvider,\n $interpolate: $InterpolateProvider,\n $interval: $IntervalProvider,\n $http: $HttpProvider,\n $httpParamSerializer: $HttpParamSerializerProvider,\n $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,\n $httpBackend: $HttpBackendProvider,\n $xhrFactory: $xhrFactoryProvider,\n $jsonpCallbacks: $jsonpCallbacksProvider,\n $location: $LocationProvider,\n $log: $LogProvider,\n $parse: $ParseProvider,\n $rootScope: $RootScopeProvider,\n $q: $QProvider,\n $$q: $$QProvider,\n $sce: $SceProvider,\n $sceDelegate: $SceDelegateProvider,\n $sniffer: $SnifferProvider,\n $templateCache: $TemplateCacheProvider,\n $templateRequest: $TemplateRequestProvider,\n $$testability: $$TestabilityProvider,\n $timeout: $TimeoutProvider,\n $window: $WindowProvider,\n $$rAF: $$RAFProvider,\n $$jqLite: $$jqLiteProvider,\n $$HashMap: $$HashMapProvider,\n $$cookieReader: $$CookieReaderProvider\n });\n }\n ]);\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* global JQLitePrototype: true,\n addEventListenerFn: true,\n removeEventListenerFn: true,\n BOOLEAN_ATTR: true,\n ALIASED_ATTR: true,\n*/\n\n//////////////////////////////////\n//JQLite\n//////////////////////////////////\n\n/**\n * @ngdoc function\n * @name angular.element\n * @module ng\n * @kind function\n *\n * @description\n * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.\n *\n * If jQuery is available, `angular.element` is an alias for the\n * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`\n * delegates to Angular's built-in subset of jQuery, called \"jQuery lite\" or **jqLite**.\n *\n * jqLite is a tiny, API-compatible subset of jQuery that allows\n * Angular to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most\n * commonly needed functionality with the goal of having a very small footprint.\n *\n * To use `jQuery`, simply ensure it is loaded before the `angular.js` file. You can also use the\n * {@link ngJq `ngJq`} directive to specify that jqlite should be used over jQuery, or to use a\n * specific version of jQuery if multiple versions exist on the page.\n *\n *
        **Note:** All element references in Angular are always wrapped with jQuery or\n * jqLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.
        \n *\n *
        **Note:** Keep in mind that this function will not find elements\n * by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)`\n * or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.
        \n *\n * ## Angular's jqLite\n * jqLite provides only the following jQuery methods:\n *\n * - [`addClass()`](http://api.jquery.com/addClass/) - Does not support a function as first argument\n * - [`after()`](http://api.jquery.com/after/)\n * - [`append()`](http://api.jquery.com/append/)\n * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters\n * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData\n * - [`children()`](http://api.jquery.com/children/) - Does not support selectors\n * - [`clone()`](http://api.jquery.com/clone/)\n * - [`contents()`](http://api.jquery.com/contents/)\n * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`.\n * As a setter, does not convert numbers to strings or append 'px', and also does not have automatic property prefixing.\n * - [`data()`](http://api.jquery.com/data/)\n * - [`detach()`](http://api.jquery.com/detach/)\n * - [`empty()`](http://api.jquery.com/empty/)\n * - [`eq()`](http://api.jquery.com/eq/)\n * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name\n * - [`hasClass()`](http://api.jquery.com/hasClass/)\n * - [`html()`](http://api.jquery.com/html/)\n * - [`next()`](http://api.jquery.com/next/) - Does not support selectors\n * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData\n * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter\n * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors\n * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors\n * - [`prepend()`](http://api.jquery.com/prepend/)\n * - [`prop()`](http://api.jquery.com/prop/)\n * - [`ready()`](http://api.jquery.com/ready/)\n * - [`remove()`](http://api.jquery.com/remove/)\n * - [`removeAttr()`](http://api.jquery.com/removeAttr/)\n * - [`removeClass()`](http://api.jquery.com/removeClass/) - Does not support a function as first argument\n * - [`removeData()`](http://api.jquery.com/removeData/)\n * - [`replaceWith()`](http://api.jquery.com/replaceWith/)\n * - [`text()`](http://api.jquery.com/text/)\n * - [`toggleClass()`](http://api.jquery.com/toggleClass/) - Does not support a function as first argument\n * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers\n * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces or event object as parameter\n * - [`val()`](http://api.jquery.com/val/)\n * - [`wrap()`](http://api.jquery.com/wrap/)\n *\n * ## jQuery/jqLite Extras\n * Angular also provides the following additional methods and events to both jQuery and jqLite:\n *\n * ### Events\n * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event\n * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM\n * element before it is removed.\n *\n * ### Methods\n * - `controller(name)` - retrieves the controller of the current element or its parent. By default\n * retrieves controller associated with the `ngController` directive. If `name` is provided as\n * camelCase directive name, then the controller for this directive will be retrieved (e.g.\n * `'ngModel'`).\n * - `injector()` - retrieves the injector of the current element or its parent.\n * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current\n * element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to\n * be enabled.\n * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the\n * current element. This getter should be used only on elements that contain a directive which starts a new isolate\n * scope. Calling `scope()` on this element always returns the original non-isolate scope.\n * Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.\n * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top\n * parent element is reached.\n *\n * @knownIssue You cannot spy on `angular.element` if you are using Jasmine version 1.x. See\n * https://github.com/angular/angular.js/issues/14251 for more information.\n *\n * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.\n * @returns {Object} jQuery object.\n */\n\nJQLite.expando = 'ng339';\n\nvar jqCache = JQLite.cache = {},\n jqId = 1,\n addEventListenerFn = function(element, type, fn) {\n element.addEventListener(type, fn, false);\n },\n removeEventListenerFn = function(element, type, fn) {\n element.removeEventListener(type, fn, false);\n };\n\n/*\n * !!! This is an undocumented \"private\" function !!!\n */\nJQLite._data = function(node) {\n //jQuery always returns an object on cache miss\n return this.cache[node[this.expando]] || {};\n};\n\nfunction jqNextId() { return ++jqId; }\n\n\nvar SPECIAL_CHARS_REGEXP = /([\\:\\-\\_]+(.))/g;\nvar MOZ_HACK_REGEXP = /^moz([A-Z])/;\nvar MOUSE_EVENT_MAP= { mouseleave: \"mouseout\", mouseenter: \"mouseover\"};\nvar jqLiteMinErr = minErr('jqLite');\n\n/**\n * Converts snake_case to camelCase.\n * Also there is special case for Moz prefix starting with upper case letter.\n * @param name Name to normalize\n */\nfunction camelCase(name) {\n return name.\n replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n }).\n replace(MOZ_HACK_REGEXP, 'Moz$1');\n}\n\nvar SINGLE_TAG_REGEXP = /^<([\\w-]+)\\s*\\/?>(?:<\\/\\1>|)$/;\nvar HTML_REGEXP = /<|&#?\\w+;/;\nvar TAG_NAME_REGEXP = /<([\\w:-]+)/;\nvar XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:-]+)[^>]*)\\/>/gi;\n\nvar wrapMap = {\n 'option': [1, ''],\n\n 'thead': [1, '', '
        '],\n 'col': [2, '', '
        '],\n 'tr': [2, '', '
        '],\n 'td': [3, '', '
        '],\n '_default': [0, \"\", \"\"]\n};\n\nwrapMap.optgroup = wrapMap.option;\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction jqLiteIsTextNode(html) {\n return !HTML_REGEXP.test(html);\n}\n\nfunction jqLiteAcceptsData(node) {\n // The window object can accept data but has no nodeType\n // Otherwise we are only interested in elements (1) and documents (9)\n var nodeType = node.nodeType;\n return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;\n}\n\nfunction jqLiteHasData(node) {\n for (var key in jqCache[node.ng339]) {\n return true;\n }\n return false;\n}\n\nfunction jqLiteCleanData(nodes) {\n for (var i = 0, ii = nodes.length; i < ii; i++) {\n jqLiteRemoveData(nodes[i]);\n }\n}\n\nfunction jqLiteBuildFragment(html, context) {\n var tmp, tag, wrap,\n fragment = context.createDocumentFragment(),\n nodes = [], i;\n\n if (jqLiteIsTextNode(html)) {\n // Convert non-html into a text node\n nodes.push(context.createTextNode(html));\n } else {\n // Convert html into DOM nodes\n tmp = fragment.appendChild(context.createElement(\"div\"));\n tag = (TAG_NAME_REGEXP.exec(html) || [\"\", \"\"])[1].toLowerCase();\n wrap = wrapMap[tag] || wrapMap._default;\n tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, \"<$1>\") + wrap[2];\n\n // Descend through wrappers to the right content\n i = wrap[0];\n while (i--) {\n tmp = tmp.lastChild;\n }\n\n nodes = concat(nodes, tmp.childNodes);\n\n tmp = fragment.firstChild;\n tmp.textContent = \"\";\n }\n\n // Remove wrapper from fragment\n fragment.textContent = \"\";\n fragment.innerHTML = \"\"; // Clear inner HTML\n forEach(nodes, function(node) {\n fragment.appendChild(node);\n });\n\n return fragment;\n}\n\nfunction jqLiteParseHTML(html, context) {\n context = context || window.document;\n var parsed;\n\n if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {\n return [context.createElement(parsed[1])];\n }\n\n if ((parsed = jqLiteBuildFragment(html, context))) {\n return parsed.childNodes;\n }\n\n return [];\n}\n\nfunction jqLiteWrapNode(node, wrapper) {\n var parent = node.parentNode;\n\n if (parent) {\n parent.replaceChild(wrapper, node);\n }\n\n wrapper.appendChild(node);\n}\n\n\n// IE9-11 has no method \"contains\" in SVG element and in Node.prototype. Bug #10259.\nvar jqLiteContains = window.Node.prototype.contains || function(arg) {\n // jshint bitwise: false\n return !!(this.compareDocumentPosition(arg) & 16);\n // jshint bitwise: true\n};\n\n/////////////////////////////////////////////\nfunction JQLite(element) {\n if (element instanceof JQLite) {\n return element;\n }\n\n var argIsString;\n\n if (isString(element)) {\n element = trim(element);\n argIsString = true;\n }\n if (!(this instanceof JQLite)) {\n if (argIsString && element.charAt(0) != '<') {\n throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');\n }\n return new JQLite(element);\n }\n\n if (argIsString) {\n jqLiteAddNodes(this, jqLiteParseHTML(element));\n } else {\n jqLiteAddNodes(this, element);\n }\n}\n\nfunction jqLiteClone(element) {\n return element.cloneNode(true);\n}\n\nfunction jqLiteDealoc(element, onlyDescendants) {\n if (!onlyDescendants) jqLiteRemoveData(element);\n\n if (element.querySelectorAll) {\n var descendants = element.querySelectorAll('*');\n for (var i = 0, l = descendants.length; i < l; i++) {\n jqLiteRemoveData(descendants[i]);\n }\n }\n}\n\nfunction jqLiteOff(element, type, fn, unsupported) {\n if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');\n\n var expandoStore = jqLiteExpandoStore(element);\n var events = expandoStore && expandoStore.events;\n var handle = expandoStore && expandoStore.handle;\n\n if (!handle) return; //no listeners registered\n\n if (!type) {\n for (type in events) {\n if (type !== '$destroy') {\n removeEventListenerFn(element, type, handle);\n }\n delete events[type];\n }\n } else {\n\n var removeHandler = function(type) {\n var listenerFns = events[type];\n if (isDefined(fn)) {\n arrayRemove(listenerFns || [], fn);\n }\n if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {\n removeEventListenerFn(element, type, handle);\n delete events[type];\n }\n };\n\n forEach(type.split(' '), function(type) {\n removeHandler(type);\n if (MOUSE_EVENT_MAP[type]) {\n removeHandler(MOUSE_EVENT_MAP[type]);\n }\n });\n }\n}\n\nfunction jqLiteRemoveData(element, name) {\n var expandoId = element.ng339;\n var expandoStore = expandoId && jqCache[expandoId];\n\n if (expandoStore) {\n if (name) {\n delete expandoStore.data[name];\n return;\n }\n\n if (expandoStore.handle) {\n if (expandoStore.events.$destroy) {\n expandoStore.handle({}, '$destroy');\n }\n jqLiteOff(element);\n }\n delete jqCache[expandoId];\n element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it\n }\n}\n\n\nfunction jqLiteExpandoStore(element, createIfNecessary) {\n var expandoId = element.ng339,\n expandoStore = expandoId && jqCache[expandoId];\n\n if (createIfNecessary && !expandoStore) {\n element.ng339 = expandoId = jqNextId();\n expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined};\n }\n\n return expandoStore;\n}\n\n\nfunction jqLiteData(element, key, value) {\n if (jqLiteAcceptsData(element)) {\n\n var isSimpleSetter = isDefined(value);\n var isSimpleGetter = !isSimpleSetter && key && !isObject(key);\n var massGetter = !key;\n var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);\n var data = expandoStore && expandoStore.data;\n\n if (isSimpleSetter) { // data('key', value)\n data[key] = value;\n } else {\n if (massGetter) { // data()\n return data;\n } else {\n if (isSimpleGetter) { // data('key')\n // don't force creation of expandoStore if it doesn't exist yet\n return data && data[key];\n } else { // mass-setter: data({key1: val1, key2: val2})\n extend(data, key);\n }\n }\n }\n }\n}\n\nfunction jqLiteHasClass(element, selector) {\n if (!element.getAttribute) return false;\n return ((\" \" + (element.getAttribute('class') || '') + \" \").replace(/[\\n\\t]/g, \" \").\n indexOf(\" \" + selector + \" \") > -1);\n}\n\nfunction jqLiteRemoveClass(element, cssClasses) {\n if (cssClasses && element.setAttribute) {\n forEach(cssClasses.split(' '), function(cssClass) {\n element.setAttribute('class', trim(\n (\" \" + (element.getAttribute('class') || '') + \" \")\n .replace(/[\\n\\t]/g, \" \")\n .replace(\" \" + trim(cssClass) + \" \", \" \"))\n );\n });\n }\n}\n\nfunction jqLiteAddClass(element, cssClasses) {\n if (cssClasses && element.setAttribute) {\n var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')\n .replace(/[\\n\\t]/g, \" \");\n\n forEach(cssClasses.split(' '), function(cssClass) {\n cssClass = trim(cssClass);\n if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {\n existingClasses += cssClass + ' ';\n }\n });\n\n element.setAttribute('class', trim(existingClasses));\n }\n}\n\n\nfunction jqLiteAddNodes(root, elements) {\n // THIS CODE IS VERY HOT. Don't make changes without benchmarking.\n\n if (elements) {\n\n // if a Node (the most common case)\n if (elements.nodeType) {\n root[root.length++] = elements;\n } else {\n var length = elements.length;\n\n // if an Array or NodeList and not a Window\n if (typeof length === 'number' && elements.window !== elements) {\n if (length) {\n for (var i = 0; i < length; i++) {\n root[root.length++] = elements[i];\n }\n }\n } else {\n root[root.length++] = elements;\n }\n }\n }\n}\n\n\nfunction jqLiteController(element, name) {\n return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');\n}\n\nfunction jqLiteInheritedData(element, name, value) {\n // if element is the document object work with the html element instead\n // this makes $(document).scope() possible\n if (element.nodeType == NODE_TYPE_DOCUMENT) {\n element = element.documentElement;\n }\n var names = isArray(name) ? name : [name];\n\n while (element) {\n for (var i = 0, ii = names.length; i < ii; i++) {\n if (isDefined(value = jqLite.data(element, names[i]))) return value;\n }\n\n // If dealing with a document fragment node with a host element, and no parent, use the host\n // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM\n // to lookup parent controllers.\n element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);\n }\n}\n\nfunction jqLiteEmpty(element) {\n jqLiteDealoc(element, true);\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}\n\nfunction jqLiteRemove(element, keepData) {\n if (!keepData) jqLiteDealoc(element);\n var parent = element.parentNode;\n if (parent) parent.removeChild(element);\n}\n\n\nfunction jqLiteDocumentLoaded(action, win) {\n win = win || window;\n if (win.document.readyState === 'complete') {\n // Force the action to be run async for consistent behavior\n // from the action's point of view\n // i.e. it will definitely not be in a $apply\n win.setTimeout(action);\n } else {\n // No need to unbind this handler as load is only ever called once\n jqLite(win).on('load', action);\n }\n}\n\n//////////////////////////////////////////\n// Functions which are declared directly.\n//////////////////////////////////////////\nvar JQLitePrototype = JQLite.prototype = {\n ready: function(fn) {\n var fired = false;\n\n function trigger() {\n if (fired) return;\n fired = true;\n fn();\n }\n\n // check if document is already loaded\n if (window.document.readyState === 'complete') {\n window.setTimeout(trigger);\n } else {\n this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9\n // we can not use jqLite since we are not done loading and jQuery could be loaded later.\n // jshint -W064\n JQLite(window).on('load', trigger); // fallback to window.onload for others\n // jshint +W064\n }\n },\n toString: function() {\n var value = [];\n forEach(this, function(e) { value.push('' + e);});\n return '[' + value.join(', ') + ']';\n },\n\n eq: function(index) {\n return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);\n },\n\n length: 0,\n push: push,\n sort: [].sort,\n splice: [].splice\n};\n\n//////////////////////////////////////////\n// Functions iterating getter/setters.\n// these functions return self on setter and\n// value on get.\n//////////////////////////////////////////\nvar BOOLEAN_ATTR = {};\nforEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {\n BOOLEAN_ATTR[lowercase(value)] = value;\n});\nvar BOOLEAN_ELEMENTS = {};\nforEach('input,select,option,textarea,button,form,details'.split(','), function(value) {\n BOOLEAN_ELEMENTS[value] = true;\n});\nvar ALIASED_ATTR = {\n 'ngMinlength': 'minlength',\n 'ngMaxlength': 'maxlength',\n 'ngMin': 'min',\n 'ngMax': 'max',\n 'ngPattern': 'pattern'\n};\n\nfunction getBooleanAttrName(element, name) {\n // check dom last since we will most likely fail on name\n var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];\n\n // booleanAttr is here twice to minimize DOM access\n return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;\n}\n\nfunction getAliasedAttrName(name) {\n return ALIASED_ATTR[name];\n}\n\nforEach({\n data: jqLiteData,\n removeData: jqLiteRemoveData,\n hasData: jqLiteHasData,\n cleanData: jqLiteCleanData\n}, function(fn, name) {\n JQLite[name] = fn;\n});\n\nforEach({\n data: jqLiteData,\n inheritedData: jqLiteInheritedData,\n\n scope: function(element) {\n // Can't use jqLiteData here directly so we stay compatible with jQuery!\n return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);\n },\n\n isolateScope: function(element) {\n // Can't use jqLiteData here directly so we stay compatible with jQuery!\n return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');\n },\n\n controller: jqLiteController,\n\n injector: function(element) {\n return jqLiteInheritedData(element, '$injector');\n },\n\n removeAttr: function(element, name) {\n element.removeAttribute(name);\n },\n\n hasClass: jqLiteHasClass,\n\n css: function(element, name, value) {\n name = camelCase(name);\n\n if (isDefined(value)) {\n element.style[name] = value;\n } else {\n return element.style[name];\n }\n },\n\n attr: function(element, name, value) {\n var nodeType = element.nodeType;\n if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT) {\n return;\n }\n var lowercasedName = lowercase(name);\n if (BOOLEAN_ATTR[lowercasedName]) {\n if (isDefined(value)) {\n if (!!value) {\n element[name] = true;\n element.setAttribute(name, lowercasedName);\n } else {\n element[name] = false;\n element.removeAttribute(lowercasedName);\n }\n } else {\n return (element[name] ||\n (element.attributes.getNamedItem(name) || noop).specified)\n ? lowercasedName\n : undefined;\n }\n } else if (isDefined(value)) {\n element.setAttribute(name, value);\n } else if (element.getAttribute) {\n // the extra argument \"2\" is to get the right thing for a.href in IE, see jQuery code\n // some elements (e.g. Document) don't have get attribute, so return undefined\n var ret = element.getAttribute(name, 2);\n // normalize non-existing attributes to undefined (as jQuery)\n return ret === null ? undefined : ret;\n }\n },\n\n prop: function(element, name, value) {\n if (isDefined(value)) {\n element[name] = value;\n } else {\n return element[name];\n }\n },\n\n text: (function() {\n getText.$dv = '';\n return getText;\n\n function getText(element, value) {\n if (isUndefined(value)) {\n var nodeType = element.nodeType;\n return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';\n }\n element.textContent = value;\n }\n })(),\n\n val: function(element, value) {\n if (isUndefined(value)) {\n if (element.multiple && nodeName_(element) === 'select') {\n var result = [];\n forEach(element.options, function(option) {\n if (option.selected) {\n result.push(option.value || option.text);\n }\n });\n return result.length === 0 ? null : result;\n }\n return element.value;\n }\n element.value = value;\n },\n\n html: function(element, value) {\n if (isUndefined(value)) {\n return element.innerHTML;\n }\n jqLiteDealoc(element, true);\n element.innerHTML = value;\n },\n\n empty: jqLiteEmpty\n}, function(fn, name) {\n /**\n * Properties: writes return selection, reads return first value\n */\n JQLite.prototype[name] = function(arg1, arg2) {\n var i, key;\n var nodeCount = this.length;\n\n // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it\n // in a way that survives minification.\n // jqLiteEmpty takes no arguments but is a setter.\n if (fn !== jqLiteEmpty &&\n (isUndefined((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) {\n if (isObject(arg1)) {\n\n // we are a write, but the object properties are the key/values\n for (i = 0; i < nodeCount; i++) {\n if (fn === jqLiteData) {\n // data() takes the whole object in jQuery\n fn(this[i], arg1);\n } else {\n for (key in arg1) {\n fn(this[i], key, arg1[key]);\n }\n }\n }\n // return self for chaining\n return this;\n } else {\n // we are a read, so read the first child.\n // TODO: do we still need this?\n var value = fn.$dv;\n // Only if we have $dv do we iterate over all, otherwise it is just the first element.\n var jj = (isUndefined(value)) ? Math.min(nodeCount, 1) : nodeCount;\n for (var j = 0; j < jj; j++) {\n var nodeValue = fn(this[j], arg1, arg2);\n value = value ? value + nodeValue : nodeValue;\n }\n return value;\n }\n } else {\n // we are a write, so apply to all children\n for (i = 0; i < nodeCount; i++) {\n fn(this[i], arg1, arg2);\n }\n // return self for chaining\n return this;\n }\n };\n});\n\nfunction createEventHandler(element, events) {\n var eventHandler = function(event, type) {\n // jQuery specific api\n event.isDefaultPrevented = function() {\n return event.defaultPrevented;\n };\n\n var eventFns = events[type || event.type];\n var eventFnsLength = eventFns ? eventFns.length : 0;\n\n if (!eventFnsLength) return;\n\n if (isUndefined(event.immediatePropagationStopped)) {\n var originalStopImmediatePropagation = event.stopImmediatePropagation;\n event.stopImmediatePropagation = function() {\n event.immediatePropagationStopped = true;\n\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n\n if (originalStopImmediatePropagation) {\n originalStopImmediatePropagation.call(event);\n }\n };\n }\n\n event.isImmediatePropagationStopped = function() {\n return event.immediatePropagationStopped === true;\n };\n\n // Some events have special handlers that wrap the real handler\n var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper;\n\n // Copy event handlers in case event handlers array is modified during execution.\n if ((eventFnsLength > 1)) {\n eventFns = shallowCopy(eventFns);\n }\n\n for (var i = 0; i < eventFnsLength; i++) {\n if (!event.isImmediatePropagationStopped()) {\n handlerWrapper(element, event, eventFns[i]);\n }\n }\n };\n\n // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all\n // events on `element`\n eventHandler.elem = element;\n return eventHandler;\n}\n\nfunction defaultHandlerWrapper(element, event, handler) {\n handler.call(element, event);\n}\n\nfunction specialMouseHandlerWrapper(target, event, handler) {\n // Refer to jQuery's implementation of mouseenter & mouseleave\n // Read about mouseenter and mouseleave:\n // http://www.quirksmode.org/js/events_mouse.html#link8\n var related = event.relatedTarget;\n // For mousenter/leave call the handler if related is outside the target.\n // NB: No relatedTarget if the mouse left/entered the browser window\n if (!related || (related !== target && !jqLiteContains.call(target, related))) {\n handler.call(target, event);\n }\n}\n\n//////////////////////////////////////////\n// Functions iterating traversal.\n// These functions chain results into a single\n// selector.\n//////////////////////////////////////////\nforEach({\n removeData: jqLiteRemoveData,\n\n on: function jqLiteOn(element, type, fn, unsupported) {\n if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');\n\n // Do not add event handlers to non-elements because they will not be cleaned up.\n if (!jqLiteAcceptsData(element)) {\n return;\n }\n\n var expandoStore = jqLiteExpandoStore(element, true);\n var events = expandoStore.events;\n var handle = expandoStore.handle;\n\n if (!handle) {\n handle = expandoStore.handle = createEventHandler(element, events);\n }\n\n // http://jsperf.com/string-indexof-vs-split\n var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];\n var i = types.length;\n\n var addHandler = function(type, specialHandlerWrapper, noEventListener) {\n var eventFns = events[type];\n\n if (!eventFns) {\n eventFns = events[type] = [];\n eventFns.specialHandlerWrapper = specialHandlerWrapper;\n if (type !== '$destroy' && !noEventListener) {\n addEventListenerFn(element, type, handle);\n }\n }\n\n eventFns.push(fn);\n };\n\n while (i--) {\n type = types[i];\n if (MOUSE_EVENT_MAP[type]) {\n addHandler(MOUSE_EVENT_MAP[type], specialMouseHandlerWrapper);\n addHandler(type, undefined, true);\n } else {\n addHandler(type);\n }\n }\n },\n\n off: jqLiteOff,\n\n one: function(element, type, fn) {\n element = jqLite(element);\n\n //add the listener twice so that when it is called\n //you can remove the original function and still be\n //able to call element.off(ev, fn) normally\n element.on(type, function onFn() {\n element.off(type, fn);\n element.off(type, onFn);\n });\n element.on(type, fn);\n },\n\n replaceWith: function(element, replaceNode) {\n var index, parent = element.parentNode;\n jqLiteDealoc(element);\n forEach(new JQLite(replaceNode), function(node) {\n if (index) {\n parent.insertBefore(node, index.nextSibling);\n } else {\n parent.replaceChild(node, element);\n }\n index = node;\n });\n },\n\n children: function(element) {\n var children = [];\n forEach(element.childNodes, function(element) {\n if (element.nodeType === NODE_TYPE_ELEMENT) {\n children.push(element);\n }\n });\n return children;\n },\n\n contents: function(element) {\n return element.contentDocument || element.childNodes || [];\n },\n\n append: function(element, node) {\n var nodeType = element.nodeType;\n if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;\n\n node = new JQLite(node);\n\n for (var i = 0, ii = node.length; i < ii; i++) {\n var child = node[i];\n element.appendChild(child);\n }\n },\n\n prepend: function(element, node) {\n if (element.nodeType === NODE_TYPE_ELEMENT) {\n var index = element.firstChild;\n forEach(new JQLite(node), function(child) {\n element.insertBefore(child, index);\n });\n }\n },\n\n wrap: function(element, wrapNode) {\n jqLiteWrapNode(element, jqLite(wrapNode).eq(0).clone()[0]);\n },\n\n remove: jqLiteRemove,\n\n detach: function(element) {\n jqLiteRemove(element, true);\n },\n\n after: function(element, newElement) {\n var index = element, parent = element.parentNode;\n newElement = new JQLite(newElement);\n\n for (var i = 0, ii = newElement.length; i < ii; i++) {\n var node = newElement[i];\n parent.insertBefore(node, index.nextSibling);\n index = node;\n }\n },\n\n addClass: jqLiteAddClass,\n removeClass: jqLiteRemoveClass,\n\n toggleClass: function(element, selector, condition) {\n if (selector) {\n forEach(selector.split(' '), function(className) {\n var classCondition = condition;\n if (isUndefined(classCondition)) {\n classCondition = !jqLiteHasClass(element, className);\n }\n (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);\n });\n }\n },\n\n parent: function(element) {\n var parent = element.parentNode;\n return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;\n },\n\n next: function(element) {\n return element.nextElementSibling;\n },\n\n find: function(element, selector) {\n if (element.getElementsByTagName) {\n return element.getElementsByTagName(selector);\n } else {\n return [];\n }\n },\n\n clone: jqLiteClone,\n\n triggerHandler: function(element, event, extraParameters) {\n\n var dummyEvent, eventFnsCopy, handlerArgs;\n var eventName = event.type || event;\n var expandoStore = jqLiteExpandoStore(element);\n var events = expandoStore && expandoStore.events;\n var eventFns = events && events[eventName];\n\n if (eventFns) {\n // Create a dummy event to pass to the handlers\n dummyEvent = {\n preventDefault: function() { this.defaultPrevented = true; },\n isDefaultPrevented: function() { return this.defaultPrevented === true; },\n stopImmediatePropagation: function() { this.immediatePropagationStopped = true; },\n isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; },\n stopPropagation: noop,\n type: eventName,\n target: element\n };\n\n // If a custom event was provided then extend our dummy event with it\n if (event.type) {\n dummyEvent = extend(dummyEvent, event);\n }\n\n // Copy event handlers in case event handlers array is modified during execution.\n eventFnsCopy = shallowCopy(eventFns);\n handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];\n\n forEach(eventFnsCopy, function(fn) {\n if (!dummyEvent.isImmediatePropagationStopped()) {\n fn.apply(element, handlerArgs);\n }\n });\n }\n }\n}, function(fn, name) {\n /**\n * chaining functions\n */\n JQLite.prototype[name] = function(arg1, arg2, arg3) {\n var value;\n\n for (var i = 0, ii = this.length; i < ii; i++) {\n if (isUndefined(value)) {\n value = fn(this[i], arg1, arg2, arg3);\n if (isDefined(value)) {\n // any function which returns a value needs to be wrapped\n value = jqLite(value);\n }\n } else {\n jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));\n }\n }\n return isDefined(value) ? value : this;\n };\n\n // bind legacy bind/unbind to on/off\n JQLite.prototype.bind = JQLite.prototype.on;\n JQLite.prototype.unbind = JQLite.prototype.off;\n});\n\n\n// Provider for private $$jqLite service\nfunction $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}\n\n/**\n * Computes a hash of an 'obj'.\n * Hash of a:\n * string is string\n * number is number as string\n * object is either result of calling $$hashKey function on the object or uniquely generated id,\n * that is also assigned to the $$hashKey property of the object.\n *\n * @param obj\n * @returns {string} hash string such that the same input will have the same hash string.\n * The resulting string key is in 'type:hashKey' format.\n */\nfunction hashKey(obj, nextUidFn) {\n var key = obj && obj.$$hashKey;\n\n if (key) {\n if (typeof key === 'function') {\n key = obj.$$hashKey();\n }\n return key;\n }\n\n var objType = typeof obj;\n if (objType == 'function' || (objType == 'object' && obj !== null)) {\n key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();\n } else {\n key = objType + ':' + obj;\n }\n\n return key;\n}\n\n/**\n * HashMap which can use objects as keys\n */\nfunction HashMap(array, isolatedUid) {\n if (isolatedUid) {\n var uid = 0;\n this.nextUid = function() {\n return ++uid;\n };\n }\n forEach(array, this.put, this);\n}\nHashMap.prototype = {\n /**\n * Store key value pair\n * @param key key to store can be any type\n * @param value value to store can be any type\n */\n put: function(key, value) {\n this[hashKey(key, this.nextUid)] = value;\n },\n\n /**\n * @param key\n * @returns {Object} the value for the key\n */\n get: function(key) {\n return this[hashKey(key, this.nextUid)];\n },\n\n /**\n * Remove the key/value pair\n * @param key\n */\n remove: function(key) {\n var value = this[key = hashKey(key, this.nextUid)];\n delete this[key];\n return value;\n }\n};\n\nvar $$HashMapProvider = [function() {\n this.$get = [function() {\n return HashMap;\n }];\n}];\n\n/**\n * @ngdoc function\n * @module ng\n * @name angular.injector\n * @kind function\n *\n * @description\n * Creates an injector object that can be used for retrieving services as well as for\n * dependency injection (see {@link guide/di dependency injection}).\n *\n * @param {Array.} modules A list of module functions or their aliases. See\n * {@link angular.module}. The `ng` module must be explicitly added.\n * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which\n * disallows argument name annotation inference.\n * @returns {injector} Injector object. See {@link auto.$injector $injector}.\n *\n * @example\n * Typical usage\n * ```js\n * // create an injector\n * var $injector = angular.injector(['ng']);\n *\n * // use the injector to kick off your application\n * // use the type inference to auto inject arguments, or use implicit injection\n * $injector.invoke(function($rootScope, $compile, $document) {\n * $compile($document)($rootScope);\n * $rootScope.$digest();\n * });\n * ```\n *\n * Sometimes you want to get access to the injector of a currently running Angular app\n * from outside Angular. Perhaps, you want to inject and compile some markup after the\n * application has been bootstrapped. You can do this using the extra `injector()` added\n * to JQuery/jqLite elements. See {@link angular.element}.\n *\n * *This is fairly rare but could be the case if a third party library is injecting the\n * markup.*\n *\n * In the following example a new block of HTML containing a `ng-controller`\n * directive is added to the end of the document body by JQuery. We then compile and link\n * it into the current AngularJS scope.\n *\n * ```js\n * var $div = $('
        {{content.label}}
        ');\n * $(document.body).append($div);\n *\n * angular.element(document).injector().invoke(function($compile) {\n * var scope = angular.element($div).scope();\n * $compile($div)(scope);\n * });\n * ```\n */\n\n\n/**\n * @ngdoc module\n * @name auto\n * @installation\n * @description\n *\n * Implicit module which gets automatically added to each {@link auto.$injector $injector}.\n */\n\nvar ARROW_ARG = /^([^\\(]+?)=>/;\nvar FN_ARGS = /^[^\\(]*\\(\\s*([^\\)]*)\\)/m;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /^\\s*(_?)(\\S+?)\\1\\s*$/;\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\nvar $injectorMinErr = minErr('$injector');\n\nfunction stringifyFn(fn) {\n // Support: Chrome 50-51 only\n // Creating a new string by adding `' '` at the end, to hack around some bug in Chrome v50/51\n // (See https://github.com/angular/angular.js/issues/14487.)\n // TODO (gkalpak): Remove workaround when Chrome v52 is released\n return Function.prototype.toString.call(fn) + ' ';\n}\n\nfunction extractArgs(fn) {\n var fnText = stringifyFn(fn).replace(STRIP_COMMENTS, ''),\n args = fnText.match(ARROW_ARG) || fnText.match(FN_ARGS);\n return args;\n}\n\nfunction anonFn(fn) {\n // For anonymous functions, showing at the very least the function signature can help in\n // debugging.\n var args = extractArgs(fn);\n if (args) {\n return 'function(' + (args[1] || '').replace(/[\\s\\r\\n]+/, ' ') + ')';\n }\n return 'fn';\n}\n\nfunction annotate(fn, strictDi, name) {\n var $inject,\n argDecl,\n last;\n\n if (typeof fn === 'function') {\n if (!($inject = fn.$inject)) {\n $inject = [];\n if (fn.length) {\n if (strictDi) {\n if (!isString(name) || !name) {\n name = fn.name || anonFn(fn);\n }\n throw $injectorMinErr('strictdi',\n '{0} is not using explicit annotation and cannot be invoked in strict mode', name);\n }\n argDecl = extractArgs(fn);\n forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {\n arg.replace(FN_ARG, function(all, underscore, name) {\n $inject.push(name);\n });\n });\n }\n fn.$inject = $inject;\n }\n } else if (isArray(fn)) {\n last = fn.length - 1;\n assertArgFn(fn[last], 'fn');\n $inject = fn.slice(0, last);\n } else {\n assertArgFn(fn, 'fn', true);\n }\n return $inject;\n}\n\n///////////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $injector\n *\n * @description\n *\n * `$injector` is used to retrieve object instances as defined by\n * {@link auto.$provide provider}, instantiate types, invoke methods,\n * and load modules.\n *\n * The following always holds true:\n *\n * ```js\n * var $injector = angular.injector();\n * expect($injector.get('$injector')).toBe($injector);\n * expect($injector.invoke(function($injector) {\n * return $injector;\n * })).toBe($injector);\n * ```\n *\n * # Injection Function Annotation\n *\n * JavaScript does not have annotations, and annotations are needed for dependency injection. The\n * following are all valid ways of annotating function with injection arguments and are equivalent.\n *\n * ```js\n * // inferred (only works if code not minified/obfuscated)\n * $injector.invoke(function(serviceA){});\n *\n * // annotated\n * function explicit(serviceA) {};\n * explicit.$inject = ['serviceA'];\n * $injector.invoke(explicit);\n *\n * // inline\n * $injector.invoke(['serviceA', function(serviceA){}]);\n * ```\n *\n * ## Inference\n *\n * In JavaScript calling `toString()` on a function returns the function definition. The definition\n * can then be parsed and the function arguments can be extracted. This method of discovering\n * annotations is disallowed when the injector is in strict mode.\n * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the\n * argument names.\n *\n * ## `$inject` Annotation\n * By adding an `$inject` property onto a function the injection parameters can be specified.\n *\n * ## Inline\n * As an array of injection names, where the last item in the array is the function to call.\n */\n\n/**\n * @ngdoc method\n * @name $injector#get\n *\n * @description\n * Return an instance of the service.\n *\n * @param {string} name The name of the instance to retrieve.\n * @param {string=} caller An optional string to provide the origin of the function call for error messages.\n * @return {*} The instance.\n */\n\n/**\n * @ngdoc method\n * @name $injector#invoke\n *\n * @description\n * Invoke the method and supply the method arguments from the `$injector`.\n *\n * @param {Function|Array.} fn The injectable function to invoke. Function parameters are\n * injected according to the {@link guide/di $inject Annotation} rules.\n * @param {Object=} self The `this` for the invoked method.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {*} the value returned by the invoked `fn` function.\n */\n\n/**\n * @ngdoc method\n * @name $injector#has\n *\n * @description\n * Allows the user to query if the particular service exists.\n *\n * @param {string} name Name of the service to query.\n * @returns {boolean} `true` if injector has given service.\n */\n\n/**\n * @ngdoc method\n * @name $injector#instantiate\n * @description\n * Create a new instance of JS type. The method takes a constructor function, invokes the new\n * operator, and supplies all of the arguments to the constructor function as specified by the\n * constructor annotation.\n *\n * @param {Function} Type Annotated constructor function.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {Object} new instance of `Type`.\n */\n\n/**\n * @ngdoc method\n * @name $injector#annotate\n *\n * @description\n * Returns an array of service names which the function is requesting for injection. This API is\n * used by the injector to determine which services need to be injected into the function when the\n * function is invoked. There are three ways in which the function can be annotated with the needed\n * dependencies.\n *\n * # Argument names\n *\n * The simplest form is to extract the dependencies from the arguments of the function. This is done\n * by converting the function into a string using `toString()` method and extracting the argument\n * names.\n * ```js\n * // Given\n * function MyController($scope, $route) {\n * // ...\n * }\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * You can disallow this method by using strict injection mode.\n *\n * This method does not work with code minification / obfuscation. For this reason the following\n * annotation strategies are supported.\n *\n * # The `$inject` property\n *\n * If a function has an `$inject` property and its value is an array of strings, then the strings\n * represent names of services to be injected into the function.\n * ```js\n * // Given\n * var MyController = function(obfuscatedScope, obfuscatedRoute) {\n * // ...\n * }\n * // Define function dependencies\n * MyController['$inject'] = ['$scope', '$route'];\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * # The array notation\n *\n * It is often desirable to inline Injected functions and that's when setting the `$inject` property\n * is very inconvenient. In these situations using the array notation to specify the dependencies in\n * a way that survives minification is a better choice:\n *\n * ```js\n * // We wish to write this (not minification / obfuscation safe)\n * injector.invoke(function($compile, $rootScope) {\n * // ...\n * });\n *\n * // We are forced to write break inlining\n * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {\n * // ...\n * };\n * tmpFn.$inject = ['$compile', '$rootScope'];\n * injector.invoke(tmpFn);\n *\n * // To better support inline function the inline annotation is supported\n * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {\n * // ...\n * }]);\n *\n * // Therefore\n * expect(injector.annotate(\n * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])\n * ).toEqual(['$compile', '$rootScope']);\n * ```\n *\n * @param {Function|Array.} fn Function for which dependent service names need to\n * be retrieved as described above.\n *\n * @param {boolean=} [strictDi=false] Disallow argument name annotation inference.\n *\n * @returns {Array.} The names of the services which the function requires.\n */\n\n\n\n\n/**\n * @ngdoc service\n * @name $provide\n *\n * @description\n *\n * The {@link auto.$provide $provide} service has a number of methods for registering components\n * with the {@link auto.$injector $injector}. Many of these functions are also exposed on\n * {@link angular.Module}.\n *\n * An Angular **service** is a singleton object created by a **service factory**. These **service\n * factories** are functions which, in turn, are created by a **service provider**.\n * The **service providers** are constructor functions. When instantiated they must contain a\n * property called `$get`, which holds the **service factory** function.\n *\n * When you request a service, the {@link auto.$injector $injector} is responsible for finding the\n * correct **service provider**, instantiating it and then calling its `$get` **service factory**\n * function to get the instance of the **service**.\n *\n * Often services have no configuration options and there is no need to add methods to the service\n * provider. The provider will be no more than a constructor function with a `$get` property. For\n * these cases the {@link auto.$provide $provide} service has additional helper methods to register\n * services without specifying a provider.\n *\n * * {@link auto.$provide#provider provider(name, provider)} - registers a **service provider** with the\n * {@link auto.$injector $injector}\n * * {@link auto.$provide#constant constant(name, obj)} - registers a value/object that can be accessed by\n * providers and services.\n * * {@link auto.$provide#value value(name, obj)} - registers a value/object that can only be accessed by\n * services, not providers.\n * * {@link auto.$provide#factory factory(name, fn)} - registers a service **factory function**\n * that will be wrapped in a **service provider** object, whose `$get` property will contain the\n * given factory function.\n * * {@link auto.$provide#service service(name, Fn)} - registers a **constructor function**\n * that will be wrapped in a **service provider** object, whose `$get` property will instantiate\n * a new object using the given constructor function.\n * * {@link auto.$provide#decorator decorator(name, decorFn)} - registers a **decorator function** that\n * will be able to modify or replace the implementation of another service.\n *\n * See the individual methods for more information and examples.\n */\n\n/**\n * @ngdoc method\n * @name $provide#provider\n * @description\n *\n * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions\n * are constructor functions, whose instances are responsible for \"providing\" a factory for a\n * service.\n *\n * Service provider names start with the name of the service they provide followed by `Provider`.\n * For example, the {@link ng.$log $log} service has a provider called\n * {@link ng.$logProvider $logProvider}.\n *\n * Service provider objects can have additional methods which allow configuration of the provider\n * and its service. Importantly, you can configure what kind of service is created by the `$get`\n * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a\n * method {@link ng.$logProvider#debugEnabled debugEnabled}\n * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the\n * console or not.\n *\n * @param {string} name The name of the instance. NOTE: the provider will be available under `name +\n 'Provider'` key.\n * @param {(Object|function())} provider If the provider is:\n *\n * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using\n * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.\n * - `Constructor`: a new instance of the provider will be created using\n * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.\n *\n * @returns {Object} registered provider instance\n\n * @example\n *\n * The following example shows how to create a simple event tracking service and register it using\n * {@link auto.$provide#provider $provide.provider()}.\n *\n * ```js\n * // Define the eventTracker provider\n * function EventTrackerProvider() {\n * var trackingUrl = '/track';\n *\n * // A provider method for configuring where the tracked events should been saved\n * this.setTrackingUrl = function(url) {\n * trackingUrl = url;\n * };\n *\n * // The service factory function\n * this.$get = ['$http', function($http) {\n * var trackedEvents = {};\n * return {\n * // Call this to track an event\n * event: function(event) {\n * var count = trackedEvents[event] || 0;\n * count += 1;\n * trackedEvents[event] = count;\n * return count;\n * },\n * // Call this to save the tracked events to the trackingUrl\n * save: function() {\n * $http.post(trackingUrl, trackedEvents);\n * }\n * };\n * }];\n * }\n *\n * describe('eventTracker', function() {\n * var postSpy;\n *\n * beforeEach(module(function($provide) {\n * // Register the eventTracker provider\n * $provide.provider('eventTracker', EventTrackerProvider);\n * }));\n *\n * beforeEach(module(function(eventTrackerProvider) {\n * // Configure eventTracker provider\n * eventTrackerProvider.setTrackingUrl('/custom-track');\n * }));\n *\n * it('tracks events', inject(function(eventTracker) {\n * expect(eventTracker.event('login')).toEqual(1);\n * expect(eventTracker.event('login')).toEqual(2);\n * }));\n *\n * it('saves to the tracking url', inject(function(eventTracker, $http) {\n * postSpy = spyOn($http, 'post');\n * eventTracker.event('login');\n * eventTracker.save();\n * expect(postSpy).toHaveBeenCalled();\n * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');\n * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');\n * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });\n * }));\n * });\n * ```\n */\n\n/**\n * @ngdoc method\n * @name $provide#factory\n * @description\n *\n * Register a **service factory**, which will be called to return the service instance.\n * This is short for registering a service where its provider consists of only a `$get` property,\n * which is the given service factory function.\n * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to\n * configure your service in a provider.\n *\n * @param {string} name The name of the instance.\n * @param {Function|Array.} $getFn The injectable $getFn for the instance creation.\n * Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service\n * ```js\n * $provide.factory('ping', ['$http', function($http) {\n * return function ping() {\n * return $http.send('/ping');\n * };\n * }]);\n * ```\n * You would then inject and use this service like this:\n * ```js\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping();\n * }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#service\n * @description\n *\n * Register a **service constructor**, which will be invoked with `new` to create the service\n * instance.\n * This is short for registering a service where its provider's `$get` property is a factory\n * function that returns an instance instantiated by the injector from the service constructor\n * function.\n *\n * Internally it looks a bit like this:\n *\n * ```\n * {\n * $get: function() {\n * return $injector.instantiate(constructor);\n * }\n * }\n * ```\n *\n *\n * You should use {@link auto.$provide#service $provide.service(class)} if you define your service\n * as a type/class.\n *\n * @param {string} name The name of the instance.\n * @param {Function|Array.} constructor An injectable class (constructor function)\n * that will be instantiated.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service using\n * {@link auto.$provide#service $provide.service(class)}.\n * ```js\n * var Ping = function($http) {\n * this.$http = $http;\n * };\n *\n * Ping.$inject = ['$http'];\n *\n * Ping.prototype.send = function() {\n * return this.$http.get('/ping');\n * };\n * $provide.service('ping', Ping);\n * ```\n * You would then inject and use this service like this:\n * ```js\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping.send();\n * }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#value\n * @description\n *\n * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a\n * number, an array, an object or a function. This is short for registering a service where its\n * provider's `$get` property is a factory function that takes no arguments and returns the **value\n * service**. That also means it is not possible to inject other services into a value service.\n *\n * Value services are similar to constant services, except that they cannot be injected into a\n * module configuration function (see {@link angular.Module#config}) but they can be overridden by\n * an Angular {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the instance.\n * @param {*} value The value.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here are some examples of creating value services.\n * ```js\n * $provide.value('ADMIN_USER', 'admin');\n *\n * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });\n *\n * $provide.value('halfOf', function(value) {\n * return value / 2;\n * });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#constant\n * @description\n *\n * Register a **constant service** with the {@link auto.$injector $injector}, such as a string,\n * a number, an array, an object or a function. Like the {@link auto.$provide#value value}, it is not\n * possible to inject other services into a constant.\n *\n * But unlike {@link auto.$provide#value value}, a constant can be\n * injected into a module configuration function (see {@link angular.Module#config}) and it cannot\n * be overridden by an Angular {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the constant.\n * @param {*} value The constant value.\n * @returns {Object} registered instance\n *\n * @example\n * Here a some examples of creating constants:\n * ```js\n * $provide.constant('SHARD_HEIGHT', 306);\n *\n * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);\n *\n * $provide.constant('double', function(value) {\n * return value * 2;\n * });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#decorator\n * @description\n *\n * Register a **decorator function** with the {@link auto.$injector $injector}. A decorator function\n * intercepts the creation of a service, allowing it to override or modify the behavior of the\n * service. The return value of the decorator function may be the original service, or a new service\n * that replaces (or wraps and delegates to) the original service.\n *\n * You can find out more about using decorators in the {@link guide/decorators} guide.\n *\n * @param {string} name The name of the service to decorate.\n * @param {Function|Array.} decorator This function will be invoked when the service needs to be\n * provided and should return the decorated service instance. The function is called using\n * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.\n * Local injection arguments:\n *\n * * `$delegate` - The original service instance, which can be replaced, monkey patched, configured,\n * decorated or delegated to.\n *\n * @example\n * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting\n * calls to {@link ng.$log#error $log.warn()}.\n * ```js\n * $provide.decorator('$log', ['$delegate', function($delegate) {\n * $delegate.warn = $delegate.error;\n * return $delegate;\n * }]);\n * ```\n */\n\n\nfunction createInjector(modulesToLoad, strictDi) {\n strictDi = (strictDi === true);\n var INSTANTIATING = {},\n providerSuffix = 'Provider',\n path = [],\n loadedModules = new HashMap([], true),\n providerCache = {\n $provide: {\n provider: supportObject(provider),\n factory: supportObject(factory),\n service: supportObject(service),\n value: supportObject(value),\n constant: supportObject(constant),\n decorator: decorator\n }\n },\n providerInjector = (providerCache.$injector =\n createInternalInjector(providerCache, function(serviceName, caller) {\n if (angular.isString(caller)) {\n path.push(caller);\n }\n throw $injectorMinErr('unpr', \"Unknown provider: {0}\", path.join(' <- '));\n })),\n instanceCache = {},\n protoInstanceInjector =\n createInternalInjector(instanceCache, function(serviceName, caller) {\n var provider = providerInjector.get(serviceName + providerSuffix, caller);\n return instanceInjector.invoke(\n provider.$get, provider, undefined, serviceName);\n }),\n instanceInjector = protoInstanceInjector;\n\n providerCache['$injector' + providerSuffix] = { $get: valueFn(protoInstanceInjector) };\n var runBlocks = loadModules(modulesToLoad);\n instanceInjector = protoInstanceInjector.get('$injector');\n instanceInjector.strictDi = strictDi;\n forEach(runBlocks, function(fn) { if (fn) instanceInjector.invoke(fn); });\n\n return instanceInjector;\n\n ////////////////////////////////////\n // $provider\n ////////////////////////////////////\n\n function supportObject(delegate) {\n return function(key, value) {\n if (isObject(key)) {\n forEach(key, reverseParams(delegate));\n } else {\n return delegate(key, value);\n }\n };\n }\n\n function provider(name, provider_) {\n assertNotHasOwnProperty(name, 'service');\n if (isFunction(provider_) || isArray(provider_)) {\n provider_ = providerInjector.instantiate(provider_);\n }\n if (!provider_.$get) {\n throw $injectorMinErr('pget', \"Provider '{0}' must define $get factory method.\", name);\n }\n return providerCache[name + providerSuffix] = provider_;\n }\n\n function enforceReturnValue(name, factory) {\n return function enforcedReturnValue() {\n var result = instanceInjector.invoke(factory, this);\n if (isUndefined(result)) {\n throw $injectorMinErr('undef', \"Provider '{0}' must return a value from $get factory method.\", name);\n }\n return result;\n };\n }\n\n function factory(name, factoryFn, enforce) {\n return provider(name, {\n $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn\n });\n }\n\n function service(name, constructor) {\n return factory(name, ['$injector', function($injector) {\n return $injector.instantiate(constructor);\n }]);\n }\n\n function value(name, val) { return factory(name, valueFn(val), false); }\n\n function constant(name, value) {\n assertNotHasOwnProperty(name, 'constant');\n providerCache[name] = value;\n instanceCache[name] = value;\n }\n\n function decorator(serviceName, decorFn) {\n var origProvider = providerInjector.get(serviceName + providerSuffix),\n orig$get = origProvider.$get;\n\n origProvider.$get = function() {\n var origInstance = instanceInjector.invoke(orig$get, origProvider);\n return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});\n };\n }\n\n ////////////////////////////////////\n // Module Loading\n ////////////////////////////////////\n function loadModules(modulesToLoad) {\n assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array');\n var runBlocks = [], moduleFn;\n forEach(modulesToLoad, function(module) {\n if (loadedModules.get(module)) return;\n loadedModules.put(module, true);\n\n function runInvokeQueue(queue) {\n var i, ii;\n for (i = 0, ii = queue.length; i < ii; i++) {\n var invokeArgs = queue[i],\n provider = providerInjector.get(invokeArgs[0]);\n\n provider[invokeArgs[1]].apply(provider, invokeArgs[2]);\n }\n }\n\n try {\n if (isString(module)) {\n moduleFn = angularModule(module);\n runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);\n runInvokeQueue(moduleFn._invokeQueue);\n runInvokeQueue(moduleFn._configBlocks);\n } else if (isFunction(module)) {\n runBlocks.push(providerInjector.invoke(module));\n } else if (isArray(module)) {\n runBlocks.push(providerInjector.invoke(module));\n } else {\n assertArgFn(module, 'module');\n }\n } catch (e) {\n if (isArray(module)) {\n module = module[module.length - 1];\n }\n if (e.message && e.stack && e.stack.indexOf(e.message) == -1) {\n // Safari & FF's stack traces don't contain error.message content\n // unlike those of Chrome and IE\n // So if stack doesn't contain message, we create a new string that contains both.\n // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.\n /* jshint -W022 */\n e = e.message + '\\n' + e.stack;\n }\n throw $injectorMinErr('modulerr', \"Failed to instantiate module {0} due to:\\n{1}\",\n module, e.stack || e.message || e);\n }\n });\n return runBlocks;\n }\n\n ////////////////////////////////////\n // internal Injector\n ////////////////////////////////////\n\n function createInternalInjector(cache, factory) {\n\n function getService(serviceName, caller) {\n if (cache.hasOwnProperty(serviceName)) {\n if (cache[serviceName] === INSTANTIATING) {\n throw $injectorMinErr('cdep', 'Circular dependency found: {0}',\n serviceName + ' <- ' + path.join(' <- '));\n }\n return cache[serviceName];\n } else {\n try {\n path.unshift(serviceName);\n cache[serviceName] = INSTANTIATING;\n return cache[serviceName] = factory(serviceName, caller);\n } catch (err) {\n if (cache[serviceName] === INSTANTIATING) {\n delete cache[serviceName];\n }\n throw err;\n } finally {\n path.shift();\n }\n }\n }\n\n\n function injectionArgs(fn, locals, serviceName) {\n var args = [],\n $inject = createInjector.$$annotate(fn, strictDi, serviceName);\n\n for (var i = 0, length = $inject.length; i < length; i++) {\n var key = $inject[i];\n if (typeof key !== 'string') {\n throw $injectorMinErr('itkn',\n 'Incorrect injection token! Expected service name as string, got {0}', key);\n }\n args.push(locals && locals.hasOwnProperty(key) ? locals[key] :\n getService(key, serviceName));\n }\n return args;\n }\n\n function isClass(func) {\n // IE 9-11 do not support classes and IE9 leaks with the code below.\n if (msie <= 11) {\n return false;\n }\n // Support: Edge 12-13 only\n // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/6156135/\n return typeof func === 'function'\n && /^(?:class\\b|constructor\\()/.test(stringifyFn(func));\n }\n\n function invoke(fn, self, locals, serviceName) {\n if (typeof locals === 'string') {\n serviceName = locals;\n locals = null;\n }\n\n var args = injectionArgs(fn, locals, serviceName);\n if (isArray(fn)) {\n fn = fn[fn.length - 1];\n }\n\n if (!isClass(fn)) {\n // http://jsperf.com/angularjs-invoke-apply-vs-switch\n // #5388\n return fn.apply(self, args);\n } else {\n args.unshift(null);\n return new (Function.prototype.bind.apply(fn, args))();\n }\n }\n\n\n function instantiate(Type, locals, serviceName) {\n // Check if Type is annotated and use just the given function at n-1 as parameter\n // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);\n var ctor = (isArray(Type) ? Type[Type.length - 1] : Type);\n var args = injectionArgs(Type, locals, serviceName);\n // Empty object at position 0 is ignored for invocation with `new`, but required.\n args.unshift(null);\n return new (Function.prototype.bind.apply(ctor, args))();\n }\n\n\n return {\n invoke: invoke,\n instantiate: instantiate,\n get: getService,\n annotate: createInjector.$$annotate,\n has: function(name) {\n return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);\n }\n };\n }\n}\n\ncreateInjector.$$annotate = annotate;\n\n/**\n * @ngdoc provider\n * @name $anchorScrollProvider\n *\n * @description\n * Use `$anchorScrollProvider` to disable automatic scrolling whenever\n * {@link ng.$location#hash $location.hash()} changes.\n */\nfunction $AnchorScrollProvider() {\n\n var autoScrollingEnabled = true;\n\n /**\n * @ngdoc method\n * @name $anchorScrollProvider#disableAutoScrolling\n *\n * @description\n * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to\n * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.
        \n * Use this method to disable automatic scrolling.\n *\n * If automatic scrolling is disabled, one must explicitly call\n * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the\n * current hash.\n */\n this.disableAutoScrolling = function() {\n autoScrollingEnabled = false;\n };\n\n /**\n * @ngdoc service\n * @name $anchorScroll\n * @kind function\n * @requires $window\n * @requires $location\n * @requires $rootScope\n *\n * @description\n * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the\n * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified\n * in the\n * [HTML5 spec](http://www.w3.org/html/wg/drafts/html/master/browsers.html#an-indicated-part-of-the-document).\n *\n * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to\n * match any anchor whenever it changes. This can be disabled by calling\n * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}.\n *\n * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a\n * vertical scroll-offset (either fixed or dynamic).\n *\n * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of\n * {@link ng.$location#hash $location.hash()} will be used.\n *\n * @property {(number|function|jqLite)} yOffset\n * If set, specifies a vertical scroll-offset. This is often useful when there are fixed\n * positioned elements at the top of the page, such as navbars, headers etc.\n *\n * `yOffset` can be specified in various ways:\n * - **number**: A fixed number of pixels to be used as offset.

        \n * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return\n * a number representing the offset (in pixels).

        \n * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from\n * the top of the page to the element's bottom will be used as offset.
        \n * **Note**: The element will be taken into account only as long as its `position` is set to\n * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust\n * their height and/or positioning according to the viewport's size.\n *\n *
        \n *
        \n * In order for `yOffset` to work properly, scrolling should take place on the document's root and\n * not some child element.\n *
        \n *\n * @example\n \n \n
        \n Go to bottom\n You're at the bottom!\n
        \n
        \n \n angular.module('anchorScrollExample', [])\n .controller('ScrollController', ['$scope', '$location', '$anchorScroll',\n function ($scope, $location, $anchorScroll) {\n $scope.gotoBottom = function() {\n // set the location.hash to the id of\n // the element you wish to scroll to.\n $location.hash('bottom');\n\n // call $anchorScroll()\n $anchorScroll();\n };\n }]);\n \n \n #scrollArea {\n height: 280px;\n overflow: auto;\n }\n\n #bottom {\n display: block;\n margin-top: 2000px;\n }\n \n
        \n *\n *
        \n * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value).\n * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details.\n *\n * @example\n \n \n \n
        \n Anchor {{x}} of 5\n
        \n
        \n \n angular.module('anchorScrollOffsetExample', [])\n .run(['$anchorScroll', function($anchorScroll) {\n $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels\n }])\n .controller('headerCtrl', ['$anchorScroll', '$location', '$scope',\n function ($anchorScroll, $location, $scope) {\n $scope.gotoAnchor = function(x) {\n var newHash = 'anchor' + x;\n if ($location.hash() !== newHash) {\n // set the $location.hash to `newHash` and\n // $anchorScroll will automatically scroll to it\n $location.hash('anchor' + x);\n } else {\n // call $anchorScroll() explicitly,\n // since $location.hash hasn't changed\n $anchorScroll();\n }\n };\n }\n ]);\n \n \n body {\n padding-top: 50px;\n }\n\n .anchor {\n border: 2px dashed DarkOrchid;\n padding: 10px 10px 200px 10px;\n }\n\n .fixed-header {\n background-color: rgba(0, 0, 0, 0.2);\n height: 50px;\n position: fixed;\n top: 0; left: 0; right: 0;\n }\n\n .fixed-header > a {\n display: inline-block;\n margin: 5px 15px;\n }\n \n
        \n */\n this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {\n var document = $window.document;\n\n // Helper function to get first anchor from a NodeList\n // (using `Array#some()` instead of `angular#forEach()` since it's more performant\n // and working in all supported browsers.)\n function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }\n\n function getYOffset() {\n\n var offset = scroll.yOffset;\n\n if (isFunction(offset)) {\n offset = offset();\n } else if (isElement(offset)) {\n var elem = offset[0];\n var style = $window.getComputedStyle(elem);\n if (style.position !== 'fixed') {\n offset = 0;\n } else {\n offset = elem.getBoundingClientRect().bottom;\n }\n } else if (!isNumber(offset)) {\n offset = 0;\n }\n\n return offset;\n }\n\n function scrollTo(elem) {\n if (elem) {\n elem.scrollIntoView();\n\n var offset = getYOffset();\n\n if (offset) {\n // `offset` is the number of pixels we should scroll UP in order to align `elem` properly.\n // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the\n // top of the viewport.\n //\n // IF the number of pixels from the top of `elem` to the end of the page's content is less\n // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some\n // way down the page.\n //\n // This is often the case for elements near the bottom of the page.\n //\n // In such cases we do not need to scroll the whole `offset` up, just the difference between\n // the top of the element and the offset, which is enough to align the top of `elem` at the\n // desired position.\n var elemTop = elem.getBoundingClientRect().top;\n $window.scrollBy(0, elemTop - offset);\n }\n } else {\n $window.scrollTo(0, 0);\n }\n }\n\n function scroll(hash) {\n hash = isString(hash) ? hash : $location.hash();\n var elm;\n\n // empty hash, scroll to the top of the page\n if (!hash) scrollTo(null);\n\n // element with given id\n else if ((elm = document.getElementById(hash))) scrollTo(elm);\n\n // first anchor with given name :-D\n else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);\n\n // no element and hash == 'top', scroll to the top of the page\n else if (hash === 'top') scrollTo(null);\n }\n\n // does not scroll when user clicks on anchor link that is currently on\n // (no url change, no $location.hash() change), browser native does scroll\n if (autoScrollingEnabled) {\n $rootScope.$watch(function autoScrollWatch() {return $location.hash();},\n function autoScrollWatchAction(newVal, oldVal) {\n // skip the initial scroll if $location.hash is empty\n if (newVal === oldVal && newVal === '') return;\n\n jqLiteDocumentLoaded(function() {\n $rootScope.$evalAsync(scroll);\n });\n });\n }\n\n return scroll;\n }];\n}\n\nvar $animateMinErr = minErr('$animate');\nvar ELEMENT_NODE = 1;\nvar NG_ANIMATE_CLASSNAME = 'ng-animate';\n\nfunction mergeClasses(a,b) {\n if (!a && !b) return '';\n if (!a) return b;\n if (!b) return a;\n if (isArray(a)) a = a.join(' ');\n if (isArray(b)) b = b.join(' ');\n return a + ' ' + b;\n}\n\nfunction extractElementNode(element) {\n for (var i = 0; i < element.length; i++) {\n var elm = element[i];\n if (elm.nodeType === ELEMENT_NODE) {\n return elm;\n }\n }\n}\n\nfunction splitClasses(classes) {\n if (isString(classes)) {\n classes = classes.split(' ');\n }\n\n // Use createMap() to prevent class assumptions involving property names in\n // Object.prototype\n var obj = createMap();\n forEach(classes, function(klass) {\n // sometimes the split leaves empty string values\n // incase extra spaces were applied to the options\n if (klass.length) {\n obj[klass] = true;\n }\n });\n return obj;\n}\n\n// if any other type of options value besides an Object value is\n// passed into the $animate.method() animation then this helper code\n// will be run which will ignore it. While this patch is not the\n// greatest solution to this, a lot of existing plugins depend on\n// $animate to either call the callback (< 1.2) or return a promise\n// that can be changed. This helper function ensures that the options\n// are wiped clean incase a callback function is provided.\nfunction prepareAnimateOptions(options) {\n return isObject(options)\n ? options\n : {};\n}\n\nvar $$CoreAnimateJsProvider = function() {\n this.$get = noop;\n};\n\n// this is prefixed with Core since it conflicts with\n// the animateQueueProvider defined in ngAnimate/animateQueue.js\nvar $$CoreAnimateQueueProvider = function() {\n var postDigestQueue = new HashMap();\n var postDigestElements = [];\n\n this.$get = ['$$AnimateRunner', '$rootScope',\n function($$AnimateRunner, $rootScope) {\n return {\n enabled: noop,\n on: noop,\n off: noop,\n pin: noop,\n\n push: function(element, event, options, domOperation) {\n domOperation && domOperation();\n\n options = options || {};\n options.from && element.css(options.from);\n options.to && element.css(options.to);\n\n if (options.addClass || options.removeClass) {\n addRemoveClassesPostDigest(element, options.addClass, options.removeClass);\n }\n\n var runner = new $$AnimateRunner(); // jshint ignore:line\n\n // since there are no animations to run the runner needs to be\n // notified that the animation call is complete.\n runner.complete();\n return runner;\n }\n };\n\n\n function updateData(data, classes, value) {\n var changed = false;\n if (classes) {\n classes = isString(classes) ? classes.split(' ') :\n isArray(classes) ? classes : [];\n forEach(classes, function(className) {\n if (className) {\n changed = true;\n data[className] = value;\n }\n });\n }\n return changed;\n }\n\n function handleCSSClassChanges() {\n forEach(postDigestElements, function(element) {\n var data = postDigestQueue.get(element);\n if (data) {\n var existing = splitClasses(element.attr('class'));\n var toAdd = '';\n var toRemove = '';\n forEach(data, function(status, className) {\n var hasClass = !!existing[className];\n if (status !== hasClass) {\n if (status) {\n toAdd += (toAdd.length ? ' ' : '') + className;\n } else {\n toRemove += (toRemove.length ? ' ' : '') + className;\n }\n }\n });\n\n forEach(element, function(elm) {\n toAdd && jqLiteAddClass(elm, toAdd);\n toRemove && jqLiteRemoveClass(elm, toRemove);\n });\n postDigestQueue.remove(element);\n }\n });\n postDigestElements.length = 0;\n }\n\n\n function addRemoveClassesPostDigest(element, add, remove) {\n var data = postDigestQueue.get(element) || {};\n\n var classesAdded = updateData(data, add, true);\n var classesRemoved = updateData(data, remove, false);\n\n if (classesAdded || classesRemoved) {\n\n postDigestQueue.put(element, data);\n postDigestElements.push(element);\n\n if (postDigestElements.length === 1) {\n $rootScope.$$postDigest(handleCSSClassChanges);\n }\n }\n }\n }];\n};\n\n/**\n * @ngdoc provider\n * @name $animateProvider\n *\n * @description\n * Default implementation of $animate that doesn't perform any animations, instead just\n * synchronously performs DOM updates and resolves the returned runner promise.\n *\n * In order to enable animations the `ngAnimate` module has to be loaded.\n *\n * To see the functional implementation check out `src/ngAnimate/animate.js`.\n */\nvar $AnimateProvider = ['$provide', function($provide) {\n var provider = this;\n\n this.$$registeredAnimations = Object.create(null);\n\n /**\n * @ngdoc method\n * @name $animateProvider#register\n *\n * @description\n * Registers a new injectable animation factory function. The factory function produces the\n * animation object which contains callback functions for each event that is expected to be\n * animated.\n *\n * * `eventFn`: `function(element, ... , doneFunction, options)`\n * The element to animate, the `doneFunction` and the options fed into the animation. Depending\n * on the type of animation additional arguments will be injected into the animation function. The\n * list below explains the function signatures for the different animation methods:\n *\n * - setClass: function(element, addedClasses, removedClasses, doneFunction, options)\n * - addClass: function(element, addedClasses, doneFunction, options)\n * - removeClass: function(element, removedClasses, doneFunction, options)\n * - enter, leave, move: function(element, doneFunction, options)\n * - animate: function(element, fromStyles, toStyles, doneFunction, options)\n *\n * Make sure to trigger the `doneFunction` once the animation is fully complete.\n *\n * ```js\n * return {\n * //enter, leave, move signature\n * eventFn : function(element, done, options) {\n * //code to run the animation\n * //once complete, then run done()\n * return function endFunction(wasCancelled) {\n * //code to cancel the animation\n * }\n * }\n * }\n * ```\n *\n * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to).\n * @param {Function} factory The factory function that will be executed to return the animation\n * object.\n */\n this.register = function(name, factory) {\n if (name && name.charAt(0) !== '.') {\n throw $animateMinErr('notcsel', \"Expecting class selector starting with '.' got '{0}'.\", name);\n }\n\n var key = name + '-animation';\n provider.$$registeredAnimations[name.substr(1)] = key;\n $provide.factory(key, factory);\n };\n\n /**\n * @ngdoc method\n * @name $animateProvider#classNameFilter\n *\n * @description\n * Sets and/or returns the CSS class regular expression that is checked when performing\n * an animation. Upon bootstrap the classNameFilter value is not set at all and will\n * therefore enable $animate to attempt to perform an animation on any element that is triggered.\n * When setting the `classNameFilter` value, animations will only be performed on elements\n * that successfully match the filter expression. This in turn can boost performance\n * for low-powered devices as well as applications containing a lot of structural operations.\n * @param {RegExp=} expression The className expression which will be checked against all animations\n * @return {RegExp} The current CSS className expression value. If null then there is no expression value\n */\n this.classNameFilter = function(expression) {\n if (arguments.length === 1) {\n this.$$classNameFilter = (expression instanceof RegExp) ? expression : null;\n if (this.$$classNameFilter) {\n var reservedRegex = new RegExp(\"(\\\\s+|\\\\/)\" + NG_ANIMATE_CLASSNAME + \"(\\\\s+|\\\\/)\");\n if (reservedRegex.test(this.$$classNameFilter.toString())) {\n throw $animateMinErr('nongcls','$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the \"{0}\" CSS class.', NG_ANIMATE_CLASSNAME);\n\n }\n }\n }\n return this.$$classNameFilter;\n };\n\n this.$get = ['$$animateQueue', function($$animateQueue) {\n function domInsert(element, parentElement, afterElement) {\n // if for some reason the previous element was removed\n // from the dom sometime before this code runs then let's\n // just stick to using the parent element as the anchor\n if (afterElement) {\n var afterNode = extractElementNode(afterElement);\n if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) {\n afterElement = null;\n }\n }\n afterElement ? afterElement.after(element) : parentElement.prepend(element);\n }\n\n /**\n * @ngdoc service\n * @name $animate\n * @description The $animate service exposes a series of DOM utility methods that provide support\n * for animation hooks. The default behavior is the application of DOM operations, however,\n * when an animation is detected (and animations are enabled), $animate will do the heavy lifting\n * to ensure that animation runs with the triggered DOM operation.\n *\n * By default $animate doesn't trigger any animations. This is because the `ngAnimate` module isn't\n * included and only when it is active then the animation hooks that `$animate` triggers will be\n * functional. Once active then all structural `ng-` directives will trigger animations as they perform\n * their DOM-related operations (enter, leave and move). Other directives such as `ngClass`,\n * `ngShow`, `ngHide` and `ngMessages` also provide support for animations.\n *\n * It is recommended that the`$animate` service is always used when executing DOM-related procedures within directives.\n *\n * To learn more about enabling animation support, click here to visit the\n * {@link ngAnimate ngAnimate module page}.\n */\n return {\n // we don't call it directly since non-existant arguments may\n // be interpreted as null within the sub enabled function\n\n /**\n *\n * @ngdoc method\n * @name $animate#on\n * @kind function\n * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)\n * has fired on the given element or among any of its children. Once the listener is fired, the provided callback\n * is fired with the following params:\n *\n * ```js\n * $animate.on('enter', container,\n * function callback(element, phase) {\n * // cool we detected an enter animation within the container\n * }\n * );\n * ```\n *\n * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)\n * @param {DOMElement} container the container element that will capture each of the animation events that are fired on itself\n * as well as among its children\n * @param {Function} callback the callback function that will be fired when the listener is triggered\n *\n * The arguments present in the callback function are:\n * * `element` - The captured DOM element that the animation was fired on.\n * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).\n */\n on: $$animateQueue.on,\n\n /**\n *\n * @ngdoc method\n * @name $animate#off\n * @kind function\n * @description Deregisters an event listener based on the event which has been associated with the provided element. This method\n * can be used in three different ways depending on the arguments:\n *\n * ```js\n * // remove all the animation event listeners listening for `enter`\n * $animate.off('enter');\n *\n * // remove listeners for all animation events from the container element\n * $animate.off(container);\n *\n * // remove all the animation event listeners listening for `enter` on the given element and its children\n * $animate.off('enter', container);\n *\n * // remove the event listener function provided by `callback` that is set\n * // to listen for `enter` on the given `container` as well as its children\n * $animate.off('enter', container, callback);\n * ```\n *\n * @param {string|DOMElement} event|container the animation event (e.g. enter, leave, move,\n * addClass, removeClass, etc...), or the container element. If it is the element, all other\n * arguments are ignored.\n * @param {DOMElement=} container the container element the event listener was placed on\n * @param {Function=} callback the callback function that was registered as the listener\n */\n off: $$animateQueue.off,\n\n /**\n * @ngdoc method\n * @name $animate#pin\n * @kind function\n * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists\n * outside of the DOM structure of the Angular application. By doing so, any animation triggered via `$animate` can be issued on the\n * element despite being outside the realm of the application or within another application. Say for example if the application\n * was bootstrapped on an element that is somewhere inside of the `` tag, but we wanted to allow for an element to be situated\n * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind\n * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.\n *\n * Note that this feature is only active when the `ngAnimate` module is used.\n *\n * @param {DOMElement} element the external element that will be pinned\n * @param {DOMElement} parentElement the host parent element that will be associated with the external element\n */\n pin: $$animateQueue.pin,\n\n /**\n *\n * @ngdoc method\n * @name $animate#enabled\n * @kind function\n * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This\n * function can be called in four ways:\n *\n * ```js\n * // returns true or false\n * $animate.enabled();\n *\n * // changes the enabled state for all animations\n * $animate.enabled(false);\n * $animate.enabled(true);\n *\n * // returns true or false if animations are enabled for an element\n * $animate.enabled(element);\n *\n * // changes the enabled state for an element and its children\n * $animate.enabled(element, true);\n * $animate.enabled(element, false);\n * ```\n *\n * @param {DOMElement=} element the element that will be considered for checking/setting the enabled state\n * @param {boolean=} enabled whether or not the animations will be enabled for the element\n *\n * @return {boolean} whether or not animations are enabled\n */\n enabled: $$animateQueue.enabled,\n\n /**\n * @ngdoc method\n * @name $animate#cancel\n * @kind function\n * @description Cancels the provided animation.\n *\n * @param {Promise} animationPromise The animation promise that is returned when an animation is started.\n */\n cancel: function(runner) {\n runner.end && runner.end();\n },\n\n /**\n *\n * @ngdoc method\n * @name $animate#enter\n * @kind function\n * @description Inserts the element into the DOM either after the `after` element (if provided) or\n * as the first child within the `parent` element and then triggers an animation.\n * A promise is returned that will be resolved during the next digest once the animation\n * has completed.\n *\n * @param {DOMElement} element the element which will be inserted into the DOM\n * @param {DOMElement} parent the parent element which will append the element as\n * a child (so long as the after element is not present)\n * @param {DOMElement=} after the sibling element after which the element will be appended\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n enter: function(element, parent, after, options) {\n parent = parent && jqLite(parent);\n after = after && jqLite(after);\n parent = parent || after.parent();\n domInsert(element, parent, after);\n return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options));\n },\n\n /**\n *\n * @ngdoc method\n * @name $animate#move\n * @kind function\n * @description Inserts (moves) the element into its new position in the DOM either after\n * the `after` element (if provided) or as the first child within the `parent` element\n * and then triggers an animation. A promise is returned that will be resolved\n * during the next digest once the animation has completed.\n *\n * @param {DOMElement} element the element which will be moved into the new DOM position\n * @param {DOMElement} parent the parent element which will append the element as\n * a child (so long as the after element is not present)\n * @param {DOMElement=} after the sibling element after which the element will be appended\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n move: function(element, parent, after, options) {\n parent = parent && jqLite(parent);\n after = after && jqLite(after);\n parent = parent || after.parent();\n domInsert(element, parent, after);\n return $$animateQueue.push(element, 'move', prepareAnimateOptions(options));\n },\n\n /**\n * @ngdoc method\n * @name $animate#leave\n * @kind function\n * @description Triggers an animation and then removes the element from the DOM.\n * When the function is called a promise is returned that will be resolved during the next\n * digest once the animation has completed.\n *\n * @param {DOMElement} element the element which will be removed from the DOM\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n leave: function(element, options) {\n return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() {\n element.remove();\n });\n },\n\n /**\n * @ngdoc method\n * @name $animate#addClass\n * @kind function\n *\n * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon\n * execution, the addClass operation will only be handled after the next digest and it will not trigger an\n * animation if element already contains the CSS class or if the class is removed at a later step.\n * Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n addClass: function(element, className, options) {\n options = prepareAnimateOptions(options);\n options.addClass = mergeClasses(options.addclass, className);\n return $$animateQueue.push(element, 'addClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#removeClass\n * @kind function\n *\n * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon\n * execution, the removeClass operation will only be handled after the next digest and it will not trigger an\n * animation if element does not contain the CSS class or if the class is added at a later step.\n * Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n removeClass: function(element, className, options) {\n options = prepareAnimateOptions(options);\n options.removeClass = mergeClasses(options.removeClass, className);\n return $$animateQueue.push(element, 'removeClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#setClass\n * @kind function\n *\n * @description Performs both the addition and removal of a CSS classes on an element and (during the process)\n * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and\n * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has\n * passed. Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)\n * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n setClass: function(element, add, remove, options) {\n options = prepareAnimateOptions(options);\n options.addClass = mergeClasses(options.addClass, add);\n options.removeClass = mergeClasses(options.removeClass, remove);\n return $$animateQueue.push(element, 'setClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#animate\n * @kind function\n *\n * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element.\n * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take\n * on the provided styles. For example, if a transition animation is set for the given classNamem, then the provided `from` and\n * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding\n * style in `to`, the style in `from` is applied immediately, and no animation is run.\n * If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate`\n * method (or as part of the `options` parameter):\n *\n * ```js\n * ngModule.animation('.my-inline-animation', function() {\n * return {\n * animate : function(element, from, to, done, options) {\n * //animation\n * done();\n * }\n * }\n * });\n * ```\n *\n * @param {DOMElement} element the element which the CSS styles will be applied to\n * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation.\n * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation.\n * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If\n * this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.\n * (Note that if no animation is detected then this value will not be applied to the element.)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Promise} the animation callback promise\n */\n animate: function(element, from, to, className, options) {\n options = prepareAnimateOptions(options);\n options.from = options.from ? extend(options.from, from) : from;\n options.to = options.to ? extend(options.to, to) : to;\n\n className = className || 'ng-inline-animate';\n options.tempClasses = mergeClasses(options.tempClasses, className);\n return $$animateQueue.push(element, 'animate', options);\n }\n };\n }];\n}];\n\nvar $$AnimateAsyncRunFactoryProvider = function() {\n this.$get = ['$$rAF', function($$rAF) {\n var waitQueue = [];\n\n function waitForTick(fn) {\n waitQueue.push(fn);\n if (waitQueue.length > 1) return;\n $$rAF(function() {\n for (var i = 0; i < waitQueue.length; i++) {\n waitQueue[i]();\n }\n waitQueue = [];\n });\n }\n\n return function() {\n var passed = false;\n waitForTick(function() {\n passed = true;\n });\n return function(callback) {\n passed ? callback() : waitForTick(callback);\n };\n };\n }];\n};\n\nvar $$AnimateRunnerFactoryProvider = function() {\n this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$document', '$timeout',\n function($q, $sniffer, $$animateAsyncRun, $document, $timeout) {\n\n var INITIAL_STATE = 0;\n var DONE_PENDING_STATE = 1;\n var DONE_COMPLETE_STATE = 2;\n\n AnimateRunner.chain = function(chain, callback) {\n var index = 0;\n\n next();\n function next() {\n if (index === chain.length) {\n callback(true);\n return;\n }\n\n chain[index](function(response) {\n if (response === false) {\n callback(false);\n return;\n }\n index++;\n next();\n });\n }\n };\n\n AnimateRunner.all = function(runners, callback) {\n var count = 0;\n var status = true;\n forEach(runners, function(runner) {\n runner.done(onProgress);\n });\n\n function onProgress(response) {\n status = status && response;\n if (++count === runners.length) {\n callback(status);\n }\n }\n };\n\n function AnimateRunner(host) {\n this.setHost(host);\n\n var rafTick = $$animateAsyncRun();\n var timeoutTick = function(fn) {\n $timeout(fn, 0, false);\n };\n\n this._doneCallbacks = [];\n this._tick = function(fn) {\n var doc = $document[0];\n\n // the document may not be ready or attached\n // to the module for some internal tests\n if (doc && doc.hidden) {\n timeoutTick(fn);\n } else {\n rafTick(fn);\n }\n };\n this._state = 0;\n }\n\n AnimateRunner.prototype = {\n setHost: function(host) {\n this.host = host || {};\n },\n\n done: function(fn) {\n if (this._state === DONE_COMPLETE_STATE) {\n fn();\n } else {\n this._doneCallbacks.push(fn);\n }\n },\n\n progress: noop,\n\n getPromise: function() {\n if (!this.promise) {\n var self = this;\n this.promise = $q(function(resolve, reject) {\n self.done(function(status) {\n status === false ? reject() : resolve();\n });\n });\n }\n return this.promise;\n },\n\n then: function(resolveHandler, rejectHandler) {\n return this.getPromise().then(resolveHandler, rejectHandler);\n },\n\n 'catch': function(handler) {\n return this.getPromise()['catch'](handler);\n },\n\n 'finally': function(handler) {\n return this.getPromise()['finally'](handler);\n },\n\n pause: function() {\n if (this.host.pause) {\n this.host.pause();\n }\n },\n\n resume: function() {\n if (this.host.resume) {\n this.host.resume();\n }\n },\n\n end: function() {\n if (this.host.end) {\n this.host.end();\n }\n this._resolve(true);\n },\n\n cancel: function() {\n if (this.host.cancel) {\n this.host.cancel();\n }\n this._resolve(false);\n },\n\n complete: function(response) {\n var self = this;\n if (self._state === INITIAL_STATE) {\n self._state = DONE_PENDING_STATE;\n self._tick(function() {\n self._resolve(response);\n });\n }\n },\n\n _resolve: function(response) {\n if (this._state !== DONE_COMPLETE_STATE) {\n forEach(this._doneCallbacks, function(fn) {\n fn(response);\n });\n this._doneCallbacks.length = 0;\n this._state = DONE_COMPLETE_STATE;\n }\n }\n };\n\n return AnimateRunner;\n }];\n};\n\n/**\n * @ngdoc service\n * @name $animateCss\n * @kind object\n *\n * @description\n * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included,\n * then the `$animateCss` service will actually perform animations.\n *\n * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}.\n */\nvar $CoreAnimateCssProvider = function() {\n this.$get = ['$$rAF', '$q', '$$AnimateRunner', function($$rAF, $q, $$AnimateRunner) {\n\n return function(element, initialOptions) {\n // all of the animation functions should create\n // a copy of the options data, however, if a\n // parent service has already created a copy then\n // we should stick to using that\n var options = initialOptions || {};\n if (!options.$$prepared) {\n options = copy(options);\n }\n\n // there is no point in applying the styles since\n // there is no animation that goes on at all in\n // this version of $animateCss.\n if (options.cleanupStyles) {\n options.from = options.to = null;\n }\n\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n\n /* jshint newcap: false */\n var closed, runner = new $$AnimateRunner();\n return {\n start: run,\n end: run\n };\n\n function run() {\n $$rAF(function() {\n applyAnimationContents();\n if (!closed) {\n runner.complete();\n }\n closed = true;\n });\n return runner;\n }\n\n function applyAnimationContents() {\n if (options.addClass) {\n element.addClass(options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n element.removeClass(options.removeClass);\n options.removeClass = null;\n }\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n }\n };\n }];\n};\n\n/* global stripHash: true */\n\n/**\n * ! This is a private undocumented service !\n *\n * @name $browser\n * @requires $log\n * @description\n * This object has two goals:\n *\n * - hide all the global state in the browser caused by the window object\n * - abstract away all the browser specific features and inconsistencies\n *\n * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`\n * service, which can be used for convenient testing of the application without the interaction with\n * the real browser apis.\n */\n/**\n * @param {object} window The global window object.\n * @param {object} document jQuery wrapped document.\n * @param {object} $log window.console or an object with the same interface.\n * @param {object} $sniffer $sniffer service\n */\nfunction Browser(window, document, $log, $sniffer) {\n var self = this,\n location = window.location,\n history = window.history,\n setTimeout = window.setTimeout,\n clearTimeout = window.clearTimeout,\n pendingDeferIds = {};\n\n self.isMock = false;\n\n var outstandingRequestCount = 0;\n var outstandingRequestCallbacks = [];\n\n // TODO(vojta): remove this temporary api\n self.$$completeOutstandingRequest = completeOutstandingRequest;\n self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };\n\n /**\n * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`\n * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.\n */\n function completeOutstandingRequest(fn) {\n try {\n fn.apply(null, sliceArgs(arguments, 1));\n } finally {\n outstandingRequestCount--;\n if (outstandingRequestCount === 0) {\n while (outstandingRequestCallbacks.length) {\n try {\n outstandingRequestCallbacks.pop()();\n } catch (e) {\n $log.error(e);\n }\n }\n }\n }\n }\n\n function getHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? '' : url.substr(index);\n }\n\n /**\n * @private\n * Note: this method is used only by scenario runner\n * TODO(vojta): prefix this method with $$ ?\n * @param {function()} callback Function that will be called when no outstanding request\n */\n self.notifyWhenNoOutstandingRequests = function(callback) {\n if (outstandingRequestCount === 0) {\n callback();\n } else {\n outstandingRequestCallbacks.push(callback);\n }\n };\n\n //////////////////////////////////////////////////////////////\n // URL API\n //////////////////////////////////////////////////////////////\n\n var cachedState, lastHistoryState,\n lastBrowserUrl = location.href,\n baseElement = document.find('base'),\n pendingLocation = null,\n getCurrentState = !$sniffer.history ? noop : function getCurrentState() {\n try {\n return history.state;\n } catch (e) {\n // MSIE can reportedly throw when there is no state (UNCONFIRMED).\n }\n };\n\n cacheState();\n lastHistoryState = cachedState;\n\n /**\n * @name $browser#url\n *\n * @description\n * GETTER:\n * Without any argument, this method just returns current value of location.href.\n *\n * SETTER:\n * With at least one argument, this method sets url to new value.\n * If html5 history api supported, pushState/replaceState is used, otherwise\n * location.href/location.replace is used.\n * Returns its own instance to allow chaining\n *\n * NOTE: this api is intended for use only by the $location service. Please use the\n * {@link ng.$location $location service} to change url.\n *\n * @param {string} url New url (when used as setter)\n * @param {boolean=} replace Should new url replace current history record?\n * @param {object=} state object to use with pushState/replaceState\n */\n self.url = function(url, replace, state) {\n // In modern browsers `history.state` is `null` by default; treating it separately\n // from `undefined` would cause `$browser.url('/foo')` to change `history.state`\n // to undefined via `pushState`. Instead, let's change `undefined` to `null` here.\n if (isUndefined(state)) {\n state = null;\n }\n\n // Android Browser BFCache causes location, history reference to become stale.\n if (location !== window.location) location = window.location;\n if (history !== window.history) history = window.history;\n\n // setter\n if (url) {\n var sameState = lastHistoryState === state;\n\n // Don't change anything if previous and current URLs and states match. This also prevents\n // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.\n // See https://github.com/angular/angular.js/commit/ffb2701\n if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {\n return self;\n }\n var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);\n lastBrowserUrl = url;\n lastHistoryState = state;\n // Don't use history API if only the hash changed\n // due to a bug in IE10/IE11 which leads\n // to not firing a `hashchange` nor `popstate` event\n // in some cases (see #9143).\n if ($sniffer.history && (!sameBase || !sameState)) {\n history[replace ? 'replaceState' : 'pushState'](state, '', url);\n cacheState();\n // Do the assignment again so that those two variables are referentially identical.\n lastHistoryState = cachedState;\n } else {\n if (!sameBase) {\n pendingLocation = url;\n }\n if (replace) {\n location.replace(url);\n } else if (!sameBase) {\n location.href = url;\n } else {\n location.hash = getHash(url);\n }\n if (location.href !== url) {\n pendingLocation = url;\n }\n }\n if (pendingLocation) {\n pendingLocation = url;\n }\n return self;\n // getter\n } else {\n // - pendingLocation is needed as browsers don't allow to read out\n // the new location.href if a reload happened or if there is a bug like in iOS 9 (see\n // https://openradar.appspot.com/22186109).\n // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172\n return pendingLocation || location.href.replace(/%27/g,\"'\");\n }\n };\n\n /**\n * @name $browser#state\n *\n * @description\n * This method is a getter.\n *\n * Return history.state or null if history.state is undefined.\n *\n * @returns {object} state\n */\n self.state = function() {\n return cachedState;\n };\n\n var urlChangeListeners = [],\n urlChangeInit = false;\n\n function cacheStateAndFireUrlChange() {\n pendingLocation = null;\n cacheState();\n fireUrlChange();\n }\n\n // This variable should be used *only* inside the cacheState function.\n var lastCachedState = null;\n function cacheState() {\n // This should be the only place in $browser where `history.state` is read.\n cachedState = getCurrentState();\n cachedState = isUndefined(cachedState) ? null : cachedState;\n\n // Prevent callbacks fo fire twice if both hashchange & popstate were fired.\n if (equals(cachedState, lastCachedState)) {\n cachedState = lastCachedState;\n }\n lastCachedState = cachedState;\n }\n\n function fireUrlChange() {\n if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {\n return;\n }\n\n lastBrowserUrl = self.url();\n lastHistoryState = cachedState;\n forEach(urlChangeListeners, function(listener) {\n listener(self.url(), cachedState);\n });\n }\n\n /**\n * @name $browser#onUrlChange\n *\n * @description\n * Register callback function that will be called, when url changes.\n *\n * It's only called when the url is changed from outside of angular:\n * - user types different url into address bar\n * - user clicks on history (forward/back) button\n * - user clicks on a link\n *\n * It's not called when url is changed by $browser.url() method\n *\n * The listener gets called with new url as parameter.\n *\n * NOTE: this api is intended for use only by the $location service. Please use the\n * {@link ng.$location $location service} to monitor url changes in angular apps.\n *\n * @param {function(string)} listener Listener function to be called when url changes.\n * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.\n */\n self.onUrlChange = function(callback) {\n // TODO(vojta): refactor to use node's syntax for events\n if (!urlChangeInit) {\n // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)\n // don't fire popstate when user change the address bar and don't fire hashchange when url\n // changed by push/replaceState\n\n // html5 history api - popstate event\n if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);\n // hashchange event\n jqLite(window).on('hashchange', cacheStateAndFireUrlChange);\n\n urlChangeInit = true;\n }\n\n urlChangeListeners.push(callback);\n return callback;\n };\n\n /**\n * @private\n * Remove popstate and hashchange handler from window.\n *\n * NOTE: this api is intended for use only by $rootScope.\n */\n self.$$applicationDestroyed = function() {\n jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange);\n };\n\n /**\n * Checks whether the url has changed outside of Angular.\n * Needs to be exported to be able to check for changes that have been done in sync,\n * as hashchange/popstate events fire in async.\n */\n self.$$checkUrlChange = fireUrlChange;\n\n //////////////////////////////////////////////////////////////\n // Misc API\n //////////////////////////////////////////////////////////////\n\n /**\n * @name $browser#baseHref\n *\n * @description\n * Returns current \n * (always relative - without domain)\n *\n * @returns {string} The current base href\n */\n self.baseHref = function() {\n var href = baseElement.attr('href');\n return href ? href.replace(/^(https?\\:)?\\/\\/[^\\/]*/, '') : '';\n };\n\n /**\n * @name $browser#defer\n * @param {function()} fn A function, who's execution should be deferred.\n * @param {number=} [delay=0] of milliseconds to defer the function execution.\n * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.\n *\n * @description\n * Executes a fn asynchronously via `setTimeout(fn, delay)`.\n *\n * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using\n * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed\n * via `$browser.defer.flush()`.\n *\n */\n self.defer = function(fn, delay) {\n var timeoutId;\n outstandingRequestCount++;\n timeoutId = setTimeout(function() {\n delete pendingDeferIds[timeoutId];\n completeOutstandingRequest(fn);\n }, delay || 0);\n pendingDeferIds[timeoutId] = true;\n return timeoutId;\n };\n\n\n /**\n * @name $browser#defer.cancel\n *\n * @description\n * Cancels a deferred task identified with `deferId`.\n *\n * @param {*} deferId Token returned by the `$browser.defer` function.\n * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n * canceled.\n */\n self.defer.cancel = function(deferId) {\n if (pendingDeferIds[deferId]) {\n delete pendingDeferIds[deferId];\n clearTimeout(deferId);\n completeOutstandingRequest(noop);\n return true;\n }\n return false;\n };\n\n}\n\nfunction $BrowserProvider() {\n this.$get = ['$window', '$log', '$sniffer', '$document',\n function($window, $log, $sniffer, $document) {\n return new Browser($window, $document, $log, $sniffer);\n }];\n}\n\n/**\n * @ngdoc service\n * @name $cacheFactory\n *\n * @description\n * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to\n * them.\n *\n * ```js\n *\n * var cache = $cacheFactory('cacheId');\n * expect($cacheFactory.get('cacheId')).toBe(cache);\n * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();\n *\n * cache.put(\"key\", \"value\");\n * cache.put(\"another key\", \"another value\");\n *\n * // We've specified no options on creation\n * expect(cache.info()).toEqual({id: 'cacheId', size: 2});\n *\n * ```\n *\n *\n * @param {string} cacheId Name or id of the newly created cache.\n * @param {object=} options Options object that specifies the cache behavior. Properties:\n *\n * - `{number=}` `capacity` — turns the cache into LRU cache.\n *\n * @returns {object} Newly created cache object with the following set of methods:\n *\n * - `{object}` `info()` — Returns id, size, and options of cache.\n * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns\n * it.\n * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.\n * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.\n * - `{void}` `removeAll()` — Removes all cached values.\n * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.\n *\n * @example\n \n \n
        \n \n \n \n\n

        Cached Values

        \n
        \n \n : \n \n
        \n\n

        Cache Info

        \n
        \n \n : \n \n
        \n
        \n
        \n \n angular.module('cacheExampleApp', []).\n controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {\n $scope.keys = [];\n $scope.cache = $cacheFactory('cacheId');\n $scope.put = function(key, value) {\n if (angular.isUndefined($scope.cache.get(key))) {\n $scope.keys.push(key);\n }\n $scope.cache.put(key, angular.isUndefined(value) ? null : value);\n };\n }]);\n \n \n p {\n margin: 10px 0 3px;\n }\n \n
        \n */\nfunction $CacheFactoryProvider() {\n\n this.$get = function() {\n var caches = {};\n\n function cacheFactory(cacheId, options) {\n if (cacheId in caches) {\n throw minErr('$cacheFactory')('iid', \"CacheId '{0}' is already taken!\", cacheId);\n }\n\n var size = 0,\n stats = extend({}, options, {id: cacheId}),\n data = createMap(),\n capacity = (options && options.capacity) || Number.MAX_VALUE,\n lruHash = createMap(),\n freshEnd = null,\n staleEnd = null;\n\n /**\n * @ngdoc type\n * @name $cacheFactory.Cache\n *\n * @description\n * A cache object used to store and retrieve data, primarily used by\n * {@link $http $http} and the {@link ng.directive:script script} directive to cache\n * templates and other data.\n *\n * ```js\n * angular.module('superCache')\n * .factory('superCache', ['$cacheFactory', function($cacheFactory) {\n * return $cacheFactory('super-cache');\n * }]);\n * ```\n *\n * Example test:\n *\n * ```js\n * it('should behave like a cache', inject(function(superCache) {\n * superCache.put('key', 'value');\n * superCache.put('another key', 'another value');\n *\n * expect(superCache.info()).toEqual({\n * id: 'super-cache',\n * size: 2\n * });\n *\n * superCache.remove('another key');\n * expect(superCache.get('another key')).toBeUndefined();\n *\n * superCache.removeAll();\n * expect(superCache.info()).toEqual({\n * id: 'super-cache',\n * size: 0\n * });\n * }));\n * ```\n */\n return caches[cacheId] = {\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#put\n * @kind function\n *\n * @description\n * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be\n * retrieved later, and incrementing the size of the cache if the key was not already\n * present in the cache. If behaving like an LRU cache, it will also remove stale\n * entries from the set.\n *\n * It will not insert undefined values into the cache.\n *\n * @param {string} key the key under which the cached data is stored.\n * @param {*} value the value to store alongside the key. If it is undefined, the key\n * will not be stored.\n * @returns {*} the value stored.\n */\n put: function(key, value) {\n if (isUndefined(value)) return;\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key] || (lruHash[key] = {key: key});\n\n refresh(lruEntry);\n }\n\n if (!(key in data)) size++;\n data[key] = value;\n\n if (size > capacity) {\n this.remove(staleEnd.key);\n }\n\n return value;\n },\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#get\n * @kind function\n *\n * @description\n * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.\n *\n * @param {string} key the key of the data to be retrieved\n * @returns {*} the value stored.\n */\n get: function(key) {\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key];\n\n if (!lruEntry) return;\n\n refresh(lruEntry);\n }\n\n return data[key];\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#remove\n * @kind function\n *\n * @description\n * Removes an entry from the {@link $cacheFactory.Cache Cache} object.\n *\n * @param {string} key the key of the entry to be removed\n */\n remove: function(key) {\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key];\n\n if (!lruEntry) return;\n\n if (lruEntry == freshEnd) freshEnd = lruEntry.p;\n if (lruEntry == staleEnd) staleEnd = lruEntry.n;\n link(lruEntry.n,lruEntry.p);\n\n delete lruHash[key];\n }\n\n if (!(key in data)) return;\n\n delete data[key];\n size--;\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#removeAll\n * @kind function\n *\n * @description\n * Clears the cache object of any entries.\n */\n removeAll: function() {\n data = createMap();\n size = 0;\n lruHash = createMap();\n freshEnd = staleEnd = null;\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#destroy\n * @kind function\n *\n * @description\n * Destroys the {@link $cacheFactory.Cache Cache} object entirely,\n * removing it from the {@link $cacheFactory $cacheFactory} set.\n */\n destroy: function() {\n data = null;\n stats = null;\n lruHash = null;\n delete caches[cacheId];\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#info\n * @kind function\n *\n * @description\n * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.\n *\n * @returns {object} an object with the following properties:\n *
          \n *
        • **id**: the id of the cache instance
        • \n *
        • **size**: the number of entries kept in the cache instance
        • \n *
        • **...**: any additional properties from the options object when creating the\n * cache.
        • \n *
        \n */\n info: function() {\n return extend({}, stats, {size: size});\n }\n };\n\n\n /**\n * makes the `entry` the freshEnd of the LRU linked list\n */\n function refresh(entry) {\n if (entry != freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd == entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }\n\n\n /**\n * bidirectionally links two entries of the LRU linked list\n */\n function link(nextEntry, prevEntry) {\n if (nextEntry != prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory#info\n *\n * @description\n * Get information about all the caches that have been created\n *\n * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`\n */\n cacheFactory.info = function() {\n var info = {};\n forEach(caches, function(cache, cacheId) {\n info[cacheId] = cache.info();\n });\n return info;\n };\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory#get\n *\n * @description\n * Get access to a cache object by the `cacheId` used when it was created.\n *\n * @param {string} cacheId Name or id of a cache to access.\n * @returns {object} Cache object identified by the cacheId or undefined if no such cache.\n */\n cacheFactory.get = function(cacheId) {\n return caches[cacheId];\n };\n\n\n return cacheFactory;\n };\n}\n\n/**\n * @ngdoc service\n * @name $templateCache\n *\n * @description\n * The first time a template is used, it is loaded in the template cache for quick retrieval. You\n * can load templates directly into the cache in a `script` tag, or by consuming the\n * `$templateCache` service directly.\n *\n * Adding via the `script` tag:\n *\n * ```html\n * \n * ```\n *\n * **Note:** the `script` tag containing the template does not need to be included in the `head` of\n * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE,\n * element with ng-app attribute), otherwise the template will be ignored.\n *\n * Adding via the `$templateCache` service:\n *\n * ```js\n * var myApp = angular.module('myApp', []);\n * myApp.run(function($templateCache) {\n * $templateCache.put('templateId.html', 'This is the content of the template');\n * });\n * ```\n *\n * To retrieve the template later, simply use it in your HTML:\n * ```html\n *
        \n * ```\n *\n * or get it via Javascript:\n * ```js\n * $templateCache.get('templateId.html')\n * ```\n *\n * See {@link ng.$cacheFactory $cacheFactory}.\n *\n */\nfunction $TemplateCacheProvider() {\n this.$get = ['$cacheFactory', function($cacheFactory) {\n return $cacheFactory('templates');\n }];\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!\n *\n * DOM-related variables:\n *\n * - \"node\" - DOM Node\n * - \"element\" - DOM Element or Node\n * - \"$node\" or \"$element\" - jqLite-wrapped node or element\n *\n *\n * Compiler related stuff:\n *\n * - \"linkFn\" - linking fn of a single directive\n * - \"nodeLinkFn\" - function that aggregates all linking fns for a particular node\n * - \"childLinkFn\" - function that aggregates all linking fns for child nodes of a particular node\n * - \"compositeLinkFn\" - function that aggregates all linking fns for a compilation root (nodeList)\n */\n\n\n/**\n * @ngdoc service\n * @name $compile\n * @kind function\n *\n * @description\n * Compiles an HTML string or DOM into a template and produces a template function, which\n * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.\n *\n * The compilation is a process of walking the DOM tree and matching DOM elements to\n * {@link ng.$compileProvider#directive directives}.\n *\n *
        \n * **Note:** This document is an in-depth reference of all directive options.\n * For a gentle introduction to directives with examples of common use cases,\n * see the {@link guide/directive directive guide}.\n *
        \n *\n * ## Comprehensive Directive API\n *\n * There are many different options for a directive.\n *\n * The difference resides in the return value of the factory function.\n * You can either return a {@link $compile#directive-definition-object Directive Definition Object (see below)}\n * that defines the directive properties, or just the `postLink` function (all other properties will have\n * the default values).\n *\n *
        \n * **Best Practice:** It's recommended to use the \"directive definition object\" form.\n *
        \n *\n * Here's an example directive declared with a Directive Definition Object:\n *\n * ```js\n * var myModule = angular.module(...);\n *\n * myModule.directive('directiveName', function factory(injectables) {\n * var directiveDefinitionObject = {\n * priority: 0,\n * template: '
        ', // or // function(tElement, tAttrs) { ... },\n * // or\n * // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... },\n * transclude: false,\n * restrict: 'A',\n * templateNamespace: 'html',\n * scope: false,\n * controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },\n * controllerAs: 'stringIdentifier',\n * bindToController: false,\n * require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],\n * compile: function compile(tElement, tAttrs, transclude) {\n * return {\n * pre: function preLink(scope, iElement, iAttrs, controller) { ... },\n * post: function postLink(scope, iElement, iAttrs, controller) { ... }\n * }\n * // or\n * // return function postLink( ... ) { ... }\n * },\n * // or\n * // link: {\n * // pre: function preLink(scope, iElement, iAttrs, controller) { ... },\n * // post: function postLink(scope, iElement, iAttrs, controller) { ... }\n * // }\n * // or\n * // link: function postLink( ... ) { ... }\n * };\n * return directiveDefinitionObject;\n * });\n * ```\n *\n *
        \n * **Note:** Any unspecified options will use the default value. You can see the default values below.\n *
        \n *\n * Therefore the above can be simplified as:\n *\n * ```js\n * var myModule = angular.module(...);\n *\n * myModule.directive('directiveName', function factory(injectables) {\n * var directiveDefinitionObject = {\n * link: function postLink(scope, iElement, iAttrs) { ... }\n * };\n * return directiveDefinitionObject;\n * // or\n * // return function postLink(scope, iElement, iAttrs) { ... }\n * });\n * ```\n *\n * ### Life-cycle hooks\n * Directive controllers can provide the following methods that are called by Angular at points in the life-cycle of the\n * directive:\n * * `$onInit()` - Called on each controller after all the controllers on an element have been constructed and\n * had their bindings initialized (and before the pre & post linking functions for the directives on\n * this element). This is a good place to put initialization code for your controller.\n * * `$onChanges(changesObj)` - Called whenever one-way (`<`) or interpolation (`@`) bindings are updated. The\n * `changesObj` is a hash whose keys are the names of the bound properties that have changed, and the values are an\n * object of the form `{ currentValue, previousValue, isFirstChange() }`. Use this hook to trigger updates within a\n * component such as cloning the bound value to prevent accidental mutation of the outer value.\n * * `$doCheck()` - Called on each turn of the digest cycle. Provides an opportunity to detect and act on\n * changes. Any actions that you wish to take in response to the changes that you detect must be\n * invoked from this hook; implementing this has no effect on when `$onChanges` is called. For example, this hook\n * could be useful if you wish to perform a deep equality check, or to check a Date object, changes to which would not\n * be detected by Angular's change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments;\n * if detecting changes, you must store the previous value(s) for comparison to the current values.\n * * `$onDestroy()` - Called on a controller when its containing scope is destroyed. Use this hook for releasing\n * external resources, watches and event handlers. Note that components have their `$onDestroy()` hooks called in\n * the same order as the `$scope.$broadcast` events are triggered, which is top down. This means that parent\n * components will have their `$onDestroy()` hook called before child components.\n * * `$postLink()` - Called after this controller's element and its children have been linked. Similar to the post-link\n * function this hook can be used to set up DOM event handlers and do direct DOM manipulation.\n * Note that child elements that contain `templateUrl` directives will not have been compiled and linked since\n * they are waiting for their template to load asynchronously and their own compilation and linking has been\n * suspended until that occurs.\n *\n * #### Comparison with Angular 2 life-cycle hooks\n * Angular 2 also uses life-cycle hooks for its components. While the Angular 1 life-cycle hooks are similar there are\n * some differences that you should be aware of, especially when it comes to moving your code from Angular 1 to Angular 2:\n *\n * * Angular 1 hooks are prefixed with `$`, such as `$onInit`. Angular 2 hooks are prefixed with `ng`, such as `ngOnInit`.\n * * Angular 1 hooks can be defined on the controller prototype or added to the controller inside its constructor.\n * In Angular 2 you can only define hooks on the prototype of the Component class.\n * * Due to the differences in change-detection, you may get many more calls to `$doCheck` in Angular 1 than you would to\n * `ngDoCheck` in Angular 2\n * * Changes to the model inside `$doCheck` will trigger new turns of the digest loop, which will cause the changes to be\n * propagated throughout the application.\n * Angular 2 does not allow the `ngDoCheck` hook to trigger a change outside of the component. It will either throw an\n * error or do nothing depending upon the state of `enableProdMode()`.\n *\n * #### Life-cycle hook examples\n *\n * This example shows how you can check for mutations to a Date object even though the identity of the object\n * has not changed.\n *\n * \n * \n * angular.module('do-check-module', [])\n * .component('app', {\n * template:\n * 'Month: ' +\n * 'Date: {{ $ctrl.date }}' +\n * '',\n * controller: function() {\n * this.date = new Date();\n * this.month = this.date.getMonth();\n * this.updateDate = function() {\n * this.date.setMonth(this.month);\n * };\n * }\n * })\n * .component('test', {\n * bindings: { date: '<' },\n * template:\n * '
        {{ $ctrl.log | json }}
        ',\n * controller: function() {\n * var previousValue;\n * this.log = [];\n * this.$doCheck = function() {\n * var currentValue = this.date && this.date.valueOf();\n * if (previousValue !== currentValue) {\n * this.log.push('doCheck: date mutated: ' + this.date);\n * previousValue = currentValue;\n * }\n * };\n * }\n * });\n *
        \n * \n * \n * \n *
        \n *\n * This example show how you might use `$doCheck` to trigger changes in your component's inputs even if the\n * actual identity of the component doesn't change. (Be aware that cloning and deep equality checks on large\n * arrays or objects can have a negative impact on your application performance)\n *\n * \n * \n *
        \n * \n * \n *
        {{ items }}
        \n * \n *
        \n *
        \n * \n * angular.module('do-check-module', [])\n * .component('test', {\n * bindings: { items: '<' },\n * template:\n * '
        {{ $ctrl.log | json }}
        ',\n * controller: function() {\n * this.log = [];\n *\n * this.$doCheck = function() {\n * if (this.items_ref !== this.items) {\n * this.log.push('doCheck: items changed');\n * this.items_ref = this.items;\n * }\n * if (!angular.equals(this.items_clone, this.items)) {\n * this.log.push('doCheck: items mutated');\n * this.items_clone = angular.copy(this.items);\n * }\n * };\n * }\n * });\n *
        \n *
        \n *\n *\n * ### Directive Definition Object\n *\n * The directive definition object provides instructions to the {@link ng.$compile\n * compiler}. The attributes are:\n *\n * #### `multiElement`\n * When this property is set to true, the HTML compiler will collect DOM nodes between\n * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them\n * together as the directive elements. It is recommended that this feature be used on directives\n * which are not strictly behavioral (such as {@link ngClick}), and which\n * do not manipulate or replace child nodes (such as {@link ngInclude}).\n *\n * #### `priority`\n * When there are multiple directives defined on a single DOM element, sometimes it\n * is necessary to specify the order in which the directives are applied. The `priority` is used\n * to sort the directives before their `compile` functions get called. Priority is defined as a\n * number. Directives with greater numerical `priority` are compiled first. Pre-link functions\n * are also run in priority order, but post-link functions are run in reverse order. The order\n * of directives with the same priority is undefined. The default priority is `0`.\n *\n * #### `terminal`\n * If set to true then the current `priority` will be the last set of directives\n * which will execute (any directives at the current priority will still execute\n * as the order of execution on same `priority` is undefined). Note that expressions\n * and other directives used in the directive's template will also be excluded from execution.\n *\n * #### `scope`\n * The scope property can be `true`, an object or a falsy value:\n *\n * * **falsy:** No scope will be created for the directive. The directive will use its parent's scope.\n *\n * * **`true`:** A new child scope that prototypically inherits from its parent will be created for\n * the directive's element. If multiple directives on the same element request a new scope,\n * only one new scope is created. The new scope rule does not apply for the root of the template\n * since the root of the template always gets a new scope.\n *\n * * **`{...}` (an object hash):** A new \"isolate\" scope is created for the directive's element. The\n * 'isolate' scope differs from normal scope in that it does not prototypically inherit from its parent\n * scope. This is useful when creating reusable components, which should not accidentally read or modify\n * data in the parent scope.\n *\n * The 'isolate' scope object hash defines a set of local scope properties derived from attributes on the\n * directive's element. These local properties are useful for aliasing values for templates. The keys in\n * the object hash map to the name of the property on the isolate scope; the values define how the property\n * is bound to the parent scope, via matching attributes on the directive's element:\n *\n * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is\n * always a string since DOM attributes are strings. If no `attr` name is specified then the\n * attribute name is assumed to be the same as the local name. Given `` and the isolate scope definition `scope: { localName:'@myAttr' }`,\n * the directive's scope property `localName` will reflect the interpolated value of `hello\n * {{name}}`. As the `name` attribute changes so will the `localName` property on the directive's\n * scope. The `name` is read from the parent scope (not the directive's scope).\n *\n * * `=` or `=attr` - set up a bidirectional binding between a local scope property and an expression\n * passed via the attribute `attr`. The expression is evaluated in the context of the parent scope.\n * If no `attr` name is specified then the attribute name is assumed to be the same as the local\n * name. Given `` and the isolate scope definition `scope: {\n * localModel: '=myAttr' }`, the property `localModel` on the directive's scope will reflect the\n * value of `parentModel` on the parent scope. Changes to `parentModel` will be reflected in\n * `localModel` and vice versa. Optional attributes should be marked as such with a question mark:\n * `=?` or `=?attr`. If the binding expression is non-assignable, or if the attribute isn't\n * optional and doesn't exist, an exception ({@link error/$compile/nonassign `$compile:nonassign`})\n * will be thrown upon discovering changes to the local value, since it will be impossible to sync\n * them back to the parent scope. By default, the {@link ng.$rootScope.Scope#$watch `$watch`}\n * method is used for tracking changes, and the equality check is based on object identity.\n * However, if an object literal or an array literal is passed as the binding expression, the\n * equality check is done by value (using the {@link angular.equals} function). It's also possible\n * to watch the evaluated value shallowly with {@link ng.$rootScope.Scope#$watchCollection\n * `$watchCollection`}: use `=*` or `=*attr` (`=*?` or `=*?attr` if the attribute is optional).\n *\n * * `<` or `` and directive definition of\n * `scope: { localModel:'` and the isolate scope definition `scope: {\n * localFn:'&myAttr' }`, the isolate scope property `localFn` will point to a function wrapper for\n * the `count = count + value` expression. Often it's desirable to pass data from the isolated scope\n * via an expression to the parent scope. This can be done by passing a map of local variable names\n * and values into the expression wrapper fn. For example, if the expression is `increment(amount)`\n * then we can specify the amount value by calling the `localFn` as `localFn({amount: 22})`.\n *\n * In general it's possible to apply more than one directive to one element, but there might be limitations\n * depending on the type of scope required by the directives. The following points will help explain these limitations.\n * For simplicity only two directives are taken into account, but it is also applicable for several directives:\n *\n * * **no scope** + **no scope** => Two directives which don't require their own scope will use their parent's scope\n * * **child scope** + **no scope** => Both directives will share one single child scope\n * * **child scope** + **child scope** => Both directives will share one single child scope\n * * **isolated scope** + **no scope** => The isolated directive will use it's own created isolated scope. The other directive will use\n * its parent's scope\n * * **isolated scope** + **child scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives cannot\n * be applied to the same element.\n * * **isolated scope** + **isolated scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives\n * cannot be applied to the same element.\n *\n *\n * #### `bindToController`\n * This property is used to bind scope properties directly to the controller. It can be either\n * `true` or an object hash with the same format as the `scope` property. Additionally, a controller\n * alias must be set, either by using `controllerAs: 'myAlias'` or by specifying the alias in the controller\n * definition: `controller: 'myCtrl as myAlias'`.\n *\n * When an isolate scope is used for a directive (see above), `bindToController: true` will\n * allow a component to have its properties bound to the controller, rather than to scope.\n *\n * After the controller is instantiated, the initial values of the isolate scope bindings will be bound to the controller\n * properties. You can access these bindings once they have been initialized by providing a controller method called\n * `$onInit`, which is called after all the controllers on an element have been constructed and had their bindings\n * initialized.\n *\n *
        \n * **Deprecation warning:** although bindings for non-ES6 class controllers are currently\n * bound to `this` before the controller constructor is called, this use is now deprecated. Please place initialization\n * code that relies upon bindings inside a `$onInit` method on the controller, instead.\n *
        \n *\n * It is also possible to set `bindToController` to an object hash with the same format as the `scope` property.\n * This will set up the scope bindings to the controller directly. Note that `scope` can still be used\n * to define which kind of scope is created. By default, no scope is created. Use `scope: {}` to create an isolate\n * scope (useful for component directives).\n *\n * If both `bindToController` and `scope` are defined and have object hashes, `bindToController` overrides `scope`.\n *\n *\n * #### `controller`\n * Controller constructor function. The controller is instantiated before the\n * pre-linking phase and can be accessed by other directives (see\n * `require` attribute). This allows the directives to communicate with each other and augment\n * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:\n *\n * * `$scope` - Current scope associated with the element\n * * `$element` - Current element\n * * `$attrs` - Current attributes object for the element\n * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:\n * `function([scope], cloneLinkingFn, futureParentElement, slotName)`:\n * * `scope`: (optional) override the scope.\n * * `cloneLinkingFn`: (optional) argument to create clones of the original transcluded content.\n * * `futureParentElement` (optional):\n * * defines the parent to which the `cloneLinkingFn` will add the cloned elements.\n * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.\n * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)\n * and when the `cloneLinkinFn` is passed,\n * as those elements need to created and cloned in a special way when they are defined outside their\n * usual containers (e.g. like ``).\n * * See also the `directive.templateNamespace` property.\n * * `slotName`: (optional) the name of the slot to transclude. If falsy (e.g. `null`, `undefined` or `''`)\n * then the default translusion is provided.\n * The `$transclude` function also has a method on it, `$transclude.isSlotFilled(slotName)`, which returns\n * `true` if the specified slot contains content (i.e. one or more DOM nodes).\n *\n * #### `require`\n * Require another directive and inject its controller as the fourth argument to the linking function. The\n * `require` property can be a string, an array or an object:\n * * a **string** containing the name of the directive to pass to the linking function\n * * an **array** containing the names of directives to pass to the linking function. The argument passed to the\n * linking function will be an array of controllers in the same order as the names in the `require` property\n * * an **object** whose property values are the names of the directives to pass to the linking function. The argument\n * passed to the linking function will also be an object with matching keys, whose values will hold the corresponding\n * controllers.\n *\n * If the `require` property is an object and `bindToController` is truthy, then the required controllers are\n * bound to the controller using the keys of the `require` property. This binding occurs after all the controllers\n * have been constructed but before `$onInit` is called.\n * If the name of the required controller is the same as the local name (the key), the name can be\n * omitted. For example, `{parentDir: '^^'}` is equivalent to `{parentDir: '^^parentDir'}`.\n * See the {@link $compileProvider#component} helper for an example of how this can be used.\n * If no such required directive(s) can be found, or if the directive does not have a controller, then an error is\n * raised (unless no link function is specified and the required controllers are not being bound to the directive\n * controller, in which case error checking is skipped). The name can be prefixed with:\n *\n * * (no prefix) - Locate the required controller on the current element. Throw an error if not found.\n * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.\n * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found.\n * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found.\n * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass\n * `null` to the `link` fn if not found.\n * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass\n * `null` to the `link` fn if not found.\n *\n *\n * #### `controllerAs`\n * Identifier name for a reference to the controller in the directive's scope.\n * This allows the controller to be referenced from the directive template. This is especially\n * useful when a directive is used as component, i.e. with an `isolate` scope. It's also possible\n * to use it in a directive without an `isolate` / `new` scope, but you need to be aware that the\n * `controllerAs` reference might overwrite a property that already exists on the parent scope.\n *\n *\n * #### `restrict`\n * String of subset of `EACM` which restricts the directive to a specific directive\n * declaration style. If omitted, the defaults (elements and attributes) are used.\n *\n * * `E` - Element name (default): ``\n * * `A` - Attribute (default): `
        `\n * * `C` - Class: `
        `\n * * `M` - Comment: ``\n *\n *\n * #### `templateNamespace`\n * String representing the document type used by the markup in the template.\n * AngularJS needs this information as those elements need to be created and cloned\n * in a special way when they are defined outside their usual containers like `` and ``.\n *\n * * `html` - All root nodes in the template are HTML. Root nodes may also be\n * top-level elements such as `` or ``.\n * * `svg` - The root nodes in the template are SVG elements (excluding ``).\n * * `math` - The root nodes in the template are MathML elements (excluding ``).\n *\n * If no `templateNamespace` is specified, then the namespace is considered to be `html`.\n *\n * #### `template`\n * HTML markup that may:\n * * Replace the contents of the directive's element (default).\n * * Replace the directive's element itself (if `replace` is true - DEPRECATED).\n * * Wrap the contents of the directive's element (if `transclude` is true).\n *\n * Value may be:\n *\n * * A string. For example `
        {{delete_str}}
        `.\n * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`\n * function api below) and returns a string value.\n *\n *\n * #### `templateUrl`\n * This is similar to `template` but the template is loaded from the specified URL, asynchronously.\n *\n * Because template loading is asynchronous the compiler will suspend compilation of directives on that element\n * for later when the template has been resolved. In the meantime it will continue to compile and link\n * sibling and parent elements as though this element had not contained any directives.\n *\n * The compiler does not suspend the entire compilation to wait for templates to be loaded because this\n * would result in the whole app \"stalling\" until all templates are loaded asynchronously - even in the\n * case when only one deeply nested directive has `templateUrl`.\n *\n * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache}\n *\n * You can specify `templateUrl` as a string representing the URL or as a function which takes two\n * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns\n * a string value representing the url. In either case, the template URL is passed through {@link\n * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.\n *\n *\n * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0)\n * specify what the template should replace. Defaults to `false`.\n *\n * * `true` - the template will replace the directive's element.\n * * `false` - the template will replace the contents of the directive's element.\n *\n * The replacement process migrates all of the attributes / classes from the old element to the new\n * one. See the {@link guide/directive#template-expanding-directive\n * Directives Guide} for an example.\n *\n * There are very few scenarios where element replacement is required for the application function,\n * the main one being reusable custom components that are used within SVG contexts\n * (because SVG doesn't work with custom elements in the DOM tree).\n *\n * #### `transclude`\n * Extract the contents of the element where the directive appears and make it available to the directive.\n * The contents are compiled and provided to the directive as a **transclusion function**. See the\n * {@link $compile#transclusion Transclusion} section below.\n *\n *\n * #### `compile`\n *\n * ```js\n * function compile(tElement, tAttrs, transclude) { ... }\n * ```\n *\n * The compile function deals with transforming the template DOM. Since most directives do not do\n * template transformation, it is not used often. The compile function takes the following arguments:\n *\n * * `tElement` - template element - The element where the directive has been declared. It is\n * safe to do template transformation on the element and child elements only.\n *\n * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared\n * between all directive compile functions.\n *\n * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)`\n *\n *
        \n * **Note:** The template instance and the link instance may be different objects if the template has\n * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that\n * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration\n * should be done in a linking function rather than in a compile function.\n *
        \n\n *
        \n * **Note:** The compile function cannot handle directives that recursively use themselves in their\n * own templates or compile functions. Compiling these directives results in an infinite loop and\n * stack overflow errors.\n *\n * This can be avoided by manually using $compile in the postLink function to imperatively compile\n * a directive's template instead of relying on automatic template compilation via `template` or\n * `templateUrl` declaration or manual compilation inside the compile function.\n *
        \n *\n *
        \n * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it\n * e.g. does not know about the right outer scope. Please use the transclude function that is passed\n * to the link function instead.\n *
        \n\n * A compile function can have a return value which can be either a function or an object.\n *\n * * returning a (post-link) function - is equivalent to registering the linking function via the\n * `link` property of the config object when the compile function is empty.\n *\n * * returning an object with function(s) registered via `pre` and `post` properties - allows you to\n * control when a linking function should be called during the linking phase. See info about\n * pre-linking and post-linking functions below.\n *\n *\n * #### `link`\n * This property is used only if the `compile` property is not defined.\n *\n * ```js\n * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }\n * ```\n *\n * The link function is responsible for registering DOM listeners as well as updating the DOM. It is\n * executed after the template has been cloned. This is where most of the directive logic will be\n * put.\n *\n * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the\n * directive for registering {@link ng.$rootScope.Scope#$watch watches}.\n *\n * * `iElement` - instance element - The element where the directive is to be used. It is safe to\n * manipulate the children of the element only in `postLink` function since the children have\n * already been linked.\n *\n * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared\n * between all directive linking functions.\n *\n * * `controller` - the directive's required controller instance(s) - Instances are shared\n * among all directives, which allows the directives to use the controllers as a communication\n * channel. The exact value depends on the directive's `require` property:\n * * no controller(s) required: the directive's own controller, or `undefined` if it doesn't have one\n * * `string`: the controller instance\n * * `array`: array of controller instances\n *\n * If a required controller cannot be found, and it is optional, the instance is `null`,\n * otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown.\n *\n * Note that you can also require the directive's own controller - it will be made available like\n * any other controller.\n *\n * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope.\n * This is the same as the `$transclude` parameter of directive controllers,\n * see {@link ng.$compile#-controller- the controller section for details}.\n * `function([scope], cloneLinkingFn, futureParentElement)`.\n *\n * #### Pre-linking function\n *\n * Executed before the child elements are linked. Not safe to do DOM transformation since the\n * compiler linking function will fail to locate the correct elements for linking.\n *\n * #### Post-linking function\n *\n * Executed after the child elements are linked.\n *\n * Note that child elements that contain `templateUrl` directives will not have been compiled\n * and linked since they are waiting for their template to load asynchronously and their own\n * compilation and linking has been suspended until that occurs.\n *\n * It is safe to do DOM transformation in the post-linking function on elements that are not waiting\n * for their async templates to be resolved.\n *\n *\n * ### Transclusion\n *\n * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and\n * copying them to another part of the DOM, while maintaining their connection to the original AngularJS\n * scope from where they were taken.\n *\n * Transclusion is used (often with {@link ngTransclude}) to insert the\n * original contents of a directive's element into a specified place in the template of the directive.\n * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded\n * content has access to the properties on the scope from which it was taken, even if the directive\n * has isolated scope.\n * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}.\n *\n * This makes it possible for the widget to have private state for its template, while the transcluded\n * content has access to its originating scope.\n *\n *
        \n * **Note:** When testing an element transclude directive you must not place the directive at the root of the\n * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives\n * Testing Transclusion Directives}.\n *
        \n *\n * There are three kinds of transclusion depending upon whether you want to transclude just the contents of the\n * directive's element, the entire element or multiple parts of the element contents:\n *\n * * `true` - transclude the content (i.e. the child nodes) of the directive's element.\n * * `'element'` - transclude the whole of the directive's element including any directives on this\n * element that defined at a lower priority than this directive. When used, the `template`\n * property is ignored.\n * * **`{...}` (an object hash):** - map elements of the content onto transclusion \"slots\" in the template.\n *\n * **Mult-slot transclusion** is declared by providing an object for the `transclude` property.\n *\n * This object is a map where the keys are the name of the slot to fill and the value is an element selector\n * used to match the HTML to the slot. The element selector should be in normalized form (e.g. `myElement`)\n * and will match the standard element variants (e.g. `my-element`, `my:element`, `data-my-element`, etc).\n *\n * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}\n *\n * If the element selector is prefixed with a `?` then that slot is optional.\n *\n * For example, the transclude object `{ slotA: '?myCustomElement' }` maps `` elements to\n * the `slotA` slot, which can be accessed via the `$transclude` function or via the {@link ngTransclude} directive.\n *\n * Slots that are not marked as optional (`?`) will trigger a compile time error if there are no matching elements\n * in the transclude content. If you wish to know if an optional slot was filled with content, then you can call\n * `$transclude.isSlotFilled(slotName)` on the transclude function passed to the directive's link function and\n * injectable into the directive's controller.\n *\n *\n * #### Transclusion Functions\n *\n * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion\n * function** to the directive's `link` function and `controller`. This transclusion function is a special\n * **linking function** that will return the compiled contents linked to a new transclusion scope.\n *\n *
        \n * If you are just using {@link ngTransclude} then you don't need to worry about this function, since\n * ngTransclude will deal with it for us.\n *
        \n *\n * If you want to manually control the insertion and removal of the transcluded content in your directive\n * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery\n * object that contains the compiled DOM, which is linked to the correct transclusion scope.\n *\n * When you call a transclusion function you can pass in a **clone attach function**. This function accepts\n * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded\n * content and the `scope` is the newly created transclusion scope, to which the clone is bound.\n *\n *
        \n * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a transclude function\n * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope.\n *
        \n *\n * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone\n * attach function**:\n *\n * ```js\n * var transcludedContent, transclusionScope;\n *\n * $transclude(function(clone, scope) {\n * element.append(clone);\n * transcludedContent = clone;\n * transclusionScope = scope;\n * });\n * ```\n *\n * Later, if you want to remove the transcluded content from your DOM then you should also destroy the\n * associated transclusion scope:\n *\n * ```js\n * transcludedContent.remove();\n * transclusionScope.$destroy();\n * ```\n *\n *
        \n * **Best Practice**: if you intend to add and remove transcluded content manually in your directive\n * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it),\n * then you are also responsible for calling `$destroy` on the transclusion scope.\n *
        \n *\n * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat}\n * automatically destroy their transcluded clones as necessary so you do not need to worry about this if\n * you are simply using {@link ngTransclude} to inject the transclusion into your directive.\n *\n *\n * #### Transclusion Scopes\n *\n * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion\n * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed\n * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it\n * was taken.\n *\n * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look\n * like this:\n *\n * ```html\n *
        \n *
        \n *
        \n *
        \n *
        \n *
        \n * ```\n *\n * The `$parent` scope hierarchy will look like this:\n *\n ```\n - $rootScope\n - isolate\n - transclusion\n ```\n *\n * but the scopes will inherit prototypically from different scopes to their `$parent`.\n *\n ```\n - $rootScope\n - transclusion\n - isolate\n ```\n *\n *\n * ### Attributes\n *\n * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the\n * `link()` or `compile()` functions. It has a variety of uses.\n *\n * * *Accessing normalized attribute names:* Directives like 'ngBind' can be expressed in many ways:\n * 'ng:bind', `data-ng-bind`, or 'x-ng-bind'. The attributes object allows for normalized access\n * to the attributes.\n *\n * * *Directive inter-communication:* All directives share the same instance of the attributes\n * object which allows the directives to use the attributes object as inter directive\n * communication.\n *\n * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object\n * allowing other directives to read the interpolated value.\n *\n * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes\n * that contain interpolation (e.g. `src=\"{{bar}}\"`). Not only is this very efficient but it's also\n * the only way to easily get the actual value because during the linking phase the interpolation\n * hasn't been evaluated yet and so the value is at this time set to `undefined`.\n *\n * ```js\n * function linkingFn(scope, elm, attrs, ctrl) {\n * // get the attribute value\n * console.log(attrs.ngModel);\n *\n * // change the attribute\n * attrs.$set('ngModel', 'new value');\n *\n * // observe changes to interpolated attribute\n * attrs.$observe('ngModel', function(value) {\n * console.log('ngModel has changed value to ' + value);\n * });\n * }\n * ```\n *\n * ## Example\n *\n *
        \n * **Note**: Typically directives are registered with `module.directive`. The example below is\n * to illustrate how `$compile` works.\n *
        \n *\n \n \n \n
        \n
        \n
        \n
        \n
        \n
        \n \n it('should auto compile', function() {\n var textarea = $('textarea');\n var output = $('div[compile]');\n // The initial state reads 'Hello Angular'.\n expect(output.getText()).toBe('Hello Angular');\n textarea.clear();\n textarea.sendKeys('{{name}}!');\n expect(output.getText()).toBe('Angular!');\n });\n \n
        \n\n *\n *\n * @param {string|DOMElement} element Element or HTML string to compile into a template function.\n * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED.\n *\n *
        \n * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it\n * e.g. will not use the right outer scope. Please pass the transclude function as a\n * `parentBoundTranscludeFn` to the link function instead.\n *
        \n *\n * @param {number} maxPriority only apply directives lower than given priority (Only effects the\n * root element(s), not their children)\n * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template\n * (a DOM element/tree) to a scope. Where:\n *\n * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.\n * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the\n * `template` and call the `cloneAttachFn` function allowing the caller to attach the\n * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is\n * called as:
        `cloneAttachFn(clonedElement, scope)` where:\n *\n * * `clonedElement` - is a clone of the original `element` passed into the compiler.\n * * `scope` - is the current scope with which the linking function is working with.\n *\n * * `options` - An optional object hash with linking options. If `options` is provided, then the following\n * keys may be used to control linking behavior:\n *\n * * `parentBoundTranscludeFn` - the transclude function made available to\n * directives; if given, it will be passed through to the link functions of\n * directives found in `element` during compilation.\n * * `transcludeControllers` - an object hash with keys that map controller names\n * to a hash with the key `instance`, which maps to the controller instance;\n * if given, it will make the controllers available to directives on the compileNode:\n * ```\n * {\n * parent: {\n * instance: parentControllerInstance\n * }\n * }\n * ```\n * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add\n * the cloned elements; only needed for transcludes that are allowed to contain non html\n * elements (e.g. SVG elements). See also the directive.controller property.\n *\n * Calling the linking function returns the element of the template. It is either the original\n * element passed in, or the clone of the element if the `cloneAttachFn` is provided.\n *\n * After linking the view is not updated until after a call to $digest which typically is done by\n * Angular automatically.\n *\n * If you need access to the bound view, there are two ways to do it:\n *\n * - If you are not asking the linking function to clone the template, create the DOM element(s)\n * before you send them to the compiler and keep this reference around.\n * ```js\n * var element = $compile('

        {{total}}

        ')(scope);\n * ```\n *\n * - if on the other hand, you need the element to be cloned, the view reference from the original\n * example would not point to the clone, but rather to the original template that was cloned. In\n * this case, you can access the clone via the cloneAttachFn:\n * ```js\n * var templateElement = angular.element('

        {{total}}

        '),\n * scope = ....;\n *\n * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) {\n * //attach the clone to DOM document at the right place\n * });\n *\n * //now we have reference to the cloned DOM via `clonedElement`\n * ```\n *\n *\n * For information on how the compiler works, see the\n * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide.\n */\n\nvar $compileMinErr = minErr('$compile');\n\nfunction UNINITIALIZED_VALUE() {}\nvar _UNINITIALIZED_VALUE = new UNINITIALIZED_VALUE();\n\n/**\n * @ngdoc provider\n * @name $compileProvider\n *\n * @description\n */\n$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];\nfunction $CompileProvider($provide, $$sanitizeUriProvider) {\n var hasDirectives = {},\n Suffix = 'Directive',\n COMMENT_DIRECTIVE_REGEXP = /^\\s*directive\\:\\s*([\\w\\-]+)\\s+(.*)$/,\n CLASS_DIRECTIVE_REGEXP = /(([\\w\\-]+)(?:\\:([^;]+))?;?)/,\n ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),\n REQUIRE_PREFIX_REGEXP = /^(?:(\\^\\^?)?(\\?)?(\\^\\^?)?)?/;\n\n // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes\n // The assumption is that future DOM event attribute names will begin with\n // 'on' and be composed of only English letters.\n var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;\n var bindingCache = createMap();\n\n function parseIsolateBindings(scope, directiveName, isController) {\n var LOCAL_REGEXP = /^\\s*([@&<]|=(\\*?))(\\??)\\s*(\\w*)\\s*$/;\n\n var bindings = createMap();\n\n forEach(scope, function(definition, scopeName) {\n if (definition in bindingCache) {\n bindings[scopeName] = bindingCache[definition];\n return;\n }\n var match = definition.match(LOCAL_REGEXP);\n\n if (!match) {\n throw $compileMinErr('iscp',\n \"Invalid {3} for directive '{0}'.\" +\n \" Definition: {... {1}: '{2}' ...}\",\n directiveName, scopeName, definition,\n (isController ? \"controller bindings definition\" :\n \"isolate scope definition\"));\n }\n\n bindings[scopeName] = {\n mode: match[1][0],\n collection: match[2] === '*',\n optional: match[3] === '?',\n attrName: match[4] || scopeName\n };\n if (match[4]) {\n bindingCache[definition] = bindings[scopeName];\n }\n });\n\n return bindings;\n }\n\n function parseDirectiveBindings(directive, directiveName) {\n var bindings = {\n isolateScope: null,\n bindToController: null\n };\n if (isObject(directive.scope)) {\n if (directive.bindToController === true) {\n bindings.bindToController = parseIsolateBindings(directive.scope,\n directiveName, true);\n bindings.isolateScope = {};\n } else {\n bindings.isolateScope = parseIsolateBindings(directive.scope,\n directiveName, false);\n }\n }\n if (isObject(directive.bindToController)) {\n bindings.bindToController =\n parseIsolateBindings(directive.bindToController, directiveName, true);\n }\n if (isObject(bindings.bindToController)) {\n var controller = directive.controller;\n var controllerAs = directive.controllerAs;\n if (!controller) {\n // There is no controller, there may or may not be a controllerAs property\n throw $compileMinErr('noctrl',\n \"Cannot bind to controller without directive '{0}'s controller.\",\n directiveName);\n } else if (!identifierForController(controller, controllerAs)) {\n // There is a controller, but no identifier or controllerAs property\n throw $compileMinErr('noident',\n \"Cannot bind to controller without identifier for directive '{0}'.\",\n directiveName);\n }\n }\n return bindings;\n }\n\n function assertValidDirectiveName(name) {\n var letter = name.charAt(0);\n if (!letter || letter !== lowercase(letter)) {\n throw $compileMinErr('baddir', \"Directive/Component name '{0}' is invalid. The first character must be a lowercase letter\", name);\n }\n if (name !== name.trim()) {\n throw $compileMinErr('baddir',\n \"Directive/Component name '{0}' is invalid. The name should not contain leading or trailing whitespaces\",\n name);\n }\n }\n\n function getDirectiveRequire(directive) {\n var require = directive.require || (directive.controller && directive.name);\n\n if (!isArray(require) && isObject(require)) {\n forEach(require, function(value, key) {\n var match = value.match(REQUIRE_PREFIX_REGEXP);\n var name = value.substring(match[0].length);\n if (!name) require[key] = match[0] + key;\n });\n }\n\n return require;\n }\n\n /**\n * @ngdoc method\n * @name $compileProvider#directive\n * @kind function\n *\n * @description\n * Register a new directive with the compiler.\n *\n * @param {string|Object} name Name of the directive in camel-case (i.e. ngBind which\n * will match as ng-bind), or an object map of directives where the keys are the\n * names and the values are the factories.\n * @param {Function|Array} directiveFactory An injectable directive factory function. See the\n * {@link guide/directive directive guide} and the {@link $compile compile API} for more info.\n * @returns {ng.$compileProvider} Self for chaining.\n */\n this.directive = function registerDirective(name, directiveFactory) {\n assertNotHasOwnProperty(name, 'directive');\n if (isString(name)) {\n assertValidDirectiveName(name);\n assertArg(directiveFactory, 'directiveFactory');\n if (!hasDirectives.hasOwnProperty(name)) {\n hasDirectives[name] = [];\n $provide.factory(name + Suffix, ['$injector', '$exceptionHandler',\n function($injector, $exceptionHandler) {\n var directives = [];\n forEach(hasDirectives[name], function(directiveFactory, index) {\n try {\n var directive = $injector.invoke(directiveFactory);\n if (isFunction(directive)) {\n directive = { compile: valueFn(directive) };\n } else if (!directive.compile && directive.link) {\n directive.compile = valueFn(directive.link);\n }\n directive.priority = directive.priority || 0;\n directive.index = index;\n directive.name = directive.name || name;\n directive.require = getDirectiveRequire(directive);\n directive.restrict = directive.restrict || 'EA';\n directive.$$moduleName = directiveFactory.$$moduleName;\n directives.push(directive);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n return directives;\n }]);\n }\n hasDirectives[name].push(directiveFactory);\n } else {\n forEach(name, reverseParams(registerDirective));\n }\n return this;\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#component\n * @module ng\n * @param {string} name Name of the component in camelCase (i.e. `myComp` which will match ``)\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object}),\n * with the following properties (all optional):\n *\n * - `controller` – `{(string|function()=}` – controller constructor function that should be\n * associated with newly created scope or the name of a {@link ng.$compile#-controller-\n * registered controller} if passed as a string. An empty `noop` function by default.\n * - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope.\n * If present, the controller will be published to scope under the `controllerAs` name.\n * If not present, this will default to be `$ctrl`.\n * - `template` – `{string=|function()=}` – html template as a string or a function that\n * returns an html template as a string which should be used as the contents of this component.\n * Empty string by default.\n *\n * If `template` is a function, then it is {@link auto.$injector#invoke injected} with\n * the following locals:\n *\n * - `$element` - Current element\n * - `$attrs` - Current attributes object for the element\n *\n * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html\n * template that should be used as the contents of this component.\n *\n * If `templateUrl` is a function, then it is {@link auto.$injector#invoke injected} with\n * the following locals:\n *\n * - `$element` - Current element\n * - `$attrs` - Current attributes object for the element\n *\n * - `bindings` – `{object=}` – defines bindings between DOM attributes and component properties.\n * Component properties are always bound to the component controller and not to the scope.\n * See {@link ng.$compile#-bindtocontroller- `bindToController`}.\n * - `transclude` – `{boolean=}` – whether {@link $compile#transclusion content transclusion} is enabled.\n * Disabled by default.\n * - `require` - `{Object=}` - requires the controllers of other directives and binds them to\n * this component's controller. The object keys specify the property names under which the required\n * controllers (object values) will be bound. See {@link ng.$compile#-require- `require`}.\n * - `$...` – additional properties to attach to the directive factory function and the controller\n * constructor function. (This is used by the component router to annotate)\n *\n * @returns {ng.$compileProvider} the compile provider itself, for chaining of function calls.\n * @description\n * Register a **component definition** with the compiler. This is a shorthand for registering a special\n * type of directive, which represents a self-contained UI component in your application. Such components\n * are always isolated (i.e. `scope: {}`) and are always restricted to elements (i.e. `restrict: 'E'`).\n *\n * Component definitions are very simple and do not require as much configuration as defining general\n * directives. Component definitions usually consist only of a template and a controller backing it.\n *\n * In order to make the definition easier, components enforce best practices like use of `controllerAs`,\n * `bindToController`. They always have **isolate scope** and are restricted to elements.\n *\n * Here are a few examples of how you would usually define components:\n *\n * ```js\n * var myMod = angular.module(...);\n * myMod.component('myComp', {\n * template: '
        My name is {{$ctrl.name}}
        ',\n * controller: function() {\n * this.name = 'shahar';\n * }\n * });\n *\n * myMod.component('myComp', {\n * template: '
        My name is {{$ctrl.name}}
        ',\n * bindings: {name: '@'}\n * });\n *\n * myMod.component('myComp', {\n * templateUrl: 'views/my-comp.html',\n * controller: 'MyCtrl',\n * controllerAs: 'ctrl',\n * bindings: {name: '@'}\n * });\n *\n * ```\n * For more examples, and an in-depth guide, see the {@link guide/component component guide}.\n *\n *
        \n * See also {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n this.component = function registerComponent(name, options) {\n var controller = options.controller || function() {};\n\n function factory($injector) {\n function makeInjectable(fn) {\n if (isFunction(fn) || isArray(fn)) {\n return function(tElement, tAttrs) {\n return $injector.invoke(fn, this, {$element: tElement, $attrs: tAttrs});\n };\n } else {\n return fn;\n }\n }\n\n var template = (!options.template && !options.templateUrl ? '' : options.template);\n var ddo = {\n controller: controller,\n controllerAs: identifierForController(options.controller) || options.controllerAs || '$ctrl',\n template: makeInjectable(template),\n templateUrl: makeInjectable(options.templateUrl),\n transclude: options.transclude,\n scope: {},\n bindToController: options.bindings || {},\n restrict: 'E',\n require: options.require\n };\n\n // Copy annotations (starting with $) over to the DDO\n forEach(options, function(val, key) {\n if (key.charAt(0) === '$') ddo[key] = val;\n });\n\n return ddo;\n }\n\n // TODO(pete) remove the following `forEach` before we release 1.6.0\n // The component-router@0.2.0 looks for the annotations on the controller constructor\n // Nothing in Angular looks for annotations on the factory function but we can't remove\n // it from 1.5.x yet.\n\n // Copy any annotation properties (starting with $) over to the factory and controller constructor functions\n // These could be used by libraries such as the new component router\n forEach(options, function(val, key) {\n if (key.charAt(0) === '$') {\n factory[key] = val;\n // Don't try to copy over annotations to named controller\n if (isFunction(controller)) controller[key] = val;\n }\n });\n\n factory.$inject = ['$injector'];\n\n return this.directive(name, factory);\n };\n\n\n /**\n * @ngdoc method\n * @name $compileProvider#aHrefSanitizationWhitelist\n * @kind function\n *\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during a[href] sanitization.\n *\n * The sanitization is a security measure aimed at preventing XSS attacks via html links.\n *\n * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.aHrefSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.aHrefSanitizationWhitelist();\n }\n };\n\n\n /**\n * @ngdoc method\n * @name $compileProvider#imgSrcSanitizationWhitelist\n * @kind function\n *\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during img[src] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.imgSrcSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();\n }\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#debugInfoEnabled\n *\n * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the\n * current debugInfoEnabled state\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n *\n * @kind function\n *\n * @description\n * Call this method to enable/disable various debug runtime information in the compiler such as adding\n * binding information and a reference to the current scope on to DOM elements.\n * If enabled, the compiler will add the following to DOM elements that have been bound to the scope\n * * `ng-binding` CSS class\n * * `$binding` data property containing an array of the binding expressions\n *\n * You may want to disable this in production for a significant performance boost. See\n * {@link guide/production#disabling-debug-data Disabling Debug Data} for more.\n *\n * The default value is true.\n */\n var debugInfoEnabled = true;\n this.debugInfoEnabled = function(enabled) {\n if (isDefined(enabled)) {\n debugInfoEnabled = enabled;\n return this;\n }\n return debugInfoEnabled;\n };\n\n\n var TTL = 10;\n /**\n * @ngdoc method\n * @name $compileProvider#onChangesTtl\n * @description\n *\n * Sets the number of times `$onChanges` hooks can trigger new changes before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that dependencies between `$onChanges` hooks and bindings will result\n * in several iterations of calls to these hooks. However if an application needs more than the default 10\n * iterations to stabilize then you should investigate what is causing the model to continuously change during\n * the `$onChanges` hook execution.\n *\n * Increasing the TTL could have performance implications, so you should not change it without proper justification.\n *\n * @param {number} limit The number of `$onChanges` hook iterations.\n * @returns {number|object} the current limit (or `this` if called as a setter for chaining)\n */\n this.onChangesTtl = function(value) {\n if (arguments.length) {\n TTL = value;\n return this;\n }\n return TTL;\n };\n\n this.$get = [\n '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse',\n '$controller', '$rootScope', '$sce', '$animate', '$$sanitizeUri',\n function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse,\n $controller, $rootScope, $sce, $animate, $$sanitizeUri) {\n\n var SIMPLE_ATTR_NAME = /^\\w/;\n var specialAttrHolder = window.document.createElement('div');\n\n\n\n var onChangesTtl = TTL;\n // The onChanges hooks should all be run together in a single digest\n // When changes occur, the call to trigger their hooks will be added to this queue\n var onChangesQueue;\n\n // This function is called in a $$postDigest to trigger all the onChanges hooks in a single digest\n function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n var errors = [];\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n errors.push(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n if (errors.length) {\n throw errors;\n }\n });\n } finally {\n onChangesTtl++;\n }\n }\n\n\n function Attributes(element, attributesToCopy) {\n if (attributesToCopy) {\n var keys = Object.keys(attributesToCopy);\n var i, l, key;\n\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n this[key] = attributesToCopy[key];\n }\n } else {\n this.$attr = {};\n }\n\n this.$$element = element;\n }\n\n Attributes.prototype = {\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$normalize\n * @kind function\n *\n * @description\n * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or\n * `data-`) to its normalized, camelCase form.\n *\n * Also there is special case for Moz prefix starting with upper case letter.\n *\n * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}\n *\n * @param {string} name Name to normalize\n */\n $normalize: directiveNormalize,\n\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$addClass\n * @kind function\n *\n * @description\n * Adds the CSS class value specified by the classVal parameter to the element. If animations\n * are enabled then an animation will be triggered for the class addition.\n *\n * @param {string} classVal The className value that will be added to the element\n */\n $addClass: function(classVal) {\n if (classVal && classVal.length > 0) {\n $animate.addClass(this.$$element, classVal);\n }\n },\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$removeClass\n * @kind function\n *\n * @description\n * Removes the CSS class value specified by the classVal parameter from the element. If\n * animations are enabled then an animation will be triggered for the class removal.\n *\n * @param {string} classVal The className value that will be removed from the element\n */\n $removeClass: function(classVal) {\n if (classVal && classVal.length > 0) {\n $animate.removeClass(this.$$element, classVal);\n }\n },\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$updateClass\n * @kind function\n *\n * @description\n * Adds and removes the appropriate CSS class values to the element based on the difference\n * between the new and old CSS class values (specified as newClasses and oldClasses).\n *\n * @param {string} newClasses The current CSS className value\n * @param {string} oldClasses The former CSS className value\n */\n $updateClass: function(newClasses, oldClasses) {\n var toAdd = tokenDifference(newClasses, oldClasses);\n if (toAdd && toAdd.length) {\n $animate.addClass(this.$$element, toAdd);\n }\n\n var toRemove = tokenDifference(oldClasses, newClasses);\n if (toRemove && toRemove.length) {\n $animate.removeClass(this.$$element, toRemove);\n }\n },\n\n /**\n * Set a normalized attribute on the element in a way such that all directives\n * can share the attribute. This function properly handles boolean attributes.\n * @param {string} key Normalized key. (ie ngAttribute)\n * @param {string|boolean} value The value to set. If `null` attribute will be deleted.\n * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.\n * Defaults to true.\n * @param {string=} attrName Optional none normalized name. Defaults to key.\n */\n $set: function(key, value, writeAttr, attrName) {\n // TODO: decide whether or not to throw an error if \"class\"\n //is set through this function since it may cause $updateClass to\n //become unstable.\n\n var node = this.$$element[0],\n booleanKey = getBooleanAttrName(node, key),\n aliasedKey = getAliasedAttrName(key),\n observer = key,\n nodeName;\n\n if (booleanKey) {\n this.$$element.prop(key, value);\n attrName = booleanKey;\n } else if (aliasedKey) {\n this[aliasedKey] = value;\n observer = aliasedKey;\n }\n\n this[key] = value;\n\n // translate normalized key to actual key\n if (attrName) {\n this.$attr[key] = attrName;\n } else {\n attrName = this.$attr[key];\n if (!attrName) {\n this.$attr[key] = attrName = snake_case(key, '-');\n }\n }\n\n nodeName = nodeName_(this.$$element);\n\n if ((nodeName === 'a' && (key === 'href' || key === 'xlinkHref')) ||\n (nodeName === 'img' && key === 'src')) {\n // sanitize a[href] and img[src] values\n this[key] = value = $$sanitizeUri(value, key === 'src');\n } else if (nodeName === 'img' && key === 'srcset' && isDefined(value)) {\n // sanitize img[srcset] values\n var result = \"\";\n\n // first check if there are spaces because it's not the same pattern\n var trimmedSrcset = trim(value);\n // ( 999x ,| 999w ,| ,|, )\n var srcPattern = /(\\s+\\d+x\\s*,|\\s+\\d+w\\s*,|\\s+,|,\\s+)/;\n var pattern = /\\s/.test(trimmedSrcset) ? srcPattern : /(,)/;\n\n // split srcset into tuple of uri and descriptor except for the last item\n var rawUris = trimmedSrcset.split(pattern);\n\n // for each tuples\n var nbrUrisWith2parts = Math.floor(rawUris.length / 2);\n for (var i = 0; i < nbrUrisWith2parts; i++) {\n var innerIdx = i * 2;\n // sanitize the uri\n result += $$sanitizeUri(trim(rawUris[innerIdx]), true);\n // add the descriptor\n result += (\" \" + trim(rawUris[innerIdx + 1]));\n }\n\n // split the last item into uri and descriptor\n var lastTuple = trim(rawUris[i * 2]).split(/\\s/);\n\n // sanitize the last uri\n result += $$sanitizeUri(trim(lastTuple[0]), true);\n\n // and add the last descriptor if any\n if (lastTuple.length === 2) {\n result += (\" \" + trim(lastTuple[1]));\n }\n this[key] = value = result;\n }\n\n if (writeAttr !== false) {\n if (value === null || isUndefined(value)) {\n this.$$element.removeAttr(attrName);\n } else {\n if (SIMPLE_ATTR_NAME.test(attrName)) {\n this.$$element.attr(attrName, value);\n } else {\n setSpecialAttr(this.$$element[0], attrName, value);\n }\n }\n }\n\n // fire observers\n var $$observers = this.$$observers;\n $$observers && forEach($$observers[observer], function(fn) {\n try {\n fn(value);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n },\n\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$observe\n * @kind function\n *\n * @description\n * Observes an interpolated attribute.\n *\n * The observer function will be invoked once during the next `$digest` following\n * compilation. The observer is then invoked whenever the interpolated value\n * changes.\n *\n * @param {string} key Normalized key. (ie ngAttribute) .\n * @param {function(interpolatedValue)} fn Function that will be called whenever\n the interpolated value of the attribute changes.\n * See the {@link guide/interpolation#how-text-and-attribute-bindings-work Interpolation\n * guide} for more info.\n * @returns {function()} Returns a deregistration function for this observer.\n */\n $observe: function(key, fn) {\n var attrs = this,\n $$observers = (attrs.$$observers || (attrs.$$observers = createMap())),\n listeners = ($$observers[key] || ($$observers[key] = []));\n\n listeners.push(fn);\n $rootScope.$evalAsync(function() {\n if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) {\n // no one registered attribute interpolation function, so lets call it manually\n fn(attrs[key]);\n }\n });\n\n return function() {\n arrayRemove(listeners, fn);\n };\n }\n };\n\n function setSpecialAttr(element, attrName, value) {\n // Attributes names that do not start with letters (such as `(click)`) cannot be set using `setAttribute`\n // so we have to jump through some hoops to get such an attribute\n // https://github.com/angular/angular.js/pull/13318\n specialAttrHolder.innerHTML = \"\";\n var attributes = specialAttrHolder.firstChild.attributes;\n var attribute = attributes[0];\n // We have to remove the attribute from its container element before we can add it to the destination element\n attributes.removeNamedItem(attribute.name);\n attribute.value = value;\n element.attributes.setNamedItem(attribute);\n }\n\n function safeAddClass($element, className) {\n try {\n $element.addClass(className);\n } catch (e) {\n // ignore, since it means that we are trying to set class on\n // SVG element, where class name is read-only.\n }\n }\n\n\n var startSymbol = $interpolate.startSymbol(),\n endSymbol = $interpolate.endSymbol(),\n denormalizeTemplate = (startSymbol == '{{' && endSymbol == '}}')\n ? identity\n : function denormalizeTemplate(template) {\n return template.replace(/\\{\\{/g, startSymbol).replace(/}}/g, endSymbol);\n },\n NG_ATTR_BINDING = /^ngAttr[A-Z]/;\n var MULTI_ELEMENT_DIR_RE = /^(.+)Start$/;\n\n compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) {\n var bindings = $element.data('$binding') || [];\n\n if (isArray(binding)) {\n bindings = bindings.concat(binding);\n } else {\n bindings.push(binding);\n }\n\n $element.data('$binding', bindings);\n } : noop;\n\n compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) {\n safeAddClass($element, 'ng-binding');\n } : noop;\n\n compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) {\n var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';\n $element.data(dataName, scope);\n } : noop;\n\n compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) {\n safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope');\n } : noop;\n\n compile.$$createComment = function(directiveName, comment) {\n var content = '';\n if (debugInfoEnabled) {\n content = ' ' + (directiveName || '') + ': ';\n if (comment) content += comment + ' ';\n }\n return window.document.createComment(content);\n };\n\n return compile;\n\n //================================\n\n function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,\n previousCompileContext) {\n if (!($compileNodes instanceof jqLite)) {\n // jquery always rewraps, whereas we need to preserve the original selector so that we can\n // modify it.\n $compileNodes = jqLite($compileNodes);\n }\n\n var NOT_EMPTY = /\\S+/;\n\n // We can not compile top level text elements since text nodes can be merged and we will\n // not be able to attach scope data to them, so we will wrap them in \n for (var i = 0, len = $compileNodes.length; i < len; i++) {\n var domNode = $compileNodes[i];\n\n if (domNode.nodeType === NODE_TYPE_TEXT && domNode.nodeValue.match(NOT_EMPTY) /* non-empty */) {\n jqLiteWrapNode(domNode, $compileNodes[i] = window.document.createElement('span'));\n }\n }\n\n var compositeLinkFn =\n compileNodes($compileNodes, transcludeFn, $compileNodes,\n maxPriority, ignoreDirective, previousCompileContext);\n compile.$$addScopeClass($compileNodes);\n var namespace = null;\n return function publicLinkFn(scope, cloneConnectFn, options) {\n assertArg(scope, 'scope');\n\n if (previousCompileContext && previousCompileContext.needsNewScope) {\n // A parent directive did a replace and a directive on this element asked\n // for transclusion, which caused us to lose a layer of element on which\n // we could hold the new transclusion scope, so we will create it manually\n // here.\n scope = scope.$parent.$new();\n }\n\n options = options || {};\n var parentBoundTranscludeFn = options.parentBoundTranscludeFn,\n transcludeControllers = options.transcludeControllers,\n futureParentElement = options.futureParentElement;\n\n // When `parentBoundTranscludeFn` is passed, it is a\n // `controllersBoundTransclude` function (it was previously passed\n // as `transclude` to directive.link) so we must unwrap it to get\n // its `boundTranscludeFn`\n if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {\n parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;\n }\n\n if (!namespace) {\n namespace = detectNamespaceForChildElements(futureParentElement);\n }\n var $linkNode;\n if (namespace !== 'html') {\n // When using a directive with replace:true and templateUrl the $compileNodes\n // (or a child element inside of them)\n // might change, so we need to recreate the namespace adapted compileNodes\n // for call to the link function.\n // Note: This will already clone the nodes...\n $linkNode = jqLite(\n wrapTemplate(namespace, jqLite('
        ').append($compileNodes).html())\n );\n } else if (cloneConnectFn) {\n // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart\n // and sometimes changes the structure of the DOM.\n $linkNode = JQLitePrototype.clone.call($compileNodes);\n } else {\n $linkNode = $compileNodes;\n }\n\n if (transcludeControllers) {\n for (var controllerName in transcludeControllers) {\n $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);\n }\n }\n\n compile.$$addScopeInfo($linkNode, scope);\n\n if (cloneConnectFn) cloneConnectFn($linkNode, scope);\n if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);\n return $linkNode;\n };\n }\n\n function detectNamespaceForChildElements(parentElement) {\n // TODO: Make this detect MathML as well...\n var node = parentElement && parentElement[0];\n if (!node) {\n return 'html';\n } else {\n return nodeName_(node) !== 'foreignobject' && toString.call(node).match(/SVG/) ? 'svg' : 'html';\n }\n }\n\n /**\n * Compile function matches each node in nodeList against the directives. Once all directives\n * for a particular node are collected their compile functions are executed. The compile\n * functions return values - the linking functions - are combined into a composite linking\n * function, which is the a linking function for the node.\n *\n * @param {NodeList} nodeList an array of nodes or NodeList to compile\n * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n * scope argument is auto-generated to the new child of the transcluded parent scope.\n * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then\n * the rootElement must be set the jqLite collection of the compile root. This is\n * needed so that the jqLite collection items can be replaced with widgets.\n * @param {number=} maxPriority Max directive priority.\n * @returns {Function} A composite linking function of all of the matched directives or null.\n */\n function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,\n previousCompileContext) {\n var linkFns = [],\n attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound;\n\n for (var i = 0; i < nodeList.length; i++) {\n attrs = new Attributes();\n\n // we must always refer to nodeList[i] since the nodes can be replaced underneath us.\n directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined,\n ignoreDirective);\n\n nodeLinkFn = (directives.length)\n ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement,\n null, [], [], previousCompileContext)\n : null;\n\n if (nodeLinkFn && nodeLinkFn.scope) {\n compile.$$addScopeClass(attrs.$$element);\n }\n\n childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||\n !(childNodes = nodeList[i].childNodes) ||\n !childNodes.length)\n ? null\n : compileNodes(childNodes,\n nodeLinkFn ? (\n (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement)\n && nodeLinkFn.transclude) : transcludeFn);\n\n if (nodeLinkFn || childLinkFn) {\n linkFns.push(i, nodeLinkFn, childLinkFn);\n linkFnFound = true;\n nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn;\n }\n\n //use the previous context only for the first element in the virtual group\n previousCompileContext = null;\n }\n\n // return a linking function if we have found anything, null otherwise\n return linkFnFound ? compositeLinkFn : null;\n\n function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {\n var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;\n var stableNodeList;\n\n\n if (nodeLinkFnFound) {\n // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our\n // offsets don't get screwed up\n var nodeListLength = nodeList.length;\n stableNodeList = new Array(nodeListLength);\n\n // create a sparse array by only copying the elements which have a linkFn\n for (i = 0; i < linkFns.length; i+=3) {\n idx = linkFns[i];\n stableNodeList[idx] = nodeList[idx];\n }\n } else {\n stableNodeList = nodeList;\n }\n\n for (i = 0, ii = linkFns.length; i < ii;) {\n node = stableNodeList[linkFns[i++]];\n nodeLinkFn = linkFns[i++];\n childLinkFn = linkFns[i++];\n\n if (nodeLinkFn) {\n if (nodeLinkFn.scope) {\n childScope = scope.$new();\n compile.$$addScopeInfo(jqLite(node), childScope);\n } else {\n childScope = scope;\n }\n\n if (nodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(\n scope, nodeLinkFn.transclude, parentBoundTranscludeFn);\n\n } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {\n childBoundTranscludeFn = parentBoundTranscludeFn;\n\n } else if (!parentBoundTranscludeFn && transcludeFn) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);\n\n } else {\n childBoundTranscludeFn = null;\n }\n\n nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);\n\n } else if (childLinkFn) {\n childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);\n }\n }\n }\n }\n\n function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {\n function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {\n\n if (!transcludedScope) {\n transcludedScope = scope.$new(false, containingScope);\n transcludedScope.$$transcluded = true;\n }\n\n return transcludeFn(transcludedScope, cloneFn, {\n parentBoundTranscludeFn: previousBoundTranscludeFn,\n transcludeControllers: controllers,\n futureParentElement: futureParentElement\n });\n }\n\n // We need to attach the transclusion slots onto the `boundTranscludeFn`\n // so that they are available inside the `controllersBoundTransclude` function\n var boundSlots = boundTranscludeFn.$$slots = createMap();\n for (var slotName in transcludeFn.$$slots) {\n if (transcludeFn.$$slots[slotName]) {\n boundSlots[slotName] = createBoundTranscludeFn(scope, transcludeFn.$$slots[slotName], previousBoundTranscludeFn);\n } else {\n boundSlots[slotName] = null;\n }\n }\n\n return boundTranscludeFn;\n }\n\n /**\n * Looks for directives on the given node and adds them to the directive collection which is\n * sorted.\n *\n * @param node Node to search.\n * @param directives An array to which the directives are added to. This array is sorted before\n * the function returns.\n * @param attrs The shared attrs object which is used to populate the normalized attributes.\n * @param {number=} maxPriority Max directive priority.\n */\n function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n var nodeType = node.nodeType,\n attrsMap = attrs.$attr,\n match,\n className;\n\n switch (nodeType) {\n case NODE_TYPE_ELEMENT: /* Element */\n // use the node name: \n addDirective(directives,\n directiveNormalize(nodeName_(node)), 'E', maxPriority, ignoreDirective);\n\n // iterate over the attributes\n for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,\n j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {\n var attrStartName = false;\n var attrEndName = false;\n\n attr = nAttrs[j];\n name = attr.name;\n value = trim(attr.value);\n\n // support ngAttr attribute binding\n ngAttrName = directiveNormalize(name);\n if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) {\n name = name.replace(PREFIX_REGEXP, '')\n .substr(8).replace(/_(.)/g, function(match, letter) {\n return letter.toUpperCase();\n });\n }\n\n var multiElementMatch = ngAttrName.match(MULTI_ELEMENT_DIR_RE);\n if (multiElementMatch && directiveIsMultiElement(multiElementMatch[1])) {\n attrStartName = name;\n attrEndName = name.substr(0, name.length - 5) + 'end';\n name = name.substr(0, name.length - 6);\n }\n\n nName = directiveNormalize(name.toLowerCase());\n attrsMap[nName] = name;\n if (isNgAttr || !attrs.hasOwnProperty(nName)) {\n attrs[nName] = value;\n if (getBooleanAttrName(node, nName)) {\n attrs[nName] = true; // presence means true\n }\n }\n addAttrInterpolateDirective(node, directives, value, nName, isNgAttr);\n addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,\n attrEndName);\n }\n\n // use class as directive\n className = node.className;\n if (isObject(className)) {\n // Maybe SVGAnimatedString\n className = className.animVal;\n }\n if (isString(className) && className !== '') {\n while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {\n nName = directiveNormalize(match[2]);\n if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {\n attrs[nName] = trim(match[3]);\n }\n className = className.substr(match.index + match[0].length);\n }\n }\n break;\n case NODE_TYPE_TEXT: /* Text Node */\n if (msie === 11) {\n // Workaround for #11781\n while (node.parentNode && node.nextSibling && node.nextSibling.nodeType === NODE_TYPE_TEXT) {\n node.nodeValue = node.nodeValue + node.nextSibling.nodeValue;\n node.parentNode.removeChild(node.nextSibling);\n }\n }\n addTextInterpolateDirective(directives, node.nodeValue);\n break;\n case NODE_TYPE_COMMENT: /* Comment */\n collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective);\n break;\n }\n\n directives.sort(byPriority);\n return directives;\n }\n\n function collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n // function created because of performance, try/catch disables\n // the optimization of the whole function #14848\n try {\n var match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);\n if (match) {\n var nName = directiveNormalize(match[1]);\n if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {\n attrs[nName] = trim(match[2]);\n }\n }\n } catch (e) {\n // turns out that under some circumstances IE9 throws errors when one attempts to read\n // comment's node value.\n // Just ignore it and continue. (Can't seem to reproduce in test case.)\n }\n }\n\n /**\n * Given a node with an directive-start it collects all of the siblings until it finds\n * directive-end.\n * @param node\n * @param attrStart\n * @param attrEnd\n * @returns {*}\n */\n function groupScan(node, attrStart, attrEnd) {\n var nodes = [];\n var depth = 0;\n if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {\n do {\n if (!node) {\n throw $compileMinErr('uterdir',\n \"Unterminated attribute, found '{0}' but no matching '{1}' found.\",\n attrStart, attrEnd);\n }\n if (node.nodeType == NODE_TYPE_ELEMENT) {\n if (node.hasAttribute(attrStart)) depth++;\n if (node.hasAttribute(attrEnd)) depth--;\n }\n nodes.push(node);\n node = node.nextSibling;\n } while (depth > 0);\n } else {\n nodes.push(node);\n }\n\n return jqLite(nodes);\n }\n\n /**\n * Wrapper for linking function which converts normal linking function into a grouped\n * linking function.\n * @param linkFn\n * @param attrStart\n * @param attrEnd\n * @returns {Function}\n */\n function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {\n return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) {\n element = groupScan(element[0], attrStart, attrEnd);\n return linkFn(scope, element, attrs, controllers, transcludeFn);\n };\n }\n\n /**\n * A function generator that is used to support both eager and lazy compilation\n * linking function.\n * @param eager\n * @param $compileNodes\n * @param transcludeFn\n * @param maxPriority\n * @param ignoreDirective\n * @param previousCompileContext\n * @returns {Function}\n */\n function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {\n var compiled;\n\n if (eager) {\n return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);\n }\n return function lazyCompilation() {\n if (!compiled) {\n compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);\n\n // Null out all of these references in order to make them eligible for garbage collection\n // since this is a potentially long lived closure\n $compileNodes = transcludeFn = previousCompileContext = null;\n }\n return compiled.apply(this, arguments);\n };\n }\n\n /**\n * Once the directives have been collected, their compile functions are executed. This method\n * is responsible for inlining directive templates as well as terminating the application\n * of the directives if the terminal directive has been reached.\n *\n * @param {Array} directives Array of collected directives to execute their compile function.\n * this needs to be pre-sorted by priority order.\n * @param {Node} compileNode The raw DOM node to apply the compile functions to\n * @param {Object} templateAttrs The shared attribute function\n * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n * scope argument is auto-generated to the new\n * child of the transcluded parent scope.\n * @param {JQLite} jqCollection If we are working on the root of the compile tree then this\n * argument has the root jqLite array so that we can replace nodes\n * on it.\n * @param {Object=} originalReplaceDirective An optional directive that will be ignored when\n * compiling the transclusion.\n * @param {Array.} preLinkFns\n * @param {Array.} postLinkFns\n * @param {Object} previousCompileContext Context used for previous compilation of the current\n * node\n * @returns {Function} linkFn\n */\n function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,\n jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,\n previousCompileContext) {\n previousCompileContext = previousCompileContext || {};\n\n var terminalPriority = -Number.MAX_VALUE,\n newScopeDirective = previousCompileContext.newScopeDirective,\n controllerDirectives = previousCompileContext.controllerDirectives,\n newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,\n templateDirective = previousCompileContext.templateDirective,\n nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,\n hasTranscludeDirective = false,\n hasTemplate = false,\n hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,\n $compileNode = templateAttrs.$$element = jqLite(compileNode),\n directive,\n directiveName,\n $template,\n replaceDirective = originalReplaceDirective,\n childTranscludeFn = transcludeFn,\n linkFn,\n didScanForMultipleTransclusion = false,\n mightHaveMultipleTransclusionError = false,\n directiveValue;\n\n // executes all directives on the current element\n for (var i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n var attrStart = directive.$$start;\n var attrEnd = directive.$$end;\n\n // collect multiblock sections\n if (attrStart) {\n $compileNode = groupScan(compileNode, attrStart, attrEnd);\n }\n $template = undefined;\n\n if (terminalPriority > directive.priority) {\n break; // prevent further processing of directives\n }\n\n if (directiveValue = directive.scope) {\n\n // skip the check for directives with async templates, we'll check the derived sync\n // directive when the template arrives\n if (!directive.templateUrl) {\n if (isObject(directiveValue)) {\n // This directive is trying to add an isolated scope.\n // Check that there is no scope of any kind already\n assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,\n directive, $compileNode);\n newIsolateScopeDirective = directive;\n } else {\n // This directive is trying to add a child scope.\n // Check that there is no isolated scope already\n assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,\n $compileNode);\n }\n }\n\n newScopeDirective = newScopeDirective || directive;\n }\n\n directiveName = directive.name;\n\n // If we encounter a condition that can result in transclusion on the directive,\n // then scan ahead in the remaining directives for others that may cause a multiple\n // transclusion error to be thrown during the compilation process. If a matching directive\n // is found, then we know that when we encounter a transcluded directive, we need to eagerly\n // compile the `transclude` function rather than doing it lazily in order to throw\n // exceptions at the correct time\n if (!didScanForMultipleTransclusion && ((directive.replace && (directive.templateUrl || directive.template))\n || (directive.transclude && !directive.$$tlb))) {\n var candidateDirective;\n\n for (var scanningIndex = i + 1; candidateDirective = directives[scanningIndex++];) {\n if ((candidateDirective.transclude && !candidateDirective.$$tlb)\n || (candidateDirective.replace && (candidateDirective.templateUrl || candidateDirective.template))) {\n mightHaveMultipleTransclusionError = true;\n break;\n }\n }\n\n didScanForMultipleTransclusion = true;\n }\n\n if (!directive.templateUrl && directive.controller) {\n directiveValue = directive.controller;\n controllerDirectives = controllerDirectives || createMap();\n assertNoDuplicate(\"'\" + directiveName + \"' controller\",\n controllerDirectives[directiveName], directive, $compileNode);\n controllerDirectives[directiveName] = directive;\n }\n\n if (directiveValue = directive.transclude) {\n hasTranscludeDirective = true;\n\n // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.\n // This option should only be used by directives that know how to safely handle element transclusion,\n // where the transcluded nodes are added or replaced after linking.\n if (!directive.$$tlb) {\n assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);\n nonTlbTranscludeDirective = directive;\n }\n\n if (directiveValue == 'element') {\n hasElementTranscludeDirective = true;\n terminalPriority = directive.priority;\n $template = $compileNode;\n $compileNode = templateAttrs.$$element =\n jqLite(compile.$$createComment(directiveName, templateAttrs[directiveName]));\n compileNode = $compileNode[0];\n replaceWith(jqCollection, sliceArgs($template), compileNode);\n\n // Support: Chrome < 50\n // https://github.com/angular/angular.js/issues/14041\n\n // In the versions of V8 prior to Chrome 50, the document fragment that is created\n // in the `replaceWith` function is improperly garbage collected despite still\n // being referenced by the `parentNode` property of all of the child nodes. By adding\n // a reference to the fragment via a different property, we can avoid that incorrect\n // behavior.\n // TODO: remove this line after Chrome 50 has been released\n $template[0].$$parentNode = $template[0].parentNode;\n\n childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, terminalPriority,\n replaceDirective && replaceDirective.name, {\n // Don't pass in:\n // - controllerDirectives - otherwise we'll create duplicates controllers\n // - newIsolateScopeDirective or templateDirective - combining templates with\n // element transclusion doesn't make sense.\n //\n // We need only nonTlbTranscludeDirective so that we prevent putting transclusion\n // on the same element more than once.\n nonTlbTranscludeDirective: nonTlbTranscludeDirective\n });\n } else {\n\n var slots = createMap();\n\n $template = jqLite(jqLiteClone(compileNode)).contents();\n\n if (isObject(directiveValue)) {\n\n // We have transclusion slots,\n // collect them up, compile them and store their transclusion functions\n $template = [];\n\n var slotMap = createMap();\n var filledSlots = createMap();\n\n // Parse the element selectors\n forEach(directiveValue, function(elementSelector, slotName) {\n // If an element selector starts with a ? then it is optional\n var optional = (elementSelector.charAt(0) === '?');\n elementSelector = optional ? elementSelector.substring(1) : elementSelector;\n\n slotMap[elementSelector] = slotName;\n\n // We explicitly assign `null` since this implies that a slot was defined but not filled.\n // Later when calling boundTransclusion functions with a slot name we only error if the\n // slot is `undefined`\n slots[slotName] = null;\n\n // filledSlots contains `true` for all slots that are either optional or have been\n // filled. This is used to check that we have not missed any required slots\n filledSlots[slotName] = optional;\n });\n\n // Add the matching elements into their slot\n forEach($compileNode.contents(), function(node) {\n var slotName = slotMap[directiveNormalize(nodeName_(node))];\n if (slotName) {\n filledSlots[slotName] = true;\n slots[slotName] = slots[slotName] || [];\n slots[slotName].push(node);\n } else {\n $template.push(node);\n }\n });\n\n // Check for required slots that were not filled\n forEach(filledSlots, function(filled, slotName) {\n if (!filled) {\n throw $compileMinErr('reqslot', 'Required transclusion slot `{0}` was not filled.', slotName);\n }\n });\n\n for (var slotName in slots) {\n if (slots[slotName]) {\n // Only define a transclusion function if the slot was filled\n slots[slotName] = compilationGenerator(mightHaveMultipleTransclusionError, slots[slotName], transcludeFn);\n }\n }\n }\n\n $compileNode.empty(); // clear contents\n childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, undefined,\n undefined, { needsNewScope: directive.$$isolateScope || directive.$$newScope});\n childTranscludeFn.$$slots = slots;\n }\n }\n\n if (directive.template) {\n hasTemplate = true;\n assertNoDuplicate('template', templateDirective, directive, $compileNode);\n templateDirective = directive;\n\n directiveValue = (isFunction(directive.template))\n ? directive.template($compileNode, templateAttrs)\n : directive.template;\n\n directiveValue = denormalizeTemplate(directiveValue);\n\n if (directive.replace) {\n replaceDirective = directive;\n if (jqLiteIsTextNode(directiveValue)) {\n $template = [];\n } else {\n $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue)));\n }\n compileNode = $template[0];\n\n if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n throw $compileMinErr('tplrt',\n \"Template for directive '{0}' must have exactly one root element. {1}\",\n directiveName, '');\n }\n\n replaceWith(jqCollection, $compileNode, compileNode);\n\n var newTemplateAttrs = {$attr: {}};\n\n // combine directives from the original node and from the template:\n // - take the array of directives for this element\n // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed)\n // - collect directives from the template and sort them by priority\n // - combine directives as: processed + template + unprocessed\n var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);\n var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));\n\n if (newIsolateScopeDirective || newScopeDirective) {\n // The original directive caused the current element to be replaced but this element\n // also needs to have a new scope, so we need to tell the template directives\n // that they would need to get their scope from further up, if they require transclusion\n markDirectiveScope(templateDirectives, newIsolateScopeDirective, newScopeDirective);\n }\n directives = directives.concat(templateDirectives).concat(unprocessedDirectives);\n mergeTemplateAttributes(templateAttrs, newTemplateAttrs);\n\n ii = directives.length;\n } else {\n $compileNode.html(directiveValue);\n }\n }\n\n if (directive.templateUrl) {\n hasTemplate = true;\n assertNoDuplicate('template', templateDirective, directive, $compileNode);\n templateDirective = directive;\n\n if (directive.replace) {\n replaceDirective = directive;\n }\n\n /* jshint -W021 */\n nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode,\n /* jshint +W021 */\n templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {\n controllerDirectives: controllerDirectives,\n newScopeDirective: (newScopeDirective !== directive) && newScopeDirective,\n newIsolateScopeDirective: newIsolateScopeDirective,\n templateDirective: templateDirective,\n nonTlbTranscludeDirective: nonTlbTranscludeDirective\n });\n ii = directives.length;\n } else if (directive.compile) {\n try {\n linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);\n var context = directive.$$originalDirective || directive;\n if (isFunction(linkFn)) {\n addLinkFns(null, bind(context, linkFn), attrStart, attrEnd);\n } else if (linkFn) {\n addLinkFns(bind(context, linkFn.pre), bind(context, linkFn.post), attrStart, attrEnd);\n }\n } catch (e) {\n $exceptionHandler(e, startingTag($compileNode));\n }\n }\n\n if (directive.terminal) {\n nodeLinkFn.terminal = true;\n terminalPriority = Math.max(terminalPriority, directive.priority);\n }\n\n }\n\n nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;\n nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;\n nodeLinkFn.templateOnThisElement = hasTemplate;\n nodeLinkFn.transclude = childTranscludeFn;\n\n previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;\n\n // might be normal or delayed nodeLinkFn depending on if templateUrl is present\n return nodeLinkFn;\n\n ////////////////////\n\n function addLinkFns(pre, post, attrStart, attrEnd) {\n if (pre) {\n if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);\n pre.require = directive.require;\n pre.directiveName = directiveName;\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n pre = cloneAndAnnotateFn(pre, {isolateScope: true});\n }\n preLinkFns.push(pre);\n }\n if (post) {\n if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);\n post.require = directive.require;\n post.directiveName = directiveName;\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n post = cloneAndAnnotateFn(post, {isolateScope: true});\n }\n postLinkFns.push(post);\n }\n }\n\n function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {\n var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element,\n attrs, scopeBindingInfo;\n\n if (compileNode === linkNode) {\n attrs = templateAttrs;\n $element = templateAttrs.$$element;\n } else {\n $element = jqLite(linkNode);\n attrs = new Attributes($element, templateAttrs);\n }\n\n controllerScope = scope;\n if (newIsolateScopeDirective) {\n isolateScope = scope.$new(true);\n } else if (newScopeDirective) {\n controllerScope = scope.$parent;\n }\n\n if (boundTranscludeFn) {\n // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn`\n // is later passed as `parentBoundTranscludeFn` to `publicLinkFn`\n transcludeFn = controllersBoundTransclude;\n transcludeFn.$$boundTransclude = boundTranscludeFn;\n // expose the slots on the `$transclude` function\n transcludeFn.isSlotFilled = function(slotName) {\n return !!boundTranscludeFn.$$slots[slotName];\n };\n }\n\n if (controllerDirectives) {\n elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective);\n }\n\n if (newIsolateScopeDirective) {\n // Initialize isolate scope bindings for new isolate scope directive.\n compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective ||\n templateDirective === newIsolateScopeDirective.$$originalDirective)));\n compile.$$addScopeClass($element, true);\n isolateScope.$$isolateBindings =\n newIsolateScopeDirective.$$isolateBindings;\n scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope,\n isolateScope.$$isolateBindings,\n newIsolateScopeDirective);\n if (scopeBindingInfo.removeWatches) {\n isolateScope.$on('$destroy', scopeBindingInfo.removeWatches);\n }\n }\n\n // Initialize bindToController bindings\n for (var name in elementControllers) {\n var controllerDirective = controllerDirectives[name];\n var controller = elementControllers[name];\n var bindings = controllerDirective.$$bindings.bindToController;\n\n if (controller.identifier && bindings) {\n controller.bindingInfo =\n initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);\n } else {\n controller.bindingInfo = {};\n }\n\n var controllerResult = controller();\n if (controllerResult !== controller.instance) {\n // If the controller constructor has a return value, overwrite the instance\n // from setupControllers\n controller.instance = controllerResult;\n $element.data('$' + controllerDirective.name + 'Controller', controllerResult);\n controller.bindingInfo.removeWatches && controller.bindingInfo.removeWatches();\n controller.bindingInfo =\n initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);\n }\n }\n\n // Bind the required controllers to the controller, if `require` is an object and `bindToController` is truthy\n forEach(controllerDirectives, function(controllerDirective, name) {\n var require = controllerDirective.require;\n if (controllerDirective.bindToController && !isArray(require) && isObject(require)) {\n extend(elementControllers[name].instance, getControllers(name, require, $element, elementControllers));\n }\n });\n\n // Handle the init and destroy lifecycle hooks on all controllers that have them\n forEach(elementControllers, function(controller) {\n var controllerInstance = controller.instance;\n if (isFunction(controllerInstance.$onChanges)) {\n try {\n controllerInstance.$onChanges(controller.bindingInfo.initialChanges);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n if (isFunction(controllerInstance.$onInit)) {\n try {\n controllerInstance.$onInit();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n if (isFunction(controllerInstance.$doCheck)) {\n controllerScope.$watch(function() { controllerInstance.$doCheck(); });\n controllerInstance.$doCheck();\n }\n if (isFunction(controllerInstance.$onDestroy)) {\n controllerScope.$on('$destroy', function callOnDestroyHook() {\n controllerInstance.$onDestroy();\n });\n }\n });\n\n // PRELINKING\n for (i = 0, ii = preLinkFns.length; i < ii; i++) {\n linkFn = preLinkFns[i];\n invokeLinkFn(linkFn,\n linkFn.isolateScope ? isolateScope : scope,\n $element,\n attrs,\n linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n transcludeFn\n );\n }\n\n // RECURSION\n // We only pass the isolate scope, if the isolate directive has a template,\n // otherwise the child elements do not belong to the isolate directive.\n var scopeToChild = scope;\n if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {\n scopeToChild = isolateScope;\n }\n childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);\n\n // POSTLINKING\n for (i = postLinkFns.length - 1; i >= 0; i--) {\n linkFn = postLinkFns[i];\n invokeLinkFn(linkFn,\n linkFn.isolateScope ? isolateScope : scope,\n $element,\n attrs,\n linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n transcludeFn\n );\n }\n\n // Trigger $postLink lifecycle hooks\n forEach(elementControllers, function(controller) {\n var controllerInstance = controller.instance;\n if (isFunction(controllerInstance.$postLink)) {\n controllerInstance.$postLink();\n }\n });\n\n // This is the function that is injected as `$transclude`.\n // Note: all arguments are optional!\n function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {\n var transcludeControllers;\n // No scope passed in:\n if (!isScope(scope)) {\n slotName = futureParentElement;\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n if (slotName) {\n // slotTranscludeFn can be one of three things:\n // * a transclude function - a filled slot\n // * `null` - an optional slot that was not filled\n // * `undefined` - a slot that was not declared (i.e. invalid)\n var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];\n if (slotTranscludeFn) {\n return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n } else if (isUndefined(slotTranscludeFn)) {\n throw $compileMinErr('noslot',\n 'No parent directive that requires a transclusion with slot name \"{0}\". ' +\n 'Element: {1}',\n slotName, startingTag($element));\n }\n } else {\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }\n }\n }\n }\n\n function getControllers(directiveName, require, $element, elementControllers) {\n var value;\n\n if (isString(require)) {\n var match = require.match(REQUIRE_PREFIX_REGEXP);\n var name = require.substring(match[0].length);\n var inheritType = match[1] || match[3];\n var optional = match[2] === '?';\n\n //If only parents then start at the parent element\n if (inheritType === '^^') {\n $element = $element.parent();\n //Otherwise attempt getting the controller from elementControllers in case\n //the element is transcluded (and has no data) and to avoid .data if possible\n } else {\n value = elementControllers && elementControllers[name];\n value = value && value.instance;\n }\n\n if (!value) {\n var dataName = '$' + name + 'Controller';\n value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName);\n }\n\n if (!value && !optional) {\n throw $compileMinErr('ctreq',\n \"Controller '{0}', required by directive '{1}', can't be found!\",\n name, directiveName);\n }\n } else if (isArray(require)) {\n value = [];\n for (var i = 0, ii = require.length; i < ii; i++) {\n value[i] = getControllers(directiveName, require[i], $element, elementControllers);\n }\n } else if (isObject(require)) {\n value = {};\n forEach(require, function(controller, property) {\n value[property] = getControllers(directiveName, controller, $element, elementControllers);\n });\n }\n\n return value || null;\n }\n\n function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective) {\n var elementControllers = createMap();\n for (var controllerKey in controllerDirectives) {\n var directive = controllerDirectives[controllerKey];\n var locals = {\n $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,\n $element: $element,\n $attrs: attrs,\n $transclude: transcludeFn\n };\n\n var controller = directive.controller;\n if (controller == '@') {\n controller = attrs[directive.name];\n }\n\n var controllerInstance = $controller(controller, locals, true, directive.controllerAs);\n\n // For directives with element transclusion the element is a comment.\n // In this case .data will not attach any data.\n // Instead, we save the controllers for the element in a local hash and attach to .data\n // later, once we have the actual element.\n elementControllers[directive.name] = controllerInstance;\n $element.data('$' + directive.name + 'Controller', controllerInstance.instance);\n }\n return elementControllers;\n }\n\n // Depending upon the context in which a directive finds itself it might need to have a new isolated\n // or child scope created. For instance:\n // * if the directive has been pulled into a template because another directive with a higher priority\n // asked for element transclusion\n // * if the directive itself asks for transclusion but it is at the root of a template and the original\n // element was replaced. See https://github.com/angular/angular.js/issues/12936\n function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n }\n }\n\n /**\n * looks up the directive and decorates it with exception handling and proper parameters. We\n * call this the boundDirective.\n *\n * @param {string} name name of the directive to look up.\n * @param {string} location The directive must be found in specific format.\n * String containing any of theses characters:\n *\n * * `E`: element name\n * * `A': attribute\n * * `C`: class\n * * `M`: comment\n * @returns {boolean} true if directive was added.\n */\n function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,\n endAttrName) {\n if (name === ignoreDirective) return null;\n var match = null;\n if (hasDirectives.hasOwnProperty(name)) {\n for (var directive, directives = $injector.get(name + Suffix),\n i = 0, ii = directives.length; i < ii; i++) {\n try {\n directive = directives[i];\n if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&\n directive.restrict.indexOf(location) != -1) {\n if (startAttrName) {\n directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});\n }\n if (!directive.$$bindings) {\n var bindings = directive.$$bindings =\n parseDirectiveBindings(directive, directive.name);\n if (isObject(bindings.isolateScope)) {\n directive.$$isolateBindings = bindings.isolateScope;\n }\n }\n tDirectives.push(directive);\n match = directive;\n }\n } catch (e) { $exceptionHandler(e); }\n }\n }\n return match;\n }\n\n\n /**\n * looks up the directive and returns true if it is a multi-element directive,\n * and therefore requires DOM nodes between -start and -end markers to be grouped\n * together.\n *\n * @param {string} name name of the directive to look up.\n * @returns true if directive was registered as multi-element.\n */\n function directiveIsMultiElement(name) {\n if (hasDirectives.hasOwnProperty(name)) {\n for (var directive, directives = $injector.get(name + Suffix),\n i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n if (directive.multiElement) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * When the element is replaced with HTML template then the new attributes\n * on the template need to be merged with the existing attributes in the DOM.\n * The desired effect is to have both of the attributes present.\n *\n * @param {object} dst destination attributes (original DOM)\n * @param {object} src source attributes (from the directive template)\n */\n function mergeTemplateAttributes(dst, src) {\n var srcAttr = src.$attr,\n dstAttr = dst.$attr,\n $element = dst.$$element;\n\n // reapply the old attributes to the new element\n forEach(dst, function(value, key) {\n if (key.charAt(0) != '$') {\n if (src[key] && src[key] !== value) {\n value += (key === 'style' ? ';' : ' ') + src[key];\n }\n dst.$set(key, value, true, srcAttr[key]);\n }\n });\n\n // copy the new attributes on the old attrs object\n forEach(src, function(value, key) {\n // Check if we already set this attribute in the loop above.\n // `dst` will never contain hasOwnProperty as DOM parser won't let it.\n // You will get an \"InvalidCharacterError: DOM Exception 5\" error if you\n // have an attribute like \"has-own-property\" or \"data-has-own-property\", etc.\n if (!dst.hasOwnProperty(key) && key.charAt(0) !== '$') {\n dst[key] = value;\n\n if (key !== 'class' && key !== 'style') {\n dstAttr[key] = srcAttr[key];\n }\n }\n });\n }\n\n\n function compileTemplateUrl(directives, $compileNode, tAttrs,\n $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {\n var linkQueue = [],\n afterTemplateNodeLinkFn,\n afterTemplateChildLinkFn,\n beforeTemplateCompileNode = $compileNode[0],\n origAsyncDirective = directives.shift(),\n derivedSyncDirective = inherit(origAsyncDirective, {\n templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective\n }),\n templateUrl = (isFunction(origAsyncDirective.templateUrl))\n ? origAsyncDirective.templateUrl($compileNode, tAttrs)\n : origAsyncDirective.templateUrl,\n templateNamespace = origAsyncDirective.templateNamespace;\n\n $compileNode.empty();\n\n $templateRequest(templateUrl)\n .then(function(content) {\n var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;\n\n content = denormalizeTemplate(content);\n\n if (origAsyncDirective.replace) {\n if (jqLiteIsTextNode(content)) {\n $template = [];\n } else {\n $template = removeComments(wrapTemplate(templateNamespace, trim(content)));\n }\n compileNode = $template[0];\n\n if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n throw $compileMinErr('tplrt',\n \"Template for directive '{0}' must have exactly one root element. {1}\",\n origAsyncDirective.name, templateUrl);\n }\n\n tempTemplateAttrs = {$attr: {}};\n replaceWith($rootElement, $compileNode, compileNode);\n var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);\n\n if (isObject(origAsyncDirective.scope)) {\n // the original directive that caused the template to be loaded async required\n // an isolate scope\n markDirectiveScope(templateDirectives, true);\n }\n directives = templateDirectives.concat(directives);\n mergeTemplateAttributes(tAttrs, tempTemplateAttrs);\n } else {\n compileNode = beforeTemplateCompileNode;\n $compileNode.html(content);\n }\n\n directives.unshift(derivedSyncDirective);\n\n afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs,\n childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,\n previousCompileContext);\n forEach($rootElement, function(node, i) {\n if (node == compileNode) {\n $rootElement[i] = $compileNode[0];\n }\n });\n afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);\n\n while (linkQueue.length) {\n var scope = linkQueue.shift(),\n beforeTemplateLinkNode = linkQueue.shift(),\n linkRootElement = linkQueue.shift(),\n boundTranscludeFn = linkQueue.shift(),\n linkNode = $compileNode[0];\n\n if (scope.$$destroyed) continue;\n\n if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {\n var oldClasses = beforeTemplateLinkNode.className;\n\n if (!(previousCompileContext.hasElementTranscludeDirective &&\n origAsyncDirective.replace)) {\n // it was cloned therefore we have to clone as well.\n linkNode = jqLiteClone(compileNode);\n }\n replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);\n\n // Copy in CSS classes from original node\n safeAddClass(jqLite(linkNode), oldClasses);\n }\n if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n } else {\n childBoundTranscludeFn = boundTranscludeFn;\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,\n childBoundTranscludeFn);\n }\n linkQueue = null;\n });\n\n return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {\n var childBoundTranscludeFn = boundTranscludeFn;\n if (scope.$$destroyed) return;\n if (linkQueue) {\n linkQueue.push(scope,\n node,\n rootElement,\n childBoundTranscludeFn);\n } else {\n if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn);\n }\n };\n }\n\n\n /**\n * Sorting function for bound directives.\n */\n function byPriority(a, b) {\n var diff = b.priority - a.priority;\n if (diff !== 0) return diff;\n if (a.name !== b.name) return (a.name < b.name) ? -1 : 1;\n return a.index - b.index;\n }\n\n function assertNoDuplicate(what, previousDirective, directive, element) {\n\n function wrapModuleNameIfDefined(moduleName) {\n return moduleName ?\n (' (module: ' + moduleName + ')') :\n '';\n }\n\n if (previousDirective) {\n throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}',\n previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName),\n directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element));\n }\n }\n\n\n function addTextInterpolateDirective(directives, text) {\n var interpolateFn = $interpolate(text, true);\n if (interpolateFn) {\n directives.push({\n priority: 0,\n compile: function textInterpolateCompileFn(templateNode) {\n var templateNodeParent = templateNode.parent(),\n hasCompileParent = !!templateNodeParent.length;\n\n // When transcluding a template that has bindings in the root\n // we don't have a parent and thus need to add the class during linking fn.\n if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);\n\n return function textInterpolateLinkFn(scope, node) {\n var parent = node.parent();\n if (!hasCompileParent) compile.$$addBindingClass(parent);\n compile.$$addBindingInfo(parent, interpolateFn.expressions);\n scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {\n node[0].nodeValue = value;\n });\n };\n }\n });\n }\n }\n\n\n function wrapTemplate(type, template) {\n type = lowercase(type || 'html');\n switch (type) {\n case 'svg':\n case 'math':\n var wrapper = window.document.createElement('div');\n wrapper.innerHTML = '<' + type + '>' + template + '';\n return wrapper.childNodes[0].childNodes;\n default:\n return template;\n }\n }\n\n\n function getTrustedContext(node, attrNormalizedName) {\n if (attrNormalizedName == \"srcdoc\") {\n return $sce.HTML;\n }\n var tag = nodeName_(node);\n // maction[xlink:href] can source SVG. It's not limited to .\n if (attrNormalizedName == \"xlinkHref\" ||\n (tag == \"form\" && attrNormalizedName == \"action\") ||\n (tag != \"img\" && (attrNormalizedName == \"src\" ||\n attrNormalizedName == \"ngSrc\"))) {\n return $sce.RESOURCE_URL;\n }\n }\n\n\n function addAttrInterpolateDirective(node, directives, value, name, allOrNothing) {\n var trustedContext = getTrustedContext(node, name);\n allOrNothing = ALL_OR_NOTHING_ATTRS[name] || allOrNothing;\n\n var interpolateFn = $interpolate(value, true, trustedContext, allOrNothing);\n\n // no interpolation found -> ignore\n if (!interpolateFn) return;\n\n\n if (name === \"multiple\" && nodeName_(node) === \"select\") {\n throw $compileMinErr(\"selmulti\",\n \"Binding to the 'multiple' attribute is not supported. Element: {0}\",\n startingTag(node));\n }\n\n directives.push({\n priority: 100,\n compile: function() {\n return {\n pre: function attrInterpolatePreLinkFn(scope, element, attr) {\n var $$observers = (attr.$$observers || (attr.$$observers = createMap()));\n\n if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {\n throw $compileMinErr('nodomevents',\n \"Interpolations for HTML DOM event attributes are disallowed. Please use the \" +\n \"ng- versions (such as ng-click instead of onclick) instead.\");\n }\n\n // If the attribute has changed since last $interpolate()ed\n var newValue = attr[name];\n if (newValue !== value) {\n // we need to interpolate again since the attribute value has been updated\n // (e.g. by another directive's compile function)\n // ensure unset/empty values make interpolateFn falsy\n interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing);\n value = newValue;\n }\n\n // if attribute was updated so that there is no interpolation going on we don't want to\n // register any observers\n if (!interpolateFn) return;\n\n // initialize attr object so that it's ready in case we need the value for isolate\n // scope initialization, otherwise the value would not be available from isolate\n // directive's linking fn during linking phase\n attr[name] = interpolateFn(scope);\n\n ($$observers[name] || ($$observers[name] = [])).$$inter = true;\n (attr.$$observers && attr.$$observers[name].$$scope || scope).\n $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {\n //special case for class attribute addition + removal\n //so that class changes can tap into the animation\n //hooks provided by the $animate service. Be sure to\n //skip animations when the first digest occurs (when\n //both the new and the old values are the same) since\n //the CSS classes are the non-interpolated values\n if (name === 'class' && newValue != oldValue) {\n attr.$updateClass(newValue, oldValue);\n } else {\n attr.$set(name, newValue);\n }\n });\n }\n };\n }\n });\n }\n\n\n /**\n * This is a special jqLite.replaceWith, which can replace items which\n * have no parents, provided that the containing jqLite collection is provided.\n *\n * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes\n * in the root of the tree.\n * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep\n * the shell, but replace its DOM node reference.\n * @param {Node} newNode The new DOM node.\n */\n function replaceWith($rootElement, elementsToRemove, newNode) {\n var firstElementToRemove = elementsToRemove[0],\n removeCount = elementsToRemove.length,\n parent = firstElementToRemove.parentNode,\n i, ii;\n\n if ($rootElement) {\n for (i = 0, ii = $rootElement.length; i < ii; i++) {\n if ($rootElement[i] == firstElementToRemove) {\n $rootElement[i++] = newNode;\n for (var j = i, j2 = j + removeCount - 1,\n jj = $rootElement.length;\n j < jj; j++, j2++) {\n if (j2 < jj) {\n $rootElement[j] = $rootElement[j2];\n } else {\n delete $rootElement[j];\n }\n }\n $rootElement.length -= removeCount - 1;\n\n // If the replaced element is also the jQuery .context then replace it\n // .context is a deprecated jQuery api, so we should set it only when jQuery set it\n // http://api.jquery.com/context/\n if ($rootElement.context === firstElementToRemove) {\n $rootElement.context = newNode;\n }\n break;\n }\n }\n }\n\n if (parent) {\n parent.replaceChild(newNode, firstElementToRemove);\n }\n\n // Append all the `elementsToRemove` to a fragment. This will...\n // - remove them from the DOM\n // - allow them to still be traversed with .nextSibling\n // - allow a single fragment.qSA to fetch all elements being removed\n var fragment = window.document.createDocumentFragment();\n for (i = 0; i < removeCount; i++) {\n fragment.appendChild(elementsToRemove[i]);\n }\n\n if (jqLite.hasData(firstElementToRemove)) {\n // Copy over user data (that includes Angular's $scope etc.). Don't copy private\n // data here because there's no public interface in jQuery to do that and copying over\n // event listeners (which is the main use of private data) wouldn't work anyway.\n jqLite.data(newNode, jqLite.data(firstElementToRemove));\n\n // Remove $destroy event listeners from `firstElementToRemove`\n jqLite(firstElementToRemove).off('$destroy');\n }\n\n // Cleanup any data/listeners on the elements and children.\n // This includes invoking the $destroy event on any elements with listeners.\n jqLite.cleanData(fragment.querySelectorAll('*'));\n\n // Update the jqLite collection to only contain the `newNode`\n for (i = 1; i < removeCount; i++) {\n delete elementsToRemove[i];\n }\n elementsToRemove[0] = newNode;\n elementsToRemove.length = 1;\n }\n\n\n function cloneAndAnnotateFn(fn, annotation) {\n return extend(function() { return fn.apply(null, arguments); }, fn, annotation);\n }\n\n\n function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {\n try {\n linkFn(scope, $element, attrs, controllers, transcludeFn);\n } catch (e) {\n $exceptionHandler(e, startingTag($element));\n }\n }\n\n\n // Set up $watches for isolate scope and controller bindings. This process\n // only occurs for isolate scopes and new scopes with controllerAs.\n function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {\n var removeWatchCollection = [];\n var initialChanges = {};\n var changes;\n forEach(bindings, function initializeBinding(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, <, or &\n lastValue,\n parentGet, parentSet, compare, removeWatch;\n\n switch (mode) {\n\n case '@':\n if (!optional && !hasOwnProperty.call(attrs, attrName)) {\n destination[scopeName] = attrs[attrName] = void 0;\n }\n attrs.$observe(attrName, function(value) {\n if (isString(value) || isBoolean(value)) {\n var oldValue = destination[scopeName];\n recordChanges(scopeName, value, oldValue);\n destination[scopeName] = value;\n }\n });\n attrs.$$observers[attrName].$$scope = scope;\n lastValue = attrs[attrName];\n if (isString(lastValue)) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(lastValue)(scope);\n } else if (isBoolean(lastValue)) {\n // If the attributes is one of the BOOLEAN_ATTR then Angular will have converted\n // the value to boolean rather than a string, so we special case this situation\n destination[scopeName] = lastValue;\n }\n initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]);\n break;\n\n case '=':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n attrs[attrName] = void 0;\n }\n if (optional && !attrs[attrName]) break;\n\n parentGet = $parse(attrs[attrName]);\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = function simpleCompare(a, b) { return a === b || (a !== a && b !== b); };\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n \"Expression '{0}' in attribute '{1}' used with directive '{2}' is non-assignable!\",\n attrs[attrName], attrName, directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n return lastValue = parentValue;\n };\n parentValueWatch.$stateful = true;\n if (definition.collection) {\n removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n removeWatchCollection.push(removeWatch);\n break;\n\n case '<':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n attrs[attrName] = void 0;\n }\n if (optional && !attrs[attrName]) break;\n\n parentGet = $parse(attrs[attrName]);\n\n var initialValue = destination[scopeName] = parentGet(scope);\n initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]);\n\n removeWatch = scope.$watch(parentGet, function parentValueWatchAction(newValue, oldValue) {\n if (oldValue === newValue) {\n if (oldValue === initialValue) return;\n oldValue = initialValue;\n }\n recordChanges(scopeName, newValue, oldValue);\n destination[scopeName] = newValue;\n }, parentGet.literal);\n\n removeWatchCollection.push(removeWatch);\n break;\n\n case '&':\n // Don't assign Object.prototype method to scope\n parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n\n function recordChanges(key, currentValue, previousValue) {\n if (isFunction(destination.$onChanges) && currentValue !== previousValue) {\n // If we have not already scheduled the top level onChangesQueue handler then do so now\n if (!onChangesQueue) {\n scope.$$postDigest(flushOnChangesQueue);\n onChangesQueue = [];\n }\n // If we have not already queued a trigger of onChanges for this controller then do so now\n if (!changes) {\n changes = {};\n onChangesQueue.push(triggerOnChangesHook);\n }\n // If the has been a change on this property already then we need to reuse the previous value\n if (changes[key]) {\n previousValue = changes[key].previousValue;\n }\n // Store this change\n changes[key] = new SimpleChange(previousValue, currentValue);\n }\n }\n\n function triggerOnChangesHook() {\n destination.$onChanges(changes);\n // Now clear the changes so that we schedule onChanges when more changes arrive\n changes = undefined;\n }\n\n return {\n initialChanges: initialChanges,\n removeWatches: removeWatchCollection.length && function removeWatches() {\n for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) {\n removeWatchCollection[i]();\n }\n }\n };\n }\n }];\n}\n\nfunction SimpleChange(previous, current) {\n this.previousValue = previous;\n this.currentValue = current;\n}\nSimpleChange.prototype.isFirstChange = function() { return this.previousValue === _UNINITIALIZED_VALUE; };\n\n\nvar PREFIX_REGEXP = /^((?:x|data)[\\:\\-_])/i;\n/**\n * Converts all accepted directives format into proper directive name.\n * @param name Name to normalize\n */\nfunction directiveNormalize(name) {\n return camelCase(name.replace(PREFIX_REGEXP, ''));\n}\n\n/**\n * @ngdoc type\n * @name $compile.directive.Attributes\n *\n * @description\n * A shared object between directive compile / linking functions which contains normalized DOM\n * element attributes. The values reflect current binding state `{{ }}`. The normalization is\n * needed since all of these are treated as equivalent in Angular:\n *\n * ```\n * \n * ```\n */\n\n/**\n * @ngdoc property\n * @name $compile.directive.Attributes#$attr\n *\n * @description\n * A map of DOM element attribute names to the normalized name. This is\n * needed to do reverse lookup from normalized name back to actual name.\n */\n\n\n/**\n * @ngdoc method\n * @name $compile.directive.Attributes#$set\n * @kind function\n *\n * @description\n * Set DOM element attribute value.\n *\n *\n * @param {string} name Normalized element attribute name of the property to modify. The name is\n * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}\n * property to the original name.\n * @param {string} value Value to set the attribute to. The value can be an interpolated string.\n */\n\n\n\n/**\n * Closure compiler type information\n */\n\nfunction nodesetLinkingFn(\n /* angular.Scope */ scope,\n /* NodeList */ nodeList,\n /* Element */ rootElement,\n /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction directiveLinkingFn(\n /* nodesetLinkingFn */ nodesetLinkingFn,\n /* angular.Scope */ scope,\n /* Node */ node,\n /* Element */ rootElement,\n /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction tokenDifference(str1, str2) {\n var values = '',\n tokens1 = str1.split(/\\s+/),\n tokens2 = str2.split(/\\s+/);\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token == tokens2[j]) continue outer;\n }\n values += (values.length > 0 ? ' ' : '') + token;\n }\n return values;\n}\n\nfunction removeComments(jqNodes) {\n jqNodes = jqLite(jqNodes);\n var i = jqNodes.length;\n\n if (i <= 1) {\n return jqNodes;\n }\n\n while (i--) {\n var node = jqNodes[i];\n if (node.nodeType === NODE_TYPE_COMMENT) {\n splice.call(jqNodes, i, 1);\n }\n }\n return jqNodes;\n}\n\nvar $controllerMinErr = minErr('$controller');\n\n\nvar CNTRL_REG = /^(\\S+)(\\s+as\\s+([\\w$]+))?$/;\nfunction identifierForController(controller, ident) {\n if (ident && isString(ident)) return ident;\n if (isString(controller)) {\n var match = CNTRL_REG.exec(controller);\n if (match) return match[3];\n }\n}\n\n\n/**\n * @ngdoc provider\n * @name $controllerProvider\n * @description\n * The {@link ng.$controller $controller service} is used by Angular to create new\n * controllers.\n *\n * This provider allows controller registration via the\n * {@link ng.$controllerProvider#register register} method.\n */\nfunction $ControllerProvider() {\n var controllers = {},\n globals = false;\n\n /**\n * @ngdoc method\n * @name $controllerProvider#has\n * @param {string} name Controller name to check.\n */\n this.has = function(name) {\n return controllers.hasOwnProperty(name);\n };\n\n /**\n * @ngdoc method\n * @name $controllerProvider#register\n * @param {string|Object} name Controller name, or an object map of controllers where the keys are\n * the names and the values are the constructors.\n * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI\n * annotations in the array notation).\n */\n this.register = function(name, constructor) {\n assertNotHasOwnProperty(name, 'controller');\n if (isObject(name)) {\n extend(controllers, name);\n } else {\n controllers[name] = constructor;\n }\n };\n\n /**\n * @ngdoc method\n * @name $controllerProvider#allowGlobals\n * @description If called, allows `$controller` to find controller constructors on `window`\n */\n this.allowGlobals = function() {\n globals = true;\n };\n\n\n this.$get = ['$injector', '$window', function($injector, $window) {\n\n /**\n * @ngdoc service\n * @name $controller\n * @requires $injector\n *\n * @param {Function|string} constructor If called with a function then it's considered to be the\n * controller constructor function. Otherwise it's considered to be a string which is used\n * to retrieve the controller constructor using the following steps:\n *\n * * check if a controller with given name is registered via `$controllerProvider`\n * * check if evaluating the string on the current scope returns a constructor\n * * if $controllerProvider#allowGlobals, check `window[constructor]` on the global\n * `window` object (not recommended)\n *\n * The string can use the `controller as property` syntax, where the controller instance is published\n * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this\n * to work correctly.\n *\n * @param {Object} locals Injection locals for Controller.\n * @return {Object} Instance of given controller.\n *\n * @description\n * `$controller` service is responsible for instantiating controllers.\n *\n * It's just a simple call to {@link auto.$injector $injector}, but extracted into\n * a service, so that one can override this service with [BC version](https://gist.github.com/1649788).\n */\n return function $controller(expression, locals, later, ident) {\n // PRIVATE API:\n // param `later` --- indicates that the controller's constructor is invoked at a later time.\n // If true, $controller will allocate the object with the correct\n // prototype chain, but will not invoke the controller until a returned\n // callback is invoked.\n // param `ident` --- An optional label which overrides the label parsed from the controller\n // expression, if any.\n var instance, match, constructor, identifier;\n later = later === true;\n if (ident && isString(ident)) {\n identifier = ident;\n }\n\n if (isString(expression)) {\n match = expression.match(CNTRL_REG);\n if (!match) {\n throw $controllerMinErr('ctrlfmt',\n \"Badly formed controller string '{0}'. \" +\n \"Must match `__name__ as __id__` or `__name__`.\", expression);\n }\n constructor = match[1],\n identifier = identifier || match[3];\n expression = controllers.hasOwnProperty(constructor)\n ? controllers[constructor]\n : getter(locals.$scope, constructor, true) ||\n (globals ? getter($window, constructor, true) : undefined);\n\n assertArgFn(expression, constructor, true);\n }\n\n if (later) {\n // Instantiate controller later:\n // This machinery is used to create an instance of the object before calling the\n // controller's constructor itself.\n //\n // This allows properties to be added to the controller before the constructor is\n // invoked. Primarily, this is used for isolate scope bindings in $compile.\n //\n // This feature is not intended for use by applications, and is thus not documented\n // publicly.\n // Object creation: http://jsperf.com/create-constructor/2\n var controllerPrototype = (isArray(expression) ?\n expression[expression.length - 1] : expression).prototype;\n instance = Object.create(controllerPrototype || null);\n\n if (identifier) {\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n\n var instantiate;\n return instantiate = extend(function $controllerInit() {\n var result = $injector.invoke(expression, instance, locals, constructor);\n if (result !== instance && (isObject(result) || isFunction(result))) {\n instance = result;\n if (identifier) {\n // If result changed, re-assign controllerAs value to scope.\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n }\n return instance;\n }, {\n instance: instance,\n identifier: identifier\n });\n }\n\n instance = $injector.instantiate(expression, locals, constructor);\n\n if (identifier) {\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n\n return instance;\n };\n\n function addIdentifier(locals, identifier, instance, name) {\n if (!(locals && isObject(locals.$scope))) {\n throw minErr('$controller')('noscp',\n \"Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.\",\n name, identifier);\n }\n\n locals.$scope[identifier] = instance;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $document\n * @requires $window\n *\n * @description\n * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.\n *\n * @example\n \n \n
        \n

        $document title:

        \n

        window.document title:

        \n
        \n
        \n \n angular.module('documentExample', [])\n .controller('ExampleController', ['$scope', '$document', function($scope, $document) {\n $scope.title = $document[0].title;\n $scope.windowTitle = angular.element(window.document)[0].title;\n }]);\n \n
        \n */\nfunction $DocumentProvider() {\n this.$get = ['$window', function(window) {\n return jqLite(window.document);\n }];\n}\n\n/**\n * @ngdoc service\n * @name $exceptionHandler\n * @requires ng.$log\n *\n * @description\n * Any uncaught exception in angular expressions is delegated to this service.\n * The default implementation simply delegates to `$log.error` which logs it into\n * the browser console.\n *\n * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by\n * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.\n *\n * ## Example:\n *\n * The example below will overwrite the default `$exceptionHandler` in order to (a) log uncaught\n * errors to the backend for later inspection by the developers and (b) to use `$log.warn()` instead\n * of `$log.error()`.\n *\n * ```js\n * angular.\n * module('exceptionOverwrite', []).\n * factory('$exceptionHandler', ['$log', 'logErrorsToBackend', function($log, logErrorsToBackend) {\n * return function myExceptionHandler(exception, cause) {\n * logErrorsToBackend(exception, cause);\n * $log.warn(exception, cause);\n * };\n * }]);\n * ```\n *\n *
        \n * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`\n * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}\n * (unless executed during a digest).\n *\n * If you wish, you can manually delegate exceptions, e.g.\n * `try { ... } catch(e) { $exceptionHandler(e); }`\n *\n * @param {Error} exception Exception associated with the error.\n * @param {string=} cause Optional information about the context in which\n * the error was thrown.\n *\n */\nfunction $ExceptionHandlerProvider() {\n this.$get = ['$log', function($log) {\n return function(exception, cause) {\n $log.error.apply($log, arguments);\n };\n }];\n}\n\nvar $$ForceReflowProvider = function() {\n this.$get = ['$document', function($document) {\n return function(domNode) {\n //the line below will force the browser to perform a repaint so\n //that all the animated elements within the animation frame will\n //be properly updated and drawn on screen. This is required to\n //ensure that the preparation animation is properly flushed so that\n //the active state picks up from there. DO NOT REMOVE THIS LINE.\n //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH\n //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND\n //WILL TAKE YEARS AWAY FROM YOUR LIFE.\n if (domNode) {\n if (!domNode.nodeType && domNode instanceof jqLite) {\n domNode = domNode[0];\n }\n } else {\n domNode = $document[0].body;\n }\n return domNode.offsetWidth + 1;\n };\n }];\n};\n\nvar APPLICATION_JSON = 'application/json';\nvar CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};\nvar JSON_START = /^\\[|^\\{(?!\\{)/;\nvar JSON_ENDS = {\n '[': /]$/,\n '{': /}$/\n};\nvar JSON_PROTECTION_PREFIX = /^\\)\\]\\}',?\\n/;\nvar $httpMinErr = minErr('$http');\nvar $httpMinErrLegacyFn = function(method) {\n return function() {\n throw $httpMinErr('legacy', 'The method `{0}` on the promise returned from `$http` has been disabled.', method);\n };\n};\n\nfunction serializeValue(v) {\n if (isObject(v)) {\n return isDate(v) ? v.toISOString() : toJson(v);\n }\n return v;\n}\n\n\nfunction $HttpParamSerializerProvider() {\n /**\n * @ngdoc service\n * @name $httpParamSerializer\n * @description\n *\n * Default {@link $http `$http`} params serializer that converts objects to strings\n * according to the following rules:\n *\n * * `{'foo': 'bar'}` results in `foo=bar`\n * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object)\n * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element)\n * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D` (stringified and encoded representation of an object)\n *\n * Note that serializer will sort the request parameters alphabetically.\n * */\n\n this.$get = function() {\n return function ngParamSerializer(params) {\n if (!params) return '';\n var parts = [];\n forEachSorted(params, function(value, key) {\n if (value === null || isUndefined(value)) return;\n if (isArray(value)) {\n forEach(value, function(v) {\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v)));\n });\n } else {\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value)));\n }\n });\n\n return parts.join('&');\n };\n };\n}\n\nfunction $HttpParamSerializerJQLikeProvider() {\n /**\n * @ngdoc service\n * @name $httpParamSerializerJQLike\n * @description\n *\n * Alternative {@link $http `$http`} params serializer that follows\n * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic.\n * The serializer will also sort the params alphabetically.\n *\n * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property:\n *\n * ```js\n * $http({\n * url: myUrl,\n * method: 'GET',\n * params: myParams,\n * paramSerializer: '$httpParamSerializerJQLike'\n * });\n * ```\n *\n * It is also possible to set it as the default `paramSerializer` in the\n * {@link $httpProvider#defaults `$httpProvider`}.\n *\n * Additionally, you can inject the serializer and use it explicitly, for example to serialize\n * form data for submission:\n *\n * ```js\n * .controller(function($http, $httpParamSerializerJQLike) {\n * //...\n *\n * $http({\n * url: myUrl,\n * method: 'POST',\n * data: $httpParamSerializerJQLike(myData),\n * headers: {\n * 'Content-Type': 'application/x-www-form-urlencoded'\n * }\n * });\n *\n * });\n * ```\n *\n * */\n this.$get = function() {\n return function jQueryLikeParamSerializer(params) {\n if (!params) return '';\n var parts = [];\n serialize(params, '', true);\n return parts.join('&');\n\n function serialize(toSerialize, prefix, topLevel) {\n if (toSerialize === null || isUndefined(toSerialize)) return;\n if (isArray(toSerialize)) {\n forEach(toSerialize, function(value, index) {\n serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']');\n });\n } else if (isObject(toSerialize) && !isDate(toSerialize)) {\n forEachSorted(toSerialize, function(value, key) {\n serialize(value, prefix +\n (topLevel ? '' : '[') +\n key +\n (topLevel ? '' : ']'));\n });\n } else {\n parts.push(encodeUriQuery(prefix) + '=' + encodeUriQuery(serializeValue(toSerialize)));\n }\n }\n };\n };\n}\n\nfunction defaultHttpResponseTransform(data, headers) {\n if (isString(data)) {\n // Strip json vulnerability protection prefix and trim whitespace\n var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();\n\n if (tempData) {\n var contentType = headers('Content-Type');\n if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {\n data = fromJson(tempData);\n }\n }\n }\n\n return data;\n}\n\nfunction isJsonLike(str) {\n var jsonStart = str.match(JSON_START);\n return jsonStart && JSON_ENDS[jsonStart[0]].test(str);\n}\n\n/**\n * Parse headers into key value object\n *\n * @param {string} headers Raw headers as a string\n * @returns {Object} Parsed headers as key value object\n */\nfunction parseHeaders(headers) {\n var parsed = createMap(), i;\n\n function fillInParsed(key, val) {\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n\n if (isString(headers)) {\n forEach(headers.split('\\n'), function(line) {\n i = line.indexOf(':');\n fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1)));\n });\n } else if (isObject(headers)) {\n forEach(headers, function(headerVal, headerKey) {\n fillInParsed(lowercase(headerKey), trim(headerVal));\n });\n }\n\n return parsed;\n}\n\n\n/**\n * Returns a function that provides access to parsed headers.\n *\n * Headers are lazy parsed when first requested.\n * @see parseHeaders\n *\n * @param {(string|Object)} headers Headers to provide access to.\n * @returns {function(string=)} Returns a getter function which if called with:\n *\n * - if called with single an argument returns a single header value or null\n * - if called with no arguments returns an object containing all headers.\n */\nfunction headersGetter(headers) {\n var headersObj;\n\n return function(name) {\n if (!headersObj) headersObj = parseHeaders(headers);\n\n if (name) {\n var value = headersObj[lowercase(name)];\n if (value === void 0) {\n value = null;\n }\n return value;\n }\n\n return headersObj;\n };\n}\n\n\n/**\n * Chain all given functions\n *\n * This function is used for both request and response transforming\n *\n * @param {*} data Data to transform.\n * @param {function(string=)} headers HTTP headers getter fn.\n * @param {number} status HTTP status code of the response.\n * @param {(Function|Array.)} fns Function or an array of functions.\n * @returns {*} Transformed data.\n */\nfunction transformData(data, headers, status, fns) {\n if (isFunction(fns)) {\n return fns(data, headers, status);\n }\n\n forEach(fns, function(fn) {\n data = fn(data, headers, status);\n });\n\n return data;\n}\n\n\nfunction isSuccess(status) {\n return 200 <= status && status < 300;\n}\n\n\n/**\n * @ngdoc provider\n * @name $httpProvider\n * @description\n * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.\n * */\nfunction $HttpProvider() {\n /**\n * @ngdoc property\n * @name $httpProvider#defaults\n * @description\n *\n * Object containing default values for all {@link ng.$http $http} requests.\n *\n * - **`defaults.cache`** - {boolean|Object} - A boolean value or object created with\n * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses\n * by default. See {@link $http#caching $http Caching} for more information.\n *\n * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.\n * Defaults value is `'XSRF-TOKEN'`.\n *\n * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the\n * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.\n *\n * - **`defaults.headers`** - {Object} - Default headers for all $http requests.\n * Refer to {@link ng.$http#setting-http-headers $http} for documentation on\n * setting default headers.\n * - **`defaults.headers.common`**\n * - **`defaults.headers.post`**\n * - **`defaults.headers.put`**\n * - **`defaults.headers.patch`**\n *\n *\n * - **`defaults.paramSerializer`** - `{string|function(Object):string}` - A function\n * used to the prepare string representation of request parameters (specified as an object).\n * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}.\n * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}.\n *\n **/\n var defaults = this.defaults = {\n // transform incoming response data\n transformResponse: [defaultHttpResponseTransform],\n\n // transform outgoing request data\n transformRequest: [function(d) {\n return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;\n }],\n\n // default headers\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n },\n post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON)\n },\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n paramSerializer: '$httpParamSerializer'\n };\n\n var useApplyAsync = false;\n /**\n * @ngdoc method\n * @name $httpProvider#useApplyAsync\n * @description\n *\n * Configure $http service to combine processing of multiple http responses received at around\n * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in\n * significant performance improvement for bigger applications that make many HTTP requests\n * concurrently (common during application bootstrap).\n *\n * Defaults to false. If no value is specified, returns the current configured value.\n *\n * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred\n * \"apply\" on the next tick, giving time for subsequent requests in a roughly ~10ms window\n * to load and share the same digest cycle.\n *\n * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.\n * otherwise, returns the current configured value.\n **/\n this.useApplyAsync = function(value) {\n if (isDefined(value)) {\n useApplyAsync = !!value;\n return this;\n }\n return useApplyAsync;\n };\n\n var useLegacyPromise = true;\n /**\n * @ngdoc method\n * @name $httpProvider#useLegacyPromiseExtensions\n * @description\n *\n * Configure `$http` service to return promises without the shorthand methods `success` and `error`.\n * This should be used to make sure that applications work without these methods.\n *\n * Defaults to true. If no value is specified, returns the current configured value.\n *\n * @param {boolean=} value If true, `$http` will return a promise with the deprecated legacy `success` and `error` methods.\n *\n * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.\n * otherwise, returns the current configured value.\n **/\n this.useLegacyPromiseExtensions = function(value) {\n if (isDefined(value)) {\n useLegacyPromise = !!value;\n return this;\n }\n return useLegacyPromise;\n };\n\n /**\n * @ngdoc property\n * @name $httpProvider#interceptors\n * @description\n *\n * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}\n * pre-processing of request or postprocessing of responses.\n *\n * These service factories are ordered by request, i.e. they are applied in the same order as the\n * array, on request, but reverse order, on response.\n *\n * {@link ng.$http#interceptors Interceptors detailed info}\n **/\n var interceptorFactories = this.interceptors = [];\n\n this.$get = ['$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector',\n function($httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector) {\n\n var defaultCache = $cacheFactory('$http');\n\n /**\n * Make sure that default param serializer is exposed as a function\n */\n defaults.paramSerializer = isString(defaults.paramSerializer) ?\n $injector.get(defaults.paramSerializer) : defaults.paramSerializer;\n\n /**\n * Interceptors stored in reverse order. Inner interceptors before outer interceptors.\n * The reversal is needed so that we can build up the interception chain around the\n * server request.\n */\n var reversedInterceptors = [];\n\n forEach(interceptorFactories, function(interceptorFactory) {\n reversedInterceptors.unshift(isString(interceptorFactory)\n ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));\n });\n\n /**\n * @ngdoc service\n * @kind function\n * @name $http\n * @requires ng.$httpBackend\n * @requires $cacheFactory\n * @requires $rootScope\n * @requires $q\n * @requires $injector\n *\n * @description\n * The `$http` service is a core Angular service that facilitates communication with the remote\n * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)\n * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).\n *\n * For unit testing applications that use `$http` service, see\n * {@link ngMock.$httpBackend $httpBackend mock}.\n *\n * For a higher level of abstraction, please check out the {@link ngResource.$resource\n * $resource} service.\n *\n * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by\n * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage\n * it is important to familiarize yourself with these APIs and the guarantees they provide.\n *\n *\n * ## General usage\n * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} —\n * that is used to generate an HTTP request and returns a {@link ng.$q promise}.\n *\n * ```js\n * // Simple GET request example:\n * $http({\n * method: 'GET',\n * url: '/someUrl'\n * }).then(function successCallback(response) {\n * // this callback will be called asynchronously\n * // when the response is available\n * }, function errorCallback(response) {\n * // called asynchronously if an error occurs\n * // or server returns response with an error status.\n * });\n * ```\n *\n * The response object has these properties:\n *\n * - **data** – `{string|Object}` – The response body transformed with the transform\n * functions.\n * - **status** – `{number}` – HTTP status code of the response.\n * - **headers** – `{function([headerName])}` – Header getter function.\n * - **config** – `{Object}` – The configuration object that was used to generate the request.\n * - **statusText** – `{string}` – HTTP status text of the response.\n *\n * A response status code between 200 and 299 is considered a success status and will result in\n * the success callback being called. Any response status code outside of that range is\n * considered an error status and will result in the error callback being called.\n * Also, status codes less than -1 are normalized to zero. -1 usually means the request was\n * aborted, e.g. using a `config.timeout`.\n * Note that if the response is a redirect, XMLHttpRequest will transparently follow it, meaning\n * that the outcome (success or error) will be determined by the final response status code.\n *\n *\n * ## Shortcut methods\n *\n * Shortcut methods are also available. All shortcut methods require passing in the URL, and\n * request data must be passed in for POST/PUT requests. An optional config can be passed as the\n * last argument.\n *\n * ```js\n * $http.get('/someUrl', config).then(successCallback, errorCallback);\n * $http.post('/someUrl', data, config).then(successCallback, errorCallback);\n * ```\n *\n * Complete list of shortcut methods:\n *\n * - {@link ng.$http#get $http.get}\n * - {@link ng.$http#head $http.head}\n * - {@link ng.$http#post $http.post}\n * - {@link ng.$http#put $http.put}\n * - {@link ng.$http#delete $http.delete}\n * - {@link ng.$http#jsonp $http.jsonp}\n * - {@link ng.$http#patch $http.patch}\n *\n *\n * ## Writing Unit Tests that use $http\n * When unit testing (using {@link ngMock ngMock}), it is necessary to call\n * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending\n * request using trained responses.\n *\n * ```\n * $httpBackend.expectGET(...);\n * $http.get(...);\n * $httpBackend.flush();\n * ```\n *\n * ## Deprecation Notice\n *
        \n * The `$http` legacy promise methods `success` and `error` have been deprecated.\n * Use the standard `then` method instead.\n * If {@link $httpProvider#useLegacyPromiseExtensions `$httpProvider.useLegacyPromiseExtensions`} is set to\n * `false` then these methods will throw {@link $http:legacy `$http/legacy`} error.\n *
        \n *\n * ## Setting HTTP Headers\n *\n * The $http service will automatically add certain HTTP headers to all requests. These defaults\n * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration\n * object, which currently contains this default configuration:\n *\n * - `$httpProvider.defaults.headers.common` (headers that are common for all requests):\n * - `Accept: application/json, text/plain, * / *`\n * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)\n * - `Content-Type: application/json`\n * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)\n * - `Content-Type: application/json`\n *\n * To add or overwrite these defaults, simply add or remove a property from these configuration\n * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object\n * with the lowercased HTTP method name as the key, e.g.\n * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`.\n *\n * The defaults can also be set at runtime via the `$http.defaults` object in the same\n * fashion. For example:\n *\n * ```\n * module.run(function($http) {\n * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w';\n * });\n * ```\n *\n * In addition, you can supply a `headers` property in the config object passed when\n * calling `$http(config)`, which overrides the defaults without changing them globally.\n *\n * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis,\n * Use the `headers` property, setting the desired header to `undefined`. For example:\n *\n * ```js\n * var req = {\n * method: 'POST',\n * url: 'http://example.com',\n * headers: {\n * 'Content-Type': undefined\n * },\n * data: { test: 'test' }\n * }\n *\n * $http(req).then(function(){...}, function(){...});\n * ```\n *\n * ## Transforming Requests and Responses\n *\n * Both requests and responses can be transformed using transformation functions: `transformRequest`\n * and `transformResponse`. These properties can be a single function that returns\n * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions,\n * which allows you to `push` or `unshift` a new transformation function into the transformation chain.\n *\n *
        \n * **Note:** Angular does not make a copy of the `data` parameter before it is passed into the `transformRequest` pipeline.\n * That means changes to the properties of `data` are not local to the transform function (since Javascript passes objects by reference).\n * For example, when calling `$http.get(url, $scope.myObject)`, modifications to the object's properties in a transformRequest\n * function will be reflected on the scope and in any templates where the object is data-bound.\n * To prevent this, transform functions should have no side-effects.\n * If you need to modify properties, it is recommended to make a copy of the data, or create new object to return.\n *
        \n *\n * ### Default Transformations\n *\n * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and\n * `defaults.transformResponse` properties. If a request does not provide its own transformations\n * then these will be applied.\n *\n * You can augment or replace the default transformations by modifying these properties by adding to or\n * replacing the array.\n *\n * Angular provides the following default transformations:\n *\n * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`):\n *\n * - If the `data` property of the request configuration object contains an object, serialize it\n * into JSON format.\n *\n * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`):\n *\n * - If XSRF prefix is detected, strip it (see Security Considerations section below).\n * - If JSON response is detected, deserialize it using a JSON parser.\n *\n *\n * ### Overriding the Default Transformations Per Request\n *\n * If you wish to override the request/response transformations only for a single request then provide\n * `transformRequest` and/or `transformResponse` properties on the configuration object passed\n * into `$http`.\n *\n * Note that if you provide these properties on the config object the default transformations will be\n * overwritten. If you wish to augment the default transformations then you must include them in your\n * local transformation array.\n *\n * The following code demonstrates adding a new response transformation to be run after the default response\n * transformations have been run.\n *\n * ```js\n * function appendTransform(defaults, transform) {\n *\n * // We can't guarantee that the default transformation is an array\n * defaults = angular.isArray(defaults) ? defaults : [defaults];\n *\n * // Append the new transformation to the defaults\n * return defaults.concat(transform);\n * }\n *\n * $http({\n * url: '...',\n * method: 'GET',\n * transformResponse: appendTransform($http.defaults.transformResponse, function(value) {\n * return doTransform(value);\n * })\n * });\n * ```\n *\n *\n * ## Caching\n *\n * {@link ng.$http `$http`} responses are not cached by default. To enable caching, you must\n * set the config.cache value or the default cache value to TRUE or to a cache object (created\n * with {@link ng.$cacheFactory `$cacheFactory`}). If defined, the value of config.cache takes\n * precedence over the default cache value.\n *\n * In order to:\n * * cache all responses - set the default cache value to TRUE or to a cache object\n * * cache a specific response - set config.cache value to TRUE or to a cache object\n *\n * If caching is enabled, but neither the default cache nor config.cache are set to a cache object,\n * then the default `$cacheFactory(\"$http\")` object is used.\n *\n * The default cache value can be set by updating the\n * {@link ng.$http#defaults `$http.defaults.cache`} property or the\n * {@link $httpProvider#defaults `$httpProvider.defaults.cache`} property.\n *\n * When caching is enabled, {@link ng.$http `$http`} stores the response from the server using\n * the relevant cache object. The next time the same request is made, the response is returned\n * from the cache without sending a request to the server.\n *\n * Take note that:\n *\n * * Only GET and JSONP requests are cached.\n * * The cache key is the request URL including search parameters; headers are not considered.\n * * Cached responses are returned asynchronously, in the same way as responses from the server.\n * * If multiple identical requests are made using the same cache, which is not yet populated,\n * one request will be made to the server and remaining requests will return the same response.\n * * A cache-control header on the response does not affect if or how responses are cached.\n *\n *\n * ## Interceptors\n *\n * Before you start creating interceptors, be sure to understand the\n * {@link ng.$q $q and deferred/promise APIs}.\n *\n * For purposes of global error handling, authentication, or any kind of synchronous or\n * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be\n * able to intercept requests before they are handed to the server and\n * responses before they are handed over to the application code that\n * initiated these requests. The interceptors leverage the {@link ng.$q\n * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.\n *\n * The interceptors are service factories that are registered with the `$httpProvider` by\n * adding them to the `$httpProvider.interceptors` array. The factory is called and\n * injected with dependencies (if specified) and returns the interceptor.\n *\n * There are two kinds of interceptors (and two kinds of rejection interceptors):\n *\n * * `request`: interceptors get called with a http {@link $http#usage config} object. The function is free to\n * modify the `config` object or create a new one. The function needs to return the `config`\n * object directly, or a promise containing the `config` or a new `config` object.\n * * `requestError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n * * `response`: interceptors get called with http `response` object. The function is free to\n * modify the `response` object or create a new one. The function needs to return the `response`\n * object directly, or as a promise containing the `response` or a new `response` object.\n * * `responseError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n *\n *\n * ```js\n * // register the interceptor as a service\n * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {\n * return {\n * // optional method\n * 'request': function(config) {\n * // do something on success\n * return config;\n * },\n *\n * // optional method\n * 'requestError': function(rejection) {\n * // do something on error\n * if (canRecover(rejection)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(rejection);\n * },\n *\n *\n *\n * // optional method\n * 'response': function(response) {\n * // do something on success\n * return response;\n * },\n *\n * // optional method\n * 'responseError': function(rejection) {\n * // do something on error\n * if (canRecover(rejection)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(rejection);\n * }\n * };\n * });\n *\n * $httpProvider.interceptors.push('myHttpInterceptor');\n *\n *\n * // alternatively, register the interceptor via an anonymous factory\n * $httpProvider.interceptors.push(function($q, dependency1, dependency2) {\n * return {\n * 'request': function(config) {\n * // same as above\n * },\n *\n * 'response': function(response) {\n * // same as above\n * }\n * };\n * });\n * ```\n *\n * ## Security Considerations\n *\n * When designing web applications, consider security threats from:\n *\n * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)\n *\n * Both server and the client must cooperate in order to eliminate these threats. Angular comes\n * pre-configured with strategies that address these issues, but for this to work backend server\n * cooperation is required.\n *\n * ### JSON Vulnerability Protection\n *\n * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n * allows third party website to turn your JSON resource URL into\n * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To\n * counter this your server can prefix all JSON requests with following string `\")]}',\\n\"`.\n * Angular will automatically strip the prefix before processing it as JSON.\n *\n * For example if your server needs to return:\n * ```js\n * ['one','two']\n * ```\n *\n * which is vulnerable to attack, your server can return:\n * ```js\n * )]}',\n * ['one','two']\n * ```\n *\n * Angular will strip the prefix, before processing the JSON.\n *\n *\n * ### Cross Site Request Forgery (XSRF) Protection\n *\n * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is an attack technique by\n * which the attacker can trick an authenticated user into unknowingly executing actions on your\n * website. Angular provides a mechanism to counter XSRF. When performing XHR requests, the\n * $http service reads a token from a cookie (by default, `XSRF-TOKEN`) and sets it as an HTTP\n * header (`X-XSRF-TOKEN`). Since only JavaScript that runs on your domain could read the\n * cookie, your server can be assured that the XHR came from JavaScript running on your domain.\n * The header will not be set for cross-domain requests.\n *\n * To take advantage of this, your server needs to set a token in a JavaScript readable session\n * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the\n * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure\n * that only JavaScript running on your domain could have sent the request. The token must be\n * unique for each user and must be verifiable by the server (to prevent the JavaScript from\n * making up its own tokens). We recommend that the token is a digest of your site's\n * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography))\n * for added security.\n *\n * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName\n * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,\n * or the per-request config object.\n *\n * In order to prevent collisions in environments where multiple Angular apps share the\n * same domain or subdomain, we recommend that each application uses unique cookie name.\n *\n * @param {object} config Object describing the request to be made and how it should be\n * processed. The object has following properties:\n *\n * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)\n * - **url** – `{string}` – Absolute or relative URL of the resource that is being requested.\n * - **params** – `{Object.}` – Map of strings or objects which will be serialized\n * with the `paramSerializer` and appended as GET parameters.\n * - **data** – `{string|Object}` – Data to be sent as the request message data.\n * - **headers** – `{Object}` – Map of strings or functions which return strings representing\n * HTTP headers to send to the server. If the return value of a function is null, the\n * header will not be sent. Functions accept a config object as an argument.\n * - **eventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest object.\n * To bind events to the XMLHttpRequest upload object, use `uploadEventHandlers`.\n * The handler will be called in the context of a `$apply` block.\n * - **uploadEventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest upload\n * object. To bind events to the XMLHttpRequest object, use `eventHandlers`.\n * The handler will be called in the context of a `$apply` block.\n * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.\n * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token.\n * - **transformRequest** –\n * `{function(data, headersGetter)|Array.}` –\n * transform function or an array of such functions. The transform function takes the http\n * request body and headers and returns its transformed (typically serialized) version.\n * See {@link ng.$http#overriding-the-default-transformations-per-request\n * Overriding the Default Transformations}\n * - **transformResponse** –\n * `{function(data, headersGetter, status)|Array.}` –\n * transform function or an array of such functions. The transform function takes the http\n * response body, headers and status and returns its transformed (typically deserialized) version.\n * See {@link ng.$http#overriding-the-default-transformations-per-request\n * Overriding the Default Transformations}\n * - **paramSerializer** - `{string|function(Object):string}` - A function used to\n * prepare the string representation of request parameters (specified as an object).\n * If specified as string, it is interpreted as function registered with the\n * {@link $injector $injector}, which means you can create your own serializer\n * by registering it as a {@link auto.$provide#service service}.\n * The default serializer is the {@link $httpParamSerializer $httpParamSerializer};\n * alternatively, you can use the {@link $httpParamSerializerJQLike $httpParamSerializerJQLike}\n * - **cache** – `{boolean|Object}` – A boolean value or object created with\n * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of the HTTP response.\n * See {@link $http#caching $http Caching} for more information.\n * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}\n * that should abort the request when resolved.\n * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the\n * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials)\n * for more information.\n * - **responseType** - `{string}` - see\n * [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype).\n *\n * @returns {HttpPromise} Returns a {@link ng.$q `Promise}` that will be resolved to a response object\n * when the request succeeds or fails.\n *\n *\n * @property {Array.} pendingRequests Array of config objects for currently pending\n * requests. This is primarily meant to be used for debugging purposes.\n *\n *\n * @example\n\n\n
        \n \n \n
        \n \n \n \n
        http status code: {{status}}
        \n
        http response data: {{data}}
        \n
        \n
        \n\n angular.module('httpExample', [])\n .controller('FetchController', ['$scope', '$http', '$templateCache',\n function($scope, $http, $templateCache) {\n $scope.method = 'GET';\n $scope.url = 'http-hello.html';\n\n $scope.fetch = function() {\n $scope.code = null;\n $scope.response = null;\n\n $http({method: $scope.method, url: $scope.url, cache: $templateCache}).\n then(function(response) {\n $scope.status = response.status;\n $scope.data = response.data;\n }, function(response) {\n $scope.data = response.data || \"Request failed\";\n $scope.status = response.status;\n });\n };\n\n $scope.updateModel = function(method, url) {\n $scope.method = method;\n $scope.url = url;\n };\n }]);\n\n\n Hello, $http!\n\n\n var status = element(by.binding('status'));\n var data = element(by.binding('data'));\n var fetchBtn = element(by.id('fetchbtn'));\n var sampleGetBtn = element(by.id('samplegetbtn'));\n var sampleJsonpBtn = element(by.id('samplejsonpbtn'));\n var invalidJsonpBtn = element(by.id('invalidjsonpbtn'));\n\n it('should make an xhr GET request', function() {\n sampleGetBtn.click();\n fetchBtn.click();\n expect(status.getText()).toMatch('200');\n expect(data.getText()).toMatch(/Hello, \\$http!/);\n });\n\n// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185\n// it('should make a JSONP request to angularjs.org', function() {\n// sampleJsonpBtn.click();\n// fetchBtn.click();\n// expect(status.getText()).toMatch('200');\n// expect(data.getText()).toMatch(/Super Hero!/);\n// });\n\n it('should make JSONP request to invalid URL and invoke the error handler',\n function() {\n invalidJsonpBtn.click();\n fetchBtn.click();\n expect(status.getText()).toMatch('0');\n expect(data.getText()).toMatch('Request failed');\n });\n\n
        \n */\n function $http(requestConfig) {\n\n if (!isObject(requestConfig)) {\n throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig);\n }\n\n if (!isString(requestConfig.url)) {\n throw minErr('$http')('badreq', 'Http request configuration url must be a string. Received: {0}', requestConfig.url);\n }\n\n var config = extend({\n method: 'get',\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse,\n paramSerializer: defaults.paramSerializer\n }, requestConfig);\n\n config.headers = mergeHeaders(requestConfig);\n config.method = uppercase(config.method);\n config.paramSerializer = isString(config.paramSerializer) ?\n $injector.get(config.paramSerializer) : config.paramSerializer;\n\n var requestInterceptors = [];\n var responseInterceptors = [];\n var promise = $q.when(config);\n\n // apply interceptors\n forEach(reversedInterceptors, function(interceptor) {\n if (interceptor.request || interceptor.requestError) {\n requestInterceptors.unshift(interceptor.request, interceptor.requestError);\n }\n if (interceptor.response || interceptor.responseError) {\n responseInterceptors.push(interceptor.response, interceptor.responseError);\n }\n });\n\n promise = chainInterceptors(promise, requestInterceptors);\n promise = promise.then(serverRequest);\n promise = chainInterceptors(promise, responseInterceptors);\n\n if (useLegacyPromise) {\n promise.success = function(fn) {\n assertArgFn(fn, 'fn');\n\n promise.then(function(response) {\n fn(response.data, response.status, response.headers, config);\n });\n return promise;\n };\n\n promise.error = function(fn) {\n assertArgFn(fn, 'fn');\n\n promise.then(null, function(response) {\n fn(response.data, response.status, response.headers, config);\n });\n return promise;\n };\n } else {\n promise.success = $httpMinErrLegacyFn('success');\n promise.error = $httpMinErrLegacyFn('error');\n }\n\n return promise;\n\n\n function chainInterceptors(promise, interceptors) {\n for (var i = 0, ii = interceptors.length; i < ii;) {\n var thenFn = interceptors[i++];\n var rejectFn = interceptors[i++];\n\n promise = promise.then(thenFn, rejectFn);\n }\n\n interceptors.length = 0;\n\n return promise;\n }\n\n function executeHeaderFns(headers, config) {\n var headerContent, processedHeaders = {};\n\n forEach(headers, function(headerFn, header) {\n if (isFunction(headerFn)) {\n headerContent = headerFn(config);\n if (headerContent != null) {\n processedHeaders[header] = headerContent;\n }\n } else {\n processedHeaders[header] = headerFn;\n }\n });\n\n return processedHeaders;\n }\n\n function mergeHeaders(config) {\n var defHeaders = defaults.headers,\n reqHeaders = extend({}, config.headers),\n defHeaderName, lowercaseDefHeaderName, reqHeaderName;\n\n defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);\n\n // using for-in instead of forEach to avoid unnecessary iteration after header has been found\n defaultHeadersIteration:\n for (defHeaderName in defHeaders) {\n lowercaseDefHeaderName = lowercase(defHeaderName);\n\n for (reqHeaderName in reqHeaders) {\n if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {\n continue defaultHeadersIteration;\n }\n }\n\n reqHeaders[defHeaderName] = defHeaders[defHeaderName];\n }\n\n // execute if header value is a function for merged headers\n return executeHeaderFns(reqHeaders, shallowCopy(config));\n }\n\n function serverRequest(config) {\n var headers = config.headers;\n var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);\n\n // strip content-type if data is undefined\n if (isUndefined(reqData)) {\n forEach(headers, function(value, header) {\n if (lowercase(header) === 'content-type') {\n delete headers[header];\n }\n });\n }\n\n if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {\n config.withCredentials = defaults.withCredentials;\n }\n\n // send request\n return sendReq(config, reqData).then(transformResponse, transformResponse);\n }\n\n function transformResponse(response) {\n // make a copy since the response must be cacheable\n var resp = extend({}, response);\n resp.data = transformData(response.data, response.headers, response.status,\n config.transformResponse);\n return (isSuccess(response.status))\n ? resp\n : $q.reject(resp);\n }\n }\n\n $http.pendingRequests = [];\n\n /**\n * @ngdoc method\n * @name $http#get\n *\n * @description\n * Shortcut method to perform `GET` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#delete\n *\n * @description\n * Shortcut method to perform `DELETE` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#head\n *\n * @description\n * Shortcut method to perform `HEAD` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#jsonp\n *\n * @description\n * Shortcut method to perform `JSONP` request.\n * If you would like to customise where and how the callbacks are stored then try overriding\n * or decorating the {@link $jsonpCallbacks} service.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request.\n * The name of the callback should be the string `JSON_CALLBACK`.\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n createShortMethods('get', 'delete', 'head', 'jsonp');\n\n /**\n * @ngdoc method\n * @name $http#post\n *\n * @description\n * Shortcut method to perform `POST` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#put\n *\n * @description\n * Shortcut method to perform `PUT` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n\n /**\n * @ngdoc method\n * @name $http#patch\n *\n * @description\n * Shortcut method to perform `PATCH` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object\n * @returns {HttpPromise} Future object\n */\n createShortMethodsWithData('post', 'put', 'patch');\n\n /**\n * @ngdoc property\n * @name $http#defaults\n *\n * @description\n * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of\n * default headers, withCredentials as well as request and response transformations.\n *\n * See \"Setting HTTP Headers\" and \"Transforming Requests and Responses\" sections above.\n */\n $http.defaults = defaults;\n\n\n return $http;\n\n\n function createShortMethods(names) {\n forEach(arguments, function(name) {\n $http[name] = function(url, config) {\n return $http(extend({}, config || {}, {\n method: name,\n url: url\n }));\n };\n });\n }\n\n\n function createShortMethodsWithData(name) {\n forEach(arguments, function(name) {\n $http[name] = function(url, data, config) {\n return $http(extend({}, config || {}, {\n method: name,\n url: url,\n data: data\n }));\n };\n });\n }\n\n\n /**\n * Makes the request.\n *\n * !!! ACCESSES CLOSURE VARS:\n * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests\n */\n function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n url = buildUrl(config.url, config.paramSerializer(config.params));\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(defaults.cache) ? defaults.cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsSameOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }\n\n\n function buildUrl(url, serializedParams) {\n if (serializedParams.length > 0) {\n url += ((url.indexOf('?') == -1) ? '?' : '&') + serializedParams;\n }\n return url;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $xhrFactory\n *\n * @description\n * Factory function used to create XMLHttpRequest objects.\n *\n * Replace or decorate this service to create your own custom XMLHttpRequest objects.\n *\n * ```\n * angular.module('myApp', [])\n * .factory('$xhrFactory', function() {\n * return function createXhr(method, url) {\n * return new window.XMLHttpRequest({mozSystem: true});\n * };\n * });\n * ```\n *\n * @param {string} method HTTP method of the request (GET, POST, PUT, ..)\n * @param {string} url URL of the request.\n */\nfunction $xhrFactoryProvider() {\n this.$get = function() {\n return function createXhr() {\n return new window.XMLHttpRequest();\n };\n };\n}\n\n/**\n * @ngdoc service\n * @name $httpBackend\n * @requires $jsonpCallbacks\n * @requires $document\n * @requires $xhrFactory\n *\n * @description\n * HTTP backend used by the {@link ng.$http service} that delegates to\n * XMLHttpRequest object or JSONP and deals with browser incompatibilities.\n *\n * You should never need to use this service directly, instead use the higher-level abstractions:\n * {@link ng.$http $http} or {@link ngResource.$resource $resource}.\n *\n * During testing this implementation is swapped with {@link ngMock.$httpBackend mock\n * $httpBackend} which can be trained with responses.\n */\nfunction $HttpBackendProvider() {\n this.$get = ['$browser', '$jsonpCallbacks', '$document', '$xhrFactory', function($browser, $jsonpCallbacks, $document, $xhrFactory) {\n return createHttpBackend($browser, $xhrFactory, $browser.defer, $jsonpCallbacks, $document[0]);\n }];\n}\n\nfunction createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {\n // TODO(vojta): fix the signature\n return function(method, url, post, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {\n $browser.$$incOutstandingRequestCount();\n url = url || $browser.url();\n\n if (lowercase(method) === 'jsonp') {\n var callbackPath = callbacks.createCallback(url);\n var jsonpDone = jsonpReq(url, callbackPath, function(status, text) {\n // jsonpReq only ever sets status to 200 (OK), 404 (ERROR) or -1 (WAITING)\n var response = (status === 200) && callbacks.getResponse(callbackPath);\n completeRequest(callback, status, response, \"\", text);\n callbacks.removeCallback(callbackPath);\n });\n } else {\n\n var xhr = createXhr(method, url);\n\n xhr.open(method, url, true);\n forEach(headers, function(value, key) {\n if (isDefined(value)) {\n xhr.setRequestHeader(key, value);\n }\n });\n\n xhr.onload = function requestLoaded() {\n var statusText = xhr.statusText || '';\n\n // responseText is the old-school way of retrieving response (supported by IE9)\n // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n var response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n var status = xhr.status === 1223 ? 204 : xhr.status;\n\n // fix status code when it is 0 (0 status is undocumented).\n // Occurs when accessing file resources or on Android 4.1 stock browser\n // while retrieving files from application cache.\n if (status === 0) {\n status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0;\n }\n\n completeRequest(callback,\n status,\n response,\n xhr.getAllResponseHeaders(),\n statusText);\n };\n\n var requestError = function() {\n // The response is always empty\n // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error\n completeRequest(callback, -1, null, null, '');\n };\n\n xhr.onerror = requestError;\n xhr.onabort = requestError;\n\n forEach(eventHandlers, function(value, key) {\n xhr.addEventListener(key, value);\n });\n\n forEach(uploadEventHandlers, function(value, key) {\n xhr.upload.addEventListener(key, value);\n });\n\n if (withCredentials) {\n xhr.withCredentials = true;\n }\n\n if (responseType) {\n try {\n xhr.responseType = responseType;\n } catch (e) {\n // WebKit added support for the json responseType value on 09/03/2013\n // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are\n // known to throw when setting the value \"json\" as the response type. Other older\n // browsers implementing the responseType\n //\n // The json response type can be ignored if not supported, because JSON payloads are\n // parsed on the client-side regardless.\n if (responseType !== 'json') {\n throw e;\n }\n }\n }\n\n xhr.send(isUndefined(post) ? null : post);\n }\n\n if (timeout > 0) {\n var timeoutId = $browserDefer(timeoutRequest, timeout);\n } else if (isPromiseLike(timeout)) {\n timeout.then(timeoutRequest);\n }\n\n\n function timeoutRequest() {\n jsonpDone && jsonpDone();\n xhr && xhr.abort();\n }\n\n function completeRequest(callback, status, response, headersString, statusText) {\n // cancel timeout and subsequent timeout promise resolution\n if (isDefined(timeoutId)) {\n $browserDefer.cancel(timeoutId);\n }\n jsonpDone = xhr = null;\n\n callback(status, response, headersString, statusText);\n $browser.$$completeOutstandingRequest(noop);\n }\n };\n\n function jsonpReq(url, callbackPath, done) {\n url = url.replace('JSON_CALLBACK', callbackPath);\n // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.:\n // - fetches local scripts via XHR and evals them\n // - adds and immediately removes script elements from the document\n var script = rawDocument.createElement('script'), callback = null;\n script.type = \"text/javascript\";\n script.src = url;\n script.async = true;\n\n callback = function(event) {\n removeEventListenerFn(script, \"load\", callback);\n removeEventListenerFn(script, \"error\", callback);\n rawDocument.body.removeChild(script);\n script = null;\n var status = -1;\n var text = \"unknown\";\n\n if (event) {\n if (event.type === \"load\" && !callbacks.wasCalled(callbackPath)) {\n event = { type: \"error\" };\n }\n text = event.type;\n status = event.type === \"error\" ? 404 : 200;\n }\n\n if (done) {\n done(status, text);\n }\n };\n\n addEventListenerFn(script, \"load\", callback);\n addEventListenerFn(script, \"error\", callback);\n rawDocument.body.appendChild(script);\n return callback;\n }\n}\n\nvar $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate');\n$interpolateMinErr.throwNoconcat = function(text) {\n throw $interpolateMinErr('noconcat',\n \"Error while interpolating: {0}\\nStrict Contextual Escaping disallows \" +\n \"interpolations that concatenate multiple expressions when a trusted value is \" +\n \"required. See http://docs.angularjs.org/api/ng.$sce\", text);\n};\n\n$interpolateMinErr.interr = function(text, err) {\n return $interpolateMinErr('interr', \"Can't interpolate: {0}\\n{1}\", text, err.toString());\n};\n\n/**\n * @ngdoc provider\n * @name $interpolateProvider\n *\n * @description\n *\n * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.\n *\n *
        \n * This feature is sometimes used to mix different markup languages, e.g. to wrap an Angular\n * template within a Python Jinja template (or any other template language). Mixing templating\n * languages is **very dangerous**. The embedding template language will not safely escape Angular\n * expressions, so any user-controlled values in the template will cause Cross Site Scripting (XSS)\n * security bugs!\n *
        \n *\n * @example\n\n\n\n
        \n //demo.label//\n
        \n
        \n\n it('should interpolate binding with custom symbols', function() {\n expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.');\n });\n\n
        \n */\nfunction $InterpolateProvider() {\n var startSymbol = '{{';\n var endSymbol = '}}';\n\n /**\n * @ngdoc method\n * @name $interpolateProvider#startSymbol\n * @description\n * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.\n *\n * @param {string=} value new value to set the starting symbol to.\n * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n */\n this.startSymbol = function(value) {\n if (value) {\n startSymbol = value;\n return this;\n } else {\n return startSymbol;\n }\n };\n\n /**\n * @ngdoc method\n * @name $interpolateProvider#endSymbol\n * @description\n * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n *\n * @param {string=} value new value to set the ending symbol to.\n * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n */\n this.endSymbol = function(value) {\n if (value) {\n endSymbol = value;\n return this;\n } else {\n return endSymbol;\n }\n };\n\n\n this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {\n var startSymbolLength = startSymbol.length,\n endSymbolLength = endSymbol.length,\n escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),\n escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');\n\n function escape(ch) {\n return '\\\\\\\\\\\\' + ch;\n }\n\n function unescapeText(text) {\n return text.replace(escapedStartRegexp, startSymbol).\n replace(escapedEndRegexp, endSymbol);\n }\n\n function stringify(value) {\n if (value == null) { // null || undefined\n return '';\n }\n switch (typeof value) {\n case 'string':\n break;\n case 'number':\n value = '' + value;\n break;\n default:\n value = toJson(value);\n }\n\n return value;\n }\n\n //TODO: this is the same as the constantWatchDelegate in parse.js\n function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch;\n return unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n }\n\n /**\n * @ngdoc service\n * @name $interpolate\n * @kind function\n *\n * @requires $parse\n * @requires $sce\n *\n * @description\n *\n * Compiles a string with markup into an interpolation function. This service is used by the\n * HTML {@link ng.$compile $compile} service for data binding. See\n * {@link ng.$interpolateProvider $interpolateProvider} for configuring the\n * interpolation markup.\n *\n *\n * ```js\n * var $interpolate = ...; // injected\n * var exp = $interpolate('Hello {{name | uppercase}}!');\n * expect(exp({name:'Angular'})).toEqual('Hello ANGULAR!');\n * ```\n *\n * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is\n * `true`, the interpolation function will return `undefined` unless all embedded expressions\n * evaluate to a value other than `undefined`.\n *\n * ```js\n * var $interpolate = ...; // injected\n * var context = {greeting: 'Hello', name: undefined };\n *\n * // default \"forgiving\" mode\n * var exp = $interpolate('{{greeting}} {{name}}!');\n * expect(exp(context)).toEqual('Hello !');\n *\n * // \"allOrNothing\" mode\n * exp = $interpolate('{{greeting}} {{name}}!', false, null, true);\n * expect(exp(context)).toBeUndefined();\n * context.name = 'Angular';\n * expect(exp(context)).toEqual('Hello Angular!');\n * ```\n *\n * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior.\n *\n * #### Escaped Interpolation\n * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers\n * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash).\n * It will be rendered as a regular start/end marker, and will not be interpreted as an expression\n * or binding.\n *\n * This enables web-servers to prevent script injection attacks and defacing attacks, to some\n * degree, while also enabling code examples to work without relying on the\n * {@link ng.directive:ngNonBindable ngNonBindable} directive.\n *\n * **For security purposes, it is strongly encouraged that web servers escape user-supplied data,\n * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all\n * interpolation start/end markers with their escaped counterparts.**\n *\n * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered\n * output when the $interpolate service processes the text. So, for HTML elements interpolated\n * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter\n * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such,\n * this is typically useful only when user-data is used in rendering a template from the server, or\n * when otherwise untrusted data is used by a directive.\n *\n * \n * \n *
        \n *

        {{apptitle}}: \\{\\{ username = \"defaced value\"; \\}\\}\n *

        \n *

        {{username}} attempts to inject code which will deface the\n * application, but fails to accomplish their task, because the server has correctly\n * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash)\n * characters.

        \n *

        Instead, the result of the attempted script injection is visible, and can be removed\n * from the database by an administrator.

        \n *
        \n *
        \n *
        \n *\n * @knownIssue\n * It is currently not possible for an interpolated expression to contain the interpolation end\n * symbol. For example, `{{ '}}' }}` will be incorrectly interpreted as `{{ ' }}` + `' }}`, i.e.\n * an interpolated expression consisting of a single-quote (`'`) and the `' }}` string.\n *\n * @knownIssue\n * All directives and components must use the standard `{{` `}}` interpolation symbols\n * in their templates. If you change the application interpolation symbols the {@link $compile}\n * service will attempt to denormalize the standard symbols to the custom symbols.\n * The denormalization process is not clever enough to know not to replace instances of the standard\n * symbols where they would not normally be treated as interpolation symbols. For example in the following\n * code snippet the closing braces of the literal object will get incorrectly denormalized:\n *\n * ```\n *
        \n * ```\n *\n * See https://github.com/angular/angular.js/pull/14610#issuecomment-219401099 for more information.\n *\n * @param {string} text The text with markup to interpolate.\n * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have\n * embedded expression in order to return an interpolation function. Strings with no\n * embedded expression will return null for the interpolation function.\n * @param {string=} trustedContext when provided, the returned function passes the interpolated\n * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult,\n * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that\n * provides Strict Contextual Escaping for details.\n * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined\n * unless all embedded expressions evaluate to a value other than `undefined`.\n * @returns {function(context)} an interpolation function which is used to compute the\n * interpolated string. The function has these parameters:\n *\n * - `context`: evaluation context for all expressions embedded in the interpolated text\n */\n function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {\n // Provide a quick exit and simplified result function for text with no interpolation\n if (!text.length || text.indexOf(startSymbol) === -1) {\n var constantInterp;\n if (!mustHaveExpression) {\n var unescapedText = unescapeText(text);\n constantInterp = valueFn(unescapedText);\n constantInterp.exp = text;\n constantInterp.expressions = [];\n constantInterp.$$watchDelegate = constantWatchDelegate;\n }\n return constantInterp;\n }\n\n allOrNothing = !!allOrNothing;\n var startIndex,\n endIndex,\n index = 0,\n expressions = [],\n parseFns = [],\n textLength = text.length,\n exp,\n concat = [],\n expressionPositions = [];\n\n while (index < textLength) {\n if (((startIndex = text.indexOf(startSymbol, index)) != -1) &&\n ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) {\n if (index !== startIndex) {\n concat.push(unescapeText(text.substring(index, startIndex)));\n }\n exp = text.substring(startIndex + startSymbolLength, endIndex);\n expressions.push(exp);\n parseFns.push($parse(exp, parseStringifyInterceptor));\n index = endIndex + endSymbolLength;\n expressionPositions.push(concat.length);\n concat.push('');\n } else {\n // we did not find an interpolation, so we have to add the remainder to the separators array\n if (index !== textLength) {\n concat.push(unescapeText(text.substring(index)));\n }\n break;\n }\n }\n\n // Concatenating expressions makes it hard to reason about whether some combination of\n // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a\n // single expression be used for iframe[src], object[src], etc., we ensure that the value\n // that's used is assigned or constructed by some JS code somewhere that is more testable or\n // make it obvious that you bound the value to some user controlled value. This helps reduce\n // the load when auditing for XSS issues.\n if (trustedContext && concat.length > 1) {\n $interpolateMinErr.throwNoconcat(text);\n }\n\n if (!mustHaveExpression || expressions.length) {\n var compute = function(values) {\n for (var i = 0, ii = expressions.length; i < ii; i++) {\n if (allOrNothing && isUndefined(values[i])) return;\n concat[expressionPositions[i]] = values[i];\n }\n return concat.join('');\n };\n\n var getValue = function(value) {\n return trustedContext ?\n $sce.getTrusted(trustedContext, value) :\n $sce.valueOf(value);\n };\n\n return extend(function interpolationFn(context) {\n var i = 0;\n var ii = expressions.length;\n var values = new Array(ii);\n\n try {\n for (; i < ii; i++) {\n values[i] = parseFns[i](context);\n }\n\n return compute(values);\n } catch (err) {\n $exceptionHandler($interpolateMinErr.interr(text, err));\n }\n\n }, {\n // all of these properties are undocumented for now\n exp: text, //just for compatibility with regular watchers created via $watch\n expressions: expressions,\n $$watchDelegate: function(scope, listener) {\n var lastValue;\n return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) {\n var currValue = compute(values);\n if (isFunction(listener)) {\n listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);\n }\n lastValue = currValue;\n });\n }\n });\n }\n\n function parseStringifyInterceptor(value) {\n try {\n value = getValue(value);\n return allOrNothing && !isDefined(value) ? value : stringify(value);\n } catch (err) {\n $exceptionHandler($interpolateMinErr.interr(text, err));\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $interpolate#startSymbol\n * @description\n * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.\n *\n * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change\n * the symbol.\n *\n * @returns {string} start symbol.\n */\n $interpolate.startSymbol = function() {\n return startSymbol;\n };\n\n\n /**\n * @ngdoc method\n * @name $interpolate#endSymbol\n * @description\n * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n *\n * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change\n * the symbol.\n *\n * @returns {string} end symbol.\n */\n $interpolate.endSymbol = function() {\n return endSymbol;\n };\n\n return $interpolate;\n }];\n}\n\nfunction $IntervalProvider() {\n this.$get = ['$rootScope', '$window', '$q', '$$q', '$browser',\n function($rootScope, $window, $q, $$q, $browser) {\n var intervals = {};\n\n\n /**\n * @ngdoc service\n * @name $interval\n *\n * @description\n * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay`\n * milliseconds.\n *\n * The return value of registering an interval function is a promise. This promise will be\n * notified upon each tick of the interval, and will be resolved after `count` iterations, or\n * run indefinitely if `count` is not defined. The value of the notification will be the\n * number of iterations that have run.\n * To cancel an interval, call `$interval.cancel(promise)`.\n *\n * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to\n * move forward by `millis` milliseconds and trigger any functions scheduled to run in that\n * time.\n *\n *
        \n * **Note**: Intervals created by this service must be explicitly destroyed when you are finished\n * with them. In particular they are not automatically destroyed when a controller's scope or a\n * directive's element are destroyed.\n * You should take this into consideration and make sure to always cancel the interval at the\n * appropriate moment. See the example below for more details on how and when to do this.\n *
        \n *\n * @param {function()} fn A function that should be called repeatedly.\n * @param {number} delay Number of milliseconds between each function call.\n * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat\n * indefinitely.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {promise} A promise which will be notified on each iteration.\n *\n * @example\n * \n * \n * \n *\n *
        \n *
        \n *
        \n * Current time is: \n *
        \n * Blood 1 : {{blood_1}}\n * Blood 2 : {{blood_2}}\n * \n * \n * \n *
        \n *
        \n *\n *
        \n *
        \n */\n function interval(fn, delay, count, invokeApply) {\n var hasParams = arguments.length > 4,\n args = hasParams ? sliceArgs(arguments, 4) : [],\n setInterval = $window.setInterval,\n clearInterval = $window.clearInterval,\n iteration = 0,\n skipApply = (isDefined(invokeApply) && !invokeApply),\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise;\n\n count = isDefined(count) ? count : 0;\n\n promise.$$intervalId = setInterval(function tick() {\n if (skipApply) {\n $browser.defer(callback);\n } else {\n $rootScope.$evalAsync(callback);\n }\n deferred.notify(iteration++);\n\n if (count > 0 && iteration >= count) {\n deferred.resolve(iteration);\n clearInterval(promise.$$intervalId);\n delete intervals[promise.$$intervalId];\n }\n\n if (!skipApply) $rootScope.$apply();\n\n }, delay);\n\n intervals[promise.$$intervalId] = deferred;\n\n return promise;\n\n function callback() {\n if (!hasParams) {\n fn(iteration);\n } else {\n fn.apply(null, args);\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $interval#cancel\n *\n * @description\n * Cancels a task associated with the `promise`.\n *\n * @param {Promise=} promise returned by the `$interval` function.\n * @returns {boolean} Returns `true` if the task was successfully canceled.\n */\n interval.cancel = function(promise) {\n if (promise && promise.$$intervalId in intervals) {\n intervals[promise.$$intervalId].reject('canceled');\n $window.clearInterval(promise.$$intervalId);\n delete intervals[promise.$$intervalId];\n return true;\n }\n return false;\n };\n\n return interval;\n }];\n}\n\n/**\n * @ngdoc service\n * @name $jsonpCallbacks\n * @requires $window\n * @description\n * This service handles the lifecycle of callbacks to handle JSONP requests.\n * Override this service if you wish to customise where the callbacks are stored and\n * how they vary compared to the requested url.\n */\nvar $jsonpCallbacksProvider = function() {\n this.$get = ['$window', function($window) {\n var callbacks = $window.angular.callbacks;\n var callbackMap = {};\n\n function createCallback(callbackId) {\n var callback = function(data) {\n callback.data = data;\n callback.called = true;\n };\n callback.id = callbackId;\n return callback;\n }\n\n return {\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#createCallback\n * @param {string} url the url of the JSONP request\n * @returns {string} the callback path to send to the server as part of the JSONP request\n * @description\n * {@link $httpBackend} calls this method to create a callback and get hold of the path to the callback\n * to pass to the server, which will be used to call the callback with its payload in the JSONP response.\n */\n createCallback: function(url) {\n var callbackId = '_' + (callbacks.$$counter++).toString(36);\n var callbackPath = 'angular.callbacks.' + callbackId;\n var callback = createCallback(callbackId);\n callbackMap[callbackPath] = callbacks[callbackId] = callback;\n return callbackPath;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#wasCalled\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @returns {boolean} whether the callback has been called, as a result of the JSONP response\n * @description\n * {@link $httpBackend} calls this method to find out whether the JSONP response actually called the\n * callback that was passed in the request.\n */\n wasCalled: function(callbackPath) {\n return callbackMap[callbackPath].called;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#getResponse\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @returns {*} the data received from the response via the registered callback\n * @description\n * {@link $httpBackend} calls this method to get hold of the data that was provided to the callback\n * in the JSONP response.\n */\n getResponse: function(callbackPath) {\n return callbackMap[callbackPath].data;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#removeCallback\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @description\n * {@link $httpBackend} calls this method to remove the callback after the JSONP request has\n * completed or timed-out.\n */\n removeCallback: function(callbackPath) {\n var callback = callbackMap[callbackPath];\n delete callbacks[callback.id];\n delete callbackMap[callbackPath];\n }\n };\n }];\n};\n\n/**\n * @ngdoc service\n * @name $locale\n *\n * @description\n * $locale service provides localization rules for various Angular components. As of right now the\n * only public api is:\n *\n * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)\n */\n\nvar PATH_MATCH = /^([^\\?#]*)(\\?([^#]*))?(#(.*))?$/,\n DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};\nvar $locationMinErr = minErr('$location');\n\n\n/**\n * Encode path using encodeUriSegment, ignoring forward slashes\n *\n * @param {string} path Path to encode\n * @returns {string}\n */\nfunction encodePath(path) {\n var segments = path.split('/'),\n i = segments.length;\n\n while (i--) {\n segments[i] = encodeUriSegment(segments[i]);\n }\n\n return segments.join('/');\n}\n\nfunction parseAbsoluteUrl(absoluteUrl, locationObj) {\n var parsedUrl = urlResolve(absoluteUrl);\n\n locationObj.$$protocol = parsedUrl.protocol;\n locationObj.$$host = parsedUrl.hostname;\n locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;\n}\n\n\nfunction parseAppUrl(relativeUrl, locationObj) {\n var prefixed = (relativeUrl.charAt(0) !== '/');\n if (prefixed) {\n relativeUrl = '/' + relativeUrl;\n }\n var match = urlResolve(relativeUrl);\n locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?\n match.pathname.substring(1) : match.pathname);\n locationObj.$$search = parseKeyValue(match.search);\n locationObj.$$hash = decodeURIComponent(match.hash);\n\n // make sure path starts with '/';\n if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {\n locationObj.$$path = '/' + locationObj.$$path;\n }\n}\n\nfunction startsWith(haystack, needle) {\n return haystack.lastIndexOf(needle, 0) === 0;\n}\n\n/**\n *\n * @param {string} base\n * @param {string} url\n * @returns {string} returns text from `url` after `base` or `undefined` if it does not begin with\n * the expected string.\n */\nfunction stripBaseUrl(base, url) {\n if (startsWith(url, base)) {\n return url.substr(base.length);\n }\n}\n\n\nfunction stripHash(url) {\n var index = url.indexOf('#');\n return index == -1 ? url : url.substr(0, index);\n}\n\nfunction trimEmptyHash(url) {\n return url.replace(/(#.+)|#$/, '$1');\n}\n\n\nfunction stripFile(url) {\n return url.substr(0, stripHash(url).lastIndexOf('/') + 1);\n}\n\n/* return the server only (scheme://host:port) */\nfunction serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}\n\n\n/**\n * LocationHtml5Url represents an url\n * This object is exposed as $location service when HTML5 mode is enabled and supported\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} basePrefix url path prefix\n */\nfunction LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {\n this.$$html5 = true;\n basePrefix = basePrefix || '';\n parseAbsoluteUrl(appBase, this);\n\n\n /**\n * Parse given html5 (regular) url string into properties\n * @param {string} url HTML5 url\n * @private\n */\n this.$$parse = function(url) {\n var pathUrl = stripBaseUrl(appBaseNoFile, url);\n if (!isString(pathUrl)) {\n throw $locationMinErr('ipthprfx', 'Invalid url \"{0}\", missing path prefix \"{1}\".', url,\n appBaseNoFile);\n }\n\n parseAppUrl(pathUrl, this);\n\n if (!this.$$path) {\n this.$$path = '/';\n }\n\n this.$$compose();\n };\n\n /**\n * Compose url and update `absUrl` property\n * @private\n */\n this.$$compose = function() {\n var search = toKeyValue(this.$$search),\n hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/'\n };\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (relHref && relHref[0] === '#') {\n // special case for links to hash fragments:\n // keep the old url and only replace the hash fragment\n this.hash(relHref.slice(1));\n return true;\n }\n var appUrl, prevAppUrl;\n var rewrittenUrl;\n\n if (isDefined(appUrl = stripBaseUrl(appBase, url))) {\n prevAppUrl = appUrl;\n if (isDefined(appUrl = stripBaseUrl(basePrefix, appUrl))) {\n rewrittenUrl = appBaseNoFile + (stripBaseUrl('/', appUrl) || appUrl);\n } else {\n rewrittenUrl = appBase + prevAppUrl;\n }\n } else if (isDefined(appUrl = stripBaseUrl(appBaseNoFile, url))) {\n rewrittenUrl = appBaseNoFile + appUrl;\n } else if (appBaseNoFile == url + '/') {\n rewrittenUrl = appBaseNoFile;\n }\n if (rewrittenUrl) {\n this.$$parse(rewrittenUrl);\n }\n return !!rewrittenUrl;\n };\n}\n\n\n/**\n * LocationHashbangUrl represents url\n * This object is exposed as $location service when developer doesn't opt into html5 mode.\n * It also serves as the base class for html5 mode fallback on legacy browsers.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {\n\n parseAbsoluteUrl(appBase, this);\n\n\n /**\n * Parse given hashbang url into properties\n * @param {string} url Hashbang url\n * @private\n */\n this.$$parse = function(url) {\n var withoutBaseUrl = stripBaseUrl(appBase, url) || stripBaseUrl(appBaseNoFile, url);\n var withoutHashUrl;\n\n if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') {\n\n // The rest of the url starts with a hash so we have\n // got either a hashbang path or a plain hash fragment\n withoutHashUrl = stripBaseUrl(hashPrefix, withoutBaseUrl);\n if (isUndefined(withoutHashUrl)) {\n // There was no hashbang prefix so we just have a hash fragment\n withoutHashUrl = withoutBaseUrl;\n }\n\n } else {\n // There was no hashbang path nor hash fragment:\n // If we are in HTML5 mode we use what is left as the path;\n // Otherwise we ignore what is left\n if (this.$$html5) {\n withoutHashUrl = withoutBaseUrl;\n } else {\n withoutHashUrl = '';\n if (isUndefined(withoutBaseUrl)) {\n appBase = url;\n this.replace();\n }\n }\n }\n\n parseAppUrl(withoutHashUrl, this);\n\n this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);\n\n this.$$compose();\n\n /*\n * In Windows, on an anchor node on documents loaded from\n * the filesystem, the browser will return a pathname\n * prefixed with the drive name ('/C:/path') when a\n * pathname without a drive is set:\n * * a.setAttribute('href', '/foo')\n * * a.pathname === '/C:/foo' //true\n *\n * Inside of Angular, we're always using pathnames that\n * do not include drive names for routing.\n */\n function removeWindowsDriveName(path, url, base) {\n /*\n Matches paths for file protocol on windows,\n such as /C:/foo/bar, and captures only /foo/bar.\n */\n var windowsFilePathExp = /^\\/[A-Z]:(\\/.*)/;\n\n var firstPathSegmentMatch;\n\n //Get the relative path from the input URL.\n if (startsWith(url, base)) {\n url = url.replace(base, '');\n }\n\n // The input URL intentionally contains a first path segment that ends with a colon.\n if (windowsFilePathExp.exec(url)) {\n return path;\n }\n\n firstPathSegmentMatch = windowsFilePathExp.exec(path);\n return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;\n }\n };\n\n /**\n * Compose hashbang url and update `absUrl` property\n * @private\n */\n this.$$compose = function() {\n var search = toKeyValue(this.$$search),\n hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');\n };\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (stripHash(appBase) == stripHash(url)) {\n this.$$parse(url);\n return true;\n }\n return false;\n };\n}\n\n\n/**\n * LocationHashbangUrl represents url\n * This object is exposed as $location service when html5 history api is enabled but the browser\n * does not support it.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {\n this.$$html5 = true;\n LocationHashbangUrl.apply(this, arguments);\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (relHref && relHref[0] === '#') {\n // special case for links to hash fragments:\n // keep the old url and only replace the hash fragment\n this.hash(relHref.slice(1));\n return true;\n }\n\n var rewrittenUrl;\n var appUrl;\n\n if (appBase == stripHash(url)) {\n rewrittenUrl = url;\n } else if ((appUrl = stripBaseUrl(appBaseNoFile, url))) {\n rewrittenUrl = appBase + hashPrefix + appUrl;\n } else if (appBaseNoFile === url + '/') {\n rewrittenUrl = appBaseNoFile;\n }\n if (rewrittenUrl) {\n this.$$parse(rewrittenUrl);\n }\n return !!rewrittenUrl;\n };\n\n this.$$compose = function() {\n var search = toKeyValue(this.$$search),\n hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';\n\n this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;\n // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#'\n this.$$absUrl = appBase + hashPrefix + this.$$url;\n };\n\n}\n\n\nvar locationPrototype = {\n\n /**\n * Ensure absolute url is initialized.\n * @private\n */\n $$absUrl:'',\n\n /**\n * Are we in html5 mode?\n * @private\n */\n $$html5: false,\n\n /**\n * Has any change been replacing?\n * @private\n */\n $$replace: false,\n\n /**\n * @ngdoc method\n * @name $location#absUrl\n *\n * @description\n * This method is getter only.\n *\n * Return full url representation with all segments encoded according to rules specified in\n * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var absUrl = $location.absUrl();\n * // => \"http://example.com/#/some/path?foo=bar&baz=xoxo\"\n * ```\n *\n * @return {string} full url\n */\n absUrl: locationGetter('$$absUrl'),\n\n /**\n * @ngdoc method\n * @name $location#url\n *\n * @description\n * This method is getter / setter.\n *\n * Return url (e.g. `/path?a=b#hash`) when called without any parameter.\n *\n * Change path, search and hash, when called with parameter and return `$location`.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var url = $location.url();\n * // => \"/some/path?foo=bar&baz=xoxo\"\n * ```\n *\n * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)\n * @return {string} url\n */\n url: function(url) {\n if (isUndefined(url)) {\n return this.$$url;\n }\n\n var match = PATH_MATCH.exec(url);\n if (match[1] || url === '') this.path(decodeURIComponent(match[1]));\n if (match[2] || match[1] || url === '') this.search(match[3] || '');\n this.hash(match[5] || '');\n\n return this;\n },\n\n /**\n * @ngdoc method\n * @name $location#protocol\n *\n * @description\n * This method is getter only.\n *\n * Return protocol of current url.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var protocol = $location.protocol();\n * // => \"http\"\n * ```\n *\n * @return {string} protocol of current url\n */\n protocol: locationGetter('$$protocol'),\n\n /**\n * @ngdoc method\n * @name $location#host\n *\n * @description\n * This method is getter only.\n *\n * Return host of current url.\n *\n * Note: compared to the non-angular version `location.host` which returns `hostname:port`, this returns the `hostname` portion only.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var host = $location.host();\n * // => \"example.com\"\n *\n * // given url http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo\n * host = $location.host();\n * // => \"example.com\"\n * host = location.host;\n * // => \"example.com:8080\"\n * ```\n *\n * @return {string} host of current url.\n */\n host: locationGetter('$$host'),\n\n /**\n * @ngdoc method\n * @name $location#port\n *\n * @description\n * This method is getter only.\n *\n * Return port of current url.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var port = $location.port();\n * // => 80\n * ```\n *\n * @return {Number} port\n */\n port: locationGetter('$$port'),\n\n /**\n * @ngdoc method\n * @name $location#path\n *\n * @description\n * This method is getter / setter.\n *\n * Return path of current url when called without any parameter.\n *\n * Change path when called with parameter and return `$location`.\n *\n * Note: Path should always begin with forward slash (/), this method will add the forward slash\n * if it is missing.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var path = $location.path();\n * // => \"/some/path\"\n * ```\n *\n * @param {(string|number)=} path New path\n * @return {(string|object)} path if called with no parameters, or `$location` if called with a parameter\n */\n path: locationGetterSetter('$$path', function(path) {\n path = path !== null ? path.toString() : '';\n return path.charAt(0) == '/' ? path : '/' + path;\n }),\n\n /**\n * @ngdoc method\n * @name $location#search\n *\n * @description\n * This method is getter / setter.\n *\n * Return search part (as object) of current url when called without any parameter.\n *\n * Change search part when called with parameter and return `$location`.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo\n * var searchObject = $location.search();\n * // => {foo: 'bar', baz: 'xoxo'}\n *\n * // set foo to 'yipee'\n * $location.search('foo', 'yipee');\n * // $location.search() => {foo: 'yipee', baz: 'xoxo'}\n * ```\n *\n * @param {string|Object.|Object.>} search New search params - string or\n * hash object.\n *\n * When called with a single argument the method acts as a setter, setting the `search` component\n * of `$location` to the specified value.\n *\n * If the argument is a hash object containing an array of values, these values will be encoded\n * as duplicate search parameters in the url.\n *\n * @param {(string|Number|Array|boolean)=} paramValue If `search` is a string or number, then `paramValue`\n * will override only a single search property.\n *\n * If `paramValue` is an array, it will override the property of the `search` component of\n * `$location` specified via the first argument.\n *\n * If `paramValue` is `null`, the property specified via the first argument will be deleted.\n *\n * If `paramValue` is `true`, the property specified via the first argument will be added with no\n * value nor trailing equal sign.\n *\n * @return {Object} If called with no arguments returns the parsed `search` object. If called with\n * one or more arguments returns `$location` object itself.\n */\n search: function(search, paramValue) {\n switch (arguments.length) {\n case 0:\n return this.$$search;\n case 1:\n if (isString(search) || isNumber(search)) {\n search = search.toString();\n this.$$search = parseKeyValue(search);\n } else if (isObject(search)) {\n search = copy(search, {});\n // remove object undefined or null properties\n forEach(search, function(value, key) {\n if (value == null) delete search[key];\n });\n\n this.$$search = search;\n } else {\n throw $locationMinErr('isrcharg',\n 'The first argument of the `$location#search()` call must be a string or an object.');\n }\n break;\n default:\n if (isUndefined(paramValue) || paramValue === null) {\n delete this.$$search[search];\n } else {\n this.$$search[search] = paramValue;\n }\n }\n\n this.$$compose();\n return this;\n },\n\n /**\n * @ngdoc method\n * @name $location#hash\n *\n * @description\n * This method is getter / setter.\n *\n * Returns the hash fragment when called without any parameters.\n *\n * Changes the hash fragment when called with a parameter and returns `$location`.\n *\n *\n * ```js\n * // given url http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue\n * var hash = $location.hash();\n * // => \"hashValue\"\n * ```\n *\n * @param {(string|number)=} hash New hash fragment\n * @return {string} hash\n */\n hash: locationGetterSetter('$$hash', function(hash) {\n return hash !== null ? hash.toString() : '';\n }),\n\n /**\n * @ngdoc method\n * @name $location#replace\n *\n * @description\n * If called, all changes to $location during the current `$digest` will replace the current history\n * record, instead of adding a new one.\n */\n replace: function() {\n this.$$replace = true;\n return this;\n }\n};\n\nforEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) {\n Location.prototype = Object.create(locationPrototype);\n\n /**\n * @ngdoc method\n * @name $location#state\n *\n * @description\n * This method is getter / setter.\n *\n * Return the history state object when called without any parameter.\n *\n * Change the history state object when called with one parameter and return `$location`.\n * The state object is later passed to `pushState` or `replaceState`.\n *\n * NOTE: This method is supported only in HTML5 mode and only in browsers supporting\n * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support\n * older browsers (like IE9 or Android < 4.0), don't use this method.\n *\n * @param {object=} state State object for pushState or replaceState\n * @return {object} state\n */\n Location.prototype.state = function(state) {\n if (!arguments.length) {\n return this.$$state;\n }\n\n if (Location !== LocationHtml5Url || !this.$$html5) {\n throw $locationMinErr('nostate', 'History API state support is available only ' +\n 'in HTML5 mode and only in browsers supporting HTML5 History API');\n }\n // The user might modify `stateObject` after invoking `$location.state(stateObject)`\n // but we're changing the $$state reference to $browser.state() during the $digest\n // so the modification window is narrow.\n this.$$state = isUndefined(state) ? null : state;\n\n return this;\n };\n});\n\n\nfunction locationGetter(property) {\n return function() {\n return this[property];\n };\n}\n\n\nfunction locationGetterSetter(property, preprocess) {\n return function(value) {\n if (isUndefined(value)) {\n return this[property];\n }\n\n this[property] = preprocess(value);\n this.$$compose();\n\n return this;\n };\n}\n\n\n/**\n * @ngdoc service\n * @name $location\n *\n * @requires $rootElement\n *\n * @description\n * The $location service parses the URL in the browser address bar (based on the\n * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL\n * available to your application. Changes to the URL in the address bar are reflected into\n * $location service and changes to $location are reflected into the browser address bar.\n *\n * **The $location service:**\n *\n * - Exposes the current URL in the browser address bar, so you can\n * - Watch and observe the URL.\n * - Change the URL.\n * - Synchronizes the URL with the browser when the user\n * - Changes the address bar.\n * - Clicks the back or forward button (or clicks a History link).\n * - Clicks on a link.\n * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).\n *\n * For more information see {@link guide/$location Developer Guide: Using $location}\n */\n\n/**\n * @ngdoc provider\n * @name $locationProvider\n * @description\n * Use the `$locationProvider` to configure how the application deep linking paths are stored.\n */\nfunction $LocationProvider() {\n var hashPrefix = '',\n html5Mode = {\n enabled: false,\n requireBase: true,\n rewriteLinks: true\n };\n\n /**\n * @ngdoc method\n * @name $locationProvider#hashPrefix\n * @description\n * @param {string=} prefix Prefix for hash part (containing path and search)\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.hashPrefix = function(prefix) {\n if (isDefined(prefix)) {\n hashPrefix = prefix;\n return this;\n } else {\n return hashPrefix;\n }\n };\n\n /**\n * @ngdoc method\n * @name $locationProvider#html5Mode\n * @description\n * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.\n * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported\n * properties:\n * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to\n * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not\n * support `pushState`.\n * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies\n * whether or not a tag is required to be present. If `enabled` and `requireBase` are\n * true, and a base tag is not present, an error will be thrown when `$location` is injected.\n * See the {@link guide/$location $location guide for more information}\n * - **rewriteLinks** - `{boolean}` - (default: `true`) When html5Mode is enabled,\n * enables/disables url rewriting for relative links.\n *\n * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter\n */\n this.html5Mode = function(mode) {\n if (isBoolean(mode)) {\n html5Mode.enabled = mode;\n return this;\n } else if (isObject(mode)) {\n\n if (isBoolean(mode.enabled)) {\n html5Mode.enabled = mode.enabled;\n }\n\n if (isBoolean(mode.requireBase)) {\n html5Mode.requireBase = mode.requireBase;\n }\n\n if (isBoolean(mode.rewriteLinks)) {\n html5Mode.rewriteLinks = mode.rewriteLinks;\n }\n\n return this;\n } else {\n return html5Mode;\n }\n };\n\n /**\n * @ngdoc event\n * @name $location#$locationChangeStart\n * @eventType broadcast on root scope\n * @description\n * Broadcasted before a URL will change.\n *\n * This change can be prevented by calling\n * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more\n * details about event object. Upon successful change\n * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.\n *\n * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n * the browser supports the HTML5 History API.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n * @param {string=} newState New history state object\n * @param {string=} oldState History state object that was before it was changed.\n */\n\n /**\n * @ngdoc event\n * @name $location#$locationChangeSuccess\n * @eventType broadcast on root scope\n * @description\n * Broadcasted after a URL was changed.\n *\n * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n * the browser supports the HTML5 History API.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n * @param {string=} newState New history state object\n * @param {string=} oldState History state object that was before it was changed.\n */\n\n this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window',\n function($rootScope, $browser, $sniffer, $rootElement, $window) {\n var $location,\n LocationMode,\n baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''\n initialUrl = $browser.url(),\n appBase;\n\n if (html5Mode.enabled) {\n if (!baseHref && html5Mode.requireBase) {\n throw $locationMinErr('nobase',\n \"$location in HTML5 mode requires a tag to be present!\");\n }\n appBase = serverBase(initialUrl) + (baseHref || '/');\n LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;\n } else {\n appBase = stripHash(initialUrl);\n LocationMode = LocationHashbangUrl;\n }\n var appBaseNoFile = stripFile(appBase);\n\n $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix);\n $location.$$parseLinkUrl(initialUrl, initialUrl);\n\n $location.$$state = $browser.state();\n\n var IGNORE_URI_REGEXP = /^\\s*(javascript|mailto):/i;\n\n function setBrowserUrlWithFallback(url, replace, state) {\n var oldUrl = $location.url();\n var oldState = $location.$$state;\n try {\n $browser.url(url, replace, state);\n\n // Make sure $location.state() returns referentially identical (not just deeply equal)\n // state object; this makes possible quick checking if the state changed in the digest\n // loop. Checking deep equality would be too expensive.\n $location.$$state = $browser.state();\n } catch (e) {\n // Restore old values if pushState fails\n $location.url(oldUrl);\n $location.$$state = oldState;\n\n throw e;\n }\n }\n\n $rootElement.on('click', function(event) {\n // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)\n // currently we open nice url link and redirect then\n\n if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return;\n\n var elm = jqLite(event.target);\n\n // traverse the DOM up to find first A tag\n while (nodeName_(elm[0]) !== 'a') {\n // ignore rewriting if no A tag (reached root element, or no parent - removed from document)\n if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;\n }\n\n var absHref = elm.prop('href');\n // get the actual href attribute - see\n // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx\n var relHref = elm.attr('href') || elm.attr('xlink:href');\n\n if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {\n // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during\n // an animation.\n absHref = urlResolve(absHref.animVal).href;\n }\n\n // Ignore when url is started with javascript: or mailto:\n if (IGNORE_URI_REGEXP.test(absHref)) return;\n\n if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) {\n if ($location.$$parseLinkUrl(absHref, relHref)) {\n // We do a preventDefault for all urls that are part of the angular application,\n // in html5mode and also without, so that we are able to abort navigation without\n // getting double entries in the location history.\n event.preventDefault();\n // update location manually\n if ($location.absUrl() != $browser.url()) {\n $rootScope.$apply();\n // hack to work around FF6 bug 684208 when scenario runner clicks on links\n $window.angular['ff-684208-preventDefault'] = true;\n }\n }\n }\n });\n\n\n // rewrite hashbang url <> html5 url\n if (trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)) {\n $browser.url($location.absUrl(), true);\n }\n\n var initializing = true;\n\n // update $location when $browser url changes\n $browser.onUrlChange(function(newUrl, newState) {\n\n if (isUndefined(stripBaseUrl(appBaseNoFile, newUrl))) {\n // If we are navigating outside of the app then force a reload\n $window.location.href = newUrl;\n return;\n }\n\n $rootScope.$evalAsync(function() {\n var oldUrl = $location.absUrl();\n var oldState = $location.$$state;\n var defaultPrevented;\n newUrl = trimEmptyHash(newUrl);\n $location.$$parse(newUrl);\n $location.$$state = newState;\n\n defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n newState, oldState).defaultPrevented;\n\n // if the location was changed by a `$locationChangeStart` handler then stop\n // processing this location change\n if ($location.absUrl() !== newUrl) return;\n\n if (defaultPrevented) {\n $location.$$parse(oldUrl);\n $location.$$state = oldState;\n setBrowserUrlWithFallback(oldUrl, false, oldState);\n } else {\n initializing = false;\n afterLocationChange(oldUrl, oldState);\n }\n });\n if (!$rootScope.$$phase) $rootScope.$digest();\n });\n\n // update browser\n $rootScope.$watch(function $locationWatch() {\n var oldUrl = trimEmptyHash($browser.url());\n var newUrl = trimEmptyHash($location.absUrl());\n var oldState = $browser.state();\n var currentReplace = $location.$$replace;\n var urlOrStateChanged = oldUrl !== newUrl ||\n ($location.$$html5 && $sniffer.history && oldState !== $location.$$state);\n\n if (initializing || urlOrStateChanged) {\n initializing = false;\n\n $rootScope.$evalAsync(function() {\n var newUrl = $location.absUrl();\n var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n $location.$$state, oldState).defaultPrevented;\n\n // if the location was changed by a `$locationChangeStart` handler then stop\n // processing this location change\n if ($location.absUrl() !== newUrl) return;\n\n if (defaultPrevented) {\n $location.$$parse(oldUrl);\n $location.$$state = oldState;\n } else {\n if (urlOrStateChanged) {\n setBrowserUrlWithFallback(newUrl, currentReplace,\n oldState === $location.$$state ? null : $location.$$state);\n }\n afterLocationChange(oldUrl, oldState);\n }\n });\n }\n\n $location.$$replace = false;\n\n // we don't need to return anything because $evalAsync will make the digest loop dirty when\n // there is a change\n });\n\n return $location;\n\n function afterLocationChange(oldUrl, oldState) {\n $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl,\n $location.$$state, oldState);\n }\n}];\n}\n\n/**\n * @ngdoc service\n * @name $log\n * @requires $window\n *\n * @description\n * Simple service for logging. Default implementation safely writes the message\n * into the browser's console (if present).\n *\n * The main purpose of this service is to simplify debugging and troubleshooting.\n *\n * The default is to log `debug` messages. You can use\n * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.\n *\n * @example\n \n \n angular.module('logExample', [])\n .controller('LogController', ['$scope', '$log', function($scope, $log) {\n $scope.$log = $log;\n $scope.message = 'Hello World!';\n }]);\n \n \n
        \n

        Reload this page with open console, enter text and hit the log button...

        \n \n \n \n \n \n \n
        \n
        \n
        \n */\n\n/**\n * @ngdoc provider\n * @name $logProvider\n * @description\n * Use the `$logProvider` to configure how the application logs messages\n */\nfunction $LogProvider() {\n var debug = true,\n self = this;\n\n /**\n * @ngdoc method\n * @name $logProvider#debugEnabled\n * @description\n * @param {boolean=} flag enable or disable debug level messages\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.debugEnabled = function(flag) {\n if (isDefined(flag)) {\n debug = flag;\n return this;\n } else {\n return debug;\n }\n };\n\n this.$get = ['$window', function($window) {\n return {\n /**\n * @ngdoc method\n * @name $log#log\n *\n * @description\n * Write a log message\n */\n log: consoleLog('log'),\n\n /**\n * @ngdoc method\n * @name $log#info\n *\n * @description\n * Write an information message\n */\n info: consoleLog('info'),\n\n /**\n * @ngdoc method\n * @name $log#warn\n *\n * @description\n * Write a warning message\n */\n warn: consoleLog('warn'),\n\n /**\n * @ngdoc method\n * @name $log#error\n *\n * @description\n * Write an error message\n */\n error: consoleLog('error'),\n\n /**\n * @ngdoc method\n * @name $log#debug\n *\n * @description\n * Write a debug message\n */\n debug: (function() {\n var fn = consoleLog('debug');\n\n return function() {\n if (debug) {\n fn.apply(self, arguments);\n }\n };\n }())\n };\n\n function formatError(arg) {\n if (arg instanceof Error) {\n if (arg.stack) {\n arg = (arg.message && arg.stack.indexOf(arg.message) === -1)\n ? 'Error: ' + arg.message + '\\n' + arg.stack\n : arg.stack;\n } else if (arg.sourceURL) {\n arg = arg.message + '\\n' + arg.sourceURL + ':' + arg.line;\n }\n }\n return arg;\n }\n\n function consoleLog(type) {\n var console = $window.console || {},\n logFn = console[type] || console.log || noop,\n hasApply = false;\n\n // Note: reading logFn.apply throws an error in IE11 in IE8 document mode.\n // The reason behind this is that console.log has type \"object\" in IE8...\n try {\n hasApply = !!logFn.apply;\n } catch (e) {}\n\n if (hasApply) {\n return function() {\n var args = [];\n forEach(arguments, function(arg) {\n args.push(formatError(arg));\n });\n return logFn.apply(console, args);\n };\n }\n\n // we are IE which either doesn't have window.console => this is noop and we do nothing,\n // or we are IE where console.log doesn't have apply so we log at least first 2 args\n return function(arg1, arg2) {\n logFn(arg1, arg2 == null ? '' : arg2);\n };\n }\n }];\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\nvar $parseMinErr = minErr('$parse');\n\n// Sandboxing Angular Expressions\n// ------------------------------\n// Angular expressions are generally considered safe because these expressions only have direct\n// access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by\n// obtaining a reference to native JS functions such as the Function constructor.\n//\n// As an example, consider the following Angular expression:\n//\n// {}.toString.constructor('alert(\"evil JS code\")')\n//\n// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits\n// against the expression language, but not to prevent exploits that were enabled by exposing\n// sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good\n// practice and therefore we are not even trying to protect against interaction with an object\n// explicitly exposed in this way.\n//\n// In general, it is not possible to access a Window object from an angular expression unless a\n// window or some DOM object that has a reference to window is published onto a Scope.\n// Similarly we prevent invocations of function known to be dangerous, as well as assignments to\n// native objects.\n//\n// See https://docs.angularjs.org/guide/security\n\n\nfunction ensureSafeMemberName(name, fullExpression) {\n if (name === \"__defineGetter__\" || name === \"__defineSetter__\"\n || name === \"__lookupGetter__\" || name === \"__lookupSetter__\"\n || name === \"__proto__\") {\n throw $parseMinErr('isecfld',\n 'Attempting to access a disallowed field in Angular expressions! '\n + 'Expression: {0}', fullExpression);\n }\n return name;\n}\n\nfunction getStringValue(name) {\n // Property names must be strings. This means that non-string objects cannot be used\n // as keys in an object. Any non-string object, including a number, is typecasted\n // into a string via the toString method.\n // -- MDN, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names\n //\n // So, to ensure that we are checking the same `name` that JavaScript would use, we cast it\n // to a string. It's not always possible. If `name` is an object and its `toString` method is\n // 'broken' (doesn't return a string, isn't a function, etc.), an error will be thrown:\n //\n // TypeError: Cannot convert object to primitive value\n //\n // For performance reasons, we don't catch this error here and allow it to propagate up the call\n // stack. Note that you'll get the same error in JavaScript if you try to access a property using\n // such a 'broken' object as a key.\n return name + '';\n}\n\nfunction ensureSafeObject(obj, fullExpression) {\n // nifty check if obj is Function that is fast and works across iframes and other contexts\n if (obj) {\n if (obj.constructor === obj) {\n throw $parseMinErr('isecfn',\n 'Referencing Function in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n } else if (// isWindow(obj)\n obj.window === obj) {\n throw $parseMinErr('isecwindow',\n 'Referencing the Window in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n } else if (// isElement(obj)\n obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) {\n throw $parseMinErr('isecdom',\n 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n } else if (// block Object so that we can't get hold of dangerous Object.* methods\n obj === Object) {\n throw $parseMinErr('isecobj',\n 'Referencing Object in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n }\n }\n return obj;\n}\n\nvar CALL = Function.prototype.call;\nvar APPLY = Function.prototype.apply;\nvar BIND = Function.prototype.bind;\n\nfunction ensureSafeFunction(obj, fullExpression) {\n if (obj) {\n if (obj.constructor === obj) {\n throw $parseMinErr('isecfn',\n 'Referencing Function in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n } else if (obj === CALL || obj === APPLY || obj === BIND) {\n throw $parseMinErr('isecff',\n 'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}',\n fullExpression);\n }\n }\n}\n\nfunction ensureSafeAssignContext(obj, fullExpression) {\n if (obj) {\n if (obj === (0).constructor || obj === (false).constructor || obj === ''.constructor ||\n obj === {}.constructor || obj === [].constructor || obj === Function.constructor) {\n throw $parseMinErr('isecaf',\n 'Assigning to a constructor is disallowed! Expression: {0}', fullExpression);\n }\n }\n}\n\nvar OPERATORS = createMap();\nforEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; });\nvar ESCAPE = {\"n\":\"\\n\", \"f\":\"\\f\", \"r\":\"\\r\", \"t\":\"\\t\", \"v\":\"\\v\", \"'\":\"'\", '\"':'\"'};\n\n\n/////////////////////////////////////////\n\n\n/**\n * @constructor\n */\nvar Lexer = function(options) {\n this.options = options;\n};\n\nLexer.prototype = {\n constructor: Lexer,\n\n lex: function(text) {\n this.text = text;\n this.index = 0;\n this.tokens = [];\n\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n if (ch === '\"' || ch === \"'\") {\n this.readString(ch);\n } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {\n this.readNumber();\n } else if (this.isIdentifierStart(this.peekMultichar())) {\n this.readIdent();\n } else if (this.is(ch, '(){}[].,;:?')) {\n this.tokens.push({index: this.index, text: ch});\n this.index++;\n } else if (this.isWhitespace(ch)) {\n this.index++;\n } else {\n var ch2 = ch + this.peek();\n var ch3 = ch2 + this.peek(2);\n var op1 = OPERATORS[ch];\n var op2 = OPERATORS[ch2];\n var op3 = OPERATORS[ch3];\n if (op1 || op2 || op3) {\n var token = op3 ? ch3 : (op2 ? ch2 : ch);\n this.tokens.push({index: this.index, text: token, operator: true});\n this.index += token.length;\n } else {\n this.throwError('Unexpected next character ', this.index, this.index + 1);\n }\n }\n }\n return this.tokens;\n },\n\n is: function(ch, chars) {\n return chars.indexOf(ch) !== -1;\n },\n\n peek: function(i) {\n var num = i || 1;\n return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false;\n },\n\n isNumber: function(ch) {\n return ('0' <= ch && ch <= '9') && typeof ch === \"string\";\n },\n\n isWhitespace: function(ch) {\n // IE treats non-breaking space as \\u00A0\n return (ch === ' ' || ch === '\\r' || ch === '\\t' ||\n ch === '\\n' || ch === '\\v' || ch === '\\u00A0');\n },\n\n isIdentifierStart: function(ch) {\n return this.options.isIdentifierStart ?\n this.options.isIdentifierStart(ch, this.codePointAt(ch)) :\n this.isValidIdentifierStart(ch);\n },\n\n isValidIdentifierStart: function(ch) {\n return ('a' <= ch && ch <= 'z' ||\n 'A' <= ch && ch <= 'Z' ||\n '_' === ch || ch === '$');\n },\n\n isIdentifierContinue: function(ch) {\n return this.options.isIdentifierContinue ?\n this.options.isIdentifierContinue(ch, this.codePointAt(ch)) :\n this.isValidIdentifierContinue(ch);\n },\n\n isValidIdentifierContinue: function(ch, cp) {\n return this.isValidIdentifierStart(ch, cp) || this.isNumber(ch);\n },\n\n codePointAt: function(ch) {\n if (ch.length === 1) return ch.charCodeAt(0);\n /*jshint bitwise: false*/\n return (ch.charCodeAt(0) << 10) + ch.charCodeAt(1) - 0x35FDC00;\n /*jshint bitwise: true*/\n },\n\n peekMultichar: function() {\n var ch = this.text.charAt(this.index);\n var peek = this.peek();\n if (!peek) {\n return ch;\n }\n var cp1 = ch.charCodeAt(0);\n var cp2 = peek.charCodeAt(0);\n if (cp1 >= 0xD800 && cp1 <= 0xDBFF && cp2 >= 0xDC00 && cp2 <= 0xDFFF) {\n return ch + peek;\n }\n return ch;\n },\n\n isExpOperator: function(ch) {\n return (ch === '-' || ch === '+' || this.isNumber(ch));\n },\n\n throwError: function(error, start, end) {\n end = end || this.index;\n var colStr = (isDefined(start)\n ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']'\n : ' ' + end);\n throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',\n error, colStr, this.text);\n },\n\n readNumber: function() {\n var number = '';\n var start = this.index;\n while (this.index < this.text.length) {\n var ch = lowercase(this.text.charAt(this.index));\n if (ch == '.' || this.isNumber(ch)) {\n number += ch;\n } else {\n var peekCh = this.peek();\n if (ch == 'e' && this.isExpOperator(peekCh)) {\n number += ch;\n } else if (this.isExpOperator(ch) &&\n peekCh && this.isNumber(peekCh) &&\n number.charAt(number.length - 1) == 'e') {\n number += ch;\n } else if (this.isExpOperator(ch) &&\n (!peekCh || !this.isNumber(peekCh)) &&\n number.charAt(number.length - 1) == 'e') {\n this.throwError('Invalid exponent');\n } else {\n break;\n }\n }\n this.index++;\n }\n this.tokens.push({\n index: start,\n text: number,\n constant: true,\n value: Number(number)\n });\n },\n\n readIdent: function() {\n var start = this.index;\n this.index += this.peekMultichar().length;\n while (this.index < this.text.length) {\n var ch = this.peekMultichar();\n if (!this.isIdentifierContinue(ch)) {\n break;\n }\n this.index += ch.length;\n }\n this.tokens.push({\n index: start,\n text: this.text.slice(start, this.index),\n identifier: true\n });\n },\n\n readString: function(quote) {\n var start = this.index;\n this.index++;\n var string = '';\n var rawString = quote;\n var escape = false;\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n rawString += ch;\n if (escape) {\n if (ch === 'u') {\n var hex = this.text.substring(this.index + 1, this.index + 5);\n if (!hex.match(/[\\da-f]{4}/i)) {\n this.throwError('Invalid unicode escape [\\\\u' + hex + ']');\n }\n this.index += 4;\n string += String.fromCharCode(parseInt(hex, 16));\n } else {\n var rep = ESCAPE[ch];\n string = string + (rep || ch);\n }\n escape = false;\n } else if (ch === '\\\\') {\n escape = true;\n } else if (ch === quote) {\n this.index++;\n this.tokens.push({\n index: start,\n text: rawString,\n constant: true,\n value: string\n });\n return;\n } else {\n string += ch;\n }\n this.index++;\n }\n this.throwError('Unterminated quote', start);\n }\n};\n\nvar AST = function(lexer, options) {\n this.lexer = lexer;\n this.options = options;\n};\n\nAST.Program = 'Program';\nAST.ExpressionStatement = 'ExpressionStatement';\nAST.AssignmentExpression = 'AssignmentExpression';\nAST.ConditionalExpression = 'ConditionalExpression';\nAST.LogicalExpression = 'LogicalExpression';\nAST.BinaryExpression = 'BinaryExpression';\nAST.UnaryExpression = 'UnaryExpression';\nAST.CallExpression = 'CallExpression';\nAST.MemberExpression = 'MemberExpression';\nAST.Identifier = 'Identifier';\nAST.Literal = 'Literal';\nAST.ArrayExpression = 'ArrayExpression';\nAST.Property = 'Property';\nAST.ObjectExpression = 'ObjectExpression';\nAST.ThisExpression = 'ThisExpression';\nAST.LocalsExpression = 'LocalsExpression';\n\n// Internal use only\nAST.NGValueParameter = 'NGValueParameter';\n\nAST.prototype = {\n ast: function(text) {\n this.text = text;\n this.tokens = this.lexer.lex(text);\n\n var value = this.program();\n\n if (this.tokens.length !== 0) {\n this.throwError('is an unexpected token', this.tokens[0]);\n }\n\n return value;\n },\n\n program: function() {\n var body = [];\n while (true) {\n if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))\n body.push(this.expressionStatement());\n if (!this.expect(';')) {\n return { type: AST.Program, body: body};\n }\n }\n },\n\n expressionStatement: function() {\n return { type: AST.ExpressionStatement, expression: this.filterChain() };\n },\n\n filterChain: function() {\n var left = this.expression();\n var token;\n while ((token = this.expect('|'))) {\n left = this.filter(left);\n }\n return left;\n },\n\n expression: function() {\n return this.assignment();\n },\n\n assignment: function() {\n var result = this.ternary();\n if (this.expect('=')) {\n result = { type: AST.AssignmentExpression, left: result, right: this.assignment(), operator: '='};\n }\n return result;\n },\n\n ternary: function() {\n var test = this.logicalOR();\n var alternate;\n var consequent;\n if (this.expect('?')) {\n alternate = this.expression();\n if (this.consume(':')) {\n consequent = this.expression();\n return { type: AST.ConditionalExpression, test: test, alternate: alternate, consequent: consequent};\n }\n }\n return test;\n },\n\n logicalOR: function() {\n var left = this.logicalAND();\n while (this.expect('||')) {\n left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() };\n }\n return left;\n },\n\n logicalAND: function() {\n var left = this.equality();\n while (this.expect('&&')) {\n left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()};\n }\n return left;\n },\n\n equality: function() {\n var left = this.relational();\n var token;\n while ((token = this.expect('==','!=','===','!=='))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() };\n }\n return left;\n },\n\n relational: function() {\n var left = this.additive();\n var token;\n while ((token = this.expect('<', '>', '<=', '>='))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() };\n }\n return left;\n },\n\n additive: function() {\n var left = this.multiplicative();\n var token;\n while ((token = this.expect('+','-'))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.multiplicative() };\n }\n return left;\n },\n\n multiplicative: function() {\n var left = this.unary();\n var token;\n while ((token = this.expect('*','/','%'))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.unary() };\n }\n return left;\n },\n\n unary: function() {\n var token;\n if ((token = this.expect('+', '-', '!'))) {\n return { type: AST.UnaryExpression, operator: token.text, prefix: true, argument: this.unary() };\n } else {\n return this.primary();\n }\n },\n\n primary: function() {\n var primary;\n if (this.expect('(')) {\n primary = this.filterChain();\n this.consume(')');\n } else if (this.expect('[')) {\n primary = this.arrayDeclaration();\n } else if (this.expect('{')) {\n primary = this.object();\n } else if (this.selfReferential.hasOwnProperty(this.peek().text)) {\n primary = copy(this.selfReferential[this.consume().text]);\n } else if (this.options.literals.hasOwnProperty(this.peek().text)) {\n primary = { type: AST.Literal, value: this.options.literals[this.consume().text]};\n } else if (this.peek().identifier) {\n primary = this.identifier();\n } else if (this.peek().constant) {\n primary = this.constant();\n } else {\n this.throwError('not a primary expression', this.peek());\n }\n\n var next;\n while ((next = this.expect('(', '[', '.'))) {\n if (next.text === '(') {\n primary = {type: AST.CallExpression, callee: primary, arguments: this.parseArguments() };\n this.consume(')');\n } else if (next.text === '[') {\n primary = { type: AST.MemberExpression, object: primary, property: this.expression(), computed: true };\n this.consume(']');\n } else if (next.text === '.') {\n primary = { type: AST.MemberExpression, object: primary, property: this.identifier(), computed: false };\n } else {\n this.throwError('IMPOSSIBLE');\n }\n }\n return primary;\n },\n\n filter: function(baseExpression) {\n var args = [baseExpression];\n var result = {type: AST.CallExpression, callee: this.identifier(), arguments: args, filter: true};\n\n while (this.expect(':')) {\n args.push(this.expression());\n }\n\n return result;\n },\n\n parseArguments: function() {\n var args = [];\n if (this.peekToken().text !== ')') {\n do {\n args.push(this.filterChain());\n } while (this.expect(','));\n }\n return args;\n },\n\n identifier: function() {\n var token = this.consume();\n if (!token.identifier) {\n this.throwError('is not a valid identifier', token);\n }\n return { type: AST.Identifier, name: token.text };\n },\n\n constant: function() {\n // TODO check that it is a constant\n return { type: AST.Literal, value: this.consume().value };\n },\n\n arrayDeclaration: function() {\n var elements = [];\n if (this.peekToken().text !== ']') {\n do {\n if (this.peek(']')) {\n // Support trailing commas per ES5.1.\n break;\n }\n elements.push(this.expression());\n } while (this.expect(','));\n }\n this.consume(']');\n\n return { type: AST.ArrayExpression, elements: elements };\n },\n\n object: function() {\n var properties = [], property;\n if (this.peekToken().text !== '}') {\n do {\n if (this.peek('}')) {\n // Support trailing commas per ES5.1.\n break;\n }\n property = {type: AST.Property, kind: 'init'};\n if (this.peek().constant) {\n property.key = this.constant();\n property.computed = false;\n this.consume(':');\n property.value = this.expression();\n } else if (this.peek().identifier) {\n property.key = this.identifier();\n property.computed = false;\n if (this.peek(':')) {\n this.consume(':');\n property.value = this.expression();\n } else {\n property.value = property.key;\n }\n } else if (this.peek('[')) {\n this.consume('[');\n property.key = this.expression();\n this.consume(']');\n property.computed = true;\n this.consume(':');\n property.value = this.expression();\n } else {\n this.throwError(\"invalid key\", this.peek());\n }\n properties.push(property);\n } while (this.expect(','));\n }\n this.consume('}');\n\n return {type: AST.ObjectExpression, properties: properties };\n },\n\n throwError: function(msg, token) {\n throw $parseMinErr('syntax',\n 'Syntax Error: Token \\'{0}\\' {1} at column {2} of the expression [{3}] starting at [{4}].',\n token.text, msg, (token.index + 1), this.text, this.text.substring(token.index));\n },\n\n consume: function(e1) {\n if (this.tokens.length === 0) {\n throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n }\n\n var token = this.expect(e1);\n if (!token) {\n this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());\n }\n return token;\n },\n\n peekToken: function() {\n if (this.tokens.length === 0) {\n throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n }\n return this.tokens[0];\n },\n\n peek: function(e1, e2, e3, e4) {\n return this.peekAhead(0, e1, e2, e3, e4);\n },\n\n peekAhead: function(i, e1, e2, e3, e4) {\n if (this.tokens.length > i) {\n var token = this.tokens[i];\n var t = token.text;\n if (t === e1 || t === e2 || t === e3 || t === e4 ||\n (!e1 && !e2 && !e3 && !e4)) {\n return token;\n }\n }\n return false;\n },\n\n expect: function(e1, e2, e3, e4) {\n var token = this.peek(e1, e2, e3, e4);\n if (token) {\n this.tokens.shift();\n return token;\n }\n return false;\n },\n\n selfReferential: {\n 'this': {type: AST.ThisExpression },\n '$locals': {type: AST.LocalsExpression }\n }\n};\n\nfunction ifDefined(v, d) {\n return typeof v !== 'undefined' ? v : d;\n}\n\nfunction plusFn(l, r) {\n if (typeof l === 'undefined') return r;\n if (typeof r === 'undefined') return l;\n return l + r;\n}\n\nfunction isStateless($filter, filterName) {\n var fn = $filter(filterName);\n return !fn.$stateful;\n}\n\nfunction findConstantAndWatchExpressions(ast, $filter) {\n var allConstants;\n var argsToWatch;\n switch (ast.type) {\n case AST.Program:\n allConstants = true;\n forEach(ast.body, function(expr) {\n findConstantAndWatchExpressions(expr.expression, $filter);\n allConstants = allConstants && expr.expression.constant;\n });\n ast.constant = allConstants;\n break;\n case AST.Literal:\n ast.constant = true;\n ast.toWatch = [];\n break;\n case AST.UnaryExpression:\n findConstantAndWatchExpressions(ast.argument, $filter);\n ast.constant = ast.argument.constant;\n ast.toWatch = ast.argument.toWatch;\n break;\n case AST.BinaryExpression:\n findConstantAndWatchExpressions(ast.left, $filter);\n findConstantAndWatchExpressions(ast.right, $filter);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch);\n break;\n case AST.LogicalExpression:\n findConstantAndWatchExpressions(ast.left, $filter);\n findConstantAndWatchExpressions(ast.right, $filter);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.ConditionalExpression:\n findConstantAndWatchExpressions(ast.test, $filter);\n findConstantAndWatchExpressions(ast.alternate, $filter);\n findConstantAndWatchExpressions(ast.consequent, $filter);\n ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant;\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.Identifier:\n ast.constant = false;\n ast.toWatch = [ast];\n break;\n case AST.MemberExpression:\n findConstantAndWatchExpressions(ast.object, $filter);\n if (ast.computed) {\n findConstantAndWatchExpressions(ast.property, $filter);\n }\n ast.constant = ast.object.constant && (!ast.computed || ast.property.constant);\n ast.toWatch = [ast];\n break;\n case AST.CallExpression:\n allConstants = ast.filter ? isStateless($filter, ast.callee.name) : false;\n argsToWatch = [];\n forEach(ast.arguments, function(expr) {\n findConstantAndWatchExpressions(expr, $filter);\n allConstants = allConstants && expr.constant;\n if (!expr.constant) {\n argsToWatch.push.apply(argsToWatch, expr.toWatch);\n }\n });\n ast.constant = allConstants;\n ast.toWatch = ast.filter && isStateless($filter, ast.callee.name) ? argsToWatch : [ast];\n break;\n case AST.AssignmentExpression:\n findConstantAndWatchExpressions(ast.left, $filter);\n findConstantAndWatchExpressions(ast.right, $filter);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = [ast];\n break;\n case AST.ArrayExpression:\n allConstants = true;\n argsToWatch = [];\n forEach(ast.elements, function(expr) {\n findConstantAndWatchExpressions(expr, $filter);\n allConstants = allConstants && expr.constant;\n if (!expr.constant) {\n argsToWatch.push.apply(argsToWatch, expr.toWatch);\n }\n });\n ast.constant = allConstants;\n ast.toWatch = argsToWatch;\n break;\n case AST.ObjectExpression:\n allConstants = true;\n argsToWatch = [];\n forEach(ast.properties, function(property) {\n findConstantAndWatchExpressions(property.value, $filter);\n allConstants = allConstants && property.value.constant && !property.computed;\n if (!property.value.constant) {\n argsToWatch.push.apply(argsToWatch, property.value.toWatch);\n }\n });\n ast.constant = allConstants;\n ast.toWatch = argsToWatch;\n break;\n case AST.ThisExpression:\n ast.constant = false;\n ast.toWatch = [];\n break;\n case AST.LocalsExpression:\n ast.constant = false;\n ast.toWatch = [];\n break;\n }\n}\n\nfunction getInputs(body) {\n if (body.length != 1) return;\n var lastExpression = body[0].expression;\n var candidate = lastExpression.toWatch;\n if (candidate.length !== 1) return candidate;\n return candidate[0] !== lastExpression ? candidate : undefined;\n}\n\nfunction isAssignable(ast) {\n return ast.type === AST.Identifier || ast.type === AST.MemberExpression;\n}\n\nfunction assignableAST(ast) {\n if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) {\n return {type: AST.AssignmentExpression, left: ast.body[0].expression, right: {type: AST.NGValueParameter}, operator: '='};\n }\n}\n\nfunction isLiteral(ast) {\n return ast.body.length === 0 ||\n ast.body.length === 1 && (\n ast.body[0].expression.type === AST.Literal ||\n ast.body[0].expression.type === AST.ArrayExpression ||\n ast.body[0].expression.type === AST.ObjectExpression);\n}\n\nfunction isConstant(ast) {\n return ast.constant;\n}\n\nfunction ASTCompiler(astBuilder, $filter) {\n this.astBuilder = astBuilder;\n this.$filter = $filter;\n}\n\nASTCompiler.prototype = {\n compile: function(expression, expensiveChecks) {\n var self = this;\n var ast = this.astBuilder.ast(expression);\n this.state = {\n nextId: 0,\n filters: {},\n expensiveChecks: expensiveChecks,\n fn: {vars: [], body: [], own: {}},\n assign: {vars: [], body: [], own: {}},\n inputs: []\n };\n findConstantAndWatchExpressions(ast, self.$filter);\n var extra = '';\n var assignable;\n this.stage = 'assign';\n if ((assignable = assignableAST(ast))) {\n this.state.computing = 'assign';\n var result = this.nextId();\n this.recurse(assignable, result);\n this.return_(result);\n extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l');\n }\n var toWatch = getInputs(ast.body);\n self.stage = 'inputs';\n forEach(toWatch, function(watch, key) {\n var fnKey = 'fn' + key;\n self.state[fnKey] = {vars: [], body: [], own: {}};\n self.state.computing = fnKey;\n var intoId = self.nextId();\n self.recurse(watch, intoId);\n self.return_(intoId);\n self.state.inputs.push(fnKey);\n watch.watchId = key;\n });\n this.state.computing = 'fn';\n this.stage = 'main';\n this.recurse(ast);\n var fnString =\n // The build and minification steps remove the string \"use strict\" from the code, but this is done using a regex.\n // This is a workaround for this until we do a better job at only removing the prefix only when we should.\n '\"' + this.USE + ' ' + this.STRICT + '\";\\n' +\n this.filterPrefix() +\n 'var fn=' + this.generateFunction('fn', 's,l,a,i') +\n extra +\n this.watchFns() +\n 'return fn;';\n\n /* jshint -W054 */\n var fn = (new Function('$filter',\n 'ensureSafeMemberName',\n 'ensureSafeObject',\n 'ensureSafeFunction',\n 'getStringValue',\n 'ensureSafeAssignContext',\n 'ifDefined',\n 'plus',\n 'text',\n fnString))(\n this.$filter,\n ensureSafeMemberName,\n ensureSafeObject,\n ensureSafeFunction,\n getStringValue,\n ensureSafeAssignContext,\n ifDefined,\n plusFn,\n expression);\n /* jshint +W054 */\n this.state = this.stage = undefined;\n fn.literal = isLiteral(ast);\n fn.constant = isConstant(ast);\n return fn;\n },\n\n USE: 'use',\n\n STRICT: 'strict',\n\n watchFns: function() {\n var result = [];\n var fns = this.state.inputs;\n var self = this;\n forEach(fns, function(name) {\n result.push('var ' + name + '=' + self.generateFunction(name, 's'));\n });\n if (fns.length) {\n result.push('fn.inputs=[' + fns.join(',') + '];');\n }\n return result.join('');\n },\n\n generateFunction: function(name, params) {\n return 'function(' + params + '){' +\n this.varsPrefix(name) +\n this.body(name) +\n '};';\n },\n\n filterPrefix: function() {\n var parts = [];\n var self = this;\n forEach(this.state.filters, function(id, filter) {\n parts.push(id + '=$filter(' + self.escape(filter) + ')');\n });\n if (parts.length) return 'var ' + parts.join(',') + ';';\n return '';\n },\n\n varsPrefix: function(section) {\n return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : '';\n },\n\n body: function(section) {\n return this.state[section].body.join('');\n },\n\n recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {\n var left, right, self = this, args, expression, computed;\n recursionFn = recursionFn || noop;\n if (!skipWatchIdCheck && isDefined(ast.watchId)) {\n intoId = intoId || this.nextId();\n this.if_('i',\n this.lazyAssign(intoId, this.computedMember('i', ast.watchId)),\n this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true)\n );\n return;\n }\n switch (ast.type) {\n case AST.Program:\n forEach(ast.body, function(expression, pos) {\n self.recurse(expression.expression, undefined, undefined, function(expr) { right = expr; });\n if (pos !== ast.body.length - 1) {\n self.current().body.push(right, ';');\n } else {\n self.return_(right);\n }\n });\n break;\n case AST.Literal:\n expression = this.escape(ast.value);\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.UnaryExpression:\n this.recurse(ast.argument, undefined, undefined, function(expr) { right = expr; });\n expression = ast.operator + '(' + this.ifDefined(right, 0) + ')';\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.BinaryExpression:\n this.recurse(ast.left, undefined, undefined, function(expr) { left = expr; });\n this.recurse(ast.right, undefined, undefined, function(expr) { right = expr; });\n if (ast.operator === '+') {\n expression = this.plus(left, right);\n } else if (ast.operator === '-') {\n expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0);\n } else {\n expression = '(' + left + ')' + ast.operator + '(' + right + ')';\n }\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.LogicalExpression:\n intoId = intoId || this.nextId();\n self.recurse(ast.left, intoId);\n self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId));\n recursionFn(intoId);\n break;\n case AST.ConditionalExpression:\n intoId = intoId || this.nextId();\n self.recurse(ast.test, intoId);\n self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId));\n recursionFn(intoId);\n break;\n case AST.Identifier:\n intoId = intoId || this.nextId();\n if (nameId) {\n nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s');\n nameId.computed = false;\n nameId.name = ast.name;\n }\n ensureSafeMemberName(ast.name);\n self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)),\n function() {\n self.if_(self.stage === 'inputs' || 's', function() {\n if (create && create !== 1) {\n self.if_(\n self.not(self.nonComputedMember('s', ast.name)),\n self.lazyAssign(self.nonComputedMember('s', ast.name), '{}'));\n }\n self.assign(intoId, self.nonComputedMember('s', ast.name));\n });\n }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name))\n );\n if (self.state.expensiveChecks || isPossiblyDangerousMemberName(ast.name)) {\n self.addEnsureSafeObject(intoId);\n }\n recursionFn(intoId);\n break;\n case AST.MemberExpression:\n left = nameId && (nameId.context = this.nextId()) || this.nextId();\n intoId = intoId || this.nextId();\n self.recurse(ast.object, left, undefined, function() {\n self.if_(self.notNull(left), function() {\n if (create && create !== 1) {\n self.addEnsureSafeAssignContext(left);\n }\n if (ast.computed) {\n right = self.nextId();\n self.recurse(ast.property, right);\n self.getStringValue(right);\n self.addEnsureSafeMemberName(right);\n if (create && create !== 1) {\n self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}'));\n }\n expression = self.ensureSafeObject(self.computedMember(left, right));\n self.assign(intoId, expression);\n if (nameId) {\n nameId.computed = true;\n nameId.name = right;\n }\n } else {\n ensureSafeMemberName(ast.property.name);\n if (create && create !== 1) {\n self.if_(self.not(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}'));\n }\n expression = self.nonComputedMember(left, ast.property.name);\n if (self.state.expensiveChecks || isPossiblyDangerousMemberName(ast.property.name)) {\n expression = self.ensureSafeObject(expression);\n }\n self.assign(intoId, expression);\n if (nameId) {\n nameId.computed = false;\n nameId.name = ast.property.name;\n }\n }\n }, function() {\n self.assign(intoId, 'undefined');\n });\n recursionFn(intoId);\n }, !!create);\n break;\n case AST.CallExpression:\n intoId = intoId || this.nextId();\n if (ast.filter) {\n right = self.filter(ast.callee.name);\n args = [];\n forEach(ast.arguments, function(expr) {\n var argument = self.nextId();\n self.recurse(expr, argument);\n args.push(argument);\n });\n expression = right + '(' + args.join(',') + ')';\n self.assign(intoId, expression);\n recursionFn(intoId);\n } else {\n right = self.nextId();\n left = {};\n args = [];\n self.recurse(ast.callee, right, left, function() {\n self.if_(self.notNull(right), function() {\n self.addEnsureSafeFunction(right);\n forEach(ast.arguments, function(expr) {\n self.recurse(expr, self.nextId(), undefined, function(argument) {\n args.push(self.ensureSafeObject(argument));\n });\n });\n if (left.name) {\n if (!self.state.expensiveChecks) {\n self.addEnsureSafeObject(left.context);\n }\n expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')';\n } else {\n expression = right + '(' + args.join(',') + ')';\n }\n expression = self.ensureSafeObject(expression);\n self.assign(intoId, expression);\n }, function() {\n self.assign(intoId, 'undefined');\n });\n recursionFn(intoId);\n });\n }\n break;\n case AST.AssignmentExpression:\n right = this.nextId();\n left = {};\n if (!isAssignable(ast.left)) {\n throw $parseMinErr('lval', 'Trying to assign a value to a non l-value');\n }\n this.recurse(ast.left, undefined, left, function() {\n self.if_(self.notNull(left.context), function() {\n self.recurse(ast.right, right);\n self.addEnsureSafeObject(self.member(left.context, left.name, left.computed));\n self.addEnsureSafeAssignContext(left.context);\n expression = self.member(left.context, left.name, left.computed) + ast.operator + right;\n self.assign(intoId, expression);\n recursionFn(intoId || expression);\n });\n }, 1);\n break;\n case AST.ArrayExpression:\n args = [];\n forEach(ast.elements, function(expr) {\n self.recurse(expr, self.nextId(), undefined, function(argument) {\n args.push(argument);\n });\n });\n expression = '[' + args.join(',') + ']';\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.ObjectExpression:\n args = [];\n computed = false;\n forEach(ast.properties, function(property) {\n if (property.computed) {\n computed = true;\n }\n });\n if (computed) {\n intoId = intoId || this.nextId();\n this.assign(intoId, '{}');\n forEach(ast.properties, function(property) {\n if (property.computed) {\n left = self.nextId();\n self.recurse(property.key, left);\n } else {\n left = property.key.type === AST.Identifier ?\n property.key.name :\n ('' + property.key.value);\n }\n right = self.nextId();\n self.recurse(property.value, right);\n self.assign(self.member(intoId, left, property.computed), right);\n });\n } else {\n forEach(ast.properties, function(property) {\n self.recurse(property.value, ast.constant ? undefined : self.nextId(), undefined, function(expr) {\n args.push(self.escape(\n property.key.type === AST.Identifier ? property.key.name :\n ('' + property.key.value)) +\n ':' + expr);\n });\n });\n expression = '{' + args.join(',') + '}';\n this.assign(intoId, expression);\n }\n recursionFn(intoId || expression);\n break;\n case AST.ThisExpression:\n this.assign(intoId, 's');\n recursionFn('s');\n break;\n case AST.LocalsExpression:\n this.assign(intoId, 'l');\n recursionFn('l');\n break;\n case AST.NGValueParameter:\n this.assign(intoId, 'v');\n recursionFn('v');\n break;\n }\n },\n\n getHasOwnProperty: function(element, property) {\n var key = element + '.' + property;\n var own = this.current().own;\n if (!own.hasOwnProperty(key)) {\n own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')');\n }\n return own[key];\n },\n\n assign: function(id, value) {\n if (!id) return;\n this.current().body.push(id, '=', value, ';');\n return id;\n },\n\n filter: function(filterName) {\n if (!this.state.filters.hasOwnProperty(filterName)) {\n this.state.filters[filterName] = this.nextId(true);\n }\n return this.state.filters[filterName];\n },\n\n ifDefined: function(id, defaultValue) {\n return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')';\n },\n\n plus: function(left, right) {\n return 'plus(' + left + ',' + right + ')';\n },\n\n return_: function(id) {\n this.current().body.push('return ', id, ';');\n },\n\n if_: function(test, alternate, consequent) {\n if (test === true) {\n alternate();\n } else {\n var body = this.current().body;\n body.push('if(', test, '){');\n alternate();\n body.push('}');\n if (consequent) {\n body.push('else{');\n consequent();\n body.push('}');\n }\n }\n },\n\n not: function(expression) {\n return '!(' + expression + ')';\n },\n\n notNull: function(expression) {\n return expression + '!=null';\n },\n\n nonComputedMember: function(left, right) {\n var SAFE_IDENTIFIER = /[$_a-zA-Z][$_a-zA-Z0-9]*/;\n var UNSAFE_CHARACTERS = /[^$_a-zA-Z0-9]/g;\n if (SAFE_IDENTIFIER.test(right)) {\n return left + '.' + right;\n } else {\n return left + '[\"' + right.replace(UNSAFE_CHARACTERS, this.stringEscapeFn) + '\"]';\n }\n },\n\n computedMember: function(left, right) {\n return left + '[' + right + ']';\n },\n\n member: function(left, right, computed) {\n if (computed) return this.computedMember(left, right);\n return this.nonComputedMember(left, right);\n },\n\n addEnsureSafeObject: function(item) {\n this.current().body.push(this.ensureSafeObject(item), ';');\n },\n\n addEnsureSafeMemberName: function(item) {\n this.current().body.push(this.ensureSafeMemberName(item), ';');\n },\n\n addEnsureSafeFunction: function(item) {\n this.current().body.push(this.ensureSafeFunction(item), ';');\n },\n\n addEnsureSafeAssignContext: function(item) {\n this.current().body.push(this.ensureSafeAssignContext(item), ';');\n },\n\n ensureSafeObject: function(item) {\n return 'ensureSafeObject(' + item + ',text)';\n },\n\n ensureSafeMemberName: function(item) {\n return 'ensureSafeMemberName(' + item + ',text)';\n },\n\n ensureSafeFunction: function(item) {\n return 'ensureSafeFunction(' + item + ',text)';\n },\n\n getStringValue: function(item) {\n this.assign(item, 'getStringValue(' + item + ')');\n },\n\n ensureSafeAssignContext: function(item) {\n return 'ensureSafeAssignContext(' + item + ',text)';\n },\n\n lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {\n var self = this;\n return function() {\n self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck);\n };\n },\n\n lazyAssign: function(id, value) {\n var self = this;\n return function() {\n self.assign(id, value);\n };\n },\n\n stringEscapeRegex: /[^ a-zA-Z0-9]/g,\n\n stringEscapeFn: function(c) {\n return '\\\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4);\n },\n\n escape: function(value) {\n if (isString(value)) return \"'\" + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + \"'\";\n if (isNumber(value)) return value.toString();\n if (value === true) return 'true';\n if (value === false) return 'false';\n if (value === null) return 'null';\n if (typeof value === 'undefined') return 'undefined';\n\n throw $parseMinErr('esc', 'IMPOSSIBLE');\n },\n\n nextId: function(skip, init) {\n var id = 'v' + (this.state.nextId++);\n if (!skip) {\n this.current().vars.push(id + (init ? '=' + init : ''));\n }\n return id;\n },\n\n current: function() {\n return this.state[this.state.computing];\n }\n};\n\n\nfunction ASTInterpreter(astBuilder, $filter) {\n this.astBuilder = astBuilder;\n this.$filter = $filter;\n}\n\nASTInterpreter.prototype = {\n compile: function(expression, expensiveChecks) {\n var self = this;\n var ast = this.astBuilder.ast(expression);\n this.expression = expression;\n this.expensiveChecks = expensiveChecks;\n findConstantAndWatchExpressions(ast, self.$filter);\n var assignable;\n var assign;\n if ((assignable = assignableAST(ast))) {\n assign = this.recurse(assignable);\n }\n var toWatch = getInputs(ast.body);\n var inputs;\n if (toWatch) {\n inputs = [];\n forEach(toWatch, function(watch, key) {\n var input = self.recurse(watch);\n watch.input = input;\n inputs.push(input);\n watch.watchId = key;\n });\n }\n var expressions = [];\n forEach(ast.body, function(expression) {\n expressions.push(self.recurse(expression.expression));\n });\n var fn = ast.body.length === 0 ? noop :\n ast.body.length === 1 ? expressions[0] :\n function(scope, locals) {\n var lastValue;\n forEach(expressions, function(exp) {\n lastValue = exp(scope, locals);\n });\n return lastValue;\n };\n if (assign) {\n fn.assign = function(scope, value, locals) {\n return assign(scope, locals, value);\n };\n }\n if (inputs) {\n fn.inputs = inputs;\n }\n fn.literal = isLiteral(ast);\n fn.constant = isConstant(ast);\n return fn;\n },\n\n recurse: function(ast, context, create) {\n var left, right, self = this, args, expression;\n if (ast.input) {\n return this.inputs(ast.input, ast.watchId);\n }\n switch (ast.type) {\n case AST.Literal:\n return this.value(ast.value, context);\n case AST.UnaryExpression:\n right = this.recurse(ast.argument);\n return this['unary' + ast.operator](right, context);\n case AST.BinaryExpression:\n left = this.recurse(ast.left);\n right = this.recurse(ast.right);\n return this['binary' + ast.operator](left, right, context);\n case AST.LogicalExpression:\n left = this.recurse(ast.left);\n right = this.recurse(ast.right);\n return this['binary' + ast.operator](left, right, context);\n case AST.ConditionalExpression:\n return this['ternary?:'](\n this.recurse(ast.test),\n this.recurse(ast.alternate),\n this.recurse(ast.consequent),\n context\n );\n case AST.Identifier:\n ensureSafeMemberName(ast.name, self.expression);\n return self.identifier(ast.name,\n self.expensiveChecks || isPossiblyDangerousMemberName(ast.name),\n context, create, self.expression);\n case AST.MemberExpression:\n left = this.recurse(ast.object, false, !!create);\n if (!ast.computed) {\n ensureSafeMemberName(ast.property.name, self.expression);\n right = ast.property.name;\n }\n if (ast.computed) right = this.recurse(ast.property);\n return ast.computed ?\n this.computedMember(left, right, context, create, self.expression) :\n this.nonComputedMember(left, right, self.expensiveChecks, context, create, self.expression);\n case AST.CallExpression:\n args = [];\n forEach(ast.arguments, function(expr) {\n args.push(self.recurse(expr));\n });\n if (ast.filter) right = this.$filter(ast.callee.name);\n if (!ast.filter) right = this.recurse(ast.callee, true);\n return ast.filter ?\n function(scope, locals, assign, inputs) {\n var values = [];\n for (var i = 0; i < args.length; ++i) {\n values.push(args[i](scope, locals, assign, inputs));\n }\n var value = right.apply(undefined, values, inputs);\n return context ? {context: undefined, name: undefined, value: value} : value;\n } :\n function(scope, locals, assign, inputs) {\n var rhs = right(scope, locals, assign, inputs);\n var value;\n if (rhs.value != null) {\n ensureSafeObject(rhs.context, self.expression);\n ensureSafeFunction(rhs.value, self.expression);\n var values = [];\n for (var i = 0; i < args.length; ++i) {\n values.push(ensureSafeObject(args[i](scope, locals, assign, inputs), self.expression));\n }\n value = ensureSafeObject(rhs.value.apply(rhs.context, values), self.expression);\n }\n return context ? {value: value} : value;\n };\n case AST.AssignmentExpression:\n left = this.recurse(ast.left, true, 1);\n right = this.recurse(ast.right);\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n ensureSafeObject(lhs.value, self.expression);\n ensureSafeAssignContext(lhs.context);\n lhs.context[lhs.name] = rhs;\n return context ? {value: rhs} : rhs;\n };\n case AST.ArrayExpression:\n args = [];\n forEach(ast.elements, function(expr) {\n args.push(self.recurse(expr));\n });\n return function(scope, locals, assign, inputs) {\n var value = [];\n for (var i = 0; i < args.length; ++i) {\n value.push(args[i](scope, locals, assign, inputs));\n }\n return context ? {value: value} : value;\n };\n case AST.ObjectExpression:\n args = [];\n forEach(ast.properties, function(property) {\n if (property.computed) {\n args.push({key: self.recurse(property.key),\n computed: true,\n value: self.recurse(property.value)\n });\n } else {\n args.push({key: property.key.type === AST.Identifier ?\n property.key.name :\n ('' + property.key.value),\n computed: false,\n value: self.recurse(property.value)\n });\n }\n });\n return function(scope, locals, assign, inputs) {\n var value = {};\n for (var i = 0; i < args.length; ++i) {\n if (args[i].computed) {\n value[args[i].key(scope, locals, assign, inputs)] = args[i].value(scope, locals, assign, inputs);\n } else {\n value[args[i].key] = args[i].value(scope, locals, assign, inputs);\n }\n }\n return context ? {value: value} : value;\n };\n case AST.ThisExpression:\n return function(scope) {\n return context ? {value: scope} : scope;\n };\n case AST.LocalsExpression:\n return function(scope, locals) {\n return context ? {value: locals} : locals;\n };\n case AST.NGValueParameter:\n return function(scope, locals, assign) {\n return context ? {value: assign} : assign;\n };\n }\n },\n\n 'unary+': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = argument(scope, locals, assign, inputs);\n if (isDefined(arg)) {\n arg = +arg;\n } else {\n arg = 0;\n }\n return context ? {value: arg} : arg;\n };\n },\n 'unary-': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = argument(scope, locals, assign, inputs);\n if (isDefined(arg)) {\n arg = -arg;\n } else {\n arg = 0;\n }\n return context ? {value: arg} : arg;\n };\n },\n 'unary!': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = !argument(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary+': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n var arg = plusFn(lhs, rhs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary-': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);\n return context ? {value: arg} : arg;\n };\n },\n 'binary*': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary/': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary%': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary===': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary!==': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary==': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary!=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary<': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary>': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary<=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary>=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary&&': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary||': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'ternary?:': function(test, alternate, consequent, context) {\n return function(scope, locals, assign, inputs) {\n var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n value: function(value, context) {\n return function() { return context ? {context: undefined, name: undefined, value: value} : value; };\n },\n identifier: function(name, expensiveChecks, context, create, expression) {\n return function(scope, locals, assign, inputs) {\n var base = locals && (name in locals) ? locals : scope;\n if (create && create !== 1 && base && !(base[name])) {\n base[name] = {};\n }\n var value = base ? base[name] : undefined;\n if (expensiveChecks) {\n ensureSafeObject(value, expression);\n }\n if (context) {\n return {context: base, name: name, value: value};\n } else {\n return value;\n }\n };\n },\n computedMember: function(left, right, context, create, expression) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs;\n var value;\n if (lhs != null) {\n rhs = right(scope, locals, assign, inputs);\n rhs = getStringValue(rhs);\n ensureSafeMemberName(rhs, expression);\n if (create && create !== 1) {\n ensureSafeAssignContext(lhs);\n if (lhs && !(lhs[rhs])) {\n lhs[rhs] = {};\n }\n }\n value = lhs[rhs];\n ensureSafeObject(value, expression);\n }\n if (context) {\n return {context: lhs, name: rhs, value: value};\n } else {\n return value;\n }\n };\n },\n nonComputedMember: function(left, right, expensiveChecks, context, create, expression) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n if (create && create !== 1) {\n ensureSafeAssignContext(lhs);\n if (lhs && !(lhs[right])) {\n lhs[right] = {};\n }\n }\n var value = lhs != null ? lhs[right] : undefined;\n if (expensiveChecks || isPossiblyDangerousMemberName(right)) {\n ensureSafeObject(value, expression);\n }\n if (context) {\n return {context: lhs, name: right, value: value};\n } else {\n return value;\n }\n };\n },\n inputs: function(input, watchId) {\n return function(scope, value, locals, inputs) {\n if (inputs) return inputs[watchId];\n return input(scope, value, locals);\n };\n }\n};\n\n/**\n * @constructor\n */\nvar Parser = function(lexer, $filter, options) {\n this.lexer = lexer;\n this.$filter = $filter;\n this.options = options;\n this.ast = new AST(lexer, options);\n this.astCompiler = options.csp ? new ASTInterpreter(this.ast, $filter) :\n new ASTCompiler(this.ast, $filter);\n};\n\nParser.prototype = {\n constructor: Parser,\n\n parse: function(text) {\n return this.astCompiler.compile(text, this.options.expensiveChecks);\n }\n};\n\nfunction isPossiblyDangerousMemberName(name) {\n return name == 'constructor';\n}\n\nvar objectValueOf = Object.prototype.valueOf;\n\nfunction getValueOf(value) {\n return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value);\n}\n\n///////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $parse\n * @kind function\n *\n * @description\n *\n * Converts Angular {@link guide/expression expression} into a function.\n *\n * ```js\n * var getter = $parse('user.name');\n * var setter = getter.assign;\n * var context = {user:{name:'angular'}};\n * var locals = {user:{name:'local'}};\n *\n * expect(getter(context)).toEqual('angular');\n * setter(context, 'newValue');\n * expect(context.user.name).toEqual('newValue');\n * expect(getter(context, locals)).toEqual('local');\n * ```\n *\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n *\n * The returned function also has the following properties:\n * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript\n * literal.\n * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript\n * constant literals.\n * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be\n * set to a function to change its value on the given context.\n *\n */\n\n\n/**\n * @ngdoc provider\n * @name $parseProvider\n *\n * @description\n * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}\n * service.\n */\nfunction $ParseProvider() {\n var cacheDefault = createMap();\n var cacheExpensive = createMap();\n var literals = {\n 'true': true,\n 'false': false,\n 'null': null,\n 'undefined': undefined\n };\n var identStart, identContinue;\n\n /**\n * @ngdoc method\n * @name $parseProvider#addLiteral\n * @description\n *\n * Configure $parse service to add literal values that will be present as literal at expressions.\n *\n * @param {string} literalName Token for the literal value. The literal name value must be a valid literal name.\n * @param {*} literalValue Value for this literal. All literal values must be primitives or `undefined`.\n *\n **/\n this.addLiteral = function(literalName, literalValue) {\n literals[literalName] = literalValue;\n };\n\n /**\n * @ngdoc method\n * @name $parseProvider#setIdentifierFns\n * @description\n *\n * Allows defining the set of characters that are allowed in Angular expressions. The function\n * `identifierStart` will get called to know if a given character is a valid character to be the\n * first character for an identifier. The function `identifierContinue` will get called to know if\n * a given character is a valid character to be a follow-up identifier character. The functions\n * `identifierStart` and `identifierContinue` will receive as arguments the single character to be\n * identifier and the character code point. These arguments will be `string` and `numeric`. Keep in\n * mind that the `string` parameter can be two characters long depending on the character\n * representation. It is expected for the function to return `true` or `false`, whether that\n * character is allowed or not.\n *\n * Since this function will be called extensivelly, keep the implementation of these functions fast,\n * as the performance of these functions have a direct impact on the expressions parsing speed.\n *\n * @param {function=} identifierStart The function that will decide whether the given character is\n * a valid identifier start character.\n * @param {function=} identifierContinue The function that will decide whether the given character is\n * a valid identifier continue character.\n */\n this.setIdentifierFns = function(identifierStart, identifierContinue) {\n identStart = identifierStart;\n identContinue = identifierContinue;\n return this;\n };\n\n this.$get = ['$filter', function($filter) {\n var noUnsafeEval = csp().noUnsafeEval;\n var $parseOptions = {\n csp: noUnsafeEval,\n expensiveChecks: false,\n literals: copy(literals),\n isIdentifierStart: isFunction(identStart) && identStart,\n isIdentifierContinue: isFunction(identContinue) && identContinue\n },\n $parseOptionsExpensive = {\n csp: noUnsafeEval,\n expensiveChecks: true,\n literals: copy(literals),\n isIdentifierStart: isFunction(identStart) && identStart,\n isIdentifierContinue: isFunction(identContinue) && identContinue\n };\n var runningChecksEnabled = false;\n\n $parse.$$runningExpensiveChecks = function() {\n return runningChecksEnabled;\n };\n\n return $parse;\n\n function $parse(exp, interceptorFn, expensiveChecks) {\n var parsedExpression, oneTime, cacheKey;\n\n expensiveChecks = expensiveChecks || runningChecksEnabled;\n\n switch (typeof exp) {\n case 'string':\n exp = exp.trim();\n cacheKey = exp;\n\n var cache = (expensiveChecks ? cacheExpensive : cacheDefault);\n parsedExpression = cache[cacheKey];\n\n if (!parsedExpression) {\n if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {\n oneTime = true;\n exp = exp.substring(2);\n }\n var parseOptions = expensiveChecks ? $parseOptionsExpensive : $parseOptions;\n var lexer = new Lexer(parseOptions);\n var parser = new Parser(lexer, $filter, parseOptions);\n parsedExpression = parser.parse(exp);\n if (parsedExpression.constant) {\n parsedExpression.$$watchDelegate = constantWatchDelegate;\n } else if (oneTime) {\n parsedExpression.$$watchDelegate = parsedExpression.literal ?\n oneTimeLiteralWatchDelegate : oneTimeWatchDelegate;\n } else if (parsedExpression.inputs) {\n parsedExpression.$$watchDelegate = inputsWatchDelegate;\n }\n if (expensiveChecks) {\n parsedExpression = expensiveChecksInterceptor(parsedExpression);\n }\n cache[cacheKey] = parsedExpression;\n }\n return addInterceptor(parsedExpression, interceptorFn);\n\n case 'function':\n return addInterceptor(exp, interceptorFn);\n\n default:\n return addInterceptor(noop, interceptorFn);\n }\n }\n\n function expensiveChecksInterceptor(fn) {\n if (!fn) return fn;\n expensiveCheckFn.$$watchDelegate = fn.$$watchDelegate;\n expensiveCheckFn.assign = expensiveChecksInterceptor(fn.assign);\n expensiveCheckFn.constant = fn.constant;\n expensiveCheckFn.literal = fn.literal;\n for (var i = 0; fn.inputs && i < fn.inputs.length; ++i) {\n fn.inputs[i] = expensiveChecksInterceptor(fn.inputs[i]);\n }\n expensiveCheckFn.inputs = fn.inputs;\n\n return expensiveCheckFn;\n\n function expensiveCheckFn(scope, locals, assign, inputs) {\n var expensiveCheckOldValue = runningChecksEnabled;\n runningChecksEnabled = true;\n try {\n return fn(scope, locals, assign, inputs);\n } finally {\n runningChecksEnabled = expensiveCheckOldValue;\n }\n }\n }\n\n function expressionInputDirtyCheck(newValue, oldValueOfValue) {\n\n if (newValue == null || oldValueOfValue == null) { // null/undefined\n return newValue === oldValueOfValue;\n }\n\n if (typeof newValue === 'object') {\n\n // attempt to convert the value to a primitive type\n // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can\n // be cheaply dirty-checked\n newValue = getValueOf(newValue);\n\n if (typeof newValue === 'object') {\n // objects/arrays are not supported - deep-watching them would be too expensive\n return false;\n }\n\n // fall-through to the primitive equality check\n }\n\n //Primitive or NaN\n return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue);\n }\n\n function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {\n var inputExpressions = parsedExpression.inputs;\n var lastResult;\n\n if (inputExpressions.length === 1) {\n var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails\n inputExpressions = inputExpressions[0];\n return scope.$watch(function expressionInputWatch(scope) {\n var newInputValue = inputExpressions(scope);\n if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf)) {\n lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]);\n oldInputValueOf = newInputValue && getValueOf(newInputValue);\n }\n return lastResult;\n }, listener, objectEquality, prettyPrintExpression);\n }\n\n var oldInputValueOfValues = [];\n var oldInputValues = [];\n for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails\n oldInputValues[i] = null;\n }\n\n return scope.$watch(function expressionInputsWatch(scope) {\n var changed = false;\n\n for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n var newInputValue = inputExpressions[i](scope);\n if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) {\n oldInputValues[i] = newInputValue;\n oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);\n }\n }\n\n if (changed) {\n lastResult = parsedExpression(scope, undefined, undefined, oldInputValues);\n }\n\n return lastResult;\n }, listener, objectEquality, prettyPrintExpression);\n }\n\n function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n var unwatch, lastValue;\n return unwatch = scope.$watch(function oneTimeWatch(scope) {\n return parsedExpression(scope);\n }, function oneTimeListener(value, old, scope) {\n lastValue = value;\n if (isFunction(listener)) {\n listener.apply(this, arguments);\n }\n if (isDefined(value)) {\n scope.$$postDigest(function() {\n if (isDefined(lastValue)) {\n unwatch();\n }\n });\n }\n }, objectEquality);\n }\n\n function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n var unwatch, lastValue;\n return unwatch = scope.$watch(function oneTimeWatch(scope) {\n return parsedExpression(scope);\n }, function oneTimeListener(value, old, scope) {\n lastValue = value;\n if (isFunction(listener)) {\n listener.call(this, value, old, scope);\n }\n if (isAllDefined(value)) {\n scope.$$postDigest(function() {\n if (isAllDefined(lastValue)) unwatch();\n });\n }\n }, objectEquality);\n\n function isAllDefined(value) {\n var allDefined = true;\n forEach(value, function(val) {\n if (!isDefined(val)) allDefined = false;\n });\n return allDefined;\n }\n }\n\n function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n var unwatch;\n return unwatch = scope.$watch(function constantWatch(scope) {\n unwatch();\n return parsedExpression(scope);\n }, listener, objectEquality);\n }\n\n function addInterceptor(parsedExpression, interceptorFn) {\n if (!interceptorFn) return parsedExpression;\n var watchDelegate = parsedExpression.$$watchDelegate;\n var useInputs = false;\n\n var regularWatch =\n watchDelegate !== oneTimeLiteralWatchDelegate &&\n watchDelegate !== oneTimeWatchDelegate;\n\n var fn = regularWatch ? function regularInterceptedExpression(scope, locals, assign, inputs) {\n var value = useInputs && inputs ? inputs[0] : parsedExpression(scope, locals, assign, inputs);\n return interceptorFn(value, scope, locals);\n } : function oneTimeInterceptedExpression(scope, locals, assign, inputs) {\n var value = parsedExpression(scope, locals, assign, inputs);\n var result = interceptorFn(value, scope, locals);\n // we only return the interceptor's result if the\n // initial value is defined (for bind-once)\n return isDefined(value) ? result : value;\n };\n\n // Propagate $$watchDelegates other then inputsWatchDelegate\n if (parsedExpression.$$watchDelegate &&\n parsedExpression.$$watchDelegate !== inputsWatchDelegate) {\n fn.$$watchDelegate = parsedExpression.$$watchDelegate;\n } else if (!interceptorFn.$stateful) {\n // If there is an interceptor, but no watchDelegate then treat the interceptor like\n // we treat filters - it is assumed to be a pure function unless flagged with $stateful\n fn.$$watchDelegate = inputsWatchDelegate;\n useInputs = !parsedExpression.inputs;\n fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression];\n }\n\n return fn;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $q\n * @requires $rootScope\n *\n * @description\n * A service that helps you run functions asynchronously, and use their return values (or exceptions)\n * when they are done processing.\n *\n * This is an implementation of promises/deferred objects inspired by\n * [Kris Kowal's Q](https://github.com/kriskowal/q).\n *\n * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred\n * implementations, and the other which resembles ES6 (ES2015) promises to some degree.\n *\n * # $q constructor\n *\n * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver`\n * function as the first argument. This is similar to the native Promise implementation from ES6,\n * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n *\n * While the constructor-style use is supported, not all of the supporting methods from ES6 promises are\n * available yet.\n *\n * It can be used like so:\n *\n * ```js\n * // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n * // are available in the current lexical scope (they could have been injected or passed in).\n *\n * function asyncGreet(name) {\n * // perform some asynchronous operation, resolve or reject the promise when appropriate.\n * return $q(function(resolve, reject) {\n * setTimeout(function() {\n * if (okToGreet(name)) {\n * resolve('Hello, ' + name + '!');\n * } else {\n * reject('Greeting ' + name + ' is not allowed.');\n * }\n * }, 1000);\n * });\n * }\n *\n * var promise = asyncGreet('Robin Hood');\n * promise.then(function(greeting) {\n * alert('Success: ' + greeting);\n * }, function(reason) {\n * alert('Failed: ' + reason);\n * });\n * ```\n *\n * Note: progress/notify callbacks are not currently supported via the ES6-style interface.\n *\n * Note: unlike ES6 behavior, an exception thrown in the constructor function will NOT implicitly reject the promise.\n *\n * However, the more traditional CommonJS-style usage is still available, and documented below.\n *\n * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an\n * interface for interacting with an object that represents the result of an action that is\n * performed asynchronously, and may or may not be finished at any given point in time.\n *\n * From the perspective of dealing with error handling, deferred and promise APIs are to\n * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming.\n *\n * ```js\n * // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n * // are available in the current lexical scope (they could have been injected or passed in).\n *\n * function asyncGreet(name) {\n * var deferred = $q.defer();\n *\n * setTimeout(function() {\n * deferred.notify('About to greet ' + name + '.');\n *\n * if (okToGreet(name)) {\n * deferred.resolve('Hello, ' + name + '!');\n * } else {\n * deferred.reject('Greeting ' + name + ' is not allowed.');\n * }\n * }, 1000);\n *\n * return deferred.promise;\n * }\n *\n * var promise = asyncGreet('Robin Hood');\n * promise.then(function(greeting) {\n * alert('Success: ' + greeting);\n * }, function(reason) {\n * alert('Failed: ' + reason);\n * }, function(update) {\n * alert('Got notification: ' + update);\n * });\n * ```\n *\n * At first it might not be obvious why this extra complexity is worth the trouble. The payoff\n * comes in the way of guarantees that promise and deferred APIs make, see\n * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.\n *\n * Additionally the promise api allows for composition that is very hard to do with the\n * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.\n * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the\n * section on serial or parallel joining of promises.\n *\n * # The Deferred API\n *\n * A new instance of deferred is constructed by calling `$q.defer()`.\n *\n * The purpose of the deferred object is to expose the associated Promise instance as well as APIs\n * that can be used for signaling the successful or unsuccessful completion, as well as the status\n * of the task.\n *\n * **Methods**\n *\n * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection\n * constructed via `$q.reject`, the promise will be rejected instead.\n * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to\n * resolving it with a rejection constructed via `$q.reject`.\n * - `notify(value)` - provides updates on the status of the promise's execution. This may be called\n * multiple times before the promise is either resolved or rejected.\n *\n * **Properties**\n *\n * - promise – `{Promise}` – promise object associated with this deferred.\n *\n *\n * # The Promise API\n *\n * A new promise instance is created when a deferred instance is created and can be retrieved by\n * calling `deferred.promise`.\n *\n * The purpose of the promise object is to allow for interested parties to get access to the result\n * of the deferred task when it completes.\n *\n * **Methods**\n *\n * - `then(successCallback, [errorCallback], [notifyCallback])` – regardless of when the promise was or\n * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously\n * as soon as the result is available. The callbacks are called with a single argument: the result\n * or rejection reason. Additionally, the notify callback may be called zero or more times to\n * provide a progress indication, before the promise is resolved or rejected.\n *\n * This method *returns a new promise* which is resolved or rejected via the return value of the\n * `successCallback`, `errorCallback` (unless that value is a promise, in which case it is resolved\n * with the value which is resolved in that promise using\n * [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)).\n * It also notifies via the return value of the `notifyCallback` method. The promise cannot be\n * resolved or rejected from the notifyCallback method. The errorCallback and notifyCallback\n * arguments are optional.\n *\n * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`\n *\n * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise,\n * but to do so without modifying the final value. This is useful to release resources or do some\n * clean-up that needs to be done whether the promise was rejected or resolved. See the [full\n * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for\n * more information.\n *\n * # Chaining promises\n *\n * Because calling the `then` method of a promise returns a new derived promise, it is easily\n * possible to create a chain of promises:\n *\n * ```js\n * promiseB = promiseA.then(function(result) {\n * return result + 1;\n * });\n *\n * // promiseB will be resolved immediately after promiseA is resolved and its value\n * // will be the result of promiseA incremented by 1\n * ```\n *\n * It is possible to create chains of any length and since a promise can be resolved with another\n * promise (which will defer its resolution further), it is possible to pause/defer resolution of\n * the promises at any point in the chain. This makes it possible to implement powerful APIs like\n * $http's response interceptors.\n *\n *\n * # Differences between Kris Kowal's Q and $q\n *\n * There are two main differences:\n *\n * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation\n * mechanism in angular, which means faster propagation of resolution or rejection into your\n * models and avoiding unnecessary browser repaints, which would result in flickering UI.\n * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains\n * all the important functionality needed for common async tasks.\n *\n * # Testing\n *\n * ```js\n * it('should simulate promise', inject(function($q, $rootScope) {\n * var deferred = $q.defer();\n * var promise = deferred.promise;\n * var resolvedValue;\n *\n * promise.then(function(value) { resolvedValue = value; });\n * expect(resolvedValue).toBeUndefined();\n *\n * // Simulate resolving of promise\n * deferred.resolve(123);\n * // Note that the 'then' function does not get called synchronously.\n * // This is because we want the promise API to always be async, whether or not\n * // it got called synchronously or asynchronously.\n * expect(resolvedValue).toBeUndefined();\n *\n * // Propagate promise resolution to 'then' functions using $apply().\n * $rootScope.$apply();\n * expect(resolvedValue).toEqual(123);\n * }));\n * ```\n *\n * @param {function(function, function)} resolver Function which is responsible for resolving or\n * rejecting the newly created promise. The first parameter is a function which resolves the\n * promise, the second parameter is a function which rejects the promise.\n *\n * @returns {Promise} The newly created promise.\n */\nfunction $QProvider() {\n\n this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {\n return qFactory(function(callback) {\n $rootScope.$evalAsync(callback);\n }, $exceptionHandler);\n }];\n}\n\nfunction $$QProvider() {\n this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {\n return qFactory(function(callback) {\n $browser.defer(callback);\n }, $exceptionHandler);\n }];\n}\n\n/**\n * Constructs a promise manager.\n *\n * @param {function(function)} nextTick Function for executing functions in the next turn.\n * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for\n * debugging purposes.\n * @returns {object} Promise manager.\n */\nfunction qFactory(nextTick, exceptionHandler) {\n var $qMinErr = minErr('$q', TypeError);\n\n /**\n * @ngdoc method\n * @name ng.$q#defer\n * @kind function\n *\n * @description\n * Creates a `Deferred` object which represents a task which will finish in the future.\n *\n * @returns {Deferred} Returns a new instance of deferred.\n */\n var defer = function() {\n var d = new Deferred();\n //Necessary to support unbound execution :/\n d.resolve = simpleBind(d, d.resolve);\n d.reject = simpleBind(d, d.reject);\n d.notify = simpleBind(d, d.notify);\n return d;\n };\n\n function Promise() {\n this.$$state = { status: 0 };\n }\n\n extend(Promise.prototype, {\n then: function(onFulfilled, onRejected, progressBack) {\n if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) {\n return this;\n }\n var result = new Deferred();\n\n this.$$state.pending = this.$$state.pending || [];\n this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]);\n if (this.$$state.status > 0) scheduleProcessQueue(this.$$state);\n\n return result.promise;\n },\n\n \"catch\": function(callback) {\n return this.then(null, callback);\n },\n\n \"finally\": function(callback, progressBack) {\n return this.then(function(value) {\n return handleCallback(value, true, callback);\n }, function(error) {\n return handleCallback(error, false, callback);\n }, progressBack);\n }\n });\n\n //Faster, more basic than angular.bind http://jsperf.com/angular-bind-vs-custom-vs-native\n function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }\n\n function processQueue(state) {\n var fn, deferred, pending;\n\n pending = state.pending;\n state.processScheduled = false;\n state.pending = undefined;\n for (var i = 0, ii = pending.length; i < ii; ++i) {\n deferred = pending[i][0];\n fn = pending[i][state.status];\n try {\n if (isFunction(fn)) {\n deferred.resolve(fn(state.value));\n } else if (state.status === 1) {\n deferred.resolve(state.value);\n } else {\n deferred.reject(state.value);\n }\n } catch (e) {\n deferred.reject(e);\n exceptionHandler(e);\n }\n }\n }\n\n function scheduleProcessQueue(state) {\n if (state.processScheduled || !state.pending) return;\n state.processScheduled = true;\n nextTick(function() { processQueue(state); });\n }\n\n function Deferred() {\n this.promise = new Promise();\n }\n\n extend(Deferred.prototype, {\n resolve: function(val) {\n if (this.promise.$$state.status) return;\n if (val === this.promise) {\n this.$$reject($qMinErr(\n 'qcycle',\n \"Expected promise to be resolved with value other than itself '{0}'\",\n val));\n } else {\n this.$$resolve(val);\n }\n\n },\n\n $$resolve: function(val) {\n var then;\n var that = this;\n var done = false;\n try {\n if ((isObject(val) || isFunction(val))) then = val && val.then;\n if (isFunction(then)) {\n this.promise.$$state.status = -1;\n then.call(val, resolvePromise, rejectPromise, simpleBind(this, this.notify));\n } else {\n this.promise.$$state.value = val;\n this.promise.$$state.status = 1;\n scheduleProcessQueue(this.promise.$$state);\n }\n } catch (e) {\n rejectPromise(e);\n exceptionHandler(e);\n }\n\n function resolvePromise(val) {\n if (done) return;\n done = true;\n that.$$resolve(val);\n }\n function rejectPromise(val) {\n if (done) return;\n done = true;\n that.$$reject(val);\n }\n },\n\n reject: function(reason) {\n if (this.promise.$$state.status) return;\n this.$$reject(reason);\n },\n\n $$reject: function(reason) {\n this.promise.$$state.value = reason;\n this.promise.$$state.status = 2;\n scheduleProcessQueue(this.promise.$$state);\n },\n\n notify: function(progress) {\n var callbacks = this.promise.$$state.pending;\n\n if ((this.promise.$$state.status <= 0) && callbacks && callbacks.length) {\n nextTick(function() {\n var callback, result;\n for (var i = 0, ii = callbacks.length; i < ii; i++) {\n result = callbacks[i][0];\n callback = callbacks[i][3];\n try {\n result.notify(isFunction(callback) ? callback(progress) : progress);\n } catch (e) {\n exceptionHandler(e);\n }\n }\n });\n }\n }\n });\n\n /**\n * @ngdoc method\n * @name $q#reject\n * @kind function\n *\n * @description\n * Creates a promise that is resolved as rejected with the specified `reason`. This api should be\n * used to forward rejection in a chain of promises. If you are dealing with the last promise in\n * a promise chain, you don't need to worry about it.\n *\n * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of\n * `reject` as the `throw` keyword in JavaScript. This also means that if you \"catch\" an error via\n * a promise error callback and you want to forward the error to the promise derived from the\n * current promise, you have to \"rethrow\" the error by returning a rejection constructed via\n * `reject`.\n *\n * ```js\n * promiseB = promiseA.then(function(result) {\n * // success: do something and resolve promiseB\n * // with the old or a new result\n * return result;\n * }, function(reason) {\n * // error: handle the error if possible and\n * // resolve promiseB with newPromiseOrValue,\n * // otherwise forward the rejection to promiseB\n * if (canHandle(reason)) {\n * // handle the error and recover\n * return newPromiseOrValue;\n * }\n * return $q.reject(reason);\n * });\n * ```\n *\n * @param {*} reason Constant, message, exception or an object representing the rejection reason.\n * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.\n */\n var reject = function(reason) {\n var result = new Deferred();\n result.reject(reason);\n return result.promise;\n };\n\n var makePromise = function makePromise(value, resolved) {\n var result = new Deferred();\n if (resolved) {\n result.resolve(value);\n } else {\n result.reject(value);\n }\n return result.promise;\n };\n\n var handleCallback = function handleCallback(value, isResolved, callback) {\n var callbackOutput = null;\n try {\n if (isFunction(callback)) callbackOutput = callback();\n } catch (e) {\n return makePromise(e, false);\n }\n if (isPromiseLike(callbackOutput)) {\n return callbackOutput.then(function() {\n return makePromise(value, isResolved);\n }, function(error) {\n return makePromise(error, false);\n });\n } else {\n return makePromise(value, isResolved);\n }\n };\n\n /**\n * @ngdoc method\n * @name $q#when\n * @kind function\n *\n * @description\n * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.\n * This is useful when you are dealing with an object that might or might not be a promise, or if\n * the promise comes from a source that can't be trusted.\n *\n * @param {*} value Value or a promise\n * @param {Function=} successCallback\n * @param {Function=} errorCallback\n * @param {Function=} progressCallback\n * @returns {Promise} Returns a promise of the passed value or promise\n */\n\n\n var when = function(value, callback, errback, progressBack) {\n var result = new Deferred();\n result.resolve(value);\n return result.promise.then(callback, errback, progressBack);\n };\n\n /**\n * @ngdoc method\n * @name $q#resolve\n * @kind function\n *\n * @description\n * Alias of {@link ng.$q#when when} to maintain naming consistency with ES6.\n *\n * @param {*} value Value or a promise\n * @param {Function=} successCallback\n * @param {Function=} errorCallback\n * @param {Function=} progressCallback\n * @returns {Promise} Returns a promise of the passed value or promise\n */\n var resolve = when;\n\n /**\n * @ngdoc method\n * @name $q#all\n * @kind function\n *\n * @description\n * Combines multiple promises into a single promise that is resolved when all of the input\n * promises are resolved.\n *\n * @param {Array.|Object.} promises An array or hash of promises.\n * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values,\n * each value corresponding to the promise at the same index/key in the `promises` array/hash.\n * If any of the promises is resolved with a rejection, this resulting promise will be rejected\n * with the same rejection value.\n */\n\n function all(promises) {\n var deferred = new Deferred(),\n counter = 0,\n results = isArray(promises) ? [] : {};\n\n forEach(promises, function(promise, key) {\n counter++;\n when(promise).then(function(value) {\n if (results.hasOwnProperty(key)) return;\n results[key] = value;\n if (!(--counter)) deferred.resolve(results);\n }, function(reason) {\n if (results.hasOwnProperty(key)) return;\n deferred.reject(reason);\n });\n });\n\n if (counter === 0) {\n deferred.resolve(results);\n }\n\n return deferred.promise;\n }\n\n /**\n * @ngdoc method\n * @name $q#race\n * @kind function\n *\n * @description\n * Returns a promise that resolves or rejects as soon as one of those promises\n * resolves or rejects, with the value or reason from that promise.\n *\n * @param {Array.|Object.} promises An array or hash of promises.\n * @returns {Promise} a promise that resolves or rejects as soon as one of the `promises`\n * resolves or rejects, with the value or reason from that promise.\n */\n\n function race(promises) {\n var deferred = defer();\n\n forEach(promises, function(promise) {\n when(promise).then(deferred.resolve, deferred.reject);\n });\n\n return deferred.promise;\n }\n\n var $Q = function Q(resolver) {\n if (!isFunction(resolver)) {\n throw $qMinErr('norslvr', \"Expected resolverFn, got '{0}'\", resolver);\n }\n\n var deferred = new Deferred();\n\n function resolveFn(value) {\n deferred.resolve(value);\n }\n\n function rejectFn(reason) {\n deferred.reject(reason);\n }\n\n resolver(resolveFn, rejectFn);\n\n return deferred.promise;\n };\n\n // Let's make the instanceof operator work for promises, so that\n // `new $q(fn) instanceof $q` would evaluate to true.\n $Q.prototype = Promise.prototype;\n\n $Q.defer = defer;\n $Q.reject = reject;\n $Q.when = when;\n $Q.resolve = resolve;\n $Q.all = all;\n $Q.race = race;\n\n return $Q;\n}\n\nfunction $$RAFProvider() { //rAF\n this.$get = ['$window', '$timeout', function($window, $timeout) {\n var requestAnimationFrame = $window.requestAnimationFrame ||\n $window.webkitRequestAnimationFrame;\n\n var cancelAnimationFrame = $window.cancelAnimationFrame ||\n $window.webkitCancelAnimationFrame ||\n $window.webkitCancelRequestAnimationFrame;\n\n var rafSupported = !!requestAnimationFrame;\n var raf = rafSupported\n ? function(fn) {\n var id = requestAnimationFrame(fn);\n return function() {\n cancelAnimationFrame(id);\n };\n }\n : function(fn) {\n var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\n return function() {\n $timeout.cancel(timer);\n };\n };\n\n raf.supported = rafSupported;\n\n return raf;\n }];\n}\n\n/**\n * DESIGN NOTES\n *\n * The design decisions behind the scope are heavily favored for speed and memory consumption.\n *\n * The typical use of scope is to watch the expressions, which most of the time return the same\n * value as last time so we optimize the operation.\n *\n * Closures construction is expensive in terms of speed as well as memory:\n * - No closures, instead use prototypical inheritance for API\n * - Internal state needs to be stored on scope directly, which means that private state is\n * exposed as $$____ properties\n *\n * Loop operations are optimized by using while(count--) { ... }\n * - This means that in order to keep the same order of execution as addition we have to add\n * items to the array at the beginning (unshift) instead of at the end (push)\n *\n * Child scopes are created and removed often\n * - Using an array would be slow since inserts in the middle are expensive; so we use linked lists\n *\n * There are fewer watches than observers. This is why you don't want the observer to be implemented\n * in the same way as watch. Watch requires return of the initialization function which is expensive\n * to construct.\n */\n\n\n/**\n * @ngdoc provider\n * @name $rootScopeProvider\n * @description\n *\n * Provider for the $rootScope service.\n */\n\n/**\n * @ngdoc method\n * @name $rootScopeProvider#digestTtl\n * @description\n *\n * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that the dependencies between `$watch`s will result in\n * several digest iterations. However if an application needs more than the default 10 digest\n * iterations for its model to stabilize then you should investigate what is causing the model to\n * continuously change during the digest.\n *\n * Increasing the TTL could have performance implications, so you should not change it without\n * proper justification.\n *\n * @param {number} limit The number of digest iterations.\n */\n\n\n/**\n * @ngdoc service\n * @name $rootScope\n * @description\n *\n * Every application has a single root {@link ng.$rootScope.Scope scope}.\n * All other scopes are descendant scopes of the root scope. Scopes provide separation\n * between the model and the view, via a mechanism for watching the model for changes.\n * They also provide event emission/broadcast and subscription facility. See the\n * {@link guide/scope developer guide on scopes}.\n */\nfunction $RootScopeProvider() {\n var TTL = 10;\n var $rootScopeMinErr = minErr('$rootScope');\n var lastDirtyWatch = null;\n var applyAsyncId = null;\n\n this.digestTtl = function(value) {\n if (arguments.length) {\n TTL = value;\n }\n return TTL;\n };\n\n function createChildScopeClass(parent) {\n function ChildScope() {\n this.$$watchers = this.$$nextSibling =\n this.$$childHead = this.$$childTail = null;\n this.$$listeners = {};\n this.$$listenerCount = {};\n this.$$watchersCount = 0;\n this.$id = nextUid();\n this.$$ChildScope = null;\n }\n ChildScope.prototype = parent;\n return ChildScope;\n }\n\n this.$get = ['$exceptionHandler', '$parse', '$browser',\n function($exceptionHandler, $parse, $browser) {\n\n function destroyChildScope($event) {\n $event.currentScope.$$destroyed = true;\n }\n\n function cleanUpScope($scope) {\n\n if (msie === 9) {\n // There is a memory leak in IE9 if all child scopes are not disconnected\n // completely when a scope is destroyed. So this code will recurse up through\n // all this scopes children\n //\n // See issue https://github.com/angular/angular.js/issues/10706\n $scope.$$childHead && cleanUpScope($scope.$$childHead);\n $scope.$$nextSibling && cleanUpScope($scope.$$nextSibling);\n }\n\n // The code below works around IE9 and V8's memory leaks\n //\n // See:\n // - https://code.google.com/p/v8/issues/detail?id=2073#c26\n // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909\n // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451\n\n $scope.$parent = $scope.$$nextSibling = $scope.$$prevSibling = $scope.$$childHead =\n $scope.$$childTail = $scope.$root = $scope.$$watchers = null;\n }\n\n /**\n * @ngdoc type\n * @name $rootScope.Scope\n *\n * @description\n * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the\n * {@link auto.$injector $injector}. Child scopes are created using the\n * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when\n * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for\n * an in-depth introduction and usage examples.\n *\n *\n * # Inheritance\n * A scope can inherit from a parent scope, as in this example:\n * ```js\n var parent = $rootScope;\n var child = parent.$new();\n\n parent.salutation = \"Hello\";\n expect(child.salutation).toEqual('Hello');\n\n child.salutation = \"Welcome\";\n expect(child.salutation).toEqual('Welcome');\n expect(parent.salutation).toEqual('Hello');\n * ```\n *\n * When interacting with `Scope` in tests, additional helper methods are available on the\n * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional\n * details.\n *\n *\n * @param {Object.=} providers Map of service factory which need to be\n * provided for the current scope. Defaults to {@link ng}.\n * @param {Object.=} instanceCache Provides pre-instantiated services which should\n * append/override services provided by `providers`. This is handy\n * when unit-testing and having the need to override a default\n * service.\n * @returns {Object} Newly created scope.\n *\n */\n function Scope() {\n this.$id = nextUid();\n this.$$phase = this.$parent = this.$$watchers =\n this.$$nextSibling = this.$$prevSibling =\n this.$$childHead = this.$$childTail = null;\n this.$root = this;\n this.$$destroyed = false;\n this.$$listeners = {};\n this.$$listenerCount = {};\n this.$$watchersCount = 0;\n this.$$isolateBindings = null;\n }\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$id\n *\n * @description\n * Unique scope ID (monotonically increasing) useful for debugging.\n */\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$parent\n *\n * @description\n * Reference to the parent scope.\n */\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$root\n *\n * @description\n * Reference to the root scope.\n */\n\n Scope.prototype = {\n constructor: Scope,\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$new\n * @kind function\n *\n * @description\n * Creates a new child {@link ng.$rootScope.Scope scope}.\n *\n * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event.\n * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.\n *\n * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is\n * desired for the scope and its child scopes to be permanently detached from the parent and\n * thus stop participating in model change detection and listener notification by invoking.\n *\n * @param {boolean} isolate If true, then the scope does not prototypically inherit from the\n * parent scope. The scope is isolated, as it can not see parent scope properties.\n * When creating widgets, it is useful for the widget to not accidentally read parent\n * state.\n *\n * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent`\n * of the newly created scope. Defaults to `this` scope if not provided.\n * This is used when creating a transclude scope to correctly place it\n * in the scope hierarchy while maintaining the correct prototypical\n * inheritance.\n *\n * @returns {Object} The newly created child scope.\n *\n */\n $new: function(isolate, parent) {\n var child;\n\n parent = parent || this;\n\n if (isolate) {\n child = new Scope();\n child.$root = this.$root;\n } else {\n // Only create a child scope class if somebody asks for one,\n // but cache it to allow the VM to optimize lookups.\n if (!this.$$ChildScope) {\n this.$$ChildScope = createChildScopeClass(this);\n }\n child = new this.$$ChildScope();\n }\n child.$parent = parent;\n child.$$prevSibling = parent.$$childTail;\n if (parent.$$childHead) {\n parent.$$childTail.$$nextSibling = child;\n parent.$$childTail = child;\n } else {\n parent.$$childHead = parent.$$childTail = child;\n }\n\n // When the new scope is not isolated or we inherit from `this`, and\n // the parent scope is destroyed, the property `$$destroyed` is inherited\n // prototypically. In all other cases, this property needs to be set\n // when the parent scope is destroyed.\n // The listener needs to be added after the parent is set\n if (isolate || parent != this) child.$on('$destroy', destroyChildScope);\n\n return child;\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watch\n * @kind function\n *\n * @description\n * Registers a `listener` callback to be executed whenever the `watchExpression` changes.\n *\n * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest\n * $digest()} and should return the value that will be watched. (`watchExpression` should not change\n * its value when executed multiple times with the same input because it may be executed multiple\n * times by {@link ng.$rootScope.Scope#$digest $digest()}. That is, `watchExpression` should be\n * [idempotent](http://en.wikipedia.org/wiki/Idempotence).\n * - The `listener` is called only when the value from the current `watchExpression` and the\n * previous call to `watchExpression` are not equal (with the exception of the initial run,\n * see below). Inequality is determined according to reference inequality,\n * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)\n * via the `!==` Javascript operator, unless `objectEquality == true`\n * (see next point)\n * - When `objectEquality == true`, inequality of the `watchExpression` is determined\n * according to the {@link angular.equals} function. To save the value of the object for\n * later comparison, the {@link angular.copy} function is used. This therefore means that\n * watching complex objects will have adverse memory and performance implications.\n * - The watch `listener` may change the model, which may trigger other `listener`s to fire.\n * This is achieved by rerunning the watchers until no changes are detected. The rerun\n * iteration limit is 10 to prevent an infinite loop deadlock.\n *\n *\n * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,\n * you can register a `watchExpression` function with no `listener`. (Be prepared for\n * multiple calls to your `watchExpression` because it will execute multiple times in a\n * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.)\n *\n * After a watcher is registered with the scope, the `listener` fn is called asynchronously\n * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the\n * watcher. In rare cases, this is undesirable because the listener is called when the result\n * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you\n * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the\n * listener was called due to initialization.\n *\n *\n *\n * # Example\n * ```js\n // let's assume that scope was dependency injected as the $rootScope\n var scope = $rootScope;\n scope.name = 'misko';\n scope.counter = 0;\n\n expect(scope.counter).toEqual(0);\n scope.$watch('name', function(newValue, oldValue) {\n scope.counter = scope.counter + 1;\n });\n expect(scope.counter).toEqual(0);\n\n scope.$digest();\n // the listener is always called during the first $digest loop after it was registered\n expect(scope.counter).toEqual(1);\n\n scope.$digest();\n // but now it will not be called unless the value changes\n expect(scope.counter).toEqual(1);\n\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(2);\n\n\n\n // Using a function as a watchExpression\n var food;\n scope.foodCounter = 0;\n expect(scope.foodCounter).toEqual(0);\n scope.$watch(\n // This function returns the value being watched. It is called for each turn of the $digest loop\n function() { return food; },\n // This is the change listener, called when the value returned from the above function changes\n function(newValue, oldValue) {\n if ( newValue !== oldValue ) {\n // Only increment the counter if the value changed\n scope.foodCounter = scope.foodCounter + 1;\n }\n }\n );\n // No digest has been run so the counter will be zero\n expect(scope.foodCounter).toEqual(0);\n\n // Run the digest but since food has not changed count will still be zero\n scope.$digest();\n expect(scope.foodCounter).toEqual(0);\n\n // Update food and run digest. Now the counter will increment\n food = 'cheeseburger';\n scope.$digest();\n expect(scope.foodCounter).toEqual(1);\n\n * ```\n *\n *\n *\n * @param {(function()|string)} watchExpression Expression that is evaluated on each\n * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers\n * a call to the `listener`.\n *\n * - `string`: Evaluated as {@link guide/expression expression}\n * - `function(scope)`: called with current `scope` as a parameter.\n * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value\n * of `watchExpression` changes.\n *\n * - `newVal` contains the current value of the `watchExpression`\n * - `oldVal` contains the previous value of the `watchExpression`\n * - `scope` refers to the current scope\n * @param {boolean=} [objectEquality=false] Compare for object equality using {@link angular.equals} instead of\n * comparing for reference equality.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $watch: function(watchExp, listener, objectEquality, prettyPrintExpression) {\n var get = $parse(watchExp);\n\n if (get.$$watchDelegate) {\n return get.$$watchDelegate(this, listener, objectEquality, get, watchExp);\n }\n var scope = this,\n array = scope.$$watchers,\n watcher = {\n fn: listener,\n last: initWatchVal,\n get: get,\n exp: prettyPrintExpression || watchExp,\n eq: !!objectEquality\n };\n\n lastDirtyWatch = null;\n\n if (!isFunction(listener)) {\n watcher.fn = noop;\n }\n\n if (!array) {\n array = scope.$$watchers = [];\n }\n // we use unshift since we use a while loop in $digest for speed.\n // the while loop reads in reverse order.\n array.unshift(watcher);\n incrementWatchersCount(this, 1);\n\n return function deregisterWatch() {\n if (arrayRemove(array, watcher) >= 0) {\n incrementWatchersCount(scope, -1);\n }\n lastDirtyWatch = null;\n };\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watchGroup\n * @kind function\n *\n * @description\n * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.\n * If any one expression in the collection changes the `listener` is executed.\n *\n * - The items in the `watchExpressions` array are observed via standard $watch operation and are examined on every\n * call to $digest() to see if any items changes.\n * - The `listener` is called whenever any expression in the `watchExpressions` array changes.\n *\n * @param {Array.} watchExpressions Array of expressions that will be individually\n * watched using {@link ng.$rootScope.Scope#$watch $watch()}\n *\n * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any\n * expression in `watchExpressions` changes\n * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching\n * those of `watchExpression`\n * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching\n * those of `watchExpression`\n * The `scope` refers to the current scope.\n * @returns {function()} Returns a de-registration function for all listeners.\n */\n $watchGroup: function(watchExpressions, listener) {\n var oldValues = new Array(watchExpressions.length);\n var newValues = new Array(watchExpressions.length);\n var deregisterFns = [];\n var self = this;\n var changeReactionScheduled = false;\n var firstRun = true;\n\n if (!watchExpressions.length) {\n // No expressions means we call the listener ASAP\n var shouldCall = true;\n self.$evalAsync(function() {\n if (shouldCall) listener(newValues, newValues, self);\n });\n return function deregisterWatchGroup() {\n shouldCall = false;\n };\n }\n\n if (watchExpressions.length === 1) {\n // Special case size of one\n return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) {\n newValues[0] = value;\n oldValues[0] = oldValue;\n listener(newValues, (value === oldValue) ? newValues : oldValues, scope);\n });\n }\n\n forEach(watchExpressions, function(expr, i) {\n var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) {\n newValues[i] = value;\n oldValues[i] = oldValue;\n if (!changeReactionScheduled) {\n changeReactionScheduled = true;\n self.$evalAsync(watchGroupAction);\n }\n });\n deregisterFns.push(unwatchFn);\n });\n\n function watchGroupAction() {\n changeReactionScheduled = false;\n\n if (firstRun) {\n firstRun = false;\n listener(newValues, newValues, self);\n } else {\n listener(newValues, oldValues, self);\n }\n }\n\n return function deregisterWatchGroup() {\n while (deregisterFns.length) {\n deregisterFns.shift()();\n }\n };\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watchCollection\n * @kind function\n *\n * @description\n * Shallow watches the properties of an object and fires whenever any of the properties change\n * (for arrays, this implies watching the array items; for object maps, this implies watching\n * the properties). If a change is detected, the `listener` callback is fired.\n *\n * - The `obj` collection is observed via standard $watch operation and is examined on every\n * call to $digest() to see if any items have been added, removed, or moved.\n * - The `listener` is called whenever anything within the `obj` has changed. Examples include\n * adding, removing, and moving items belonging to an object or array.\n *\n *\n * # Example\n * ```js\n $scope.names = ['igor', 'matias', 'misko', 'james'];\n $scope.dataCount = 4;\n\n $scope.$watchCollection('names', function(newNames, oldNames) {\n $scope.dataCount = newNames.length;\n });\n\n expect($scope.dataCount).toEqual(4);\n $scope.$digest();\n\n //still at 4 ... no changes\n expect($scope.dataCount).toEqual(4);\n\n $scope.names.pop();\n $scope.$digest();\n\n //now there's been a change\n expect($scope.dataCount).toEqual(3);\n * ```\n *\n *\n * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The\n * expression value should evaluate to an object or an array which is observed on each\n * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the\n * collection will trigger a call to the `listener`.\n *\n * @param {function(newCollection, oldCollection, scope)} listener a callback function called\n * when a change is detected.\n * - The `newCollection` object is the newly modified data obtained from the `obj` expression\n * - The `oldCollection` object is a copy of the former collection data.\n * Due to performance considerations, the`oldCollection` value is computed only if the\n * `listener` function declares two or more arguments.\n * - The `scope` argument refers to the current scope.\n *\n * @returns {function()} Returns a de-registration function for this listener. When the\n * de-registration function is executed, the internal watch operation is terminated.\n */\n $watchCollection: function(obj, listener) {\n $watchCollectionInterceptor.$stateful = true;\n\n var self = this;\n // the current value, updated on each dirty-check run\n var newValue;\n // a shallow copy of the newValue from the last dirty-check run,\n // updated to match newValue during dirty-check run\n var oldValue;\n // a shallow copy of the newValue from when the last change happened\n var veryOldValue;\n // only track veryOldValue if the listener is asking for it\n var trackVeryOldValue = (listener.length > 1);\n var changeDetected = 0;\n var changeDetector = $parse(obj, $watchCollectionInterceptor);\n var internalArray = [];\n var internalObject = {};\n var initRun = true;\n var oldLength = 0;\n\n function $watchCollectionInterceptor(_value) {\n newValue = _value;\n var newLength, key, bothNaN, newItem, oldItem;\n\n // If the new value is undefined, then return undefined as the watch may be a one-time watch\n if (isUndefined(newValue)) return;\n\n if (!isObject(newValue)) { // if primitive\n if (oldValue !== newValue) {\n oldValue = newValue;\n changeDetected++;\n }\n } else if (isArrayLike(newValue)) {\n if (oldValue !== internalArray) {\n // we are transitioning from something which was not an array into array.\n oldValue = internalArray;\n oldLength = oldValue.length = 0;\n changeDetected++;\n }\n\n newLength = newValue.length;\n\n if (oldLength !== newLength) {\n // if lengths do not match we need to trigger change notification\n changeDetected++;\n oldValue.length = oldLength = newLength;\n }\n // copy the items to oldValue and look for changes.\n for (var i = 0; i < newLength; i++) {\n oldItem = oldValue[i];\n newItem = newValue[i];\n\n bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n if (!bothNaN && (oldItem !== newItem)) {\n changeDetected++;\n oldValue[i] = newItem;\n }\n }\n } else {\n if (oldValue !== internalObject) {\n // we are transitioning from something which was not an object into object.\n oldValue = internalObject = {};\n oldLength = 0;\n changeDetected++;\n }\n // copy the items to oldValue and look for changes.\n newLength = 0;\n for (key in newValue) {\n if (hasOwnProperty.call(newValue, key)) {\n newLength++;\n newItem = newValue[key];\n oldItem = oldValue[key];\n\n if (key in oldValue) {\n bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n if (!bothNaN && (oldItem !== newItem)) {\n changeDetected++;\n oldValue[key] = newItem;\n }\n } else {\n oldLength++;\n oldValue[key] = newItem;\n changeDetected++;\n }\n }\n }\n if (oldLength > newLength) {\n // we used to have more keys, need to find them and destroy them.\n changeDetected++;\n for (key in oldValue) {\n if (!hasOwnProperty.call(newValue, key)) {\n oldLength--;\n delete oldValue[key];\n }\n }\n }\n }\n return changeDetected;\n }\n\n function $watchCollectionAction() {\n if (initRun) {\n initRun = false;\n listener(newValue, newValue, self);\n } else {\n listener(newValue, veryOldValue, self);\n }\n\n // make a copy for the next time a collection is changed\n if (trackVeryOldValue) {\n if (!isObject(newValue)) {\n //primitive\n veryOldValue = newValue;\n } else if (isArrayLike(newValue)) {\n veryOldValue = new Array(newValue.length);\n for (var i = 0; i < newValue.length; i++) {\n veryOldValue[i] = newValue[i];\n }\n } else { // if object\n veryOldValue = {};\n for (var key in newValue) {\n if (hasOwnProperty.call(newValue, key)) {\n veryOldValue[key] = newValue[key];\n }\n }\n }\n }\n }\n\n return this.$watch(changeDetector, $watchCollectionAction);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$digest\n * @kind function\n *\n * @description\n * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and\n * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change\n * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}\n * until no more listeners are firing. This means that it is possible to get into an infinite\n * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of\n * iterations exceeds 10.\n *\n * Usually, you don't call `$digest()` directly in\n * {@link ng.directive:ngController controllers} or in\n * {@link ng.$compileProvider#directive directives}.\n * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within\n * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`.\n *\n * If you want to be notified whenever `$digest()` is called,\n * you can register a `watchExpression` function with\n * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.\n *\n * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.\n *\n * # Example\n * ```js\n var scope = ...;\n scope.name = 'misko';\n scope.counter = 0;\n\n expect(scope.counter).toEqual(0);\n scope.$watch('name', function(newValue, oldValue) {\n scope.counter = scope.counter + 1;\n });\n expect(scope.counter).toEqual(0);\n\n scope.$digest();\n // the listener is always called during the first $digest loop after it was registered\n expect(scope.counter).toEqual(1);\n\n scope.$digest();\n // but now it will not be called unless the value changes\n expect(scope.counter).toEqual(1);\n\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(2);\n * ```\n *\n */\n $digest: function() {\n var watch, value, last, fn, get,\n watchers,\n length,\n dirty, ttl = TTL,\n next, current, target = this,\n watchLog = [],\n logIdx, asyncTask;\n\n beginPhase('$digest');\n // Check for changes to browser url that happened in sync before the call to $digest\n $browser.$$checkUrlChange();\n\n if (this === $rootScope && applyAsyncId !== null) {\n // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then\n // cancel the scheduled $apply and flush the queue of expressions to be evaluated.\n $browser.defer.cancel(applyAsyncId);\n flushApplyAsync();\n }\n\n lastDirtyWatch = null;\n\n do { // \"while dirty\" loop\n dirty = false;\n current = target;\n\n // It's safe for asyncQueuePosition to be a local variable here because this loop can't\n // be reentered recursively. Calling $digest from a function passed to $applyAsync would\n // lead to a '$digest already in progress' error.\n for (var asyncQueuePosition = 0; asyncQueuePosition < asyncQueue.length; asyncQueuePosition++) {\n try {\n asyncTask = asyncQueue[asyncQueuePosition];\n asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals);\n } catch (e) {\n $exceptionHandler(e);\n }\n lastDirtyWatch = null;\n }\n asyncQueue.length = 0;\n\n traverseScopesLoop:\n do { // \"traverse the scopes\" loop\n if ((watchers = current.$$watchers)) {\n // process our watches\n length = watchers.length;\n while (length--) {\n try {\n watch = watchers[length];\n // Most common watches are on primitives, in which case we can short\n // circuit it with === operator, only when === fails do we use .equals\n if (watch) {\n get = watch.get;\n if ((value = get(current)) !== (last = watch.last) &&\n !(watch.eq\n ? equals(value, last)\n : (typeof value === 'number' && typeof last === 'number'\n && isNaN(value) && isNaN(last)))) {\n dirty = true;\n lastDirtyWatch = watch;\n watch.last = watch.eq ? copy(value, null) : value;\n fn = watch.fn;\n fn(value, ((last === initWatchVal) ? value : last), current);\n if (ttl < 5) {\n logIdx = 4 - ttl;\n if (!watchLog[logIdx]) watchLog[logIdx] = [];\n watchLog[logIdx].push({\n msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,\n newVal: value,\n oldVal: last\n });\n }\n } else if (watch === lastDirtyWatch) {\n // If the most recently dirty watcher is now clean, short circuit since the remaining watchers\n // have already been tested.\n dirty = false;\n break traverseScopesLoop;\n }\n }\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n }\n\n // Insanity Warning: scope depth-first traversal\n // yes, this code is a bit crazy, but it works and we have tests to prove it!\n // this piece should be kept in sync with the traversal in $broadcast\n if (!(next = ((current.$$watchersCount && current.$$childHead) ||\n (current !== target && current.$$nextSibling)))) {\n while (current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n } while ((current = next));\n\n // `break traverseScopesLoop;` takes us to here\n\n if ((dirty || asyncQueue.length) && !(ttl--)) {\n clearPhase();\n throw $rootScopeMinErr('infdig',\n '{0} $digest() iterations reached. Aborting!\\n' +\n 'Watchers fired in the last 5 iterations: {1}',\n TTL, watchLog);\n }\n\n } while (dirty || asyncQueue.length);\n\n clearPhase();\n\n // postDigestQueuePosition isn't local here because this loop can be reentered recursively.\n while (postDigestQueuePosition < postDigestQueue.length) {\n try {\n postDigestQueue[postDigestQueuePosition++]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n postDigestQueue.length = postDigestQueuePosition = 0;\n },\n\n\n /**\n * @ngdoc event\n * @name $rootScope.Scope#$destroy\n * @eventType broadcast on scope being destroyed\n *\n * @description\n * Broadcasted when a scope and its children are being destroyed.\n *\n * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n * clean up DOM bindings before an element is removed from the DOM.\n */\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$destroy\n * @kind function\n *\n * @description\n * Removes the current scope (and all of its children) from the parent scope. Removal implies\n * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer\n * propagate to the current scope and its children. Removal also implies that the current\n * scope is eligible for garbage collection.\n *\n * The `$destroy()` is usually used by directives such as\n * {@link ng.directive:ngRepeat ngRepeat} for managing the\n * unrolling of the loop.\n *\n * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.\n * Application code can register a `$destroy` event handler that will give it a chance to\n * perform any necessary cleanup.\n *\n * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n * clean up DOM bindings before an element is removed from the DOM.\n */\n $destroy: function() {\n // We can't destroy a scope that has been already destroyed.\n if (this.$$destroyed) return;\n var parent = this.$parent;\n\n this.$broadcast('$destroy');\n this.$$destroyed = true;\n\n if (this === $rootScope) {\n //Remove handlers attached to window when $rootScope is removed\n $browser.$$applicationDestroyed();\n }\n\n incrementWatchersCount(this, -this.$$watchersCount);\n for (var eventName in this.$$listenerCount) {\n decrementListenerCount(this, this.$$listenerCount[eventName], eventName);\n }\n\n // sever all the references to parent scopes (after this cleanup, the current scope should\n // not be retained by any of our references and should be eligible for garbage collection)\n if (parent && parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;\n if (parent && parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;\n if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;\n if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;\n\n // Disable listeners, watchers and apply/digest methods\n this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;\n this.$on = this.$watch = this.$watchGroup = function() { return noop; };\n this.$$listeners = {};\n\n // Disconnect the next sibling to prevent `cleanUpScope` destroying those too\n this.$$nextSibling = null;\n cleanUpScope(this);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$eval\n * @kind function\n *\n * @description\n * Executes the `expression` on the current scope and returns the result. Any exceptions in\n * the expression are propagated (uncaught). This is useful when evaluating Angular\n * expressions.\n *\n * # Example\n * ```js\n var scope = ng.$rootScope.Scope();\n scope.a = 1;\n scope.b = 2;\n\n expect(scope.$eval('a+b')).toEqual(3);\n expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);\n * ```\n *\n * @param {(string|function())=} expression An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with the current `scope` parameter.\n *\n * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n * @returns {*} The result of evaluating the expression.\n */\n $eval: function(expr, locals) {\n return $parse(expr)(this, locals);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$evalAsync\n * @kind function\n *\n * @description\n * Executes the expression on the current scope at a later point in time.\n *\n * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only\n * that:\n *\n * - it will execute after the function that scheduled the evaluation (preferably before DOM\n * rendering).\n * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after\n * `expression` execution.\n *\n * Any exceptions from the execution of the expression are forwarded to the\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle\n * will be scheduled. However, it is encouraged to always call code that changes the model\n * from within an `$apply` call. That includes code evaluated via `$evalAsync`.\n *\n * @param {(string|function())=} expression An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with the current `scope` parameter.\n *\n * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n */\n $evalAsync: function(expr, locals) {\n // if we are outside of an $digest loop and this is the first time we are scheduling async\n // task also schedule async auto-flush\n if (!$rootScope.$$phase && !asyncQueue.length) {\n $browser.defer(function() {\n if (asyncQueue.length) {\n $rootScope.$digest();\n }\n });\n }\n\n asyncQueue.push({scope: this, expression: $parse(expr), locals: locals});\n },\n\n $$postDigest: function(fn) {\n postDigestQueue.push(fn);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$apply\n * @kind function\n *\n * @description\n * `$apply()` is used to execute an expression in angular from outside of the angular\n * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).\n * Because we are calling into the angular framework we need to perform proper scope life\n * cycle of {@link ng.$exceptionHandler exception handling},\n * {@link ng.$rootScope.Scope#$digest executing watches}.\n *\n * ## Life cycle\n *\n * # Pseudo-Code of `$apply()`\n * ```js\n function $apply(expr) {\n try {\n return $eval(expr);\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n $root.$digest();\n }\n }\n * ```\n *\n *\n * Scope's `$apply()` method transitions through the following stages:\n *\n * 1. The {@link guide/expression expression} is executed using the\n * {@link ng.$rootScope.Scope#$eval $eval()} method.\n * 2. Any exceptions from the execution of the expression are forwarded to the\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the\n * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.\n *\n *\n * @param {(string|function())=} exp An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with current `scope` parameter.\n *\n * @returns {*} The result of evaluating the expression.\n */\n $apply: function(expr) {\n try {\n beginPhase('$apply');\n try {\n return this.$eval(expr);\n } finally {\n clearPhase();\n }\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n try {\n $rootScope.$digest();\n } catch (e) {\n $exceptionHandler(e);\n throw e;\n }\n }\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$applyAsync\n * @kind function\n *\n * @description\n * Schedule the invocation of $apply to occur at a later time. The actual time difference\n * varies across browsers, but is typically around ~10 milliseconds.\n *\n * This can be used to queue up multiple expressions which need to be evaluated in the same\n * digest.\n *\n * @param {(string|function())=} exp An angular expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with current `scope` parameter.\n */\n $applyAsync: function(expr) {\n var scope = this;\n expr && applyAsyncQueue.push($applyAsyncExpression);\n expr = $parse(expr);\n scheduleApplyAsync();\n\n function $applyAsyncExpression() {\n scope.$eval(expr);\n }\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$on\n * @kind function\n *\n * @description\n * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for\n * discussion of event life cycle.\n *\n * The event listener function format is: `function(event, args...)`. The `event` object\n * passed into the listener has the following attributes:\n *\n * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or\n * `$broadcast`-ed.\n * - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the\n * event propagates through the scope hierarchy, this property is set to null.\n * - `name` - `{string}`: name of the event.\n * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel\n * further event propagation (available only for events that were `$emit`-ed).\n * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag\n * to true.\n * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.\n *\n * @param {string} name Event name to listen on.\n * @param {function(event, ...args)} listener Function to call when the event is emitted.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $on: function(name, listener) {\n var namedListeners = this.$$listeners[name];\n if (!namedListeners) {\n this.$$listeners[name] = namedListeners = [];\n }\n namedListeners.push(listener);\n\n var current = this;\n do {\n if (!current.$$listenerCount[name]) {\n current.$$listenerCount[name] = 0;\n }\n current.$$listenerCount[name]++;\n } while ((current = current.$parent));\n\n var self = this;\n return function() {\n var indexOfListener = namedListeners.indexOf(listener);\n if (indexOfListener !== -1) {\n namedListeners[indexOfListener] = null;\n decrementListenerCount(self, 1, name);\n }\n };\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$emit\n * @kind function\n *\n * @description\n * Dispatches an event `name` upwards through the scope hierarchy notifying the\n * registered {@link ng.$rootScope.Scope#$on} listeners.\n *\n * The event life cycle starts at the scope on which `$emit` was called. All\n * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n * notified. Afterwards, the event traverses upwards toward the root scope and calls all\n * registered listeners along the way. The event will stop propagating if one of the listeners\n * cancels it.\n *\n * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * @param {string} name Event name to emit.\n * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).\n */\n $emit: function(name, args) {\n var empty = [],\n namedListeners,\n scope = this,\n stopPropagation = false,\n event = {\n name: name,\n targetScope: scope,\n stopPropagation: function() {stopPropagation = true;},\n preventDefault: function() {\n event.defaultPrevented = true;\n },\n defaultPrevented: false\n },\n listenerArgs = concat([event], arguments, 1),\n i, length;\n\n do {\n namedListeners = scope.$$listeners[name] || empty;\n event.currentScope = scope;\n for (i = 0, length = namedListeners.length; i < length; i++) {\n\n // if listeners were deregistered, defragment the array\n if (!namedListeners[i]) {\n namedListeners.splice(i, 1);\n i--;\n length--;\n continue;\n }\n try {\n //allow all listeners attached to the current scope to run\n namedListeners[i].apply(null, listenerArgs);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n //if any listener on the current scope stops propagation, prevent bubbling\n if (stopPropagation) {\n event.currentScope = null;\n return event;\n }\n //traverse upwards\n scope = scope.$parent;\n } while (scope);\n\n event.currentScope = null;\n\n return event;\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$broadcast\n * @kind function\n *\n * @description\n * Dispatches an event `name` downwards to all child scopes (and their children) notifying the\n * registered {@link ng.$rootScope.Scope#$on} listeners.\n *\n * The event life cycle starts at the scope on which `$broadcast` was called. All\n * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n * notified. Afterwards, the event propagates to all direct and indirect scopes of the current\n * scope and calls all registered listeners along the way. The event cannot be canceled.\n *\n * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * @param {string} name Event name to broadcast.\n * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}\n */\n $broadcast: function(name, args) {\n var target = this,\n current = target,\n next = target,\n event = {\n name: name,\n targetScope: target,\n preventDefault: function() {\n event.defaultPrevented = true;\n },\n defaultPrevented: false\n };\n\n if (!target.$$listenerCount[name]) return event;\n\n var listenerArgs = concat([event], arguments, 1),\n listeners, i, length;\n\n //down while you can, then up and next sibling or up and next sibling until back at root\n while ((current = next)) {\n event.currentScope = current;\n listeners = current.$$listeners[name] || [];\n for (i = 0, length = listeners.length; i < length; i++) {\n // if listeners were deregistered, defragment the array\n if (!listeners[i]) {\n listeners.splice(i, 1);\n i--;\n length--;\n continue;\n }\n\n try {\n listeners[i].apply(null, listenerArgs);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n\n // Insanity Warning: scope depth-first traversal\n // yes, this code is a bit crazy, but it works and we have tests to prove it!\n // this piece should be kept in sync with the traversal in $digest\n // (though it differs due to having the extra check for $$listenerCount)\n if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||\n (current !== target && current.$$nextSibling)))) {\n while (current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n }\n\n event.currentScope = null;\n return event;\n }\n };\n\n var $rootScope = new Scope();\n\n //The internal queues. Expose them on the $rootScope for debugging/testing purposes.\n var asyncQueue = $rootScope.$$asyncQueue = [];\n var postDigestQueue = $rootScope.$$postDigestQueue = [];\n var applyAsyncQueue = $rootScope.$$applyAsyncQueue = [];\n\n var postDigestQueuePosition = 0;\n\n return $rootScope;\n\n\n function beginPhase(phase) {\n if ($rootScope.$$phase) {\n throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);\n }\n\n $rootScope.$$phase = phase;\n }\n\n function clearPhase() {\n $rootScope.$$phase = null;\n }\n\n function incrementWatchersCount(current, count) {\n do {\n current.$$watchersCount += count;\n } while ((current = current.$parent));\n }\n\n function decrementListenerCount(current, count, name) {\n do {\n current.$$listenerCount[name] -= count;\n\n if (current.$$listenerCount[name] === 0) {\n delete current.$$listenerCount[name];\n }\n } while ((current = current.$parent));\n }\n\n /**\n * function used as an initial value for watchers.\n * because it's unique we can easily tell it apart from other values\n */\n function initWatchVal() {}\n\n function flushApplyAsync() {\n while (applyAsyncQueue.length) {\n try {\n applyAsyncQueue.shift()();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n applyAsyncId = null;\n }\n\n function scheduleApplyAsync() {\n if (applyAsyncId === null) {\n applyAsyncId = $browser.defer(function() {\n $rootScope.$apply(flushApplyAsync);\n });\n }\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $rootElement\n *\n * @description\n * The root element of Angular application. This is either the element where {@link\n * ng.directive:ngApp ngApp} was declared or the element passed into\n * {@link angular.bootstrap}. The element represents the root element of application. It is also the\n * location where the application's {@link auto.$injector $injector} service gets\n * published, and can be retrieved using `$rootElement.injector()`.\n */\n\n\n// the implementation is in angular.bootstrap\n\n/**\n * @description\n * Private service to sanitize uris for links and images. Used by $compile and $sanitize.\n */\nfunction $$SanitizeUriProvider() {\n var aHrefSanitizationWhitelist = /^\\s*(https?|ftp|mailto|tel|file):/,\n imgSrcSanitizationWhitelist = /^\\s*((https?|ftp|file|blob):|data:image\\/)/;\n\n /**\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during a[href] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.aHrefSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n aHrefSanitizationWhitelist = regexp;\n return this;\n }\n return aHrefSanitizationWhitelist;\n };\n\n\n /**\n * @description\n * Retrieves or overrides the default regular expression that is used for whitelisting of safe\n * urls during img[src] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to whitelist urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.imgSrcSanitizationWhitelist = function(regexp) {\n if (isDefined(regexp)) {\n imgSrcSanitizationWhitelist = regexp;\n return this;\n }\n return imgSrcSanitizationWhitelist;\n };\n\n this.$get = function() {\n return function sanitizeUri(uri, isImage) {\n var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;\n var normalizedVal;\n normalizedVal = urlResolve(uri).href;\n if (normalizedVal !== '' && !normalizedVal.match(regex)) {\n return 'unsafe:' + normalizedVal;\n }\n return uri;\n };\n };\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\nvar $sceMinErr = minErr('$sce');\n\nvar SCE_CONTEXTS = {\n HTML: 'html',\n CSS: 'css',\n URL: 'url',\n // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a\n // url. (e.g. ng-include, script src, templateUrl)\n RESOURCE_URL: 'resourceUrl',\n JS: 'js'\n};\n\n// Helper functions follow.\n\nfunction adjustMatcher(matcher) {\n if (matcher === 'self') {\n return matcher;\n } else if (isString(matcher)) {\n // Strings match exactly except for 2 wildcards - '*' and '**'.\n // '*' matches any character except those from the set ':/.?&'.\n // '**' matches any character (like .* in a RegExp).\n // More than 2 *'s raises an error as it's ill defined.\n if (matcher.indexOf('***') > -1) {\n throw $sceMinErr('iwcard',\n 'Illegal sequence *** in string matcher. String: {0}', matcher);\n }\n matcher = escapeForRegexp(matcher).\n replace('\\\\*\\\\*', '.*').\n replace('\\\\*', '[^:/.?&;]*');\n return new RegExp('^' + matcher + '$');\n } else if (isRegExp(matcher)) {\n // The only other type of matcher allowed is a Regexp.\n // Match entire URL / disallow partial matches.\n // Flags are reset (i.e. no global, ignoreCase or multiline)\n return new RegExp('^' + matcher.source + '$');\n } else {\n throw $sceMinErr('imatcher',\n 'Matchers may only be \"self\", string patterns or RegExp objects');\n }\n}\n\n\nfunction adjustMatchers(matchers) {\n var adjustedMatchers = [];\n if (isDefined(matchers)) {\n forEach(matchers, function(matcher) {\n adjustedMatchers.push(adjustMatcher(matcher));\n });\n }\n return adjustedMatchers;\n}\n\n\n/**\n * @ngdoc service\n * @name $sceDelegate\n * @kind function\n *\n * @description\n *\n * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict\n * Contextual Escaping (SCE)} services to AngularJS.\n *\n * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of\n * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is\n * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to\n * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things\n * work because `$sce` delegates to `$sceDelegate` for these operations.\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.\n *\n * The default instance of `$sceDelegate` should work out of the box with little pain. While you\n * can override it completely to change the behavior of `$sce`, the common case would\n * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting\n * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as\n * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist\n * $sceDelegateProvider.resourceUrlWhitelist} and {@link\n * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}\n */\n\n/**\n * @ngdoc provider\n * @name $sceDelegateProvider\n * @description\n *\n * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate\n * $sceDelegate} service. This allows one to get/set the whitelists and blacklists used to ensure\n * that the URLs used for sourcing Angular templates are safe. Refer {@link\n * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and\n * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}\n *\n * For the general details about this service in Angular, read the main page for {@link ng.$sce\n * Strict Contextual Escaping (SCE)}.\n *\n * **Example**: Consider the following case. \n *\n * - your app is hosted at url `http://myapp.example.com/`\n * - but some of your templates are hosted on other domains you control such as\n * `http://srv01.assets.example.com/`,  `http://srv02.assets.example.com/`, etc.\n * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.\n *\n * Here is what a secure configuration for this scenario might look like:\n *\n * ```\n * angular.module('myApp', []).config(function($sceDelegateProvider) {\n * $sceDelegateProvider.resourceUrlWhitelist([\n * // Allow same origin resource loads.\n * 'self',\n * // Allow loading from our assets domain. Notice the difference between * and **.\n * 'http://srv*.assets.example.com/**'\n * ]);\n *\n * // The blacklist overrides the whitelist so the open redirect here is blocked.\n * $sceDelegateProvider.resourceUrlBlacklist([\n * 'http://myapp.example.com/clickThru**'\n * ]);\n * });\n * ```\n */\n\nfunction $SceDelegateProvider() {\n this.SCE_CONTEXTS = SCE_CONTEXTS;\n\n // Resource URLs can also be trusted by policy.\n var resourceUrlWhitelist = ['self'],\n resourceUrlBlacklist = [];\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#resourceUrlWhitelist\n * @kind function\n *\n * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value\n * provided. This must be an array or null. A snapshot of this array is used so further\n * changes to the array are ignored.\n *\n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.\n *\n *
        \n * **Note:** an empty whitelist array will block all URLs!\n *
        \n *\n * @return {Array} the currently set whitelist array.\n *\n * The **default value** when no whitelist has been explicitly set is `['self']` allowing only\n * same origin resource requests.\n *\n * @description\n * Sets/Gets the whitelist of trusted resource URLs.\n */\n this.resourceUrlWhitelist = function(value) {\n if (arguments.length) {\n resourceUrlWhitelist = adjustMatchers(value);\n }\n return resourceUrlWhitelist;\n };\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#resourceUrlBlacklist\n * @kind function\n *\n * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value\n * provided. This must be an array or null. A snapshot of this array is used so further\n * changes to the array are ignored.\n *\n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.\n *\n * The typical usage for the blacklist is to **block\n * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as\n * these would otherwise be trusted but actually return content from the redirected domain.\n *\n * Finally, **the blacklist overrides the whitelist** and has the final say.\n *\n * @return {Array} the currently set blacklist array.\n *\n * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there\n * is no blacklist.)\n *\n * @description\n * Sets/Gets the blacklist of trusted resource URLs.\n */\n\n this.resourceUrlBlacklist = function(value) {\n if (arguments.length) {\n resourceUrlBlacklist = adjustMatchers(value);\n }\n return resourceUrlBlacklist;\n };\n\n this.$get = ['$injector', function($injector) {\n\n var htmlSanitizer = function htmlSanitizer(html) {\n throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n };\n\n if ($injector.has('$sanitize')) {\n htmlSanitizer = $injector.get('$sanitize');\n }\n\n\n function matchUrl(matcher, parsedUrl) {\n if (matcher === 'self') {\n return urlIsSameOrigin(parsedUrl);\n } else {\n // definitely a regex. See adjustMatchers()\n return !!matcher.exec(parsedUrl.href);\n }\n }\n\n function isResourceUrlAllowedByPolicy(url) {\n var parsedUrl = urlResolve(url.toString());\n var i, n, allowed = false;\n // Ensure that at least one item from the whitelist allows this url.\n for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {\n if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {\n allowed = true;\n break;\n }\n }\n if (allowed) {\n // Ensure that no item from the blacklist blocked this url.\n for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {\n if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {\n allowed = false;\n break;\n }\n }\n }\n return allowed;\n }\n\n function generateHolderType(Base) {\n var holderType = function TrustedValueHolderType(trustedValue) {\n this.$$unwrapTrustedValue = function() {\n return trustedValue;\n };\n };\n if (Base) {\n holderType.prototype = new Base();\n }\n holderType.prototype.valueOf = function sceValueOf() {\n return this.$$unwrapTrustedValue();\n };\n holderType.prototype.toString = function sceToString() {\n return this.$$unwrapTrustedValue().toString();\n };\n return holderType;\n }\n\n var trustedValueHolderBase = generateHolderType(),\n byType = {};\n\n byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);\n\n /**\n * @ngdoc method\n * @name $sceDelegate#trustAs\n *\n * @description\n * Returns an object that is trusted by angular for use in specified strict\n * contextual escaping contexts (such as ng-bind-html, ng-include, any src\n * attribute interpolation, any dom event binding attribute interpolation\n * such as for onclick, etc.) that uses the provided value.\n * See {@link ng.$sce $sce} for enabling strict contextual escaping.\n *\n * @param {string} type The kind of context in which this value is safe for use. e.g. url,\n * resourceUrl, html, js and css.\n * @param {*} value The value that that should be considered trusted/safe.\n * @returns {*} A value that can be used to stand in for the provided `value` in places\n * where Angular expects a $sce.trustAs() return value.\n */\n function trustAs(type, trustedValue) {\n var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n if (!Constructor) {\n throw $sceMinErr('icontext',\n 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',\n type, trustedValue);\n }\n if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') {\n return trustedValue;\n }\n // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting\n // mutable objects, we ensure here that the value passed in is actually a string.\n if (typeof trustedValue !== 'string') {\n throw $sceMinErr('itype',\n 'Attempted to trust a non-string value in a content requiring a string: Context: {0}',\n type);\n }\n return new Constructor(trustedValue);\n }\n\n /**\n * @ngdoc method\n * @name $sceDelegate#valueOf\n *\n * @description\n * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.\n *\n * If the passed parameter is not a value that had been returned by {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is.\n *\n * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}\n * call or anything else.\n * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns\n * `value` unchanged.\n */\n function valueOf(maybeTrusted) {\n if (maybeTrusted instanceof trustedValueHolderBase) {\n return maybeTrusted.$$unwrapTrustedValue();\n } else {\n return maybeTrusted;\n }\n }\n\n /**\n * @ngdoc method\n * @name $sceDelegate#getTrusted\n *\n * @description\n * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and\n * returns the originally supplied value if the queried context type is a supertype of the\n * created type. If this condition isn't satisfied, throws an exception.\n *\n *
        \n * Disabling auto-escaping is extremely dangerous, it usually creates a Cross Site Scripting\n * (XSS) vulnerability in your application.\n *
        \n *\n * @param {string} type The kind of context in which this value is to be used.\n * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} call.\n * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} if valid in this context. Otherwise, throws an exception.\n */\n function getTrusted(type, maybeTrusted) {\n if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') {\n return maybeTrusted;\n }\n var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n if (constructor && maybeTrusted instanceof constructor) {\n return maybeTrusted.$$unwrapTrustedValue();\n }\n // If we get here, then we may only take one of two actions.\n // 1. sanitize the value for the requested type, or\n // 2. throw an exception.\n if (type === SCE_CONTEXTS.RESOURCE_URL) {\n if (isResourceUrlAllowedByPolicy(maybeTrusted)) {\n return maybeTrusted;\n } else {\n throw $sceMinErr('insecurl',\n 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}',\n maybeTrusted.toString());\n }\n } else if (type === SCE_CONTEXTS.HTML) {\n return htmlSanitizer(maybeTrusted);\n }\n throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n }\n\n return { trustAs: trustAs,\n getTrusted: getTrusted,\n valueOf: valueOf };\n }];\n}\n\n\n/**\n * @ngdoc provider\n * @name $sceProvider\n * @description\n *\n * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.\n * - enable/disable Strict Contextual Escaping (SCE) in a module\n * - override the default implementation with a custom delegate\n *\n * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.\n */\n\n/* jshint maxlen: false*/\n\n/**\n * @ngdoc service\n * @name $sce\n * @kind function\n *\n * @description\n *\n * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.\n *\n * # Strict Contextual Escaping\n *\n * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain\n * contexts to result in a value that is marked as safe to use for that context. One example of\n * such a context is binding arbitrary html controlled by the user via `ng-bind-html`. We refer\n * to these contexts as privileged or SCE contexts.\n *\n * As of version 1.2, Angular ships with SCE enabled by default.\n *\n * Note: When enabled (the default), IE<11 in quirks mode is not supported. In this mode, IE<11 allow\n * one to execute arbitrary javascript by the use of the expression() syntax. Refer\n * to learn more about them.\n * You can ensure your document is in standards mode and not quirks mode by adding ``\n * to the top of your HTML document.\n *\n * SCE assists in writing code in a way that (a) is secure by default and (b) makes auditing for\n * security vulnerabilities such as XSS, clickjacking, etc. a lot easier.\n *\n * Here's an example of a binding in a privileged context:\n *\n * ```\n * \n *
        \n * ```\n *\n * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE\n * disabled, this application allows the user to render arbitrary HTML into the DIV.\n * In a more realistic example, one may be rendering user comments, blog articles, etc. via\n * bindings. (HTML is just one example of a context where rendering user controlled input creates\n * security vulnerabilities.)\n *\n * For the case of HTML, you might use a library, either on the client side, or on the server side,\n * to sanitize unsafe HTML before binding to the value and rendering it in the document.\n *\n * How would you ensure that every place that used these types of bindings was bound to a value that\n * was sanitized by your library (or returned as safe for rendering by your server?) How can you\n * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some\n * properties/fields and forgot to update the binding to the sanitized value?\n *\n * To be secure by default, you want to ensure that any such bindings are disallowed unless you can\n * determine that something explicitly says it's safe to use a value for binding in that\n * context. You can then audit your code (a simple grep would do) to ensure that this is only done\n * for those values that you can easily tell are safe - because they were received from your server,\n * sanitized by your library, etc. You can organize your codebase to help with this - perhaps\n * allowing only the files in a specific directory to do this. Ensuring that the internal API\n * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.\n *\n * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}\n * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to\n * obtain values that will be accepted by SCE / privileged contexts.\n *\n *\n * ## How does it work?\n *\n * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted\n * $sce.getTrusted(context, value)} rather than to the value directly. Directives use {@link\n * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the\n * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals.\n *\n * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link\n * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly\n * simplified):\n *\n * ```\n * var ngBindHtmlDirective = ['$sce', function($sce) {\n * return function(scope, element, attr) {\n * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {\n * element.html(value || '');\n * });\n * };\n * }];\n * ```\n *\n * ## Impact on loading templates\n *\n * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as\n * `templateUrl`'s specified by {@link guide/directive directives}.\n *\n * By default, Angular only loads templates from the same domain and protocol as the application\n * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or\n * protocols, you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist\n * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value.\n *\n * *Please note*:\n * The browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy apply in addition to this and may further restrict whether the template is successfully\n * loaded. This means that without the right CORS policy, loading templates from a different domain\n * won't work on all browsers. Also, loading templates from `file://` URL does not work on some\n * browsers.\n *\n * ## This feels like too much overhead\n *\n * It's important to remember that SCE only applies to interpolation expressions.\n *\n * If your expressions are constant literals, they're automatically trusted and you don't need to\n * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g.\n * `
        implicitly trusted'\">
        `) just works.\n *\n * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them\n * through {@link ng.$sce#getTrusted $sce.getTrusted}. SCE doesn't play a role here.\n *\n * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load\n * templates in `ng-include` from your application's domain without having to even know about SCE.\n * It blocks loading templates from other domains or loading templates over http from an https\n * served document. You can change these by setting your own custom {@link\n * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link\n * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs.\n *\n * This significantly reduces the overhead. It is far easier to pay the small overhead and have an\n * application that's secure and can be audited to verify that with much more ease than bolting\n * security onto an application later.\n *\n * \n * ## What trusted context types are supported?\n *\n * | Context | Notes |\n * |---------------------|----------------|\n * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. |\n * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. |\n * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`
        Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. |\n * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. |\n *\n * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist}
        \n *\n * Each element in these arrays must be one of the following:\n *\n * - **'self'**\n * - The special **string**, `'self'`, can be used to match against all URLs of the **same\n * domain** as the application document using the **same protocol**.\n * - **String** (except the special value `'self'`)\n * - The string is matched against the full *normalized / absolute URL* of the resource\n * being tested (substring matches are not good enough.)\n * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters\n * match themselves.\n * - `*`: matches zero or more occurrences of any character other than one of the following 6\n * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use\n * in a whitelist.\n * - `**`: matches zero or more occurrences of *any* character. As such, it's not\n * appropriate for use in a scheme, domain, etc. as it would match too much. (e.g.\n * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might\n * not have been the intention.) Its usage at the very end of the path is ok. (e.g.\n * http://foo.example.com/templates/**).\n * - **RegExp** (*see caveat below*)\n * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax\n * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to\n * accidentally introduce a bug when one updates a complex expression (imho, all regexes should\n * have good test coverage). For instance, the use of `.` in the regex is correct only in a\n * small number of cases. A `.` character in the regex used when matching the scheme or a\n * subdomain could be matched against a `:` or literal `.` that was likely not intended. It\n * is highly recommended to use the string patterns and only fall back to regular expressions\n * as a last resort.\n * - The regular expression must be an instance of RegExp (i.e. not a string.) It is\n * matched against the **entire** *normalized / absolute URL* of the resource being tested\n * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags\n * present on the RegExp (such as multiline, global, ignoreCase) are ignored.\n * - If you are generating your JavaScript from some other templating engine (not\n * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),\n * remember to escape your regular expression (and be aware that you might need more than\n * one level of escaping depending on your templating engine and the way you interpolated\n * the value.) Do make use of your platform's escaping mechanism as it might be good\n * enough before coding your own. E.g. Ruby has\n * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)\n * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).\n * Javascript lacks a similar built in function for escaping. Take a look at Google\n * Closure library's [goog.string.regExpEscape(s)](\n * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.\n *\n * ## Show me an example using SCE.\n *\n * \n * \n *
        \n *

        \n * User comments
        \n * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when\n * $sanitize is available. If $sanitize isn't available, this results in an error instead of an\n * exploit.\n *
        \n *
        \n * {{userComment.name}}:\n * \n *
        \n *
        \n *
        \n *
        \n *
        \n *\n * \n * angular.module('mySceApp', ['ngSanitize'])\n * .controller('AppController', ['$http', '$templateCache', '$sce',\n * function($http, $templateCache, $sce) {\n * var self = this;\n * $http.get(\"test_data.json\", {cache: $templateCache}).success(function(userComments) {\n * self.userComments = userComments;\n * });\n * self.explicitlyTrustedHtml = $sce.trustAsHtml(\n * 'Hover over this text.');\n * }]);\n * \n *\n * \n * [\n * { \"name\": \"Alice\",\n * \"htmlComment\":\n * \"Is anyone reading this?\"\n * },\n * { \"name\": \"Bob\",\n * \"htmlComment\": \"Yes! Am I the only other one?\"\n * }\n * ]\n * \n *\n * \n * describe('SCE doc demo', function() {\n * it('should sanitize untrusted values', function() {\n * expect(element.all(by.css('.htmlComment')).first().getInnerHtml())\n * .toBe('Is anyone reading this?');\n * });\n *\n * it('should NOT sanitize explicitly trusted values', function() {\n * expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe(\n * 'Hover over this text.');\n * });\n * });\n * \n *
        \n *\n *\n *\n * ## Can I disable SCE completely?\n *\n * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits\n * for little coding overhead. It will be much harder to take an SCE disabled application and\n * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE\n * for cases where you have a lot of existing code that was written before SCE was introduced and\n * you're migrating them a module at a time.\n *\n * That said, here's how you can completely disable SCE:\n *\n * ```\n * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {\n * // Completely disable SCE. For demonstration purposes only!\n * // Do not use in new projects.\n * $sceProvider.enabled(false);\n * });\n * ```\n *\n */\n/* jshint maxlen: 100 */\n\nfunction $SceProvider() {\n var enabled = true;\n\n /**\n * @ngdoc method\n * @name $sceProvider#enabled\n * @kind function\n *\n * @param {boolean=} value If provided, then enables/disables SCE.\n * @return {boolean} true if SCE is enabled, false otherwise.\n *\n * @description\n * Enables/disables SCE and returns the current value.\n */\n this.enabled = function(value) {\n if (arguments.length) {\n enabled = !!value;\n }\n return enabled;\n };\n\n\n /* Design notes on the default implementation for SCE.\n *\n * The API contract for the SCE delegate\n * -------------------------------------\n * The SCE delegate object must provide the following 3 methods:\n *\n * - trustAs(contextEnum, value)\n * This method is used to tell the SCE service that the provided value is OK to use in the\n * contexts specified by contextEnum. It must return an object that will be accepted by\n * getTrusted() for a compatible contextEnum and return this value.\n *\n * - valueOf(value)\n * For values that were not produced by trustAs(), return them as is. For values that were\n * produced by trustAs(), return the corresponding input value to trustAs. Basically, if\n * trustAs is wrapping the given values into some type, this operation unwraps it when given\n * such a value.\n *\n * - getTrusted(contextEnum, value)\n * This function should return the a value that is safe to use in the context specified by\n * contextEnum or throw and exception otherwise.\n *\n * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be\n * opaque or wrapped in some holder object. That happens to be an implementation detail. For\n * instance, an implementation could maintain a registry of all trusted objects by context. In\n * such a case, trustAs() would return the same object that was passed in. getTrusted() would\n * return the same object passed in if it was found in the registry under a compatible context or\n * throw an exception otherwise. An implementation might only wrap values some of the time based\n * on some criteria. getTrusted() might return a value and not throw an exception for special\n * constants or objects even if not wrapped. All such implementations fulfill this contract.\n *\n *\n * A note on the inheritance model for SCE contexts\n * ------------------------------------------------\n * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This\n * is purely an implementation details.\n *\n * The contract is simply this:\n *\n * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value)\n * will also succeed.\n *\n * Inheritance happens to capture this in a natural way. In some future, we\n * may not use inheritance anymore. That is OK because no code outside of\n * sce.js and sceSpecs.js would need to be aware of this detail.\n */\n\n this.$get = ['$parse', '$sceDelegate', function(\n $parse, $sceDelegate) {\n // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow\n // the \"expression(javascript expression)\" syntax which is insecure.\n if (enabled && msie < 8) {\n throw $sceMinErr('iequirks',\n 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' +\n 'mode. You can fix this by adding the text to the top of your HTML ' +\n 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');\n }\n\n var sce = shallowCopy(SCE_CONTEXTS);\n\n /**\n * @ngdoc method\n * @name $sce#isEnabled\n * @kind function\n *\n * @return {Boolean} true if SCE is enabled, false otherwise. If you want to set the value, you\n * have to do it at module config time on {@link ng.$sceProvider $sceProvider}.\n *\n * @description\n * Returns a boolean indicating if SCE is enabled.\n */\n sce.isEnabled = function() {\n return enabled;\n };\n sce.trustAs = $sceDelegate.trustAs;\n sce.getTrusted = $sceDelegate.getTrusted;\n sce.valueOf = $sceDelegate.valueOf;\n\n if (!enabled) {\n sce.trustAs = sce.getTrusted = function(type, value) { return value; };\n sce.valueOf = identity;\n }\n\n /**\n * @ngdoc method\n * @name $sce#parseAs\n *\n * @description\n * Converts Angular {@link guide/expression expression} into a function. This is like {@link\n * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it\n * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*,\n * *result*)}\n *\n * @param {string} type The kind of SCE context in which this result will be used.\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n sce.parseAs = function sceParseAs(type, expr) {\n var parsed = $parse(expr);\n if (parsed.literal && parsed.constant) {\n return parsed;\n } else {\n return $parse(expr, function(value) {\n return sce.getTrusted(type, value);\n });\n }\n };\n\n /**\n * @ngdoc method\n * @name $sce#trustAs\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such,\n * returns an object that is trusted by angular for use in specified strict contextual\n * escaping contexts (such as ng-bind-html, ng-include, any src attribute\n * interpolation, any dom event binding attribute interpolation such as for onclick, etc.)\n * that uses the provided value. See * {@link ng.$sce $sce} for enabling strict contextual\n * escaping.\n *\n * @param {string} type The kind of context in which this value is safe for use. e.g. url,\n * resourceUrl, html, js and css.\n * @param {*} value The value that that should be considered trusted/safe.\n * @returns {*} A value that can be used to stand in for the provided `value` in places\n * where Angular expects a $sce.trustAs() return value.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsHtml\n *\n * @description\n * Shorthand method. `$sce.trustAsHtml(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`}\n *\n * @param {*} value The value to trustAs.\n * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml\n * $sce.getTrustedHtml(value)} to obtain the original value. (privileged directives\n * only accept expressions that are either literal constants or are the\n * return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsUrl\n *\n * @description\n * Shorthand method. `$sce.trustAsUrl(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`}\n *\n * @param {*} value The value to trustAs.\n * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl\n * $sce.getTrustedUrl(value)} to obtain the original value. (privileged directives\n * only accept expressions that are either literal constants or are the\n * return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsResourceUrl\n *\n * @description\n * Shorthand method. `$sce.trustAsResourceUrl(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}\n *\n * @param {*} value The value to trustAs.\n * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl(value)} to obtain the original value. (privileged directives\n * only accept expressions that are either literal constants or are the return\n * value of {@link ng.$sce#trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsJs\n *\n * @description\n * Shorthand method. `$sce.trustAsJs(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`}\n *\n * @param {*} value The value to trustAs.\n * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs\n * $sce.getTrustedJs(value)} to obtain the original value. (privileged directives\n * only accept expressions that are either literal constants or are the\n * return value of {@link ng.$sce#trustAs $sce.trustAs}.)\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrusted\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such,\n * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the\n * originally supplied value if the queried context type is a supertype of the created type.\n * If this condition isn't satisfied, throws an exception.\n *\n * @param {string} type The kind of context in which this value is to be used.\n * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`}\n * call.\n * @returns {*} The value the was originally provided to\n * {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context.\n * Otherwise, throws an exception.\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedHtml\n *\n * @description\n * Shorthand method. `$sce.getTrustedHtml(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedCss\n *\n * @description\n * Shorthand method. `$sce.getTrustedCss(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedUrl\n *\n * @description\n * Shorthand method. `$sce.getTrustedUrl(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedResourceUrl\n *\n * @description\n * Shorthand method. `$sce.getTrustedResourceUrl(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}\n *\n * @param {*} value The value to pass to `$sceDelegate.getTrusted`.\n * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedJs\n *\n * @description\n * Shorthand method. `$sce.getTrustedJs(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsHtml\n *\n * @description\n * Shorthand method. `$sce.parseAsHtml(expression string)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`}\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsCss\n *\n * @description\n * Shorthand method. `$sce.parseAsCss(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`}\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsUrl\n *\n * @description\n * Shorthand method. `$sce.parseAsUrl(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`}\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsResourceUrl\n *\n * @description\n * Shorthand method. `$sce.parseAsResourceUrl(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`}\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsJs\n *\n * @description\n * Shorthand method. `$sce.parseAsJs(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`}\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n */\n\n // Shorthand delegations.\n var parse = sce.parseAs,\n getTrusted = sce.getTrusted,\n trustAs = sce.trustAs;\n\n forEach(SCE_CONTEXTS, function(enumValue, name) {\n var lName = lowercase(name);\n sce[camelCase(\"parse_as_\" + lName)] = function(expr) {\n return parse(enumValue, expr);\n };\n sce[camelCase(\"get_trusted_\" + lName)] = function(value) {\n return getTrusted(enumValue, value);\n };\n sce[camelCase(\"trust_as_\" + lName)] = function(value) {\n return trustAs(enumValue, value);\n };\n });\n\n return sce;\n }];\n}\n\n/**\n * !!! This is an undocumented \"private\" service !!!\n *\n * @name $sniffer\n * @requires $window\n * @requires $document\n *\n * @property {boolean} history Does the browser support html5 history api ?\n * @property {boolean} transitions Does the browser support CSS transition events ?\n * @property {boolean} animations Does the browser support CSS animation events ?\n *\n * @description\n * This is very simple implementation of testing browser's features.\n */\nfunction $SnifferProvider() {\n this.$get = ['$window', '$document', function($window, $document) {\n var eventSupport = {},\n // Chrome Packaged Apps are not allowed to access `history.pushState`. They can be detected by\n // the presence of `chrome.app.runtime` (see https://developer.chrome.com/apps/api_index)\n isChromePackagedApp = $window.chrome && $window.chrome.app && $window.chrome.app.runtime,\n hasHistoryPushState = !isChromePackagedApp && $window.history && $window.history.pushState,\n android =\n toInt((/android (\\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),\n boxee = /Boxee/i.test(($window.navigator || {}).userAgent),\n document = $document[0] || {},\n vendorPrefix,\n vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/,\n bodyStyle = document.body && document.body.style,\n transitions = false,\n animations = false,\n match;\n\n if (bodyStyle) {\n for (var prop in bodyStyle) {\n if (match = vendorRegex.exec(prop)) {\n vendorPrefix = match[0];\n vendorPrefix = vendorPrefix[0].toUpperCase() + vendorPrefix.substr(1);\n break;\n }\n }\n\n if (!vendorPrefix) {\n vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit';\n }\n\n transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));\n animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));\n\n if (android && (!transitions || !animations)) {\n transitions = isString(bodyStyle.webkitTransition);\n animations = isString(bodyStyle.webkitAnimation);\n }\n }\n\n\n return {\n // Android has history.pushState, but it does not update location correctly\n // so let's not use the history API at all.\n // http://code.google.com/p/android/issues/detail?id=17471\n // https://github.com/angular/angular.js/issues/904\n\n // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has\n // so let's not use the history API also\n // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined\n // jshint -W018\n history: !!(hasHistoryPushState && !(android < 4) && !boxee),\n // jshint +W018\n hasEvent: function(event) {\n // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have\n // it. In particular the event is not fired when backspace or delete key are pressed or\n // when cut operation is performed.\n // IE10+ implements 'input' event but it erroneously fires under various situations,\n // e.g. when placeholder changes, or a form is focused.\n if (event === 'input' && msie <= 11) return false;\n\n if (isUndefined(eventSupport[event])) {\n var divElm = document.createElement('div');\n eventSupport[event] = 'on' + event in divElm;\n }\n\n return eventSupport[event];\n },\n csp: csp(),\n vendorPrefix: vendorPrefix,\n transitions: transitions,\n animations: animations,\n android: android\n };\n }];\n}\n\nvar $templateRequestMinErr = minErr('$compile');\n\n/**\n * @ngdoc provider\n * @name $templateRequestProvider\n * @description\n * Used to configure the options passed to the {@link $http} service when making a template request.\n *\n * For example, it can be used for specifying the \"Accept\" header that is sent to the server, when\n * requesting a template.\n */\nfunction $TemplateRequestProvider() {\n\n var httpOptions;\n\n /**\n * @ngdoc method\n * @name $templateRequestProvider#httpOptions\n * @description\n * The options to be passed to the {@link $http} service when making the request.\n * You can use this to override options such as the \"Accept\" header for template requests.\n *\n * The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the\n * options if not overridden here.\n *\n * @param {string=} value new value for the {@link $http} options.\n * @returns {string|self} Returns the {@link $http} options when used as getter and self if used as setter.\n */\n this.httpOptions = function(val) {\n if (val) {\n httpOptions = val;\n return this;\n }\n return httpOptions;\n };\n\n /**\n * @ngdoc service\n * @name $templateRequest\n *\n * @description\n * The `$templateRequest` service runs security checks then downloads the provided template using\n * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request\n * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the\n * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the\n * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted\n * when `tpl` is of type string and `$templateCache` has the matching entry.\n *\n * If you want to pass custom options to the `$http` service, such as setting the Accept header you\n * can configure this via {@link $templateRequestProvider#httpOptions}.\n *\n * @param {string|TrustedResourceUrl} tpl The HTTP request template URL\n * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty\n *\n * @return {Promise} a promise for the HTTP response data of the given URL.\n *\n * @property {number} totalPendingRequests total amount of pending template requests being downloaded.\n */\n this.$get = ['$templateCache', '$http', '$q', '$sce', function($templateCache, $http, $q, $sce) {\n\n function handleRequestFn(tpl, ignoreRequestError) {\n handleRequestFn.totalPendingRequests++;\n\n // We consider the template cache holds only trusted templates, so\n // there's no need to go through whitelisting again for keys that already\n // are included in there. This also makes Angular accept any script\n // directive, no matter its name. However, we still need to unwrap trusted\n // types.\n if (!isString(tpl) || isUndefined($templateCache.get(tpl))) {\n tpl = $sce.getTrustedResourceUrl(tpl);\n }\n\n var transformResponse = $http.defaults && $http.defaults.transformResponse;\n\n if (isArray(transformResponse)) {\n transformResponse = transformResponse.filter(function(transformer) {\n return transformer !== defaultHttpResponseTransform;\n });\n } else if (transformResponse === defaultHttpResponseTransform) {\n transformResponse = null;\n }\n\n return $http.get(tpl, extend({\n cache: $templateCache,\n transformResponse: transformResponse\n }, httpOptions))\n ['finally'](function() {\n handleRequestFn.totalPendingRequests--;\n })\n .then(function(response) {\n $templateCache.put(tpl, response.data);\n return response.data;\n }, handleError);\n\n function handleError(resp) {\n if (!ignoreRequestError) {\n throw $templateRequestMinErr('tpload', 'Failed to load template: {0} (HTTP status: {1} {2})',\n tpl, resp.status, resp.statusText);\n }\n return $q.reject(resp);\n }\n }\n\n handleRequestFn.totalPendingRequests = 0;\n\n return handleRequestFn;\n }];\n}\n\nfunction $$TestabilityProvider() {\n this.$get = ['$rootScope', '$browser', '$location',\n function($rootScope, $browser, $location) {\n\n /**\n * @name $testability\n *\n * @description\n * The private $$testability service provides a collection of methods for use when debugging\n * or by automated test and debugging tools.\n */\n var testability = {};\n\n /**\n * @name $$testability#findBindings\n *\n * @description\n * Returns an array of elements that are bound (via ng-bind or {{}})\n * to expressions matching the input.\n *\n * @param {Element} element The element root to search from.\n * @param {string} expression The binding expression to match.\n * @param {boolean} opt_exactMatch If true, only returns exact matches\n * for the expression. Filters and whitespace are ignored.\n */\n testability.findBindings = function(element, expression, opt_exactMatch) {\n var bindings = element.getElementsByClassName('ng-binding');\n var matches = [];\n forEach(bindings, function(binding) {\n var dataBinding = angular.element(binding).data('$binding');\n if (dataBinding) {\n forEach(dataBinding, function(bindingName) {\n if (opt_exactMatch) {\n var matcher = new RegExp('(^|\\\\s)' + escapeForRegexp(expression) + '(\\\\s|\\\\||$)');\n if (matcher.test(bindingName)) {\n matches.push(binding);\n }\n } else {\n if (bindingName.indexOf(expression) != -1) {\n matches.push(binding);\n }\n }\n });\n }\n });\n return matches;\n };\n\n /**\n * @name $$testability#findModels\n *\n * @description\n * Returns an array of elements that are two-way found via ng-model to\n * expressions matching the input.\n *\n * @param {Element} element The element root to search from.\n * @param {string} expression The model expression to match.\n * @param {boolean} opt_exactMatch If true, only returns exact matches\n * for the expression.\n */\n testability.findModels = function(element, expression, opt_exactMatch) {\n var prefixes = ['ng-', 'data-ng-', 'ng\\\\:'];\n for (var p = 0; p < prefixes.length; ++p) {\n var attributeEquals = opt_exactMatch ? '=' : '*=';\n var selector = '[' + prefixes[p] + 'model' + attributeEquals + '\"' + expression + '\"]';\n var elements = element.querySelectorAll(selector);\n if (elements.length) {\n return elements;\n }\n }\n };\n\n /**\n * @name $$testability#getLocation\n *\n * @description\n * Shortcut for getting the location in a browser agnostic way. Returns\n * the path, search, and hash. (e.g. /path?a=b#hash)\n */\n testability.getLocation = function() {\n return $location.url();\n };\n\n /**\n * @name $$testability#setLocation\n *\n * @description\n * Shortcut for navigating to a location without doing a full page reload.\n *\n * @param {string} url The location url (path, search and hash,\n * e.g. /path?a=b#hash) to go to.\n */\n testability.setLocation = function(url) {\n if (url !== $location.url()) {\n $location.url(url);\n $rootScope.$digest();\n }\n };\n\n /**\n * @name $$testability#whenStable\n *\n * @description\n * Calls the callback when $timeout and $http requests are completed.\n *\n * @param {function} callback\n */\n testability.whenStable = function(callback) {\n $browser.notifyWhenNoOutstandingRequests(callback);\n };\n\n return testability;\n }];\n}\n\nfunction $TimeoutProvider() {\n this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',\n function($rootScope, $browser, $q, $$q, $exceptionHandler) {\n\n var deferreds = {};\n\n\n /**\n * @ngdoc service\n * @name $timeout\n *\n * @description\n * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch\n * block and delegates any exceptions to\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * The return value of calling `$timeout` is a promise, which will be resolved when\n * the delay has passed and the timeout function, if provided, is executed.\n *\n * To cancel a timeout request, call `$timeout.cancel(promise)`.\n *\n * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to\n * synchronously flush the queue of deferred functions.\n *\n * If you only want a promise that will be resolved after some specified delay\n * then you can call `$timeout` without the `fn` function.\n *\n * @param {function()=} fn A function, whose execution should be delayed.\n * @param {number=} [delay=0] Delay in milliseconds.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {Promise} Promise that will be resolved when the timeout is reached. The promise\n * will be resolved with the return value of the `fn` function.\n *\n */\n function timeout(fn, delay, invokeApply) {\n if (!isFunction(fn)) {\n invokeApply = delay;\n delay = fn;\n fn = noop;\n }\n\n var args = sliceArgs(arguments, 3),\n skipApply = (isDefined(invokeApply) && !invokeApply),\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise,\n timeoutId;\n\n timeoutId = $browser.defer(function() {\n try {\n deferred.resolve(fn.apply(null, args));\n } catch (e) {\n deferred.reject(e);\n $exceptionHandler(e);\n }\n finally {\n delete deferreds[promise.$$timeoutId];\n }\n\n if (!skipApply) $rootScope.$apply();\n }, delay);\n\n promise.$$timeoutId = timeoutId;\n deferreds[timeoutId] = deferred;\n\n return promise;\n }\n\n\n /**\n * @ngdoc method\n * @name $timeout#cancel\n *\n * @description\n * Cancels a task associated with the `promise`. As a result of this, the promise will be\n * resolved with a rejection.\n *\n * @param {Promise=} promise Promise returned by the `$timeout` function.\n * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n * canceled.\n */\n timeout.cancel = function(promise) {\n if (promise && promise.$$timeoutId in deferreds) {\n deferreds[promise.$$timeoutId].reject('canceled');\n delete deferreds[promise.$$timeoutId];\n return $browser.defer.cancel(promise.$$timeoutId);\n }\n return false;\n };\n\n return timeout;\n }];\n}\n\n// NOTE: The usage of window and document instead of $window and $document here is\n// deliberate. This service depends on the specific behavior of anchor nodes created by the\n// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and\n// cause us to break tests. In addition, when the browser resolves a URL for XHR, it\n// doesn't know about mocked locations and resolves URLs to the real document - which is\n// exactly the behavior needed here. There is little value is mocking these out for this\n// service.\nvar urlParsingNode = window.document.createElement(\"a\");\nvar originUrl = urlResolve(window.location.href);\n\n\n/**\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL. Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL. This approach has wide\n * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers. However, the parsed components will not be set if the URL assigned did not specify\n * them. (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.) We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * References:\n * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n * http://url.spec.whatwg.org/#urlutils\n * https://github.com/angular/angular.js/pull/2902\n * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string} url The URL to be parsed.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n * | member name | Description |\n * |---------------|----------------|\n * | href | A normalized version of the provided URL if it was not an absolute URL |\n * | protocol | The protocol including the trailing colon |\n * | host | The host and port (if the port is non-default) of the normalizedUrl |\n * | search | The search params, minus the question mark |\n * | hash | The hash string, minus the hash symbol\n * | hostname | The hostname\n * | port | The port, without \":\"\n * | pathname | The pathname, beginning with \"/\"\n *\n */\nfunction urlResolve(url) {\n var href = url;\n\n if (msie) {\n // Normalize before parse. Refer Implementation Notes on why this is\n // done in two steps on IE.\n urlParsingNode.setAttribute(\"href\", href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/')\n ? urlParsingNode.pathname\n : '/' + urlParsingNode.pathname\n };\n}\n\n/**\n * Parse a request URL and determine whether this is a same-origin request as the application document.\n *\n * @param {string|object} requestUrl The url of the request as a string that will be resolved\n * or a parsed URL object.\n * @returns {boolean} Whether the request is for the same origin as the application document.\n */\nfunction urlIsSameOrigin(requestUrl) {\n var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;\n return (parsed.protocol === originUrl.protocol &&\n parsed.host === originUrl.host);\n}\n\n/**\n * @ngdoc service\n * @name $window\n *\n * @description\n * A reference to the browser's `window` object. While `window`\n * is globally available in JavaScript, it causes testability problems, because\n * it is a global variable. In angular we always refer to it through the\n * `$window` service, so it may be overridden, removed or mocked for testing.\n *\n * Expressions, like the one defined for the `ngClick` directive in the example\n * below, are evaluated with respect to the current scope. Therefore, there is\n * no risk of inadvertently coding in a dependency on a global value in such an\n * expression.\n *\n * @example\n \n \n \n
        \n \n \n
        \n
        \n \n it('should display the greeting in the input box', function() {\n element(by.model('greeting')).sendKeys('Hello, E2E Tests');\n // If we click the button it will block the test runner\n // element(':button').click();\n });\n \n
        \n */\nfunction $WindowProvider() {\n this.$get = valueFn(window);\n}\n\n/**\n * @name $$cookieReader\n * @requires $document\n *\n * @description\n * This is a private service for reading cookies used by $http and ngCookies\n *\n * @return {Object} a key/value map of the current cookies\n */\nfunction $$CookieReader($document) {\n var rawDocument = $document[0] || {};\n var lastCookies = {};\n var lastCookieString = '';\n\n function safeDecodeURIComponent(str) {\n try {\n return decodeURIComponent(str);\n } catch (e) {\n return str;\n }\n }\n\n return function() {\n var cookieArray, cookie, i, index, name;\n var currentCookieString = rawDocument.cookie || '';\n\n if (currentCookieString !== lastCookieString) {\n lastCookieString = currentCookieString;\n cookieArray = lastCookieString.split('; ');\n lastCookies = {};\n\n for (i = 0; i < cookieArray.length; i++) {\n cookie = cookieArray[i];\n index = cookie.indexOf('=');\n if (index > 0) { //ignore nameless cookies\n name = safeDecodeURIComponent(cookie.substring(0, index));\n // the first value that is seen for a cookie is the most\n // specific one. values for the same cookie name that\n // follow are for less specific paths.\n if (isUndefined(lastCookies[name])) {\n lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));\n }\n }\n }\n }\n return lastCookies;\n };\n}\n\n$$CookieReader.$inject = ['$document'];\n\nfunction $$CookieReaderProvider() {\n this.$get = $$CookieReader;\n}\n\n/* global currencyFilter: true,\n dateFilter: true,\n filterFilter: true,\n jsonFilter: true,\n limitToFilter: true,\n lowercaseFilter: true,\n numberFilter: true,\n orderByFilter: true,\n uppercaseFilter: true,\n */\n\n/**\n * @ngdoc provider\n * @name $filterProvider\n * @description\n *\n * Filters are just functions which transform input to an output. However filters need to be\n * Dependency Injected. To achieve this a filter definition consists of a factory function which is\n * annotated with dependencies and is responsible for creating a filter function.\n *\n *
        \n * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n *
        \n *\n * ```js\n * // Filter registration\n * function MyModule($provide, $filterProvider) {\n * // create a service to demonstrate injection (not always needed)\n * $provide.value('greet', function(name){\n * return 'Hello ' + name + '!';\n * });\n *\n * // register a filter factory which uses the\n * // greet service to demonstrate DI.\n * $filterProvider.register('greet', function(greet){\n * // return the filter function which uses the greet service\n * // to generate salutation\n * return function(text) {\n * // filters need to be forgiving so check input validity\n * return text && greet(text) || text;\n * };\n * });\n * }\n * ```\n *\n * The filter function is registered with the `$injector` under the filter name suffix with\n * `Filter`.\n *\n * ```js\n * it('should be the same instance', inject(\n * function($filterProvider) {\n * $filterProvider.register('reverse', function(){\n * return ...;\n * });\n * },\n * function($filter, reverseFilter) {\n * expect($filter('reverse')).toBe(reverseFilter);\n * });\n * ```\n *\n *\n * For more information about how angular filters work, and how to create your own filters, see\n * {@link guide/filter Filters} in the Angular Developer Guide.\n */\n\n/**\n * @ngdoc service\n * @name $filter\n * @kind function\n * @description\n * Filters are used for formatting data displayed to the user.\n *\n * The general syntax in templates is as follows:\n *\n * {{ expression [| filter_name[:parameter_value] ... ] }}\n *\n * @param {String} name Name of the filter function to retrieve\n * @return {Function} the filter function\n * @example\n \n \n
        \n

        {{ originalText }}

        \n

        {{ filteredText }}

        \n
        \n
        \n\n \n angular.module('filterExample', [])\n .controller('MainCtrl', function($scope, $filter) {\n $scope.originalText = 'hello';\n $scope.filteredText = $filter('uppercase')($scope.originalText);\n });\n \n
        \n */\n$FilterProvider.$inject = ['$provide'];\nfunction $FilterProvider($provide) {\n var suffix = 'Filter';\n\n /**\n * @ngdoc method\n * @name $filterProvider#register\n * @param {string|Object} name Name of the filter function, or an object map of filters where\n * the keys are the filter names and the values are the filter factories.\n *\n *
        \n * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n *
        \n * @param {Function} factory If the first argument was a string, a factory function for the filter to be registered.\n * @returns {Object} Registered filter instance, or if a map of filters was provided then a map\n * of the registered filter instances.\n */\n function register(name, factory) {\n if (isObject(name)) {\n var filters = {};\n forEach(name, function(filter, key) {\n filters[key] = register(key, filter);\n });\n return filters;\n } else {\n return $provide.factory(name + suffix, factory);\n }\n }\n this.register = register;\n\n this.$get = ['$injector', function($injector) {\n return function(name) {\n return $injector.get(name + suffix);\n };\n }];\n\n ////////////////////////////////////////\n\n /* global\n currencyFilter: false,\n dateFilter: false,\n filterFilter: false,\n jsonFilter: false,\n limitToFilter: false,\n lowercaseFilter: false,\n numberFilter: false,\n orderByFilter: false,\n uppercaseFilter: false,\n */\n\n register('currency', currencyFilter);\n register('date', dateFilter);\n register('filter', filterFilter);\n register('json', jsonFilter);\n register('limitTo', limitToFilter);\n register('lowercase', lowercaseFilter);\n register('number', numberFilter);\n register('orderBy', orderByFilter);\n register('uppercase', uppercaseFilter);\n}\n\n/**\n * @ngdoc filter\n * @name filter\n * @kind function\n *\n * @description\n * Selects a subset of items from `array` and returns it as a new array.\n *\n * @param {Array} array The source array.\n * @param {string|Object|function()} expression The predicate to be used for selecting items from\n * `array`.\n *\n * Can be one of:\n *\n * - `string`: The string is used for matching against the contents of the `array`. All strings or\n * objects with string properties in `array` that match this string will be returned. This also\n * applies to nested object properties.\n * The predicate can be negated by prefixing the string with `!`.\n *\n * - `Object`: A pattern object can be used to filter specific properties on objects contained\n * by `array`. For example `{name:\"M\", phone:\"1\"}` predicate will return an array of items\n * which have property `name` containing \"M\" and property `phone` containing \"1\". A special\n * property name (`$` by default) can be used (e.g. as in `{$: \"text\"}`) to accept a match\n * against any property of the object or its nested object properties. That's equivalent to the\n * simple substring match with a `string` as described above. The special property name can be\n * overwritten, using the `anyPropertyKey` parameter.\n * The predicate can be negated by prefixing the string with `!`.\n * For example `{name: \"!M\"}` predicate will return an array of items which have property `name`\n * not containing \"M\".\n *\n * Note that a named property will match properties on the same level only, while the special\n * `$` property will match properties on the same level or deeper. E.g. an array item like\n * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but\n * **will** be matched by `{$: 'John'}`.\n *\n * - `function(value, index, array)`: A predicate function can be used to write arbitrary filters.\n * The function is called for each element of the array, with the element, its index, and\n * the entire array itself as arguments.\n *\n * The final result is an array of those elements that the predicate returned true for.\n *\n * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in\n * determining if the expected value (from the filter expression) and actual value (from\n * the object in the array) should be considered a match.\n *\n * Can be one of:\n *\n * - `function(actual, expected)`:\n * The function will be given the object value and the predicate value to compare and\n * should return true if both values should be considered equal.\n *\n * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.\n * This is essentially strict comparison of expected and actual.\n *\n * - `false|undefined`: A short hand for a function which will look for a substring match in case\n * insensitive way.\n *\n * Primitive values are converted to strings. Objects are not compared against primitives,\n * unless they have a custom `toString` method (e.g. `Date` objects).\n *\n * @param {string=} anyPropertyKey The special property name that matches against any property.\n * By default `$`.\n *\n * @example\n \n \n
        \n\n \n \n \n \n \n \n \n
        NamePhone
        {{friend.name}}{{friend.phone}}
        \n
        \n
        \n
        \n
        \n
        \n \n \n \n \n \n \n
        NamePhone
        {{friendObj.name}}{{friendObj.phone}}
        \n
        \n \n var expectFriendNames = function(expectedNames, key) {\n element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) {\n arr.forEach(function(wd, i) {\n expect(wd.getText()).toMatch(expectedNames[i]);\n });\n });\n };\n\n it('should search across all fields when filtering with a string', function() {\n var searchText = element(by.model('searchText'));\n searchText.clear();\n searchText.sendKeys('m');\n expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend');\n\n searchText.clear();\n searchText.sendKeys('76');\n expectFriendNames(['John', 'Julie'], 'friend');\n });\n\n it('should search in specific fields when filtering with a predicate object', function() {\n var searchAny = element(by.model('search.$'));\n searchAny.clear();\n searchAny.sendKeys('i');\n expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj');\n });\n it('should use a equal comparison when comparator is true', function() {\n var searchName = element(by.model('search.name'));\n var strict = element(by.model('strict'));\n searchName.clear();\n searchName.sendKeys('Julie');\n strict.click();\n expectFriendNames(['Julie'], 'friendObj');\n });\n \n
        \n */\n\nfunction filterFilter() {\n return function(array, expression, comparator, anyPropertyKey) {\n if (!isArrayLike(array)) {\n if (array == null) {\n return array;\n } else {\n throw minErr('filter')('notarray', 'Expected array but received: {0}', array);\n }\n }\n\n anyPropertyKey = anyPropertyKey || '$';\n var expressionType = getTypeForFilter(expression);\n var predicateFn;\n var matchAgainstAnyProp;\n\n switch (expressionType) {\n case 'function':\n predicateFn = expression;\n break;\n case 'boolean':\n case 'null':\n case 'number':\n case 'string':\n matchAgainstAnyProp = true;\n //jshint -W086\n case 'object':\n //jshint +W086\n predicateFn = createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n break;\n default:\n return array;\n }\n\n return Array.prototype.filter.call(array, predicateFn);\n };\n}\n\n// Helper functions for `filterFilter`\nfunction createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}\n\nfunction deepCompare(actual, expected, comparator, anyPropertyKey, matchAgainstAnyProp, dontMatchWholeObject) {\n var actualType = getTypeForFilter(actual);\n var expectedType = getTypeForFilter(expected);\n\n if ((expectedType === 'string') && (expected.charAt(0) === '!')) {\n return !deepCompare(actual, expected.substring(1), comparator, anyPropertyKey, matchAgainstAnyProp);\n } else if (isArray(actual)) {\n // In case `actual` is an array, consider it a match\n // if ANY of it's items matches `expected`\n return actual.some(function(item) {\n return deepCompare(item, expected, comparator, anyPropertyKey, matchAgainstAnyProp);\n });\n }\n\n switch (actualType) {\n case 'object':\n var key;\n if (matchAgainstAnyProp) {\n for (key in actual) {\n if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, anyPropertyKey, true)) {\n return true;\n }\n }\n return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, anyPropertyKey, false);\n } else if (expectedType === 'object') {\n for (key in expected) {\n var expectedVal = expected[key];\n if (isFunction(expectedVal) || isUndefined(expectedVal)) {\n continue;\n }\n\n var matchAnyProperty = key === anyPropertyKey;\n var actualVal = matchAnyProperty ? actual : actual[key];\n if (!deepCompare(actualVal, expectedVal, comparator, anyPropertyKey, matchAnyProperty, matchAnyProperty)) {\n return false;\n }\n }\n return true;\n } else {\n return comparator(actual, expected);\n }\n break;\n case 'function':\n return false;\n default:\n return comparator(actual, expected);\n }\n}\n\n// Used for easily differentiating between `null` and actual `object`\nfunction getTypeForFilter(val) {\n return (val === null) ? 'null' : typeof val;\n}\n\nvar MAX_DIGITS = 22;\nvar DECIMAL_SEP = '.';\nvar ZERO_CHAR = '0';\n\n/**\n * @ngdoc filter\n * @name currency\n * @kind function\n *\n * @description\n * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default\n * symbol for current locale is used.\n *\n * @param {number} amount Input to filter.\n * @param {string=} symbol Currency symbol or identifier to be displayed.\n * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale\n * @returns {string} Formatted number.\n *\n *\n * @example\n \n \n \n
        \n
        \n default currency symbol ($): {{amount | currency}}
        \n custom currency identifier (USD$): {{amount | currency:\"USD$\"}}\n no fractions (0): {{amount | currency:\"USD$\":0}}\n
        \n
        \n \n it('should init with 1234.56', function() {\n expect(element(by.id('currency-default')).getText()).toBe('$1,234.56');\n expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56');\n expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235');\n });\n it('should update', function() {\n if (browser.params.browser == 'safari') {\n // Safari does not understand the minus key. See\n // https://github.com/angular/protractor/issues/481\n return;\n }\n element(by.model('amount')).clear();\n element(by.model('amount')).sendKeys('-1234');\n expect(element(by.id('currency-default')).getText()).toBe('-$1,234.00');\n expect(element(by.id('currency-custom')).getText()).toBe('-USD$1,234.00');\n expect(element(by.id('currency-no-fractions')).getText()).toBe('-USD$1,234');\n });\n \n
        \n */\ncurrencyFilter.$inject = ['$locale'];\nfunction currencyFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function(amount, currencySymbol, fractionSize) {\n if (isUndefined(currencySymbol)) {\n currencySymbol = formats.CURRENCY_SYM;\n }\n\n if (isUndefined(fractionSize)) {\n fractionSize = formats.PATTERNS[1].maxFrac;\n }\n\n // if null or undefined pass it through\n return (amount == null)\n ? amount\n : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize).\n replace(/\\u00A4/g, currencySymbol);\n };\n}\n\n/**\n * @ngdoc filter\n * @name number\n * @kind function\n *\n * @description\n * Formats a number as text.\n *\n * If the input is null or undefined, it will just be returned.\n * If the input is infinite (Infinity or -Infinity), the Infinity symbol '∞' or '-∞' is returned, respectively.\n * If the input is not a number an empty string is returned.\n *\n *\n * @param {number|string} number Number to format.\n * @param {(number|string)=} fractionSize Number of decimal places to round the number to.\n * If this is not provided then the fraction size is computed from the current locale's number\n * formatting pattern. In the case of the default locale, it will be 3.\n * @returns {string} Number rounded to `fractionSize` appropriately formatted based on the current\n * locale (e.g., in the en_US locale it will have \".\" as the decimal separator and\n * include \",\" group separators after each third digit).\n *\n * @example\n \n \n \n
        \n
        \n Default formatting: {{val | number}}
        \n No fractions: {{val | number:0}}
        \n Negative number: {{-val | number:4}}\n
        \n
        \n \n it('should format numbers', function() {\n expect(element(by.id('number-default')).getText()).toBe('1,234.568');\n expect(element(by.binding('val | number:0')).getText()).toBe('1,235');\n expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679');\n });\n\n it('should update', function() {\n element(by.model('val')).clear();\n element(by.model('val')).sendKeys('3374.333');\n expect(element(by.id('number-default')).getText()).toBe('3,374.333');\n expect(element(by.binding('val | number:0')).getText()).toBe('3,374');\n expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330');\n });\n \n
        \n */\nnumberFilter.$inject = ['$locale'];\nfunction numberFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function(number, fractionSize) {\n\n // if null or undefined pass it through\n return (number == null)\n ? number\n : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,\n fractionSize);\n };\n}\n\n/**\n * Parse a number (as a string) into three components that can be used\n * for formatting the number.\n *\n * (Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/)\n *\n * @param {string} numStr The number to parse\n * @return {object} An object describing this number, containing the following keys:\n * - d : an array of digits containing leading zeros as necessary\n * - i : the number of the digits in `d` that are to the left of the decimal point\n * - e : the exponent for numbers that would need more than `MAX_DIGITS` digits in `d`\n *\n */\nfunction parse(numStr) {\n var exponent = 0, digits, numberOfIntegerDigits;\n var i, j, zeros;\n\n // Decimal point?\n if ((numberOfIntegerDigits = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (numberOfIntegerDigits < 0) numberOfIntegerDigits = i;\n numberOfIntegerDigits += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n } else if (numberOfIntegerDigits < 0) {\n // There was no decimal point or exponent so it is an integer.\n numberOfIntegerDigits = numStr.length;\n }\n\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) == ZERO_CHAR; i++) {/* jshint noempty: false */}\n\n if (i == (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n numberOfIntegerDigits = 1;\n } else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) == ZERO_CHAR) zeros--;\n\n // Trailing zeros are insignificant so ignore them\n numberOfIntegerDigits -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = +numStr.charAt(i);\n }\n }\n\n // If the number overflows the maximum allowed digits then use an exponent.\n if (numberOfIntegerDigits > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = numberOfIntegerDigits - 1;\n numberOfIntegerDigits = 1;\n }\n\n return { d: digits, e: exponent, i: numberOfIntegerDigits };\n}\n\n/**\n * Round the parsed number to the specified number of decimal places\n * This function changed the parsedNumber in-place\n */\nfunction roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {\n var digits = parsedNumber.d;\n var fractionLen = digits.length - parsedNumber.i;\n\n // determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;\n\n // The index of the digit to where rounding is to occur\n var roundAt = fractionSize + parsedNumber.i;\n var digit = digits[roundAt];\n\n if (roundAt > 0) {\n // Drop fractional digits beyond `roundAt`\n digits.splice(Math.max(parsedNumber.i, roundAt));\n\n // Set non-fractional digits beyond `roundAt` to 0\n for (var j = roundAt; j < digits.length; j++) {\n digits[j] = 0;\n }\n } else {\n // We rounded to zero so reset the parsedNumber\n fractionLen = Math.max(0, fractionLen);\n parsedNumber.i = 1;\n digits.length = Math.max(1, roundAt = fractionSize + 1);\n digits[0] = 0;\n for (var i = 1; i < roundAt; i++) digits[i] = 0;\n }\n\n if (digit >= 5) {\n if (roundAt - 1 < 0) {\n for (var k = 0; k > roundAt; k--) {\n digits.unshift(0);\n parsedNumber.i++;\n }\n digits.unshift(1);\n parsedNumber.i++;\n } else {\n digits[roundAt - 1]++;\n }\n }\n\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);\n\n\n // Do any carrying, e.g. a digit was rounded up to 10\n var carry = digits.reduceRight(function(carry, d, i, digits) {\n d = d + carry;\n digits[i] = d % 10;\n return Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.i++;\n }\n}\n\n/**\n * Format a number into a string\n * @param {number} number The number to format\n * @param {{\n * minFrac, // the minimum number of digits required in the fraction part of the number\n * maxFrac, // the maximum number of digits required in the fraction part of the number\n * gSize, // number of digits in each group of separated digits\n * lgSize, // number of digits in the last group of digits before the decimal separator\n * negPre, // the string to go in front of a negative number (e.g. `-` or `(`))\n * posPre, // the string to go in front of a positive number\n * negSuf, // the string to go after a negative number (e.g. `)`)\n * posSuf // the string to go after a positive number\n * }} pattern\n * @param {string} groupSep The string to separate groups of number (e.g. `,`)\n * @param {string} decimalSep The string to act as the decimal separator (e.g. `.`)\n * @param {[type]} fractionSize The size of the fractional part of the number\n * @return {string} The number formatted as a string\n */\nfunction formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {\n\n if (!(isString(number) || isNumber(number)) || isNaN(number)) return '';\n\n var isInfinity = !isFinite(number);\n var isZero = false;\n var numStr = Math.abs(number) + '',\n formattedText = '',\n parsedNumber;\n\n if (isInfinity) {\n formattedText = '\\u221e';\n } else {\n parsedNumber = parse(numStr);\n\n roundNumber(parsedNumber, fractionSize, pattern.minFrac, pattern.maxFrac);\n\n var digits = parsedNumber.d;\n var integerLen = parsedNumber.i;\n var exponent = parsedNumber.e;\n var decimals = [];\n isZero = digits.reduce(function(isZero, d) { return isZero && !d; }, true);\n\n // pad zeros for small numbers\n while (integerLen < 0) {\n digits.unshift(0);\n integerLen++;\n }\n\n // extract decimals digits\n if (integerLen > 0) {\n decimals = digits.splice(integerLen, digits.length);\n } else {\n decimals = digits;\n digits = [0];\n }\n\n // format the integer digits with grouping separators\n var groups = [];\n if (digits.length >= pattern.lgSize) {\n groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));\n }\n while (digits.length > pattern.gSize) {\n groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));\n }\n if (digits.length) {\n groups.unshift(digits.join(''));\n }\n formattedText = groups.join(groupSep);\n\n // append the decimal digits\n if (decimals.length) {\n formattedText += decimalSep + decimals.join('');\n }\n\n if (exponent) {\n formattedText += 'e+' + exponent;\n }\n }\n if (number < 0 && !isZero) {\n return pattern.negPre + formattedText + pattern.negSuf;\n } else {\n return pattern.posPre + formattedText + pattern.posSuf;\n }\n}\n\nfunction padNumber(num, digits, trim, negWrap) {\n var neg = '';\n if (num < 0 || (negWrap && num <= 0)) {\n if (negWrap) {\n num = -num + 1;\n } else {\n num = -num;\n neg = '-';\n }\n }\n num = '' + num;\n while (num.length < digits) num = ZERO_CHAR + num;\n if (trim) {\n num = num.substr(num.length - digits);\n }\n return neg + num;\n}\n\n\nfunction dateGetter(name, size, offset, trim, negWrap) {\n offset = offset || 0;\n return function(date) {\n var value = date['get' + name]();\n if (offset > 0 || value > -offset) {\n value += offset;\n }\n if (value === 0 && offset == -12) value = 12;\n return padNumber(value, size, trim, negWrap);\n };\n}\n\nfunction dateStrGetter(name, shortForm, standAlone) {\n return function(date, formats) {\n var value = date['get' + name]();\n var propPrefix = (standAlone ? 'STANDALONE' : '') + (shortForm ? 'SHORT' : '');\n var get = uppercase(propPrefix + name);\n\n return formats[get][value];\n };\n}\n\nfunction timeZoneGetter(date, formats, offset) {\n var zone = -1 * offset;\n var paddedZone = (zone >= 0) ? \"+\" : \"\";\n\n paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +\n padNumber(Math.abs(zone % 60), 2);\n\n return paddedZone;\n}\n\nfunction getFirstThursdayOfYear(year) {\n // 0 = index of January\n var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay();\n // 4 = index of Thursday (+1 to account for 1st = 5)\n // 11 = index of *next* Thursday (+1 account for 1st = 12)\n return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst);\n}\n\nfunction getThursdayThisWeek(datetime) {\n return new Date(datetime.getFullYear(), datetime.getMonth(),\n // 4 = index of Thursday\n datetime.getDate() + (4 - datetime.getDay()));\n}\n\nfunction weekGetter(size) {\n return function(date) {\n var firstThurs = getFirstThursdayOfYear(date.getFullYear()),\n thisThurs = getThursdayThisWeek(date);\n\n var diff = +thisThurs - +firstThurs,\n result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n\n return padNumber(result, size);\n };\n}\n\nfunction ampmGetter(date, formats) {\n return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];\n}\n\nfunction eraGetter(date, formats) {\n return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1];\n}\n\nfunction longEraGetter(date, formats) {\n return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1];\n}\n\nvar DATE_FORMATS = {\n yyyy: dateGetter('FullYear', 4, 0, false, true),\n yy: dateGetter('FullYear', 2, 0, true, true),\n y: dateGetter('FullYear', 1, 0, false, true),\n MMMM: dateStrGetter('Month'),\n MMM: dateStrGetter('Month', true),\n MM: dateGetter('Month', 2, 1),\n M: dateGetter('Month', 1, 1),\n LLLL: dateStrGetter('Month', false, true),\n dd: dateGetter('Date', 2),\n d: dateGetter('Date', 1),\n HH: dateGetter('Hours', 2),\n H: dateGetter('Hours', 1),\n hh: dateGetter('Hours', 2, -12),\n h: dateGetter('Hours', 1, -12),\n mm: dateGetter('Minutes', 2),\n m: dateGetter('Minutes', 1),\n ss: dateGetter('Seconds', 2),\n s: dateGetter('Seconds', 1),\n // while ISO 8601 requires fractions to be prefixed with `.` or `,`\n // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions\n sss: dateGetter('Milliseconds', 3),\n EEEE: dateStrGetter('Day'),\n EEE: dateStrGetter('Day', true),\n a: ampmGetter,\n Z: timeZoneGetter,\n ww: weekGetter(2),\n w: weekGetter(1),\n G: eraGetter,\n GG: eraGetter,\n GGG: eraGetter,\n GGGG: longEraGetter\n};\n\nvar DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,\n NUMBER_STRING = /^\\-?\\d+$/;\n\n/**\n * @ngdoc filter\n * @name date\n * @kind function\n *\n * @description\n * Formats `date` to a string based on the requested `format`.\n *\n * `format` string can be composed of the following elements:\n *\n * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)\n * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)\n * * `'MMMM'`: Month in year (January-December)\n * * `'MMM'`: Month in year (Jan-Dec)\n * * `'MM'`: Month in year, padded (01-12)\n * * `'M'`: Month in year (1-12)\n * * `'LLLL'`: Stand-alone month in year (January-December)\n * * `'dd'`: Day in month, padded (01-31)\n * * `'d'`: Day in month (1-31)\n * * `'EEEE'`: Day in Week,(Sunday-Saturday)\n * * `'EEE'`: Day in Week, (Sun-Sat)\n * * `'HH'`: Hour in day, padded (00-23)\n * * `'H'`: Hour in day (0-23)\n * * `'hh'`: Hour in AM/PM, padded (01-12)\n * * `'h'`: Hour in AM/PM, (1-12)\n * * `'mm'`: Minute in hour, padded (00-59)\n * * `'m'`: Minute in hour (0-59)\n * * `'ss'`: Second in minute, padded (00-59)\n * * `'s'`: Second in minute (0-59)\n * * `'sss'`: Millisecond in second, padded (000-999)\n * * `'a'`: AM/PM marker\n * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200)\n * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year\n * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year\n * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD')\n * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini')\n *\n * `format` string can also be one of the following predefined\n * {@link guide/i18n localizable formats}:\n *\n * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale\n * (e.g. Sep 3, 2010 12:05:08 PM)\n * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 PM)\n * * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US locale\n * (e.g. Friday, September 3, 2010)\n * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010)\n * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010)\n * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)\n * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM)\n * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM)\n *\n * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g.\n * `\"h 'in the morning'\"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence\n * (e.g. `\"h 'o''clock'\"`).\n *\n * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or\n * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its\n * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is\n * specified in the string input, the time is considered to be in the local timezone.\n * @param {string=} format Formatting rules (see Description). If not specified,\n * `mediumDate` is used.\n * @param {string=} timezone Timezone to be used for formatting. It understands UTC/GMT and the\n * continental US time zone abbreviations, but for general use, use a time zone offset, for\n * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the timezone of the browser will be used.\n * @returns {string} Formatted string or the input if input is not recognized as date/millis.\n *\n * @example\n \n \n {{1288323623006 | date:'medium'}}:\n {{1288323623006 | date:'medium'}}
        \n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}:\n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
        \n {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}:\n {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}
        \n {{1288323623006 | date:\"MM/dd/yyyy 'at' h:mma\"}}:\n {{'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"}}
        \n
        \n \n it('should format date', function() {\n expect(element(by.binding(\"1288323623006 | date:'medium'\")).getText()).\n toMatch(/Oct 2\\d, 2010 \\d{1,2}:\\d{2}:\\d{2} (AM|PM)/);\n expect(element(by.binding(\"1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'\")).getText()).\n toMatch(/2010\\-10\\-2\\d \\d{2}:\\d{2}:\\d{2} (\\-|\\+)?\\d{4}/);\n expect(element(by.binding(\"'1288323623006' | date:'MM/dd/yyyy @ h:mma'\")).getText()).\n toMatch(/10\\/2\\d\\/2010 @ \\d{1,2}:\\d{2}(AM|PM)/);\n expect(element(by.binding(\"'1288323623006' | date:\\\"MM/dd/yyyy 'at' h:mma\\\"\")).getText()).\n toMatch(/10\\/2\\d\\/2010 at \\d{1,2}:\\d{2}(AM|PM)/);\n });\n \n
        \n */\ndateFilter.$inject = ['$locale'];\nfunction dateFilter($locale) {\n\n\n var R_ISO8601_STR = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n // 1 2 3 4 5 6 7 8 9 10 11\n function jsonStringToDate(string) {\n var match;\n if (match = string.match(R_ISO8601_STR)) {\n var date = new Date(0),\n tzHour = 0,\n tzMin = 0,\n dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,\n timeSetter = match[8] ? date.setUTCHours : date.setHours;\n\n if (match[9]) {\n tzHour = toInt(match[9] + match[10]);\n tzMin = toInt(match[9] + match[11]);\n }\n dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));\n var h = toInt(match[4] || 0) - tzHour;\n var m = toInt(match[5] || 0) - tzMin;\n var s = toInt(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n }\n return string;\n }\n\n\n return function(date, format, timezone) {\n var text = '',\n parts = [],\n fn, match;\n\n format = format || 'mediumDate';\n format = $locale.DATETIME_FORMATS[format] || format;\n if (isString(date)) {\n date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date);\n }\n\n if (isNumber(date)) {\n date = new Date(date);\n }\n\n if (!isDate(date) || !isFinite(date.getTime())) {\n return date;\n }\n\n while (format) {\n match = DATE_FORMATS_SPLIT.exec(format);\n if (match) {\n parts = concat(parts, match, 1);\n format = parts.pop();\n } else {\n parts.push(format);\n format = null;\n }\n }\n\n var dateTimezoneOffset = date.getTimezoneOffset();\n if (timezone) {\n dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n date = convertTimezoneToLocal(date, timezone, true);\n }\n forEach(parts, function(value) {\n fn = DATE_FORMATS[value];\n text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset)\n : value === \"''\" ? \"'\" : value.replace(/(^'|'$)/g, '').replace(/''/g, \"'\");\n });\n\n return text;\n };\n}\n\n\n/**\n * @ngdoc filter\n * @name json\n * @kind function\n *\n * @description\n * Allows you to convert a JavaScript object into JSON string.\n *\n * This filter is mostly useful for debugging. When using the double curly {{value}} notation\n * the binding is automatically converted to JSON.\n *\n * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.\n * @param {number=} spacing The number of spaces to use per indentation, defaults to 2.\n * @returns {string} JSON string.\n *\n *\n * @example\n \n \n
        {{ {'name':'value'} | json }}
        \n
        {{ {'name':'value'} | json:4 }}
        \n
        \n \n it('should jsonify filtered objects', function() {\n expect(element(by.id('default-spacing')).getText()).toMatch(/\\{\\n \"name\": ?\"value\"\\n}/);\n expect(element(by.id('custom-spacing')).getText()).toMatch(/\\{\\n \"name\": ?\"value\"\\n}/);\n });\n \n
        \n *\n */\nfunction jsonFilter() {\n return function(object, spacing) {\n if (isUndefined(spacing)) {\n spacing = 2;\n }\n return toJson(object, spacing);\n };\n}\n\n\n/**\n * @ngdoc filter\n * @name lowercase\n * @kind function\n * @description\n * Converts string to lowercase.\n * @see angular.lowercase\n */\nvar lowercaseFilter = valueFn(lowercase);\n\n\n/**\n * @ngdoc filter\n * @name uppercase\n * @kind function\n * @description\n * Converts string to uppercase.\n * @see angular.uppercase\n */\nvar uppercaseFilter = valueFn(uppercase);\n\n/**\n * @ngdoc filter\n * @name limitTo\n * @kind function\n *\n * @description\n * Creates a new array or string containing only a specified number of elements. The elements are\n * taken from either the beginning or the end of the source array, string or number, as specified by\n * the value and sign (positive or negative) of `limit`. Other array-like objects are also supported\n * (e.g. array subclasses, NodeLists, jqLite/jQuery collections etc). If a number is used as input,\n * it is converted to a string.\n *\n * @param {Array|ArrayLike|string|number} input - Array/array-like, string or number to be limited.\n * @param {string|number} limit - The length of the returned array or string. If the `limit` number\n * is positive, `limit` number of items from the beginning of the source array/string are copied.\n * If the number is negative, `limit` number of items from the end of the source array/string\n * are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined,\n * the input will be returned unchanged.\n * @param {(string|number)=} begin - Index at which to begin limitation. As a negative index,\n * `begin` indicates an offset from the end of `input`. Defaults to `0`.\n * @returns {Array|string} A new sub-array or substring of length `limit` or less if the input had\n * less than `limit` elements.\n *\n * @example\n \n \n \n
        \n \n

        Output numbers: {{ numbers | limitTo:numLimit }}

        \n \n

        Output letters: {{ letters | limitTo:letterLimit }}

        \n \n

        Output long number: {{ longNumber | limitTo:longNumberLimit }}

        \n
        \n
        \n \n var numLimitInput = element(by.model('numLimit'));\n var letterLimitInput = element(by.model('letterLimit'));\n var longNumberLimitInput = element(by.model('longNumberLimit'));\n var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));\n var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));\n var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit'));\n\n it('should limit the number array to first three items', function() {\n expect(numLimitInput.getAttribute('value')).toBe('3');\n expect(letterLimitInput.getAttribute('value')).toBe('3');\n expect(longNumberLimitInput.getAttribute('value')).toBe('3');\n expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');\n expect(limitedLetters.getText()).toEqual('Output letters: abc');\n expect(limitedLongNumber.getText()).toEqual('Output long number: 234');\n });\n\n // There is a bug in safari and protractor that doesn't like the minus key\n // it('should update the output when -3 is entered', function() {\n // numLimitInput.clear();\n // numLimitInput.sendKeys('-3');\n // letterLimitInput.clear();\n // letterLimitInput.sendKeys('-3');\n // longNumberLimitInput.clear();\n // longNumberLimitInput.sendKeys('-3');\n // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');\n // expect(limitedLetters.getText()).toEqual('Output letters: ghi');\n // expect(limitedLongNumber.getText()).toEqual('Output long number: 342');\n // });\n\n it('should not exceed the maximum size of input array', function() {\n numLimitInput.clear();\n numLimitInput.sendKeys('100');\n letterLimitInput.clear();\n letterLimitInput.sendKeys('100');\n longNumberLimitInput.clear();\n longNumberLimitInput.sendKeys('100');\n expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');\n expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');\n expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342');\n });\n \n
        \n*/\nfunction limitToFilter() {\n return function(input, limit, begin) {\n if (Math.abs(Number(limit)) === Infinity) {\n limit = Number(limit);\n } else {\n limit = toInt(limit);\n }\n if (isNaN(limit)) return input;\n\n if (isNumber(input)) input = input.toString();\n if (!isArrayLike(input)) return input;\n\n begin = (!begin || isNaN(begin)) ? 0 : toInt(begin);\n begin = (begin < 0) ? Math.max(0, input.length + begin) : begin;\n\n if (limit >= 0) {\n return sliceFn(input, begin, begin + limit);\n } else {\n if (begin === 0) {\n return sliceFn(input, limit, input.length);\n } else {\n return sliceFn(input, Math.max(0, begin + limit), begin);\n }\n }\n };\n}\n\nfunction sliceFn(input, begin, end) {\n if (isString(input)) return input.slice(begin, end);\n\n return slice.call(input, begin, end);\n}\n\n/**\n * @ngdoc filter\n * @name orderBy\n * @kind function\n *\n * @description\n * Returns an array containing the items from the specified `collection`, ordered by a `comparator`\n * function based on the values computed using the `expression` predicate.\n *\n * For example, `[{id: 'foo'}, {id: 'bar'}] | orderBy:'id'` would result in\n * `[{id: 'bar'}, {id: 'foo'}]`.\n *\n * The `collection` can be an Array or array-like object (e.g. NodeList, jQuery object, TypedArray,\n * String, etc).\n *\n * The `expression` can be a single predicate, or a list of predicates each serving as a tie-breaker\n * for the preceeding one. The `expression` is evaluated against each item and the output is used\n * for comparing with other items.\n *\n * You can change the sorting order by setting `reverse` to `true`. By default, items are sorted in\n * ascending order.\n *\n * The comparison is done using the `comparator` function. If none is specified, a default, built-in\n * comparator is used (see below for details - in a nutshell, it compares numbers numerically and\n * strings alphabetically).\n *\n * ### Under the hood\n *\n * Ordering the specified `collection` happens in two phases:\n *\n * 1. All items are passed through the predicate (or predicates), and the returned values are saved\n * along with their type (`string`, `number` etc). For example, an item `{label: 'foo'}`, passed\n * through a predicate that extracts the value of the `label` property, would be transformed to:\n * ```\n * {\n * value: 'foo',\n * type: 'string',\n * index: ...\n * }\n * ```\n * 2. The comparator function is used to sort the items, based on the derived values, types and\n * indices.\n *\n * If you use a custom comparator, it will be called with pairs of objects of the form\n * `{value: ..., type: '...', index: ...}` and is expected to return `0` if the objects are equal\n * (as far as the comparator is concerned), `-1` if the 1st one should be ranked higher than the\n * second, or `1` otherwise.\n *\n * In order to ensure that the sorting will be deterministic across platforms, if none of the\n * specified predicates can distinguish between two items, `orderBy` will automatically introduce a\n * dummy predicate that returns the item's index as `value`.\n * (If you are using a custom comparator, make sure it can handle this predicate as well.)\n *\n * Finally, in an attempt to simplify things, if a predicate returns an object as the extracted\n * value for an item, `orderBy` will try to convert that object to a primitive value, before passing\n * it to the comparator. The following rules govern the conversion:\n *\n * 1. If the object has a `valueOf()` method that returns a primitive, its return value will be\n * used instead.
        \n * (If the object has a `valueOf()` method that returns another object, then the returned object\n * will be used in subsequent steps.)\n * 2. If the object has a custom `toString()` method (i.e. not the one inherited from `Object`) that\n * returns a primitive, its return value will be used instead.
        \n * (If the object has a `toString()` method that returns another object, then the returned object\n * will be used in subsequent steps.)\n * 3. No conversion; the object itself is used.\n *\n * ### The default comparator\n *\n * The default, built-in comparator should be sufficient for most usecases. In short, it compares\n * numbers numerically, strings alphabetically (and case-insensitively), for objects falls back to\n * using their index in the original collection, and sorts values of different types by type.\n *\n * More specifically, it follows these steps to determine the relative order of items:\n *\n * 1. If the compared values are of different types, compare the types themselves alphabetically.\n * 2. If both values are of type `string`, compare them alphabetically in a case- and\n * locale-insensitive way.\n * 3. If both values are objects, compare their indices instead.\n * 4. Otherwise, return:\n * - `0`, if the values are equal (by strict equality comparison, i.e. using `===`).\n * - `-1`, if the 1st value is \"less than\" the 2nd value (compared using the `<` operator).\n * - `1`, otherwise.\n *\n * **Note:** If you notice numbers not being sorted as expected, make sure they are actually being\n * saved as numbers and not strings.\n *\n * @param {Array|ArrayLike} collection - The collection (array or array-like object) to sort.\n * @param {(Function|string|Array.)=} expression - A predicate (or list of\n * predicates) to be used by the comparator to determine the order of elements.\n *\n * Can be one of:\n *\n * - `Function`: A getter function. This function will be called with each item as argument and\n * the return value will be used for sorting.\n * - `string`: An Angular expression. This expression will be evaluated against each item and the\n * result will be used for sorting. For example, use `'label'` to sort by a property called\n * `label` or `'label.substring(0, 3)'` to sort by the first 3 characters of the `label`\n * property.
        \n * (The result of a constant expression is interpreted as a property name to be used for\n * comparison. For example, use `'\"special name\"'` (note the extra pair of quotes) to sort by a\n * property called `special name`.)
        \n * An expression can be optionally prefixed with `+` or `-` to control the sorting direction,\n * ascending or descending. For example, `'+label'` or `'-label'`. If no property is provided,\n * (e.g. `'+'` or `'-'`), the collection element itself is used in comparisons.\n * - `Array`: An array of function and/or string predicates. If a predicate cannot determine the\n * relative order of two items, the next predicate is used as a tie-breaker.\n *\n * **Note:** If the predicate is missing or empty then it defaults to `'+'`.\n *\n * @param {boolean=} reverse - If `true`, reverse the sorting order.\n * @param {(Function)=} comparator - The comparator function used to determine the relative order of\n * value pairs. If omitted, the built-in comparator will be used.\n *\n * @returns {Array} - The sorted array.\n *\n *\n * @example\n * ### Ordering a table with `ngRepeat`\n *\n * The example below demonstrates a simple {@link ngRepeat ngRepeat}, where the data is sorted by\n * age in descending order (expression is set to `'-age'`). The `comparator` is not set, which means\n * it defaults to the built-in comparator.\n *\n \n \n
        \n \n \n \n \n \n \n \n \n \n \n \n
        NamePhone NumberAge
        {{friend.name}}{{friend.phone}}{{friend.age}}
        \n
        \n
        \n \n angular.module('orderByExample1', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n }]);\n \n \n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n \n \n // Element locators\n var names = element.all(by.repeater('friends').column('friend.name'));\n\n it('should sort friends by age in reverse order', function() {\n expect(names.get(0).getText()).toBe('Adam');\n expect(names.get(1).getText()).toBe('Julie');\n expect(names.get(2).getText()).toBe('Mike');\n expect(names.get(3).getText()).toBe('Mary');\n expect(names.get(4).getText()).toBe('John');\n });\n \n
        \n *
        \n *\n * @example\n * ### Changing parameters dynamically\n *\n * All parameters can be changed dynamically. The next example shows how you can make the columns of\n * a table sortable, by binding the `expression` and `reverse` parameters to scope properties.\n *\n \n \n
        \n
        Sort by = {{propertyName}}; reverse = {{reverse}}
        \n
        \n \n
        \n \n \n \n \n \n \n \n \n \n \n \n
        \n \n \n \n \n \n \n \n \n
        {{friend.name}}{{friend.phone}}{{friend.age}}
        \n
        \n
        \n \n angular.module('orderByExample2', [])\n .controller('ExampleController', ['$scope', function($scope) {\n var friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n\n $scope.propertyName = 'age';\n $scope.reverse = true;\n $scope.friends = friends;\n\n $scope.sortBy = function(propertyName) {\n $scope.reverse = ($scope.propertyName === propertyName) ? !$scope.reverse : false;\n $scope.propertyName = propertyName;\n };\n }]);\n \n \n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n\n .sortorder:after {\n content: '\\25b2'; // BLACK UP-POINTING TRIANGLE\n }\n .sortorder.reverse:after {\n content: '\\25bc'; // BLACK DOWN-POINTING TRIANGLE\n }\n \n \n // Element locators\n var unsortButton = element(by.partialButtonText('unsorted'));\n var nameHeader = element(by.partialButtonText('Name'));\n var phoneHeader = element(by.partialButtonText('Phone'));\n var ageHeader = element(by.partialButtonText('Age'));\n var firstName = element(by.repeater('friends').column('friend.name').row(0));\n var lastName = element(by.repeater('friends').column('friend.name').row(4));\n\n it('should sort friends by some property, when clicking on the column header', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n phoneHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Mary');\n\n nameHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('Mike');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n });\n\n it('should sort friends in reverse order, when clicking on the same column', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n });\n\n it('should restore the original order, when clicking \"Set to unsorted\"', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n unsortButton.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Julie');\n });\n \n
        \n *
        \n *\n * @example\n * ### Using `orderBy` inside a controller\n *\n * It is also possible to call the `orderBy` filter manually, by injecting `orderByFilter`, and\n * calling it with the desired parameters. (Alternatively, you could inject the `$filter` factory\n * and retrieve the `orderBy` filter with `$filter('orderBy')`.)\n *\n \n \n
        \n
        Sort by = {{propertyName}}; reverse = {{reverse}}
        \n
        \n \n
        \n \n \n \n \n \n \n \n \n \n \n \n
        \n \n \n \n \n \n \n \n \n
        {{friend.name}}{{friend.phone}}{{friend.age}}
        \n
        \n
        \n \n angular.module('orderByExample3', [])\n .controller('ExampleController', ['$scope', 'orderByFilter', function($scope, orderBy) {\n var friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n\n $scope.propertyName = 'age';\n $scope.reverse = true;\n $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse);\n\n $scope.sortBy = function(propertyName) {\n $scope.reverse = (propertyName !== null && $scope.propertyName === propertyName)\n ? !$scope.reverse : false;\n $scope.propertyName = propertyName;\n $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse);\n };\n }]);\n \n \n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n\n .sortorder:after {\n content: '\\25b2'; // BLACK UP-POINTING TRIANGLE\n }\n .sortorder.reverse:after {\n content: '\\25bc'; // BLACK DOWN-POINTING TRIANGLE\n }\n \n \n // Element locators\n var unsortButton = element(by.partialButtonText('unsorted'));\n var nameHeader = element(by.partialButtonText('Name'));\n var phoneHeader = element(by.partialButtonText('Phone'));\n var ageHeader = element(by.partialButtonText('Age'));\n var firstName = element(by.repeater('friends').column('friend.name').row(0));\n var lastName = element(by.repeater('friends').column('friend.name').row(4));\n\n it('should sort friends by some property, when clicking on the column header', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n phoneHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Mary');\n\n nameHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('Mike');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n });\n\n it('should sort friends in reverse order, when clicking on the same column', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n });\n\n it('should restore the original order, when clicking \"Set to unsorted\"', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n unsortButton.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Julie');\n });\n \n
        \n *
        \n *\n * @example\n * ### Using a custom comparator\n *\n * If you have very specific requirements about the way items are sorted, you can pass your own\n * comparator function. For example, you might need to compare some strings in a locale-sensitive\n * way. (When specifying a custom comparator, you also need to pass a value for the `reverse`\n * argument - passing `false` retains the default sorting order, i.e. ascending.)\n *\n \n \n
        \n
        \n

        Locale-sensitive Comparator

        \n \n \n \n \n \n \n \n \n \n
        NameFavorite Letter
        {{friend.name}}{{friend.favoriteLetter}}
        \n
        \n
        \n

        Default Comparator

        \n \n \n \n \n \n \n \n \n \n
        NameFavorite Letter
        {{friend.name}}{{friend.favoriteLetter}}
        \n
        \n
        \n
        \n \n angular.module('orderByExample4', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.friends = [\n {name: 'John', favoriteLetter: 'Ä'},\n {name: 'Mary', favoriteLetter: 'Ü'},\n {name: 'Mike', favoriteLetter: 'Ö'},\n {name: 'Adam', favoriteLetter: 'H'},\n {name: 'Julie', favoriteLetter: 'Z'}\n ];\n\n $scope.localeSensitiveComparator = function(v1, v2) {\n // If we don't get strings, just compare by index\n if (v1.type !== 'string' || v2.type !== 'string') {\n return (v1.index < v2.index) ? -1 : 1;\n }\n\n // Compare strings alphabetically, taking locale into account\n return v1.value.localeCompare(v2.value);\n };\n }]);\n \n \n .friends-container {\n display: inline-block;\n margin: 0 30px;\n }\n\n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n \n \n // Element locators\n var container = element(by.css('.custom-comparator'));\n var names = container.all(by.repeater('friends').column('friend.name'));\n\n it('should sort friends by favorite letter (in correct alphabetical order)', function() {\n expect(names.get(0).getText()).toBe('John');\n expect(names.get(1).getText()).toBe('Adam');\n expect(names.get(2).getText()).toBe('Mike');\n expect(names.get(3).getText()).toBe('Mary');\n expect(names.get(4).getText()).toBe('Julie');\n });\n \n
        \n *\n */\norderByFilter.$inject = ['$parse'];\nfunction orderByFilter($parse) {\n return function(array, sortPredicate, reverseOrder, compareFn) {\n\n if (array == null) return array;\n if (!isArrayLike(array)) {\n throw minErr('orderBy')('notarray', 'Expected array but received: {0}', array);\n }\n\n if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; }\n if (sortPredicate.length === 0) { sortPredicate = ['+']; }\n\n var predicates = processPredicates(sortPredicate);\n\n var descending = reverseOrder ? -1 : 1;\n\n // Define the `compare()` function. Use a default comparator if none is specified.\n var compare = isFunction(compareFn) ? compareFn : defaultCompare;\n\n // The next three lines are a version of a Swartzian Transform idiom from Perl\n // (sometimes called the Decorate-Sort-Undecorate idiom)\n // See https://en.wikipedia.org/wiki/Schwartzian_transform\n var compareValues = Array.prototype.map.call(array, getComparisonObject);\n compareValues.sort(doComparison);\n array = compareValues.map(function(item) { return item.value; });\n\n return array;\n\n function getComparisonObject(value, index) {\n // NOTE: We are adding an extra `tieBreaker` value based on the element's index.\n // This will be used to keep the sort stable when none of the input predicates can\n // distinguish between two elements.\n return {\n value: value,\n tieBreaker: {value: index, type: 'number', index: index},\n predicateValues: predicates.map(function(predicate) {\n return getPredicateValue(predicate.get(value), index);\n })\n };\n }\n\n function doComparison(v1, v2) {\n for (var i = 0, ii = predicates.length; i < ii; i++) {\n var result = compare(v1.predicateValues[i], v2.predicateValues[i]);\n if (result) {\n return result * predicates[i].descending * descending;\n }\n }\n\n return compare(v1.tieBreaker, v2.tieBreaker) * descending;\n }\n };\n\n function processPredicates(sortPredicates) {\n return sortPredicates.map(function(predicate) {\n var descending = 1, get = identity;\n\n if (isFunction(predicate)) {\n get = predicate;\n } else if (isString(predicate)) {\n if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {\n descending = predicate.charAt(0) == '-' ? -1 : 1;\n predicate = predicate.substring(1);\n }\n if (predicate !== '') {\n get = $parse(predicate);\n if (get.constant) {\n var key = get();\n get = function(value) { return value[key]; };\n }\n }\n }\n return {get: get, descending: descending};\n });\n }\n\n function isPrimitive(value) {\n switch (typeof value) {\n case 'number': /* falls through */\n case 'boolean': /* falls through */\n case 'string':\n return true;\n default:\n return false;\n }\n }\n\n function objectValue(value) {\n // If `valueOf` is a valid function use that\n if (isFunction(value.valueOf)) {\n value = value.valueOf();\n if (isPrimitive(value)) return value;\n }\n // If `toString` is a valid function and not the one from `Object.prototype` use that\n if (hasCustomToString(value)) {\n value = value.toString();\n if (isPrimitive(value)) return value;\n }\n\n return value;\n }\n\n function getPredicateValue(value, index) {\n var type = typeof value;\n if (value === null) {\n type = 'string';\n value = 'null';\n } else if (type === 'object') {\n value = objectValue(value);\n }\n return {value: value, type: type, index: index};\n }\n\n function defaultCompare(v1, v2) {\n var result = 0;\n var type1 = v1.type;\n var type2 = v2.type;\n\n if (type1 === type2) {\n var value1 = v1.value;\n var value2 = v2.value;\n\n if (type1 === 'string') {\n // Compare strings case-insensitively\n value1 = value1.toLowerCase();\n value2 = value2.toLowerCase();\n } else if (type1 === 'object') {\n // For basic objects, use the position of the object\n // in the collection instead of the value\n if (isObject(value1)) value1 = v1.index;\n if (isObject(value2)) value2 = v2.index;\n }\n\n if (value1 !== value2) {\n result = value1 < value2 ? -1 : 1;\n }\n } else {\n result = type1 < type2 ? -1 : 1;\n }\n\n return result;\n }\n}\n\nfunction ngDirective(directive) {\n if (isFunction(directive)) {\n directive = {\n link: directive\n };\n }\n directive.restrict = directive.restrict || 'AC';\n return valueFn(directive);\n}\n\n/**\n * @ngdoc directive\n * @name a\n * @restrict E\n *\n * @description\n * Modifies the default behavior of the html A tag so that the default action is prevented when\n * the href attribute is empty.\n *\n * This change permits the easy creation of action links with the `ngClick` directive\n * without changing the location or causing page reloads, e.g.:\n * `Add Item`\n */\nvar htmlAnchorDirective = valueFn({\n restrict: 'E',\n compile: function(element, attr) {\n if (!attr.href && !attr.xlinkHref) {\n return function(scope, element) {\n // If the linked element is not an anchor tag anymore, do nothing\n if (element[0].nodeName.toLowerCase() !== 'a') return;\n\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?\n 'xlink:href' : 'href';\n element.on('click', function(event) {\n // if we have no href url, then don't navigate anywhere.\n if (!element.attr(href)) {\n event.preventDefault();\n }\n });\n };\n }\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngHref\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in an href attribute will\n * make the link go to the wrong URL if the user clicks it before\n * Angular has a chance to replace the `{{hash}}` markup with its\n * value. Until Angular replaces the markup the link will be broken\n * and will most likely return a 404 error. The `ngHref` directive\n * solves this problem.\n *\n * The wrong way to write it:\n * ```html\n * link1\n * ```\n *\n * The correct way to write it:\n * ```html\n * link1\n * ```\n *\n * @element A\n * @param {template} ngHref any string which can contain `{{}}` markup.\n *\n * @example\n * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes\n * in links and their different behaviors:\n \n \n
        \n link 1 (link, don't reload)
        \n link 2 (link, don't reload)
        \n link 3 (link, reload!)
        \n anchor (link, don't reload)
        \n anchor (no link)
        \n link (link, change location)\n
        \n \n it('should execute ng-click but not reload when href without value', function() {\n element(by.id('link-1')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('1');\n expect(element(by.id('link-1')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click but not reload when href empty string', function() {\n element(by.id('link-2')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('2');\n expect(element(by.id('link-2')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click and change url when ng-href specified', function() {\n expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\\/123$/);\n\n element(by.id('link-3')).click();\n\n // At this point, we navigate away from an Angular page, so we need\n // to use browser.driver to get the base webdriver.\n\n browser.wait(function() {\n return browser.driver.getCurrentUrl().then(function(url) {\n return url.match(/\\/123$/);\n });\n }, 5000, 'page should navigate to /123');\n });\n\n it('should execute ng-click but not reload when href empty string and name specified', function() {\n element(by.id('link-4')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('4');\n expect(element(by.id('link-4')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click but not reload when no href but name specified', function() {\n element(by.id('link-5')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('5');\n expect(element(by.id('link-5')).getAttribute('href')).toBe(null);\n });\n\n it('should only change url when only ng-href', function() {\n element(by.model('value')).clear();\n element(by.model('value')).sendKeys('6');\n expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\\/6$/);\n\n element(by.id('link-6')).click();\n\n // At this point, we navigate away from an Angular page, so we need\n // to use browser.driver to get the base webdriver.\n browser.wait(function() {\n return browser.driver.getCurrentUrl().then(function(url) {\n return url.match(/\\/6$/);\n });\n }, 5000, 'page should navigate to /6');\n });\n \n
        \n */\n\n/**\n * @ngdoc directive\n * @name ngSrc\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in a `src` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until Angular replaces the expression inside\n * `{{hash}}`. The `ngSrc` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * \"Description\"/\n * ```\n *\n * The correct way to write it:\n * ```html\n * \"Description\"\n * ```\n *\n * @element IMG\n * @param {template} ngSrc any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngSrcset\n * @restrict A\n * @priority 99\n *\n * @description\n * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until Angular replaces the expression inside\n * `{{hash}}`. The `ngSrcset` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * \"Description\"/\n * ```\n *\n * The correct way to write it:\n * ```html\n * \"Description\"\n * ```\n *\n * @element IMG\n * @param {template} ngSrcset any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngDisabled\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * This directive sets the `disabled` attribute on the element if the\n * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `disabled`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n \n \n
        \n \n
        \n \n it('should toggle button', function() {\n expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy();\n element(by.model('checked')).click();\n expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy();\n });\n \n
        \n *\n * @element INPUT\n * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,\n * then the `disabled` attribute will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngChecked\n * @restrict A\n * @priority 100\n *\n * @description\n * Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy.\n *\n * Note that this directive should not be used together with {@link ngModel `ngModel`},\n * as this can lead to unexpected behavior.\n *\n * A special directive is necessary because we cannot use interpolation inside the `checked`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n \n \n
        \n \n
        \n \n it('should check both checkBoxes', function() {\n expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();\n element(by.model('master')).click();\n expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();\n });\n \n
        \n *\n * @element INPUT\n * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,\n * then the `checked` attribute will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngReadonly\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `readonly` attribute on the element, if the expression inside `ngReadonly` is truthy.\n * Note that `readonly` applies only to `input` elements with specific types. [See the input docs on\n * MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly) for more information.\n *\n * A special directive is necessary because we cannot use interpolation inside the `readonly`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n \n \n
        \n \n
        \n \n it('should toggle readonly attr', function() {\n expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeFalsy();\n element(by.model('checked')).click();\n expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeTruthy();\n });\n \n
        \n *\n * @element INPUT\n * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,\n * then special attribute \"readonly\" will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngSelected\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `selected` attribute on the element, if the expression inside `ngSelected` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `selected`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n *
        \n * **Note:** `ngSelected` does not interact with the `select` and `ngModel` directives, it only\n * sets the `selected` attribute on the element. If you are using `ngModel` on the select, you\n * should not use `ngSelected` on the options, as `ngModel` will set the select value and\n * selected options.\n *
        \n *\n * @example\n \n \n
        \n \n
        \n \n it('should select Greetings!', function() {\n expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();\n element(by.model('selected')).click();\n expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();\n });\n \n
        \n *\n * @element OPTION\n * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,\n * then special attribute \"selected\" will be set on the element\n */\n\n/**\n * @ngdoc directive\n * @name ngOpen\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `open` attribute on the element, if the expression inside `ngOpen` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `open`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * ## A note about browser compatibility\n *\n * Edge, Firefox, and Internet Explorer do not support the `details` element, it is\n * recommended to use {@link ng.ngShow} and {@link ng.ngHide} instead.\n *\n * @example\n \n \n
        \n
        \n Show/Hide me\n
        \n
        \n \n it('should toggle open', function() {\n expect(element(by.id('details')).getAttribute('open')).toBeFalsy();\n element(by.model('open')).click();\n expect(element(by.id('details')).getAttribute('open')).toBeTruthy();\n });\n \n
        \n *\n * @element DETAILS\n * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,\n * then special attribute \"open\" will be set on the element\n */\n\nvar ngAttributeAliasDirectives = {};\n\n// boolean attrs are evaluated\nforEach(BOOLEAN_ATTR, function(propName, attrName) {\n // binding to multiple is not supported\n if (propName == \"multiple\") return;\n\n function defaultLinkFn(scope, element, attr) {\n scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {\n attr.$set(attrName, !!value);\n });\n }\n\n var normalized = directiveNormalize('ng-' + attrName);\n var linkFn = defaultLinkFn;\n\n if (propName === 'checked') {\n linkFn = function(scope, element, attr) {\n // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input\n if (attr.ngModel !== attr[normalized]) {\n defaultLinkFn(scope, element, attr);\n }\n };\n }\n\n ngAttributeAliasDirectives[normalized] = function() {\n return {\n restrict: 'A',\n priority: 100,\n link: linkFn\n };\n };\n});\n\n// aliased input attrs are evaluated\nforEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {\n ngAttributeAliasDirectives[ngAttr] = function() {\n return {\n priority: 100,\n link: function(scope, element, attr) {\n //special case ngPattern when a literal regular expression value\n //is used as the expression (this way we don't have to watch anything).\n if (ngAttr === \"ngPattern\" && attr.ngPattern.charAt(0) == \"/\") {\n var match = attr.ngPattern.match(REGEX_STRING_REGEXP);\n if (match) {\n attr.$set(\"ngPattern\", new RegExp(match[1], match[2]));\n return;\n }\n }\n\n scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) {\n attr.$set(ngAttr, value);\n });\n }\n };\n };\n});\n\n// ng-src, ng-srcset, ng-href are interpolated\nforEach(['src', 'srcset', 'href'], function(attrName) {\n var normalized = directiveNormalize('ng-' + attrName);\n ngAttributeAliasDirectives[normalized] = function() {\n return {\n priority: 99, // it needs to run after the attributes are interpolated\n link: function(scope, element, attr) {\n var propName = attrName,\n name = attrName;\n\n if (attrName === 'href' &&\n toString.call(element.prop('href')) === '[object SVGAnimatedString]') {\n name = 'xlinkHref';\n attr.$attr[name] = 'xlink:href';\n propName = null;\n }\n\n attr.$observe(normalized, function(value) {\n if (!value) {\n if (attrName === 'href') {\n attr.$set(name, null);\n }\n return;\n }\n\n attr.$set(name, value);\n\n // on IE, if \"ng:src\" directive declaration is used and \"src\" attribute doesn't exist\n // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need\n // to set the property as well to achieve the desired effect.\n // we use attr[attrName] value since $set can sanitize the url.\n if (msie && propName) element.prop(propName, attr[name]);\n });\n }\n };\n };\n});\n\n/* global -nullFormCtrl, -SUBMITTED_CLASS, addSetValidityMethod: true\n */\nvar nullFormCtrl = {\n $addControl: noop,\n $$renameControl: nullFormRenameControl,\n $removeControl: noop,\n $setValidity: noop,\n $setDirty: noop,\n $setPristine: noop,\n $setSubmitted: noop\n},\nSUBMITTED_CLASS = 'ng-submitted';\n\nfunction nullFormRenameControl(control, name) {\n control.$name = name;\n}\n\n/**\n * @ngdoc type\n * @name form.FormController\n *\n * @property {boolean} $pristine True if user has not interacted with the form yet.\n * @property {boolean} $dirty True if user has already interacted with the form.\n * @property {boolean} $valid True if all of the containing forms and controls are valid.\n * @property {boolean} $invalid True if at least one containing control or form is invalid.\n * @property {boolean} $pending True if at least one containing control or form is pending.\n * @property {boolean} $submitted True if user has submitted the form even if its invalid.\n *\n * @property {Object} $error Is an object hash, containing references to controls or\n * forms with failing validators, where:\n *\n * - keys are validation tokens (error names),\n * - values are arrays of controls or forms that have a failing validator for given error name.\n *\n * Built-in validation tokens:\n *\n * - `email`\n * - `max`\n * - `maxlength`\n * - `min`\n * - `minlength`\n * - `number`\n * - `pattern`\n * - `required`\n * - `url`\n * - `date`\n * - `datetimelocal`\n * - `time`\n * - `week`\n * - `month`\n *\n * @description\n * `FormController` keeps track of all its controls and nested forms as well as the state of them,\n * such as being valid/invalid or dirty/pristine.\n *\n * Each {@link ng.directive:form form} directive creates an instance\n * of `FormController`.\n *\n */\n//asks for $scope to fool the BC controller module\nFormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate'];\nfunction FormController(element, attrs, $scope, $animate, $interpolate) {\n var form = this,\n controls = [];\n\n // init state\n form.$error = {};\n form.$$success = {};\n form.$pending = undefined;\n form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope);\n form.$dirty = false;\n form.$pristine = true;\n form.$valid = true;\n form.$invalid = false;\n form.$submitted = false;\n form.$$parentForm = nullFormCtrl;\n\n /**\n * @ngdoc method\n * @name form.FormController#$rollbackViewValue\n *\n * @description\n * Rollback all form controls pending updates to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. This method is typically needed by the reset button of\n * a form that uses `ng-model-options` to pend updates.\n */\n form.$rollbackViewValue = function() {\n forEach(controls, function(control) {\n control.$rollbackViewValue();\n });\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$commitViewValue\n *\n * @description\n * Commit all form controls pending updates to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. This method is rarely needed as `NgModelController`\n * usually handles calling this in response to input events.\n */\n form.$commitViewValue = function() {\n forEach(controls, function(control) {\n control.$commitViewValue();\n });\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$addControl\n * @param {object} control control object, either a {@link form.FormController} or an\n * {@link ngModel.NgModelController}\n *\n * @description\n * Register a control with the form. Input elements using ngModelController do this automatically\n * when they are linked.\n *\n * Note that the current state of the control will not be reflected on the new parent form. This\n * is not an issue with normal use, as freshly compiled and linked controls are in a `$pristine`\n * state.\n *\n * However, if the method is used programmatically, for example by adding dynamically created controls,\n * or controls that have been previously removed without destroying their corresponding DOM element,\n * it's the developers responsibility to make sure the current state propagates to the parent form.\n *\n * For example, if an input control is added that is already `$dirty` and has `$error` properties,\n * calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form.\n */\n form.$addControl = function(control) {\n // Breaking change - before, inputs whose name was \"hasOwnProperty\" were quietly ignored\n // and not added to the scope. Now we throw an error.\n assertNotHasOwnProperty(control.$name, 'input');\n controls.push(control);\n\n if (control.$name) {\n form[control.$name] = control;\n }\n\n control.$$parentForm = form;\n };\n\n // Private API: rename a form control\n form.$$renameControl = function(control, newName) {\n var oldName = control.$name;\n\n if (form[oldName] === control) {\n delete form[oldName];\n }\n form[newName] = control;\n control.$name = newName;\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$removeControl\n * @param {object} control control object, either a {@link form.FormController} or an\n * {@link ngModel.NgModelController}\n *\n * @description\n * Deregister a control from the form.\n *\n * Input elements using ngModelController do this automatically when they are destroyed.\n *\n * Note that only the removed control's validation state (`$errors`etc.) will be removed from the\n * form. `$dirty`, `$submitted` states will not be changed, because the expected behavior can be\n * different from case to case. For example, removing the only `$dirty` control from a form may or\n * may not mean that the form is still `$dirty`.\n */\n form.$removeControl = function(control) {\n if (control.$name && form[control.$name] === control) {\n delete form[control.$name];\n }\n forEach(form.$pending, function(value, name) {\n form.$setValidity(name, null, control);\n });\n forEach(form.$error, function(value, name) {\n form.$setValidity(name, null, control);\n });\n forEach(form.$$success, function(value, name) {\n form.$setValidity(name, null, control);\n });\n\n arrayRemove(controls, control);\n control.$$parentForm = nullFormCtrl;\n };\n\n\n /**\n * @ngdoc method\n * @name form.FormController#$setValidity\n *\n * @description\n * Sets the validity of a form control.\n *\n * This method will also propagate to parent forms.\n */\n addSetValidityMethod({\n ctrl: this,\n $element: element,\n set: function(object, property, controller) {\n var list = object[property];\n if (!list) {\n object[property] = [controller];\n } else {\n var index = list.indexOf(controller);\n if (index === -1) {\n list.push(controller);\n }\n }\n },\n unset: function(object, property, controller) {\n var list = object[property];\n if (!list) {\n return;\n }\n arrayRemove(list, controller);\n if (list.length === 0) {\n delete object[property];\n }\n },\n $animate: $animate\n });\n\n /**\n * @ngdoc method\n * @name form.FormController#$setDirty\n *\n * @description\n * Sets the form to a dirty state.\n *\n * This method can be called to add the 'ng-dirty' class and set the form to a dirty\n * state (ng-dirty class). This method will also propagate to parent forms.\n */\n form.$setDirty = function() {\n $animate.removeClass(element, PRISTINE_CLASS);\n $animate.addClass(element, DIRTY_CLASS);\n form.$dirty = true;\n form.$pristine = false;\n form.$$parentForm.$setDirty();\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$setPristine\n *\n * @description\n * Sets the form to its pristine state.\n *\n * This method can be called to remove the 'ng-dirty' class and set the form to its pristine\n * state (ng-pristine class). This method will also propagate to all the controls contained\n * in this form.\n *\n * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after\n * saving or resetting it.\n */\n form.$setPristine = function() {\n $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS);\n form.$dirty = false;\n form.$pristine = true;\n form.$submitted = false;\n forEach(controls, function(control) {\n control.$setPristine();\n });\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$setUntouched\n *\n * @description\n * Sets the form to its untouched state.\n *\n * This method can be called to remove the 'ng-touched' class and set the form controls to their\n * untouched state (ng-untouched class).\n *\n * Setting a form controls back to their untouched state is often useful when setting the form\n * back to its pristine state.\n */\n form.$setUntouched = function() {\n forEach(controls, function(control) {\n control.$setUntouched();\n });\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$setSubmitted\n *\n * @description\n * Sets the form to its submitted state.\n */\n form.$setSubmitted = function() {\n $animate.addClass(element, SUBMITTED_CLASS);\n form.$submitted = true;\n form.$$parentForm.$setSubmitted();\n };\n}\n\n/**\n * @ngdoc directive\n * @name ngForm\n * @restrict EAC\n *\n * @description\n * Nestable alias of {@link ng.directive:form `form`} directive. HTML\n * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a\n * sub-group of controls needs to be determined.\n *\n * Note: the purpose of `ngForm` is to group controls,\n * but not to be a replacement for the `
        ` tag with all of its capabilities\n * (e.g. posting to the server, ...).\n *\n * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into\n * related scope, under this name.\n *\n */\n\n /**\n * @ngdoc directive\n * @name form\n * @restrict E\n *\n * @description\n * Directive that instantiates\n * {@link form.FormController FormController}.\n *\n * If the `name` attribute is specified, the form controller is published onto the current scope under\n * this name.\n *\n * # Alias: {@link ng.directive:ngForm `ngForm`}\n *\n * In Angular, forms can be nested. This means that the outer form is valid when all of the child\n * forms are valid as well. However, browsers do not allow nesting of `` elements, so\n * Angular provides the {@link ng.directive:ngForm `ngForm`} directive, which behaves identically to\n * `form` but can be nested. Nested forms can be useful, for example, if the validity of a sub-group\n * of controls needs to be determined.\n *\n * # CSS classes\n * - `ng-valid` is set if the form is valid.\n * - `ng-invalid` is set if the form is invalid.\n * - `ng-pending` is set if the form is pending.\n * - `ng-pristine` is set if the form is pristine.\n * - `ng-dirty` is set if the form is dirty.\n * - `ng-submitted` is set if the form was submitted.\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n *\n * # Submitting a form and preventing the default action\n *\n * Since the role of forms in client-side Angular applications is different than in classical\n * roundtrip apps, it is desirable for the browser not to translate the form submission into a full\n * page reload that sends the data to the server. Instead some javascript logic should be triggered\n * to handle the form submission in an application-specific way.\n *\n * For this reason, Angular prevents the default action (form submission to the server) unless the\n * `` element has an `action` attribute specified.\n *\n * You can use one of the following two ways to specify what javascript method should be called when\n * a form is submitted:\n *\n * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element\n * - {@link ng.directive:ngClick ngClick} directive on the first\n * button or input field of type submit (input[type=submit])\n *\n * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit}\n * or {@link ng.directive:ngClick ngClick} directives.\n * This is because of the following form submission rules in the HTML specification:\n *\n * - If a form has only one input field then hitting enter in this field triggers form submit\n * (`ngSubmit`)\n * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter\n * doesn't trigger submit\n * - if a form has one or more input fields and one or more buttons or input[type=submit] then\n * hitting enter in any of the input fields will trigger the click handler on the *first* button or\n * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)\n *\n * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is\n * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * ## Animation Hooks\n *\n * Animations in ngForm are triggered when any of the associated CSS classes are added and removed.\n * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any\n * other validations that are performed within the form. Animations in ngForm are similar to how\n * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well\n * as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style a form element\n * that has been rendered as invalid after it has been validated:\n *\n *
        \n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-form {\n *   transition:0.5s linear all;\n *   background: white;\n * }\n * .my-form.ng-invalid {\n *   background: red;\n *   color:white;\n * }\n * 
        \n *\n * @example\n \n \n \n \n \n userType: \n Required!
        \n userType = {{userType}}
        \n myForm.input.$valid = {{myForm.input.$valid}}
        \n myForm.input.$error = {{myForm.input.$error}}
        \n myForm.$valid = {{myForm.$valid}}
        \n myForm.$error.required = {{!!myForm.$error.required}}
        \n \n
        \n \n it('should initialize to model', function() {\n var userType = element(by.binding('userType'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n expect(userType.getText()).toContain('guest');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n var userType = element(by.binding('userType'));\n var valid = element(by.binding('myForm.input.$valid'));\n var userInput = element(by.model('userType'));\n\n userInput.clear();\n userInput.sendKeys('');\n\n expect(userType.getText()).toEqual('userType =');\n expect(valid.getText()).toContain('false');\n });\n \n
        \n *\n * @param {string=} name Name of the form. If specified, the form controller will be published into\n * related scope, under this name.\n */\nvar formDirectiveFactory = function(isNgForm) {\n return ['$timeout', '$parse', function($timeout, $parse) {\n var formDirective = {\n name: 'form',\n restrict: isNgForm ? 'EAC' : 'E',\n require: ['form', '^^?form'], //first is the form's own ctrl, second is an optional parent form\n controller: FormController,\n compile: function ngFormCompile(formElement, attr) {\n // Setup initial state of the control\n formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);\n\n var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false);\n\n return {\n pre: function ngFormPreLink(scope, formElement, attr, ctrls) {\n var controller = ctrls[0];\n\n // if `action` attr is not present on the form, prevent the default action (submission)\n if (!('action' in attr)) {\n // we can't use jq events because if a form is destroyed during submission the default\n // action is not prevented. see #1238\n //\n // IE 9 is not affected because it doesn't fire a submit event and try to do a full\n // page reload if the form was destroyed by submission of the form via a click handler\n // on a button in the form. Looks like an IE9 specific bug.\n var handleFormSubmission = function(event) {\n scope.$apply(function() {\n controller.$commitViewValue();\n controller.$setSubmitted();\n });\n\n event.preventDefault();\n };\n\n addEventListenerFn(formElement[0], 'submit', handleFormSubmission);\n\n // unregister the preventDefault listener so that we don't not leak memory but in a\n // way that will achieve the prevention of the default action.\n formElement.on('$destroy', function() {\n $timeout(function() {\n removeEventListenerFn(formElement[0], 'submit', handleFormSubmission);\n }, 0, false);\n });\n }\n\n var parentFormCtrl = ctrls[1] || controller.$$parentForm;\n parentFormCtrl.$addControl(controller);\n\n var setter = nameAttr ? getSetter(controller.$name) : noop;\n\n if (nameAttr) {\n setter(scope, controller);\n attr.$observe(nameAttr, function(newValue) {\n if (controller.$name === newValue) return;\n setter(scope, undefined);\n controller.$$parentForm.$$renameControl(controller, newValue);\n setter = getSetter(controller.$name);\n setter(scope, controller);\n });\n }\n formElement.on('$destroy', function() {\n controller.$$parentForm.$removeControl(controller);\n setter(scope, undefined);\n extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards\n });\n }\n };\n }\n };\n\n return formDirective;\n\n function getSetter(expression) {\n if (expression === '') {\n //create an assignable expression, so forms with an empty name can be renamed later\n return $parse('this[\"\"]').assign;\n }\n return $parse(expression).assign || noop;\n }\n }];\n};\n\nvar formDirective = formDirectiveFactory();\nvar ngFormDirective = formDirectiveFactory(true);\n\n/* global VALID_CLASS: false,\n INVALID_CLASS: false,\n PRISTINE_CLASS: false,\n DIRTY_CLASS: false,\n UNTOUCHED_CLASS: false,\n TOUCHED_CLASS: false,\n ngModelMinErr: false,\n*/\n\n// Regex code was initially obtained from SO prior to modification: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231\nvar ISO_DATE_REGEXP = /^\\d{4,}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+(?:[+-][0-2]\\d:[0-5]\\d|Z)$/;\n// See valid URLs in RFC3987 (http://tools.ietf.org/html/rfc3987)\n// Note: We are being more lenient, because browsers are too.\n// 1. Scheme\n// 2. Slashes\n// 3. Username\n// 4. Password\n// 5. Hostname\n// 6. Port\n// 7. Path\n// 8. Query\n// 9. Fragment\n// 1111111111111111 222 333333 44444 555555555555555555555555 666 77777777 8888888 999\nvar URL_REGEXP = /^[a-z][a-z\\d.+-]*:\\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\\s:/?#]+|\\[[a-f\\d:]+\\])(?::\\d+)?(?:\\/[^?#]*)?(?:\\?[^#]*)?(?:#.*)?$/i;\n/* jshint maxlen:220 */\nvar EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\\/0-9=?A-Z^_`a-z{|}~]+(\\.[-!#$%&'*+\\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;\n/* jshint maxlen:200 */\nvar NUMBER_REGEXP = /^\\s*(\\-|\\+)?(\\d+|(\\d*(\\.\\d*)))([eE][+-]?\\d+)?\\s*$/;\nvar DATE_REGEXP = /^(\\d{4,})-(\\d{2})-(\\d{2})$/;\nvar DATETIMELOCAL_REGEXP = /^(\\d{4,})-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\nvar WEEK_REGEXP = /^(\\d{4,})-W(\\d\\d)$/;\nvar MONTH_REGEXP = /^(\\d{4,})-(\\d\\d)$/;\nvar TIME_REGEXP = /^(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\n\nvar PARTIAL_VALIDATION_EVENTS = 'keydown wheel mousedown';\nvar PARTIAL_VALIDATION_TYPES = createMap();\nforEach('date,datetime-local,month,time,week'.split(','), function(type) {\n PARTIAL_VALIDATION_TYPES[type] = true;\n});\n\nvar inputType = {\n\n /**\n * @ngdoc input\n * @name input[text]\n *\n * @description\n * Standard HTML text input with angular data binding, inherited by most of the `input` elements.\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Adds `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
        \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n * This parameter is ignored for input[type=password] controls, which will never trim the\n * input.\n *\n * @example\n \n \n \n
        \n \n
        \n \n Required!\n \n Single word only!\n
        \n text = {{example.text}}
        \n myForm.input.$valid = {{myForm.input.$valid}}
        \n myForm.input.$error = {{myForm.input.$error}}
        \n myForm.$valid = {{myForm.$valid}}
        \n myForm.$error.required = {{!!myForm.$error.required}}
        \n
        \n
        \n \n var text = element(by.binding('example.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('guest');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if multi word', function() {\n input.clear();\n input.sendKeys('hello world');\n\n expect(valid.getText()).toContain('false');\n });\n \n
        \n */\n 'text': textInputType,\n\n /**\n * @ngdoc input\n * @name input[date]\n *\n * @description\n * Input with date validation and transformation. In browsers that do not yet support\n * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601\n * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many\n * modern browsers do not yet support this input type, it is important to provide cues to users on the\n * expected input format via a placeholder or label.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n * valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute\n * (e.g. `min=\"{{minDate | date:'yyyy-MM-dd'}}\"`). Note that `min` will also add native HTML5\n * constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n * a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute\n * (e.g. `max=\"{{maxDate | date:'yyyy-MM-dd'}}\"`). Note that `max` will also add native HTML5\n * constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
        \n \n \n
        \n \n Required!\n \n Not a valid date!\n
        \n value = {{example.value | date: \"yyyy-MM-dd\"}}
        \n myForm.input.$valid = {{myForm.input.$valid}}
        \n myForm.input.$error = {{myForm.input.$error}}
        \n myForm.$valid = {{myForm.$valid}}
        \n myForm.$error.required = {{!!myForm.$error.required}}
        \n
        \n
        \n \n var value = element(by.binding('example.value | date: \"yyyy-MM-dd\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (see https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-10-22');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01-01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
        \n */\n 'date': createDateInputType('date', DATE_REGEXP,\n createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']),\n 'yyyy-MM-dd'),\n\n /**\n * @ngdoc input\n * @name input[datetime-local]\n *\n * @description\n * Input with datetime validation and transformation. In browsers that do not yet support\n * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation\n * inside this attribute (e.g. `min=\"{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}\"`).\n * Note that `min` will also add native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation\n * inside this attribute (e.g. `max=\"{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}\"`).\n * Note that `max` will also add native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
        \n \n \n
        \n \n Required!\n \n Not a valid date!\n
        \n value = {{example.value | date: \"yyyy-MM-ddTHH:mm:ss\"}}
        \n myForm.input.$valid = {{myForm.input.$valid}}
        \n myForm.input.$error = {{myForm.input.$error}}
        \n myForm.$valid = {{myForm.$valid}}
        \n myForm.$error.required = {{!!myForm.$error.required}}
        \n
        \n
        \n \n var value = element(by.binding('example.value | date: \"yyyy-MM-ddTHH:mm:ss\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2010-12-28T14:57:00');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01-01T23:59:00');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
        \n */\n 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP,\n createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']),\n 'yyyy-MM-ddTHH:mm:ss.sss'),\n\n /**\n * @ngdoc input\n * @name input[time]\n *\n * @description\n * Input with time validation and transformation. In browsers that do not yet support\n * the HTML5 time input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a\n * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minTime | date:'HH:mm:ss'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxTime | date:'HH:mm:ss'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the\n * `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the\n * `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
        \n \n \n
        \n \n Required!\n \n Not a valid date!\n
        \n value = {{example.value | date: \"HH:mm:ss\"}}
        \n myForm.input.$valid = {{myForm.input.$valid}}
        \n myForm.input.$error = {{myForm.input.$error}}
        \n myForm.$valid = {{myForm.$valid}}
        \n myForm.$error.required = {{!!myForm.$error.required}}
        \n
        \n
        \n \n var value = element(by.binding('example.value | date: \"HH:mm:ss\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('14:57:00');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('23:59:00');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
        \n */\n 'time': createDateInputType('time', TIME_REGEXP,\n createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']),\n 'HH:mm:ss.sss'),\n\n /**\n * @ngdoc input\n * @name input[week]\n *\n * @description\n * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support\n * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * week format (yyyy-W##), for example: `2013-W02`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minWeek | date:'yyyy-Www'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxWeek | date:'yyyy-Www'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
        \n \n
        \n \n Required!\n \n Not a valid date!\n
        \n value = {{example.value | date: \"yyyy-Www\"}}
        \n myForm.input.$valid = {{myForm.input.$valid}}
        \n myForm.input.$error = {{myForm.input.$error}}
        \n myForm.$valid = {{myForm.$valid}}
        \n myForm.$error.required = {{!!myForm.$error.required}}
        \n
        \n
        \n \n var value = element(by.binding('example.value | date: \"yyyy-Www\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-W01');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-W01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
        \n */\n 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'),\n\n /**\n * @ngdoc input\n * @name input[month]\n *\n * @description\n * Input with month validation and transformation. In browsers that do not yet support\n * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * month format (yyyy-MM), for example: `2009-01`.\n *\n * The model must always be a Date object, otherwise Angular will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n * If the model is not set to the first of the month, the next view to model update will set it\n * to the first of the month.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minMonth | date:'yyyy-MM'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxMonth | date:'yyyy-MM'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
        \n \n \n
        \n \n Required!\n \n Not a valid month!\n
        \n value = {{example.value | date: \"yyyy-MM\"}}
        \n myForm.input.$valid = {{myForm.input.$valid}}
        \n myForm.input.$error = {{myForm.input.$error}}
        \n myForm.$valid = {{myForm.$valid}}
        \n myForm.$error.required = {{!!myForm.$error.required}}
        \n
        \n
        \n \n var value = element(by.binding('example.value | date: \"yyyy-MM\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-10');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
        \n */\n 'month': createDateInputType('month', MONTH_REGEXP,\n createDateParser(MONTH_REGEXP, ['yyyy', 'MM']),\n 'yyyy-MM'),\n\n /**\n * @ngdoc input\n * @name input[number]\n *\n * @description\n * Text input with number validation and transformation. Sets the `number` validation\n * error if not a valid number.\n *\n *
        \n * The model must always be of type `number` otherwise Angular will throw an error.\n * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt}\n * error docs for more information and an example of how to convert your model if necessary.\n *
        \n *\n * ## Issues with HTML5 constraint validation\n *\n * In browsers that follow the\n * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),\n * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}.\n * If a non-number is entered in the input, the browser will report the value as an empty string,\n * which means the view / model values in `ngModel` and subsequently the scope value\n * will also be an empty string.\n *\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
        \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
        \n \n
        \n \n Required!\n \n Not valid number!\n
        \n value = {{example.value}}
        \n myForm.input.$valid = {{myForm.input.$valid}}
        \n myForm.input.$error = {{myForm.input.$error}}
        \n myForm.$valid = {{myForm.$valid}}
        \n myForm.$error.required = {{!!myForm.$error.required}}
        \n
        \n
        \n \n var value = element(by.binding('example.value'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('12');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if over max', function() {\n input.clear();\n input.sendKeys('123');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('false');\n });\n \n
        \n */\n 'number': numberInputType,\n\n\n /**\n * @ngdoc input\n * @name input[url]\n *\n * @description\n * Text input with URL validation. Sets the `url` validation error key if the content is not a\n * valid URL.\n *\n *
        \n * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex\n * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify\n * the built-in validators (see the {@link guide/forms Forms guide})\n *
        \n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
        \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
        \n
        \n \n var text = element(by.binding('url.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('url.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('http://google.com');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if not url', function() {\n input.clear();\n input.sendKeys('box');\n\n expect(valid.getText()).toContain('false');\n });\n \n
        \n */\n 'url': urlInputType,\n\n\n /**\n * @ngdoc input\n * @name input[email]\n *\n * @description\n * Text input with email validation. Sets the `email` validation error key if not a valid email\n * address.\n *\n *
        \n * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex\n * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can\n * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide})\n *
        \n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
        \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
        \n \n
        \n \n Required!\n \n Not valid email!\n
        \n text = {{email.text}}
        \n myForm.input.$valid = {{myForm.input.$valid}}
        \n myForm.input.$error = {{myForm.input.$error}}
        \n myForm.$valid = {{myForm.$valid}}
        \n myForm.$error.required = {{!!myForm.$error.required}}
        \n myForm.$error.email = {{!!myForm.$error.email}}
        \n
        \n
        \n \n var text = element(by.binding('email.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('email.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('me@example.com');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if not email', function() {\n input.clear();\n input.sendKeys('xxx');\n\n expect(valid.getText()).toContain('false');\n });\n \n
        \n */\n 'email': emailInputType,\n\n\n /**\n * @ngdoc input\n * @name input[radio]\n *\n * @description\n * HTML radio button.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string} value The value to which the `ngModel` expression should be set when selected.\n * Note that `value` only supports `string` values, i.e. the scope model needs to be a string,\n * too. Use `ngValue` if you need complex models (`number`, `object`, ...).\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {string} ngValue Angular expression to which `ngModel` will be be set when the radio\n * is selected. Should be used instead of the `value` attribute if you need\n * a non-string `ngModel` (`boolean`, `array`, ...).\n *\n * @example\n \n \n \n
        \n
        \n
        \n
        \n color = {{color.name | json}}
        \n
        \n Note that `ng-value=\"specialValue\"` sets radio item's value to be the value of `$scope.specialValue`.\n
        \n \n it('should change state', function() {\n var color = element(by.binding('color.name'));\n\n expect(color.getText()).toContain('blue');\n\n element.all(by.model('color.name')).get(0).click();\n\n expect(color.getText()).toContain('red');\n });\n \n
        \n */\n 'radio': radioInputType,\n\n\n /**\n * @ngdoc input\n * @name input[checkbox]\n *\n * @description\n * HTML checkbox.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {expression=} ngTrueValue The value to which the expression should be set when selected.\n * @param {expression=} ngFalseValue The value to which the expression should be set when not selected.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
        \n
        \n
        \n value1 = {{checkboxModel.value1}}
        \n value2 = {{checkboxModel.value2}}
        \n
        \n
        \n \n it('should change state', function() {\n var value1 = element(by.binding('checkboxModel.value1'));\n var value2 = element(by.binding('checkboxModel.value2'));\n\n expect(value1.getText()).toContain('true');\n expect(value2.getText()).toContain('YES');\n\n element(by.model('checkboxModel.value1')).click();\n element(by.model('checkboxModel.value2')).click();\n\n expect(value1.getText()).toContain('false');\n expect(value2.getText()).toContain('NO');\n });\n \n
        \n */\n 'checkbox': checkboxInputType,\n\n 'hidden': noop,\n 'button': noop,\n 'submit': noop,\n 'reset': noop,\n 'file': noop\n};\n\nfunction stringBasedInputType(ctrl) {\n ctrl.$formatters.push(function(value) {\n return ctrl.$isEmpty(value) ? value : value.toString();\n });\n}\n\nfunction textInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n}\n\nfunction baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n var type = lowercase(element[0].type);\n\n // In composition mode, users are still inputing intermediate text buffer,\n // hold the listener until composition is done.\n // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent\n if (!$sniffer.android) {\n var composing = false;\n\n element.on('compositionstart', function() {\n composing = true;\n });\n\n element.on('compositionend', function() {\n composing = false;\n listener();\n });\n }\n\n var timeout;\n\n var listener = function(ev) {\n if (timeout) {\n $browser.defer.cancel(timeout);\n timeout = null;\n }\n if (composing) return;\n var value = element.val(),\n event = ev && ev.type;\n\n // By default we will trim the value\n // If the attribute ng-trim exists we will avoid trimming\n // If input type is 'password', the value is never trimmed\n if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) {\n value = trim(value);\n }\n\n // If a control is suffering from bad input (due to native validators), browsers discard its\n // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the\n // control's value is the same empty value twice in a row.\n if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) {\n ctrl.$setViewValue(value, event);\n }\n };\n\n // if the browser does support \"input\" event, we are fine - except on IE9 which doesn't fire the\n // input event on backspace, delete or cut\n if ($sniffer.hasEvent('input')) {\n element.on('input', listener);\n } else {\n var deferListener = function(ev, input, origValue) {\n if (!timeout) {\n timeout = $browser.defer(function() {\n timeout = null;\n if (!input || input.value !== origValue) {\n listener(ev);\n }\n });\n }\n };\n\n element.on('keydown', function(event) {\n var key = event.keyCode;\n\n // ignore\n // command modifiers arrows\n if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;\n\n deferListener(event, this, this.value);\n });\n\n // if user modifies input value using context menu in IE, we need \"paste\" and \"cut\" events to catch it\n if ($sniffer.hasEvent('paste')) {\n element.on('paste cut', deferListener);\n }\n }\n\n // if user paste into input using mouse on older browser\n // or form autocomplete on newer browser, we need \"change\" event to catch it\n element.on('change', listener);\n\n // Some native input types (date-family) have the ability to change validity without\n // firing any input/change events.\n // For these event types, when native validators are present and the browser supports the type,\n // check for validity changes on various DOM events.\n if (PARTIAL_VALIDATION_TYPES[type] && ctrl.$$hasNativeValidators && type === attr.type) {\n element.on(PARTIAL_VALIDATION_EVENTS, function(ev) {\n if (!timeout) {\n var validity = this[VALIDITY_STATE_PROPERTY];\n var origBadInput = validity.badInput;\n var origTypeMismatch = validity.typeMismatch;\n timeout = $browser.defer(function() {\n timeout = null;\n if (validity.badInput !== origBadInput || validity.typeMismatch !== origTypeMismatch) {\n listener(ev);\n }\n });\n }\n });\n }\n\n ctrl.$render = function() {\n // Workaround for Firefox validation #12102.\n var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue;\n if (element.val() !== value) {\n element.val(value);\n }\n };\n}\n\nfunction weekParser(isoWeek, existingDate) {\n if (isDate(isoWeek)) {\n return isoWeek;\n }\n\n if (isString(isoWeek)) {\n WEEK_REGEXP.lastIndex = 0;\n var parts = WEEK_REGEXP.exec(isoWeek);\n if (parts) {\n var year = +parts[1],\n week = +parts[2],\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n firstThurs = getFirstThursdayOfYear(year),\n addDays = (week - 1) * 7;\n\n if (existingDate) {\n hours = existingDate.getHours();\n minutes = existingDate.getMinutes();\n seconds = existingDate.getSeconds();\n milliseconds = existingDate.getMilliseconds();\n }\n\n return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds);\n }\n }\n\n return NaN;\n}\n\nfunction createDateParser(regexp, mapping) {\n return function(iso, date) {\n var parts, map;\n\n if (isDate(iso)) {\n return iso;\n }\n\n if (isString(iso)) {\n // When a date is JSON'ified to wraps itself inside of an extra\n // set of double quotes. This makes the date parsing code unable\n // to match the date string and parse it as a date.\n if (iso.charAt(0) == '\"' && iso.charAt(iso.length - 1) == '\"') {\n iso = iso.substring(1, iso.length - 1);\n }\n if (ISO_DATE_REGEXP.test(iso)) {\n return new Date(iso);\n }\n regexp.lastIndex = 0;\n parts = regexp.exec(iso);\n\n if (parts) {\n parts.shift();\n if (date) {\n map = {\n yyyy: date.getFullYear(),\n MM: date.getMonth() + 1,\n dd: date.getDate(),\n HH: date.getHours(),\n mm: date.getMinutes(),\n ss: date.getSeconds(),\n sss: date.getMilliseconds() / 1000\n };\n } else {\n map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };\n }\n\n forEach(parts, function(part, index) {\n if (index < mapping.length) {\n map[mapping[index]] = +part;\n }\n });\n return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0);\n }\n }\n\n return NaN;\n };\n}\n\nfunction createDateInputType(type, regexp, parseDate, format) {\n return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) {\n badInputChecker(scope, element, attr, ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n var timezone = ctrl && ctrl.$options && ctrl.$options.timezone;\n var previousDate;\n\n ctrl.$$parserName = type;\n ctrl.$parsers.push(function(value) {\n if (ctrl.$isEmpty(value)) return null;\n if (regexp.test(value)) {\n // Note: We cannot read ctrl.$modelValue, as there might be a different\n // parser/formatter in the processing chain so that the model\n // contains some different data format!\n var parsedDate = parseDate(value, previousDate);\n if (timezone) {\n parsedDate = convertTimezoneToLocal(parsedDate, timezone);\n }\n return parsedDate;\n }\n return undefined;\n });\n\n ctrl.$formatters.push(function(value) {\n if (value && !isDate(value)) {\n throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value);\n }\n if (isValidDate(value)) {\n previousDate = value;\n if (previousDate && timezone) {\n previousDate = convertTimezoneToLocal(previousDate, timezone, true);\n }\n return $filter('date')(value, format, timezone);\n } else {\n previousDate = null;\n return '';\n }\n });\n\n if (isDefined(attr.min) || attr.ngMin) {\n var minVal;\n ctrl.$validators.min = function(value) {\n return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal;\n };\n attr.$observe('min', function(val) {\n minVal = parseObservedDateValue(val);\n ctrl.$validate();\n });\n }\n\n if (isDefined(attr.max) || attr.ngMax) {\n var maxVal;\n ctrl.$validators.max = function(value) {\n return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal;\n };\n attr.$observe('max', function(val) {\n maxVal = parseObservedDateValue(val);\n ctrl.$validate();\n });\n }\n\n function isValidDate(value) {\n // Invalid Date: getTime() returns NaN\n return value && !(value.getTime && value.getTime() !== value.getTime());\n }\n\n function parseObservedDateValue(val) {\n return isDefined(val) && !isDate(val) ? parseDate(val) || undefined : val;\n }\n };\n}\n\nfunction badInputChecker(scope, element, attr, ctrl) {\n var node = element[0];\n var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity);\n if (nativeValidation) {\n ctrl.$parsers.push(function(value) {\n var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};\n return validity.badInput || validity.typeMismatch ? undefined : value;\n });\n }\n}\n\nfunction numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n badInputChecker(scope, element, attr, ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n ctrl.$$parserName = 'number';\n ctrl.$parsers.push(function(value) {\n if (ctrl.$isEmpty(value)) return null;\n if (NUMBER_REGEXP.test(value)) return parseFloat(value);\n return undefined;\n });\n\n ctrl.$formatters.push(function(value) {\n if (!ctrl.$isEmpty(value)) {\n if (!isNumber(value)) {\n throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);\n }\n value = value.toString();\n }\n return value;\n });\n\n if (isDefined(attr.min) || attr.ngMin) {\n var minVal;\n ctrl.$validators.min = function(value) {\n return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal;\n };\n\n attr.$observe('min', function(val) {\n if (isDefined(val) && !isNumber(val)) {\n val = parseFloat(val);\n }\n minVal = isNumber(val) && !isNaN(val) ? val : undefined;\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n });\n }\n\n if (isDefined(attr.max) || attr.ngMax) {\n var maxVal;\n ctrl.$validators.max = function(value) {\n return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;\n };\n\n attr.$observe('max', function(val) {\n if (isDefined(val) && !isNumber(val)) {\n val = parseFloat(val);\n }\n maxVal = isNumber(val) && !isNaN(val) ? val : undefined;\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n });\n }\n}\n\nfunction urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n // Note: no badInputChecker here by purpose as `url` is only a validation\n // in browsers, i.e. we can always read out input.value even if it is not valid!\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n\n ctrl.$$parserName = 'url';\n ctrl.$validators.url = function(modelValue, viewValue) {\n var value = modelValue || viewValue;\n return ctrl.$isEmpty(value) || URL_REGEXP.test(value);\n };\n}\n\nfunction emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n // Note: no badInputChecker here by purpose as `url` is only a validation\n // in browsers, i.e. we can always read out input.value even if it is not valid!\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n\n ctrl.$$parserName = 'email';\n ctrl.$validators.email = function(modelValue, viewValue) {\n var value = modelValue || viewValue;\n return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);\n };\n}\n\nfunction radioInputType(scope, element, attr, ctrl) {\n // make the name unique, if not defined\n if (isUndefined(attr.name)) {\n element.attr('name', nextUid());\n }\n\n var listener = function(ev) {\n if (element[0].checked) {\n ctrl.$setViewValue(attr.value, ev && ev.type);\n }\n };\n\n element.on('click', listener);\n\n ctrl.$render = function() {\n var value = attr.value;\n element[0].checked = (value == ctrl.$viewValue);\n };\n\n attr.$observe('value', ctrl.$render);\n}\n\nfunction parseConstantExpr($parse, context, name, expression, fallback) {\n var parseFn;\n if (isDefined(expression)) {\n parseFn = $parse(expression);\n if (!parseFn.constant) {\n throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' +\n '`{1}`.', name, expression);\n }\n return parseFn(context);\n }\n return fallback;\n}\n\nfunction checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true);\n var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false);\n\n var listener = function(ev) {\n ctrl.$setViewValue(element[0].checked, ev && ev.type);\n };\n\n element.on('click', listener);\n\n ctrl.$render = function() {\n element[0].checked = ctrl.$viewValue;\n };\n\n // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false`\n // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert\n // it to a boolean.\n ctrl.$isEmpty = function(value) {\n return value === false;\n };\n\n ctrl.$formatters.push(function(value) {\n return equals(value, trueValue);\n });\n\n ctrl.$parsers.push(function(value) {\n return value ? trueValue : falseValue;\n });\n}\n\n\n/**\n * @ngdoc directive\n * @name textarea\n * @restrict E\n *\n * @description\n * HTML textarea element control with angular data-binding. The data-binding and validation\n * properties of this element are exactly the same as those of the\n * {@link ng.directive:input input element}.\n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n * length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
        \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n */\n\n\n/**\n * @ngdoc directive\n * @name input\n * @restrict E\n *\n * @description\n * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding,\n * input state control, and validation.\n * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.\n *\n *
        \n * **Note:** Not every feature offered is available for all input types.\n * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`.\n *
        \n *\n * @param {string} ngModel Assignable angular expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {boolean=} ngRequired Sets `required` attribute if set to true\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n * length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * value does not match a RegExp found by evaluating the Angular expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
        \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange Angular expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.\n * This parameter is ignored for input[type=password] controls, which will never trim the\n * input.\n *\n * @example\n \n \n \n
        \n
        \n \n
        \n \n Required!\n
        \n \n
        \n \n Too short!\n \n Too long!\n
        \n
        \n
        \n user = {{user}}
        \n myForm.userName.$valid = {{myForm.userName.$valid}}
        \n myForm.userName.$error = {{myForm.userName.$error}}
        \n myForm.lastName.$valid = {{myForm.lastName.$valid}}
        \n myForm.lastName.$error = {{myForm.lastName.$error}}
        \n myForm.$valid = {{myForm.$valid}}
        \n myForm.$error.required = {{!!myForm.$error.required}}
        \n myForm.$error.minlength = {{!!myForm.$error.minlength}}
        \n myForm.$error.maxlength = {{!!myForm.$error.maxlength}}
        \n
        \n
        \n \n var user = element(by.exactBinding('user'));\n var userNameValid = element(by.binding('myForm.userName.$valid'));\n var lastNameValid = element(by.binding('myForm.lastName.$valid'));\n var lastNameError = element(by.binding('myForm.lastName.$error'));\n var formValid = element(by.binding('myForm.$valid'));\n var userNameInput = element(by.model('user.name'));\n var userLastInput = element(by.model('user.last'));\n\n it('should initialize to model', function() {\n expect(user.getText()).toContain('{\"name\":\"guest\",\"last\":\"visitor\"}');\n expect(userNameValid.getText()).toContain('true');\n expect(formValid.getText()).toContain('true');\n });\n\n it('should be invalid if empty when required', function() {\n userNameInput.clear();\n userNameInput.sendKeys('');\n\n expect(user.getText()).toContain('{\"last\":\"visitor\"}');\n expect(userNameValid.getText()).toContain('false');\n expect(formValid.getText()).toContain('false');\n });\n\n it('should be valid if empty when min length is set', function() {\n userLastInput.clear();\n userLastInput.sendKeys('');\n\n expect(user.getText()).toContain('{\"name\":\"guest\",\"last\":\"\"}');\n expect(lastNameValid.getText()).toContain('true');\n expect(formValid.getText()).toContain('true');\n });\n\n it('should be invalid if less than required min length', function() {\n userLastInput.clear();\n userLastInput.sendKeys('xx');\n\n expect(user.getText()).toContain('{\"name\":\"guest\"}');\n expect(lastNameValid.getText()).toContain('false');\n expect(lastNameError.getText()).toContain('minlength');\n expect(formValid.getText()).toContain('false');\n });\n\n it('should be invalid if longer than max length', function() {\n userLastInput.clear();\n userLastInput.sendKeys('some ridiculously long name');\n\n expect(user.getText()).toContain('{\"name\":\"guest\"}');\n expect(lastNameValid.getText()).toContain('false');\n expect(lastNameError.getText()).toContain('maxlength');\n expect(formValid.getText()).toContain('false');\n });\n \n
        \n */\nvar inputDirective = ['$browser', '$sniffer', '$filter', '$parse',\n function($browser, $sniffer, $filter, $parse) {\n return {\n restrict: 'E',\n require: ['?ngModel'],\n link: {\n pre: function(scope, element, attr, ctrls) {\n if (ctrls[0]) {\n (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer,\n $browser, $filter, $parse);\n }\n }\n }\n };\n}];\n\n\n\nvar CONSTANT_VALUE_REGEXP = /^(true|false|\\d+)$/;\n/**\n * @ngdoc directive\n * @name ngValue\n *\n * @description\n * Binds the given expression to the value of `
        \n \n \n it('should show correct pluralized string', function() {\n var withoutOffset = element.all(by.css('ng-pluralize')).get(0);\n var withOffset = element.all(by.css('ng-pluralize')).get(1);\n var countInput = element(by.model('personCount'));\n\n expect(withoutOffset.getText()).toEqual('1 person is viewing.');\n expect(withOffset.getText()).toEqual('Igor is viewing.');\n\n countInput.clear();\n countInput.sendKeys('0');\n\n expect(withoutOffset.getText()).toEqual('Nobody is viewing.');\n expect(withOffset.getText()).toEqual('Nobody is viewing.');\n\n countInput.clear();\n countInput.sendKeys('2');\n\n expect(withoutOffset.getText()).toEqual('2 people are viewing.');\n expect(withOffset.getText()).toEqual('Igor and Misko are viewing.');\n\n countInput.clear();\n countInput.sendKeys('3');\n\n expect(withoutOffset.getText()).toEqual('3 people are viewing.');\n expect(withOffset.getText()).toEqual('Igor, Misko and one other person are viewing.');\n\n countInput.clear();\n countInput.sendKeys('4');\n\n expect(withoutOffset.getText()).toEqual('4 people are viewing.');\n expect(withOffset.getText()).toEqual('Igor, Misko and 2 other people are viewing.');\n });\n it('should show data-bound names', function() {\n var withOffset = element.all(by.css('ng-pluralize')).get(1);\n var personCount = element(by.model('personCount'));\n var person1 = element(by.model('person1'));\n var person2 = element(by.model('person2'));\n personCount.clear();\n personCount.sendKeys('4');\n person1.clear();\n person1.sendKeys('Di');\n person2.clear();\n person2.sendKeys('Vojta');\n expect(withOffset.getText()).toEqual('Di, Vojta and 2 other people are viewing.');\n });\n \n \n */\nvar ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, $interpolate, $log) {\n var BRACE = /{}/g,\n IS_WHEN = /^when(Minus)?(.+)$/;\n\n return {\n link: function(scope, element, attr) {\n var numberExp = attr.count,\n whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs\n offset = attr.offset || 0,\n whens = scope.$eval(whenExp) || {},\n whensExpFns = {},\n startSymbol = $interpolate.startSymbol(),\n endSymbol = $interpolate.endSymbol(),\n braceReplacement = startSymbol + numberExp + '-' + offset + endSymbol,\n watchRemover = angular.noop,\n lastCount;\n\n forEach(attr, function(expression, attributeName) {\n var tmpMatch = IS_WHEN.exec(attributeName);\n if (tmpMatch) {\n var whenKey = (tmpMatch[1] ? '-' : '') + lowercase(tmpMatch[2]);\n whens[whenKey] = element.attr(attr.$attr[attributeName]);\n }\n });\n forEach(whens, function(expression, key) {\n whensExpFns[key] = $interpolate(expression.replace(BRACE, braceReplacement));\n\n });\n\n scope.$watch(numberExp, function ngPluralizeWatchAction(newVal) {\n var count = parseFloat(newVal);\n var countIsNaN = isNaN(count);\n\n if (!countIsNaN && !(count in whens)) {\n // If an explicit number rule such as 1, 2, 3... is defined, just use it.\n // Otherwise, check it against pluralization rules in $locale service.\n count = $locale.pluralCat(count - offset);\n }\n\n // If both `count` and `lastCount` are NaN, we don't need to re-register a watch.\n // In JS `NaN !== NaN`, so we have to explicitly check.\n if ((count !== lastCount) && !(countIsNaN && isNumber(lastCount) && isNaN(lastCount))) {\n watchRemover();\n var whenExpFn = whensExpFns[count];\n if (isUndefined(whenExpFn)) {\n if (newVal != null) {\n $log.debug(\"ngPluralize: no rule defined for '\" + count + \"' in \" + whenExp);\n }\n watchRemover = noop;\n updateElementText();\n } else {\n watchRemover = scope.$watch(whenExpFn, updateElementText);\n }\n lastCount = count;\n }\n });\n\n function updateElementText(newText) {\n element.text(newText || '');\n }\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngRepeat\n * @multiElement\n *\n * @description\n * The `ngRepeat` directive instantiates a template once per item from a collection. Each template\n * instance gets its own scope, where the given loop variable is set to the current collection item,\n * and `$index` is set to the item index or key.\n *\n * Special properties are exposed on the local scope of each template instance, including:\n *\n * | Variable | Type | Details |\n * |-----------|-----------------|-----------------------------------------------------------------------------|\n * | `$index` | {@type number} | iterator offset of the repeated element (0..length-1) |\n * | `$first` | {@type boolean} | true if the repeated element is first in the iterator. |\n * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. |\n * | `$last` | {@type boolean} | true if the repeated element is last in the iterator. |\n * | `$even` | {@type boolean} | true if the iterator position `$index` is even (otherwise false). |\n * | `$odd` | {@type boolean} | true if the iterator position `$index` is odd (otherwise false). |\n *\n *
        \n * Creating aliases for these properties is possible with {@link ng.directive:ngInit `ngInit`}.\n * This may be useful when, for instance, nesting ngRepeats.\n *
        \n *\n *\n * # Iterating over object properties\n *\n * It is possible to get `ngRepeat` to iterate over the properties of an object using the following\n * syntax:\n *\n * ```js\n *
        ...
        \n * ```\n *\n * However, there are a limitations compared to array iteration:\n *\n * - The JavaScript specification does not define the order of keys\n * returned for an object, so Angular relies on the order returned by the browser\n * when running `for key in myObj`. Browsers generally follow the strategy of providing\n * keys in the order in which they were defined, although there are exceptions when keys are deleted\n * and reinstated. See the\n * [MDN page on `delete` for more info](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete#Cross-browser_notes).\n *\n * - `ngRepeat` will silently *ignore* object keys starting with `$`, because\n * it's a prefix used by Angular for public (`$`) and private (`$$`) properties.\n *\n * - The built-in filters {@link ng.orderBy orderBy} and {@link ng.filter filter} do not work with\n * objects, and will throw an error if used with one.\n *\n * If you are hitting any of these limitations, the recommended workaround is to convert your object into an array\n * that is sorted into the order that you prefer before providing it to `ngRepeat`. You could\n * do this with a filter such as [toArrayFilter](http://ngmodules.org/modules/angular-toArrayFilter)\n * or implement a `$watch` on the object yourself.\n *\n *\n * # Tracking and Duplicates\n *\n * `ngRepeat` uses {@link $rootScope.Scope#$watchCollection $watchCollection} to detect changes in\n * the collection. When a change happens, ngRepeat then makes the corresponding changes to the DOM:\n *\n * * When an item is added, a new instance of the template is added to the DOM.\n * * When an item is removed, its template instance is removed from the DOM.\n * * When items are reordered, their respective templates are reordered in the DOM.\n *\n * To minimize creation of DOM elements, `ngRepeat` uses a function\n * to \"keep track\" of all items in the collection and their corresponding DOM elements.\n * For example, if an item is added to the collection, ngRepeat will know that all other items\n * already have DOM elements, and will not re-render them.\n *\n * The default tracking function (which tracks items by their identity) does not allow\n * duplicate items in arrays. This is because when there are duplicates, it is not possible\n * to maintain a one-to-one mapping between collection items and DOM elements.\n *\n * If you do need to repeat duplicate items, you can substitute the default tracking behavior\n * with your own using the `track by` expression.\n *\n * For example, you may track items by the index of each item in the collection, using the\n * special scope property `$index`:\n * ```html\n *
        \n * {{n}}\n *
        \n * ```\n *\n * You may also use arbitrary expressions in `track by`, including references to custom functions\n * on the scope:\n * ```html\n *
        \n * {{n}}\n *
        \n * ```\n *\n *
        \n * If you are working with objects that have an identifier property, you should track\n * by the identifier instead of the whole object. Should you reload your data later, `ngRepeat`\n * will not have to rebuild the DOM elements for items it has already rendered, even if the\n * JavaScript objects in the collection have been substituted for new ones. For large collections,\n * this significantly improves rendering performance. If you don't have a unique identifier,\n * `track by $index` can also provide a performance boost.\n *
        \n * ```html\n *
        \n * {{model.name}}\n *
        \n * ```\n *\n * When no `track by` expression is provided, it is equivalent to tracking by the built-in\n * `$id` function, which tracks items by their identity:\n * ```html\n *
        \n * {{obj.prop}}\n *
        \n * ```\n *\n *
        \n * **Note:** `track by` must always be the last expression:\n *
        \n * ```\n *
        \n * {{model.name}}\n *
        \n * ```\n *\n * # Special repeat start and end points\n * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending\n * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.\n * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on)\n * up to and including the ending HTML tag where **ng-repeat-end** is placed.\n *\n * The example below makes use of this feature:\n * ```html\n *
        \n * Header {{ item }}\n *
        \n *
        \n * Body {{ item }}\n *
        \n *
        \n * Footer {{ item }}\n *
        \n * ```\n *\n * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:\n * ```html\n *
        \n * Header A\n *
        \n *
        \n * Body A\n *
        \n *
        \n * Footer A\n *
        \n *
        \n * Header B\n *
        \n *
        \n * Body B\n *
        \n *
        \n * Footer B\n *
        \n * ```\n *\n * The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such\n * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link ng.$animate#enter enter} | when a new item is added to the list or when an item is revealed after a filter |\n * | {@link ng.$animate#leave leave} | when an item is removed from the list or when an item is filtered out |\n * | {@link ng.$animate#move move } | when an adjacent item is filtered out causing a reorder or when the item contents are reordered |\n *\n * See the example below for defining CSS animations with ngRepeat.\n *\n * @element ANY\n * @scope\n * @priority 1000\n * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These\n * formats are currently supported:\n *\n * * `variable in expression` – where variable is the user defined loop variable and `expression`\n * is a scope expression giving the collection to enumerate.\n *\n * For example: `album in artist.albums`.\n *\n * * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,\n * and `expression` is the scope expression giving the collection to enumerate.\n *\n * For example: `(name, age) in {'adam':10, 'amalie':12}`.\n *\n * * `variable in expression track by tracking_expression` – You can also provide an optional tracking expression\n * which can be used to associate the objects in the collection with the DOM elements. If no tracking expression\n * is specified, ng-repeat associates elements by identity. It is an error to have\n * more than one tracking expression value resolve to the same key. (This would mean that two distinct objects are\n * mapped to the same DOM element, which is not possible.)\n *\n * Note that the tracking expression must come last, after any filters, and the alias expression.\n *\n * For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements\n * will be associated by item identity in the array.\n *\n * For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique\n * `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements\n * with the corresponding item in the array by identity. Moving the same object in array would move the DOM\n * element in the same way in the DOM.\n *\n * For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this\n * case the object identity does not matter. Two objects are considered equivalent as long as their `id`\n * property is same.\n *\n * For example: `item in items | filter:searchText track by item.id` is a pattern that might be used to apply a filter\n * to items in conjunction with a tracking expression.\n *\n * * `variable in expression as alias_expression` – You can also provide an optional alias expression which will then store the\n * intermediate results of the repeater after the filters have been applied. Typically this is used to render a special message\n * when a filter is active on the repeater, but the filtered result set is empty.\n *\n * For example: `item in items | filter:x as results` will store the fragment of the repeated items as `results`, but only after\n * the items have been processed through the filter.\n *\n * Please note that `as [variable name] is not an operator but rather a part of ngRepeat micro-syntax so it can be used only at the end\n * (and not as operator, inside an expression).\n *\n * For example: `item in items | filter : x | orderBy : order | limitTo : limit as results` .\n *\n * @example\n * This example uses `ngRepeat` to display a list of people. A filter is used to restrict the displayed\n * results by name. New (entering) and removed (leaving) items are animated.\n \n \n
        \n I have {{friends.length}} friends. They are:\n \n
          \n
        • \n [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.\n
        • \n
        • \n No results found...\n
        • \n
        \n
        \n
        \n \n angular.module('ngRepeat', ['ngAnimate']).controller('repeatController', function($scope) {\n $scope.friends = [\n {name:'John', age:25, gender:'boy'},\n {name:'Jessie', age:30, gender:'girl'},\n {name:'Johanna', age:28, gender:'girl'},\n {name:'Joy', age:15, gender:'girl'},\n {name:'Mary', age:28, gender:'girl'},\n {name:'Peter', age:95, gender:'boy'},\n {name:'Sebastian', age:50, gender:'boy'},\n {name:'Erika', age:27, gender:'girl'},\n {name:'Patrick', age:40, gender:'boy'},\n {name:'Samantha', age:60, gender:'girl'}\n ];\n });\n \n \n .example-animate-container {\n background:white;\n border:1px solid black;\n list-style:none;\n margin:0;\n padding:0 10px;\n }\n\n .animate-repeat {\n line-height:30px;\n list-style:none;\n box-sizing:border-box;\n }\n\n .animate-repeat.ng-move,\n .animate-repeat.ng-enter,\n .animate-repeat.ng-leave {\n transition:all linear 0.5s;\n }\n\n .animate-repeat.ng-leave.ng-leave-active,\n .animate-repeat.ng-move,\n .animate-repeat.ng-enter {\n opacity:0;\n max-height:0;\n }\n\n .animate-repeat.ng-leave,\n .animate-repeat.ng-move.ng-move-active,\n .animate-repeat.ng-enter.ng-enter-active {\n opacity:1;\n max-height:30px;\n }\n \n \n var friends = element.all(by.repeater('friend in friends'));\n\n it('should render initial data set', function() {\n expect(friends.count()).toBe(10);\n expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.');\n expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.');\n expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.');\n expect(element(by.binding('friends.length')).getText())\n .toMatch(\"I have 10 friends. They are:\");\n });\n\n it('should update repeater when filter predicate changes', function() {\n expect(friends.count()).toBe(10);\n\n element(by.model('q')).sendKeys('ma');\n\n expect(friends.count()).toBe(2);\n expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.');\n expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.');\n });\n \n
        \n */\nvar ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $animate, $compile) {\n var NG_REMOVED = '$$NG_REMOVED';\n var ngRepeatMinErr = minErr('ngRepeat');\n\n var updateScope = function(scope, index, valueIdentifier, value, keyIdentifier, key, arrayLength) {\n // TODO(perf): generate setters to shave off ~40ms or 1-1.5%\n scope[valueIdentifier] = value;\n if (keyIdentifier) scope[keyIdentifier] = key;\n scope.$index = index;\n scope.$first = (index === 0);\n scope.$last = (index === (arrayLength - 1));\n scope.$middle = !(scope.$first || scope.$last);\n // jshint bitwise: false\n scope.$odd = !(scope.$even = (index&1) === 0);\n // jshint bitwise: true\n };\n\n var getBlockStart = function(block) {\n return block.clone[0];\n };\n\n var getBlockEnd = function(block) {\n return block.clone[block.clone.length - 1];\n };\n\n\n return {\n restrict: 'A',\n multiElement: true,\n transclude: 'element',\n priority: 1000,\n terminal: true,\n $$tlb: true,\n compile: function ngRepeatCompile($element, $attr) {\n var expression = $attr.ngRepeat;\n var ngRepeatEndComment = $compile.$$createComment('end ngRepeat', expression);\n\n var match = expression.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?(?:\\s+track\\s+by\\s+([\\s\\S]+?))?\\s*$/);\n\n if (!match) {\n throw ngRepeatMinErr('iexp', \"Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.\",\n expression);\n }\n\n var lhs = match[1];\n var rhs = match[2];\n var aliasAs = match[3];\n var trackByExp = match[4];\n\n match = lhs.match(/^(?:(\\s*[\\$\\w]+)|\\(\\s*([\\$\\w]+)\\s*,\\s*([\\$\\w]+)\\s*\\))$/);\n\n if (!match) {\n throw ngRepeatMinErr('iidexp', \"'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.\",\n lhs);\n }\n var valueIdentifier = match[3] || match[1];\n var keyIdentifier = match[2];\n\n if (aliasAs && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs) ||\n /^(null|undefined|this|\\$index|\\$first|\\$middle|\\$last|\\$even|\\$odd|\\$parent|\\$root|\\$id)$/.test(aliasAs))) {\n throw ngRepeatMinErr('badident', \"alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.\",\n aliasAs);\n }\n\n var trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn;\n var hashFnLocals = {$id: hashKey};\n\n if (trackByExp) {\n trackByExpGetter = $parse(trackByExp);\n } else {\n trackByIdArrayFn = function(key, value) {\n return hashKey(value);\n };\n trackByIdObjFn = function(key) {\n return key;\n };\n }\n\n return function ngRepeatLink($scope, $element, $attr, ctrl, $transclude) {\n\n if (trackByExpGetter) {\n trackByIdExpFn = function(key, value, index) {\n // assign key, value, and $index to the locals so that they can be used in hash functions\n if (keyIdentifier) hashFnLocals[keyIdentifier] = key;\n hashFnLocals[valueIdentifier] = value;\n hashFnLocals.$index = index;\n return trackByExpGetter($scope, hashFnLocals);\n };\n }\n\n // Store a list of elements from previous run. This is a hash where key is the item from the\n // iterator, and the value is objects with following properties.\n // - scope: bound scope\n // - element: previous element.\n // - index: position\n //\n // We are using no-proto object so that we don't need to guard against inherited props via\n // hasOwnProperty.\n var lastBlockMap = createMap();\n\n //watch props\n $scope.$watchCollection(rhs, function ngRepeatAction(collection) {\n var index, length,\n previousNode = $element[0], // node that cloned nodes should be inserted after\n // initialized to the comment node anchor\n nextNode,\n // Same as lastBlockMap but it has the current state. It will become the\n // lastBlockMap on the next iteration.\n nextBlockMap = createMap(),\n collectionLength,\n key, value, // key/value of iteration\n trackById,\n trackByIdFn,\n collectionKeys,\n block, // last object information {scope, element, id}\n nextBlockOrder,\n elementsToRemove;\n\n if (aliasAs) {\n $scope[aliasAs] = collection;\n }\n\n if (isArrayLike(collection)) {\n collectionKeys = collection;\n trackByIdFn = trackByIdExpFn || trackByIdArrayFn;\n } else {\n trackByIdFn = trackByIdExpFn || trackByIdObjFn;\n // if object, extract keys, in enumeration order, unsorted\n collectionKeys = [];\n for (var itemKey in collection) {\n if (hasOwnProperty.call(collection, itemKey) && itemKey.charAt(0) !== '$') {\n collectionKeys.push(itemKey);\n }\n }\n }\n\n collectionLength = collectionKeys.length;\n nextBlockOrder = new Array(collectionLength);\n\n // locate existing items\n for (index = 0; index < collectionLength; index++) {\n key = (collection === collectionKeys) ? index : collectionKeys[index];\n value = collection[key];\n trackById = trackByIdFn(key, value, index);\n if (lastBlockMap[trackById]) {\n // found previously seen block\n block = lastBlockMap[trackById];\n delete lastBlockMap[trackById];\n nextBlockMap[trackById] = block;\n nextBlockOrder[index] = block;\n } else if (nextBlockMap[trackById]) {\n // if collision detected. restore lastBlockMap and throw an error\n forEach(nextBlockOrder, function(block) {\n if (block && block.scope) lastBlockMap[block.id] = block;\n });\n throw ngRepeatMinErr('dupes',\n \"Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}\",\n expression, trackById, value);\n } else {\n // new never before seen block\n nextBlockOrder[index] = {id: trackById, scope: undefined, clone: undefined};\n nextBlockMap[trackById] = true;\n }\n }\n\n // remove leftover items\n for (var blockKey in lastBlockMap) {\n block = lastBlockMap[blockKey];\n elementsToRemove = getBlockNodes(block.clone);\n $animate.leave(elementsToRemove);\n if (elementsToRemove[0].parentNode) {\n // if the element was not removed yet because of pending animation, mark it as deleted\n // so that we can ignore it later\n for (index = 0, length = elementsToRemove.length; index < length; index++) {\n elementsToRemove[index][NG_REMOVED] = true;\n }\n }\n block.scope.$destroy();\n }\n\n // we are not using forEach for perf reasons (trying to avoid #call)\n for (index = 0; index < collectionLength; index++) {\n key = (collection === collectionKeys) ? index : collectionKeys[index];\n value = collection[key];\n block = nextBlockOrder[index];\n\n if (block.scope) {\n // if we have already seen this object, then we need to reuse the\n // associated scope/element\n\n nextNode = previousNode;\n\n // skip nodes that are already pending removal via leave animation\n do {\n nextNode = nextNode.nextSibling;\n } while (nextNode && nextNode[NG_REMOVED]);\n\n if (getBlockStart(block) != nextNode) {\n // existing item which got moved\n $animate.move(getBlockNodes(block.clone), null, previousNode);\n }\n previousNode = getBlockEnd(block);\n updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);\n } else {\n // new item which we don't know about\n $transclude(function ngRepeatTransclude(clone, scope) {\n block.scope = scope;\n // http://jsperf.com/clone-vs-createcomment\n var endNode = ngRepeatEndComment.cloneNode(false);\n clone[clone.length++] = endNode;\n\n $animate.enter(clone, null, previousNode);\n previousNode = endNode;\n // Note: We only need the first/last node of the cloned nodes.\n // However, we need to keep the reference to the jqlite wrapper as it might be changed later\n // by a directive with templateUrl when its template arrives.\n block.clone = clone;\n nextBlockMap[block.id] = block;\n updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);\n });\n }\n }\n lastBlockMap = nextBlockMap;\n });\n };\n }\n };\n}];\n\nvar NG_HIDE_CLASS = 'ng-hide';\nvar NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';\n/**\n * @ngdoc directive\n * @name ngShow\n * @multiElement\n *\n * @description\n * The `ngShow` directive shows or hides the given HTML element based on the expression\n * provided to the `ngShow` attribute. The element is shown or hidden by removing or adding\n * the `.ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined\n * in AngularJS and sets the display style to none (using an !important flag).\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```html\n * \n *
        \n *\n * \n *
        \n * ```\n *\n * When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added to the class\n * attribute on the element causing it to become hidden. When truthy, the `.ng-hide` CSS class is removed\n * from the element causing the element not to appear hidden.\n *\n * ## Why is !important used?\n *\n * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector\n * can be easily overridden by heavier selectors. For example, something as simple\n * as changing the display style on a HTML list item would make hidden elements appear visible.\n * This also becomes a bigger issue when dealing with CSS frameworks.\n *\n * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector\n * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the\n * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.\n *\n * ### Overriding `.ng-hide`\n *\n * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change\n * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`\n * class CSS. Note that the selector that needs to be used is actually `.ng-hide:not(.ng-hide-animate)` to cope\n * with extra animation classes that can be added.\n *\n * ```css\n * .ng-hide:not(.ng-hide-animate) {\n * /* this is just another form of hiding an element */\n * display: block!important;\n * position: absolute;\n * top: -9999px;\n * left: -9999px;\n * }\n * ```\n *\n * By default you don't need to override in CSS anything and the animations will work around the display style.\n *\n * ## A note about animations with `ngShow`\n *\n * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression\n * is true and false. This system works like the animation system present with ngClass except that\n * you must also include the !important flag to override the display property\n * so that you can perform an animation when the element is hidden during the time of the animation.\n *\n * ```css\n * //\n * //a working example can be found at the bottom of this page\n * //\n * .my-element.ng-hide-add, .my-element.ng-hide-remove {\n * /* this is required as of 1.3x to properly\n * apply all styling in a show/hide animation */\n * transition: 0s linear all;\n * }\n *\n * .my-element.ng-hide-add-active,\n * .my-element.ng-hide-remove-active {\n * /* the transition is defined in the active class */\n * transition: 1s linear all;\n * }\n *\n * .my-element.ng-hide-add { ... }\n * .my-element.ng-hide-add.ng-hide-add-active { ... }\n * .my-element.ng-hide-remove { ... }\n * .my-element.ng-hide-remove.ng-hide-remove-active { ... }\n * ```\n *\n * Keep in mind that, as of AngularJS version 1.3, there is no need to change the display\n * property to block during animation states--ngAnimate will handle the style toggling automatically for you.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link $animate#addClass addClass} `.ng-hide` | after the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden |\n * | {@link $animate#removeClass removeClass} `.ng-hide` | after the `ngShow` expression evaluates to a truthy value and just before contents are set to visible |\n *\n * @element ANY\n * @param {expression} ngShow If the {@link guide/expression expression} is truthy\n * then the element is shown or hidden respectively.\n *\n * @example\n \n \n Click me:
        \n
        \n Show:\n
        \n I show up when your checkbox is checked.\n
        \n
        \n
        \n Hide:\n
        \n I hide when your checkbox is checked.\n
        \n
        \n
        \n \n @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);\n \n \n .animate-show {\n line-height: 20px;\n opacity: 1;\n padding: 10px;\n border: 1px solid black;\n background: white;\n }\n\n .animate-show.ng-hide-add, .animate-show.ng-hide-remove {\n transition: all linear 0.5s;\n }\n\n .animate-show.ng-hide {\n line-height: 0;\n opacity: 0;\n padding: 0 10px;\n }\n\n .check-element {\n padding: 10px;\n border: 1px solid black;\n background: white;\n }\n \n \n var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));\n var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));\n\n it('should check ng-show / ng-hide', function() {\n expect(thumbsUp.isDisplayed()).toBeFalsy();\n expect(thumbsDown.isDisplayed()).toBeTruthy();\n\n element(by.model('checked')).click();\n\n expect(thumbsUp.isDisplayed()).toBeTruthy();\n expect(thumbsDown.isDisplayed()).toBeFalsy();\n });\n \n
        \n */\nvar ngShowDirective = ['$animate', function($animate) {\n return {\n restrict: 'A',\n multiElement: true,\n link: function(scope, element, attr) {\n scope.$watch(attr.ngShow, function ngShowWatchAction(value) {\n // we're adding a temporary, animation-specific class for ng-hide since this way\n // we can control when the element is actually displayed on screen without having\n // to have a global/greedy CSS selector that breaks when other animations are run.\n // Read: https://github.com/angular/angular.js/issues/9103#issuecomment-58335845\n $animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, {\n tempClasses: NG_HIDE_IN_PROGRESS_CLASS\n });\n });\n }\n };\n}];\n\n\n/**\n * @ngdoc directive\n * @name ngHide\n * @multiElement\n *\n * @description\n * The `ngHide` directive shows or hides the given HTML element based on the expression\n * provided to the `ngHide` attribute. The element is shown or hidden by removing or adding\n * the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined\n * in AngularJS and sets the display style to none (using an !important flag).\n * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).\n *\n * ```html\n * \n *
        \n *\n * \n *
        \n * ```\n *\n * When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added to the class\n * attribute on the element causing it to become hidden. When falsy, the `.ng-hide` CSS class is removed\n * from the element causing the element not to appear hidden.\n *\n * ## Why is !important used?\n *\n * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector\n * can be easily overridden by heavier selectors. For example, something as simple\n * as changing the display style on a HTML list item would make hidden elements appear visible.\n * This also becomes a bigger issue when dealing with CSS frameworks.\n *\n * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector\n * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the\n * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.\n *\n * ### Overriding `.ng-hide`\n *\n * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change\n * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`\n * class in CSS:\n *\n * ```css\n * .ng-hide {\n * /* this is just another form of hiding an element */\n * display: block!important;\n * position: absolute;\n * top: -9999px;\n * left: -9999px;\n * }\n * ```\n *\n * By default you don't need to override in CSS anything and the animations will work around the display style.\n *\n * ## A note about animations with `ngHide`\n *\n * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression\n * is true and false. This system works like the animation system present with ngClass, except that the `.ng-hide`\n * CSS class is added and removed for you instead of your own CSS class.\n *\n * ```css\n * //\n * //a working example can be found at the bottom of this page\n * //\n * .my-element.ng-hide-add, .my-element.ng-hide-remove {\n * transition: 0.5s linear all;\n * }\n *\n * .my-element.ng-hide-add { ... }\n * .my-element.ng-hide-add.ng-hide-add-active { ... }\n * .my-element.ng-hide-remove { ... }\n * .my-element.ng-hide-remove.ng-hide-remove-active { ... }\n * ```\n *\n * Keep in mind that, as of AngularJS version 1.3, there is no need to change the display\n * property to block during animation states--ngAnimate will handle the style toggling automatically for you.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link $animate#addClass addClass} `.ng-hide` | after the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden |\n * | {@link $animate#removeClass removeClass} `.ng-hide` | after the `ngHide` expression evaluates to a non truthy value and just before contents are set to visible |\n *\n *\n * @element ANY\n * @param {expression} ngHide If the {@link guide/expression expression} is truthy then\n * the element is shown or hidden respectively.\n *\n * @example\n \n \n Click me:
        \n
        \n Show:\n
        \n I show up when your checkbox is checked.\n
        \n
        \n
        \n Hide:\n
        \n I hide when your checkbox is checked.\n
        \n
        \n
        \n \n @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);\n \n \n .animate-hide {\n transition: all linear 0.5s;\n line-height: 20px;\n opacity: 1;\n padding: 10px;\n border: 1px solid black;\n background: white;\n }\n\n .animate-hide.ng-hide {\n line-height: 0;\n opacity: 0;\n padding: 0 10px;\n }\n\n .check-element {\n padding: 10px;\n border: 1px solid black;\n background: white;\n }\n \n \n var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));\n var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));\n\n it('should check ng-show / ng-hide', function() {\n expect(thumbsUp.isDisplayed()).toBeFalsy();\n expect(thumbsDown.isDisplayed()).toBeTruthy();\n\n element(by.model('checked')).click();\n\n expect(thumbsUp.isDisplayed()).toBeTruthy();\n expect(thumbsDown.isDisplayed()).toBeFalsy();\n });\n \n
        \n */\nvar ngHideDirective = ['$animate', function($animate) {\n return {\n restrict: 'A',\n multiElement: true,\n link: function(scope, element, attr) {\n scope.$watch(attr.ngHide, function ngHideWatchAction(value) {\n // The comment inside of the ngShowDirective explains why we add and\n // remove a temporary class for the show/hide animation\n $animate[value ? 'addClass' : 'removeClass'](element,NG_HIDE_CLASS, {\n tempClasses: NG_HIDE_IN_PROGRESS_CLASS\n });\n });\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name ngStyle\n * @restrict AC\n *\n * @description\n * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally.\n *\n * @knownIssue\n * You should not use {@link guide/interpolation interpolation} in the value of the `style`\n * attribute, when using the `ngStyle` directive on the same element.\n * See {@link guide/interpolation#known-issues here} for more info.\n *\n * @element ANY\n * @param {expression} ngStyle\n *\n * {@link guide/expression Expression} which evals to an\n * object whose keys are CSS style names and values are corresponding values for those CSS\n * keys.\n *\n * Since some CSS style names are not valid keys for an object, they must be quoted.\n * See the 'background-color' style in the example below.\n *\n * @example\n \n \n \n \n \n
        \n Sample Text\n
        myStyle={{myStyle}}
        \n
        \n \n span {\n color: black;\n }\n \n \n var colorSpan = element(by.css('span'));\n\n it('should check ng-style', function() {\n expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');\n element(by.css('input[value=\\'set color\\']')).click();\n expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)');\n element(by.css('input[value=clear]')).click();\n expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');\n });\n \n
        \n */\nvar ngStyleDirective = ngDirective(function(scope, element, attr) {\n scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {\n if (oldStyles && (newStyles !== oldStyles)) {\n forEach(oldStyles, function(val, style) { element.css(style, '');});\n }\n if (newStyles) element.css(newStyles);\n }, true);\n});\n\n/**\n * @ngdoc directive\n * @name ngSwitch\n * @restrict EA\n *\n * @description\n * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.\n * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location\n * as specified in the template.\n *\n * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it\n * from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element\n * matches the value obtained from the evaluated expression. In other words, you define a container element\n * (where you place the directive), place an expression on the **`on=\"...\"` attribute**\n * (or the **`ng-switch=\"...\"` attribute**), define any inner elements inside of the directive and place\n * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on\n * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default\n * attribute is displayed.\n *\n *
        \n * Be aware that the attribute values to match against cannot be expressions. They are interpreted\n * as literal string values to match against.\n * For example, **`ng-switch-when=\"someVal\"`** will match against the string `\"someVal\"` not against the\n * value of the expression `$scope.someVal`.\n *
        \n\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link ng.$animate#enter enter} | after the ngSwitch contents change and the matched child element is placed inside the container |\n * | {@link ng.$animate#leave leave} | after the ngSwitch contents change and just before the former contents are removed from the DOM |\n *\n * @usage\n *\n * ```\n * \n * ...\n * ...\n * ...\n * \n * ```\n *\n *\n * @scope\n * @priority 1200\n * @param {*} ngSwitch|on expression to match against ng-switch-when.\n * On child elements add:\n *\n * * `ngSwitchWhen`: the case statement to match against. If match then this\n * case will be displayed. If the same match appears multiple times, all the\n * elements will be displayed.\n * * `ngSwitchDefault`: the default case when no other case match. If there\n * are multiple default cases, all of them will be displayed when no other\n * case match.\n *\n *\n * @example\n \n \n
        \n \n selection={{selection}}\n
        \n
        \n
        Settings Div
        \n
        Home Span
        \n
        default
        \n
        \n
        \n
        \n \n angular.module('switchExample', ['ngAnimate'])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.items = ['settings', 'home', 'other'];\n $scope.selection = $scope.items[0];\n }]);\n \n \n .animate-switch-container {\n position:relative;\n background:white;\n border:1px solid black;\n height:40px;\n overflow:hidden;\n }\n\n .animate-switch {\n padding:10px;\n }\n\n .animate-switch.ng-animate {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;\n\n position:absolute;\n top:0;\n left:0;\n right:0;\n bottom:0;\n }\n\n .animate-switch.ng-leave.ng-leave-active,\n .animate-switch.ng-enter {\n top:-50px;\n }\n .animate-switch.ng-leave,\n .animate-switch.ng-enter.ng-enter-active {\n top:0;\n }\n \n \n var switchElem = element(by.css('[ng-switch]'));\n var select = element(by.model('selection'));\n\n it('should start in settings', function() {\n expect(switchElem.getText()).toMatch(/Settings Div/);\n });\n it('should change to home', function() {\n select.all(by.css('option')).get(1).click();\n expect(switchElem.getText()).toMatch(/Home Span/);\n });\n it('should select default', function() {\n select.all(by.css('option')).get(2).click();\n expect(switchElem.getText()).toMatch(/default/);\n });\n \n
        \n */\nvar ngSwitchDirective = ['$animate', '$compile', function($animate, $compile) {\n return {\n require: 'ngSwitch',\n\n // asks for $scope to fool the BC controller module\n controller: ['$scope', function ngSwitchController() {\n this.cases = {};\n }],\n link: function(scope, element, attr, ngSwitchController) {\n var watchExpr = attr.ngSwitch || attr.on,\n selectedTranscludes = [],\n selectedElements = [],\n previousLeaveAnimations = [],\n selectedScopes = [];\n\n var spliceFactory = function(array, index) {\n return function() { array.splice(index, 1); };\n };\n\n scope.$watch(watchExpr, function ngSwitchWatchAction(value) {\n var i, ii;\n for (i = 0, ii = previousLeaveAnimations.length; i < ii; ++i) {\n $animate.cancel(previousLeaveAnimations[i]);\n }\n previousLeaveAnimations.length = 0;\n\n for (i = 0, ii = selectedScopes.length; i < ii; ++i) {\n var selected = getBlockNodes(selectedElements[i].clone);\n selectedScopes[i].$destroy();\n var promise = previousLeaveAnimations[i] = $animate.leave(selected);\n promise.then(spliceFactory(previousLeaveAnimations, i));\n }\n\n selectedElements.length = 0;\n selectedScopes.length = 0;\n\n if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {\n forEach(selectedTranscludes, function(selectedTransclude) {\n selectedTransclude.transclude(function(caseElement, selectedScope) {\n selectedScopes.push(selectedScope);\n var anchor = selectedTransclude.element;\n caseElement[caseElement.length++] = $compile.$$createComment('end ngSwitchWhen');\n var block = { clone: caseElement };\n\n selectedElements.push(block);\n $animate.enter(caseElement, anchor.parent(), anchor);\n });\n });\n }\n });\n }\n };\n}];\n\nvar ngSwitchWhenDirective = ngDirective({\n transclude: 'element',\n priority: 1200,\n require: '^ngSwitch',\n multiElement: true,\n link: function(scope, element, attrs, ctrl, $transclude) {\n ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);\n ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });\n }\n});\n\nvar ngSwitchDefaultDirective = ngDirective({\n transclude: 'element',\n priority: 1200,\n require: '^ngSwitch',\n multiElement: true,\n link: function(scope, element, attr, ctrl, $transclude) {\n ctrl.cases['?'] = (ctrl.cases['?'] || []);\n ctrl.cases['?'].push({ transclude: $transclude, element: element });\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngTransclude\n * @restrict EAC\n *\n * @description\n * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.\n *\n * You can specify that you want to insert a named transclusion slot, instead of the default slot, by providing the slot name\n * as the value of the `ng-transclude` or `ng-transclude-slot` attribute.\n *\n * If the transcluded content is not empty (i.e. contains one or more DOM nodes, including whitespace text nodes), any existing\n * content of this element will be removed before the transcluded content is inserted.\n * If the transcluded content is empty, the existing content is left intact. This lets you provide fallback content in the case\n * that no transcluded content is provided.\n *\n * @element ANY\n *\n * @param {string} ngTransclude|ngTranscludeSlot the name of the slot to insert at this point. If this is not provided, is empty\n * or its value is the same as the name of the attribute then the default slot is used.\n *\n * @example\n * ### Basic transclusion\n * This example demonstrates basic transclusion of content into a component directive.\n * \n * \n * \n *
        \n *
        \n *
        \n * {{text}}\n *
        \n *
        \n * \n * it('should have transcluded', function() {\n * var titleElement = element(by.model('title'));\n * titleElement.clear();\n * titleElement.sendKeys('TITLE');\n * var textElement = element(by.model('text'));\n * textElement.clear();\n * textElement.sendKeys('TEXT');\n * expect(element(by.binding('title')).getText()).toEqual('TITLE');\n * expect(element(by.binding('text')).getText()).toEqual('TEXT');\n * });\n * \n *
        \n *\n * @example\n * ### Transclude fallback content\n * This example shows how to use `NgTransclude` with fallback content, that\n * is displayed if no transcluded content is provided.\n *\n * \n * \n * \n * \n * \n * \n * \n * Button2\n * \n * \n * \n * it('should have different transclude element content', function() {\n * expect(element(by.id('fallback')).getText()).toBe('Button1');\n * expect(element(by.id('modified')).getText()).toBe('Button2');\n * });\n * \n * \n *\n * @example\n * ### Multi-slot transclusion\n * This example demonstrates using multi-slot transclusion in a component directive.\n * \n * \n * \n *
        \n *
        \n *
        \n * \n * {{title}}\n *

        {{text}}

        \n *
        \n *
        \n *
        \n * \n * angular.module('multiSlotTranscludeExample', [])\n * .directive('pane', function(){\n * return {\n * restrict: 'E',\n * transclude: {\n * 'title': '?paneTitle',\n * 'body': 'paneBody',\n * 'footer': '?paneFooter'\n * },\n * template: '
        ' +\n * '
        Fallback Title
        ' +\n * '
        ' +\n * '
        Fallback Footer
        ' +\n * '
        '\n * };\n * })\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.title = 'Lorem Ipsum';\n * $scope.link = \"https://google.com\";\n * $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';\n * }]);\n *
        \n * \n * it('should have transcluded the title and the body', function() {\n * var titleElement = element(by.model('title'));\n * titleElement.clear();\n * titleElement.sendKeys('TITLE');\n * var textElement = element(by.model('text'));\n * textElement.clear();\n * textElement.sendKeys('TEXT');\n * expect(element(by.css('.title')).getText()).toEqual('TITLE');\n * expect(element(by.binding('text')).getText()).toEqual('TEXT');\n * expect(element(by.css('.footer')).getText()).toEqual('Fallback Footer');\n * });\n * \n *
        \n */\nvar ngTranscludeMinErr = minErr('ngTransclude');\nvar ngTranscludeDirective = ['$compile', function($compile) {\n return {\n restrict: 'EAC',\n terminal: true,\n compile: function ngTranscludeCompile(tElement) {\n\n // Remove and cache any original content to act as a fallback\n var fallbackLinkFn = $compile(tElement.contents());\n tElement.empty();\n\n return function ngTranscludePostLink($scope, $element, $attrs, controller, $transclude) {\n\n if (!$transclude) {\n throw ngTranscludeMinErr('orphan',\n 'Illegal use of ngTransclude directive in the template! ' +\n 'No parent directive that requires a transclusion found. ' +\n 'Element: {0}',\n startingTag($element));\n }\n\n\n // If the attribute is of the form: `ng-transclude=\"ng-transclude\"` then treat it like the default\n if ($attrs.ngTransclude === $attrs.$attr.ngTransclude) {\n $attrs.ngTransclude = '';\n }\n var slotName = $attrs.ngTransclude || $attrs.ngTranscludeSlot;\n\n // If the slot is required and no transclusion content is provided then this call will throw an error\n $transclude(ngTranscludeCloneAttachFn, null, slotName);\n\n // If the slot is optional and no transclusion content is provided then use the fallback content\n if (slotName && !$transclude.isSlotFilled(slotName)) {\n useFallbackContent();\n }\n\n function ngTranscludeCloneAttachFn(clone, transcludedScope) {\n if (clone.length) {\n $element.append(clone);\n } else {\n useFallbackContent();\n // There is nothing linked against the transcluded scope since no content was available,\n // so it should be safe to clean up the generated scope.\n transcludedScope.$destroy();\n }\n }\n\n function useFallbackContent() {\n // Since this is the fallback content rather than the transcluded content,\n // we link against the scope of this directive rather than the transcluded scope\n fallbackLinkFn($scope, function(clone) {\n $element.append(clone);\n });\n }\n };\n }\n };\n}];\n\n/**\n * @ngdoc directive\n * @name script\n * @restrict E\n *\n * @description\n * Load the content of a `\n\n Load inlined template\n
        \n \n \n it('should load template defined inside script tag', function() {\n element(by.css('#tpl-link')).click();\n expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/);\n });\n \n \n */\nvar scriptDirective = ['$templateCache', function($templateCache) {\n return {\n restrict: 'E',\n terminal: true,\n compile: function(element, attr) {\n if (attr.type == 'text/ng-template') {\n var templateUrl = attr.id,\n text = element[0].text;\n\n $templateCache.put(templateUrl, text);\n }\n }\n };\n}];\n\nvar noopNgModelController = { $setViewValue: noop, $render: noop };\n\nfunction chromeHack(optionElement) {\n // Workaround for https://code.google.com/p/chromium/issues/detail?id=381459\n // Adding an