webpackJsonp([10],{

/***/ 1215:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClassOnePageModule", function() { return ClassOnePageModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__class_one__ = __webpack_require__(1472);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ngx_translate_core__ = __webpack_require__(257);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_components_module__ = __webpack_require__(775);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(53);
var __decorate = (this && this.__decorate) || function (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;
};






var ClassOnePageModule = /** @class */ (function () {
    function ClassOnePageModule() {
    }
    ClassOnePageModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_2__class_one__["a" /* ClassOnePage */],
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__["g" /* CoreModule */],
                __WEBPACK_IMPORTED_MODULE_4__components_components_module__["a" /* ComponentsModule */],
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__class_one__["a" /* ClassOnePage */]),
                __WEBPACK_IMPORTED_MODULE_3__ngx_translate_core__["b" /* TranslateModule */].forChild(),
            ],
            exports: [],
            entryComponents: []
        })
    ], ClassOnePageModule);
    return ClassOnePageModule;
}());

//# sourceMappingURL=class-one.module.js.map

/***/ }),

/***/ 1472:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ClassOnePage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(14);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ngx_logger__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__class_one_template__ = __webpack_require__(1473);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__providers_recentevent_provider__ = __webpack_require__(66);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__ = __webpack_require__(80);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__providers_data_load_provider__ = __webpack_require__(780);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_util__ = __webpack_require__(143);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_util___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_util__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__class_one_selected__ = __webpack_require__(790);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__models_btnModel__ = __webpack_require__(54);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__providers_shared_data_service_shared_data_service__ = __webpack_require__(41);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__providers_ccenv_provider__ = __webpack_require__(106);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__providers_appMasterDataCntrl_app_masterData_cntrl_provider__ = __webpack_require__(777);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__ncinga_sp_nsp_app_core_dist_providers_business_context__ = __webpack_require__(40);
var __decorate = (this && this.__decorate) || function (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;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};















