@spinnaker/kayenta 2.3.0 → 2025.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"lazy-c9b39d81.js","sources":["../../../src/kayenta/layout/table/tableHeader.tsx","../../../src/kayenta/layout/table/table.tsx","../../node_modules/redux/es/compose.js","../../node_modules/redux/es/applyMiddleware.js","../../../src/kayenta/report/detail/graph/semiotic/index.tsx","../../node_modules/redux-logger/dist/redux-logger.js","../../node_modules/rxjs/util/root.js","../../node_modules/rxjs/util/isFunction.js","../../node_modules/rxjs/util/isArray.js","../../node_modules/rxjs/util/isObject.js","../../node_modules/rxjs/util/tryCatch.js","../../node_modules/rxjs/util/errorObject.js","../../node_modules/rxjs/util/UnsubscriptionError.js","../../node_modules/rxjs/Subscription.js","../../node_modules/rxjs/Observer.js","../../node_modules/rxjs/symbol/rxSubscriber.js","../../node_modules/rxjs/Subscriber.js","../../node_modules/rxjs/util/toSubscriber.js","../../node_modules/rxjs/symbol/observable.js","../../node_modules/rxjs/util/noop.js","../../node_modules/rxjs/util/pipe.js","../../node_modules/rxjs/Observable.js","../../node_modules/rxjs/util/ObjectUnsubscribedError.js","../../node_modules/rxjs/SubjectSubscription.js","../../node_modules/rxjs/Subject.js","../../node_modules/rxjs/operators/map.js","../../node_modules/rxjs/operator/map.js","../../node_modules/rxjs/OuterSubscriber.js","../../node_modules/rxjs/util/isArrayLike.js","../../node_modules/rxjs/util/isPromise.js","../../node_modules/rxjs/symbol/iterator.js","../../node_modules/rxjs/InnerSubscriber.js","../../node_modules/rxjs/util/subscribeToResult.js","../../node_modules/rxjs/operators/switchMap.js","../../node_modules/rxjs/operator/switchMap.js","../../node_modules/rxjs/observable/ScalarObservable.js","../../node_modules/rxjs/observable/EmptyObservable.js","../../node_modules/rxjs/util/isScheduler.js","../../node_modules/rxjs/observable/ArrayObservable.js","../../node_modules/rxjs/observable/of.js","../../node_modules/rxjs/observable/PromiseObservable.js","../../node_modules/rxjs/observable/IteratorObservable.js","../../node_modules/rxjs/observable/ArrayLikeObservable.js","../../node_modules/rxjs/Notification.js","../../node_modules/rxjs/operators/observeOn.js","../../node_modules/rxjs/observable/FromObservable.js","../../node_modules/rxjs/observable/from.js","../../node_modules/rxjs/operators/filter.js","../../node_modules/rxjs/operator/filter.js","../../node_modules/redux-observable/lib/es/ActionsObservable.js","../../node_modules/redux-observable/lib/es/EPIC_END.js","../../node_modules/redux-observable/lib/es/createEpicMiddleware.js","../../node_modules/rxjs/operators/mergeMap.js","../../node_modules/rxjs/util/identity.js","../../node_modules/rxjs/operators/mergeAll.js","../../node_modules/rxjs/operators/merge.js","../../node_modules/rxjs/operator/merge.js","../../node_modules/rxjs/observable/merge.js","../../node_modules/redux-observable/lib/es/combineEpics.js","../../node_modules/rxjs/operators/concatAll.js","../../node_modules/rxjs/observable/concat.js","../../node_modules/rxjs/add/observable/concat.js","../../node_modules/rxjs/observable/ForkJoinObservable.js","../../node_modules/rxjs/observable/forkJoin.js","../../node_modules/rxjs/add/observable/forkJoin.js","../../node_modules/rxjs/observable/fromPromise.js","../../node_modules/rxjs/add/observable/fromPromise.js","../../node_modules/rxjs/operators/catchError.js","../../node_modules/rxjs/operator/catch.js","../../node_modules/rxjs/add/operator/catch.js","../../node_modules/rxjs/operators/concatMap.js","../../node_modules/rxjs/operator/concatMap.js","../../node_modules/rxjs/add/operator/concatMap.js","../../node_modules/rxjs/scheduler/Action.js","../../node_modules/rxjs/scheduler/AsyncAction.js","../../node_modules/rxjs/Scheduler.js","../../node_modules/rxjs/scheduler/AsyncScheduler.js","../../node_modules/rxjs/scheduler/async.js","../../node_modules/rxjs/operators/debounceTime.js","../../node_modules/rxjs/operator/debounceTime.js","../../node_modules/rxjs/add/operator/debounceTime.js","../../node_modules/rxjs/add/operator/filter.js","../../node_modules/rxjs/add/operator/map.js","../../node_modules/rxjs/operators/mapTo.js","../../node_modules/rxjs/operator/mapTo.js","../../node_modules/rxjs/add/operator/mapTo.js","../../../src/kayenta/middleware/epics.ts","../../../src/kayenta/service/metricsServiceMetadata.service.ts","../../../src/kayenta/canary.tsx","../../../src/kayenta/middleware/actionInterceptor.ts","../../../src/kayenta/middleware/asyncDispatch.ts","../../../src/kayenta/components/loadStates.tsx","../../../src/kayenta/layout/formattedDate.tsx","../../../src/kayenta/edit/copyConfigButton.tsx","../../../src/kayenta/edit/openConfigJsonModalButton.tsx","../../../src/kayenta/edit/deleteModal.tsx","../../../src/kayenta/edit/openDeleteModalButton.tsx","../../../src/kayenta/edit/configDetailActionButtons.tsx","../../../src/kayenta/edit/configDetailHeader.tsx","../../../src/kayenta/edit/editMetricEffectSizes.tsx","../../../src/kayenta/edit/filterTemplateSelector.tsx","../../../src/kayenta/edit/inlineTemplateEditor.tsx","../../../src/kayenta/edit/metricConfigurerDelegator.tsx","../../../src/kayenta/edit/editMetricModal.tsx","../../../src/kayenta/layout/titledSection.tsx","../../../src/kayenta/edit/changeMetricGroupModal.tsx","../../../src/kayenta/edit/metricList.tsx","../../../src/kayenta/layout/formList.tsx","../../../src/kayenta/edit/metricStoreSelector.tsx","../../../src/kayenta/edit/nameAndDescription.tsx","../../../src/kayenta/layout/titledSubsection.tsx","../../../src/kayenta/edit/groupWeight.tsx","../../../src/kayenta/edit/groupWeights.tsx","../../../src/kayenta/edit/scoring.tsx","../../../src/kayenta/edit/configDetail.tsx","../../../src/kayenta/layout/centeredDetail.tsx","../../../src/kayenta/edit/configDetailLoadStates.tsx","../../../src/kayenta/edit/configDetailLoader.tsx","../../../src/kayenta/edit/createConfigButton.tsx","../../../src/kayenta/edit/ownedBy.tsx","../../../src/kayenta/edit/configList.tsx","../../../src/kayenta/edit/footer.tsx","../../../src/kayenta/layout/listDetail.tsx","../../../src/kayenta/edit/edit.tsx","../../../src/kayenta/edit/saveConfigButton.tsx","../../../src/kayenta/edit/saveConfigError.tsx","../../../src/kayenta/edit/validationErrors.tsx","../../../src/kayenta/edit/save.tsx","../../../src/kayenta/edit/selectConfig.tsx","../../../src/kayenta/report/detail/sourceLinks.tsx","../../../src/kayenta/report/detail/reportMetadata.tsx","../../../src/kayenta/report/detail/score.tsx","../../../src/kayenta/report/detail/header.tsx","../../../src/kayenta/report/detail/graph/graph.tsx","../../../src/kayenta/report/detail/graphTypeSelector.tsx","../../../src/kayenta/report/detail/metricResultActions.tsx","../../../src/kayenta/report/detail/metricResultStats.tsx","../../../src/kayenta/report/detail/metricResultDetailLayout.tsx","../../../src/kayenta/report/detail/metricSetPairLoadStates.tsx","../../../src/kayenta/report/detail/metricResultDetail.tsx","../../../src/kayenta/report/detail/metricResultsClassificationFilters.tsx","../../../src/kayenta/report/detail/colors.ts","../../../src/kayenta/report/detail/metricResultClassification.tsx","../../../src/kayenta/report/detail/metricResultDeviation.tsx","../../../src/kayenta/report/detail/metricResultsColumns.tsx","../../../src/kayenta/report/detail/multipleResultsTable.tsx","../../../src/kayenta/report/detail/metricResultsList.tsx","../../../src/kayenta/report/detail/metricResults.tsx","../../../src/kayenta/report/detail/reportException.tsx","../../../src/kayenta/report/detail/reportExplanation.tsx","../../../src/kayenta/report/detail/headerArrow.tsx","../../../src/kayenta/report/detail/allMetricResultsHeader.tsx","../../../src/kayenta/report/detail/clickableHeader.tsx","../../../src/kayenta/report/detail/groupScores.tsx","../../../src/kayenta/report/detail/reportScores.tsx","../../../src/kayenta/report/detail/detail.tsx","../../../src/kayenta/report/detail/loadStates.tsx","../../../src/kayenta/report/detail/detailLoader.tsx","../../../src/kayenta/manualAnalysis/ManualAnalysisModal.tsx","../../../src/kayenta/report/list/configLink.tsx","../../../src/kayenta/report/list/pipelineLink.tsx","../../../src/kayenta/report/list/reportLink.tsx","../../../src/kayenta/report/list/table.tsx","../../../src/kayenta/report/list/loadStates.tsx","../../../src/kayenta/report/report.tsx","../../../src/lazy.ts","../../../src/kayenta/navigation/canary.states.ts","../../../src/kayenta/canary.dataSource.bridge.ts"],"sourcesContent":["import classNames from 'classnames';\nimport * as React from 'react';\n\nimport { ITableColumn } from './tableColumn';\n\nexport interface ITableHeaderProps {\n columns: Array<ITableColumn<any>>;\n className: string;\n}\n\nexport const TableHeader = ({ columns, className }: ITableHeaderProps) => {\n return (\n <div className={classNames('horizontal', className)}>\n {columns.map((c, i) => (\n <div key={c.label || i} className={`flex-${c.width}`}>\n {!c.hide && (\n <h6 className={classNames('heading-6', 'uppercase', 'color-text-primary', c.labelClassName)}>{c.label}</h6>\n )}\n </div>\n ))}\n </div>\n );\n};\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nimport { ITableColumn } from './tableColumn';\nimport { TableHeader } from './tableHeader';\n\nexport interface ITableProps<T> {\n rows: T[];\n columns: Array<ITableColumn<T>>;\n rowKey: (row: T) => string;\n tableBodyClassName?: string;\n headerClassName?: string;\n rowClassName?: (row: T) => string;\n onRowClick?: (row: T) => void;\n customRow?: (row: T) => JSX.Element;\n className?: string;\n}\n\nexport function Table<T>({\n rows,\n columns,\n rowKey,\n tableBodyClassName,\n rowClassName,\n onRowClick,\n customRow,\n className,\n headerClassName,\n}: ITableProps<T>) {\n const TableRow = ({ row }: { row: T }) => (\n <li\n onClick={onRowClick ? () => onRowClick(row) : null}\n className={classNames(\n { horizontal: !rowClassName, 'table-row': !rowClassName },\n rowClassName && rowClassName(row),\n )}\n >\n {columns.map((c, i) => (\n <div key={c.label || i} className={`flex-${c.width}`}>\n {!c.hide && c.getContent(row)}\n </div>\n ))}\n </li>\n );\n\n return (\n <div className={className}>\n <ul className={classNames(tableBodyClassName, 'list-group')}>\n <TableHeader columns={columns} className={classNames('table-header', 'sticky-header', headerClassName)} />\n {rows.map((r) =>\n customRow && customRow(r) ? <div key={rowKey(r)}>{customRow(r)}</div> : <TableRow key={rowKey(r)} row={r} />,\n )}\n </ul>\n </div>\n );\n}\n","/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nexport default function compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nimport compose from './compose';\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nexport default function applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var _dispatch = store.dispatch;\n var chain = [];\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch(action) {\n return _dispatch(action);\n }\n };\n chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}","import * as React from 'react';\nimport { Suspense } from 'react';\n\nimport { Spinner } from '@spinnaker/core';\n\nimport { GraphType, IMetricSetPairGraphProps, metricSetPairGraphService } from '../metricSetPairGraph.service';\nconst SemioticGraphLazy = React.lazy(() => import(/* webpackChunkName: \"Lazy-KayentaGraphs\" */ './semioticGraph'));\n\nconst supportedGraphTypes: GraphType[] = [GraphType.TimeSeries, GraphType.Histogram, GraphType.BoxPlot];\n// Semiotic component registration\nmetricSetPairGraphService.register({\n name: 'semiotic',\n handlesGraphType: (type) => supportedGraphTypes.includes(type),\n getGraph: () => (props: IMetricSetPairGraphProps) => (\n <Suspense fallback={<Spinner />}>\n <SemioticGraphLazy {...props} />\n </Suspense>\n ),\n});\n","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?t(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],t):t(e.reduxLogger=e.reduxLogger||{})}(this,function(e){\"use strict\";function t(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function r(e,t){Object.defineProperty(this,\"kind\",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,\"path\",{value:t,enumerable:!0})}function n(e,t,r){n.super_.call(this,\"E\",e),Object.defineProperty(this,\"lhs\",{value:t,enumerable:!0}),Object.defineProperty(this,\"rhs\",{value:r,enumerable:!0})}function o(e,t){o.super_.call(this,\"N\",e),Object.defineProperty(this,\"rhs\",{value:t,enumerable:!0})}function i(e,t){i.super_.call(this,\"D\",e),Object.defineProperty(this,\"lhs\",{value:t,enumerable:!0})}function a(e,t,r){a.super_.call(this,\"A\",e),Object.defineProperty(this,\"index\",{value:t,enumerable:!0}),Object.defineProperty(this,\"item\",{value:r,enumerable:!0})}function f(e,t,r){var n=e.slice((r||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,n),e}function u(e){var t=\"undefined\"==typeof e?\"undefined\":N(e);return\"object\"!==t?t:e===Math?\"math\":null===e?\"null\":Array.isArray(e)?\"array\":\"[object Date]\"===Object.prototype.toString.call(e)?\"date\":\"function\"==typeof e.toString&&/^\\/.*\\//.test(e.toString())?\"regexp\":\"object\"}function l(e,t,r,c,s,d,p){s=s||[],p=p||[];var g=s.slice(0);if(\"undefined\"!=typeof d){if(c){if(\"function\"==typeof c&&c(g,d))return;if(\"object\"===(\"undefined\"==typeof c?\"undefined\":N(c))){if(c.prefilter&&c.prefilter(g,d))return;if(c.normalize){var h=c.normalize(g,d,e,t);h&&(e=h[0],t=h[1])}}}g.push(d)}\"regexp\"===u(e)&&\"regexp\"===u(t)&&(e=e.toString(),t=t.toString());var y=\"undefined\"==typeof e?\"undefined\":N(e),v=\"undefined\"==typeof t?\"undefined\":N(t),b=\"undefined\"!==y||p&&p[p.length-1].lhs&&p[p.length-1].lhs.hasOwnProperty(d),m=\"undefined\"!==v||p&&p[p.length-1].rhs&&p[p.length-1].rhs.hasOwnProperty(d);if(!b&&m)r(new o(g,t));else if(!m&&b)r(new i(g,e));else if(u(e)!==u(t))r(new n(g,e,t));else if(\"date\"===u(e)&&e-t!==0)r(new n(g,e,t));else if(\"object\"===y&&null!==e&&null!==t)if(p.filter(function(t){return t.lhs===e}).length)e!==t&&r(new n(g,e,t));else{if(p.push({lhs:e,rhs:t}),Array.isArray(e)){var w;e.length;for(w=0;w<e.length;w++)w>=t.length?r(new a(g,w,new i(void 0,e[w]))):l(e[w],t[w],r,c,g,w,p);for(;w<t.length;)r(new a(g,w,new o(void 0,t[w++])))}else{var x=Object.keys(e),S=Object.keys(t);x.forEach(function(n,o){var i=S.indexOf(n);i>=0?(l(e[n],t[n],r,c,g,n,p),S=f(S,i)):l(e[n],void 0,r,c,g,n,p)}),S.forEach(function(e){l(void 0,t[e],r,c,g,e,p)})}p.length=p.length-1}else e!==t&&(\"number\"===y&&isNaN(e)&&isNaN(t)||r(new n(g,e,t)))}function c(e,t,r,n){return n=n||[],l(e,t,function(e){e&&n.push(e)},r),n.length?n:void 0}function s(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;n<i;n++)o=o[r.path[n]];switch(r.kind){case\"A\":s(o[r.path[n]],r.index,r.item);break;case\"D\":delete o[r.path[n]];break;case\"E\":case\"N\":o[r.path[n]]=r.rhs}}else switch(r.kind){case\"A\":s(e[t],r.index,r.item);break;case\"D\":e=f(e,t);break;case\"E\":case\"N\":e[t]=r.rhs}return e}function d(e,t,r){if(e&&t&&r&&r.kind){for(var n=e,o=-1,i=r.path?r.path.length-1:0;++o<i;)\"undefined\"==typeof n[r.path[o]]&&(n[r.path[o]]=\"number\"==typeof r.path[o]?[]:{}),n=n[r.path[o]];switch(r.kind){case\"A\":s(r.path?n[r.path[o]]:n,r.index,r.item);break;case\"D\":delete n[r.path[o]];break;case\"E\":case\"N\":n[r.path[o]]=r.rhs}}}function p(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;n<i;n++)o=o[r.path[n]];switch(r.kind){case\"A\":p(o[r.path[n]],r.index,r.item);break;case\"D\":o[r.path[n]]=r.lhs;break;case\"E\":o[r.path[n]]=r.lhs;break;case\"N\":delete o[r.path[n]]}}else switch(r.kind){case\"A\":p(e[t],r.index,r.item);break;case\"D\":e[t]=r.lhs;break;case\"E\":e[t]=r.lhs;break;case\"N\":e=f(e,t)}return e}function g(e,t,r){if(e&&t&&r&&r.kind){var n,o,i=e;for(o=r.path.length-1,n=0;n<o;n++)\"undefined\"==typeof i[r.path[n]]&&(i[r.path[n]]={}),i=i[r.path[n]];switch(r.kind){case\"A\":p(i[r.path[n]],r.index,r.item);break;case\"D\":i[r.path[n]]=r.lhs;break;case\"E\":i[r.path[n]]=r.lhs;break;case\"N\":delete i[r.path[n]]}}}function h(e,t,r){if(e&&t){var n=function(n){r&&!r(e,t,n)||d(e,t,n)};l(e,t,n)}}function y(e){return\"color: \"+F[e].color+\"; font-weight: bold\"}function v(e){var t=e.kind,r=e.path,n=e.lhs,o=e.rhs,i=e.index,a=e.item;switch(t){case\"E\":return[r.join(\".\"),n,\"→\",o];case\"N\":return[r.join(\".\"),o];case\"D\":return[r.join(\".\")];case\"A\":return[r.join(\".\")+\"[\"+i+\"]\",a];default:return[]}}function b(e,t,r,n){var o=c(e,t);try{n?r.groupCollapsed(\"diff\"):r.group(\"diff\")}catch(e){r.log(\"diff\")}o?o.forEach(function(e){var t=e.kind,n=v(e);r.log.apply(r,[\"%c \"+F[t].text,y(t)].concat(P(n)))}):r.log(\"—— no diff ——\");try{r.groupEnd()}catch(e){r.log(\"—— diff end —— \")}}function m(e,t,r,n){switch(\"undefined\"==typeof e?\"undefined\":N(e)){case\"object\":return\"function\"==typeof e[n]?e[n].apply(e,P(r)):e[n];case\"function\":return e(t);default:return e}}function w(e){var t=e.timestamp,r=e.duration;return function(e,n,o){var i=[\"action\"];return i.push(\"%c\"+String(e.type)),t&&i.push(\"%c@ \"+n),r&&i.push(\"%c(in \"+o.toFixed(2)+\" ms)\"),i.join(\" \")}}function x(e,t){var r=t.logger,n=t.actionTransformer,o=t.titleFormatter,i=void 0===o?w(t):o,a=t.collapsed,f=t.colors,u=t.level,l=t.diff,c=\"undefined\"==typeof t.titleFormatter;e.forEach(function(o,s){var d=o.started,p=o.startedTime,g=o.action,h=o.prevState,y=o.error,v=o.took,w=o.nextState,x=e[s+1];x&&(w=x.prevState,v=x.started-d);var S=n(g),k=\"function\"==typeof a?a(function(){return w},g,o):a,j=D(p),E=f.title?\"color: \"+f.title(S)+\";\":\"\",A=[\"color: gray; font-weight: lighter;\"];A.push(E),t.timestamp&&A.push(\"color: gray; font-weight: lighter;\"),t.duration&&A.push(\"color: gray; font-weight: lighter;\");var O=i(S,j,v);try{k?f.title&&c?r.groupCollapsed.apply(r,[\"%c \"+O].concat(A)):r.groupCollapsed(O):f.title&&c?r.group.apply(r,[\"%c \"+O].concat(A)):r.group(O)}catch(e){r.log(O)}var N=m(u,S,[h],\"prevState\"),P=m(u,S,[S],\"action\"),C=m(u,S,[y,h],\"error\"),F=m(u,S,[w],\"nextState\");if(N)if(f.prevState){var L=\"color: \"+f.prevState(h)+\"; font-weight: bold\";r[N](\"%c prev state\",L,h)}else r[N](\"prev state\",h);if(P)if(f.action){var T=\"color: \"+f.action(S)+\"; font-weight: bold\";r[P](\"%c action \",T,S)}else r[P](\"action \",S);if(y&&C)if(f.error){var M=\"color: \"+f.error(y,h)+\"; font-weight: bold;\";r[C](\"%c error \",M,y)}else r[C](\"error \",y);if(F)if(f.nextState){var _=\"color: \"+f.nextState(w)+\"; font-weight: bold\";r[F](\"%c next state\",_,w)}else r[F](\"next state\",w);l&&b(h,w,r,k);try{r.groupEnd()}catch(e){r.log(\"—— log end ——\")}})}function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},L,e),r=t.logger,n=t.stateTransformer,o=t.errorTransformer,i=t.predicate,a=t.logErrors,f=t.diffPredicate;if(\"undefined\"==typeof r)return function(){return function(e){return function(t){return e(t)}}};if(e.getState&&e.dispatch)return console.error(\"[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\\n// Logger with default options\\nimport { logger } from 'redux-logger'\\nconst store = createStore(\\n reducer,\\n applyMiddleware(logger)\\n)\\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\\nimport createLogger from 'redux-logger'\\nconst logger = createLogger({\\n // ...options\\n});\\nconst store = createStore(\\n reducer,\\n applyMiddleware(logger)\\n)\\n\"),function(){return function(e){return function(t){return e(t)}}};var u=[];return function(e){var r=e.getState;return function(e){return function(l){if(\"function\"==typeof i&&!i(r,l))return e(l);var c={};u.push(c),c.started=O.now(),c.startedTime=new Date,c.prevState=n(r()),c.action=l;var s=void 0;if(a)try{s=e(l)}catch(e){c.error=o(e)}else s=e(l);c.took=O.now()-c.started,c.nextState=n(r());var d=t.diff&&\"function\"==typeof f?f(r,l):t.diff;if(x(u,Object.assign({},t,{diff:d})),u.length=0,c.error)throw c.error;return s}}}}var k,j,E=function(e,t){return new Array(t+1).join(e)},A=function(e,t){return E(\"0\",t-e.toString().length)+e},D=function(e){return A(e.getHours(),2)+\":\"+A(e.getMinutes(),2)+\":\"+A(e.getSeconds(),2)+\".\"+A(e.getMilliseconds(),3)},O=\"undefined\"!=typeof performance&&null!==performance&&\"function\"==typeof performance.now?performance:Date,N=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},P=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},C=[];k=\"object\"===(\"undefined\"==typeof global?\"undefined\":N(global))&&global?global:\"undefined\"!=typeof window?window:{},j=k.DeepDiff,j&&C.push(function(){\"undefined\"!=typeof j&&k.DeepDiff===c&&(k.DeepDiff=j,j=void 0)}),t(n,r),t(o,r),t(i,r),t(a,r),Object.defineProperties(c,{diff:{value:c,enumerable:!0},observableDiff:{value:l,enumerable:!0},applyDiff:{value:h,enumerable:!0},applyChange:{value:d,enumerable:!0},revertChange:{value:g,enumerable:!0},isConflict:{value:function(){return\"undefined\"!=typeof j},enumerable:!0},noConflict:{value:function(){return C&&(C.forEach(function(e){e()}),C=null),c},enumerable:!0}});var F={E:{color:\"#2196F3\",text:\"CHANGED:\"},N:{color:\"#4CAF50\",text:\"ADDED:\"},D:{color:\"#F44336\",text:\"DELETED:\"},A:{color:\"#2196F3\",text:\"ARRAY:\"}},L={level:\"log\",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(e){return e},actionTransformer:function(e){return e},errorTransformer:function(e){return e},colors:{title:function(){return\"inherit\"},prevState:function(){return\"#9E9E9E\"},action:function(){return\"#03A9F4\"},nextState:function(){return\"#4CAF50\"},error:function(){return\"#F20404\"}},diff:!1,diffPredicate:void 0,transformer:void 0},T=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dispatch,r=e.getState;return\"function\"==typeof t||\"function\"==typeof r?S()({dispatch:t,getState:r}):void console.error(\"\\n[redux-logger v3] BREAKING CHANGE\\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\\n[redux-logger v3] Change\\n[redux-logger v3] import createLogger from 'redux-logger'\\n[redux-logger v3] to\\n[redux-logger v3] import { createLogger } from 'redux-logger'\\n\")};e.defaults=L,e.createLogger=S,e.logger=T,e.default=T,Object.defineProperty(e,\"__esModule\",{value:!0})});\n","\"use strict\";\n// CommonJS / Node have global context exposed as \"global\" variable.\n// We don't want to include the whole node.d.ts this this compilation unit so we'll just fake\n// the global \"global\" var for now.\nvar __window = typeof window !== 'undefined' && window;\nvar __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope && self;\nvar __global = typeof global !== 'undefined' && global;\nvar _root = __window || __global || __self;\nexports.root = _root;\n// Workaround Closure Compiler restriction: The body of a goog.module cannot use throw.\n// This is needed when used with angular/tsickle which inserts a goog.module statement.\n// Wrap in IIFE\n(function () {\n if (!_root) {\n throw new Error('RxJS could not find any global context (window, self, global)');\n }\n})();\n//# sourceMappingURL=root.js.map","\"use strict\";\nfunction isFunction(x) {\n return typeof x === 'function';\n}\nexports.isFunction = isFunction;\n//# sourceMappingURL=isFunction.js.map","\"use strict\";\nexports.isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; });\n//# sourceMappingURL=isArray.js.map","\"use strict\";\nfunction isObject(x) {\n return x != null && typeof x === 'object';\n}\nexports.isObject = isObject;\n//# sourceMappingURL=isObject.js.map","\"use strict\";\nvar errorObject_1 = require('./errorObject');\nvar tryCatchTarget;\nfunction tryCatcher() {\n try {\n return tryCatchTarget.apply(this, arguments);\n }\n catch (e) {\n errorObject_1.errorObject.e = e;\n return errorObject_1.errorObject;\n }\n}\nfunction tryCatch(fn) {\n tryCatchTarget = fn;\n return tryCatcher;\n}\nexports.tryCatch = tryCatch;\n;\n//# sourceMappingURL=tryCatch.js.map","\"use strict\";\n// typeof any so that it we don't have to cast when comparing a result to the error object\nexports.errorObject = { e: {} };\n//# sourceMappingURL=errorObject.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nvar UnsubscriptionError = (function (_super) {\n __extends(UnsubscriptionError, _super);\n function UnsubscriptionError(errors) {\n _super.call(this);\n this.errors = errors;\n var err = Error.call(this, errors ?\n errors.length + \" errors occurred during unsubscription:\\n \" + errors.map(function (err, i) { return ((i + 1) + \") \" + err.toString()); }).join('\\n ') : '');\n this.name = err.name = 'UnsubscriptionError';\n this.stack = err.stack;\n this.message = err.message;\n }\n return UnsubscriptionError;\n}(Error));\nexports.UnsubscriptionError = UnsubscriptionError;\n//# sourceMappingURL=UnsubscriptionError.js.map","\"use strict\";\nvar isArray_1 = require('./util/isArray');\nvar isObject_1 = require('./util/isObject');\nvar isFunction_1 = require('./util/isFunction');\nvar tryCatch_1 = require('./util/tryCatch');\nvar errorObject_1 = require('./util/errorObject');\nvar UnsubscriptionError_1 = require('./util/UnsubscriptionError');\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n *\n * @class Subscription\n */\nvar Subscription = (function () {\n /**\n * @param {function(): void} [unsubscribe] A function describing how to\n * perform the disposal of resources when the `unsubscribe` method is called.\n */\n function Subscription(unsubscribe) {\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n * @type {boolean}\n */\n this.closed = false;\n this._parent = null;\n this._parents = null;\n this._subscriptions = null;\n if (unsubscribe) {\n this._unsubscribe = unsubscribe;\n }\n }\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n * @return {void}\n */\n Subscription.prototype.unsubscribe = function () {\n var hasErrors = false;\n var errors;\n if (this.closed) {\n return;\n }\n var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;\n this.closed = true;\n this._parent = null;\n this._parents = null;\n // null out _subscriptions first so any child subscriptions that attempt\n // to remove themselves from this subscription will noop\n this._subscriptions = null;\n var index = -1;\n var len = _parents ? _parents.length : 0;\n // if this._parent is null, then so is this._parents, and we\n // don't have to remove ourselves from any parent subscriptions.\n while (_parent) {\n _parent.remove(this);\n // if this._parents is null or index >= len,\n // then _parent is set to null, and the loop exits\n _parent = ++index < len && _parents[index] || null;\n }\n if (isFunction_1.isFunction(_unsubscribe)) {\n var trial = tryCatch_1.tryCatch(_unsubscribe).call(this);\n if (trial === errorObject_1.errorObject) {\n hasErrors = true;\n errors = errors || (errorObject_1.errorObject.e instanceof UnsubscriptionError_1.UnsubscriptionError ?\n flattenUnsubscriptionErrors(errorObject_1.errorObject.e.errors) : [errorObject_1.errorObject.e]);\n }\n }\n if (isArray_1.isArray(_subscriptions)) {\n index = -1;\n len = _subscriptions.length;\n while (++index < len) {\n var sub = _subscriptions[index];\n if (isObject_1.isObject(sub)) {\n var trial = tryCatch_1.tryCatch(sub.unsubscribe).call(sub);\n if (trial === errorObject_1.errorObject) {\n hasErrors = true;\n errors = errors || [];\n var err = errorObject_1.errorObject.e;\n if (err instanceof UnsubscriptionError_1.UnsubscriptionError) {\n errors = errors.concat(flattenUnsubscriptionErrors(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n }\n if (hasErrors) {\n throw new UnsubscriptionError_1.UnsubscriptionError(errors);\n }\n };\n /**\n * Adds a tear down to be called during the unsubscribe() of this\n * Subscription.\n *\n * If the tear down being added is a subscription that is already\n * unsubscribed, is the same reference `add` is being called on, or is\n * `Subscription.EMPTY`, it will not be added.\n *\n * If this subscription is already in an `closed` state, the passed\n * tear down logic will be executed immediately.\n *\n * @param {TeardownLogic} teardown The additional logic to execute on\n * teardown.\n * @return {Subscription} Returns the Subscription used or created to be\n * added to the inner subscriptions list. This Subscription can be used with\n * `remove()` to remove the passed teardown logic from the inner subscriptions\n * list.\n */\n Subscription.prototype.add = function (teardown) {\n if (!teardown || (teardown === Subscription.EMPTY)) {\n return Subscription.EMPTY;\n }\n if (teardown === this) {\n return this;\n }\n var subscription = teardown;\n switch (typeof teardown) {\n case 'function':\n subscription = new Subscription(teardown);\n case 'object':\n if (subscription.closed || typeof subscription.unsubscribe !== 'function') {\n return subscription;\n }\n else if (this.closed) {\n subscription.unsubscribe();\n return subscription;\n }\n else if (typeof subscription._addParent !== 'function' /* quack quack */) {\n var tmp = subscription;\n subscription = new Subscription();\n subscription._subscriptions = [tmp];\n }\n break;\n default:\n throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');\n }\n var subscriptions = this._subscriptions || (this._subscriptions = []);\n subscriptions.push(subscription);\n subscription._addParent(this);\n return subscription;\n };\n /**\n * Removes a Subscription from the internal list of subscriptions that will\n * unsubscribe during the unsubscribe process of this Subscription.\n * @param {Subscription} subscription The subscription to remove.\n * @return {void}\n */\n Subscription.prototype.remove = function (subscription) {\n var subscriptions = this._subscriptions;\n if (subscriptions) {\n var subscriptionIndex = subscriptions.indexOf(subscription);\n if (subscriptionIndex !== -1) {\n subscriptions.splice(subscriptionIndex, 1);\n }\n }\n };\n Subscription.prototype._addParent = function (parent) {\n var _a = this, _parent = _a._parent, _parents = _a._parents;\n if (!_parent || _parent === parent) {\n // If we don't have a parent, or the new parent is the same as the\n // current parent, then set this._parent to the new parent.\n this._parent = parent;\n }\n else if (!_parents) {\n // If there's already one parent, but not multiple, allocate an Array to\n // store the rest of the parent Subscriptions.\n this._parents = [parent];\n }\n else if (_parents.indexOf(parent) === -1) {\n // Only add the new parent to the _parents list if it's not already there.\n _parents.push(parent);\n }\n };\n Subscription.EMPTY = (function (empty) {\n empty.closed = true;\n return empty;\n }(new Subscription()));\n return Subscription;\n}());\nexports.Subscription = Subscription;\nfunction flattenUnsubscriptionErrors(errors) {\n return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError_1.UnsubscriptionError) ? err.errors : err); }, []);\n}\n//# sourceMappingURL=Subscription.js.map","\"use strict\";\nexports.empty = {\n closed: true,\n next: function (value) { },\n error: function (err) { throw err; },\n complete: function () { }\n};\n//# sourceMappingURL=Observer.js.map","\"use strict\";\nvar root_1 = require('../util/root');\nvar Symbol = root_1.root.Symbol;\nexports.rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ?\n Symbol.for('rxSubscriber') : '@@rxSubscriber';\n/**\n * @deprecated use rxSubscriber instead\n */\nexports.$$rxSubscriber = exports.rxSubscriber;\n//# sourceMappingURL=rxSubscriber.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar isFunction_1 = require('./util/isFunction');\nvar Subscription_1 = require('./Subscription');\nvar Observer_1 = require('./Observer');\nvar rxSubscriber_1 = require('./symbol/rxSubscriber');\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n *\n * @class Subscriber<T>\n */\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n /**\n * @param {Observer|function(value: T): void} [destinationOrNext] A partially\n * defined Observer or a `next` callback function.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n */\n function Subscriber(destinationOrNext, error, complete) {\n _super.call(this);\n this.syncErrorValue = null;\n this.syncErrorThrown = false;\n this.syncErrorThrowable = false;\n this.isStopped = false;\n switch (arguments.length) {\n case 0:\n this.destination = Observer_1.empty;\n break;\n case 1:\n if (!destinationOrNext) {\n this.destination = Observer_1.empty;\n break;\n }\n if (typeof destinationOrNext === 'object') {\n if (destinationOrNext instanceof Subscriber) {\n this.destination = destinationOrNext;\n this.destination.add(this);\n }\n else {\n this.syncErrorThrowable = true;\n this.destination = new SafeSubscriber(this, destinationOrNext);\n }\n break;\n }\n default:\n this.syncErrorThrowable = true;\n this.destination = new SafeSubscriber(this, destinationOrNext, error, complete);\n break;\n }\n }\n Subscriber.prototype[rxSubscriber_1.rxSubscriber] = function () { return this; };\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param {function(x: ?T): void} [next] The `next` callback of an Observer.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n * @return {Subscriber<T>} A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n */\n Subscriber.create = function (next, error, complete) {\n var subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n };\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param {T} [value] The `next` value.\n * @return {void}\n */\n Subscriber.prototype.next = function (value) {\n if (!this.isStopped) {\n this._next(value);\n }\n };\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached {@link Error}. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param {any} [err] The `error` exception.\n * @return {void}\n */\n Subscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n };\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n * @return {void}\n */\n Subscriber.prototype.complete = function () {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n this.destination.error(err);\n this.unsubscribe();\n };\n Subscriber.prototype._complete = function () {\n this.destination.complete();\n this.unsubscribe();\n };\n Subscriber.prototype._unsubscribeAndRecycle = function () {\n var _a = this, _parent = _a._parent, _parents = _a._parents;\n this._parent = null;\n this._parents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parent = _parent;\n this._parents = _parents;\n return this;\n };\n return Subscriber;\n}(Subscription_1.Subscription));\nexports.Subscriber = Subscriber;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {\n _super.call(this);\n this._parentSubscriber = _parentSubscriber;\n var next;\n var context = this;\n if (isFunction_1.isFunction(observerOrNext)) {\n next = observerOrNext;\n }\n else if (observerOrNext) {\n next = observerOrNext.next;\n error = observerOrNext.error;\n complete = observerOrNext.complete;\n if (observerOrNext !== Observer_1.empty) {\n context = Object.create(observerOrNext);\n if (isFunction_1.isFunction(context.unsubscribe)) {\n this.add(context.unsubscribe.bind(context));\n }\n context.unsubscribe = this.unsubscribe.bind(this);\n }\n }\n this._context = context;\n this._next = next;\n this._error = error;\n this._complete = complete;\n }\n SafeSubscriber.prototype.next = function (value) {\n if (!this.isStopped && this._next) {\n var _parentSubscriber = this._parentSubscriber;\n if (!_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._next, value);\n }\n else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n if (this._error) {\n if (!_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._error, err);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, this._error, err);\n this.unsubscribe();\n }\n }\n else if (!_parentSubscriber.syncErrorThrowable) {\n this.unsubscribe();\n throw err;\n }\n else {\n _parentSubscriber.syncErrorValue = err;\n _parentSubscriber.syncErrorThrown = true;\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.complete = function () {\n var _this = this;\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n if (this._complete) {\n var wrappedComplete = function () { return _this._complete.call(_this._context); };\n if (!_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(wrappedComplete);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n this.unsubscribe();\n }\n }\n else {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n this.unsubscribe();\n throw err;\n }\n };\n SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n parent.syncErrorValue = err;\n parent.syncErrorThrown = true;\n return true;\n }\n return false;\n };\n SafeSubscriber.prototype._unsubscribe = function () {\n var _parentSubscriber = this._parentSubscriber;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n };\n return SafeSubscriber;\n}(Subscriber));\n//# sourceMappingURL=Subscriber.js.map","\"use strict\";\nvar Subscriber_1 = require('../Subscriber');\nvar rxSubscriber_1 = require('../symbol/rxSubscriber');\nvar Observer_1 = require('../Observer');\nfunction toSubscriber(nextOrObserver, error, complete) {\n if (nextOrObserver) {\n if (nextOrObserver instanceof Subscriber_1.Subscriber) {\n return nextOrObserver;\n }\n if (nextOrObserver[rxSubscriber_1.rxSubscriber]) {\n return nextOrObserver[rxSubscriber_1.rxSubscriber]();\n }\n }\n if (!nextOrObserver && !error && !complete) {\n return new Subscriber_1.Subscriber(Observer_1.empty);\n }\n return new Subscriber_1.Subscriber(nextOrObserver, error, complete);\n}\nexports.toSubscriber = toSubscriber;\n//# sourceMappingURL=toSubscriber.js.map","\"use strict\";\nvar root_1 = require('../util/root');\nfunction getSymbolObservable(context) {\n var $$observable;\n var Symbol = context.Symbol;\n if (typeof Symbol === 'function') {\n if (Symbol.observable) {\n $$observable = Symbol.observable;\n }\n else {\n $$observable = Symbol('observable');\n Symbol.observable = $$observable;\n }\n }\n else {\n $$observable = '@@observable';\n }\n return $$observable;\n}\nexports.getSymbolObservable = getSymbolObservable;\nexports.observable = getSymbolObservable(root_1.root);\n/**\n * @deprecated use observable instead\n */\nexports.$$observable = exports.observable;\n//# sourceMappingURL=observable.js.map","\"use strict\";\n/* tslint:disable:no-empty */\nfunction noop() { }\nexports.noop = noop;\n//# sourceMappingURL=noop.js.map","\"use strict\";\nvar noop_1 = require('./noop');\n/* tslint:enable:max-line-length */\nfunction pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i - 0] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexports.pipe = pipe;\n/* @internal */\nfunction pipeFromArray(fns) {\n if (!fns) {\n return noop_1.noop;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\nexports.pipeFromArray = pipeFromArray;\n//# sourceMappingURL=pipe.js.map","\"use strict\";\nvar root_1 = require('./util/root');\nvar toSubscriber_1 = require('./util/toSubscriber');\nvar observable_1 = require('./symbol/observable');\nvar pipe_1 = require('./util/pipe');\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n *\n * @class Observable<T>\n */\nvar Observable = (function () {\n /**\n * @constructor\n * @param {Function} subscribe the function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n function Observable(subscribe) {\n this._isScalar = false;\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n /**\n * Creates a new Observable, with this Observable as the source, and the passed\n * operator defined as the new observable's operator.\n * @method lift\n * @param {Operator} operator the operator defining the operation to take on the observable\n * @return {Observable} a new observable with the Operator applied\n */\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * <span class=\"informal\">Use it when you have all these Observables, but still nothing is happening.</span>\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to a {@link create} static factory, but most of the time it is\n * a library implementation, which defines what and when will be emitted by an Observable. This means that calling\n * `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, that if `error` method is not provided, all errors will\n * be left uncaught.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where first function is equivalent\n * of a `next` method, second of an `error` method and third of a `complete` method. Just as in case of Observer,\n * if you do not need to listen for something, you can omit a function, preferably by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to `error` function, just as before, if not provided, errors emitted by an Observable will be thrown.\n *\n * Whatever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a {@link Scheduler}.\n *\n * @example <caption>Subscribe with an Observer</caption>\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() { // We actually could just remove this method,\n * }, // since we do not really care about errors right now.\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * Rx.Observable.of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // \"Adding: 1\"\n * // \"Adding: 2\"\n * // \"Adding: 3\"\n * // \"Sum equals: 6\"\n *\n *\n * @example <caption>Subscribe with functions</caption>\n * let sum = 0;\n *\n * Rx.Observable.of(1, 2, 3)\n * .subscribe(\n * function(value) {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * function() {\n * console.log('Sum equals: ' + sum);\n * }\n * );\n *\n * // Logs:\n * // \"Adding: 1\"\n * // \"Adding: 2\"\n * // \"Adding: 3\"\n * // \"Sum equals: 6\"\n *\n *\n * @example <caption>Cancel a subscription</caption>\n * const subscription = Rx.Observable.interval(1000).subscribe(\n * num => console.log(num),\n * undefined,\n * () => console.log('completed!') // Will not be called, even\n * ); // when cancelling subscription\n *\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // \"unsubscribed!\" after 2.5s\n *\n *\n * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,\n * or the first of three possible handlers, which is the handler for each value emitted from the subscribed\n * Observable.\n * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown as unhandled.\n * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.\n * @return {ISubscription} a subscription reference to the registered handlers\n * @method subscribe\n */\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var operator = this.operator;\n var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete);\n if (operator) {\n operator.call(sink, this.source);\n }\n else {\n sink.add(this.source ? this._subscribe(sink) : this._trySubscribe(sink));\n }\n if (sink.syncErrorThrowable) {\n sink.syncErrorThrowable = false;\n if (sink.syncErrorThrown) {\n throw sink.syncErrorValue;\n }\n }\n return sink;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.syncErrorThrown = true;\n sink.syncErrorValue = err;\n sink.error(err);\n }\n };\n /**\n * @method forEach\n * @param {Function} next a handler for each value emitted by the observable\n * @param {PromiseConstructor} [PromiseCtor] a constructor function used to instantiate the Promise\n * @return {Promise} a promise that either resolves on observable completion or\n * rejects with the handled error\n */\n Observable.prototype.forEach = function (next, PromiseCtor) {\n var _this = this;\n if (!PromiseCtor) {\n if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) {\n PromiseCtor = root_1.root.Rx.config.Promise;\n }\n else if (root_1.root.Promise) {\n PromiseCtor = root_1.root.Promise;\n }\n }\n if (!PromiseCtor) {\n throw new Error('no Promise impl found');\n }\n return new PromiseCtor(function (resolve, reject) {\n // Must be declared in a separate statement to avoid a RefernceError when\n // accessing subscription below in the closure due to Temporal Dead Zone.\n var subscription;\n subscription = _this.subscribe(function (value) {\n if (subscription) {\n // if there is a subscription, then we can surmise\n // the next handling is asynchronous. Any errors thrown\n // need to be rejected explicitly and unsubscribe must be\n // called manually\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscription.unsubscribe();\n }\n }\n else {\n // if there is NO subscription, then we're getting a nexted\n // value synchronously during subscription. We can just call it.\n // If it errors, Observable's `subscribe` will ensure the\n // unsubscription logic is called, then synchronously rethrow the error.\n // After that, Promise will trap the error and send it\n // down the rejection path.\n next(value);\n }\n }, reject, resolve);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n return this.source.subscribe(subscriber);\n };\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @method Symbol.observable\n * @return {Observable} this instance of the observable\n */\n Observable.prototype[observable_1.observable] = function () {\n return this;\n };\n /* tslint:enable:max-line-length */\n /**\n * Used to stitch together functional operators into a chain.\n * @method pipe\n * @return {Observable} the Observable result of all of the operators having\n * been called in the order they were passed in.\n *\n * @example\n *\n * import { map, filter, scan } from 'rxjs/operators';\n *\n * Rx.Observable.interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x))\n */\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i - 0] = arguments[_i];\n }\n if (operations.length === 0) {\n return this;\n }\n return pipe_1.pipeFromArray(operations)(this);\n };\n /* tslint:enable:max-line-length */\n Observable.prototype.toPromise = function (PromiseCtor) {\n var _this = this;\n if (!PromiseCtor) {\n if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) {\n PromiseCtor = root_1.root.Rx.config.Promise;\n }\n else if (root_1.root.Promise) {\n PromiseCtor = root_1.root.Promise;\n }\n }\n if (!PromiseCtor) {\n throw new Error('no Promise impl found');\n }\n return new PromiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new cold Observable by calling the Observable constructor\n * @static true\n * @owner Observable\n * @method create\n * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor\n * @return {Observable} a new cold observable\n */\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexports.Observable = Observable;\n//# sourceMappingURL=Observable.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nvar ObjectUnsubscribedError = (function (_super) {\n __extends(ObjectUnsubscribedError, _super);\n function ObjectUnsubscribedError() {\n var err = _super.call(this, 'object unsubscribed');\n this.name = err.name = 'ObjectUnsubscribedError';\n this.stack = err.stack;\n this.message = err.message;\n }\n return ObjectUnsubscribedError;\n}(Error));\nexports.ObjectUnsubscribedError = ObjectUnsubscribedError;\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscription_1 = require('./Subscription');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar SubjectSubscription = (function (_super) {\n __extends(SubjectSubscription, _super);\n function SubjectSubscription(subject, subscriber) {\n _super.call(this);\n this.subject = subject;\n this.subscriber = subscriber;\n this.closed = false;\n }\n SubjectSubscription.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.closed = true;\n var subject = this.subject;\n var observers = subject.observers;\n this.subject = null;\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n var subscriberIndex = observers.indexOf(this.subscriber);\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n };\n return SubjectSubscription;\n}(Subscription_1.Subscription));\nexports.SubjectSubscription = SubjectSubscription;\n//# sourceMappingURL=SubjectSubscription.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('./Observable');\nvar Subscriber_1 = require('./Subscriber');\nvar Subscription_1 = require('./Subscription');\nvar ObjectUnsubscribedError_1 = require('./util/ObjectUnsubscribedError');\nvar SubjectSubscription_1 = require('./SubjectSubscription');\nvar rxSubscriber_1 = require('./symbol/rxSubscriber');\n/**\n * @class SubjectSubscriber<T>\n */\nvar SubjectSubscriber = (function (_super) {\n __extends(SubjectSubscriber, _super);\n function SubjectSubscriber(destination) {\n _super.call(this, destination);\n this.destination = destination;\n }\n return SubjectSubscriber;\n}(Subscriber_1.Subscriber));\nexports.SubjectSubscriber = SubjectSubscriber;\n/**\n * @class Subject<T>\n */\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n _super.call(this);\n this.observers = [];\n this.closed = false;\n this.isStopped = false;\n this.hasError = false;\n this.thrownError = null;\n }\n Subject.prototype[rxSubscriber_1.rxSubscriber] = function () {\n return new SubjectSubscriber(this);\n };\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype.next = function (value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n };\n Subject.prototype.error = function (err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n };\n Subject.prototype.complete = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n };\n Subject.prototype._trySubscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else {\n return _super.prototype._trySubscribe.call(this, subscriber);\n }\n };\n Subject.prototype._subscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription_1.Subscription.EMPTY;\n }\n else if (this.isStopped) {\n subscriber.complete();\n return Subscription_1.Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n return new SubjectSubscription_1.SubjectSubscription(this, subscriber);\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable_1.Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable_1.Observable));\nexports.Subject = Subject;\n/**\n * @class AnonymousSubject<T>\n */\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n _super.call(this);\n this.destination = destination;\n this.source = source;\n }\n AnonymousSubject.prototype.next = function (value) {\n var destination = this.destination;\n if (destination && destination.next) {\n destination.next(value);\n }\n };\n AnonymousSubject.prototype.error = function (err) {\n var destination = this.destination;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n };\n AnonymousSubject.prototype.complete = function () {\n var destination = this.destination;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var source = this.source;\n if (source) {\n return this.source.subscribe(subscriber);\n }\n else {\n return Subscription_1.Subscription.EMPTY;\n }\n };\n return AnonymousSubject;\n}(Subject));\nexports.AnonymousSubject = AnonymousSubject;\n//# sourceMappingURL=Subject.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * <span class=\"informal\">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.</span>\n *\n * <img src=\"./img/map.png\" width=\"100%\">\n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * @example <caption>Map every click to the clientX position of that click</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var positions = clicks.map(ev => ev.clientX);\n * positions.subscribe(x => console.log(x));\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable<R>} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nfunction map(project, thisArg) {\n return function mapOperation(source) {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}\nexports.map = map;\nvar MapOperator = (function () {\n function MapOperator(project, thisArg) {\n this.project = project;\n this.thisArg = thisArg;\n }\n MapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n };\n return MapOperator;\n}());\nexports.MapOperator = MapOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar MapSubscriber = (function (_super) {\n __extends(MapSubscriber, _super);\n function MapSubscriber(destination, project, thisArg) {\n _super.call(this, destination);\n this.project = project;\n this.count = 0;\n this.thisArg = thisArg || this;\n }\n // NOTE: This looks unoptimized, but it's actually purposefully NOT\n // using try/catch optimizations.\n MapSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return MapSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=map.js.map","\"use strict\";\nvar map_1 = require('../operators/map');\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * <span class=\"informal\">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.</span>\n *\n * <img src=\"./img/map.png\" width=\"100%\">\n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * @example <caption>Map every click to the clientX position of that click</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var positions = clicks.map(ev => ev.clientX);\n * positions.subscribe(x => console.log(x));\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable<R>} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nfunction map(project, thisArg) {\n return map_1.map(project, thisArg)(this);\n}\nexports.map = map;\n//# sourceMappingURL=map.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('./Subscriber');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar OuterSubscriber = (function (_super) {\n __extends(OuterSubscriber, _super);\n function OuterSubscriber() {\n _super.apply(this, arguments);\n }\n OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n OuterSubscriber.prototype.notifyError = function (error, innerSub) {\n this.destination.error(error);\n };\n OuterSubscriber.prototype.notifyComplete = function (innerSub) {\n this.destination.complete();\n };\n return OuterSubscriber;\n}(Subscriber_1.Subscriber));\nexports.OuterSubscriber = OuterSubscriber;\n//# sourceMappingURL=OuterSubscriber.js.map","\"use strict\";\nexports.isArrayLike = (function (x) { return x && typeof x.length === 'number'; });\n//# sourceMappingURL=isArrayLike.js.map","\"use strict\";\nfunction isPromise(value) {\n return value && typeof value.subscribe !== 'function' && typeof value.then === 'function';\n}\nexports.isPromise = isPromise;\n//# sourceMappingURL=isPromise.js.map","\"use strict\";\nvar root_1 = require('../util/root');\nfunction symbolIteratorPonyfill(root) {\n var Symbol = root.Symbol;\n if (typeof Symbol === 'function') {\n if (!Symbol.iterator) {\n Symbol.iterator = Symbol('iterator polyfill');\n }\n return Symbol.iterator;\n }\n else {\n // [for Mozilla Gecko 27-35:](https://mzl.la/2ewE1zC)\n var Set_1 = root.Set;\n if (Set_1 && typeof new Set_1()['@@iterator'] === 'function') {\n return '@@iterator';\n }\n var Map_1 = root.Map;\n // required for compatability with es6-shim\n if (Map_1) {\n var keys = Object.getOwnPropertyNames(Map_1.prototype);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n // according to spec, Map.prototype[@@iterator] and Map.orototype.entries must be equal.\n if (key !== 'entries' && key !== 'size' && Map_1.prototype[key] === Map_1.prototype['entries']) {\n return key;\n }\n }\n }\n return '@@iterator';\n }\n}\nexports.symbolIteratorPonyfill = symbolIteratorPonyfill;\nexports.iterator = symbolIteratorPonyfill(root_1.root);\n/**\n * @deprecated use iterator instead\n */\nexports.$$iterator = exports.iterator;\n//# sourceMappingURL=iterator.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('./Subscriber');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar InnerSubscriber = (function (_super) {\n __extends(InnerSubscriber, _super);\n function InnerSubscriber(parent, outerValue, outerIndex) {\n _super.call(this);\n this.parent = parent;\n this.outerValue = outerValue;\n this.outerIndex = outerIndex;\n this.index = 0;\n }\n InnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n };\n InnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n };\n InnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return InnerSubscriber;\n}(Subscriber_1.Subscriber));\nexports.InnerSubscriber = InnerSubscriber;\n//# sourceMappingURL=InnerSubscriber.js.map","\"use strict\";\nvar root_1 = require('./root');\nvar isArrayLike_1 = require('./isArrayLike');\nvar isPromise_1 = require('./isPromise');\nvar isObject_1 = require('./isObject');\nvar Observable_1 = require('../Observable');\nvar iterator_1 = require('../symbol/iterator');\nvar InnerSubscriber_1 = require('../InnerSubscriber');\nvar observable_1 = require('../symbol/observable');\nfunction subscribeToResult(outerSubscriber, result, outerValue, outerIndex) {\n var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex);\n if (destination.closed) {\n return null;\n }\n if (result instanceof Observable_1.Observable) {\n if (result._isScalar) {\n destination.next(result.value);\n destination.complete();\n return null;\n }\n else {\n destination.syncErrorThrowable = true;\n return result.subscribe(destination);\n }\n }\n else if (isArrayLike_1.isArrayLike(result)) {\n for (var i = 0, len = result.length; i < len && !destination.closed; i++) {\n destination.next(result[i]);\n }\n if (!destination.closed) {\n destination.complete();\n }\n }\n else if (isPromise_1.isPromise(result)) {\n result.then(function (value) {\n if (!destination.closed) {\n destination.next(value);\n destination.complete();\n }\n }, function (err) { return destination.error(err); })\n .then(null, function (err) {\n // Escaping the Promise trap: globally throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n return destination;\n }\n else if (result && typeof result[iterator_1.iterator] === 'function') {\n var iterator = result[iterator_1.iterator]();\n do {\n var item = iterator.next();\n if (item.done) {\n destination.complete();\n break;\n }\n destination.next(item.value);\n if (destination.closed) {\n break;\n }\n } while (true);\n }\n else if (result && typeof result[observable_1.observable] === 'function') {\n var obs = result[observable_1.observable]();\n if (typeof obs.subscribe !== 'function') {\n destination.error(new TypeError('Provided object does not correctly implement Symbol.observable'));\n }\n else {\n return obs.subscribe(new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex));\n }\n }\n else {\n var value = isObject_1.isObject(result) ? 'an invalid object' : \"'\" + result + \"'\";\n var msg = (\"You provided \" + value + \" where a stream was expected.\")\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n destination.error(new TypeError(msg));\n }\n return null;\n}\nexports.subscribeToResult = subscribeToResult;\n//# sourceMappingURL=subscribeToResult.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar OuterSubscriber_1 = require('../OuterSubscriber');\nvar subscribeToResult_1 = require('../util/subscribeToResult');\n/* tslint:enable:max-line-length */\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, emitting values only from the most recently projected Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link switch}.</span>\n *\n * <img src=\"./img/switchMap.png\" width=\"100%\">\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each time it observes one of these\n * inner Observables, the output Observable begins emitting the items emitted by\n * that inner Observable. When a new inner Observable is emitted, `switchMap`\n * stops emitting items from the earlier-emitted inner Observable and begins\n * emitting items from the new one. It continues to behave like this for\n * subsequent inner Observables.\n *\n * @example <caption>Rerun an interval Observable on every click event</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.switchMap((ev) => Rx.Observable.interval(1000));\n * result.subscribe(x => console.log(x));\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switch}\n * @see {@link switchMapTo}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]\n * A function to produce the value on the output Observable based on the values\n * and the indices of the source (outer) emission and the inner Observable\n * emission. The arguments passed to this function are:\n * - `outerValue`: the value that came from the source\n * - `innerValue`: the value that came from the projected Observable\n * - `outerIndex`: the \"index\" of the value that came from the source\n * - `innerIndex`: the \"index\" of the value from the projected Observable\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional `resultSelector`) to each item emitted\n * by the source Observable and taking only the values from the most recently\n * projected inner Observable.\n * @method switchMap\n * @owner Observable\n */\nfunction switchMap(project, resultSelector) {\n return function switchMapOperatorFunction(source) {\n return source.lift(new SwitchMapOperator(project, resultSelector));\n };\n}\nexports.switchMap = switchMap;\nvar SwitchMapOperator = (function () {\n function SwitchMapOperator(project, resultSelector) {\n this.project = project;\n this.resultSelector = resultSelector;\n }\n SwitchMapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SwitchMapSubscriber(subscriber, this.project, this.resultSelector));\n };\n return SwitchMapOperator;\n}());\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar SwitchMapSubscriber = (function (_super) {\n __extends(SwitchMapSubscriber, _super);\n function SwitchMapSubscriber(destination, project, resultSelector) {\n _super.call(this, destination);\n this.project = project;\n this.resultSelector = resultSelector;\n this.index = 0;\n }\n SwitchMapSubscriber.prototype._next = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (error) {\n this.destination.error(error);\n return;\n }\n this._innerSub(result, value, index);\n };\n SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {\n var innerSubscription = this.innerSubscription;\n if (innerSubscription) {\n innerSubscription.unsubscribe();\n }\n this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, result, value, index));\n };\n SwitchMapSubscriber.prototype._complete = function () {\n var innerSubscription = this.innerSubscription;\n if (!innerSubscription || innerSubscription.closed) {\n _super.prototype._complete.call(this);\n }\n };\n SwitchMapSubscriber.prototype._unsubscribe = function () {\n this.innerSubscription = null;\n };\n SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {\n this.remove(innerSub);\n this.innerSubscription = null;\n if (this.isStopped) {\n _super.prototype._complete.call(this);\n }\n };\n SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n if (this.resultSelector) {\n this._tryNotifyNext(outerValue, innerValue, outerIndex, innerIndex);\n }\n else {\n this.destination.next(innerValue);\n }\n };\n SwitchMapSubscriber.prototype._tryNotifyNext = function (outerValue, innerValue, outerIndex, innerIndex) {\n var result;\n try {\n result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return SwitchMapSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\n//# sourceMappingURL=switchMap.js.map","\"use strict\";\nvar switchMap_1 = require('../operators/switchMap');\n/* tslint:enable:max-line-length */\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, emitting values only from the most recently projected Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link switch}.</span>\n *\n * <img src=\"./img/switchMap.png\" width=\"100%\">\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each time it observes one of these\n * inner Observables, the output Observable begins emitting the items emitted by\n * that inner Observable. When a new inner Observable is emitted, `switchMap`\n * stops emitting items from the earlier-emitted inner Observable and begins\n * emitting items from the new one. It continues to behave like this for\n * subsequent inner Observables.\n *\n * @example <caption>Rerun an interval Observable on every click event</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.switchMap((ev) => Rx.Observable.interval(1000));\n * result.subscribe(x => console.log(x));\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switch}\n * @see {@link switchMapTo}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]\n * A function to produce the value on the output Observable based on the values\n * and the indices of the source (outer) emission and the inner Observable\n * emission. The arguments passed to this function are:\n * - `outerValue`: the value that came from the source\n * - `innerValue`: the value that came from the projected Observable\n * - `outerIndex`: the \"index\" of the value that came from the source\n * - `innerIndex`: the \"index\" of the value from the projected Observable\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional `resultSelector`) to each item emitted\n * by the source Observable and taking only the values from the most recently\n * projected inner Observable.\n * @method switchMap\n * @owner Observable\n */\nfunction switchMap(project, resultSelector) {\n return switchMap_1.switchMap(project, resultSelector)(this);\n}\nexports.switchMap = switchMap;\n//# sourceMappingURL=switchMap.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ScalarObservable = (function (_super) {\n __extends(ScalarObservable, _super);\n function ScalarObservable(value, scheduler) {\n _super.call(this);\n this.value = value;\n this.scheduler = scheduler;\n this._isScalar = true;\n if (scheduler) {\n this._isScalar = false;\n }\n }\n ScalarObservable.create = function (value, scheduler) {\n return new ScalarObservable(value, scheduler);\n };\n ScalarObservable.dispatch = function (state) {\n var done = state.done, value = state.value, subscriber = state.subscriber;\n if (done) {\n subscriber.complete();\n return;\n }\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n state.done = true;\n this.schedule(state);\n };\n ScalarObservable.prototype._subscribe = function (subscriber) {\n var value = this.value;\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(ScalarObservable.dispatch, 0, {\n done: false, value: value, subscriber: subscriber\n });\n }\n else {\n subscriber.next(value);\n if (!subscriber.closed) {\n subscriber.complete();\n }\n }\n };\n return ScalarObservable;\n}(Observable_1.Observable));\nexports.ScalarObservable = ScalarObservable;\n//# sourceMappingURL=ScalarObservable.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar EmptyObservable = (function (_super) {\n __extends(EmptyObservable, _super);\n function EmptyObservable(scheduler) {\n _super.call(this);\n this.scheduler = scheduler;\n }\n /**\n * Creates an Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * <span class=\"informal\">Just emits 'complete', and nothing else.\n * </span>\n *\n * <img src=\"./img/empty.png\" width=\"100%\">\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the complete notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * @example <caption>Emit the number 7, then complete.</caption>\n * var result = Rx.Observable.empty().startWith(7);\n * result.subscribe(x => console.log(x));\n *\n * @example <caption>Map and flatten only odd numbers to the sequence 'a', 'b', 'c'</caption>\n * var interval = Rx.Observable.interval(1000);\n * var result = interval.mergeMap(x =>\n * x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty()\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval eg(0,1,2,3,...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1 print abc\n * // if x % 2 is not equal to 1 nothing will be output\n *\n * @see {@link create}\n * @see {@link never}\n * @see {@link of}\n * @see {@link throw}\n *\n * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling\n * the emission of the complete notification.\n * @return {Observable} An \"empty\" Observable: emits only the complete\n * notification.\n * @static true\n * @name empty\n * @owner Observable\n */\n EmptyObservable.create = function (scheduler) {\n return new EmptyObservable(scheduler);\n };\n EmptyObservable.dispatch = function (arg) {\n var subscriber = arg.subscriber;\n subscriber.complete();\n };\n EmptyObservable.prototype._subscribe = function (subscriber) {\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(EmptyObservable.dispatch, 0, { subscriber: subscriber });\n }\n else {\n subscriber.complete();\n }\n };\n return EmptyObservable;\n}(Observable_1.Observable));\nexports.EmptyObservable = EmptyObservable;\n//# sourceMappingURL=EmptyObservable.js.map","\"use strict\";\nfunction isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}\nexports.isScheduler = isScheduler;\n//# sourceMappingURL=isScheduler.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\nvar ScalarObservable_1 = require('./ScalarObservable');\nvar EmptyObservable_1 = require('./EmptyObservable');\nvar isScheduler_1 = require('../util/isScheduler');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ArrayObservable = (function (_super) {\n __extends(ArrayObservable, _super);\n function ArrayObservable(array, scheduler) {\n _super.call(this);\n this.array = array;\n this.scheduler = scheduler;\n if (!scheduler && array.length === 1) {\n this._isScalar = true;\n this.value = array[0];\n }\n }\n ArrayObservable.create = function (array, scheduler) {\n return new ArrayObservable(array, scheduler);\n };\n /**\n * Creates an Observable that emits some values you specify as arguments,\n * immediately one after the other, and then emits a complete notification.\n *\n * <span class=\"informal\">Emits the arguments you provide, then completes.\n * </span>\n *\n * <img src=\"./img/of.png\" width=\"100%\">\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the arguments given, and the complete notification thereafter. It can\n * be used for composing with other Observables, such as with {@link concat}.\n * By default, it uses a `null` IScheduler, which means the `next`\n * notifications are sent synchronously, although with a different IScheduler\n * it is possible to determine when those notifications will be delivered.\n *\n * @example <caption>Emit 10, 20, 30, then 'a', 'b', 'c', then start ticking every second.</caption>\n * var numbers = Rx.Observable.of(10, 20, 30);\n * var letters = Rx.Observable.of('a', 'b', 'c');\n * var interval = Rx.Observable.interval(1000);\n * var result = numbers.concat(letters).concat(interval);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link create}\n * @see {@link empty}\n * @see {@link never}\n * @see {@link throw}\n *\n * @param {...T} values Arguments that represent `next` values to be emitted.\n * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling\n * the emissions of the `next` notifications.\n * @return {Observable<T>} An Observable that emits each given input value.\n * @static true\n * @name of\n * @owner Observable\n */\n ArrayObservable.of = function () {\n var array = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n array[_i - 0] = arguments[_i];\n }\n var scheduler = array[array.length - 1];\n if (isScheduler_1.isScheduler(scheduler)) {\n array.pop();\n }\n else {\n scheduler = null;\n }\n var len = array.length;\n if (len > 1) {\n return new ArrayObservable(array, scheduler);\n }\n else if (len === 1) {\n return new ScalarObservable_1.ScalarObservable(array[0], scheduler);\n }\n else {\n return new EmptyObservable_1.EmptyObservable(scheduler);\n }\n };\n ArrayObservable.dispatch = function (state) {\n var array = state.array, index = state.index, count = state.count, subscriber = state.subscriber;\n if (index >= count) {\n subscriber.complete();\n return;\n }\n subscriber.next(array[index]);\n if (subscriber.closed) {\n return;\n }\n state.index = index + 1;\n this.schedule(state);\n };\n ArrayObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var array = this.array;\n var count = array.length;\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(ArrayObservable.dispatch, 0, {\n array: array, index: index, count: count, subscriber: subscriber\n });\n }\n else {\n for (var i = 0; i < count && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n }\n };\n return ArrayObservable;\n}(Observable_1.Observable));\nexports.ArrayObservable = ArrayObservable;\n//# sourceMappingURL=ArrayObservable.js.map","\"use strict\";\nvar ArrayObservable_1 = require('./ArrayObservable');\nexports.of = ArrayObservable_1.ArrayObservable.of;\n//# sourceMappingURL=of.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar root_1 = require('../util/root');\nvar Observable_1 = require('../Observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar PromiseObservable = (function (_super) {\n __extends(PromiseObservable, _super);\n function PromiseObservable(promise, scheduler) {\n _super.call(this);\n this.promise = promise;\n this.scheduler = scheduler;\n }\n /**\n * Converts a Promise to an Observable.\n *\n * <span class=\"informal\">Returns an Observable that just emits the Promise's\n * resolved value, then completes.</span>\n *\n * Converts an ES2015 Promise or a Promises/A+ spec compliant Promise to an\n * Observable. If the Promise resolves with a value, the output Observable\n * emits that resolved value as a `next`, and then completes. If the Promise\n * is rejected, then the output Observable emits the corresponding Error.\n *\n * @example <caption>Convert the Promise returned by Fetch to an Observable</caption>\n * var result = Rx.Observable.fromPromise(fetch('http://myserver.com/'));\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * @see {@link bindCallback}\n * @see {@link from}\n *\n * @param {PromiseLike<T>} promise The promise to be converted.\n * @param {Scheduler} [scheduler] An optional IScheduler to use for scheduling\n * the delivery of the resolved value (or the rejection).\n * @return {Observable<T>} An Observable which wraps the Promise.\n * @static true\n * @name fromPromise\n * @owner Observable\n */\n PromiseObservable.create = function (promise, scheduler) {\n return new PromiseObservable(promise, scheduler);\n };\n PromiseObservable.prototype._subscribe = function (subscriber) {\n var _this = this;\n var promise = this.promise;\n var scheduler = this.scheduler;\n if (scheduler == null) {\n if (this._isScalar) {\n if (!subscriber.closed) {\n subscriber.next(this.value);\n subscriber.complete();\n }\n }\n else {\n promise.then(function (value) {\n _this.value = value;\n _this._isScalar = true;\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) {\n if (!subscriber.closed) {\n subscriber.error(err);\n }\n })\n .then(null, function (err) {\n // escape the promise trap, throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n }\n }\n else {\n if (this._isScalar) {\n if (!subscriber.closed) {\n return scheduler.schedule(dispatchNext, 0, { value: this.value, subscriber: subscriber });\n }\n }\n else {\n promise.then(function (value) {\n _this.value = value;\n _this._isScalar = true;\n if (!subscriber.closed) {\n subscriber.add(scheduler.schedule(dispatchNext, 0, { value: value, subscriber: subscriber }));\n }\n }, function (err) {\n if (!subscriber.closed) {\n subscriber.add(scheduler.schedule(dispatchError, 0, { err: err, subscriber: subscriber }));\n }\n })\n .then(null, function (err) {\n // escape the promise trap, throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n }\n }\n };\n return PromiseObservable;\n}(Observable_1.Observable));\nexports.PromiseObservable = PromiseObservable;\nfunction dispatchNext(arg) {\n var value = arg.value, subscriber = arg.subscriber;\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n}\nfunction dispatchError(arg) {\n var err = arg.err, subscriber = arg.subscriber;\n if (!subscriber.closed) {\n subscriber.error(err);\n }\n}\n//# sourceMappingURL=PromiseObservable.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar root_1 = require('../util/root');\nvar Observable_1 = require('../Observable');\nvar iterator_1 = require('../symbol/iterator');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar IteratorObservable = (function (_super) {\n __extends(IteratorObservable, _super);\n function IteratorObservable(iterator, scheduler) {\n _super.call(this);\n this.scheduler = scheduler;\n if (iterator == null) {\n throw new Error('iterator cannot be null.');\n }\n this.iterator = getIterator(iterator);\n }\n IteratorObservable.create = function (iterator, scheduler) {\n return new IteratorObservable(iterator, scheduler);\n };\n IteratorObservable.dispatch = function (state) {\n var index = state.index, hasError = state.hasError, iterator = state.iterator, subscriber = state.subscriber;\n if (hasError) {\n subscriber.error(state.error);\n return;\n }\n var result = iterator.next();\n if (result.done) {\n subscriber.complete();\n return;\n }\n subscriber.next(result.value);\n state.index = index + 1;\n if (subscriber.closed) {\n if (typeof iterator.return === 'function') {\n iterator.return();\n }\n return;\n }\n this.schedule(state);\n };\n IteratorObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var _a = this, iterator = _a.iterator, scheduler = _a.scheduler;\n if (scheduler) {\n return scheduler.schedule(IteratorObservable.dispatch, 0, {\n index: index, iterator: iterator, subscriber: subscriber\n });\n }\n else {\n do {\n var result = iterator.next();\n if (result.done) {\n subscriber.complete();\n break;\n }\n else {\n subscriber.next(result.value);\n }\n if (subscriber.closed) {\n if (typeof iterator.return === 'function') {\n iterator.return();\n }\n break;\n }\n } while (true);\n }\n };\n return IteratorObservable;\n}(Observable_1.Observable));\nexports.IteratorObservable = IteratorObservable;\nvar StringIterator = (function () {\n function StringIterator(str, idx, len) {\n if (idx === void 0) { idx = 0; }\n if (len === void 0) { len = str.length; }\n this.str = str;\n this.idx = idx;\n this.len = len;\n }\n StringIterator.prototype[iterator_1.iterator] = function () { return (this); };\n StringIterator.prototype.next = function () {\n return this.idx < this.len ? {\n done: false,\n value: this.str.charAt(this.idx++)\n } : {\n done: true,\n value: undefined\n };\n };\n return StringIterator;\n}());\nvar ArrayIterator = (function () {\n function ArrayIterator(arr, idx, len) {\n if (idx === void 0) { idx = 0; }\n if (len === void 0) { len = toLength(arr); }\n this.arr = arr;\n this.idx = idx;\n this.len = len;\n }\n ArrayIterator.prototype[iterator_1.iterator] = function () { return this; };\n ArrayIterator.prototype.next = function () {\n return this.idx < this.len ? {\n done: false,\n value: this.arr[this.idx++]\n } : {\n done: true,\n value: undefined\n };\n };\n return ArrayIterator;\n}());\nfunction getIterator(obj) {\n var i = obj[iterator_1.iterator];\n if (!i && typeof obj === 'string') {\n return new StringIterator(obj);\n }\n if (!i && obj.length !== undefined) {\n return new ArrayIterator(obj);\n }\n if (!i) {\n throw new TypeError('object is not iterable');\n }\n return obj[iterator_1.iterator]();\n}\nvar maxSafeInteger = Math.pow(2, 53) - 1;\nfunction toLength(o) {\n var len = +o.length;\n if (isNaN(len)) {\n return 0;\n }\n if (len === 0 || !numberIsFinite(len)) {\n return len;\n }\n len = sign(len) * Math.floor(Math.abs(len));\n if (len <= 0) {\n return 0;\n }\n if (len > maxSafeInteger) {\n return maxSafeInteger;\n }\n return len;\n}\nfunction numberIsFinite(value) {\n return typeof value === 'number' && root_1.root.isFinite(value);\n}\nfunction sign(value) {\n var valueAsNumber = +value;\n if (valueAsNumber === 0) {\n return valueAsNumber;\n }\n if (isNaN(valueAsNumber)) {\n return valueAsNumber;\n }\n return valueAsNumber < 0 ? -1 : 1;\n}\n//# sourceMappingURL=IteratorObservable.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\nvar ScalarObservable_1 = require('./ScalarObservable');\nvar EmptyObservable_1 = require('./EmptyObservable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ArrayLikeObservable = (function (_super) {\n __extends(ArrayLikeObservable, _super);\n function ArrayLikeObservable(arrayLike, scheduler) {\n _super.call(this);\n this.arrayLike = arrayLike;\n this.scheduler = scheduler;\n if (!scheduler && arrayLike.length === 1) {\n this._isScalar = true;\n this.value = arrayLike[0];\n }\n }\n ArrayLikeObservable.create = function (arrayLike, scheduler) {\n var length = arrayLike.length;\n if (length === 0) {\n return new EmptyObservable_1.EmptyObservable();\n }\n else if (length === 1) {\n return new ScalarObservable_1.ScalarObservable(arrayLike[0], scheduler);\n }\n else {\n return new ArrayLikeObservable(arrayLike, scheduler);\n }\n };\n ArrayLikeObservable.dispatch = function (state) {\n var arrayLike = state.arrayLike, index = state.index, length = state.length, subscriber = state.subscriber;\n if (subscriber.closed) {\n return;\n }\n if (index >= length) {\n subscriber.complete();\n return;\n }\n subscriber.next(arrayLike[index]);\n state.index = index + 1;\n this.schedule(state);\n };\n ArrayLikeObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var _a = this, arrayLike = _a.arrayLike, scheduler = _a.scheduler;\n var length = arrayLike.length;\n if (scheduler) {\n return scheduler.schedule(ArrayLikeObservable.dispatch, 0, {\n arrayLike: arrayLike, index: index, length: length, subscriber: subscriber\n });\n }\n else {\n for (var i = 0; i < length && !subscriber.closed; i++) {\n subscriber.next(arrayLike[i]);\n }\n subscriber.complete();\n }\n };\n return ArrayLikeObservable;\n}(Observable_1.Observable));\nexports.ArrayLikeObservable = ArrayLikeObservable;\n//# sourceMappingURL=ArrayLikeObservable.js.map","\"use strict\";\nvar Observable_1 = require('./Observable');\n/**\n * Represents a push-based event or value that an {@link Observable} can emit.\n * This class is particularly useful for operators that manage notifications,\n * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and\n * others. Besides wrapping the actual delivered value, it also annotates it\n * with metadata of, for instance, what type of push message it is (`next`,\n * `error`, or `complete`).\n *\n * @see {@link materialize}\n * @see {@link dematerialize}\n * @see {@link observeOn}\n *\n * @class Notification<T>\n */\nvar Notification = (function () {\n function Notification(kind, value, error) {\n this.kind = kind;\n this.value = value;\n this.error = error;\n this.hasValue = kind === 'N';\n }\n /**\n * Delivers to the given `observer` the value wrapped by this Notification.\n * @param {Observer} observer\n * @return\n */\n Notification.prototype.observe = function (observer) {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n };\n /**\n * Given some {@link Observer} callbacks, deliver the value represented by the\n * current Notification to the correctly corresponding callback.\n * @param {function(value: T): void} next An Observer `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n Notification.prototype.do = function (next, error, complete) {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return next && next(this.value);\n case 'E':\n return error && error(this.error);\n case 'C':\n return complete && complete();\n }\n };\n /**\n * Takes an Observer or its individual callback functions, and calls `observe`\n * or `do` methods accordingly.\n * @param {Observer|function(value: T): void} nextOrObserver An Observer or\n * the `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n Notification.prototype.accept = function (nextOrObserver, error, complete) {\n if (nextOrObserver && typeof nextOrObserver.next === 'function') {\n return this.observe(nextOrObserver);\n }\n else {\n return this.do(nextOrObserver, error, complete);\n }\n };\n /**\n * Returns a simple Observable that just delivers the notification represented\n * by this Notification instance.\n * @return {any}\n */\n Notification.prototype.toObservable = function () {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return Observable_1.Observable.of(this.value);\n case 'E':\n return Observable_1.Observable.throw(this.error);\n case 'C':\n return Observable_1.Observable.empty();\n }\n throw new Error('unexpected notification kind value');\n };\n /**\n * A shortcut to create a Notification instance of the type `next` from a\n * given value.\n * @param {T} value The `next` value.\n * @return {Notification<T>} The \"next\" Notification representing the\n * argument.\n */\n Notification.createNext = function (value) {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n };\n /**\n * A shortcut to create a Notification instance of the type `error` from a\n * given error.\n * @param {any} [err] The `error` error.\n * @return {Notification<T>} The \"error\" Notification representing the\n * argument.\n */\n Notification.createError = function (err) {\n return new Notification('E', undefined, err);\n };\n /**\n * A shortcut to create a Notification instance of the type `complete`.\n * @return {Notification<any>} The valueless \"complete\" Notification.\n */\n Notification.createComplete = function () {\n return Notification.completeNotification;\n };\n Notification.completeNotification = new Notification('C');\n Notification.undefinedValueNotification = new Notification('N', undefined);\n return Notification;\n}());\nexports.Notification = Notification;\n//# sourceMappingURL=Notification.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\nvar Notification_1 = require('../Notification');\n/**\n *\n * Re-emits all notifications from source Observable with specified scheduler.\n *\n * <span class=\"informal\">Ensure a specific scheduler is used, from outside of an Observable.</span>\n *\n * `observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule\n * notifications emitted by the source Observable. It might be useful, if you do not have control over\n * internal scheduler of a given Observable, but want to control when its values are emitted nevertheless.\n *\n * Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable,\n * but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal\n * scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits\n * notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`.\n * An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split\n * that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source\n * Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a\n * little bit more, to ensure that they are emitted at expected moments.\n *\n * As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications\n * will be emitted. The main difference between {@link delay} operator and `observeOn` is that `observeOn`\n * will delay all notifications - including error notifications - while `delay` will pass through error\n * from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator\n * for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used\n * for notification emissions in general.\n *\n * @example <caption>Ensure values in subscribe are called just before browser repaint.</caption>\n * const intervals = Rx.Observable.interval(10); // Intervals are scheduled\n * // with async scheduler by default...\n *\n * intervals\n * .observeOn(Rx.Scheduler.animationFrame) // ...but we will observe on animationFrame\n * .subscribe(val => { // scheduler to ensure smooth animation.\n * someDiv.style.height = val + 'px';\n * });\n *\n * @see {@link delay}\n *\n * @param {IScheduler} scheduler Scheduler that will be used to reschedule notifications from source Observable.\n * @param {number} [delay] Number of milliseconds that states with what delay every notification should be rescheduled.\n * @return {Observable<T>} Observable that emits the same notifications as the source Observable,\n * but with provided scheduler.\n *\n * @method observeOn\n * @owner Observable\n */\nfunction observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return function observeOnOperatorFunction(source) {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\nexports.observeOn = observeOn;\nvar ObserveOnOperator = (function () {\n function ObserveOnOperator(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n };\n return ObserveOnOperator;\n}());\nexports.ObserveOnOperator = ObserveOnOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar ObserveOnSubscriber = (function (_super) {\n __extends(ObserveOnSubscriber, _super);\n function ObserveOnSubscriber(destination, scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n _super.call(this, destination);\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnSubscriber.dispatch = function (arg) {\n var notification = arg.notification, destination = arg.destination;\n notification.observe(destination);\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {\n this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));\n };\n ObserveOnSubscriber.prototype._next = function (value) {\n this.scheduleMessage(Notification_1.Notification.createNext(value));\n };\n ObserveOnSubscriber.prototype._error = function (err) {\n this.scheduleMessage(Notification_1.Notification.createError(err));\n };\n ObserveOnSubscriber.prototype._complete = function () {\n this.scheduleMessage(Notification_1.Notification.createComplete());\n };\n return ObserveOnSubscriber;\n}(Subscriber_1.Subscriber));\nexports.ObserveOnSubscriber = ObserveOnSubscriber;\nvar ObserveOnMessage = (function () {\n function ObserveOnMessage(notification, destination) {\n this.notification = notification;\n this.destination = destination;\n }\n return ObserveOnMessage;\n}());\nexports.ObserveOnMessage = ObserveOnMessage;\n//# sourceMappingURL=observeOn.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar isArray_1 = require('../util/isArray');\nvar isArrayLike_1 = require('../util/isArrayLike');\nvar isPromise_1 = require('../util/isPromise');\nvar PromiseObservable_1 = require('./PromiseObservable');\nvar IteratorObservable_1 = require('./IteratorObservable');\nvar ArrayObservable_1 = require('./ArrayObservable');\nvar ArrayLikeObservable_1 = require('./ArrayLikeObservable');\nvar iterator_1 = require('../symbol/iterator');\nvar Observable_1 = require('../Observable');\nvar observeOn_1 = require('../operators/observeOn');\nvar observable_1 = require('../symbol/observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar FromObservable = (function (_super) {\n __extends(FromObservable, _super);\n function FromObservable(ish, scheduler) {\n _super.call(this, null);\n this.ish = ish;\n this.scheduler = scheduler;\n }\n /**\n * Creates an Observable from an Array, an array-like object, a Promise, an\n * iterable object, or an Observable-like object.\n *\n * <span class=\"informal\">Converts almost anything to an Observable.</span>\n *\n * <img src=\"./img/from.png\" width=\"100%\">\n *\n * Convert various other objects and data types into Observables. `from`\n * converts a Promise or an array-like or an\n * [iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable)\n * object into an Observable that emits the items in that promise or array or\n * iterable. A String, in this context, is treated as an array of characters.\n * Observable-like objects (contains a function named with the ES2015 Symbol\n * for Observable) can also be converted through this operator.\n *\n * @example <caption>Converts an array to an Observable</caption>\n * var array = [10, 20, 30];\n * var result = Rx.Observable.from(array);\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // 10 20 30\n *\n * @example <caption>Convert an infinite iterable (from a generator) to an Observable</caption>\n * function* generateDoubles(seed) {\n * var i = seed;\n * while (true) {\n * yield i;\n * i = 2 * i; // double it\n * }\n * }\n *\n * var iterator = generateDoubles(3);\n * var result = Rx.Observable.from(iterator).take(10);\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // 3 6 12 24 48 96 192 384 768 1536\n *\n * @see {@link create}\n * @see {@link fromEvent}\n * @see {@link fromEventPattern}\n * @see {@link fromPromise}\n *\n * @param {ObservableInput<T>} ish A subscribable object, a Promise, an\n * Observable-like, an Array, an iterable or an array-like object to be\n * converted.\n * @param {Scheduler} [scheduler] The scheduler on which to schedule the\n * emissions of values.\n * @return {Observable<T>} The Observable whose values are originally from the\n * input object that was converted.\n * @static true\n * @name from\n * @owner Observable\n */\n FromObservable.create = function (ish, scheduler) {\n if (ish != null) {\n if (typeof ish[observable_1.observable] === 'function') {\n if (ish instanceof Observable_1.Observable && !scheduler) {\n return ish;\n }\n return new FromObservable(ish, scheduler);\n }\n else if (isArray_1.isArray(ish)) {\n return new ArrayObservable_1.ArrayObservable(ish, scheduler);\n }\n else if (isPromise_1.isPromise(ish)) {\n return new PromiseObservable_1.PromiseObservable(ish, scheduler);\n }\n else if (typeof ish[iterator_1.iterator] === 'function' || typeof ish === 'string') {\n return new IteratorObservable_1.IteratorObservable(ish, scheduler);\n }\n else if (isArrayLike_1.isArrayLike(ish)) {\n return new ArrayLikeObservable_1.ArrayLikeObservable(ish, scheduler);\n }\n }\n throw new TypeError((ish !== null && typeof ish || ish) + ' is not observable');\n };\n FromObservable.prototype._subscribe = function (subscriber) {\n var ish = this.ish;\n var scheduler = this.scheduler;\n if (scheduler == null) {\n return ish[observable_1.observable]().subscribe(subscriber);\n }\n else {\n return ish[observable_1.observable]().subscribe(new observeOn_1.ObserveOnSubscriber(subscriber, scheduler, 0));\n }\n };\n return FromObservable;\n}(Observable_1.Observable));\nexports.FromObservable = FromObservable;\n//# sourceMappingURL=FromObservable.js.map","\"use strict\";\nvar FromObservable_1 = require('./FromObservable');\nexports.from = FromObservable_1.FromObservable.create;\n//# sourceMappingURL=from.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\n/* tslint:enable:max-line-length */\n/**\n * Filter items emitted by the source Observable by only emitting those that\n * satisfy a specified predicate.\n *\n * <span class=\"informal\">Like\n * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\n * it only emits a value from the source if it passes a criterion function.</span>\n *\n * <img src=\"./img/filter.png\" width=\"100%\">\n *\n * Similar to the well-known `Array.prototype.filter` method, this operator\n * takes values from the source Observable, passes them through a `predicate`\n * function and only emits those values that yielded `true`.\n *\n * @example <caption>Emit only click events whose target was a DIV element</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var clicksOnDivs = clicks.filter(ev => ev.target.tagName === 'DIV');\n * clicksOnDivs.subscribe(x => console.log(x));\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n * @see {@link ignoreElements}\n * @see {@link partition}\n * @see {@link skip}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted, if `false` the value is not passed to the output\n * Observable. The `index` parameter is the number `i` for the i-th source\n * emission that has happened since the subscription, starting from the number\n * `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of values from the source that were\n * allowed by the `predicate` function.\n * @method filter\n * @owner Observable\n */\nfunction filter(predicate, thisArg) {\n return function filterOperatorFunction(source) {\n return source.lift(new FilterOperator(predicate, thisArg));\n };\n}\nexports.filter = filter;\nvar FilterOperator = (function () {\n function FilterOperator(predicate, thisArg) {\n this.predicate = predicate;\n this.thisArg = thisArg;\n }\n FilterOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));\n };\n return FilterOperator;\n}());\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar FilterSubscriber = (function (_super) {\n __extends(FilterSubscriber, _super);\n function FilterSubscriber(destination, predicate, thisArg) {\n _super.call(this, destination);\n this.predicate = predicate;\n this.thisArg = thisArg;\n this.count = 0;\n }\n // the try catch block below is left specifically for\n // optimization and perf reasons. a tryCatcher is not necessary here.\n FilterSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.predicate.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.destination.next(value);\n }\n };\n return FilterSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=filter.js.map","\"use strict\";\nvar filter_1 = require('../operators/filter');\n/* tslint:enable:max-line-length */\n/**\n * Filter items emitted by the source Observable by only emitting those that\n * satisfy a specified predicate.\n *\n * <span class=\"informal\">Like\n * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\n * it only emits a value from the source if it passes a criterion function.</span>\n *\n * <img src=\"./img/filter.png\" width=\"100%\">\n *\n * Similar to the well-known `Array.prototype.filter` method, this operator\n * takes values from the source Observable, passes them through a `predicate`\n * function and only emits those values that yielded `true`.\n *\n * @example <caption>Emit only click events whose target was a DIV element</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var clicksOnDivs = clicks.filter(ev => ev.target.tagName === 'DIV');\n * clicksOnDivs.subscribe(x => console.log(x));\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n * @see {@link ignoreElements}\n * @see {@link partition}\n * @see {@link skip}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted, if `false` the value is not passed to the output\n * Observable. The `index` parameter is the number `i` for the i-th source\n * emission that has happened since the subscription, starting from the number\n * `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of values from the source that were\n * allowed by the `predicate` function.\n * @method filter\n * @owner Observable\n */\nfunction filter(predicate, thisArg) {\n return filter_1.filter(predicate, thisArg)(this);\n}\nexports.filter = filter;\n//# sourceMappingURL=filter.js.map","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport { Observable } from 'rxjs/Observable';\nimport { of as _of } from 'rxjs/observable/of';\nimport { from as _from } from 'rxjs/observable/from';\nimport { filter } from 'rxjs/operator/filter';\n\nexport var ActionsObservable = function (_Observable) {\n _inherits(ActionsObservable, _Observable);\n\n _createClass(ActionsObservable, null, [{\n key: 'of',\n value: function of() {\n return new this(_of.apply(undefined, arguments));\n }\n }, {\n key: 'from',\n value: function from(actions, scheduler) {\n return new this(_from(actions, scheduler));\n }\n }]);\n\n function ActionsObservable(actionsSubject) {\n _classCallCheck(this, ActionsObservable);\n\n var _this = _possibleConstructorReturn(this, (ActionsObservable.__proto__ || Object.getPrototypeOf(ActionsObservable)).call(this));\n\n _this.source = actionsSubject;\n return _this;\n }\n\n _createClass(ActionsObservable, [{\n key: 'lift',\n value: function lift(operator) {\n var observable = new ActionsObservable(this);\n observable.operator = operator;\n return observable;\n }\n }, {\n key: 'ofType',\n value: function ofType() {\n for (var _len = arguments.length, keys = Array(_len), _key = 0; _key < _len; _key++) {\n keys[_key] = arguments[_key];\n }\n\n return filter.call(this, function (_ref) {\n var type = _ref.type;\n\n var len = keys.length;\n if (len === 1) {\n return type === keys[0];\n } else {\n for (var i = 0; i < len; i++) {\n if (keys[i] === type) {\n return true;\n }\n }\n }\n return false;\n });\n }\n }]);\n\n return ActionsObservable;\n}(Observable);","export var EPIC_END = '@@redux-observable/EPIC_END';","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nimport { Subject } from 'rxjs/Subject';\nimport { map } from 'rxjs/operator/map';\nimport { switchMap } from 'rxjs/operator/switchMap';\nimport { ActionsObservable } from './ActionsObservable';\nimport { EPIC_END } from './EPIC_END';\n\nvar defaultAdapter = {\n input: function input(action$) {\n return action$;\n },\n output: function output(action$) {\n return action$;\n }\n};\n\nvar defaultOptions = {\n adapter: defaultAdapter\n};\n\nexport function createEpicMiddleware(epic) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions;\n\n if (typeof epic !== 'function') {\n throw new TypeError('You must provide a root Epic to createEpicMiddleware');\n }\n\n // even though we used default param, we need to merge the defaults\n // inside the options object as well in case they declare only some\n options = _extends({}, defaultOptions, options);\n var input$ = new Subject();\n var action$ = options.adapter.input(new ActionsObservable(input$));\n var epic$ = new Subject();\n var store = void 0;\n\n var epicMiddleware = function epicMiddleware(_store) {\n store = _store;\n\n return function (next) {\n var _context;\n\n (_context = map.call(epic$, function (epic) {\n var output$ = 'dependencies' in options ? epic(action$, store, options.dependencies) : epic(action$, store);\n\n if (!output$) {\n throw new TypeError('Your root Epic \"' + (epic.name || '<anonymous>') + '\" does not return a stream. Double check you\\'re not missing a return statement!');\n }\n\n return output$;\n }), switchMap).call(_context, function (output$) {\n return options.adapter.output(output$);\n }).subscribe(store.dispatch);\n\n // Setup initial root epic\n epic$.next(epic);\n\n return function (action) {\n var result = next(action);\n input$.next(action);\n return result;\n };\n };\n };\n\n epicMiddleware.replaceEpic = function (epic) {\n // gives the previous root Epic a last chance\n // to do some clean up\n store.dispatch({ type: EPIC_END });\n // switches to the new root Epic, synchronously terminating\n // the previous one\n epic$.next(epic);\n };\n\n return epicMiddleware;\n}","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar subscribeToResult_1 = require('../util/subscribeToResult');\nvar OuterSubscriber_1 = require('../OuterSubscriber');\n/* tslint:enable:max-line-length */\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link mergeAll}.</span>\n *\n * <img src=\"./img/mergeMap.png\" width=\"100%\">\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an Observable, and then merging those resulting Observables and\n * emitting the results of this merger.\n *\n * @example <caption>Map and flatten each letter to an Observable ticking every 1 second</caption>\n * var letters = Rx.Observable.of('a', 'b', 'c');\n * var result = letters.mergeMap(x =>\n * Rx.Observable.interval(1000).map(i => x+i)\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // a0\n * // b0\n * // c0\n * // a1\n * // b1\n * // c1\n * // continues to list a,b,c with respective ascending integers\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link merge}\n * @see {@link mergeAll}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]\n * A function to produce the value on the output Observable based on the values\n * and the indices of the source (outer) emission and the inner Observable\n * emission. The arguments passed to this function are:\n * - `outerValue`: the value that came from the source\n * - `innerValue`: the value that came from the projected Observable\n * - `outerIndex`: the \"index\" of the value that came from the source\n * - `innerIndex`: the \"index\" of the value from the projected Observable\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional `resultSelector`) to each item emitted\n * by the source Observable and merging the results of the Observables obtained\n * from this transformation.\n * @method mergeMap\n * @owner Observable\n */\nfunction mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n return function mergeMapOperatorFunction(source) {\n if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n resultSelector = null;\n }\n return source.lift(new MergeMapOperator(project, resultSelector, concurrent));\n };\n}\nexports.mergeMap = mergeMap;\nvar MergeMapOperator = (function () {\n function MergeMapOperator(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n this.project = project;\n this.resultSelector = resultSelector;\n this.concurrent = concurrent;\n }\n MergeMapOperator.prototype.call = function (observer, source) {\n return source.subscribe(new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent));\n };\n return MergeMapOperator;\n}());\nexports.MergeMapOperator = MergeMapOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar MergeMapSubscriber = (function (_super) {\n __extends(MergeMapSubscriber, _super);\n function MergeMapSubscriber(destination, project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n _super.call(this, destination);\n this.project = project;\n this.resultSelector = resultSelector;\n this.concurrent = concurrent;\n this.hasCompleted = false;\n this.buffer = [];\n this.active = 0;\n this.index = 0;\n }\n MergeMapSubscriber.prototype._next = function (value) {\n if (this.active < this.concurrent) {\n this._tryNext(value);\n }\n else {\n this.buffer.push(value);\n }\n };\n MergeMapSubscriber.prototype._tryNext = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.active++;\n this._innerSub(result, value, index);\n };\n MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {\n this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index));\n };\n MergeMapSubscriber.prototype._complete = function () {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n this.destination.complete();\n }\n };\n MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n if (this.resultSelector) {\n this._notifyResultSelector(outerValue, innerValue, outerIndex, innerIndex);\n }\n else {\n this.destination.next(innerValue);\n }\n };\n MergeMapSubscriber.prototype._notifyResultSelector = function (outerValue, innerValue, outerIndex, innerIndex) {\n var result;\n try {\n result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {\n var buffer = this.buffer;\n this.remove(innerSub);\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift());\n }\n else if (this.active === 0 && this.hasCompleted) {\n this.destination.complete();\n }\n };\n return MergeMapSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\nexports.MergeMapSubscriber = MergeMapSubscriber;\n//# sourceMappingURL=mergeMap.js.map","\"use strict\";\nfunction identity(x) {\n return x;\n}\nexports.identity = identity;\n//# sourceMappingURL=identity.js.map","\"use strict\";\nvar mergeMap_1 = require('./mergeMap');\nvar identity_1 = require('../util/identity');\n/**\n * Converts a higher-order Observable into a first-order Observable which\n * concurrently delivers all values that are emitted on the inner Observables.\n *\n * <span class=\"informal\">Flattens an Observable-of-Observables.</span>\n *\n * <img src=\"./img/mergeAll.png\" width=\"100%\">\n *\n * `mergeAll` subscribes to an Observable that emits Observables, also known as\n * a higher-order Observable. Each time it observes one of these emitted inner\n * Observables, it subscribes to that and delivers all the values from the\n * inner Observable on the output Observable. The output Observable only\n * completes once all inner Observables have completed. Any error delivered by\n * a inner Observable will be immediately emitted on the output Observable.\n *\n * @example <caption>Spawn a new interval Observable for each click event, and blend their outputs as one Observable</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000));\n * var firstOrder = higherOrder.mergeAll();\n * firstOrder.subscribe(x => console.log(x));\n *\n * @example <caption>Count from 0 to 9 every second for each click, but only allow 2 concurrent timers</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000).take(10));\n * var firstOrder = higherOrder.mergeAll(2);\n * firstOrder.subscribe(x => console.log(x));\n *\n * @see {@link combineAll}\n * @see {@link concatAll}\n * @see {@link exhaust}\n * @see {@link merge}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switch}\n * @see {@link zipAll}\n *\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of inner\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits values coming from all the\n * inner Observables emitted by the source Observable.\n * @method mergeAll\n * @owner Observable\n */\nfunction mergeAll(concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n return mergeMap_1.mergeMap(identity_1.identity, null, concurrent);\n}\nexports.mergeAll = mergeAll;\n//# sourceMappingURL=mergeAll.js.map","\"use strict\";\nvar Observable_1 = require('../Observable');\nvar ArrayObservable_1 = require('../observable/ArrayObservable');\nvar mergeAll_1 = require('./mergeAll');\nvar isScheduler_1 = require('../util/isScheduler');\n/* tslint:enable:max-line-length */\nfunction merge() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i - 0] = arguments[_i];\n }\n return function (source) { return source.lift.call(mergeStatic.apply(void 0, [source].concat(observables))); };\n}\nexports.merge = merge;\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which concurrently emits all values from every\n * given input Observable.\n *\n * <span class=\"informal\">Flattens multiple Observables together by blending\n * their values into one Observable.</span>\n *\n * <img src=\"./img/merge.png\" width=\"100%\">\n *\n * `merge` subscribes to each given input Observable (as arguments), and simply\n * forwards (without doing any transformation) all the values from all the input\n * Observables to the output Observable. The output Observable only completes\n * once all input Observables have completed. Any error delivered by an input\n * Observable will be immediately emitted on the output Observable.\n *\n * @example <caption>Merge together two Observables: 1s interval and clicks</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var timer = Rx.Observable.interval(1000);\n * var clicksOrTimer = Rx.Observable.merge(clicks, timer);\n * clicksOrTimer.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // timer will emit ascending values, one every second(1000ms) to console\n * // clicks logs MouseEvents to console everytime the \"document\" is clicked\n * // Since the two streams are merged you see these happening\n * // as they occur.\n *\n * @example <caption>Merge together 3 Observables, but only 2 run concurrently</caption>\n * var timer1 = Rx.Observable.interval(1000).take(10);\n * var timer2 = Rx.Observable.interval(2000).take(6);\n * var timer3 = Rx.Observable.interval(500).take(10);\n * var concurrent = 2; // the argument\n * var merged = Rx.Observable.merge(timer1, timer2, timer3, concurrent);\n * merged.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // - First timer1 and timer2 will run concurrently\n * // - timer1 will emit a value every 1000ms for 10 iterations\n * // - timer2 will emit a value every 2000ms for 6 iterations\n * // - after timer1 hits it's max iteration, timer2 will\n * // continue, and timer3 will start to run concurrently with timer2\n * // - when timer2 hits it's max iteration it terminates, and\n * // timer3 will continue to emit a value every 500ms until it is complete\n *\n * @see {@link mergeAll}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n *\n * @param {...ObservableInput} observables Input Observables to merge together.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @param {Scheduler} [scheduler=null] The IScheduler to use for managing\n * concurrency of input Observables.\n * @return {Observable} an Observable that emits items that are the result of\n * every input Observable.\n * @static true\n * @name merge\n * @owner Observable\n */\nfunction mergeStatic() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i - 0] = arguments[_i];\n }\n var concurrent = Number.POSITIVE_INFINITY;\n var scheduler = null;\n var last = observables[observables.length - 1];\n if (isScheduler_1.isScheduler(last)) {\n scheduler = observables.pop();\n if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {\n concurrent = observables.pop();\n }\n }\n else if (typeof last === 'number') {\n concurrent = observables.pop();\n }\n if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable_1.Observable) {\n return observables[0];\n }\n return mergeAll_1.mergeAll(concurrent)(new ArrayObservable_1.ArrayObservable(observables, scheduler));\n}\nexports.mergeStatic = mergeStatic;\n//# sourceMappingURL=merge.js.map","\"use strict\";\nvar merge_1 = require('../operators/merge');\nvar merge_2 = require('../operators/merge');\nexports.mergeStatic = merge_2.mergeStatic;\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which concurrently emits all values from every\n * given input Observable.\n *\n * <span class=\"informal\">Flattens multiple Observables together by blending\n * their values into one Observable.</span>\n *\n * <img src=\"./img/merge.png\" width=\"100%\">\n *\n * `merge` subscribes to each given input Observable (either the source or an\n * Observable given as argument), and simply forwards (without doing any\n * transformation) all the values from all the input Observables to the output\n * Observable. The output Observable only completes once all input Observables\n * have completed. Any error delivered by an input Observable will be immediately\n * emitted on the output Observable.\n *\n * @example <caption>Merge together two Observables: 1s interval and clicks</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var timer = Rx.Observable.interval(1000);\n * var clicksOrTimer = clicks.merge(timer);\n * clicksOrTimer.subscribe(x => console.log(x));\n *\n * @example <caption>Merge together 3 Observables, but only 2 run concurrently</caption>\n * var timer1 = Rx.Observable.interval(1000).take(10);\n * var timer2 = Rx.Observable.interval(2000).take(6);\n * var timer3 = Rx.Observable.interval(500).take(10);\n * var concurrent = 2; // the argument\n * var merged = timer1.merge(timer2, timer3, concurrent);\n * merged.subscribe(x => console.log(x));\n *\n * @see {@link mergeAll}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n *\n * @param {ObservableInput} other An input Observable to merge with the source\n * Observable. More than one input Observables may be given as argument.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @param {Scheduler} [scheduler=null] The IScheduler to use for managing\n * concurrency of input Observables.\n * @return {Observable} An Observable that emits items that are the result of\n * every input Observable.\n * @method merge\n * @owner Observable\n */\nfunction merge() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i - 0] = arguments[_i];\n }\n return merge_1.merge.apply(void 0, observables)(this);\n}\nexports.merge = merge;\n//# sourceMappingURL=merge.js.map","\"use strict\";\nvar merge_1 = require('../operator/merge');\nexports.merge = merge_1.mergeStatic;\n//# sourceMappingURL=merge.js.map","function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nimport { merge } from 'rxjs/observable/merge';\n\n/**\n Merges all epics into a single one.\n */\nexport var combineEpics = function combineEpics() {\n for (var _len = arguments.length, epics = Array(_len), _key = 0; _key < _len; _key++) {\n epics[_key] = arguments[_key];\n }\n\n return function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge.apply(undefined, _toConsumableArray(epics.map(function (epic) {\n var output$ = epic.apply(undefined, args);\n if (!output$) {\n throw new TypeError('combineEpics: one of the provided Epics \"' + (epic.name || '<anonymous>') + '\" does not return a stream. Double check you\\'re not missing a return statement!');\n }\n return output$;\n })));\n };\n};","\"use strict\";\nvar mergeAll_1 = require('./mergeAll');\n/**\n * Converts a higher-order Observable into a first-order Observable by\n * concatenating the inner Observables in order.\n *\n * <span class=\"informal\">Flattens an Observable-of-Observables by putting one\n * inner Observable after the other.</span>\n *\n * <img src=\"./img/concatAll.png\" width=\"100%\">\n *\n * Joins every Observable emitted by the source (a higher-order Observable), in\n * a serial fashion. It subscribes to each inner Observable only after the\n * previous inner Observable has completed, and merges all of their values into\n * the returned observable.\n *\n * __Warning:__ If the source Observable emits Observables quickly and\n * endlessly, and the inner Observables it emits generally complete slower than\n * the source emits, you can run into memory issues as the incoming Observables\n * collect in an unbounded buffer.\n *\n * Note: `concatAll` is equivalent to `mergeAll` with concurrency parameter set\n * to `1`.\n *\n * @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var higherOrder = clicks.map(ev => Rx.Observable.interval(1000).take(4));\n * var firstOrder = higherOrder.concatAll();\n * firstOrder.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n *\n * @see {@link combineAll}\n * @see {@link concat}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n * @see {@link exhaust}\n * @see {@link mergeAll}\n * @see {@link switch}\n * @see {@link zipAll}\n *\n * @return {Observable} An Observable emitting values from all the inner\n * Observables concatenated.\n * @method concatAll\n * @owner Observable\n */\nfunction concatAll() {\n return mergeAll_1.mergeAll(1);\n}\nexports.concatAll = concatAll;\n//# sourceMappingURL=concatAll.js.map","\"use strict\";\nvar isScheduler_1 = require('../util/isScheduler');\nvar of_1 = require('./of');\nvar from_1 = require('./from');\nvar concatAll_1 = require('../operators/concatAll');\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which sequentially emits all values from given\n * Observable and then moves on to the next.\n *\n * <span class=\"informal\">Concatenates multiple Observables together by\n * sequentially emitting their values, one Observable after the other.</span>\n *\n * <img src=\"./img/concat.png\" width=\"100%\">\n *\n * `concat` joins multiple Observables together, by subscribing to them one at a time and\n * merging their results into the output Observable. You can pass either an array of\n * Observables, or put them directly as arguments. Passing an empty array will result\n * in Observable that completes immediately.\n *\n * `concat` will subscribe to first input Observable and emit all its values, without\n * changing or affecting them in any way. When that Observable completes, it will\n * subscribe to then next Observable passed and, again, emit its values. This will be\n * repeated, until the operator runs out of Observables. When last input Observable completes,\n * `concat` will complete as well. At any given moment only one Observable passed to operator\n * emits values. If you would like to emit values from passed Observables concurrently, check out\n * {@link merge} instead, especially with optional `concurrent` parameter. As a matter of fact,\n * `concat` is an equivalent of `merge` operator with `concurrent` parameter set to `1`.\n *\n * Note that if some input Observable never completes, `concat` will also never complete\n * and Observables following the one that did not complete will never be subscribed. On the other\n * hand, if some Observable simply completes immediately after it is subscribed, it will be\n * invisible for `concat`, which will just move on to the next Observable.\n *\n * If any Observable in chain errors, instead of passing control to the next Observable,\n * `concat` will error immediately as well. Observables that would be subscribed after\n * the one that emitted error, never will.\n *\n * If you pass to `concat` the same Observable many times, its stream of values\n * will be \"replayed\" on every subscription, which means you can repeat given Observable\n * as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious,\n * you can always use {@link repeat}.\n *\n * @example <caption>Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10</caption>\n * var timer = Rx.Observable.interval(1000).take(4);\n * var sequence = Rx.Observable.range(1, 10);\n * var result = Rx.Observable.concat(timer, sequence);\n * result.subscribe(x => console.log(x));\n *\n * // results in:\n * // 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10\n *\n *\n * @example <caption>Concatenate an array of 3 Observables</caption>\n * var timer1 = Rx.Observable.interval(1000).take(10);\n * var timer2 = Rx.Observable.interval(2000).take(6);\n * var timer3 = Rx.Observable.interval(500).take(10);\n * var result = Rx.Observable.concat([timer1, timer2, timer3]); // note that array is passed\n * result.subscribe(x => console.log(x));\n *\n * // results in the following:\n * // (Prints to console sequentially)\n * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9\n * // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5\n * // -500ms-> 0 -500ms-> 1 -500ms-> ... 9\n *\n *\n * @example <caption>Concatenate the same Observable to repeat it</caption>\n * const timer = Rx.Observable.interval(1000).take(2);\n *\n * Rx.Observable.concat(timer, timer) // concating the same Observable!\n * .subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('...and it is done!')\n * );\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 0 after 3s\n * // 1 after 4s\n * // \"...and it is done!\" also after 4s\n *\n * @see {@link concatAll}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n *\n * @param {ObservableInput} input1 An input Observable to concatenate with others.\n * @param {ObservableInput} input2 An input Observable to concatenate with others.\n * More than one input Observables may be given as argument.\n * @param {Scheduler} [scheduler=null] An optional IScheduler to schedule each\n * Observable subscription on.\n * @return {Observable} All values of each passed Observable merged into a\n * single Observable, in order, in serial fashion.\n * @static true\n * @name concat\n * @owner Observable\n */\nfunction concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i - 0] = arguments[_i];\n }\n if (observables.length === 1 || (observables.length === 2 && isScheduler_1.isScheduler(observables[1]))) {\n return from_1.from(observables[0]);\n }\n return concatAll_1.concatAll()(of_1.of.apply(void 0, observables));\n}\nexports.concat = concat;\n//# sourceMappingURL=concat.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar concat_1 = require('../../observable/concat');\nObservable_1.Observable.concat = concat_1.concat;\n//# sourceMappingURL=concat.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\nvar EmptyObservable_1 = require('./EmptyObservable');\nvar isArray_1 = require('../util/isArray');\nvar subscribeToResult_1 = require('../util/subscribeToResult');\nvar OuterSubscriber_1 = require('../OuterSubscriber');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ForkJoinObservable = (function (_super) {\n __extends(ForkJoinObservable, _super);\n function ForkJoinObservable(sources, resultSelector) {\n _super.call(this);\n this.sources = sources;\n this.resultSelector = resultSelector;\n }\n /* tslint:enable:max-line-length */\n /**\n * Joins last values emitted by passed Observables.\n *\n * <span class=\"informal\">Wait for Observables to complete and then combine last values they emitted.</span>\n *\n * <img src=\"./img/forkJoin.png\" width=\"100%\">\n *\n * `forkJoin` is an operator that takes any number of Observables which can be passed either as an array\n * or directly as arguments. If no input Observables are provided, resulting stream will complete\n * immediately.\n *\n * `forkJoin` will wait for all passed Observables to complete and then it will emit an array with last\n * values from corresponding Observables. So if you pass `n` Observables to the operator, resulting\n * array will have `n` values, where first value is the last thing emitted by the first Observable,\n * second value is the last thing emitted by the second Observable and so on. That means `forkJoin` will\n * not emit more than once and it will complete after that. If you need to emit combined values not only\n * at the end of lifecycle of passed Observables, but also throughout it, try out {@link combineLatest}\n * or {@link zip} instead.\n *\n * In order for resulting array to have the same length as the number of input Observables, whenever any of\n * that Observables completes without emitting any value, `forkJoin` will complete at that moment as well\n * and it will not emit anything either, even if it already has some last values from other Observables.\n * Conversely, if there is an Observable that never completes, `forkJoin` will never complete as well,\n * unless at any point some other Observable completes without emitting value, which brings us back to\n * the previous case. Overall, in order for `forkJoin` to emit a value, all Observables passed as arguments\n * have to emit something at least once and complete.\n *\n * If any input Observable errors at some point, `forkJoin` will error as well and all other Observables\n * will be immediately unsubscribed.\n *\n * Optionally `forkJoin` accepts project function, that will be called with values which normally\n * would land in emitted array. Whatever is returned by project function, will appear in output\n * Observable instead. This means that default project can be thought of as a function that takes\n * all its arguments and puts them into an array. Note that project function will be called only\n * when output Observable is supposed to emit a result.\n *\n * @example <caption>Use forkJoin with operator emitting immediately</caption>\n * const observable = Rx.Observable.forkJoin(\n * Rx.Observable.of(1, 2, 3, 4),\n * Rx.Observable.of(5, 6, 7, 8)\n * );\n * observable.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('This is how it ends!')\n * );\n *\n * // Logs:\n * // [4, 8]\n * // \"This is how it ends!\"\n *\n *\n * @example <caption>Use forkJoin with operator emitting after some time</caption>\n * const observable = Rx.Observable.forkJoin(\n * Rx.Observable.interval(1000).take(3), // emit 0, 1, 2 every second and complete\n * Rx.Observable.interval(500).take(4) // emit 0, 1, 2, 3 every half a second and complete\n * );\n * observable.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('This is how it ends!')\n * );\n *\n * // Logs:\n * // [2, 3] after 3 seconds\n * // \"This is how it ends!\" immediately after\n *\n *\n * @example <caption>Use forkJoin with project function</caption>\n * const observable = Rx.Observable.forkJoin(\n * Rx.Observable.interval(1000).take(3), // emit 0, 1, 2 every second and complete\n * Rx.Observable.interval(500).take(4), // emit 0, 1, 2, 3 every half a second and complete\n * (n, m) => n + m\n * );\n * observable.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('This is how it ends!')\n * );\n *\n * // Logs:\n * // 5 after 3 seconds\n * // \"This is how it ends!\" immediately after\n *\n * @see {@link combineLatest}\n * @see {@link zip}\n *\n * @param {...SubscribableOrPromise} sources Any number of Observables provided either as an array or as an arguments\n * passed directly to the operator.\n * @param {function} [project] Function that takes values emitted by input Observables and returns value\n * that will appear in resulting Observable instead of default array.\n * @return {Observable} Observable emitting either an array of last values emitted by passed Observables\n * or value from project function.\n * @static true\n * @name forkJoin\n * @owner Observable\n */\n ForkJoinObservable.create = function () {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i - 0] = arguments[_i];\n }\n if (sources === null || arguments.length === 0) {\n return new EmptyObservable_1.EmptyObservable();\n }\n var resultSelector = null;\n if (typeof sources[sources.length - 1] === 'function') {\n resultSelector = sources.pop();\n }\n // if the first and only other argument besides the resultSelector is an array\n // assume it's been called with `forkJoin([obs1, obs2, obs3], resultSelector)`\n if (sources.length === 1 && isArray_1.isArray(sources[0])) {\n sources = sources[0];\n }\n if (sources.length === 0) {\n return new EmptyObservable_1.EmptyObservable();\n }\n return new ForkJoinObservable(sources, resultSelector);\n };\n ForkJoinObservable.prototype._subscribe = function (subscriber) {\n return new ForkJoinSubscriber(subscriber, this.sources, this.resultSelector);\n };\n return ForkJoinObservable;\n}(Observable_1.Observable));\nexports.ForkJoinObservable = ForkJoinObservable;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar ForkJoinSubscriber = (function (_super) {\n __extends(ForkJoinSubscriber, _super);\n function ForkJoinSubscriber(destination, sources, resultSelector) {\n _super.call(this, destination);\n this.sources = sources;\n this.resultSelector = resultSelector;\n this.completed = 0;\n this.haveValues = 0;\n var len = sources.length;\n this.total = len;\n this.values = new Array(len);\n for (var i = 0; i < len; i++) {\n var source = sources[i];\n var innerSubscription = subscribeToResult_1.subscribeToResult(this, source, null, i);\n if (innerSubscription) {\n innerSubscription.outerIndex = i;\n this.add(innerSubscription);\n }\n }\n }\n ForkJoinSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.values[outerIndex] = innerValue;\n if (!innerSub._hasValue) {\n innerSub._hasValue = true;\n this.haveValues++;\n }\n };\n ForkJoinSubscriber.prototype.notifyComplete = function (innerSub) {\n var destination = this.destination;\n var _a = this, haveValues = _a.haveValues, resultSelector = _a.resultSelector, values = _a.values;\n var len = values.length;\n if (!innerSub._hasValue) {\n destination.complete();\n return;\n }\n this.completed++;\n if (this.completed !== len) {\n return;\n }\n if (haveValues === len) {\n var value = resultSelector ? resultSelector.apply(this, values) : values;\n destination.next(value);\n }\n destination.complete();\n };\n return ForkJoinSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\n//# sourceMappingURL=ForkJoinObservable.js.map","\"use strict\";\nvar ForkJoinObservable_1 = require('./ForkJoinObservable');\nexports.forkJoin = ForkJoinObservable_1.ForkJoinObservable.create;\n//# sourceMappingURL=forkJoin.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar forkJoin_1 = require('../../observable/forkJoin');\nObservable_1.Observable.forkJoin = forkJoin_1.forkJoin;\n//# sourceMappingURL=forkJoin.js.map","\"use strict\";\nvar PromiseObservable_1 = require('./PromiseObservable');\nexports.fromPromise = PromiseObservable_1.PromiseObservable.create;\n//# sourceMappingURL=fromPromise.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar fromPromise_1 = require('../../observable/fromPromise');\nObservable_1.Observable.fromPromise = fromPromise_1.fromPromise;\n//# sourceMappingURL=fromPromise.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar OuterSubscriber_1 = require('../OuterSubscriber');\nvar subscribeToResult_1 = require('../util/subscribeToResult');\n/**\n * Catches errors on the observable to be handled by returning a new observable or throwing an error.\n *\n * <img src=\"./img/catch.png\" width=\"100%\">\n *\n * @example <caption>Continues with a different Observable when there's an error</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * \t if (n == 4) {\n * \t throw 'four!';\n * }\n *\t return n;\n * })\n * .catch(err => Observable.of('I', 'II', 'III', 'IV', 'V'))\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, I, II, III, IV, V\n *\n * @example <caption>Retries the caught source Observable again in case of error, similar to retry() operator</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * \t if (n === 4) {\n * \t throw 'four!';\n * }\n * \t return n;\n * })\n * .catch((err, caught) => caught)\n * .take(30)\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, 1, 2, 3, ...\n *\n * @example <caption>Throws a new error when the source Observable throws an error</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * if (n == 4) {\n * throw 'four!';\n * }\n * return n;\n * })\n * .catch(err => {\n * throw 'error in source. Details: ' + err;\n * })\n * .subscribe(\n * x => console.log(x),\n * err => console.log(err)\n * );\n * // 1, 2, 3, error in source. Details: four!\n *\n * @param {function} selector a function that takes as arguments `err`, which is the error, and `caught`, which\n * is the source observable, in case you'd like to \"retry\" that observable by returning it again. Whatever observable\n * is returned by the `selector` will be used to continue the observable chain.\n * @return {Observable} An observable that originates from either the source or the observable returned by the\n * catch `selector` function.\n * @name catchError\n */\nfunction catchError(selector) {\n return function catchErrorOperatorFunction(source) {\n var operator = new CatchOperator(selector);\n var caught = source.lift(operator);\n return (operator.caught = caught);\n };\n}\nexports.catchError = catchError;\nvar CatchOperator = (function () {\n function CatchOperator(selector) {\n this.selector = selector;\n }\n CatchOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));\n };\n return CatchOperator;\n}());\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar CatchSubscriber = (function (_super) {\n __extends(CatchSubscriber, _super);\n function CatchSubscriber(destination, selector, caught) {\n _super.call(this, destination);\n this.selector = selector;\n this.caught = caught;\n }\n // NOTE: overriding `error` instead of `_error` because we don't want\n // to have this flag this subscriber as `isStopped`. We can mimic the\n // behavior of the RetrySubscriber (from the `retry` operator), where\n // we unsubscribe from our source chain, reset our Subscriber flags,\n // then subscribe to the selector result.\n CatchSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var result = void 0;\n try {\n result = this.selector(err, this.caught);\n }\n catch (err2) {\n _super.prototype.error.call(this, err2);\n return;\n }\n this._unsubscribeAndRecycle();\n this.add(subscribeToResult_1.subscribeToResult(this, result));\n }\n };\n return CatchSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\n//# sourceMappingURL=catchError.js.map","\"use strict\";\nvar catchError_1 = require('../operators/catchError');\n/**\n * Catches errors on the observable to be handled by returning a new observable or throwing an error.\n *\n * <img src=\"./img/catch.png\" width=\"100%\">\n *\n * @example <caption>Continues with a different Observable when there's an error</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * \t if (n == 4) {\n * \t throw 'four!';\n * }\n *\t return n;\n * })\n * .catch(err => Observable.of('I', 'II', 'III', 'IV', 'V'))\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, I, II, III, IV, V\n *\n * @example <caption>Retries the caught source Observable again in case of error, similar to retry() operator</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * \t if (n === 4) {\n * \t throw 'four!';\n * }\n * \t return n;\n * })\n * .catch((err, caught) => caught)\n * .take(30)\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, 1, 2, 3, ...\n *\n * @example <caption>Throws a new error when the source Observable throws an error</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * if (n == 4) {\n * throw 'four!';\n * }\n * return n;\n * })\n * .catch(err => {\n * throw 'error in source. Details: ' + err;\n * })\n * .subscribe(\n * x => console.log(x),\n * err => console.log(err)\n * );\n * // 1, 2, 3, error in source. Details: four!\n *\n * @param {function} selector a function that takes as arguments `err`, which is the error, and `caught`, which\n * is the source observable, in case you'd like to \"retry\" that observable by returning it again. Whatever observable\n * is returned by the `selector` will be used to continue the observable chain.\n * @return {Observable} An observable that originates from either the source or the observable returned by the\n * catch `selector` function.\n * @method catch\n * @name catch\n * @owner Observable\n */\nfunction _catch(selector) {\n return catchError_1.catchError(selector)(this);\n}\nexports._catch = _catch;\n//# sourceMappingURL=catch.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar catch_1 = require('../../operator/catch');\nObservable_1.Observable.prototype.catch = catch_1._catch;\nObservable_1.Observable.prototype._catch = catch_1._catch;\n//# sourceMappingURL=catch.js.map","\"use strict\";\nvar mergeMap_1 = require('./mergeMap');\n/* tslint:enable:max-line-length */\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, in a serialized fashion waiting for each one to complete before\n * merging the next.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link concatAll}.</span>\n *\n * <img src=\"./img/concatMap.png\" width=\"100%\">\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each new inner Observable is\n * concatenated with the previous inner Observable.\n *\n * __Warning:__ if source values arrive endlessly and faster than their\n * corresponding inner Observables can complete, it will result in memory issues\n * as inner Observables amass in an unbounded buffer waiting for their turn to\n * be subscribed to.\n *\n * Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set\n * to `1`.\n *\n * @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.concatMap(ev => Rx.Observable.interval(1000).take(4));\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n *\n * @see {@link concat}\n * @see {@link concatAll}\n * @see {@link concatMapTo}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]\n * A function to produce the value on the output Observable based on the values\n * and the indices of the source (outer) emission and the inner Observable\n * emission. The arguments passed to this function are:\n * - `outerValue`: the value that came from the source\n * - `innerValue`: the value that came from the projected Observable\n * - `outerIndex`: the \"index\" of the value that came from the source\n * - `innerIndex`: the \"index\" of the value from the projected Observable\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional `resultSelector`) to each item emitted\n * by the source Observable and taking values from each projected inner\n * Observable sequentially.\n * @method concatMap\n * @owner Observable\n */\nfunction concatMap(project, resultSelector) {\n return mergeMap_1.mergeMap(project, resultSelector, 1);\n}\nexports.concatMap = concatMap;\n//# sourceMappingURL=concatMap.js.map","\"use strict\";\nvar concatMap_1 = require('../operators/concatMap');\n/* tslint:enable:max-line-length */\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, in a serialized fashion waiting for each one to complete before\n * merging the next.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link concatAll}.</span>\n *\n * <img src=\"./img/concatMap.png\" width=\"100%\">\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each new inner Observable is\n * concatenated with the previous inner Observable.\n *\n * __Warning:__ if source values arrive endlessly and faster than their\n * corresponding inner Observables can complete, it will result in memory issues\n * as inner Observables amass in an unbounded buffer waiting for their turn to\n * be subscribed to.\n *\n * Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set\n * to `1`.\n *\n * @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.concatMap(ev => Rx.Observable.interval(1000).take(4));\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n *\n * @see {@link concat}\n * @see {@link concatAll}\n * @see {@link concatMapTo}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]\n * A function to produce the value on the output Observable based on the values\n * and the indices of the source (outer) emission and the inner Observable\n * emission. The arguments passed to this function are:\n * - `outerValue`: the value that came from the source\n * - `innerValue`: the value that came from the projected Observable\n * - `outerIndex`: the \"index\" of the value that came from the source\n * - `innerIndex`: the \"index\" of the value from the projected Observable\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional `resultSelector`) to each item emitted\n * by the source Observable and taking values from each projected inner\n * Observable sequentially.\n * @method concatMap\n * @owner Observable\n */\nfunction concatMap(project, resultSelector) {\n return concatMap_1.concatMap(project, resultSelector)(this);\n}\nexports.concatMap = concatMap;\n//# sourceMappingURL=concatMap.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar concatMap_1 = require('../../operator/concatMap');\nObservable_1.Observable.prototype.concatMap = concatMap_1.concatMap;\n//# sourceMappingURL=concatMap.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscription_1 = require('../Subscription');\n/**\n * A unit of work to be executed in a {@link Scheduler}. An action is typically\n * created from within a Scheduler and an RxJS user does not need to concern\n * themselves about creating and manipulating an Action.\n *\n * ```ts\n * class Action<T> extends Subscription {\n * new (scheduler: Scheduler, work: (state?: T) => void);\n * schedule(state?: T, delay: number = 0): Subscription;\n * }\n * ```\n *\n * @class Action<T>\n */\nvar Action = (function (_super) {\n __extends(Action, _super);\n function Action(scheduler, work) {\n _super.call(this);\n }\n /**\n * Schedules this action on its parent Scheduler for execution. May be passed\n * some context object, `state`. May happen at some point in the future,\n * according to the `delay` parameter, if specified.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler.\n * @return {void}\n */\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n return this;\n };\n return Action;\n}(Subscription_1.Subscription));\nexports.Action = Action;\n//# sourceMappingURL=Action.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar root_1 = require('../util/root');\nvar Action_1 = require('./Action');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar AsyncAction = (function (_super) {\n __extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n _super.call(this, scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n this.pending = false;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n if (this.closed) {\n return this;\n }\n // Always replace the current state with the new state.\n this.state = state;\n // Set the pending flag indicating that this action has been scheduled, or\n // has recursively rescheduled itself.\n this.pending = true;\n var id = this.id;\n var scheduler = this.scheduler;\n //\n // Important implementation note:\n //\n // Actions only execute once by default, unless rescheduled from within the\n // scheduled callback. This allows us to implement single and repeat\n // actions via the same code path, without adding API surface area, as well\n // as mimic traditional recursion but across asynchronous boundaries.\n //\n // However, JS runtimes and timers distinguish between intervals achieved by\n // serial `setTimeout` calls vs. a single `setInterval` call. An interval of\n // serial `setTimeout` calls can be individually delayed, which delays\n // scheduling the next `setTimeout`, and so on. `setInterval` attempts to\n // guarantee the interval callback will be invoked more precisely to the\n // interval period, regardless of load.\n //\n // Therefore, we use `setInterval` to schedule single and repeat actions.\n // If the action reschedules itself with the same delay, the interval is not\n // canceled. If the action doesn't reschedule, or reschedules with a\n // different delay, the interval will be canceled after scheduled callback\n // execution.\n //\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.delay = delay;\n // If this action has already an async Id, don't request a new one.\n this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n return root_1.root.setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n // If this action is rescheduled with the same delay time, don't clear the interval id.\n if (delay !== null && this.delay === delay && this.pending === false) {\n return id;\n }\n // Otherwise, if the action's delay time is different from the current delay,\n // or the action has been rescheduled before it's executed, clear the interval id\n return root_1.root.clearInterval(id) && undefined || undefined;\n };\n /**\n * Immediately executes this action and the `work` it contains.\n * @return {any}\n */\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n // Dequeue if the action didn't reschedule itself. Don't call\n // unsubscribe(), because the action could reschedule later.\n // For example:\n // ```\n // scheduler.schedule(function doWork(counter) {\n // /* ... I'm a busy worker bee ... */\n // var originalAction = this;\n // /* wait 100ms before rescheduling the action */\n // setTimeout(function () {\n // originalAction.schedule(counter + 1);\n // }, 100);\n // }, 1000);\n // ```\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, delay) {\n var errored = false;\n var errorValue = undefined;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = !!e && e || new Error(e);\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype._unsubscribe = function () {\n var id = this.id;\n var scheduler = this.scheduler;\n var actions = scheduler.actions;\n var index = actions.indexOf(this);\n this.work = null;\n this.state = null;\n this.pending = false;\n this.scheduler = null;\n if (index !== -1) {\n actions.splice(index, 1);\n }\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n };\n return AsyncAction;\n}(Action_1.Action));\nexports.AsyncAction = AsyncAction;\n//# sourceMappingURL=AsyncAction.js.map","\"use strict\";\n/**\n * An execution context and a data structure to order tasks and schedule their\n * execution. Provides a notion of (potentially virtual) time, through the\n * `now()` getter method.\n *\n * Each unit of work in a Scheduler is called an {@link Action}.\n *\n * ```ts\n * class Scheduler {\n * now(): number;\n * schedule(work, delay?, state?): Subscription;\n * }\n * ```\n *\n * @class Scheduler\n */\nvar Scheduler = (function () {\n function Scheduler(SchedulerAction, now) {\n if (now === void 0) { now = Scheduler.now; }\n this.SchedulerAction = SchedulerAction;\n this.now = now;\n }\n /**\n * Schedules a function, `work`, for execution. May happen at some point in\n * the future, according to the `delay` parameter, if specified. May be passed\n * some context object, `state`, which will be passed to the `work` function.\n *\n * The given arguments will be processed an stored as an Action object in a\n * queue of actions.\n *\n * @param {function(state: ?T): ?Subscription} work A function representing a\n * task, or some unit of work to be executed by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler itself.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @return {Subscription} A subscription in order to be able to unsubscribe\n * the scheduled work.\n */\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) { delay = 0; }\n return new this.SchedulerAction(this, work).schedule(state, delay);\n };\n Scheduler.now = Date.now ? Date.now : function () { return +new Date(); };\n return Scheduler;\n}());\nexports.Scheduler = Scheduler;\n//# sourceMappingURL=Scheduler.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Scheduler_1 = require('../Scheduler');\nvar AsyncScheduler = (function (_super) {\n __extends(AsyncScheduler, _super);\n function AsyncScheduler() {\n _super.apply(this, arguments);\n this.actions = [];\n /**\n * A flag to indicate whether the Scheduler is currently executing a batch of\n * queued actions.\n * @type {boolean}\n */\n this.active = false;\n /**\n * An internal ID used to track the latest asynchronous task such as those\n * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and\n * others.\n * @type {any}\n */\n this.scheduled = undefined;\n }\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this.active) {\n actions.push(action);\n return;\n }\n var error;\n this.active = true;\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift()); // exhaust the scheduler queue\n this.active = false;\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler_1.Scheduler));\nexports.AsyncScheduler = AsyncScheduler;\n//# sourceMappingURL=AsyncScheduler.js.map","\"use strict\";\nvar AsyncAction_1 = require('./AsyncAction');\nvar AsyncScheduler_1 = require('./AsyncScheduler');\n/**\n *\n * Async Scheduler\n *\n * <span class=\"informal\">Schedule task as if you used setTimeout(task, duration)</span>\n *\n * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript\n * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating\n * in intervals.\n *\n * If you just want to \"defer\" task, that is to perform it right after currently\n * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),\n * better choice will be the {@link asap} scheduler.\n *\n * @example <caption>Use async scheduler to delay task</caption>\n * const task = () => console.log('it works!');\n *\n * Rx.Scheduler.async.schedule(task, 2000);\n *\n * // After 2 seconds logs:\n * // \"it works!\"\n *\n *\n * @example <caption>Use async scheduler to repeat task in intervals</caption>\n * function task(state) {\n * console.log(state);\n * this.schedule(state + 1, 1000); // `this` references currently executing Action,\n * // which we reschedule with new state and delay\n * }\n *\n * Rx.Scheduler.async.schedule(task, 3000, 0);\n *\n * // Logs:\n * // 0 after 3s\n * // 1 after 4s\n * // 2 after 5s\n * // 3 after 6s\n *\n * @static true\n * @name async\n * @owner Scheduler\n */\nexports.async = new AsyncScheduler_1.AsyncScheduler(AsyncAction_1.AsyncAction);\n//# sourceMappingURL=async.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\nvar async_1 = require('../scheduler/async');\n/**\n * Emits a value from the source Observable only after a particular time span\n * has passed without another source emission.\n *\n * <span class=\"informal\">It's like {@link delay}, but passes only the most\n * recent value from each burst of emissions.</span>\n *\n * <img src=\"./img/debounceTime.png\" width=\"100%\">\n *\n * `debounceTime` delays values emitted by the source Observable, but drops\n * previous pending delayed emissions if a new value arrives on the source\n * Observable. This operator keeps track of the most recent value from the\n * source Observable, and emits that only when `dueTime` enough time has passed\n * without any other value appearing on the source Observable. If a new value\n * appears before `dueTime` silence occurs, the previous value will be dropped\n * and will not be emitted on the output Observable.\n *\n * This is a rate-limiting operator, because it is impossible for more than one\n * value to be emitted in any time window of duration `dueTime`, but it is also\n * a delay-like operator since output emissions do not occur at the same time as\n * they did on the source Observable. Optionally takes a {@link IScheduler} for\n * managing timers.\n *\n * @example <caption>Emit the most recent click after a burst of clicks</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.debounceTime(1000);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttleTime}\n *\n * @param {number} dueTime The timeout duration in milliseconds (or the time\n * unit determined internally by the optional `scheduler`) for the window of\n * time required to wait for emission silence before emitting the most recent\n * source value.\n * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for\n * managing the timers that handle the timeout for each value.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified `dueTime`, and may drop some values if they occur\n * too frequently.\n * @method debounceTime\n * @owner Observable\n */\nfunction debounceTime(dueTime, scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return function (source) { return source.lift(new DebounceTimeOperator(dueTime, scheduler)); };\n}\nexports.debounceTime = debounceTime;\nvar DebounceTimeOperator = (function () {\n function DebounceTimeOperator(dueTime, scheduler) {\n this.dueTime = dueTime;\n this.scheduler = scheduler;\n }\n DebounceTimeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));\n };\n return DebounceTimeOperator;\n}());\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar DebounceTimeSubscriber = (function (_super) {\n __extends(DebounceTimeSubscriber, _super);\n function DebounceTimeSubscriber(destination, dueTime, scheduler) {\n _super.call(this, destination);\n this.dueTime = dueTime;\n this.scheduler = scheduler;\n this.debouncedSubscription = null;\n this.lastValue = null;\n this.hasValue = false;\n }\n DebounceTimeSubscriber.prototype._next = function (value) {\n this.clearDebounce();\n this.lastValue = value;\n this.hasValue = true;\n this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));\n };\n DebounceTimeSubscriber.prototype._complete = function () {\n this.debouncedNext();\n this.destination.complete();\n };\n DebounceTimeSubscriber.prototype.debouncedNext = function () {\n this.clearDebounce();\n if (this.hasValue) {\n this.destination.next(this.lastValue);\n this.lastValue = null;\n this.hasValue = false;\n }\n };\n DebounceTimeSubscriber.prototype.clearDebounce = function () {\n var debouncedSubscription = this.debouncedSubscription;\n if (debouncedSubscription !== null) {\n this.remove(debouncedSubscription);\n debouncedSubscription.unsubscribe();\n this.debouncedSubscription = null;\n }\n };\n return DebounceTimeSubscriber;\n}(Subscriber_1.Subscriber));\nfunction dispatchNext(subscriber) {\n subscriber.debouncedNext();\n}\n//# sourceMappingURL=debounceTime.js.map","\"use strict\";\nvar async_1 = require('../scheduler/async');\nvar debounceTime_1 = require('../operators/debounceTime');\n/**\n * Emits a value from the source Observable only after a particular time span\n * has passed without another source emission.\n *\n * <span class=\"informal\">It's like {@link delay}, but passes only the most\n * recent value from each burst of emissions.</span>\n *\n * <img src=\"./img/debounceTime.png\" width=\"100%\">\n *\n * `debounceTime` delays values emitted by the source Observable, but drops\n * previous pending delayed emissions if a new value arrives on the source\n * Observable. This operator keeps track of the most recent value from the\n * source Observable, and emits that only when `dueTime` enough time has passed\n * without any other value appearing on the source Observable. If a new value\n * appears before `dueTime` silence occurs, the previous value will be dropped\n * and will not be emitted on the output Observable.\n *\n * This is a rate-limiting operator, because it is impossible for more than one\n * value to be emitted in any time window of duration `dueTime`, but it is also\n * a delay-like operator since output emissions do not occur at the same time as\n * they did on the source Observable. Optionally takes a {@link IScheduler} for\n * managing timers.\n *\n * @example <caption>Emit the most recent click after a burst of clicks</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.debounceTime(1000);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttleTime}\n *\n * @param {number} dueTime The timeout duration in milliseconds (or the time\n * unit determined internally by the optional `scheduler`) for the window of\n * time required to wait for emission silence before emitting the most recent\n * source value.\n * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for\n * managing the timers that handle the timeout for each value.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified `dueTime`, and may drop some values if they occur\n * too frequently.\n * @method debounceTime\n * @owner Observable\n */\nfunction debounceTime(dueTime, scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return debounceTime_1.debounceTime(dueTime, scheduler)(this);\n}\nexports.debounceTime = debounceTime;\n//# sourceMappingURL=debounceTime.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar debounceTime_1 = require('../../operator/debounceTime');\nObservable_1.Observable.prototype.debounceTime = debounceTime_1.debounceTime;\n//# sourceMappingURL=debounceTime.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar filter_1 = require('../../operator/filter');\nObservable_1.Observable.prototype.filter = filter_1.filter;\n//# sourceMappingURL=filter.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar map_1 = require('../../operator/map');\nObservable_1.Observable.prototype.map = map_1.map;\n//# sourceMappingURL=map.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\n/**\n * Emits the given constant value on the output Observable every time the source\n * Observable emits a value.\n *\n * <span class=\"informal\">Like {@link map}, but it maps every source value to\n * the same output value every time.</span>\n *\n * <img src=\"./img/mapTo.png\" width=\"100%\">\n *\n * Takes a constant `value` as argument, and emits that whenever the source\n * Observable emits a value. In other words, ignores the actual source value,\n * and simply uses the emission moment to know when to emit the given `value`.\n *\n * @example <caption>Map every click to the string 'Hi'</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var greetings = clicks.mapTo('Hi');\n * greetings.subscribe(x => console.log(x));\n *\n * @see {@link map}\n *\n * @param {any} value The value to map each source value to.\n * @return {Observable} An Observable that emits the given `value` every time\n * the source Observable emits something.\n * @method mapTo\n * @owner Observable\n */\nfunction mapTo(value) {\n return function (source) { return source.lift(new MapToOperator(value)); };\n}\nexports.mapTo = mapTo;\nvar MapToOperator = (function () {\n function MapToOperator(value) {\n this.value = value;\n }\n MapToOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapToSubscriber(subscriber, this.value));\n };\n return MapToOperator;\n}());\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar MapToSubscriber = (function (_super) {\n __extends(MapToSubscriber, _super);\n function MapToSubscriber(destination, value) {\n _super.call(this, destination);\n this.value = value;\n }\n MapToSubscriber.prototype._next = function (x) {\n this.destination.next(this.value);\n };\n return MapToSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=mapTo.js.map","\"use strict\";\nvar mapTo_1 = require('../operators/mapTo');\n/**\n * Emits the given constant value on the output Observable every time the source\n * Observable emits a value.\n *\n * <span class=\"informal\">Like {@link map}, but it maps every source value to\n * the same output value every time.</span>\n *\n * <img src=\"./img/mapTo.png\" width=\"100%\">\n *\n * Takes a constant `value` as argument, and emits that whenever the source\n * Observable emits a value. In other words, ignores the actual source value,\n * and simply uses the emission moment to know when to emit the given `value`.\n *\n * @example <caption>Map every click to the string 'Hi'</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var greetings = clicks.mapTo('Hi');\n * greetings.subscribe(x => console.log(x));\n *\n * @see {@link map}\n *\n * @param {any} value The value to map each source value to.\n * @return {Observable} An Observable that emits the given `value` every time\n * the source Observable emits something.\n * @method mapTo\n * @owner Observable\n */\nfunction mapTo(value) {\n return mapTo_1.mapTo(value)(this);\n}\nexports.mapTo = mapTo;\n//# sourceMappingURL=mapTo.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar mapTo_1 = require('../../operator/mapTo');\nObservable_1.Observable.prototype.mapTo = mapTo_1.mapTo;\n//# sourceMappingURL=mapTo.js.map","import * as Actions from 'kayenta/actions';\nimport * as Creators from 'kayenta/actions/creators';\nimport { ICanaryConfigUpdateResponse, KayentaAccountType } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { runSelector } from 'kayenta/selectors';\nimport {\n createCanaryConfig,\n deleteCanaryConfig,\n getCanaryConfigById,\n listKayentaAccounts,\n mapStateToConfig,\n updateCanaryConfig,\n} from 'kayenta/service/canaryConfig.service';\nimport { listMetricsServiceMetadata } from 'kayenta/service/metricsServiceMetadata.service';\nimport { Action, MiddlewareAPI } from 'redux';\nimport { combineEpics, createEpicMiddleware, EpicMiddleware } from 'redux-observable';\nimport { Observable } from 'rxjs/Observable';\nimport 'rxjs/add/observable/concat';\nimport 'rxjs/add/observable/forkJoin';\nimport 'rxjs/add/observable/fromPromise';\nimport 'rxjs/add/operator/catch';\nimport 'rxjs/add/operator/concatMap';\nimport 'rxjs/add/operator/debounceTime';\nimport 'rxjs/add/operator/filter';\nimport 'rxjs/add/operator/map';\nimport 'rxjs/add/operator/mapTo';\n\nimport { ReactInjector } from '@spinnaker/core';\n\nimport { getCanaryRun, getMetricSetPair } from '../service/canaryRun.service';\n\nconst typeMatches = (...actions: string[]) => (action: Action & any) => actions.includes(action.type);\n\nconst loadConfigEpic = (action$: Observable<Action & any>) =>\n action$.filter(typeMatches(Actions.LOAD_CONFIG_REQUEST, Actions.SAVE_CONFIG_SUCCESS)).concatMap((action) =>\n Observable.fromPromise(getCanaryConfigById(action.payload.id))\n .map((config) => Creators.loadConfigSuccess({ config }))\n .catch((error) => Observable.of(Creators.loadConfigFailure({ error }))),\n );\n\nconst selectConfigEpic = (action$: Observable<Action & any>) =>\n action$\n .filter(typeMatches(Actions.LOAD_CONFIG_SUCCESS))\n .map((action) => Creators.selectConfig({ config: action.payload.config }));\n\nconst saveConfigEpic = (action$: Observable<Action & any>, store: MiddlewareAPI<ICanaryState>) =>\n action$.filter(typeMatches(Actions.SAVE_CONFIG_REQUEST)).concatMap(() => {\n const config = mapStateToConfig(store.getState());\n let saveAction: PromiseLike<ICanaryConfigUpdateResponse>;\n if (config.isNew) {\n delete config.isNew;\n saveAction = createCanaryConfig(config);\n } else {\n saveAction = updateCanaryConfig(config);\n }\n\n return Observable.fromPromise(saveAction)\n .concatMap(({ canaryConfigId }) =>\n Observable.forkJoin(\n ReactInjector.$state.go('^.configDetail', { id: canaryConfigId, copy: false, new: false }),\n store.getState().data.application.getDataSource('canaryConfigs').refresh(true),\n ).mapTo(Creators.saveConfigSuccess({ id: canaryConfigId })),\n )\n .catch((error: Error) => Observable.of(Creators.saveConfigFailure({ error })));\n });\n\nconst deleteConfigRequestEpic = (action$: Observable<Action & any>, store: MiddlewareAPI<ICanaryState>) =>\n action$.filter(typeMatches(Actions.DELETE_CONFIG_REQUEST)).concatMap(() =>\n Observable.fromPromise(deleteCanaryConfig(store.getState().selectedConfig.config.id))\n .mapTo(Creators.deleteConfigSuccess())\n .catch((error: Error) => Observable.of(Creators.deleteConfigFailure({ error }))),\n );\n\nconst deleteConfigSuccessEpic = (action$: Observable<Action & any>, store: MiddlewareAPI<ICanaryState>) =>\n action$\n .filter(typeMatches(Actions.DELETE_CONFIG_SUCCESS))\n .concatMap(() =>\n Observable.forkJoin(\n ReactInjector.$state.go('^.configDefault'),\n // TODO: handle config summary load failure (in general, not just here).\n store.getState().data.application.getDataSource('canaryConfigs').refresh(true),\n ),\n )\n .mapTo(Creators.closeDeleteConfigModal());\n\nconst loadCanaryRunRequestEpic = (action$: Observable<Action & any>) =>\n action$.filter(typeMatches(Actions.LOAD_RUN_REQUEST)).concatMap((action) =>\n Observable.fromPromise(getCanaryRun(action.payload.configId, action.payload.runId))\n .map((run) => Creators.loadRunSuccess({ run }))\n .catch((error: Error) => Observable.of(Creators.loadRunFailure({ error }))),\n );\n\nconst loadMetricSetPairEpic = (action$: Observable<Action & any>, store: MiddlewareAPI<ICanaryState>) =>\n action$.filter(typeMatches(Actions.LOAD_METRIC_SET_PAIR_REQUEST)).concatMap((action) => {\n const run = runSelector(store.getState());\n return Observable.fromPromise(getMetricSetPair(run.metricSetPairListId, action.payload.pairId))\n .map((metricSetPair) => Creators.loadMetricSetPairSuccess({ metricSetPair }))\n .catch((error: Error) => Observable.of(Creators.loadMetricSetPairFailure({ error })));\n });\n\nconst updatePrometheusMetricDescriptionFilterEpic = (action$: Observable<Action & any>) =>\n action$\n .filter(typeMatches(Actions.UPDATE_PROMETHEUS_METRIC_DESCRIPTOR_FILTER))\n .filter((action) => action.payload.filter && action.payload.filter.length > 2)\n .debounceTime(200 /* milliseconds */)\n .map((action) => {\n return Creators.loadMetricsServiceMetadataRequest({\n filter: action.payload.filter,\n metricsAccountName: action.payload.metricsAccountName,\n });\n });\n\nconst updateStackdriverMetricDescriptionFilterEpic = (\n action$: Observable<Action & any>,\n store: MiddlewareAPI<ICanaryState>,\n) =>\n action$\n .filter(typeMatches(Actions.UPDATE_STACKDRIVER_METRIC_DESCRIPTOR_FILTER))\n .filter((action) => action.payload.filter && action.payload.filter.length > 2)\n .debounceTime(200 /* milliseconds */)\n .map((action) => {\n const [metricsAccountName] = store\n .getState()\n .data.kayentaAccounts.data.filter(\n (account) =>\n account.supportedTypes.includes(KayentaAccountType.MetricsStore) &&\n account.metricsStoreType === 'stackdriver',\n )\n .map((account) => account.name);\n\n return Creators.loadMetricsServiceMetadataRequest({\n filter: action.payload.filter,\n metricsAccountName,\n });\n });\n\nconst updateGraphiteMetricDescriptionFilterEpic = (\n action$: Observable<Action & any>,\n store: MiddlewareAPI<ICanaryState>,\n) =>\n action$\n .filter(typeMatches(Actions.UPDATE_GRAPHITE_METRIC_DESCRIPTOR_FILTER))\n .filter((action) => action.payload.filter && action.payload.filter.length > 2)\n .debounceTime(200 /* milliseconds */)\n .map((action) => {\n const [metricsAccountName] = store\n .getState()\n .data.kayentaAccounts.data.filter(\n (account) => account.supportedTypes.includes(KayentaAccountType.MetricsStore) && account.type === 'graphite',\n )\n .map((account) => account.name);\n\n return Creators.loadMetricsServiceMetadataRequest({\n filter: action.payload.filter,\n metricsAccountName,\n });\n });\n\nconst updateDatadogMetricDescriptionFilterEpic = (\n action$: Observable<Action & any>,\n store: MiddlewareAPI<ICanaryState>,\n) =>\n action$\n .filter(typeMatches(Actions.UPDATE_DATADOG_METRIC_DESCRIPTOR_FILTER))\n .filter((action) => action.payload.filter && action.payload.filter.length > 2)\n .debounceTime(200 /* milliseconds */)\n .map((action) => {\n const [metricsAccountName] = store\n .getState()\n .data.kayentaAccounts.data.filter(\n (account) => account.supportedTypes.includes(KayentaAccountType.MetricsStore) && account.type === 'datadog',\n )\n .map((account) => account.name);\n\n return Creators.loadMetricsServiceMetadataRequest({\n filter: action.payload.filter,\n metricsAccountName,\n });\n });\n\nconst loadMetricsServiceMetadataEpic = (action$: Observable<Action & any>) =>\n action$.filter(typeMatches(Actions.LOAD_METRICS_SERVICE_METADATA_REQUEST)).concatMap((action) => {\n return Observable.fromPromise(listMetricsServiceMetadata(action.payload.filter, action.payload.metricsAccountName))\n .map((data) => Creators.loadMetricsServiceMetadataSuccess({ data }))\n .catch((error: Error) => Observable.of(Creators.loadMetricsServiceMetadataFailure({ error })));\n });\n\nconst loadKayentaAccountsEpic = (action$: Observable<Action & any>) =>\n action$.filter(typeMatches(Actions.LOAD_KAYENTA_ACCOUNTS_REQUEST, Actions.INITIALIZE)).concatMap(() =>\n Observable.fromPromise(listKayentaAccounts())\n .map((accounts) => Creators.loadKayentaAccountsSuccess({ accounts }))\n .catch((error: Error) => Observable.of(Creators.loadKayentaAccountsFailure({ error }))),\n );\n\nconst rootEpic = combineEpics(\n loadConfigEpic,\n selectConfigEpic,\n saveConfigEpic,\n deleteConfigRequestEpic,\n deleteConfigSuccessEpic,\n loadCanaryRunRequestEpic,\n loadMetricSetPairEpic,\n updateGraphiteMetricDescriptionFilterEpic,\n updatePrometheusMetricDescriptionFilterEpic,\n updateStackdriverMetricDescriptionFilterEpic,\n updateDatadogMetricDescriptionFilterEpic,\n loadMetricsServiceMetadataEpic,\n loadKayentaAccountsEpic,\n);\n\nexport const epicMiddleware: EpicMiddleware<Action & any, ICanaryState> = createEpicMiddleware(rootEpic);\n","import { IMetricsServiceMetadata } from 'kayenta/domain/IMetricsServiceMetadata';\n\nimport { REST } from '@spinnaker/core';\n\nexport const listMetricsServiceMetadata = (\n filter?: string,\n metricsAccountName?: string,\n): PromiseLike<IMetricsServiceMetadata[]> =>\n REST('/v2/canaries/metadata/metricsService').query({ filter, metricsAccountName }).get();\n","import { UIView } from '@uirouter/react';\nimport * as React from 'react';\nimport { Provider, Store } from 'react-redux';\nimport { applyMiddleware, createStore } from 'redux';\nimport { logger } from 'redux-logger';\n\nimport { Application } from '@spinnaker/core';\n\nimport { INITIALIZE } from './actions';\nimport { CanarySettings } from './canary.settings';\nimport { ICanaryConfigSummary, IJudge } from './domain';\nimport Styleguide from './layout/styleguide';\nimport { actionInterceptingMiddleware, asyncDispatchMiddleware, epicMiddleware } from './middleware';\nimport { ICanaryState, rootReducer } from './reducers';\n\nexport interface ICanaryProps {\n app: Application;\n}\n\nconst middleware = [epicMiddleware, actionInterceptingMiddleware, asyncDispatchMiddleware];\n\nexport const canaryStore: Store<ICanaryState> = createStore<ICanaryState>(\n rootReducer,\n applyMiddleware(...(CanarySettings.reduxLogger ? [...middleware, logger] : middleware)),\n);\n\nexport default class Canary extends React.Component<ICanaryProps> {\n private readonly store: Store<ICanaryState>;\n\n constructor(props: ICanaryProps) {\n super(props);\n this.store = canaryStore;\n this.initializeAppState(props.app);\n }\n\n public componentWillReceiveProps(nextProps: ICanaryProps) {\n if (this.props.app.name !== nextProps.app.name) {\n this.initializeAppState(nextProps.app);\n }\n }\n\n private initializeAppState(app: Application): void {\n this.store.dispatch({\n type: INITIALIZE,\n state: {\n data: {\n application: app,\n configSummaries: app.getDataSource('canaryConfigs').data as ICanaryConfigSummary[],\n judges: app.getDataSource('canaryJudges').data as IJudge[],\n },\n },\n });\n }\n\n public render() {\n const noWrap = { wrap: false };\n return (\n <Styleguide className=\"kayenta-root vertical\">\n <Provider store={this.store}>\n <div className=\"vertical flex-1\">\n <UIView {...noWrap} name=\"canary\" />\n </div>\n </Provider>\n </Styleguide>\n );\n }\n}\n","import * as Creators from 'kayenta/actions/creators';\nimport * as Actions from 'kayenta/actions/index';\nimport { Action, Dispatch, Middleware, MiddlewareAPI } from 'redux';\n\nimport { ICanaryState } from '../reducers/index';\nimport { buildConfigCopy, buildNewConfig } from '../service/canaryConfig.service';\n\n// TODO: replace the `any` generic passed to MiddlewareAPI with ICanaryState. The Redux typings here are wrong.\n// Should be fixed in this PR: https://github.com/reactjs/redux/pull/2563\nexport const actionInterceptingMiddleware: Middleware = (store: MiddlewareAPI<any>) => (\n next: Dispatch<ICanaryState>,\n) => (action: Action & any) => {\n switch (action.type) {\n case Actions.CREATE_NEW_CONFIG: {\n const newConfig = buildNewConfig(store.getState());\n const newAction = Creators.selectConfig({ config: newConfig });\n return next(newAction);\n }\n\n case Actions.COPY_SELECTED_CONFIG: {\n const copiedConfig = buildConfigCopy(store.getState());\n const newAction = Creators.selectConfig({ config: copiedConfig });\n return next(newAction);\n }\n\n default:\n return next(action);\n }\n};\n","import { Action, Dispatch, Middleware, MiddlewareAPI } from 'redux';\n\nimport { ICanaryState } from '../reducers/index';\n\n/*\n * Middleware for scheduling actions from within reducers.\n * Provides every action with an `asyncDispatch` method.\n * Actions provided to `asyncDispatch` will run after all reducers have completed.\n * TODO: type actions to include `asyncDispatch`.\n * */\n\n// TODO: replace the `any` generic passed to MiddlewareAPI with ICanaryState. The Redux typings here are wrong.\n// Should be fixed in this PR: https://github.com/reactjs/redux/pull/2563\nexport const asyncDispatchMiddleware: Middleware = (store: MiddlewareAPI<any>) => (next: Dispatch<ICanaryState>) => (\n action: Action & any,\n) => {\n let syncActivityFinished = false;\n let actionQueue: Action[] = [];\n\n const flushQueue = () => {\n actionQueue.forEach((a) => store.dispatch(a));\n actionQueue = [];\n };\n\n const asyncDispatch = (a: Action & any) => {\n actionQueue.push(a);\n if (syncActivityFinished) {\n flushQueue();\n }\n };\n\n const nextAction = next({ ...action, asyncDispatch });\n syncActivityFinished = true;\n flushQueue();\n\n return nextAction;\n};\n","import { AsyncRequestState } from 'kayenta/reducers/asyncRequest';\nimport * as React from 'react';\n\nimport { Spinner } from '@spinnaker/core';\n\nexport interface ILoadStatesProps {\n state: AsyncRequestState;\n}\n\n/*\n * Builder for rendering load states. Defaults to standard spinner during\n * `Requesting` state.\n * */\nexport default class LoadStatesBuilder {\n private requesting: JSX.Element;\n private fulfilled: JSX.Element;\n private failed: JSX.Element;\n\n public onRequesting(requesting: JSX.Element): LoadStatesBuilder {\n this.requesting = requesting;\n return this;\n }\n\n public onFulfilled(fulfilled: JSX.Element): LoadStatesBuilder {\n this.fulfilled = fulfilled;\n return this;\n }\n\n public onFailed(failed: JSX.Element): LoadStatesBuilder {\n this.failed = failed;\n return this;\n }\n\n public build(): React.SFC<ILoadStatesProps> {\n return ({ state }: ILoadStatesProps) => {\n switch (state) {\n case AsyncRequestState.Requesting:\n return (\n this.requesting || (\n <div className=\"horizontal center middle spinner-container\">\n <Spinner />\n </div>\n )\n );\n case AsyncRequestState.Fulfilled:\n return this.fulfilled;\n case AsyncRequestState.Failed:\n return this.failed;\n }\n };\n }\n}\n","import * as React from 'react';\nimport { timestamp } from '@spinnaker/core';\n\nexport interface IDateLabelProps {\n dateIso: string;\n}\n\nexport default function FormattedDate({ dateIso }: IDateLabelProps) {\n if (dateIso) {\n return <span>{timestamp(new Date(dateIso).getTime())}</span>;\n } else {\n return <span>N/A</span>;\n }\n}\n","import { UISref } from '@uirouter/react';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { get } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { ICanaryState } from '../reducers/index';\n\ninterface ICopyConfigButtonStateProps {\n disabled: boolean;\n}\n\n/*\n * Button for copying a canary config.\n */\nfunction CopyConfigButton({ disabled }: ICopyConfigButtonStateProps) {\n return (\n <UISref to=\"^.configDetail\" params={{ copy: true }}>\n <button className=\"passive\" disabled={disabled}>\n <i className=\"fa fa-copy\" />\n <span>Copy</span>\n </button>\n </UISref>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState) {\n return {\n disabled:\n get(state.selectedConfig, 'config.isNew') || state.app.disableConfigEdit || CanarySettings.disableConfigEdit,\n };\n}\n\nexport default connect(mapStateToProps)(CopyConfigButton);\n","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport * as Creators from '../actions/creators';\nimport ConfigJsonModal from './configJsonModal';\n\ninterface IOpenConfigJsonModalDispatchProps {\n openConfigJsonModal: () => void;\n}\n\n/*\n * Button for opening the edit config JSON modal.\n */\nfunction OpenConfigJsonModalButton({ openConfigJsonModal }: IOpenConfigJsonModalDispatchProps) {\n return (\n <div>\n <button className=\"passive\" onClick={openConfigJsonModal}>\n <i className=\"far fa-file-code\" />\n <span>JSON</span>\n </button>\n <ConfigJsonModal />\n </div>\n );\n}\n\nfunction mapDispatchToProps(dispatch: (action: Action & any) => void): IOpenConfigJsonModalDispatchProps {\n return {\n openConfigJsonModal: () => dispatch(Creators.openConfigJsonModal()),\n };\n}\n\nexport default connect(null, mapDispatchToProps)(OpenConfigJsonModalButton);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport * as React from 'react';\nimport { Modal } from 'react-bootstrap';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport Styleguide from '../layout/styleguide';\nimport { AsyncRequestState } from '../reducers/asyncRequest';\nimport { ICanaryState } from '../reducers/index';\n\ninterface IDeleteModalDispatchProps {\n closeDeleteConfigModal: () => void;\n deleteConfig: () => void;\n}\n\ninterface IDeleteModalStateProps {\n show: boolean;\n selectedConfigName: string;\n deleteConfigState: AsyncRequestState;\n deleteConfigErrorMessage: string;\n}\n\n/*\n * Modal to confirm canary config deletion.\n */\nfunction DeleteConfigModal({\n show,\n selectedConfigName,\n deleteConfigState,\n deleteConfigErrorMessage,\n closeDeleteConfigModal,\n deleteConfig,\n}: IDeleteModalDispatchProps & IDeleteModalStateProps) {\n return (\n <Modal show={show} onHide={null}>\n <Styleguide>\n <Modal.Header>\n <Modal.Title>Really delete {selectedConfigName}?</Modal.Title>\n </Modal.Header>\n {deleteConfigState === AsyncRequestState.Failed && (\n <Modal.Body>\n {/*TODO: create generic error message component */}\n <span className={classNames('alert', 'alert-danger')}>{buildErrorMessage(deleteConfigErrorMessage)}</span>\n </Modal.Body>\n )}\n <Modal.Footer>\n <ul className=\"list-inline pull-right\">\n <li>\n <button className=\"passive\" onClick={closeDeleteConfigModal}>\n Cancel\n </button>\n </li>\n <li>\n <button className=\"primary\" onClick={deleteConfig}>\n Delete\n </button>\n </li>\n </ul>\n </Modal.Footer>\n </Styleguide>\n </Modal>\n );\n}\n\nfunction buildErrorMessage(deleteConfigErrorMessage: string): string {\n const message = 'The was an error deleting your config';\n return deleteConfigErrorMessage ? message + `: ${deleteConfigErrorMessage}.` : message + '.';\n}\n\nfunction mapDispatchToProps(dispatch: (action: Action & any) => void): IDeleteModalDispatchProps {\n return {\n closeDeleteConfigModal: () => dispatch(Creators.closeDeleteConfigModal()),\n deleteConfig: () => dispatch(Creators.deleteConfig()),\n };\n}\n\nfunction mapStateToProps(state: ICanaryState): IDeleteModalStateProps {\n return {\n show: state.app.deleteConfigModalOpen,\n selectedConfigName: state.selectedConfig.config ? state.selectedConfig.config.name : null,\n deleteConfigState: state.selectedConfig.destroy.state,\n deleteConfigErrorMessage: state.selectedConfig.destroy.error,\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(DeleteConfigModal);\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { DISABLE_EDIT_CONFIG, DisableableButton } from 'kayenta/layout/disableable';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport DeleteConfigModal from './deleteModal';\n\ninterface IDeleteButtonStateProps {\n disabled: boolean;\n}\n\ninterface IDeleteButtonDispatchProps {\n openDeleteConfigModal: () => void;\n}\n\n/*\n * Button for opening the delete canary config confirmation modal.\n */\nfunction DeleteConfigButton({ openDeleteConfigModal, disabled }: IDeleteButtonDispatchProps & IDeleteButtonStateProps) {\n return (\n <div>\n <DisableableButton\n className=\"passive\"\n disabled={disabled || CanarySettings.disableConfigEdit}\n onClick={openDeleteConfigModal}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n >\n <i className=\"fa fa-trash\" />\n <span>Delete</span>\n </DisableableButton>\n <DeleteConfigModal />\n </div>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState) {\n return {\n disabled: (state.selectedConfig.config && state.selectedConfig.config.isNew) || CanarySettings.disableConfigEdit,\n };\n}\n\nfunction mapDispatchToProps(dispatch: any): IDeleteButtonDispatchProps {\n return {\n openDeleteConfigModal: () => dispatch(Creators.openDeleteConfigModal()),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(DeleteConfigButton);\n","import * as React from 'react';\n\nimport CopyConfigButton from './copyConfigButton';\nimport OpenEditConfigJsonModalButton from './openConfigJsonModalButton';\nimport OpenDeleteModalButton from './openDeleteModalButton';\n\n/*\n * Layout for canary config action buttons.\n */\nexport default function ConfigDetailActionButtons() {\n return (\n <ul className=\"list-inline pull-right\">\n <li>\n <OpenEditConfigJsonModalButton />\n </li>\n <li>\n <CopyConfigButton />\n </li>\n <li>\n <OpenDeleteModalButton />\n </li>\n </ul>\n );\n}\n","import { UISref } from '@uirouter/react';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryConfig } from 'kayenta/domain';\nimport FormattedDate from 'kayenta/layout/formattedDate';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { mapStateToConfig } from 'kayenta/service/canaryConfig.service';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ConfigDetailActionButtons from './configDetailActionButtons';\n\ninterface IConfigDetailStateProps {\n selectedConfig: ICanaryConfig;\n editingDisabled: boolean;\n disableConfigEdit: boolean;\n}\n\nconst getOwnerAppLinks = (owners: string[]) => {\n if (owners.length === 1) {\n return (\n <UISref to=\".\" params={{ application: owners[0] }}>\n <a>{owners[0]}</a>\n </UISref>\n );\n } else {\n // totally gross to read, but a somewhat-straightforward way of creating\n // a 'one, two, or three' sentence from this array of app names with some JSX in between\n const lastIndex = owners.length - 1;\n return owners.map((owner, index) => (\n <React.Fragment key={owner}>\n {index === lastIndex ? 'or ' : ''}\n <UISref to=\".\" params={{ application: owner }}>\n <a>{owner}</a>\n </UISref>\n {index < lastIndex && owners.length === 2 ? ' ' : ''}\n {index < lastIndex && owners.length > 2 ? ', ' : ''}\n </React.Fragment>\n ));\n }\n};\n\nconst EditingDisabledWarning = ({ owners }: { owners: string[] }) => {\n return (\n <div className=\"horizontal middle well-compact alert alert-warning config-detail-edit-warning\">\n <i className=\"fa fa-exclamation-triangle sp-margin-m-right\" />\n <span>\n <b>\n Editing is disabled because this config is owned by{' '}\n {owners.length > 1 ? `${owners.length} other applications` : 'another application'}.\n </b>{' '}\n To edit, view in {getOwnerAppLinks(owners)}\n </span>\n </div>\n );\n};\n\nconst ConfigEditingDisabledWarning = () => {\n return (\n <div className=\"horizontal middle well-compact alert alert-warning config-detail-edit-warning\">\n <i className=\"fa fa-exclamation-triangle sp-margin-m-right\" />\n <span>\n <b>Canary config is locked and does not allow modification</b>\n </span>\n </div>\n );\n};\n\n/*\n * Config detail header layout.\n */\nfunction ConfigDetailHeader({ selectedConfig, editingDisabled, disableConfigEdit }: IConfigDetailStateProps) {\n return (\n <div className=\"vertical\">\n <div className=\"horizontal config-detail-header\">\n <div className=\"flex-3\">\n <h1 className=\"heading-1 color-text-primary\">{selectedConfig ? selectedConfig.name : ''}</h1>\n </div>\n <div className=\"flex-1\">\n <h5 className=\"heading-5\">\n <strong>Edited:</strong>{' '}\n <FormattedDate dateIso={selectedConfig ? selectedConfig.updatedTimestampIso : ''} />\n </h5>\n </div>\n <div className=\"flex-2\">\n <ConfigDetailActionButtons />\n </div>\n </div>\n {selectedConfig && editingDisabled && !disableConfigEdit && (\n <EditingDisabledWarning owners={selectedConfig.applications} />\n )}\n {selectedConfig && disableConfigEdit && <ConfigEditingDisabledWarning />}\n </div>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IConfigDetailStateProps {\n return {\n selectedConfig: mapStateToConfig(state),\n editingDisabled: state.app.disableConfigEdit,\n disableConfigEdit: CanarySettings.disableConfigEdit,\n };\n}\n\nexport default connect(mapStateToProps)(ConfigDetailHeader);\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryMetricEffectSizeConfig } from 'kayenta/domain';\nimport FormRow from 'kayenta/layout/formRow';\nimport RadioChoice from 'kayenta/layout/radioChoice';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { HelpField, robotToHuman } from '@spinnaker/core';\n\nimport { DISABLE_EDIT_CONFIG, DisableableInput } from '../layout/disableable';\n\ninterface IEditMetricEffectSizesProps {\n metricId: string;\n direction: string;\n disabled: boolean;\n effectSizes: ICanaryMetricEffectSizeConfig;\n}\n\ninterface IEditMetricEffectSizesDispatchProps {\n updateEffectSize: (id: string, value: ICanaryMetricEffectSizeConfig) => void;\n}\n\nexport function EditMetricEffectSizes({\n effectSizes = {},\n updateEffectSize,\n direction,\n metricId,\n disabled,\n}: IEditMetricEffectSizesProps & IEditMetricEffectSizesDispatchProps) {\n const [showEffectSizes, setShowEffectSizes] = React.useState<boolean>(!!Object.keys(effectSizes).length);\n // only allow editing of measurement type if it was set to \"cles\" programmatically\n const [allowEditMeasurementType] = React.useState<boolean>(effectSizes.measure === 'cles');\n\n const description = (\n <p>\n Effect sizes should be used when your canary data produces a lot of metrics that flag as \"high\", but where you\n only want the test to fail if they are sufficiently larger or smaller than the control data.\n </p>\n );\n\n if (!showEffectSizes && disabled) {\n return null;\n }\n\n if (!showEffectSizes) {\n return (\n <FormRow label=\"Effect Sizes\">\n {description}\n <button className=\"passive\" onClick={() => setShowEffectSizes(true)}>\n Configure effect sizes\n </button>\n </FormRow>\n );\n }\n\n const isCles = effectSizes.measure === 'cles';\n const defaultSize = isCles ? 0.5 : 1;\n\n const {\n allowedIncrease = defaultSize,\n criticalIncrease = defaultSize,\n allowedDecrease = defaultSize,\n criticalDecrease = defaultSize,\n measure = 'meanRatio',\n } = effectSizes;\n\n const updateSize = (field: keyof ICanaryMetricEffectSizeConfig, percent: string) => {\n const value = isCles ? Number(percent) : fromPercent(field, percent);\n const newEffectSizes = { ...effectSizes, [field]: value };\n if (value === defaultSize) {\n delete newEffectSizes[field];\n }\n updateEffectSize(metricId, newEffectSizes);\n };\n\n const updateMeasure = (event: React.ChangeEvent<HTMLInputElement>) => {\n updateEffectSize(metricId, { ...effectSizes, measure: event.target.value });\n };\n\n const fromPercent = (field: keyof ICanaryMetricEffectSizeConfig, percent: string) => {\n const size = Number(percent) / 100;\n return field.endsWith('Increase') ? 1 + size : 1 - size;\n };\n\n const toPercent = (value: number, field: keyof ICanaryMetricEffectSizeConfig) => {\n const normalized = field.endsWith('Increase') ? value - 1 : 1 - value;\n return Math.round(normalized * 100);\n };\n\n const clesLabel = (\n <>\n CLES <HelpField id=\"canary.config.effectSize.cles\" />\n </>\n );\n\n const noEffectLabel = (effect: number) => {\n if (effect === defaultSize) {\n return <HelpField expand={true} content=\"(will not affect metric evaluation)\" />;\n }\n return null;\n };\n\n const buildInput = (field: keyof ICanaryMetricEffectSizeConfig, value: number) => (\n <div className=\"form-group flex-1\">\n <label>{robotToHuman(field)}</label>\n <div className=\"row\">\n <div className=\"col-md-4\">\n <div className=\"input-group effect-size-wrapper\">\n <DisableableInput\n className=\"form-control input-sm\"\n type=\"number\"\n min={0}\n step={isCles ? 0.01 : 1}\n onChange={(e) => updateSize(field, e.target.value)}\n value={isCles ? value : toPercent(value, field)}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n {!isCles && <div className=\"input-group-addon\">%</div>}\n </div>\n </div>\n </div>\n {noEffectLabel(value)}\n </div>\n );\n\n return (\n <FormRow label=\"Effect Sizes\">\n {description}\n <div className=\"vertical\" style={{ marginTop: '5px' }}>\n {allowEditMeasurementType && (\n <div className=\"form-group vertical\">\n <label>Measurement Type</label>\n <div>\n <RadioChoice\n value=\"meanRatio\"\n label=\"Mean (default)\"\n name=\"measure\"\n current={measure}\n action={updateMeasure}\n />\n <RadioChoice value=\"cles\" label={clesLabel} name=\"measure\" current={measure} action={updateMeasure} />\n </div>\n </div>\n )}\n <label className=\"sp-margin-m-top\">Allowed Effects</label>\n <p>\n If the canary surpasses the baseline by the supplied (non-zero) percentage, the <em>metric</em> will fail.\n </p>\n <div className=\"horizontal\">\n {direction !== 'increase' && buildInput('allowedDecrease', allowedDecrease)}\n {direction !== 'decrease' && buildInput('allowedIncrease', allowedIncrease)}\n </div>\n <label className=\"sp-margin-m-top\">Critical Effects</label>\n <p>\n If the canary surpasses the baseline by the supplied (non-zero) percentage, the <em>entire analysis</em> will\n fail with a score of 0.\n </p>\n <div className=\"horizontal\">\n {direction !== 'increase' && buildInput('criticalDecrease', criticalDecrease)}\n {direction !== 'decrease' && buildInput('criticalIncrease', criticalIncrease)}\n </div>\n </div>\n </FormRow>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IEditMetricEffectSizesProps {\n return {\n metricId: state.selectedConfig.editingMetric.id,\n direction: state.selectedConfig.editingMetric.analysisConfigurations?.canary?.direction ?? 'either',\n disabled: state.app.disableConfigEdit || CanarySettings.disableConfigEdit,\n effectSizes: state.selectedConfig.editingMetric.analysisConfigurations?.canary?.effectSize ?? {},\n };\n}\n\nfunction mapDispatchToProps(dispatch: any): IEditMetricEffectSizesDispatchProps {\n return {\n updateEffectSize: (id: string, value: ICanaryMetricEffectSizeConfig) =>\n dispatch(Creators.updateEffectSize({ id, value })),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(EditMetricEffectSizes);\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryFilterTemplateValidationMessages } from 'kayenta/edit/filterTemplatesValidation';\nimport {\n DISABLE_EDIT_CONFIG,\n DisableableInput,\n DisableableReactSelect,\n DisableableTextarea,\n} from 'kayenta/layout/disableable';\nimport FormRow from 'kayenta/layout/formRow';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { configTemplatesSelector, editingTemplateSelector } from 'kayenta/selectors';\nimport {\n editingTemplateValidationSelector,\n selectedTemplateNameSelector,\n} from 'kayenta/selectors/filterTemplatesSelectors';\nimport { get, isString } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Option } from 'react-select';\nimport { Dispatch } from 'redux';\n\nimport './filterTemplateSelector.less';\n\ninterface IFilterTemplateSelectorStateProps {\n editedTemplateName: string;\n editedTemplateValue: string;\n selectedTemplateName: string;\n templates: { [key: string]: string };\n validation: ICanaryFilterTemplateValidationMessages;\n}\n\ninterface IFilterTemplateSelectorDispatchProps {\n deleteTemplate: (e: any, name: string) => void;\n editTemplateBegin: (e: any, name: string, value: string) => void;\n editTemplateCancel: () => void;\n editTemplateConfirm: () => void;\n editTemplateName: (event: any) => void;\n editTemplateValue: (event: any) => void;\n selectTemplate: (option: Option) => void;\n}\n\nexport type IFilterTemplateSelectorProps = IFilterTemplateSelectorStateProps & IFilterTemplateSelectorDispatchProps;\n\nexport class FilterTemplateSelector extends React.Component<IFilterTemplateSelectorProps> {\n private getOptions = (): Option[] => {\n const templateOptions = Object.keys(this.props.templates).map((t) => ({\n value: t,\n label: t,\n requestingNew: false,\n }));\n templateOptions.push({ value: null, label: null, requestingNew: true });\n return templateOptions;\n };\n\n private optionRenderer = (option: Option<string>): JSX.Element => {\n if (option.requestingNew) {\n return <span>Create new...</span>;\n }\n return (\n <span className=\"filter-template-option\">\n <span>{option.label}</span>\n <span>\n <button className=\"link\" onMouseDown={(e) => this.props.deleteTemplate(e, option.value)}>\n Delete\n </button>\n <button\n className=\"link\"\n onMouseDown={(e) => this.props.editTemplateBegin(e, option.value, this.props.templates[option.value])}\n >\n Edit\n </button>\n </span>\n </span>\n );\n };\n\n public render() {\n const {\n editedTemplateName,\n editedTemplateValue,\n editTemplateCancel,\n editTemplateConfirm,\n editTemplateName,\n editTemplateValue,\n selectTemplate,\n selectedTemplateName,\n templates,\n validation,\n } = this.props;\n const isEditing = isString(editedTemplateName) && isString(editedTemplateValue);\n return (\n <>\n <FormRow label=\"Filter Template\" helpId=\"canary.config.filterTemplate\" inputOnly={true}>\n {!isEditing && (\n <DisableableReactSelect\n value={selectedTemplateName}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n disabled={CanarySettings.disableConfigEdit}\n onChange={selectTemplate}\n options={this.getOptions()}\n optionRenderer={this.optionRenderer}\n />\n )}\n </FormRow>\n {isEditing && (\n <>\n <FormRow label=\"Name\" error={get(validation, 'errors.templateName.message')} inputOnly={true}>\n <DisableableInput\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n disabled={CanarySettings.disableConfigEdit}\n onChange={editTemplateName}\n value={editedTemplateName}\n />\n </FormRow>\n <FormRow\n label=\"Template\"\n inputOnly={true}\n error={get(validation, 'errors.templateValue.message')}\n warning={get(validation, 'warnings.template.message')}\n >\n <DisableableTextarea\n className=\"template-editor-textarea\"\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n disabled={CanarySettings.disableConfigEdit}\n onChange={editTemplateValue}\n value={editedTemplateValue}\n />\n </FormRow>\n <FormRow>\n <div className=\"horizontal pull-right\">\n <button className=\"link\" onClick={editTemplateCancel}>\n Cancel\n </button>\n <button\n className=\"link\"\n disabled={[validation.errors.templateName, validation.errors.templateValue].some((e) => e != null)}\n onClick={editTemplateConfirm}\n >\n Save\n </button>\n </div>\n </FormRow>\n </>\n )}\n {!isEditing && selectedTemplateName && (\n <FormRow>\n <pre className=\"template-editor-value-formatted\">{templates[selectedTemplateName]}</pre>\n </FormRow>\n )}\n </>\n );\n }\n}\n\nconst mapStateToProps = (state: ICanaryState): IFilterTemplateSelectorStateProps => ({\n editedTemplateName: get(editingTemplateSelector(state), 'editedName'),\n editedTemplateValue: get(editingTemplateSelector(state), 'editedValue'),\n selectedTemplateName: selectedTemplateNameSelector(state),\n templates: configTemplatesSelector(state),\n validation: editingTemplateValidationSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>): IFilterTemplateSelectorDispatchProps => ({\n deleteTemplate: (e: any, name: string) => {\n e.stopPropagation();\n dispatch(Creators.selectTemplate({ name: null }));\n dispatch(Creators.deleteTemplate({ name }));\n },\n editTemplateBegin: (e: any, name: string, value: string) => {\n e.stopPropagation();\n dispatch(Creators.selectTemplate({ name }));\n dispatch(\n Creators.editTemplateBegin({\n name,\n value,\n }),\n );\n },\n editTemplateCancel: () => dispatch(Creators.editTemplateCancel()),\n editTemplateConfirm: () => dispatch(Creators.editTemplateConfirm()),\n editTemplateName: (event: any) => dispatch(Creators.editTemplateName({ name: event.target.value })),\n editTemplateValue: (event: any) => dispatch(Creators.editTemplateValue({ value: event.target.value })),\n selectTemplate: (option: Option<string>) => {\n if (option && option.requestingNew === true) {\n dispatch(Creators.selectTemplate({ name: null }));\n dispatch(Creators.addTemplate());\n } else {\n dispatch(Creators.selectTemplate({ name: option ? option.value : null }));\n }\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(FilterTemplateSelector);\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { DISABLE_EDIT_CONFIG, DisableableTextarea } from 'kayenta/layout/disableable';\nimport FormRow from 'kayenta/layout/formRow';\nimport { ICanaryState } from 'kayenta/reducers';\nimport {\n inlineTemplateValueSelector,\n transformInlineTemplateForSave,\n} from 'kayenta/selectors/filterTemplatesSelectors';\nimport { isEmpty } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\ninterface IInlineTemplateEditorStateProps {\n templateValue: string;\n transformValueForSave: (value: string) => string;\n}\n\ninterface IInlineTemplateEditorDispatchProps {\n editTemplateValue: (value: string) => void;\n}\n\nexport type IInlineTemplateEditorProps = IInlineTemplateEditorStateProps & IInlineTemplateEditorDispatchProps;\n\nexport function InlineTemplateEditor({\n editTemplateValue,\n templateValue,\n transformValueForSave,\n}: IInlineTemplateEditorProps) {\n return (\n <FormRow\n label=\"Template\"\n inputOnly={true}\n helpId=\"canary.config.filterTemplate\"\n error={isEmpty(templateValue) && 'Template is required'}\n >\n <DisableableTextarea\n className=\"template-editor-textarea\"\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n disabled={CanarySettings.disableConfigEdit}\n onChange={(e: any) => editTemplateValue(transformValueForSave(e.target.value))}\n value={templateValue}\n />\n </FormRow>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IInlineTemplateEditorStateProps {\n return {\n templateValue: inlineTemplateValueSelector(state),\n transformValueForSave: transformInlineTemplateForSave(state),\n };\n}\n\nfunction mapDispatchToProps(dispatch: any): IInlineTemplateEditorDispatchProps {\n return {\n editTemplateValue: (value: string) => dispatch(Creators.editInlineTemplate({ value })),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(InlineTemplateEditor);\n","import { ICanaryMetricConfig } from 'kayenta/domain/ICanaryConfig';\nimport metricStoreConfigService from 'kayenta/metricStore/metricStoreConfig.service';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\ninterface IMetricConfigurerDelegatorStateProps {\n editingMetric: ICanaryMetricConfig;\n}\n\n/*\n * Should find and render the appropriate metric configurer for a given metric store.\n * */\nfunction MetricConfigurerDelegator({ editingMetric }: IMetricConfigurerDelegatorStateProps) {\n const config = metricStoreConfigService.getDelegate(editingMetric.query.type);\n if (config && config.metricConfigurer) {\n const MetricConfigurer = config.metricConfigurer;\n return <MetricConfigurer />;\n } else {\n return <p>Metric configuration has not been implemented for {editingMetric.query.type}.</p>;\n }\n}\n\nfunction mapStateToProps(state: ICanaryState): IMetricConfigurerDelegatorStateProps {\n return {\n editingMetric: state.selectedConfig.editingMetric,\n };\n}\n\nexport default connect(mapStateToProps)(MetricConfigurerDelegator);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryMetricConfig } from 'kayenta/domain';\nimport { DISABLE_EDIT_CONFIG, DisableableInput, DisableableSelect } from 'kayenta/layout/disableable';\nimport FormRow from 'kayenta/layout/formRow';\nimport RadioChoice from 'kayenta/layout/radioChoice';\nimport Styleguide from 'kayenta/layout/styleguide';\nimport metricStoreConfigService from 'kayenta/metricStore/metricStoreConfig.service';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { editingMetricValidationErrorsSelector } from 'kayenta/selectors';\nimport { isTemplateValidSelector, useInlineTemplateEditorSelector } from 'kayenta/selectors/filterTemplatesSelectors';\nimport { isNull, values } from 'lodash';\nimport * as React from 'react';\nimport { Modal } from 'react-bootstrap';\nimport { connect } from 'react-redux';\n\nimport { noop } from '@spinnaker/core';\n\nimport EditMetricEffectSizes from './editMetricEffectSizes';\nimport { ICanaryMetricValidationErrors } from './editMetricValidation';\nimport FilterTemplateSelector from './filterTemplateSelector';\nimport InlineTemplateEditor from './inlineTemplateEditor';\nimport MetricConfigurerDelegator from './metricConfigurerDelegator';\n\nimport './editMetricModal.less';\n\ninterface IEditMetricModalDispatchProps {\n rename: (event: any) => void;\n changeGroup: (event: any) => void;\n updateDirection: (event: any) => void;\n updateNanStrategy: (event: any) => void;\n updateCriticality: (event: any) => void;\n confirm: () => void;\n cancel: () => void;\n}\n\ninterface IEditMetricModalStateProps {\n metric: ICanaryMetricConfig;\n groups: string[];\n isTemplateValid: boolean;\n useInlineTemplateEditor: boolean;\n disableEdit: boolean;\n validationErrors: ICanaryMetricValidationErrors;\n}\n\n/*\n * Modal to edit metric details.\n */\nfunction EditMetricModal({\n metric,\n rename,\n changeGroup,\n groups,\n confirm,\n cancel,\n isTemplateValid,\n updateDirection,\n updateNanStrategy,\n updateCriticality,\n useInlineTemplateEditor,\n disableEdit,\n validationErrors,\n}: IEditMetricModalDispatchProps & IEditMetricModalStateProps) {\n if (!metric) {\n return null;\n }\n\n const direction = metric.analysisConfigurations?.canary?.direction ?? 'either';\n const nanStrategy = metric.analysisConfigurations?.canary?.nanStrategy ?? 'default';\n const critical = metric.analysisConfigurations?.canary?.critical ?? false;\n const isConfirmDisabled =\n !isTemplateValid ||\n disableEdit ||\n CanarySettings.disableConfigEdit ||\n values(validationErrors).some((e) => !isNull(e));\n\n const metricGroup = metric.groups.length ? metric.groups[0] : groups[0];\n const templatesEnabled =\n metricStoreConfigService.getDelegate(metric.query.type) &&\n metricStoreConfigService.getDelegate(metric.query.type).useTemplates &&\n CanarySettings.templatesEnabled;\n return (\n <Modal bsSize=\"large\" show={true} onHide={noop} className={classNames('kayenta-edit-metric-modal')}>\n <Styleguide>\n <Modal.Header>\n <Modal.Title>\n {disableEdit || CanarySettings.disableConfigEdit ? 'Metric Details' : 'Configure Metric'}\n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <FormRow label=\"Group\" inputOnly={true}>\n {metric.groups.length > 1 && (\n <DisableableInput\n type=\"text\"\n value={metric.groups}\n data-id={metric.id}\n onChange={changeGroup}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n )}\n {metric.groups.length < 2 && (\n <DisableableSelect\n value={metricGroup}\n onChange={changeGroup}\n className=\"form-control input-sm\"\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n >\n {groups.map((g) => (\n <option key={g} value={g}>\n {g}\n </option>\n ))}\n </DisableableSelect>\n )}\n </FormRow>\n <FormRow label=\"Name\" error={validationErrors?.name?.message ?? null} inputOnly={true}>\n <DisableableInput\n type=\"text\"\n value={metric.name}\n data-id={metric.id}\n onChange={rename}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n </FormRow>\n <FormRow label=\"Fail on\">\n <RadioChoice\n value=\"increase\"\n label=\"Increase\"\n name=\"direction\"\n current={direction}\n action={updateDirection}\n />\n <RadioChoice\n value=\"decrease\"\n label=\"Decrease\"\n name=\"direction\"\n current={direction}\n action={updateDirection}\n />\n <RadioChoice value=\"either\" label=\"Either\" name=\"direction\" current={direction} action={updateDirection} />\n </FormRow>\n <FormRow label=\"Criticality\" checkbox={true}>\n <label>\n <DisableableInput\n type=\"checkbox\"\n checked={critical}\n onChange={updateCriticality}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n Fail the canary if this metric fails\n </label>\n </FormRow>\n <FormRow label=\"NaN Strategy\" helpId=\"canary.config.nanStrategy\">\n <RadioChoice\n value=\"default\"\n label=\"Default (remove)\"\n name=\"nanStrategy\"\n current={nanStrategy}\n action={updateNanStrategy}\n />\n <RadioChoice\n value=\"replace\"\n label=\"Replace with zero\"\n name=\"nanStrategy\"\n current={nanStrategy}\n action={updateNanStrategy}\n />\n <RadioChoice\n value=\"remove\"\n label=\"Remove\"\n name=\"nanStrategy\"\n current={nanStrategy}\n action={updateNanStrategy}\n />\n </FormRow>\n <EditMetricEffectSizes />\n <MetricConfigurerDelegator />\n {templatesEnabled && !useInlineTemplateEditor && <FilterTemplateSelector />}\n {templatesEnabled && useInlineTemplateEditor && <InlineTemplateEditor />}\n </Modal.Body>\n <Modal.Footer>\n <ul className=\"list-inline pull-right\">\n <li>\n <button className=\"passive\" onClick={cancel}>\n Cancel\n </button>\n </li>\n <li>\n <button className=\"primary\" disabled={isConfirmDisabled} onClick={confirm}>\n OK\n </button>\n </li>\n </ul>\n </Modal.Footer>\n </Styleguide>\n </Modal>\n );\n}\n\nfunction mapDispatchToProps(dispatch: any): IEditMetricModalDispatchProps {\n return {\n rename: (event: any) => {\n dispatch(Creators.renameMetric({ id: event.target.dataset.id, name: event.target.value }));\n },\n changeGroup: (event: any) => {\n dispatch(Creators.updateMetricGroup({ id: event.target.dataset.id, group: event.target.value }));\n },\n cancel: () => {\n dispatch(Creators.editMetricCancel());\n dispatch(Creators.editTemplateCancel());\n },\n confirm: () => {\n dispatch(Creators.editMetricConfirm());\n dispatch(Creators.editTemplateCancel());\n },\n updateDirection: ({ target }: React.ChangeEvent<HTMLInputElement>) => {\n dispatch(Creators.updateMetricDirection({ id: target.dataset.id, direction: target.value }));\n },\n updateNanStrategy: ({ target }: React.ChangeEvent<HTMLInputElement>) => {\n dispatch(Creators.updateMetricNanStrategy({ id: target.dataset.id, strategy: target.value }));\n },\n updateCriticality: ({ target }: React.ChangeEvent<HTMLInputElement>) => {\n dispatch(Creators.updateMetricCriticality({ id: target.dataset.id, critical: Boolean(target.checked) }));\n },\n };\n}\n\nfunction mapStateToProps(state: ICanaryState): IEditMetricModalStateProps {\n return {\n metric: state.selectedConfig.editingMetric,\n groups: state.selectedConfig.group.list.sort(),\n isTemplateValid: isTemplateValidSelector(state),\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useInlineTemplateEditor: useInlineTemplateEditorSelector(state),\n disableEdit: state.app.disableConfigEdit || CanarySettings.disableConfigEdit,\n validationErrors: editingMetricValidationErrorsSelector(state),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(EditMetricModal);\n","import * as React from 'react';\n\nimport './titledSection.less';\n\nexport interface ISectionProps {\n title: string;\n children?: any;\n}\n\n// TODO: implemented the mocks using a modified open pod, but the styleguide should add something more directly appropriate\nexport default function TitledSection({ title, children }: ISectionProps) {\n return (\n <section className=\"pod open titled-section\">\n <div className=\"header horizontal middle\">\n <div className=\"flex-1 heading-2 uppercase\">{title}</div>\n </div>\n <div className=\"contents vertical\">{children}</div>\n </section>\n );\n}\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryMetricConfig } from 'kayenta/domain/ICanaryConfig';\nimport { DISABLE_EDIT_CONFIG, DisableableSelect } from 'kayenta/layout/disableable';\nimport Styleguide from 'kayenta/layout/styleguide';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { Modal } from 'react-bootstrap';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport { noop } from '@spinnaker/core';\n\ninterface IChangeMetricGroupModalOwnProps {\n metric: ICanaryMetricConfig;\n}\n\ninterface IChangeMetricGroupModalStateProps {\n groups: string[];\n toGroup: string;\n}\n\ninterface IChangeMetricGroupModalDispatchProps {\n select: (event: any) => void;\n clear: () => void;\n confirm: () => void;\n}\n\nfunction ChangeMetricGroupModal({\n groups,\n toGroup,\n confirm,\n clear,\n select,\n}: IChangeMetricGroupModalStateProps & IChangeMetricGroupModalDispatchProps) {\n return (\n <Modal show={true} onHide={noop}>\n <Styleguide>\n <Modal.Header>\n <Modal.Title>Change Metric Group</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <DisableableSelect\n value={toGroup || ''}\n onChange={select}\n className=\"form-control input-sm\"\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n >\n <option value={''}>-- select group --</option>\n {groups.map((g) => (\n <option key={g} value={g}>\n {g}\n </option>\n ))}\n </DisableableSelect>\n </Modal.Body>\n <Modal.Footer>\n <ul className=\"list-inline pull-right\">\n <li>\n <button className=\"passive\" onClick={clear}>\n Cancel\n </button>\n </li>\n <li>\n <button className=\"primary\" disabled={!toGroup} onClick={confirm}>\n OK\n </button>\n </li>\n </ul>\n </Modal.Footer>\n </Styleguide>\n </Modal>\n );\n}\n\nfunction mapStateToProps(\n state: ICanaryState,\n { metric }: IChangeMetricGroupModalOwnProps,\n): IChangeMetricGroupModalStateProps {\n // If a metric belongs to more than one group, allow a move into one of those groups.\n // e.g., a [system, requests] -> [requests] move should be allowed, but\n // don't offer a [system] -> [system] move.\n return {\n groups: state.selectedConfig.group.list.filter((g) => metric.groups.length > 1 || !metric.groups.includes(g)),\n toGroup: state.selectedConfig.changeMetricGroup.toGroup,\n };\n}\n\nfunction mapDispatchToProps(\n dispatch: (action: Action & any) => void,\n { metric }: IChangeMetricGroupModalOwnProps,\n): IChangeMetricGroupModalDispatchProps {\n return {\n select: (event: any) => {\n dispatch(Creators.changeMetricGroupSelect({ group: event.target.value || null }));\n },\n clear: () => {\n dispatch(Creators.changeMetricGroupConfirm({ metricId: null }));\n },\n confirm: () => {\n dispatch(Creators.changeMetricGroupConfirm({ metricId: metric.id }));\n },\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ChangeMetricGroupModal);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryMetricConfig } from 'kayenta/domain';\nimport { DISABLE_EDIT_CONFIG, DisableableButton } from 'kayenta/layout/disableable';\nimport { ITableColumn, NativeTable } from 'kayenta/layout/table';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { cloneDeep } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport { Tooltip } from '@spinnaker/core';\n\nimport ChangeMetricGroupModal from './changeMetricGroupModal';\n\nimport './metricList.less';\n\ninterface IMetricListStateProps {\n selectedGroup: string;\n metrics: ICanaryMetricConfig[];\n showGroups: boolean;\n changingGroupMetric: ICanaryMetricConfig;\n groupList: string[];\n metricStore: string;\n disableEdit: boolean;\n}\n\ninterface IMetricListDispatchProps {\n addMetric: (event: any) => void;\n editMetric: (event: any) => void;\n copyMetric: (metric: ICanaryMetricConfig) => void;\n removeMetric: (event: any) => void;\n openChangeMetricGroupModal: (event: any) => void;\n}\n\nfunction FailOn({ metric }: { metric: ICanaryMetricConfig }) {\n const direction = metric.analysisConfigurations?.canary?.direction;\n const isCritical = metric.analysisConfigurations?.canary?.critical;\n const tooltipSuffix = isCritical ? '(critical — if this metric fails, the entire canary will fail)' : '';\n const classes = classNames('metric-fail-on-icon', 'fas', 'sp-margin-xs-right', { critical: isCritical });\n if (direction === 'decrease') {\n return (\n <Tooltip value={`decrease ${tooltipSuffix}`}>\n <i className={`fa-caret-square-down ${classes}`} />\n </Tooltip>\n );\n }\n if (direction === 'increase') {\n return (\n <Tooltip value={`increase ${tooltipSuffix}`}>\n <i className={`fa-caret-square-up ${classes}`} />\n </Tooltip>\n );\n }\n return (\n <Tooltip value={`increase OR decrease ${tooltipSuffix}`}>\n <span>\n <i className={`fa-caret-square-down ${classes}`} />\n <i className={`fa-caret-square-up ${classes}`} />\n </span>\n </Tooltip>\n );\n}\n\n/*\n * Configures an entire list of metrics.\n */\nfunction MetricList({\n metrics,\n groupList,\n selectedGroup,\n showGroups,\n addMetric,\n editMetric,\n copyMetric,\n removeMetric,\n changingGroupMetric,\n openChangeMetricGroupModal,\n metricStore,\n disableEdit,\n}: IMetricListStateProps & IMetricListDispatchProps) {\n const columns: Array<ITableColumn<ICanaryMetricConfig>> = [\n {\n label: 'Metric Name',\n getContent: (metric) => <span>{metric.name || '(new)'}</span>,\n },\n {\n label: 'Fail On',\n getContent: (metric) => <FailOn metric={metric} />,\n },\n {\n label: 'Groups',\n getContent: (metric) => <span>{metric.groups.join(', ')}</span>,\n hide: () => !showGroups,\n },\n {\n getContent: (metric) => (\n <div className=\"horizontal pull-right metrics-action-buttons\">\n <button className=\"link\" data-id={metric.id} onClick={editMetric}>\n {disableEdit || CanarySettings.disableConfigEdit ? 'View' : 'Edit'}\n </button>\n <button\n className=\"link\"\n data-id={metric.id}\n disabled={disableEdit || CanarySettings.disableConfigEdit}\n onClick={openChangeMetricGroupModal}\n >\n Move Group\n </button>\n <button\n className=\"link\"\n data-id={metric.id}\n disabled={disableEdit || CanarySettings.disableConfigEdit}\n onClick={() => copyMetric(metric)}\n >\n Copy\n </button>\n <button\n className=\"link\"\n data-id={metric.id}\n disabled={disableEdit || CanarySettings.disableConfigEdit}\n onClick={removeMetric}\n >\n Delete\n </button>\n </div>\n ),\n },\n ];\n\n return (\n <>\n <NativeTable columns={columns} rows={metrics} rowKey={(metric) => metric.id} className=\"header-white\" />\n {!metrics.length && selectedGroup ? (\n <p>\n This group is empty! The group will be not be present the next time the config is loaded unless it is saved\n with at least one metric in it.\n </p>\n ) : null}\n {changingGroupMetric && <ChangeMetricGroupModal metric={changingGroupMetric} />}\n <DisableableButton\n className=\"passive self-left\"\n data-group={selectedGroup}\n data-default={groupList[0]}\n data-metric-store={metricStore}\n onClick={addMetric}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n >\n Add Metric\n </DisableableButton>\n </>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IMetricListStateProps {\n const selectedGroup = state.selectedConfig.group.selected;\n const metricList = state.selectedConfig.metricList;\n\n const filter = selectedGroup ? (metric: ICanaryMetricConfig) => metric.groups.includes(selectedGroup) : () => true;\n return {\n selectedGroup,\n groupList: state.selectedConfig.group.list,\n metrics: metricList.filter(filter),\n showGroups: !selectedGroup || metricList.filter(filter).some((metric) => metric.groups.length > 1),\n changingGroupMetric: state.selectedConfig.metricList.find(\n (m) => m.id === state.selectedConfig.changeMetricGroup.metric,\n ),\n metricStore: state.selectedConfig.selectedStore,\n disableEdit: state.app.disableConfigEdit || CanarySettings.disableConfigEdit,\n };\n}\n\nfunction mapDispatchToProps(dispatch: (action: Action & any) => void): IMetricListDispatchProps {\n return {\n addMetric: (event: any) => {\n const group = event.target.dataset.group || event.target.dataset.default;\n dispatch(\n Creators.addMetric({\n metric: {\n // TODO: need to block saving an invalid name\n // TODO: for Atlas metrics, attempt to gather name when query changes\n id: '[new]',\n analysisConfigurations: {},\n name: '',\n query: {\n type: event.target.dataset.metricStore,\n serviceType: event.target.dataset.metricStore,\n },\n groups: group ? [group] : [],\n scopeName: 'default', // scopeName always defaults to `default` and is not configurable from the UI\n isNew: true,\n },\n }),\n );\n },\n copyMetric: (metric: ICanaryMetricConfig) => {\n const metricCopy: ICanaryMetricConfig = cloneDeep(metric);\n metricCopy.id = '[new]';\n metricCopy.isNew = true;\n metricCopy.name = '';\n dispatch(Creators.addMetric({ metric: metricCopy }));\n },\n editMetric: (event: any) => {\n dispatch(Creators.editMetricBegin({ id: event.target.dataset.id }));\n },\n removeMetric: (event: any) => {\n dispatch(Creators.removeMetric({ id: event.target.dataset.id }));\n },\n openChangeMetricGroupModal: (event: any) => dispatch(Creators.changeMetricGroup({ id: event.target.dataset.id })),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MetricList);\n","import * as React from 'react';\n\nexport interface IFormListProps {\n children: JSX.Element[] | JSX.Element;\n}\n\n/*\n * Mostly exists to centralize styles for form components.\n * */\nexport default function FormList({ children }: IFormListProps) {\n return (\n <ul className=\"list-group\">\n {React.Children.map(\n children,\n (c) =>\n c && (\n <li className=\"list-unstyled\">\n <form role=\"form\" className=\"form-horizontal container-fluid\">\n <div className=\"col-md-12\">{c}</div>\n </form>\n </li>\n ),\n )}\n </ul>\n );\n}\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { KayentaAccountType } from 'kayenta/domain';\nimport { DISABLE_EDIT_CONFIG, DisableableSelect } from 'kayenta/layout/disableable';\nimport FormRow from 'kayenta/layout/formRow';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { chain } from 'lodash';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\ninterface IMetricStoreSelectorStateProps {\n stores: string[];\n selectedStore: string;\n}\n\ninterface IMetricStoreSelectorDispatchProps {\n select: (event: any) => void;\n}\n\nconst MetricStoreSelector = ({\n stores,\n selectedStore,\n select,\n}: IMetricStoreSelectorDispatchProps & IMetricStoreSelectorStateProps) => {\n if (stores.length < 2) {\n return null;\n }\n\n return (\n <FormRow label=\"Metric Store\" inputOnly={true}>\n <DisableableSelect\n value={selectedStore || ''}\n onChange={select}\n className=\"form-control input-sm\"\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n >\n {stores.map((s) => (\n <option key={s} value={s}>\n {s}\n </option>\n ))}\n </DisableableSelect>\n </FormRow>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricStoreSelectorStateProps => {\n return {\n stores: chain(state.data.kayentaAccounts.data)\n .filter((account) => account.supportedTypes.includes(KayentaAccountType.MetricsStore))\n .map((account) => account.metricsStoreType || account.type)\n .uniq()\n .sort()\n .valueOf(),\n selectedStore: state.selectedConfig.selectedStore,\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>): IMetricStoreSelectorDispatchProps => {\n return {\n select: (event: any) => dispatch(Creators.selectMetricStore({ store: event.target.value })),\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MetricStoreSelector);\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { DISABLE_EDIT_CONFIG, DisableableInput, DisableableTextarea } from 'kayenta/layout/disableable';\nimport FormList from 'kayenta/layout/formList';\nimport FormRow from 'kayenta/layout/formRow';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport MetricStoreSelector from './metricStoreSelector';\n\ninterface INameAndDescriptionDispatchProps {\n changeName: (event: React.ChangeEvent<HTMLInputElement>) => void;\n changeDescription: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n}\n\ninterface INameAndDescriptionStateProps {\n name: string;\n description: string;\n}\n\n/*\n * Configures canary config name and description.\n */\nfunction NameAndDescription({\n name,\n description,\n changeName,\n changeDescription,\n}: INameAndDescriptionDispatchProps & INameAndDescriptionStateProps) {\n return (\n <FormList>\n <FormRow label=\"Configuration Name\" inputOnly={true}>\n <DisableableInput\n type=\"text\"\n value={name}\n onChange={changeName}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n </FormRow>\n <MetricStoreSelector />\n <FormRow label=\"Description\" inputOnly={true}>\n <DisableableTextarea\n className=\"form-control input-sm\"\n value={description}\n onChange={changeDescription}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n </FormRow>\n </FormList>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): INameAndDescriptionStateProps {\n if (state.selectedConfig.config) {\n return {\n name: state.selectedConfig.config.name,\n description: state.selectedConfig.config.description,\n };\n } else {\n return {\n name: '',\n description: '',\n };\n }\n}\n\nfunction mapDispatchToProps(dispatch: (action: Action & any) => void): INameAndDescriptionDispatchProps {\n return {\n changeName: (event: React.ChangeEvent<HTMLInputElement>) => {\n dispatch(\n Creators.updateConfigName({\n name: event.target.value,\n }),\n );\n },\n changeDescription: (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n dispatch(\n Creators.updateConfigDescription({\n description: event.target.value,\n }),\n );\n },\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(NameAndDescription);\n","import * as React from 'react';\nimport { HelpField } from '@spinnaker/core';\n\nimport './titledSubsection.less';\n\nexport interface ITitledSubsectionProps {\n children: any;\n title: string;\n helpKey?: string;\n}\n\nexport default function TitledSubsection({ title, children, helpKey }: ITitledSubsectionProps) {\n return (\n <section className=\"titled-subsection\">\n <h5 className=\"heading-5\">\n {title} {helpKey && <HelpField id={helpKey} />}\n </h5>\n <hr />\n {children}\n </section>\n );\n}\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryConfig } from 'kayenta/domain/ICanaryConfig';\nimport { DISABLE_EDIT_CONFIG, DisableableInput } from 'kayenta/layout/disableable';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { mapStateToConfig } from 'kayenta/service/canaryConfig.service';\nimport { get, isNumber } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport FormRow from '../layout/formRow';\n\nexport interface IGroupWeightOwnProps {\n group: string;\n}\n\ninterface IGroupWeightStateProps {\n config: ICanaryConfig;\n}\n\ninterface IGroupWeightDispatchProps {\n handleInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\n/*\n * Component for configuring a group weight.\n * */\nfunction GroupWeight({\n group,\n config,\n handleInputChange,\n}: IGroupWeightOwnProps & IGroupWeightStateProps & IGroupWeightDispatchProps) {\n const groupWeight = getGroupWeights(config)[group];\n return (\n <FormRow label={group} inputOnly={true}>\n <DisableableInput\n type=\"number\"\n value={isNumber(groupWeight) ? groupWeight : ''}\n onChange={handleInputChange}\n min={0}\n max={100}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n </FormRow>\n );\n}\n\nfunction getGroupWeights(config: ICanaryConfig): { [key: string]: number } {\n return get(config, 'classifier.groupWeights', {});\n}\n\nfunction mapStateToProps(\n state: ICanaryState,\n ownProps: IGroupWeightOwnProps,\n): IGroupWeightOwnProps & IGroupWeightStateProps {\n return {\n ...ownProps,\n config: mapStateToConfig(state),\n };\n}\n\nfunction mapDispatchToProps(\n dispatch: (action: Action & any) => void,\n { group }: IGroupWeightOwnProps,\n): IGroupWeightDispatchProps {\n return {\n handleInputChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n dispatch(\n Creators.updateGroupWeight({\n group,\n weight: event.target.value ? parseInt(event.target.value, 10) : null,\n }),\n );\n },\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(GroupWeight);\n","import { flatMap, uniq } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport GroupWeight from './groupWeight';\nimport { ICanaryState } from '../reducers/index';\nimport { mapStateToConfig } from '../service/canaryConfig.service';\n\ninterface IGroupWeightsStateProps {\n groups: string[];\n}\n\n/*\n * Component for rendering list of group weight configurers.\n */\nfunction GroupWeights({ groups }: IGroupWeightsStateProps) {\n const hasGroups = groups.length > 0;\n return (\n <section>\n {hasGroups ? (\n groups.map((group) => <GroupWeight key={group} group={group} />)\n ) : (\n <p key=\"no-groups\">You have not configured any grouped metrics.</p>\n )}\n </section>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IGroupWeightsStateProps {\n const config = mapStateToConfig(state);\n const metrics = config ? config.metrics : [];\n const groups = uniq(flatMap(metrics, (metric) => metric.groups || []));\n return {\n groups,\n };\n}\n\nexport default connect(mapStateToProps)(GroupWeights);\n","import TitledSubsection from 'kayenta/layout/titledSubsection';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport GroupWeights from './groupWeights';\nimport JudgeSelect, { JudgeSelectRenderState } from './judgeSelect';\nimport FormList from '../layout/formList';\nimport { ICanaryState } from '../reducers/index';\n\ninterface IScoringStateProps {\n renderJudgeSelect: boolean;\n}\n\nfunction Scoring({ renderJudgeSelect }: IScoringStateProps) {\n return (\n <FormList>\n {renderJudgeSelect && (\n <TitledSubsection title=\"Judge\">\n <JudgeSelect />\n </TitledSubsection>\n )}\n <TitledSubsection title=\"Metric Group Weights\" helpKey=\"canary.config.metricGroupWeights\">\n <GroupWeights />\n </TitledSubsection>\n </FormList>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState) {\n return {\n renderJudgeSelect: state.selectedConfig.judge.renderState !== JudgeSelectRenderState.None,\n };\n}\n\nexport default connect(mapStateToProps)(Scoring);\n","import * as React from 'react';\n\nimport ConfigDetailHeader from './configDetailHeader';\nimport EditMetricModal from './editMetricModal';\nimport GroupTabs from './groupTabs';\nimport TitledSection from '../layout/titledSection';\nimport MetricList from './metricList';\nimport NameAndDescription from './nameAndDescription';\nimport Scoring from './scoring';\n\n/*\n * Top-level config detail layout\n */\nexport default function ConfigDetail() {\n return (\n <section className=\"config-detail\">\n <ConfigDetailHeader />\n <TitledSection title=\"Name and Description\">\n <NameAndDescription />\n </TitledSection>\n <TitledSection title=\"Metrics\">\n <GroupTabs />\n <MetricList />\n <EditMetricModal />\n </TitledSection>\n <TitledSection title=\"Scoring\">\n <Scoring />\n </TitledSection>\n </section>\n );\n}\n","import * as React from 'react';\n\nexport interface ICenteredDetailProps {\n children: JSX.Element;\n}\n\nexport default function CenteredDetail({ children }: ICenteredDetailProps) {\n return (\n <div className=\"row\">\n <div className=\"col-sm-offset-4\">{children}</div>\n </div>\n );\n}\n","import LoadStatesBuilder from 'kayenta/components/loadStates';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ConfigDetail from './configDetail';\nimport CenteredDetail from '../layout/centeredDetail';\nimport { AsyncRequestState } from '../reducers/asyncRequest';\nimport { ICanaryState } from '../reducers/index';\n\ninterface IConfigLoadStatesProps {\n configLoadState: AsyncRequestState;\n}\n\n/*\n * Renders appropriate view given the configuration detail's load state.\n */\nfunction ConfigDetailLoadStates({ configLoadState }: IConfigLoadStatesProps) {\n const LoadStates = new LoadStatesBuilder()\n .onFulfilled(<ConfigDetail />)\n .onFailed(\n <CenteredDetail>\n <h3 className=\"heading-3\">Could not load canary config.</h3>\n </CenteredDetail>,\n )\n .build();\n\n return <LoadStates state={configLoadState} />;\n}\n\nfunction mapStateToProps(state: ICanaryState): IConfigLoadStatesProps {\n return {\n configLoadState: state.selectedConfig.load.state,\n };\n}\n\nexport default connect(mapStateToProps)(ConfigDetailLoadStates);\n","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\nimport { Observable } from 'rxjs/Observable';\nimport { Subscription } from 'rxjs/Subscription';\n\nimport * as Creators from '../actions/creators';\nimport ConfigDetailLoadStates from './configDetailLoadStates';\n\ninterface IConfigLoaderStateParamsProps {\n configNameStream: Observable<IConfigDetailStateParams>;\n}\n\ninterface IConfigLoaderDispatchProps {\n loadConfig: (stateParams: IConfigDetailStateParams) => void;\n}\n\ninterface IConfigDetailStateParams {\n id: string;\n copy: boolean;\n new: boolean;\n}\n\n/*\n * Top-level .configDetail state component.\n * Loads config details on changes to /canary/:configName path parameter, renders load states.\n */\nclass ConfigDetailLoader extends React.Component<IConfigLoaderDispatchProps & IConfigLoaderStateParamsProps> {\n private subscription: Subscription;\n\n constructor(props: IConfigLoaderDispatchProps & IConfigLoaderStateParamsProps) {\n const { configNameStream, loadConfig } = props;\n super(props);\n this.subscription = configNameStream.subscribe(loadConfig);\n }\n\n public componentWillUnmount(): void {\n this.subscription.unsubscribe();\n }\n\n public render() {\n return <ConfigDetailLoadStates />;\n }\n}\n\nfunction mapDispatchToProps(dispatch: (action: Action & any) => void): IConfigLoaderDispatchProps {\n return {\n loadConfig: (stateParams: IConfigDetailStateParams) => {\n if (stateParams.copy) {\n dispatch(Creators.copySelectedConfig());\n } else if (stateParams.new) {\n dispatch(Creators.createNewConfig());\n } else if (stateParams.id) {\n dispatch(Creators.loadConfigRequest({ id: stateParams.id }));\n }\n },\n };\n}\n\nexport default connect(null, mapDispatchToProps)(ConfigDetailLoader);\n","import { UISref } from '@uirouter/react';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { UUIDGenerator } from '@spinnaker/core';\n\nimport { ICanaryState } from '../reducers/index';\n\ninterface ICreateConfigButtonStateProps {\n disabled: boolean;\n}\n\n/*\n * Button for creating a new canary config.\n */\nfunction CreateConfigButton({ disabled }: ICreateConfigButtonStateProps) {\n return (\n <UISref to=\".configDetail\" params={{ id: UUIDGenerator.generateUuid(), new: true }}>\n <button className=\"zombie text-left form-control\" disabled={disabled}>\n <i className=\"fa fa-plus-circle\" />\n <span>Add configuration</span>\n </button>\n </UISref>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): ICreateConfigButtonStateProps {\n return {\n disabled: (state.selectedConfig.config && state.selectedConfig.config.isNew) || CanarySettings.disableConfigEdit,\n };\n}\n\nexport default connect(mapStateToProps)(CreateConfigButton);\n","import * as React from 'react';\n\nimport { HelpField } from '@spinnaker/core';\n\ninterface IOwnedByProps {\n owningApplications: string[];\n currentApplication: string;\n}\n\nconst buildHelpText = (ownedBy: string[]): string => {\n if (ownedBy.length === 0) {\n return null;\n } else if (ownedBy.length === 1) {\n return `This config can only be edited from within the application <strong>${ownedBy[0]}.</strong>`;\n } else {\n return `This config can only be edited from within the following applications: <strong>${ownedBy.join(\n ', ',\n )}.</strong>`;\n }\n};\n\nexport const OwnedBy = ({ owningApplications, currentApplication }: IOwnedByProps) => {\n if (owningApplications.length < 2 && owningApplications.includes(currentApplication)) {\n return null;\n }\n\n return (\n <span>\n Owned by: {owningApplications.join(', ')}\n &nbsp;\n <HelpField placement=\"right\" content={buildHelpText(owningApplications)} />\n </span>\n );\n};\n","import { UISref } from '@uirouter/react';\nimport { ICanaryConfigSummary } from 'kayenta/domain/ICanaryConfigSummary';\nimport FormattedDate from 'kayenta/layout/formattedDate';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { sortBy } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport CreateConfigButton from './createConfigButton';\nimport { OwnedBy } from './ownedBy';\n\nimport './configList.less';\n\ninterface IConfigListStateProps {\n configs: ICanaryConfigSummary[];\n selectedConfigId: string;\n application: string;\n}\n\n/*\n * Shows a list of available configurations the user can select for editing.\n */\nfunction ConfigList({ configs, selectedConfigId, application }: IConfigListStateProps) {\n return (\n <section className=\"config-list\">\n <ul className=\"tabs-vertical list-unstyled \" style={{ wordBreak: 'break-all' }}>\n {configs.map((config) => (\n <li key={config.id} className={config.id === selectedConfigId ? 'selected' : ''}>\n <UISref to=\".configDetail\" params={{ id: config.id, new: false, copy: false }}>\n <a>\n <div className=\"heading-4 color-text-primary\">{config.name}</div>\n <div className=\"body-small color-text-caption caption\" style={{ marginTop: '5px', marginBottom: '0' }}>\n Edited: <FormattedDate dateIso={config.updatedTimestampIso} />\n <br />\n <OwnedBy owningApplications={config.applications} currentApplication={application} />\n </div>\n </a>\n </UISref>\n </li>\n ))}\n </ul>\n <CreateConfigButton />\n </section>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IConfigListStateProps {\n const selectedConfigId = state.selectedConfig.config ? state.selectedConfig.config.id : null;\n const application = state.data.application.name;\n return {\n selectedConfigId,\n configs: sortBy(state.data.configSummaries, 'name'),\n application,\n };\n}\n\nexport default connect(mapStateToProps)(ConfigList);\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nimport './footer.less';\n\nexport interface IFooterProps {\n children?: JSX.Element;\n}\n\nexport default function Footer({ children }: IFooterProps) {\n return <div className={classNames('row', 'canary-footer')}>{children}</div>;\n}\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nexport interface IListDetailProps {\n className?: string;\n list: JSX.Element;\n listClass?: string;\n listWidth?: number;\n detail: JSX.Element;\n detailWidth?: number;\n detailClass?: string;\n}\n\n/*\n * A composite view that combines a list view in one panel and a detail view in another.\n * The contents of the detail view are dependent on the user's selection in the list view.\n */\nexport default function ListDetail({\n className,\n list,\n listWidth = 2,\n detail,\n detailWidth = 10,\n listClass,\n detailClass,\n}: IListDetailProps) {\n return (\n <div className={classNames('list-detail', 'horizontal', className)}>\n <div className={classNames(`col-md-${listWidth}`, listClass)}>{list}</div>\n <div className={classNames(`col-md-${detailWidth}`, detailClass)}>{detail}</div>\n </div>\n );\n}\n","import { UIView } from '@uirouter/react';\nimport * as React from 'react';\n\nimport ConfigList from './configList';\nimport Footer from './footer';\nimport ListDetail from '../layout/listDetail';\n\n/*\n * Component for editing canary configurations for an application.\n */\nexport default function CanaryConfigEdit() {\n const List = <ConfigList />;\n // TODO: need to break these down by groups\n const noWrap = { wrap: false };\n const Detail = <UIView {...noWrap} name=\"detail\" />;\n return (\n <div className=\"vertical flex-1\">\n <ListDetail list={List} detail={Detail} className=\"flex-1\" detailClass=\"vertical flex-1\" />\n <Footer>\n <UIView {...noWrap} name=\"footer\" />\n </Footer>\n </div>\n );\n}\n","import { CanarySettings } from 'kayenta/canary.settings';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { SubmitButton } from '@spinnaker/core';\n\nimport * as Creators from '../actions/creators';\nimport { ICanaryState } from '../reducers';\nimport { AsyncRequestState } from '../reducers/asyncRequest';\n\ninterface ISaveButtonStateProps {\n saveConfigState: AsyncRequestState;\n inSyncWithServer: boolean;\n disable: boolean;\n}\n\ninterface ISaveButtonDispatchProps {\n saveConfig: () => void;\n}\n\n/*\n * Button for saving a canary config.\n */\nfunction SaveConfigButton({\n saveConfigState,\n inSyncWithServer,\n saveConfig,\n disable,\n}: ISaveButtonStateProps & ISaveButtonDispatchProps) {\n if (inSyncWithServer && saveConfigState !== AsyncRequestState.Requesting) {\n return (\n <span className=\"btn btn-link disabled\">\n <i className=\"far fa-check-circle\" /> In sync with server\n </span>\n );\n } else {\n return (\n <SubmitButton\n label=\"Save Changes\"\n onClick={saveConfig}\n isDisabled={disable || CanarySettings.disableConfigEdit}\n submitting={saveConfigState === AsyncRequestState.Requesting}\n />\n );\n }\n}\n\nfunction mapStateToProps(state: ICanaryState): ISaveButtonStateProps {\n const disable = !!state.selectedConfig.validationErrors.length || CanarySettings.disableConfigEdit;\n return {\n saveConfigState: state.selectedConfig.save.state,\n inSyncWithServer: state.selectedConfig.isInSyncWithServer,\n disable,\n };\n}\n\nfunction mapDispatchToProps(dispatch: any): ISaveButtonDispatchProps {\n return {\n saveConfig: () => {\n dispatch(Creators.saveConfig());\n },\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SaveConfigButton);\n","import classNames from 'classnames';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport * as Creators from '../actions/creators';\nimport { ICanaryState } from '../reducers';\nimport { AsyncRequestState } from '../reducers/asyncRequest';\n\ninterface ISaveErrorStateProps {\n saveConfigState: AsyncRequestState;\n saveConfigErrorMessage: string;\n}\n\ninterface ISaveErrorDispatchProps {\n dismissError: () => void;\n}\n\n/*\n * Renders canary config save error.\n */\nfunction SaveConfigError({\n saveConfigState,\n saveConfigErrorMessage,\n dismissError,\n}: ISaveErrorStateProps & ISaveErrorDispatchProps) {\n return (\n saveConfigState === AsyncRequestState.Failed && (\n <span className={classNames('alert', 'alert-danger')}>\n {buildErrorMessage(saveConfigErrorMessage)}\n <a className={classNames('alert-dismiss', 'clickable')} onClick={dismissError}>\n {' '}\n [dismiss]\n </a>\n </span>\n )\n );\n}\n\nfunction buildErrorMessage(saveConfigErrorMessage: string): string {\n const message = 'There was an error saving your config';\n return saveConfigErrorMessage ? message + `: ${saveConfigErrorMessage}.` : message + '.';\n}\n\nfunction mapStateToProps(state: ICanaryState): ISaveErrorStateProps {\n return {\n saveConfigState: state.selectedConfig.save.state,\n saveConfigErrorMessage: state.selectedConfig.save.error,\n };\n}\n\nfunction mapDispatchToProps(dispatch: any): ISaveErrorDispatchProps {\n return {\n dismissError: () => {\n dispatch(Creators.dismissSaveConfigError());\n },\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SaveConfigError);\n","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport { HoverablePopover } from '@spinnaker/core';\nimport { ICanaryState } from '../reducers/index';\n\ninterface IConfigValidationErrorsStateProps {\n errors: string[];\n}\n\nconst ConfigValidationErrors = ({ errors }: IConfigValidationErrorsStateProps) => {\n if (!errors || !errors.length) {\n return null;\n }\n\n const template = (\n <section>\n <p>The following errors may prevent this config from working properly:</p>\n <ul>\n {errors.map((e) => (\n <li key={e}>{e}</li>\n ))}\n </ul>\n </section>\n );\n\n return (\n <HoverablePopover placement={'left'} template={template}>\n <button className=\"btn btn-link\">\n <i className=\"fa fa-exclamation-triangle\" />\n </button>\n </HoverablePopover>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IConfigValidationErrorsStateProps => ({\n errors: state.selectedConfig.validationErrors.map((e) => e.message),\n});\n\nexport default connect(mapStateToProps)(ConfigValidationErrors);\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nimport SaveConfigButton from './saveConfigButton';\nimport SaveConfigError from './saveConfigError';\nimport ValidationErrors from './validationErrors';\n\n/*\n * Responsible for canary config save component layout.\n */\nexport default function Save() {\n return (\n <div className={classNames('col-sm-12', 'text-right')}>\n <ValidationErrors />\n <SaveConfigError />\n <SaveConfigButton />\n </div>\n );\n}\n","import * as React from 'react';\nimport CenteredDetail from '../layout/centeredDetail';\n\nexport default function SelectConfig() {\n return (\n <CenteredDetail>\n <h3 className=\"heading-3\">Click a configuration to edit.</h3>\n </CenteredDetail>\n );\n}\n","import { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryExecutionStatusResult } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { runSelector, serializedCanaryConfigSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { SETTINGS } from '@spinnaker/core';\n\ninterface ISourceJsonStateProps {\n reportUrl: string;\n metricListUrl: string;\n}\n\nconst SourceLinks = ({ reportUrl, metricListUrl }: ISourceJsonStateProps) => {\n return (\n <ul className=\"list-unstyled small\">\n <li>\n <a target=\"_blank\" href={reportUrl}>\n Report\n </a>\n </li>\n {metricListUrl && (\n <li>\n <p>\n <a target=\"_blank\" href={metricListUrl}>\n Metrics\n </a>\n </p>\n </li>\n )}\n </ul>\n );\n};\n\nconst resolveReportUrl = (state: ICanaryState): string => {\n const canaryConfigId = serializedCanaryConfigSelector(state).id;\n const result: ICanaryExecutionStatusResult = runSelector(state);\n const canaryRunId = result.id;\n let url = `${SETTINGS.gateUrl}/v2/canaries/canary/${canaryConfigId}/${canaryRunId}`;\n const storageAccountName = result.storageAccountName || CanarySettings.storageAccountName;\n if (storageAccountName) {\n url += `?storageAccountName=${storageAccountName}`;\n }\n return url;\n};\n\nconst resolveMetricListUrl = (state: ICanaryState): string => {\n const status = runSelector(state);\n const { metricSetPairListId } = status;\n if (!metricSetPairListId) {\n return null;\n }\n let url = `${SETTINGS.gateUrl}/v2/canaries/metricSetPairList/${metricSetPairListId}`;\n const storageAccountName = status.storageAccountName || CanarySettings.storageAccountName;\n if (storageAccountName) {\n url += `?storageAccountName=${storageAccountName}`;\n }\n return url;\n};\n\nconst mapStateToProps = (state: ICanaryState): ISourceJsonStateProps => {\n return {\n reportUrl: resolveReportUrl(state),\n metricListUrl: resolveMetricListUrl(state),\n };\n};\n\nexport default connect(mapStateToProps)(SourceLinks);\n","import { ICanaryExecutionStatusResult } from 'kayenta/domain/ICanaryExecutionStatusResult';\nimport FormattedDate from 'kayenta/layout/formattedDate';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { HoverablePopover } from '@spinnaker/core';\n\nimport SourceLinks from './sourceLinks';\n\ninterface IReportMetadata {\n run: ICanaryExecutionStatusResult;\n}\n\ninterface IMetadataGroup {\n label?: string;\n entries: IMetadataEntry[];\n}\n\ninterface IMetadataEntry {\n label: string;\n getContent: () => JSX.Element;\n popover?: boolean;\n}\n\nconst Label = ({ label, extraClass }: { label: string; extraClass?: string }) => (\n <label className={`label uppercase color-text-primary ${extraClass}`}>{label}</label>\n);\n\n// TODO(dpeach): this only supports canary runs with a single scope.\nconst buildScopeMetadataEntries = (run: ICanaryExecutionStatusResult): IMetadataGroup[] => {\n const request = run.canaryExecutionRequest;\n const scopes = Object.values(request.scopes);\n if (scopes.length > 1) {\n return null;\n }\n\n const {\n controlScope: { step, location: controlLocation, scope: controlScope },\n experimentScope: {\n // Since baseline starttime may be offset in canaries from Orca,\n // Choose the experiment start and end to represent\n // the canary start and end times\n start: experimentStart,\n end: experimentEnd,\n location: experimentLocation,\n scope: experimentScope,\n },\n } = scopes[0];\n\n return [\n {\n label: 'baseline',\n entries: [\n {\n label: 'scope',\n popover: true,\n getContent: () => <p className=\"kayenta-scope\">{controlScope}</p>,\n },\n {\n label: 'location',\n getContent: () => <p>{controlLocation}</p>,\n },\n ],\n },\n {\n label: 'canary',\n entries: [\n {\n label: 'scope',\n popover: true,\n getContent: () => <p className=\"kayenta-scope\">{experimentScope}</p>,\n },\n {\n label: 'location',\n getContent: () => <p>{experimentLocation}</p>,\n },\n ],\n },\n {\n label: 'time',\n entries: [\n {\n label: 'start',\n getContent: () => (\n <p>\n <FormattedDate dateIso={experimentStart} />\n </p>\n ),\n },\n {\n label: 'end',\n getContent: () => (\n <p>\n <FormattedDate dateIso={experimentEnd} />\n </p>\n ),\n },\n {\n label: 'step',\n getContent: () => {\n const mins = step / 60;\n return (\n <p>\n {mins} min\n {mins === 1 ? '' : 's'}\n </p>\n );\n },\n },\n ],\n },\n ];\n};\n\nconst ReportMetadata = ({ run }: IReportMetadata) => {\n const {\n thresholds: { marginal, pass },\n } = run.canaryExecutionRequest;\n\n const metadataGroups = buildScopeMetadataEntries(run) || [];\n metadataGroups.push({\n label: 'threshold',\n entries: [\n {\n label: 'marginal',\n getContent: () => <p>{marginal}</p>,\n },\n {\n label: 'pass',\n getContent: () => <p>{pass}</p>,\n },\n ],\n });\n\n return (\n <section className=\"report-metadata\">\n {metadataGroups.map((group, index) => (\n <div className={`group group-${group.label}`} key={group.label || index}>\n <Label label={group.label || ''} extraClass=\"label-lg\" />\n <ul className=\"list-unstyled\">\n {group.entries.map((e) => (\n <li key={e.label || index}>\n <Label label={e.label} />\n {e.popover ? (\n <HoverablePopover template={e.getContent()}>{e.getContent()}</HoverablePopover>\n ) : (\n <>{e.getContent()}</>\n )}\n </li>\n ))}\n </ul>\n </div>\n ))}\n <div className=\"group group-source\" key=\"source\">\n <Label label=\"Source\" extraClass=\"label-lgf\" />\n <SourceLinks />\n </div>\n </section>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n run: state.selectedRun.run,\n});\n\nexport default connect(mapStateToProps)(ReportMetadata);\n","import { CanaryScore } from 'kayenta/components/canaryScore';\nimport { ICanaryJudgeScore } from 'kayenta/domain/ICanaryJudgeResult';\nimport { ScoreClassificationLabel } from 'kayenta/domain/ScoreClassificationLabel';\nimport { round } from 'lodash';\nimport * as React from 'react';\n\nexport interface ICanaryJudgeScoreProps {\n score: ICanaryJudgeScore;\n showClassification?: boolean;\n inverse?: boolean;\n}\n\n// TODO(dpeach): don't use ACA statuses in the CanaryScore component.\nconst mapKayentaToACA = (score: ICanaryJudgeScore): { health: string; result: string } => {\n if (score.classification === ScoreClassificationLabel.Pass) {\n return { health: null, result: 'success' };\n } else if (score.classification === ScoreClassificationLabel.Fail) {\n return { health: 'unhealthy', result: null };\n } else {\n return { health: null, result: null };\n }\n};\n\nexport default ({ score, showClassification, inverse }: ICanaryJudgeScoreProps) => (\n <CanaryScore\n className=\"score-report\"\n score={round(score.score, 2)}\n result={mapKayentaToACA(score).result}\n health={mapKayentaToACA(score).health}\n classification={showClassification ? score.classification : null}\n inverse={inverse}\n />\n);\n","import { UISref } from '@uirouter/react';\nimport { ICanaryJudgeScore } from 'kayenta/domain/ICanaryJudgeResult';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { judgeResultSelector, serializedCanaryConfigSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ReportMetadata from './reportMetadata';\nimport ReportScore from './score';\n\nimport './header.less';\n\nexport interface IReportHeaderStateProps {\n id: string;\n name: string;\n score: ICanaryJudgeScore;\n}\n\nconst ReportHeader = ({ id, name, score }: IReportHeaderStateProps) => (\n <section className=\"horizontal report-header\">\n <div className=\"report-score-wrapper\">\n <ReportScore score={score} showClassification={true} />\n <h1 className=\"heading-2 color-text-primary\">\n <UISref to=\"^.^.canaryConfig.configDetail\" params={{ id }}>\n <a className=\"clickable color-text-primary\"> {name}</a>\n </UISref>\n </h1>\n </div>\n <ReportMetadata />\n </section>\n);\n\nconst mapStateToProps = (state: ICanaryState): IReportHeaderStateProps => ({\n id: serializedCanaryConfigSelector(state).id,\n name: serializedCanaryConfigSelector(state).name,\n score: judgeResultSelector(state).score,\n});\n\nexport default connect(mapStateToProps)(ReportHeader);\n","import { ICanaryAnalysisResult } from 'kayenta/domain/ICanaryJudgeResult';\nimport { IMetricSetPair } from 'kayenta/domain/IMetricSetPair';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { metricResultsSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { GraphType, metricSetPairGraphService } from './metricSetPairGraph.service';\n\ninterface IMetricSetPairGraphStateProps {\n pair: IMetricSetPair;\n result: ICanaryAnalysisResult;\n graphType: GraphType;\n}\n\nconst GRAPH_IMPLEMENTATIONS = ['semiotic'];\n\nconst MetricSetPairGraph = ({ pair, result, graphType }: IMetricSetPairGraphStateProps) => {\n const delegates = GRAPH_IMPLEMENTATIONS.map((name) => metricSetPairGraphService.getDelegate(name)).filter((d) => !!d);\n const delegate = delegates.find((candidate) => candidate.handlesGraphType(graphType));\n if (!delegate) {\n return <h3 className=\"heading-3\">Could not load graph.</h3>;\n }\n const Graph = delegate.getGraph();\n return <Graph metricSetPair={pair} result={result} type={graphType} />;\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricSetPairGraphStateProps => {\n const selectedMetric = state.selectedRun.selectedMetric;\n return {\n pair: state.selectedRun.metricSetPair.pair,\n result: metricResultsSelector(state).find((result) => result.id === selectedMetric),\n graphType: state.selectedRun.graphType,\n };\n};\n\nexport default connect(mapStateToProps)(MetricSetPairGraph);\n","import * as Creators from 'kayenta/actions/creators';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport { GraphType } from './graph/metricSetPairGraph.service';\n\nimport './graphTypeSelector.less';\n\ninterface IGraphTypeSelectorStateProps {\n selected: GraphType;\n}\n\ninterface IGraphTypeSelectorDispatchProps {\n selectGraphType: (type: GraphType) => void;\n}\n\nconst GraphTypeSelector = ({\n selected,\n selectGraphType,\n}: IGraphTypeSelectorStateProps & IGraphTypeSelectorDispatchProps) => {\n return (\n <ul className=\"list-inline graph-type-selector\">\n <li>\n <label className=\"label uppercase color-text-primary\" style={{ paddingLeft: 0 }}>\n Graph:\n </label>\n </li>\n {Object.values(GraphType).map((type) => (\n <li\n style={selected === type ? { textDecoration: 'underline' } : null}\n key={type}\n onClick={() => selectGraphType(type)}\n >\n <a className=\"small clickable\">{type}</a>\n </li>\n ))}\n </ul>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IGraphTypeSelectorStateProps => ({\n selected: state.selectedRun.graphType,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>): IGraphTypeSelectorDispatchProps => ({\n selectGraphType: (type: GraphType) => dispatch(Creators.selectGraphType({ type })),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(GraphTypeSelector);\n","import { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryMetricConfig } from 'kayenta/domain/ICanaryConfig';\nimport { IMetricSetPair } from 'kayenta/domain/IMetricSetPair';\nimport metricStoreConfigStore from 'kayenta/metricStore/metricStoreConfig.service';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { selectedMetricConfigSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { CopyToClipboard } from '@spinnaker/core';\n\nimport './metricResultActions.less';\n\nexport interface IMetricResultStatsStateProps {\n metricConfig: ICanaryMetricConfig;\n metricSetPair: IMetricSetPair;\n}\n\nconst buildAtlasGraphUrl = (metricSetPair: IMetricSetPair) => {\n const { attributes, scopes, values, tags } = metricSetPair;\n const { atlasGraphBaseUrl } = CanarySettings;\n let legendTags = '';\n if (Object.keys(tags).length) {\n legendTags = ` (${Object.keys(tags)\n .map((tag) => `$${tag}`)\n .join('|')})`;\n }\n\n // TODO: If the control and experiment have different baseURLs, generate two links instead of a combined one.\n const backend = encodeURIComponent(attributes.control.baseURL);\n const experimentQuery = encodeURIComponent(attributes.experiment.query);\n const controlQuery = encodeURIComponent(attributes.control.query);\n const query = `${experimentQuery},Canary${legendTags},:legend,:freeze,${controlQuery},Baseline${legendTags},:legend`;\n\n const startTime = Math.min(scopes.control.startTimeMillis, scopes.experiment.startTimeMillis);\n const controlEndTime = scopes.control.startTimeMillis + values.control.length * scopes.control.stepMillis;\n const experimentEndTime = scopes.experiment.startTimeMillis + values.experiment.length * scopes.experiment.stepMillis;\n const endTime = Math.max(controlEndTime, experimentEndTime);\n\n return `${atlasGraphBaseUrl}?backend=${backend}&g.q=${query}&g.s=${startTime}&g.e=${endTime}&g.w=651&mode=png&axis=0`;\n};\n\nconst MetricResultActions = ({ metricSetPair, metricConfig }: IMetricResultStatsStateProps) => {\n const atlasURL = buildAtlasGraphUrl(metricSetPair);\n const atlasQuery = metricStoreConfigStore.getDelegate(metricConfig.query.type).queryFinder(metricConfig);\n\n // Mask CopyToClipboard component as a larger button, fire event when clicked\n const copyToClipboard = (\n <div className=\"copy-button-container\">\n <CopyToClipboard displayText={false} text={atlasQuery} toolTip={null} />\n <button className=\"primary copy-button\" key=\"copy-link\">\n <i className=\"glyphicon glyphicon-copy copy-icon\" />\n Copy metric query\n </button>\n </div>\n );\n\n const openAtlas = (\n <a href={atlasURL} target=\"_blank\">\n <button className=\"primary\">\n <i className=\"fas fa-chart-line\" />\n Explore more data in Atlas\n </button>\n </a>\n );\n\n const actions = [copyToClipboard, openAtlas].map((action, i) => {\n return (\n <li className=\"action\" key={i}>\n {action}\n </li>\n );\n });\n\n return (\n <div className=\"metric-result-actions\">\n <ul className=\"actions-layout list-inline\">{actions}</ul>\n </div>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricResultStatsStateProps => ({\n metricConfig: selectedMetricConfigSelector(state),\n metricSetPair: state.selectedRun.metricSetPair.pair,\n});\n\nexport default connect(mapStateToProps)(MetricResultActions);\n","import { ICanaryAnalysisResultsStats } from 'kayenta/domain';\nimport { ICanaryMetricConfig } from 'kayenta/domain/ICanaryConfig';\nimport { ICanaryExecutionStatusResult } from 'kayenta/domain/ICanaryExecutionStatusResult';\nimport { IMetricSetPair } from 'kayenta/domain/IMetricSetPair';\nimport FormattedDate from 'kayenta/layout/formattedDate';\nimport { ITableColumn, NativeTable } from 'kayenta/layout/table';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { runSelector, selectedMetricConfigSelector } from 'kayenta/selectors';\nimport { round } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport './metricResultStats.less';\n\nexport interface IMetricResultStatsStateProps {\n metricConfig: ICanaryMetricConfig;\n metricSetPair: IMetricSetPair;\n run: ICanaryExecutionStatusResult;\n service: string;\n}\n\nconst getStats = (run: ICanaryExecutionStatusResult, id: string, target: string): ICanaryAnalysisResultsStats => {\n const result = run.result.judgeResult.results.find((r) => r.id === id);\n if (target === 'experiment') {\n return result.experimentMetadata.stats;\n } else if (target === 'control') {\n return result.controlMetadata.stats;\n } else {\n return null;\n }\n};\n\ninterface IResultMetadataRow {\n label: string;\n getContent: () => JSX.Element;\n}\n\nconst ResultMetadataRow = ({ row }: { row: IResultMetadataRow }) => {\n if (!row.getContent()) {\n return null;\n }\n\n return (\n <div>\n <label className=\"label uppercase color-text-primary\">{row.label}</label>\n {row.getContent()}\n </div>\n );\n};\n\nconst MetricResultStats = ({ metricConfig, metricSetPair, run }: IMetricResultStatsStateProps) => {\n const tableColumns: Array<ITableColumn<string>> = [\n {\n getContent: (target) => <span>{target === 'control' ? 'Baseline' : 'Canary'}</span>,\n },\n {\n label: 'start',\n getContent: (target) => <FormattedDate dateIso={metricSetPair.scopes[target].startTimeIso} />,\n hide: () => {\n const request = run.canaryExecutionRequest;\n const configuredControlStart = request.scopes[metricConfig.scopeName].controlScope.start;\n const actualControlStart = metricSetPair.scopes.control.startTimeIso;\n\n const configuredExperimentStart = request.scopes[metricConfig.scopeName].experimentScope.start;\n const actualExperimentStart = metricSetPair.scopes.experiment.startTimeIso;\n\n return configuredControlStart === actualControlStart && configuredExperimentStart === actualExperimentStart;\n },\n },\n {\n label: 'count',\n getContent: (target) => <span>{getStats(run, metricSetPair.id, target).count}</span>,\n },\n {\n label: 'avg',\n getContent: (target) => <span>{round(getStats(run, metricSetPair.id, target).mean, 3)}</span>,\n },\n {\n label: 'max',\n getContent: (target) => <span>{round(getStats(run, metricSetPair.id, target).max, 3)}</span>,\n },\n {\n label: 'min',\n getContent: (target) => <span>{round(getStats(run, metricSetPair.id, target).min, 3)}</span>,\n },\n ];\n\n const metadataRows: IResultMetadataRow[] = [\n {\n label: 'classification reason',\n getContent: () => {\n const result = run.result.judgeResult.results.find((r) => r.id === metricSetPair.id);\n\n if (!result.classificationReason) {\n return null;\n }\n\n return <p>{result.classificationReason}</p>;\n },\n },\n ];\n\n return (\n <div className=\"metric-stats vertical\">\n {metadataRows.map((row) => (\n <ResultMetadataRow row={row} key={row.label} />\n ))}\n <NativeTable columns={tableColumns} rows={['control', 'experiment']} rowKey={(row) => row} />\n </div>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricResultStatsStateProps => ({\n metricConfig: selectedMetricConfigSelector(state),\n metricSetPair: state.selectedRun.metricSetPair.pair,\n run: runSelector(state),\n service: selectedMetricConfigSelector(state).query.type,\n});\n\nexport default connect(mapStateToProps)(MetricResultStats);\n","import * as React from 'react';\n\nimport Graph from './graph/graph';\nimport GraphTypeSelector from './graphTypeSelector';\nimport MetricResultActions from './metricResultActions';\nimport MetricResultStats from './metricResultStats';\n\n/*\n * Responsible for layout of the metric result detail view after the metric set\n * pair for the result has loaded successfully.\n * */\nexport default () => (\n <section className=\"vertical flex-1 sp-padding-xl-bottom\" style={{ overflowY: 'auto' }}>\n <GraphTypeSelector />\n <Graph />\n <MetricResultActions />\n <MetricResultStats />\n </section>\n);\n","import LoadStatesBuilder from 'kayenta/components/loadStates';\nimport { AsyncRequestState } from 'kayenta/reducers/asyncRequest';\nimport { ICanaryState } from 'kayenta/reducers/index';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport MetricResultDetailLayout from './metricResultDetailLayout';\n\nconst MetricSetPairLoadStates = ({ state }: { state: AsyncRequestState }) => {\n const LoadStates = new LoadStatesBuilder()\n .onFulfilled(<MetricResultDetailLayout />)\n .onFailed(<h3 className=\"heading-3 text-center\">Could not load metrics.</h3>)\n .build();\n\n return <LoadStates state={state} />;\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n state: state.selectedRun.metricSetPair.load,\n});\n\nexport default connect(mapStateToProps)(MetricSetPairLoadStates);\n","import { ICanaryAnalysisResult } from 'kayenta/domain/ICanaryJudgeResult';\nimport * as React from 'react';\n\nimport MetricSetPairLoadStates from './metricSetPairLoadStates';\n\nexport interface IMetricResultDetailProps {\n result: ICanaryAnalysisResult;\n}\n\n/*\n * Top-level component for the metric result detail - i.e., the right side of the\n * screen that opens when you click on a metric result.\n * */\nexport default ({ result }: IMetricResultDetailProps) => {\n if (result) {\n return <MetricSetPairLoadStates />;\n } else {\n return <h3 className=\"heading-3 text-center\">Select a metric result.</h3>;\n }\n};\n","import * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport * as Creators from '../../actions/creators';\nimport { ICanaryAnalysisResult, MetricClassificationLabel } from '../../domain';\nimport { ICanaryState } from '../../reducers';\n\nexport interface IMetricFiltersOwnProps {\n results: ICanaryAnalysisResult[];\n}\n\ninterface IMetricFiltersStateProps {\n metricFilters: MetricClassificationLabel[];\n}\n\ninterface IMetricFiltersDispatchProps {\n toggle: (classification: MetricClassificationLabel) => void;\n}\n\nconst MetricFilters = ({\n results,\n metricFilters,\n toggle,\n}: IMetricFiltersOwnProps & IMetricFiltersStateProps & IMetricFiltersDispatchProps) => {\n const options = [\n MetricClassificationLabel.Error,\n MetricClassificationLabel.High,\n MetricClassificationLabel.Low,\n MetricClassificationLabel.Nodata,\n MetricClassificationLabel.Pass,\n ]\n .map((classification) => ({\n classification,\n count: results.filter((r) => r.classification === classification).length,\n }))\n .filter((option) => option.count);\n\n const checkboxes = options.map((o) => (\n <label key={o.classification}>\n <input\n type=\"checkbox\"\n checked={metricFilters.includes(o.classification)}\n onChange={() => toggle(o.classification)}\n />{' '}\n {o.classification} ({o.count}){' '}\n </label>\n ));\n\n return <div className=\"metric-filter-options horizontal center\">{checkboxes}</div>;\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricFiltersStateProps => ({\n metricFilters: state.selectedRun.metricFilters,\n});\n\nconst mapDispatchToProps = (\n dispatch: Dispatch<ICanaryState>,\n ownProps: IMetricFiltersOwnProps,\n): IMetricFiltersOwnProps & IMetricFiltersDispatchProps => ({\n toggle: (classification: MetricClassificationLabel) =>\n dispatch(Creators.toggleMetricClassificationFilter({ classification })),\n ...ownProps,\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MetricFilters);\n","import {\n ICanaryJudgeGroupScore,\n ICanaryJudgeScore,\n ICanaryScoreThresholds,\n MetricClassificationLabel,\n ScoreClassificationLabel,\n} from 'kayenta/domain';\n\n// Standard Spinnaker styleguide colors.\nconst GREEN = 'var(--color-success)';\nconst RED = 'var(--color-danger)';\nconst GREY = 'var(--color-text-caption)';\nconst YELLOW = 'var(--color-warning)';\n\nexport const mapMetricClassificationToColor = (classification: MetricClassificationLabel): string =>\n ({\n [MetricClassificationLabel.High]: RED,\n [MetricClassificationLabel.Low]: RED,\n [MetricClassificationLabel.Error]: YELLOW,\n [MetricClassificationLabel.Nodata]: GREY,\n [MetricClassificationLabel.Pass]: GREEN,\n }[classification]);\n\nexport const mapScoreClassificationToColor = (classification: ScoreClassificationLabel): string =>\n ({\n [ScoreClassificationLabel.Fail]: RED,\n [ScoreClassificationLabel.Error]: YELLOW,\n [ScoreClassificationLabel.Marginal]: GREY,\n [ScoreClassificationLabel.Nodata]: GREY,\n [ScoreClassificationLabel.Pass]: GREEN,\n }[classification]);\n\nexport const mapGroupToColor = (\n group: ICanaryJudgeGroupScore | ICanaryJudgeScore,\n scoreThresholds: ICanaryScoreThresholds,\n): string => {\n if (typeof group.score !== 'number') {\n return YELLOW; // Some kind of error.\n } else if (group.score > scoreThresholds.pass) {\n return GREEN;\n } else if (group.score > scoreThresholds.marginal) {\n return GREY;\n } else {\n return RED;\n }\n};\n","import classNames from 'classnames';\nimport { MetricClassificationLabel } from 'kayenta/domain/MetricClassificationLabel';\nimport * as React from 'react';\n\nimport { mapMetricClassificationToColor } from './colors';\n\ninterface IMetricResultClassificationProps {\n classification: MetricClassificationLabel;\n className?: string;\n}\n\nconst buildStyle = (classification: MetricClassificationLabel) => ({\n backgroundColor: mapMetricClassificationToColor(classification),\n});\n\nconst TEXT_COLOR = 'var(--color-text-on-dark)';\n\nexport default ({ classification, className }: IMetricResultClassificationProps) => (\n <div className={classNames('pill', 'metric-result-classification', className)} style={buildStyle(classification)}>\n <span style={{ color: TEXT_COLOR }}>{classification}</span>\n </div>\n);\n","import * as React from 'react';\n\ninterface IMetricResultDeviationProps {\n className?: string;\n ratio: number;\n}\n\nconst formatDeviationAsPercentage = (ratio: number) => {\n if (typeof ratio !== 'number') {\n return 'N/A';\n } else if (ratio === 1) {\n return '0%';\n } else if (ratio < 1) {\n return ((ratio - 1) * 100).toFixed(1) + '%';\n } else {\n return '+' + ((ratio - 1) * 100).toFixed(1) + '%';\n }\n};\n\nexport default ({ ratio, className }: IMetricResultDeviationProps) =>\n ratio && (\n <span className={className} style={{ color: 'var(--color-text-caption' }}>\n {formatDeviationAsPercentage(ratio)}\n </span>\n );\n","import { ITableColumn } from 'kayenta/layout/table';\nimport * as React from 'react';\n\nimport { BreakString } from '@spinnaker/core';\n\nimport MetricResultClassification from './metricResultClassification';\nimport MetricResultDeviation from './metricResultDeviation';\nimport { IMetricResultsTableRow } from './metricResultsList';\n\nexport const metricResultsColumns: Array<ITableColumn<IMetricResultsTableRow>> = [\n {\n label: 'metric name',\n getContent: ({ metricName }) => <BreakString>{metricName}</BreakString>,\n width: 5,\n },\n {\n label: 'deviation',\n getContent: ({ results }) =>\n results[0].resultMetadata && <MetricResultDeviation ratio={results[0].resultMetadata.ratio} />,\n width: 1,\n },\n {\n label: 'result',\n getContent: ({ results }) => <MetricResultClassification classification={results[0].classification} />,\n width: 1,\n },\n];\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { ICanaryAnalysisResult } from 'kayenta/domain/ICanaryJudgeResult';\nimport { ITableColumn, Table } from 'kayenta/layout/table';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { selectedMetricResultIdSelector } from 'kayenta/selectors';\nimport { chain } from 'lodash';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport { BreakString } from '@spinnaker/core';\n\nimport MetricResultClassification from './metricResultClassification';\nimport MetricResultDeviation from './metricResultDeviation';\n\ninterface IMultipleResultsTableOwnProps {\n results: ICanaryAnalysisResult[];\n}\n\ninterface IMultipleResultsTableStateProps {\n selectedResult: string;\n}\n\ninterface IMultipleResultsTableDispatchProps {\n select: (metricId: string) => void;\n}\n\nconst MultipleResultsTable = ({\n results,\n select,\n selectedResult,\n}: IMultipleResultsTableOwnProps & IMultipleResultsTableStateProps & IMultipleResultsTableDispatchProps) => {\n const tagKeys = chain(results)\n .flatMap((r) => Object.keys(r.tags || {}))\n .uniq()\n .value();\n\n let columns: Array<ITableColumn<ICanaryAnalysisResult>> = tagKeys.map((key) => ({\n label: key,\n width: 5,\n getContent: (result: ICanaryAnalysisResult) => <BreakString>{result.tags[key]}</BreakString>,\n }));\n\n columns = columns.concat([\n {\n width: 1,\n getContent: ({ resultMetadata }) => resultMetadata && <MetricResultDeviation ratio={resultMetadata.ratio} />,\n },\n {\n width: 1,\n getContent: ({ classification }) => <MetricResultClassification classification={classification} />,\n },\n ]);\n\n return (\n <Table\n rows={results}\n columns={columns}\n className=\"multiple-results-table\"\n headerClassName=\"sticky-header-2\"\n rowClassName={(r) => classNames('horizontal', { selected: r.id === selectedResult })}\n rowKey={(r) =>\n Object.entries(r.tags || {})\n .map(([key, value]) => `${key}:${value}`)\n .join(':')\n }\n onRowClick={(r) => select(r.id)}\n />\n );\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n selectedResult: selectedMetricResultIdSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>, ownProps: IMultipleResultsTableOwnProps) => ({\n ...ownProps,\n select: (metricId: string) => dispatch(Creators.selectReportMetric({ metricId })),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MultipleResultsTable);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { ICanaryAnalysisResult } from 'kayenta/domain/ICanaryJudgeResult';\nimport { Table } from 'kayenta/layout/table';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport { MetricClassificationLabel } from '../../domain';\nimport MetricFilters from './metricResultsClassificationFilters';\nimport { metricResultsColumns } from './metricResultsColumns';\nimport MultipleResultsTable from './multipleResultsTable';\n\nimport './metricResultsList.less';\n\nexport interface IResultsListOwnProps {\n results: ICanaryAnalysisResult[];\n}\n\ninterface IResultsListDispatchProps {\n select: (metric: string) => void;\n}\n\ninterface IResultsListStateProps {\n selectedMetric: string;\n metricFilters: MetricClassificationLabel[];\n}\n\nexport interface IMetricResultsTableRow {\n metricName: string;\n results: ICanaryAnalysisResult[];\n hasMultipleRows: boolean;\n}\n\nconst buildTableRows = (\n results: ICanaryAnalysisResult[],\n metricFilters: MetricClassificationLabel[],\n): IMetricResultsTableRow[] => {\n const unfilteredCounts = results.reduce((map, result) => {\n if (!map.has(result.name)) {\n map.set(result.name, 0);\n }\n map.set(result.name, map.get(result.name) + 1);\n return map;\n }, new Map<string, number>());\n\n const tableRowsByMetricName = results\n .filter((result) => !metricFilters.length || metricFilters.includes(result.classification))\n .reduce(\n (map, result) =>\n map.has(result.name)\n ? map.set(result.name, {\n metricName: result.name,\n results: map.get(result.name).results.concat(result),\n hasMultipleRows: unfilteredCounts.get(result.name) > 1,\n })\n : map.set(result.name, {\n metricName: result.name,\n results: [result],\n hasMultipleRows: unfilteredCounts.get(result.name) > 1,\n }),\n new Map<string, IMetricResultsTableRow>(),\n );\n\n return Array.from(tableRowsByMetricName.values());\n};\n\nconst buildRowForMetricWithMultipleResults = (row: IMetricResultsTableRow) => {\n if (!row.hasMultipleRows) {\n return null;\n }\n\n return (\n <li className=\"horizontal multiple-results\">\n <section className=\"vertical flex-fill\">\n <div>{row.metricName}</div>\n <MultipleResultsTable results={row.results} />\n </section>\n </li>\n );\n};\n\nconst ResultsList = ({\n results,\n select,\n selectedMetric,\n metricFilters,\n}: IResultsListOwnProps & IResultsListDispatchProps & IResultsListStateProps) => {\n const rows = buildTableRows(results, metricFilters);\n return (\n <section className=\"vertical metric-results-list flex-1\">\n <MetricFilters results={results} />\n <Table\n rowKey={(r) => r.metricName}\n tableBodyClassName=\"list-unstyled tabs-vertical flex-1 sp-padding-xl-bottom\"\n rowClassName={(r) => classNames('horizontal', { selected: r.results[0].id === selectedMetric })}\n rows={rows}\n columns={metricResultsColumns}\n onRowClick={(r) => select(r.results[0].id)}\n className=\"flex-1 vertical\"\n customRow={buildRowForMetricWithMultipleResults}\n />\n </section>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IResultsListStateProps => ({\n selectedMetric: state.selectedRun.selectedMetric,\n metricFilters: state.selectedRun.metricFilters,\n});\n\nconst mapDispatchToProps = (\n dispatch: Dispatch<ICanaryState>,\n ownProps: IResultsListOwnProps,\n): IResultsListOwnProps & IResultsListDispatchProps => ({\n select: (metricId: string) => dispatch(Creators.selectReportMetric({ metricId })),\n ...ownProps,\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ResultsList);\n","import { ICanaryAnalysisResult } from 'kayenta/domain/ICanaryJudgeResult';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { judgeResultSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ListDetail from '../../layout/listDetail';\nimport MetricResultDetail from './metricResultDetail';\nimport MetricResultsList from './metricResultsList';\n\nimport './metricResults.less';\n\ninterface IMetricResultsStateProps {\n metricResults: ICanaryAnalysisResult[];\n selectedMetricResult: ICanaryAnalysisResult;\n}\n\nconst MetricResults = ({ metricResults, selectedMetricResult }: IMetricResultsStateProps) => {\n const list = <MetricResultsList results={metricResults} />;\n const detail = <MetricResultDetail result={selectedMetricResult} />;\n\n return (\n <ListDetail\n list={list}\n listClass=\"vertical\"\n listWidth={5}\n detail={detail}\n detailClass=\"vertical\"\n detailWidth={9}\n className=\"metric-results flex-1\"\n />\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricResultsStateProps => {\n const {\n selectedRun: { selectedGroup, selectedMetric },\n } = state;\n const result = judgeResultSelector(state);\n\n // Build list of metric results to render.\n const filter: (r: ICanaryAnalysisResult) => boolean = selectedGroup\n ? (r) => r.groups.includes(selectedGroup)\n : () => true;\n\n return {\n metricResults: Object.values(result.results).filter(filter),\n selectedMetricResult: Object.values(result.results).find((r) => r.id === selectedMetric),\n };\n};\n\nexport default connect(mapStateToProps)(MetricResults);\n","import { ICanaryExecutionException } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport SourceLinks from './sourceLinks';\n\nimport './reportExplanation.less';\n\ninterface IReportExceptionProps {\n exception: ICanaryExecutionException;\n}\n\nconst ReportException = ({ exception }: IReportExceptionProps) => {\n const errorMessages = [];\n if (exception.details) {\n // error messages can be in an array on the details, or a single field, or possibly both?\n // it's unclear based on Orca where the error message might be\n const { error, errors } = exception.details;\n if (error) {\n errorMessages.push(error);\n }\n if (errors?.length) {\n errors.forEach((m: string) => errorMessages.push(m));\n }\n }\n // if there were no errors, set a default message\n if (!errorMessages.length) {\n errorMessages.push('No error message provided. Click the \"Report\" link to see more details.');\n }\n\n return (\n <>\n <h3 className=\"text-center\">Canary report failed</h3>\n <dl>\n <dt>Details</dt>\n <dd>\n {errorMessages.map((message, i) => (\n <div key={i}>\n <code>{message}</code>\n </div>\n ))}\n </dd>\n <dt>Source</dt>\n <dd>\n <SourceLinks />\n </dd>\n </dl>\n </>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n exception: state.selectedRun.run.exception,\n});\n\nexport default connect(mapStateToProps)(ReportException);\n","import { ICanaryExecutionStatusResult } from 'kayenta/domain/ICanaryExecutionStatusResult';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport './reportExplanation.less';\n\ninterface IReportMetadata {\n run: ICanaryExecutionStatusResult;\n}\n\nconst getReason = (run: ICanaryExecutionStatusResult): string =>\n run?.result?.judgeResult?.score?.classificationReason ?? null;\n\nconst ReportExplanation = ({ run }: IReportMetadata) => {\n const classificationReason = getReason(run);\n\n if (classificationReason) {\n return (\n <section>\n <div className=\"report-explanation\">{classificationReason}</div>\n </section>\n );\n }\n return null;\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n run: state.selectedRun.run,\n});\n\nexport default connect(mapStateToProps)(ReportExplanation);\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nconst ARROW_CLASS = 'arrow-down';\n\nexport interface IHeaderArrowProps {\n arrowColor: string;\n className?: string;\n}\n\nexport default ({ arrowColor, className }: IHeaderArrowProps) => (\n <div className={classNames(ARROW_CLASS, className)} style={{ borderTopColor: arrowColor }} />\n);\n","import classNames from 'classnames';\nimport { ICanaryJudgeScore, ICanaryScoreThresholds } from 'kayenta/domain';\nimport * as React from 'react';\n\nimport { mapGroupToColor } from './colors';\nimport HeaderArrow from './headerArrow';\n\nexport interface IAllMetricResultsHeader {\n onClick: () => void;\n className: string;\n score: ICanaryJudgeScore;\n scoreThresholds: ICanaryScoreThresholds;\n}\n\n/*\n * Clickable header for all metric results.\n */\nexport default ({ className, onClick, score, scoreThresholds }: IAllMetricResultsHeader) => (\n <section className={className}>\n <div\n onClick={onClick}\n style={{\n backgroundColor: mapGroupToColor(score, scoreThresholds),\n }}\n className={classNames('clickable', 'text-center', 'all-metric-results-header')}\n >\n <h3 className=\"heading-3 label\">ALL</h3>\n <HeaderArrow className=\"outer\" arrowColor=\"var(--color-titanium)\" />\n <HeaderArrow className=\"inner\" arrowColor={mapGroupToColor(score, scoreThresholds)} />\n </div>\n </section>\n);\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nimport HeaderArrow from './headerArrow';\n\nexport interface IGroupScoreProps {\n label: string;\n style?: { [key: string]: string };\n onClick: () => void;\n className: string;\n}\n\n/*\n * Component for a labeled, clickable, colored header.\n * */\nexport default ({ label, onClick, style, className }: IGroupScoreProps) => (\n <section style={style} onClick={onClick} className={classNames('clickable', 'text-center', 'group-score', className)}>\n <h3 className=\"heading-3 uppercase label\">{label}</h3>\n <HeaderArrow arrowColor={style.backgroundColor} />\n </section>\n);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { ICanaryJudgeGroupScore, ICanaryScoreThresholds, IGroupWeights } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { canaryExecutionRequestSelector, serializedGroupWeightsSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport ClickableHeader from './clickableHeader';\nimport { mapGroupToColor } from './colors';\n\nexport interface IGroupScoresOwnProps {\n groups: ICanaryJudgeGroupScore[];\n className?: string;\n}\n\ninterface IGroupScoresStateProps {\n groupWeights: IGroupWeights;\n scoreThresholds: ICanaryScoreThresholds;\n selectedGroup: string;\n}\n\ninterface IGroupScoresDispatchProps {\n select: (event: any) => void;\n}\n\n/*\n * Renders list of group scores.\n * */\nconst GroupScores = ({\n groups,\n groupWeights,\n scoreThresholds,\n className,\n select,\n selectedGroup,\n}: IGroupScoresOwnProps & IGroupScoresDispatchProps & IGroupScoresStateProps) => (\n <section className={classNames('horizontal', className)}>\n {groups.map((g) => (\n <ClickableHeader\n key={g.name}\n style={{\n width: `${groupWeights[g.name]}%`, // TODO: at some point (around 4%), the group name doesn't fit.\n backgroundColor: mapGroupToColor(g, scoreThresholds),\n }}\n onClick={() => select(g.name)}\n label={g.name}\n className={classNames('report-score', { active: g.name === selectedGroup })}\n />\n ))}\n </section>\n);\n\nconst mapStateToProps = (state: ICanaryState): IGroupScoresStateProps => ({\n selectedGroup: state.selectedRun.selectedGroup,\n groupWeights: serializedGroupWeightsSelector(state),\n scoreThresholds: canaryExecutionRequestSelector(state).thresholds,\n});\n\nconst mapDispatchToProps = (\n dispatch: Dispatch<ICanaryState>,\n ownProps: IGroupScoresOwnProps,\n): IGroupScoresOwnProps & IGroupScoresDispatchProps => ({\n select: (group: string) => dispatch(Creators.selectReportMetricGroup({ group })),\n ...ownProps,\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(GroupScores);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { ICanaryJudgeGroupScore, ICanaryJudgeScore, ICanaryScoreThresholds } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { judgeResultSelector, serializedGroupWeightsSelector } from 'kayenta/selectors';\nimport { sortBy } from 'lodash';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport AllMetricResultsHeader from './allMetricResultsHeader';\nimport GroupScores from './groupScores';\n\nimport './reportScores.less';\n\ninterface IReportScoresStateProps {\n groups: ICanaryJudgeGroupScore[];\n score: ICanaryJudgeScore;\n scoreThresholds: ICanaryScoreThresholds;\n selectedGroup: string;\n}\n\ninterface IReportScoresDispatchProps {\n clearSelectedGroup: () => void;\n}\n\ninterface IReportScoreParentProps {\n isExpanded: boolean;\n toggleHeader: () => void;\n}\n\n/*\n * Layout for the report scores.\n * */\nconst ReportScores = ({\n groups,\n isExpanded,\n selectedGroup,\n clearSelectedGroup,\n score,\n scoreThresholds,\n toggleHeader,\n}: IReportScoresStateProps & IReportScoresDispatchProps & IReportScoreParentProps) => {\n const chevronStyle = {\n transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',\n transition: 'all ease 0.15s',\n };\n\n return (\n <section className=\"horizontal report-scores\">\n <AllMetricResultsHeader\n onClick={clearSelectedGroup}\n score={score}\n scoreThresholds={scoreThresholds}\n className={classNames('flex-1', 'report-score', { active: !selectedGroup })}\n />\n <GroupScores groups={groups} className=\"flex-12\" />\n <div className=\"kayenta-overview-toggle horizontal middle\" onClick={() => toggleHeader()}>\n {isExpanded ? <p>hide details</p> : <p>show details</p>}\n <span className=\"glyphicon glyphicon-chevron-right\" style={chevronStyle} />\n </div>\n </section>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IReportScoresStateProps => ({\n groups: sortBy(\n judgeResultSelector(state).groupScores,\n // Sort by group weight, then by name.\n [(group: ICanaryJudgeGroupScore) => -serializedGroupWeightsSelector(state)[group.name], 'name'],\n ),\n score: judgeResultSelector(state).score,\n scoreThresholds: state.selectedRun.run.canaryExecutionRequest.thresholds,\n selectedGroup: state.selectedRun.selectedGroup,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>): IReportScoresDispatchProps => ({\n clearSelectedGroup: () => dispatch(Creators.selectReportMetricGroup({ group: null })),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ReportScores);\n","import { ICanaryExecutionStatusResult } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ReportHeader from './header';\nimport MetricResults from './metricResults';\nimport ReportException from './reportException';\nimport ReportExplanation from './reportExplanation';\nimport ReportScores from './reportScores';\n\nimport './detail.less';\n\n/*\n * Layout for report detail view.\n * */\n\ninterface IDetailViewProps {\n run: ICanaryExecutionStatusResult;\n}\n\nfunction DetailView({ run }: IDetailViewProps) {\n const [isExpanded, setIsExpanded] = React.useState<boolean>(true);\n\n if (!run.result?.judgeResult.results?.length && run.exception) {\n return <ReportException />;\n }\n\n const toggleDetailHeader = () => {\n setIsExpanded(!isExpanded);\n };\n return (\n <>\n <div className=\"vertical flex-1\">\n {isExpanded && <ReportHeader />}\n <ReportExplanation />\n <ReportScores isExpanded={isExpanded} toggleHeader={toggleDetailHeader} />\n <MetricResults />\n </div>\n </>\n );\n}\n\nconst mapStateToProps = (state: ICanaryState) => ({\n run: state.selectedRun.run,\n});\n\nexport default connect(mapStateToProps)(DetailView);\n","import LoadStatesBuilder from 'kayenta/components/loadStates';\nimport CenteredDetail from 'kayenta/layout/centeredDetail';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { AsyncRequestState } from 'kayenta/reducers/asyncRequest';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ReportDetail from './detail';\n\ninterface IReportLoadStatesStateProps {\n loadState: AsyncRequestState;\n}\n\nconst ReportLoadStates = ({ loadState }: IReportLoadStatesStateProps) => {\n const LoadStates = new LoadStatesBuilder()\n .onFulfilled(<ReportDetail />)\n .onFailed(\n <CenteredDetail>\n <h3 className=\"heading-3\">Could not load canary report.</h3>\n </CenteredDetail>,\n )\n .build();\n\n return <LoadStates state={loadState} />;\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n loadState: state.selectedRun.load,\n});\n\nexport default connect(mapStateToProps)(ReportLoadStates);\n","import * as Creators from 'kayenta/actions/creators';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\nimport { Observable } from 'rxjs/Observable';\nimport { Subscription } from 'rxjs/Subscription';\n\nimport ReportDetailLoadStates from './loadStates';\n\ninterface IResultLoaderStateParamsProps {\n resultIdStream: Observable<IResultLoaderStateParams>;\n}\n\ninterface IResultLoaderDispatchProps {\n loadResult: (stateParams: IResultLoaderStateParams) => void;\n}\n\ninterface IResultLoaderStateParams {\n configId: string;\n runId: string;\n}\n\n/*\n * Top-level .reportDetail state component.\n * Loads result details on changes to /report/:configId/:runId path parameter, renders load states.\n */\nclass ResultDetailLoader extends React.Component<IResultLoaderDispatchProps & IResultLoaderStateParamsProps> {\n private subscription: Subscription;\n\n constructor(props: IResultLoaderDispatchProps & IResultLoaderStateParamsProps) {\n super(props);\n const { resultIdStream, loadResult } = props;\n this.subscription = resultIdStream.subscribe(loadResult);\n }\n\n public componentWillUnmount(): void {\n this.subscription.unsubscribe();\n }\n\n public render() {\n return <ReportDetailLoadStates />;\n }\n}\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>): IResultLoaderDispatchProps => ({\n loadResult: (stateParams: IResultLoaderStateParams) =>\n dispatch(\n Creators.loadRunRequest({\n configId: stateParams.configId,\n runId: stateParams.runId,\n }),\n ),\n});\n\nexport default connect(null, mapDispatchToProps)(ResultDetailLoader);\n","import { Field, Form, Formik, FormikActions, FormikErrors, FormikProps, FormikTouched } from 'formik';\nimport { get } from 'lodash';\nimport * as React from 'react';\nimport { Modal } from 'react-bootstrap';\n\nimport {\n Application,\n HelpField,\n HoverablePopover,\n IModalComponentProps,\n MapEditor,\n ModalClose,\n noop,\n ReactModal,\n SubmitButton,\n TetheredSelect,\n} from '@spinnaker/core';\n\nimport { CanaryScores } from '../components/canaryScores';\nimport { ICanaryConfigSummary, ICanaryExecutionRequest, IKayentaAccount, KayentaAccountType } from '../domain';\nimport { startCanaryRun } from '../service/canaryRun.service';\n\nconst RESOURCE_TYPES = {\n prometheus: [\n { label: '', value: '' },\n { label: 'gce_instance', value: 'gce_instance' },\n { label: 'aws_ec2_instance', value: 'aws_ec2_instance' },\n ],\n stackdriver: [\n { label: 'gce_instance', value: 'gce_instance' },\n { label: 'aws_ec2_instance', value: 'aws_ec2_instance' },\n { label: 'gae_app', value: 'gae_app' },\n { label: 'k8s_container', value: 'k8s_container' },\n { label: 'k8s_pod', value: 'k8s_pod' },\n { label: 'k8s_node', value: 'k8s_node' },\n { label: 'gke_container', value: 'gke_container' },\n { label: 'https_lb_rule', value: 'https_lb_rule' },\n { label: 'global', value: 'global' },\n ],\n};\n\nexport interface IManualAnalysisModalProps extends IModalComponentProps {\n title: string;\n application: Application;\n accounts: IKayentaAccount[];\n initialValues?: IManualAnalysisModalFormProps;\n}\n\nexport interface IManualAnalysisModalState {\n showAllControlLocations: boolean;\n showAllExperimentLocations: boolean;\n}\n\nexport interface IManualAnalysisModalFormProps {\n configId: string;\n startTime: string;\n endTime: string;\n step: string;\n baselineScope: string;\n canaryScope: string;\n baselineLocation: string;\n canaryLocation: string;\n extendedScopeParams: { [key: string]: string };\n resourceType: string;\n marginalThreshold: string;\n passThreshold: string;\n metricsAccountName: string;\n storageAccountName: string;\n}\n\nconst transformFormPropsToExecutionRequest = (\n values: IManualAnalysisModalFormProps,\n accounts: IKayentaAccount[],\n): ICanaryExecutionRequest => {\n const step = parseInt(values.step, 10);\n const pass = parseInt(values.passThreshold, 10);\n const marginal = parseInt(values.marginalThreshold, 10);\n\n const metricsAccount = accounts.find(({ name }) => values.metricsAccountName === name);\n\n const accountSpecificParams: { [param: string]: string } = {};\n\n if (values.resourceType) {\n accountSpecificParams.resourceType = values.resourceType;\n }\n\n if (metricsAccount.type === 'atlas' && !values.extendedScopeParams?.type) {\n accountSpecificParams.type = 'cluster';\n }\n\n const extendedScopeParams = { ...values.extendedScopeParams, ...accountSpecificParams };\n\n return {\n scopes: {\n default: {\n controlScope: {\n scope: values.baselineScope,\n start: values.startTime,\n end: values.endTime,\n location: values.baselineLocation,\n step,\n extendedScopeParams,\n },\n experimentScope: {\n scope: values.canaryScope,\n start: values.startTime,\n end: values.endTime,\n location: values.canaryLocation,\n step,\n extendedScopeParams,\n },\n },\n },\n thresholds: {\n pass,\n marginal,\n },\n };\n};\n\nconst defaultValues: IManualAnalysisModalFormProps = {\n configId: null,\n startTime: '',\n endTime: '',\n step: '',\n baselineScope: '',\n canaryScope: '',\n baselineLocation: '',\n canaryLocation: '',\n extendedScopeParams: {},\n resourceType: '',\n marginalThreshold: '',\n passThreshold: '',\n metricsAccountName: '',\n storageAccountName: '',\n};\n\nexport class ManualAnalysisModal extends React.Component<IManualAnalysisModalProps, IManualAnalysisModalState> {\n public static defaultProps: Partial<IManualAnalysisModalProps> = {\n closeModal: noop,\n dismissModal: noop,\n initialValues: defaultValues,\n };\n\n public static show(props: IManualAnalysisModalProps): Promise<any> {\n const modalProps = { dialogClassName: 'modal-lg' };\n return ReactModal.show(ManualAnalysisModal, props, modalProps);\n }\n\n constructor(props: IManualAnalysisModalProps) {\n super(props);\n const { initialValues, accounts } = props;\n const selectedMetricsStore = accounts.find(({ name }) => initialValues.metricsAccountName === name);\n const recommendedLocations = selectedMetricsStore?.recommendedLocations ?? [];\n this.state = {\n showAllControlLocations: !recommendedLocations.includes(initialValues.baselineLocation),\n showAllExperimentLocations: !recommendedLocations.includes(initialValues.canaryLocation),\n };\n }\n\n private validate = (values: IManualAnalysisModalFormProps) => {\n const errors = {} as FormikErrors<IManualAnalysisModalFormProps>;\n let startTime, endTime;\n\n if (!values.configId) {\n errors.configId = 'You must choose a canary config';\n }\n\n if (!values.startTime) {\n errors.startTime = 'You must provide a start time';\n } else {\n try {\n startTime = new Date(values.startTime).getTime();\n } catch (e) {\n errors.startTime = 'Invalid start time. Time must be in ISO-8601 format, e.g. 2018-07-12T22:28:29Z';\n }\n }\n\n if (!values.endTime) {\n errors.endTime = 'You must provide an end time';\n } else {\n try {\n endTime = new Date(values.endTime).getTime();\n } catch (e) {\n errors.endTime = 'Invalid start time. Time must be in ISO-8601 format, e.g. 2018-07-12T22:28:29Z';\n }\n }\n\n if (startTime && endTime && endTime <= startTime) {\n errors.endTime = 'End time must be after start time';\n }\n\n if (!values.step) {\n errors.step = 'You must provide a step value';\n } else if (parseInt(values.step, 10) < 1) {\n errors.step = 'Invalid step value';\n }\n\n if (!values.baselineScope) {\n errors.baselineScope = 'You must provide a baseline scope';\n }\n\n if (!values.canaryScope) {\n errors.canaryScope = 'You must provide a canary scope';\n }\n\n if (!values.baselineLocation) {\n errors.baselineLocation = 'You must provide a baseline location';\n }\n\n if (!values.canaryLocation) {\n errors.canaryLocation = 'You must provide a canary location';\n }\n\n const marginalThreshold = parseInt(values.marginalThreshold, 10);\n const passThreshold = parseInt(values.passThreshold, 10);\n\n if (!values.marginalThreshold) {\n errors.marginalThreshold = 'You must provide a marginal score threshold';\n } else if (marginalThreshold > passThreshold) {\n errors.marginalThreshold = 'Marginal threshold must be greater than passing threshold';\n } else if (marginalThreshold < 1) {\n errors.marginalThreshold = 'Marginal threshold must be positive';\n }\n\n if (!values.passThreshold) {\n errors.passThreshold = 'You must provide a passing score threshold';\n } else if (passThreshold > 100) {\n errors.passThreshold = 'Passing threshold cannot be greater than 100';\n }\n\n if (!values.metricsAccountName) {\n errors.metricsAccountName = 'You must choose a metrics account';\n }\n\n if (!values.storageAccountName) {\n errors.storageAccountName = 'You must choose a storage account';\n }\n\n return errors;\n };\n\n private submit = (values: IManualAnalysisModalFormProps, actions: FormikActions<IManualAnalysisModalFormProps>) => {\n const { configId, metricsAccountName, storageAccountName } = values;\n const { application, accounts } = this.props;\n const executionRequest = transformFormPropsToExecutionRequest(values, accounts);\n\n startCanaryRun(configId, executionRequest, {\n application: application.name,\n metricsAccountName,\n storageAccountName,\n })\n .then(() => {\n actions.setSubmitting(false);\n actions.setStatus({ succeeded: true });\n })\n .catch((error) => {\n actions.setSubmitting(false);\n actions.setStatus({ succeeded: false, error });\n });\n };\n\n public render() {\n const { dismissModal, title, application, accounts, initialValues } = this.props;\n const { showAllControlLocations, showAllExperimentLocations } = this.state;\n\n const canaryConfigs: ICanaryConfigSummary[] = application\n .getDataSource('canaryConfigs')\n .data.slice()\n .sort((a: ICanaryConfigSummary, b: ICanaryConfigSummary) => a.name.localeCompare(b.name));\n const metricsStores = accounts.filter(({ supportedTypes }) =>\n supportedTypes.includes(KayentaAccountType.MetricsStore),\n );\n const objectStores = accounts.filter(({ supportedTypes }) =>\n supportedTypes.includes(KayentaAccountType.ObjectStore),\n );\n // TODO: support a scope name besides 'default'.\n const showAdvancedSettings = metricsStores.length > 1 || objectStores.length > 1;\n\n return (\n <Formik\n initialValues={{\n ...initialValues,\n metricsAccountName: get(metricsStores[0], 'name', ''),\n storageAccountName: get(objectStores[0], 'name', ''),\n }}\n onSubmit={this.submit}\n validate={this.validate}\n isInitialValid={!!initialValues.configId} // if we have a config id initially, everything else should be valid\n render={({\n values,\n touched,\n isValid,\n isSubmitting,\n status,\n setFieldValue,\n setFieldTouched,\n errors,\n }: FormikProps<IManualAnalysisModalFormProps>) => {\n if (get(status, 'succeeded') === true) {\n return (\n <>\n <ModalClose dismiss={dismissModal} />\n <Modal.Header>{<h3>Analysis Started</h3>}</Modal.Header>\n <Modal.Body>\n <p>Analysis started — check the list of reports in a few minutes to view results</p>\n </Modal.Body>\n <Modal.Footer className=\"horizontal right\">\n <button className=\"btn btn-primary\" onClick={dismissModal} type=\"button\">\n Got it\n </button>\n </Modal.Footer>\n </>\n );\n }\n\n const selectedMetricsStore = metricsStores.find(({ name }) => values.metricsAccountName === name);\n const selectedObjectStore = objectStores.find(({ name }) => values.storageAccountName === name);\n\n const recommendedLocations = get(selectedMetricsStore, 'recommendedLocations', []);\n const { canaryLocation, baselineLocation } = initialValues;\n const locations = get(selectedMetricsStore, 'locations', []);\n // Almost every report generated for Atlas uses a simple region for its location. On the backend, Kayenta\n // performs amazing feats to reconcile the location with an Atlas backend, considering the values of several\n // extended params. We are not going to reverse engineer that logic here in order to pick a predefined value\n // from the dropdown: if a location was valid to generate the report, it'll probably be valid when we\n // regenerate it.\n if (canaryLocation && !locations.includes(canaryLocation)) {\n locations.push(canaryLocation);\n }\n if (baselineLocation && !locations.includes(baselineLocation)) {\n locations.push(baselineLocation);\n }\n\n const hasLocationChoices = recommendedLocations.length > 0 || locations.length > 0;\n\n return (\n <Form className=\"form-horizontal\">\n <ModalClose dismiss={dismissModal} />\n <Modal.Header>{title && <h3>{title}</h3>}</Modal.Header>\n <Modal.Body>\n <div className=\"row\">\n <div className=\"col-md-12\">\n <div className=\"container-fluid form-horizontal\">\n <h5>Analysis Configuration</h5>\n <div className=\"horizontal-rule\" />\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">Config Name</div>\n <div className=\"col-md-7\">\n <TetheredSelect\n value={values.configId}\n options={canaryConfigs.map(({ id, name }) => ({ label: name, value: id }))}\n onChange={(item: { label: string; value: string }) =>\n setFieldValue('configId', (item && item.value) || null)\n }\n />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Start Time <HelpField id=\"pipeline.config.canary.startTimeIso\" />\n </div>\n <div className=\"col-md-7\">\n <ValidatedField errors={errors} touched={touched} name=\"startTime\" />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n End Time <HelpField id=\"pipeline.config.canary.endTimeIso\" />\n </div>\n <div className=\"col-md-7\">\n <ValidatedField errors={errors} touched={touched} name=\"endTime\" />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">Step</div>\n <div className=\"col-md-7\">\n <ValidatedField\n errors={errors}\n touched={touched}\n type=\"number\"\n style={{ width: '60px', display: 'inline-block' }}\n name=\"step\"\n />\n <span className=\"form-control-static\"> seconds</span>\n </div>\n </div>\n <h5>Baseline + Canary Pair</h5>\n <div className=\"horizontal-rule\" />\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Baseline <HelpField id=\"pipeline.config.canary.baselineGroup\" />\n </div>\n <div className=\"col-md-7\">\n <ValidatedField name=\"baselineScope\" errors={errors} touched={touched} />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Baseline Location <HelpField id=\"pipeline.config.canary.baselineLocation\" />\n </div>\n <div className=\"col-md-7\">\n <LocationField\n hasLocationChoices={hasLocationChoices}\n showAll={showAllControlLocations}\n recommendedLocations={recommendedLocations}\n locations={locations}\n value={values.baselineLocation}\n field=\"baselineLocation\"\n errors={errors}\n touched={touched}\n onChange={(location) => {\n setFieldTouched('baselineLocation', true);\n setFieldValue('baselineLocation', location);\n }}\n onShowAllChange={(showAll) => this.setState({ showAllControlLocations: showAll })}\n />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Canary <HelpField id=\"pipeline.config.canary.canaryGroup\" />\n </div>\n <div className=\"col-md-7\">\n <ValidatedField errors={errors} touched={touched} name=\"canaryScope\" />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Canary Location <HelpField id=\"pipeline.config.canary.canaryLocation\" />\n </div>\n <div className=\"col-md-7\">\n <LocationField\n hasLocationChoices={hasLocationChoices}\n showAll={showAllExperimentLocations}\n recommendedLocations={recommendedLocations}\n locations={locations}\n value={values.canaryLocation}\n field=\"canaryLocation\"\n errors={errors}\n touched={touched}\n onChange={(location) => {\n setFieldTouched('canaryLocation', true);\n setFieldValue('canaryLocation', location);\n }}\n onShowAllChange={(showAll) => this.setState({ showAllExperimentLocations: showAll })}\n />\n </div>\n </div>\n <h5>Metric Scope</h5>\n <div className=\"horizontal-rule\" />\n {RESOURCE_TYPES.hasOwnProperty(get(selectedMetricsStore, 'type')) && (\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">Resource Type</div>\n <div className=\"col-md-7\">\n <TetheredSelect\n value={values.resourceType}\n options={RESOURCE_TYPES[selectedMetricsStore.type as keyof typeof RESOURCE_TYPES]}\n onChange={(item: { label: string; value: string }) =>\n setFieldValue('resourceType', (item && item.value) || '')\n }\n />\n <ErrorMessage field=\"resourceType\" errors={errors} touched={touched} />\n </div>\n </div>\n )}\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Extended Params <HelpField id=\"pipeline.config.canary.extendedScopeParams\" />\n </div>\n <div className=\"col-md-7\">\n <MapEditor\n model={values.extendedScopeParams}\n onChange={(model) => setFieldValue('extendedScopeParams', model)}\n hiddenKeys={['resourceType']}\n />\n </div>\n </div>\n <h5>Scoring Thresholds</h5>\n <div className=\"horizontal-rule\" />\n <CanaryScores\n onChange={({ unhealthyScore, successfulScore }) => {\n setFieldValue('marginalThreshold', unhealthyScore);\n setFieldValue('passThreshold', successfulScore);\n }}\n successfulHelpFieldId=\"pipeline.config.canary.passingScore\"\n successfulLabel=\"Pass \"\n successfulScore={values.passThreshold}\n unhealthyHelpFieldId=\"pipeline.config.canary.marginalScore\"\n unhealthyLabel=\"Marginal \"\n unhealthyScore={values.marginalThreshold}\n />\n {showAdvancedSettings && (\n <AdvancedSettings\n metricsStores={metricsStores}\n selectedMetricsStore={selectedMetricsStore}\n objectStores={objectStores}\n selectedObjectStore={selectedObjectStore}\n onChange={setFieldValue}\n errors={errors}\n touched={touched}\n />\n )}\n </div>\n </div>\n </div>\n {get(status, 'error') && (\n <div className=\"row\">\n <div className=\"col-md-7 col-md-offset-3\">\n <div className=\"well-compact alert alert-danger\">\n <b>There was a problem starting your analysis:</b>\n <span>{JSON.stringify(status.error.data)}</span>\n </div>\n </div>\n </div>\n )}\n </Modal.Body>\n <Modal.Footer className=\"horizontal right\">\n <button className=\"btn btn-default\" onClick={dismissModal} type=\"button\">\n Cancel\n </button>\n <SubmitFormButton isValid={isValid} isSubmitting={isSubmitting} errors={errors} />\n </Modal.Footer>\n </Form>\n );\n }}\n />\n );\n }\n}\n\nconst SubmitFormButton = ({\n errors,\n isValid,\n isSubmitting,\n}: {\n errors: FormikErrors<any>;\n isValid: boolean;\n isSubmitting: boolean;\n}) => {\n const button = (\n <SubmitButton isDisabled={!isValid} submitting={isSubmitting} isFormSubmit={true} label=\"Start analysis\" />\n );\n const errorMessages = Object.values(errors).map((error: string, i) => <li key={i}>{error}</li>);\n if (isValid || !errorMessages.length) {\n return button;\n }\n\n const popoverComponent = () => (\n <div>\n The following errors must be corrected before submitting:<ul>{errorMessages}</ul>\n </div>\n );\n return (\n <div className=\"sp-margin-s-left\">\n <HoverablePopover Component={popoverComponent}>{button}</HoverablePopover>\n </div>\n );\n};\n\nconst combineLocations = (includeAll: boolean, recommendedLocations: string[], locations: string[]) => {\n if (includeAll) {\n return [...new Set(recommendedLocations.concat(locations))];\n }\n\n return recommendedLocations.length > 0 ? recommendedLocations : locations;\n};\n\ninterface ILocationFieldProps {\n hasLocationChoices: boolean;\n showAll: boolean;\n recommendedLocations: string[];\n locations: string[];\n value: string;\n onChange: (location: string) => any;\n onShowAllChange: (showAll: boolean) => any;\n errors: FormikErrors<IManualAnalysisModalFormProps>;\n touched: FormikTouched<IManualAnalysisModalFormProps>;\n field: keyof IManualAnalysisModalFormProps;\n}\n\nconst LocationField = ({\n hasLocationChoices,\n showAll,\n recommendedLocations,\n locations,\n value,\n onChange,\n onShowAllChange,\n errors,\n touched,\n field,\n}: ILocationFieldProps) => {\n if (!hasLocationChoices) {\n return <ValidatedField name={field} errors={errors} touched={touched} />;\n }\n const combinedLocations = combineLocations(showAll, recommendedLocations, locations).sort();\n const options = combinedLocations.map((location) => ({ label: location, value: location }));\n\n return (\n <>\n <TetheredSelect\n clearable={false}\n value={value}\n options={options}\n onChange={(item: { label: string; value: string }) => onChange((item && item.value) || '')}\n />\n <ErrorMessage field={field} errors={errors} touched={touched} />\n {recommendedLocations.length > 0 && locations.length > 0 && (\n <div className=\"pull-right\">\n <button\n type=\"button\"\n className=\"link\"\n onClick={() => {\n onShowAllChange(!showAll);\n if (!combineLocations(!showAll, recommendedLocations, locations).includes(value)) {\n onChange('');\n }\n }}\n >\n {showAll ? 'Only show recommended locations' : 'Show all locations'}\n </button>\n </div>\n )}\n </>\n );\n};\n\ninterface IAdvancedSettingsProps {\n metricsStores: IKayentaAccount[];\n objectStores: IKayentaAccount[];\n selectedMetricsStore: IKayentaAccount;\n selectedObjectStore: IKayentaAccount;\n onChange: (field: 'metricsAccountName' | 'storageAccountName', value: string) => any;\n errors: FormikErrors<IManualAnalysisModalFormProps>;\n touched: FormikTouched<IManualAnalysisModalFormProps>;\n}\n\nconst AdvancedSettings = ({\n metricsStores,\n selectedMetricsStore,\n objectStores,\n selectedObjectStore,\n onChange,\n errors,\n touched,\n}: IAdvancedSettingsProps) => {\n return (\n <>\n <h5>Advanced Settings</h5>\n <div className=\"horizontal-rule\" />\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Metrics Account <HelpField id=\"pipeline.config.metricsAccount\" />\n </div>\n <div className=\"col-md-7\">\n <TetheredSelect\n clearable={false}\n value={get(selectedMetricsStore, 'name')}\n options={metricsStores.map(({ name }) => ({ label: name, value: name }))}\n onChange={(item: { label: string; value: string }) =>\n onChange('metricsAccountName', (item && item.value) || '')\n }\n />\n <ErrorMessage field=\"metricsAccountName\" errors={errors} touched={touched} />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Storage Account <HelpField id=\"pipeline.config.storageAccount\" />\n </div>\n <div className=\"col-md-7\">\n <TetheredSelect\n clearable={false}\n value={get(selectedObjectStore, 'name')}\n options={objectStores.map(({ name }) => ({ label: name, value: name }))}\n onChange={(item: { label: string; value: string }) =>\n onChange('storageAccountName', (item && item.value) || '')\n }\n />\n <ErrorMessage field=\"storageAccountName\" errors={errors} touched={touched} />\n </div>\n </div>\n </>\n );\n};\n\ninterface IErrorMessageProps {\n field: keyof IManualAnalysisModalFormProps;\n errors: FormikErrors<IManualAnalysisModalFormProps>;\n touched: FormikTouched<IManualAnalysisModalFormProps>;\n}\n\nconst ErrorMessage = ({ field, errors, touched }: IErrorMessageProps) => {\n if (!touched[field] || !errors[field]) {\n return null;\n }\n return <div className=\"error-message\">{errors[field]}</div>;\n};\n\nexport interface IValidatedFieldProps {\n errors: FormikErrors<IManualAnalysisModalFormProps>;\n touched: FormikTouched<IManualAnalysisModalFormProps>;\n name: keyof IManualAnalysisModalFormProps;\n [field: string]: any;\n}\n\nconst ValidatedField = (props: IValidatedFieldProps) => {\n const { errors, name, touched } = props;\n return (\n <>\n <Field {...props} className=\"form-control input-sm\" required={touched[name]} error={errors[name]} />\n <ErrorMessage field={name} errors={errors} touched={touched} />\n </>\n );\n};\n","import { useSref } from '@uirouter/react';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { resolveConfigIdFromExecutionId } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\ninterface IConfigLinkOwnProps {\n configName: string;\n executionId: string;\n application: string;\n}\n\ninterface IConfigLinkStateProps {\n configId: string;\n}\n\nexport const ConfigLink = ({ configId, configName }: IConfigLinkOwnProps & IConfigLinkStateProps) => {\n const sref = useSref('^.^.canaryConfig.configDetail', { id: configId });\n return <a {...sref}>{configName}</a>;\n};\n\nconst mapStateToProps = (\n state: ICanaryState,\n ownProps: IConfigLinkOwnProps,\n): IConfigLinkStateProps & IConfigLinkOwnProps => {\n return {\n configId: resolveConfigIdFromExecutionId(state, ownProps.executionId),\n ...ownProps,\n };\n};\n\nexport default connect(mapStateToProps)(ConfigLink);\n","import { useSref } from '@uirouter/react';\nimport * as React from 'react';\n\ninterface IParentPipelineLinkProps {\n parentPipelineExecutionId: string;\n application: string;\n}\n\nexport const PipelineLink = ({ parentPipelineExecutionId, application }: IParentPipelineLinkProps) => {\n const sref = useSref('home.applications.application.pipelines.executionDetails.execution', {\n application,\n executionId: parentPipelineExecutionId,\n });\n return <a {...sref}>Pipeline</a>;\n};\n","import { useSref } from '@uirouter/react';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { resolveConfigIdFromExecutionId } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\ninterface IReportLinkOwnProps {\n configName: string;\n executionId: string;\n application: string;\n children?: React.ReactNode;\n}\n\ninterface IReportLinkStateProps {\n configId: string;\n}\n\nexport const ReportLink = ({ configId, executionId, children }: IReportLinkOwnProps & IReportLinkStateProps) => {\n const sref = useSref('^.reportDetail', { configId, runId: executionId });\n return <a {...sref}>{children}</a>;\n};\n\nconst mapStateToProps = (\n state: ICanaryState,\n ownProps: IReportLinkOwnProps,\n): IReportLinkStateProps & IReportLinkOwnProps => {\n return {\n configId: resolveConfigIdFromExecutionId(state, ownProps.executionId),\n ...ownProps,\n };\n};\n\nexport default connect(mapStateToProps)(ReportLink);\n","import { CanarySettings } from 'kayenta/canary.settings';\nimport {\n CANARY_EXECUTION_NO_PIPELINE_STATUS,\n ICanaryExecutionStatusResult,\n ICanaryMetricConfig,\n ICanaryScopesByName,\n IKayentaAccount,\n} from 'kayenta/domain';\nimport CenteredDetail from 'kayenta/layout/centeredDetail';\nimport FormattedDate from 'kayenta/layout/formattedDate';\nimport { ITableColumn, NativeTable } from 'kayenta/layout/table';\nimport { ManualAnalysisModal } from 'kayenta/manualAnalysis/ManualAnalysisModal';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { get, isEqual } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { Application, ReactInjector, relativeTime, Spinner, Tooltip } from '@spinnaker/core';\n\nimport ConfigLink from './configLink';\nimport Score from '../detail/score';\nimport { PipelineLink } from './pipelineLink';\nimport ReportLink from './reportLink';\n\nimport './executionList.less';\n\n// Both this and the atlas-specific logic in `getScopeLocations` shouldn't really\n// be in this file, and probably shouldn't even be referenced directly.\n// Ideally this and any other metric store customizations should happen in a registry\n// of store-specific transformation functions or similar.\nconst isAtlasScope = (scope: string, metrics: ICanaryMetricConfig[]) =>\n metrics.some(({ query, scopeName }) => scopeName === scope && query.type === 'atlas');\n\nconst getScopeLocations = (scopes: ICanaryScopesByName, metrics: ICanaryMetricConfig[]) =>\n Object.keys(scopes).reduce((acc, scopeName) => {\n const { controlScope, experimentScope } = scopes[scopeName];\n const isAtlas = isAtlasScope(scopeName, metrics);\n\n // When atlas metrics have the dataset param set to global,\n // the location field is not accurate.\n if (isAtlas && get(controlScope, 'extendedScopeParams.dataset') === 'global') {\n acc.add('Global');\n } else {\n acc.add(controlScope.location);\n }\n if (isAtlas && get(experimentScope, 'extendedScopeParams.dataset') === 'global') {\n acc.add('Global');\n } else {\n acc.add(experimentScope.location);\n }\n\n return acc;\n }, new Set<string>());\n\nconst baseColumns: Array<ITableColumn<ICanaryExecutionStatusResult>> = [\n {\n label: 'Summary',\n getContent: (execution) => (\n <div>\n <ReportLink\n configName={execution.config.name}\n executionId={execution.pipelineId}\n application={execution.application}\n >\n <Score score={execution.result.judgeResult.score} showClassification={false} inverse={true} />\n {' '}\n <FormattedDate dateIso={execution.startTimeIso} />\n </ReportLink>\n {execution.startTimeIso && (\n <div className=\"color-text-caption body-small\">\n {relativeTime(new Date(execution.startTimeIso).getTime())}\n </div>\n )}\n </div>\n ),\n },\n {\n label: 'Locations',\n getContent: ({ canaryExecutionRequest: { scopes }, config: { metrics } }) => {\n const locations = [...getScopeLocations(scopes, metrics)];\n\n return (\n <div className=\"vertical\">\n {locations.map((location) => (\n <span key={location}>{location}</span>\n ))}\n </div>\n );\n },\n },\n {\n label: 'Config',\n getContent: (execution) => (\n <ConfigLink\n configName={execution.config.name}\n executionId={execution.pipelineId}\n application={execution.application}\n />\n ),\n },\n {\n label: 'Scopes',\n getContent: ({ canaryExecutionRequest: { scopes } }) => {\n const baselineScopeNames = Object.keys(scopes).reduce(\n (acc, scope) => acc.add(scopes[scope].controlScope.scope),\n new Set<string>(),\n );\n const canaryScopeNames = Object.keys(scopes).reduce(\n (acc, scope) => acc.add(scopes[scope].experimentScope.scope),\n new Set<string>(),\n );\n\n const areScopesIdentical = isEqual(baselineScopeNames, canaryScopeNames);\n\n const styles: React.CSSProperties = { maxWidth: '350px', wordBreak: 'break-all' };\n if (areScopesIdentical) {\n return (\n <div className=\"vertical\" style={styles}>\n {[...canaryScopeNames].map((scope) => (\n <span key={scope}>{scope}</span>\n ))}\n </div>\n );\n } else {\n return (\n <div className=\"vertical\" style={styles}>\n <span className=\"heading-6 uppercase color-text-caption\">Baseline</span>\n {[...baselineScopeNames].map((scope) => (\n <span key={scope}>{scope}</span>\n ))}\n <span className=\"heading-6 uppercase color-text-caption\" style={{ marginTop: '5px' }}>\n Canary\n </span>\n {[...canaryScopeNames].map((scope) => (\n <span key={scope}>{scope}</span>\n ))}\n </div>\n );\n }\n },\n },\n {\n getContent: ({ parentPipelineExecutionId, application }) =>\n parentPipelineExecutionId &&\n parentPipelineExecutionId !== CANARY_EXECUTION_NO_PIPELINE_STATUS && (\n <PipelineLink parentPipelineExecutionId={parentPipelineExecutionId} application={application} />\n ),\n },\n];\n\nconst getTableColumns = (application: Application, accounts: IKayentaAccount[]) => {\n if (!CanarySettings.manualAnalysisEnabled) {\n return baseColumns;\n }\n return baseColumns.concat([\n {\n label: 'Actions',\n getContent: (execution) => (\n <Tooltip value=\"Re-run analysis\">\n <button className=\"link\" onClick={() => rerunAnalysis(execution, application, accounts)}>\n <i className=\"fas fa-redo-alt\" />\n </button>\n </Tooltip>\n ),\n },\n ]);\n};\n\nconst rerunAnalysis = (\n execution: ICanaryExecutionStatusResult,\n application: Application,\n accounts: IKayentaAccount[],\n) => {\n const { controlScope, experimentScope } = Object.values(execution.canaryExecutionRequest.scopes)[0];\n const step = `${controlScope.step ?? 60}`;\n ManualAnalysisModal.show({\n title: 'Start Manual Analysis',\n application,\n accounts,\n initialValues: {\n configId: execution.canaryConfigId,\n startTime: controlScope.start,\n endTime: controlScope.end,\n step,\n baselineScope: controlScope.scope,\n canaryScope: experimentScope.scope,\n baselineLocation: controlScope.location,\n canaryLocation: experimentScope.location,\n extendedScopeParams: controlScope.extendedScopeParams,\n resourceType: controlScope.resourceType,\n marginalThreshold: `${execution.canaryExecutionRequest.thresholds.marginal}`,\n passThreshold: `${execution.canaryExecutionRequest.thresholds.pass}`,\n metricsAccountName: execution.metricsAccountName,\n storageAccountName: execution.storageAccountName,\n },\n });\n};\n\nconst startManualAnalysis = (application: Application, accounts: IKayentaAccount[]) => {\n ManualAnalysisModal.show({\n title: 'Start Manual Analysis',\n application,\n accounts,\n });\n};\n\ninterface IExecutionListTableStateProps {\n executions: ICanaryExecutionStatusResult[];\n application: Application;\n accounts: IKayentaAccount[];\n executionsCount: number;\n}\n\nconst TableRows = ({\n executions,\n application,\n accounts,\n}: {\n executions: ICanaryExecutionStatusResult[];\n application: Application;\n accounts: IKayentaAccount[];\n}) => {\n if (!application.getDataSource('canaryExecutions').loaded) {\n return (\n <CenteredDetail>\n <div className=\"horizontal center middle spinner-container\">\n <Spinner />\n </div>\n </CenteredDetail>\n );\n }\n if (!executions || !executions.length) {\n return (\n <CenteredDetail>\n <h3 className=\"heading-3\">No canary execution history for this application.</h3>\n </CenteredDetail>\n );\n }\n return (\n <NativeTable\n rows={executions}\n className=\"flex-1 execution-list-table\"\n columns={getTableColumns(application, accounts)}\n rowKey={(execution) => execution.pipelineId}\n />\n );\n};\n\nconst updateExecutionsCount = (event: React.ChangeEvent<HTMLSelectElement>) => {\n ReactInjector.$state.go('.', { count: Number(event.target.value) });\n};\n\nconst ExecutionListTable = ({ executions, application, accounts, executionsCount }: IExecutionListTableStateProps) => {\n React.useEffect(() => {\n const dataSource = application.getDataSource('canaryExecutions');\n if (!dataSource.active) {\n dataSource.activate();\n }\n dataSource.refresh();\n return () => dataSource.deactivate();\n }, [application, executionsCount]);\n\n const countOptions: number[] = CanarySettings.executionsCountOptions ?? [20, 50, 100, 200];\n if (!countOptions.includes(executionsCount)) {\n countOptions.push(executionsCount);\n countOptions.sort((a, b) => a - b);\n }\n\n return (\n <div className=\"vertical execution-list-container\">\n <div className=\"horizontal space-between form-inline\">\n <div className=\"form-group\">\n {countOptions.length > 1 && (\n <>\n <span className=\"sp-margin-s-right\">Showing</span>\n <select className=\"form-control input-sm\" onChange={updateExecutionsCount}>\n {countOptions.map((o) => (\n <option selected={executionsCount === o} value={o}>\n {o}\n </option>\n ))}\n </select>\n <span className=\"sp-margin-s-left\">most recent reports</span>\n </>\n )}\n </div>\n {CanarySettings.manualAnalysisEnabled && (\n <button\n style={{ alignSelf: 'flex-end', flexShrink: 0 }}\n className=\"primary\"\n onClick={() => startManualAnalysis(application, accounts)}\n >\n <i className=\"fa fa-play\" /> Start Manual Analysis\n </button>\n )}\n </div>\n <TableRows executions={executions} application={application} accounts={accounts} />\n </div>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n executions: Object.values(state.data.executions.data).filter((e) => e.result),\n application: state.data.application,\n accounts: state.data.kayentaAccounts.data,\n executionsCount: state.app.executionsCount,\n});\n\nexport default connect(mapStateToProps)(ExecutionListTable);\n","import LoadStatesBuilder from 'kayenta/components/loadStates';\nimport CenteredDetail from 'kayenta/layout/centeredDetail';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { AsyncRequestState } from 'kayenta/reducers/asyncRequest';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ExecutionListTable from './table';\n\ninterface IExecutionListLoadStatesStateProps {\n loadState: AsyncRequestState;\n}\n\nconst ExecutionListLoadStates = ({ loadState }: IExecutionListLoadStatesStateProps) => {\n const LoadStates = new LoadStatesBuilder()\n .onFulfilled(<ExecutionListTable />)\n .onFailed(\n <CenteredDetail>\n <h3 className=\"heading-3\">Could not load canary execution history.</h3>\n </CenteredDetail>,\n )\n .build();\n return <LoadStates state={loadState} />;\n};\n\nconst mapStateToProps = (state: ICanaryState) => {\n return {\n loadState: state.data.executions.load,\n };\n};\n\nexport default connect(mapStateToProps)(ExecutionListLoadStates);\n","import { UIView } from '@uirouter/react';\nimport * as React from 'react';\n\nexport default () => {\n const noWrap = { wrap: false };\n return (\n <div className=\"vertical flex-1\">\n <UIView {...noWrap} name=\"detail\" />\n </div>\n );\n};\n","import { UIRouter } from '@uirouter/core';\nimport 'kayenta/metricStore/index';\nimport 'kayenta/report/detail/graph/semiotic';\n\nimport { ApplicationStateProvider } from '@spinnaker/core';\n\n// This import has a side effect of instantiating the canary redux store\nimport { bridgeKayentaDataSourceToReduxStore } from './kayenta/canary.dataSource.bridge';\nimport { registerStates, registerTransitionHooks } from './kayenta/navigation/canary.states';\n\nexport function lazyInitializeKayenta(applicationState: ApplicationStateProvider, uiRouter: UIRouter) {\n const { stateRegistry } = uiRouter;\n\n // deregister the stub states, starting with the deepest children first\n stateRegistry\n .get()\n .filter((state) => state.name.match(/home.(project|applications).application.canary/))\n .sort((a, b) => b.name.length - a.name.length)\n .forEach((stub) => stateRegistry.deregister(stub));\n\n // Now register the full states\n registerStates(uiRouter, applicationState);\n registerTransitionHooks(uiRouter);\n\n // Patch the data source so data flows into the redux store\n bridgeKayentaDataSourceToReduxStore();\n\n return {};\n}\n","import { Transition, UIRouter } from '@uirouter/core';\nimport * as Creators from 'kayenta/actions/creators';\nimport Canary, { canaryStore } from 'kayenta/canary';\nimport ConfigDetailLoader from 'kayenta/edit/configDetailLoader';\nimport CanaryConfigEdit from 'kayenta/edit/edit';\nimport CanaryConfigSave from 'kayenta/edit/save';\nimport SelectConfig from 'kayenta/edit/selectConfig';\nimport ResultDetailLoader from 'kayenta/report/detail/detailLoader';\nimport ExecutionListLoadStates from 'kayenta/report/list/loadStates';\nimport Report from 'kayenta/report/report';\nimport { $rootScope } from 'ngimport';\n\nimport { ApplicationStateProvider, INestedState } from '@spinnaker/core';\n\nimport '../canary.dataSource.bridge';\nimport { CanarySettings } from '../canary.settings';\n\nexport function registerStates($uiRouter: UIRouter, applicationStateProvider: ApplicationStateProvider) {\n const configDetail: INestedState = {\n name: 'configDetail',\n url: '/:id?copy&new',\n views: {\n detail: {\n component: ConfigDetailLoader,\n $type: 'react',\n },\n footer: {\n component: CanaryConfigSave,\n $type: 'react',\n },\n },\n params: {\n copy: { type: 'boolean', value: false, squash: true },\n new: { type: 'boolean', value: false, squash: true },\n },\n resolve: [\n {\n token: 'configNameStream',\n deps: [UIRouter],\n resolveFn: (uiRouter: any) => uiRouter.globals.params$,\n },\n ],\n };\n\n const configDefault: INestedState = {\n name: 'configDefault',\n url: '',\n views: {\n detail: {\n component: SelectConfig,\n $type: 'react',\n },\n },\n };\n\n const config: INestedState = {\n name: 'canaryConfig',\n url: '/config',\n views: {\n canary: {\n component: CanaryConfigEdit,\n $type: 'react',\n },\n },\n children: [configDefault, configDetail],\n redirectTo: (transition) => transition.to().name + '.configDefault',\n };\n\n const reportDetail: INestedState = {\n name: 'reportDetail',\n url: '/:configId/:runId',\n views: {\n detail: {\n component: ResultDetailLoader,\n $type: 'react',\n },\n },\n resolve: [\n {\n token: 'resultIdStream',\n deps: [UIRouter],\n resolveFn: (uiRouter: any) => uiRouter.globals.params$,\n },\n ],\n };\n\n const reportDefault: INestedState = {\n name: 'reportDefault',\n url: '',\n views: {\n detail: {\n component: ExecutionListLoadStates,\n $type: 'react',\n },\n },\n };\n\n const report: INestedState = {\n name: 'report',\n url: '/report?count',\n views: {\n canary: {\n component: Report,\n $type: 'react',\n },\n },\n params: {\n count: {\n type: 'int',\n value: CanarySettings.defaultExecutionCount ?? CanarySettings.executionsCountOptions?.[0] ?? 20,\n squash: true,\n },\n },\n children: [reportDetail, reportDefault],\n redirectTo: (transition) => transition.to().name + '.reportDefault',\n };\n\n const canaryRoot: INestedState = {\n abstract: true,\n name: 'canary',\n url: '/canary',\n views: {\n insight: {\n component: Canary,\n $type: 'react',\n },\n },\n data: {\n pageTitleSection: {\n title: 'Canary',\n },\n },\n children: [config, report],\n };\n\n applicationStateProvider.addChildState(canaryRoot);\n}\n\nexport function registerTransitionHooks($uiRouter: UIRouter) {\n // When leaving a config detail state, clear that config.\n $uiRouter.transitionService.onBefore(\n {\n from: '**.configDetail.**',\n to: (state) => !state.name.includes('configDetail'),\n },\n () => {\n canaryStore.dispatch(Creators.clearSelectedConfig());\n },\n );\n\n // Prompts confirmation for page navigation if config hasn't been saved.\n // Should be possible with a $uiRouter transition hook, but it's not.\n $rootScope.$on('$stateChangeStart', (event) => {\n const state = canaryStore.getState();\n const warningMessage = 'You have unsaved changes.\\nAre you sure you want to navigate away from this page?';\n if (state.selectedConfig && !state.selectedConfig.isInSyncWithServer) {\n if (!window.confirm(warningMessage)) {\n event.preventDefault();\n }\n }\n });\n\n // Prompts confirmation for page reload if config hasn't been saved.\n $uiRouter.transitionService.onEnter({ to: '**.configDetail.**' }, () => {\n window.onbeforeunload = () => {\n const state = canaryStore.getState();\n // Must return `null` if reload should be allowed.\n return (state.selectedConfig && !state.selectedConfig.isInSyncWithServer) || null;\n };\n });\n\n // Clears reload hook when leaving canary config view.\n $uiRouter.transitionService.onExit({ from: '**.configDetail.**' }, () => {\n window.onbeforeunload = undefined;\n });\n\n $uiRouter.transitionService.onSuccess({ to: '**.report.**' }, (transition: Transition) => {\n if (transition.params('from').count !== transition.params('to').count) {\n canaryStore.dispatch(Creators.setExecutionsCount({ count: transition.params('to').count }));\n }\n });\n}\n","import { Application } from '@spinnaker/core';\n\nimport * as Creators from './actions/creators';\nimport { canaryStore } from './canary';\nimport { stub } from './canary.dataSource.stub';\nimport { ICanaryExecutionStatusResult } from './domain/ICanaryExecutionStatusResult';\nimport { ICanaryConfigSummary, IJudge } from './domain/index';\nimport { listCanaryExecutions } from './service/canaryRun.service';\n\nexport function bridgeKayentaDataSourceToReduxStore() {\n stub.afterConfigsLoaded = (application: Application) => {\n if (application !== canaryStore.getState().data.application) {\n return;\n }\n canaryStore.dispatch(\n Creators.updateConfigSummaries({\n configSummaries: application.getDataSource('canaryConfigs').data as ICanaryConfigSummary[],\n }),\n );\n };\n\n stub.afterJudgesLoaded = (application: Application) => {\n if (application !== canaryStore.getState().data.application) {\n return;\n }\n canaryStore.dispatch(\n Creators.updateJudges({\n judges: application.getDataSource('canaryJudges').data as IJudge[],\n }),\n );\n };\n\n stub.loadCanaryExecutions = (application: Application) => {\n const listExecutionsRequest = listCanaryExecutions(application.name);\n\n listExecutionsRequest.catch((error) => {\n canaryStore.dispatch(Creators.loadExecutionsFailure({ error }));\n });\n\n return listExecutionsRequest;\n };\n\n stub.afterCanaryExecutionsLoaded = (application: Application) => {\n if (application !== canaryStore.getState().data.application) {\n return;\n }\n canaryStore.dispatch(\n Creators.loadExecutionsSuccess({\n executions: application.getDataSource('canaryExecutions').data as ICanaryExecutionStatusResult[],\n }),\n );\n };\n}\n"],"names":["TableHeader","columns","className","React","classNames","map","c","i","key","label","width","hide","labelClassName","Table","rows","rowKey","tableBodyClassName","rowClassName","onRowClick","customRow","headerClassName","TableRow","row","onClick","horizontal","getContent","r","compose","_len","arguments","length","funcs","Array","_key","arg","reduce","a","b","apply","undefined","_extends","Object","assign","target","source","prototype","hasOwnProperty","call","SemioticGraphLazy","lazy","import","supportedGraphTypes","GraphType","TimeSeries","Histogram","BoxPlot","metricSetPairGraphService","register","name","handlesGraphType","type","includes","getGraph","props","Suspense","fallback","Spinner","e","t","super_","create","constructor","value","enumerable","writable","configurable","defineProperty","this","n","o","f","slice","push","u","N","Math","isArray","toString","test","l","s","d","p","g","prefilter","normalize","h","y","v","lhs","m","rhs","filter","w","x","keys","S","forEach","indexOf","isNaN","path","kind","index","item","F","color","join","groupCollapsed","group","log","text","concat","P","groupEnd","timestamp","duration","String","toFixed","logger","actionTransformer","titleFormatter","collapsed","colors","level","diff","started","startedTime","action","prevState","error","took","nextState","k","j","D","E","title","A","O","C","L","T","M","_","stateTransformer","errorTransformer","predicate","logErrors","diffPredicate","getState","dispatch","console","now","Date","getHours","getMinutes","getSeconds","getMilliseconds","performance","Symbol","iterator","from","global","window","DeepDiff","defineProperties","observableDiff","applyDiff","applyChange","revertChange","isConflict","noConflict","transformer","defaults","createLogger","default","exports","__window","__self","self","WorkerGlobalScope","_root","Error","tryCatchTarget","tryCatcher","errorObject_1","errorObject","fn","__extends","__","_super","UnsubscriptionError","errors","err","stack","message","Subscription","unsubscribe","closed","_parent","_parents","_subscriptions","_unsubscribe","hasErrors","_a","len","remove","isFunction_1","isFunction","tryCatch_1","tryCatch","UnsubscriptionError_1","flattenUnsubscriptionErrors","isArray_1","sub","isObject_1","isObject","add","teardown","EMPTY","subscription","_addParent","tmp","subscriptions","subscriptionIndex","splice","parent","empty","errs","next","complete","root_1","root","for","rxSubscriber","Subscriber","destinationOrNext","syncErrorValue","syncErrorThrown","syncErrorThrowable","isStopped","destination","Observer_1","SafeSubscriber","rxSubscriber_1","subscriber","_next","_error","_complete","_unsubscribeAndRecycle","Subscription_1","_parentSubscriber","observerOrNext","context","bind","_context","__tryOrSetError","__tryOrUnsub","_this","wrappedComplete","nextOrObserver","Subscriber_1","getSymbolObservable","$$observable","observable","pipeFromArray","fns","input","prev","noop_1","noop","_i","Observable","subscribe","_isScalar","_subscribe","lift","operator","sink","toSubscriber_1","toSubscriber","_trySubscribe","PromiseCtor","Rx","config","Promise","resolve","reject","observable_1","pipe","operations","pipe_1","toPromise","ObjectUnsubscribedError","SubjectSubscription","subject","observers","subscriberIndex","SubjectSubscriber","Subject","hasError","thrownError","AnonymousSubject","ObjectUnsubscribedError_1","copy","SubjectSubscription_1","asObservable","Observable_1","project","thisArg","TypeError","MapOperator","MapSubscriber","count","result","map_1","OuterSubscriber","notifyNext","outerValue","innerValue","outerIndex","innerIndex","innerSub","notifyError","notifyComplete","then","symbolIteratorPonyfill","Set_1","Set","Map_1","Map","getOwnPropertyNames","InnerSubscriber","outerSubscriber","InnerSubscriber_1","isArrayLike_1","isPromise_1","isPromise","setTimeout","iterator_1","done","obs","msg","resultSelector","SwitchMapOperator","SwitchMapSubscriber","_innerSub","innerSubscription","subscribeToResult_1","subscribeToResult","_tryNotifyNext","OuterSubscriber_1","switchMap_1","switchMap","ScalarObservable","scheduler","state","schedule","EmptyObservable","ArrayObservable","array","of","isScheduler_1","isScheduler","pop","ScalarObservable_1","EmptyObservable_1","ArrayObservable_1","dispatchNext","dispatchError","PromiseObservable","promise","IteratorObservable","getIterator","return","StringIterator","str","idx","charAt","ArrayIterator","arr","isFinite","valueAsNumber","sign","floor","abs","maxSafeInteger","toLength","obj","pow","ArrayLikeObservable","arrayLike","Notification","hasValue","observe","observer","do","accept","toObservable","throw","createNext","undefinedValueNotification","createError","createComplete","completeNotification","delay","ObserveOnOperator","ObserveOnSubscriber","notification","scheduleMessage","ObserveOnMessage","Notification_1","FromObservable","ish","PromiseObservable_1","IteratorObservable_1","ArrayLikeObservable_1","observeOn_1","FilterOperator","FilterSubscriber","filter_1","_createClass","descriptor","Constructor","protoProps","staticProps","ActionsObservable","_Observable","actionsSubject","instance","_classCallCheck","ReferenceError","_possibleConstructorReturn","__proto__","getPrototypeOf","subClass","superClass","setPrototypeOf","_inherits","_of","actions","_from","_ref","EPIC_END","defaultOptions","adapter","action$","output","concurrent","Number","POSITIVE_INFINITY","MergeMapOperator","MergeMapSubscriber","hasCompleted","buffer","active","_tryNext","_notifyResultSelector","shift","mergeMap_1","mergeMap","identity_1","identity","mergeStatic","observables","last","mergeAll_1","mergeAll","merge_1","merge","_toConsumableArray","arr2","from_1","concatAll_1","concatAll","of_1","concat_1","ForkJoinObservable","sources","ForkJoinSubscriber","completed","haveValues","total","values","_hasValue","forkJoin","forkJoin_1","fromPromise","fromPromise_1","selector","CatchOperator","caught","CatchSubscriber","err2","catchError_1","catchError","catch","catch_1","_catch","concatMap_1","concatMap","Action","work","AsyncAction","pending","id","recycleAsyncId","requestAsyncId","setInterval","flush","clearInterval","execute","_execute","errored","errorValue","Action_1","Scheduler","SchedulerAction","AsyncScheduler","scheduled","Scheduler_1","AsyncAction_1","dueTime","async_1","async","DebounceTimeOperator","DebounceTimeSubscriber","debouncedSubscription","lastValue","clearDebounce","debouncedNext","debounceTime_1","debounceTime","MapToOperator","MapToSubscriber","mapTo_1","mapTo","typeMatches","rootEpic","epics","_len2","args","_key2","epic","output$","combineEpics","Actions.LOAD_CONFIG_REQUEST","Actions.SAVE_CONFIG_SUCCESS","getCanaryConfigById","payload","Creators.loadConfigSuccess","Creators.loadConfigFailure","Actions.LOAD_CONFIG_SUCCESS","Creators.selectConfig","store","Actions.SAVE_CONFIG_REQUEST","mapStateToConfig","saveAction","isNew","createCanaryConfig","updateCanaryConfig","canaryConfigId","ReactInjector","$state","go","new","data","application","getDataSource","refresh","Creators.saveConfigSuccess","Creators.saveConfigFailure","Actions.DELETE_CONFIG_REQUEST","deleteCanaryConfig","selectedConfig","Creators.deleteConfigSuccess","Creators.deleteConfigFailure","Actions.DELETE_CONFIG_SUCCESS","Creators.closeDeleteConfigModal","Actions.LOAD_RUN_REQUEST","getCanaryRun","configId","runId","run","Creators.loadRunSuccess","Creators.loadRunFailure","Actions.LOAD_METRIC_SET_PAIR_REQUEST","runSelector","getMetricSetPair","metricSetPairListId","pairId","metricSetPair","Creators.loadMetricSetPairSuccess","Creators.loadMetricSetPairFailure","Actions.UPDATE_GRAPHITE_METRIC_DESCRIPTOR_FILTER","metricsAccountName","kayentaAccounts","account","supportedTypes","KayentaAccountType","MetricsStore","Creators.loadMetricsServiceMetadataRequest","Actions.UPDATE_PROMETHEUS_METRIC_DESCRIPTOR_FILTER","Actions.UPDATE_STACKDRIVER_METRIC_DESCRIPTOR_FILTER","metricsStoreType","Actions.UPDATE_DATADOG_METRIC_DESCRIPTOR_FILTER","Actions.LOAD_METRICS_SERVICE_METADATA_REQUEST","REST","query","get","listMetricsServiceMetadata","Creators.loadMetricsServiceMetadataSuccess","Creators.loadMetricsServiceMetadataFailure","Actions.LOAD_KAYENTA_ACCOUNTS_REQUEST","Actions.INITIALIZE","listKayentaAccounts","accounts","Creators.loadKayentaAccountsSuccess","Creators.loadKayentaAccountsFailure","middleware","options","input$","epic$","epicMiddleware","_store","dependencies","replaceEpic","createEpicMiddleware","Actions.CREATE_NEW_CONFIG","newConfig","buildNewConfig","newAction","Actions.COPY_SELECTED_CONFIG","copiedConfig","buildConfigCopy","syncActivityFinished","actionQueue","flushQueue","nextAction","asyncDispatch","canaryStore","createStore","rootReducer","middlewares","reducer","preloadedState","enhancer","chain","_dispatch","middlewareAPI","applyMiddleware","CanarySettings","reduxLogger","Canary","Component","super","initializeAppState","app","componentWillReceiveProps","nextProps","INITIALIZE","configSummaries","judges","render","Styleguide","Provider","UIView","wrap","LoadStatesBuilder","onRequesting","requesting","onFulfilled","fulfilled","onFailed","failed","build","AsyncRequestState","Requesting","Fulfilled","Failed","FormattedDate","dateIso","getTime","connect","disabled","disableConfigEdit","UISref","to","params","openConfigJsonModal","Creators.openConfigJsonModal","ConfigJsonModal","show","deleteConfigModalOpen","selectedConfigName","deleteConfigState","destroy","deleteConfigErrorMessage","closeDeleteConfigModal","deleteConfig","Creators.deleteConfig","Modal","onHide","Header","Title","Body","buildErrorMessage","Footer","openDeleteConfigModal","Creators.openDeleteConfigModal","DisableableButton","disabledStateKeys","DISABLE_EDIT_CONFIG","DeleteConfigModal","ConfigDetailActionButtons","OpenEditConfigJsonModalButton","CopyConfigButton","OpenDeleteModalButton","EditingDisabledWarning","owners","lastIndex","owner","Fragment","getOwnerAppLinks","ConfigEditingDisabledWarning","editingDisabled","updatedTimestampIso","applications","metricId","editingMetric","direction","analysisConfigurations","canary","effectSizes","effectSize","updateEffectSize","Creators.updateEffectSize","showEffectSizes","setShowEffectSizes","useState","allowEditMeasurementType","measure","description","FormRow","isCles","defaultSize","allowedIncrease","criticalIncrease","allowedDecrease","criticalDecrease","updateMeasure","event","fromPercent","field","percent","size","endsWith","toPercent","normalized","round","clesLabel","HelpField","buildInput","robotToHuman","DisableableInput","min","step","onChange","newEffectSizes","updateSize","expand","content","style","marginTop","RadioChoice","current","FilterTemplateSelector","templateOptions","templates","requestingNew","option","onMouseDown","deleteTemplate","editTemplateBegin","editedTemplateName","editedTemplateValue","editTemplateCancel","editTemplateConfirm","editTemplateName","editTemplateValue","selectTemplate","selectedTemplateName","validation","isEditing","isString","helpId","inputOnly","DisableableReactSelect","getOptions","optionRenderer","warning","DisableableTextarea","templateName","templateValue","some","editingTemplateSelector","selectedTemplateNameSelector","configTemplatesSelector","editingTemplateValidationSelector","stopPropagation","Creators.selectTemplate","Creators.deleteTemplate","Creators.editTemplateBegin","Creators.editTemplateCancel","Creators.editTemplateConfirm","Creators.editTemplateName","Creators.editTemplateValue","Creators.addTemplate","inlineTemplateValueSelector","transformValueForSave","transformInlineTemplateForSave","Creators.editInlineTemplate","isEmpty","metricStoreConfigService","getDelegate","metricConfigurer","MetricConfigurer","metric","groups","list","sort","isTemplateValid","isTemplateValidSelector","useInlineTemplateEditor","useInlineTemplateEditorSelector","disableEdit","validationErrors","editingMetricValidationErrorsSelector","rename","Creators.renameMetric","dataset","changeGroup","Creators.updateMetricGroup","cancel","Creators.editMetricCancel","confirm","Creators.editMetricConfirm","updateDirection","Creators.updateMetricDirection","updateNanStrategy","Creators.updateMetricNanStrategy","strategy","updateCriticality","Creators.updateMetricCriticality","critical","Boolean","checked","nanStrategy","isConfirmDisabled","isNull","metricGroup","templatesEnabled","useTemplates","bsSize","DisableableSelect","checkbox","EditMetricEffectSizes","MetricConfigurerDelegator","InlineTemplateEditor","TitledSection","children","toGroup","changeMetricGroup","select","Creators.changeMetricGroupSelect","clear","Creators.changeMetricGroupConfirm","FailOn","isCritical","tooltipSuffix","classes","Tooltip","selectedGroup","selected","metricList","groupList","metrics","showGroups","changingGroupMetric","find","metricStore","selectedStore","addMetric","Creators.addMetric","serviceType","scopeName","copyMetric","metricCopy","cloneDeep","editMetric","Creators.editMetricBegin","removeMetric","Creators.removeMetric","openChangeMetricGroupModal","Creators.changeMetricGroup","NativeTable","ChangeMetricGroupModal","FormList","Children","role","stores","uniq","valueOf","Creators.selectMetricStore","changeName","Creators.updateConfigName","changeDescription","Creators.updateConfigDescription","MetricStoreSelector","TitledSubsection","helpKey","ownProps","handleInputChange","Creators.updateGroupWeight","weight","parseInt","groupWeight","getGroupWeights","isNumber","max","flatMap","hasGroups","GroupWeight","renderJudgeSelect","judge","renderState","JudgeSelectRenderState","None","JudgeSelect","GroupWeights","ConfigDetail","ConfigDetailHeader","NameAndDescription","GroupTabs","MetricList","EditMetricModal","Scoring","CenteredDetail","configLoadState","load","LoadStates","ConfigDetailLoader","configNameStream","loadConfig","componentWillUnmount","ConfigDetailLoadStates","stateParams","Creators.copySelectedConfig","Creators.createNewConfig","Creators.loadConfigRequest","UUIDGenerator","generateUuid","OwnedBy","owningApplications","currentApplication","placement","ownedBy","selectedConfigId","configs","sortBy","wordBreak","marginBottom","CreateConfigButton","ListDetail","listWidth","detail","detailWidth","listClass","detailClass","CanaryConfigEdit","List","ConfigList","noWrap","Detail","disable","saveConfigState","save","inSyncWithServer","isInSyncWithServer","saveConfig","Creators.saveConfig","SubmitButton","isDisabled","submitting","saveConfigErrorMessage","dismissError","Creators.dismissSaveConfigError","template","HoverablePopover","Save","ValidationErrors","SaveConfigError","SaveConfigButton","SelectConfig","resolveReportUrl","serializedCanaryConfigSelector","canaryRunId","url","SETTINGS","gateUrl","storageAccountName","resolveMetricListUrl","status","reportUrl","metricListUrl","href","Label","extraClass","selectedRun","thresholds","marginal","pass","canaryExecutionRequest","metadataGroups","request","scopes","controlScope","location","controlLocation","scope","experimentScope","start","experimentStart","end","experimentEnd","experimentLocation","entries","popover","mins","buildScopeMetadataEntries","SourceLinks","mapKayentaToACA","score","classification","ScoreClassificationLabel","Pass","health","Fail","showClassification","inverse","CanaryScore","judgeResultSelector","ReportScore","ReportMetadata","GRAPH_IMPLEMENTATIONS","selectedMetric","pair","metricResultsSelector","graphType","delegate","candidate","Graph","selectGraphType","Creators.selectGraphType","paddingLeft","textDecoration","metricConfig","selectedMetricConfigSelector","atlasURL","attributes","tags","atlasGraphBaseUrl","legendTags","tag","backend","encodeURIComponent","control","baseURL","experiment","startTime","startTimeMillis","controlEndTime","stepMillis","experimentEndTime","buildAtlasGraphUrl","atlasQuery","metricStoreConfigStore","queryFinder","CopyToClipboard","displayText","toolTip","getStats","judgeResult","results","experimentMetadata","stats","controlMetadata","ResultMetadataRow","service","tableColumns","startTimeIso","configuredControlStart","actualControlStart","configuredExperimentStart","actualExperimentStart","mean","metadataRows","classificationReason","overflowY","GraphTypeSelector","MetricResultActions","MetricResultStats","MetricResultDetailLayout","MetricSetPairLoadStates","metricFilters","toggle","Creators.toggleMetricClassificationFilter","checkboxes","MetricClassificationLabel","High","Low","Nodata","GREEN","RED","GREY","YELLOW","mapMetricClassificationToColor","mapGroupToColor","scoreThresholds","buildStyle","backgroundColor","ratio","formatDeviationAsPercentage","metricResultsColumns","metricName","BreakString","resultMetadata","MetricResultDeviation","MetricResultClassification","selectedResult","selectedMetricResultIdSelector","Creators.selectReportMetric","buildRowForMetricWithMultipleResults","hasMultipleRows","MultipleResultsTable","unfilteredCounts","has","set","tableRowsByMetricName","buildTableRows","MetricFilters","metricResults","selectedMetricResult","MetricResultsList","MetricResultDetail","exception","errorMessages","details","getReason","arrowColor","borderTopColor","HeaderArrow","groupWeights","serializedGroupWeightsSelector","canaryExecutionRequestSelector","Creators.selectReportMetricGroup","ClickableHeader","groupScores","clearSelectedGroup","isExpanded","toggleHeader","chevronStyle","transform","transition","AllMetricResultsHeader","GroupScores","setIsExpanded","ReportException","ReportHeader","ReportExplanation","ReportScores","MetricResults","loadState","ReportDetail","ResultDetailLoader","resultIdStream","loadResult","ReportDetailLoadStates","Creators.loadRunRequest","RESOURCE_TYPES","prometheus","stackdriver","ManualAnalysisModal","endTime","baselineScope","canaryScope","baselineLocation","canaryLocation","marginalThreshold","passThreshold","executionRequest","metricsAccount","accountSpecificParams","resourceType","extendedScopeParams","transformFormPropsToExecutionRequest","startCanaryRun","setSubmitting","setStatus","succeeded","initialValues","selectedMetricsStore","recommendedLocations","showAllControlLocations","showAllExperimentLocations","static","ReactModal","dialogClassName","dismissModal","canaryConfigs","localeCompare","metricsStores","objectStores","ObjectStore","showAdvancedSettings","Formik","onSubmit","submit","validate","isInitialValid","touched","isValid","isSubmitting","setFieldValue","setFieldTouched","ModalClose","dismiss","selectedObjectStore","locations","hasLocationChoices","Form","TetheredSelect","ValidatedField","display","LocationField","showAll","onShowAllChange","setState","ErrorMessage","MapEditor","model","hiddenKeys","CanaryScores","unhealthyScore","successfulScore","successfulHelpFieldId","successfulLabel","unhealthyHelpFieldId","unhealthyLabel","AdvancedSettings","JSON","stringify","SubmitFormButton","closeModal","button","isFormSubmit","combineLocations","includeAll","clearable","Field","required","resolveConfigIdFromExecutionId","executionId","configName","sref","useSref","PipelineLink","parentPipelineExecutionId","getScopeLocations","acc","isAtlas","isAtlasScope","baseColumns","execution","ReportLink","pipelineId","Score","relativeTime","ConfigLink","baselineScopeNames","canaryScopeNames","styles","maxWidth","isEqual","CANARY_EXECUTION_NO_PIPELINE_STATUS","getTableColumns","manualAnalysisEnabled","rerunAnalysis","TableRows","executions","loaded","updateExecutionsCount","executionsCount","useEffect","dataSource","activate","deactivate","countOptions","executionsCountOptions","alignSelf","flexShrink","startManualAnalysis","ExecutionListTable","lazyInitializeKayenta","applicationState","uiRouter","stateRegistry","$uiRouter","match","stub","deregister","applicationStateProvider","views","component","$type","footer","CanaryConfigSave","squash","token","deps","UIRouter","resolveFn","globals","params$","redirectTo","reportDetail","reportDefault","ExecutionListLoadStates","report","Report","defaultExecutionCount","canaryRoot","abstract","insight","pageTitleSection","addChildState","registerStates","transitionService","onBefore","Creators.clearSelectedConfig","$rootScope","$on","preventDefault","onEnter","onbeforeunload","onExit","onSuccess","Creators.setExecutionsCount","afterConfigsLoaded","Creators.updateConfigSummaries","afterJudgesLoaded","Creators.updateJudges","loadCanaryExecutions","listExecutionsRequest","listCanaryExecutions","Creators.loadExecutionsFailure","afterCanaryExecutionsLoaded","Creators.loadExecutionsSuccess"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AA+B,CAC7B1rB,gBAAiB9F,EAAYC,cAAc,iBAAiBF,OAE/D,EAGHivB,GAAKyC,kBAAqBzxB,IACpBA,IAAgByE,GAAY3e,WAAWia,KAAKC,aAGhDyE,GAAY1e,SACV2rC,GAAsB,CACpB3rB,OAAQ/F,EAAYC,cAAc,gBAAgBF,OAErD,EAGHivB,GAAK2C,qBAAwB3xB,IAC3B,MAAM4xB,EAAwBC,GAAqB7xB,EAAYvgB,MAM/D,OAJAmyC,EAAsBn2B,OAAO/W,IAC3B+f,GAAY1e,SAAS+rC,GAA+B,CAAEptC,UAAS,IAG1DktC,CAAqB,EAG9B5C,GAAK+C,4BAA+B/xB,IAC9BA,IAAgByE,GAAY3e,WAAWia,KAAKC,aAGhDyE,GAAY1e,SACVisC,GAA+B,CAC7BpE,WAAY5tB,EAAYC,cAAc,oBAAoBF,OAE7D,EFvBI,EACT"}
1
+ {"version":3,"file":"lazy-1f6a42b8.js","sources":["../../../src/kayenta/layout/table/tableHeader.tsx","../../../src/kayenta/layout/table/table.tsx","../../node_modules/redux/es/compose.js","../../node_modules/redux/es/applyMiddleware.js","../../../src/kayenta/report/detail/graph/semiotic/index.tsx","../../node_modules/redux-logger/dist/redux-logger.js","../../node_modules/rxjs/util/root.js","../../node_modules/rxjs/util/isFunction.js","../../node_modules/rxjs/util/isArray.js","../../node_modules/rxjs/util/isObject.js","../../node_modules/rxjs/util/tryCatch.js","../../node_modules/rxjs/util/errorObject.js","../../node_modules/rxjs/util/UnsubscriptionError.js","../../node_modules/rxjs/Subscription.js","../../node_modules/rxjs/Observer.js","../../node_modules/rxjs/symbol/rxSubscriber.js","../../node_modules/rxjs/Subscriber.js","../../node_modules/rxjs/util/toSubscriber.js","../../node_modules/rxjs/symbol/observable.js","../../node_modules/rxjs/util/noop.js","../../node_modules/rxjs/util/pipe.js","../../node_modules/rxjs/Observable.js","../../node_modules/rxjs/util/ObjectUnsubscribedError.js","../../node_modules/rxjs/SubjectSubscription.js","../../node_modules/rxjs/Subject.js","../../node_modules/rxjs/operators/map.js","../../node_modules/rxjs/operator/map.js","../../node_modules/rxjs/OuterSubscriber.js","../../node_modules/rxjs/util/isArrayLike.js","../../node_modules/rxjs/util/isPromise.js","../../node_modules/rxjs/symbol/iterator.js","../../node_modules/rxjs/InnerSubscriber.js","../../node_modules/rxjs/util/subscribeToResult.js","../../node_modules/rxjs/operators/switchMap.js","../../node_modules/rxjs/operator/switchMap.js","../../node_modules/rxjs/observable/ScalarObservable.js","../../node_modules/rxjs/observable/EmptyObservable.js","../../node_modules/rxjs/util/isScheduler.js","../../node_modules/rxjs/observable/ArrayObservable.js","../../node_modules/rxjs/observable/of.js","../../node_modules/rxjs/observable/PromiseObservable.js","../../node_modules/rxjs/observable/IteratorObservable.js","../../node_modules/rxjs/observable/ArrayLikeObservable.js","../../node_modules/rxjs/Notification.js","../../node_modules/rxjs/operators/observeOn.js","../../node_modules/rxjs/observable/FromObservable.js","../../node_modules/rxjs/observable/from.js","../../node_modules/rxjs/operators/filter.js","../../node_modules/rxjs/operator/filter.js","../../node_modules/redux-observable/lib/es/ActionsObservable.js","../../node_modules/redux-observable/lib/es/EPIC_END.js","../../node_modules/redux-observable/lib/es/createEpicMiddleware.js","../../node_modules/rxjs/operators/mergeMap.js","../../node_modules/rxjs/util/identity.js","../../node_modules/rxjs/operators/mergeAll.js","../../node_modules/rxjs/operators/merge.js","../../node_modules/rxjs/operator/merge.js","../../node_modules/rxjs/observable/merge.js","../../node_modules/redux-observable/lib/es/combineEpics.js","../../node_modules/rxjs/operators/concatAll.js","../../node_modules/rxjs/observable/concat.js","../../node_modules/rxjs/add/observable/concat.js","../../node_modules/rxjs/observable/ForkJoinObservable.js","../../node_modules/rxjs/observable/forkJoin.js","../../node_modules/rxjs/add/observable/forkJoin.js","../../node_modules/rxjs/observable/fromPromise.js","../../node_modules/rxjs/add/observable/fromPromise.js","../../node_modules/rxjs/operators/catchError.js","../../node_modules/rxjs/operator/catch.js","../../node_modules/rxjs/add/operator/catch.js","../../node_modules/rxjs/operators/concatMap.js","../../node_modules/rxjs/operator/concatMap.js","../../node_modules/rxjs/add/operator/concatMap.js","../../node_modules/rxjs/scheduler/Action.js","../../node_modules/rxjs/scheduler/AsyncAction.js","../../node_modules/rxjs/Scheduler.js","../../node_modules/rxjs/scheduler/AsyncScheduler.js","../../node_modules/rxjs/scheduler/async.js","../../node_modules/rxjs/operators/debounceTime.js","../../node_modules/rxjs/operator/debounceTime.js","../../node_modules/rxjs/add/operator/debounceTime.js","../../node_modules/rxjs/add/operator/filter.js","../../node_modules/rxjs/add/operator/map.js","../../node_modules/rxjs/operators/mapTo.js","../../node_modules/rxjs/operator/mapTo.js","../../node_modules/rxjs/add/operator/mapTo.js","../../../src/kayenta/middleware/epics.ts","../../../src/kayenta/service/metricsServiceMetadata.service.ts","../../../src/kayenta/canary.tsx","../../../src/kayenta/middleware/actionInterceptor.ts","../../../src/kayenta/middleware/asyncDispatch.ts","../../../src/kayenta/components/loadStates.tsx","../../../src/kayenta/layout/formattedDate.tsx","../../../src/kayenta/edit/copyConfigButton.tsx","../../../src/kayenta/edit/openConfigJsonModalButton.tsx","../../../src/kayenta/edit/deleteModal.tsx","../../../src/kayenta/edit/openDeleteModalButton.tsx","../../../src/kayenta/edit/configDetailActionButtons.tsx","../../../src/kayenta/edit/configDetailHeader.tsx","../../../src/kayenta/edit/editMetricEffectSizes.tsx","../../../src/kayenta/edit/filterTemplateSelector.tsx","../../../src/kayenta/edit/inlineTemplateEditor.tsx","../../../src/kayenta/edit/metricConfigurerDelegator.tsx","../../../src/kayenta/edit/editMetricModal.tsx","../../../src/kayenta/layout/titledSection.tsx","../../../src/kayenta/edit/changeMetricGroupModal.tsx","../../../src/kayenta/edit/metricList.tsx","../../../src/kayenta/layout/formList.tsx","../../../src/kayenta/edit/metricStoreSelector.tsx","../../../src/kayenta/edit/nameAndDescription.tsx","../../../src/kayenta/layout/titledSubsection.tsx","../../../src/kayenta/edit/groupWeight.tsx","../../../src/kayenta/edit/groupWeights.tsx","../../../src/kayenta/edit/scoring.tsx","../../../src/kayenta/edit/configDetail.tsx","../../../src/kayenta/layout/centeredDetail.tsx","../../../src/kayenta/edit/configDetailLoadStates.tsx","../../../src/kayenta/edit/configDetailLoader.tsx","../../../src/kayenta/edit/createConfigButton.tsx","../../../src/kayenta/edit/ownedBy.tsx","../../../src/kayenta/edit/configList.tsx","../../../src/kayenta/edit/footer.tsx","../../../src/kayenta/layout/listDetail.tsx","../../../src/kayenta/edit/edit.tsx","../../../src/kayenta/edit/saveConfigButton.tsx","../../../src/kayenta/edit/saveConfigError.tsx","../../../src/kayenta/edit/validationErrors.tsx","../../../src/kayenta/edit/save.tsx","../../../src/kayenta/edit/selectConfig.tsx","../../../src/kayenta/report/detail/sourceLinks.tsx","../../../src/kayenta/report/detail/reportMetadata.tsx","../../../src/kayenta/report/detail/score.tsx","../../../src/kayenta/report/detail/header.tsx","../../../src/kayenta/report/detail/graph/graph.tsx","../../../src/kayenta/report/detail/graphTypeSelector.tsx","../../../src/kayenta/report/detail/metricResultActions.tsx","../../../src/kayenta/report/detail/metricResultStats.tsx","../../../src/kayenta/report/detail/metricResultDetailLayout.tsx","../../../src/kayenta/report/detail/metricSetPairLoadStates.tsx","../../../src/kayenta/report/detail/metricResultDetail.tsx","../../../src/kayenta/report/detail/metricResultsClassificationFilters.tsx","../../../src/kayenta/report/detail/colors.ts","../../../src/kayenta/report/detail/metricResultClassification.tsx","../../../src/kayenta/report/detail/metricResultDeviation.tsx","../../../src/kayenta/report/detail/metricResultsColumns.tsx","../../../src/kayenta/report/detail/multipleResultsTable.tsx","../../../src/kayenta/report/detail/metricResultsList.tsx","../../../src/kayenta/report/detail/metricResults.tsx","../../../src/kayenta/report/detail/reportException.tsx","../../../src/kayenta/report/detail/reportExplanation.tsx","../../../src/kayenta/report/detail/headerArrow.tsx","../../../src/kayenta/report/detail/allMetricResultsHeader.tsx","../../../src/kayenta/report/detail/clickableHeader.tsx","../../../src/kayenta/report/detail/groupScores.tsx","../../../src/kayenta/report/detail/reportScores.tsx","../../../src/kayenta/report/detail/detail.tsx","../../../src/kayenta/report/detail/loadStates.tsx","../../../src/kayenta/report/detail/detailLoader.tsx","../../../src/kayenta/manualAnalysis/ManualAnalysisModal.tsx","../../../src/kayenta/report/list/configLink.tsx","../../../src/kayenta/report/list/pipelineLink.tsx","../../../src/kayenta/report/list/reportLink.tsx","../../../src/kayenta/report/list/table.tsx","../../../src/kayenta/report/list/loadStates.tsx","../../../src/kayenta/report/report.tsx","../../../src/lazy.ts","../../../src/kayenta/navigation/canary.states.ts","../../../src/kayenta/canary.dataSource.bridge.ts"],"sourcesContent":["import classNames from 'classnames';\nimport * as React from 'react';\n\nimport { ITableColumn } from './tableColumn';\n\nexport interface ITableHeaderProps {\n columns: Array<ITableColumn<any>>;\n className: string;\n}\n\nexport const TableHeader = ({ columns, className }: ITableHeaderProps) => {\n return (\n <div className={classNames('horizontal', className)}>\n {columns.map((c, i) => (\n <div key={c.label || i} className={`flex-${c.width}`}>\n {!c.hide && (\n <h6 className={classNames('heading-6', 'uppercase', 'color-text-primary', c.labelClassName)}>{c.label}</h6>\n )}\n </div>\n ))}\n </div>\n );\n};\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nimport { ITableColumn } from './tableColumn';\nimport { TableHeader } from './tableHeader';\n\nexport interface ITableProps<T> {\n rows: T[];\n columns: Array<ITableColumn<T>>;\n rowKey: (row: T) => string;\n tableBodyClassName?: string;\n headerClassName?: string;\n rowClassName?: (row: T) => string;\n onRowClick?: (row: T) => void;\n customRow?: (row: T) => JSX.Element;\n className?: string;\n}\n\nexport function Table<T>({\n rows,\n columns,\n rowKey,\n tableBodyClassName,\n rowClassName,\n onRowClick,\n customRow,\n className,\n headerClassName,\n}: ITableProps<T>) {\n const TableRow = ({ row }: { row: T }) => (\n <li\n onClick={onRowClick ? () => onRowClick(row) : null}\n className={classNames(\n { horizontal: !rowClassName, 'table-row': !rowClassName },\n rowClassName && rowClassName(row),\n )}\n >\n {columns.map((c, i) => (\n <div key={c.label || i} className={`flex-${c.width}`}>\n {!c.hide && c.getContent(row)}\n </div>\n ))}\n </li>\n );\n\n return (\n <div className={className}>\n <ul className={classNames(tableBodyClassName, 'list-group')}>\n <TableHeader columns={columns} className={classNames('table-header', 'sticky-header', headerClassName)} />\n {rows.map((r) =>\n customRow && customRow(r) ? <div key={rowKey(r)}>{customRow(r)}</div> : <TableRow key={rowKey(r)} row={r} />,\n )}\n </ul>\n </div>\n );\n}\n","/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nexport default function compose() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(undefined, arguments));\n };\n });\n}","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nimport compose from './compose';\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\nexport default function applyMiddleware() {\n for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function (reducer, preloadedState, enhancer) {\n var store = createStore(reducer, preloadedState, enhancer);\n var _dispatch = store.dispatch;\n var chain = [];\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch(action) {\n return _dispatch(action);\n }\n };\n chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(undefined, chain)(store.dispatch);\n\n return _extends({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}","import * as React from 'react';\nimport { Suspense } from 'react';\n\nimport { Spinner } from '@spinnaker/core';\n\nimport { GraphType, IMetricSetPairGraphProps, metricSetPairGraphService } from '../metricSetPairGraph.service';\nconst SemioticGraphLazy = React.lazy(() => import(/* webpackChunkName: \"Lazy-KayentaGraphs\" */ './semioticGraph'));\n\nconst supportedGraphTypes: GraphType[] = [GraphType.TimeSeries, GraphType.Histogram, GraphType.BoxPlot];\n// Semiotic component registration\nmetricSetPairGraphService.register({\n name: 'semiotic',\n handlesGraphType: (type) => supportedGraphTypes.includes(type),\n getGraph: () => (props: IMetricSetPairGraphProps) => (\n <Suspense fallback={<Spinner />}>\n <SemioticGraphLazy {...props} />\n </Suspense>\n ),\n});\n","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?t(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],t):t(e.reduxLogger=e.reduxLogger||{})}(this,function(e){\"use strict\";function t(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function r(e,t){Object.defineProperty(this,\"kind\",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,\"path\",{value:t,enumerable:!0})}function n(e,t,r){n.super_.call(this,\"E\",e),Object.defineProperty(this,\"lhs\",{value:t,enumerable:!0}),Object.defineProperty(this,\"rhs\",{value:r,enumerable:!0})}function o(e,t){o.super_.call(this,\"N\",e),Object.defineProperty(this,\"rhs\",{value:t,enumerable:!0})}function i(e,t){i.super_.call(this,\"D\",e),Object.defineProperty(this,\"lhs\",{value:t,enumerable:!0})}function a(e,t,r){a.super_.call(this,\"A\",e),Object.defineProperty(this,\"index\",{value:t,enumerable:!0}),Object.defineProperty(this,\"item\",{value:r,enumerable:!0})}function f(e,t,r){var n=e.slice((r||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,n),e}function u(e){var t=\"undefined\"==typeof e?\"undefined\":N(e);return\"object\"!==t?t:e===Math?\"math\":null===e?\"null\":Array.isArray(e)?\"array\":\"[object Date]\"===Object.prototype.toString.call(e)?\"date\":\"function\"==typeof e.toString&&/^\\/.*\\//.test(e.toString())?\"regexp\":\"object\"}function l(e,t,r,c,s,d,p){s=s||[],p=p||[];var g=s.slice(0);if(\"undefined\"!=typeof d){if(c){if(\"function\"==typeof c&&c(g,d))return;if(\"object\"===(\"undefined\"==typeof c?\"undefined\":N(c))){if(c.prefilter&&c.prefilter(g,d))return;if(c.normalize){var h=c.normalize(g,d,e,t);h&&(e=h[0],t=h[1])}}}g.push(d)}\"regexp\"===u(e)&&\"regexp\"===u(t)&&(e=e.toString(),t=t.toString());var y=\"undefined\"==typeof e?\"undefined\":N(e),v=\"undefined\"==typeof t?\"undefined\":N(t),b=\"undefined\"!==y||p&&p[p.length-1].lhs&&p[p.length-1].lhs.hasOwnProperty(d),m=\"undefined\"!==v||p&&p[p.length-1].rhs&&p[p.length-1].rhs.hasOwnProperty(d);if(!b&&m)r(new o(g,t));else if(!m&&b)r(new i(g,e));else if(u(e)!==u(t))r(new n(g,e,t));else if(\"date\"===u(e)&&e-t!==0)r(new n(g,e,t));else if(\"object\"===y&&null!==e&&null!==t)if(p.filter(function(t){return t.lhs===e}).length)e!==t&&r(new n(g,e,t));else{if(p.push({lhs:e,rhs:t}),Array.isArray(e)){var w;e.length;for(w=0;w<e.length;w++)w>=t.length?r(new a(g,w,new i(void 0,e[w]))):l(e[w],t[w],r,c,g,w,p);for(;w<t.length;)r(new a(g,w,new o(void 0,t[w++])))}else{var x=Object.keys(e),S=Object.keys(t);x.forEach(function(n,o){var i=S.indexOf(n);i>=0?(l(e[n],t[n],r,c,g,n,p),S=f(S,i)):l(e[n],void 0,r,c,g,n,p)}),S.forEach(function(e){l(void 0,t[e],r,c,g,e,p)})}p.length=p.length-1}else e!==t&&(\"number\"===y&&isNaN(e)&&isNaN(t)||r(new n(g,e,t)))}function c(e,t,r,n){return n=n||[],l(e,t,function(e){e&&n.push(e)},r),n.length?n:void 0}function s(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;n<i;n++)o=o[r.path[n]];switch(r.kind){case\"A\":s(o[r.path[n]],r.index,r.item);break;case\"D\":delete o[r.path[n]];break;case\"E\":case\"N\":o[r.path[n]]=r.rhs}}else switch(r.kind){case\"A\":s(e[t],r.index,r.item);break;case\"D\":e=f(e,t);break;case\"E\":case\"N\":e[t]=r.rhs}return e}function d(e,t,r){if(e&&t&&r&&r.kind){for(var n=e,o=-1,i=r.path?r.path.length-1:0;++o<i;)\"undefined\"==typeof n[r.path[o]]&&(n[r.path[o]]=\"number\"==typeof r.path[o]?[]:{}),n=n[r.path[o]];switch(r.kind){case\"A\":s(r.path?n[r.path[o]]:n,r.index,r.item);break;case\"D\":delete n[r.path[o]];break;case\"E\":case\"N\":n[r.path[o]]=r.rhs}}}function p(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;n<i;n++)o=o[r.path[n]];switch(r.kind){case\"A\":p(o[r.path[n]],r.index,r.item);break;case\"D\":o[r.path[n]]=r.lhs;break;case\"E\":o[r.path[n]]=r.lhs;break;case\"N\":delete o[r.path[n]]}}else switch(r.kind){case\"A\":p(e[t],r.index,r.item);break;case\"D\":e[t]=r.lhs;break;case\"E\":e[t]=r.lhs;break;case\"N\":e=f(e,t)}return e}function g(e,t,r){if(e&&t&&r&&r.kind){var n,o,i=e;for(o=r.path.length-1,n=0;n<o;n++)\"undefined\"==typeof i[r.path[n]]&&(i[r.path[n]]={}),i=i[r.path[n]];switch(r.kind){case\"A\":p(i[r.path[n]],r.index,r.item);break;case\"D\":i[r.path[n]]=r.lhs;break;case\"E\":i[r.path[n]]=r.lhs;break;case\"N\":delete i[r.path[n]]}}}function h(e,t,r){if(e&&t){var n=function(n){r&&!r(e,t,n)||d(e,t,n)};l(e,t,n)}}function y(e){return\"color: \"+F[e].color+\"; font-weight: bold\"}function v(e){var t=e.kind,r=e.path,n=e.lhs,o=e.rhs,i=e.index,a=e.item;switch(t){case\"E\":return[r.join(\".\"),n,\"→\",o];case\"N\":return[r.join(\".\"),o];case\"D\":return[r.join(\".\")];case\"A\":return[r.join(\".\")+\"[\"+i+\"]\",a];default:return[]}}function b(e,t,r,n){var o=c(e,t);try{n?r.groupCollapsed(\"diff\"):r.group(\"diff\")}catch(e){r.log(\"diff\")}o?o.forEach(function(e){var t=e.kind,n=v(e);r.log.apply(r,[\"%c \"+F[t].text,y(t)].concat(P(n)))}):r.log(\"—— no diff ——\");try{r.groupEnd()}catch(e){r.log(\"—— diff end —— \")}}function m(e,t,r,n){switch(\"undefined\"==typeof e?\"undefined\":N(e)){case\"object\":return\"function\"==typeof e[n]?e[n].apply(e,P(r)):e[n];case\"function\":return e(t);default:return e}}function w(e){var t=e.timestamp,r=e.duration;return function(e,n,o){var i=[\"action\"];return i.push(\"%c\"+String(e.type)),t&&i.push(\"%c@ \"+n),r&&i.push(\"%c(in \"+o.toFixed(2)+\" ms)\"),i.join(\" \")}}function x(e,t){var r=t.logger,n=t.actionTransformer,o=t.titleFormatter,i=void 0===o?w(t):o,a=t.collapsed,f=t.colors,u=t.level,l=t.diff,c=\"undefined\"==typeof t.titleFormatter;e.forEach(function(o,s){var d=o.started,p=o.startedTime,g=o.action,h=o.prevState,y=o.error,v=o.took,w=o.nextState,x=e[s+1];x&&(w=x.prevState,v=x.started-d);var S=n(g),k=\"function\"==typeof a?a(function(){return w},g,o):a,j=D(p),E=f.title?\"color: \"+f.title(S)+\";\":\"\",A=[\"color: gray; font-weight: lighter;\"];A.push(E),t.timestamp&&A.push(\"color: gray; font-weight: lighter;\"),t.duration&&A.push(\"color: gray; font-weight: lighter;\");var O=i(S,j,v);try{k?f.title&&c?r.groupCollapsed.apply(r,[\"%c \"+O].concat(A)):r.groupCollapsed(O):f.title&&c?r.group.apply(r,[\"%c \"+O].concat(A)):r.group(O)}catch(e){r.log(O)}var N=m(u,S,[h],\"prevState\"),P=m(u,S,[S],\"action\"),C=m(u,S,[y,h],\"error\"),F=m(u,S,[w],\"nextState\");if(N)if(f.prevState){var L=\"color: \"+f.prevState(h)+\"; font-weight: bold\";r[N](\"%c prev state\",L,h)}else r[N](\"prev state\",h);if(P)if(f.action){var T=\"color: \"+f.action(S)+\"; font-weight: bold\";r[P](\"%c action \",T,S)}else r[P](\"action \",S);if(y&&C)if(f.error){var M=\"color: \"+f.error(y,h)+\"; font-weight: bold;\";r[C](\"%c error \",M,y)}else r[C](\"error \",y);if(F)if(f.nextState){var _=\"color: \"+f.nextState(w)+\"; font-weight: bold\";r[F](\"%c next state\",_,w)}else r[F](\"next state\",w);l&&b(h,w,r,k);try{r.groupEnd()}catch(e){r.log(\"—— log end ——\")}})}function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},L,e),r=t.logger,n=t.stateTransformer,o=t.errorTransformer,i=t.predicate,a=t.logErrors,f=t.diffPredicate;if(\"undefined\"==typeof r)return function(){return function(e){return function(t){return e(t)}}};if(e.getState&&e.dispatch)return console.error(\"[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\\n// Logger with default options\\nimport { logger } from 'redux-logger'\\nconst store = createStore(\\n reducer,\\n applyMiddleware(logger)\\n)\\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\\nimport createLogger from 'redux-logger'\\nconst logger = createLogger({\\n // ...options\\n});\\nconst store = createStore(\\n reducer,\\n applyMiddleware(logger)\\n)\\n\"),function(){return function(e){return function(t){return e(t)}}};var u=[];return function(e){var r=e.getState;return function(e){return function(l){if(\"function\"==typeof i&&!i(r,l))return e(l);var c={};u.push(c),c.started=O.now(),c.startedTime=new Date,c.prevState=n(r()),c.action=l;var s=void 0;if(a)try{s=e(l)}catch(e){c.error=o(e)}else s=e(l);c.took=O.now()-c.started,c.nextState=n(r());var d=t.diff&&\"function\"==typeof f?f(r,l):t.diff;if(x(u,Object.assign({},t,{diff:d})),u.length=0,c.error)throw c.error;return s}}}}var k,j,E=function(e,t){return new Array(t+1).join(e)},A=function(e,t){return E(\"0\",t-e.toString().length)+e},D=function(e){return A(e.getHours(),2)+\":\"+A(e.getMinutes(),2)+\":\"+A(e.getSeconds(),2)+\".\"+A(e.getMilliseconds(),3)},O=\"undefined\"!=typeof performance&&null!==performance&&\"function\"==typeof performance.now?performance:Date,N=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},P=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},C=[];k=\"object\"===(\"undefined\"==typeof global?\"undefined\":N(global))&&global?global:\"undefined\"!=typeof window?window:{},j=k.DeepDiff,j&&C.push(function(){\"undefined\"!=typeof j&&k.DeepDiff===c&&(k.DeepDiff=j,j=void 0)}),t(n,r),t(o,r),t(i,r),t(a,r),Object.defineProperties(c,{diff:{value:c,enumerable:!0},observableDiff:{value:l,enumerable:!0},applyDiff:{value:h,enumerable:!0},applyChange:{value:d,enumerable:!0},revertChange:{value:g,enumerable:!0},isConflict:{value:function(){return\"undefined\"!=typeof j},enumerable:!0},noConflict:{value:function(){return C&&(C.forEach(function(e){e()}),C=null),c},enumerable:!0}});var F={E:{color:\"#2196F3\",text:\"CHANGED:\"},N:{color:\"#4CAF50\",text:\"ADDED:\"},D:{color:\"#F44336\",text:\"DELETED:\"},A:{color:\"#2196F3\",text:\"ARRAY:\"}},L={level:\"log\",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(e){return e},actionTransformer:function(e){return e},errorTransformer:function(e){return e},colors:{title:function(){return\"inherit\"},prevState:function(){return\"#9E9E9E\"},action:function(){return\"#03A9F4\"},nextState:function(){return\"#4CAF50\"},error:function(){return\"#F20404\"}},diff:!1,diffPredicate:void 0,transformer:void 0},T=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dispatch,r=e.getState;return\"function\"==typeof t||\"function\"==typeof r?S()({dispatch:t,getState:r}):void console.error(\"\\n[redux-logger v3] BREAKING CHANGE\\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\\n[redux-logger v3] Change\\n[redux-logger v3] import createLogger from 'redux-logger'\\n[redux-logger v3] to\\n[redux-logger v3] import { createLogger } from 'redux-logger'\\n\")};e.defaults=L,e.createLogger=S,e.logger=T,e.default=T,Object.defineProperty(e,\"__esModule\",{value:!0})});\n","\"use strict\";\n// CommonJS / Node have global context exposed as \"global\" variable.\n// We don't want to include the whole node.d.ts this this compilation unit so we'll just fake\n// the global \"global\" var for now.\nvar __window = typeof window !== 'undefined' && window;\nvar __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope && self;\nvar __global = typeof global !== 'undefined' && global;\nvar _root = __window || __global || __self;\nexports.root = _root;\n// Workaround Closure Compiler restriction: The body of a goog.module cannot use throw.\n// This is needed when used with angular/tsickle which inserts a goog.module statement.\n// Wrap in IIFE\n(function () {\n if (!_root) {\n throw new Error('RxJS could not find any global context (window, self, global)');\n }\n})();\n//# sourceMappingURL=root.js.map","\"use strict\";\nfunction isFunction(x) {\n return typeof x === 'function';\n}\nexports.isFunction = isFunction;\n//# sourceMappingURL=isFunction.js.map","\"use strict\";\nexports.isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; });\n//# sourceMappingURL=isArray.js.map","\"use strict\";\nfunction isObject(x) {\n return x != null && typeof x === 'object';\n}\nexports.isObject = isObject;\n//# sourceMappingURL=isObject.js.map","\"use strict\";\nvar errorObject_1 = require('./errorObject');\nvar tryCatchTarget;\nfunction tryCatcher() {\n try {\n return tryCatchTarget.apply(this, arguments);\n }\n catch (e) {\n errorObject_1.errorObject.e = e;\n return errorObject_1.errorObject;\n }\n}\nfunction tryCatch(fn) {\n tryCatchTarget = fn;\n return tryCatcher;\n}\nexports.tryCatch = tryCatch;\n;\n//# sourceMappingURL=tryCatch.js.map","\"use strict\";\n// typeof any so that it we don't have to cast when comparing a result to the error object\nexports.errorObject = { e: {} };\n//# sourceMappingURL=errorObject.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nvar UnsubscriptionError = (function (_super) {\n __extends(UnsubscriptionError, _super);\n function UnsubscriptionError(errors) {\n _super.call(this);\n this.errors = errors;\n var err = Error.call(this, errors ?\n errors.length + \" errors occurred during unsubscription:\\n \" + errors.map(function (err, i) { return ((i + 1) + \") \" + err.toString()); }).join('\\n ') : '');\n this.name = err.name = 'UnsubscriptionError';\n this.stack = err.stack;\n this.message = err.message;\n }\n return UnsubscriptionError;\n}(Error));\nexports.UnsubscriptionError = UnsubscriptionError;\n//# sourceMappingURL=UnsubscriptionError.js.map","\"use strict\";\nvar isArray_1 = require('./util/isArray');\nvar isObject_1 = require('./util/isObject');\nvar isFunction_1 = require('./util/isFunction');\nvar tryCatch_1 = require('./util/tryCatch');\nvar errorObject_1 = require('./util/errorObject');\nvar UnsubscriptionError_1 = require('./util/UnsubscriptionError');\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n *\n * @class Subscription\n */\nvar Subscription = (function () {\n /**\n * @param {function(): void} [unsubscribe] A function describing how to\n * perform the disposal of resources when the `unsubscribe` method is called.\n */\n function Subscription(unsubscribe) {\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n * @type {boolean}\n */\n this.closed = false;\n this._parent = null;\n this._parents = null;\n this._subscriptions = null;\n if (unsubscribe) {\n this._unsubscribe = unsubscribe;\n }\n }\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n * @return {void}\n */\n Subscription.prototype.unsubscribe = function () {\n var hasErrors = false;\n var errors;\n if (this.closed) {\n return;\n }\n var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;\n this.closed = true;\n this._parent = null;\n this._parents = null;\n // null out _subscriptions first so any child subscriptions that attempt\n // to remove themselves from this subscription will noop\n this._subscriptions = null;\n var index = -1;\n var len = _parents ? _parents.length : 0;\n // if this._parent is null, then so is this._parents, and we\n // don't have to remove ourselves from any parent subscriptions.\n while (_parent) {\n _parent.remove(this);\n // if this._parents is null or index >= len,\n // then _parent is set to null, and the loop exits\n _parent = ++index < len && _parents[index] || null;\n }\n if (isFunction_1.isFunction(_unsubscribe)) {\n var trial = tryCatch_1.tryCatch(_unsubscribe).call(this);\n if (trial === errorObject_1.errorObject) {\n hasErrors = true;\n errors = errors || (errorObject_1.errorObject.e instanceof UnsubscriptionError_1.UnsubscriptionError ?\n flattenUnsubscriptionErrors(errorObject_1.errorObject.e.errors) : [errorObject_1.errorObject.e]);\n }\n }\n if (isArray_1.isArray(_subscriptions)) {\n index = -1;\n len = _subscriptions.length;\n while (++index < len) {\n var sub = _subscriptions[index];\n if (isObject_1.isObject(sub)) {\n var trial = tryCatch_1.tryCatch(sub.unsubscribe).call(sub);\n if (trial === errorObject_1.errorObject) {\n hasErrors = true;\n errors = errors || [];\n var err = errorObject_1.errorObject.e;\n if (err instanceof UnsubscriptionError_1.UnsubscriptionError) {\n errors = errors.concat(flattenUnsubscriptionErrors(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n }\n if (hasErrors) {\n throw new UnsubscriptionError_1.UnsubscriptionError(errors);\n }\n };\n /**\n * Adds a tear down to be called during the unsubscribe() of this\n * Subscription.\n *\n * If the tear down being added is a subscription that is already\n * unsubscribed, is the same reference `add` is being called on, or is\n * `Subscription.EMPTY`, it will not be added.\n *\n * If this subscription is already in an `closed` state, the passed\n * tear down logic will be executed immediately.\n *\n * @param {TeardownLogic} teardown The additional logic to execute on\n * teardown.\n * @return {Subscription} Returns the Subscription used or created to be\n * added to the inner subscriptions list. This Subscription can be used with\n * `remove()` to remove the passed teardown logic from the inner subscriptions\n * list.\n */\n Subscription.prototype.add = function (teardown) {\n if (!teardown || (teardown === Subscription.EMPTY)) {\n return Subscription.EMPTY;\n }\n if (teardown === this) {\n return this;\n }\n var subscription = teardown;\n switch (typeof teardown) {\n case 'function':\n subscription = new Subscription(teardown);\n case 'object':\n if (subscription.closed || typeof subscription.unsubscribe !== 'function') {\n return subscription;\n }\n else if (this.closed) {\n subscription.unsubscribe();\n return subscription;\n }\n else if (typeof subscription._addParent !== 'function' /* quack quack */) {\n var tmp = subscription;\n subscription = new Subscription();\n subscription._subscriptions = [tmp];\n }\n break;\n default:\n throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');\n }\n var subscriptions = this._subscriptions || (this._subscriptions = []);\n subscriptions.push(subscription);\n subscription._addParent(this);\n return subscription;\n };\n /**\n * Removes a Subscription from the internal list of subscriptions that will\n * unsubscribe during the unsubscribe process of this Subscription.\n * @param {Subscription} subscription The subscription to remove.\n * @return {void}\n */\n Subscription.prototype.remove = function (subscription) {\n var subscriptions = this._subscriptions;\n if (subscriptions) {\n var subscriptionIndex = subscriptions.indexOf(subscription);\n if (subscriptionIndex !== -1) {\n subscriptions.splice(subscriptionIndex, 1);\n }\n }\n };\n Subscription.prototype._addParent = function (parent) {\n var _a = this, _parent = _a._parent, _parents = _a._parents;\n if (!_parent || _parent === parent) {\n // If we don't have a parent, or the new parent is the same as the\n // current parent, then set this._parent to the new parent.\n this._parent = parent;\n }\n else if (!_parents) {\n // If there's already one parent, but not multiple, allocate an Array to\n // store the rest of the parent Subscriptions.\n this._parents = [parent];\n }\n else if (_parents.indexOf(parent) === -1) {\n // Only add the new parent to the _parents list if it's not already there.\n _parents.push(parent);\n }\n };\n Subscription.EMPTY = (function (empty) {\n empty.closed = true;\n return empty;\n }(new Subscription()));\n return Subscription;\n}());\nexports.Subscription = Subscription;\nfunction flattenUnsubscriptionErrors(errors) {\n return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError_1.UnsubscriptionError) ? err.errors : err); }, []);\n}\n//# sourceMappingURL=Subscription.js.map","\"use strict\";\nexports.empty = {\n closed: true,\n next: function (value) { },\n error: function (err) { throw err; },\n complete: function () { }\n};\n//# sourceMappingURL=Observer.js.map","\"use strict\";\nvar root_1 = require('../util/root');\nvar Symbol = root_1.root.Symbol;\nexports.rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ?\n Symbol.for('rxSubscriber') : '@@rxSubscriber';\n/**\n * @deprecated use rxSubscriber instead\n */\nexports.$$rxSubscriber = exports.rxSubscriber;\n//# sourceMappingURL=rxSubscriber.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar isFunction_1 = require('./util/isFunction');\nvar Subscription_1 = require('./Subscription');\nvar Observer_1 = require('./Observer');\nvar rxSubscriber_1 = require('./symbol/rxSubscriber');\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n *\n * @class Subscriber<T>\n */\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n /**\n * @param {Observer|function(value: T): void} [destinationOrNext] A partially\n * defined Observer or a `next` callback function.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n */\n function Subscriber(destinationOrNext, error, complete) {\n _super.call(this);\n this.syncErrorValue = null;\n this.syncErrorThrown = false;\n this.syncErrorThrowable = false;\n this.isStopped = false;\n switch (arguments.length) {\n case 0:\n this.destination = Observer_1.empty;\n break;\n case 1:\n if (!destinationOrNext) {\n this.destination = Observer_1.empty;\n break;\n }\n if (typeof destinationOrNext === 'object') {\n if (destinationOrNext instanceof Subscriber) {\n this.destination = destinationOrNext;\n this.destination.add(this);\n }\n else {\n this.syncErrorThrowable = true;\n this.destination = new SafeSubscriber(this, destinationOrNext);\n }\n break;\n }\n default:\n this.syncErrorThrowable = true;\n this.destination = new SafeSubscriber(this, destinationOrNext, error, complete);\n break;\n }\n }\n Subscriber.prototype[rxSubscriber_1.rxSubscriber] = function () { return this; };\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param {function(x: ?T): void} [next] The `next` callback of an Observer.\n * @param {function(e: ?any): void} [error] The `error` callback of an\n * Observer.\n * @param {function(): void} [complete] The `complete` callback of an\n * Observer.\n * @return {Subscriber<T>} A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n */\n Subscriber.create = function (next, error, complete) {\n var subscriber = new Subscriber(next, error, complete);\n subscriber.syncErrorThrowable = false;\n return subscriber;\n };\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param {T} [value] The `next` value.\n * @return {void}\n */\n Subscriber.prototype.next = function (value) {\n if (!this.isStopped) {\n this._next(value);\n }\n };\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached {@link Error}. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param {any} [err] The `error` exception.\n * @return {void}\n */\n Subscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n this.isStopped = true;\n this._error(err);\n }\n };\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n * @return {void}\n */\n Subscriber.prototype.complete = function () {\n if (!this.isStopped) {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n this.destination.error(err);\n this.unsubscribe();\n };\n Subscriber.prototype._complete = function () {\n this.destination.complete();\n this.unsubscribe();\n };\n Subscriber.prototype._unsubscribeAndRecycle = function () {\n var _a = this, _parent = _a._parent, _parents = _a._parents;\n this._parent = null;\n this._parents = null;\n this.unsubscribe();\n this.closed = false;\n this.isStopped = false;\n this._parent = _parent;\n this._parents = _parents;\n return this;\n };\n return Subscriber;\n}(Subscription_1.Subscription));\nexports.Subscriber = Subscriber;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {\n _super.call(this);\n this._parentSubscriber = _parentSubscriber;\n var next;\n var context = this;\n if (isFunction_1.isFunction(observerOrNext)) {\n next = observerOrNext;\n }\n else if (observerOrNext) {\n next = observerOrNext.next;\n error = observerOrNext.error;\n complete = observerOrNext.complete;\n if (observerOrNext !== Observer_1.empty) {\n context = Object.create(observerOrNext);\n if (isFunction_1.isFunction(context.unsubscribe)) {\n this.add(context.unsubscribe.bind(context));\n }\n context.unsubscribe = this.unsubscribe.bind(this);\n }\n }\n this._context = context;\n this._next = next;\n this._error = error;\n this._complete = complete;\n }\n SafeSubscriber.prototype.next = function (value) {\n if (!this.isStopped && this._next) {\n var _parentSubscriber = this._parentSubscriber;\n if (!_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._next, value);\n }\n else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n if (this._error) {\n if (!_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(this._error, err);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, this._error, err);\n this.unsubscribe();\n }\n }\n else if (!_parentSubscriber.syncErrorThrowable) {\n this.unsubscribe();\n throw err;\n }\n else {\n _parentSubscriber.syncErrorValue = err;\n _parentSubscriber.syncErrorThrown = true;\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.complete = function () {\n var _this = this;\n if (!this.isStopped) {\n var _parentSubscriber = this._parentSubscriber;\n if (this._complete) {\n var wrappedComplete = function () { return _this._complete.call(_this._context); };\n if (!_parentSubscriber.syncErrorThrowable) {\n this.__tryOrUnsub(wrappedComplete);\n this.unsubscribe();\n }\n else {\n this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n this.unsubscribe();\n }\n }\n else {\n this.unsubscribe();\n }\n }\n };\n SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n this.unsubscribe();\n throw err;\n }\n };\n SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {\n try {\n fn.call(this._context, value);\n }\n catch (err) {\n parent.syncErrorValue = err;\n parent.syncErrorThrown = true;\n return true;\n }\n return false;\n };\n SafeSubscriber.prototype._unsubscribe = function () {\n var _parentSubscriber = this._parentSubscriber;\n this._context = null;\n this._parentSubscriber = null;\n _parentSubscriber.unsubscribe();\n };\n return SafeSubscriber;\n}(Subscriber));\n//# sourceMappingURL=Subscriber.js.map","\"use strict\";\nvar Subscriber_1 = require('../Subscriber');\nvar rxSubscriber_1 = require('../symbol/rxSubscriber');\nvar Observer_1 = require('../Observer');\nfunction toSubscriber(nextOrObserver, error, complete) {\n if (nextOrObserver) {\n if (nextOrObserver instanceof Subscriber_1.Subscriber) {\n return nextOrObserver;\n }\n if (nextOrObserver[rxSubscriber_1.rxSubscriber]) {\n return nextOrObserver[rxSubscriber_1.rxSubscriber]();\n }\n }\n if (!nextOrObserver && !error && !complete) {\n return new Subscriber_1.Subscriber(Observer_1.empty);\n }\n return new Subscriber_1.Subscriber(nextOrObserver, error, complete);\n}\nexports.toSubscriber = toSubscriber;\n//# sourceMappingURL=toSubscriber.js.map","\"use strict\";\nvar root_1 = require('../util/root');\nfunction getSymbolObservable(context) {\n var $$observable;\n var Symbol = context.Symbol;\n if (typeof Symbol === 'function') {\n if (Symbol.observable) {\n $$observable = Symbol.observable;\n }\n else {\n $$observable = Symbol('observable');\n Symbol.observable = $$observable;\n }\n }\n else {\n $$observable = '@@observable';\n }\n return $$observable;\n}\nexports.getSymbolObservable = getSymbolObservable;\nexports.observable = getSymbolObservable(root_1.root);\n/**\n * @deprecated use observable instead\n */\nexports.$$observable = exports.observable;\n//# sourceMappingURL=observable.js.map","\"use strict\";\n/* tslint:disable:no-empty */\nfunction noop() { }\nexports.noop = noop;\n//# sourceMappingURL=noop.js.map","\"use strict\";\nvar noop_1 = require('./noop');\n/* tslint:enable:max-line-length */\nfunction pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i - 0] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexports.pipe = pipe;\n/* @internal */\nfunction pipeFromArray(fns) {\n if (!fns) {\n return noop_1.noop;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\nexports.pipeFromArray = pipeFromArray;\n//# sourceMappingURL=pipe.js.map","\"use strict\";\nvar root_1 = require('./util/root');\nvar toSubscriber_1 = require('./util/toSubscriber');\nvar observable_1 = require('./symbol/observable');\nvar pipe_1 = require('./util/pipe');\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n *\n * @class Observable<T>\n */\nvar Observable = (function () {\n /**\n * @constructor\n * @param {Function} subscribe the function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n function Observable(subscribe) {\n this._isScalar = false;\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n /**\n * Creates a new Observable, with this Observable as the source, and the passed\n * operator defined as the new observable's operator.\n * @method lift\n * @param {Operator} operator the operator defining the operation to take on the observable\n * @return {Observable} a new observable with the Operator applied\n */\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * <span class=\"informal\">Use it when you have all these Observables, but still nothing is happening.</span>\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to a {@link create} static factory, but most of the time it is\n * a library implementation, which defines what and when will be emitted by an Observable. This means that calling\n * `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, that if `error` method is not provided, all errors will\n * be left uncaught.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where first function is equivalent\n * of a `next` method, second of an `error` method and third of a `complete` method. Just as in case of Observer,\n * if you do not need to listen for something, you can omit a function, preferably by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to `error` function, just as before, if not provided, errors emitted by an Observable will be thrown.\n *\n * Whatever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a {@link Scheduler}.\n *\n * @example <caption>Subscribe with an Observer</caption>\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() { // We actually could just remove this method,\n * }, // since we do not really care about errors right now.\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * Rx.Observable.of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // \"Adding: 1\"\n * // \"Adding: 2\"\n * // \"Adding: 3\"\n * // \"Sum equals: 6\"\n *\n *\n * @example <caption>Subscribe with functions</caption>\n * let sum = 0;\n *\n * Rx.Observable.of(1, 2, 3)\n * .subscribe(\n * function(value) {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * function() {\n * console.log('Sum equals: ' + sum);\n * }\n * );\n *\n * // Logs:\n * // \"Adding: 1\"\n * // \"Adding: 2\"\n * // \"Adding: 3\"\n * // \"Sum equals: 6\"\n *\n *\n * @example <caption>Cancel a subscription</caption>\n * const subscription = Rx.Observable.interval(1000).subscribe(\n * num => console.log(num),\n * undefined,\n * () => console.log('completed!') // Will not be called, even\n * ); // when cancelling subscription\n *\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // \"unsubscribed!\" after 2.5s\n *\n *\n * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,\n * or the first of three possible handlers, which is the handler for each value emitted from the subscribed\n * Observable.\n * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown as unhandled.\n * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.\n * @return {ISubscription} a subscription reference to the registered handlers\n * @method subscribe\n */\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var operator = this.operator;\n var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete);\n if (operator) {\n operator.call(sink, this.source);\n }\n else {\n sink.add(this.source ? this._subscribe(sink) : this._trySubscribe(sink));\n }\n if (sink.syncErrorThrowable) {\n sink.syncErrorThrowable = false;\n if (sink.syncErrorThrown) {\n throw sink.syncErrorValue;\n }\n }\n return sink;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.syncErrorThrown = true;\n sink.syncErrorValue = err;\n sink.error(err);\n }\n };\n /**\n * @method forEach\n * @param {Function} next a handler for each value emitted by the observable\n * @param {PromiseConstructor} [PromiseCtor] a constructor function used to instantiate the Promise\n * @return {Promise} a promise that either resolves on observable completion or\n * rejects with the handled error\n */\n Observable.prototype.forEach = function (next, PromiseCtor) {\n var _this = this;\n if (!PromiseCtor) {\n if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) {\n PromiseCtor = root_1.root.Rx.config.Promise;\n }\n else if (root_1.root.Promise) {\n PromiseCtor = root_1.root.Promise;\n }\n }\n if (!PromiseCtor) {\n throw new Error('no Promise impl found');\n }\n return new PromiseCtor(function (resolve, reject) {\n // Must be declared in a separate statement to avoid a RefernceError when\n // accessing subscription below in the closure due to Temporal Dead Zone.\n var subscription;\n subscription = _this.subscribe(function (value) {\n if (subscription) {\n // if there is a subscription, then we can surmise\n // the next handling is asynchronous. Any errors thrown\n // need to be rejected explicitly and unsubscribe must be\n // called manually\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscription.unsubscribe();\n }\n }\n else {\n // if there is NO subscription, then we're getting a nexted\n // value synchronously during subscription. We can just call it.\n // If it errors, Observable's `subscribe` will ensure the\n // unsubscription logic is called, then synchronously rethrow the error.\n // After that, Promise will trap the error and send it\n // down the rejection path.\n next(value);\n }\n }, reject, resolve);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n return this.source.subscribe(subscriber);\n };\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @method Symbol.observable\n * @return {Observable} this instance of the observable\n */\n Observable.prototype[observable_1.observable] = function () {\n return this;\n };\n /* tslint:enable:max-line-length */\n /**\n * Used to stitch together functional operators into a chain.\n * @method pipe\n * @return {Observable} the Observable result of all of the operators having\n * been called in the order they were passed in.\n *\n * @example\n *\n * import { map, filter, scan } from 'rxjs/operators';\n *\n * Rx.Observable.interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x))\n */\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i - 0] = arguments[_i];\n }\n if (operations.length === 0) {\n return this;\n }\n return pipe_1.pipeFromArray(operations)(this);\n };\n /* tslint:enable:max-line-length */\n Observable.prototype.toPromise = function (PromiseCtor) {\n var _this = this;\n if (!PromiseCtor) {\n if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) {\n PromiseCtor = root_1.root.Rx.config.Promise;\n }\n else if (root_1.root.Promise) {\n PromiseCtor = root_1.root.Promise;\n }\n }\n if (!PromiseCtor) {\n throw new Error('no Promise impl found');\n }\n return new PromiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new cold Observable by calling the Observable constructor\n * @static true\n * @owner Observable\n * @method create\n * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor\n * @return {Observable} a new cold observable\n */\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexports.Observable = Observable;\n//# sourceMappingURL=Observable.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nvar ObjectUnsubscribedError = (function (_super) {\n __extends(ObjectUnsubscribedError, _super);\n function ObjectUnsubscribedError() {\n var err = _super.call(this, 'object unsubscribed');\n this.name = err.name = 'ObjectUnsubscribedError';\n this.stack = err.stack;\n this.message = err.message;\n }\n return ObjectUnsubscribedError;\n}(Error));\nexports.ObjectUnsubscribedError = ObjectUnsubscribedError;\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscription_1 = require('./Subscription');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar SubjectSubscription = (function (_super) {\n __extends(SubjectSubscription, _super);\n function SubjectSubscription(subject, subscriber) {\n _super.call(this);\n this.subject = subject;\n this.subscriber = subscriber;\n this.closed = false;\n }\n SubjectSubscription.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.closed = true;\n var subject = this.subject;\n var observers = subject.observers;\n this.subject = null;\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n var subscriberIndex = observers.indexOf(this.subscriber);\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n };\n return SubjectSubscription;\n}(Subscription_1.Subscription));\nexports.SubjectSubscription = SubjectSubscription;\n//# sourceMappingURL=SubjectSubscription.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('./Observable');\nvar Subscriber_1 = require('./Subscriber');\nvar Subscription_1 = require('./Subscription');\nvar ObjectUnsubscribedError_1 = require('./util/ObjectUnsubscribedError');\nvar SubjectSubscription_1 = require('./SubjectSubscription');\nvar rxSubscriber_1 = require('./symbol/rxSubscriber');\n/**\n * @class SubjectSubscriber<T>\n */\nvar SubjectSubscriber = (function (_super) {\n __extends(SubjectSubscriber, _super);\n function SubjectSubscriber(destination) {\n _super.call(this, destination);\n this.destination = destination;\n }\n return SubjectSubscriber;\n}(Subscriber_1.Subscriber));\nexports.SubjectSubscriber = SubjectSubscriber;\n/**\n * @class Subject<T>\n */\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n _super.call(this);\n this.observers = [];\n this.closed = false;\n this.isStopped = false;\n this.hasError = false;\n this.thrownError = null;\n }\n Subject.prototype[rxSubscriber_1.rxSubscriber] = function () {\n return new SubjectSubscriber(this);\n };\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype.next = function (value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n };\n Subject.prototype.error = function (err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n };\n Subject.prototype.complete = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n };\n Subject.prototype._trySubscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else {\n return _super.prototype._trySubscribe.call(this, subscriber);\n }\n };\n Subject.prototype._subscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription_1.Subscription.EMPTY;\n }\n else if (this.isStopped) {\n subscriber.complete();\n return Subscription_1.Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n return new SubjectSubscription_1.SubjectSubscription(this, subscriber);\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable_1.Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable_1.Observable));\nexports.Subject = Subject;\n/**\n * @class AnonymousSubject<T>\n */\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n _super.call(this);\n this.destination = destination;\n this.source = source;\n }\n AnonymousSubject.prototype.next = function (value) {\n var destination = this.destination;\n if (destination && destination.next) {\n destination.next(value);\n }\n };\n AnonymousSubject.prototype.error = function (err) {\n var destination = this.destination;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n };\n AnonymousSubject.prototype.complete = function () {\n var destination = this.destination;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var source = this.source;\n if (source) {\n return this.source.subscribe(subscriber);\n }\n else {\n return Subscription_1.Subscription.EMPTY;\n }\n };\n return AnonymousSubject;\n}(Subject));\nexports.AnonymousSubject = AnonymousSubject;\n//# sourceMappingURL=Subject.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * <span class=\"informal\">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.</span>\n *\n * <img src=\"./img/map.png\" width=\"100%\">\n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * @example <caption>Map every click to the clientX position of that click</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var positions = clicks.map(ev => ev.clientX);\n * positions.subscribe(x => console.log(x));\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable<R>} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nfunction map(project, thisArg) {\n return function mapOperation(source) {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}\nexports.map = map;\nvar MapOperator = (function () {\n function MapOperator(project, thisArg) {\n this.project = project;\n this.thisArg = thisArg;\n }\n MapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n };\n return MapOperator;\n}());\nexports.MapOperator = MapOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar MapSubscriber = (function (_super) {\n __extends(MapSubscriber, _super);\n function MapSubscriber(destination, project, thisArg) {\n _super.call(this, destination);\n this.project = project;\n this.count = 0;\n this.thisArg = thisArg || this;\n }\n // NOTE: This looks unoptimized, but it's actually purposefully NOT\n // using try/catch optimizations.\n MapSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return MapSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=map.js.map","\"use strict\";\nvar map_1 = require('../operators/map');\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * <span class=\"informal\">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.</span>\n *\n * <img src=\"./img/map.png\" width=\"100%\">\n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * @example <caption>Map every click to the clientX position of that click</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var positions = clicks.map(ev => ev.clientX);\n * positions.subscribe(x => console.log(x));\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable<R>} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nfunction map(project, thisArg) {\n return map_1.map(project, thisArg)(this);\n}\nexports.map = map;\n//# sourceMappingURL=map.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('./Subscriber');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar OuterSubscriber = (function (_super) {\n __extends(OuterSubscriber, _super);\n function OuterSubscriber() {\n _super.apply(this, arguments);\n }\n OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n OuterSubscriber.prototype.notifyError = function (error, innerSub) {\n this.destination.error(error);\n };\n OuterSubscriber.prototype.notifyComplete = function (innerSub) {\n this.destination.complete();\n };\n return OuterSubscriber;\n}(Subscriber_1.Subscriber));\nexports.OuterSubscriber = OuterSubscriber;\n//# sourceMappingURL=OuterSubscriber.js.map","\"use strict\";\nexports.isArrayLike = (function (x) { return x && typeof x.length === 'number'; });\n//# sourceMappingURL=isArrayLike.js.map","\"use strict\";\nfunction isPromise(value) {\n return value && typeof value.subscribe !== 'function' && typeof value.then === 'function';\n}\nexports.isPromise = isPromise;\n//# sourceMappingURL=isPromise.js.map","\"use strict\";\nvar root_1 = require('../util/root');\nfunction symbolIteratorPonyfill(root) {\n var Symbol = root.Symbol;\n if (typeof Symbol === 'function') {\n if (!Symbol.iterator) {\n Symbol.iterator = Symbol('iterator polyfill');\n }\n return Symbol.iterator;\n }\n else {\n // [for Mozilla Gecko 27-35:](https://mzl.la/2ewE1zC)\n var Set_1 = root.Set;\n if (Set_1 && typeof new Set_1()['@@iterator'] === 'function') {\n return '@@iterator';\n }\n var Map_1 = root.Map;\n // required for compatability with es6-shim\n if (Map_1) {\n var keys = Object.getOwnPropertyNames(Map_1.prototype);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n // according to spec, Map.prototype[@@iterator] and Map.orototype.entries must be equal.\n if (key !== 'entries' && key !== 'size' && Map_1.prototype[key] === Map_1.prototype['entries']) {\n return key;\n }\n }\n }\n return '@@iterator';\n }\n}\nexports.symbolIteratorPonyfill = symbolIteratorPonyfill;\nexports.iterator = symbolIteratorPonyfill(root_1.root);\n/**\n * @deprecated use iterator instead\n */\nexports.$$iterator = exports.iterator;\n//# sourceMappingURL=iterator.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('./Subscriber');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar InnerSubscriber = (function (_super) {\n __extends(InnerSubscriber, _super);\n function InnerSubscriber(parent, outerValue, outerIndex) {\n _super.call(this);\n this.parent = parent;\n this.outerValue = outerValue;\n this.outerIndex = outerIndex;\n this.index = 0;\n }\n InnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n };\n InnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n };\n InnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return InnerSubscriber;\n}(Subscriber_1.Subscriber));\nexports.InnerSubscriber = InnerSubscriber;\n//# sourceMappingURL=InnerSubscriber.js.map","\"use strict\";\nvar root_1 = require('./root');\nvar isArrayLike_1 = require('./isArrayLike');\nvar isPromise_1 = require('./isPromise');\nvar isObject_1 = require('./isObject');\nvar Observable_1 = require('../Observable');\nvar iterator_1 = require('../symbol/iterator');\nvar InnerSubscriber_1 = require('../InnerSubscriber');\nvar observable_1 = require('../symbol/observable');\nfunction subscribeToResult(outerSubscriber, result, outerValue, outerIndex) {\n var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex);\n if (destination.closed) {\n return null;\n }\n if (result instanceof Observable_1.Observable) {\n if (result._isScalar) {\n destination.next(result.value);\n destination.complete();\n return null;\n }\n else {\n destination.syncErrorThrowable = true;\n return result.subscribe(destination);\n }\n }\n else if (isArrayLike_1.isArrayLike(result)) {\n for (var i = 0, len = result.length; i < len && !destination.closed; i++) {\n destination.next(result[i]);\n }\n if (!destination.closed) {\n destination.complete();\n }\n }\n else if (isPromise_1.isPromise(result)) {\n result.then(function (value) {\n if (!destination.closed) {\n destination.next(value);\n destination.complete();\n }\n }, function (err) { return destination.error(err); })\n .then(null, function (err) {\n // Escaping the Promise trap: globally throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n return destination;\n }\n else if (result && typeof result[iterator_1.iterator] === 'function') {\n var iterator = result[iterator_1.iterator]();\n do {\n var item = iterator.next();\n if (item.done) {\n destination.complete();\n break;\n }\n destination.next(item.value);\n if (destination.closed) {\n break;\n }\n } while (true);\n }\n else if (result && typeof result[observable_1.observable] === 'function') {\n var obs = result[observable_1.observable]();\n if (typeof obs.subscribe !== 'function') {\n destination.error(new TypeError('Provided object does not correctly implement Symbol.observable'));\n }\n else {\n return obs.subscribe(new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex));\n }\n }\n else {\n var value = isObject_1.isObject(result) ? 'an invalid object' : \"'\" + result + \"'\";\n var msg = (\"You provided \" + value + \" where a stream was expected.\")\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n destination.error(new TypeError(msg));\n }\n return null;\n}\nexports.subscribeToResult = subscribeToResult;\n//# sourceMappingURL=subscribeToResult.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar OuterSubscriber_1 = require('../OuterSubscriber');\nvar subscribeToResult_1 = require('../util/subscribeToResult');\n/* tslint:enable:max-line-length */\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, emitting values only from the most recently projected Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link switch}.</span>\n *\n * <img src=\"./img/switchMap.png\" width=\"100%\">\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each time it observes one of these\n * inner Observables, the output Observable begins emitting the items emitted by\n * that inner Observable. When a new inner Observable is emitted, `switchMap`\n * stops emitting items from the earlier-emitted inner Observable and begins\n * emitting items from the new one. It continues to behave like this for\n * subsequent inner Observables.\n *\n * @example <caption>Rerun an interval Observable on every click event</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.switchMap((ev) => Rx.Observable.interval(1000));\n * result.subscribe(x => console.log(x));\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switch}\n * @see {@link switchMapTo}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]\n * A function to produce the value on the output Observable based on the values\n * and the indices of the source (outer) emission and the inner Observable\n * emission. The arguments passed to this function are:\n * - `outerValue`: the value that came from the source\n * - `innerValue`: the value that came from the projected Observable\n * - `outerIndex`: the \"index\" of the value that came from the source\n * - `innerIndex`: the \"index\" of the value from the projected Observable\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional `resultSelector`) to each item emitted\n * by the source Observable and taking only the values from the most recently\n * projected inner Observable.\n * @method switchMap\n * @owner Observable\n */\nfunction switchMap(project, resultSelector) {\n return function switchMapOperatorFunction(source) {\n return source.lift(new SwitchMapOperator(project, resultSelector));\n };\n}\nexports.switchMap = switchMap;\nvar SwitchMapOperator = (function () {\n function SwitchMapOperator(project, resultSelector) {\n this.project = project;\n this.resultSelector = resultSelector;\n }\n SwitchMapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new SwitchMapSubscriber(subscriber, this.project, this.resultSelector));\n };\n return SwitchMapOperator;\n}());\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar SwitchMapSubscriber = (function (_super) {\n __extends(SwitchMapSubscriber, _super);\n function SwitchMapSubscriber(destination, project, resultSelector) {\n _super.call(this, destination);\n this.project = project;\n this.resultSelector = resultSelector;\n this.index = 0;\n }\n SwitchMapSubscriber.prototype._next = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (error) {\n this.destination.error(error);\n return;\n }\n this._innerSub(result, value, index);\n };\n SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {\n var innerSubscription = this.innerSubscription;\n if (innerSubscription) {\n innerSubscription.unsubscribe();\n }\n this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, result, value, index));\n };\n SwitchMapSubscriber.prototype._complete = function () {\n var innerSubscription = this.innerSubscription;\n if (!innerSubscription || innerSubscription.closed) {\n _super.prototype._complete.call(this);\n }\n };\n SwitchMapSubscriber.prototype._unsubscribe = function () {\n this.innerSubscription = null;\n };\n SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {\n this.remove(innerSub);\n this.innerSubscription = null;\n if (this.isStopped) {\n _super.prototype._complete.call(this);\n }\n };\n SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n if (this.resultSelector) {\n this._tryNotifyNext(outerValue, innerValue, outerIndex, innerIndex);\n }\n else {\n this.destination.next(innerValue);\n }\n };\n SwitchMapSubscriber.prototype._tryNotifyNext = function (outerValue, innerValue, outerIndex, innerIndex) {\n var result;\n try {\n result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return SwitchMapSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\n//# sourceMappingURL=switchMap.js.map","\"use strict\";\nvar switchMap_1 = require('../operators/switchMap');\n/* tslint:enable:max-line-length */\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, emitting values only from the most recently projected Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link switch}.</span>\n *\n * <img src=\"./img/switchMap.png\" width=\"100%\">\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each time it observes one of these\n * inner Observables, the output Observable begins emitting the items emitted by\n * that inner Observable. When a new inner Observable is emitted, `switchMap`\n * stops emitting items from the earlier-emitted inner Observable and begins\n * emitting items from the new one. It continues to behave like this for\n * subsequent inner Observables.\n *\n * @example <caption>Rerun an interval Observable on every click event</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.switchMap((ev) => Rx.Observable.interval(1000));\n * result.subscribe(x => console.log(x));\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switch}\n * @see {@link switchMapTo}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]\n * A function to produce the value on the output Observable based on the values\n * and the indices of the source (outer) emission and the inner Observable\n * emission. The arguments passed to this function are:\n * - `outerValue`: the value that came from the source\n * - `innerValue`: the value that came from the projected Observable\n * - `outerIndex`: the \"index\" of the value that came from the source\n * - `innerIndex`: the \"index\" of the value from the projected Observable\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional `resultSelector`) to each item emitted\n * by the source Observable and taking only the values from the most recently\n * projected inner Observable.\n * @method switchMap\n * @owner Observable\n */\nfunction switchMap(project, resultSelector) {\n return switchMap_1.switchMap(project, resultSelector)(this);\n}\nexports.switchMap = switchMap;\n//# sourceMappingURL=switchMap.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ScalarObservable = (function (_super) {\n __extends(ScalarObservable, _super);\n function ScalarObservable(value, scheduler) {\n _super.call(this);\n this.value = value;\n this.scheduler = scheduler;\n this._isScalar = true;\n if (scheduler) {\n this._isScalar = false;\n }\n }\n ScalarObservable.create = function (value, scheduler) {\n return new ScalarObservable(value, scheduler);\n };\n ScalarObservable.dispatch = function (state) {\n var done = state.done, value = state.value, subscriber = state.subscriber;\n if (done) {\n subscriber.complete();\n return;\n }\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n state.done = true;\n this.schedule(state);\n };\n ScalarObservable.prototype._subscribe = function (subscriber) {\n var value = this.value;\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(ScalarObservable.dispatch, 0, {\n done: false, value: value, subscriber: subscriber\n });\n }\n else {\n subscriber.next(value);\n if (!subscriber.closed) {\n subscriber.complete();\n }\n }\n };\n return ScalarObservable;\n}(Observable_1.Observable));\nexports.ScalarObservable = ScalarObservable;\n//# sourceMappingURL=ScalarObservable.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar EmptyObservable = (function (_super) {\n __extends(EmptyObservable, _super);\n function EmptyObservable(scheduler) {\n _super.call(this);\n this.scheduler = scheduler;\n }\n /**\n * Creates an Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * <span class=\"informal\">Just emits 'complete', and nothing else.\n * </span>\n *\n * <img src=\"./img/empty.png\" width=\"100%\">\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the complete notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * @example <caption>Emit the number 7, then complete.</caption>\n * var result = Rx.Observable.empty().startWith(7);\n * result.subscribe(x => console.log(x));\n *\n * @example <caption>Map and flatten only odd numbers to the sequence 'a', 'b', 'c'</caption>\n * var interval = Rx.Observable.interval(1000);\n * var result = interval.mergeMap(x =>\n * x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty()\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval eg(0,1,2,3,...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1 print abc\n * // if x % 2 is not equal to 1 nothing will be output\n *\n * @see {@link create}\n * @see {@link never}\n * @see {@link of}\n * @see {@link throw}\n *\n * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling\n * the emission of the complete notification.\n * @return {Observable} An \"empty\" Observable: emits only the complete\n * notification.\n * @static true\n * @name empty\n * @owner Observable\n */\n EmptyObservable.create = function (scheduler) {\n return new EmptyObservable(scheduler);\n };\n EmptyObservable.dispatch = function (arg) {\n var subscriber = arg.subscriber;\n subscriber.complete();\n };\n EmptyObservable.prototype._subscribe = function (subscriber) {\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(EmptyObservable.dispatch, 0, { subscriber: subscriber });\n }\n else {\n subscriber.complete();\n }\n };\n return EmptyObservable;\n}(Observable_1.Observable));\nexports.EmptyObservable = EmptyObservable;\n//# sourceMappingURL=EmptyObservable.js.map","\"use strict\";\nfunction isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}\nexports.isScheduler = isScheduler;\n//# sourceMappingURL=isScheduler.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\nvar ScalarObservable_1 = require('./ScalarObservable');\nvar EmptyObservable_1 = require('./EmptyObservable');\nvar isScheduler_1 = require('../util/isScheduler');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ArrayObservable = (function (_super) {\n __extends(ArrayObservable, _super);\n function ArrayObservable(array, scheduler) {\n _super.call(this);\n this.array = array;\n this.scheduler = scheduler;\n if (!scheduler && array.length === 1) {\n this._isScalar = true;\n this.value = array[0];\n }\n }\n ArrayObservable.create = function (array, scheduler) {\n return new ArrayObservable(array, scheduler);\n };\n /**\n * Creates an Observable that emits some values you specify as arguments,\n * immediately one after the other, and then emits a complete notification.\n *\n * <span class=\"informal\">Emits the arguments you provide, then completes.\n * </span>\n *\n * <img src=\"./img/of.png\" width=\"100%\">\n *\n * This static operator is useful for creating a simple Observable that only\n * emits the arguments given, and the complete notification thereafter. It can\n * be used for composing with other Observables, such as with {@link concat}.\n * By default, it uses a `null` IScheduler, which means the `next`\n * notifications are sent synchronously, although with a different IScheduler\n * it is possible to determine when those notifications will be delivered.\n *\n * @example <caption>Emit 10, 20, 30, then 'a', 'b', 'c', then start ticking every second.</caption>\n * var numbers = Rx.Observable.of(10, 20, 30);\n * var letters = Rx.Observable.of('a', 'b', 'c');\n * var interval = Rx.Observable.interval(1000);\n * var result = numbers.concat(letters).concat(interval);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link create}\n * @see {@link empty}\n * @see {@link never}\n * @see {@link throw}\n *\n * @param {...T} values Arguments that represent `next` values to be emitted.\n * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling\n * the emissions of the `next` notifications.\n * @return {Observable<T>} An Observable that emits each given input value.\n * @static true\n * @name of\n * @owner Observable\n */\n ArrayObservable.of = function () {\n var array = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n array[_i - 0] = arguments[_i];\n }\n var scheduler = array[array.length - 1];\n if (isScheduler_1.isScheduler(scheduler)) {\n array.pop();\n }\n else {\n scheduler = null;\n }\n var len = array.length;\n if (len > 1) {\n return new ArrayObservable(array, scheduler);\n }\n else if (len === 1) {\n return new ScalarObservable_1.ScalarObservable(array[0], scheduler);\n }\n else {\n return new EmptyObservable_1.EmptyObservable(scheduler);\n }\n };\n ArrayObservable.dispatch = function (state) {\n var array = state.array, index = state.index, count = state.count, subscriber = state.subscriber;\n if (index >= count) {\n subscriber.complete();\n return;\n }\n subscriber.next(array[index]);\n if (subscriber.closed) {\n return;\n }\n state.index = index + 1;\n this.schedule(state);\n };\n ArrayObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var array = this.array;\n var count = array.length;\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(ArrayObservable.dispatch, 0, {\n array: array, index: index, count: count, subscriber: subscriber\n });\n }\n else {\n for (var i = 0; i < count && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n }\n };\n return ArrayObservable;\n}(Observable_1.Observable));\nexports.ArrayObservable = ArrayObservable;\n//# sourceMappingURL=ArrayObservable.js.map","\"use strict\";\nvar ArrayObservable_1 = require('./ArrayObservable');\nexports.of = ArrayObservable_1.ArrayObservable.of;\n//# sourceMappingURL=of.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar root_1 = require('../util/root');\nvar Observable_1 = require('../Observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar PromiseObservable = (function (_super) {\n __extends(PromiseObservable, _super);\n function PromiseObservable(promise, scheduler) {\n _super.call(this);\n this.promise = promise;\n this.scheduler = scheduler;\n }\n /**\n * Converts a Promise to an Observable.\n *\n * <span class=\"informal\">Returns an Observable that just emits the Promise's\n * resolved value, then completes.</span>\n *\n * Converts an ES2015 Promise or a Promises/A+ spec compliant Promise to an\n * Observable. If the Promise resolves with a value, the output Observable\n * emits that resolved value as a `next`, and then completes. If the Promise\n * is rejected, then the output Observable emits the corresponding Error.\n *\n * @example <caption>Convert the Promise returned by Fetch to an Observable</caption>\n * var result = Rx.Observable.fromPromise(fetch('http://myserver.com/'));\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * @see {@link bindCallback}\n * @see {@link from}\n *\n * @param {PromiseLike<T>} promise The promise to be converted.\n * @param {Scheduler} [scheduler] An optional IScheduler to use for scheduling\n * the delivery of the resolved value (or the rejection).\n * @return {Observable<T>} An Observable which wraps the Promise.\n * @static true\n * @name fromPromise\n * @owner Observable\n */\n PromiseObservable.create = function (promise, scheduler) {\n return new PromiseObservable(promise, scheduler);\n };\n PromiseObservable.prototype._subscribe = function (subscriber) {\n var _this = this;\n var promise = this.promise;\n var scheduler = this.scheduler;\n if (scheduler == null) {\n if (this._isScalar) {\n if (!subscriber.closed) {\n subscriber.next(this.value);\n subscriber.complete();\n }\n }\n else {\n promise.then(function (value) {\n _this.value = value;\n _this._isScalar = true;\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) {\n if (!subscriber.closed) {\n subscriber.error(err);\n }\n })\n .then(null, function (err) {\n // escape the promise trap, throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n }\n }\n else {\n if (this._isScalar) {\n if (!subscriber.closed) {\n return scheduler.schedule(dispatchNext, 0, { value: this.value, subscriber: subscriber });\n }\n }\n else {\n promise.then(function (value) {\n _this.value = value;\n _this._isScalar = true;\n if (!subscriber.closed) {\n subscriber.add(scheduler.schedule(dispatchNext, 0, { value: value, subscriber: subscriber }));\n }\n }, function (err) {\n if (!subscriber.closed) {\n subscriber.add(scheduler.schedule(dispatchError, 0, { err: err, subscriber: subscriber }));\n }\n })\n .then(null, function (err) {\n // escape the promise trap, throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n }\n }\n };\n return PromiseObservable;\n}(Observable_1.Observable));\nexports.PromiseObservable = PromiseObservable;\nfunction dispatchNext(arg) {\n var value = arg.value, subscriber = arg.subscriber;\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n}\nfunction dispatchError(arg) {\n var err = arg.err, subscriber = arg.subscriber;\n if (!subscriber.closed) {\n subscriber.error(err);\n }\n}\n//# sourceMappingURL=PromiseObservable.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar root_1 = require('../util/root');\nvar Observable_1 = require('../Observable');\nvar iterator_1 = require('../symbol/iterator');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar IteratorObservable = (function (_super) {\n __extends(IteratorObservable, _super);\n function IteratorObservable(iterator, scheduler) {\n _super.call(this);\n this.scheduler = scheduler;\n if (iterator == null) {\n throw new Error('iterator cannot be null.');\n }\n this.iterator = getIterator(iterator);\n }\n IteratorObservable.create = function (iterator, scheduler) {\n return new IteratorObservable(iterator, scheduler);\n };\n IteratorObservable.dispatch = function (state) {\n var index = state.index, hasError = state.hasError, iterator = state.iterator, subscriber = state.subscriber;\n if (hasError) {\n subscriber.error(state.error);\n return;\n }\n var result = iterator.next();\n if (result.done) {\n subscriber.complete();\n return;\n }\n subscriber.next(result.value);\n state.index = index + 1;\n if (subscriber.closed) {\n if (typeof iterator.return === 'function') {\n iterator.return();\n }\n return;\n }\n this.schedule(state);\n };\n IteratorObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var _a = this, iterator = _a.iterator, scheduler = _a.scheduler;\n if (scheduler) {\n return scheduler.schedule(IteratorObservable.dispatch, 0, {\n index: index, iterator: iterator, subscriber: subscriber\n });\n }\n else {\n do {\n var result = iterator.next();\n if (result.done) {\n subscriber.complete();\n break;\n }\n else {\n subscriber.next(result.value);\n }\n if (subscriber.closed) {\n if (typeof iterator.return === 'function') {\n iterator.return();\n }\n break;\n }\n } while (true);\n }\n };\n return IteratorObservable;\n}(Observable_1.Observable));\nexports.IteratorObservable = IteratorObservable;\nvar StringIterator = (function () {\n function StringIterator(str, idx, len) {\n if (idx === void 0) { idx = 0; }\n if (len === void 0) { len = str.length; }\n this.str = str;\n this.idx = idx;\n this.len = len;\n }\n StringIterator.prototype[iterator_1.iterator] = function () { return (this); };\n StringIterator.prototype.next = function () {\n return this.idx < this.len ? {\n done: false,\n value: this.str.charAt(this.idx++)\n } : {\n done: true,\n value: undefined\n };\n };\n return StringIterator;\n}());\nvar ArrayIterator = (function () {\n function ArrayIterator(arr, idx, len) {\n if (idx === void 0) { idx = 0; }\n if (len === void 0) { len = toLength(arr); }\n this.arr = arr;\n this.idx = idx;\n this.len = len;\n }\n ArrayIterator.prototype[iterator_1.iterator] = function () { return this; };\n ArrayIterator.prototype.next = function () {\n return this.idx < this.len ? {\n done: false,\n value: this.arr[this.idx++]\n } : {\n done: true,\n value: undefined\n };\n };\n return ArrayIterator;\n}());\nfunction getIterator(obj) {\n var i = obj[iterator_1.iterator];\n if (!i && typeof obj === 'string') {\n return new StringIterator(obj);\n }\n if (!i && obj.length !== undefined) {\n return new ArrayIterator(obj);\n }\n if (!i) {\n throw new TypeError('object is not iterable');\n }\n return obj[iterator_1.iterator]();\n}\nvar maxSafeInteger = Math.pow(2, 53) - 1;\nfunction toLength(o) {\n var len = +o.length;\n if (isNaN(len)) {\n return 0;\n }\n if (len === 0 || !numberIsFinite(len)) {\n return len;\n }\n len = sign(len) * Math.floor(Math.abs(len));\n if (len <= 0) {\n return 0;\n }\n if (len > maxSafeInteger) {\n return maxSafeInteger;\n }\n return len;\n}\nfunction numberIsFinite(value) {\n return typeof value === 'number' && root_1.root.isFinite(value);\n}\nfunction sign(value) {\n var valueAsNumber = +value;\n if (valueAsNumber === 0) {\n return valueAsNumber;\n }\n if (isNaN(valueAsNumber)) {\n return valueAsNumber;\n }\n return valueAsNumber < 0 ? -1 : 1;\n}\n//# sourceMappingURL=IteratorObservable.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\nvar ScalarObservable_1 = require('./ScalarObservable');\nvar EmptyObservable_1 = require('./EmptyObservable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ArrayLikeObservable = (function (_super) {\n __extends(ArrayLikeObservable, _super);\n function ArrayLikeObservable(arrayLike, scheduler) {\n _super.call(this);\n this.arrayLike = arrayLike;\n this.scheduler = scheduler;\n if (!scheduler && arrayLike.length === 1) {\n this._isScalar = true;\n this.value = arrayLike[0];\n }\n }\n ArrayLikeObservable.create = function (arrayLike, scheduler) {\n var length = arrayLike.length;\n if (length === 0) {\n return new EmptyObservable_1.EmptyObservable();\n }\n else if (length === 1) {\n return new ScalarObservable_1.ScalarObservable(arrayLike[0], scheduler);\n }\n else {\n return new ArrayLikeObservable(arrayLike, scheduler);\n }\n };\n ArrayLikeObservable.dispatch = function (state) {\n var arrayLike = state.arrayLike, index = state.index, length = state.length, subscriber = state.subscriber;\n if (subscriber.closed) {\n return;\n }\n if (index >= length) {\n subscriber.complete();\n return;\n }\n subscriber.next(arrayLike[index]);\n state.index = index + 1;\n this.schedule(state);\n };\n ArrayLikeObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var _a = this, arrayLike = _a.arrayLike, scheduler = _a.scheduler;\n var length = arrayLike.length;\n if (scheduler) {\n return scheduler.schedule(ArrayLikeObservable.dispatch, 0, {\n arrayLike: arrayLike, index: index, length: length, subscriber: subscriber\n });\n }\n else {\n for (var i = 0; i < length && !subscriber.closed; i++) {\n subscriber.next(arrayLike[i]);\n }\n subscriber.complete();\n }\n };\n return ArrayLikeObservable;\n}(Observable_1.Observable));\nexports.ArrayLikeObservable = ArrayLikeObservable;\n//# sourceMappingURL=ArrayLikeObservable.js.map","\"use strict\";\nvar Observable_1 = require('./Observable');\n/**\n * Represents a push-based event or value that an {@link Observable} can emit.\n * This class is particularly useful for operators that manage notifications,\n * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and\n * others. Besides wrapping the actual delivered value, it also annotates it\n * with metadata of, for instance, what type of push message it is (`next`,\n * `error`, or `complete`).\n *\n * @see {@link materialize}\n * @see {@link dematerialize}\n * @see {@link observeOn}\n *\n * @class Notification<T>\n */\nvar Notification = (function () {\n function Notification(kind, value, error) {\n this.kind = kind;\n this.value = value;\n this.error = error;\n this.hasValue = kind === 'N';\n }\n /**\n * Delivers to the given `observer` the value wrapped by this Notification.\n * @param {Observer} observer\n * @return\n */\n Notification.prototype.observe = function (observer) {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n };\n /**\n * Given some {@link Observer} callbacks, deliver the value represented by the\n * current Notification to the correctly corresponding callback.\n * @param {function(value: T): void} next An Observer `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n Notification.prototype.do = function (next, error, complete) {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return next && next(this.value);\n case 'E':\n return error && error(this.error);\n case 'C':\n return complete && complete();\n }\n };\n /**\n * Takes an Observer or its individual callback functions, and calls `observe`\n * or `do` methods accordingly.\n * @param {Observer|function(value: T): void} nextOrObserver An Observer or\n * the `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n Notification.prototype.accept = function (nextOrObserver, error, complete) {\n if (nextOrObserver && typeof nextOrObserver.next === 'function') {\n return this.observe(nextOrObserver);\n }\n else {\n return this.do(nextOrObserver, error, complete);\n }\n };\n /**\n * Returns a simple Observable that just delivers the notification represented\n * by this Notification instance.\n * @return {any}\n */\n Notification.prototype.toObservable = function () {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return Observable_1.Observable.of(this.value);\n case 'E':\n return Observable_1.Observable.throw(this.error);\n case 'C':\n return Observable_1.Observable.empty();\n }\n throw new Error('unexpected notification kind value');\n };\n /**\n * A shortcut to create a Notification instance of the type `next` from a\n * given value.\n * @param {T} value The `next` value.\n * @return {Notification<T>} The \"next\" Notification representing the\n * argument.\n */\n Notification.createNext = function (value) {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n };\n /**\n * A shortcut to create a Notification instance of the type `error` from a\n * given error.\n * @param {any} [err] The `error` error.\n * @return {Notification<T>} The \"error\" Notification representing the\n * argument.\n */\n Notification.createError = function (err) {\n return new Notification('E', undefined, err);\n };\n /**\n * A shortcut to create a Notification instance of the type `complete`.\n * @return {Notification<any>} The valueless \"complete\" Notification.\n */\n Notification.createComplete = function () {\n return Notification.completeNotification;\n };\n Notification.completeNotification = new Notification('C');\n Notification.undefinedValueNotification = new Notification('N', undefined);\n return Notification;\n}());\nexports.Notification = Notification;\n//# sourceMappingURL=Notification.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\nvar Notification_1 = require('../Notification');\n/**\n *\n * Re-emits all notifications from source Observable with specified scheduler.\n *\n * <span class=\"informal\">Ensure a specific scheduler is used, from outside of an Observable.</span>\n *\n * `observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule\n * notifications emitted by the source Observable. It might be useful, if you do not have control over\n * internal scheduler of a given Observable, but want to control when its values are emitted nevertheless.\n *\n * Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable,\n * but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal\n * scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits\n * notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`.\n * An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split\n * that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source\n * Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a\n * little bit more, to ensure that they are emitted at expected moments.\n *\n * As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications\n * will be emitted. The main difference between {@link delay} operator and `observeOn` is that `observeOn`\n * will delay all notifications - including error notifications - while `delay` will pass through error\n * from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator\n * for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used\n * for notification emissions in general.\n *\n * @example <caption>Ensure values in subscribe are called just before browser repaint.</caption>\n * const intervals = Rx.Observable.interval(10); // Intervals are scheduled\n * // with async scheduler by default...\n *\n * intervals\n * .observeOn(Rx.Scheduler.animationFrame) // ...but we will observe on animationFrame\n * .subscribe(val => { // scheduler to ensure smooth animation.\n * someDiv.style.height = val + 'px';\n * });\n *\n * @see {@link delay}\n *\n * @param {IScheduler} scheduler Scheduler that will be used to reschedule notifications from source Observable.\n * @param {number} [delay] Number of milliseconds that states with what delay every notification should be rescheduled.\n * @return {Observable<T>} Observable that emits the same notifications as the source Observable,\n * but with provided scheduler.\n *\n * @method observeOn\n * @owner Observable\n */\nfunction observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return function observeOnOperatorFunction(source) {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\nexports.observeOn = observeOn;\nvar ObserveOnOperator = (function () {\n function ObserveOnOperator(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n };\n return ObserveOnOperator;\n}());\nexports.ObserveOnOperator = ObserveOnOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar ObserveOnSubscriber = (function (_super) {\n __extends(ObserveOnSubscriber, _super);\n function ObserveOnSubscriber(destination, scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n _super.call(this, destination);\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnSubscriber.dispatch = function (arg) {\n var notification = arg.notification, destination = arg.destination;\n notification.observe(destination);\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {\n this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));\n };\n ObserveOnSubscriber.prototype._next = function (value) {\n this.scheduleMessage(Notification_1.Notification.createNext(value));\n };\n ObserveOnSubscriber.prototype._error = function (err) {\n this.scheduleMessage(Notification_1.Notification.createError(err));\n };\n ObserveOnSubscriber.prototype._complete = function () {\n this.scheduleMessage(Notification_1.Notification.createComplete());\n };\n return ObserveOnSubscriber;\n}(Subscriber_1.Subscriber));\nexports.ObserveOnSubscriber = ObserveOnSubscriber;\nvar ObserveOnMessage = (function () {\n function ObserveOnMessage(notification, destination) {\n this.notification = notification;\n this.destination = destination;\n }\n return ObserveOnMessage;\n}());\nexports.ObserveOnMessage = ObserveOnMessage;\n//# sourceMappingURL=observeOn.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar isArray_1 = require('../util/isArray');\nvar isArrayLike_1 = require('../util/isArrayLike');\nvar isPromise_1 = require('../util/isPromise');\nvar PromiseObservable_1 = require('./PromiseObservable');\nvar IteratorObservable_1 = require('./IteratorObservable');\nvar ArrayObservable_1 = require('./ArrayObservable');\nvar ArrayLikeObservable_1 = require('./ArrayLikeObservable');\nvar iterator_1 = require('../symbol/iterator');\nvar Observable_1 = require('../Observable');\nvar observeOn_1 = require('../operators/observeOn');\nvar observable_1 = require('../symbol/observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar FromObservable = (function (_super) {\n __extends(FromObservable, _super);\n function FromObservable(ish, scheduler) {\n _super.call(this, null);\n this.ish = ish;\n this.scheduler = scheduler;\n }\n /**\n * Creates an Observable from an Array, an array-like object, a Promise, an\n * iterable object, or an Observable-like object.\n *\n * <span class=\"informal\">Converts almost anything to an Observable.</span>\n *\n * <img src=\"./img/from.png\" width=\"100%\">\n *\n * Convert various other objects and data types into Observables. `from`\n * converts a Promise or an array-like or an\n * [iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable)\n * object into an Observable that emits the items in that promise or array or\n * iterable. A String, in this context, is treated as an array of characters.\n * Observable-like objects (contains a function named with the ES2015 Symbol\n * for Observable) can also be converted through this operator.\n *\n * @example <caption>Converts an array to an Observable</caption>\n * var array = [10, 20, 30];\n * var result = Rx.Observable.from(array);\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // 10 20 30\n *\n * @example <caption>Convert an infinite iterable (from a generator) to an Observable</caption>\n * function* generateDoubles(seed) {\n * var i = seed;\n * while (true) {\n * yield i;\n * i = 2 * i; // double it\n * }\n * }\n *\n * var iterator = generateDoubles(3);\n * var result = Rx.Observable.from(iterator).take(10);\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // 3 6 12 24 48 96 192 384 768 1536\n *\n * @see {@link create}\n * @see {@link fromEvent}\n * @see {@link fromEventPattern}\n * @see {@link fromPromise}\n *\n * @param {ObservableInput<T>} ish A subscribable object, a Promise, an\n * Observable-like, an Array, an iterable or an array-like object to be\n * converted.\n * @param {Scheduler} [scheduler] The scheduler on which to schedule the\n * emissions of values.\n * @return {Observable<T>} The Observable whose values are originally from the\n * input object that was converted.\n * @static true\n * @name from\n * @owner Observable\n */\n FromObservable.create = function (ish, scheduler) {\n if (ish != null) {\n if (typeof ish[observable_1.observable] === 'function') {\n if (ish instanceof Observable_1.Observable && !scheduler) {\n return ish;\n }\n return new FromObservable(ish, scheduler);\n }\n else if (isArray_1.isArray(ish)) {\n return new ArrayObservable_1.ArrayObservable(ish, scheduler);\n }\n else if (isPromise_1.isPromise(ish)) {\n return new PromiseObservable_1.PromiseObservable(ish, scheduler);\n }\n else if (typeof ish[iterator_1.iterator] === 'function' || typeof ish === 'string') {\n return new IteratorObservable_1.IteratorObservable(ish, scheduler);\n }\n else if (isArrayLike_1.isArrayLike(ish)) {\n return new ArrayLikeObservable_1.ArrayLikeObservable(ish, scheduler);\n }\n }\n throw new TypeError((ish !== null && typeof ish || ish) + ' is not observable');\n };\n FromObservable.prototype._subscribe = function (subscriber) {\n var ish = this.ish;\n var scheduler = this.scheduler;\n if (scheduler == null) {\n return ish[observable_1.observable]().subscribe(subscriber);\n }\n else {\n return ish[observable_1.observable]().subscribe(new observeOn_1.ObserveOnSubscriber(subscriber, scheduler, 0));\n }\n };\n return FromObservable;\n}(Observable_1.Observable));\nexports.FromObservable = FromObservable;\n//# sourceMappingURL=FromObservable.js.map","\"use strict\";\nvar FromObservable_1 = require('./FromObservable');\nexports.from = FromObservable_1.FromObservable.create;\n//# sourceMappingURL=from.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\n/* tslint:enable:max-line-length */\n/**\n * Filter items emitted by the source Observable by only emitting those that\n * satisfy a specified predicate.\n *\n * <span class=\"informal\">Like\n * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\n * it only emits a value from the source if it passes a criterion function.</span>\n *\n * <img src=\"./img/filter.png\" width=\"100%\">\n *\n * Similar to the well-known `Array.prototype.filter` method, this operator\n * takes values from the source Observable, passes them through a `predicate`\n * function and only emits those values that yielded `true`.\n *\n * @example <caption>Emit only click events whose target was a DIV element</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var clicksOnDivs = clicks.filter(ev => ev.target.tagName === 'DIV');\n * clicksOnDivs.subscribe(x => console.log(x));\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n * @see {@link ignoreElements}\n * @see {@link partition}\n * @see {@link skip}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted, if `false` the value is not passed to the output\n * Observable. The `index` parameter is the number `i` for the i-th source\n * emission that has happened since the subscription, starting from the number\n * `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of values from the source that were\n * allowed by the `predicate` function.\n * @method filter\n * @owner Observable\n */\nfunction filter(predicate, thisArg) {\n return function filterOperatorFunction(source) {\n return source.lift(new FilterOperator(predicate, thisArg));\n };\n}\nexports.filter = filter;\nvar FilterOperator = (function () {\n function FilterOperator(predicate, thisArg) {\n this.predicate = predicate;\n this.thisArg = thisArg;\n }\n FilterOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));\n };\n return FilterOperator;\n}());\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar FilterSubscriber = (function (_super) {\n __extends(FilterSubscriber, _super);\n function FilterSubscriber(destination, predicate, thisArg) {\n _super.call(this, destination);\n this.predicate = predicate;\n this.thisArg = thisArg;\n this.count = 0;\n }\n // the try catch block below is left specifically for\n // optimization and perf reasons. a tryCatcher is not necessary here.\n FilterSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.predicate.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n if (result) {\n this.destination.next(value);\n }\n };\n return FilterSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=filter.js.map","\"use strict\";\nvar filter_1 = require('../operators/filter');\n/* tslint:enable:max-line-length */\n/**\n * Filter items emitted by the source Observable by only emitting those that\n * satisfy a specified predicate.\n *\n * <span class=\"informal\">Like\n * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),\n * it only emits a value from the source if it passes a criterion function.</span>\n *\n * <img src=\"./img/filter.png\" width=\"100%\">\n *\n * Similar to the well-known `Array.prototype.filter` method, this operator\n * takes values from the source Observable, passes them through a `predicate`\n * function and only emits those values that yielded `true`.\n *\n * @example <caption>Emit only click events whose target was a DIV element</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var clicksOnDivs = clicks.filter(ev => ev.target.tagName === 'DIV');\n * clicksOnDivs.subscribe(x => console.log(x));\n *\n * @see {@link distinct}\n * @see {@link distinctUntilChanged}\n * @see {@link distinctUntilKeyChanged}\n * @see {@link ignoreElements}\n * @see {@link partition}\n * @see {@link skip}\n *\n * @param {function(value: T, index: number): boolean} predicate A function that\n * evaluates each value emitted by the source Observable. If it returns `true`,\n * the value is emitted, if `false` the value is not passed to the output\n * Observable. The `index` parameter is the number `i` for the i-th source\n * emission that has happened since the subscription, starting from the number\n * `0`.\n * @param {any} [thisArg] An optional argument to determine the value of `this`\n * in the `predicate` function.\n * @return {Observable} An Observable of values from the source that were\n * allowed by the `predicate` function.\n * @method filter\n * @owner Observable\n */\nfunction filter(predicate, thisArg) {\n return filter_1.filter(predicate, thisArg)(this);\n}\nexports.filter = filter;\n//# sourceMappingURL=filter.js.map","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport { Observable } from 'rxjs/Observable';\nimport { of as _of } from 'rxjs/observable/of';\nimport { from as _from } from 'rxjs/observable/from';\nimport { filter } from 'rxjs/operator/filter';\n\nexport var ActionsObservable = function (_Observable) {\n _inherits(ActionsObservable, _Observable);\n\n _createClass(ActionsObservable, null, [{\n key: 'of',\n value: function of() {\n return new this(_of.apply(undefined, arguments));\n }\n }, {\n key: 'from',\n value: function from(actions, scheduler) {\n return new this(_from(actions, scheduler));\n }\n }]);\n\n function ActionsObservable(actionsSubject) {\n _classCallCheck(this, ActionsObservable);\n\n var _this = _possibleConstructorReturn(this, (ActionsObservable.__proto__ || Object.getPrototypeOf(ActionsObservable)).call(this));\n\n _this.source = actionsSubject;\n return _this;\n }\n\n _createClass(ActionsObservable, [{\n key: 'lift',\n value: function lift(operator) {\n var observable = new ActionsObservable(this);\n observable.operator = operator;\n return observable;\n }\n }, {\n key: 'ofType',\n value: function ofType() {\n for (var _len = arguments.length, keys = Array(_len), _key = 0; _key < _len; _key++) {\n keys[_key] = arguments[_key];\n }\n\n return filter.call(this, function (_ref) {\n var type = _ref.type;\n\n var len = keys.length;\n if (len === 1) {\n return type === keys[0];\n } else {\n for (var i = 0; i < len; i++) {\n if (keys[i] === type) {\n return true;\n }\n }\n }\n return false;\n });\n }\n }]);\n\n return ActionsObservable;\n}(Observable);","export var EPIC_END = '@@redux-observable/EPIC_END';","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nimport { Subject } from 'rxjs/Subject';\nimport { map } from 'rxjs/operator/map';\nimport { switchMap } from 'rxjs/operator/switchMap';\nimport { ActionsObservable } from './ActionsObservable';\nimport { EPIC_END } from './EPIC_END';\n\nvar defaultAdapter = {\n input: function input(action$) {\n return action$;\n },\n output: function output(action$) {\n return action$;\n }\n};\n\nvar defaultOptions = {\n adapter: defaultAdapter\n};\n\nexport function createEpicMiddleware(epic) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions;\n\n if (typeof epic !== 'function') {\n throw new TypeError('You must provide a root Epic to createEpicMiddleware');\n }\n\n // even though we used default param, we need to merge the defaults\n // inside the options object as well in case they declare only some\n options = _extends({}, defaultOptions, options);\n var input$ = new Subject();\n var action$ = options.adapter.input(new ActionsObservable(input$));\n var epic$ = new Subject();\n var store = void 0;\n\n var epicMiddleware = function epicMiddleware(_store) {\n store = _store;\n\n return function (next) {\n var _context;\n\n (_context = map.call(epic$, function (epic) {\n var output$ = 'dependencies' in options ? epic(action$, store, options.dependencies) : epic(action$, store);\n\n if (!output$) {\n throw new TypeError('Your root Epic \"' + (epic.name || '<anonymous>') + '\" does not return a stream. Double check you\\'re not missing a return statement!');\n }\n\n return output$;\n }), switchMap).call(_context, function (output$) {\n return options.adapter.output(output$);\n }).subscribe(store.dispatch);\n\n // Setup initial root epic\n epic$.next(epic);\n\n return function (action) {\n var result = next(action);\n input$.next(action);\n return result;\n };\n };\n };\n\n epicMiddleware.replaceEpic = function (epic) {\n // gives the previous root Epic a last chance\n // to do some clean up\n store.dispatch({ type: EPIC_END });\n // switches to the new root Epic, synchronously terminating\n // the previous one\n epic$.next(epic);\n };\n\n return epicMiddleware;\n}","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar subscribeToResult_1 = require('../util/subscribeToResult');\nvar OuterSubscriber_1 = require('../OuterSubscriber');\n/* tslint:enable:max-line-length */\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link mergeAll}.</span>\n *\n * <img src=\"./img/mergeMap.png\" width=\"100%\">\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an Observable, and then merging those resulting Observables and\n * emitting the results of this merger.\n *\n * @example <caption>Map and flatten each letter to an Observable ticking every 1 second</caption>\n * var letters = Rx.Observable.of('a', 'b', 'c');\n * var result = letters.mergeMap(x =>\n * Rx.Observable.interval(1000).map(i => x+i)\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // a0\n * // b0\n * // c0\n * // a1\n * // b1\n * // c1\n * // continues to list a,b,c with respective ascending integers\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link merge}\n * @see {@link mergeAll}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]\n * A function to produce the value on the output Observable based on the values\n * and the indices of the source (outer) emission and the inner Observable\n * emission. The arguments passed to this function are:\n * - `outerValue`: the value that came from the source\n * - `innerValue`: the value that came from the projected Observable\n * - `outerIndex`: the \"index\" of the value that came from the source\n * - `innerIndex`: the \"index\" of the value from the projected Observable\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional `resultSelector`) to each item emitted\n * by the source Observable and merging the results of the Observables obtained\n * from this transformation.\n * @method mergeMap\n * @owner Observable\n */\nfunction mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n return function mergeMapOperatorFunction(source) {\n if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n resultSelector = null;\n }\n return source.lift(new MergeMapOperator(project, resultSelector, concurrent));\n };\n}\nexports.mergeMap = mergeMap;\nvar MergeMapOperator = (function () {\n function MergeMapOperator(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n this.project = project;\n this.resultSelector = resultSelector;\n this.concurrent = concurrent;\n }\n MergeMapOperator.prototype.call = function (observer, source) {\n return source.subscribe(new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent));\n };\n return MergeMapOperator;\n}());\nexports.MergeMapOperator = MergeMapOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar MergeMapSubscriber = (function (_super) {\n __extends(MergeMapSubscriber, _super);\n function MergeMapSubscriber(destination, project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n _super.call(this, destination);\n this.project = project;\n this.resultSelector = resultSelector;\n this.concurrent = concurrent;\n this.hasCompleted = false;\n this.buffer = [];\n this.active = 0;\n this.index = 0;\n }\n MergeMapSubscriber.prototype._next = function (value) {\n if (this.active < this.concurrent) {\n this._tryNext(value);\n }\n else {\n this.buffer.push(value);\n }\n };\n MergeMapSubscriber.prototype._tryNext = function (value) {\n var result;\n var index = this.index++;\n try {\n result = this.project(value, index);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.active++;\n this._innerSub(result, value, index);\n };\n MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {\n this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index));\n };\n MergeMapSubscriber.prototype._complete = function () {\n this.hasCompleted = true;\n if (this.active === 0 && this.buffer.length === 0) {\n this.destination.complete();\n }\n };\n MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n if (this.resultSelector) {\n this._notifyResultSelector(outerValue, innerValue, outerIndex, innerIndex);\n }\n else {\n this.destination.next(innerValue);\n }\n };\n MergeMapSubscriber.prototype._notifyResultSelector = function (outerValue, innerValue, outerIndex, innerIndex) {\n var result;\n try {\n result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {\n var buffer = this.buffer;\n this.remove(innerSub);\n this.active--;\n if (buffer.length > 0) {\n this._next(buffer.shift());\n }\n else if (this.active === 0 && this.hasCompleted) {\n this.destination.complete();\n }\n };\n return MergeMapSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\nexports.MergeMapSubscriber = MergeMapSubscriber;\n//# sourceMappingURL=mergeMap.js.map","\"use strict\";\nfunction identity(x) {\n return x;\n}\nexports.identity = identity;\n//# sourceMappingURL=identity.js.map","\"use strict\";\nvar mergeMap_1 = require('./mergeMap');\nvar identity_1 = require('../util/identity');\n/**\n * Converts a higher-order Observable into a first-order Observable which\n * concurrently delivers all values that are emitted on the inner Observables.\n *\n * <span class=\"informal\">Flattens an Observable-of-Observables.</span>\n *\n * <img src=\"./img/mergeAll.png\" width=\"100%\">\n *\n * `mergeAll` subscribes to an Observable that emits Observables, also known as\n * a higher-order Observable. Each time it observes one of these emitted inner\n * Observables, it subscribes to that and delivers all the values from the\n * inner Observable on the output Observable. The output Observable only\n * completes once all inner Observables have completed. Any error delivered by\n * a inner Observable will be immediately emitted on the output Observable.\n *\n * @example <caption>Spawn a new interval Observable for each click event, and blend their outputs as one Observable</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000));\n * var firstOrder = higherOrder.mergeAll();\n * firstOrder.subscribe(x => console.log(x));\n *\n * @example <caption>Count from 0 to 9 every second for each click, but only allow 2 concurrent timers</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000).take(10));\n * var firstOrder = higherOrder.mergeAll(2);\n * firstOrder.subscribe(x => console.log(x));\n *\n * @see {@link combineAll}\n * @see {@link concatAll}\n * @see {@link exhaust}\n * @see {@link merge}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switch}\n * @see {@link zipAll}\n *\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of inner\n * Observables being subscribed to concurrently.\n * @return {Observable} An Observable that emits values coming from all the\n * inner Observables emitted by the source Observable.\n * @method mergeAll\n * @owner Observable\n */\nfunction mergeAll(concurrent) {\n if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }\n return mergeMap_1.mergeMap(identity_1.identity, null, concurrent);\n}\nexports.mergeAll = mergeAll;\n//# sourceMappingURL=mergeAll.js.map","\"use strict\";\nvar Observable_1 = require('../Observable');\nvar ArrayObservable_1 = require('../observable/ArrayObservable');\nvar mergeAll_1 = require('./mergeAll');\nvar isScheduler_1 = require('../util/isScheduler');\n/* tslint:enable:max-line-length */\nfunction merge() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i - 0] = arguments[_i];\n }\n return function (source) { return source.lift.call(mergeStatic.apply(void 0, [source].concat(observables))); };\n}\nexports.merge = merge;\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which concurrently emits all values from every\n * given input Observable.\n *\n * <span class=\"informal\">Flattens multiple Observables together by blending\n * their values into one Observable.</span>\n *\n * <img src=\"./img/merge.png\" width=\"100%\">\n *\n * `merge` subscribes to each given input Observable (as arguments), and simply\n * forwards (without doing any transformation) all the values from all the input\n * Observables to the output Observable. The output Observable only completes\n * once all input Observables have completed. Any error delivered by an input\n * Observable will be immediately emitted on the output Observable.\n *\n * @example <caption>Merge together two Observables: 1s interval and clicks</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var timer = Rx.Observable.interval(1000);\n * var clicksOrTimer = Rx.Observable.merge(clicks, timer);\n * clicksOrTimer.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // timer will emit ascending values, one every second(1000ms) to console\n * // clicks logs MouseEvents to console everytime the \"document\" is clicked\n * // Since the two streams are merged you see these happening\n * // as they occur.\n *\n * @example <caption>Merge together 3 Observables, but only 2 run concurrently</caption>\n * var timer1 = Rx.Observable.interval(1000).take(10);\n * var timer2 = Rx.Observable.interval(2000).take(6);\n * var timer3 = Rx.Observable.interval(500).take(10);\n * var concurrent = 2; // the argument\n * var merged = Rx.Observable.merge(timer1, timer2, timer3, concurrent);\n * merged.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // - First timer1 and timer2 will run concurrently\n * // - timer1 will emit a value every 1000ms for 10 iterations\n * // - timer2 will emit a value every 2000ms for 6 iterations\n * // - after timer1 hits it's max iteration, timer2 will\n * // continue, and timer3 will start to run concurrently with timer2\n * // - when timer2 hits it's max iteration it terminates, and\n * // timer3 will continue to emit a value every 500ms until it is complete\n *\n * @see {@link mergeAll}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n *\n * @param {...ObservableInput} observables Input Observables to merge together.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @param {Scheduler} [scheduler=null] The IScheduler to use for managing\n * concurrency of input Observables.\n * @return {Observable} an Observable that emits items that are the result of\n * every input Observable.\n * @static true\n * @name merge\n * @owner Observable\n */\nfunction mergeStatic() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i - 0] = arguments[_i];\n }\n var concurrent = Number.POSITIVE_INFINITY;\n var scheduler = null;\n var last = observables[observables.length - 1];\n if (isScheduler_1.isScheduler(last)) {\n scheduler = observables.pop();\n if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {\n concurrent = observables.pop();\n }\n }\n else if (typeof last === 'number') {\n concurrent = observables.pop();\n }\n if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable_1.Observable) {\n return observables[0];\n }\n return mergeAll_1.mergeAll(concurrent)(new ArrayObservable_1.ArrayObservable(observables, scheduler));\n}\nexports.mergeStatic = mergeStatic;\n//# sourceMappingURL=merge.js.map","\"use strict\";\nvar merge_1 = require('../operators/merge');\nvar merge_2 = require('../operators/merge');\nexports.mergeStatic = merge_2.mergeStatic;\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which concurrently emits all values from every\n * given input Observable.\n *\n * <span class=\"informal\">Flattens multiple Observables together by blending\n * their values into one Observable.</span>\n *\n * <img src=\"./img/merge.png\" width=\"100%\">\n *\n * `merge` subscribes to each given input Observable (either the source or an\n * Observable given as argument), and simply forwards (without doing any\n * transformation) all the values from all the input Observables to the output\n * Observable. The output Observable only completes once all input Observables\n * have completed. Any error delivered by an input Observable will be immediately\n * emitted on the output Observable.\n *\n * @example <caption>Merge together two Observables: 1s interval and clicks</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var timer = Rx.Observable.interval(1000);\n * var clicksOrTimer = clicks.merge(timer);\n * clicksOrTimer.subscribe(x => console.log(x));\n *\n * @example <caption>Merge together 3 Observables, but only 2 run concurrently</caption>\n * var timer1 = Rx.Observable.interval(1000).take(10);\n * var timer2 = Rx.Observable.interval(2000).take(6);\n * var timer3 = Rx.Observable.interval(500).take(10);\n * var concurrent = 2; // the argument\n * var merged = timer1.merge(timer2, timer3, concurrent);\n * merged.subscribe(x => console.log(x));\n *\n * @see {@link mergeAll}\n * @see {@link mergeMap}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n *\n * @param {ObservableInput} other An input Observable to merge with the source\n * Observable. More than one input Observables may be given as argument.\n * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input\n * Observables being subscribed to concurrently.\n * @param {Scheduler} [scheduler=null] The IScheduler to use for managing\n * concurrency of input Observables.\n * @return {Observable} An Observable that emits items that are the result of\n * every input Observable.\n * @method merge\n * @owner Observable\n */\nfunction merge() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i - 0] = arguments[_i];\n }\n return merge_1.merge.apply(void 0, observables)(this);\n}\nexports.merge = merge;\n//# sourceMappingURL=merge.js.map","\"use strict\";\nvar merge_1 = require('../operator/merge');\nexports.merge = merge_1.mergeStatic;\n//# sourceMappingURL=merge.js.map","function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nimport { merge } from 'rxjs/observable/merge';\n\n/**\n Merges all epics into a single one.\n */\nexport var combineEpics = function combineEpics() {\n for (var _len = arguments.length, epics = Array(_len), _key = 0; _key < _len; _key++) {\n epics[_key] = arguments[_key];\n }\n\n return function () {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge.apply(undefined, _toConsumableArray(epics.map(function (epic) {\n var output$ = epic.apply(undefined, args);\n if (!output$) {\n throw new TypeError('combineEpics: one of the provided Epics \"' + (epic.name || '<anonymous>') + '\" does not return a stream. Double check you\\'re not missing a return statement!');\n }\n return output$;\n })));\n };\n};","\"use strict\";\nvar mergeAll_1 = require('./mergeAll');\n/**\n * Converts a higher-order Observable into a first-order Observable by\n * concatenating the inner Observables in order.\n *\n * <span class=\"informal\">Flattens an Observable-of-Observables by putting one\n * inner Observable after the other.</span>\n *\n * <img src=\"./img/concatAll.png\" width=\"100%\">\n *\n * Joins every Observable emitted by the source (a higher-order Observable), in\n * a serial fashion. It subscribes to each inner Observable only after the\n * previous inner Observable has completed, and merges all of their values into\n * the returned observable.\n *\n * __Warning:__ If the source Observable emits Observables quickly and\n * endlessly, and the inner Observables it emits generally complete slower than\n * the source emits, you can run into memory issues as the incoming Observables\n * collect in an unbounded buffer.\n *\n * Note: `concatAll` is equivalent to `mergeAll` with concurrency parameter set\n * to `1`.\n *\n * @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var higherOrder = clicks.map(ev => Rx.Observable.interval(1000).take(4));\n * var firstOrder = higherOrder.concatAll();\n * firstOrder.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n *\n * @see {@link combineAll}\n * @see {@link concat}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n * @see {@link exhaust}\n * @see {@link mergeAll}\n * @see {@link switch}\n * @see {@link zipAll}\n *\n * @return {Observable} An Observable emitting values from all the inner\n * Observables concatenated.\n * @method concatAll\n * @owner Observable\n */\nfunction concatAll() {\n return mergeAll_1.mergeAll(1);\n}\nexports.concatAll = concatAll;\n//# sourceMappingURL=concatAll.js.map","\"use strict\";\nvar isScheduler_1 = require('../util/isScheduler');\nvar of_1 = require('./of');\nvar from_1 = require('./from');\nvar concatAll_1 = require('../operators/concatAll');\n/* tslint:enable:max-line-length */\n/**\n * Creates an output Observable which sequentially emits all values from given\n * Observable and then moves on to the next.\n *\n * <span class=\"informal\">Concatenates multiple Observables together by\n * sequentially emitting their values, one Observable after the other.</span>\n *\n * <img src=\"./img/concat.png\" width=\"100%\">\n *\n * `concat` joins multiple Observables together, by subscribing to them one at a time and\n * merging their results into the output Observable. You can pass either an array of\n * Observables, or put them directly as arguments. Passing an empty array will result\n * in Observable that completes immediately.\n *\n * `concat` will subscribe to first input Observable and emit all its values, without\n * changing or affecting them in any way. When that Observable completes, it will\n * subscribe to then next Observable passed and, again, emit its values. This will be\n * repeated, until the operator runs out of Observables. When last input Observable completes,\n * `concat` will complete as well. At any given moment only one Observable passed to operator\n * emits values. If you would like to emit values from passed Observables concurrently, check out\n * {@link merge} instead, especially with optional `concurrent` parameter. As a matter of fact,\n * `concat` is an equivalent of `merge` operator with `concurrent` parameter set to `1`.\n *\n * Note that if some input Observable never completes, `concat` will also never complete\n * and Observables following the one that did not complete will never be subscribed. On the other\n * hand, if some Observable simply completes immediately after it is subscribed, it will be\n * invisible for `concat`, which will just move on to the next Observable.\n *\n * If any Observable in chain errors, instead of passing control to the next Observable,\n * `concat` will error immediately as well. Observables that would be subscribed after\n * the one that emitted error, never will.\n *\n * If you pass to `concat` the same Observable many times, its stream of values\n * will be \"replayed\" on every subscription, which means you can repeat given Observable\n * as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious,\n * you can always use {@link repeat}.\n *\n * @example <caption>Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10</caption>\n * var timer = Rx.Observable.interval(1000).take(4);\n * var sequence = Rx.Observable.range(1, 10);\n * var result = Rx.Observable.concat(timer, sequence);\n * result.subscribe(x => console.log(x));\n *\n * // results in:\n * // 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10\n *\n *\n * @example <caption>Concatenate an array of 3 Observables</caption>\n * var timer1 = Rx.Observable.interval(1000).take(10);\n * var timer2 = Rx.Observable.interval(2000).take(6);\n * var timer3 = Rx.Observable.interval(500).take(10);\n * var result = Rx.Observable.concat([timer1, timer2, timer3]); // note that array is passed\n * result.subscribe(x => console.log(x));\n *\n * // results in the following:\n * // (Prints to console sequentially)\n * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9\n * // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5\n * // -500ms-> 0 -500ms-> 1 -500ms-> ... 9\n *\n *\n * @example <caption>Concatenate the same Observable to repeat it</caption>\n * const timer = Rx.Observable.interval(1000).take(2);\n *\n * Rx.Observable.concat(timer, timer) // concating the same Observable!\n * .subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('...and it is done!')\n * );\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 0 after 3s\n * // 1 after 4s\n * // \"...and it is done!\" also after 4s\n *\n * @see {@link concatAll}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n *\n * @param {ObservableInput} input1 An input Observable to concatenate with others.\n * @param {ObservableInput} input2 An input Observable to concatenate with others.\n * More than one input Observables may be given as argument.\n * @param {Scheduler} [scheduler=null] An optional IScheduler to schedule each\n * Observable subscription on.\n * @return {Observable} All values of each passed Observable merged into a\n * single Observable, in order, in serial fashion.\n * @static true\n * @name concat\n * @owner Observable\n */\nfunction concat() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i - 0] = arguments[_i];\n }\n if (observables.length === 1 || (observables.length === 2 && isScheduler_1.isScheduler(observables[1]))) {\n return from_1.from(observables[0]);\n }\n return concatAll_1.concatAll()(of_1.of.apply(void 0, observables));\n}\nexports.concat = concat;\n//# sourceMappingURL=concat.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar concat_1 = require('../../observable/concat');\nObservable_1.Observable.concat = concat_1.concat;\n//# sourceMappingURL=concat.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\nvar EmptyObservable_1 = require('./EmptyObservable');\nvar isArray_1 = require('../util/isArray');\nvar subscribeToResult_1 = require('../util/subscribeToResult');\nvar OuterSubscriber_1 = require('../OuterSubscriber');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ForkJoinObservable = (function (_super) {\n __extends(ForkJoinObservable, _super);\n function ForkJoinObservable(sources, resultSelector) {\n _super.call(this);\n this.sources = sources;\n this.resultSelector = resultSelector;\n }\n /* tslint:enable:max-line-length */\n /**\n * Joins last values emitted by passed Observables.\n *\n * <span class=\"informal\">Wait for Observables to complete and then combine last values they emitted.</span>\n *\n * <img src=\"./img/forkJoin.png\" width=\"100%\">\n *\n * `forkJoin` is an operator that takes any number of Observables which can be passed either as an array\n * or directly as arguments. If no input Observables are provided, resulting stream will complete\n * immediately.\n *\n * `forkJoin` will wait for all passed Observables to complete and then it will emit an array with last\n * values from corresponding Observables. So if you pass `n` Observables to the operator, resulting\n * array will have `n` values, where first value is the last thing emitted by the first Observable,\n * second value is the last thing emitted by the second Observable and so on. That means `forkJoin` will\n * not emit more than once and it will complete after that. If you need to emit combined values not only\n * at the end of lifecycle of passed Observables, but also throughout it, try out {@link combineLatest}\n * or {@link zip} instead.\n *\n * In order for resulting array to have the same length as the number of input Observables, whenever any of\n * that Observables completes without emitting any value, `forkJoin` will complete at that moment as well\n * and it will not emit anything either, even if it already has some last values from other Observables.\n * Conversely, if there is an Observable that never completes, `forkJoin` will never complete as well,\n * unless at any point some other Observable completes without emitting value, which brings us back to\n * the previous case. Overall, in order for `forkJoin` to emit a value, all Observables passed as arguments\n * have to emit something at least once and complete.\n *\n * If any input Observable errors at some point, `forkJoin` will error as well and all other Observables\n * will be immediately unsubscribed.\n *\n * Optionally `forkJoin` accepts project function, that will be called with values which normally\n * would land in emitted array. Whatever is returned by project function, will appear in output\n * Observable instead. This means that default project can be thought of as a function that takes\n * all its arguments and puts them into an array. Note that project function will be called only\n * when output Observable is supposed to emit a result.\n *\n * @example <caption>Use forkJoin with operator emitting immediately</caption>\n * const observable = Rx.Observable.forkJoin(\n * Rx.Observable.of(1, 2, 3, 4),\n * Rx.Observable.of(5, 6, 7, 8)\n * );\n * observable.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('This is how it ends!')\n * );\n *\n * // Logs:\n * // [4, 8]\n * // \"This is how it ends!\"\n *\n *\n * @example <caption>Use forkJoin with operator emitting after some time</caption>\n * const observable = Rx.Observable.forkJoin(\n * Rx.Observable.interval(1000).take(3), // emit 0, 1, 2 every second and complete\n * Rx.Observable.interval(500).take(4) // emit 0, 1, 2, 3 every half a second and complete\n * );\n * observable.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('This is how it ends!')\n * );\n *\n * // Logs:\n * // [2, 3] after 3 seconds\n * // \"This is how it ends!\" immediately after\n *\n *\n * @example <caption>Use forkJoin with project function</caption>\n * const observable = Rx.Observable.forkJoin(\n * Rx.Observable.interval(1000).take(3), // emit 0, 1, 2 every second and complete\n * Rx.Observable.interval(500).take(4), // emit 0, 1, 2, 3 every half a second and complete\n * (n, m) => n + m\n * );\n * observable.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('This is how it ends!')\n * );\n *\n * // Logs:\n * // 5 after 3 seconds\n * // \"This is how it ends!\" immediately after\n *\n * @see {@link combineLatest}\n * @see {@link zip}\n *\n * @param {...SubscribableOrPromise} sources Any number of Observables provided either as an array or as an arguments\n * passed directly to the operator.\n * @param {function} [project] Function that takes values emitted by input Observables and returns value\n * that will appear in resulting Observable instead of default array.\n * @return {Observable} Observable emitting either an array of last values emitted by passed Observables\n * or value from project function.\n * @static true\n * @name forkJoin\n * @owner Observable\n */\n ForkJoinObservable.create = function () {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i - 0] = arguments[_i];\n }\n if (sources === null || arguments.length === 0) {\n return new EmptyObservable_1.EmptyObservable();\n }\n var resultSelector = null;\n if (typeof sources[sources.length - 1] === 'function') {\n resultSelector = sources.pop();\n }\n // if the first and only other argument besides the resultSelector is an array\n // assume it's been called with `forkJoin([obs1, obs2, obs3], resultSelector)`\n if (sources.length === 1 && isArray_1.isArray(sources[0])) {\n sources = sources[0];\n }\n if (sources.length === 0) {\n return new EmptyObservable_1.EmptyObservable();\n }\n return new ForkJoinObservable(sources, resultSelector);\n };\n ForkJoinObservable.prototype._subscribe = function (subscriber) {\n return new ForkJoinSubscriber(subscriber, this.sources, this.resultSelector);\n };\n return ForkJoinObservable;\n}(Observable_1.Observable));\nexports.ForkJoinObservable = ForkJoinObservable;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar ForkJoinSubscriber = (function (_super) {\n __extends(ForkJoinSubscriber, _super);\n function ForkJoinSubscriber(destination, sources, resultSelector) {\n _super.call(this, destination);\n this.sources = sources;\n this.resultSelector = resultSelector;\n this.completed = 0;\n this.haveValues = 0;\n var len = sources.length;\n this.total = len;\n this.values = new Array(len);\n for (var i = 0; i < len; i++) {\n var source = sources[i];\n var innerSubscription = subscribeToResult_1.subscribeToResult(this, source, null, i);\n if (innerSubscription) {\n innerSubscription.outerIndex = i;\n this.add(innerSubscription);\n }\n }\n }\n ForkJoinSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.values[outerIndex] = innerValue;\n if (!innerSub._hasValue) {\n innerSub._hasValue = true;\n this.haveValues++;\n }\n };\n ForkJoinSubscriber.prototype.notifyComplete = function (innerSub) {\n var destination = this.destination;\n var _a = this, haveValues = _a.haveValues, resultSelector = _a.resultSelector, values = _a.values;\n var len = values.length;\n if (!innerSub._hasValue) {\n destination.complete();\n return;\n }\n this.completed++;\n if (this.completed !== len) {\n return;\n }\n if (haveValues === len) {\n var value = resultSelector ? resultSelector.apply(this, values) : values;\n destination.next(value);\n }\n destination.complete();\n };\n return ForkJoinSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\n//# sourceMappingURL=ForkJoinObservable.js.map","\"use strict\";\nvar ForkJoinObservable_1 = require('./ForkJoinObservable');\nexports.forkJoin = ForkJoinObservable_1.ForkJoinObservable.create;\n//# sourceMappingURL=forkJoin.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar forkJoin_1 = require('../../observable/forkJoin');\nObservable_1.Observable.forkJoin = forkJoin_1.forkJoin;\n//# sourceMappingURL=forkJoin.js.map","\"use strict\";\nvar PromiseObservable_1 = require('./PromiseObservable');\nexports.fromPromise = PromiseObservable_1.PromiseObservable.create;\n//# sourceMappingURL=fromPromise.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar fromPromise_1 = require('../../observable/fromPromise');\nObservable_1.Observable.fromPromise = fromPromise_1.fromPromise;\n//# sourceMappingURL=fromPromise.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar OuterSubscriber_1 = require('../OuterSubscriber');\nvar subscribeToResult_1 = require('../util/subscribeToResult');\n/**\n * Catches errors on the observable to be handled by returning a new observable or throwing an error.\n *\n * <img src=\"./img/catch.png\" width=\"100%\">\n *\n * @example <caption>Continues with a different Observable when there's an error</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * \t if (n == 4) {\n * \t throw 'four!';\n * }\n *\t return n;\n * })\n * .catch(err => Observable.of('I', 'II', 'III', 'IV', 'V'))\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, I, II, III, IV, V\n *\n * @example <caption>Retries the caught source Observable again in case of error, similar to retry() operator</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * \t if (n === 4) {\n * \t throw 'four!';\n * }\n * \t return n;\n * })\n * .catch((err, caught) => caught)\n * .take(30)\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, 1, 2, 3, ...\n *\n * @example <caption>Throws a new error when the source Observable throws an error</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * if (n == 4) {\n * throw 'four!';\n * }\n * return n;\n * })\n * .catch(err => {\n * throw 'error in source. Details: ' + err;\n * })\n * .subscribe(\n * x => console.log(x),\n * err => console.log(err)\n * );\n * // 1, 2, 3, error in source. Details: four!\n *\n * @param {function} selector a function that takes as arguments `err`, which is the error, and `caught`, which\n * is the source observable, in case you'd like to \"retry\" that observable by returning it again. Whatever observable\n * is returned by the `selector` will be used to continue the observable chain.\n * @return {Observable} An observable that originates from either the source or the observable returned by the\n * catch `selector` function.\n * @name catchError\n */\nfunction catchError(selector) {\n return function catchErrorOperatorFunction(source) {\n var operator = new CatchOperator(selector);\n var caught = source.lift(operator);\n return (operator.caught = caught);\n };\n}\nexports.catchError = catchError;\nvar CatchOperator = (function () {\n function CatchOperator(selector) {\n this.selector = selector;\n }\n CatchOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));\n };\n return CatchOperator;\n}());\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar CatchSubscriber = (function (_super) {\n __extends(CatchSubscriber, _super);\n function CatchSubscriber(destination, selector, caught) {\n _super.call(this, destination);\n this.selector = selector;\n this.caught = caught;\n }\n // NOTE: overriding `error` instead of `_error` because we don't want\n // to have this flag this subscriber as `isStopped`. We can mimic the\n // behavior of the RetrySubscriber (from the `retry` operator), where\n // we unsubscribe from our source chain, reset our Subscriber flags,\n // then subscribe to the selector result.\n CatchSubscriber.prototype.error = function (err) {\n if (!this.isStopped) {\n var result = void 0;\n try {\n result = this.selector(err, this.caught);\n }\n catch (err2) {\n _super.prototype.error.call(this, err2);\n return;\n }\n this._unsubscribeAndRecycle();\n this.add(subscribeToResult_1.subscribeToResult(this, result));\n }\n };\n return CatchSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\n//# sourceMappingURL=catchError.js.map","\"use strict\";\nvar catchError_1 = require('../operators/catchError');\n/**\n * Catches errors on the observable to be handled by returning a new observable or throwing an error.\n *\n * <img src=\"./img/catch.png\" width=\"100%\">\n *\n * @example <caption>Continues with a different Observable when there's an error</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * \t if (n == 4) {\n * \t throw 'four!';\n * }\n *\t return n;\n * })\n * .catch(err => Observable.of('I', 'II', 'III', 'IV', 'V'))\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, I, II, III, IV, V\n *\n * @example <caption>Retries the caught source Observable again in case of error, similar to retry() operator</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * \t if (n === 4) {\n * \t throw 'four!';\n * }\n * \t return n;\n * })\n * .catch((err, caught) => caught)\n * .take(30)\n * .subscribe(x => console.log(x));\n * // 1, 2, 3, 1, 2, 3, ...\n *\n * @example <caption>Throws a new error when the source Observable throws an error</caption>\n *\n * Observable.of(1, 2, 3, 4, 5)\n * .map(n => {\n * if (n == 4) {\n * throw 'four!';\n * }\n * return n;\n * })\n * .catch(err => {\n * throw 'error in source. Details: ' + err;\n * })\n * .subscribe(\n * x => console.log(x),\n * err => console.log(err)\n * );\n * // 1, 2, 3, error in source. Details: four!\n *\n * @param {function} selector a function that takes as arguments `err`, which is the error, and `caught`, which\n * is the source observable, in case you'd like to \"retry\" that observable by returning it again. Whatever observable\n * is returned by the `selector` will be used to continue the observable chain.\n * @return {Observable} An observable that originates from either the source or the observable returned by the\n * catch `selector` function.\n * @method catch\n * @name catch\n * @owner Observable\n */\nfunction _catch(selector) {\n return catchError_1.catchError(selector)(this);\n}\nexports._catch = _catch;\n//# sourceMappingURL=catch.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar catch_1 = require('../../operator/catch');\nObservable_1.Observable.prototype.catch = catch_1._catch;\nObservable_1.Observable.prototype._catch = catch_1._catch;\n//# sourceMappingURL=catch.js.map","\"use strict\";\nvar mergeMap_1 = require('./mergeMap');\n/* tslint:enable:max-line-length */\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, in a serialized fashion waiting for each one to complete before\n * merging the next.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link concatAll}.</span>\n *\n * <img src=\"./img/concatMap.png\" width=\"100%\">\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each new inner Observable is\n * concatenated with the previous inner Observable.\n *\n * __Warning:__ if source values arrive endlessly and faster than their\n * corresponding inner Observables can complete, it will result in memory issues\n * as inner Observables amass in an unbounded buffer waiting for their turn to\n * be subscribed to.\n *\n * Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set\n * to `1`.\n *\n * @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.concatMap(ev => Rx.Observable.interval(1000).take(4));\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n *\n * @see {@link concat}\n * @see {@link concatAll}\n * @see {@link concatMapTo}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]\n * A function to produce the value on the output Observable based on the values\n * and the indices of the source (outer) emission and the inner Observable\n * emission. The arguments passed to this function are:\n * - `outerValue`: the value that came from the source\n * - `innerValue`: the value that came from the projected Observable\n * - `outerIndex`: the \"index\" of the value that came from the source\n * - `innerIndex`: the \"index\" of the value from the projected Observable\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional `resultSelector`) to each item emitted\n * by the source Observable and taking values from each projected inner\n * Observable sequentially.\n * @method concatMap\n * @owner Observable\n */\nfunction concatMap(project, resultSelector) {\n return mergeMap_1.mergeMap(project, resultSelector, 1);\n}\nexports.concatMap = concatMap;\n//# sourceMappingURL=concatMap.js.map","\"use strict\";\nvar concatMap_1 = require('../operators/concatMap');\n/* tslint:enable:max-line-length */\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable, in a serialized fashion waiting for each one to complete before\n * merging the next.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link concatAll}.</span>\n *\n * <img src=\"./img/concatMap.png\" width=\"100%\">\n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an (so-called \"inner\") Observable. Each new inner Observable is\n * concatenated with the previous inner Observable.\n *\n * __Warning:__ if source values arrive endlessly and faster than their\n * corresponding inner Observables can complete, it will result in memory issues\n * as inner Observables amass in an unbounded buffer waiting for their turn to\n * be subscribed to.\n *\n * Note: `concatMap` is equivalent to `mergeMap` with concurrency parameter set\n * to `1`.\n *\n * @example <caption>For each click event, tick every second from 0 to 3, with no concurrency</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.concatMap(ev => Rx.Observable.interval(1000).take(4));\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // (results are not concurrent)\n * // For every click on the \"document\" it will emit values 0 to 3 spaced\n * // on a 1000ms interval\n * // one click = 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3\n *\n * @see {@link concat}\n * @see {@link concatAll}\n * @see {@link concatMapTo}\n * @see {@link exhaustMap}\n * @see {@link mergeMap}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]\n * A function to produce the value on the output Observable based on the values\n * and the indices of the source (outer) emission and the inner Observable\n * emission. The arguments passed to this function are:\n * - `outerValue`: the value that came from the source\n * - `innerValue`: the value that came from the projected Observable\n * - `outerIndex`: the \"index\" of the value that came from the source\n * - `innerIndex`: the \"index\" of the value from the projected Observable\n * @return {Observable} An Observable that emits the result of applying the\n * projection function (and the optional `resultSelector`) to each item emitted\n * by the source Observable and taking values from each projected inner\n * Observable sequentially.\n * @method concatMap\n * @owner Observable\n */\nfunction concatMap(project, resultSelector) {\n return concatMap_1.concatMap(project, resultSelector)(this);\n}\nexports.concatMap = concatMap;\n//# sourceMappingURL=concatMap.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar concatMap_1 = require('../../operator/concatMap');\nObservable_1.Observable.prototype.concatMap = concatMap_1.concatMap;\n//# sourceMappingURL=concatMap.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscription_1 = require('../Subscription');\n/**\n * A unit of work to be executed in a {@link Scheduler}. An action is typically\n * created from within a Scheduler and an RxJS user does not need to concern\n * themselves about creating and manipulating an Action.\n *\n * ```ts\n * class Action<T> extends Subscription {\n * new (scheduler: Scheduler, work: (state?: T) => void);\n * schedule(state?: T, delay: number = 0): Subscription;\n * }\n * ```\n *\n * @class Action<T>\n */\nvar Action = (function (_super) {\n __extends(Action, _super);\n function Action(scheduler, work) {\n _super.call(this);\n }\n /**\n * Schedules this action on its parent Scheduler for execution. May be passed\n * some context object, `state`. May happen at some point in the future,\n * according to the `delay` parameter, if specified.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler.\n * @return {void}\n */\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n return this;\n };\n return Action;\n}(Subscription_1.Subscription));\nexports.Action = Action;\n//# sourceMappingURL=Action.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar root_1 = require('../util/root');\nvar Action_1 = require('./Action');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar AsyncAction = (function (_super) {\n __extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n _super.call(this, scheduler, work);\n this.scheduler = scheduler;\n this.work = work;\n this.pending = false;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n if (this.closed) {\n return this;\n }\n // Always replace the current state with the new state.\n this.state = state;\n // Set the pending flag indicating that this action has been scheduled, or\n // has recursively rescheduled itself.\n this.pending = true;\n var id = this.id;\n var scheduler = this.scheduler;\n //\n // Important implementation note:\n //\n // Actions only execute once by default, unless rescheduled from within the\n // scheduled callback. This allows us to implement single and repeat\n // actions via the same code path, without adding API surface area, as well\n // as mimic traditional recursion but across asynchronous boundaries.\n //\n // However, JS runtimes and timers distinguish between intervals achieved by\n // serial `setTimeout` calls vs. a single `setInterval` call. An interval of\n // serial `setTimeout` calls can be individually delayed, which delays\n // scheduling the next `setTimeout`, and so on. `setInterval` attempts to\n // guarantee the interval callback will be invoked more precisely to the\n // interval period, regardless of load.\n //\n // Therefore, we use `setInterval` to schedule single and repeat actions.\n // If the action reschedules itself with the same delay, the interval is not\n // canceled. If the action doesn't reschedule, or reschedules with a\n // different delay, the interval will be canceled after scheduled callback\n // execution.\n //\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.delay = delay;\n // If this action has already an async Id, don't request a new one.\n this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n return root_1.root.setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n // If this action is rescheduled with the same delay time, don't clear the interval id.\n if (delay !== null && this.delay === delay && this.pending === false) {\n return id;\n }\n // Otherwise, if the action's delay time is different from the current delay,\n // or the action has been rescheduled before it's executed, clear the interval id\n return root_1.root.clearInterval(id) && undefined || undefined;\n };\n /**\n * Immediately executes this action and the `work` it contains.\n * @return {any}\n */\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n // Dequeue if the action didn't reschedule itself. Don't call\n // unsubscribe(), because the action could reschedule later.\n // For example:\n // ```\n // scheduler.schedule(function doWork(counter) {\n // /* ... I'm a busy worker bee ... */\n // var originalAction = this;\n // /* wait 100ms before rescheduling the action */\n // setTimeout(function () {\n // originalAction.schedule(counter + 1);\n // }, 100);\n // }, 1000);\n // ```\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, delay) {\n var errored = false;\n var errorValue = undefined;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = !!e && e || new Error(e);\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype._unsubscribe = function () {\n var id = this.id;\n var scheduler = this.scheduler;\n var actions = scheduler.actions;\n var index = actions.indexOf(this);\n this.work = null;\n this.state = null;\n this.pending = false;\n this.scheduler = null;\n if (index !== -1) {\n actions.splice(index, 1);\n }\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n };\n return AsyncAction;\n}(Action_1.Action));\nexports.AsyncAction = AsyncAction;\n//# sourceMappingURL=AsyncAction.js.map","\"use strict\";\n/**\n * An execution context and a data structure to order tasks and schedule their\n * execution. Provides a notion of (potentially virtual) time, through the\n * `now()` getter method.\n *\n * Each unit of work in a Scheduler is called an {@link Action}.\n *\n * ```ts\n * class Scheduler {\n * now(): number;\n * schedule(work, delay?, state?): Subscription;\n * }\n * ```\n *\n * @class Scheduler\n */\nvar Scheduler = (function () {\n function Scheduler(SchedulerAction, now) {\n if (now === void 0) { now = Scheduler.now; }\n this.SchedulerAction = SchedulerAction;\n this.now = now;\n }\n /**\n * Schedules a function, `work`, for execution. May happen at some point in\n * the future, according to the `delay` parameter, if specified. May be passed\n * some context object, `state`, which will be passed to the `work` function.\n *\n * The given arguments will be processed an stored as an Action object in a\n * queue of actions.\n *\n * @param {function(state: ?T): ?Subscription} work A function representing a\n * task, or some unit of work to be executed by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler itself.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @return {Subscription} A subscription in order to be able to unsubscribe\n * the scheduled work.\n */\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) { delay = 0; }\n return new this.SchedulerAction(this, work).schedule(state, delay);\n };\n Scheduler.now = Date.now ? Date.now : function () { return +new Date(); };\n return Scheduler;\n}());\nexports.Scheduler = Scheduler;\n//# sourceMappingURL=Scheduler.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Scheduler_1 = require('../Scheduler');\nvar AsyncScheduler = (function (_super) {\n __extends(AsyncScheduler, _super);\n function AsyncScheduler() {\n _super.apply(this, arguments);\n this.actions = [];\n /**\n * A flag to indicate whether the Scheduler is currently executing a batch of\n * queued actions.\n * @type {boolean}\n */\n this.active = false;\n /**\n * An internal ID used to track the latest asynchronous task such as those\n * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and\n * others.\n * @type {any}\n */\n this.scheduled = undefined;\n }\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this.active) {\n actions.push(action);\n return;\n }\n var error;\n this.active = true;\n do {\n if (error = action.execute(action.state, action.delay)) {\n break;\n }\n } while (action = actions.shift()); // exhaust the scheduler queue\n this.active = false;\n if (error) {\n while (action = actions.shift()) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler_1.Scheduler));\nexports.AsyncScheduler = AsyncScheduler;\n//# sourceMappingURL=AsyncScheduler.js.map","\"use strict\";\nvar AsyncAction_1 = require('./AsyncAction');\nvar AsyncScheduler_1 = require('./AsyncScheduler');\n/**\n *\n * Async Scheduler\n *\n * <span class=\"informal\">Schedule task as if you used setTimeout(task, duration)</span>\n *\n * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript\n * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating\n * in intervals.\n *\n * If you just want to \"defer\" task, that is to perform it right after currently\n * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),\n * better choice will be the {@link asap} scheduler.\n *\n * @example <caption>Use async scheduler to delay task</caption>\n * const task = () => console.log('it works!');\n *\n * Rx.Scheduler.async.schedule(task, 2000);\n *\n * // After 2 seconds logs:\n * // \"it works!\"\n *\n *\n * @example <caption>Use async scheduler to repeat task in intervals</caption>\n * function task(state) {\n * console.log(state);\n * this.schedule(state + 1, 1000); // `this` references currently executing Action,\n * // which we reschedule with new state and delay\n * }\n *\n * Rx.Scheduler.async.schedule(task, 3000, 0);\n *\n * // Logs:\n * // 0 after 3s\n * // 1 after 4s\n * // 2 after 5s\n * // 3 after 6s\n *\n * @static true\n * @name async\n * @owner Scheduler\n */\nexports.async = new AsyncScheduler_1.AsyncScheduler(AsyncAction_1.AsyncAction);\n//# sourceMappingURL=async.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\nvar async_1 = require('../scheduler/async');\n/**\n * Emits a value from the source Observable only after a particular time span\n * has passed without another source emission.\n *\n * <span class=\"informal\">It's like {@link delay}, but passes only the most\n * recent value from each burst of emissions.</span>\n *\n * <img src=\"./img/debounceTime.png\" width=\"100%\">\n *\n * `debounceTime` delays values emitted by the source Observable, but drops\n * previous pending delayed emissions if a new value arrives on the source\n * Observable. This operator keeps track of the most recent value from the\n * source Observable, and emits that only when `dueTime` enough time has passed\n * without any other value appearing on the source Observable. If a new value\n * appears before `dueTime` silence occurs, the previous value will be dropped\n * and will not be emitted on the output Observable.\n *\n * This is a rate-limiting operator, because it is impossible for more than one\n * value to be emitted in any time window of duration `dueTime`, but it is also\n * a delay-like operator since output emissions do not occur at the same time as\n * they did on the source Observable. Optionally takes a {@link IScheduler} for\n * managing timers.\n *\n * @example <caption>Emit the most recent click after a burst of clicks</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.debounceTime(1000);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttleTime}\n *\n * @param {number} dueTime The timeout duration in milliseconds (or the time\n * unit determined internally by the optional `scheduler`) for the window of\n * time required to wait for emission silence before emitting the most recent\n * source value.\n * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for\n * managing the timers that handle the timeout for each value.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified `dueTime`, and may drop some values if they occur\n * too frequently.\n * @method debounceTime\n * @owner Observable\n */\nfunction debounceTime(dueTime, scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return function (source) { return source.lift(new DebounceTimeOperator(dueTime, scheduler)); };\n}\nexports.debounceTime = debounceTime;\nvar DebounceTimeOperator = (function () {\n function DebounceTimeOperator(dueTime, scheduler) {\n this.dueTime = dueTime;\n this.scheduler = scheduler;\n }\n DebounceTimeOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));\n };\n return DebounceTimeOperator;\n}());\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar DebounceTimeSubscriber = (function (_super) {\n __extends(DebounceTimeSubscriber, _super);\n function DebounceTimeSubscriber(destination, dueTime, scheduler) {\n _super.call(this, destination);\n this.dueTime = dueTime;\n this.scheduler = scheduler;\n this.debouncedSubscription = null;\n this.lastValue = null;\n this.hasValue = false;\n }\n DebounceTimeSubscriber.prototype._next = function (value) {\n this.clearDebounce();\n this.lastValue = value;\n this.hasValue = true;\n this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));\n };\n DebounceTimeSubscriber.prototype._complete = function () {\n this.debouncedNext();\n this.destination.complete();\n };\n DebounceTimeSubscriber.prototype.debouncedNext = function () {\n this.clearDebounce();\n if (this.hasValue) {\n this.destination.next(this.lastValue);\n this.lastValue = null;\n this.hasValue = false;\n }\n };\n DebounceTimeSubscriber.prototype.clearDebounce = function () {\n var debouncedSubscription = this.debouncedSubscription;\n if (debouncedSubscription !== null) {\n this.remove(debouncedSubscription);\n debouncedSubscription.unsubscribe();\n this.debouncedSubscription = null;\n }\n };\n return DebounceTimeSubscriber;\n}(Subscriber_1.Subscriber));\nfunction dispatchNext(subscriber) {\n subscriber.debouncedNext();\n}\n//# sourceMappingURL=debounceTime.js.map","\"use strict\";\nvar async_1 = require('../scheduler/async');\nvar debounceTime_1 = require('../operators/debounceTime');\n/**\n * Emits a value from the source Observable only after a particular time span\n * has passed without another source emission.\n *\n * <span class=\"informal\">It's like {@link delay}, but passes only the most\n * recent value from each burst of emissions.</span>\n *\n * <img src=\"./img/debounceTime.png\" width=\"100%\">\n *\n * `debounceTime` delays values emitted by the source Observable, but drops\n * previous pending delayed emissions if a new value arrives on the source\n * Observable. This operator keeps track of the most recent value from the\n * source Observable, and emits that only when `dueTime` enough time has passed\n * without any other value appearing on the source Observable. If a new value\n * appears before `dueTime` silence occurs, the previous value will be dropped\n * and will not be emitted on the output Observable.\n *\n * This is a rate-limiting operator, because it is impossible for more than one\n * value to be emitted in any time window of duration `dueTime`, but it is also\n * a delay-like operator since output emissions do not occur at the same time as\n * they did on the source Observable. Optionally takes a {@link IScheduler} for\n * managing timers.\n *\n * @example <caption>Emit the most recent click after a burst of clicks</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.debounceTime(1000);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delay}\n * @see {@link sampleTime}\n * @see {@link throttleTime}\n *\n * @param {number} dueTime The timeout duration in milliseconds (or the time\n * unit determined internally by the optional `scheduler`) for the window of\n * time required to wait for emission silence before emitting the most recent\n * source value.\n * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for\n * managing the timers that handle the timeout for each value.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified `dueTime`, and may drop some values if they occur\n * too frequently.\n * @method debounceTime\n * @owner Observable\n */\nfunction debounceTime(dueTime, scheduler) {\n if (scheduler === void 0) { scheduler = async_1.async; }\n return debounceTime_1.debounceTime(dueTime, scheduler)(this);\n}\nexports.debounceTime = debounceTime;\n//# sourceMappingURL=debounceTime.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar debounceTime_1 = require('../../operator/debounceTime');\nObservable_1.Observable.prototype.debounceTime = debounceTime_1.debounceTime;\n//# sourceMappingURL=debounceTime.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar filter_1 = require('../../operator/filter');\nObservable_1.Observable.prototype.filter = filter_1.filter;\n//# sourceMappingURL=filter.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar map_1 = require('../../operator/map');\nObservable_1.Observable.prototype.map = map_1.map;\n//# sourceMappingURL=map.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\n/**\n * Emits the given constant value on the output Observable every time the source\n * Observable emits a value.\n *\n * <span class=\"informal\">Like {@link map}, but it maps every source value to\n * the same output value every time.</span>\n *\n * <img src=\"./img/mapTo.png\" width=\"100%\">\n *\n * Takes a constant `value` as argument, and emits that whenever the source\n * Observable emits a value. In other words, ignores the actual source value,\n * and simply uses the emission moment to know when to emit the given `value`.\n *\n * @example <caption>Map every click to the string 'Hi'</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var greetings = clicks.mapTo('Hi');\n * greetings.subscribe(x => console.log(x));\n *\n * @see {@link map}\n *\n * @param {any} value The value to map each source value to.\n * @return {Observable} An Observable that emits the given `value` every time\n * the source Observable emits something.\n * @method mapTo\n * @owner Observable\n */\nfunction mapTo(value) {\n return function (source) { return source.lift(new MapToOperator(value)); };\n}\nexports.mapTo = mapTo;\nvar MapToOperator = (function () {\n function MapToOperator(value) {\n this.value = value;\n }\n MapToOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapToSubscriber(subscriber, this.value));\n };\n return MapToOperator;\n}());\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar MapToSubscriber = (function (_super) {\n __extends(MapToSubscriber, _super);\n function MapToSubscriber(destination, value) {\n _super.call(this, destination);\n this.value = value;\n }\n MapToSubscriber.prototype._next = function (x) {\n this.destination.next(this.value);\n };\n return MapToSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=mapTo.js.map","\"use strict\";\nvar mapTo_1 = require('../operators/mapTo');\n/**\n * Emits the given constant value on the output Observable every time the source\n * Observable emits a value.\n *\n * <span class=\"informal\">Like {@link map}, but it maps every source value to\n * the same output value every time.</span>\n *\n * <img src=\"./img/mapTo.png\" width=\"100%\">\n *\n * Takes a constant `value` as argument, and emits that whenever the source\n * Observable emits a value. In other words, ignores the actual source value,\n * and simply uses the emission moment to know when to emit the given `value`.\n *\n * @example <caption>Map every click to the string 'Hi'</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var greetings = clicks.mapTo('Hi');\n * greetings.subscribe(x => console.log(x));\n *\n * @see {@link map}\n *\n * @param {any} value The value to map each source value to.\n * @return {Observable} An Observable that emits the given `value` every time\n * the source Observable emits something.\n * @method mapTo\n * @owner Observable\n */\nfunction mapTo(value) {\n return mapTo_1.mapTo(value)(this);\n}\nexports.mapTo = mapTo;\n//# sourceMappingURL=mapTo.js.map","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar mapTo_1 = require('../../operator/mapTo');\nObservable_1.Observable.prototype.mapTo = mapTo_1.mapTo;\n//# sourceMappingURL=mapTo.js.map","import * as Actions from 'kayenta/actions';\nimport * as Creators from 'kayenta/actions/creators';\nimport { ICanaryConfigUpdateResponse, KayentaAccountType } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { runSelector } from 'kayenta/selectors';\nimport {\n createCanaryConfig,\n deleteCanaryConfig,\n getCanaryConfigById,\n listKayentaAccounts,\n mapStateToConfig,\n updateCanaryConfig,\n} from 'kayenta/service/canaryConfig.service';\nimport { listMetricsServiceMetadata } from 'kayenta/service/metricsServiceMetadata.service';\nimport { Action, MiddlewareAPI } from 'redux';\nimport { combineEpics, createEpicMiddleware, EpicMiddleware } from 'redux-observable';\nimport { Observable } from 'rxjs/Observable';\nimport 'rxjs/add/observable/concat';\nimport 'rxjs/add/observable/forkJoin';\nimport 'rxjs/add/observable/fromPromise';\nimport 'rxjs/add/operator/catch';\nimport 'rxjs/add/operator/concatMap';\nimport 'rxjs/add/operator/debounceTime';\nimport 'rxjs/add/operator/filter';\nimport 'rxjs/add/operator/map';\nimport 'rxjs/add/operator/mapTo';\n\nimport { ReactInjector } from '@spinnaker/core';\n\nimport { getCanaryRun, getMetricSetPair } from '../service/canaryRun.service';\n\nconst typeMatches = (...actions: string[]) => (action: Action & any) => actions.includes(action.type);\n\nconst loadConfigEpic = (action$: Observable<Action & any>) =>\n action$.filter(typeMatches(Actions.LOAD_CONFIG_REQUEST, Actions.SAVE_CONFIG_SUCCESS)).concatMap((action) =>\n Observable.fromPromise(getCanaryConfigById(action.payload.id))\n .map((config) => Creators.loadConfigSuccess({ config }))\n .catch((error) => Observable.of(Creators.loadConfigFailure({ error }))),\n );\n\nconst selectConfigEpic = (action$: Observable<Action & any>) =>\n action$\n .filter(typeMatches(Actions.LOAD_CONFIG_SUCCESS))\n .map((action) => Creators.selectConfig({ config: action.payload.config }));\n\nconst saveConfigEpic = (action$: Observable<Action & any>, store: MiddlewareAPI<ICanaryState>) =>\n action$.filter(typeMatches(Actions.SAVE_CONFIG_REQUEST)).concatMap(() => {\n const config = mapStateToConfig(store.getState());\n let saveAction: PromiseLike<ICanaryConfigUpdateResponse>;\n if (config.isNew) {\n delete config.isNew;\n saveAction = createCanaryConfig(config);\n } else {\n saveAction = updateCanaryConfig(config);\n }\n\n return Observable.fromPromise(saveAction)\n .concatMap(({ canaryConfigId }) =>\n Observable.forkJoin(\n ReactInjector.$state.go('^.configDetail', { id: canaryConfigId, copy: false, new: false }),\n store.getState().data.application.getDataSource('canaryConfigs').refresh(true),\n ).mapTo(Creators.saveConfigSuccess({ id: canaryConfigId })),\n )\n .catch((error: Error) => Observable.of(Creators.saveConfigFailure({ error })));\n });\n\nconst deleteConfigRequestEpic = (action$: Observable<Action & any>, store: MiddlewareAPI<ICanaryState>) =>\n action$.filter(typeMatches(Actions.DELETE_CONFIG_REQUEST)).concatMap(() =>\n Observable.fromPromise(deleteCanaryConfig(store.getState().selectedConfig.config.id))\n .mapTo(Creators.deleteConfigSuccess())\n .catch((error: Error) => Observable.of(Creators.deleteConfigFailure({ error }))),\n );\n\nconst deleteConfigSuccessEpic = (action$: Observable<Action & any>, store: MiddlewareAPI<ICanaryState>) =>\n action$\n .filter(typeMatches(Actions.DELETE_CONFIG_SUCCESS))\n .concatMap(() =>\n Observable.forkJoin(\n ReactInjector.$state.go('^.configDefault'),\n // TODO: handle config summary load failure (in general, not just here).\n store.getState().data.application.getDataSource('canaryConfigs').refresh(true),\n ),\n )\n .mapTo(Creators.closeDeleteConfigModal());\n\nconst loadCanaryRunRequestEpic = (action$: Observable<Action & any>) =>\n action$.filter(typeMatches(Actions.LOAD_RUN_REQUEST)).concatMap((action) =>\n Observable.fromPromise(getCanaryRun(action.payload.configId, action.payload.runId))\n .map((run) => Creators.loadRunSuccess({ run }))\n .catch((error: Error) => Observable.of(Creators.loadRunFailure({ error }))),\n );\n\nconst loadMetricSetPairEpic = (action$: Observable<Action & any>, store: MiddlewareAPI<ICanaryState>) =>\n action$.filter(typeMatches(Actions.LOAD_METRIC_SET_PAIR_REQUEST)).concatMap((action) => {\n const run = runSelector(store.getState());\n return Observable.fromPromise(getMetricSetPair(run.metricSetPairListId, action.payload.pairId))\n .map((metricSetPair) => Creators.loadMetricSetPairSuccess({ metricSetPair }))\n .catch((error: Error) => Observable.of(Creators.loadMetricSetPairFailure({ error })));\n });\n\nconst updatePrometheusMetricDescriptionFilterEpic = (action$: Observable<Action & any>) =>\n action$\n .filter(typeMatches(Actions.UPDATE_PROMETHEUS_METRIC_DESCRIPTOR_FILTER))\n .filter((action) => action.payload.filter && action.payload.filter.length > 2)\n .debounceTime(200 /* milliseconds */)\n .map((action) => {\n return Creators.loadMetricsServiceMetadataRequest({\n filter: action.payload.filter,\n metricsAccountName: action.payload.metricsAccountName,\n });\n });\n\nconst updateStackdriverMetricDescriptionFilterEpic = (\n action$: Observable<Action & any>,\n store: MiddlewareAPI<ICanaryState>,\n) =>\n action$\n .filter(typeMatches(Actions.UPDATE_STACKDRIVER_METRIC_DESCRIPTOR_FILTER))\n .filter((action) => action.payload.filter && action.payload.filter.length > 2)\n .debounceTime(200 /* milliseconds */)\n .map((action) => {\n const [metricsAccountName] = store\n .getState()\n .data.kayentaAccounts.data.filter(\n (account) =>\n account.supportedTypes.includes(KayentaAccountType.MetricsStore) &&\n account.metricsStoreType === 'stackdriver',\n )\n .map((account) => account.name);\n\n return Creators.loadMetricsServiceMetadataRequest({\n filter: action.payload.filter,\n metricsAccountName,\n });\n });\n\nconst updateGraphiteMetricDescriptionFilterEpic = (\n action$: Observable<Action & any>,\n store: MiddlewareAPI<ICanaryState>,\n) =>\n action$\n .filter(typeMatches(Actions.UPDATE_GRAPHITE_METRIC_DESCRIPTOR_FILTER))\n .filter((action) => action.payload.filter && action.payload.filter.length > 2)\n .debounceTime(200 /* milliseconds */)\n .map((action) => {\n const [metricsAccountName] = store\n .getState()\n .data.kayentaAccounts.data.filter(\n (account) => account.supportedTypes.includes(KayentaAccountType.MetricsStore) && account.type === 'graphite',\n )\n .map((account) => account.name);\n\n return Creators.loadMetricsServiceMetadataRequest({\n filter: action.payload.filter,\n metricsAccountName,\n });\n });\n\nconst updateDatadogMetricDescriptionFilterEpic = (\n action$: Observable<Action & any>,\n store: MiddlewareAPI<ICanaryState>,\n) =>\n action$\n .filter(typeMatches(Actions.UPDATE_DATADOG_METRIC_DESCRIPTOR_FILTER))\n .filter((action) => action.payload.filter && action.payload.filter.length > 2)\n .debounceTime(200 /* milliseconds */)\n .map((action) => {\n const [metricsAccountName] = store\n .getState()\n .data.kayentaAccounts.data.filter(\n (account) => account.supportedTypes.includes(KayentaAccountType.MetricsStore) && account.type === 'datadog',\n )\n .map((account) => account.name);\n\n return Creators.loadMetricsServiceMetadataRequest({\n filter: action.payload.filter,\n metricsAccountName,\n });\n });\n\nconst loadMetricsServiceMetadataEpic = (action$: Observable<Action & any>) =>\n action$.filter(typeMatches(Actions.LOAD_METRICS_SERVICE_METADATA_REQUEST)).concatMap((action) => {\n return Observable.fromPromise(listMetricsServiceMetadata(action.payload.filter, action.payload.metricsAccountName))\n .map((data) => Creators.loadMetricsServiceMetadataSuccess({ data }))\n .catch((error: Error) => Observable.of(Creators.loadMetricsServiceMetadataFailure({ error })));\n });\n\nconst loadKayentaAccountsEpic = (action$: Observable<Action & any>) =>\n action$.filter(typeMatches(Actions.LOAD_KAYENTA_ACCOUNTS_REQUEST, Actions.INITIALIZE)).concatMap(() =>\n Observable.fromPromise(listKayentaAccounts())\n .map((accounts) => Creators.loadKayentaAccountsSuccess({ accounts }))\n .catch((error: Error) => Observable.of(Creators.loadKayentaAccountsFailure({ error }))),\n );\n\nconst rootEpic = combineEpics(\n loadConfigEpic,\n selectConfigEpic,\n saveConfigEpic,\n deleteConfigRequestEpic,\n deleteConfigSuccessEpic,\n loadCanaryRunRequestEpic,\n loadMetricSetPairEpic,\n updateGraphiteMetricDescriptionFilterEpic,\n updatePrometheusMetricDescriptionFilterEpic,\n updateStackdriverMetricDescriptionFilterEpic,\n updateDatadogMetricDescriptionFilterEpic,\n loadMetricsServiceMetadataEpic,\n loadKayentaAccountsEpic,\n);\n\nexport const epicMiddleware: EpicMiddleware<Action & any, ICanaryState> = createEpicMiddleware(rootEpic);\n","import { IMetricsServiceMetadata } from 'kayenta/domain/IMetricsServiceMetadata';\n\nimport { REST } from '@spinnaker/core';\n\nexport const listMetricsServiceMetadata = (\n filter?: string,\n metricsAccountName?: string,\n): PromiseLike<IMetricsServiceMetadata[]> =>\n REST('/v2/canaries/metadata/metricsService').query({ filter, metricsAccountName }).get();\n","import { UIView } from '@uirouter/react';\nimport * as React from 'react';\nimport { Provider, Store } from 'react-redux';\nimport { applyMiddleware, createStore } from 'redux';\nimport { logger } from 'redux-logger';\n\nimport { Application } from '@spinnaker/core';\n\nimport { INITIALIZE } from './actions';\nimport { CanarySettings } from './canary.settings';\nimport { ICanaryConfigSummary, IJudge } from './domain';\nimport Styleguide from './layout/styleguide';\nimport { actionInterceptingMiddleware, asyncDispatchMiddleware, epicMiddleware } from './middleware';\nimport { ICanaryState, rootReducer } from './reducers';\n\nexport interface ICanaryProps {\n app: Application;\n}\n\nconst middleware = [epicMiddleware, actionInterceptingMiddleware, asyncDispatchMiddleware];\n\nexport const canaryStore: Store<ICanaryState> = createStore<ICanaryState>(\n rootReducer,\n applyMiddleware(...(CanarySettings.reduxLogger ? [...middleware, logger] : middleware)),\n);\n\nexport default class Canary extends React.Component<ICanaryProps> {\n private readonly store: Store<ICanaryState>;\n\n constructor(props: ICanaryProps) {\n super(props);\n this.store = canaryStore;\n this.initializeAppState(props.app);\n }\n\n public componentWillReceiveProps(nextProps: ICanaryProps) {\n if (this.props.app.name !== nextProps.app.name) {\n this.initializeAppState(nextProps.app);\n }\n }\n\n private initializeAppState(app: Application): void {\n this.store.dispatch({\n type: INITIALIZE,\n state: {\n data: {\n application: app,\n configSummaries: app.getDataSource('canaryConfigs').data as ICanaryConfigSummary[],\n judges: app.getDataSource('canaryJudges').data as IJudge[],\n },\n },\n });\n }\n\n public render() {\n const noWrap = { wrap: false };\n return (\n <Styleguide className=\"kayenta-root vertical\">\n <Provider store={this.store}>\n <div className=\"vertical flex-1\">\n <UIView {...noWrap} name=\"canary\" />\n </div>\n </Provider>\n </Styleguide>\n );\n }\n}\n","import * as Creators from 'kayenta/actions/creators';\nimport * as Actions from 'kayenta/actions/index';\nimport { Action, Dispatch, Middleware, MiddlewareAPI } from 'redux';\n\nimport { ICanaryState } from '../reducers/index';\nimport { buildConfigCopy, buildNewConfig } from '../service/canaryConfig.service';\n\n// TODO: replace the `any` generic passed to MiddlewareAPI with ICanaryState. The Redux typings here are wrong.\n// Should be fixed in this PR: https://github.com/reactjs/redux/pull/2563\nexport const actionInterceptingMiddleware: Middleware = (store: MiddlewareAPI<any>) => (\n next: Dispatch<ICanaryState>,\n) => (action: Action & any) => {\n switch (action.type) {\n case Actions.CREATE_NEW_CONFIG: {\n const newConfig = buildNewConfig(store.getState());\n const newAction = Creators.selectConfig({ config: newConfig });\n return next(newAction);\n }\n\n case Actions.COPY_SELECTED_CONFIG: {\n const copiedConfig = buildConfigCopy(store.getState());\n const newAction = Creators.selectConfig({ config: copiedConfig });\n return next(newAction);\n }\n\n default:\n return next(action);\n }\n};\n","import { Action, Dispatch, Middleware, MiddlewareAPI } from 'redux';\n\nimport { ICanaryState } from '../reducers/index';\n\n/*\n * Middleware for scheduling actions from within reducers.\n * Provides every action with an `asyncDispatch` method.\n * Actions provided to `asyncDispatch` will run after all reducers have completed.\n * TODO: type actions to include `asyncDispatch`.\n * */\n\n// TODO: replace the `any` generic passed to MiddlewareAPI with ICanaryState. The Redux typings here are wrong.\n// Should be fixed in this PR: https://github.com/reactjs/redux/pull/2563\nexport const asyncDispatchMiddleware: Middleware = (store: MiddlewareAPI<any>) => (next: Dispatch<ICanaryState>) => (\n action: Action & any,\n) => {\n let syncActivityFinished = false;\n let actionQueue: Action[] = [];\n\n const flushQueue = () => {\n actionQueue.forEach((a) => store.dispatch(a));\n actionQueue = [];\n };\n\n const asyncDispatch = (a: Action & any) => {\n actionQueue.push(a);\n if (syncActivityFinished) {\n flushQueue();\n }\n };\n\n const nextAction = next({ ...action, asyncDispatch });\n syncActivityFinished = true;\n flushQueue();\n\n return nextAction;\n};\n","import { AsyncRequestState } from 'kayenta/reducers/asyncRequest';\nimport * as React from 'react';\n\nimport { Spinner } from '@spinnaker/core';\n\nexport interface ILoadStatesProps {\n state: AsyncRequestState;\n}\n\n/*\n * Builder for rendering load states. Defaults to standard spinner during\n * `Requesting` state.\n * */\nexport default class LoadStatesBuilder {\n private requesting: JSX.Element;\n private fulfilled: JSX.Element;\n private failed: JSX.Element;\n\n public onRequesting(requesting: JSX.Element): LoadStatesBuilder {\n this.requesting = requesting;\n return this;\n }\n\n public onFulfilled(fulfilled: JSX.Element): LoadStatesBuilder {\n this.fulfilled = fulfilled;\n return this;\n }\n\n public onFailed(failed: JSX.Element): LoadStatesBuilder {\n this.failed = failed;\n return this;\n }\n\n public build(): React.SFC<ILoadStatesProps> {\n return ({ state }: ILoadStatesProps) => {\n switch (state) {\n case AsyncRequestState.Requesting:\n return (\n this.requesting || (\n <div className=\"horizontal center middle spinner-container\">\n <Spinner />\n </div>\n )\n );\n case AsyncRequestState.Fulfilled:\n return this.fulfilled;\n case AsyncRequestState.Failed:\n return this.failed;\n }\n };\n }\n}\n","import * as React from 'react';\nimport { timestamp } from '@spinnaker/core';\n\nexport interface IDateLabelProps {\n dateIso: string;\n}\n\nexport default function FormattedDate({ dateIso }: IDateLabelProps) {\n if (dateIso) {\n return <span>{timestamp(new Date(dateIso).getTime())}</span>;\n } else {\n return <span>N/A</span>;\n }\n}\n","import { UISref } from '@uirouter/react';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { get } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { ICanaryState } from '../reducers/index';\n\ninterface ICopyConfigButtonStateProps {\n disabled: boolean;\n}\n\n/*\n * Button for copying a canary config.\n */\nfunction CopyConfigButton({ disabled }: ICopyConfigButtonStateProps) {\n return (\n <UISref to=\"^.configDetail\" params={{ copy: true }}>\n <button className=\"passive\" disabled={disabled}>\n <i className=\"fa fa-copy\" />\n <span>Copy</span>\n </button>\n </UISref>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState) {\n return {\n disabled:\n get(state.selectedConfig, 'config.isNew') || state.app.disableConfigEdit || CanarySettings.disableConfigEdit,\n };\n}\n\nexport default connect(mapStateToProps)(CopyConfigButton);\n","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport * as Creators from '../actions/creators';\nimport ConfigJsonModal from './configJsonModal';\n\ninterface IOpenConfigJsonModalDispatchProps {\n openConfigJsonModal: () => void;\n}\n\n/*\n * Button for opening the edit config JSON modal.\n */\nfunction OpenConfigJsonModalButton({ openConfigJsonModal }: IOpenConfigJsonModalDispatchProps) {\n return (\n <div>\n <button className=\"passive\" onClick={openConfigJsonModal}>\n <i className=\"far fa-file-code\" />\n <span>JSON</span>\n </button>\n <ConfigJsonModal />\n </div>\n );\n}\n\nfunction mapDispatchToProps(dispatch: (action: Action & any) => void): IOpenConfigJsonModalDispatchProps {\n return {\n openConfigJsonModal: () => dispatch(Creators.openConfigJsonModal()),\n };\n}\n\nexport default connect(null, mapDispatchToProps)(OpenConfigJsonModalButton);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport * as React from 'react';\nimport { Modal } from 'react-bootstrap';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport Styleguide from '../layout/styleguide';\nimport { AsyncRequestState } from '../reducers/asyncRequest';\nimport { ICanaryState } from '../reducers/index';\n\ninterface IDeleteModalDispatchProps {\n closeDeleteConfigModal: () => void;\n deleteConfig: () => void;\n}\n\ninterface IDeleteModalStateProps {\n show: boolean;\n selectedConfigName: string;\n deleteConfigState: AsyncRequestState;\n deleteConfigErrorMessage: string;\n}\n\n/*\n * Modal to confirm canary config deletion.\n */\nfunction DeleteConfigModal({\n show,\n selectedConfigName,\n deleteConfigState,\n deleteConfigErrorMessage,\n closeDeleteConfigModal,\n deleteConfig,\n}: IDeleteModalDispatchProps & IDeleteModalStateProps) {\n return (\n <Modal show={show} onHide={null}>\n <Styleguide>\n <Modal.Header>\n <Modal.Title>Really delete {selectedConfigName}?</Modal.Title>\n </Modal.Header>\n {deleteConfigState === AsyncRequestState.Failed && (\n <Modal.Body>\n {/*TODO: create generic error message component */}\n <span className={classNames('alert', 'alert-danger')}>{buildErrorMessage(deleteConfigErrorMessage)}</span>\n </Modal.Body>\n )}\n <Modal.Footer>\n <ul className=\"list-inline pull-right\">\n <li>\n <button className=\"passive\" onClick={closeDeleteConfigModal}>\n Cancel\n </button>\n </li>\n <li>\n <button className=\"primary\" onClick={deleteConfig}>\n Delete\n </button>\n </li>\n </ul>\n </Modal.Footer>\n </Styleguide>\n </Modal>\n );\n}\n\nfunction buildErrorMessage(deleteConfigErrorMessage: string): string {\n const message = 'The was an error deleting your config';\n return deleteConfigErrorMessage ? message + `: ${deleteConfigErrorMessage}.` : message + '.';\n}\n\nfunction mapDispatchToProps(dispatch: (action: Action & any) => void): IDeleteModalDispatchProps {\n return {\n closeDeleteConfigModal: () => dispatch(Creators.closeDeleteConfigModal()),\n deleteConfig: () => dispatch(Creators.deleteConfig()),\n };\n}\n\nfunction mapStateToProps(state: ICanaryState): IDeleteModalStateProps {\n return {\n show: state.app.deleteConfigModalOpen,\n selectedConfigName: state.selectedConfig.config ? state.selectedConfig.config.name : null,\n deleteConfigState: state.selectedConfig.destroy.state,\n deleteConfigErrorMessage: state.selectedConfig.destroy.error,\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(DeleteConfigModal);\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { DISABLE_EDIT_CONFIG, DisableableButton } from 'kayenta/layout/disableable';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport DeleteConfigModal from './deleteModal';\n\ninterface IDeleteButtonStateProps {\n disabled: boolean;\n}\n\ninterface IDeleteButtonDispatchProps {\n openDeleteConfigModal: () => void;\n}\n\n/*\n * Button for opening the delete canary config confirmation modal.\n */\nfunction DeleteConfigButton({ openDeleteConfigModal, disabled }: IDeleteButtonDispatchProps & IDeleteButtonStateProps) {\n return (\n <div>\n <DisableableButton\n className=\"passive\"\n disabled={disabled || CanarySettings.disableConfigEdit}\n onClick={openDeleteConfigModal}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n >\n <i className=\"fa fa-trash\" />\n <span>Delete</span>\n </DisableableButton>\n <DeleteConfigModal />\n </div>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState) {\n return {\n disabled: (state.selectedConfig.config && state.selectedConfig.config.isNew) || CanarySettings.disableConfigEdit,\n };\n}\n\nfunction mapDispatchToProps(dispatch: any): IDeleteButtonDispatchProps {\n return {\n openDeleteConfigModal: () => dispatch(Creators.openDeleteConfigModal()),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(DeleteConfigButton);\n","import * as React from 'react';\n\nimport CopyConfigButton from './copyConfigButton';\nimport OpenEditConfigJsonModalButton from './openConfigJsonModalButton';\nimport OpenDeleteModalButton from './openDeleteModalButton';\n\n/*\n * Layout for canary config action buttons.\n */\nexport default function ConfigDetailActionButtons() {\n return (\n <ul className=\"list-inline pull-right\">\n <li>\n <OpenEditConfigJsonModalButton />\n </li>\n <li>\n <CopyConfigButton />\n </li>\n <li>\n <OpenDeleteModalButton />\n </li>\n </ul>\n );\n}\n","import { UISref } from '@uirouter/react';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryConfig } from 'kayenta/domain';\nimport FormattedDate from 'kayenta/layout/formattedDate';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { mapStateToConfig } from 'kayenta/service/canaryConfig.service';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ConfigDetailActionButtons from './configDetailActionButtons';\n\ninterface IConfigDetailStateProps {\n selectedConfig: ICanaryConfig;\n editingDisabled: boolean;\n disableConfigEdit: boolean;\n}\n\nconst getOwnerAppLinks = (owners: string[]) => {\n if (owners.length === 1) {\n return (\n <UISref to=\".\" params={{ application: owners[0] }}>\n <a>{owners[0]}</a>\n </UISref>\n );\n } else {\n // totally gross to read, but a somewhat-straightforward way of creating\n // a 'one, two, or three' sentence from this array of app names with some JSX in between\n const lastIndex = owners.length - 1;\n return owners.map((owner, index) => (\n <React.Fragment key={owner}>\n {index === lastIndex ? 'or ' : ''}\n <UISref to=\".\" params={{ application: owner }}>\n <a>{owner}</a>\n </UISref>\n {index < lastIndex && owners.length === 2 ? ' ' : ''}\n {index < lastIndex && owners.length > 2 ? ', ' : ''}\n </React.Fragment>\n ));\n }\n};\n\nconst EditingDisabledWarning = ({ owners }: { owners: string[] }) => {\n return (\n <div className=\"horizontal middle well-compact alert alert-warning config-detail-edit-warning\">\n <i className=\"fa fa-exclamation-triangle sp-margin-m-right\" />\n <span>\n <b>\n Editing is disabled because this config is owned by{' '}\n {owners.length > 1 ? `${owners.length} other applications` : 'another application'}.\n </b>{' '}\n To edit, view in {getOwnerAppLinks(owners)}\n </span>\n </div>\n );\n};\n\nconst ConfigEditingDisabledWarning = () => {\n return (\n <div className=\"horizontal middle well-compact alert alert-warning config-detail-edit-warning\">\n <i className=\"fa fa-exclamation-triangle sp-margin-m-right\" />\n <span>\n <b>Canary config is locked and does not allow modification</b>\n </span>\n </div>\n );\n};\n\n/*\n * Config detail header layout.\n */\nfunction ConfigDetailHeader({ selectedConfig, editingDisabled, disableConfigEdit }: IConfigDetailStateProps) {\n return (\n <div className=\"vertical\">\n <div className=\"horizontal config-detail-header\">\n <div className=\"flex-3\">\n <h1 className=\"heading-1 color-text-primary\">{selectedConfig ? selectedConfig.name : ''}</h1>\n </div>\n <div className=\"flex-1\">\n <h5 className=\"heading-5\">\n <strong>Edited:</strong>{' '}\n <FormattedDate dateIso={selectedConfig ? selectedConfig.updatedTimestampIso : ''} />\n </h5>\n </div>\n <div className=\"flex-2\">\n <ConfigDetailActionButtons />\n </div>\n </div>\n {selectedConfig && editingDisabled && !disableConfigEdit && (\n <EditingDisabledWarning owners={selectedConfig.applications} />\n )}\n {selectedConfig && disableConfigEdit && <ConfigEditingDisabledWarning />}\n </div>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IConfigDetailStateProps {\n return {\n selectedConfig: mapStateToConfig(state),\n editingDisabled: state.app.disableConfigEdit,\n disableConfigEdit: CanarySettings.disableConfigEdit,\n };\n}\n\nexport default connect(mapStateToProps)(ConfigDetailHeader);\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryMetricEffectSizeConfig } from 'kayenta/domain';\nimport FormRow from 'kayenta/layout/formRow';\nimport RadioChoice from 'kayenta/layout/radioChoice';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { HelpField, robotToHuman } from '@spinnaker/core';\n\nimport { DISABLE_EDIT_CONFIG, DisableableInput } from '../layout/disableable';\n\ninterface IEditMetricEffectSizesProps {\n metricId: string;\n direction: string;\n disabled: boolean;\n effectSizes: ICanaryMetricEffectSizeConfig;\n}\n\ninterface IEditMetricEffectSizesDispatchProps {\n updateEffectSize: (id: string, value: ICanaryMetricEffectSizeConfig) => void;\n}\n\nexport function EditMetricEffectSizes({\n effectSizes = {},\n updateEffectSize,\n direction,\n metricId,\n disabled,\n}: IEditMetricEffectSizesProps & IEditMetricEffectSizesDispatchProps) {\n const [showEffectSizes, setShowEffectSizes] = React.useState<boolean>(!!Object.keys(effectSizes).length);\n // only allow editing of measurement type if it was set to \"cles\" programmatically\n const [allowEditMeasurementType] = React.useState<boolean>(effectSizes.measure === 'cles');\n\n const description = (\n <p>\n Effect sizes should be used when your canary data produces a lot of metrics that flag as \"high\", but where you\n only want the test to fail if they are sufficiently larger or smaller than the control data.\n </p>\n );\n\n if (!showEffectSizes && disabled) {\n return null;\n }\n\n if (!showEffectSizes) {\n return (\n <FormRow label=\"Effect Sizes\">\n {description}\n <button className=\"passive\" onClick={() => setShowEffectSizes(true)}>\n Configure effect sizes\n </button>\n </FormRow>\n );\n }\n\n const isCles = effectSizes.measure === 'cles';\n const defaultSize = isCles ? 0.5 : 1;\n\n const {\n allowedIncrease = defaultSize,\n criticalIncrease = defaultSize,\n allowedDecrease = defaultSize,\n criticalDecrease = defaultSize,\n measure = 'meanRatio',\n } = effectSizes;\n\n const updateSize = (field: keyof ICanaryMetricEffectSizeConfig, percent: string) => {\n const value = isCles ? Number(percent) : fromPercent(field, percent);\n const newEffectSizes = { ...effectSizes, [field]: value };\n if (value === defaultSize) {\n delete newEffectSizes[field];\n }\n updateEffectSize(metricId, newEffectSizes);\n };\n\n const updateMeasure = (event: React.ChangeEvent<HTMLInputElement>) => {\n updateEffectSize(metricId, { ...effectSizes, measure: event.target.value });\n };\n\n const fromPercent = (field: keyof ICanaryMetricEffectSizeConfig, percent: string) => {\n const size = Number(percent) / 100;\n return field.endsWith('Increase') ? 1 + size : 1 - size;\n };\n\n const toPercent = (value: number, field: keyof ICanaryMetricEffectSizeConfig) => {\n const normalized = field.endsWith('Increase') ? value - 1 : 1 - value;\n return Math.round(normalized * 100);\n };\n\n const clesLabel = (\n <>\n CLES <HelpField id=\"canary.config.effectSize.cles\" />\n </>\n );\n\n const noEffectLabel = (effect: number) => {\n if (effect === defaultSize) {\n return <HelpField expand={true} content=\"(will not affect metric evaluation)\" />;\n }\n return null;\n };\n\n const buildInput = (field: keyof ICanaryMetricEffectSizeConfig, value: number) => (\n <div className=\"form-group flex-1\">\n <label>{robotToHuman(field)}</label>\n <div className=\"row\">\n <div className=\"col-md-4\">\n <div className=\"input-group effect-size-wrapper\">\n <DisableableInput\n className=\"form-control input-sm\"\n type=\"number\"\n min={0}\n step={isCles ? 0.01 : 1}\n onChange={(e) => updateSize(field, e.target.value)}\n value={isCles ? value : toPercent(value, field)}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n {!isCles && <div className=\"input-group-addon\">%</div>}\n </div>\n </div>\n </div>\n {noEffectLabel(value)}\n </div>\n );\n\n return (\n <FormRow label=\"Effect Sizes\">\n {description}\n <div className=\"vertical\" style={{ marginTop: '5px' }}>\n {allowEditMeasurementType && (\n <div className=\"form-group vertical\">\n <label>Measurement Type</label>\n <div>\n <RadioChoice\n value=\"meanRatio\"\n label=\"Mean (default)\"\n name=\"measure\"\n current={measure}\n action={updateMeasure}\n />\n <RadioChoice value=\"cles\" label={clesLabel} name=\"measure\" current={measure} action={updateMeasure} />\n </div>\n </div>\n )}\n <label className=\"sp-margin-m-top\">Allowed Effects</label>\n <p>\n If the canary surpasses the baseline by the supplied (non-zero) percentage, the <em>metric</em> will fail.\n </p>\n <div className=\"horizontal\">\n {direction !== 'increase' && buildInput('allowedDecrease', allowedDecrease)}\n {direction !== 'decrease' && buildInput('allowedIncrease', allowedIncrease)}\n </div>\n <label className=\"sp-margin-m-top\">Critical Effects</label>\n <p>\n If the canary surpasses the baseline by the supplied (non-zero) percentage, the <em>entire analysis</em> will\n fail with a score of 0.\n </p>\n <div className=\"horizontal\">\n {direction !== 'increase' && buildInput('criticalDecrease', criticalDecrease)}\n {direction !== 'decrease' && buildInput('criticalIncrease', criticalIncrease)}\n </div>\n </div>\n </FormRow>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IEditMetricEffectSizesProps {\n return {\n metricId: state.selectedConfig.editingMetric.id,\n direction: state.selectedConfig.editingMetric.analysisConfigurations?.canary?.direction ?? 'either',\n disabled: state.app.disableConfigEdit || CanarySettings.disableConfigEdit,\n effectSizes: state.selectedConfig.editingMetric.analysisConfigurations?.canary?.effectSize ?? {},\n };\n}\n\nfunction mapDispatchToProps(dispatch: any): IEditMetricEffectSizesDispatchProps {\n return {\n updateEffectSize: (id: string, value: ICanaryMetricEffectSizeConfig) =>\n dispatch(Creators.updateEffectSize({ id, value })),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(EditMetricEffectSizes);\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryFilterTemplateValidationMessages } from 'kayenta/edit/filterTemplatesValidation';\nimport {\n DISABLE_EDIT_CONFIG,\n DisableableInput,\n DisableableReactSelect,\n DisableableTextarea,\n} from 'kayenta/layout/disableable';\nimport FormRow from 'kayenta/layout/formRow';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { configTemplatesSelector, editingTemplateSelector } from 'kayenta/selectors';\nimport {\n editingTemplateValidationSelector,\n selectedTemplateNameSelector,\n} from 'kayenta/selectors/filterTemplatesSelectors';\nimport { get, isString } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Option } from 'react-select';\nimport { Dispatch } from 'redux';\n\nimport './filterTemplateSelector.less';\n\ninterface IFilterTemplateSelectorStateProps {\n editedTemplateName: string;\n editedTemplateValue: string;\n selectedTemplateName: string;\n templates: { [key: string]: string };\n validation: ICanaryFilterTemplateValidationMessages;\n}\n\ninterface IFilterTemplateSelectorDispatchProps {\n deleteTemplate: (e: any, name: string) => void;\n editTemplateBegin: (e: any, name: string, value: string) => void;\n editTemplateCancel: () => void;\n editTemplateConfirm: () => void;\n editTemplateName: (event: any) => void;\n editTemplateValue: (event: any) => void;\n selectTemplate: (option: Option) => void;\n}\n\nexport type IFilterTemplateSelectorProps = IFilterTemplateSelectorStateProps & IFilterTemplateSelectorDispatchProps;\n\nexport class FilterTemplateSelector extends React.Component<IFilterTemplateSelectorProps> {\n private getOptions = (): Option[] => {\n const templateOptions = Object.keys(this.props.templates).map((t) => ({\n value: t,\n label: t,\n requestingNew: false,\n }));\n templateOptions.push({ value: null, label: null, requestingNew: true });\n return templateOptions;\n };\n\n private optionRenderer = (option: Option<string>): JSX.Element => {\n if (option.requestingNew) {\n return <span>Create new...</span>;\n }\n return (\n <span className=\"filter-template-option\">\n <span>{option.label}</span>\n <span>\n <button className=\"link\" onMouseDown={(e) => this.props.deleteTemplate(e, option.value)}>\n Delete\n </button>\n <button\n className=\"link\"\n onMouseDown={(e) => this.props.editTemplateBegin(e, option.value, this.props.templates[option.value])}\n >\n Edit\n </button>\n </span>\n </span>\n );\n };\n\n public render() {\n const {\n editedTemplateName,\n editedTemplateValue,\n editTemplateCancel,\n editTemplateConfirm,\n editTemplateName,\n editTemplateValue,\n selectTemplate,\n selectedTemplateName,\n templates,\n validation,\n } = this.props;\n const isEditing = isString(editedTemplateName) && isString(editedTemplateValue);\n return (\n <>\n <FormRow label=\"Filter Template\" helpId=\"canary.config.filterTemplate\" inputOnly={true}>\n {!isEditing && (\n <DisableableReactSelect\n value={selectedTemplateName}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n disabled={CanarySettings.disableConfigEdit}\n onChange={selectTemplate}\n options={this.getOptions()}\n optionRenderer={this.optionRenderer}\n />\n )}\n </FormRow>\n {isEditing && (\n <>\n <FormRow label=\"Name\" error={get(validation, 'errors.templateName.message')} inputOnly={true}>\n <DisableableInput\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n disabled={CanarySettings.disableConfigEdit}\n onChange={editTemplateName}\n value={editedTemplateName}\n />\n </FormRow>\n <FormRow\n label=\"Template\"\n inputOnly={true}\n error={get(validation, 'errors.templateValue.message')}\n warning={get(validation, 'warnings.template.message')}\n >\n <DisableableTextarea\n className=\"template-editor-textarea\"\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n disabled={CanarySettings.disableConfigEdit}\n onChange={editTemplateValue}\n value={editedTemplateValue}\n />\n </FormRow>\n <FormRow>\n <div className=\"horizontal pull-right\">\n <button className=\"link\" onClick={editTemplateCancel}>\n Cancel\n </button>\n <button\n className=\"link\"\n disabled={[validation.errors.templateName, validation.errors.templateValue].some((e) => e != null)}\n onClick={editTemplateConfirm}\n >\n Save\n </button>\n </div>\n </FormRow>\n </>\n )}\n {!isEditing && selectedTemplateName && (\n <FormRow>\n <pre className=\"template-editor-value-formatted\">{templates[selectedTemplateName]}</pre>\n </FormRow>\n )}\n </>\n );\n }\n}\n\nconst mapStateToProps = (state: ICanaryState): IFilterTemplateSelectorStateProps => ({\n editedTemplateName: get(editingTemplateSelector(state), 'editedName'),\n editedTemplateValue: get(editingTemplateSelector(state), 'editedValue'),\n selectedTemplateName: selectedTemplateNameSelector(state),\n templates: configTemplatesSelector(state),\n validation: editingTemplateValidationSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>): IFilterTemplateSelectorDispatchProps => ({\n deleteTemplate: (e: any, name: string) => {\n e.stopPropagation();\n dispatch(Creators.selectTemplate({ name: null }));\n dispatch(Creators.deleteTemplate({ name }));\n },\n editTemplateBegin: (e: any, name: string, value: string) => {\n e.stopPropagation();\n dispatch(Creators.selectTemplate({ name }));\n dispatch(\n Creators.editTemplateBegin({\n name,\n value,\n }),\n );\n },\n editTemplateCancel: () => dispatch(Creators.editTemplateCancel()),\n editTemplateConfirm: () => dispatch(Creators.editTemplateConfirm()),\n editTemplateName: (event: any) => dispatch(Creators.editTemplateName({ name: event.target.value })),\n editTemplateValue: (event: any) => dispatch(Creators.editTemplateValue({ value: event.target.value })),\n selectTemplate: (option: Option<string>) => {\n if (option && option.requestingNew === true) {\n dispatch(Creators.selectTemplate({ name: null }));\n dispatch(Creators.addTemplate());\n } else {\n dispatch(Creators.selectTemplate({ name: option ? option.value : null }));\n }\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(FilterTemplateSelector);\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { DISABLE_EDIT_CONFIG, DisableableTextarea } from 'kayenta/layout/disableable';\nimport FormRow from 'kayenta/layout/formRow';\nimport { ICanaryState } from 'kayenta/reducers';\nimport {\n inlineTemplateValueSelector,\n transformInlineTemplateForSave,\n} from 'kayenta/selectors/filterTemplatesSelectors';\nimport { isEmpty } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\ninterface IInlineTemplateEditorStateProps {\n templateValue: string;\n transformValueForSave: (value: string) => string;\n}\n\ninterface IInlineTemplateEditorDispatchProps {\n editTemplateValue: (value: string) => void;\n}\n\nexport type IInlineTemplateEditorProps = IInlineTemplateEditorStateProps & IInlineTemplateEditorDispatchProps;\n\nexport function InlineTemplateEditor({\n editTemplateValue,\n templateValue,\n transformValueForSave,\n}: IInlineTemplateEditorProps) {\n return (\n <FormRow\n label=\"Template\"\n inputOnly={true}\n helpId=\"canary.config.filterTemplate\"\n error={isEmpty(templateValue) && 'Template is required'}\n >\n <DisableableTextarea\n className=\"template-editor-textarea\"\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n disabled={CanarySettings.disableConfigEdit}\n onChange={(e: any) => editTemplateValue(transformValueForSave(e.target.value))}\n value={templateValue}\n />\n </FormRow>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IInlineTemplateEditorStateProps {\n return {\n templateValue: inlineTemplateValueSelector(state),\n transformValueForSave: transformInlineTemplateForSave(state),\n };\n}\n\nfunction mapDispatchToProps(dispatch: any): IInlineTemplateEditorDispatchProps {\n return {\n editTemplateValue: (value: string) => dispatch(Creators.editInlineTemplate({ value })),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(InlineTemplateEditor);\n","import { ICanaryMetricConfig } from 'kayenta/domain/ICanaryConfig';\nimport metricStoreConfigService from 'kayenta/metricStore/metricStoreConfig.service';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\ninterface IMetricConfigurerDelegatorStateProps {\n editingMetric: ICanaryMetricConfig;\n}\n\n/*\n * Should find and render the appropriate metric configurer for a given metric store.\n * */\nfunction MetricConfigurerDelegator({ editingMetric }: IMetricConfigurerDelegatorStateProps) {\n const config = metricStoreConfigService.getDelegate(editingMetric.query.type);\n if (config && config.metricConfigurer) {\n const MetricConfigurer = config.metricConfigurer;\n return <MetricConfigurer />;\n } else {\n return <p>Metric configuration has not been implemented for {editingMetric.query.type}.</p>;\n }\n}\n\nfunction mapStateToProps(state: ICanaryState): IMetricConfigurerDelegatorStateProps {\n return {\n editingMetric: state.selectedConfig.editingMetric,\n };\n}\n\nexport default connect(mapStateToProps)(MetricConfigurerDelegator);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryMetricConfig } from 'kayenta/domain';\nimport { DISABLE_EDIT_CONFIG, DisableableInput, DisableableSelect } from 'kayenta/layout/disableable';\nimport FormRow from 'kayenta/layout/formRow';\nimport RadioChoice from 'kayenta/layout/radioChoice';\nimport Styleguide from 'kayenta/layout/styleguide';\nimport metricStoreConfigService from 'kayenta/metricStore/metricStoreConfig.service';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { editingMetricValidationErrorsSelector } from 'kayenta/selectors';\nimport { isTemplateValidSelector, useInlineTemplateEditorSelector } from 'kayenta/selectors/filterTemplatesSelectors';\nimport { isNull, values } from 'lodash';\nimport * as React from 'react';\nimport { Modal } from 'react-bootstrap';\nimport { connect } from 'react-redux';\n\nimport { noop } from '@spinnaker/core';\n\nimport EditMetricEffectSizes from './editMetricEffectSizes';\nimport { ICanaryMetricValidationErrors } from './editMetricValidation';\nimport FilterTemplateSelector from './filterTemplateSelector';\nimport InlineTemplateEditor from './inlineTemplateEditor';\nimport MetricConfigurerDelegator from './metricConfigurerDelegator';\n\nimport './editMetricModal.less';\n\ninterface IEditMetricModalDispatchProps {\n rename: (event: any) => void;\n changeGroup: (event: any) => void;\n updateDirection: (event: any) => void;\n updateNanStrategy: (event: any) => void;\n updateCriticality: (event: any) => void;\n confirm: () => void;\n cancel: () => void;\n}\n\ninterface IEditMetricModalStateProps {\n metric: ICanaryMetricConfig;\n groups: string[];\n isTemplateValid: boolean;\n useInlineTemplateEditor: boolean;\n disableEdit: boolean;\n validationErrors: ICanaryMetricValidationErrors;\n}\n\n/*\n * Modal to edit metric details.\n */\nfunction EditMetricModal({\n metric,\n rename,\n changeGroup,\n groups,\n confirm,\n cancel,\n isTemplateValid,\n updateDirection,\n updateNanStrategy,\n updateCriticality,\n useInlineTemplateEditor,\n disableEdit,\n validationErrors,\n}: IEditMetricModalDispatchProps & IEditMetricModalStateProps) {\n if (!metric) {\n return null;\n }\n\n const direction = metric.analysisConfigurations?.canary?.direction ?? 'either';\n const nanStrategy = metric.analysisConfigurations?.canary?.nanStrategy ?? 'default';\n const critical = metric.analysisConfigurations?.canary?.critical ?? false;\n const isConfirmDisabled =\n !isTemplateValid ||\n disableEdit ||\n CanarySettings.disableConfigEdit ||\n values(validationErrors).some((e) => !isNull(e));\n\n const metricGroup = metric.groups.length ? metric.groups[0] : groups[0];\n const templatesEnabled =\n metricStoreConfigService.getDelegate(metric.query.type) &&\n metricStoreConfigService.getDelegate(metric.query.type).useTemplates &&\n CanarySettings.templatesEnabled;\n return (\n <Modal bsSize=\"large\" show={true} onHide={noop} className={classNames('kayenta-edit-metric-modal')}>\n <Styleguide>\n <Modal.Header>\n <Modal.Title>\n {disableEdit || CanarySettings.disableConfigEdit ? 'Metric Details' : 'Configure Metric'}\n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <FormRow label=\"Group\" inputOnly={true}>\n {metric.groups.length > 1 && (\n <DisableableInput\n type=\"text\"\n value={metric.groups}\n data-id={metric.id}\n onChange={changeGroup}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n )}\n {metric.groups.length < 2 && (\n <DisableableSelect\n value={metricGroup}\n onChange={changeGroup}\n className=\"form-control input-sm\"\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n >\n {groups.map((g) => (\n <option key={g} value={g}>\n {g}\n </option>\n ))}\n </DisableableSelect>\n )}\n </FormRow>\n <FormRow label=\"Name\" error={validationErrors?.name?.message ?? null} inputOnly={true}>\n <DisableableInput\n type=\"text\"\n value={metric.name}\n data-id={metric.id}\n onChange={rename}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n </FormRow>\n <FormRow label=\"Fail on\">\n <RadioChoice\n value=\"increase\"\n label=\"Increase\"\n name=\"direction\"\n current={direction}\n action={updateDirection}\n />\n <RadioChoice\n value=\"decrease\"\n label=\"Decrease\"\n name=\"direction\"\n current={direction}\n action={updateDirection}\n />\n <RadioChoice value=\"either\" label=\"Either\" name=\"direction\" current={direction} action={updateDirection} />\n </FormRow>\n <FormRow label=\"Criticality\" checkbox={true}>\n <label>\n <DisableableInput\n type=\"checkbox\"\n checked={critical}\n onChange={updateCriticality}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n Fail the canary if this metric fails\n </label>\n </FormRow>\n <FormRow label=\"NaN Strategy\" helpId=\"canary.config.nanStrategy\">\n <RadioChoice\n value=\"default\"\n label=\"Default (remove)\"\n name=\"nanStrategy\"\n current={nanStrategy}\n action={updateNanStrategy}\n />\n <RadioChoice\n value=\"replace\"\n label=\"Replace with zero\"\n name=\"nanStrategy\"\n current={nanStrategy}\n action={updateNanStrategy}\n />\n <RadioChoice\n value=\"remove\"\n label=\"Remove\"\n name=\"nanStrategy\"\n current={nanStrategy}\n action={updateNanStrategy}\n />\n </FormRow>\n <EditMetricEffectSizes />\n <MetricConfigurerDelegator />\n {templatesEnabled && !useInlineTemplateEditor && <FilterTemplateSelector />}\n {templatesEnabled && useInlineTemplateEditor && <InlineTemplateEditor />}\n </Modal.Body>\n <Modal.Footer>\n <ul className=\"list-inline pull-right\">\n <li>\n <button className=\"passive\" onClick={cancel}>\n Cancel\n </button>\n </li>\n <li>\n <button className=\"primary\" disabled={isConfirmDisabled} onClick={confirm}>\n OK\n </button>\n </li>\n </ul>\n </Modal.Footer>\n </Styleguide>\n </Modal>\n );\n}\n\nfunction mapDispatchToProps(dispatch: any): IEditMetricModalDispatchProps {\n return {\n rename: (event: any) => {\n dispatch(Creators.renameMetric({ id: event.target.dataset.id, name: event.target.value }));\n },\n changeGroup: (event: any) => {\n dispatch(Creators.updateMetricGroup({ id: event.target.dataset.id, group: event.target.value }));\n },\n cancel: () => {\n dispatch(Creators.editMetricCancel());\n dispatch(Creators.editTemplateCancel());\n },\n confirm: () => {\n dispatch(Creators.editMetricConfirm());\n dispatch(Creators.editTemplateCancel());\n },\n updateDirection: ({ target }: React.ChangeEvent<HTMLInputElement>) => {\n dispatch(Creators.updateMetricDirection({ id: target.dataset.id, direction: target.value }));\n },\n updateNanStrategy: ({ target }: React.ChangeEvent<HTMLInputElement>) => {\n dispatch(Creators.updateMetricNanStrategy({ id: target.dataset.id, strategy: target.value }));\n },\n updateCriticality: ({ target }: React.ChangeEvent<HTMLInputElement>) => {\n dispatch(Creators.updateMetricCriticality({ id: target.dataset.id, critical: Boolean(target.checked) }));\n },\n };\n}\n\nfunction mapStateToProps(state: ICanaryState): IEditMetricModalStateProps {\n return {\n metric: state.selectedConfig.editingMetric,\n groups: state.selectedConfig.group.list.sort(),\n isTemplateValid: isTemplateValidSelector(state),\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useInlineTemplateEditor: useInlineTemplateEditorSelector(state),\n disableEdit: state.app.disableConfigEdit || CanarySettings.disableConfigEdit,\n validationErrors: editingMetricValidationErrorsSelector(state),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(EditMetricModal);\n","import * as React from 'react';\n\nimport './titledSection.less';\n\nexport interface ISectionProps {\n title: string;\n children?: any;\n}\n\n// TODO: implemented the mocks using a modified open pod, but the styleguide should add something more directly appropriate\nexport default function TitledSection({ title, children }: ISectionProps) {\n return (\n <section className=\"pod open titled-section\">\n <div className=\"header horizontal middle\">\n <div className=\"flex-1 heading-2 uppercase\">{title}</div>\n </div>\n <div className=\"contents vertical\">{children}</div>\n </section>\n );\n}\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryMetricConfig } from 'kayenta/domain/ICanaryConfig';\nimport { DISABLE_EDIT_CONFIG, DisableableSelect } from 'kayenta/layout/disableable';\nimport Styleguide from 'kayenta/layout/styleguide';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { Modal } from 'react-bootstrap';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport { noop } from '@spinnaker/core';\n\ninterface IChangeMetricGroupModalOwnProps {\n metric: ICanaryMetricConfig;\n}\n\ninterface IChangeMetricGroupModalStateProps {\n groups: string[];\n toGroup: string;\n}\n\ninterface IChangeMetricGroupModalDispatchProps {\n select: (event: any) => void;\n clear: () => void;\n confirm: () => void;\n}\n\nfunction ChangeMetricGroupModal({\n groups,\n toGroup,\n confirm,\n clear,\n select,\n}: IChangeMetricGroupModalStateProps & IChangeMetricGroupModalDispatchProps) {\n return (\n <Modal show={true} onHide={noop}>\n <Styleguide>\n <Modal.Header>\n <Modal.Title>Change Metric Group</Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <DisableableSelect\n value={toGroup || ''}\n onChange={select}\n className=\"form-control input-sm\"\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n >\n <option value={''}>-- select group --</option>\n {groups.map((g) => (\n <option key={g} value={g}>\n {g}\n </option>\n ))}\n </DisableableSelect>\n </Modal.Body>\n <Modal.Footer>\n <ul className=\"list-inline pull-right\">\n <li>\n <button className=\"passive\" onClick={clear}>\n Cancel\n </button>\n </li>\n <li>\n <button className=\"primary\" disabled={!toGroup} onClick={confirm}>\n OK\n </button>\n </li>\n </ul>\n </Modal.Footer>\n </Styleguide>\n </Modal>\n );\n}\n\nfunction mapStateToProps(\n state: ICanaryState,\n { metric }: IChangeMetricGroupModalOwnProps,\n): IChangeMetricGroupModalStateProps {\n // If a metric belongs to more than one group, allow a move into one of those groups.\n // e.g., a [system, requests] -> [requests] move should be allowed, but\n // don't offer a [system] -> [system] move.\n return {\n groups: state.selectedConfig.group.list.filter((g) => metric.groups.length > 1 || !metric.groups.includes(g)),\n toGroup: state.selectedConfig.changeMetricGroup.toGroup,\n };\n}\n\nfunction mapDispatchToProps(\n dispatch: (action: Action & any) => void,\n { metric }: IChangeMetricGroupModalOwnProps,\n): IChangeMetricGroupModalDispatchProps {\n return {\n select: (event: any) => {\n dispatch(Creators.changeMetricGroupSelect({ group: event.target.value || null }));\n },\n clear: () => {\n dispatch(Creators.changeMetricGroupConfirm({ metricId: null }));\n },\n confirm: () => {\n dispatch(Creators.changeMetricGroupConfirm({ metricId: metric.id }));\n },\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ChangeMetricGroupModal);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryMetricConfig } from 'kayenta/domain';\nimport { DISABLE_EDIT_CONFIG, DisableableButton } from 'kayenta/layout/disableable';\nimport { ITableColumn, NativeTable } from 'kayenta/layout/table';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { cloneDeep } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport { Tooltip } from '@spinnaker/core';\n\nimport ChangeMetricGroupModal from './changeMetricGroupModal';\n\nimport './metricList.less';\n\ninterface IMetricListStateProps {\n selectedGroup: string;\n metrics: ICanaryMetricConfig[];\n showGroups: boolean;\n changingGroupMetric: ICanaryMetricConfig;\n groupList: string[];\n metricStore: string;\n disableEdit: boolean;\n}\n\ninterface IMetricListDispatchProps {\n addMetric: (event: any) => void;\n editMetric: (event: any) => void;\n copyMetric: (metric: ICanaryMetricConfig) => void;\n removeMetric: (event: any) => void;\n openChangeMetricGroupModal: (event: any) => void;\n}\n\nfunction FailOn({ metric }: { metric: ICanaryMetricConfig }) {\n const direction = metric.analysisConfigurations?.canary?.direction;\n const isCritical = metric.analysisConfigurations?.canary?.critical;\n const tooltipSuffix = isCritical ? '(critical — if this metric fails, the entire canary will fail)' : '';\n const classes = classNames('metric-fail-on-icon', 'fas', 'sp-margin-xs-right', { critical: isCritical });\n if (direction === 'decrease') {\n return (\n <Tooltip value={`decrease ${tooltipSuffix}`}>\n <i className={`fa-caret-square-down ${classes}`} />\n </Tooltip>\n );\n }\n if (direction === 'increase') {\n return (\n <Tooltip value={`increase ${tooltipSuffix}`}>\n <i className={`fa-caret-square-up ${classes}`} />\n </Tooltip>\n );\n }\n return (\n <Tooltip value={`increase OR decrease ${tooltipSuffix}`}>\n <span>\n <i className={`fa-caret-square-down ${classes}`} />\n <i className={`fa-caret-square-up ${classes}`} />\n </span>\n </Tooltip>\n );\n}\n\n/*\n * Configures an entire list of metrics.\n */\nfunction MetricList({\n metrics,\n groupList,\n selectedGroup,\n showGroups,\n addMetric,\n editMetric,\n copyMetric,\n removeMetric,\n changingGroupMetric,\n openChangeMetricGroupModal,\n metricStore,\n disableEdit,\n}: IMetricListStateProps & IMetricListDispatchProps) {\n const columns: Array<ITableColumn<ICanaryMetricConfig>> = [\n {\n label: 'Metric Name',\n getContent: (metric) => <span>{metric.name || '(new)'}</span>,\n },\n {\n label: 'Fail On',\n getContent: (metric) => <FailOn metric={metric} />,\n },\n {\n label: 'Groups',\n getContent: (metric) => <span>{metric.groups.join(', ')}</span>,\n hide: () => !showGroups,\n },\n {\n getContent: (metric) => (\n <div className=\"horizontal pull-right metrics-action-buttons\">\n <button className=\"link\" data-id={metric.id} onClick={editMetric}>\n {disableEdit || CanarySettings.disableConfigEdit ? 'View' : 'Edit'}\n </button>\n <button\n className=\"link\"\n data-id={metric.id}\n disabled={disableEdit || CanarySettings.disableConfigEdit}\n onClick={openChangeMetricGroupModal}\n >\n Move Group\n </button>\n <button\n className=\"link\"\n data-id={metric.id}\n disabled={disableEdit || CanarySettings.disableConfigEdit}\n onClick={() => copyMetric(metric)}\n >\n Copy\n </button>\n <button\n className=\"link\"\n data-id={metric.id}\n disabled={disableEdit || CanarySettings.disableConfigEdit}\n onClick={removeMetric}\n >\n Delete\n </button>\n </div>\n ),\n },\n ];\n\n return (\n <>\n <NativeTable columns={columns} rows={metrics} rowKey={(metric) => metric.id} className=\"header-white\" />\n {!metrics.length && selectedGroup ? (\n <p>\n This group is empty! The group will be not be present the next time the config is loaded unless it is saved\n with at least one metric in it.\n </p>\n ) : null}\n {changingGroupMetric && <ChangeMetricGroupModal metric={changingGroupMetric} />}\n <DisableableButton\n className=\"passive self-left\"\n data-group={selectedGroup}\n data-default={groupList[0]}\n data-metric-store={metricStore}\n onClick={addMetric}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n >\n Add Metric\n </DisableableButton>\n </>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IMetricListStateProps {\n const selectedGroup = state.selectedConfig.group.selected;\n const metricList = state.selectedConfig.metricList;\n\n const filter = selectedGroup ? (metric: ICanaryMetricConfig) => metric.groups.includes(selectedGroup) : () => true;\n return {\n selectedGroup,\n groupList: state.selectedConfig.group.list,\n metrics: metricList.filter(filter),\n showGroups: !selectedGroup || metricList.filter(filter).some((metric) => metric.groups.length > 1),\n changingGroupMetric: state.selectedConfig.metricList.find(\n (m) => m.id === state.selectedConfig.changeMetricGroup.metric,\n ),\n metricStore: state.selectedConfig.selectedStore,\n disableEdit: state.app.disableConfigEdit || CanarySettings.disableConfigEdit,\n };\n}\n\nfunction mapDispatchToProps(dispatch: (action: Action & any) => void): IMetricListDispatchProps {\n return {\n addMetric: (event: any) => {\n const group = event.target.dataset.group || event.target.dataset.default;\n dispatch(\n Creators.addMetric({\n metric: {\n // TODO: need to block saving an invalid name\n // TODO: for Atlas metrics, attempt to gather name when query changes\n id: '[new]',\n analysisConfigurations: {},\n name: '',\n query: {\n type: event.target.dataset.metricStore,\n serviceType: event.target.dataset.metricStore,\n },\n groups: group ? [group] : [],\n scopeName: 'default', // scopeName always defaults to `default` and is not configurable from the UI\n isNew: true,\n },\n }),\n );\n },\n copyMetric: (metric: ICanaryMetricConfig) => {\n const metricCopy: ICanaryMetricConfig = cloneDeep(metric);\n metricCopy.id = '[new]';\n metricCopy.isNew = true;\n metricCopy.name = '';\n dispatch(Creators.addMetric({ metric: metricCopy }));\n },\n editMetric: (event: any) => {\n dispatch(Creators.editMetricBegin({ id: event.target.dataset.id }));\n },\n removeMetric: (event: any) => {\n dispatch(Creators.removeMetric({ id: event.target.dataset.id }));\n },\n openChangeMetricGroupModal: (event: any) => dispatch(Creators.changeMetricGroup({ id: event.target.dataset.id })),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MetricList);\n","import * as React from 'react';\n\nexport interface IFormListProps {\n children: JSX.Element[] | JSX.Element;\n}\n\n/*\n * Mostly exists to centralize styles for form components.\n * */\nexport default function FormList({ children }: IFormListProps) {\n return (\n <ul className=\"list-group\">\n {React.Children.map(\n children,\n (c) =>\n c && (\n <li className=\"list-unstyled\">\n <form role=\"form\" className=\"form-horizontal container-fluid\">\n <div className=\"col-md-12\">{c}</div>\n </form>\n </li>\n ),\n )}\n </ul>\n );\n}\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { KayentaAccountType } from 'kayenta/domain';\nimport { DISABLE_EDIT_CONFIG, DisableableSelect } from 'kayenta/layout/disableable';\nimport FormRow from 'kayenta/layout/formRow';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { chain } from 'lodash';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\ninterface IMetricStoreSelectorStateProps {\n stores: string[];\n selectedStore: string;\n}\n\ninterface IMetricStoreSelectorDispatchProps {\n select: (event: any) => void;\n}\n\nconst MetricStoreSelector = ({\n stores,\n selectedStore,\n select,\n}: IMetricStoreSelectorDispatchProps & IMetricStoreSelectorStateProps) => {\n if (stores.length < 2) {\n return null;\n }\n\n return (\n <FormRow label=\"Metric Store\" inputOnly={true}>\n <DisableableSelect\n value={selectedStore || ''}\n onChange={select}\n className=\"form-control input-sm\"\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n >\n {stores.map((s) => (\n <option key={s} value={s}>\n {s}\n </option>\n ))}\n </DisableableSelect>\n </FormRow>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricStoreSelectorStateProps => {\n return {\n stores: chain(state.data.kayentaAccounts.data)\n .filter((account) => account.supportedTypes.includes(KayentaAccountType.MetricsStore))\n .map((account) => account.metricsStoreType || account.type)\n .uniq()\n .sort()\n .valueOf(),\n selectedStore: state.selectedConfig.selectedStore,\n };\n};\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>): IMetricStoreSelectorDispatchProps => {\n return {\n select: (event: any) => dispatch(Creators.selectMetricStore({ store: event.target.value })),\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MetricStoreSelector);\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { DISABLE_EDIT_CONFIG, DisableableInput, DisableableTextarea } from 'kayenta/layout/disableable';\nimport FormList from 'kayenta/layout/formList';\nimport FormRow from 'kayenta/layout/formRow';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport MetricStoreSelector from './metricStoreSelector';\n\ninterface INameAndDescriptionDispatchProps {\n changeName: (event: React.ChangeEvent<HTMLInputElement>) => void;\n changeDescription: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n}\n\ninterface INameAndDescriptionStateProps {\n name: string;\n description: string;\n}\n\n/*\n * Configures canary config name and description.\n */\nfunction NameAndDescription({\n name,\n description,\n changeName,\n changeDescription,\n}: INameAndDescriptionDispatchProps & INameAndDescriptionStateProps) {\n return (\n <FormList>\n <FormRow label=\"Configuration Name\" inputOnly={true}>\n <DisableableInput\n type=\"text\"\n value={name}\n onChange={changeName}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n </FormRow>\n <MetricStoreSelector />\n <FormRow label=\"Description\" inputOnly={true}>\n <DisableableTextarea\n className=\"form-control input-sm\"\n value={description}\n onChange={changeDescription}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n </FormRow>\n </FormList>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): INameAndDescriptionStateProps {\n if (state.selectedConfig.config) {\n return {\n name: state.selectedConfig.config.name,\n description: state.selectedConfig.config.description,\n };\n } else {\n return {\n name: '',\n description: '',\n };\n }\n}\n\nfunction mapDispatchToProps(dispatch: (action: Action & any) => void): INameAndDescriptionDispatchProps {\n return {\n changeName: (event: React.ChangeEvent<HTMLInputElement>) => {\n dispatch(\n Creators.updateConfigName({\n name: event.target.value,\n }),\n );\n },\n changeDescription: (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n dispatch(\n Creators.updateConfigDescription({\n description: event.target.value,\n }),\n );\n },\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(NameAndDescription);\n","import * as React from 'react';\nimport { HelpField } from '@spinnaker/core';\n\nimport './titledSubsection.less';\n\nexport interface ITitledSubsectionProps {\n children: any;\n title: string;\n helpKey?: string;\n}\n\nexport default function TitledSubsection({ title, children, helpKey }: ITitledSubsectionProps) {\n return (\n <section className=\"titled-subsection\">\n <h5 className=\"heading-5\">\n {title} {helpKey && <HelpField id={helpKey} />}\n </h5>\n <hr />\n {children}\n </section>\n );\n}\n","import * as Creators from 'kayenta/actions/creators';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryConfig } from 'kayenta/domain/ICanaryConfig';\nimport { DISABLE_EDIT_CONFIG, DisableableInput } from 'kayenta/layout/disableable';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { mapStateToConfig } from 'kayenta/service/canaryConfig.service';\nimport { get, isNumber } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\n\nimport FormRow from '../layout/formRow';\n\nexport interface IGroupWeightOwnProps {\n group: string;\n}\n\ninterface IGroupWeightStateProps {\n config: ICanaryConfig;\n}\n\ninterface IGroupWeightDispatchProps {\n handleInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\n/*\n * Component for configuring a group weight.\n * */\nfunction GroupWeight({\n group,\n config,\n handleInputChange,\n}: IGroupWeightOwnProps & IGroupWeightStateProps & IGroupWeightDispatchProps) {\n const groupWeight = getGroupWeights(config)[group];\n return (\n <FormRow label={group} inputOnly={true}>\n <DisableableInput\n type=\"number\"\n value={isNumber(groupWeight) ? groupWeight : ''}\n onChange={handleInputChange}\n min={0}\n max={100}\n disabled={CanarySettings.disableConfigEdit}\n disabledStateKeys={[DISABLE_EDIT_CONFIG]}\n />\n </FormRow>\n );\n}\n\nfunction getGroupWeights(config: ICanaryConfig): { [key: string]: number } {\n return get(config, 'classifier.groupWeights', {});\n}\n\nfunction mapStateToProps(\n state: ICanaryState,\n ownProps: IGroupWeightOwnProps,\n): IGroupWeightOwnProps & IGroupWeightStateProps {\n return {\n ...ownProps,\n config: mapStateToConfig(state),\n };\n}\n\nfunction mapDispatchToProps(\n dispatch: (action: Action & any) => void,\n { group }: IGroupWeightOwnProps,\n): IGroupWeightDispatchProps {\n return {\n handleInputChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n dispatch(\n Creators.updateGroupWeight({\n group,\n weight: event.target.value ? parseInt(event.target.value, 10) : null,\n }),\n );\n },\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(GroupWeight);\n","import { flatMap, uniq } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport GroupWeight from './groupWeight';\nimport { ICanaryState } from '../reducers/index';\nimport { mapStateToConfig } from '../service/canaryConfig.service';\n\ninterface IGroupWeightsStateProps {\n groups: string[];\n}\n\n/*\n * Component for rendering list of group weight configurers.\n */\nfunction GroupWeights({ groups }: IGroupWeightsStateProps) {\n const hasGroups = groups.length > 0;\n return (\n <section>\n {hasGroups ? (\n groups.map((group) => <GroupWeight key={group} group={group} />)\n ) : (\n <p key=\"no-groups\">You have not configured any grouped metrics.</p>\n )}\n </section>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IGroupWeightsStateProps {\n const config = mapStateToConfig(state);\n const metrics = config ? config.metrics : [];\n const groups = uniq(flatMap(metrics, (metric) => metric.groups || []));\n return {\n groups,\n };\n}\n\nexport default connect(mapStateToProps)(GroupWeights);\n","import TitledSubsection from 'kayenta/layout/titledSubsection';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport GroupWeights from './groupWeights';\nimport JudgeSelect, { JudgeSelectRenderState } from './judgeSelect';\nimport FormList from '../layout/formList';\nimport { ICanaryState } from '../reducers/index';\n\ninterface IScoringStateProps {\n renderJudgeSelect: boolean;\n}\n\nfunction Scoring({ renderJudgeSelect }: IScoringStateProps) {\n return (\n <FormList>\n {renderJudgeSelect && (\n <TitledSubsection title=\"Judge\">\n <JudgeSelect />\n </TitledSubsection>\n )}\n <TitledSubsection title=\"Metric Group Weights\" helpKey=\"canary.config.metricGroupWeights\">\n <GroupWeights />\n </TitledSubsection>\n </FormList>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState) {\n return {\n renderJudgeSelect: state.selectedConfig.judge.renderState !== JudgeSelectRenderState.None,\n };\n}\n\nexport default connect(mapStateToProps)(Scoring);\n","import * as React from 'react';\n\nimport ConfigDetailHeader from './configDetailHeader';\nimport EditMetricModal from './editMetricModal';\nimport GroupTabs from './groupTabs';\nimport TitledSection from '../layout/titledSection';\nimport MetricList from './metricList';\nimport NameAndDescription from './nameAndDescription';\nimport Scoring from './scoring';\n\n/*\n * Top-level config detail layout\n */\nexport default function ConfigDetail() {\n return (\n <section className=\"config-detail\">\n <ConfigDetailHeader />\n <TitledSection title=\"Name and Description\">\n <NameAndDescription />\n </TitledSection>\n <TitledSection title=\"Metrics\">\n <GroupTabs />\n <MetricList />\n <EditMetricModal />\n </TitledSection>\n <TitledSection title=\"Scoring\">\n <Scoring />\n </TitledSection>\n </section>\n );\n}\n","import * as React from 'react';\n\nexport interface ICenteredDetailProps {\n children: JSX.Element;\n}\n\nexport default function CenteredDetail({ children }: ICenteredDetailProps) {\n return (\n <div className=\"row\">\n <div className=\"col-sm-offset-4\">{children}</div>\n </div>\n );\n}\n","import LoadStatesBuilder from 'kayenta/components/loadStates';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ConfigDetail from './configDetail';\nimport CenteredDetail from '../layout/centeredDetail';\nimport { AsyncRequestState } from '../reducers/asyncRequest';\nimport { ICanaryState } from '../reducers/index';\n\ninterface IConfigLoadStatesProps {\n configLoadState: AsyncRequestState;\n}\n\n/*\n * Renders appropriate view given the configuration detail's load state.\n */\nfunction ConfigDetailLoadStates({ configLoadState }: IConfigLoadStatesProps) {\n const LoadStates = new LoadStatesBuilder()\n .onFulfilled(<ConfigDetail />)\n .onFailed(\n <CenteredDetail>\n <h3 className=\"heading-3\">Could not load canary config.</h3>\n </CenteredDetail>,\n )\n .build();\n\n return <LoadStates state={configLoadState} />;\n}\n\nfunction mapStateToProps(state: ICanaryState): IConfigLoadStatesProps {\n return {\n configLoadState: state.selectedConfig.load.state,\n };\n}\n\nexport default connect(mapStateToProps)(ConfigDetailLoadStates);\n","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Action } from 'redux';\nimport { Observable } from 'rxjs/Observable';\nimport { Subscription } from 'rxjs/Subscription';\n\nimport * as Creators from '../actions/creators';\nimport ConfigDetailLoadStates from './configDetailLoadStates';\n\ninterface IConfigLoaderStateParamsProps {\n configNameStream: Observable<IConfigDetailStateParams>;\n}\n\ninterface IConfigLoaderDispatchProps {\n loadConfig: (stateParams: IConfigDetailStateParams) => void;\n}\n\ninterface IConfigDetailStateParams {\n id: string;\n copy: boolean;\n new: boolean;\n}\n\n/*\n * Top-level .configDetail state component.\n * Loads config details on changes to /canary/:configName path parameter, renders load states.\n */\nclass ConfigDetailLoader extends React.Component<IConfigLoaderDispatchProps & IConfigLoaderStateParamsProps> {\n private subscription: Subscription;\n\n constructor(props: IConfigLoaderDispatchProps & IConfigLoaderStateParamsProps) {\n const { configNameStream, loadConfig } = props;\n super(props);\n this.subscription = configNameStream.subscribe(loadConfig);\n }\n\n public componentWillUnmount(): void {\n this.subscription.unsubscribe();\n }\n\n public render() {\n return <ConfigDetailLoadStates />;\n }\n}\n\nfunction mapDispatchToProps(dispatch: (action: Action & any) => void): IConfigLoaderDispatchProps {\n return {\n loadConfig: (stateParams: IConfigDetailStateParams) => {\n if (stateParams.copy) {\n dispatch(Creators.copySelectedConfig());\n } else if (stateParams.new) {\n dispatch(Creators.createNewConfig());\n } else if (stateParams.id) {\n dispatch(Creators.loadConfigRequest({ id: stateParams.id }));\n }\n },\n };\n}\n\nexport default connect(null, mapDispatchToProps)(ConfigDetailLoader);\n","import { UISref } from '@uirouter/react';\nimport { CanarySettings } from 'kayenta/canary.settings';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { UUIDGenerator } from '@spinnaker/core';\n\nimport { ICanaryState } from '../reducers/index';\n\ninterface ICreateConfigButtonStateProps {\n disabled: boolean;\n}\n\n/*\n * Button for creating a new canary config.\n */\nfunction CreateConfigButton({ disabled }: ICreateConfigButtonStateProps) {\n return (\n <UISref to=\".configDetail\" params={{ id: UUIDGenerator.generateUuid(), new: true }}>\n <button className=\"zombie text-left form-control\" disabled={disabled}>\n <i className=\"fa fa-plus-circle\" />\n <span>Add configuration</span>\n </button>\n </UISref>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): ICreateConfigButtonStateProps {\n return {\n disabled: (state.selectedConfig.config && state.selectedConfig.config.isNew) || CanarySettings.disableConfigEdit,\n };\n}\n\nexport default connect(mapStateToProps)(CreateConfigButton);\n","import * as React from 'react';\n\nimport { HelpField } from '@spinnaker/core';\n\ninterface IOwnedByProps {\n owningApplications: string[];\n currentApplication: string;\n}\n\nconst buildHelpText = (ownedBy: string[]): string => {\n if (ownedBy.length === 0) {\n return null;\n } else if (ownedBy.length === 1) {\n return `This config can only be edited from within the application <strong>${ownedBy[0]}.</strong>`;\n } else {\n return `This config can only be edited from within the following applications: <strong>${ownedBy.join(\n ', ',\n )}.</strong>`;\n }\n};\n\nexport const OwnedBy = ({ owningApplications, currentApplication }: IOwnedByProps) => {\n if (owningApplications.length < 2 && owningApplications.includes(currentApplication)) {\n return null;\n }\n\n return (\n <span>\n Owned by: {owningApplications.join(', ')}\n &nbsp;\n <HelpField placement=\"right\" content={buildHelpText(owningApplications)} />\n </span>\n );\n};\n","import { UISref } from '@uirouter/react';\nimport { ICanaryConfigSummary } from 'kayenta/domain/ICanaryConfigSummary';\nimport FormattedDate from 'kayenta/layout/formattedDate';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { sortBy } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport CreateConfigButton from './createConfigButton';\nimport { OwnedBy } from './ownedBy';\n\nimport './configList.less';\n\ninterface IConfigListStateProps {\n configs: ICanaryConfigSummary[];\n selectedConfigId: string;\n application: string;\n}\n\n/*\n * Shows a list of available configurations the user can select for editing.\n */\nfunction ConfigList({ configs, selectedConfigId, application }: IConfigListStateProps) {\n return (\n <section className=\"config-list\">\n <ul className=\"tabs-vertical list-unstyled \" style={{ wordBreak: 'break-all' }}>\n {configs.map((config) => (\n <li key={config.id} className={config.id === selectedConfigId ? 'selected' : ''}>\n <UISref to=\".configDetail\" params={{ id: config.id, new: false, copy: false }}>\n <a>\n <div className=\"heading-4 color-text-primary\">{config.name}</div>\n <div className=\"body-small color-text-caption caption\" style={{ marginTop: '5px', marginBottom: '0' }}>\n Edited: <FormattedDate dateIso={config.updatedTimestampIso} />\n <br />\n <OwnedBy owningApplications={config.applications} currentApplication={application} />\n </div>\n </a>\n </UISref>\n </li>\n ))}\n </ul>\n <CreateConfigButton />\n </section>\n );\n}\n\nfunction mapStateToProps(state: ICanaryState): IConfigListStateProps {\n const selectedConfigId = state.selectedConfig.config ? state.selectedConfig.config.id : null;\n const application = state.data.application.name;\n return {\n selectedConfigId,\n configs: sortBy(state.data.configSummaries, 'name'),\n application,\n };\n}\n\nexport default connect(mapStateToProps)(ConfigList);\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nimport './footer.less';\n\nexport interface IFooterProps {\n children?: JSX.Element;\n}\n\nexport default function Footer({ children }: IFooterProps) {\n return <div className={classNames('row', 'canary-footer')}>{children}</div>;\n}\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nexport interface IListDetailProps {\n className?: string;\n list: JSX.Element;\n listClass?: string;\n listWidth?: number;\n detail: JSX.Element;\n detailWidth?: number;\n detailClass?: string;\n}\n\n/*\n * A composite view that combines a list view in one panel and a detail view in another.\n * The contents of the detail view are dependent on the user's selection in the list view.\n */\nexport default function ListDetail({\n className,\n list,\n listWidth = 2,\n detail,\n detailWidth = 10,\n listClass,\n detailClass,\n}: IListDetailProps) {\n return (\n <div className={classNames('list-detail', 'horizontal', className)}>\n <div className={classNames(`col-md-${listWidth}`, listClass)}>{list}</div>\n <div className={classNames(`col-md-${detailWidth}`, detailClass)}>{detail}</div>\n </div>\n );\n}\n","import { UIView } from '@uirouter/react';\nimport * as React from 'react';\n\nimport ConfigList from './configList';\nimport Footer from './footer';\nimport ListDetail from '../layout/listDetail';\n\n/*\n * Component for editing canary configurations for an application.\n */\nexport default function CanaryConfigEdit() {\n const List = <ConfigList />;\n // TODO: need to break these down by groups\n const noWrap = { wrap: false };\n const Detail = <UIView {...noWrap} name=\"detail\" />;\n return (\n <div className=\"vertical flex-1\">\n <ListDetail list={List} detail={Detail} className=\"flex-1\" detailClass=\"vertical flex-1\" />\n <Footer>\n <UIView {...noWrap} name=\"footer\" />\n </Footer>\n </div>\n );\n}\n","import { CanarySettings } from 'kayenta/canary.settings';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { SubmitButton } from '@spinnaker/core';\n\nimport * as Creators from '../actions/creators';\nimport { ICanaryState } from '../reducers';\nimport { AsyncRequestState } from '../reducers/asyncRequest';\n\ninterface ISaveButtonStateProps {\n saveConfigState: AsyncRequestState;\n inSyncWithServer: boolean;\n disable: boolean;\n}\n\ninterface ISaveButtonDispatchProps {\n saveConfig: () => void;\n}\n\n/*\n * Button for saving a canary config.\n */\nfunction SaveConfigButton({\n saveConfigState,\n inSyncWithServer,\n saveConfig,\n disable,\n}: ISaveButtonStateProps & ISaveButtonDispatchProps) {\n if (inSyncWithServer && saveConfigState !== AsyncRequestState.Requesting) {\n return (\n <span className=\"btn btn-link disabled\">\n <i className=\"far fa-check-circle\" /> In sync with server\n </span>\n );\n } else {\n return (\n <SubmitButton\n label=\"Save Changes\"\n onClick={saveConfig}\n isDisabled={disable || CanarySettings.disableConfigEdit}\n submitting={saveConfigState === AsyncRequestState.Requesting}\n />\n );\n }\n}\n\nfunction mapStateToProps(state: ICanaryState): ISaveButtonStateProps {\n const disable = !!state.selectedConfig.validationErrors.length || CanarySettings.disableConfigEdit;\n return {\n saveConfigState: state.selectedConfig.save.state,\n inSyncWithServer: state.selectedConfig.isInSyncWithServer,\n disable,\n };\n}\n\nfunction mapDispatchToProps(dispatch: any): ISaveButtonDispatchProps {\n return {\n saveConfig: () => {\n dispatch(Creators.saveConfig());\n },\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SaveConfigButton);\n","import classNames from 'classnames';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport * as Creators from '../actions/creators';\nimport { ICanaryState } from '../reducers';\nimport { AsyncRequestState } from '../reducers/asyncRequest';\n\ninterface ISaveErrorStateProps {\n saveConfigState: AsyncRequestState;\n saveConfigErrorMessage: string;\n}\n\ninterface ISaveErrorDispatchProps {\n dismissError: () => void;\n}\n\n/*\n * Renders canary config save error.\n */\nfunction SaveConfigError({\n saveConfigState,\n saveConfigErrorMessage,\n dismissError,\n}: ISaveErrorStateProps & ISaveErrorDispatchProps) {\n return (\n saveConfigState === AsyncRequestState.Failed && (\n <span className={classNames('alert', 'alert-danger')}>\n {buildErrorMessage(saveConfigErrorMessage)}\n <a className={classNames('alert-dismiss', 'clickable')} onClick={dismissError}>\n {' '}\n [dismiss]\n </a>\n </span>\n )\n );\n}\n\nfunction buildErrorMessage(saveConfigErrorMessage: string): string {\n const message = 'There was an error saving your config';\n return saveConfigErrorMessage ? message + `: ${saveConfigErrorMessage}.` : message + '.';\n}\n\nfunction mapStateToProps(state: ICanaryState): ISaveErrorStateProps {\n return {\n saveConfigState: state.selectedConfig.save.state,\n saveConfigErrorMessage: state.selectedConfig.save.error,\n };\n}\n\nfunction mapDispatchToProps(dispatch: any): ISaveErrorDispatchProps {\n return {\n dismissError: () => {\n dispatch(Creators.dismissSaveConfigError());\n },\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SaveConfigError);\n","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport { HoverablePopover } from '@spinnaker/core';\nimport { ICanaryState } from '../reducers/index';\n\ninterface IConfigValidationErrorsStateProps {\n errors: string[];\n}\n\nconst ConfigValidationErrors = ({ errors }: IConfigValidationErrorsStateProps) => {\n if (!errors || !errors.length) {\n return null;\n }\n\n const template = (\n <section>\n <p>The following errors may prevent this config from working properly:</p>\n <ul>\n {errors.map((e) => (\n <li key={e}>{e}</li>\n ))}\n </ul>\n </section>\n );\n\n return (\n <HoverablePopover placement={'left'} template={template}>\n <button className=\"btn btn-link\">\n <i className=\"fa fa-exclamation-triangle\" />\n </button>\n </HoverablePopover>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IConfigValidationErrorsStateProps => ({\n errors: state.selectedConfig.validationErrors.map((e) => e.message),\n});\n\nexport default connect(mapStateToProps)(ConfigValidationErrors);\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nimport SaveConfigButton from './saveConfigButton';\nimport SaveConfigError from './saveConfigError';\nimport ValidationErrors from './validationErrors';\n\n/*\n * Responsible for canary config save component layout.\n */\nexport default function Save() {\n return (\n <div className={classNames('col-sm-12', 'text-right')}>\n <ValidationErrors />\n <SaveConfigError />\n <SaveConfigButton />\n </div>\n );\n}\n","import * as React from 'react';\nimport CenteredDetail from '../layout/centeredDetail';\n\nexport default function SelectConfig() {\n return (\n <CenteredDetail>\n <h3 className=\"heading-3\">Click a configuration to edit.</h3>\n </CenteredDetail>\n );\n}\n","import { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryExecutionStatusResult } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { runSelector, serializedCanaryConfigSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { SETTINGS } from '@spinnaker/core';\n\ninterface ISourceJsonStateProps {\n reportUrl: string;\n metricListUrl: string;\n}\n\nconst SourceLinks = ({ reportUrl, metricListUrl }: ISourceJsonStateProps) => {\n return (\n <ul className=\"list-unstyled small\">\n <li>\n <a target=\"_blank\" href={reportUrl}>\n Report\n </a>\n </li>\n {metricListUrl && (\n <li>\n <p>\n <a target=\"_blank\" href={metricListUrl}>\n Metrics\n </a>\n </p>\n </li>\n )}\n </ul>\n );\n};\n\nconst resolveReportUrl = (state: ICanaryState): string => {\n const canaryConfigId = serializedCanaryConfigSelector(state).id;\n const result: ICanaryExecutionStatusResult = runSelector(state);\n const canaryRunId = result.id;\n let url = `${SETTINGS.gateUrl}/v2/canaries/canary/${canaryConfigId}/${canaryRunId}`;\n const storageAccountName = result.storageAccountName || CanarySettings.storageAccountName;\n if (storageAccountName) {\n url += `?storageAccountName=${storageAccountName}`;\n }\n return url;\n};\n\nconst resolveMetricListUrl = (state: ICanaryState): string => {\n const status = runSelector(state);\n const { metricSetPairListId } = status;\n if (!metricSetPairListId) {\n return null;\n }\n let url = `${SETTINGS.gateUrl}/v2/canaries/metricSetPairList/${metricSetPairListId}`;\n const storageAccountName = status.storageAccountName || CanarySettings.storageAccountName;\n if (storageAccountName) {\n url += `?storageAccountName=${storageAccountName}`;\n }\n return url;\n};\n\nconst mapStateToProps = (state: ICanaryState): ISourceJsonStateProps => {\n return {\n reportUrl: resolveReportUrl(state),\n metricListUrl: resolveMetricListUrl(state),\n };\n};\n\nexport default connect(mapStateToProps)(SourceLinks);\n","import { ICanaryExecutionStatusResult } from 'kayenta/domain/ICanaryExecutionStatusResult';\nimport FormattedDate from 'kayenta/layout/formattedDate';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { HoverablePopover } from '@spinnaker/core';\n\nimport SourceLinks from './sourceLinks';\n\ninterface IReportMetadata {\n run: ICanaryExecutionStatusResult;\n}\n\ninterface IMetadataGroup {\n label?: string;\n entries: IMetadataEntry[];\n}\n\ninterface IMetadataEntry {\n label: string;\n getContent: () => JSX.Element;\n popover?: boolean;\n}\n\nconst Label = ({ label, extraClass }: { label: string; extraClass?: string }) => (\n <label className={`label uppercase color-text-primary ${extraClass}`}>{label}</label>\n);\n\n// TODO(dpeach): this only supports canary runs with a single scope.\nconst buildScopeMetadataEntries = (run: ICanaryExecutionStatusResult): IMetadataGroup[] => {\n const request = run.canaryExecutionRequest;\n const scopes = Object.values(request.scopes);\n if (scopes.length > 1) {\n return null;\n }\n\n const {\n controlScope: { step, location: controlLocation, scope: controlScope },\n experimentScope: {\n // Since baseline starttime may be offset in canaries from Orca,\n // Choose the experiment start and end to represent\n // the canary start and end times\n start: experimentStart,\n end: experimentEnd,\n location: experimentLocation,\n scope: experimentScope,\n },\n } = scopes[0];\n\n return [\n {\n label: 'baseline',\n entries: [\n {\n label: 'scope',\n popover: true,\n getContent: () => <p className=\"kayenta-scope\">{controlScope}</p>,\n },\n {\n label: 'location',\n getContent: () => <p>{controlLocation}</p>,\n },\n ],\n },\n {\n label: 'canary',\n entries: [\n {\n label: 'scope',\n popover: true,\n getContent: () => <p className=\"kayenta-scope\">{experimentScope}</p>,\n },\n {\n label: 'location',\n getContent: () => <p>{experimentLocation}</p>,\n },\n ],\n },\n {\n label: 'time',\n entries: [\n {\n label: 'start',\n getContent: () => (\n <p>\n <FormattedDate dateIso={experimentStart} />\n </p>\n ),\n },\n {\n label: 'end',\n getContent: () => (\n <p>\n <FormattedDate dateIso={experimentEnd} />\n </p>\n ),\n },\n {\n label: 'step',\n getContent: () => {\n const mins = step / 60;\n return (\n <p>\n {mins} min\n {mins === 1 ? '' : 's'}\n </p>\n );\n },\n },\n ],\n },\n ];\n};\n\nconst ReportMetadata = ({ run }: IReportMetadata) => {\n const {\n thresholds: { marginal, pass },\n } = run.canaryExecutionRequest;\n\n const metadataGroups = buildScopeMetadataEntries(run) || [];\n metadataGroups.push({\n label: 'threshold',\n entries: [\n {\n label: 'marginal',\n getContent: () => <p>{marginal}</p>,\n },\n {\n label: 'pass',\n getContent: () => <p>{pass}</p>,\n },\n ],\n });\n\n return (\n <section className=\"report-metadata\">\n {metadataGroups.map((group, index) => (\n <div className={`group group-${group.label}`} key={group.label || index}>\n <Label label={group.label || ''} extraClass=\"label-lg\" />\n <ul className=\"list-unstyled\">\n {group.entries.map((e) => (\n <li key={e.label || index}>\n <Label label={e.label} />\n {e.popover ? (\n <HoverablePopover template={e.getContent()}>{e.getContent()}</HoverablePopover>\n ) : (\n <>{e.getContent()}</>\n )}\n </li>\n ))}\n </ul>\n </div>\n ))}\n <div className=\"group group-source\" key=\"source\">\n <Label label=\"Source\" extraClass=\"label-lgf\" />\n <SourceLinks />\n </div>\n </section>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n run: state.selectedRun.run,\n});\n\nexport default connect(mapStateToProps)(ReportMetadata);\n","import { CanaryScore } from 'kayenta/components/canaryScore';\nimport { ICanaryJudgeScore } from 'kayenta/domain/ICanaryJudgeResult';\nimport { ScoreClassificationLabel } from 'kayenta/domain/ScoreClassificationLabel';\nimport { round } from 'lodash';\nimport * as React from 'react';\n\nexport interface ICanaryJudgeScoreProps {\n score: ICanaryJudgeScore;\n showClassification?: boolean;\n inverse?: boolean;\n}\n\n// TODO(dpeach): don't use ACA statuses in the CanaryScore component.\nconst mapKayentaToACA = (score: ICanaryJudgeScore): { health: string; result: string } => {\n if (score.classification === ScoreClassificationLabel.Pass) {\n return { health: null, result: 'success' };\n } else if (score.classification === ScoreClassificationLabel.Fail) {\n return { health: 'unhealthy', result: null };\n } else {\n return { health: null, result: null };\n }\n};\n\nexport default ({ score, showClassification, inverse }: ICanaryJudgeScoreProps) => (\n <CanaryScore\n className=\"score-report\"\n score={round(score.score, 2)}\n result={mapKayentaToACA(score).result}\n health={mapKayentaToACA(score).health}\n classification={showClassification ? score.classification : null}\n inverse={inverse}\n />\n);\n","import { UISref } from '@uirouter/react';\nimport { ICanaryJudgeScore } from 'kayenta/domain/ICanaryJudgeResult';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { judgeResultSelector, serializedCanaryConfigSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ReportMetadata from './reportMetadata';\nimport ReportScore from './score';\n\nimport './header.less';\n\nexport interface IReportHeaderStateProps {\n id: string;\n name: string;\n score: ICanaryJudgeScore;\n}\n\nconst ReportHeader = ({ id, name, score }: IReportHeaderStateProps) => (\n <section className=\"horizontal report-header\">\n <div className=\"report-score-wrapper\">\n <ReportScore score={score} showClassification={true} />\n <h1 className=\"heading-2 color-text-primary\">\n <UISref to=\"^.^.canaryConfig.configDetail\" params={{ id }}>\n <a className=\"clickable color-text-primary\"> {name}</a>\n </UISref>\n </h1>\n </div>\n <ReportMetadata />\n </section>\n);\n\nconst mapStateToProps = (state: ICanaryState): IReportHeaderStateProps => ({\n id: serializedCanaryConfigSelector(state).id,\n name: serializedCanaryConfigSelector(state).name,\n score: judgeResultSelector(state).score,\n});\n\nexport default connect(mapStateToProps)(ReportHeader);\n","import { ICanaryAnalysisResult } from 'kayenta/domain/ICanaryJudgeResult';\nimport { IMetricSetPair } from 'kayenta/domain/IMetricSetPair';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { metricResultsSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { GraphType, metricSetPairGraphService } from './metricSetPairGraph.service';\n\ninterface IMetricSetPairGraphStateProps {\n pair: IMetricSetPair;\n result: ICanaryAnalysisResult;\n graphType: GraphType;\n}\n\nconst GRAPH_IMPLEMENTATIONS = ['semiotic'];\n\nconst MetricSetPairGraph = ({ pair, result, graphType }: IMetricSetPairGraphStateProps) => {\n const delegates = GRAPH_IMPLEMENTATIONS.map((name) => metricSetPairGraphService.getDelegate(name)).filter((d) => !!d);\n const delegate = delegates.find((candidate) => candidate.handlesGraphType(graphType));\n if (!delegate) {\n return <h3 className=\"heading-3\">Could not load graph.</h3>;\n }\n const Graph = delegate.getGraph();\n return <Graph metricSetPair={pair} result={result} type={graphType} />;\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricSetPairGraphStateProps => {\n const selectedMetric = state.selectedRun.selectedMetric;\n return {\n pair: state.selectedRun.metricSetPair.pair,\n result: metricResultsSelector(state).find((result) => result.id === selectedMetric),\n graphType: state.selectedRun.graphType,\n };\n};\n\nexport default connect(mapStateToProps)(MetricSetPairGraph);\n","import * as Creators from 'kayenta/actions/creators';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport { GraphType } from './graph/metricSetPairGraph.service';\n\nimport './graphTypeSelector.less';\n\ninterface IGraphTypeSelectorStateProps {\n selected: GraphType;\n}\n\ninterface IGraphTypeSelectorDispatchProps {\n selectGraphType: (type: GraphType) => void;\n}\n\nconst GraphTypeSelector = ({\n selected,\n selectGraphType,\n}: IGraphTypeSelectorStateProps & IGraphTypeSelectorDispatchProps) => {\n return (\n <ul className=\"list-inline graph-type-selector\">\n <li>\n <label className=\"label uppercase color-text-primary\" style={{ paddingLeft: 0 }}>\n Graph:\n </label>\n </li>\n {Object.values(GraphType).map((type) => (\n <li\n style={selected === type ? { textDecoration: 'underline' } : null}\n key={type}\n onClick={() => selectGraphType(type)}\n >\n <a className=\"small clickable\">{type}</a>\n </li>\n ))}\n </ul>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IGraphTypeSelectorStateProps => ({\n selected: state.selectedRun.graphType,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>): IGraphTypeSelectorDispatchProps => ({\n selectGraphType: (type: GraphType) => dispatch(Creators.selectGraphType({ type })),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(GraphTypeSelector);\n","import { CanarySettings } from 'kayenta/canary.settings';\nimport { ICanaryMetricConfig } from 'kayenta/domain/ICanaryConfig';\nimport { IMetricSetPair } from 'kayenta/domain/IMetricSetPair';\nimport metricStoreConfigStore from 'kayenta/metricStore/metricStoreConfig.service';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { selectedMetricConfigSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { CopyToClipboard } from '@spinnaker/core';\n\nimport './metricResultActions.less';\n\nexport interface IMetricResultStatsStateProps {\n metricConfig: ICanaryMetricConfig;\n metricSetPair: IMetricSetPair;\n}\n\nconst buildAtlasGraphUrl = (metricSetPair: IMetricSetPair) => {\n const { attributes, scopes, values, tags } = metricSetPair;\n const { atlasGraphBaseUrl } = CanarySettings;\n let legendTags = '';\n if (Object.keys(tags).length) {\n legendTags = ` (${Object.keys(tags)\n .map((tag) => `$${tag}`)\n .join('|')})`;\n }\n\n // TODO: If the control and experiment have different baseURLs, generate two links instead of a combined one.\n const backend = encodeURIComponent(attributes.control.baseURL);\n const experimentQuery = encodeURIComponent(attributes.experiment.query);\n const controlQuery = encodeURIComponent(attributes.control.query);\n const query = `${experimentQuery},Canary${legendTags},:legend,:freeze,${controlQuery},Baseline${legendTags},:legend`;\n\n const startTime = Math.min(scopes.control.startTimeMillis, scopes.experiment.startTimeMillis);\n const controlEndTime = scopes.control.startTimeMillis + values.control.length * scopes.control.stepMillis;\n const experimentEndTime = scopes.experiment.startTimeMillis + values.experiment.length * scopes.experiment.stepMillis;\n const endTime = Math.max(controlEndTime, experimentEndTime);\n\n return `${atlasGraphBaseUrl}?backend=${backend}&g.q=${query}&g.s=${startTime}&g.e=${endTime}&g.w=651&mode=png&axis=0`;\n};\n\nconst MetricResultActions = ({ metricSetPair, metricConfig }: IMetricResultStatsStateProps) => {\n const atlasURL = buildAtlasGraphUrl(metricSetPair);\n const atlasQuery = metricStoreConfigStore.getDelegate(metricConfig.query.type).queryFinder(metricConfig);\n\n // Mask CopyToClipboard component as a larger button, fire event when clicked\n const copyToClipboard = (\n <div className=\"copy-button-container\">\n <CopyToClipboard displayText={false} text={atlasQuery} toolTip={null} />\n <button className=\"primary copy-button\" key=\"copy-link\">\n <i className=\"glyphicon glyphicon-copy copy-icon\" />\n Copy metric query\n </button>\n </div>\n );\n\n const openAtlas = (\n <a href={atlasURL} target=\"_blank\">\n <button className=\"primary\">\n <i className=\"fas fa-chart-line\" />\n Explore more data in Atlas\n </button>\n </a>\n );\n\n const actions = [copyToClipboard, openAtlas].map((action, i) => {\n return (\n <li className=\"action\" key={i}>\n {action}\n </li>\n );\n });\n\n return (\n <div className=\"metric-result-actions\">\n <ul className=\"actions-layout list-inline\">{actions}</ul>\n </div>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricResultStatsStateProps => ({\n metricConfig: selectedMetricConfigSelector(state),\n metricSetPair: state.selectedRun.metricSetPair.pair,\n});\n\nexport default connect(mapStateToProps)(MetricResultActions);\n","import { ICanaryAnalysisResultsStats } from 'kayenta/domain';\nimport { ICanaryMetricConfig } from 'kayenta/domain/ICanaryConfig';\nimport { ICanaryExecutionStatusResult } from 'kayenta/domain/ICanaryExecutionStatusResult';\nimport { IMetricSetPair } from 'kayenta/domain/IMetricSetPair';\nimport FormattedDate from 'kayenta/layout/formattedDate';\nimport { ITableColumn, NativeTable } from 'kayenta/layout/table';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { runSelector, selectedMetricConfigSelector } from 'kayenta/selectors';\nimport { round } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport './metricResultStats.less';\n\nexport interface IMetricResultStatsStateProps {\n metricConfig: ICanaryMetricConfig;\n metricSetPair: IMetricSetPair;\n run: ICanaryExecutionStatusResult;\n service: string;\n}\n\nconst getStats = (run: ICanaryExecutionStatusResult, id: string, target: string): ICanaryAnalysisResultsStats => {\n const result = run.result.judgeResult.results.find((r) => r.id === id);\n if (target === 'experiment') {\n return result.experimentMetadata.stats;\n } else if (target === 'control') {\n return result.controlMetadata.stats;\n } else {\n return null;\n }\n};\n\ninterface IResultMetadataRow {\n label: string;\n getContent: () => JSX.Element;\n}\n\nconst ResultMetadataRow = ({ row }: { row: IResultMetadataRow }) => {\n if (!row.getContent()) {\n return null;\n }\n\n return (\n <div>\n <label className=\"label uppercase color-text-primary\">{row.label}</label>\n {row.getContent()}\n </div>\n );\n};\n\nconst MetricResultStats = ({ metricConfig, metricSetPair, run }: IMetricResultStatsStateProps) => {\n const tableColumns: Array<ITableColumn<string>> = [\n {\n getContent: (target) => <span>{target === 'control' ? 'Baseline' : 'Canary'}</span>,\n },\n {\n label: 'start',\n getContent: (target) => <FormattedDate dateIso={metricSetPair.scopes[target].startTimeIso} />,\n hide: () => {\n const request = run.canaryExecutionRequest;\n const configuredControlStart = request.scopes[metricConfig.scopeName].controlScope.start;\n const actualControlStart = metricSetPair.scopes.control.startTimeIso;\n\n const configuredExperimentStart = request.scopes[metricConfig.scopeName].experimentScope.start;\n const actualExperimentStart = metricSetPair.scopes.experiment.startTimeIso;\n\n return configuredControlStart === actualControlStart && configuredExperimentStart === actualExperimentStart;\n },\n },\n {\n label: 'count',\n getContent: (target) => <span>{getStats(run, metricSetPair.id, target).count}</span>,\n },\n {\n label: 'avg',\n getContent: (target) => <span>{round(getStats(run, metricSetPair.id, target).mean, 3)}</span>,\n },\n {\n label: 'max',\n getContent: (target) => <span>{round(getStats(run, metricSetPair.id, target).max, 3)}</span>,\n },\n {\n label: 'min',\n getContent: (target) => <span>{round(getStats(run, metricSetPair.id, target).min, 3)}</span>,\n },\n ];\n\n const metadataRows: IResultMetadataRow[] = [\n {\n label: 'classification reason',\n getContent: () => {\n const result = run.result.judgeResult.results.find((r) => r.id === metricSetPair.id);\n\n if (!result.classificationReason) {\n return null;\n }\n\n return <p>{result.classificationReason}</p>;\n },\n },\n ];\n\n return (\n <div className=\"metric-stats vertical\">\n {metadataRows.map((row) => (\n <ResultMetadataRow row={row} key={row.label} />\n ))}\n <NativeTable columns={tableColumns} rows={['control', 'experiment']} rowKey={(row) => row} />\n </div>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricResultStatsStateProps => ({\n metricConfig: selectedMetricConfigSelector(state),\n metricSetPair: state.selectedRun.metricSetPair.pair,\n run: runSelector(state),\n service: selectedMetricConfigSelector(state).query.type,\n});\n\nexport default connect(mapStateToProps)(MetricResultStats);\n","import * as React from 'react';\n\nimport Graph from './graph/graph';\nimport GraphTypeSelector from './graphTypeSelector';\nimport MetricResultActions from './metricResultActions';\nimport MetricResultStats from './metricResultStats';\n\n/*\n * Responsible for layout of the metric result detail view after the metric set\n * pair for the result has loaded successfully.\n * */\nexport default () => (\n <section className=\"vertical flex-1 sp-padding-xl-bottom\" style={{ overflowY: 'auto' }}>\n <GraphTypeSelector />\n <Graph />\n <MetricResultActions />\n <MetricResultStats />\n </section>\n);\n","import LoadStatesBuilder from 'kayenta/components/loadStates';\nimport { AsyncRequestState } from 'kayenta/reducers/asyncRequest';\nimport { ICanaryState } from 'kayenta/reducers/index';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport MetricResultDetailLayout from './metricResultDetailLayout';\n\nconst MetricSetPairLoadStates = ({ state }: { state: AsyncRequestState }) => {\n const LoadStates = new LoadStatesBuilder()\n .onFulfilled(<MetricResultDetailLayout />)\n .onFailed(<h3 className=\"heading-3 text-center\">Could not load metrics.</h3>)\n .build();\n\n return <LoadStates state={state} />;\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n state: state.selectedRun.metricSetPair.load,\n});\n\nexport default connect(mapStateToProps)(MetricSetPairLoadStates);\n","import { ICanaryAnalysisResult } from 'kayenta/domain/ICanaryJudgeResult';\nimport * as React from 'react';\n\nimport MetricSetPairLoadStates from './metricSetPairLoadStates';\n\nexport interface IMetricResultDetailProps {\n result: ICanaryAnalysisResult;\n}\n\n/*\n * Top-level component for the metric result detail - i.e., the right side of the\n * screen that opens when you click on a metric result.\n * */\nexport default ({ result }: IMetricResultDetailProps) => {\n if (result) {\n return <MetricSetPairLoadStates />;\n } else {\n return <h3 className=\"heading-3 text-center\">Select a metric result.</h3>;\n }\n};\n","import * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport * as Creators from '../../actions/creators';\nimport { ICanaryAnalysisResult, MetricClassificationLabel } from '../../domain';\nimport { ICanaryState } from '../../reducers';\n\nexport interface IMetricFiltersOwnProps {\n results: ICanaryAnalysisResult[];\n}\n\ninterface IMetricFiltersStateProps {\n metricFilters: MetricClassificationLabel[];\n}\n\ninterface IMetricFiltersDispatchProps {\n toggle: (classification: MetricClassificationLabel) => void;\n}\n\nconst MetricFilters = ({\n results,\n metricFilters,\n toggle,\n}: IMetricFiltersOwnProps & IMetricFiltersStateProps & IMetricFiltersDispatchProps) => {\n const options = [\n MetricClassificationLabel.Error,\n MetricClassificationLabel.High,\n MetricClassificationLabel.Low,\n MetricClassificationLabel.Nodata,\n MetricClassificationLabel.Pass,\n ]\n .map((classification) => ({\n classification,\n count: results.filter((r) => r.classification === classification).length,\n }))\n .filter((option) => option.count);\n\n const checkboxes = options.map((o) => (\n <label key={o.classification}>\n <input\n type=\"checkbox\"\n checked={metricFilters.includes(o.classification)}\n onChange={() => toggle(o.classification)}\n />{' '}\n {o.classification} ({o.count}){' '}\n </label>\n ));\n\n return <div className=\"metric-filter-options horizontal center\">{checkboxes}</div>;\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricFiltersStateProps => ({\n metricFilters: state.selectedRun.metricFilters,\n});\n\nconst mapDispatchToProps = (\n dispatch: Dispatch<ICanaryState>,\n ownProps: IMetricFiltersOwnProps,\n): IMetricFiltersOwnProps & IMetricFiltersDispatchProps => ({\n toggle: (classification: MetricClassificationLabel) =>\n dispatch(Creators.toggleMetricClassificationFilter({ classification })),\n ...ownProps,\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MetricFilters);\n","import {\n ICanaryJudgeGroupScore,\n ICanaryJudgeScore,\n ICanaryScoreThresholds,\n MetricClassificationLabel,\n ScoreClassificationLabel,\n} from 'kayenta/domain';\n\n// Standard Spinnaker styleguide colors.\nconst GREEN = 'var(--color-success)';\nconst RED = 'var(--color-danger)';\nconst GREY = 'var(--color-text-caption)';\nconst YELLOW = 'var(--color-warning)';\n\nexport const mapMetricClassificationToColor = (classification: MetricClassificationLabel): string =>\n ({\n [MetricClassificationLabel.High]: RED,\n [MetricClassificationLabel.Low]: RED,\n [MetricClassificationLabel.Error]: YELLOW,\n [MetricClassificationLabel.Nodata]: GREY,\n [MetricClassificationLabel.Pass]: GREEN,\n }[classification]);\n\nexport const mapScoreClassificationToColor = (classification: ScoreClassificationLabel): string =>\n ({\n [ScoreClassificationLabel.Fail]: RED,\n [ScoreClassificationLabel.Error]: YELLOW,\n [ScoreClassificationLabel.Marginal]: GREY,\n [ScoreClassificationLabel.Nodata]: GREY,\n [ScoreClassificationLabel.Pass]: GREEN,\n }[classification]);\n\nexport const mapGroupToColor = (\n group: ICanaryJudgeGroupScore | ICanaryJudgeScore,\n scoreThresholds: ICanaryScoreThresholds,\n): string => {\n if (typeof group.score !== 'number') {\n return YELLOW; // Some kind of error.\n } else if (group.score > scoreThresholds.pass) {\n return GREEN;\n } else if (group.score > scoreThresholds.marginal) {\n return GREY;\n } else {\n return RED;\n }\n};\n","import classNames from 'classnames';\nimport { MetricClassificationLabel } from 'kayenta/domain/MetricClassificationLabel';\nimport * as React from 'react';\n\nimport { mapMetricClassificationToColor } from './colors';\n\ninterface IMetricResultClassificationProps {\n classification: MetricClassificationLabel;\n className?: string;\n}\n\nconst buildStyle = (classification: MetricClassificationLabel) => ({\n backgroundColor: mapMetricClassificationToColor(classification),\n});\n\nconst TEXT_COLOR = 'var(--color-text-on-dark)';\n\nexport default ({ classification, className }: IMetricResultClassificationProps) => (\n <div className={classNames('pill', 'metric-result-classification', className)} style={buildStyle(classification)}>\n <span style={{ color: TEXT_COLOR }}>{classification}</span>\n </div>\n);\n","import * as React from 'react';\n\ninterface IMetricResultDeviationProps {\n className?: string;\n ratio: number;\n}\n\nconst formatDeviationAsPercentage = (ratio: number) => {\n if (typeof ratio !== 'number') {\n return 'N/A';\n } else if (ratio === 1) {\n return '0%';\n } else if (ratio < 1) {\n return ((ratio - 1) * 100).toFixed(1) + '%';\n } else {\n return '+' + ((ratio - 1) * 100).toFixed(1) + '%';\n }\n};\n\nexport default ({ ratio, className }: IMetricResultDeviationProps) =>\n ratio && (\n <span className={className} style={{ color: 'var(--color-text-caption' }}>\n {formatDeviationAsPercentage(ratio)}\n </span>\n );\n","import { ITableColumn } from 'kayenta/layout/table';\nimport * as React from 'react';\n\nimport { BreakString } from '@spinnaker/core';\n\nimport MetricResultClassification from './metricResultClassification';\nimport MetricResultDeviation from './metricResultDeviation';\nimport { IMetricResultsTableRow } from './metricResultsList';\n\nexport const metricResultsColumns: Array<ITableColumn<IMetricResultsTableRow>> = [\n {\n label: 'metric name',\n getContent: ({ metricName }) => <BreakString>{metricName}</BreakString>,\n width: 5,\n },\n {\n label: 'deviation',\n getContent: ({ results }) =>\n results[0].resultMetadata && <MetricResultDeviation ratio={results[0].resultMetadata.ratio} />,\n width: 1,\n },\n {\n label: 'result',\n getContent: ({ results }) => <MetricResultClassification classification={results[0].classification} />,\n width: 1,\n },\n];\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { ICanaryAnalysisResult } from 'kayenta/domain/ICanaryJudgeResult';\nimport { ITableColumn, Table } from 'kayenta/layout/table';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { selectedMetricResultIdSelector } from 'kayenta/selectors';\nimport { chain } from 'lodash';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport { BreakString } from '@spinnaker/core';\n\nimport MetricResultClassification from './metricResultClassification';\nimport MetricResultDeviation from './metricResultDeviation';\n\ninterface IMultipleResultsTableOwnProps {\n results: ICanaryAnalysisResult[];\n}\n\ninterface IMultipleResultsTableStateProps {\n selectedResult: string;\n}\n\ninterface IMultipleResultsTableDispatchProps {\n select: (metricId: string) => void;\n}\n\nconst MultipleResultsTable = ({\n results,\n select,\n selectedResult,\n}: IMultipleResultsTableOwnProps & IMultipleResultsTableStateProps & IMultipleResultsTableDispatchProps) => {\n const tagKeys = chain(results)\n .flatMap((r) => Object.keys(r.tags || {}))\n .uniq()\n .value();\n\n let columns: Array<ITableColumn<ICanaryAnalysisResult>> = tagKeys.map((key) => ({\n label: key,\n width: 5,\n getContent: (result: ICanaryAnalysisResult) => <BreakString>{result.tags[key]}</BreakString>,\n }));\n\n columns = columns.concat([\n {\n width: 1,\n getContent: ({ resultMetadata }) => resultMetadata && <MetricResultDeviation ratio={resultMetadata.ratio} />,\n },\n {\n width: 1,\n getContent: ({ classification }) => <MetricResultClassification classification={classification} />,\n },\n ]);\n\n return (\n <Table\n rows={results}\n columns={columns}\n className=\"multiple-results-table\"\n headerClassName=\"sticky-header-2\"\n rowClassName={(r) => classNames('horizontal', { selected: r.id === selectedResult })}\n rowKey={(r) =>\n Object.entries(r.tags || {})\n .map(([key, value]) => `${key}:${value}`)\n .join(':')\n }\n onRowClick={(r) => select(r.id)}\n />\n );\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n selectedResult: selectedMetricResultIdSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>, ownProps: IMultipleResultsTableOwnProps) => ({\n ...ownProps,\n select: (metricId: string) => dispatch(Creators.selectReportMetric({ metricId })),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MultipleResultsTable);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { ICanaryAnalysisResult } from 'kayenta/domain/ICanaryJudgeResult';\nimport { Table } from 'kayenta/layout/table';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport { MetricClassificationLabel } from '../../domain';\nimport MetricFilters from './metricResultsClassificationFilters';\nimport { metricResultsColumns } from './metricResultsColumns';\nimport MultipleResultsTable from './multipleResultsTable';\n\nimport './metricResultsList.less';\n\nexport interface IResultsListOwnProps {\n results: ICanaryAnalysisResult[];\n}\n\ninterface IResultsListDispatchProps {\n select: (metric: string) => void;\n}\n\ninterface IResultsListStateProps {\n selectedMetric: string;\n metricFilters: MetricClassificationLabel[];\n}\n\nexport interface IMetricResultsTableRow {\n metricName: string;\n results: ICanaryAnalysisResult[];\n hasMultipleRows: boolean;\n}\n\nconst buildTableRows = (\n results: ICanaryAnalysisResult[],\n metricFilters: MetricClassificationLabel[],\n): IMetricResultsTableRow[] => {\n const unfilteredCounts = results.reduce((map, result) => {\n if (!map.has(result.name)) {\n map.set(result.name, 0);\n }\n map.set(result.name, map.get(result.name) + 1);\n return map;\n }, new Map<string, number>());\n\n const tableRowsByMetricName = results\n .filter((result) => !metricFilters.length || metricFilters.includes(result.classification))\n .reduce(\n (map, result) =>\n map.has(result.name)\n ? map.set(result.name, {\n metricName: result.name,\n results: map.get(result.name).results.concat(result),\n hasMultipleRows: unfilteredCounts.get(result.name) > 1,\n })\n : map.set(result.name, {\n metricName: result.name,\n results: [result],\n hasMultipleRows: unfilteredCounts.get(result.name) > 1,\n }),\n new Map<string, IMetricResultsTableRow>(),\n );\n\n return Array.from(tableRowsByMetricName.values());\n};\n\nconst buildRowForMetricWithMultipleResults = (row: IMetricResultsTableRow) => {\n if (!row.hasMultipleRows) {\n return null;\n }\n\n return (\n <li className=\"horizontal multiple-results\">\n <section className=\"vertical flex-fill\">\n <div>{row.metricName}</div>\n <MultipleResultsTable results={row.results} />\n </section>\n </li>\n );\n};\n\nconst ResultsList = ({\n results,\n select,\n selectedMetric,\n metricFilters,\n}: IResultsListOwnProps & IResultsListDispatchProps & IResultsListStateProps) => {\n const rows = buildTableRows(results, metricFilters);\n return (\n <section className=\"vertical metric-results-list flex-1\">\n <MetricFilters results={results} />\n <Table\n rowKey={(r) => r.metricName}\n tableBodyClassName=\"list-unstyled tabs-vertical flex-1 sp-padding-xl-bottom\"\n rowClassName={(r) => classNames('horizontal', { selected: r.results[0].id === selectedMetric })}\n rows={rows}\n columns={metricResultsColumns}\n onRowClick={(r) => select(r.results[0].id)}\n className=\"flex-1 vertical\"\n customRow={buildRowForMetricWithMultipleResults}\n />\n </section>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IResultsListStateProps => ({\n selectedMetric: state.selectedRun.selectedMetric,\n metricFilters: state.selectedRun.metricFilters,\n});\n\nconst mapDispatchToProps = (\n dispatch: Dispatch<ICanaryState>,\n ownProps: IResultsListOwnProps,\n): IResultsListOwnProps & IResultsListDispatchProps => ({\n select: (metricId: string) => dispatch(Creators.selectReportMetric({ metricId })),\n ...ownProps,\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ResultsList);\n","import { ICanaryAnalysisResult } from 'kayenta/domain/ICanaryJudgeResult';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { judgeResultSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ListDetail from '../../layout/listDetail';\nimport MetricResultDetail from './metricResultDetail';\nimport MetricResultsList from './metricResultsList';\n\nimport './metricResults.less';\n\ninterface IMetricResultsStateProps {\n metricResults: ICanaryAnalysisResult[];\n selectedMetricResult: ICanaryAnalysisResult;\n}\n\nconst MetricResults = ({ metricResults, selectedMetricResult }: IMetricResultsStateProps) => {\n const list = <MetricResultsList results={metricResults} />;\n const detail = <MetricResultDetail result={selectedMetricResult} />;\n\n return (\n <ListDetail\n list={list}\n listClass=\"vertical\"\n listWidth={5}\n detail={detail}\n detailClass=\"vertical\"\n detailWidth={9}\n className=\"metric-results flex-1\"\n />\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IMetricResultsStateProps => {\n const {\n selectedRun: { selectedGroup, selectedMetric },\n } = state;\n const result = judgeResultSelector(state);\n\n // Build list of metric results to render.\n const filter: (r: ICanaryAnalysisResult) => boolean = selectedGroup\n ? (r) => r.groups.includes(selectedGroup)\n : () => true;\n\n return {\n metricResults: Object.values(result.results).filter(filter),\n selectedMetricResult: Object.values(result.results).find((r) => r.id === selectedMetric),\n };\n};\n\nexport default connect(mapStateToProps)(MetricResults);\n","import { ICanaryExecutionException } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport SourceLinks from './sourceLinks';\n\nimport './reportExplanation.less';\n\ninterface IReportExceptionProps {\n exception: ICanaryExecutionException;\n}\n\nconst ReportException = ({ exception }: IReportExceptionProps) => {\n const errorMessages = [];\n if (exception.details) {\n // error messages can be in an array on the details, or a single field, or possibly both?\n // it's unclear based on Orca where the error message might be\n const { error, errors } = exception.details;\n if (error) {\n errorMessages.push(error);\n }\n if (errors?.length) {\n errors.forEach((m: string) => errorMessages.push(m));\n }\n }\n // if there were no errors, set a default message\n if (!errorMessages.length) {\n errorMessages.push('No error message provided. Click the \"Report\" link to see more details.');\n }\n\n return (\n <>\n <h3 className=\"text-center\">Canary report failed</h3>\n <dl>\n <dt>Details</dt>\n <dd>\n {errorMessages.map((message, i) => (\n <div key={i}>\n <code>{message}</code>\n </div>\n ))}\n </dd>\n <dt>Source</dt>\n <dd>\n <SourceLinks />\n </dd>\n </dl>\n </>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n exception: state.selectedRun.run.exception,\n});\n\nexport default connect(mapStateToProps)(ReportException);\n","import { ICanaryExecutionStatusResult } from 'kayenta/domain/ICanaryExecutionStatusResult';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport './reportExplanation.less';\n\ninterface IReportMetadata {\n run: ICanaryExecutionStatusResult;\n}\n\nconst getReason = (run: ICanaryExecutionStatusResult): string =>\n run?.result?.judgeResult?.score?.classificationReason ?? null;\n\nconst ReportExplanation = ({ run }: IReportMetadata) => {\n const classificationReason = getReason(run);\n\n if (classificationReason) {\n return (\n <section>\n <div className=\"report-explanation\">{classificationReason}</div>\n </section>\n );\n }\n return null;\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n run: state.selectedRun.run,\n});\n\nexport default connect(mapStateToProps)(ReportExplanation);\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nconst ARROW_CLASS = 'arrow-down';\n\nexport interface IHeaderArrowProps {\n arrowColor: string;\n className?: string;\n}\n\nexport default ({ arrowColor, className }: IHeaderArrowProps) => (\n <div className={classNames(ARROW_CLASS, className)} style={{ borderTopColor: arrowColor }} />\n);\n","import classNames from 'classnames';\nimport { ICanaryJudgeScore, ICanaryScoreThresholds } from 'kayenta/domain';\nimport * as React from 'react';\n\nimport { mapGroupToColor } from './colors';\nimport HeaderArrow from './headerArrow';\n\nexport interface IAllMetricResultsHeader {\n onClick: () => void;\n className: string;\n score: ICanaryJudgeScore;\n scoreThresholds: ICanaryScoreThresholds;\n}\n\n/*\n * Clickable header for all metric results.\n */\nexport default ({ className, onClick, score, scoreThresholds }: IAllMetricResultsHeader) => (\n <section className={className}>\n <div\n onClick={onClick}\n style={{\n backgroundColor: mapGroupToColor(score, scoreThresholds),\n }}\n className={classNames('clickable', 'text-center', 'all-metric-results-header')}\n >\n <h3 className=\"heading-3 label\">ALL</h3>\n <HeaderArrow className=\"outer\" arrowColor=\"var(--color-titanium)\" />\n <HeaderArrow className=\"inner\" arrowColor={mapGroupToColor(score, scoreThresholds)} />\n </div>\n </section>\n);\n","import classNames from 'classnames';\nimport * as React from 'react';\n\nimport HeaderArrow from './headerArrow';\n\nexport interface IGroupScoreProps {\n label: string;\n style?: { [key: string]: string };\n onClick: () => void;\n className: string;\n}\n\n/*\n * Component for a labeled, clickable, colored header.\n * */\nexport default ({ label, onClick, style, className }: IGroupScoreProps) => (\n <section style={style} onClick={onClick} className={classNames('clickable', 'text-center', 'group-score', className)}>\n <h3 className=\"heading-3 uppercase label\">{label}</h3>\n <HeaderArrow arrowColor={style.backgroundColor} />\n </section>\n);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { ICanaryJudgeGroupScore, ICanaryScoreThresholds, IGroupWeights } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { canaryExecutionRequestSelector, serializedGroupWeightsSelector } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport ClickableHeader from './clickableHeader';\nimport { mapGroupToColor } from './colors';\n\nexport interface IGroupScoresOwnProps {\n groups: ICanaryJudgeGroupScore[];\n className?: string;\n}\n\ninterface IGroupScoresStateProps {\n groupWeights: IGroupWeights;\n scoreThresholds: ICanaryScoreThresholds;\n selectedGroup: string;\n}\n\ninterface IGroupScoresDispatchProps {\n select: (event: any) => void;\n}\n\n/*\n * Renders list of group scores.\n * */\nconst GroupScores = ({\n groups,\n groupWeights,\n scoreThresholds,\n className,\n select,\n selectedGroup,\n}: IGroupScoresOwnProps & IGroupScoresDispatchProps & IGroupScoresStateProps) => (\n <section className={classNames('horizontal', className)}>\n {groups.map((g) => (\n <ClickableHeader\n key={g.name}\n style={{\n width: `${groupWeights[g.name]}%`, // TODO: at some point (around 4%), the group name doesn't fit.\n backgroundColor: mapGroupToColor(g, scoreThresholds),\n }}\n onClick={() => select(g.name)}\n label={g.name}\n className={classNames('report-score', { active: g.name === selectedGroup })}\n />\n ))}\n </section>\n);\n\nconst mapStateToProps = (state: ICanaryState): IGroupScoresStateProps => ({\n selectedGroup: state.selectedRun.selectedGroup,\n groupWeights: serializedGroupWeightsSelector(state),\n scoreThresholds: canaryExecutionRequestSelector(state).thresholds,\n});\n\nconst mapDispatchToProps = (\n dispatch: Dispatch<ICanaryState>,\n ownProps: IGroupScoresOwnProps,\n): IGroupScoresOwnProps & IGroupScoresDispatchProps => ({\n select: (group: string) => dispatch(Creators.selectReportMetricGroup({ group })),\n ...ownProps,\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(GroupScores);\n","import classNames from 'classnames';\nimport * as Creators from 'kayenta/actions/creators';\nimport { ICanaryJudgeGroupScore, ICanaryJudgeScore, ICanaryScoreThresholds } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { judgeResultSelector, serializedGroupWeightsSelector } from 'kayenta/selectors';\nimport { sortBy } from 'lodash';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\n\nimport AllMetricResultsHeader from './allMetricResultsHeader';\nimport GroupScores from './groupScores';\n\nimport './reportScores.less';\n\ninterface IReportScoresStateProps {\n groups: ICanaryJudgeGroupScore[];\n score: ICanaryJudgeScore;\n scoreThresholds: ICanaryScoreThresholds;\n selectedGroup: string;\n}\n\ninterface IReportScoresDispatchProps {\n clearSelectedGroup: () => void;\n}\n\ninterface IReportScoreParentProps {\n isExpanded: boolean;\n toggleHeader: () => void;\n}\n\n/*\n * Layout for the report scores.\n * */\nconst ReportScores = ({\n groups,\n isExpanded,\n selectedGroup,\n clearSelectedGroup,\n score,\n scoreThresholds,\n toggleHeader,\n}: IReportScoresStateProps & IReportScoresDispatchProps & IReportScoreParentProps) => {\n const chevronStyle = {\n transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',\n transition: 'all ease 0.15s',\n };\n\n return (\n <section className=\"horizontal report-scores\">\n <AllMetricResultsHeader\n onClick={clearSelectedGroup}\n score={score}\n scoreThresholds={scoreThresholds}\n className={classNames('flex-1', 'report-score', { active: !selectedGroup })}\n />\n <GroupScores groups={groups} className=\"flex-12\" />\n <div className=\"kayenta-overview-toggle horizontal middle\" onClick={() => toggleHeader()}>\n {isExpanded ? <p>hide details</p> : <p>show details</p>}\n <span className=\"glyphicon glyphicon-chevron-right\" style={chevronStyle} />\n </div>\n </section>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState): IReportScoresStateProps => ({\n groups: sortBy(\n judgeResultSelector(state).groupScores,\n // Sort by group weight, then by name.\n [(group: ICanaryJudgeGroupScore) => -serializedGroupWeightsSelector(state)[group.name], 'name'],\n ),\n score: judgeResultSelector(state).score,\n scoreThresholds: state.selectedRun.run.canaryExecutionRequest.thresholds,\n selectedGroup: state.selectedRun.selectedGroup,\n});\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>): IReportScoresDispatchProps => ({\n clearSelectedGroup: () => dispatch(Creators.selectReportMetricGroup({ group: null })),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ReportScores);\n","import { ICanaryExecutionStatusResult } from 'kayenta/domain';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ReportHeader from './header';\nimport MetricResults from './metricResults';\nimport ReportException from './reportException';\nimport ReportExplanation from './reportExplanation';\nimport ReportScores from './reportScores';\n\nimport './detail.less';\n\n/*\n * Layout for report detail view.\n * */\n\ninterface IDetailViewProps {\n run: ICanaryExecutionStatusResult;\n}\n\nfunction DetailView({ run }: IDetailViewProps) {\n const [isExpanded, setIsExpanded] = React.useState<boolean>(true);\n\n if (!run.result?.judgeResult.results?.length && run.exception) {\n return <ReportException />;\n }\n\n const toggleDetailHeader = () => {\n setIsExpanded(!isExpanded);\n };\n return (\n <>\n <div className=\"vertical flex-1\">\n {isExpanded && <ReportHeader />}\n <ReportExplanation />\n <ReportScores isExpanded={isExpanded} toggleHeader={toggleDetailHeader} />\n <MetricResults />\n </div>\n </>\n );\n}\n\nconst mapStateToProps = (state: ICanaryState) => ({\n run: state.selectedRun.run,\n});\n\nexport default connect(mapStateToProps)(DetailView);\n","import LoadStatesBuilder from 'kayenta/components/loadStates';\nimport CenteredDetail from 'kayenta/layout/centeredDetail';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { AsyncRequestState } from 'kayenta/reducers/asyncRequest';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ReportDetail from './detail';\n\ninterface IReportLoadStatesStateProps {\n loadState: AsyncRequestState;\n}\n\nconst ReportLoadStates = ({ loadState }: IReportLoadStatesStateProps) => {\n const LoadStates = new LoadStatesBuilder()\n .onFulfilled(<ReportDetail />)\n .onFailed(\n <CenteredDetail>\n <h3 className=\"heading-3\">Could not load canary report.</h3>\n </CenteredDetail>,\n )\n .build();\n\n return <LoadStates state={loadState} />;\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n loadState: state.selectedRun.load,\n});\n\nexport default connect(mapStateToProps)(ReportLoadStates);\n","import * as Creators from 'kayenta/actions/creators';\nimport { ICanaryState } from 'kayenta/reducers';\nimport * as React from 'react';\nimport { connect, Dispatch } from 'react-redux';\nimport { Observable } from 'rxjs/Observable';\nimport { Subscription } from 'rxjs/Subscription';\n\nimport ReportDetailLoadStates from './loadStates';\n\ninterface IResultLoaderStateParamsProps {\n resultIdStream: Observable<IResultLoaderStateParams>;\n}\n\ninterface IResultLoaderDispatchProps {\n loadResult: (stateParams: IResultLoaderStateParams) => void;\n}\n\ninterface IResultLoaderStateParams {\n configId: string;\n runId: string;\n}\n\n/*\n * Top-level .reportDetail state component.\n * Loads result details on changes to /report/:configId/:runId path parameter, renders load states.\n */\nclass ResultDetailLoader extends React.Component<IResultLoaderDispatchProps & IResultLoaderStateParamsProps> {\n private subscription: Subscription;\n\n constructor(props: IResultLoaderDispatchProps & IResultLoaderStateParamsProps) {\n super(props);\n const { resultIdStream, loadResult } = props;\n this.subscription = resultIdStream.subscribe(loadResult);\n }\n\n public componentWillUnmount(): void {\n this.subscription.unsubscribe();\n }\n\n public render() {\n return <ReportDetailLoadStates />;\n }\n}\n\nconst mapDispatchToProps = (dispatch: Dispatch<ICanaryState>): IResultLoaderDispatchProps => ({\n loadResult: (stateParams: IResultLoaderStateParams) =>\n dispatch(\n Creators.loadRunRequest({\n configId: stateParams.configId,\n runId: stateParams.runId,\n }),\n ),\n});\n\nexport default connect(null, mapDispatchToProps)(ResultDetailLoader);\n","import { Field, Form, Formik, FormikActions, FormikErrors, FormikProps, FormikTouched } from 'formik';\nimport { get } from 'lodash';\nimport * as React from 'react';\nimport { Modal } from 'react-bootstrap';\n\nimport {\n Application,\n HelpField,\n HoverablePopover,\n IModalComponentProps,\n MapEditor,\n ModalClose,\n noop,\n ReactModal,\n SubmitButton,\n TetheredSelect,\n} from '@spinnaker/core';\n\nimport { CanaryScores } from '../components/canaryScores';\nimport { ICanaryConfigSummary, ICanaryExecutionRequest, IKayentaAccount, KayentaAccountType } from '../domain';\nimport { startCanaryRun } from '../service/canaryRun.service';\n\nconst RESOURCE_TYPES = {\n prometheus: [\n { label: '', value: '' },\n { label: 'gce_instance', value: 'gce_instance' },\n { label: 'aws_ec2_instance', value: 'aws_ec2_instance' },\n ],\n stackdriver: [\n { label: 'gce_instance', value: 'gce_instance' },\n { label: 'aws_ec2_instance', value: 'aws_ec2_instance' },\n { label: 'gae_app', value: 'gae_app' },\n { label: 'k8s_container', value: 'k8s_container' },\n { label: 'k8s_pod', value: 'k8s_pod' },\n { label: 'k8s_node', value: 'k8s_node' },\n { label: 'gke_container', value: 'gke_container' },\n { label: 'https_lb_rule', value: 'https_lb_rule' },\n { label: 'global', value: 'global' },\n ],\n};\n\nexport interface IManualAnalysisModalProps extends IModalComponentProps {\n title: string;\n application: Application;\n accounts: IKayentaAccount[];\n initialValues?: IManualAnalysisModalFormProps;\n}\n\nexport interface IManualAnalysisModalState {\n showAllControlLocations: boolean;\n showAllExperimentLocations: boolean;\n}\n\nexport interface IManualAnalysisModalFormProps {\n configId: string;\n startTime: string;\n endTime: string;\n step: string;\n baselineScope: string;\n canaryScope: string;\n baselineLocation: string;\n canaryLocation: string;\n extendedScopeParams: { [key: string]: string };\n resourceType: string;\n marginalThreshold: string;\n passThreshold: string;\n metricsAccountName: string;\n storageAccountName: string;\n}\n\nconst transformFormPropsToExecutionRequest = (\n values: IManualAnalysisModalFormProps,\n accounts: IKayentaAccount[],\n): ICanaryExecutionRequest => {\n const step = parseInt(values.step, 10);\n const pass = parseInt(values.passThreshold, 10);\n const marginal = parseInt(values.marginalThreshold, 10);\n\n const metricsAccount = accounts.find(({ name }) => values.metricsAccountName === name);\n\n const accountSpecificParams: { [param: string]: string } = {};\n\n if (values.resourceType) {\n accountSpecificParams.resourceType = values.resourceType;\n }\n\n if (metricsAccount.type === 'atlas' && !values.extendedScopeParams?.type) {\n accountSpecificParams.type = 'cluster';\n }\n\n const extendedScopeParams = { ...values.extendedScopeParams, ...accountSpecificParams };\n\n return {\n scopes: {\n default: {\n controlScope: {\n scope: values.baselineScope,\n start: values.startTime,\n end: values.endTime,\n location: values.baselineLocation,\n step,\n extendedScopeParams,\n },\n experimentScope: {\n scope: values.canaryScope,\n start: values.startTime,\n end: values.endTime,\n location: values.canaryLocation,\n step,\n extendedScopeParams,\n },\n },\n },\n thresholds: {\n pass,\n marginal,\n },\n };\n};\n\nconst defaultValues: IManualAnalysisModalFormProps = {\n configId: null,\n startTime: '',\n endTime: '',\n step: '',\n baselineScope: '',\n canaryScope: '',\n baselineLocation: '',\n canaryLocation: '',\n extendedScopeParams: {},\n resourceType: '',\n marginalThreshold: '',\n passThreshold: '',\n metricsAccountName: '',\n storageAccountName: '',\n};\n\nexport class ManualAnalysisModal extends React.Component<IManualAnalysisModalProps, IManualAnalysisModalState> {\n public static defaultProps: Partial<IManualAnalysisModalProps> = {\n closeModal: noop,\n dismissModal: noop,\n initialValues: defaultValues,\n };\n\n public static show(props: IManualAnalysisModalProps): Promise<any> {\n const modalProps = { dialogClassName: 'modal-lg' };\n return ReactModal.show(ManualAnalysisModal, props, modalProps);\n }\n\n constructor(props: IManualAnalysisModalProps) {\n super(props);\n const { initialValues, accounts } = props;\n const selectedMetricsStore = accounts.find(({ name }) => initialValues.metricsAccountName === name);\n const recommendedLocations = selectedMetricsStore?.recommendedLocations ?? [];\n this.state = {\n showAllControlLocations: !recommendedLocations.includes(initialValues.baselineLocation),\n showAllExperimentLocations: !recommendedLocations.includes(initialValues.canaryLocation),\n };\n }\n\n private validate = (values: IManualAnalysisModalFormProps) => {\n const errors = {} as FormikErrors<IManualAnalysisModalFormProps>;\n let startTime, endTime;\n\n if (!values.configId) {\n errors.configId = 'You must choose a canary config';\n }\n\n if (!values.startTime) {\n errors.startTime = 'You must provide a start time';\n } else {\n try {\n startTime = new Date(values.startTime).getTime();\n } catch (e) {\n errors.startTime = 'Invalid start time. Time must be in ISO-8601 format, e.g. 2018-07-12T22:28:29Z';\n }\n }\n\n if (!values.endTime) {\n errors.endTime = 'You must provide an end time';\n } else {\n try {\n endTime = new Date(values.endTime).getTime();\n } catch (e) {\n errors.endTime = 'Invalid start time. Time must be in ISO-8601 format, e.g. 2018-07-12T22:28:29Z';\n }\n }\n\n if (startTime && endTime && endTime <= startTime) {\n errors.endTime = 'End time must be after start time';\n }\n\n if (!values.step) {\n errors.step = 'You must provide a step value';\n } else if (parseInt(values.step, 10) < 1) {\n errors.step = 'Invalid step value';\n }\n\n if (!values.baselineScope) {\n errors.baselineScope = 'You must provide a baseline scope';\n }\n\n if (!values.canaryScope) {\n errors.canaryScope = 'You must provide a canary scope';\n }\n\n if (!values.baselineLocation) {\n errors.baselineLocation = 'You must provide a baseline location';\n }\n\n if (!values.canaryLocation) {\n errors.canaryLocation = 'You must provide a canary location';\n }\n\n const marginalThreshold = parseInt(values.marginalThreshold, 10);\n const passThreshold = parseInt(values.passThreshold, 10);\n\n if (!values.marginalThreshold) {\n errors.marginalThreshold = 'You must provide a marginal score threshold';\n } else if (marginalThreshold > passThreshold) {\n errors.marginalThreshold = 'Marginal threshold must be greater than passing threshold';\n } else if (marginalThreshold < 1) {\n errors.marginalThreshold = 'Marginal threshold must be positive';\n }\n\n if (!values.passThreshold) {\n errors.passThreshold = 'You must provide a passing score threshold';\n } else if (passThreshold > 100) {\n errors.passThreshold = 'Passing threshold cannot be greater than 100';\n }\n\n if (!values.metricsAccountName) {\n errors.metricsAccountName = 'You must choose a metrics account';\n }\n\n if (!values.storageAccountName) {\n errors.storageAccountName = 'You must choose a storage account';\n }\n\n return errors;\n };\n\n private submit = (values: IManualAnalysisModalFormProps, actions: FormikActions<IManualAnalysisModalFormProps>) => {\n const { configId, metricsAccountName, storageAccountName } = values;\n const { application, accounts } = this.props;\n const executionRequest = transformFormPropsToExecutionRequest(values, accounts);\n\n startCanaryRun(configId, executionRequest, {\n application: application.name,\n metricsAccountName,\n storageAccountName,\n })\n .then(() => {\n actions.setSubmitting(false);\n actions.setStatus({ succeeded: true });\n })\n .catch((error) => {\n actions.setSubmitting(false);\n actions.setStatus({ succeeded: false, error });\n });\n };\n\n public render() {\n const { dismissModal, title, application, accounts, initialValues } = this.props;\n const { showAllControlLocations, showAllExperimentLocations } = this.state;\n\n const canaryConfigs: ICanaryConfigSummary[] = application\n .getDataSource('canaryConfigs')\n .data.slice()\n .sort((a: ICanaryConfigSummary, b: ICanaryConfigSummary) => a.name.localeCompare(b.name));\n const metricsStores = accounts.filter(({ supportedTypes }) =>\n supportedTypes.includes(KayentaAccountType.MetricsStore),\n );\n const objectStores = accounts.filter(({ supportedTypes }) =>\n supportedTypes.includes(KayentaAccountType.ObjectStore),\n );\n // TODO: support a scope name besides 'default'.\n const showAdvancedSettings = metricsStores.length > 1 || objectStores.length > 1;\n\n return (\n <Formik\n initialValues={{\n ...initialValues,\n metricsAccountName: get(metricsStores[0], 'name', ''),\n storageAccountName: get(objectStores[0], 'name', ''),\n }}\n onSubmit={this.submit}\n validate={this.validate}\n isInitialValid={!!initialValues.configId} // if we have a config id initially, everything else should be valid\n render={({\n values,\n touched,\n isValid,\n isSubmitting,\n status,\n setFieldValue,\n setFieldTouched,\n errors,\n }: FormikProps<IManualAnalysisModalFormProps>) => {\n if (get(status, 'succeeded') === true) {\n return (\n <>\n <ModalClose dismiss={dismissModal} />\n <Modal.Header>{<h3>Analysis Started</h3>}</Modal.Header>\n <Modal.Body>\n <p>Analysis started — check the list of reports in a few minutes to view results</p>\n </Modal.Body>\n <Modal.Footer className=\"horizontal right\">\n <button className=\"btn btn-primary\" onClick={dismissModal} type=\"button\">\n Got it\n </button>\n </Modal.Footer>\n </>\n );\n }\n\n const selectedMetricsStore = metricsStores.find(({ name }) => values.metricsAccountName === name);\n const selectedObjectStore = objectStores.find(({ name }) => values.storageAccountName === name);\n\n const recommendedLocations = get(selectedMetricsStore, 'recommendedLocations', []);\n const { canaryLocation, baselineLocation } = initialValues;\n const locations = get(selectedMetricsStore, 'locations', []);\n // Almost every report generated for Atlas uses a simple region for its location. On the backend, Kayenta\n // performs amazing feats to reconcile the location with an Atlas backend, considering the values of several\n // extended params. We are not going to reverse engineer that logic here in order to pick a predefined value\n // from the dropdown: if a location was valid to generate the report, it'll probably be valid when we\n // regenerate it.\n if (canaryLocation && !locations.includes(canaryLocation)) {\n locations.push(canaryLocation);\n }\n if (baselineLocation && !locations.includes(baselineLocation)) {\n locations.push(baselineLocation);\n }\n\n const hasLocationChoices = recommendedLocations.length > 0 || locations.length > 0;\n\n return (\n <Form className=\"form-horizontal\">\n <ModalClose dismiss={dismissModal} />\n <Modal.Header>{title && <h3>{title}</h3>}</Modal.Header>\n <Modal.Body>\n <div className=\"row\">\n <div className=\"col-md-12\">\n <div className=\"container-fluid form-horizontal\">\n <h5>Analysis Configuration</h5>\n <div className=\"horizontal-rule\" />\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">Config Name</div>\n <div className=\"col-md-7\">\n <TetheredSelect\n value={values.configId}\n options={canaryConfigs.map(({ id, name }) => ({ label: name, value: id }))}\n onChange={(item: { label: string; value: string }) =>\n setFieldValue('configId', (item && item.value) || null)\n }\n />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Start Time <HelpField id=\"pipeline.config.canary.startTimeIso\" />\n </div>\n <div className=\"col-md-7\">\n <ValidatedField errors={errors} touched={touched} name=\"startTime\" />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n End Time <HelpField id=\"pipeline.config.canary.endTimeIso\" />\n </div>\n <div className=\"col-md-7\">\n <ValidatedField errors={errors} touched={touched} name=\"endTime\" />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">Step</div>\n <div className=\"col-md-7\">\n <ValidatedField\n errors={errors}\n touched={touched}\n type=\"number\"\n style={{ width: '60px', display: 'inline-block' }}\n name=\"step\"\n />\n <span className=\"form-control-static\"> seconds</span>\n </div>\n </div>\n <h5>Baseline + Canary Pair</h5>\n <div className=\"horizontal-rule\" />\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Baseline <HelpField id=\"pipeline.config.canary.baselineGroup\" />\n </div>\n <div className=\"col-md-7\">\n <ValidatedField name=\"baselineScope\" errors={errors} touched={touched} />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Baseline Location <HelpField id=\"pipeline.config.canary.baselineLocation\" />\n </div>\n <div className=\"col-md-7\">\n <LocationField\n hasLocationChoices={hasLocationChoices}\n showAll={showAllControlLocations}\n recommendedLocations={recommendedLocations}\n locations={locations}\n value={values.baselineLocation}\n field=\"baselineLocation\"\n errors={errors}\n touched={touched}\n onChange={(location) => {\n setFieldTouched('baselineLocation', true);\n setFieldValue('baselineLocation', location);\n }}\n onShowAllChange={(showAll) => this.setState({ showAllControlLocations: showAll })}\n />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Canary <HelpField id=\"pipeline.config.canary.canaryGroup\" />\n </div>\n <div className=\"col-md-7\">\n <ValidatedField errors={errors} touched={touched} name=\"canaryScope\" />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Canary Location <HelpField id=\"pipeline.config.canary.canaryLocation\" />\n </div>\n <div className=\"col-md-7\">\n <LocationField\n hasLocationChoices={hasLocationChoices}\n showAll={showAllExperimentLocations}\n recommendedLocations={recommendedLocations}\n locations={locations}\n value={values.canaryLocation}\n field=\"canaryLocation\"\n errors={errors}\n touched={touched}\n onChange={(location) => {\n setFieldTouched('canaryLocation', true);\n setFieldValue('canaryLocation', location);\n }}\n onShowAllChange={(showAll) => this.setState({ showAllExperimentLocations: showAll })}\n />\n </div>\n </div>\n <h5>Metric Scope</h5>\n <div className=\"horizontal-rule\" />\n {RESOURCE_TYPES.hasOwnProperty(get(selectedMetricsStore, 'type')) && (\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">Resource Type</div>\n <div className=\"col-md-7\">\n <TetheredSelect\n value={values.resourceType}\n options={RESOURCE_TYPES[selectedMetricsStore.type as keyof typeof RESOURCE_TYPES]}\n onChange={(item: { label: string; value: string }) =>\n setFieldValue('resourceType', (item && item.value) || '')\n }\n />\n <ErrorMessage field=\"resourceType\" errors={errors} touched={touched} />\n </div>\n </div>\n )}\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Extended Params <HelpField id=\"pipeline.config.canary.extendedScopeParams\" />\n </div>\n <div className=\"col-md-7\">\n <MapEditor\n model={values.extendedScopeParams}\n onChange={(model) => setFieldValue('extendedScopeParams', model)}\n hiddenKeys={['resourceType']}\n />\n </div>\n </div>\n <h5>Scoring Thresholds</h5>\n <div className=\"horizontal-rule\" />\n <CanaryScores\n onChange={({ unhealthyScore, successfulScore }) => {\n setFieldValue('marginalThreshold', unhealthyScore);\n setFieldValue('passThreshold', successfulScore);\n }}\n successfulHelpFieldId=\"pipeline.config.canary.passingScore\"\n successfulLabel=\"Pass \"\n successfulScore={values.passThreshold}\n unhealthyHelpFieldId=\"pipeline.config.canary.marginalScore\"\n unhealthyLabel=\"Marginal \"\n unhealthyScore={values.marginalThreshold}\n />\n {showAdvancedSettings && (\n <AdvancedSettings\n metricsStores={metricsStores}\n selectedMetricsStore={selectedMetricsStore}\n objectStores={objectStores}\n selectedObjectStore={selectedObjectStore}\n onChange={setFieldValue}\n errors={errors}\n touched={touched}\n />\n )}\n </div>\n </div>\n </div>\n {get(status, 'error') && (\n <div className=\"row\">\n <div className=\"col-md-7 col-md-offset-3\">\n <div className=\"well-compact alert alert-danger\">\n <b>There was a problem starting your analysis:</b>\n <span>{JSON.stringify(status.error.data)}</span>\n </div>\n </div>\n </div>\n )}\n </Modal.Body>\n <Modal.Footer className=\"horizontal right\">\n <button className=\"btn btn-default\" onClick={dismissModal} type=\"button\">\n Cancel\n </button>\n <SubmitFormButton isValid={isValid} isSubmitting={isSubmitting} errors={errors} />\n </Modal.Footer>\n </Form>\n );\n }}\n />\n );\n }\n}\n\nconst SubmitFormButton = ({\n errors,\n isValid,\n isSubmitting,\n}: {\n errors: FormikErrors<any>;\n isValid: boolean;\n isSubmitting: boolean;\n}) => {\n const button = (\n <SubmitButton isDisabled={!isValid} submitting={isSubmitting} isFormSubmit={true} label=\"Start analysis\" />\n );\n const errorMessages = Object.values(errors).map((error: string, i) => <li key={i}>{error}</li>);\n if (isValid || !errorMessages.length) {\n return button;\n }\n\n const popoverComponent = () => (\n <div>\n The following errors must be corrected before submitting:<ul>{errorMessages}</ul>\n </div>\n );\n return (\n <div className=\"sp-margin-s-left\">\n <HoverablePopover Component={popoverComponent}>{button}</HoverablePopover>\n </div>\n );\n};\n\nconst combineLocations = (includeAll: boolean, recommendedLocations: string[], locations: string[]) => {\n if (includeAll) {\n return [...new Set(recommendedLocations.concat(locations))];\n }\n\n return recommendedLocations.length > 0 ? recommendedLocations : locations;\n};\n\ninterface ILocationFieldProps {\n hasLocationChoices: boolean;\n showAll: boolean;\n recommendedLocations: string[];\n locations: string[];\n value: string;\n onChange: (location: string) => any;\n onShowAllChange: (showAll: boolean) => any;\n errors: FormikErrors<IManualAnalysisModalFormProps>;\n touched: FormikTouched<IManualAnalysisModalFormProps>;\n field: keyof IManualAnalysisModalFormProps;\n}\n\nconst LocationField = ({\n hasLocationChoices,\n showAll,\n recommendedLocations,\n locations,\n value,\n onChange,\n onShowAllChange,\n errors,\n touched,\n field,\n}: ILocationFieldProps) => {\n if (!hasLocationChoices) {\n return <ValidatedField name={field} errors={errors} touched={touched} />;\n }\n const combinedLocations = combineLocations(showAll, recommendedLocations, locations).sort();\n const options = combinedLocations.map((location) => ({ label: location, value: location }));\n\n return (\n <>\n <TetheredSelect\n clearable={false}\n value={value}\n options={options}\n onChange={(item: { label: string; value: string }) => onChange((item && item.value) || '')}\n />\n <ErrorMessage field={field} errors={errors} touched={touched} />\n {recommendedLocations.length > 0 && locations.length > 0 && (\n <div className=\"pull-right\">\n <button\n type=\"button\"\n className=\"link\"\n onClick={() => {\n onShowAllChange(!showAll);\n if (!combineLocations(!showAll, recommendedLocations, locations).includes(value)) {\n onChange('');\n }\n }}\n >\n {showAll ? 'Only show recommended locations' : 'Show all locations'}\n </button>\n </div>\n )}\n </>\n );\n};\n\ninterface IAdvancedSettingsProps {\n metricsStores: IKayentaAccount[];\n objectStores: IKayentaAccount[];\n selectedMetricsStore: IKayentaAccount;\n selectedObjectStore: IKayentaAccount;\n onChange: (field: 'metricsAccountName' | 'storageAccountName', value: string) => any;\n errors: FormikErrors<IManualAnalysisModalFormProps>;\n touched: FormikTouched<IManualAnalysisModalFormProps>;\n}\n\nconst AdvancedSettings = ({\n metricsStores,\n selectedMetricsStore,\n objectStores,\n selectedObjectStore,\n onChange,\n errors,\n touched,\n}: IAdvancedSettingsProps) => {\n return (\n <>\n <h5>Advanced Settings</h5>\n <div className=\"horizontal-rule\" />\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Metrics Account <HelpField id=\"pipeline.config.metricsAccount\" />\n </div>\n <div className=\"col-md-7\">\n <TetheredSelect\n clearable={false}\n value={get(selectedMetricsStore, 'name')}\n options={metricsStores.map(({ name }) => ({ label: name, value: name }))}\n onChange={(item: { label: string; value: string }) =>\n onChange('metricsAccountName', (item && item.value) || '')\n }\n />\n <ErrorMessage field=\"metricsAccountName\" errors={errors} touched={touched} />\n </div>\n </div>\n <div className=\"form-group\">\n <div className=\"col-md-3 sm-label-right\">\n Storage Account <HelpField id=\"pipeline.config.storageAccount\" />\n </div>\n <div className=\"col-md-7\">\n <TetheredSelect\n clearable={false}\n value={get(selectedObjectStore, 'name')}\n options={objectStores.map(({ name }) => ({ label: name, value: name }))}\n onChange={(item: { label: string; value: string }) =>\n onChange('storageAccountName', (item && item.value) || '')\n }\n />\n <ErrorMessage field=\"storageAccountName\" errors={errors} touched={touched} />\n </div>\n </div>\n </>\n );\n};\n\ninterface IErrorMessageProps {\n field: keyof IManualAnalysisModalFormProps;\n errors: FormikErrors<IManualAnalysisModalFormProps>;\n touched: FormikTouched<IManualAnalysisModalFormProps>;\n}\n\nconst ErrorMessage = ({ field, errors, touched }: IErrorMessageProps) => {\n if (!touched[field] || !errors[field]) {\n return null;\n }\n return <div className=\"error-message\">{errors[field]}</div>;\n};\n\nexport interface IValidatedFieldProps {\n errors: FormikErrors<IManualAnalysisModalFormProps>;\n touched: FormikTouched<IManualAnalysisModalFormProps>;\n name: keyof IManualAnalysisModalFormProps;\n [field: string]: any;\n}\n\nconst ValidatedField = (props: IValidatedFieldProps) => {\n const { errors, name, touched } = props;\n return (\n <>\n <Field {...props} className=\"form-control input-sm\" required={touched[name]} error={errors[name]} />\n <ErrorMessage field={name} errors={errors} touched={touched} />\n </>\n );\n};\n","import { useSref } from '@uirouter/react';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { resolveConfigIdFromExecutionId } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\ninterface IConfigLinkOwnProps {\n configName: string;\n executionId: string;\n application: string;\n}\n\ninterface IConfigLinkStateProps {\n configId: string;\n}\n\nexport const ConfigLink = ({ configId, configName }: IConfigLinkOwnProps & IConfigLinkStateProps) => {\n const sref = useSref('^.^.canaryConfig.configDetail', { id: configId });\n return <a {...sref}>{configName}</a>;\n};\n\nconst mapStateToProps = (\n state: ICanaryState,\n ownProps: IConfigLinkOwnProps,\n): IConfigLinkStateProps & IConfigLinkOwnProps => {\n return {\n configId: resolveConfigIdFromExecutionId(state, ownProps.executionId),\n ...ownProps,\n };\n};\n\nexport default connect(mapStateToProps)(ConfigLink);\n","import { useSref } from '@uirouter/react';\nimport * as React from 'react';\n\ninterface IParentPipelineLinkProps {\n parentPipelineExecutionId: string;\n application: string;\n}\n\nexport const PipelineLink = ({ parentPipelineExecutionId, application }: IParentPipelineLinkProps) => {\n const sref = useSref('home.applications.application.pipelines.executionDetails.execution', {\n application,\n executionId: parentPipelineExecutionId,\n });\n return <a {...sref}>Pipeline</a>;\n};\n","import { useSref } from '@uirouter/react';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { resolveConfigIdFromExecutionId } from 'kayenta/selectors';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\ninterface IReportLinkOwnProps {\n configName: string;\n executionId: string;\n application: string;\n children?: React.ReactNode;\n}\n\ninterface IReportLinkStateProps {\n configId: string;\n}\n\nexport const ReportLink = ({ configId, executionId, children }: IReportLinkOwnProps & IReportLinkStateProps) => {\n const sref = useSref('^.reportDetail', { configId, runId: executionId });\n return <a {...sref}>{children}</a>;\n};\n\nconst mapStateToProps = (\n state: ICanaryState,\n ownProps: IReportLinkOwnProps,\n): IReportLinkStateProps & IReportLinkOwnProps => {\n return {\n configId: resolveConfigIdFromExecutionId(state, ownProps.executionId),\n ...ownProps,\n };\n};\n\nexport default connect(mapStateToProps)(ReportLink);\n","import { CanarySettings } from 'kayenta/canary.settings';\nimport {\n CANARY_EXECUTION_NO_PIPELINE_STATUS,\n ICanaryExecutionStatusResult,\n ICanaryMetricConfig,\n ICanaryScopesByName,\n IKayentaAccount,\n} from 'kayenta/domain';\nimport CenteredDetail from 'kayenta/layout/centeredDetail';\nimport FormattedDate from 'kayenta/layout/formattedDate';\nimport { ITableColumn, NativeTable } from 'kayenta/layout/table';\nimport { ManualAnalysisModal } from 'kayenta/manualAnalysis/ManualAnalysisModal';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { get, isEqual } from 'lodash';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport { Application, ReactInjector, relativeTime, Spinner, Tooltip } from '@spinnaker/core';\n\nimport ConfigLink from './configLink';\nimport Score from '../detail/score';\nimport { PipelineLink } from './pipelineLink';\nimport ReportLink from './reportLink';\n\nimport './executionList.less';\n\n// Both this and the atlas-specific logic in `getScopeLocations` shouldn't really\n// be in this file, and probably shouldn't even be referenced directly.\n// Ideally this and any other metric store customizations should happen in a registry\n// of store-specific transformation functions or similar.\nconst isAtlasScope = (scope: string, metrics: ICanaryMetricConfig[]) =>\n metrics.some(({ query, scopeName }) => scopeName === scope && query.type === 'atlas');\n\nconst getScopeLocations = (scopes: ICanaryScopesByName, metrics: ICanaryMetricConfig[]) =>\n Object.keys(scopes).reduce((acc, scopeName) => {\n const { controlScope, experimentScope } = scopes[scopeName];\n const isAtlas = isAtlasScope(scopeName, metrics);\n\n // When atlas metrics have the dataset param set to global,\n // the location field is not accurate.\n if (isAtlas && get(controlScope, 'extendedScopeParams.dataset') === 'global') {\n acc.add('Global');\n } else {\n acc.add(controlScope.location);\n }\n if (isAtlas && get(experimentScope, 'extendedScopeParams.dataset') === 'global') {\n acc.add('Global');\n } else {\n acc.add(experimentScope.location);\n }\n\n return acc;\n }, new Set<string>());\n\nconst baseColumns: Array<ITableColumn<ICanaryExecutionStatusResult>> = [\n {\n label: 'Summary',\n getContent: (execution) => (\n <div>\n <ReportLink\n configName={execution.config.name}\n executionId={execution.pipelineId}\n application={execution.application}\n >\n <Score score={execution.result.judgeResult.score} showClassification={false} inverse={true} />\n {' '}\n <FormattedDate dateIso={execution.startTimeIso} />\n </ReportLink>\n {execution.startTimeIso && (\n <div className=\"color-text-caption body-small\">\n {relativeTime(new Date(execution.startTimeIso).getTime())}\n </div>\n )}\n </div>\n ),\n },\n {\n label: 'Locations',\n getContent: ({ canaryExecutionRequest: { scopes }, config: { metrics } }) => {\n const locations = [...getScopeLocations(scopes, metrics)];\n\n return (\n <div className=\"vertical\">\n {locations.map((location) => (\n <span key={location}>{location}</span>\n ))}\n </div>\n );\n },\n },\n {\n label: 'Config',\n getContent: (execution) => (\n <ConfigLink\n configName={execution.config.name}\n executionId={execution.pipelineId}\n application={execution.application}\n />\n ),\n },\n {\n label: 'Scopes',\n getContent: ({ canaryExecutionRequest: { scopes } }) => {\n const baselineScopeNames = Object.keys(scopes).reduce(\n (acc, scope) => acc.add(scopes[scope].controlScope.scope),\n new Set<string>(),\n );\n const canaryScopeNames = Object.keys(scopes).reduce(\n (acc, scope) => acc.add(scopes[scope].experimentScope.scope),\n new Set<string>(),\n );\n\n const areScopesIdentical = isEqual(baselineScopeNames, canaryScopeNames);\n\n const styles: React.CSSProperties = { maxWidth: '350px', wordBreak: 'break-all' };\n if (areScopesIdentical) {\n return (\n <div className=\"vertical\" style={styles}>\n {[...canaryScopeNames].map((scope) => (\n <span key={scope}>{scope}</span>\n ))}\n </div>\n );\n } else {\n return (\n <div className=\"vertical\" style={styles}>\n <span className=\"heading-6 uppercase color-text-caption\">Baseline</span>\n {[...baselineScopeNames].map((scope) => (\n <span key={scope}>{scope}</span>\n ))}\n <span className=\"heading-6 uppercase color-text-caption\" style={{ marginTop: '5px' }}>\n Canary\n </span>\n {[...canaryScopeNames].map((scope) => (\n <span key={scope}>{scope}</span>\n ))}\n </div>\n );\n }\n },\n },\n {\n getContent: ({ parentPipelineExecutionId, application }) =>\n parentPipelineExecutionId &&\n parentPipelineExecutionId !== CANARY_EXECUTION_NO_PIPELINE_STATUS && (\n <PipelineLink parentPipelineExecutionId={parentPipelineExecutionId} application={application} />\n ),\n },\n];\n\nconst getTableColumns = (application: Application, accounts: IKayentaAccount[]) => {\n if (!CanarySettings.manualAnalysisEnabled) {\n return baseColumns;\n }\n return baseColumns.concat([\n {\n label: 'Actions',\n getContent: (execution) => (\n <Tooltip value=\"Re-run analysis\">\n <button className=\"link\" onClick={() => rerunAnalysis(execution, application, accounts)}>\n <i className=\"fas fa-redo-alt\" />\n </button>\n </Tooltip>\n ),\n },\n ]);\n};\n\nconst rerunAnalysis = (\n execution: ICanaryExecutionStatusResult,\n application: Application,\n accounts: IKayentaAccount[],\n) => {\n const { controlScope, experimentScope } = Object.values(execution.canaryExecutionRequest.scopes)[0];\n const step = `${controlScope.step ?? 60}`;\n ManualAnalysisModal.show({\n title: 'Start Manual Analysis',\n application,\n accounts,\n initialValues: {\n configId: execution.canaryConfigId,\n startTime: controlScope.start,\n endTime: controlScope.end,\n step,\n baselineScope: controlScope.scope,\n canaryScope: experimentScope.scope,\n baselineLocation: controlScope.location,\n canaryLocation: experimentScope.location,\n extendedScopeParams: controlScope.extendedScopeParams,\n resourceType: controlScope.resourceType,\n marginalThreshold: `${execution.canaryExecutionRequest.thresholds.marginal}`,\n passThreshold: `${execution.canaryExecutionRequest.thresholds.pass}`,\n metricsAccountName: execution.metricsAccountName,\n storageAccountName: execution.storageAccountName,\n },\n });\n};\n\nconst startManualAnalysis = (application: Application, accounts: IKayentaAccount[]) => {\n ManualAnalysisModal.show({\n title: 'Start Manual Analysis',\n application,\n accounts,\n });\n};\n\ninterface IExecutionListTableStateProps {\n executions: ICanaryExecutionStatusResult[];\n application: Application;\n accounts: IKayentaAccount[];\n executionsCount: number;\n}\n\nconst TableRows = ({\n executions,\n application,\n accounts,\n}: {\n executions: ICanaryExecutionStatusResult[];\n application: Application;\n accounts: IKayentaAccount[];\n}) => {\n if (!application.getDataSource('canaryExecutions').loaded) {\n return (\n <CenteredDetail>\n <div className=\"horizontal center middle spinner-container\">\n <Spinner />\n </div>\n </CenteredDetail>\n );\n }\n if (!executions || !executions.length) {\n return (\n <CenteredDetail>\n <h3 className=\"heading-3\">No canary execution history for this application.</h3>\n </CenteredDetail>\n );\n }\n return (\n <NativeTable\n rows={executions}\n className=\"flex-1 execution-list-table\"\n columns={getTableColumns(application, accounts)}\n rowKey={(execution) => execution.pipelineId}\n />\n );\n};\n\nconst updateExecutionsCount = (event: React.ChangeEvent<HTMLSelectElement>) => {\n ReactInjector.$state.go('.', { count: Number(event.target.value) });\n};\n\nconst ExecutionListTable = ({ executions, application, accounts, executionsCount }: IExecutionListTableStateProps) => {\n React.useEffect(() => {\n const dataSource = application.getDataSource('canaryExecutions');\n if (!dataSource.active) {\n dataSource.activate();\n }\n dataSource.refresh();\n return () => dataSource.deactivate();\n }, [application, executionsCount]);\n\n const countOptions: number[] = CanarySettings.executionsCountOptions ?? [20, 50, 100, 200];\n if (!countOptions.includes(executionsCount)) {\n countOptions.push(executionsCount);\n countOptions.sort((a, b) => a - b);\n }\n\n return (\n <div className=\"vertical execution-list-container\">\n <div className=\"horizontal space-between form-inline\">\n <div className=\"form-group\">\n {countOptions.length > 1 && (\n <>\n <span className=\"sp-margin-s-right\">Showing</span>\n <select className=\"form-control input-sm\" onChange={updateExecutionsCount}>\n {countOptions.map((o) => (\n <option selected={executionsCount === o} value={o}>\n {o}\n </option>\n ))}\n </select>\n <span className=\"sp-margin-s-left\">most recent reports</span>\n </>\n )}\n </div>\n {CanarySettings.manualAnalysisEnabled && (\n <button\n style={{ alignSelf: 'flex-end', flexShrink: 0 }}\n className=\"primary\"\n onClick={() => startManualAnalysis(application, accounts)}\n >\n <i className=\"fa fa-play\" /> Start Manual Analysis\n </button>\n )}\n </div>\n <TableRows executions={executions} application={application} accounts={accounts} />\n </div>\n );\n};\n\nconst mapStateToProps = (state: ICanaryState) => ({\n executions: Object.values(state.data.executions.data).filter((e) => e.result),\n application: state.data.application,\n accounts: state.data.kayentaAccounts.data,\n executionsCount: state.app.executionsCount,\n});\n\nexport default connect(mapStateToProps)(ExecutionListTable);\n","import LoadStatesBuilder from 'kayenta/components/loadStates';\nimport CenteredDetail from 'kayenta/layout/centeredDetail';\nimport { ICanaryState } from 'kayenta/reducers';\nimport { AsyncRequestState } from 'kayenta/reducers/asyncRequest';\nimport * as React from 'react';\nimport { connect } from 'react-redux';\n\nimport ExecutionListTable from './table';\n\ninterface IExecutionListLoadStatesStateProps {\n loadState: AsyncRequestState;\n}\n\nconst ExecutionListLoadStates = ({ loadState }: IExecutionListLoadStatesStateProps) => {\n const LoadStates = new LoadStatesBuilder()\n .onFulfilled(<ExecutionListTable />)\n .onFailed(\n <CenteredDetail>\n <h3 className=\"heading-3\">Could not load canary execution history.</h3>\n </CenteredDetail>,\n )\n .build();\n return <LoadStates state={loadState} />;\n};\n\nconst mapStateToProps = (state: ICanaryState) => {\n return {\n loadState: state.data.executions.load,\n };\n};\n\nexport default connect(mapStateToProps)(ExecutionListLoadStates);\n","import { UIView } from '@uirouter/react';\nimport * as React from 'react';\n\nexport default () => {\n const noWrap = { wrap: false };\n return (\n <div className=\"vertical flex-1\">\n <UIView {...noWrap} name=\"detail\" />\n </div>\n );\n};\n","import { UIRouter } from '@uirouter/core';\nimport 'kayenta/metricStore/index';\nimport 'kayenta/report/detail/graph/semiotic';\n\nimport { ApplicationStateProvider } from '@spinnaker/core';\n\n// This import has a side effect of instantiating the canary redux store\nimport { bridgeKayentaDataSourceToReduxStore } from './kayenta/canary.dataSource.bridge';\nimport { registerStates, registerTransitionHooks } from './kayenta/navigation/canary.states';\n\nexport function lazyInitializeKayenta(applicationState: ApplicationStateProvider, uiRouter: UIRouter) {\n const { stateRegistry } = uiRouter;\n\n // deregister the stub states, starting with the deepest children first\n stateRegistry\n .get()\n .filter((state) => state.name.match(/home.(project|applications).application.canary/))\n .sort((a, b) => b.name.length - a.name.length)\n .forEach((stub) => stateRegistry.deregister(stub));\n\n // Now register the full states\n registerStates(uiRouter, applicationState);\n registerTransitionHooks(uiRouter);\n\n // Patch the data source so data flows into the redux store\n bridgeKayentaDataSourceToReduxStore();\n\n return {};\n}\n","import { Transition, UIRouter } from '@uirouter/core';\nimport * as Creators from 'kayenta/actions/creators';\nimport Canary, { canaryStore } from 'kayenta/canary';\nimport ConfigDetailLoader from 'kayenta/edit/configDetailLoader';\nimport CanaryConfigEdit from 'kayenta/edit/edit';\nimport CanaryConfigSave from 'kayenta/edit/save';\nimport SelectConfig from 'kayenta/edit/selectConfig';\nimport ResultDetailLoader from 'kayenta/report/detail/detailLoader';\nimport ExecutionListLoadStates from 'kayenta/report/list/loadStates';\nimport Report from 'kayenta/report/report';\nimport { $rootScope } from 'ngimport';\n\nimport { ApplicationStateProvider, INestedState } from '@spinnaker/core';\n\nimport '../canary.dataSource.bridge';\nimport { CanarySettings } from '../canary.settings';\n\nexport function registerStates($uiRouter: UIRouter, applicationStateProvider: ApplicationStateProvider) {\n const configDetail: INestedState = {\n name: 'configDetail',\n url: '/:id?copy&new',\n views: {\n detail: {\n component: ConfigDetailLoader,\n $type: 'react',\n },\n footer: {\n component: CanaryConfigSave,\n $type: 'react',\n },\n },\n params: {\n copy: { type: 'boolean', value: false, squash: true },\n new: { type: 'boolean', value: false, squash: true },\n },\n resolve: [\n {\n token: 'configNameStream',\n deps: [UIRouter],\n resolveFn: (uiRouter: any) => uiRouter.globals.params$,\n },\n ],\n };\n\n const configDefault: INestedState = {\n name: 'configDefault',\n url: '',\n views: {\n detail: {\n component: SelectConfig,\n $type: 'react',\n },\n },\n };\n\n const config: INestedState = {\n name: 'canaryConfig',\n url: '/config',\n views: {\n canary: {\n component: CanaryConfigEdit,\n $type: 'react',\n },\n },\n children: [configDefault, configDetail],\n redirectTo: (transition) => transition.to().name + '.configDefault',\n };\n\n const reportDetail: INestedState = {\n name: 'reportDetail',\n url: '/:configId/:runId',\n views: {\n detail: {\n component: ResultDetailLoader,\n $type: 'react',\n },\n },\n resolve: [\n {\n token: 'resultIdStream',\n deps: [UIRouter],\n resolveFn: (uiRouter: any) => uiRouter.globals.params$,\n },\n ],\n };\n\n const reportDefault: INestedState = {\n name: 'reportDefault',\n url: '',\n views: {\n detail: {\n component: ExecutionListLoadStates,\n $type: 'react',\n },\n },\n };\n\n const report: INestedState = {\n name: 'report',\n url: '/report?count',\n views: {\n canary: {\n component: Report,\n $type: 'react',\n },\n },\n params: {\n count: {\n type: 'int',\n value: CanarySettings.defaultExecutionCount ?? CanarySettings.executionsCountOptions?.[0] ?? 20,\n squash: true,\n },\n },\n children: [reportDetail, reportDefault],\n redirectTo: (transition) => transition.to().name + '.reportDefault',\n };\n\n const canaryRoot: INestedState = {\n abstract: true,\n name: 'canary',\n url: '/canary',\n views: {\n insight: {\n component: Canary,\n $type: 'react',\n },\n },\n data: {\n pageTitleSection: {\n title: 'Canary',\n },\n },\n children: [config, report],\n };\n\n applicationStateProvider.addChildState(canaryRoot);\n}\n\nexport function registerTransitionHooks($uiRouter: UIRouter) {\n // When leaving a config detail state, clear that config.\n $uiRouter.transitionService.onBefore(\n {\n from: '**.configDetail.**',\n to: (state) => !state.name.includes('configDetail'),\n },\n () => {\n canaryStore.dispatch(Creators.clearSelectedConfig());\n },\n );\n\n // Prompts confirmation for page navigation if config hasn't been saved.\n // Should be possible with a $uiRouter transition hook, but it's not.\n $rootScope.$on('$stateChangeStart', (event) => {\n const state = canaryStore.getState();\n const warningMessage = 'You have unsaved changes.\\nAre you sure you want to navigate away from this page?';\n if (state.selectedConfig && !state.selectedConfig.isInSyncWithServer) {\n if (!window.confirm(warningMessage)) {\n event.preventDefault();\n }\n }\n });\n\n // Prompts confirmation for page reload if config hasn't been saved.\n $uiRouter.transitionService.onEnter({ to: '**.configDetail.**' }, () => {\n window.onbeforeunload = () => {\n const state = canaryStore.getState();\n // Must return `null` if reload should be allowed.\n return (state.selectedConfig && !state.selectedConfig.isInSyncWithServer) || null;\n };\n });\n\n // Clears reload hook when leaving canary config view.\n $uiRouter.transitionService.onExit({ from: '**.configDetail.**' }, () => {\n window.onbeforeunload = undefined;\n });\n\n $uiRouter.transitionService.onSuccess({ to: '**.report.**' }, (transition: Transition) => {\n if (transition.params('from').count !== transition.params('to').count) {\n canaryStore.dispatch(Creators.setExecutionsCount({ count: transition.params('to').count }));\n }\n });\n}\n","import { Application } from '@spinnaker/core';\n\nimport * as Creators from './actions/creators';\nimport { canaryStore } from './canary';\nimport { stub } from './canary.dataSource.stub';\nimport { ICanaryExecutionStatusResult } from './domain/ICanaryExecutionStatusResult';\nimport { ICanaryConfigSummary, IJudge } from './domain/index';\nimport { listCanaryExecutions } from './service/canaryRun.service';\n\nexport function bridgeKayentaDataSourceToReduxStore() {\n stub.afterConfigsLoaded = (application: Application) => {\n if (application !== canaryStore.getState().data.application) {\n return;\n }\n canaryStore.dispatch(\n Creators.updateConfigSummaries({\n configSummaries: application.getDataSource('canaryConfigs').data as ICanaryConfigSummary[],\n }),\n );\n };\n\n stub.afterJudgesLoaded = (application: Application) => {\n if (application !== canaryStore.getState().data.application) {\n return;\n }\n canaryStore.dispatch(\n Creators.updateJudges({\n judges: application.getDataSource('canaryJudges').data as IJudge[],\n }),\n );\n };\n\n stub.loadCanaryExecutions = (application: Application) => {\n const listExecutionsRequest = listCanaryExecutions(application.name);\n\n listExecutionsRequest.catch((error) => {\n canaryStore.dispatch(Creators.loadExecutionsFailure({ error }));\n });\n\n return listExecutionsRequest;\n };\n\n stub.afterCanaryExecutionsLoaded = (application: Application) => {\n if (application !== canaryStore.getState().data.application) {\n return;\n }\n canaryStore.dispatch(\n Creators.loadExecutionsSuccess({\n executions: application.getDataSource('canaryExecutions').data as ICanaryExecutionStatusResult[],\n }),\n );\n };\n}\n"],"names":["TableHeader","columns","className","React","classNames","map","c","i","key","label","width","hide","labelClassName","Table","rows","rowKey","tableBodyClassName","rowClassName","onRowClick","customRow","headerClassName","TableRow","row","onClick","horizontal","getContent","r","compose","_len","arguments","length","funcs","Array","_key","arg","reduce","a","b","apply","undefined","_extends","Object","assign","target","source","prototype","hasOwnProperty","call","SemioticGraphLazy","lazy","import","supportedGraphTypes","GraphType","TimeSeries","Histogram","BoxPlot","metricSetPairGraphService","register","name","handlesGraphType","type","includes","getGraph","props","Suspense","fallback","Spinner","e","t","super_","create","constructor","value","enumerable","writable","configurable","defineProperty","this","n","o","f","slice","push","u","N","Math","isArray","toString","test","l","s","d","p","g","prefilter","normalize","h","y","v","lhs","m","rhs","filter","w","x","keys","S","forEach","indexOf","isNaN","path","kind","index","item","F","color","join","groupCollapsed","group","log","text","concat","P","groupEnd","timestamp","duration","String","toFixed","logger","actionTransformer","titleFormatter","collapsed","colors","level","diff","started","startedTime","action","prevState","error","took","nextState","k","j","D","E","title","A","O","C","L","T","M","_","stateTransformer","errorTransformer","predicate","logErrors","diffPredicate","getState","dispatch","console","now","Date","getHours","getMinutes","getSeconds","getMilliseconds","performance","Symbol","iterator","from","global","window","DeepDiff","defineProperties","observableDiff","applyDiff","applyChange","revertChange","isConflict","noConflict","transformer","defaults","createLogger","default","exports","__window","__self","self","WorkerGlobalScope","_root","Error","tryCatchTarget","tryCatcher","errorObject_1","errorObject","fn","__extends","__","_super","UnsubscriptionError","errors","err","stack","message","Subscription","unsubscribe","closed","_parent","_parents","_subscriptions","_unsubscribe","hasErrors","_a","len","remove","isFunction_1","isFunction","tryCatch_1","tryCatch","UnsubscriptionError_1","flattenUnsubscriptionErrors","isArray_1","sub","isObject_1","isObject","add","teardown","EMPTY","subscription","_addParent","tmp","subscriptions","subscriptionIndex","splice","parent","empty","errs","next","complete","root_1","root","for","rxSubscriber","Subscriber","destinationOrNext","syncErrorValue","syncErrorThrown","syncErrorThrowable","isStopped","destination","Observer_1","SafeSubscriber","rxSubscriber_1","subscriber","_next","_error","_complete","_unsubscribeAndRecycle","Subscription_1","_parentSubscriber","observerOrNext","context","bind","_context","__tryOrSetError","__tryOrUnsub","_this","wrappedComplete","nextOrObserver","Subscriber_1","getSymbolObservable","$$observable","observable","pipeFromArray","fns","input","prev","noop_1","noop","_i","Observable","subscribe","_isScalar","_subscribe","lift","operator","sink","toSubscriber_1","toSubscriber","_trySubscribe","PromiseCtor","Rx","config","Promise","resolve","reject","observable_1","pipe","operations","pipe_1","toPromise","ObjectUnsubscribedError","SubjectSubscription","subject","observers","subscriberIndex","SubjectSubscriber","Subject","hasError","thrownError","AnonymousSubject","ObjectUnsubscribedError_1","copy","SubjectSubscription_1","asObservable","Observable_1","project","thisArg","TypeError","MapOperator","MapSubscriber","count","result","map_1","OuterSubscriber","notifyNext","outerValue","innerValue","outerIndex","innerIndex","innerSub","notifyError","notifyComplete","then","symbolIteratorPonyfill","Set_1","Set","Map_1","Map","getOwnPropertyNames","InnerSubscriber","outerSubscriber","InnerSubscriber_1","isArrayLike_1","isPromise_1","isPromise","setTimeout","iterator_1","done","obs","msg","resultSelector","SwitchMapOperator","SwitchMapSubscriber","_innerSub","innerSubscription","subscribeToResult_1","subscribeToResult","_tryNotifyNext","OuterSubscriber_1","switchMap_1","switchMap","ScalarObservable","scheduler","state","schedule","EmptyObservable","ArrayObservable","array","of","isScheduler_1","isScheduler","pop","ScalarObservable_1","EmptyObservable_1","ArrayObservable_1","dispatchNext","dispatchError","PromiseObservable","promise","IteratorObservable","getIterator","return","StringIterator","str","idx","charAt","ArrayIterator","arr","isFinite","valueAsNumber","sign","floor","abs","maxSafeInteger","toLength","obj","pow","ArrayLikeObservable","arrayLike","Notification","hasValue","observe","observer","do","accept","toObservable","throw","createNext","undefinedValueNotification","createError","createComplete","completeNotification","delay","ObserveOnOperator","ObserveOnSubscriber","notification","scheduleMessage","ObserveOnMessage","Notification_1","FromObservable","ish","PromiseObservable_1","IteratorObservable_1","ArrayLikeObservable_1","observeOn_1","FilterOperator","FilterSubscriber","filter_1","_createClass","descriptor","Constructor","protoProps","staticProps","ActionsObservable","_Observable","actionsSubject","instance","_classCallCheck","ReferenceError","_possibleConstructorReturn","__proto__","getPrototypeOf","subClass","superClass","setPrototypeOf","_inherits","_of","actions","_from","_ref","EPIC_END","defaultOptions","adapter","action$","output","concurrent","Number","POSITIVE_INFINITY","MergeMapOperator","MergeMapSubscriber","hasCompleted","buffer","active","_tryNext","_notifyResultSelector","shift","mergeMap_1","mergeMap","identity_1","identity","mergeStatic","observables","last","mergeAll_1","mergeAll","merge_1","merge","_toConsumableArray","arr2","from_1","concatAll_1","concatAll","of_1","concat_1","ForkJoinObservable","sources","ForkJoinSubscriber","completed","haveValues","total","values","_hasValue","forkJoin","forkJoin_1","fromPromise","fromPromise_1","selector","CatchOperator","caught","CatchSubscriber","err2","catchError_1","catchError","catch","catch_1","_catch","concatMap_1","concatMap","Action","work","AsyncAction","pending","id","recycleAsyncId","requestAsyncId","setInterval","flush","clearInterval","execute","_execute","errored","errorValue","Action_1","Scheduler","SchedulerAction","AsyncScheduler","scheduled","Scheduler_1","AsyncAction_1","dueTime","async_1","async","DebounceTimeOperator","DebounceTimeSubscriber","debouncedSubscription","lastValue","clearDebounce","debouncedNext","debounceTime_1","debounceTime","MapToOperator","MapToSubscriber","mapTo_1","mapTo","typeMatches","rootEpic","epics","_len2","args","_key2","epic","output$","combineEpics","Actions.LOAD_CONFIG_REQUEST","Actions.SAVE_CONFIG_SUCCESS","getCanaryConfigById","payload","Creators.loadConfigSuccess","Creators.loadConfigFailure","Actions.LOAD_CONFIG_SUCCESS","Creators.selectConfig","store","Actions.SAVE_CONFIG_REQUEST","mapStateToConfig","saveAction","isNew","createCanaryConfig","updateCanaryConfig","canaryConfigId","ReactInjector","$state","go","new","data","application","getDataSource","refresh","Creators.saveConfigSuccess","Creators.saveConfigFailure","Actions.DELETE_CONFIG_REQUEST","deleteCanaryConfig","selectedConfig","Creators.deleteConfigSuccess","Creators.deleteConfigFailure","Actions.DELETE_CONFIG_SUCCESS","Creators.closeDeleteConfigModal","Actions.LOAD_RUN_REQUEST","getCanaryRun","configId","runId","run","Creators.loadRunSuccess","Creators.loadRunFailure","Actions.LOAD_METRIC_SET_PAIR_REQUEST","runSelector","getMetricSetPair","metricSetPairListId","pairId","metricSetPair","Creators.loadMetricSetPairSuccess","Creators.loadMetricSetPairFailure","Actions.UPDATE_GRAPHITE_METRIC_DESCRIPTOR_FILTER","metricsAccountName","kayentaAccounts","account","supportedTypes","KayentaAccountType","MetricsStore","Creators.loadMetricsServiceMetadataRequest","Actions.UPDATE_PROMETHEUS_METRIC_DESCRIPTOR_FILTER","Actions.UPDATE_STACKDRIVER_METRIC_DESCRIPTOR_FILTER","metricsStoreType","Actions.UPDATE_DATADOG_METRIC_DESCRIPTOR_FILTER","Actions.LOAD_METRICS_SERVICE_METADATA_REQUEST","REST","query","get","listMetricsServiceMetadata","Creators.loadMetricsServiceMetadataSuccess","Creators.loadMetricsServiceMetadataFailure","Actions.LOAD_KAYENTA_ACCOUNTS_REQUEST","Actions.INITIALIZE","listKayentaAccounts","accounts","Creators.loadKayentaAccountsSuccess","Creators.loadKayentaAccountsFailure","middleware","options","input$","epic$","epicMiddleware","_store","dependencies","replaceEpic","createEpicMiddleware","Actions.CREATE_NEW_CONFIG","newConfig","buildNewConfig","newAction","Actions.COPY_SELECTED_CONFIG","copiedConfig","buildConfigCopy","syncActivityFinished","actionQueue","flushQueue","nextAction","asyncDispatch","canaryStore","createStore","rootReducer","middlewares","reducer","preloadedState","enhancer","chain","_dispatch","middlewareAPI","applyMiddleware","CanarySettings","reduxLogger","Canary","Component","super","initializeAppState","app","componentWillReceiveProps","nextProps","INITIALIZE","configSummaries","judges","render","Styleguide","Provider","UIView","wrap","LoadStatesBuilder","onRequesting","requesting","onFulfilled","fulfilled","onFailed","failed","build","AsyncRequestState","Requesting","Fulfilled","Failed","FormattedDate","dateIso","getTime","connect","disabled","disableConfigEdit","UISref","to","params","openConfigJsonModal","Creators.openConfigJsonModal","ConfigJsonModal","show","deleteConfigModalOpen","selectedConfigName","deleteConfigState","destroy","deleteConfigErrorMessage","closeDeleteConfigModal","deleteConfig","Creators.deleteConfig","Modal","onHide","Header","Title","Body","buildErrorMessage","Footer","openDeleteConfigModal","Creators.openDeleteConfigModal","DisableableButton","disabledStateKeys","DISABLE_EDIT_CONFIG","DeleteConfigModal","ConfigDetailActionButtons","OpenEditConfigJsonModalButton","CopyConfigButton","OpenDeleteModalButton","EditingDisabledWarning","owners","lastIndex","owner","Fragment","getOwnerAppLinks","ConfigEditingDisabledWarning","editingDisabled","updatedTimestampIso","applications","metricId","editingMetric","direction","analysisConfigurations","canary","effectSizes","effectSize","updateEffectSize","Creators.updateEffectSize","showEffectSizes","setShowEffectSizes","useState","allowEditMeasurementType","measure","description","FormRow","isCles","defaultSize","allowedIncrease","criticalIncrease","allowedDecrease","criticalDecrease","updateMeasure","event","fromPercent","field","percent","size","endsWith","toPercent","normalized","round","clesLabel","HelpField","buildInput","robotToHuman","DisableableInput","min","step","onChange","newEffectSizes","updateSize","expand","content","style","marginTop","RadioChoice","current","FilterTemplateSelector","templateOptions","templates","requestingNew","option","onMouseDown","deleteTemplate","editTemplateBegin","editedTemplateName","editedTemplateValue","editTemplateCancel","editTemplateConfirm","editTemplateName","editTemplateValue","selectTemplate","selectedTemplateName","validation","isEditing","isString","helpId","inputOnly","DisableableReactSelect","getOptions","optionRenderer","warning","DisableableTextarea","templateName","templateValue","some","editingTemplateSelector","selectedTemplateNameSelector","configTemplatesSelector","editingTemplateValidationSelector","stopPropagation","Creators.selectTemplate","Creators.deleteTemplate","Creators.editTemplateBegin","Creators.editTemplateCancel","Creators.editTemplateConfirm","Creators.editTemplateName","Creators.editTemplateValue","Creators.addTemplate","inlineTemplateValueSelector","transformValueForSave","transformInlineTemplateForSave","Creators.editInlineTemplate","isEmpty","metricStoreConfigService","getDelegate","metricConfigurer","MetricConfigurer","metric","groups","list","sort","isTemplateValid","isTemplateValidSelector","useInlineTemplateEditor","useInlineTemplateEditorSelector","disableEdit","validationErrors","editingMetricValidationErrorsSelector","rename","Creators.renameMetric","dataset","changeGroup","Creators.updateMetricGroup","cancel","Creators.editMetricCancel","confirm","Creators.editMetricConfirm","updateDirection","Creators.updateMetricDirection","updateNanStrategy","Creators.updateMetricNanStrategy","strategy","updateCriticality","Creators.updateMetricCriticality","critical","Boolean","checked","nanStrategy","isConfirmDisabled","isNull","metricGroup","templatesEnabled","useTemplates","bsSize","DisableableSelect","checkbox","EditMetricEffectSizes","MetricConfigurerDelegator","InlineTemplateEditor","TitledSection","children","toGroup","changeMetricGroup","select","Creators.changeMetricGroupSelect","clear","Creators.changeMetricGroupConfirm","FailOn","isCritical","tooltipSuffix","classes","Tooltip","selectedGroup","selected","metricList","groupList","metrics","showGroups","changingGroupMetric","find","metricStore","selectedStore","addMetric","Creators.addMetric","serviceType","scopeName","copyMetric","metricCopy","cloneDeep","editMetric","Creators.editMetricBegin","removeMetric","Creators.removeMetric","openChangeMetricGroupModal","Creators.changeMetricGroup","NativeTable","ChangeMetricGroupModal","FormList","Children","role","stores","uniq","valueOf","Creators.selectMetricStore","changeName","Creators.updateConfigName","changeDescription","Creators.updateConfigDescription","MetricStoreSelector","TitledSubsection","helpKey","ownProps","handleInputChange","Creators.updateGroupWeight","weight","parseInt","groupWeight","getGroupWeights","isNumber","max","flatMap","hasGroups","GroupWeight","renderJudgeSelect","judge","renderState","JudgeSelectRenderState","None","JudgeSelect","GroupWeights","ConfigDetail","ConfigDetailHeader","NameAndDescription","GroupTabs","MetricList","EditMetricModal","Scoring","CenteredDetail","configLoadState","load","LoadStates","ConfigDetailLoader","configNameStream","loadConfig","componentWillUnmount","ConfigDetailLoadStates","stateParams","Creators.copySelectedConfig","Creators.createNewConfig","Creators.loadConfigRequest","UUIDGenerator","generateUuid","OwnedBy","owningApplications","currentApplication","placement","ownedBy","selectedConfigId","configs","sortBy","wordBreak","marginBottom","CreateConfigButton","ListDetail","listWidth","detail","detailWidth","listClass","detailClass","CanaryConfigEdit","List","ConfigList","noWrap","Detail","disable","saveConfigState","save","inSyncWithServer","isInSyncWithServer","saveConfig","Creators.saveConfig","SubmitButton","isDisabled","submitting","saveConfigErrorMessage","dismissError","Creators.dismissSaveConfigError","template","HoverablePopover","Save","ValidationErrors","SaveConfigError","SaveConfigButton","SelectConfig","resolveReportUrl","serializedCanaryConfigSelector","canaryRunId","url","SETTINGS","gateUrl","storageAccountName","resolveMetricListUrl","status","reportUrl","metricListUrl","href","Label","extraClass","selectedRun","thresholds","marginal","pass","canaryExecutionRequest","metadataGroups","request","scopes","controlScope","location","controlLocation","scope","experimentScope","start","experimentStart","end","experimentEnd","experimentLocation","entries","popover","mins","buildScopeMetadataEntries","SourceLinks","mapKayentaToACA","score","classification","ScoreClassificationLabel","Pass","health","Fail","showClassification","inverse","CanaryScore","judgeResultSelector","ReportScore","ReportMetadata","GRAPH_IMPLEMENTATIONS","selectedMetric","pair","metricResultsSelector","graphType","delegate","candidate","Graph","selectGraphType","Creators.selectGraphType","paddingLeft","textDecoration","metricConfig","selectedMetricConfigSelector","atlasURL","attributes","tags","atlasGraphBaseUrl","legendTags","tag","backend","encodeURIComponent","control","baseURL","experiment","startTime","startTimeMillis","controlEndTime","stepMillis","experimentEndTime","buildAtlasGraphUrl","atlasQuery","metricStoreConfigStore","queryFinder","CopyToClipboard","displayText","toolTip","getStats","judgeResult","results","experimentMetadata","stats","controlMetadata","ResultMetadataRow","service","tableColumns","startTimeIso","configuredControlStart","actualControlStart","configuredExperimentStart","actualExperimentStart","mean","metadataRows","classificationReason","overflowY","GraphTypeSelector","MetricResultActions","MetricResultStats","MetricResultDetailLayout","MetricSetPairLoadStates","metricFilters","toggle","Creators.toggleMetricClassificationFilter","checkboxes","MetricClassificationLabel","High","Low","Nodata","GREEN","RED","GREY","YELLOW","mapMetricClassificationToColor","mapGroupToColor","scoreThresholds","buildStyle","backgroundColor","ratio","formatDeviationAsPercentage","metricResultsColumns","metricName","BreakString","resultMetadata","MetricResultDeviation","MetricResultClassification","selectedResult","selectedMetricResultIdSelector","Creators.selectReportMetric","buildRowForMetricWithMultipleResults","hasMultipleRows","MultipleResultsTable","unfilteredCounts","has","set","tableRowsByMetricName","buildTableRows","MetricFilters","metricResults","selectedMetricResult","MetricResultsList","MetricResultDetail","exception","errorMessages","details","getReason","arrowColor","borderTopColor","HeaderArrow","groupWeights","serializedGroupWeightsSelector","canaryExecutionRequestSelector","Creators.selectReportMetricGroup","ClickableHeader","groupScores","clearSelectedGroup","isExpanded","toggleHeader","chevronStyle","transform","transition","AllMetricResultsHeader","GroupScores","setIsExpanded","ReportException","ReportHeader","ReportExplanation","ReportScores","MetricResults","loadState","ReportDetail","ResultDetailLoader","resultIdStream","loadResult","ReportDetailLoadStates","Creators.loadRunRequest","RESOURCE_TYPES","prometheus","stackdriver","ManualAnalysisModal","endTime","baselineScope","canaryScope","baselineLocation","canaryLocation","marginalThreshold","passThreshold","executionRequest","metricsAccount","accountSpecificParams","resourceType","extendedScopeParams","transformFormPropsToExecutionRequest","startCanaryRun","setSubmitting","setStatus","succeeded","initialValues","selectedMetricsStore","recommendedLocations","showAllControlLocations","showAllExperimentLocations","static","ReactModal","dialogClassName","dismissModal","canaryConfigs","localeCompare","metricsStores","objectStores","ObjectStore","showAdvancedSettings","Formik","onSubmit","submit","validate","isInitialValid","touched","isValid","isSubmitting","setFieldValue","setFieldTouched","ModalClose","dismiss","selectedObjectStore","locations","hasLocationChoices","Form","TetheredSelect","ValidatedField","display","LocationField","showAll","onShowAllChange","setState","ErrorMessage","MapEditor","model","hiddenKeys","CanaryScores","unhealthyScore","successfulScore","successfulHelpFieldId","successfulLabel","unhealthyHelpFieldId","unhealthyLabel","AdvancedSettings","JSON","stringify","SubmitFormButton","closeModal","button","isFormSubmit","combineLocations","includeAll","clearable","Field","required","resolveConfigIdFromExecutionId","executionId","configName","sref","useSref","PipelineLink","parentPipelineExecutionId","getScopeLocations","acc","isAtlas","isAtlasScope","baseColumns","execution","ReportLink","pipelineId","Score","relativeTime","ConfigLink","baselineScopeNames","canaryScopeNames","styles","maxWidth","isEqual","CANARY_EXECUTION_NO_PIPELINE_STATUS","getTableColumns","manualAnalysisEnabled","rerunAnalysis","TableRows","executions","loaded","updateExecutionsCount","executionsCount","useEffect","dataSource","activate","deactivate","countOptions","executionsCountOptions","alignSelf","flexShrink","startManualAnalysis","ExecutionListTable","lazyInitializeKayenta","applicationState","uiRouter","stateRegistry","$uiRouter","match","stub","deregister","applicationStateProvider","views","component","$type","footer","CanaryConfigSave","squash","token","deps","UIRouter","resolveFn","globals","params$","redirectTo","reportDetail","reportDefault","ExecutionListLoadStates","report","Report","defaultExecutionCount","canaryRoot","abstract","insight","pageTitleSection","addChildState","registerStates","transitionService","onBefore","Creators.clearSelectedConfig","$rootScope","$on","preventDefault","onEnter","onbeforeunload","onExit","onSuccess","Creators.setExecutionsCount","afterConfigsLoaded","Creators.updateConfigSummaries","afterJudgesLoaded","Creators.updateJudges","loadCanaryExecutions","listExecutionsRequest","listCanaryExecutions","Creators.loadExecutionsFailure","afterCanaryExecutionsLoaded","Creators.loadExecutionsSuccess"],"mappings":"0jEAUO,MAAMA,GAAc,EAAGC,UAASC,eAEnCC,wBAAKD,UAAWE,EAAW,aAAcF,IACtCD,EAAQI,KAAI,CAACC,EAAGC,IACfJ,wBAAKK,IAAKF,EAAEG,OAASF,EAAGL,UAAW,QAAQI,EAAEI,UACzCJ,EAAEK,MACFR,uBAAID,UAAWE,EAAW,YAAa,YAAa,qBAAsBE,EAAEM,iBAAkBN,EAAEG,oBCE5FI,IAASC,KACvBA,EAAIb,QACJA,EAAOc,OACPA,EAAMC,mBACNA,EAAkBC,aAClBA,EAAYC,WACZA,EAAUC,UACVA,EAASjB,UACTA,EAASkB,gBACTA,IAEA,MAAMC,EAAW,EAAGC,SAClBnB,uBACEoB,QAASL,EAAa,IAAMA,EAAWI,GAAO,KAC9CpB,UAAWE,EACT,CAAEoB,YAAaP,EAAc,aAAcA,GAC3CA,GAAgBA,EAAaK,KAG9BrB,EAAQI,KAAI,CAACC,EAAGC,IACfJ,wBAAKK,IAAKF,EAAEG,OAASF,EAAGL,UAAW,QAAQI,EAAEI,UACzCJ,EAAEK,MAAQL,EAAEmB,WAAWH,OAMjC,OACEnB,wBAAKD,UAAWA,GACdC,uBAAID,UAAWE,EAAWY,EAAoB,eAC5Cb,iBAACH,IAAYC,QAASA,EAASC,UAAWE,EAAW,eAAgB,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