text: webpackJsonp([0],{0:function(t,e,n){"use strict";var o=n(1),r=n(3),i=n(23);r.enableProdMode(),o.platformBrowserDynamic().bootstrapModule(i.AppModule)},23:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(21),s=n(24),c=n(25),u=n(55),l=n(60),p=n(61),f=n(58),d=n(63),h=n(77),m=n(395),y=n(404),g=n(409),v=n(411),b=n(56),_=function(){function t(){}return t=o([i.NgModule({imports:[a.BrowserModule,s.HttpModule,d.UserModule,h.BooksModule,m.MoviesModule,c.RouterModule.forRoot(u.appRoutes,{useHash:!1})],declarations:[y.AppComponent,g.NavbarComponent,v.NotifierComponent,b.HomeComponent],providers:[u.appRoutingProviders,l.AppConfig,p.NotificationService,f.AuthService],bootstrap:[y.AppComponent]}),r("design:paramtypes",[])],t)}();e.AppModule=_},55:function(t,e,n){"use strict";var o=n(56),r=n(57),i=n(62);e.appRoutes=[{path:"",redirectTo:"/home",pathMatch:"full"},{path:"home",component:o.HomeComponent},{path:"**",redirectTo:"/home"}],e.appRoutingProviders=[r.LoggedInGuard,i.LoggedOutGuard]},56:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=function(){function t(){}return t=o([i.Component({template:'\n    <div class="panel panel-default">\n      <div class="panel-body">\n        <p>\n            <b>MY HOBBIES</b>\n            is an\n            <a href="https://github.com/iurii-kyrylenko/hobbies" target="_blank">open-source project</a>\n            for keeping track of books you have read/listened and movies you have watched.\n        </p>\n        <p>\n            After logging in you will be able to:\n        </p>\n        <ul>\n            <li>Add an item (book or movie) to the list.</li>\n            <li>Modify an existing item.</li>\n            <li>Remove an item.</li>\n            <li>Perform search for specific item(s).</li>\n            <li>Download items as a file in JSON format.</li>\n            <li>Upload items from JSON file.</li>\n        </ul>\n        <p>\n            Your data is not accessible to other users.\n        </p>\n        <p>\n            <b>This site is for demonstartion purposes only: you can loose data at any time.</b>\n        </p>\n      </div>\n    </div>\n    '}),r("design:paramtypes",[])],t)}();e.HomeComponent=a},57:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(58),s=function(){function t(t){this.auth=t}return t.prototype.canActivate=function(){return this.auth.isLoggedIn},t=o([i.Injectable(),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof a.AuthService&&a.AuthService)&&e||Object])],t);var e}();e.LoggedInGuard=s},58:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(24),s=n(25),c=n(59),u=n(60),l=n(61),p=function(){function t(t,e,n,o){this.http=t,this.router=e,this.config=n,this.ntfs=o}return Object.defineProperty(t.prototype,"isLoggedIn",{get:function(){var t=this.getToken();if(!t)return!1;var e=t.split(".")[1];return e=JSON.parse(atob(e)),e.exp>Date.now()/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentUser",{get:function(){if(!this.isLoggedIn)return null;var t=this.getToken(),e=t.split(".")[1];return e=JSON.parse(atob(e)),new c.AuthUser(e.name,e.email)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"authHeader",{get:function(){var t=new a.Headers;return t.append("Authorization","Bearer "+this.getToken()),{headers:t}},enumerable:!0,configurable:!0}),t.prototype.login=function(t,e){var n=this,o=this.config.apiUrl+"/users/login";this.http.post(o,t).map(function(t){return t.json().token}).subscribe(function(t){n.saveToken(t),n.router.navigate([e]),n.ntfs.notifyInfo("You have been looged in")},function(t){return n.ntfs.notifyWarning("You have failed to log in. Try again with another credentials.")})},t.prototype.register=function(t,e,n){var o=this,r=this.config.apiUrl+"/users/register";this.http.post(r,t).map(function(t){return t.json().token}).subscribe(function(t){o.saveToken(t),o.router.navigate([e]),o.ntfs.notifyInfo("You have been registered and logged in.")},function(t){n(),o.ntfs.notifyWarning("You have failed to register. Try again with another email address.")})},t.prototype.logout=function(){this.removeToken(),this.ntfs.notifyInfo("You have been logged out.")},t.prototype.saveToken=function(t){localStorage.jwt=t},t.prototype.getToken=function(){return localStorage.jwt},t.prototype.removeToken=function(){localStorage.removeItem("jwt")},t=o([i.Injectable(),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof a.Http&&a.Http)&&e||Object,"function"==typeof(n="undefined"!=typeof s.Router&&s.Router)&&n||Object,"function"==typeof(p="undefined"!=typeof u.AppConfig&&u.AppConfig)&&p||Object,"function"==typeof(f="undefined"!=typeof l.NotificationService&&l.NotificationService)&&f||Object])],t);var e,n,p,f}();e.AuthService=p},59:function(t,e){"use strict";var n=function(){function t(t,e){this.name=t,this.email=e}return t}();e.AuthUser=n;var o=function(){function t(t,e){void 0===t&&(t=""),void 0===e&&(e=""),this.email=t,this.password=e}return t}();e.LoginUser=o;var r=function(){function t(t,e,n,o){void 0===t&&(t=""),void 0===e&&(e=""),void 0===n&&(n=""),void 0===o&&(o=""),this.name=t,this.email=e,this.password=n,this.captchaResponse=o}return t}();e.RegisterUser=r},60:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=function(){function t(){}return Object.defineProperty(t.prototype,"apiUrl",{get:function(){return"/api"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reCaptchaSiteKey",{get:function(){return"6LeUuSUTAAAAAElwIcAHk994ErqNeqw7aQxlsw_H"},enumerable:!0,configurable:!0}),t=o([i.Injectable(),r("design:paramtypes",[])],t)}();e.AppConfig=a},61:function(t,e,n){"use strict";var o=n(4),r=function(){function t(){this.notificationsSource=new o.Subject,this.notifications$=this.notificationsSource.asObservable()}return t.prototype.notify=function(t){this.notificationsSource.next(t)},t.prototype.notifySuccess=function(t){this.notify({type:"success",message:t})},t.prototype.notifyInfo=function(t){this.notify({type:"info",message:t})},t.prototype.notifyWarning=function(t){this.notify({type:"warning",message:t})},t.prototype.notifyDanger=function(t){this.notify({type:"danger",message:t})},t}();e.NotificationService=r},62:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(58),s=function(){function t(t){this.auth=t}return t.prototype.canActivate=function(){return!this.auth.isLoggedIn},t=o([i.Injectable(),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof a.AuthService&&a.AuthService)&&e||Object])],t);var e}();e.LoggedOutGuard=s},63:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(25),s=n(22),c=n(64),u=n(66),l=n(71),p=n(72),f=n(74),d=n(76),h=function(){function t(){}return t=o([i.NgModule({imports:[s.CommonModule,c.FormsModule,u.ValidatorsModule,a.RouterModule.forChild(l.userRoutes)],declarations:[p.LoginComponent,f.RegisterComponent,d.ReCaptchaComponent]}),r("design:paramtypes",[])],t)}();e.UserModule=h},64:function(t,e,n){(function(t){!function(t,o){o(e,n(3),n(65),n(4),n(5),n(52))}(this,function(e,n,o,r,i,a){"use strict";function s(t){return void 0!==t&&null!==t}function c(t){return void 0===t||null===t}function u(t){return"string"==typeof t}function l(t){return"function"==typeof t}function p(t){return"object"==typeof t&&null!==t}function f(t){return s(t)&&l(t.then)}function d(t){return Array.isArray(t)}function h(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}function m(t){return!c(t)&&t}function y(t){return null!==t&&("function"==typeof t||"object"==typeof t)}function g(t){return!y(t)}function v(t,e){return t.constructor===e}function b(t,e){if(s(t))for(var n=0;n<t.length;n++){var o=t[n];d(o)?b(o,e):e.push(o)}return e}function _(t){return f(t)?t:o.toPromise.call(t)}function C(t,e){return e.map(function(e){return e(t)})}function O(t,e){return e.map(function(e){return e(t)})}function w(t){var e=t.reduce(function(t,e){return s(e)?at.merge(t,e):t},{});return at.isEmpty(e)?null:e}function j(t){return void 0!==t.validate?function(e){return t.validate(e)}:t}function R(t){return void 0!==t.validate?function(e){return t.validate(e)}:t}function S(){throw new Error("unimplemented")}function P(t,e){return c(t)?""+e:(g(e)||(e="Object"),W.slice(t+": "+e,0,50))}function A(t){return t.split(":")[0]}function V(t,e){return c(t)?""+e:(u(e)&&(e="'"+e+"'"),g(e)||(e="Object"),W.slice(t+": "+e,0,50))}function E(t){return t.split(":")[0]}function k(t,e){var n=st.clone(e.path);return n.push(t),n}function M(t,e){c(t)&&x(e,"Cannot find control with"),c(e.valueAccessor)&&x(e,"No value accessor for form control with"),t.validator=lt.compose([t.validator,e.validator]),t.asyncValidator=lt.composeAsync([t.asyncValidator,e.asyncValidator]),e.valueAccessor.writeValue(t.value),e.valueAccessor.registerOnChange(function(n){e.viewToModelUpdate(n),t.markAsDirty(),t.setValue(n,{emitModelToViewChange:!1})}),e.valueAccessor.registerOnTouched(function(){return t.markAsTouched()}),t.registerOnChange(function(t,n){e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)}),e.valueAccessor.setDisabledState&&t.registerOnDisabledChange(function(t){e.valueAccessor.setDisabledState(t)}),e._rawValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})}),e._rawAsyncValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})})}function D(t,e){e.valueAccessor.registerOnChange(function(){return I(e)}),e.valueAccessor.registerOnTouched(function(){return I(e)}),e._rawValidators.forEach(function(t){return t.registerOnValidatorChange(null)}),e._rawAsyncValidators.forEach(function(t){return t.registerOnValidatorChange(null)}),t&&t._clearChangeFns()}function N(t,e){c(t)&&x(e,"Cannot find control with"),t.validator=lt.compose([t.validator,e.validator]),t.asyncValidator=lt.composeAsync([t.asyncValidator,e.asyncValidator])}function I(t){return x(t,"There is no FormControl instance attached to form control element with")}function x(t,e){var n;throw n=t.path.length>1?"path: '"+t.path.join(" -> ")+"'":t.path[0]?"name: '"+t.path+"'":"unspecified name attribute",new Error(e+" "+n)}function F(t){return s(t)?lt.compose(t.map(j)):null}function T(t){return s(t)?lt.composeAsync(t.map(R)):null}function G(t,e){if(!at.contains(t,"model"))return!1;var n=t.model;return!!n.isFirstChange()||!h(e,n.currentValue)}function L(t){return v(t,dt)||v(t,gt)||v(t,jt)||v(t,Pt)||v(t,Ot)}function U(t,e){if(c(e))return null;var n,o,r;return e.forEach(function(e){v(e,mt)?n=e:L(e)?(s(o)&&x(t,"More than one built-in value accessor matches form control with"),o=e):(s(r)&&x(t,"More than one custom value accessor matches form control with"),r=e)}),s(r)?r:s(o)?o:s(n)?n:(x(t,"No valid value accessor for form control with"),null)}function B(t,e,n){return c(e)?null:(e instanceof Array||(e=e.split(n)),e instanceof Array&&st.isEmpty(e)?null:e.reduce(function(t,e){if(t instanceof zt)return s(t.controls[e])?t.controls[e]:null;if(t instanceof $t){var n=e;return s(t.at(n))?t.at(n):null}return null},t))}function q(t){return f(t)?a.fromPromise(t):t}function H(t){return Array.isArray(t)?F(t):t}function z(t){return Array.isArray(t)?T(t):t}function $(t){return!(t instanceof me||t instanceof fe||t instanceof ge)}var Y;Y="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:t:window;var J=Y;J.assert=function(t){};var W=function(){function t(){}return t.fromCharCode=function(t){return String.fromCharCode(t)},t.charCodeAt=function(t,e){return t.charCodeAt(e)},t.split=function(t,e){return t.split(e)},t.equals=function(t,e){return t===e},t.stripLeft=function(t,e){if(t&&t.length){for(var n=0,o=0;o<t.length&&t[o]==e;o++)n++;t=t.substring(n)}return t},t.stripRight=function(t,e){if(t&&t.length){for(var n=t.length,o=t.length-1;o>=0&&t[o]==e;o--)n--;t=t.substring(0,n)}return t},t.replace=function(t,e,n){return t.replace(e,n)},t.replaceAll=function(t,e,n){return t.replace(e,n)},t.slice=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=null),t.slice(e,null===n?void 0:n)},t.replaceAllMapped=function(t,e,n){return t.replace(e,function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return t.splice(-2,2),n(t)})},t.contains=function(t,e){return t.indexOf(e)!=-1},t.compare=function(t,e){return t<e?-1:t>e?1:0},t}(),K=(function(){function t(){}return t.toFixed=function(t,e){return t.toFixed(e)},t.equal=function(t,e){return t===e},t.parseIntAutoRadix=function(t){var e=parseInt(t);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+t);return e},t.parseInt=function(t,e){if(10==e){if(/^(\-|\+)?[0-9]+$/.test(t))return parseInt(t,e)}else if(16==e){if(/^(\-|\+)?[0-9ABCDEFabcdef]+$/.test(t))return parseInt(t,e)}else{var n=parseInt(t,e);if(!isNaN(n))return n}throw new Error("Invalid integer literal when parsing "+t+" in base "+e)},Object.defineProperty(t,"NaN",{get:function(){return NaN},enumerable:!0,configurable:!0}),t.isNumeric=function(t){return!isNaN(t-parseFloat(t))},t.isNaN=function(t){return isNaN(t)},t.isInteger=function(t){return Number.isInteger(t)},t}(),function(){function t(){}return Object.defineProperty(t.prototype,"control",{get:function(){throw new Error("unimplemented")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return s(this.control)?this.control.value:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return s(this.control)?this.control.valid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invalid",{get:function(){return s(this.control)?this.control.invalid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return s(this.control)?this.control.pending:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return s(this.control)?this.control.errors:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return s(this.control)?this.control.pristine:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return s(this.control)?this.control.dirty:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return s(this.control)?this.control.touched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return s(this.control)?this.control.untouched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return s(this.control)?this.control.disabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return s(this.control)?this.control.enabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusChanges",{get:function(){return s(this.control)?this.control.statusChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueChanges",{get:function(){return s(this.control)?this.control.valueChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.reset=function(t){void 0===t&&(t=void 0),s(this.control)&&this.control.reset(t)},t}()),Z=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Q=function(t){function e(){t.apply(this,arguments)}return Z(e,t),Object.defineProperty(e.prototype,"formDirective",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),e}(K),X=J.Map,tt=J.Set,et=function(){try{if(1===new X([[1,2]]).size)return function(t){return new X(t)}}catch(t){}return function(t){for(var e=new X,n=0;n<t.length;n++){var o=t[n];e.set(o[0],o[1])}return e}}(),nt=function(){try{if(new X(new X))return function(t){return new X(t)}}catch(t){}return function(t){var e=new X;return t.forEach(function(t,n){e.set(n,t)}),e}}(),ot=function(){return(new X).keys().next?function(t){for(var e,n=t.keys();!(e=n.next()).done;)t.set(e.value,null)}:function(t){t.forEach(function(e,n){t.set(n,null)})}}(),rt=function(){try{if((new X).values().next)return function(t,e){return e?Array.from(t.values()):Array.from(t.keys())}}catch(t){}return function(t,e){var n=st.createFixedSize(t.size),o=0;return t.forEach(function(t,r){n[o]=e?t:r,o++}),n}}(),it=function(){function t(){}return t.clone=function(t){return nt(t)},t.createFromStringMap=function(t){var e=new X;for(var n in t)e.set(n,t[n]);return e},t.toStringMap=function(t){var e={};return t.forEach(function(t,n){return e[n]=t}),e},t.createFromPairs=function(t){return et(t)},t.clearValues=function(t){ot(t)},t.iterable=function(t){return t},t.keys=function(t){return rt(t,!1)},t.values=function(t){return rt(t,!0)},t}(),at=function(){function t(){}return t.create=function(){return{}},t.contains=function(t,e){return t.hasOwnProperty(e)},t.get=function(t,e){return t.hasOwnProperty(e)?t[e]:void 0},t.set=function(t,e,n){t[e]=n},t.keys=function(t){return Object.keys(t)},t.values=function(t){return Object.keys(t).map(function(e){return t[e]})},t.isEmpty=function(t){for(var e in t)return!1;return!0},t.delete=function(t,e){delete t[e]},t.forEach=function(t,e){for(var n=0,o=Object.keys(t);n<o.length;n++){var r=o[n];e(t[r],r)}},t.merge=function(t,e){for(var n={},o=0,r=Object.keys(t);o<r.length;o++){var i=r[o];n[i]=t[i]}for(var a=0,s=Object.keys(e);a<s.length;a++){var i=s[a];n[i]=e[i]}return n},t.equals=function(t,e){var n=Object.keys(t),o=Object.keys(e);if(n.length!=o.length)return!1;for(var r=0;r<n.length;r++){var i=n[r];if(t[i]!==e[i])return!1}return!0},t}(),st=function(){function t(){}return t.createFixedSize=function(t){return new Array(t)},t.createGrowableSize=function(t){return new Array(t)},t.clone=function(t){return t.slice(0)},t.forEachWithIndex=function(t,e){for(var n=0;n<t.length;n++)e(t[n],n)},t.first=function(t){return t?t[0]:null},t.last=function(t){return t&&0!=t.length?t[t.length-1]:null},t.indexOf=function(t,e,n){return void 0===n&&(n=0),t.indexOf(e,n)},t.contains=function(t,e){return t.indexOf(e)!==-1},t.reversed=function(e){var n=t.clone(e);return n.reverse()},t.concat=function(t,e){return t.concat(e)},t.insert=function(t,e,n){t.splice(e,0,n)},t.removeAt=function(t,e){var n=t[e];return t.splice(e,1),n},t.removeAll=function(t,e){for(var n=0;n<e.length;++n){var o=t.indexOf(e[n]);t.splice(o,1)}},t.remove=function(t,e){var n=t.indexOf(e);return n>-1&&(t.splice(n,1),!0)},t.clear=function(t){t.length=0},t.isEmpty=function(t){return 0==t.length},t.fill=function(t,e,n,o){void 0===n&&(n=0),void 0===o&&(o=null),t.fill(e,n,null===o?t.length:o)},t.equals=function(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0},t.slice=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=null),t.slice(e,null===n?void 0:n)},t.splice=function(t,e,n){return t.splice(e,n)},t.sort=function(t,e){s(e)?t.sort(e):t.sort()},t.toString=function(t){return t.toString()},t.toJSON=function(t){return JSON.stringify(t)},t.maximum=function(t,e){if(0==t.length)return null;for(var n=null,o=-(1/0),r=0;r<t.length;r++){var i=t[r];if(!c(i)){var a=e(i);a>o&&(n=i,o=a)}}return n},t.flatten=function(t){var e=[];return b(t,e),e},t.addAll=function(t,e){for(var n=0;n<e.length;n++)t.push(e[n])},t}(),ct=(function(){var t=new tt([1,2,3]);return 3===t.size?function(t){return new tt(t)}:function(t){var e=new tt(t);if(e.size!==t.length)for(var n=0;n<t.length;n++)e.add(t[n]);return e}}(),new n.OpaqueToken("NgValidators")),ut=new n.OpaqueToken("NgAsyncValidators"),lt=function(){function t(){}return t.required=function(t){return c(t.value)||u(t.value)&&""==t.value?{required:!0}:null},t.minLength=function(e){return function(n){if(s(t.required(n)))return null;var o=n.value;return o.length<e?{minlength:{requiredLength:e,actualLength:o.length}}:null}},t.maxLength=function(e){return function(n){if(s(t.required(n)))return null;var o=n.value;return o.length>e?{maxlength:{requiredLength:e,actualLength:o.length}}:null}},t.pattern=function(e){return function(n){if(s(t.required(n)))return null;var o=new RegExp("^"+e+"$"),r=n.value;return o.test(r)?null:{pattern:{requiredPattern:"^"+e+"$",actualValue:r}}}},t.nullValidator=function(t){return null},t.compose=function(t){if(c(t))return null;var e=t.filter(s);return 0==e.length?null:function(t){return w(C(t,e))}},t.composeAsync=function(t){if(c(t))return null;var e=t.filter(s);return 0==e.length?null:function(t){var n=O(t,e).map(_);return Promise.all(n).then(w)}},t}(),pt=new n.OpaqueToken("NgValueAccessor"),ft={provide:pt,useExisting:n.forwardRef(function(){return dt}),multi:!0},dt=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"checked",t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:n.Directive,args:[{selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},providers:[ft]}]}],t.ctorParameters=[{type:n.Renderer},{type:n.ElementRef}],t}(),ht={provide:pt,useExisting:n.forwardRef(function(){return mt}),multi:!0},mt=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){var e=c(t)?"":t;this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:n.Directive,args:[{selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",host:{"(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[ht]}]}],t.ctorParameters=[{type:n.Renderer},{type:n.ElementRef}],t}(),yt={provide:pt,useExisting:n.forwardRef(function(){return gt}),multi:!0},gt=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){var e=c(t)?"":t;this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:n.Directive,args:[{selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[yt]}]}],t.ctorParameters=[{type:n.Renderer},{type:n.ElementRef}],t}(),vt=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},bt=function(t){function e(){t.apply(this,arguments),this._parent=null,this.name=null,this.valueAccessor=null,this._rawValidators=[],this._rawAsyncValidators=[]}return vt(e,t),Object.defineProperty(e.prototype,"validator",{get:function(){return S()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return S()},enumerable:!0,configurable:!0}),e}(K),_t={provide:pt,useExisting:n.forwardRef(function(){return Ot}),multi:!0},Ct=function(){function t(){this._accessors=[]}return t.prototype.add=function(t,e){this._accessors.push([t,e])},t.prototype.remove=function(t){for(var e=-1,n=0;n<this._accessors.length;++n)this._accessors[n][1]===t&&(e=n);st.removeAt(this._accessors,e)},t.prototype.select=function(t){var e=this;this._accessors.forEach(function(n){e._isSameGroup(n,t)&&n[1]!==t&&n[1].fireUncheck(t.value)})},t.prototype._isSameGroup=function(t,e){return!!t[0].control&&(t[0]._parent===e._control._parent&&t[1].name===e.name)},t.decorators=[{type:n.Injectable}],t.ctorParameters=[],t}(),Ot=function(){function t(t,e,n,o){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=o,this.onChange=function(){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this._control=this._injector.get(bt),this._checkName(),this._registry.add(this._control,this)},t.prototype.ngOnDestroy=function(){this._registry.remove(this)},t.prototype.writeValue=function(t){this._state=t===this.value,this._renderer.setElementProperty(this._elementRef.nativeElement,"checked",this._state)},t.prototype.registerOnChange=function(t){var e=this;this._fn=t,this.onChange=function(){t(e.value),e._registry.select(e)}},t.prototype.fireUncheck=function(t){this.writeValue(t)},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},t.prototype._throwNameError=function(){throw new Error('\n      If you define both a name and a formControlName attribute on your radio button, their values\n      must match. Ex: <input type="radio" formControlName="food" name="food">\n    ')},t.decorators=[{type:n.Directive,args:[{selector:"input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",host:{"(change)":"onChange()","(blur)":"onTouched()"},providers:[_t]}]}],t.ctorParameters=[{type:n.Renderer},{type:n.ElementRef},{type:Ct},{type:n.Injector}],t.propDecorators={name:[{type:n.Input}],formControlName:[{type:n.Input}],value:[{type:n.Input}]},t}(),wt={provide:pt,useExisting:n.forwardRef(function(){return jt}),multi:!0},jt=function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this.value=t;var e=P(this._getOptionId(t),t);this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){e.value=n,t(e._getOptionValue(n))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(){return(this._idCounter++).toString()},t.prototype._getOptionId=function(t){for(var e=0,n=it.keys(this._optionMap);e<n.length;e++){var o=n[e];if(h(this._optionMap.get(o),t))return o}return null},t.prototype._getOptionValue=function(t){var e=this._optionMap.get(A(t));return s(e)?e:t},t.decorators=[{type:n.Directive,args:[{selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",host:{"(change)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[wt]}]}],t.ctorParameters=[{type:n.Renderer},{type:n.ElementRef}],t}(),Rt=function(){function t(t,e,n){this._element=t,this._renderer=e,this._select=n,s(this._select)&&(this.id=this._select._registerOption())}return Object.defineProperty(t.prototype,"ngValue",{set:function(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue(P(this.id,t)),this._select.writeValue(this._select.value))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{set:function(t){this._setElementValue(t),s(this._select)&&this._select.writeValue(this._select.value)},enumerable:!0,configurable:!0}),t.prototype._setElementValue=function(t){this._renderer.setElementProperty(this._element.nativeElement,"value",t)},t.prototype.ngOnDestroy=function(){s(this._select)&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))},t.decorators=[{type:n.Directive,args:[{selector:"option"
  }]}],t.ctorParameters=[{type:n.ElementRef},{type:n.Renderer},{type:jt,decorators:[{type:n.Optional},{type:n.Host}]}],t.propDecorators={ngValue:[{type:n.Input,args:["ngValue"]}],value:[{type:n.Input,args:["value"]}]},t}(),St={provide:pt,useExisting:n.forwardRef(function(){return Pt}),multi:!0},Pt=function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){var e=this;if(this.value=t,null!=t){var n=t,o=n.map(function(t){return e._getOptionId(t)});this._optionMap.forEach(function(t,e){t._setSelected(o.indexOf(e.toString())>-1)})}},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){var o=[];if(n.hasOwnProperty("selectedOptions"))for(var r=n.selectedOptions,i=0;i<r.length;i++){var a=r.item(i),s=e._getOptionValue(a.value);o.push(s)}else for(var r=n.options,i=0;i<r.length;i++){var a=r.item(i);if(a.selected){var s=e._getOptionValue(a.value);o.push(s)}}t(o)}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(t){var e=(this._idCounter++).toString();return this._optionMap.set(e,t),e},t.prototype._getOptionId=function(t){for(var e=0,n=it.keys(this._optionMap);e<n.length;e++){var o=n[e];if(h(this._optionMap.get(o)._value,t))return o}return null},t.prototype._getOptionValue=function(t){var e=this._optionMap.get(E(t));return s(e)?e._value:t},t.decorators=[{type:n.Directive,args:[{selector:"select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]",host:{"(change)":"onChange($event.target)","(blur)":"onTouched()"},providers:[St]}]}],t.ctorParameters=[{type:n.Renderer},{type:n.ElementRef}],t}(),At=function(){function t(t,e,n){this._element=t,this._renderer=e,this._select=n,s(this._select)&&(this.id=this._select._registerOption(this))}return Object.defineProperty(t.prototype,"ngValue",{set:function(t){null!=this._select&&(this._value=t,this._setElementValue(V(this.id,t)),this._select.writeValue(this._select.value))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{set:function(t){s(this._select)?(this._value=t,this._setElementValue(V(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)},enumerable:!0,configurable:!0}),t.prototype._setElementValue=function(t){this._renderer.setElementProperty(this._element.nativeElement,"value",t)},t.prototype._setSelected=function(t){this._renderer.setElementProperty(this._element.nativeElement,"selected",t)},t.prototype.ngOnDestroy=function(){s(this._select)&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))},t.decorators=[{type:n.Directive,args:[{selector:"option"}]}],t.ctorParameters=[{type:n.ElementRef},{type:n.Renderer},{type:Pt,decorators:[{type:n.Optional},{type:n.Host}]}],t.propDecorators={ngValue:[{type:n.Input,args:["ngValue"]}],value:[{type:n.Input,args:["value"]}]},t}(),Vt=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Et=function(t){function e(){t.apply(this,arguments)}return Vt(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormGroup(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormGroup(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormGroup(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return k(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return F(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return T(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){},e}(Q),kt=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Mt=function(){function t(t){this._cd=t}return Object.defineProperty(t.prototype,"ngClassUntouched",{get:function(){return!!s(this._cd.control)&&this._cd.control.untouched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassTouched",{get:function(){return!!s(this._cd.control)&&this._cd.control.touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPristine",{get:function(){return!!s(this._cd.control)&&this._cd.control.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassDirty",{get:function(){return!!s(this._cd.control)&&this._cd.control.dirty},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassValid",{get:function(){return!!s(this._cd.control)&&this._cd.control.valid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassInvalid",{get:function(){return!!s(this._cd.control)&&this._cd.control.invalid},enumerable:!0,configurable:!0}),t}(),Dt={"[class.ng-untouched]":"ngClassUntouched","[class.ng-touched]":"ngClassTouched","[class.ng-pristine]":"ngClassPristine","[class.ng-dirty]":"ngClassDirty","[class.ng-valid]":"ngClassValid","[class.ng-invalid]":"ngClassInvalid"},Nt=function(t){function e(e){t.call(this,e)}return kt(e,t),e.decorators=[{type:n.Directive,args:[{selector:"[formControlName],[ngModel],[formControl]",host:Dt}]}],e.ctorParameters=[{type:bt,decorators:[{type:n.Self}]}],e}(Mt),It=function(t){function e(e){t.call(this,e)}return kt(e,t),e.decorators=[{type:n.Directive,args:[{selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",host:Dt}]}],e.ctorParameters=[{type:Q,decorators:[{type:n.Self}]}],e}(Mt),xt=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Ft=function(t){function e(e){void 0===e&&(e=!1),t.call(this),this.__isAsync=e}return xt(e,t),e.prototype.emit=function(e){t.prototype.next.call(this,e)},e.prototype.subscribe=function(e,n,o){var r,i=function(t){return null},a=function(){return null};return e&&"object"==typeof e?(r=this.__isAsync?function(t){setTimeout(function(){return e.next(t)})}:function(t){e.next(t)},e.error&&(i=this.__isAsync?function(t){setTimeout(function(){return e.error(t)})}:function(t){e.error(t)}),e.complete&&(a=this.__isAsync?function(){setTimeout(function(){return e.complete()})}:function(){e.complete()})):(r=this.__isAsync?function(t){setTimeout(function(){return e(t)})}:function(t){e(t)},n&&(i=this.__isAsync?function(t){setTimeout(function(){return n(t)})}:function(t){n(t)}),o&&(a=this.__isAsync?function(){setTimeout(function(){return o()})}:function(){o()})),t.prototype.subscribe.call(this,r,i,a)},e}(r.Subject),Tt=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Gt="VALID",Lt="INVALID",Ut="PENDING",Bt="DISABLED",qt=function(){function t(t,e){this.validator=t,this.asyncValidator=e,this._onCollectionChange=function(){},this._pristine=!0,this._touched=!1}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this._status===Gt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invalid",{get:function(){return this._status===Lt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return this._status==Ut},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._status===Bt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return this._status!==Bt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this._errors},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this._pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return!this.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this._touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return!this._touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueChanges",{get:function(){return this._valueChanges},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusChanges",{get:function(){return this._statusChanges},enumerable:!0,configurable:!0}),t.prototype.setValidators=function(t){this.validator=H(t)},t.prototype.setAsyncValidators=function(t){this.asyncValidator=z(t)},t.prototype.clearValidators=function(){this.validator=null},t.prototype.clearAsyncValidators=function(){this.asyncValidator=null},t.prototype.markAsTouched=function(t){var e=(void 0===t?{}:t).onlySelf;e=m(e),this._touched=!0,s(this._parent)&&!e&&this._parent.markAsTouched({onlySelf:e})},t.prototype.markAsUntouched=function(t){var e=(void 0===t?{}:t).onlySelf;this._touched=!1,this._forEachChild(function(t){t.markAsUntouched({onlySelf:!0})}),s(this._parent)&&!e&&this._parent._updateTouched({onlySelf:e})},t.prototype.markAsDirty=function(t){var e=(void 0===t?{}:t).onlySelf;e=m(e),this._pristine=!1,s(this._parent)&&!e&&this._parent.markAsDirty({onlySelf:e})},t.prototype.markAsPristine=function(t){var e=(void 0===t?{}:t).onlySelf;this._pristine=!0,this._forEachChild(function(t){t.markAsPristine({onlySelf:!0})}),s(this._parent)&&!e&&this._parent._updatePristine({onlySelf:e})},t.prototype.markAsPending=function(t){var e=(void 0===t?{}:t).onlySelf;e=m(e),this._status=Ut,s(this._parent)&&!e&&this._parent.markAsPending({onlySelf:e})},t.prototype.disable=function(t){var e=void 0===t?{}:t,n=e.onlySelf,o=e.emitEvent;o=!s(o)||o,this._status=Bt,this._errors=null,this._forEachChild(function(t){t.disable({onlySelf:!0})}),this._updateValue(),o&&(this._valueChanges.emit(this._value),this._statusChanges.emit(this._status)),this._updateAncestors(n),this._onDisabledChange(!0)},t.prototype.enable=function(t){var e=void 0===t?{}:t,n=e.onlySelf,o=e.emitEvent;this._status=Gt,this._forEachChild(function(t){t.enable({onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:o}),this._updateAncestors(n),this._onDisabledChange(!1)},t.prototype._updateAncestors=function(t){s(this._parent)&&!t&&(this._parent.updateValueAndValidity(),this._parent._updatePristine(),this._parent._updateTouched())},t.prototype.setParent=function(t){this._parent=t},t.prototype.updateValueAndValidity=function(t){var e=void 0===t?{}:t,n=e.onlySelf,o=e.emitEvent;n=m(n),o=!s(o)||o,this._setInitialStatus(),this._updateValue(),this.enabled&&(this._errors=this._runValidator(),this._status=this._calculateStatus(),this._status!==Gt&&this._status!==Ut||this._runAsyncValidator(o)),o&&(this._valueChanges.emit(this._value),this._statusChanges.emit(this._status)),s(this._parent)&&!n&&this._parent.updateValueAndValidity({onlySelf:n,emitEvent:o})},t.prototype._updateTreeValidity=function(t){var e=(void 0===t?{emitEvent:!0}:t).emitEvent;this._forEachChild(function(t){return t._updateTreeValidity({emitEvent:e})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e})},t.prototype._setInitialStatus=function(){this._status=this._allControlsDisabled()?Bt:Gt},t.prototype._runValidator=function(){return s(this.validator)?this.validator(this):null},t.prototype._runAsyncValidator=function(t){var e=this;if(s(this.asyncValidator)){this._status=Ut,this._cancelExistingSubscription();var n=q(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe({next:function(n){return e.setErrors(n,{emitEvent:t})}})}},t.prototype._cancelExistingSubscription=function(){s(this._asyncValidationSubscription)&&this._asyncValidationSubscription.unsubscribe()},t.prototype.setErrors=function(t,e){var n=(void 0===e?{}:e).emitEvent;n=!s(n)||n,this._errors=t,this._updateControlsErrors(n)},t.prototype.get=function(t){return B(this,t,".")},t.prototype.getError=function(t,e){void 0===e&&(e=null);var n=s(e)&&!st.isEmpty(e)?this.get(e):this;return s(n)&&s(n._errors)?at.get(n._errors,t):null},t.prototype.hasError=function(t,e){return void 0===e&&(e=null),s(this.getError(t,e))},Object.defineProperty(t.prototype,"root",{get:function(){for(var t=this;s(t._parent);)t=t._parent;return t},enumerable:!0,configurable:!0}),t.prototype._updateControlsErrors=function(t){this._status=this._calculateStatus(),t&&this._statusChanges.emit(this._status),s(this._parent)&&this._parent._updateControlsErrors(t)},t.prototype._initObservables=function(){this._valueChanges=new Ft,this._statusChanges=new Ft},t.prototype._calculateStatus=function(){return this._allControlsDisabled()?Bt:s(this._errors)?Lt:this._anyControlsHaveStatus(Ut)?Ut:this._anyControlsHaveStatus(Lt)?Lt:Gt},t.prototype._anyControlsHaveStatus=function(t){return this._anyControls(function(e){return e.status==t})},t.prototype._anyControlsDirty=function(){return this._anyControls(function(t){return t.dirty})},t.prototype._anyControlsTouched=function(){return this._anyControls(function(t){return t.touched})},t.prototype._updatePristine=function(t){var e=(void 0===t?{}:t).onlySelf;this._pristine=!this._anyControlsDirty(),s(this._parent)&&!e&&this._parent._updatePristine({onlySelf:e})},t.prototype._updateTouched=function(t){var e=(void 0===t?{}:t).onlySelf;this._touched=this._anyControlsTouched(),s(this._parent)&&!e&&this._parent._updateTouched({onlySelf:e})},t.prototype._onDisabledChange=function(t){},t.prototype._isBoxedValue=function(t){return p(t)&&2===Object.keys(t).length&&"value"in t&&"disabled"in t},t.prototype._registerOnCollectionChange=function(t){this._onCollectionChange=t},t}(),Ht=function(t){function e(e,n,o){void 0===e&&(e=null),void 0===n&&(n=null),void 0===o&&(o=null),t.call(this,H(n),z(o)),this._onChange=[],this._applyFormState(e),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),this._initObservables()}return Tt(e,t),e.prototype.setValue=function(t,e){var n=this,o=void 0===e?{}:e,r=o.onlySelf,i=o.emitEvent,a=o.emitModelToViewChange,c=o.emitViewToModelChange;a=!s(a)||a,c=!s(c)||c,this._value=t,this._onChange.length&&a&&this._onChange.forEach(function(t){return t(n._value,c)}),this.updateValueAndValidity({onlySelf:r,emitEvent:i})},e.prototype.patchValue=function(t,e){void 0===e&&(e={}),this.setValue(t,e)},e.prototype.reset=function(t,e){void 0===t&&(t=null);var n=(void 0===e?{}:e).onlySelf;this._applyFormState(t),this.markAsPristine({onlySelf:n}),this.markAsUntouched({onlySelf:n}),this.setValue(this._value,{onlySelf:n})},e.prototype._updateValue=function(){},e.prototype._anyControls=function(t){return!1},e.prototype._allControlsDisabled=function(){return this.disabled},e.prototype.registerOnChange=function(t){this._onChange.push(t)},e.prototype._clearChangeFns=function(){this._onChange=[],this._onDisabledChange=null,this._onCollectionChange=function(){}},e.prototype.registerOnDisabledChange=function(t){this._onDisabledChange=t},e.prototype._forEachChild=function(t){},e.prototype._applyFormState=function(t){this._isBoxedValue(t)?(this._value=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this._value=t},e}(qt),zt=function(t){function e(e,n,o){void 0===n&&(n=null),void 0===o&&(o=null),t.call(this,n,o),this.controls=e,this._initObservables(),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}return Tt(e,t),e.prototype.registerControl=function(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)},e.prototype.addControl=function(t,e){this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.removeControl=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),at.delete(this.controls,t),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),at.delete(this.controls,t),e&&this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.contains=function(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled},e.prototype.setValue=function(t,e){var n=this,o=(void 0===e?{}:e).onlySelf;this._checkAllValuesPresent(t),at.forEach(t,function(t,e){n._throwIfControlMissing(e),n.controls[e].setValue(t,{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:o})},e.prototype.patchValue=function(t,e){var n=this,o=(void 0===e?{}:e).onlySelf;at.forEach(t,function(t,e){n.controls[e]&&n.controls[e].patchValue(t,{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:o})},e.prototype.reset=function(t,e){void 0===t&&(t={});var n=(void 0===e?{}:e).onlySelf;this._forEachChild(function(e,n){e.reset(t[n],{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:n}),this._updatePristine({onlySelf:n}),this._updateTouched({onlySelf:n})},e.prototype.getRawValue=function(){return this._reduceChildren({},function(t,e,n){return t[n]=e.value,t})},e.prototype._throwIfControlMissing=function(t){if(!Object.keys(this.controls).length)throw new Error("\n        There are no form controls registered with this group yet.  If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.controls[t])throw new Error("Cannot find form control with name: "+t+".")},e.prototype._forEachChild=function(t){at.forEach(this.controls,t)},e.prototype._setUpControls=function(){var t=this;this._forEachChild(function(e){e.setParent(t),e._registerOnCollectionChange(t._onCollectionChange)})},e.prototype._updateValue=function(){this._value=this._reduceValue()},e.prototype._anyControls=function(t){var e=this,n=!1;return this._forEachChild(function(o,r){n=n||e.contains(r)&&t(o)}),n},e.prototype._reduceValue=function(){var t=this;return this._reduceChildren({},function(e,n,o){return(n.enabled||t.disabled)&&(e[o]=n.value),e})},e.prototype._reduceChildren=function(t,e){var n=t;return this._forEachChild(function(t,o){n=e(n,t,o)}),n},e.prototype._allControlsDisabled=function(){for(var t=0,e=Object.keys(this.controls);t<e.length;t++){var n=e[t];if(this.controls[n].enabled)return!1}return Object.keys(this.controls).length>0||this.disabled},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control with name: '"+n+"'.")})},e}(qt),$t=function(t){function e(e,n,o){void 0===n&&(n=null),void 0===o&&(o=null),t.call(this,n,o),this.controls=e,this._initObservables(),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}return Tt(e,t),e.prototype.at=function(t){return this.controls[t]},e.prototype.push=function(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.insert=function(t,e){st.insert(this.controls,t,e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.removeAt=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),st.removeAt(this.controls,t),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),st.removeAt(this.controls,t),e&&(st.insert(this.controls,t,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(e.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),e.prototype.setValue=function(t,e){var n=this,o=(void 0===e?{}:e).onlySelf;this._checkAllValuesPresent(t),t.forEach(function(t,e){n._throwIfControlMissing(e),n.at(e).setValue(t,{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:o})},e.prototype.patchValue=function(t,e){var n=this,o=(void 0===e?{}:e).onlySelf;t.forEach(function(t,e){n.at(e)&&n.at(e).patchValue(t,{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:o})},e.prototype.reset=function(t,e){void 0===t&&(t=[]);var n=(void 0===e?{}:e).onlySelf;this._forEachChild(function(e,n){e.reset(t[n],{onlySelf:!0})}),this.updateValueAndValidity({onlySelf:n}),this._updatePristine({onlySelf:n}),this._updateTouched({onlySelf:n})},e.prototype.getRawValue=function(){return this.controls.map(function(t){return t.value})},e.prototype._throwIfControlMissing=function(t){if(!this.controls.length)throw new Error("\n        There are no form controls registered with this array yet.  If you're using ngModel,\n        you may want to check next tick (e.g. use setTimeout).\n      ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)},e.prototype._forEachChild=function(t){this.controls.forEach(function(e,n){t(e,n)})},e.prototype._updateValue=function(){var t=this;this._value=this.controls.filter(function(e){return e.enabled||t.disabled}).map(function(t){return t.value})},e.prototype._anyControls=function(t){return this.controls.some(function(e){return e.enabled&&t(e)})},e.prototype._setUpControls=function(){var t=this;this._forEachChild(function(e){return t._registerControl(e)})},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control at index: "+n+".")})},e.prototype._allControlsDisabled=function(){for(var t=0,e=this.controls;t<e.length;t++){var n=e[t];if(n.enabled)return!1}return this.controls.length>0||this.disabled},e.prototype._registerControl=function(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)},e}(qt),Yt=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Jt={provide:Q,useExisting:n.forwardRef(function(){return Kt})},Wt=Promise.resolve(null),Kt=function(t){function e(e,n){t.call(this),this._submitted=!1,this.ngSubmit=new Ft,this.form=new zt({},F(e),T(n))}return Yt(e,t),Object.defineProperty(e.prototype,"submitted",{get:function(){return this._submitted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this;Wt.then(function(){var n=e._findContainer(t.path);t._control=n.registerControl(t.name,t.control),M(t.control,t),t.control.updateValueAndValidity({emitEvent:!1})})},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){var e=this;Wt.then(function(){var n=e._findContainer(t.path);s(n)&&n.removeControl(t.name)})},e.prototype.addFormGroup=function(t){var e=this;Wt.then(function(){var n=e._findContainer(t.path),o=new zt({});N(o,t),n.registerControl(t.name,o),o.updateValueAndValidity({emitEvent:!1})})},e.prototype.removeFormGroup=function(t){var e=this;Wt.then(function(){var n=e._findContainer(t.path);s(n)&&n.removeControl(t.name)})},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){var n=this;Wt.then(function(){var o=n.form.get(t.path);o.setValue(e)})},e.prototype.setValue=function(t){this.control.setValue(t)},e.prototype.onSubmit=function(){return this._submitted=!0,this.ngSubmit.emit(null),!1},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this._submitted=!1},e.prototype._findContainer=function(t){return t.pop(),st.isEmpty(t)?this.form:this.form.get(t)},e.decorators=[{type:n.Directive,args:[{selector:"form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]",providers:[Jt],host:{"(submit)":"onSubmit()","(reset)":"onReset()"},outputs:["ngSubmit"],exportAs:"ngForm"}]}],e.ctorParameters=[{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ct]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ut]}]}],e}(Q),Zt={formControlName:'\n    <div [formGroup]="myGroup">\n      <input formControlName="firstName">\n    </div>\n\n    In your class:\n\n    this.myGroup = new FormGroup({\n       firstName: new FormControl()\n    });',formGroupName:'\n    <div [formGroup]="myGroup">\n       <div formGroupName="person">\n          <input formControlName="firstName">\n       </div>\n    </div>\n\n    In your class:\n\n    this.myGroup = new FormGroup({\n       person: new FormGroup({ firstName: new FormControl() })\n    });',formArrayName:'\n    <div [formGroup]="myGroup">\n      <div formArrayName="cities">\n        <div *ngFor="let city of cityArray.controls; let i=index">\n          <input [formControlName]="i">\n        </div>\n      </div>\n    </div>\n\n    In your class:\n\n    this.cityArray = new FormArray([new FormControl(\'SF\')]);\n    this.myGroup = new FormGroup({\n      cities: this.cityArray\n    });',ngModelGroup:'\n    <form>\n       <div ngModelGroup="person">\n          <input [(ngModel)]="person.name" name="firstName">\n       </div>\n    </form>',ngModelWithFormGroup:'\n    <div [formGroup]="myGroup">\n       <input formControlName="firstName">\n       <input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}">\n    </div>\n  '},Qt=function(){function t(){}return t.modelParentException=function(){throw new Error('\n      ngModel cannot be used to register form controls with a parent formGroup directive.  Try using\n      formGroup\'s partner directive "formControlName" instead.  Example:\n\n      '+Zt.formControlName+"\n\n      Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:\n\n      Example:\n\n      "+Zt.ngModelWithFormGroup)},t.formGroupNameException=function(){throw new Error("\n      ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n      Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n      "+Zt.formGroupName+"\n\n      Option 2:  Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n      "+Zt.ngModelGroup)},t.missingNameException=function(){throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n      control must be defined as \'standalone\' in ngModelOptions.\n\n      Example 1: <input [(ngModel)]="person.firstName" name="first">\n      Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">')},t.modelGroupParentException=function(){throw new Error("\n      ngModelGroup cannot be used with a parent formGroup directive.\n\n      Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n      "+Zt.formGroupName+"\n\n      Option 2:  Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n      "+Zt.ngModelGroup)},t}(),Xt=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},te={provide:Q,useExisting:n.forwardRef(function(){return ee})},ee=function(t){function e(e,n,o){t.call(this),this._parent=e,this._validators=n,this._asyncValidators=o}return Xt(e,t),e.prototype._checkParentType=function(){this._parent instanceof e||this._parent instanceof Kt||Qt.modelGroupParentException()},e.decorators=[{type:n.Directive,args:[{selector:"[ngModelGroup]",providers:[te],exportAs:"ngModelGroup"}]}],e.ctorParameters=[{type:Q,decorators:[{type:n.Host},{type:n.SkipSelf}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ct]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ut]}]}],e.propDecorators={name:[{type:n.Input,args:["ngModelGroup"]}]},e}(Et),ne=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},oe={provide:bt,useExisting:n.forwardRef(function(){return ie})},re=Promise.resolve(null),ie=function(t){function e(e,n,o,r){t.call(this),this._control=new Ht,this._registered=!1,this.update=new Ft,this._parent=e,this._rawValidators=n||[],this._rawAsyncValidators=o||[],this.valueAccessor=U(this,r)}return ne(e,t),e.prototype.ngOnChanges=function(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),G(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._parent?k(this.name,this._parent):[this.name]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return F(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return T(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},e.prototype._setUpControl=function(){this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0},e.prototype._isStandalone=function(){return!this._parent||this.options&&this.options.standalone},e.prototype._setUpStandalone=function(){M(this._control,this),this._control.updateValueAndValidity({emitEvent:!1})},e.prototype._checkForErrors=function(){this._isStandalone()||this._checkParentType(),this._checkName()},e.prototype._checkParentType=function(){!(this._parent instanceof ee)&&this._parent instanceof Et?Qt.formGroupNameException():this._parent instanceof ee||this._parent instanceof Kt||Qt.modelParentException()},e.prototype._checkName=function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||Qt.missingNameException()},e.prototype._updateValue=function(t){var e=this;re.then(function(){e.control.setValue(t,{emitViewToModelChange:!1})})},e.prototype._updateDisabled=function(t){var e=this,n=t.isDisabled.currentValue,o=null!=n&&0!=n;re.then(function(){o&&!e.control.disabled?e.control.disable():!o&&e.control.disabled&&e.control.enable()})},e.decorators=[{type:n.Directive,args:[{selector:"[ngModel]:not([formControlName]):not([formControl])",providers:[oe],exportAs:"ngModel"}]}],e.ctorParameters=[{type:Q,decorators:[{type:n.Optional},{type:n.Host}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ct]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ut]}]},{type:Array,decorators:[{type:n.Optional
  },{type:n.Self},{type:n.Inject,args:[pt]}]}],e.propDecorators={name:[{type:n.Input}],isDisabled:[{type:n.Input,args:["disabled"]}],model:[{type:n.Input,args:["ngModel"]}],options:[{type:n.Input,args:["ngModelOptions"]}],update:[{type:n.Output,args:["ngModelChange"]}]},e}(bt),ae=function(){function t(){}return t.controlParentException=function(){throw new Error("formControlName must be used with a parent formGroup directive.  You'll want to add a formGroup\n       directive and pass it an existing FormGroup instance (you can create one in your class).\n\n      Example:\n\n      "+Zt.formControlName)},t.ngModelGroupException=function(){throw new Error('formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n       that also have a "form" prefix: formGroupName, formArrayName, or formGroup.\n\n       Option 1:  Update the parent to be formGroupName (reactive form strategy)\n\n        '+Zt.formGroupName+"\n\n        Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n        "+Zt.ngModelGroup)},t.missingFormException=function(){throw new Error("formGroup expects a FormGroup instance. Please pass one in.\n\n       Example:\n\n       "+Zt.formControlName)},t.groupParentException=function(){throw new Error("formGroupName must be used with a parent formGroup directive.  You'll want to add a formGroup\n      directive and pass it an existing FormGroup instance (you can create one in your class).\n\n      Example:\n\n      "+Zt.formGroupName)},t.arrayParentException=function(){throw new Error("formArrayName must be used with a parent formGroup directive.  You'll want to add a formGroup\n       directive and pass it an existing FormGroup instance (you can create one in your class).\n\n        Example:\n\n        "+Zt.formArrayName)},t.disabledAttrWarning=function(){console.warn("\n      It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n      when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n      you. We recommend using this approach to avoid 'changed after checked' errors.\n       \n      Example: \n      form = new FormGroup({\n        first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n        last: new FormControl('Drew', Validators.required)\n      });\n    ")},t}(),se=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},ce={provide:bt,useExisting:n.forwardRef(function(){return ue})},ue=function(t){function e(e,n,o){t.call(this),this.update=new Ft,this._rawValidators=e||[],this._rawAsyncValidators=n||[],this.valueAccessor=U(this,o)}return se(e,t),Object.defineProperty(e.prototype,"isDisabled",{set:function(t){ae.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){this._isControlChanged(t)&&(M(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})),G(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)},Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return F(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return T(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},e.prototype._isControlChanged=function(t){return at.contains(t,"form")},e.decorators=[{type:n.Directive,args:[{selector:"[formControl]",providers:[ce],exportAs:"ngForm"}]}],e.ctorParameters=[{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ct]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ut]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[pt]}]}],e.propDecorators={form:[{type:n.Input,args:["formControl"]}],model:[{type:n.Input,args:["ngModel"]}],update:[{type:n.Output,args:["ngModelChange"]}],isDisabled:[{type:n.Input,args:["disabled"]}]},e}(bt),le=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},pe={provide:Q,useExisting:n.forwardRef(function(){return fe})},fe=function(t){function e(e,n){t.call(this),this._validators=e,this._asyncValidators=n,this._submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new Ft}return le(e,t),e.prototype.ngOnChanges=function(t){this._checkFormPresent(),at.contains(t,"form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations())},Object.defineProperty(e.prototype,"submitted",{get:function(){return this._submitted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this.form.get(t.path);return M(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){st.remove(this.directives,t)},e.prototype.addFormGroup=function(t){var e=this.form.get(t.path);N(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormGroup=function(t){},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.addFormArray=function(t){var e=this.form.get(t.path);N(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormArray=function(t){},e.prototype.getFormArray=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){var n=this.form.get(t.path);n.setValue(e)},e.prototype.onSubmit=function(){return this._submitted=!0,this.ngSubmit.emit(null),!1},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this._submitted=!1},e.prototype._updateDomValue=function(){var t=this;this.directives.forEach(function(e){var n=t.form.get(e.path);e._control!==n&&(D(e._control,e),n&&M(n,e),e._control=n)}),this.form._updateTreeValidity({emitEvent:!1})},e.prototype._updateRegistrations=function(){var t=this;this.form._registerOnCollectionChange(function(){return t._updateDomValue()}),this._oldForm&&this._oldForm._registerOnCollectionChange(function(){}),this._oldForm=this.form},e.prototype._updateValidators=function(){var t=F(this._validators);this.form.validator=lt.compose([this.form.validator,t]);var e=T(this._asyncValidators);this.form.asyncValidator=lt.composeAsync([this.form.asyncValidator,e])},e.prototype._checkFormPresent=function(){c(this.form)&&ae.missingFormException()},e.decorators=[{type:n.Directive,args:[{selector:"[formGroup]",providers:[pe],host:{"(submit)":"onSubmit()","(reset)":"onReset()"},exportAs:"ngForm"}]}],e.ctorParameters=[{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ct]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ut]}]}],e.propDecorators={form:[{type:n.Input,args:["formGroup"]}],ngSubmit:[{type:n.Output}]},e}(Q),de=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},he={provide:Q,useExisting:n.forwardRef(function(){return me})},me=function(t){function e(e,n,o){t.call(this),this._parent=e,this._validators=n,this._asyncValidators=o}return de(e,t),e.prototype._checkParentType=function(){$(this._parent)&&ae.groupParentException()},e.decorators=[{type:n.Directive,args:[{selector:"[formGroupName]",providers:[he]}]}],e.ctorParameters=[{type:Q,decorators:[{type:n.Optional},{type:n.Host},{type:n.SkipSelf}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ct]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ut]}]}],e.propDecorators={name:[{type:n.Input,args:["formGroupName"]}]},e}(Et),ye={provide:Q,useExisting:n.forwardRef(function(){return ge})},ge=function(t){function e(e,n,o){t.call(this),this._parent=e,this._validators=n,this._asyncValidators=o}return de(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormArray(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormArray(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormArray(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return k(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return F(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return T(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){$(this._parent)&&ae.arrayParentException()},e.decorators=[{type:n.Directive,args:[{selector:"[formArrayName]",providers:[ye]}]}],e.ctorParameters=[{type:Q,decorators:[{type:n.Optional},{type:n.Host},{type:n.SkipSelf}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ct]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ut]}]}],e.propDecorators={name:[{type:n.Input,args:["formArrayName"]}]},e}(Q),ve=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},be={provide:bt,useExisting:n.forwardRef(function(){return _e})},_e=function(t){function e(e,n,o,r){t.call(this),this._added=!1,this.update=new Ft,this._parent=e,this._rawValidators=n||[],this._rawAsyncValidators=o||[],this.valueAccessor=U(this,r)}return ve(e,t),Object.defineProperty(e.prototype,"isDisabled",{set:function(t){ae.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){this._added||this._setUpControl(),G(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},Object.defineProperty(e.prototype,"path",{get:function(){return k(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return F(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return T(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){!(this._parent instanceof me)&&this._parent instanceof Et?ae.ngModelGroupException():this._parent instanceof me||this._parent instanceof fe||this._parent instanceof ge||ae.controlParentException()},e.prototype._setUpControl=function(){this._checkParentType(),this._control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState(!0),this._added=!0},e.decorators=[{type:n.Directive,args:[{selector:"[formControlName]",providers:[be]}]}],e.ctorParameters=[{type:Q,decorators:[{type:n.Optional},{type:n.Host},{type:n.SkipSelf}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ct]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[ut]}]},{type:Array,decorators:[{type:n.Optional},{type:n.Self},{type:n.Inject,args:[pt]}]}],e.propDecorators={name:[{type:n.Input,args:["formControlName"]}],model:[{type:n.Input,args:["ngModel"]}],update:[{type:n.Output,args:["ngModelChange"]}],isDisabled:[{type:n.Input,args:["disabled"]}]},e}(bt),Ce={provide:ct,useExisting:n.forwardRef(function(){return Oe}),multi:!0},Oe=function(){function t(){}return Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this._required=s(t)&&""+t!="false",this._onChange&&this._onChange()},enumerable:!0,configurable:!0}),t.prototype.validate=function(t){return this.required?lt.required(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.decorators=[{type:n.Directive,args:[{selector:"[required][formControlName],[required][formControl],[required][ngModel]",providers:[Ce],host:{"[attr.required]":'required? "" : null'}}]}],t.ctorParameters=[],t.propDecorators={required:[{type:n.Input}]},t}(),we={provide:ct,useExisting:n.forwardRef(function(){return je}),multi:!0},je=function(){function t(){}return t.prototype._createValidator=function(){this._validator=lt.minLength(parseInt(this.minlength,10))},t.prototype.ngOnChanges=function(t){t.minlength&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return s(this.minlength)?this._validator(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.decorators=[{type:n.Directive,args:[{selector:"[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",providers:[we],host:{"[attr.minlength]":"minlength? minlength : null"}}]}],t.ctorParameters=[],t.propDecorators={minlength:[{type:n.Input}]},t}(),Re={provide:ct,useExisting:n.forwardRef(function(){return Se}),multi:!0},Se=function(){function t(){}return t.prototype._createValidator=function(){this._validator=lt.maxLength(parseInt(this.maxlength,10))},t.prototype.ngOnChanges=function(t){t.maxlength&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return s(this.maxlength)?this._validator(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.decorators=[{type:n.Directive,args:[{selector:"[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",providers:[Re],host:{"[attr.maxlength]":"maxlength? maxlength : null"}}]}],t.ctorParameters=[],t.propDecorators={maxlength:[{type:n.Input}]},t}(),Pe={provide:ct,useExisting:n.forwardRef(function(){return Ae}),multi:!0},Ae=function(){function t(){}return t.prototype._createValidator=function(){this._validator=lt.pattern(this.pattern)},t.prototype.ngOnChanges=function(t){t.pattern&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return s(this.pattern)?this._validator(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.decorators=[{type:n.Directive,args:[{selector:"[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",providers:[Pe],host:{"[attr.pattern]":"pattern? pattern : null"}}]}],t.ctorParameters=[],t.propDecorators={pattern:[{type:n.Input}]},t}(),Ve=function(){function t(){}return t.prototype.group=function(t,e){void 0===e&&(e=null);var n=this._reduceControls(t),o=s(e)?at.get(e,"validator"):null,r=s(e)?at.get(e,"asyncValidator"):null;return new zt(n,o,r)},t.prototype.control=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),new Ht(t,e,n)},t.prototype.array=function(t,e,n){var o=this;void 0===e&&(e=null),void 0===n&&(n=null);var r=t.map(function(t){return o._createControl(t)});return new $t(r,e,n)},t.prototype._reduceControls=function(t){var e=this,n={};return at.forEach(t,function(t,o){n[o]=e._createControl(t)}),n},t.prototype._createControl=function(t){if(t instanceof Ht||t instanceof zt||t instanceof $t)return t;if(d(t)){var e=t[0],n=t.length>1?t[1]:null,o=t.length>2?t[2]:null;return this.control(e,n,o)}return this.control(t)},t.decorators=[{type:n.Injectable}],t.ctorParameters=[],t}(),Ee=[Rt,At,mt,gt,dt,jt,Pt,Ot,Nt,It,Oe,je,Se,Ae],ke=[ie,ee,Kt],Me=[ue,fe,_e,me,ge],De=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{declarations:Ee,exports:Ee}]}],t.ctorParameters=[],t}(),Ne=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{declarations:ke,providers:[Ct],exports:[De,ke]}]}],t.ctorParameters=[],t}(),Ie=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{declarations:[Me],providers:[Ve,Ct],exports:[De,Me]}]}],t.ctorParameters=[],t}();e.AbstractControlDirective=K,e.AbstractFormGroupDirective=Et,e.CheckboxControlValueAccessor=dt,e.ControlContainer=Q,e.NG_VALUE_ACCESSOR=pt,e.DefaultValueAccessor=mt,e.NgControl=bt,e.NgControlStatus=Nt,e.NgControlStatusGroup=It,e.NgForm=Kt,e.NgModel=ie,e.NgModelGroup=ee,e.FormControlDirective=ue,e.FormControlName=_e,e.FormGroupDirective=fe,e.FormArrayName=ge,e.FormGroupName=me,e.NgSelectOption=Rt,e.SelectControlValueAccessor=jt,e.SelectMultipleControlValueAccessor=Pt,e.MaxLengthValidator=Se,e.MinLengthValidator=je,e.PatternValidator=Ae,e.RequiredValidator=Oe,e.FormBuilder=Ve,e.AbstractControl=qt,e.FormArray=$t,e.FormControl=Ht,e.FormGroup=zt,e.NG_ASYNC_VALIDATORS=ut,e.NG_VALIDATORS=ct,e.Validators=lt,e.FormsModule=Ne,e.ReactiveFormsModule=Ie})}).call(e,function(){return this}())},66:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(22),s=n(67),c=n(68),u=n(69),l=n(70),p=function(){function t(){}return t=o([i.NgModule({imports:[a.CommonModule],declarations:[s.UserNameValidator,c.EmailValidator,u.PasswordValidator,l.ConfirmationValidator],exports:[s.UserNameValidator,c.EmailValidator,u.PasswordValidator,l.ConfirmationValidator]}),r("design:paramtypes",[])],t)}();e.ValidatorsModule=p},67:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(64),s=function(){function t(){}return t.prototype.validate=function(t){var e=/^[A-Za-z][A-Za-z0-9]{4,}$/;return t.value?e.test(t.value)?null:{message:"Name requires at least 5 letters or digits, does not contain spaces and begins with letter"}:{message:"Name is required"}},t=o([i.Directive({selector:"[validate-name][ngModel],[validate-name][formControl]",providers:[{provide:a.NG_VALIDATORS,useExisting:t,multi:!0}]}),r("design:paramtypes",[])],t)}();e.UserNameValidator=s},68:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(64),s=function(){function t(){}return t.prototype.validate=function(t){var e=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;return t.value?e.test(t.value)?null:{message:"Invalid email address"}:{message:"Email address is required"}},t=o([i.Directive({selector:"[validate-email][ngModel],[validate-email][formControl]",providers:[{provide:a.NG_VALIDATORS,useExisting:t,multi:!0}]}),r("design:paramtypes",[])],t)}();e.EmailValidator=s},69:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(64),s=function(){function t(){}return t.prototype.validate=function(t){var e=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])\S{8,}$/;return t.value?e.test(t.value)?null:{message:"Password requires at least 8 characters without spaces, one number, one lowercase and one uppercase letter"}:{message:"Password is required"}},t=o([i.Directive({selector:"[validate-password][ngModel],[validate-password][formControl]",providers:[{provide:a.NG_VALIDATORS,useExisting:t,multi:!0}]}),r("design:paramtypes",[])],t)}();e.PasswordValidator=s},70:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(64),s=function(){function t(){}return t.prototype.validate=function(t){var e=Object.keys(t.controls);if(2!==e.length)return null;var n=t.controls[e[0]].value,o=t.controls[e[1]].value;return n&&o&&n!==o?{message:"Password mismatch"}:null},t=o([i.Directive({selector:"[validate-confirmation][ngModelGroup]",providers:[{provide:a.NG_VALIDATORS,useExisting:t,multi:!0}]}),r("design:paramtypes",[])],t)}();e.ConfirmationValidator=s},71:function(t,e,n){"use strict";var o=n(72),r=n(74),i=n(62);e.userRoutes=[{path:"login",component:o.LoginComponent,canActivate:[i.LoggedOutGuard]},{path:"register",component:r.RegisterComponent,canActivate:[i.LoggedOutGuard]}]},72:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(58),s=n(59),c=function(){function t(t){this.auth=t,this.user=new s.LoginUser}return t.prototype.login=function(){this.auth.login(this.user,"/home")},t=o([i.Component({template:n(73)}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof a.AuthService&&a.AuthService)&&e||Object])],t);var e}();e.LoginComponent=c},73:function(t,e){t.exports='<div class="row">\n    <div class="col-sm-4 col-sm-offset-4">\n\n        <form novalidate (ngSubmit)="login()" #loginForm="ngForm">\n            <div class="form-group">\n                <label for="email">Email</label>\n                <input\n                    type="text"\n                    placeholder="Email address"\n                    class="form-control"\n                    [(ngModel)]="user.email"\n                    validate-email\n                    name="email"\n                    #email="ngModel">\n                <div [hidden]="email.valid || email.pristine" class="alert alert-danger">\n                    <small>{{email.errors?.message}}</small>\n                </div>\n            </div>\n            <div class="form-group">\n                <label for="password">Password</label>\n                <input\n                    type="password"\n                    class="form-control"\n                    placeholder="Password"\n                    [(ngModel)]="user.password"\n                    validate-password\n                    name="password"\n                    #password="ngModel">\n                <div [hidden]="password.valid || password.pristine" class="alert alert-danger">\n                    <small>{{password.errors?.message}}</small>\n                </div>\n            </div>\n            <button type="submit" [disabled]="!loginForm.valid" class="btn btn-default">\n                Log in\n            </button>\n        </form>\n\n    </div>\n</div>\n'},74:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(58),s=n(59),c=n(60),u=function(){function t(t,e){this.config=t,this.auth=e,this.user=new s.RegisterUser,this.passwordConfirmation=""}return t.prototype.register=function(){this.auth.register(this.user,"/home",this.reset.bind(this))},t.prototype.getCaptchaResponse=function(t){this.user.captchaResponse=t},t.prototype.reset=function(){window.grecaptcha.reset(),this.user.captchaResponse=""},t=o([i.Component({template:n(75)}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof c.AppConfig&&c.AppConfig)&&e||Object,"function"==typeof(u="undefined"!=typeof a.AuthService&&a.AuthService)&&u||Object])],t);var e,u}();e.RegisterComponent=u},75:function(t,e){t.exports='<div class="row">\n    <div class="col-sm-4 col-sm-offset-4">\n\n        <form novalidate (ngSubmit)="register()" #registerForm="ngForm">\n\n            <div class="form-group">\n                <label for="name">Name</label>\n                <input\n                    type="text"\n                    placeholder="User name"\n                    class="form-control"\n                    [(ngModel)]="user.name"\n                    validate-name\n                    name="name"\n                    #name="ngModel">\n                <div [hidden]="name.valid || name.pristine" class="alert alert-danger">\n                    <small>{{name.errors?.message}}</small>\n                </div>\n            </div>\n\n            <div class="form-group">\n                <label for="email">Email</label>\n                <input\n                    type="text"\n                    placeholder="Email address"\n                    class="form-control"\n                    [(ngModel)]="user.email"\n                    validate-email\n                    name="email"\n                    #email="ngModel">\n                <div [hidden]="email.valid || email.pristine" class="alert alert-danger">\n                    <small>{{email.errors?.message}}</small>\n                </div>\n            </div>\n\n            <div ngModelGroup #passwordGroup="ngModelGroup" validate-confirmation>\n                <div class="form-group">\n                    <label for="password">Password</label>\n                    <input\n                        type="password"\n                        placeholder="Password"\n                        class="form-control"\n                        [(ngModel)]="user.password"\n                        validate-password\n                        name="password"\n                        #password="ngModel">\n                    <div [hidden]="password.valid || password.pristine" class="alert alert-danger">\n                        <small>{{password.errors?.message}}</small>\n                    </div>\n                </div>\n\n                <div class="form-group">\n                    <label for="confirmation">Confirmation</label>\n                    <input\n                        type="password"\n                        placeholder="Password confirmation"\n                        class="form-control"\n                        [(ngModel)]="passwordConfirmation"\n                        required\n                        name="confirmation"\n                        #confirmation="ngModel">\n                    <div [hidden]="confirmation.valid || confirmation.pristine" class="alert alert-danger">\n                        <small>Confirmation is required</small>\n                    </div>\n                </div>\n\n                <div [hidden]="!passwordGroup.errors" class="alert alert-danger">\n                    <small>{{passwordGroup.errors?.message}}</small>\n                </div>\n            </div>\n\n            <div class="form-group">\n                <re-captcha\n                    [siteKey]="config.reCaptchaSiteKey"\n                    (captchaResponse)="getCaptchaResponse($event)">                        \n                </re-captcha>\n            </div>\n\n            <button\n                type="submit"\n                [disabled]="!registerForm.form.valid || !user.captchaResponse"\n                class="btn btn-default">\n                Sign up\n            </button>\n        </form>\n\n    </div>\n</div>\n'},76:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=function(){function t(t){this.zone=t,this.siteKey=null,this.captchaResponse=new i.EventEmitter}return t.prototype.ngOnInit=function(){var t=this;window.verifyCallback=function(e){return t.zone.run(function(){return t.captchaResponse.emit(e)})};var e=document.body,n=document.createElement("script");n.innerHTML="",n.src="https://www.google.com/recaptcha/api.js",n.async=!0,n.defer=!0,e.appendChild(n)},o([i.Input(),r("design:type",String)],t.prototype,"siteKey",void 0),o([i.Output(),r("design:type",Object)],t.prototype,"captchaResponse",void 0),t=o([i.Component({selector:"re-captcha",template:'\n        <div\n            class="g-recaptcha"\n            [attr.data-sitekey]="siteKey"\n            data-callback="verifyCallback">\n        </div>\n    '}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof i.NgZone&&i.NgZone)&&e||Object])],t);var e}();e.ReCaptchaComponent=a},77:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(25),s=n(22),c=n(64),u=n(78),l=n(387),p=n(388),f=n(389),d=n(394),h=n(391),m=function(){
  function t(){}return t=o([i.NgModule({imports:[s.CommonModule,c.FormsModule,u.CustomizationModule,a.RouterModule.forChild(l.booksRoutes)],declarations:[p.BooksComponent,f.BookListComponent,d.EditBookComponent,h.NewBookComponent]}),r("design:paramtypes",[])],t)}();e.BooksModule=m},78:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(22),s=n(64),c=n(25),u=n(79),l=n(80),p=n(379),f=n(385),d=function(){function t(){}return t=o([i.NgModule({imports:[a.CommonModule,s.FormsModule,c.RouterModule],declarations:[u.DateInputComponent,l.ModalComponent,p.ItemListComponent,f.PagerComponent],exports:[u.DateInputComponent,p.ItemListComponent],schemas:[i.CUSTOM_ELEMENTS_SCHEMA]}),r("design:paramtypes",[])],t)}();e.CustomizationModule=d},79:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(64),s=function(){},c={provide:a.NG_VALUE_ACCESSOR,useExisting:i.forwardRef(function(){return u}),multi:!0},u=function(){function t(){this.title="",this.innerValue="",this.onTouchedCallback=s,this.onChangeCallback=s}return Object.defineProperty(t.prototype,"value",{get:function(){return this.innerValue},set:function(t){if(t!==this.innerValue){this.innerValue=t;var e=new Date(t);this.bindValue=e.toJSON()?e:null,this.onChangeCallback(this.bindValue)}},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){t&&(this.bindValue=t,this.innerValue=this.formatDate())},t.prototype.registerOnChange=function(t){this.onChangeCallback=t},t.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},t.prototype.formatDate=function(){var t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];if(!this.bindValue)return null;var e=this.bindValue.getFullYear(),n=this.bindValue.getMonth(),o=this.bindValue.getDate();return t[n]+" "+o+", "+e},o([i.Input(),r("design:type",Object)],t.prototype,"title",void 0),t=o([i.Component({selector:"my-date-input",template:'\n        <label for="completed">\n            {{title}}\n            <span class="label label-default">{{formatDate()}}</span>\n        </label>\n        <input [(ngModel)]="value" placeholder="Free date format" class="form-control">\n    ',providers:[c]}),r("design:paramtypes",[])],t)}();e.DateInputComponent=u},80:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(81),s=function(){function t(){this.closeOnEscape=!0,this.closeOnOutsideClick=!1,this.hideCloseButton=!1,this.isOpened=!1,this.createBackDrop()}return t.prototype.ngOnDestroy=function(){this.backdropElement&&this.backdropElement.parentNode===document.body&&document.body.removeChild(this.backdropElement)},t.prototype.open=function(t){var e=this;return this.modalData=t,this.isOpened=!0,document.body.appendChild(this.backdropElement),window.setTimeout(function(){return e.modalRoot.nativeElement.focus()},0),this.closeEvents=new a.Subject,this.closeEvents.asObservable()},t.prototype.dismiss=function(){this.closeEvents.next(!1),this.close()},t.prototype.submit=function(){this.closeEvents.next(!0),this.close()},t.prototype.close=function(){this.isOpened=!1,document.body.removeChild(this.backdropElement)},t.prototype.preventClosing=function(t){t.stopPropagation()},t.prototype.createBackDrop=function(){this.backdropElement=document.createElement("div"),this.backdropElement.classList.add("modal-backdrop"),this.backdropElement.classList.add("fade"),this.backdropElement.classList.add("in")},o([i.Input(),r("design:type",String)],t.prototype,"modalClass",void 0),o([i.Input(),r("design:type",Boolean)],t.prototype,"closeOnEscape",void 0),o([i.Input(),r("design:type",Boolean)],t.prototype,"closeOnOutsideClick",void 0),o([i.Input(),r("design:type",String)],t.prototype,"title",void 0),o([i.Input(),r("design:type",Object)],t.prototype,"hideCloseButton",void 0),o([i.Input(),r("design:type",String)],t.prototype,"cancelButtonLabel",void 0),o([i.Input(),r("design:type",String)],t.prototype,"submitButtonLabel",void 0),o([i.ViewChild("modalRoot"),r("design:type","function"==typeof(e="undefined"!=typeof i.ElementRef&&i.ElementRef)&&e||Object)],t.prototype,"modalRoot",void 0),t=o([i.Component({selector:"my-modal",template:'\n<div class="modal" \n     tabindex="-1"\n     role="dialog"\n     #modalRoot\n     (keydown.enter)="submitButtonLabel ? submit() : 0"\n     (keydown.esc)="closeOnEscape ? dismiss() : 0"\n     [ngStyle]="{ display: isOpened ? \'block\' : \'none\' }"\n     (click)="closeOnOutsideClick ? dismiss() : 0">\n    <div [class]="\'modal-dialog \' + modalClass" (click)="preventClosing($event)">\n        <div class="modal-content" tabindex="0" *ngIf="isOpened">\n            <div class="modal-header">\n                <button *ngIf="!hideCloseButton" type="button" class="close" (click)="dismiss()"><span aria-hidden="true">&times;</span></button>\n                <h4 class="modal-title" *ngIf="title">{{ title }}</h4>\n                <ng-content select="modal-header"></ng-content>\n            </div>\n            <div class="modal-body">\n                <ng-content select="modal-content"></ng-content>\n            </div>\n            <div class="modal-footer">\n                <ng-content select="modal-footer"></ng-content>\n                <button *ngIf="submitButtonLabel" type="button" class="btn btn-default" (click)="submit()">{{ submitButtonLabel }}</button>\n                <button *ngIf="cancelButtonLabel" type="button" class="btn btn-default" (click)="dismiss()">{{ cancelButtonLabel }}</button>\n            </div>\n        </div>\n    </div>\n</div>\n'}),r("design:paramtypes",[])],t);var e}();e.ModalComponent=s},379:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(24),s=n(60),c=n(58),u=n(80),l=n(61),p=n(380),f=n(381).saveAs,d=function(){function t(t,e,n,o){this.http=t,this.config=e,this.auth=n,this.ntfs=o}return t.prototype.ngOnInit=function(){this.pageReset()},t.prototype.getItems=function(){var t=this,e=this.config.apiUrl+"/"+this.apiSelector,n=Object.assign({},this.auth.authHeader,this.state.queryParams);this.http.get(e,n).map(function(t){var e=t.json();return e.items.forEach(function(t){return t.completed=new Date(t.completed)}),e}).subscribe(function(e){t.items=e.items,t.pages=e.pages})},t.prototype.applySearch=function(t){this.state.term=t,this.state.page=1,this.getItems()},t.prototype.pageChange=function(t){this.state.page=t,this.getItems()},t.prototype.pageReset=function(){this.state.page=1,this.getItems()},t.prototype.removeConfirm=function(t){var e=this;this.deleteConfirm.open(t.title).subscribe(function(n){n&&e.removeBook(t)})},t.prototype.removeBook=function(t){var e=this,n=this.config.apiUrl+"/"+this.apiSelector+"/"+t._id;this.http.delete(n,this.auth.authHeader).subscribe(function(t){e.pageReset(),e.ntfs.notifySuccess("An item has been removed :-)")},function(t){e.ntfs.notifyDanger("Something went wrong when removing an item :-(")})},t.prototype.formatDate=function(t){var e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];if(!t)return null;var n=t.getFullYear(),o=t.getMonth(),r=t.getDate();return e[o]+" "+r+", "+n},t.prototype.download=function(){var t=this,e=this.config.apiUrl+"/"+this.apiSelector,n=Object.assign({},this.auth.authHeader,this.state.searchParams);this.http.get(e,n).map(function(t){return t.json()}).subscribe(function(e){var n=new Blob([JSON.stringify(e.items,t.replaceForDownload,1)],{type:"application/json"});f(n,t.exportFileName)})},t.prototype.replaceForDownload=function(t,e){if("_id"!==t&&""!==e)return"completed"===t?e.split(/T/)[0]:e},t.prototype.uploadChange=function(t){var e=this,n=t.target.files;if(n.length){var o=this.config.apiUrl+"/"+this.apiSelector+"/upload";this.uploadRequest(o,n[0],this.auth.authHeader.headers).then(function(){e.pageReset(),e.ntfs.notifySuccess("Items have been uploaded :-)")},function(){e.ntfs.notifyDanger("Something went wrong when uploading items :-(")}),this.uploadForm.nativeElement.reset()}},t.prototype.uploadRequest=function(t,e,n){return new Promise(function(o,r){var i=new FormData,a=new XMLHttpRequest;i.append("upload",e,e.name),a.onreadystatechange=function(){4==a.readyState&&(200==a.status?o(a.response):r(a.response))},a.open("POST",t,!0),n.forEach(function(t,e,n){a.setRequestHeader(e,t[0])}),a.send(i)})},o([i.Input(),r("design:type","function"==typeof(e="undefined"!=typeof p.ItemsStateService&&p.ItemsStateService)&&e||Object)],t.prototype,"state",void 0),o([i.Input(),r("design:type",String)],t.prototype,"searchPlaceholder",void 0),o([i.Input(),r("design:type",String)],t.prototype,"addPrompt",void 0),o([i.Input(),r("design:type",String)],t.prototype,"uploadPrompt",void 0),o([i.Input(),r("design:type",String)],t.prototype,"downloadPrompt",void 0),o([i.Input(),r("design:type",String)],t.prototype,"removeHeader",void 0),o([i.Input(),r("design:type",String)],t.prototype,"apiSelector",void 0),o([i.Input(),r("design:type",String)],t.prototype,"exportFileName",void 0),o([i.ViewChild("deleteConfirm"),r("design:type","function"==typeof(d="undefined"!=typeof u.ModalComponent&&u.ModalComponent)&&d||Object)],t.prototype,"deleteConfirm",void 0),o([i.ViewChild("uploadForm"),r("design:type",Object)],t.prototype,"uploadForm",void 0),t=o([i.Component({selector:"item-list",template:n(384)}),r("design:paramtypes",["function"==typeof(h="undefined"!=typeof a.Http&&a.Http)&&h||Object,"function"==typeof(m="undefined"!=typeof s.AppConfig&&s.AppConfig)&&m||Object,"function"==typeof(y="undefined"!=typeof c.AuthService&&c.AuthService)&&y||Object,"function"==typeof(g="undefined"!=typeof l.NotificationService&&l.NotificationService)&&g||Object])],t);var e,d,h,m,y,g}();e.ItemListComponent=d},380:function(t,e,n){"use strict";var o=n(24),r=function(){function t(){this.term=""}return Object.defineProperty(t.prototype,"queryParams",{get:function(){var t=new o.URLSearchParams;return this.term.trim()&&t.append("term",this.term),this.page>0&&t.append("page",this.page.toString()),{search:t}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"searchParams",{get:function(){var t=new o.URLSearchParams;return this.term.trim()&&t.append("term",this.term),{search:t}},enumerable:!0,configurable:!0}),t}();e.ItemsStateService=r},381:function(t,e,n){var o,r,i=i||function(t){"use strict";if(!("undefined"==typeof t||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var e=t.document,n=function(){return t.URL||t.webkitURL||t},o=e.createElementNS("http://www.w3.org/1999/xhtml","a"),r="download"in o,i=function(t){var e=new MouseEvent("click");t.dispatchEvent(e)},a=/constructor/i.test(t.HTMLElement),s=/CriOS\/[\d]+/.test(navigator.userAgent),c=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},u="application/octet-stream",l=4e4,p=function(t){var e=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};setTimeout(e,l)},f=function(t,e,n){e=[].concat(e);for(var o=e.length;o--;){var r=t["on"+e[o]];if("function"==typeof r)try{r.call(t,n||t)}catch(i){c(i)}}},d=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t},h=function(e,c,l){l||(e=d(e));var h,m=this,y=e.type,g=y===u,v=function(){f(m,"writestart progress write writeend".split(" "))},b=function(){if((s||g&&a)&&t.FileReader){var o=new FileReader;return o.onloadend=function(){var e=s?o.result:o.result.replace(/^data:[^;]*;/,"data:attachment/file;"),n=t.open(e,"_blank");n||(t.location.href=e),e=void 0,m.readyState=m.DONE,v()},o.readAsDataURL(e),void(m.readyState=m.INIT)}if(h||(h=n().createObjectURL(e)),g)t.location.href=h;else{var r=t.open(h,"_blank");r||(t.location.href=h)}m.readyState=m.DONE,v(),p(h)};return m.readyState=m.INIT,r?(h=n().createObjectURL(e),void setTimeout(function(){o.href=h,o.download=c,i(o),v(),p(h),m.readyState=m.DONE})):void b()},m=h.prototype,y=function(t,e,n){return new h(t,e||t.name||"download",n)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return e=e||t.name||"download",n||(t=d(t)),navigator.msSaveOrOpenBlob(t,e)}:(m.abort=function(){},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,y)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof t&&t.exports?t.exports.saveAs=i:null!==n(382)&&null!==n(383)&&(o=[],r=function(){return i}.apply(e,o),!(void 0!==r&&(t.exports=r)))},382:function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},383:function(t,e){(function(e){t.exports=e}).call(e,{})},384:function(t,e){t.exports='<my-modal #deleteConfirm title={{removeHeader}} submitButtonLabel="Yes" cancelButtonLabel="No">\n    <modal-content>\n        Are you sure you want to remove <span class="badge">{{deleteConfirm.modalData}}</span>?\n    </modal-content>\n</my-modal>\n\n<div class=" my-search input-group">\n\n    <input #search (keydown.enter)="applySearch(search.value)" (keydown.esc)="applySearch(\'\')" [value]="state.term" type="text" class="form-control" placeholder={{searchPlaceholder}}>\n\n    <div class="input-group-btn">\n\n        <a (click)="applySearch(search.value)" class="btn btn-default" title="Apply Search Filter"><i class="glyphicon glyphicon-search"></i></a>\n\n        <a (click)="applySearch(\'\')" class="btn btn-default" title="Clear Search Filter"><i class="glyphicon glyphicon-remove-sign"></i></a>\n\n        <a [routerLink]="[\'new\']" class="btn btn-default" title={{addPrompt}}><i class="glyphicon glyphicon-plus"></i></a>\n\n        <a (click)="download()" class="btn btn-default" title="{{downloadPrompt}}"><i class="glyphicon glyphicon-download"></i></a>\n\n        <label for="file" class="btn btn-default" title={{uploadPrompt}}><i class="glyphicon glyphicon-upload"></i></label>\n\n    </div>\n</div>\n\n<form #uploadForm>\n    <input type="file" id="file" (change)="uploadChange($event)">\n</form>\n\n<div class="panel panel-default">\n    <ng-content></ng-content>\n</div>\n\n<my-pager *ngIf="pages" [frame]="8" [pagesCount]="pages" [page]="state.page" (change)="pageChange($event)"></my-pager>\n\n'},385:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=function(){function t(){this.frame=10,this.change=new i.EventEmitter}return t.prototype.getPagerLimits=function(t,e){if(t<=this.frame)return{min:1,max:t};var n=Math.floor(this.frame/2),o=t-n+1,r=1;n<e&&e<o&&(r=e-n),e>=o&&(r=o-n);var i=r+this.frame-1;return{min:r,max:i}},Object.defineProperty(t.prototype,"pages",{get:function(){for(var t=this.getPagerLimits(this.pagesCount,this.page),e=t.min,n=t.max,o=[],r=e;r<=n;r++)o.push(r);return o},enumerable:!0,configurable:!0}),t.prototype.select=function(t,e){t.preventDefault(),this.change.emit(e)},t.prototype.previous=function(t){t.preventDefault(),this.change.emit(this.page-1)},t.prototype.next=function(t){t.preventDefault(),this.change.emit(this.page+1)},o([i.Input(),r("design:type",Object)],t.prototype,"frame",void 0),o([i.Input(),r("design:type",Number)],t.prototype,"page",void 0),o([i.Input(),r("design:type",Number)],t.prototype,"pagesCount",void 0),o([i.Output(),r("design:type",Object)],t.prototype,"change",void 0),t=o([i.Component({selector:"my-pager",template:n(386)}),r("design:paramtypes",[])],t)}();e.PagerComponent=a},386:function(t,e){t.exports='<ul class="pagination">\n\n  <li *ngIf="page > 1">\n    <a href="" (click)="previous($event)">\n      <span aria-hidden="true">&laquo;</span>\n    </a>\n  </li>\n\n  <li *ngFor="let p of pages">\n    <a href="" [class.active]="p == page" (click)="select($event, p)">{{p}}</a>\n  </li>\n\n  <li *ngIf="page < pagesCount">\n    <a href="" (click)="next($event)">\n      <span aria-hidden="true">&raquo;</span>\n    </a>\n  </li>\n\n</ul>\n'},387:function(t,e,n){"use strict";var o=n(388),r=n(389),i=n(391),a=n(394),s=n(57);e.booksRoutes=[{path:"books",component:o.BooksComponent,children:[{path:"",component:r.BookListComponent},{path:"new",component:i.NewBookComponent},{path:":id",component:a.EditBookComponent}],canActivate:[s.LoggedInGuard]}]},388:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(380),s=function(){function t(){}return t=o([i.Component({template:"\n        <router-outlet></router-outlet>\n    ",providers:[a.ItemsStateService]}),r("design:paramtypes",[])],t)}();e.BooksComponent=s},389:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(380),s=function(){function t(t){this.state=t}return t=o([i.Component({template:n(390)}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof a.ItemsStateService&&a.ItemsStateService)&&e||Object])],t);var e}();e.BookListComponent=s},390:function(t,e){t.exports='<item-list #itemList\n    [state]="state"\n    apiSelector="books"\n    searchPlaceholder="Search for book title or author"\n    addPrompt="Add Book"\n    removeHeader="Removing Book"\n    downloadPrompt="Download Books"\n    uploadPrompt="Upload Books"\n    exportFileName="books.json">\n\n    <div class="table-responsive">\n        <table class="table table-striped">\n            <thead>\n                <tr>\n                    <th style="width: 10%"></th>\n                    <th style="width: 15%">Completed</th>\n                    <th style="width: 8%">Mode</th>\n                    <th style="width: 25%">Author</th>\n                    <th>Title</th>\n                </tr>\n            </thead>\n            <tbody>\n                <tr *ngFor="let book of itemList.items">\n                    <td>\n                        <div class="input-group-btn">\n                            <a [routerLink]="[book._id]" class="btn btn-default" title="Edit Book">\n                                <i class="glyphicon glyphicon-pencil"></i>\n                            </a>\n                            <a (click)="itemList.removeConfirm(book)" class="btn btn-default" title="Remove Book">\n                                <i class="glyphicon glyphicon-remove"></i>\n                            </a>\n                        </div>\n                    </td>\n                    <!-- Date pipe doesn\'t work in Safari -->\n                    <td>{{itemList.formatDate(book.completed)}}</td>\n                    <td>{{book.mode}}</td>\n                    <td>{{book.author}}</td>\n                    <td>{{book.title}}</td>\n                </tr>\n           </tbody>\n        </table>\n    </div>\n\n</item-list>\n'},391:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(25),s=n(392),c=n(24),u=n(60),l=n(58),p=n(61),f=function(){function t(t,e,n,o,r){this.config=t,this.http=e,this.auth=n,this.ntfs=o,this.router=r,this.book=new s.Book,this.header="New Book"}return t.prototype.submit=function(){var t=this,e=this.config.apiUrl+"/books";this.http.post(e,this.book,this.auth.authHeader).subscribe(function(e){t.ntfs.notifySuccess("New book has been added :-)"),t.router.navigate(["/books"])},function(e){t.ntfs.notifyDanger("Something went wrong when adding new book :-(")})},t=o([i.Component({template:n(393)}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof u.AppConfig&&u.AppConfig)&&e||Object,"function"==typeof(f="undefined"!=typeof c.Http&&c.Http)&&f||Object,"function"==typeof(d="undefined"!=typeof l.AuthService&&l.AuthService)&&d||Object,"function"==typeof(h="undefined"!=typeof p.NotificationService&&p.NotificationService)&&h||Object,"function"==typeof(m="undefined"!=typeof a.Router&&a.Router)&&m||Object])],t);var e,f,d,h,m}();e.NewBookComponent=f},392:function(t,e){"use strict";var n=function(){function t(){}return t}();e.Book=n},393:function(t,e){t.exports='<div class="row">\n\n    <div class="col-sm-4">\n        <h4>{{header}}</h4>\n    </div>\n\n    <div class="col-sm-4">\n\n        <form novalidate (ngSubmit)="submit()" #bookForm="ngForm">\n            <div class="form-group">\n                <label for="title">Title</label>\n                <input\n                    type="text"\n                    placeholder="Book title"\n                    class="form-control"\n                    [(ngModel)]="book.title"\n                    required\n                    name="title"\n                    #title="ngModel">\n                <div [hidden]="title.valid || title.pristine" class="alert alert-danger">\n                    <small>Book title is required</small>\n                </div>\n            </div>\n            <div class="form-group">\n                <label for="author">Author</label>\n                <input\n                    type="text"\n                    class="form-control"\n                    placeholder="Author"\n                    [(ngModel)]="book.author"\n                    required\n                    name="author"\n                    #author="ngModel">\n                <div [hidden]="author.valid || author.pristine" class="alert alert-danger">\n                    <small>Author is required</small>\n                </div>\n            </div>\n            <div class="form-group">\n            <label for="mode">Book type</label>\n            <select\n                class="form-control"\n                [(ngModel)]="book.mode"\n                required\n                name="mode"\n                #mode="ngModel">\n                <option [value]="\'r\'">Regular book</option>\n                <option [value]="\'a\'">Audio book</option>\n                <option [value]="\'r-a\'">Both: Regular and Audio</option>\n            </select>\n            </div>\n            <div class="form-group">\n                <my-date-input\n                    title="Completed on"\n                    [(ngModel)]="book.completed"\n                    required\n                    name="completed"\n                    #completed="ngModel">\n                </my-date-input>\n                <div [hidden]="completed.valid || completed.pristine" class="alert alert-danger">\n                    <small>Completion date has wrong format</small>\n                </div>\n            </div>\n            <button type="submit" [disabled]="!bookForm.valid" class="btn btn-default">Submit</button>\n            <a [routerLink]="[\'../\']" class="btn btn-default">Reject</a>\n        </form>\n\n    </div>\n</div>\n'},394:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(25),s=n(392),c=n(24),u=n(60),l=n(58),p=n(61),f=function(){function t(t,e,n,o,r,i){this.route=t,this.config=e,this.http=n,this.auth=o,this.ntfs=r,this.router=i,this.book=new s.Book,this.header="Edit Book"}return t.prototype.ngOnInit=function(){var t=this;this.sub=this.route.params.subscribe(function(e){var n=e.id;t.apiUrl=t.config.apiUrl+"/books/"+n,t.http.get(t.apiUrl,t.auth.authHeader).map(function(t){var e=t.json();return e.completed=new Date(e.completed),e}).subscribe(function(e){return t.book=e})})},t.prototype.ngOnDestroy=function(){this.sub.unsubscribe()},t.prototype.submit=function(){var t=this;this.http.put(this.apiUrl,this.book,this.auth.authHeader).subscribe(function(e){t.ntfs.notifySuccess("A book has been modified :-)"),t.router.navigate(["/books"])},function(e){t.ntfs.notifyDanger("Something went wrong when modifying a book :-(")})},t=o([i.Component({template:n(393)}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof a.ActivatedRoute&&a.ActivatedRoute)&&e||Object,"function"==typeof(f="undefined"!=typeof u.AppConfig&&u.AppConfig)&&f||Object,"function"==typeof(d="undefined"!=typeof c.Http&&c.Http)&&d||Object,"function"==typeof(h="undefined"!=typeof l.AuthService&&l.AuthService)&&h||Object,"function"==typeof(m="undefined"!=typeof p.NotificationService&&p.NotificationService)&&m||Object,"function"==typeof(y="undefined"!=typeof a.Router&&a.Router)&&y||Object])],t);var e,f,d,h,m,y}();e.EditBookComponent=f},395:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(25),s=n(22),c=n(64),u=n(78),l=n(396),p=n(397),f=n(398),d=n(403),h=n(400),m=function(){function t(){}return t=o([i.NgModule({imports:[s.CommonModule,c.FormsModule,u.CustomizationModule,a.RouterModule.forChild(l.moviesRoutes)],declarations:[p.MoviesComponent,f.MovieListComponent,d.EditMovieComponent,h.NewMovieComponent]}),r("design:paramtypes",[])],t)}();e.MoviesModule=m},396:function(t,e,n){"use strict";var o=n(397),r=n(398),i=n(400),a=n(403),s=n(57);e.moviesRoutes=[{path:"movies",component:o.MoviesComponent,children:[{path:"",component:r.MovieListComponent},{path:"new",component:i.NewMovieComponent},{path:":id",component:a.EditMovieComponent}],canActivate:[s.LoggedInGuard]}]},397:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(380),s=function(){function t(){}return t=o([i.Component({template:"\n        <router-outlet></router-outlet>\n    ",providers:[a.ItemsStateService]}),r("design:paramtypes",[])],t)}();e.MoviesComponent=s},398:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(380),s=function(){function t(t){this.state=t}return t=o([i.Component({template:n(399)}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof a.ItemsStateService&&a.ItemsStateService)&&e||Object])],t);var e}();e.MovieListComponent=s},399:function(t,e){t.exports='<item-list #itemList\n    [state]="state"\n    apiSelector="movies"\n    searchPlaceholder="Search for movie title, year of production or notes"\n    addPrompt="Add Movie"\n    removeHeader="Removing Movie"\n    downloadPrompt="Download Movies"\n    uploadPrompt="Upload Movies"\n    exportFileName="movies.json">\n\n    <div class="table-responsive">\n        <table class="table table-striped">\n            <thead>\n                <tr>\n                    <th style="width: 10%"></th>\n                    <th style="width: 15%">Completed</th>\n                    <th style="width: 10%">Year</th>\n                    <th style="width: 40%">Title</th>\n                    <th>Notes</th>\n                </tr>\n            </thead>\n            <tbody>\n                <tr *ngFor="let movie of itemList.items">\n                    <td>\n                        <div class="input-group-btn">\n                            <a [routerLink]="[movie._id]" class="btn btn-default" title="Edit Movie">\n                                <i class="glyphicon glyphicon-pencil"></i>\n                            </a>\n                            <a (click)="itemList.removeConfirm(movie)" class="btn btn-default" title="Remove Movie">\n                                <i class="glyphicon glyphicon-remove"></i>\n                            </a>\n                        </div>\n                    </td>\n                    <!-- Date pipe doesn\'t work in Safari -->\n                    <td>{{itemList.formatDate(movie.completed)}}</td>\n                    <td>{{movie.year}}</td>\n                    <td>{{movie.title}}</td>\n                    <td>{{movie.notes}}</td>\n                </tr>\n           </tbody>\n        </table>\n    </div>\n\n</item-list>\n';
  },400:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(25),s=n(401),c=n(24),u=n(60),l=n(58),p=n(61),f=function(){function t(t,e,n,o,r){this.config=t,this.http=e,this.auth=n,this.ntfs=o,this.router=r,this.movie=new s.Movie,this.header="New Movie"}return t.prototype.submit=function(){var t=this,e=this.config.apiUrl+"/movies";this.http.post(e,this.movie,this.auth.authHeader).subscribe(function(e){t.ntfs.notifySuccess("New movie has been added :-)"),t.router.navigate(["/movies"])},function(e){t.ntfs.notifyDanger("Something went wrong when adding new movie :-(")})},t=o([i.Component({template:n(402)}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof u.AppConfig&&u.AppConfig)&&e||Object,"function"==typeof(f="undefined"!=typeof c.Http&&c.Http)&&f||Object,"function"==typeof(d="undefined"!=typeof l.AuthService&&l.AuthService)&&d||Object,"function"==typeof(h="undefined"!=typeof p.NotificationService&&p.NotificationService)&&h||Object,"function"==typeof(m="undefined"!=typeof a.Router&&a.Router)&&m||Object])],t);var e,f,d,h,m}();e.NewMovieComponent=f},401:function(t,e){"use strict";var n=function(){function t(){}return t}();e.Movie=n},402:function(t,e){t.exports='<div class="row">\n\n    <div class="col-sm-4">\n        <h4>{{header}}</h4>\n    </div>\n\n    <div class="col-sm-4">\n\n        <form novalidate (ngSubmit)="submit()" #movieForm="ngForm">\n            <div class="form-group">\n                <label for="title">Title</label>\n                <input\n                    type="text"\n                    placeholder="Movie title"\n                    class="form-control"\n                    [(ngModel)]="movie.title"\n                    required\n                    name="title"\n                    #title="ngModel">\n                <div [hidden]="title.valid || title.pristine" class="alert alert-danger">\n                    <small>Movie title is required</small>\n                </div>\n            </div>\n            <div class="form-group">\n                <label for="year">Year</label>\n                <input\n                    type="text"\n                    class="form-control"\n                    placeholder="Production year"\n                    [(ngModel)]="movie.year"\n                    required\n                    name="year"\n                    #year="ngModel">\n                <div [hidden]="year.valid || year.pristine" class="alert alert-danger">\n                    <small>Year is required</small>\n                </div>\n            </div>\n            <div class="form-group">\n                <label for="notes">Notes</label>\n                <input\n                    type="text"\n                    class="form-control"\n                    placeholder="Notes on movie"\n                    [(ngModel)]="movie.notes"\n                    name="notes"\n                    #notes="ngModel">\n            </div>\n            <div class="form-group">\n                <my-date-input\n                    title="Completed on"\n                    [(ngModel)]="movie.completed"\n                    required\n                    name="completed"\n                    #completed="ngModel">\n                </my-date-input>\n                <div [hidden]="completed.valid || completed.pristine" class="alert alert-danger">\n                    <small>Completion date has wrong format</small>\n                </div>\n            </div>\n            <button type="submit" [disabled]="!movieForm.valid" class="btn btn-default">Submit</button>\n            <a [routerLink]="[\'../\']" class="btn btn-default">Reject</a>\n        </form>\n\n    </div>\n</div>\n'},403:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(25),s=n(401),c=n(24),u=n(60),l=n(58),p=n(61),f=function(){function t(t,e,n,o,r,i){this.route=t,this.config=e,this.http=n,this.auth=o,this.ntfs=r,this.router=i,this.movie=new s.Movie,this.header="Edit Movie"}return t.prototype.ngOnInit=function(){var t=this;this.sub=this.route.params.subscribe(function(e){var n=e.id;t.apiUrl=t.config.apiUrl+"/movies/"+n,t.http.get(t.apiUrl,t.auth.authHeader).map(function(t){var e=t.json();return e.completed=new Date(e.completed),e}).subscribe(function(e){return t.movie=e})})},t.prototype.ngOnDestroy=function(){this.sub.unsubscribe()},t.prototype.submit=function(){var t=this;this.http.put(this.apiUrl,this.movie,this.auth.authHeader).subscribe(function(e){t.ntfs.notifySuccess("A movie has been modified :-)"),t.router.navigate(["/movies"])},function(e){t.ntfs.notifyDanger("Something went wrong when modifying a movie :-(")})},t=o([i.Component({template:n(402)}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof a.ActivatedRoute&&a.ActivatedRoute)&&e||Object,"function"==typeof(f="undefined"!=typeof u.AppConfig&&u.AppConfig)&&f||Object,"function"==typeof(d="undefined"!=typeof c.Http&&c.Http)&&d||Object,"function"==typeof(h="undefined"!=typeof l.AuthService&&l.AuthService)&&h||Object,"function"==typeof(m="undefined"!=typeof p.NotificationService&&p.NotificationService)&&m||Object,"function"==typeof(y="undefined"!=typeof a.Router&&a.Router)&&y||Object])],t);var e,f,d,h,m,y}();e.EditMovieComponent=f},404:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3);n(405);var a=function(){function t(){}return t=o([i.Component({selector:"my-app",template:"\n        <my-navbar></my-navbar>\n        <my-notifier></my-notifier>\n        <router-outlet></router-outlet>\n    "}),r("design:paramtypes",[])],t)}();e.AppComponent=a},405:670,409:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(58),s=function(){function t(t){this.auth=t}return t.prototype.logout=function(){this.auth.logout()},t=o([i.Component({selector:"my-navbar",template:n(410)}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof a.AuthService&&a.AuthService)&&e||Object])],t);var e}();e.NavbarComponent=s},410:function(t,e){t.exports='<nav class="navbar navbar-default">\n  <div class="container-fluid">\n\n  <div class="navbar-header">\n    <a [routerLink]="[\'/home\']" routerLinkActive="active" class="navbar-brand">\n      <span class="glyphicon glyphicon-home" aria-hidden="true"></span>\n      &nbsp;My Hobbies\n    </a>\n  </div>\n\n  <ul *ngIf="auth.isLoggedIn" class="nav navbar-nav">\n    <li>\n      <a [routerLink]="[\'/books\']" routerLinkActive="active">\n        <span class="glyphicon glyphicon-book" aria-hidden="true"></span>\n        &nbsp;Books\n      </a>\n    </li>\n    <li>\n      <a [routerLink]="[\'/movies\']" routerLinkActive="active">\n      <span class="glyphicon glyphicon-film" aria-hidden="true"></span>\n      &nbsp;Movies\n      </a>\n    </li>\n  </ul>\n\n  <ul *ngIf="!auth.isLoggedIn" class="nav navbar-nav navbar-right">\n    <li>\n      <a [routerLink]="[\'/login\']" routerLinkActive="active">\n        <span class="glyphicon glyphicon-log-in" aria-hidden="true"></span>\n        &nbsp;Log in\n      </a>\n    </li>\n    <li>\n      <a [routerLink]="[\'/register\']" routerLinkActive="active">\n        <span class="glyphicon glyphicon-user" aria-hidden="true"></span>\n        &nbsp;Sign up\n      </a>\n    </li>\n  </ul>\n\n  <ul *ngIf="auth.isLoggedIn" class="nav navbar-nav navbar-right">\n    <li>\n      <a>\n        <span class="glyphicon glyphicon-user" aria-hidden="true"></span>\n        Logged in as: <{{auth.currentUser.name}}>{{auth.currentUser.email}}\n      </a>\n    </li>\n    <li>\n      <a [routerLink]="[\'/home\']" (click)="logout()">\n        <span class="glyphicon glyphicon-log-out" aria-hidden="true"></span>\n        &nbsp;Log out\n      </a>\n    </li>\n  </ul>\n\n  </div>\n</nav>\n'},411:function(t,e,n){"use strict";var o=this&&this.__decorate||function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(3),a=n(61),s=function(){function t(t){this.ntfc=t}return t.prototype.ngOnInit=function(){var t=this;this.ntfc.notifications$.subscribe(function(e){t.message=e.message,t.alertClass="alert-"+e.type})},t=o([i.Component({selector:"my-notifier",template:'\n        <div *ngIf="message" [ngClass]="alertClass" class="alert">\n            <button type="button" class="close" (click)="message = null">\n                <span aria-hidden="true">&times;</span>\n            </button>\n            {{message}}\n        </div>\n    '}),r("design:paramtypes",["function"==typeof(e="undefined"!=typeof a.NotificationService&&a.NotificationService)&&e||Object])],t);var e}();e.NotifierComponent=s}});