\n Snippet:
\n
\n \n Filter \n Source \n Rendered \n \n \n linky filter \n \n <div ng-bind-html=\"snippet | linky\"> </div> \n \n \n
\n \n \n \n linky target \n \n <div ng-bind-html=\"snippetWithSingleURL | linky:'_blank'\"> </div> \n \n \n
\n \n \n \n linky custom attributes \n \n <div ng-bind-html=\"snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}\"> </div> \n \n \n
\n \n \n \n no filter \n <div ng-bind=\"snippet\"> </div> \n
\n \n
\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 /((s?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\nvar angularSanitize = 'ngSanitize';\n\nexport default angularSanitize;\n", "/**\n * @license AngularJS v1.8.0\n * (c) 2010-2020 Google, Inc. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {\nvar ELEMENT_NODE = 1;\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 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 === undefined) && (window.onwebkittransitionend !== undefined)) {\n TRANSITION_PROP = 'WebkitTransition';\n TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';\n} else {\n TRANSITION_PROP = 'transition';\n TRANSITIONEND_EVENT = 'transitionend';\n}\n\nif ((window.onanimationend === undefined) && (window.onwebkitanimationend !== undefined)) {\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($$jqLite, 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 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 helpers = {\n blockTransitions: function(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};\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 `ngAnimateChildren` 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
Show container? \n
Animate children? \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 MainController() {\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\n/* exported $AnimateCssProvider */\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 * ## General Use\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 AngularJS. 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 *
Fold In \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;\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\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', /** @this */ function($animateProvider) {\n\n this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout', '$$animateCache',\n '$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue',\n function($window, $$jqLite, $$AnimateRunner, $timeout, $$animateCache,\n $$forceReflow, $sniffer, $$rAFScheduler, $$animateQueue) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function computeCachedCssStyles(node, className, cacheKey, allowNoDuration, properties) {\n var timings = $$animateCache.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 // if a css animation has no duration we\n // should mark that so that repeated addClass/removeClass calls are skipped\n var hasDuration = allowNoDuration || (timings.transitionDuration > 0 || timings.animationDuration > 0);\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 $$animateCache.put(cacheKey, timings, hasDuration);\n\n return timings;\n }\n\n function computeCachedCssStaggerStyles(node, className, cacheKey, properties) {\n var stagger;\n var staggerCacheKey = 'stagger-' + cacheKey;\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 ($$animateCache.count(cacheKey) > 0) {\n stagger = $$animateCache.get(staggerCacheKey);\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 $$animateCache.put(staggerCacheKey, stagger, true);\n }\n }\n\n return stagger || {};\n }\n\n var rafWaitQueue = [];\n function waitUntilQuiet(callback) {\n rafWaitQueue.push(callback);\n $$rAFScheduler.waitUntilQuiet(function() {\n $$animateCache.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, allowNoDuration) {\n var timings = computeCachedCssStyles(node, className, cacheKey, allowNoDuration, 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 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 stagger, cacheKey = $$animateCache.cacheKey(node, method, options.addClass, options.removeClass);\n if ($$animateCache.containsCachedAnimationWithoutDuration(cacheKey)) {\n preparationClasses = null;\n return closeAndReturnNoopAnimator();\n }\n\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 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 : $$animateCache.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 helpers.blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE);\n }\n\n var timings = computeTimings(node, fullClassName, cacheKey, !isStructural);\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 var activeClasses = pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX);\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 helpers.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) {\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 (preparationClasses && !options.$$skipPreparationClasses) {\n $$jqLite.removeClass(element, preparationClasses);\n }\n\n if (activeClasses) {\n $$jqLite.removeClass(element, activeClasses);\n }\n\n blockKeyframeAnimations(node, false);\n helpers.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 if (value) {\n node.style.setProperty(prop, value);\n } else {\n node.style.removeProperty(prop);\n }\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 helpers.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 if (ev.target !== node) {\n // Since TransitionEvent / AnimationEvent bubble up,\n // we have to ignore events by finished child animations\n return;\n }\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 if (animationPaused) {\n temporaryStyles.push(value);\n } else {\n removeFromArray(temporaryStyles, value);\n }\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.getAttribute('class') + ' ' + preparationClasses;\n cacheKey = $$animateCache.cacheKey(node, method, options.addClass, options.removeClass);\n\n timings = computeTimings(node, fullClassName, cacheKey, false);\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', /** @this */ 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 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);\n var toAnimation = prepareRegularAnimation(to);\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', /** @this */ 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();\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 if (runners.length) {\n $$AnimateRunner.all(runners, callback);\n } else {\n callback();\n }\n\n return function endFn(reject) {\n forEach(runners, function(runner) {\n if (reject) {\n runner.cancel();\n } else {\n runner.end();\n }\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', /** @this */ 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', /** @this */ 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 getEventData(options) {\n return {\n addClass: options.addClass,\n removeClass: options.removeClass,\n from: options.from,\n to: options.to\n };\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, currentAnimation, previousAnimation) {\n return rules[ruleType].some(function(fn) {\n return fn(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(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(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(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(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(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(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(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', '$$Map',\n '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow',\n '$$isDocumentHidden',\n function($$rAF, $rootScope, $rootElement, $document, $$Map,\n $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow,\n $$isDocumentHidden) {\n\n var activeAnimationsLookup = new $$Map();\n var disabledElementsLookup = new $$Map();\n var animationsEnabled = null;\n\n function removeFromDisabledElementsLookup(evt) {\n disabledElementsLookup.delete(evt.target);\n }\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 `customFilter`/`classNameFilter` are set during the\n // provider/config stage therefore we can optimize here and setup helper functions\n var customFilter = $animateProvider.customFilter();\n var classNameFilter = $animateProvider.classNameFilter();\n var returnTrue = function() { return true; };\n\n var isAnimatableByFilter = customFilter || returnTrue;\n var isAnimatableClassName = !classNameFilter ? returnTrue : function(node, options) {\n var className = [node.getAttribute('class'), options.addClass, options.removeClass].join(' ');\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 || /** @this */ function(arg) {\n // eslint-disable-next-line no-bitwise\n return this === arg || !!(this.compareDocumentPosition(arg) & 16);\n };\n\n function findCallbacks(targetParentNode, targetNode, event) {\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, node) {\n if (phase === 'close' && !node.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(node);\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 if (!disabledElementsLookup.has(node)) {\n // The element is added to the map for the first time.\n // Create a listener to remove it on `$destroy` (to avoid memory leak).\n jqLite(element).on('$destroy', removeFromDisabledElementsLookup);\n }\n disabledElementsLookup.set(node, !bool);\n }\n }\n }\n\n return bool;\n }\n };\n\n return $animate;\n\n function queueAnimation(originalElement, 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 element = stripCommentsFromElement(originalElement);\n var node = getDomNode(element);\n var parentNode = node && node.parentNode;\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 // If animations are hard-disabled for the whole application there is no need to continue.\n // There are also situations where a directive issues an animation for a jqLite wrapper that\n // contains only comment nodes. In this case, there is no way we can perform an animation.\n if (!animationsEnabled ||\n !node ||\n !isAnimatableByFilter(node, event, initialOptions) ||\n !isAnimatableClassName(node, options)) {\n close();\n return runner;\n }\n\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n var documentHidden = $$isDocumentHidden();\n\n // This is a hard disable of all animations the element itself, therefore there is no need to\n // continue further 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 = 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(node, parentNode);\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', getEventData(options));\n close();\n if (documentHidden) notifyProgress(runner, event, 'close', getEventData(options));\n return runner;\n }\n\n if (isStructural) {\n closeChildAnimations(node);\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', 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', 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', newAnimation, existingAnimation);\n if (joinAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n normalizeAnimationDetails(element, newAnimation);\n } else {\n applyGeneratedPreparationClasses($$jqLite, 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(node);\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(node, PRE_DIGEST_STATE, newAnimation);\n\n $rootScope.$$postDigest(function() {\n // It is possible that the DOM nodes inside `originalElement` have been replaced. This can\n // happen if the animated element is a transcluded clone and also has a `templateUrl`\n // directive on it. Therefore, we must recreate `element` in order to interact with the\n // actual DOM nodes.\n // Note: We still need to use the old `node` for certain things, such as looking up in\n // HashMaps where it was used as the key.\n\n element = stripCommentsFromElement(originalElement);\n\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(node);\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(node, 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', getEventData(options));\n\n realRunner.done(function(status) {\n close(!status);\n var animationDetails = activeAnimationsLookup.get(node);\n if (animationDetails && animationDetails.counter === counter) {\n clearElementAnimationState(node);\n }\n notifyProgress(runner, event, 'close', getEventData(options));\n });\n });\n\n return runner;\n\n function notifyProgress(runner, event, phase, data) {\n runInNextPostDigestOrNow(function() {\n var callbacks = findCallbacks(parentNode, node, 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, node);\n });\n } else {\n cleanupEventListeners(phase, node);\n }\n });\n runner.progress(event, phase, data);\n }\n\n function close(reject) {\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(node) {\n var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');\n forEach(children, function(child) {\n var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME), 10);\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.delete(child);\n break;\n }\n }\n });\n }\n\n function clearElementAnimationState(node) {\n node.removeAttribute(NG_ANIMATE_ATTR_NAME);\n activeAnimationsLookup.delete(node);\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(node, parentNode, event) {\n var bodyNode = $document[0].body;\n var rootNode = getDomNode($rootElement);\n\n var bodyNodeDetected = (node === bodyNode) || node.nodeName === 'HTML';\n var rootNodeDetected = (node === rootNode);\n var parentAnimationDetected = false;\n var elementDisabled = disabledElementsLookup.get(node);\n var animateChildren;\n\n var parentHost = jqLite.data(node, NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n parentNode = getDomNode(parentHost);\n }\n\n while (parentNode) {\n if (!rootNodeDetected) {\n // AngularJS 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 rootNodeDetected = (parentNode === rootNode);\n }\n\n if (parentNode.nodeType !== ELEMENT_NODE) {\n // no point in inspecting the #document element\n break;\n }\n\n var details = activeAnimationsLookup.get(parentNode) || {};\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 parentNodeDisabled = disabledElementsLookup.get(parentNode);\n\n if (parentNodeDisabled === 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 (parentNodeDisabled === false) {\n elementDisabled = false;\n }\n parentAnimationDetected = details.structural;\n }\n\n if (isUndefined(animateChildren) || animateChildren === true) {\n var value = jqLite.data(parentNode, 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 (!bodyNodeDetected) {\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 bodyNodeDetected = (parentNode === bodyNode);\n }\n\n if (bodyNodeDetected && rootNodeDetected) {\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 (!rootNodeDetected) {\n // If `rootNode` is not detected, check if `parentNode` is pinned to another element\n parentHost = jqLite.data(parentNode, NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n // The pin target element becomes the next parent element\n parentNode = getDomNode(parentHost);\n continue;\n }\n }\n\n parentNode = parentNode.parentNode;\n }\n\n var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true;\n return allowAnimation && rootNodeDetected && bodyNodeDetected;\n }\n\n function markElementAnimationState(node, state, details) {\n details = details || {};\n details.state = state;\n\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.set(node, newValue);\n }\n }];\n}];\n\n/** @this */\nvar $$AnimateCacheProvider = function() {\n\n var KEY = '$$ngAnimateParentKey';\n var parentCounter = 0;\n var cache = Object.create(null);\n\n this.$get = [function() {\n return {\n cacheKey: function(node, method, addClass, removeClass) {\n var parentNode = node.parentNode;\n var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);\n var parts = [parentID, method, node.getAttribute('class')];\n if (addClass) {\n parts.push(addClass);\n }\n if (removeClass) {\n parts.push(removeClass);\n }\n return parts.join(' ');\n },\n\n containsCachedAnimationWithoutDuration: function(key) {\n var entry = cache[key];\n\n // nothing cached, so go ahead and animate\n // otherwise it should be a valid animation\n return (entry && !entry.isValid) || false;\n },\n\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, isValid) {\n if (!cache[key]) {\n cache[key] = { total: 1, value: value, isValid: isValid };\n } else {\n cache[key].total++;\n cache[key].value = value;\n }\n }\n };\n }];\n};\n\n/* exported $$AnimationProvider */\n\nvar $$AnimationProvider = ['$animateProvider', /** @this */ 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 var PREPARE_CLASSES_KEY = '$$animatePrepareClasses';\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', '$$Map', '$$rAFScheduler', '$$animateCache',\n function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$Map, $$rAFScheduler, $$animateCache) {\n\n var animationQueue = [];\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function sortAnimations(animations) {\n var tree = { children: [] };\n var i, lookup = new $$Map();\n\n // this is done first beforehand so that the map\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.set(animation.domNode, animations[i] = {\n domNode: animation.domNode,\n element: animation.element,\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.set(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);\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 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 if (isStructural) {\n element.data(PREPARE_CLASSES_KEY, 'ng-' + event + PREPARE_CLASS_SUFFIX);\n }\n\n setRunner(element, runner);\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 var element = animationEntry.from ? animationEntry.from.element : animationEntry.element;\n var extraClasses = options.addClass;\n\n extraClasses = (extraClasses ? (extraClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;\n var cacheKey = $$animateCache.cacheKey(element[0], animationEntry.event, extraClasses, options.removeClass);\n\n toBeSortedAnimations.push({\n element: element,\n domNode: getDomNode(element),\n fn: function triggerAnimationStart() {\n var startAnimationFn, closeFn = animationEntry.close;\n\n // in the event that we've cached the animation status for this element\n // and it's in fact an invalid animation (something that has duration = 0)\n // then we should skip all the heavy work from here on\n if ($$animateCache.containsCachedAnimationWithoutDuration(cacheKey)) {\n closeFn();\n return;\n }\n\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 // 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 var finalAnimations = sortAnimations(toBeSortedAnimations);\n for (var i = 0; i < finalAnimations.length; i++) {\n var innerArray = finalAnimations[i];\n for (var j = 0; j < innerArray.length; j++) {\n var entry = innerArray[j];\n var element = entry.element;\n\n // the RAFScheduler code only uses functions\n finalAnimations[i][j] = entry.fn;\n\n // the first row of elements shouldn't have a prepare-class added to them\n // since the elements are at the top of the animation hierarchy and they\n // will be applied without a RAF having to pass...\n if (i === 0) {\n element.removeData(PREPARE_CLASSES_KEY);\n continue;\n }\n\n var prepareClassName = element.data(PREPARE_CLASSES_KEY);\n if (prepareClassName) {\n $$jqLite.addClass(element, prepareClassName);\n }\n }\n }\n\n $$rAFScheduler(finalAnimations);\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 tempClasses = (tempClasses ? (tempClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;\n $$jqLite.addClass(element, tempClasses);\n\n var prepareClassName = element.data(PREPARE_CLASSES_KEY);\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) {\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 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', function($animate) {\n return {\n restrict: 'A',\n transclude: 'element',\n terminal: true,\n priority: 550, // We use 550 here to ensure that the directive is caught before others,\n // but after `ngIf` (at priority 600).\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 $transclude(function(clone, childScope) {\n previousElement = clone;\n previousScope = childScope;\n $animate.enter(clone, 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 AngularJS app.\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:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) |\n * | {@link ngAnimate.directive:ngAnimateSwap#animations ngAnimateSwap} | enter and leave |\n * | {@link ng.directive:ngClass#animations ngClass / {{class}}} | add and remove |\n * | {@link ng.directive:ngClassEven#animations ngClassEven} | add and remove |\n * | {@link ng.directive:ngClassOdd#animations ngClassOdd} | add and remove |\n * | {@link ng.directive:ngHide#animations ngHide} | add and remove (the `ng-hide` class) |\n * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |\n * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |\n * | {@link module:ngMessages#animations ngMessage / ngMessageExp} | enter and leave |\n * | {@link module:ngMessages#animations ngMessages} | add and remove (the `ng-active`/`ng-inactive` classes) |\n * | {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) |\n * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave, and move |\n * | {@link ng.directive:ngShow#animations ngShow} | add and remove (the `ng-hide` class) |\n * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |\n * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave |\n *\n * (More information can be found by visiting the documentation associated with each directive.)\n *\n * For a full breakdown of the steps involved during each animation event, refer to the\n * {@link ng.$animate `$animate` API docs}.\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 AngularJS when an 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 * Fade In! \n * Fade Out! \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 * Toggle \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 * Toggle \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 * /* if you are using animations instead of transitions you should configure as follows:\n * animation-delay: 0.1s;\n * animation-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 * 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 * ### Animating between value changes\n *\n * Sometimes you need to animate between different expression states, whose values\n * don't necessary need to be known or referenced in CSS styles.\n * Unless possible with another {@link ngAnimate#directive-support \"animation aware\" directive},\n * that specific use case can always be covered with {@link ngAnimate.directive:ngAnimateSwap} as\n * can be seen in {@link ngAnimate.directive:ngAnimateSwap#examples this example}.\n *\n * Note that {@link ngAnimate.directive:ngAnimateSwap} is a *structural directive*, which means it\n * creates a new instance of the element (including any other/child directives it may have) and\n * links it to a new scope every time *swap* happens. In some cases this might not be desirable\n * (e.g. for performance reasons, or when you wish to retain internal state on the original\n * element instance).\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 AngularJS\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 * Change to red \n * Change to blue \n * Change to green \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 AngularJS,\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 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',\n function ProfileController($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 AngularJS 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 AngularJS 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 AngularJS 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 AngularJS 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 .info({ angularVersion: '1.8.0' })\n .directive('ngAnimateSwap', ngAnimateSwapDirective)\n\n .directive('ngAnimateChildren', $$AnimateChildrenDirective)\n .factory('$$rAFScheduler', $$rAFSchedulerFactory)\n\n .provider('$$animateQueue', $$AnimateQueueProvider)\n .provider('$$animateCache', $$AnimateCacheProvider)\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\nvar angularAnimate = 'ngAnimate';\n\nexport default angularAnimate;\n", "/*\nCopyright 2015-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from 'angular';\nimport {fromEvent, Subject, timer} from 'rxjs';\nimport {tap, switchMap, takeUntil} from 'rxjs/operators';\nimport _ from 'lodash';\nimport saveAs from 'file-saver';\nimport mnDeveloperSettingsTemplate from \"./mn_developer_settings.html\";\nimport mnInternalSettingsTemplate from \"./mn_internal_settings.html\";\n\nexport default mnAdminController;\n\nmnAdminController.$inject = [\"$scope\", \"$rootScope\", \"$state\", \"$window\", \"$uibModal\", \"mnAlertsService\", \"poolDefault\", \"mnPromiseHelper\", \"pools\", \"mnPoller\", \"mnEtagPoller\", \"mnAuthService\", \"mnTasksDetails\", \"mnPoolDefault\", \"mnSettingsAutoFailoverService\", \"formatProgressMessageFilter\", \"mnPrettyVersionFilter\", \"mnLostConnectionService\", \"mnPermissions\", \"mnPools\", \"whoami\", \"mnBucketsService\", \"$q\", \"mnSettingsClusterService\", \"$ocLazyLoad\", \"$injector\", \"mnAdminService\", \"mnHelper\", \"mnSessionService\"];\nfunction mnAdminController($scope, $rootScope, $state, $window, $uibModal, mnAlertsService, poolDefault, mnPromiseHelper, pools, mnPoller, mnEtagPoller, mnAuthService, mnTasksDetails, mnPoolDefault, mnSettingsAutoFailoverService, formatProgressMessageFilter, mnPrettyVersionFilter, mnLostConnectionService, mnPermissions, mnPools, whoami, mnBucketsService, $q, mnSettingsClusterService, $ocLazyLoad, $injector, mnAdminService, mnHelper, mnSessionService) {\n var vm = this;\n\n vm.poolDefault = poolDefault;\n vm.launchpadId = pools.launchID;\n vm.implementationVersion = pools.implementationVersion;\n vm.logout = mnAuthService.logout;\n vm.resetAutoFailOverCount = resetAutoFailOverCount;\n vm.isProgressBarClosed = true;\n vm.toggleProgressBar = toggleProgressBar;\n vm.filterTasks = filterTasks;\n vm.showResetPasswordDialog = showResetPasswordDialog;\n vm.postCancelRebalanceRetry = postCancelRebalanceRetry;\n vm.showClusterInfoDialog = showClusterInfoDialog;\n vm.isDeveloperPreview = pools.isDeveloperPreview;\n vm.mainSpinnerCounter = mnHelper.mainSpinnerCounter;\n vm.majorMinorVersion = pools.implementationVersion.split('.').splice(0,2).join('.');\n\n $rootScope.mnGlobalSpinnerFlag = false;\n\n vm.user = whoami;\n\n vm.$state = $state;\n\n vm.enableInternalSettings = $state.params.enableInternalSettings;\n vm.enableDeveloperSettings = $state.params.enableDeveloperSettings;\n vm.runInternalSettingsDialog = runInternalSettingsDialog;\n vm.runDeveloperSettingsDialog = runDeveloperSettingsDialog;\n vm.lostConnState = mnLostConnectionService.getState();\n\n vm.clientAlerts = mnAlertsService.clientAlerts;\n vm.alerts = mnAlertsService.alerts;\n vm.closeAlert = mnAlertsService.removeItem;\n vm.setHideNavSidebar = mnPoolDefault.setHideNavSidebar;\n vm.postStopRebalance = postStopRebalance;\n vm.closeCustomAlert = closeCustomAlert;\n vm.enableCustomAlert = enableCustomAlert;\n\n vm.getRebalanceReport = getRebalanceReport;\n\n $rootScope.implementationVersion = pools.implementationVersion;\n $rootScope.rbac = mnPermissions.export;\n $rootScope.poolDefault = mnPoolDefault.export;\n $rootScope.pools = mnPools.export;\n $rootScope.buckets = mnBucketsService.export;\n\n let mnOnDestroy = new Subject();\n $scope.$on(\"$destroy\", function () {\n mnOnDestroy.next();\n mnOnDestroy.complete();\n });\n\n function disableHoverEventDuringScroll() {\n let bodyElement = angular.element(document.querySelector(\"body\"));\n\n fromEvent(bodyElement, \"scroll\")\n .pipe(tap(() => bodyElement.addClass(\"mn-scroll-active\")),\n switchMap(() => timer(200)),\n takeUntil(mnOnDestroy))\n .subscribe(() => bodyElement.removeClass(\"mn-scroll-active\"));\n }\n\n disableHoverEventDuringScroll();\n\n activate();\n\n function closeCustomAlert(alertName) {\n vm.clientAlerts[alertName] = true;\n }\n\n function enableCustomAlert(alertName) {\n vm.clientAlerts[alertName] = false;\n }\n\n function postCancelRebalanceRetry(id) {\n mnSettingsClusterService.postCancelRebalanceRetry(id);\n }\n\n async function showClusterInfoDialog() {\n await import('./mn_logs_service.js');\n await $ocLazyLoad.load({name: 'mnLogsService'});\n var mnLogsService = $injector.get('mnLogsService');\n mnLogsService.showClusterInfoDialog();\n }\n\n async function showResetPasswordDialog() {\n vm.showUserDropdownMenu = false;\n await import('./mn_reset_password_dialog_controller.js');\n await $ocLazyLoad.load({name: 'mnResetPasswordDialog'});\n var mnResetPasswordDialogService = $injector.get('mnResetPasswordDialogService');\n mnResetPasswordDialogService.showDialog(whoami);\n }\n\n async function postStopRebalance() {\n await import('./mn_servers_service.js');\n await $ocLazyLoad.load({name: 'mnServersService'});\n var mnServersService = $injector.get('mnServersService');\n return mnPromiseHelper(vm, mnServersService.stopRebalanceWithConfirm())\n .broadcast(\"reloadServersPoller\");\n }\n\n function runDeveloperSettingsDialog() {\n import('./mn_developer_settings_controller.js')\n .then(function () {\n $ocLazyLoad.load({name: 'mnDeveloperSettings'});\n $uibModal.open({\n template: mnDeveloperSettingsTemplate,\n controller: \"mnDeveloperSettingsController as devSettingsCtl\"\n });\n });\n }\n\n function runInternalSettingsDialog() {\n import('./mn_internal_settings_controller.js')\n .then(function () {\n $ocLazyLoad.load({name: 'mnInternalSettings'});\n $uibModal.open({\n template: mnInternalSettingsTemplate,\n controller: \"mnInternalSettingsController as internalSettingsCtl\"\n });\n });\n }\n\n function toggleProgressBar() {\n vm.isProgressBarClosed = !vm.isProgressBarClosed;\n }\n\n function filterTasks(runningTasks, includeRebalance) {\n return (runningTasks || []).filter(function (task) {\n return formatProgressMessageFilter(task, includeRebalance);\n });\n }\n\n function resetAutoFailOverCount() {\n var queries = [\n mnSettingsAutoFailoverService.resetAutoFailOverCount({group: \"global\"}),\n mnSettingsAutoFailoverService.resetAutoReprovisionCount({group: \"global\"})\n ];\n\n mnPromiseHelper(vm, $q.all(queries))\n .reloadState()\n .showSpinner('resetQuotaLoading')\n .catchGlobalErrors('Unable to reset Auto-failover quota!')\n .showGlobalSuccess(\"Auto-failover quota reset successfully!\");\n }\n\n function getRebalanceReport() {\n mnTasksDetails.getRebalanceReport().then(function(report) {\n var file = new Blob([JSON.stringify(report,null,2)],{type: \"application/json\", name: \"rebalanceReport.json\"});\n saveAs(file,\"rebalanceReport.json\");\n });\n }\n\n function activate() {\n mnSessionService.activate(mnOnDestroy);\n\n new mnPoller($scope, function () {\n return mnBucketsService.findMoxiBucket();\n })\n .subscribe(\"moxiBucket\", vm)\n .reloadOnScopeEvent([\"reloadBucketStats\"])\n .cycle();\n\n if (mnPermissions.export.cluster.settings.read) {\n new mnPoller($scope, function () {\n return mnSettingsAutoFailoverService.getAutoFailoverSettings();\n })\n .setInterval(10000)\n .subscribe(\"autoFailoverSettings\", vm)\n .reloadOnScopeEvent([\"reloadServersPoller\", \"rebalanceFinished\"])\n .cycle();\n }\n\n if (mnPermissions.export.cluster.settings.read) {\n loadAndRunLauchpad($ocLazyLoad, $injector, vm);\n }\n\n new mnEtagPoller($scope, function (previous) {\n return mnPoolDefault.get({\n etag: previous ? previous.etag : \"\",\n waitChange: 10000\n }, {group: \"global\"});\n }, true).subscribe(function (resp, previous) {\n\n if (previous && (resp.thisNode.clusterCompatibility !=\n previous.thisNode.clusterCompatibility)) {\n $window.location.reload();\n }\n\n mnAdminService.stream.getPoolsDefault.next(resp);\n\n if (!_.isEqual(resp, previous)) {\n $rootScope.$broadcast(\"mnPoolDefaultChanged\");\n }\n\n if (Number(localStorage.getItem(\"uiSessionTimeout\")) !== (resp.uiSessionTimeout * 1000)) {\n $rootScope.$broadcast(\"newSessionTimeout\", resp.uiSessionTimeout);\n }\n\n vm.tabName = resp.clusterName;\n\n if (previous && !_.isEqual(resp.nodes, previous.nodes)) {\n $rootScope.$broadcast(\"nodesChanged\", [resp.nodes, previous.nodes]);\n }\n\n if (previous && previous.buckets.uri !== resp.buckets.uri) {\n $rootScope.$broadcast(\"reloadBucketStats\");\n }\n\n if (previous && previous.trustedCAsURI !== resp.trustedCAsURI) {\n $rootScope.$broadcast(\"reloadGetPoolsDefaultTrustedCAs\");\n }\n\n if (previous && previous.serverGroupsUri !== resp.serverGroupsUri) {\n $rootScope.$broadcast(\"serverGroupsUriChanged\");\n }\n\n if (previous && previous.indexStatusURI !== resp.indexStatusURI) {\n $rootScope.$broadcast(\"indexStatusURIChanged\");\n }\n\n if (!_.isEqual(resp.alerts, (previous || {}).alerts || [])) {\n loadAndRunPoorMansAlertsDialog($ocLazyLoad, $injector, resp);\n }\n\n var version = mnPrettyVersionFilter(pools.implementationVersion);\n $rootScope.mnTitle = vm.tabName + (version ? (' - ' + version) : '');\n\n if (previous && previous.tasks.uri != resp.tasks.uri) {\n $rootScope.$broadcast(\"reloadTasksPoller\");\n }\n\n if (previous && previous.checkPermissionsURI != resp.checkPermissionsURI) {\n $rootScope.$broadcast(\"reloadPermissions\");\n }\n })\n .cycle();\n\n if (mnPermissions.export.cluster.tasks.read) {\n if (pools.isEnterprise && poolDefault.compat.atLeast65) {\n new mnPoller($scope, function () {\n return mnSettingsClusterService.getPendingRetryRebalance({group: \"global\"});\n })\n .setInterval(function (resp) {\n return resp.data.retry_after_secs ? 1000 : 3000;\n })\n .subscribe(function (resp) {\n vm.retryRebalance = resp.data;\n }).cycle();\n }\n\n var tasksPoller = new mnPoller($scope, function (prevTask) {\n return mnTasksDetails.getFresh({group: \"global\"})\n .then(function (tasks) {\n if (poolDefault.compat.atLeast65) {\n if (tasks.tasksRebalance.status == \"notRunning\") {\n if (!tasks.tasksRebalance.masterRequestTimedOut &&\n prevTask && (tasks.tasksRebalance.lastReportURI !=\n prevTask.tasksRebalance.lastReportURI)) {\n mnTasksDetails.clearRebalanceReportCache(prevTask.tasksRebalance.lastReportURI);\n }\n if (mnPermissions.export.cluster.admin.logs.read) {\n return mnTasksDetails.getRebalanceReport(tasks.tasksRebalance.lastReportURI)\n .then(function (rv) {\n if (rv.data.stageInfo) {\n tasks.tasksRebalance.stageInfo = rv.data.stageInfo;\n tasks.tasksRebalance.completionMessage = rv.data.completionMessage;\n }\n return tasks;\n });\n }\n }\n return tasks;\n }\n return tasks;\n });\n })\n .setInterval(function (result) {\n return (_.chain(result.tasks).pluck('recommendedRefreshPeriod').compact().min().value() * 1000) >> 0 || 10000;\n })\n .subscribe(function (tasks, prevTask) {\n vm.showTasksSpinner = false;\n if (!_.isEqual(tasks, prevTask)) {\n $rootScope.$broadcast(\"mnTasksDetailsChanged\");\n }\n\n var isRebalanceFinished =\n tasks.tasksRebalance && tasks.tasksRebalance.status !== 'running' &&\n prevTask && prevTask.tasksRebalance && prevTask.tasksRebalance.status === \"running\";\n if (isRebalanceFinished) {\n $rootScope.$broadcast(\"rebalanceFinished\");\n }\n\n if (!vm.isProgressBarClosed &&\n !filterTasks(tasks.running).length &&\n !tasks.tasksRebalance.stageInfo &&\n prevTask && filterTasks(prevTask.running).length) {\n vm.isProgressBarClosed = true;\n }\n\n var stageInfo = {\n services: {},\n startTime: null,\n completedTime: {\n status: true\n }\n };\n var serverStageInfo = tasks.tasksRebalance.stageInfo ||\n (tasks.tasksRebalance.previousRebalance &&\n tasks.tasksRebalance.previousRebalance.stageInfo);\n\n if (serverStageInfo) {\n var services = Object\n .keys(serverStageInfo)\n .sort(function (a, b) {\n if (!serverStageInfo[a].timeTaken) {\n return 1;\n }\n if (!serverStageInfo[b].startTime) {\n return -1;\n }\n if (new Date(serverStageInfo[a].startTime) >\n new Date(serverStageInfo[b].startTime)) {\n return 1;\n } else {\n return -1;\n }\n });\n\n stageInfo.services = services\n .map(function(key) {\n var value = serverStageInfo[key];\n value.name = key;\n var details = Object\n .keys(value.details || {})\n // .sort(function (a, b) {\n // return new Date(value.details[a].startTime) -\n // new Date(value.details[b].startTime);\n // });\n\n value.details = details.map(function (bucketName) {\n value.details[bucketName].name = bucketName;\n return value.details[bucketName];\n });\n\n if (value.startTime) {\n if (!stageInfo.startTime ||\n stageInfo.startTime > new Date(value.startTime)) {\n stageInfo.startTime = new Date(value.startTime);\n }\n }\n if (value.completedTime) {\n value.completedTime = new Date(value.completedTime);\n if (!stageInfo.completedTime.time ||\n (stageInfo.completedTime.time < value.completedTime)) {\n stageInfo.completedTime.time = new Date(value.completedTime);\n }\n } else {\n stageInfo.completedTime.status = false;\n }\n return value;\n });\n\n tasks.tasksRebalance.stageInfo = stageInfo;\n }\n\n if (tasks.inRebalance) {\n if (!prevTask) {\n vm.isProgressBarClosed = false;\n } else {\n if (!prevTask.tasksRebalance ||\n prevTask.tasksRebalance.status !== \"running\") {\n vm.isProgressBarClosed = false;\n }\n }\n }\n\n if (tasks.tasksRebalance.errorMessage && mnAlertsService.isNewAlert({id: tasks.tasksRebalance.statusId})) {\n mnAlertsService.setAlert(\"error\", tasks.tasksRebalance.errorMessage, null, tasks.tasksRebalance.statusId);\n }\n vm.tasks = tasks;\n }, vm)\n .cycle();\n }\n\n $scope.$on(\"reloadPermissions\", function () {\n mnPermissions.throttledCheck();\n });\n\n $scope.$on(\"reloadTasksPoller\", function (event, params) {\n if (!params || !params.doNotShowSpinner) {\n vm.showTasksSpinner = true;\n }\n if (tasksPoller) {\n tasksPoller.reload(true);\n }\n });\n\n $scope.$on(\"reloadBucketStats\", function () {\n mnBucketsService.clearCache();\n mnBucketsService.getBucketsByType();\n });\n $rootScope.$broadcast(\"reloadBucketStats\");\n\n mnAdminService.stream.hideNavSidebar\n .pipe(takeUntil(mnOnDestroy))\n .subscribe(hideSidebar => vm.setHideNavSidebar(hideSidebar));\n }\n}\n\n\nasync function loadAndRunPoorMansAlertsDialog($ocLazyLoad, $injector, resp) {\n await import(\"./mn_poor_mans_alerts_controller.js\");\n await $ocLazyLoad.load({name: 'mnPoorMansAlerts'});\n var mnPoorMansAlertsService = $injector.get('mnPoorMansAlertsService');\n mnPoorMansAlertsService.maybeShowAlerts(resp);\n}\n\nasync function loadAndRunLauchpad($ocLazyLoad, $injector, vm) {\n await import(\"./mn_settings_notifications_service.js\");\n await $ocLazyLoad.load({name: 'mnSettingsNotificationsService'});\n var mnSettingsNotificationsService = $injector.get('mnSettingsNotificationsService');\n\n vm.updates = await mnSettingsNotificationsService.maybeCheckUpdates({group: \"global\"});\n if (vm.updates.sendStats) {\n vm.launchpadSource = await mnSettingsNotificationsService\n .buildPhoneHomeThingy({group: \"global\"})\n }\n}\n", "/*\nCopyright 2015-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from 'angular';\n\nexport default 'mnLaunchpad';\n\nangular\n .module('mnLaunchpad', [])\n .directive('mnLaunchpad', mnLaunchpadDirective);\n\nfunction mnLaunchpadDirective($timeout) {\n var mnLaunchpad = {\n scope: {\n launchpadSource: \"=\",\n launchpadId: \"=\"\n },\n link: link\n }\n\n return mnLaunchpad;\n\n function link($scope, $element) {\n $scope.$watch('launchpadSource', function (launchpadSource) {\n if (!launchpadSource) {\n return;\n }\n var iframe = document.createElement(\"iframe\");\n iframe.style.display = 'none'\n $element.append(iframe);\n var idoc = iframe.contentWindow.document;\n idoc.body.innerHTML = \"\";\n var form = idoc.getElementById(\"launchpad\");\n var textarea = idoc.getElementById(\"sputnik\");\n form['action'] = \"https://ph.couchbase.net/v2?launchID=\" + $scope.launchpadId;\n textarea.innerText = JSON.stringify(launchpadSource);\n form.submit();\n $scope.launchpadSource = undefined;\n\n $timeout(function () {\n $element.empty();\n }, 30000);\n });\n }\n}\n", "/*\nCopyright 2020-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from \"angular\";\nimport uiRouter from \"@uirouter/angularjs\";\nimport uiBootstrap from \"angular-ui-bootstrap\";\n\nexport default \"mnLostConnectionService\";\n\nangular\n .module(\"mnLostConnectionService\", [\n uiRouter,\n uiBootstrap\n ])\n .factory(\"mnLostConnectionService\", [\"$interval\", \"$uibModalStack\", \"$window\", \"$state\", mnLostConnectionFactory]);\n\nfunction mnLostConnectionFactory($interval, $uibModalStack, $window, $state) {\n var state = {\n isActive: false,\n isReload: false\n };\n var mnLostConnectionService = {\n activate: activate,\n deactivate: deactivate,\n getState: getState,\n resendQueries: resendQueries\n };\n return mnLostConnectionService;\n\n function activate() {\n if (state.isActive) {\n return;\n }\n state.isActive = true;\n resetTimer();\n runTimer();\n }\n\n function runTimer() {\n state.interval = $interval(function () {\n state.repeatAt -= 1;\n if (state.repeatAt <= 0) {\n $uibModalStack.dismissAll();\n resendQueries();\n }\n }, 1000);\n }\n\n function resetTimer() {\n $interval.cancel(state.interval);\n state.interval = null;\n state.repeatAt = 60;\n }\n\n function resendQueries() {\n $state.reload().then(deactivate, function () {\n resetTimer();\n runTimer();\n });\n }\n\n function deactivate() {\n if (state.isReload) {\n return;\n }\n state.isReload = true;\n $interval.cancel(state.interval);\n $window.location.reload(true);// completely reinitialize application after lost of connection\n }\n\n function getState() {\n return state;\n }\n}\n", "/*\nCopyright 2020-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from \"angular\";\nimport mnLostConnectionService from \"./mn_lost_connection_service.js\";\n\nexport default 'mnLostConnection';\n\nangular\n .module('mnLostConnection', [mnLostConnectionService])\n .config([\"$httpProvider\", mnLostConnectionConfig])\n .controller(\"mnLostConnectionController\", [\"mnLostConnectionService\", \"$window\", mnLostConnectionController]);\n\nfunction mnLostConnectionController(mnLostConnectionService, $window) {\n var vm = this;\n vm.lostConnectionAt = $window.location.host;\n vm.state = mnLostConnectionService.getState();\n vm.retryNow = mnLostConnectionService.resendQueries;\n}\n\nfunction mnLostConnectionConfig($httpProvider) {\n $httpProvider.interceptors.push(['$q', '$injector', interceptorOfErrConnectionRefused]);\n}\n\nfunction interceptorOfErrConnectionRefused($q, $injector) {\n var wantedUrls = {};\n\n return {\n responseError: function (rejection) {\n if (rejection.status <= 0 && (rejection.xhrStatus == \"error\")) {\n //rejection caused not by us (e.g. net::ERR_CONNECTION_REFUSED)\n wantedUrls[rejection.config.url] = true;\n $injector\n .get(\"mnLostConnectionService\")\n .activate();\n } else {\n if (rejection.config && wantedUrls[rejection.config.url]) { //in order to avoid cached queries\n wantedUrls = {};\n $injector\n .get(\"mnLostConnectionService\")\n .deactivate();\n }\n }\n return $q.reject(rejection);\n },\n response: function (resp) {\n if (wantedUrls[resp.config.url]) {\n wantedUrls = {};\n $injector\n .get(\"mnLostConnectionService\")\n .deactivate();\n }\n return resp;\n }\n };\n}\n", "/*\nCopyright 2020-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport {Component, ChangeDetectionStrategy} from '@angular/core';\nimport {FormGroup} from '@angular/forms';\nimport {interval} from 'rxjs';\nimport {NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';\nimport {scan, startWith} from 'rxjs/operators';\n\nimport {MnLifeCycleHooksToStream} from './mn.core.js';\nimport template from \"./mn.session.timeout.dialog.html\";\n\nexport {MnSessionTimeoutDialogComponent};\n\nclass MnSessionTimeoutDialogComponent extends MnLifeCycleHooksToStream {\n static get annotations() { return [\n new Component({\n template,\n changeDetection: ChangeDetectionStrategy.OnPush\n })\n ]}\n\n static get parameters() { return [\n NgbActiveModal\n ]}\n\n constructor(activeModal) {\n super();\n this.activeModal = activeModal;\n this.formGroup = new FormGroup({});\n var time = 29;\n this.time = interval(1000).pipe(scan(acc => acc ? (--acc) : 0, time), startWith(time));\n }\n}\n", "/*\nCopyright 2020-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {NgbModal} from '@ng-bootstrap/ng-bootstrap';\nimport {fromEvent, merge, NEVER, timer} from 'rxjs';\nimport {throttleTime, takeUntil, filter,\n switchMap, map, shareReplay} from 'rxjs/operators';\nimport {not, compose} from 'ramda';\n\nimport {MnAuth} from './ajs.upgraded.providers.js';\nimport {MnAdminService} from './mn.admin.service.js';\nimport {MnSessionTimeoutDialogComponent} from './mn.session.timeout.dialog.component.js';\nimport {singletonGuard} from './mn.core.js';\n\nexport {MnSessionService};\n\nclass MnSessionService {\n static get annotations() { return [\n new Injectable()\n ]}\n\n static get parameters() { return [\n HttpClient,\n MnAuth,\n MnAdminService,\n NgbModal\n ]}\n\n constructor(http, mnAuth, mnAdminService, modalService) {\n singletonGuard(MnSessionService);\n\n this.http = http;\n this.modalService = modalService;\n this.postUILogout = mnAuth.logout;\n\n this.stream = {};\n\n this.stream.storage = fromEvent(window, 'storage');\n this.stream.mousemove = fromEvent(window, 'mousemove');\n this.stream.keydown = fromEvent(window, 'keydown');\n this.stream.touchstart = fromEvent(window, 'touchstart');\n\n this.stream.userEvents =\n merge(this.stream.mousemove,\n this.stream.keydown,\n this.stream.touchstart)\n .pipe(throttleTime(300));\n\n this.stream.poolsSessionTimeout =\n mnAdminService.stream.uiSessionTimeout;\n\n this.stream.storageResetSessionTimeout =\n this.stream.storage.pipe(filter(this.isUiSessionTimeoutEvent.bind(this)));\n\n this.stream.resetSessionTimeout =\n merge(this.stream.storageResetSessionTimeout,\n this.stream.poolsSessionTimeout,\n this.stream.userEvents)\n .pipe(filter(compose(not, this.isDialogOpened.bind(this))),\n map(this.getUiSessionTimeout.bind(this)),\n shareReplay({refCount: true, bufferSize: 1}));\n }\n\n activate(mnOnDestroy) {\n this.stream.poolsSessionTimeout\n .pipe(map(this.minToSeconds.bind(this)),\n takeUntil(mnOnDestroy))\n .subscribe(this.setTimeout.bind(this));\n\n this.stream.userEvents\n .pipe(filter(compose(not, this.isDialogOpened.bind(this))),\n takeUntil(mnOnDestroy))\n .subscribe(this.resetAndSyncTimeout.bind(this));\n\n this.stream.storageResetSessionTimeout\n .pipe(filter(this.isDialogOpened.bind(this)),\n takeUntil(mnOnDestroy))\n .subscribe(this.dismissDialog.bind(this));\n\n this.stream.resetSessionTimeout\n .pipe(map(this.getDialogTimeout.bind(this)),\n switchMap(this.createTimer.bind(this)),\n takeUntil(mnOnDestroy))\n .subscribe(this.openDialog.bind(this));\n\n this.stream.resetSessionTimeout\n .pipe(switchMap(this.createTimer.bind(this)),\n takeUntil(mnOnDestroy))\n .subscribe(this.logout.bind(this));\n\n }\n\n setTimeout(uiSessionTimeout) {\n localStorage.setItem(\"uiSessionTimeout\", Number(uiSessionTimeout));\n }\n\n resetAndSyncTimeout() {\n //localStorage triggers event \"storage\" only when storage value has been changed\n localStorage.setItem(\"uiSessionTimeoutReset\",\n (Number(localStorage.getItem(\"uiSessionTimeoutReset\")) + 1) || 0);\n }\n\n getUiSessionTimeout() {\n return Number(localStorage.getItem(\"uiSessionTimeout\")) || 0;\n }\n\n isUiSessionTimeoutEvent(e) {\n return e.key === \"uiSessionTimeoutReset\";\n }\n\n openDialog() {\n this.dialogRef = this.modalService.open(MnSessionTimeoutDialogComponent);\n this.dialogRef.result.then(this.removeDialog.bind(this), this.removeDialog.bind(this));\n }\n\n removeDialog() {\n this.dialogRef = null;\n }\n\n dismissDialog() {\n this.dialogRef.dismiss();\n }\n\n isDialogOpened() {\n return !!this.dialogRef;\n }\n\n getDialogTimeout(t) {\n return t - 30000;\n }\n\n minToSeconds(t) {\n return t * 1000;\n }\n\n createTimer(t) {\n return t && t > 0 ? timer(t) : NEVER;\n }\n\n logout() {\n this.postUILogout();\n }\n}\n", "/*\nCopyright 2015-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from \"angular\";\nimport ngAnimate from \"angular-animate\";\nimport uiSelect from \"ui-select\";\nimport uiBootstrap from \"angular-ui-bootstrap\";\nimport uiRouter from \"@uirouter/angularjs\";\nimport {downgradeInjectable, setAngularJSGlobal} from \"@angular/upgrade/static\";\nsetAngularJSGlobal(angular);\n\nimport mnAdminController from \"./mn_admin_controller.js\";\nimport mnAlertsService from \"../components/mn_alerts.js\";\nimport mnPoolDefault from \"../components/mn_pool_default.js\";\nimport mnPoll from \"../components/mn_poll.js\";\nimport mnFilters from \"../components/mn_filters.js\";\nimport mnHelper from \"../components/mn_helper.js\";\nimport mnSpinner from \"../components/directives/mn_spinner.js\";\nimport mnMainSpinner from \"../components/directives/mn_main_spinner.js\";\nimport mnLaunchpad from \"../components/directives/mn_launchpad.js\";\nimport mnPluggableUiRegistry from \"../components/mn_pluggable_ui_registry.js\";\nimport mnSettingsAutoFailoverService from \"./mn_settings_auto_failover_service.js\";\nimport mnSettingsClusterService from \"./mn_settings_cluster_service.js\";\n\nimport mnAuthService from \"../mn_auth/mn_auth_service.js\";\nimport mnPermissions from \"../components/mn_permissions.js\";\nimport mnElementCrane from \"../components/directives/mn_element_crane/mn_element_crane.js\";\nimport mnDragAndDrop from \"../components/directives/mn_drag_and_drop.js\";\nimport mnTasksDetails from \"../components/mn_tasks_details.js\";\n\nimport mnLostConnection from \"./mn_lost_connection_config.js\";\nimport {MnAdminService} from \"../mn.admin.service.js\";\nimport {MnSessionService} from \"../mn.session.service.js\";\nimport {MnStatsService} from \"../mn.stats.service.js\";\n\nimport mnDetailStatsModule from \"../components/directives/mn_detail_stats_controller.js\";\n\nimport mnSelect from \"../components/directives/mn_select/mn_select.js\";\nimport memoryQuotaDialogTemplate from \"./memory_quota_dialog.html\";\nimport mnAdminTemplate from \"./mn_admin.html\";\nimport mnLostConnectionTemplate from \"./mn_lost_connection.html\";\n\nexport default 'mnAdmin';\n\nangular.module('mnAdmin', [\n ngAnimate,\n uiBootstrap,\n uiRouter,\n uiSelect,\n\n mnPoll,\n mnFilters,\n mnAlertsService,\n mnPoolDefault,\n mnAuthService,\n mnHelper,\n mnSpinner,\n mnMainSpinner,\n\n mnTasksDetails,\n\n mnLaunchpad,\n mnPluggableUiRegistry,\n mnLostConnection,\n mnPermissions,\n mnElementCrane,\n mnDragAndDrop,\n mnSettingsAutoFailoverService,\n mnSettingsClusterService,\n mnDetailStatsModule,\n mnSelect\n]).config([\"$stateProvider\", \"$urlMatcherFactoryProvider\", \"mnPluggableUiRegistryProvider\", \"$httpProvider\", mnAdminConfig])\n .controller('mnAdminController', mnAdminController)\n .factory('mnAdminService', downgradeInjectable(MnAdminService))\n .factory('mnSessionService', downgradeInjectable(MnSessionService))\n .factory('mnStatsServiceDowngraded', downgradeInjectable(MnStatsService));\n\n//https://github.com/angular-ui/ui-select/issues/1560\nangular.module('ui.select').run([\"$animate\", uiSelectRun]);\n\nfunction uiSelectRun($animate) {\n var origEnabled = $animate.enabled\n $animate.enabled = function (elem) {\n if (arguments.length !== 1) {\n return origEnabled.apply($animate, arguments);\n } else if (origEnabled(elem)) {\n return (/enable-ng-animation/).test(elem.classNames);\n }\n return false\n }\n}\n\nangular.module('mnAdmin').run([\"$rootScope\", \"$uibModal\", \"$ocLazyLoad\", \"$injector\", mnAdminRun]);\n\nfunction mnAdminRun($rootScope, $uibModal, $ocLazyLoad, $injector) {\n let mnPoolDefault = $injector.get('mnPoolDefault');\n\n $rootScope.$on(\"maybeShowMemoryQuotaDialog\",\n loadAndRunMemoryQuotaDialog($uibModal, $ocLazyLoad, $injector, mnPoolDefault));\n\n function loadAndRunMemoryQuotaDialog($uibModal, $ocLazyLoad, $injector, mnPoolDefault) {\n return async function (_, services) {\n var poolsDefault = await mnPoolDefault.get();\n var servicesToCheck = [\"index\", \"fts\"];\n if (poolsDefault.isEnterprise) {\n servicesToCheck = servicesToCheck.concat([\"cbas\", \"eventing\"]);\n }\n await import(\"../components/directives/mn_memory_quota/mn_memory_quota_service.js\");\n await $ocLazyLoad.load({name: 'mnMemoryQuotaService'});\n var mnMemoryQuotaService = $injector.get('mnMemoryQuotaService');\n\n var firstTimeAddedServices =\n mnMemoryQuotaService.getFirstTimeAddedServices(servicesToCheck,\n services, poolsDefault.nodes);\n if (!firstTimeAddedServices.count) {\n return;\n }\n\n await import(\"./memory_quota_dialog_controller.js\");\n await $ocLazyLoad.load({name: 'mnMemoryQuotaDialogController'});\n $uibModal.open({\n windowTopClass: \"without-titlebar-close\",\n backdrop: 'static',\n template: memoryQuotaDialogTemplate,\n controller: 'mnMemoryQuotaDialogController as memoryQuotaDialogCtl',\n resolve: {\n memoryQuotaConfig: ['mnMemoryQuotaService', function (mnMemoryQuotaService) {\n return mnMemoryQuotaService.memoryQuotaConfig(services, true, false);\n }],\n indexSettings: ['mnSettingsClusterService', function (mnSettingsClusterService) {\n return mnSettingsClusterService.getIndexSettings();\n }],\n firstTimeAddedServices: function() {\n return firstTimeAddedServices;\n }\n }\n });\n }\n };\n}\n\nfunction mnAdminConfig($stateProvider, $urlMatcherFactoryProvider, mnPluggableUiRegistryProvider, $httpProvider) {\n\n $httpProvider.interceptors.push(['$q', '$injector', interceptorOf401]);\n\n function interceptorOf401($q, $injector) {\n return {\n responseError: function (rejection) {\n if (rejection.status === 401 &&\n rejection.config.url !== \"/pools\" &&\n rejection.config.url !== \"/controller/changePassword\" &&\n rejection.config.url !== \"/uilogout\" &&\n ($injector.get('$state').includes('app.admin') ||\n $injector.get('$state').includes('app.wizard')) &&\n !rejection.config.headers[\"ignore-401\"] &&\n !$injector.get('mnLostConnectionService').getState().isActive) {\n $injector.get('mnAuthService').logout();\n }\n return $q.reject(rejection);\n }\n };\n }\n\n function valToString(val) {\n return val != null ? val.toString() : val;\n }\n $urlMatcherFactoryProvider.type(\"string\", {\n encode: valToString,\n decode: valToString,\n is: function (val) {\n return (/[^/]*/).test(val);\n }\n });\n\n mnPluggableUiRegistryProvider.registerConfig({\n name: 'Indexes',\n state: 'app.admin.gsi',\n includedByState: 'app.admin.gsi',\n plugIn: 'workbenchTab',\n index: 2,\n ngShow: \"rbac.cluster.collection['.:.:.'].n1ql.index.read\"\n });\n\n $stateProvider\n .state('app.admin', {\n url: \"?commonBucket&commonScope&commonCollection&scenarioZoom&scenario\",\n abstract: true,\n data: {\n requiresAuth: true\n },\n params: {\n openedGroups: {\n value: [],\n array: true,\n dynamic: true\n },\n commonBucket: {\n value: null,\n dynamic: true\n },\n commonScope: {\n value: null,\n dynamic: true\n },\n commonCollection: {\n value: null,\n dynamic: true\n },\n scenario: {\n value: null,\n dynamic: true\n },\n scenarioZoom: {\n value: \"minute\"\n }\n },\n resolve: {\n poolDefault: ['mnPoolDefault', function (mnPoolDefault) {\n return mnPoolDefault.getFresh();\n }],\n pools: ['mnPools', function (mnPools) {\n return mnPools.get();\n }],\n permissions: ['mnPermissions', function (mnPermissions) {\n return mnPermissions.check();\n }],\n whoami: ['mnAuthService', function (mnAuthService) {\n return mnAuthService.whoami();\n }]\n },\n views: {\n \"\": {\n controller: 'mnAdminController as adminCtl',\n template: mnAdminTemplate\n },\n \"lostConnection@app.admin\": {\n template: mnLostConnectionTemplate,\n controller: 'mnLostConnectionController as lostConnCtl'\n }\n }\n });\n}\n", "/*\nCopyright 2015-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nexport default appConfig;\n\nappConfig.$inject = [\"$httpProvider\", \"$stateProvider\", \"$urlRouterProvider\", \"$transitionsProvider\", \"$uibTooltipProvider\", \"$animateProvider\", \"$qProvider\", \"$sceDelegateProvider\", \"$locationProvider\", \"$uibModalProvider\"];\nfunction appConfig($httpProvider, $stateProvider, $urlRouterProvider, $transitionsProvider, $uibTooltipProvider, $animateProvider, $qProvider, $sceDelegateProvider, $locationProvider, $uibModalProvider) {\n $httpProvider.defaults.headers.common['invalid-auth-response'] = 'on';\n $httpProvider.defaults.headers.common['Cache-Control'] = 'no-cache';\n $httpProvider.defaults.headers.common['Pragma'] = 'no-cache';\n $httpProvider.defaults.headers.common['ns-server-ui'] = 'yes';\n\n $animateProvider.classNameFilter(/enable-ng-animation/);\n\n $urlRouterProvider.deferIntercept();\n $locationProvider.hashPrefix('');\n $urlRouterProvider.otherwise(function ($injector) {\n $injector.invoke(['$state', function($state) {\n $state.go('app.admin.overview.statistics');\n }]);\n });\n\n $uibModalProvider.options.backdrop = \"static\";\n\n $sceDelegateProvider.resourceUrlWhitelist([\n 'self', // Allow same origin resource loads\n 'https://ph.couchbase.net/**' // Allow JSONP calls that match this pattern\n ]);\n\n $qProvider.errorOnUnhandledRejections(false);\n // When using a tooltip in an absolute positioned element,\n // you need tooltip-append-to-body=\"true\" https://github.com/angular-ui/bootstrap/issues/4195\n $uibTooltipProvider.options({\n placement: \"auto right\",\n trigger: \"outsideClick\"\n });\n\n $stateProvider.state('app', {\n url: '?{enableInternalSettings:bool}&{disablePoorMansAlerts:bool}&{enableDeveloperSettings:bool}',\n params: {\n enableDeveloperSettings: {\n value: null,\n squash: true\n },\n enableInternalSettings: {\n value: null,\n squash: true\n },\n disablePoorMansAlerts: {\n value: null,\n squash: true\n }\n },\n abstract: true,\n resolve: {\n env: ['mnEnv', '$rootScope', function (mnEnv, $rootScope) {\n return mnEnv.loadEnv().then(function(env) {\n $rootScope.ENV = env;\n });\n }]\n },\n template: '
' +\n '
'\n });\n\n $transitionsProvider.onBefore({\n to: \"app.admin.**\"\n }, (trans) => {\n //convert pre 7.0 bucket params to 7.0 commonBucket\n let original = Object.assign({}, trans.params('to'));\n\n if (!original.commonBucket) {\n let params = Object.assign({}, original);\n ([\"bucket\", \"scenarioBucket\", \"collectionsBucket\", \"indexesBucket\"])\n .forEach(bucket => {\n if (params[bucket]) {\n params.commonBucket = params[bucket];\n if (bucket != \"bucket\") {\n //do not remove 'bucket' parameter since this is\n //popular pluggable UI param, so we just pass it\n //along with commonBucket parameter\n delete params[bucket];\n }\n }\n });\n\n if (params.commonBucket) {\n return trans.router.stateService.target(trans.to().name, params);\n }\n }\n });\n\n $transitionsProvider.onBefore({\n to: (state) => state.data && state.data.requiresAuth\n }, (transition) => {\n let mnPools = transition.injector().get('mnPools');\n let $state = transition.router.stateService;\n return mnPools.get().then(pools => {\n if (!pools.isInitialized) {\n $state.go('app.wizard.welcome', null, {location: false});\n return false;\n } else {\n return true;\n }\n }, function (resp) {\n switch (resp.status) {\n case 401:\n $state.go('app.auth', null, {location: false});\n return false;\n }\n });\n });\n\n function isThisTransitionBetweenTabs(trans) {\n let toName = trans.to().name;\n let fromName = trans.from().name;\n return toName.indexOf(fromName) === -1 && fromName.indexOf(toName) === -1;\n }\n\n $transitionsProvider.onFinish({\n from: \"app.admin.**\",\n to: \"app.admin.**\"\n }, function (trans) {\n if (isThisTransitionBetweenTabs(trans)) {\n let mnHelper = trans.injector().get('mnHelper');\n mnHelper.mainSpinnerCounter.decrease();\n }\n });\n\n $transitionsProvider.onError({\n from: \"app.admin.**\",\n to: \"app.admin.**\"\n }, function (trans) {\n if (isThisTransitionBetweenTabs(trans)) {\n let mnHelper = trans.injector().get('mnHelper');\n mnHelper.mainSpinnerCounter.decrease();\n }\n });\n\n $transitionsProvider.onBefore({\n from: \"app.admin.**\",\n to: \"app.admin.**\"\n }, function (trans) {\n var $rootScope = trans.injector().get('$rootScope');\n var mnPendingQueryKeeper = trans.injector().get('mnPendingQueryKeeper');\n var $uibModalStack = trans.injector().get('$uibModalStack');\n var isModalOpen = !!$uibModalStack.getTop();\n\n if ($rootScope.mnGlobalSpinnerFlag) {\n return false;\n }\n if (!isModalOpen && isThisTransitionBetweenTabs(trans)) {\n //cancel tabs specific queries in case toName is not child of fromName and vise versa\n mnPendingQueryKeeper.cancelTabsSpecificQueries();\n var mnHelper = trans.injector().get('mnHelper');\n mnHelper.mainSpinnerCounter.increase();\n }\n return !isModalOpen;\n });\n $transitionsProvider.onBefore({\n from: \"app.auth\",\n to: \"app.admin.**\"\n }, function (trans, $state) {\n var mnPools = trans.injector().get('mnPools');\n return mnPools.get().then(function (pools) {\n return pools.isInitialized ? true : $state.target(\"app.wizard.welcome\");\n }, function (resp) {\n switch (resp.status) {\n case 401: return false;\n }\n });\n });\n $transitionsProvider.onBefore({\n from: \"app.wizard.**\",\n to: \"app.admin.**\"\n }, function (trans) {\n var mnPools = trans.injector().get('mnPools');\n return mnPools.getFresh().then(function (pools) {\n return pools.isInitialized;\n });\n });\n\n $transitionsProvider.onBefore({\n from: \"app.admin.cbas|query.**\",\n to: \"app.admin.**\"\n }, function (trans) {\n let mnPoolDefault = trans.injector().get('mnPoolDefault');\n mnPoolDefault.setHideNavSidebar(false);\n });\n\n $transitionsProvider.onStart({\n to: function (state) {\n return state.data && state.data.permissions;\n }\n }, function (trans) {\n var mnPermissions = trans.injector().get('mnPermissions');\n var $parse = trans.injector().get('$parse');\n return mnPermissions.check().then(function() {\n if ($parse(trans.to().data.permissions)(mnPermissions.export)) {\n return true;\n } else {\n return trans.router.stateService.target('app.admin.overview.statistics');\n }\n });\n });\n $transitionsProvider.onStart({\n to: function (state) {\n return state.data && state.data.compat;\n }\n }, function (trans) {\n var mnPoolDefault = trans.injector().get('mnPoolDefault');\n var $parse = trans.injector().get('$parse');\n return mnPoolDefault.get().then(function() {\n if ($parse(trans.to().data.compat)(mnPoolDefault.export.compat)) {\n return true;\n } else {\n return trans.router.stateService.target('app.admin.overview.statistics');\n }\n });\n });\n $transitionsProvider.onStart({\n to: function (state) {\n return state.data && state.data.enterprise;\n }\n }, function (trans) {\n var mnPools = trans.injector().get('mnPools');\n return mnPools.get().then(function (pools) {\n if (pools.isEnterprise) {\n return true;\n } else {\n return trans.router.stateService.target('app.admin.overview.statistics');\n }\n });\n });\n}\n", "/*\nCopyright 2016-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from 'angular';\n\nexport default 'mnEnv';\n\n/**\n * Service supporting access to UI applicable environment variables.\n */\nangular\n .module('mnEnv', [])\n .factory('mnEnv', [\"$http\", mnEnvFactory]);\n\nfunction mnEnvFactory($http) {\n\n var envUrl = '/_uiEnv';\n var envDefaults = {\n disable_autocomplete: true\n };\n return {\n loadEnv: loadEnv\n };\n\n /**\n * Invokes the server side REST API and returns a promise that fulfills\n * with a JSON object that fulfills with the complete set of environment\n * variables.\n * @returns Promise\n */\n function loadEnv() {\n return $http({method: 'GET', url: envUrl, cache: true}).then(\n function (resp) {\n return angular.extend({}, envDefaults, resp.data);\n });\n }\n}\n", "/*\nCopyright 2015-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from 'angular';\nimport _ from 'lodash';\n\nimport mnFilters from './mn_filters.js';\nimport mnPendingQueryKeeper from './mn_pending_query_keeper.js';\n\nexport default 'mnHttp';\n\nangular\n .module('mnHttp', [mnPendingQueryKeeper, mnFilters])\n .factory('mnHttpInterceptor', [\"mnPendingQueryKeeper\", \"$q\", \"$timeout\", \"jQueryLikeParamSerializerFilter\", \"$exceptionHandler\", mnHttpFactory])\n .config([\"$httpProvider\", function ($httpProvider) {\n $httpProvider.interceptors.push('mnHttpInterceptor');\n }]);\n\nfunction mnHttpFactory(mnPendingQueryKeeper, $q, $timeout, jQueryLikeParamSerializerFilter, $exceptionHandler) {\n var myHttpInterceptor = {\n request: request,\n response: response,\n responseError: responseError\n };\n\n return myHttpInterceptor;\n\n function request(config) {\n if (config.url.indexOf(\".html\") !== -1 || config.doNotIntercept) {\n return config;\n } else {\n return intercept(config);\n }\n }\n function intercept(config) {\n var pendingQuery = {\n config: _.clone(config)\n };\n var mnHttpConfig = config.mnHttp || {};\n delete config.mnHttp;\n if (config.method.toLowerCase() === \"post\" && mnHttpConfig.cancelPrevious) {\n var queryInFly = mnPendingQueryKeeper.getQueryInFly(config);\n queryInFly && queryInFly.canceler();\n }\n var canceler = $q.defer();\n var timeoutID;\n var timeout = config.timeout;\n var isCleared;\n\n function clear() {\n if (isCleared) {\n return;\n }\n isCleared = true;\n timeoutID && $timeout.cancel(timeoutID);\n mnPendingQueryKeeper.removeQueryInFly(pendingQuery);\n }\n\n function cancel(reason) {\n return function () {\n canceler.resolve(reason);\n clear();\n };\n }\n\n switch (config.method.toLowerCase()) {\n case 'post':\n case 'put':\n config.headers = config.headers || {};\n if (!mnHttpConfig.isNotForm) {\n config.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\n if (!angular.isString(config.data)) {\n config.data = jQueryLikeParamSerializerFilter(config.data);\n }\n }\n break;\n }\n\n config.timeout = canceler.promise;\n config.clear = clear;\n\n pendingQuery.canceler = cancel(\"cancelled\");\n pendingQuery.group = mnHttpConfig.group;\n mnPendingQueryKeeper.push(pendingQuery);\n\n if (timeout) {\n timeoutID = $timeout(cancel(\"timeout\"), timeout);\n }\n return config;\n }\n\n\n function clearOnResponse(response) {\n if (response.config &&\n response.config.clear && angular.isFunction(response.config.clear)) {\n response.config.clear();\n delete response.config.clear;\n }\n }\n\n function response(response) {\n clearOnResponse(response);\n return response;\n }\n function responseError(response) {\n if (response instanceof Error) {\n $exceptionHandler(response);\n }\n clearOnResponse(response);\n return $q.reject(response);\n }\n}\n", "/*\nCopyright 2015-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from 'angular';\nimport _ from 'lodash';\nimport {Rejection} from '@uirouter/core';\n\nexport default 'mnExceptionReporter';\n\nangular\n .module(\"mnExceptionReporter\", [])\n .config([\"$provide\", mnExceptionReporterConfig]);\n\nfunction mnExceptionReporterConfig($provide) {\n $provide.decorator('$exceptionHandler', [\"$delegate\", \"$injector\", mnExceptionReporter])\n}\n\nfunction mnExceptionReporter($delegate, $injector) {\n var errorReportsLimit = 8;\n var sentReports = 0;\n\n // TransitionRejection types\n // 2 \"SUPERSEDED\";\n // 3 \"ABORTED\";\n // 4 \"INVALID\";\n // 5 \"IGNORED\";\n // 6 \"ERROR\";\n return function (exception, cause) {\n if (\n exception instanceof Rejection &&\n (exception.type === 2 || exception.type === 3 || exception.type === 5 ||\n (exception.type === 6 && !exception.detail && !exception.cause))\n ) {\n return; //we are not interested in these Rejection exceptions;\n }\n exception.cause = cause;\n send(exception);\n $delegate(exception, cause);\n };\n\n function formatErrorMessage(exception) {\n var error = [\"Got unhandled javascript error:\\n\"];\n angular.forEach([\"name\", \"message\", \"fileName\", \"lineNumber\", \"columnNumber\", \"stack\"], function (property) {\n if (exception[property]) {\n error.push(property + \": \" + exception[property] + \";\\n\");\n }\n });\n return error;\n }\n\n function send(exception) {\n let has = Object.prototype.hasOwnProperty;\n if (has.call(exception, \"config\") &&\n has.call(exception, \"headers\") &&\n has.call(exception, \"status\") &&\n has.call(exception, \"statusText\")) {\n return; //we are not interested in http exception;\n }\n var error;\n if (sentReports < errorReportsLimit) {\n sentReports++;\n error = formatErrorMessage(exception);\n if (sentReports == errorReportsLimit - 1) {\n error.push(\"Further reports will be suppressed\\n\");\n }\n }\n // mozilla can report errors in some cases when user leaves current page\n // so delay report sending\n if (error) {\n _.delay(function () {\n $injector.get(\"$http\")({\n method: \"POST\",\n url: \"/logClientError\",\n data: error.join(\"\")\n });\n }, 500);\n }\n }\n}\n", "/*\nCopyright 2015-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from 'angular';\nimport uiRouter from '@uirouter/angularjs';\nimport {upgradeModule} from '@uirouter/angular-hybrid';\nimport oclazyLoad from 'oclazyload';\nimport ngSanitize from 'angular-sanitize';\nimport ngAnimate from 'angular-animate';\nimport uiBootstrap from 'angular-ui-bootstrap';\n\nimport mnAdmin from './mn_admin/mn_admin_config.js';\nimport mnAppConfig from './app_config.js';\nimport mnPools from './components/mn_pools.js';\nimport mnEnv from './components/mn_env.js';\nimport mnFilters from './components/mn_filters.js';\nimport mnHttp from './components/mn_http.js';\nimport mnExceptionReporter from './components/mn_exception_reporter.js';\nimport {\n daysOfWeek,\n knownAlerts,\n timeUnitToSeconds,\n docsLimit,\n docBytesLimit,\n viewsPerPageLimit,\n IEC\n} from './constants/constants.js';\n\nexport default 'app';\n\nangular.module('app', [\n upgradeModule.name,\n oclazyLoad,\n mnPools,\n mnEnv,\n mnHttp,\n mnFilters,\n mnExceptionReporter,\n ngAnimate,\n ngSanitize,\n uiRouter,\n uiBootstrap,\n mnAdmin\n]).config(mnAppConfig)\n .constant(\"daysOfWeek\", daysOfWeek)\n .constant(\"knownAlerts\", knownAlerts)\n .constant(\"timeUnitToSeconds\", timeUnitToSeconds)\n .constant(\"docsLimit\", docsLimit)\n .constant(\"docBytesLimit\", docBytesLimit)\n .constant(\"viewsPerPageLimit\", viewsPerPageLimit)\n .constant(\"IEC\", IEC)\n .run([\"$state\", \"$urlRouter\", \"$exceptionHandler\", \"mnPools\", \"$window\", \"$rootScope\", appRun]);\n\nfunction appRun($state, $urlRouter, $exceptionHandler, mnPools, $window, $rootScope) {\n\n angular.element($window).on(\"storage\", function (storage) {\n if (storage.key === \"mnLogIn\") {\n mnPools.clearCache();\n $urlRouter.sync();\n }\n });\n\n var originalOnerror = $window.onerror;\n $window.onerror = onError;\n function onError(message, url, lineNumber, columnNumber, exception) {\n $exceptionHandler({\n message: message,\n fileName: url,\n lineNumber: lineNumber,\n columnNumber: columnNumber,\n stack: exception && exception.stack\n });\n originalOnerror && originalOnerror.apply($window, Array.prototype.slice.call(arguments));\n }\n\n\n $rootScope.mnTitle = \"Couchbase Server\";\n\n $state.defaultErrorHandler(function (error) {\n error && $exceptionHandler(error);\n });\n}\n", "import pluggableUI_n1ql from \"./_p/ui/query/ui-current/main.js\";\nexport {pluggableUI_n1ql}\nimport pluggableUI_fts from \"./_p/ui/fts/./main.js\";\nexport {pluggableUI_fts}\nimport pluggableUI_cbas from \"./_p/ui/cbas/./main.js\";\nexport {pluggableUI_cbas}\nimport pluggableUI_backup from \"./_p/ui/backup/ui-current/main.js\";\nexport {pluggableUI_backup}\nimport pluggableUI_eventing from \"./_p/ui/event/ui-current/main.js\";\nexport {pluggableUI_eventing}\n", "/*\nCopyright 2020-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from \"angular\";\nimport app from \"app\";\nimport { mnLoadNgModule, mnLazyload } from \"mn.app.imports\";\nimport ace from 'ace/ace-wrapper';\n\nimport { NgModule } from '@angular/core';\nimport { UIRouterUpgradeModule } from '@uirouter/angular-hybrid';\n\nimport { QwDirectivesModule } from \"../angular-directives/qw.directives.module.js\";\nimport {QwCollectionMenu} from \"../angular-directives/qw.collection.menu.component.js\";\n\nangular\n .module(app)\n .config(function (mnPluggableUiRegistryProvider, mnPermissionsProvider) {\n mnPermissionsProvider.set(\"cluster.collection[.:.:.].data.docs!read\"); // needed for Documents and Query\n mnPermissionsProvider.set(\"cluster.collection[.:.:.].data.docs!upsert\"); // needed for Import\n mnPermissionsProvider.set(\"cluster.collection[.:.:.].collections!read\"); // needed for Documents\n mnPermissionsProvider.set(\"cluster.collection[.:.:.].n1ql.select!execute\");\n mnPermissionsProvider.set(\"cluster.collection[.:.:.].n1ql.index!all\");\n\n // permissions for UDFs\n mnPermissionsProvider.set(\"cluster.collection[.:.:.].n1ql.udf!manage\");\n mnPermissionsProvider.set(\"cluster.collection[.:.:.].n1ql.udf_external!manage\");\n mnPermissionsProvider.set(\"cluster.n1ql.udf!manage\");\n mnPermissionsProvider.set(\"cluster.n1ql.udf_external!manage\");\n\n ace.config.set('basePath','/ui/libs/ace');\n\n // Angular8 version of the DocEditor\n mnPluggableUiRegistryProvider.registerConfig({\n name: 'Documents',\n state: 'app.admin.docs.editor',\n includedByState: 'app.admin.docs',\n plugIn: 'workbenchTab',\n ngShow: \"rbac.cluster.collection['.:.:.'].data.docs.read\",\n index: 0\n });\n\n // Angular8 Workbench\n mnPluggableUiRegistryProvider.registerConfig({\n name: 'Query',\n state: 'app.admin.query.workbench',\n includedByState: 'app.admin.query',\n plugIn: 'workbenchTab',\n ngShow: \"rbac.cluster.collection['.:.:.'].data.docs.read\",\n index: 1\n });\n\n mnPermissionsProvider.set(\"cluster.n1ql.meta!read\"); // system catalogs\n\n mnPermissionsProvider.setBucketSpecific(function (name) {\n return [\n \"cluster.bucket[\" + name + \"].n1ql.select!execute\",\n \"cluster.bucket[\" + name + \"].data.docs!upsert\",\n \"cluster.bucket[\" + name + \"].data.xattr!read\"\n ]\n });\n });\n\nclass QueryUI {\n static get annotations() { return [\n new NgModule({\n imports: [\n QwDirectivesModule,\n UIRouterUpgradeModule.forRoot({\n states: [\n {\n name: \"app.admin.docs.**\",\n url: \"/docs\",\n lazyLoad: mnLoadNgModule(() => import(\"../angular-components/documents/qw.documents.module.js\"),\n \"QwDocumentsModule\")\n }, {\n name: \"app.admin.query.**\",\n url: \"/query\",\n lazyLoad: mnLoadNgModule(() => import(\"../angular-component-wrappers/qw.wrapper.module.js\"),\n \"QwWrapperModule\")\n },\n ]\n })\n ],\n providers: [\n ],\n entryComponents: [\n ]\n })\n ]}\n}\n\nexport default QueryUI;\n", "/*\nCopyright 2020-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from \"angular\";\nimport app from \"app\";\nimport mnElementCrane from \"components/directives/mn_element_crane/mn_element_crane\";\nimport { mnLazyload } from \"mn.app.imports\";\n\nimport { NgModule } from '@angular/core';\nimport { UIRouterUpgradeModule } from '@uirouter/angular-hybrid';\n\nangular\n .module(app)\n .config(function (mnPluggableUiRegistryProvider, mnPermissionsProvider) {\n mnPluggableUiRegistryProvider.registerConfig({\n name: 'Search',\n state: 'app.admin.search.fts_list',\n plugIn: 'workbenchTab',\n index: 2,\n responsiveHide: true,\n includedByState: 'app.admin.search',\n ngShow: 'rbac.cluster.settings.fts.read'\n });\n\n ([\"cluster.settings.fts!read\", \"cluster.settings.fts!write\"])\n .forEach(mnPermissionsProvider.set);\n\n mnPermissionsProvider.setBucketSpecific(function(name) {\n return [\n \"cluster.bucket[\" + name + \"].fts!write\",\n \"cluster.bucket[\" + name + \"].data!read\"\n ];\n });\n });\n\nclass FtsUI {\n static get annotations() { return [\n new NgModule({\n imports: [\n UIRouterUpgradeModule.forRoot({\n states: [{\n name: \"app.admin.search.**\",\n url: \"/fts\",\n lazyLoad: mnLazyload(() => import('./fts.js'), 'fts')\n }]\n })\n ]\n })\n ]}\n}\n\nexport default FtsUI;\n", "/*\nCopyright 2020-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport angular from \"angular\";\nimport app from \"app\";\nimport ace from 'ace/ace-wrapper';\nimport { mnLazyload } from \"mn.app.imports\";\n\nimport { NgModule } from '@angular/core';\nimport { UIRouterUpgradeModule } from '@uirouter/angular-hybrid';\n\nimport { QwCollectionMenu } from \"../query/angular-directives/qw.collection.menu.component.js\";\nimport { QwJsonDataTableComp } from \"../query/angular-directives/qw.json.datatable.directive.js\";\nimport { QwExplainViz } from \"../query/angular-directives/qw.explain.viz.component.js\";\nimport { QwDialogService } from \"../query/angular-directives/qw.dialog.service.js\";\n\nimport { QwCollectionsService } from \"../query/angular-services/qw.collections.service.js\";\nimport { QwQueryPlanService } from \"../query/angular-services/qw.query.plan.service.js\";\n\nangular\n .module(app)\n .config([\"mnPluggableUiRegistryProvider\", \"mnPermissionsProvider\", function (mnPluggableUiRegistryProvider, mnPermissionsProvider) {\n\n ace.config.set('basePath','/ui/libs/ace');\n\n mnPluggableUiRegistryProvider.registerConfig({\n name: 'Analytics',\n includedByState: 'app.admin.cbas',\n state: 'app.admin.cbas.workbench',\n plugIn: 'workbenchTab',\n ngShow: \"rbac.cluster.collection['.:.:.'].analytics.select || rbac.cluster.analytics.manage\",\n index: 3\n });\n\n mnPermissionsProvider.setBucketSpecific(function (name) {\n return [\n \"cluster.collection[\" + name + \":.:.].analytics!select\", \"cluster.analytics!manage\"\n ]\n })\n\n }]);\n\nclass CbasUI {\n static get annotations() { return [\n new NgModule({\n imports: [\n UIRouterUpgradeModule.forRoot({\n states: [{\n name: \"app.admin.cbas.**\",\n url: \"/cbas\",\n lazyLoad: mnLazyload(() => import('./cbas.js'), 'cwCbas')\n }]\n })\n ],\n // because the Analytics Workbench is still AngularJS, yet relies on\n // downgradeInjectable versions of the following Angular services,\n // we need to list them as providers here to ensure that they are loaded.\n // otherwise we get \"missing provider\" errors when reloading the UI\n providers: [\n QwCollectionsService,\n QwDialogService,\n QwQueryPlanService,\n ],\n entryComponents: [\n QwCollectionMenu,\n QwExplainViz,\n QwJsonDataTableComp,\n ]\n })\n ]}\n}\n\nexport default CbasUI;\n", "import angular from 'angular';\nimport app from 'app';\nimport { mnLoadNgModule } from 'mn.app.imports';\n\nimport { NgModule } from '@angular/core';\nimport { UIRouterUpgradeModule } from '@uirouter/angular-hybrid';\n\nangular\n .module(app)\n .config((mnPluggableUiRegistryProvider, mnPermissionsProvider) => {\n mnPermissionsProvider.set('cluster.admin.internal!all');\n mnPluggableUiRegistryProvider.registerConfig({\n name: 'Backup',\n state: 'app.admin.backup',\n plugIn: 'adminTab',\n ngShow: 'rbac.cluster.backup.all',\n after: 'buckets',\n responsiveHide: true,\n });\n });\n\nclass BackupUI {\n static get annotations() {\n return [\n new NgModule({\n imports: [\n UIRouterUpgradeModule.forRoot({\n states: [{\n name: 'app.admin.backup.**',\n url: '/backup',\n lazyLoad: mnLoadNgModule(() => import('./backup.js'), 'BackupModule'),\n }],\n }),\n ],\n }),\n ];\n }\n}\n\nexport default BackupUI;\n", "import angular from \"angular\";\nimport app from \"app\";\nimport { mnLazyload } from \"mn.app.imports\";\n\nimport { NgModule } from '@angular/core';\nimport { UIRouterUpgradeModule } from '@uirouter/angular-hybrid';\n\nangular\n .module(app)\n .config([\"mnPluggableUiRegistryProvider\", \"mnPermissionsProvider\", function(mnPluggableUiRegistryProvider, mnPermissionsProvider) {\n mnPermissionsProvider.set(\n \"cluster.collection[.:.:.].eventing.function!manage\");\n mnPluggableUiRegistryProvider.registerConfig({\n name: 'Eventing',\n state: 'app.admin.eventing.summary',\n plugIn: 'workbenchTab',\n ngShow: \"rbac.cluster.collection['.:.:.'].eventing.function.manage\",\n index: 4,\n responsiveHide: true\n });\n }]);\n\nclass EventingUI {\n static get annotations() {\n return [\n new NgModule({\n imports: [\n UIRouterUpgradeModule.forRoot({\n states: [{\n name: \"app.admin.eventing.**\",\n url: \"/eventing\",\n lazyLoad: mnLazyload(() => import('./eventing.js'),\n 'eventing')\n }]\n })\n ]\n })\n ]\n }\n}\n\nexport default EventingUI;\n", "/*\nCopyright 2020-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport {CommonModule} from '@angular/common';\nimport {BrowserModule} from '@angular/platform-browser';\nimport {HttpClientModule} from '@angular/common/http';\nimport {UIRouterModule, loadNgModule} from '@uirouter/angular';\nimport {Rejection} from '@uirouter/core';\nimport {UIRouterUpgradeModule} from '@uirouter/angular-hybrid';\n\nimport {MnPipesModule} from './mn.pipes.module.js';\nimport {MnSharedModule} from './mn.shared.module.js';\nimport {MnElementCraneModule} from './mn.element.crane.js';\nimport * as pluggableUIsModules from '../../pluggable-uis.js';\nimport {MnKeyspaceSelectorModule} from './mn.keyspace.selector.module.js';\nimport {MnHelper} from './ajs.upgraded.providers.js';\n\nlet wizardState = {\n name: 'app.wizard.**',\n lazyLoad: mnLoadNgModule(() => import('./mn.wizard.module.js'), 'MnWizardModule')\n};\n\nlet collectionsState = {\n name: 'app.admin.collections.**',\n url: '/collections',\n lazyLoad: mnLoadNgModule(() => import('./mn.collections.module.js'), 'MnCollectionsModule')\n};\n\nlet XDCRState = {\n name: 'app.admin.replications.**',\n url: '/replications',\n lazyLoad: mnLoadNgModule(() => import('./mn.xdcr.module.js'), \"MnXDCRModule\")\n};\n\nlet otherSecuritySettingsState = {\n name: 'app.admin.security.other.**',\n url: '/other',\n lazyLoad: mnLoadNgModule(() => import('./mn.security.other.module.js'), 'MnSecurityOtherModule')\n};\n\nlet auditState = {\n name: 'app.admin.security.audit.**',\n url: '/audit',\n lazyLoad: mnLoadNgModule(() => import('./mn.security.audit.module.js'), 'MnSecurityAuditModule')\n};\n\nlet overviewState = {\n name: 'app.admin.overview.**',\n url: '/overview',\n lazyLoad: mnLazyload(() => import('./mn_admin/mn_overview_controller.js'), 'mnOverview')\n};\n\nlet serversState = {\n name: 'app.admin.servers.**',\n url: '/servers',\n lazyLoad: mnLazyload(() => import('./mn_admin/mn_servers_controller.js'), 'mnServers')\n};\n\nlet logsState = {\n name: 'app.admin.logs.**',\n url: '/logs',\n lazyLoad: mnLoadNgModule(() => import('./mn.logs.module.js'), 'MnLogsModule')\n};\n\nlet logsListState = {\n name: \"app.admin.logs.list.**\",\n url: \"\",\n lazyLoad: mnLoadNgModule(() => import('./mn.logs.list.module.js'), \"MnLogsListModule\")\n};\n\nlet logsCollectInfo = {\n name: \"app.admin.logs.collectInfo.**\",\n url: \"/collectInfo\",\n lazyLoad: mnLoadNgModule(() => import('./mn.logs.collectInfo.module.js'), \"MnLogsCollectInfoModule\")\n}\n\nlet groupsState = {\n name: 'app.admin.groups.**',\n url: '/groups',\n lazyLoad: mnLazyload(() => import('./mn_admin/mn_groups_controller.js'), 'mnGroups')\n};\n\nlet bucketsState = {\n name: 'app.admin.buckets.**',\n url: '/buckets',\n lazyLoad: mnLoadNgModule(() => import('./mn.buckets.module.js'), 'MnBucketsModule')\n};\n\nlet authState = {\n name: \"app.auth.**\",\n lazyLoad: mnLoadNgModule(() => import('./mn.auth.module.js'), 'MnAuthModule')\n};\n\nlet gsiState = {\n name: \"app.admin.gsi.**\",\n url: \"/index\",\n lazyLoad: mnLazyload(() => import('./mn_admin/mn_gsi_controller.js'), 'mnGsi')\n};\n\nlet viewsState = {\n name: \"app.admin.views.**\",\n url: \"/views\",\n lazyLoad: mnLoadNgModule(() => import('./mn.views.module.js'), \"MnViewsModule\")\n};\n\nlet settingsState = {\n name: \"app.admin.settings.**\",\n url: \"/settings\",\n lazyLoad: mnLazyload(() => import('./mn_admin/mn_settings_config.js'), \"mnSettings\")\n};\n\nlet sampleBucketState = {\n name: 'app.admin.settings.sampleBuckets.**',\n url: '/sampleBuckets',\n lazyLoad: mnLoadNgModule(() => import('./mn.settings.sample.buckets.module.js'), 'MnSettingsSampleBucketsModule')\n};\n\nlet alertsState = {\n name: \"app.admin.settings.alerts.**\",\n url: \"/alerts\",\n lazyLoad: mnLoadNgModule(() => import('./mn.settings.alerts.module.js'), \"MnSettingsAlertsModule\")\n};\n\nlet autoCompactionState = {\n name: 'app.admin.settings.autoCompaction.**',\n url: '/autoCompaction',\n lazyLoad: mnLoadNgModule(() => import('./mn.settings.auto.compaction.module.js'), 'MnSettingsAutoCompactionModule')\n}\n\nlet securityState = {\n name: \"app.admin.security.**\",\n url: \"/security\",\n lazyLoad: mnLazyload(() => import('./mn_admin/mn_security_config.js'), \"mnSecurity\")\n};\n\nfunction rejectTransition() {\n return Promise.reject(Rejection.superseded(\"Lazy loading has been suppressed by another transition\"));\n}\n\nfunction ocLazyLoad($transition$, module, initialHref) {\n return $transition$\n .injector()\n .get('$ocLazyLoad')\n .load({name: module})\n .then(result => {\n let postLoadHref = window.location.href;\n return initialHref === postLoadHref ? result : rejectTransition();\n });\n}\n\nfunction mnLazyload(doImport, module) {\n return ($transition$) => {\n let initialHref = window.location.href;\n\n let mnHelper = $transition$.injector().get('mnHelper');\n mnHelper.mainSpinnerCounter.increase();\n\n return (typeof doImport == \"function\" ? doImport() : import(doImport)).then(() => {\n let postImportHref = window.location.href;\n\n return initialHref === postImportHref ?\n ocLazyLoad($transition$, module, initialHref) :\n rejectTransition();\n\n }).finally(() => mnHelper.mainSpinnerCounter.decrease());\n };\n}\n\nfunction mnLoadNgModule(doImport, module) {\n return (transition, stateObject) => {\n let initialHref = window.location.href;\n\n let mnHelper = transition.injector().get(MnHelper);\n mnHelper.mainSpinnerCounter.increase();\n\n let lazyLoadFn = loadNgModule(() =>\n (typeof doImport == \"function\" ? doImport() : import(doImport)).then(result => {\n let postImportHref = window.location.href;\n return initialHref === postImportHref ? result[module] : rejectTransition();\n }));\n\n return lazyLoadFn(transition, stateObject).then(result => {\n let postLoadHref = window.location.href;\n return initialHref === postLoadHref ? result : rejectTransition();\n\n }).finally(() => mnHelper.mainSpinnerCounter.decrease());\n };\n}\n\nlet mnAppImports = [\n ...Object.values(pluggableUIsModules),\n UIRouterModule,\n MnPipesModule,\n BrowserModule,\n CommonModule,\n HttpClientModule,\n MnSharedModule,\n MnElementCraneModule,\n UIRouterUpgradeModule.forRoot({\n states: [\n authState,\n wizardState,\n overviewState,\n serversState,\n bucketsState,\n logsState,\n logsListState,\n logsCollectInfo,\n alertsState,\n groupsState,\n gsiState,\n viewsState,\n settingsState,\n sampleBucketState,\n autoCompactionState,\n securityState,\n collectionsState,\n XDCRState,\n otherSecuritySettingsState,\n auditState\n ]\n }),\n\n //downgradedModules\n MnKeyspaceSelectorModule\n];\n\nexport {mnAppImports, mnLoadNgModule, mnLazyload};\n", "/*\nCopyright 2020-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient, HttpErrorResponse} from '@angular/common/http';\nimport {Subject} from 'rxjs'\nimport {take, filter, map} from 'rxjs/operators';\nimport {Rejection} from '@uirouter/core';\n\nimport {singletonGuard} from './mn.core.js';\n\nexport {MnExceptionHandlerService};\n\nclass MnExceptionHandlerService {\n static get annotations() { return [\n new Injectable()\n ]}\n\n static get parameters() { return [\n HttpClient\n ]}\n\n constructor(http) {\n singletonGuard(MnExceptionHandlerService);\n\n this.stream = {};\n this.http = http;\n this.errorReportsLimit = 8;\n\n this.stream.appError = new Subject();\n\n this.stream.appException = this.stream.appError.pipe(\n filter(this.filterException.bind(this)),\n take(this.errorReportsLimit),\n map(this.formatErrorMessage.bind(this))\n );\n\n // uiRouter.stateService.defaultErrorHandler(this.handleError.bind(this));\n }\n\n handleError(exception) {\n console.error(exception);\n this.stream.appError.next(exception);\n }\n\n activate() {\n this.stream.appException.subscribe(this.send.bind(this));\n }\n\n deactivate() {\n this.stream.appException.unsubscribe();\n }\n\n send(error) {\n return this.http.post(\"/logClientError\", error);\n }\n\n // TransitionRejection types\n // 2 \"SUPERSEDED\";\n // 3 \"ABORTED\";\n // 4 \"INVALID\";\n // 5 \"IGNORED\";\n // 6 \"ERROR\";\n filterException(exception) {\n return !(exception instanceof HttpErrorResponse) &&\n //we are not interested in these Rejection exceptions;\n !(exception instanceof Rejection &&\n (exception.type === 2 || exception.type === 3 || exception.type === 5));\n }\n\n formatErrorMessage(exception, index) {\n let error = [\"Got unhandled javascript error:\\n\"];\n let props = [\"name\", \"message\", \"fileName\", \"lineNumber\", \"columnNumber\", \"stack\", \"detail\"];\n props.forEach(function (property) {\n if (exception[property]) {\n error.push(property + \": \" + exception[property] + \";\\n\");\n }\n });\n if ((index + 1) === this.errorReportsLimit) {\n error.push(\"Further reports will be suppressed\\n\");\n }\n return error.join(\"\");\n }\n}\n", "/*\nCopyright 2020-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\n\n// app import should go first in order to load AngularJS before\nimport app from './app.js';\n\nimport {NgModule, ErrorHandler} from '@angular/core';\nimport {HTTP_INTERCEPTORS} from '@angular/common/http';\nimport {UpgradeModule, setAngularJSGlobal} from '@angular/upgrade/static';\nimport angular from 'angular';\nsetAngularJSGlobal(angular);\n\nimport {NgbModalConfig} from '@ng-bootstrap/ng-bootstrap';\nimport {ClipboardService} from 'ngx-clipboard';\n\nimport {mnAppImports} from './mn.app.imports.js';\nimport {MnHttpInterceptor} from './mn.http.interceptor.js';\n\nimport {ajsUpgradedProviders} from './ajs.upgraded.providers.js';\nimport {MnAppService} from './mn.app.service.js';\nimport {MnTasksService} from './mn.tasks.service.js';\nimport {MnSecurityService} from './mn.security.service.js';\nimport {MnServerGroupsService} from './mn.server.groups.service.js';\nimport {MnFormService} from './mn.form.service.js';\nimport {MnExceptionHandlerService} from './mn.exception.handler.service.js';\nimport {MnCollectionsService} from './mn.collections.service.js';\nimport {MnSettingsSampleBucketsService} from './mn.settings.sample.buckets.service.js';\nimport {MnKeyspaceSelectorService} from './mn.keyspace.selector.service.js';\nimport {MnHelperService} from './mn.helper.service.js';\nimport {MnSettingsAutoCompactionService} from './mn.settings.auto.compaction.service.js';\nimport {MnAuthService} from './mn.auth.service.js';\nimport {MnElementCraneService} from './mn.element.crane.js';\nimport {MnBucketsService} from './mn.buckets.service.js';\nimport {MnWizardService} from './mn.wizard.service.js';\nimport {MnLogsCollectInfoService} from './mn.logs.collectInfo.service.js';\nimport {MnPermissionsService} from './mn.permissions.service.js';\nimport {MnUserRolesService} from './mn.user.roles.service.js';\nimport {MnPoolsService} from './mn.pools.service.js';\nimport {MnAdminService} from './mn.admin.service.js';\nimport {MnAlertsService} from './mn.alerts.service.js';\nimport {MnXDCRService} from \"./mn.xdcr.service.js\";\nimport {MnStatsService} from './mn.stats.service.js';\nimport {MnSettingsAlertsService} from './mn.settings.alerts.service.js';\nimport {MnLogsListService} from './mn.logs.list.service.js';\nimport {MnSessionService} from './mn.session.service.js';\nimport {MnViewsListService} from './mn.views.list.service.js';\nimport {MnViewsEditingService} from './mn.views.editing.service.js';\nimport {MnRouterService} from './mn.router.service.js';\nimport {MnDocumentsService} from './mn.documents.service.js';\n\n\nexport {MnAppModule};\n\nclass MnAppModule {\n static get annotations() { return [\n new NgModule({\n declarations: [\n\n ],\n entryComponents: [\n\n ],\n imports: mnAppImports,\n // bootstrap: [\n // UIView\n // ],\n providers: [\n ...ajsUpgradedProviders,\n ClipboardService,\n MnAppService,\n MnTasksService,\n MnSecurityService,\n MnServerGroupsService,\n MnFormService,\n MnExceptionHandlerService,\n MnCollectionsService,\n MnSettingsSampleBucketsService,\n MnKeyspaceSelectorService,\n MnHelperService,\n MnSettingsAutoCompactionService,\n MnAuthService,\n MnElementCraneService,\n MnBucketsService,\n MnWizardService,\n MnLogsCollectInfoService,\n MnPermissionsService,\n MnUserRolesService,\n MnPoolsService,\n MnAdminService,\n MnAlertsService,\n MnXDCRService,\n MnStatsService,\n MnSettingsAlertsService,\n MnLogsListService,\n MnSessionService,\n MnViewsListService,\n MnViewsEditingService,\n MnRouterService,\n MnDocumentsService,\n {\n provide: HTTP_INTERCEPTORS,\n useClass: MnHttpInterceptor,\n multi: true\n }, {\n provide: ErrorHandler,\n useClass: MnExceptionHandlerService\n },\n NgbModalConfig\n ]\n })\n ]}\n\n static get parameters() {return [\n UpgradeModule,\n NgbModalConfig\n ]}\n\n ngDoBootstrap() {\n this.upgrade.bootstrap(document, [app], { strictDi: false });\n }\n\n constructor(upgrade, ngbModalConfig) {\n this.upgrade = upgrade;\n ngbModalConfig.backdrop = \"static\";\n }\n\n}\n", "/*\nCopyright 2019-Present Couchbase, Inc.\n\nUse of this software is governed by the Business Source License included in\nthe file licenses/BSL-Couchbase.txt. As of the Change Date specified in that\nfile, in accordance with the Business Source License, use of this software will\nbe governed by the Apache License, Version 2.0, included in the file\nlicenses/APL2.txt.\n*/\nimport angular from 'angular';\n\nimport {NgZone} from '@angular/core';\nimport {platformBrowserDynamic} from '@angular/platform-browser-dynamic';\nimport {UIRouter} from '@uirouter/core';\n\nimport {MnAppModule} from './mn.app.module.js';\n\nplatformBrowserDynamic().bootstrapModule(MnAppModule, {preserveWhitespaces: true}).then(platformRef => {\n const urlService = platformRef.injector.get(UIRouter).urlService;\n // Instruct UIRouter to listen to URL changes\n function startUIRouter() {\n urlService.listen();\n urlService.sync();\n }\n platformRef.injector.get(NgZone).run(startUIRouter);\n});\n"],
"mappings": "+qJAmBA,GAAI,cAAe,oBAAsB,cACrC,SAAU,eACd,GAAI,CAAC,SACD,KAAM,IAAI,OAAM,kHAQpB,GAAI,eAAgB,SAAQ,OAAO,oBAAqB,CAAC,cACzD,wBAAyB,CACrB,MAAO,GADF,sCAqET,GAAI,iBAAiC,UAAY,CAC7C,0BAAyB,IAAK,OAAQ,SACpC,CAME,GAAI,SAAU,SACT,QAAQ,IAAI,eACZ,SACA,SAGL,OAAO,eAAe,OAAQ,UAAW,CACrC,IAAK,UAAY,CACb,GAAI,MAAO,QAAQ,cAAiB,WACpC,MAAO,OAAQ,KAAK,KAAO,KAAK,KAAK,SAAS,SAAW,SAAS,QAEtE,WAAY,KAEhB,OAAO,eAAe,OAAQ,MAAO,CACjC,IAAK,UAAY,CACb,GAAI,MAAO,QAAQ,cAAiB,WACpC,MAAO,OAAQ,KAAK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