var ClassOnePage = /** @class */ (function () {
    function ClassOnePage(logger, navParams, navigationProvider, bsCtx, toastCtrl, appMsDtPrv, envProvider, cacheSvc, recentEvtSvc, dataPro, modalCtrl, sharedDataService) {
        this.logger = logger;
        this.navParams = navParams;
        this.navigationProvider = navigationProvider;
        this.bsCtx = bsCtx;
        this.toastCtrl = toastCtrl;
        this.appMsDtPrv = appMsDtPrv;
        this.envProvider = envProvider;
        this.cacheSvc = cacheSvc;
        this.recentEvtSvc = recentEvtSvc;
        this.dataPro = dataPro;
        this.modalCtrl = modalCtrl;
        this.sharedDataService = sharedDataService;
        this.classOne_all_list_temp = [];
        this.classOne_all_list = [];
        this.classOne_selected_list = [];
        this.sub_header = true;
        this.pagesize = 4;
        this.lastIndex = 0;
        this.tools = {
            line: true,
            menu: true,
            shift: true,
            user: true,
        };
        this.currentPageConfig = this.navParams.get('conf');
        this.sub_header = this.currentPageConfig['order_heading'];
        if (!this.sub_header) {
            this.grid_class = 'main-grid_none_header';
        }
        this.data_set = this.navParams.get('data');
        this.previous_data = this.data_set['data'];
        this.data_store_dum = new __WEBPACK_IMPORTED_MODULE_9__models_btnModel__["a" /* ClassificationModel */](this.data_set['model']);
        // if (this.data_store_dum['parent_input_categories'].length === 0) {
        //     let modal = this.modalCtrl.create(InstructionPopUp, {imgName: this.currentPageConfig.img_name});
        //     modal.present();
        // }
        this.logger.debug('loading data store in page one', this.data_set);
    }
    ClassOnePage.prototype.ionViewDidEnter = function () {
        this.logger.debug('im class one page');
    };
    ClassOnePage.prototype.ngAfterContentInit = function () {
        this.logger.debug('la la ');
    };
    ClassOnePage.prototype.ngAfterViewInit = function () {
        this.logger.debug('class -one called  2', this.data_store_dum);
        // generate page body data
        this.prepareData();
    };
    ClassOnePage.prototype.prepareData = function () {
        var _this = this;
        var url = this.envProvider.getEnvVar(__WEBPACK_IMPORTED_MODULE_11__providers_ccenv_provider__["b" /* CCServiceEndPoints */].DATA_SERVICE);
        try {
            this.currentPageData = [];
            this.classOne_all_list = [];
            var response = null;
            // this.cacheSvc.get(CC_MOD_KEY, Crnt_M_D, url).then(respn => {
            var respn = this.appMsDtPrv.getCrntMsDtList(this.currentPageConfig['view_data']);
            if (respn) {
                this.logger.trace('response for grading list', respn, this.currentPageConfig['view_data']);
                var resdata = respn;
                this.currentPageData = resdata;
                if (this.data_store_dum['parent_input_categories'].length === 0) {
                    this.currentPageData.forEach(function (item, index) {
                        _this.classOne_all_list.push({
                            'id': index,
                            'classOne_item': item,
                            'status': false
                        });
                    });
                    this.data_store_dum.setParentMasterCategories(this.classOne_all_list);
                }
                else if (this.data_store_dum['parent_input_categories'].length > 0) {
                    this.data_store_dum['parent_input_categories'].forEach(function (item, index) {
                        item.status = false;
                    });
                }
                this.lastIndex = this.currentPageData.length;
                this.doInfinite(this.infiniteScroll);
                // response = resdata;
            }
            else {
                this.logger.trace('<<<< grading list not loading >>>>>');
                // this.appMsDtPrv.setAvailableCntxtMstData();
                // this.getStyleSizes(dataType);
            }
            // response;
            // });
        }
        catch (e) {
            this.logger.error(e);
        }
        // this.classOne_all_list = [];
        // this.dataPro.getInputMasterData(this.currentPageConfig['view_data']).subscribe(res => {
        //     this.currentPageData = res;
        //
        //     if (this.data_store_dum['parent_input_categories'].length === 0) {
        //         this.currentPageData.forEach((item, index) => {
        //             this.classOne_all_list.push({
        //                 'id': index,
        //                 'classOne_item': item,
        //                 'status': false
        //             });
        //         });
        //         this.data_store_dum.setParentMasterCategories(this.classOne_all_list);
        //     } else if (this.data_store_dum['parent_input_categories'].length > 0 ) {
        //         this.data_store_dum['parent_input_categories'].forEach((item, index) => {
        //             item.status = false;
        //
        //         });
        //     }
        //
        //
        //     this.lastIndex = this.currentPageData.length;
        //     this.doInfinite(this.infiniteScroll);
        // });
        this.logger.info(this.classOne_all_list);
        this.currentPageConfig = this.navParams.get('conf');
        // load page header and footer
        this.currentPageheader = this.currentPageConfig['title'];
        this.currentPagebuttons = this.currentPageConfig['view_controles'];
        // check whether next page available
        if (this.currentPageConfig['next_view_ref'] !== 'EXIT') {
            this.nextPage = this.currentPageConfig['next_view_ref'];
        }
        else {
            this.nextPage = 'page_order_end';
        }
    };
    ClassOnePage.prototype.doInfinite = function (infiniteScroll) {
        var _this = this;
        var limit = this.lastIndex + this.pagesize;
        setTimeout(function () {
            for (var i = _this.lastIndex + 1; i <= limit; i++) {
                if (_this.data_store_dum['parent_input_categories'].length <= i) {
                    break;
                }
                _this.data_store_dum['parent_input_categories'].push(_this.data_store_dum['parent_input_categories'][i]);
                _this.lastIndex = i;
            }
            infiniteScroll.complete();
        }, 3500);
    };
    ClassOnePage.prototype.addCurrentOperation = function () {
        var _this = this;
        var modelData = {
            'model': this.data_store_dum,
            'btnConf': this.data_set['btnConf'],
            pgConf: this.currentPageConfig
        };
        var modal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_8__class_one_selected__["a" /* ClassOneSelected */], modelData, { cssClass: 'class-one-selected' });
        modal.onDidDismiss(function (dataRes) {
            _this.logger.log(dataRes);
            _this.prepareData();
        });
        modal.present();
    };
    ClassOnePage.prototype.navigationClick = function (type) {
        var _this = this;
        this.classOne_selected_list = [];
        this.data_store_dum['parent_input_categories'].forEach(function (item, index) {
            if (item.status === true) {
                var temp = {};
                temp['data'] = item.classOne_item;
                temp['size'] = _this.data_store_dum.recent_grade;
                _this.classOne_selected_list.push(temp);
            }
        });
        this.data_store_dum.setParentSelectedCategories(this.classOne_selected_list);
        var finalSelectedList = [];
        var finalMap = {};
        var date = new Date();
        var count = this.data_store_dum.count + 1;
        var ctxId = this.generateCtxId();
        if (Object(__WEBPACK_IMPORTED_MODULE_7_util__["isUndefined"])(this.previous_data)) {
            finalMap['id'] = count + '-' + ctxId + '-' + date.toISOString();
            finalMap['round'] = 1;
            finalMap['ctx'] = this.bsCtx.getCurrentContext().ctx;
        }
        else {
            finalMap['id'] = this.previous_data['display_item']['id'];
            finalMap['round'] = this.previous_data['display_item']['round'] + 1;
            finalMap['ctx'] = this.previous_data['display_item']['ctx'];
        }
        // if (isUndefined(this.previous_data)) {
        //     finalMap['round'] = this.previous_data['round'] + 1;
        // } else {
        //     finalMap['round'] = 1;
        // }
        finalMap['result'] = this.classOne_selected_list;
        finalSelectedList.push(finalMap);
        if (type === 'cancel') {
            this.navigationProvider.exitToRoot(null);
        }
        else if (type === 'ok') {
            if (this.data_store_dum['parent_selected_categories'].length > 0) {
                if (this.nextPage !== 'page_order_end') {
                    var data = {};
                    data['type'] = 'push';
                    data['next_page'] = this.nextPage;
                    data['result'] = finalSelectedList;
                    data['result_type'] = this.data_store_dum['data_type'];
                    this.logger.debug('page one next View...', this.data_store_dum);
                    this.logger.debug(this.data_store_dum, 'parent');
                    this.navigationProvider.nextView(this.nextPage, {
                        data: finalSelectedList,
                        model: this.data_store_dum, btnConf: this.data_set['btnConf']
                    });
                }
                else {
                    var data = {};
                    data['type'] = 'remove_all';
                    data['next_page'] = this.nextPage;
                    data['result'] = finalSelectedList;
                    data['result_type'] = this.data_store_dum.name;
                    this.logger.debug('page one select...', this.data_store_dum);
                    this.data_store_dum.recentCatList(data['result']);
                    if (!this.data_set['btnConf']['ref_type']) {
                        this.data_store_dum.updateGrades(this.data_store_dum['recent_grade']);
                        this.data_store_dum.increment();
                    }
                    this.data_store_dum.concatRecentCatList(this.data_store_dum['parent_selected_categories']);
                    this.sharedDataService.updateSharedDataService(this.data_set['btnConf'], this.data_store_dum.value, new __WEBPACK_IMPORTED_MODULE_9__models_btnModel__["a" /* ClassificationModel */](this.data_store_dum));
                    this.navigationProvider.exitToRoot(null);
                }
            }
            else {
                var toast = this.toastCtrl.create({
                    message: 'Please Select Item(s) to Proceed',
                    duration: 3000,
                    position: 'middle',
                    showCloseButton: true,
                    closeButtonText: 'OK'
                });
                toast.present();
            }
        }
    };
    /*
    generate ctx id
     */
    ClassOnePage.prototype.generateCtxId = function () {
        var bsnsCtx = this.bsCtx.getCurrentContext();
        var id = null;
        bsnsCtx.ctx.forEach(function (dt) {
            if (id === null) {
                id = dt.v;
            }
            else {
                id = id + '-' + dt.v;
            }
        });
        return id;
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["d" /* InfiniteScroll */]),
        __metadata("design:type", __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["d" /* InfiniteScroll */])
    ], ClassOnePage.prototype, "infiniteScroll", void 0);
    ClassOnePage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
            selector: 'page-class-one',
            template: __WEBPACK_IMPORTED_MODULE_3__class_one_template__["a" /* CLASS_ONE_HTML */]
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2_ngx_logger__["b" /* NGXLogger */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["n" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__["a" /* NavigationManager */], __WEBPACK_IMPORTED_MODULE_14__ncinga_sp_nsp_app_core_dist_providers_business_context__["a" /* BusinessContext */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["s" /* ToastController */], __WEBPACK_IMPORTED_MODULE_12__providers_appMasterDataCntrl_app_masterData_cntrl_provider__["a" /* AppMasterDataCntrl */],
            __WEBPACK_IMPORTED_MODULE_11__providers_ccenv_provider__["a" /* CCEnvProvider */], __WEBPACK_IMPORTED_MODULE_13__ncinga_sp_nsp_app_core_dist__["f" /* CacheService */],
            __WEBPACK_IMPORTED_MODULE_4__providers_recentevent_provider__["a" /* RecentEventProvider */], __WEBPACK_IMPORTED_MODULE_6__providers_data_load_provider__["a" /* DataLoadProvider */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["k" /* ModalController */], __WEBPACK_IMPORTED_MODULE_10__providers_shared_data_service_shared_data_service__["a" /* SharedDataProvider */]])
    ], ClassOnePage);
    return ClassOnePage;
}());

