webpackJsonp([1],{ /***/ 113: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var EmployeeService = /** @class */ (function () { function EmployeeService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } EmployeeService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; EmployeeService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; EmployeeService.prototype.getEmployees = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/employee', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; EmployeeService.prototype.getEmployee = function (id) { return this.getEmployees().then(function (employees) { return employees.find(function (employee) { return employee.id === id; }); }); }; EmployeeService.prototype.deleteEmployee = function (employee) { this.refreshSid(); return this.http .delete(this.baseUrl + this.sid + '/employee/' + employee.id, new http_1.RequestOptions({ body: JSON.stringify({ sid: this.sid, id: employee.id }), headers: this.headers })) .map(function (res) { return res.json(); }); }; EmployeeService.prototype.saveEmployee = function (employee) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/employee/' + employee.id, JSON.stringify({ sid: this.sid, id: employee.id, name: employee.name, initial: employee.initial, code: employee.code, active: employee.active }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; EmployeeService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; EmployeeService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return EmployeeService; }()); exports.EmployeeService = EmployeeService; //# sourceMappingURL=employee.service.js.map /***/ }), /***/ 114: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var ScheduleService = /** @class */ (function () { function ScheduleService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } ScheduleService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; ScheduleService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; ScheduleService.prototype.getSchedules = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/schedules', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; ScheduleService.prototype.getSchedule = function (id) { return this.getSchedules().then(function (schedules) { return schedules.find(function (schedule) { return schedule.id === id; }); }); }; ScheduleService.prototype.getScheduleTimes = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/scheduletimes', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; ScheduleService.prototype.deleteSchedule = function (schedule) { this.refreshSid(); return this.http .delete(this.baseUrl + this.sid + '/schedule/' + schedule.id, new http_1.RequestOptions({ body: JSON.stringify({ sid: this.sid, id: schedule.id }), headers: this.headers })) .map(function (res) { return res.json(); }); }; ScheduleService.prototype.saveSchedule = function (schedule) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/schedule/' + schedule.id, JSON.stringify({ sid: this.sid, id: schedule.id, name: schedule.name, active: schedule.active, times: schedule.times }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; ScheduleService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; ScheduleService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return ScheduleService; }()); exports.ScheduleService = ScheduleService; //# sourceMappingURL=schedule.service.js.map /***/ }), /***/ 115: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var MenuService = /** @class */ (function () { function MenuService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } MenuService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; MenuService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; MenuService.prototype.getMenus = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/menus', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; MenuService.prototype.getMenu = function (idMenu) { return this.getMenus().then(function (menus) { return menus.find(function (menu) { return menu.idMenu === idMenu; }); }); }; MenuService.prototype.deleteMenu = function (menu) { this.refreshSid(); return this.http .delete(this.baseUrl + this.sid + '/menu/' + menu.idMenu, new http_1.RequestOptions({ body: JSON.stringify({ sid: this.sid, idMenu: menu.idMenu }), headers: this.headers })) .map(function (res) { return res.json(); }); }; MenuService.prototype.saveMenu = function (menu) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/menu/' + menu.idMenu, JSON.stringify({ sid: this.sid, idMenu: menu.idMenu, name: menu.name, active: menu.active, type: menu.type, items: menu.items }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; MenuService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; MenuService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return MenuService; }()); exports.MenuService = MenuService; //# sourceMappingURL=menu.service.js.map /***/ }), /***/ 116: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var MenuDateService = /** @class */ (function () { function MenuDateService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } MenuDateService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; MenuDateService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; MenuDateService.prototype.getMenuDates = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/menudates', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; MenuDateService.prototype.getMenuDate = function (idMenuDay) { return this.getMenuDates().then(function (menudates) { return menudates.find(function (menudate) { return menudate.idMenuDay === idMenuDay; }); }); }; MenuDateService.prototype.deleteMenuDate = function (menudate) { this.refreshSid(); return this.http .delete(this.baseUrl + this.sid + '/menudate/' + menudate.idMenuDay, new http_1.RequestOptions({ body: JSON.stringify({ sid: this.sid, idMenuDay: menudate.idMenuDay }), headers: this.headers })) .map(function (res) { return res.json(); }); }; MenuDateService.prototype.saveMenuDate = function (menudate) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/menudate/' + menudate.idMenuDay, JSON.stringify({ sid: this.sid, idMenuDay: menudate.idMenuDay, idMenu: menudate.idMenu, vrsn: menudate.vrsn, epchDate: menudate.epchDate, past: menudate.past }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; MenuDateService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; MenuDateService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return MenuDateService; }()); exports.MenuDateService = MenuDateService; //# sourceMappingURL=menudate.service.js.map /***/ }), /***/ 117: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var CCDataService = /** @class */ (function () { function CCDataService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } CCDataService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; CCDataService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; CCDataService.prototype.getCCData = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/cookchilldata', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; /* getItem(id: number): Promise { return this.getItems().then(items => items.find(item => item.id === id)); } */ CCDataService.prototype.saveCCDORR = function (ccdata) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/cookchilldata/' + ccdata.id, JSON.stringify({ sid: this.sid, id: ccdata.id, customer: ccdata.customer, mac: ccdata.mac, dorrs: ccdata.dorrs }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; CCDataService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; CCDataService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return CCDataService; }()); exports.CCDataService = CCDataService; //# sourceMappingURL=cookchill-data.service.js.map /***/ }), /***/ 118: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var CCPDataService = /** @class */ (function () { function CCPDataService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } CCPDataService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; CCPDataService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; CCPDataService.prototype.getCCPStats = function (date) { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/ccpstats/' + this.user.user_level + '/' + date, { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; CCPDataService.prototype.getCCPData = function (date) { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/ccpdata/' + date, { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; /* getItem(id: number): Promise { return this.getItems().then(items => items.find(item => item.id === id)); } */ CCPDataService.prototype.saveSignature = function (ccpdata) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/ccpdata/' + ccpdata.id, JSON.stringify({ sid: this.sid, id: ccpdata.id, stmp: ccpdata.stmp, signature: ccpdata.signature }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; CCPDataService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; CCPDataService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return CCPDataService; }()); exports.CCPDataService = CCPDataService; //# sourceMappingURL=ccp-data.service.js.map /***/ }), /***/ 119: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var CCP3DataService = /** @class */ (function () { function CCP3DataService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } CCP3DataService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; CCP3DataService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; CCP3DataService.prototype.getCCP3Data = function (date) { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/ccp3data/' + date, { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; /* getItem(id: number): Promise { return this.getItems().then(items => items.find(item => item.id === id)); } */ /* saveSignature(ccpdata: CCPData) { this.refreshSid(); return this.http .post(this.baseUrl+this.sid+'/ccpdata/'+ccpdata.id, JSON.stringify({ sid: this.sid, id: ccpdata.id, stmp: ccpdata.stmp, signature: ccpdata.signature}), {headers: this.headers}) .map(res => res.json()); } */ CCP3DataService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; CCP3DataService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return CCP3DataService; }()); exports.CCP3DataService = CCP3DataService; //# sourceMappingURL=ccp3-data.service.js.map /***/ }), /***/ 120: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var GroupService = /** @class */ (function () { function GroupService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } GroupService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; GroupService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; GroupService.prototype.getGroups = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/groups', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; GroupService.prototype.getGroup = function (id) { return this.getGroups().then(function (groups) { return groups.find(function (group) { return group.id === id; }); }); }; GroupService.prototype.deleteGroup = function (group, reassignID) { this.refreshSid(); return this.http .delete(this.baseUrl + this.sid + '/group/' + group.id, new http_1.RequestOptions({ body: JSON.stringify({ sid: this.sid, id: group.id, newid: reassignID }), headers: this.headers })) .map(function (res) { return res.json(); }); }; GroupService.prototype.saveGroup = function (group) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/group/' + group.id, JSON.stringify({ sid: this.sid, id: group.id, name: group.name, active: group.active }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; GroupService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; GroupService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return GroupService; }()); exports.GroupService = GroupService; //# sourceMappingURL=group.service.js.map /***/ }), /***/ 121: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var ReportGroupService = /** @class */ (function () { function ReportGroupService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } ReportGroupService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; ReportGroupService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; ReportGroupService.prototype.getReportGroups = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/reportGroups', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; ReportGroupService.prototype.getReportGroup = function (id) { return this.getReportGroups().then(function (reportGroups) { return reportGroups.find(function (reportGroup) { return reportGroup.id === id; }); }); }; ReportGroupService.prototype.deleteReportGroup = function (reportGroup) { this.refreshSid(); return this.http .delete(this.baseUrl + this.sid + '/reportGroup/' + reportGroup.id, new http_1.RequestOptions({ body: JSON.stringify({ sid: this.sid, id: reportGroup.id }), headers: this.headers })) .map(function (res) { return res.json(); }); }; ReportGroupService.prototype.saveReportGroup = function (reportGroup) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/reportGroup/' + reportGroup.id, JSON.stringify({ sid: this.sid, id: reportGroup.id, name: reportGroup.name, notes: reportGroup.notes, active: reportGroup.active }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; ReportGroupService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; ReportGroupService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return ReportGroupService; }()); exports.ReportGroupService = ReportGroupService; //# sourceMappingURL=report-group.service.js.map /***/ }), /***/ 122: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var CAService = /** @class */ (function () { function CAService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } CAService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; CAService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; CAService.prototype.getCAs = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/cas', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; CAService.prototype.getCA = function (id) { return this.getCAs().then(function (cas) { return cas.find(function (ca) { return ca.id === id; }); }); }; CAService.prototype.deleteCA = function (ca, reassignID) { this.refreshSid(); return this.http .delete(this.baseUrl + this.sid + '/ca/' + ca.id, new http_1.RequestOptions({ body: JSON.stringify({ sid: this.sid, id: ca.id, newid: reassignID }), headers: this.headers })) .map(function (res) { return res.json(); }); }; CAService.prototype.saveCA = function (ca) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/ca/' + ca.id, JSON.stringify({ sid: this.sid, id: ca.id, name: ca.name, active: ca.active, actions: ca.actions }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; CAService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; CAService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return CAService; }()); exports.CAService = CAService; //# sourceMappingURL=ca.service.js.map /***/ }), /***/ 123: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var CNPService = /** @class */ (function () { function CNPService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } CNPService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; CNPService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; CNPService.prototype.getCNPs = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/cnps', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; CNPService.prototype.getCNP = function (id) { return this.getCNPs().then(function (cnps) { return cnps.find(function (cnp) { return cnp.id === id; }); }); }; CNPService.prototype.deleteCNP = function (cnp, reassignID) { this.refreshSid(); return this.http .delete(this.baseUrl + this.sid + '/cnp/' + cnp.id, new http_1.RequestOptions({ body: JSON.stringify({ sid: this.sid, id: cnp.id, newid: reassignID }), headers: this.headers })) .map(function (res) { return res.json(); }); }; CNPService.prototype.saveCNP = function (cnp) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/cnp/' + cnp.id, JSON.stringify({ sid: this.sid, id: cnp.id, name: cnp.name, active: cnp.active, actions: cnp.actions }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; CNPService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; CNPService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return CNPService; }()); exports.CNPService = CNPService; //# sourceMappingURL=cnp.service.js.map /***/ }), /***/ 124: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var http_1 = __webpack_require__(15); __webpack_require__(21); var user_service_1 = __webpack_require__(5); var MeasurementService = /** @class */ (function () { function MeasurementService(http, userService) { this.http = http; this.userService = userService; this.baseUrl = 'https://www.goicc.com/api-v1/store/'; this.headers = new http_1.Headers({ 'Content-Type': 'application/json' }); this.init(); } MeasurementService.prototype.init = function () { if (this.userService.isLoggedIn()) { this.user = this.userService.getMe(); this.refreshSid(); this.headers.append('Authorization', this.user.apikey); } }; MeasurementService.prototype.refreshSid = function () { this.sid = parseInt(localStorage.getItem('sid')); if (this.sid == 102) { this.sid = 4005; } }; MeasurementService.prototype.getMeasurements = function () { this.refreshSid(); return this.http.get(this.baseUrl + this.sid + '/measurement', { headers: this.headers }) .toPromise() .then(function (response) { return response.json(); }) .catch(this.handleError); }; MeasurementService.prototype.getMeasurement = function (id) { return this.getMeasurements().then(function (measurements) { return measurements.find(function (measurement) { return measurement.id === id; }); }); }; MeasurementService.prototype.deleteMeasurement = function (measurement, reassignID) { this.refreshSid(); return this.http .delete(this.baseUrl + this.sid + '/measurement/' + measurement.id, new http_1.RequestOptions({ body: JSON.stringify({ sid: this.sid, id: measurement.id, newid: reassignID }), headers: this.headers })) .map(function (res) { return res.json(); }); }; MeasurementService.prototype.saveMeasurement = function (measurement) { this.refreshSid(); return this.http .post(this.baseUrl + this.sid + '/measurement/' + measurement.id, JSON.stringify({ sid: this.sid, id: measurement.id, name: measurement.name, type: measurement.type, lo: measurement.lo, hi: measurement.hi, active: measurement.active }), { headers: this.headers }) .map(function (res) { return res.json(); }); }; MeasurementService.prototype.handleError = function (error) { console.error('An error occurred', error); // for demo purposes only return Promise.reject(error.message || error); }; MeasurementService.ctorParameters = function () { return [{ type: http_1.Http }, { type: user_service_1.UserService }]; }; return MeasurementService; }()); exports.MeasurementService = MeasurementService; //# sourceMappingURL=measurement.service.js.map /***/ }), /***/ 17: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); // CONCATENATED MODULE: ./node_modules/@angular/forms/node_modules/tslib/tslib.es6.js /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function () { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]]; return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); }; } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function () { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } function __exportStar(m, exports) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } function __values(o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } ; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result.default = mod; return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } // EXTERNAL MODULE: ./node_modules/@angular/core/@angular/core.es5.js var core_es5 = __webpack_require__(3); // EXTERNAL MODULE: ./node_modules/rxjs/observable/forkJoin.js var forkJoin = __webpack_require__(231); var forkJoin_default = /*#__PURE__*/__webpack_require__.n(forkJoin); // EXTERNAL MODULE: ./node_modules/rxjs/observable/fromPromise.js var fromPromise = __webpack_require__(159); var fromPromise_default = /*#__PURE__*/__webpack_require__.n(fromPromise); // EXTERNAL MODULE: ./node_modules/rxjs/operator/map.js var map = __webpack_require__(154); var map_default = /*#__PURE__*/__webpack_require__.n(map); // EXTERNAL MODULE: ./node_modules/@angular/platform-browser/@angular/platform-browser.es5.js var platform_browser_es5 = __webpack_require__(34); // CONCATENATED MODULE: ./node_modules/@angular/forms/@angular/forms.es5.js /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractControlDirective", function() { return AbstractControlDirective; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractFormGroupDirective", function() { return forms_es5_AbstractFormGroupDirective; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckboxControlValueAccessor", function() { return CheckboxControlValueAccessor; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ControlContainer", function() { return forms_es5_ControlContainer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NG_VALUE_ACCESSOR", function() { return NG_VALUE_ACCESSOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMPOSITION_BUFFER_MODE", function() { return COMPOSITION_BUFFER_MODE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultValueAccessor", function() { return DefaultValueAccessor; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgControl", function() { return forms_es5_NgControl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgControlStatus", function() { return forms_es5_NgControlStatus; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgControlStatusGroup", function() { return forms_es5_NgControlStatusGroup; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgForm", function() { return forms_es5_NgForm; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModel", function() { return forms_es5_NgModel; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgModelGroup", function() { return forms_es5_NgModelGroup; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadioControlValueAccessor", function() { return RadioControlValueAccessor; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormControlDirective", function() { return forms_es5_FormControlDirective; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormControlName", function() { return forms_es5_FormControlName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormGroupDirective", function() { return forms_es5_FormGroupDirective; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormArrayName", function() { return forms_es5_FormArrayName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormGroupName", function() { return forms_es5_FormGroupName; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NgSelectOption", function() { return NgSelectOption; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectControlValueAccessor", function() { return forms_es5_SelectControlValueAccessor; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectMultipleControlValueAccessor", function() { return forms_es5_SelectMultipleControlValueAccessor; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CheckboxRequiredValidator", function() { return forms_es5_CheckboxRequiredValidator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmailValidator", function() { return EmailValidator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaxLengthValidator", function() { return MaxLengthValidator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinLengthValidator", function() { return MinLengthValidator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PatternValidator", function() { return PatternValidator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequiredValidator", function() { return RequiredValidator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormBuilder", function() { return FormBuilder; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractControl", function() { return forms_es5_AbstractControl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormArray", function() { return forms_es5_FormArray; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormControl", function() { return forms_es5_FormControl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormGroup", function() { return forms_es5_FormGroup; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NG_ASYNC_VALIDATORS", function() { return NG_ASYNC_VALIDATORS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NG_VALIDATORS", function() { return NG_VALIDATORS; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Validators", function() { return forms_es5_Validators; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormsModule", function() { return FormsModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReactiveFormsModule", function() { return ReactiveFormsModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵba", function() { return InternalFormsSharedModule; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵz", function() { return REACTIVE_DRIVEN_DIRECTIVES; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵx", function() { return SHARED_FORM_DIRECTIVES; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵy", function() { return TEMPLATE_DRIVEN_DIRECTIVES; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵa", function() { return CHECKBOX_VALUE_ACCESSOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵb", function() { return DEFAULT_VALUE_ACCESSOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵc", function() { return AbstractControlStatus; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵd", function() { return ngControlStatusHost; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵe", function() { return formDirectiveProvider; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵf", function() { return formControlBinding; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵg", function() { return modelGroupProvider; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbf", function() { return NgNoValidate; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbb", function() { return NUMBER_VALUE_ACCESSOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbc", function() { return NumberValueAccessor; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵh", function() { return RADIO_VALUE_ACCESSOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵi", function() { return RadioControlRegistry; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbd", function() { return RANGE_VALUE_ACCESSOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵbe", function() { return RangeValueAccessor; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵj", function() { return formControlBinding$1; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵk", function() { return controlNameBinding; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵl", function() { return formDirectiveProvider$1; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵn", function() { return formArrayNameProvider; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵm", function() { return formGroupNameProvider; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵo", function() { return SELECT_VALUE_ACCESSOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵq", function() { return NgSelectMultipleOption; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵp", function() { return SELECT_MULTIPLE_VALUE_ACCESSOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵs", function() { return CHECKBOX_REQUIRED_VALIDATOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵt", function() { return EMAIL_VALIDATOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵv", function() { return MAX_LENGTH_VALIDATOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵu", function() { return MIN_LENGTH_VALIDATOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵw", function() { return PATTERN_VALIDATOR; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵr", function() { return REQUIRED_VALIDATOR; }); /** PURE_IMPORTS_START tslib,_angular_core,rxjs_observable_forkJoin,rxjs_observable_fromPromise,rxjs_operator_map,_angular_platform_browser PURE_IMPORTS_END */ /** * @license Angular v4.4.7 * (c) 2010-2017 Google, Inc. https://angular.io/ * License: MIT */ /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Base class for control directives. * * Only used internally in the forms module. * * \@stable * @abstract */ var AbstractControlDirective = /*@__PURE__*/ (/*@__PURE__*/ function () { function AbstractControlDirective() { } /** * The {\@link FormControl}, {\@link FormGroup}, or {\@link FormArray} * that backs this directive. Most properties fall through to that * instance. * @abstract * @return {?} */ AbstractControlDirective.prototype.control = function () { }; Object.defineProperty(AbstractControlDirective.prototype, "value", { /** * The value of the control. * @return {?} */ get: function () { return this.control ? this.control.value : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "valid", { /** * A control is `valid` when its `status === VALID`. * * In order to have this status, the control must have passed all its * validation checks. * @return {?} */ get: function () { return this.control ? this.control.valid : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "invalid", { /** * A control is `invalid` when its `status === INVALID`. * * In order to have this status, the control must have failed * at least one of its validation checks. * @return {?} */ get: function () { return this.control ? this.control.invalid : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "pending", { /** * A control is `pending` when its `status === PENDING`. * * In order to have this status, the control must be in the * middle of conducting a validation check. * @return {?} */ get: function () { return this.control ? this.control.pending : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "disabled", { /** * A control is `disabled` when its `status === DISABLED`. * * Disabled controls are exempt from validation checks and * are not included in the aggregate value of their ancestor * controls. * @return {?} */ get: function () { return this.control ? this.control.disabled : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "enabled", { /** * A control is `enabled` as long as its `status !== DISABLED`. * * In other words, it has a status of `VALID`, `INVALID`, or * `PENDING`. * @return {?} */ get: function () { return this.control ? this.control.enabled : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "errors", { /** * Returns any errors generated by failing validation. If there * are no errors, it will return null. * @return {?} */ get: function () { return this.control ? this.control.errors : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "pristine", { /** * A control is `pristine` if the user has not yet changed * the value in the UI. * * Note that programmatic changes to a control's value will * *not* mark it dirty. * @return {?} */ get: function () { return this.control ? this.control.pristine : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "dirty", { /** * A control is `dirty` if the user has changed the value * in the UI. * * Note that programmatic changes to a control's value will * *not* mark it dirty. * @return {?} */ get: function () { return this.control ? this.control.dirty : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "touched", { /** * A control is marked `touched` once the user has triggered * a `blur` event on it. * @return {?} */ get: function () { return this.control ? this.control.touched : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "untouched", { /** * A control is `untouched` if the user has not yet triggered * a `blur` event on it. * @return {?} */ get: function () { return this.control ? this.control.untouched : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "statusChanges", { /** * Emits an event every time the validation status of the control * is re-calculated. * @return {?} */ get: function () { return this.control ? this.control.statusChanges : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "valueChanges", { /** * Emits an event every time the value of the control changes, in * the UI or programmatically. * @return {?} */ get: function () { return this.control ? this.control.valueChanges : null; }, enumerable: true, configurable: true }); Object.defineProperty(AbstractControlDirective.prototype, "path", { /** * Returns an array that represents the path from the top-level form * to this control. Each index is the string name of the control on * that level. * @return {?} */ get: function () { return null; }, enumerable: true, configurable: true }); /** * Resets the form control. This means by default: * * * it is marked as `pristine` * * it is marked as `untouched` * * value is set to null * * For more information, see {\@link AbstractControl}. * @param {?=} value * @return {?} */ AbstractControlDirective.prototype.reset = function (value) { if (value === void 0) { value = undefined; } if (this.control) this.control.reset(value); }; /** * Returns true if the control with the given path has the error specified. Otherwise * returns false. * * If no path is given, it checks for the error on the present control. * @param {?} errorCode * @param {?=} path * @return {?} */ AbstractControlDirective.prototype.hasError = function (errorCode, path) { return this.control ? this.control.hasError(errorCode, path) : false; }; /** * Returns error data if the control with the given path has the error specified. Otherwise * returns null or undefined. * * If no path is given, it checks for the error on the present control. * @param {?} errorCode * @param {?=} path * @return {?} */ AbstractControlDirective.prototype.getError = function (errorCode, path) { return this.control ? this.control.getError(errorCode, path) : null; }; return AbstractControlDirective; }()); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * A directive that contains multiple {\@link NgControl}s. * * Only used by the forms module. * * \@stable * @abstract */ var forms_es5_ControlContainer = /*@__PURE__*/ (function (_super) { __extends(ControlContainer, _super); function ControlContainer() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(ControlContainer.prototype, "formDirective", { /** * Get the form to which this container belongs. * @return {?} */ get: function () { return null; }, enumerable: true, configurable: true }); Object.defineProperty(ControlContainer.prototype, "path", { /** * Get the path to this container. * @return {?} */ get: function () { return null; }, enumerable: true, configurable: true }); return ControlContainer; }(AbstractControlDirective)); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @param {?} value * @return {?} */ function isEmptyInputValue(value) { // we don't check for string here so it also works with arrays return value == null || value.length === 0; } /** * Providers for validators to be used for {\@link FormControl}s in a form. * * Provide this using `multi: true` to add validators. * * \@stable */ var NG_VALIDATORS = /*@__PURE__*/ new core_es5["InjectionToken"]('NgValidators'); /** * Providers for asynchronous validators to be used for {\@link FormControl}s * in a form. * * Provide this using `multi: true` to add validators. * * See {\@link NG_VALIDATORS} for more details. * * \@stable */ var NG_ASYNC_VALIDATORS = /*@__PURE__*/ new core_es5["InjectionToken"]('NgAsyncValidators'); var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/; /** * Provides a set of validators used by form controls. * * A validator is a function that processes a {\@link FormControl} or collection of * controls and returns a map of errors. A null map means that validation has passed. * * ### Example * * ```typescript * var loginControl = new FormControl("", Validators.required) * ``` * * \@stable */ var forms_es5_Validators = /*@__PURE__*/ (/*@__PURE__*/ function () { function Validators() { } /** * Validator that requires controls to have a value greater than a number. * @param {?} min * @return {?} */ Validators.min = function (min) { return function (control) { if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) { return null; // don't validate empty values to allow optional controls } var /** @type {?} */ value = parseFloat(control.value); // Controls with NaN values after parsing should be treated as not having a // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min return !isNaN(value) && value < min ? { 'min': { 'min': min, 'actual': control.value } } : null; }; }; /** * Validator that requires controls to have a value less than a number. * @param {?} max * @return {?} */ Validators.max = function (max) { return function (control) { if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) { return null; // don't validate empty values to allow optional controls } var /** @type {?} */ value = parseFloat(control.value); // Controls with NaN values after parsing should be treated as not having a // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max return !isNaN(value) && value > max ? { 'max': { 'max': max, 'actual': control.value } } : null; }; }; /** * Validator that requires controls to have a non-empty value. * @param {?} control * @return {?} */ Validators.required = function (control) { return isEmptyInputValue(control.value) ? { 'required': true } : null; }; /** * Validator that requires control value to be true. * @param {?} control * @return {?} */ Validators.requiredTrue = function (control) { return control.value === true ? null : { 'required': true }; }; /** * Validator that performs email validation. * @param {?} control * @return {?} */ Validators.email = function (control) { return EMAIL_REGEXP.test(control.value) ? null : { 'email': true }; }; /** * Validator that requires controls to have a value of a minimum length. * @param {?} minLength * @return {?} */ Validators.minLength = function (minLength) { return function (control) { if (isEmptyInputValue(control.value)) { return null; // don't validate empty values to allow optional controls } var /** @type {?} */ length = control.value ? control.value.length : 0; return length < minLength ? { 'minlength': { 'requiredLength': minLength, 'actualLength': length } } : null; }; }; /** * Validator that requires controls to have a value of a maximum length. * @param {?} maxLength * @return {?} */ Validators.maxLength = function (maxLength) { return function (control) { var /** @type {?} */ length = control.value ? control.value.length : 0; return length > maxLength ? { 'maxlength': { 'requiredLength': maxLength, 'actualLength': length } } : null; }; }; /** * Validator that requires a control to match a regex to its value. * @param {?} pattern * @return {?} */ Validators.pattern = function (pattern) { if (!pattern) return Validators.nullValidator; var /** @type {?} */ regex; var /** @type {?} */ regexStr; if (typeof pattern === 'string') { regexStr = "^" + pattern + "$"; regex = new RegExp(regexStr); } else { regexStr = pattern.toString(); regex = pattern; } return function (control) { if (isEmptyInputValue(control.value)) { return null; // don't validate empty values to allow optional controls } var /** @type {?} */ value = control.value; return regex.test(value) ? null : { 'pattern': { 'requiredPattern': regexStr, 'actualValue': value } }; }; }; /** * No-op validator. * @param {?} c * @return {?} */ Validators.nullValidator = function (c) { return null; }; /** * @param {?} validators * @return {?} */ Validators.compose = function (validators) { if (!validators) return null; var /** @type {?} */ presentValidators = (validators.filter(isPresent)); if (presentValidators.length == 0) return null; return function (control) { return _mergeErrors(_executeValidators(control, presentValidators)); }; }; /** * @param {?} validators * @return {?} */ Validators.composeAsync = function (validators) { if (!validators) return null; var /** @type {?} */ presentValidators = (validators.filter(isPresent)); if (presentValidators.length == 0) return null; return function (control) { var /** @type {?} */ observables = _executeAsyncValidators(control, presentValidators).map(toObservable); return map["map"].call(Object(forkJoin["forkJoin"])(observables), _mergeErrors); }; }; return Validators; }()); /** * @param {?} o * @return {?} */ function isPresent(o) { return o != null; } /** * @param {?} r * @return {?} */ function toObservable(r) { var /** @type {?} */ obs = Object(core_es5["ɵisPromise"])(r) ? Object(fromPromise["fromPromise"])(r) : r; if (!(Object(core_es5["ɵisObservable"])(obs))) { throw new Error("Expected validator to return Promise or Observable."); } return obs; } /** * @param {?} control * @param {?} validators * @return {?} */ function _executeValidators(control, validators) { return validators.map(function (v) { return v(control); }); } /** * @param {?} control * @param {?} validators * @return {?} */ function _executeAsyncValidators(control, validators) { return validators.map(function (v) { return v(control); }); } /** * @param {?} arrayOfErrors * @return {?} */ function _mergeErrors(arrayOfErrors) { var /** @type {?} */ res = arrayOfErrors.reduce(function (res, errors) { return errors != null ? Object.assign({}, /** @type {?} */ ((res)), errors) : ((res)); }, {}); return Object.keys(res).length === 0 ? null : res; } /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * Used to provide a {\@link ControlValueAccessor} for form controls. * * See {\@link DefaultValueAccessor} for how to implement one. * \@stable */ var NG_VALUE_ACCESSOR = /*@__PURE__*/ new core_es5["InjectionToken"]('NgValueAccessor'); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var CHECKBOX_VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, useExisting: /*@__PURE__*/ Object(core_es5["forwardRef"])(function () { return CheckboxControlValueAccessor; }), multi: true, }; /** * The accessor for writing a value and listening to changes on a checkbox input element. * * ### Example * ``` * * ``` * * \@stable */ var CheckboxControlValueAccessor = /*@__PURE__*/ (/*@__PURE__*/ function () { /** * @param {?} _renderer * @param {?} _elementRef */ function CheckboxControlValueAccessor(_renderer, _elementRef) { this._renderer = _renderer; this._elementRef = _elementRef; this.onChange = function (_) { }; this.onTouched = function () { }; } /** * @param {?} value * @return {?} */ CheckboxControlValueAccessor.prototype.writeValue = function (value) { this._renderer.setProperty(this._elementRef.nativeElement, 'checked', value); }; /** * @param {?} fn * @return {?} */ CheckboxControlValueAccessor.prototype.registerOnChange = function (fn) { this.onChange = fn; }; /** * @param {?} fn * @return {?} */ CheckboxControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; /** * @param {?} isDisabled * @return {?} */ CheckboxControlValueAccessor.prototype.setDisabledState = function (isDisabled) { this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); }; return CheckboxControlValueAccessor; }()); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var DEFAULT_VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, useExisting: /*@__PURE__*/ Object(core_es5["forwardRef"])(function () { return DefaultValueAccessor; }), multi: true }; /** * We must check whether the agent is Android because composition events * behave differently between iOS and Android. * @return {?} */ function _isAndroid() { var /** @type {?} */ userAgent = Object(platform_browser_es5["ɵgetDOM"])() ? Object(platform_browser_es5["ɵgetDOM"])().getUserAgent() : ''; return /android (\d+)/.test(userAgent.toLowerCase()); } /** * Turn this mode on if you want form directives to buffer IME input until compositionend * \@experimental */ var COMPOSITION_BUFFER_MODE = /*@__PURE__*/ new core_es5["InjectionToken"]('CompositionEventMode'); /** * The default accessor for writing a value and listening to changes that is used by the * {\@link NgModel}, {\@link FormControlDirective}, and {\@link FormControlName} directives. * * ### Example * ``` * * ``` * * \@stable */ var DefaultValueAccessor = /*@__PURE__*/ (/*@__PURE__*/ function () { /** * @param {?} _renderer * @param {?} _elementRef * @param {?} _compositionMode */ function DefaultValueAccessor(_renderer, _elementRef, _compositionMode) { this._renderer = _renderer; this._elementRef = _elementRef; this._compositionMode = _compositionMode; this.onChange = function (_) { }; this.onTouched = function () { }; /** * Whether the user is creating a composition string (IME events). */ this._composing = false; if (this._compositionMode == null) { this._compositionMode = !_isAndroid(); } } /** * @param {?} value * @return {?} */ DefaultValueAccessor.prototype.writeValue = function (value) { var /** @type {?} */ normalizedValue = value == null ? '' : value; this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue); }; /** * @param {?} fn * @return {?} */ DefaultValueAccessor.prototype.registerOnChange = function (fn) { this.onChange = fn; }; /** * @param {?} fn * @return {?} */ DefaultValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; /** * @param {?} isDisabled * @return {?} */ DefaultValueAccessor.prototype.setDisabledState = function (isDisabled) { this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); }; /** * \@internal * @param {?} value * @return {?} */ DefaultValueAccessor.prototype._handleInput = function (value) { if (!this._compositionMode || (this._compositionMode && !this._composing)) { this.onChange(value); } }; /** * \@internal * @return {?} */ DefaultValueAccessor.prototype._compositionStart = function () { this._composing = true; }; /** * \@internal * @param {?} value * @return {?} */ DefaultValueAccessor.prototype._compositionEnd = function (value) { this._composing = false; this._compositionMode && this.onChange(value); }; return DefaultValueAccessor; }()); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @param {?} validator * @return {?} */ function normalizeValidator(validator) { if (((validator)).validate) { return function (c) { return ((validator)).validate(c); }; } else { return (validator); } } /** * @param {?} validator * @return {?} */ function normalizeAsyncValidator(validator) { if (((validator)).validate) { return function (c) { return ((validator)).validate(c); }; } else { return (validator); } } /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var NUMBER_VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, useExisting: /*@__PURE__*/ Object(core_es5["forwardRef"])(function () { return NumberValueAccessor; }), multi: true }; /** * The accessor for writing a number value and listening to changes that is used by the * {\@link NgModel}, {\@link FormControlDirective}, and {\@link FormControlName} directives. * * ### Example * ``` * * ``` */ var NumberValueAccessor = /*@__PURE__*/ (/*@__PURE__*/ function () { /** * @param {?} _renderer * @param {?} _elementRef */ function NumberValueAccessor(_renderer, _elementRef) { this._renderer = _renderer; this._elementRef = _elementRef; this.onChange = function (_) { }; this.onTouched = function () { }; } /** * @param {?} value * @return {?} */ NumberValueAccessor.prototype.writeValue = function (value) { // The value needs to be normalized for IE9, otherwise it is set to 'null' when null var /** @type {?} */ normalizedValue = value == null ? '' : value; this._renderer.setProperty(this._elementRef.nativeElement, 'value', normalizedValue); }; /** * @param {?} fn * @return {?} */ NumberValueAccessor.prototype.registerOnChange = function (fn) { this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); }; }; /** * @param {?} fn * @return {?} */ NumberValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; /** * @param {?} isDisabled * @return {?} */ NumberValueAccessor.prototype.setDisabledState = function (isDisabled) { this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); }; return NumberValueAccessor; }()); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @return {?} */ function unimplemented() { throw new Error('unimplemented'); } /** * A base class that all control directive extend. * It binds a {\@link FormControl} object to a DOM element. * * Used internally by Angular forms. * * \@stable * @abstract */ var forms_es5_NgControl = /*@__PURE__*/ (function (_super) { __extends(NgControl, _super); function NgControl() { var _this = _super.apply(this, arguments) || this; /** * \@internal */ _this._parent = null; _this.name = null; _this.valueAccessor = null; /** * \@internal */ _this._rawValidators = []; /** * \@internal */ _this._rawAsyncValidators = []; return _this; } Object.defineProperty(NgControl.prototype, "validator", { /** * @return {?} */ get: function () { return (unimplemented()); }, enumerable: true, configurable: true }); Object.defineProperty(NgControl.prototype, "asyncValidator", { /** * @return {?} */ get: function () { return (unimplemented()); }, enumerable: true, configurable: true }); /** * @abstract * @param {?} newValue * @return {?} */ NgControl.prototype.viewToModelUpdate = function (newValue) { }; return NgControl; }(AbstractControlDirective)); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var RADIO_VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, useExisting: /*@__PURE__*/ Object(core_es5["forwardRef"])(function () { return RadioControlValueAccessor; }), multi: true }; /** * Internal class used by Angular to uncheck radio buttons with the matching name. */ var RadioControlRegistry = /*@__PURE__*/ (/*@__PURE__*/ function () { function RadioControlRegistry() { this._accessors = []; } /** * @param {?} control * @param {?} accessor * @return {?} */ RadioControlRegistry.prototype.add = function (control, accessor) { this._accessors.push([control, accessor]); }; /** * @param {?} accessor * @return {?} */ RadioControlRegistry.prototype.remove = function (accessor) { for (var /** @type {?} */ i = this._accessors.length - 1; i >= 0; --i) { if (this._accessors[i][1] === accessor) { this._accessors.splice(i, 1); return; } } }; /** * @param {?} accessor * @return {?} */ RadioControlRegistry.prototype.select = function (accessor) { var _this = this; this._accessors.forEach(function (c) { if (_this._isSameGroup(c, accessor) && c[1] !== accessor) { c[1].fireUncheck(accessor.value); } }); }; /** * @param {?} controlPair * @param {?} accessor * @return {?} */ RadioControlRegistry.prototype._isSameGroup = function (controlPair, accessor) { if (!controlPair[0].control) return false; return controlPair[0]._parent === accessor._control._parent && controlPair[1].name === accessor.name; }; return RadioControlRegistry; }()); /** * \@whatItDoes Writes radio control values and listens to radio control changes. * * Used by {\@link NgModel}, {\@link FormControlDirective}, and {\@link FormControlName} * to keep the view synced with the {\@link FormControl} model. * * \@howToUse * * If you have imported the {\@link FormsModule} or the {\@link ReactiveFormsModule}, this * value accessor will be active on any radio control that has a form directive. You do * **not** need to add a special selector to activate it. * * ### How to use radio buttons with form directives * * To use radio buttons in a template-driven form, you'll want to ensure that radio buttons * in the same group have the same `name` attribute. Radio buttons with different `name` * attributes do not affect each other. * * {\@example forms/ts/radioButtons/radio_button_example.ts region='TemplateDriven'} * * When using radio buttons in a reactive form, radio buttons in the same group should have the * same `formControlName`. You can also add a `name` attribute, but it's optional. * * {\@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'} * * * **npm package**: `\@angular/forms` * * \@stable */ var RadioControlValueAccessor = /*@__PURE__*/ (/*@__PURE__*/ function () { /** * @param {?} _renderer * @param {?} _elementRef * @param {?} _registry * @param {?} _injector */ function RadioControlValueAccessor(_renderer, _elementRef, _registry, _injector) { this._renderer = _renderer; this._elementRef = _elementRef; this._registry = _registry; this._injector = _injector; this.onChange = function () { }; this.onTouched = function () { }; } /** * @return {?} */ RadioControlValueAccessor.prototype.ngOnInit = function () { this._control = this._injector.get(forms_es5_NgControl); this._checkName(); this._registry.add(this._control, this); }; /** * @return {?} */ RadioControlValueAccessor.prototype.ngOnDestroy = function () { this._registry.remove(this); }; /** * @param {?} value * @return {?} */ RadioControlValueAccessor.prototype.writeValue = function (value) { this._state = value === this.value; this._renderer.setProperty(this._elementRef.nativeElement, 'checked', this._state); }; /** * @param {?} fn * @return {?} */ RadioControlValueAccessor.prototype.registerOnChange = function (fn) { var _this = this; this._fn = fn; this.onChange = function () { fn(_this.value); _this._registry.select(_this); }; }; /** * @param {?} value * @return {?} */ RadioControlValueAccessor.prototype.fireUncheck = function (value) { this.writeValue(value); }; /** * @param {?} fn * @return {?} */ RadioControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; /** * @param {?} isDisabled * @return {?} */ RadioControlValueAccessor.prototype.setDisabledState = function (isDisabled) { this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); }; /** * @return {?} */ RadioControlValueAccessor.prototype._checkName = function () { if (this.name && this.formControlName && this.name !== this.formControlName) { this._throwNameError(); } if (!this.name && this.formControlName) this.name = this.formControlName; }; /** * @return {?} */ RadioControlValueAccessor.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: \n "); }; return RadioControlValueAccessor; }()); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var RANGE_VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, useExisting: /*@__PURE__*/ Object(core_es5["forwardRef"])(function () { return RangeValueAccessor; }), multi: true }; /** * The accessor for writing a range value and listening to changes that is used by the * {\@link NgModel}, {\@link FormControlDirective}, and {\@link FormControlName} directives. * * ### Example * ``` * * ``` */ var RangeValueAccessor = /*@__PURE__*/ (/*@__PURE__*/ function () { /** * @param {?} _renderer * @param {?} _elementRef */ function RangeValueAccessor(_renderer, _elementRef) { this._renderer = _renderer; this._elementRef = _elementRef; this.onChange = function (_) { }; this.onTouched = function () { }; } /** * @param {?} value * @return {?} */ RangeValueAccessor.prototype.writeValue = function (value) { this._renderer.setProperty(this._elementRef.nativeElement, 'value', parseFloat(value)); }; /** * @param {?} fn * @return {?} */ RangeValueAccessor.prototype.registerOnChange = function (fn) { this.onChange = function (value) { fn(value == '' ? null : parseFloat(value)); }; }; /** * @param {?} fn * @return {?} */ RangeValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; /** * @param {?} isDisabled * @return {?} */ RangeValueAccessor.prototype.setDisabledState = function (isDisabled) { this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); }; return RangeValueAccessor; }()); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var SELECT_VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, useExisting: /*@__PURE__*/ Object(core_es5["forwardRef"])(function () { return forms_es5_SelectControlValueAccessor; }), multi: true }; /** * @param {?} id * @param {?} value * @return {?} */ function _buildValueString(id, value) { if (id == null) return "" + value; if (value && typeof value === 'object') value = 'Object'; return (id + ": " + value).slice(0, 50); } /** * @param {?} valueString * @return {?} */ function _extractId(valueString) { return valueString.split(':')[0]; } /** * \@whatItDoes Writes values and listens to changes on a select element. * * Used by {\@link NgModel}, {\@link FormControlDirective}, and {\@link FormControlName} * to keep the view synced with the {\@link FormControl} model. * * \@howToUse * * If you have imported the {\@link FormsModule} or the {\@link ReactiveFormsModule}, this * value accessor will be active on any select control that has a form directive. You do * **not** need to add a special selector to activate it. * * ### How to use select controls with form directives * * To use a select in a template-driven form, simply add an `ngModel` and a `name` * attribute to the main `` tag. Like in the former example, you have the * choice of binding to the `value` or `ngValue` property on the select's options. * * {\@example forms/ts/reactiveSelectControl/reactive_select_control_example.ts region='Component'} * * ### Caveat: Option selection * * Angular uses object identity to select option. It's possible for the identities of items * to change while the data does not. This can happen, for example, if the items are produced * from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the * second response will produce objects with different identities. * * To customize the default option comparison algorithm, ` * * * * compareFn(c1: Country, c2: Country): boolean { * return c1 && c2 ? c1.id === c2.id : c1 === c2; * } * ``` * * Note: We listen to the 'change' event because 'input' events aren't fired * for selects in Firefox and IE: * https://bugzilla.mozilla.org/show_bug.cgi?id=1024350 * https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4660045/ * * * **npm package**: `\@angular/forms` * * \@stable */ var forms_es5_SelectControlValueAccessor = /*@__PURE__*/ (/*@__PURE__*/ function () { /** * @param {?} _renderer * @param {?} _elementRef */ function SelectControlValueAccessor(_renderer, _elementRef) { this._renderer = _renderer; this._elementRef = _elementRef; /** * \@internal */ this._optionMap = new Map(); /** * \@internal */ this._idCounter = 0; this.onChange = function (_) { }; this.onTouched = function () { }; this._compareWith = core_es5["ɵlooseIdentical"]; } Object.defineProperty(SelectControlValueAccessor.prototype, "compareWith", { /** * @param {?} fn * @return {?} */ set: function (fn) { if (typeof fn !== 'function') { throw new Error("compareWith must be a function, but received " + JSON.stringify(fn)); } this._compareWith = fn; }, enumerable: true, configurable: true }); /** * @param {?} value * @return {?} */ SelectControlValueAccessor.prototype.writeValue = function (value) { this.value = value; var /** @type {?} */ id = this._getOptionId(value); if (id == null) { this._renderer.setProperty(this._elementRef.nativeElement, 'selectedIndex', -1); } var /** @type {?} */ valueString = _buildValueString(id, value); this._renderer.setProperty(this._elementRef.nativeElement, 'value', valueString); }; /** * @param {?} fn * @return {?} */ SelectControlValueAccessor.prototype.registerOnChange = function (fn) { var _this = this; this.onChange = function (valueString) { _this.value = _this._getOptionValue(valueString); fn(_this.value); }; }; /** * @param {?} fn * @return {?} */ SelectControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; /** * @param {?} isDisabled * @return {?} */ SelectControlValueAccessor.prototype.setDisabledState = function (isDisabled) { this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); }; /** * \@internal * @return {?} */ SelectControlValueAccessor.prototype._registerOption = function () { return (this._idCounter++).toString(); }; /** * \@internal * @param {?} value * @return {?} */ SelectControlValueAccessor.prototype._getOptionId = function (value) { for (var _i = 0, _a = Array.from(this._optionMap.keys()); _i < _a.length; _i++) { var id = _a[_i]; if (this._compareWith(this._optionMap.get(id), value)) return id; } return null; }; /** * \@internal * @param {?} valueString * @return {?} */ SelectControlValueAccessor.prototype._getOptionValue = function (valueString) { var /** @type {?} */ id = _extractId(valueString); return this._optionMap.has(id) ? this._optionMap.get(id) : valueString; }; return SelectControlValueAccessor; }()); /** * \@whatItDoes Marks ` * * * compareFn(c1: Country, c2: Country): boolean { * return c1 && c2 ? c1.id === c2.id : c1 === c2; * } * ``` * * \@stable */ var forms_es5_SelectMultipleControlValueAccessor = /*@__PURE__*/ (/*@__PURE__*/ function () { /** * @param {?} _renderer * @param {?} _elementRef */ function SelectMultipleControlValueAccessor(_renderer, _elementRef) { this._renderer = _renderer; this._elementRef = _elementRef; /** * \@internal */ this._optionMap = new Map(); /** * \@internal */ this._idCounter = 0; this.onChange = function (_) { }; this.onTouched = function () { }; this._compareWith = core_es5["ɵlooseIdentical"]; } Object.defineProperty(SelectMultipleControlValueAccessor.prototype, "compareWith", { /** * @param {?} fn * @return {?} */ set: function (fn) { if (typeof fn !== 'function') { throw new Error("compareWith must be a function, but received " + JSON.stringify(fn)); } this._compareWith = fn; }, enumerable: true, configurable: true }); /** * @param {?} value * @return {?} */ SelectMultipleControlValueAccessor.prototype.writeValue = function (value) { var _this = this; this.value = value; var /** @type {?} */ optionSelectedStateSetter; if (Array.isArray(value)) { // convert values to ids var /** @type {?} */ ids_1 = value.map(function (v) { return _this._getOptionId(v); }); optionSelectedStateSetter = function (opt, o) { opt._setSelected(ids_1.indexOf(o.toString()) > -1); }; } else { optionSelectedStateSetter = function (opt, o) { opt._setSelected(false); }; } this._optionMap.forEach(optionSelectedStateSetter); }; /** * @param {?} fn * @return {?} */ SelectMultipleControlValueAccessor.prototype.registerOnChange = function (fn) { var _this = this; this.onChange = function (_) { var /** @type {?} */ selected = []; if (_.hasOwnProperty('selectedOptions')) { var /** @type {?} */ options = _.selectedOptions; for (var /** @type {?} */ i = 0; i < options.length; i++) { var /** @type {?} */ opt = options.item(i); var /** @type {?} */ val = _this._getOptionValue(opt.value); selected.push(val); } } else { var /** @type {?} */ options = (_.options); for (var /** @type {?} */ i = 0; i < options.length; i++) { var /** @type {?} */ opt = options.item(i); if (opt.selected) { var /** @type {?} */ val = _this._getOptionValue(opt.value); selected.push(val); } } } _this.value = selected; fn(selected); }; }; /** * @param {?} fn * @return {?} */ SelectMultipleControlValueAccessor.prototype.registerOnTouched = function (fn) { this.onTouched = fn; }; /** * @param {?} isDisabled * @return {?} */ SelectMultipleControlValueAccessor.prototype.setDisabledState = function (isDisabled) { this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); }; /** * \@internal * @param {?} value * @return {?} */ SelectMultipleControlValueAccessor.prototype._registerOption = function (value) { var /** @type {?} */ id = (this._idCounter++).toString(); this._optionMap.set(id, value); return id; }; /** * \@internal * @param {?} value * @return {?} */ SelectMultipleControlValueAccessor.prototype._getOptionId = function (value) { for (var _i = 0, _a = Array.from(this._optionMap.keys()); _i < _a.length; _i++) { var id = _a[_i]; if (this._compareWith(/** @type {?} */ ((this._optionMap.get(id)))._value, value)) return id; } return null; }; /** * \@internal * @param {?} valueString * @return {?} */ SelectMultipleControlValueAccessor.prototype._getOptionValue = function (valueString) { var /** @type {?} */ id = _extractId$1(valueString); return this._optionMap.has(id) ? ((this._optionMap.get(id)))._value : valueString; }; return SelectMultipleControlValueAccessor; }()); /** * Marks `