//# sourceMappingURL=class-one.js.map

/***/ }),

/***/ 1473:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CLASS_ONE_HTML; });
/**
 * Created by Paramee Gunethilake on 5/3/2018.
 */
var CLASS_ONE_HTML = "\n\n<ion-header>\n<ion-navbar color=\"c22\">\n        <common-main-header [title]=\"currentPageConfig.title\" [tools]=\"tools\"\n        [header_disabled]=\"currentPageConfig?.subject_disable\"></common-main-header>\n    </ion-navbar>\n</ion-header>\n<ion-content class=\"main-container\">\n <ion-grid class=\"summary-grid\" *ngIf=\"sub_header\">\n   <ion-row class=\"summary-row\">\n            <ion-col class=\"summary-col\">\n                <core-domain-header></core-domain-header>\n            </ion-col>\n        </ion-row>\n</ion-grid>\n  <ion-grid [ngClass]=\"grid_class\" class=\"main-grid\">\n  <ion-row class=\"add-btn-row\" align-items-center>\n  <ion-col col-11>\n   <div class=\"hdr r-align-flx\">Operations</div>\n</ion-col>\n<ion-col col-1>\n <button class=\"add-button\" ion-button (click)=\"addCurrentOperation()\"><ion-icon name=\"add\"></ion-icon></button>\n</ion-col>\n\n </ion-row>\n<ion-row class=\"category-row\">\n<ion-col col-6  class=\"select-col\" no-padding *ngFor=\"let Singledata of data_store_dum['parent_input_categories']\">\n        <ion-item class=\"selection-item\" [ngClass]=\"{'item-slct':Singledata.status == true, 'item-not-slct':Singledata.status == false}\">\n          <ion-label  class=\"selection-header\">{{Singledata.classOne_item.name}}\n          </ion-label>\n          <ion-checkbox [(ngModel)]=\"Singledata.status\"  >\n          </ion-checkbox>\n        </ion-item>\n</ion-col>\n      <ion-infinite-scroll (ionInfinite)=\"doInfinite($event)\">\n    <ion-infinite-scroll-content loadingSpinner=\"bubbles\" position=\"top\"\n                                 loadingText=\"Loading more Operations...\">\n    </ion-infinite-scroll-content>\n    </ion-infinite-scroll>\n       </ion-row>\n       <ion-row no-padding class=\"data-empty-time\" *ngIf=\"data_store_dum['parent_input_categories'].length === 0\">\n       <ion-col>\n      <div class=empt-msg><ion-icon name=\"md-alert\" class=\"ion-icon\" item-left></ion-icon><span class=\"space-rem\"></span>\n        Please Click <ion-icon name=\"add\" class=\"pls-ioc\"></ion-icon> button to add {{currentPageConfig['list_name']}}\n       </div>\n</ion-col>\n</ion-row>\n  </ion-grid>\n</ion-content>\n<ion-footer no-padding>\n  <ion-navbar no-padding>\n\n    <ion-grid no-padding>\n      <ion-row justify-content-end no-padding>\n        <ion-col *ngFor=\"let button of currentPagebuttons \" col-5 col-lg-2 col-md-3 class=\"right-pdn\">\n          <button [ngClass]=\"button.button_type\" ion-button [hidden]=\"!button.display\"\n          (click)=\"navigationClick(button.button_type)\" class=\"page-button help-category-btn\">\n          {{button.button_name}}</button>\n        </ion-col>\n      </ion-row>\n    </ion-grid>\n\n  </ion-navbar>\n</ion-footer>\n\n\n";
//# sourceMappingURL=class-one-template.js.map

/***/ })

});
//# sourceMappingURL=10.js.map