webpackJsonp([8],{

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

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GradingPageModule", function() { return GradingPageModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ngx_translate_core__ = __webpack_require__(136);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_components_module__ = __webpack_require__(959);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__grading__ = __webpack_require__(1787);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(7);
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 GradingPageModule = /** @class */ (function () {
    function GradingPageModule() {
    }
    GradingPageModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_2__angular_core__["NgModule"])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_4__grading__["a" /* GradingPage */],
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_5__ncinga_sp_nsp_app_core_dist__["j" /* CoreModule */],
                __WEBPACK_IMPORTED_MODULE_3__components_components_module__["a" /* ComponentsModule */],
                __WEBPACK_IMPORTED_MODULE_0_ionic_angular__["j" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_4__grading__["a" /* GradingPage */]),
                __WEBPACK_IMPORTED_MODULE_1__ngx_translate_core__["b" /* TranslateModule */].forChild()
            ],
            exports: [
                __WEBPACK_IMPORTED_MODULE_4__grading__["a" /* GradingPage */]
            ],
            providers: []
        })
    ], GradingPageModule);
    return GradingPageModule;
}());

//# sourceMappingURL=grading.module.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GradingPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(5);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_keypad_ion_digit_keyboard_cmp__ = __webpack_require__(985);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_native_text_to_speech__ = __webpack_require__(201);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ngx_logger__ = __webpack_require__(4);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__grading_template__ = __webpack_require__(1788);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__ = __webpack_require__(50);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_util__ = __webpack_require__(79);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_util___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_util__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__models_btnModel__ = __webpack_require__(53);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__providers_shared_data_service_shared_data_service__ = __webpack_require__(44);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__ncinga_sp_nsp_reader_dist_providers_scanner_listener__ = __webpack_require__(137);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__providers_activity_log_activity_log__ = __webpack_require__(139);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__util_ContextCompareUtil__ = __webpack_require__(1789);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__candc_module__ = __webpack_require__(142);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__ncinga_sp_nsp_app_core_dist__ = __webpack_require__(7);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__providers_ccenv_provider__ = __webpack_require__(140);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__grading_selected__ = __webpack_require__(988);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__ncinga_sp_nsp_app_core_dist_providers_business_context__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__providers_masterdata_service_masterdata_service__ = __webpack_require__(199);
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 GradingPage = /** @class */ (function () {
    function GradingPage(tts, toastCtrl, logger, navParams, navProvider, sharedDataService, readerSvc, activityLog, cacheSvc, appMsDtPrv, envProvider, alertCtrl, modalCtrl, businessCtx, navCtrl) {
        this.tts = tts;
        this.toastCtrl = toastCtrl;
        this.logger = logger;
        this.navParams = navParams;
        this.navProvider = navProvider;
        this.sharedDataService = sharedDataService;
        this.readerSvc = readerSvc;
        this.activityLog = activityLog;
        this.cacheSvc = cacheSvc;
        this.appMsDtPrv = appMsDtPrv;
        this.envProvider = envProvider;
        this.alertCtrl = alertCtrl;
        this.modalCtrl = modalCtrl;
        this.businessCtx = businessCtx;
        this.navCtrl = navCtrl;
        this.next_view_ref = '';
        this.this_view_conf = {};
        this.categoryCounts = {};
        this.anyNumber = '';
        this._selectedItemType = { icon: '', label: '', value: '' };
        this._selectedCatOne = {};
        this._selectedCatTwo = {};
        this.lastIndex = -1;
        this.lastOptionIdx = -1;
        this.quantityOptions = [];
        this.loading_msg = false;
        this.sub_header = true;
        this.arrow_disabled = false;
        this.grade_data_set = [];
        this.bulk_record_arr = [];
        this.bulk_record_arr_temp = [];
        this.ac_event = [];
        this.hide = true;
        /*
         scanner reader
         */
        this.customOptions = {
            alert: false,
            types: {
                Code128: true,
                Code39: true,
                Code93: true,
                CodaBar: true,
                DataMatrix: true,
                EAN13: true,
                EAN8: true,
                ITF: true,
                QRCode: true,
                UPCA: true,
                UPCE: true,
                PDF417: true,
                Aztec: true
            }
        };
        // keyboard options
        this.keyboardSettings = {
            align: 'center',
            visible: false,
            leftActionOptions: {
                iconName: 'ios-backspace-outline',
                fontSize: '1.4em'
            },
            rightActionOptions: {
                iconName: 'ios-checkmark-circle-outline',
                fontSize: '1.3em'
            },
            roundButtons: false,
            showLetters: true,
            swipeToHide: true,
            theme: 'dusk'
        };
        this.tools = {
            line: true,
            menu: true,
            shift: true,
            user: true,
        };
        this.count = 0;
        this.readerSvc.setOptions(this.customOptions);
    }
    GradingPage.prototype.ionViewWillEnter = function () {
        this.this_view_conf = this.navParams.get('conf');
        /*
         listenForStateChanges page master data set
         */
        if (this.navCtrl.getPrevious()['id'] !== 'GradingPage') {
            this.pageDataLoader();
            this.setQuantityOptions();
            this.loadSelectDataList();
        }
    };
    GradingPage.prototype.ionViewDidLoad = function () {
        /*
         * TODO: if only scanning is available
         * */
        this.listenToScanner();
    };
    GradingPage.prototype.setQuantityOptions = function () {
        if (this.view_model && this.view_model.qty_list.length > 0) {
            this.quantityOptions = this.view_model.qty_list;
        }
        else {
            if (!Object(__WEBPACK_IMPORTED_MODULE_7_util__["isUndefined"])(this.this_view_conf.view_params)) {
                this.quantityOptions = this.this_view_conf.view_params.sec_categories.options.slice(0);
                this.view_model.setQtyList(this.quantityOptions);
            }
        }
    };
    /*
     set select grading list
     */
    GradingPage.prototype.loadSelectDataList = function () {
        var _this = this;
        var bsctx = this.businessCtx.getCurrentContext();
        this.view_model.setCtx(bsctx.ctx);
        this._selectedCatTwo = this.quantityOptions[0];
        if (this.view_model.value === 0) {
            this.view_model.setValue(this.quantityOptions[0].value);
        }
        else {
            var qtyIndex_1 = this.quantityOptions.findIndex(function (item) { return item.value === _this.view_model.value; });
            this.logger.trace('qty index', qtyIndex_1);
            setTimeout(function () {
                _this.slides.slideTo(qtyIndex_1, 400);
            }, 400);
        }
        var index = this.quantityOptions.findIndex(function (item) { return item.type === 'any'; });
        if (index > -1) {
            this._hasCustomSize = true;
        }
        if (!Object(__WEBPACK_IMPORTED_MODULE_7_util__["isUndefined"])(this.data_set['btnConf']['undo_times'])) {
            this.logger.debug('undo set');
            this.undo_terms = this.data_set['btnConf']['undo_times'];
        }
        // set current grades
        var dtx = this.appMsDtPrv.getCurrentList(this.this_view_conf.view_data);
        if (dtx) {
            this.view_model.setGrades(dtx.list);
            this.grade_data_set = dtx.list; // to reset when undo
        }
        else {
            this.mappingIncomplete();
        }
    };
    /*
     scanner subscriber
     */
    GradingPage.prototype.listenToScanner = function () {
        var _this = this;
        try {
            this.readerSvc.scannerEventPublisher().subscribe(function (res) {
                var data = res.data;
                var current_bs_ctx = _this.activityLog.getActivityLogBsnsCtx();
                // check is valid entry
                if (data && !isNaN(data.qty)) {
                    if (__WEBPACK_IMPORTED_MODULE_12__util_ContextCompareUtil__["a" /* ContextCompareUtil */].contextMatch(current_bs_ctx, data)) {
                        var size = data.size;
                        var qty = data.qty;
                        _this.autoDetectGrading(size, qty);
                    }
                    else {
                        _this.speakOut('Scanner Data Mismatch....');
                    }
                }
                else {
                    _this.speakOut('Quantity is not a number');
                }
                _this.logger.trace(res);
            });
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    GradingPage.prototype.selectCatOne = function (opt, i) {
        // opt['active'] = !opt['active'];
        var _this = this;
        var actEvt = Object.assign({}, opt);
        delete actEvt['id'];
        delete actEvt['group_id'];
        delete actEvt['grading_item'];
        delete actEvt['active'];
        delete actEvt['status'];
        delete actEvt['value'];
        delete actEvt['item'];
        try {
            if (this.hide) {
                // if (opt['active']) { // TODO: get 'size' from config
                this.ac_event = [
                    {
                        size: actEvt
                    }
                ];
                this.btn_click_view_disabled = false;
                if (this.view_model.grades.length === 0) {
                    var dtx = this.appMsDtPrv.getCurrentList(this.this_view_conf.view_data);
                    if (dtx) {
                        this.view_model.setGrades(dtx.list);
                    }
                    else {
                        this.mappingIncomplete();
                    }
                }
                if (this.view_model.value === 0) {
                    this.view_model.setValue(this.quantityOptions[0].value);
                }
                this.logger.debug('this changeCustomQuantity', opt, i, this._selectedCatTwo.value);
                this._selectedCatOne = opt;
                this.lastIndex = i;
                this.lastOptionIdx = i;
                this.categoryCounts[opt['name']] = this.categoryCounts[opt['name']] + this._selectedCatTwo.value;
                this.view_model.setRecentGrade(opt['name']);
                this.view_model.setEventActual(this.ac_event);
                this.view_model.setSelectItem(actEvt);
                if (!this.this_view_conf.bulk_record) {
                    this.handleNonBulkCounts(opt);
                }
                else {
                    this.logger.trace(this.this_view_conf.bulk_record, 'bulk_record');
                    this.handleBulkCounts(opt);
                }
            }
        }
        catch (e) {
        }
        setTimeout(function () {
            _this.lastOptionIdx = -1;
            // opt['active'] = false;
        }, 500);
    };
    GradingPage.prototype.selectCatTwo = function (opt) {
        opt['active'] = !opt['active'];
        if (opt['active']) {
            this._selectedCatTwo = opt;
        }
        else {
            this._selectedCatTwo = {};
        }
    };
    GradingPage.prototype.handleNonBulkCounts = function (opt) {
        if (this.this_view_conf.next_view_ref && this.this_view_conf.next_page) {
            if (this.this_view_conf.next_view_ref === 'page_order_end') {
                this.doIncrement(opt, false);
                this.navProvider.exitToRoot(null);
            }
            else {
                this.next();
            }
        }
        else if (this.this_view_conf.one_click) {
            this.doIncrement(opt, true);
            this.view_disabled_btn_upper = true;
        }
        else {
            this.speakOut(this.view_model.value + ' ' + this.view_model.recent_grade_type + '   Added');
            this.hide = false;
            this.doIncrement(opt, false);
            var _self_1 = this;
            setTimeout(function () {
                _self_1.hide = true;
            }, 300);
        }
    };
    GradingPage.prototype.handleBulkCounts = function (opt) {
        var _this = this;
        this.speakOut(this.view_model.value + ' ' + this.view_model.recent_grade_type + '   Added');
        this.view_model.updateGrades(opt['name']);
        this.view_model.increment();
        this.view_model.setRecentGrade(opt['name']);
        this.view_model.setGroupId(this.random_group_id);
        var gradList = this.view_model.grades;
        this.view_model.grades = [];
        gradList.forEach(function (v) {
            _this.view_model.grades.push(Object.assign({}, v));
            // this.view_model.grade_qtys = {};
        });
        this.logger.debug('output', this.view_model.grades, this.data_set['model']);
        this.count = this.count + this.view_model.value;
        this.bulk_record_arr.push(Object.assign({}, new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["c" /* GradingModel */](this.view_model)));
        this.logger.trace(this.bulk_record_arr, 'bulk_record_arr');
        if (!Object(__WEBPACK_IMPORTED_MODULE_7_util__["isUndefined"])(this.data_set['btnConf']['undo_times'])) {
            this.logger.debug('undo set');
            this.undo_terms = this.data_set['btnConf']['undo_times'];
        }
    };
    GradingPage.prototype.doIncrement = function (opt, hasNextPage) {
        this.view_model.updateGrades(opt['name']);
        this.view_model.increment();
        this.logger.debug('output', this.view_model.grades, this.data_set['model']);
        if (hasNextPage) {
            this.sharedDataService.updateSharedDataService(this.data_set['btnConf'], this.view_model.value, new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["a" /* ClassificationModel */](this.view_model), this.ac_event);
        }
        else {
            this.sharedDataService.updateSharedDataService(this.data_set['btnConf'], this.view_model.value, this.view_model, this.ac_event);
        }
        var btnConf = this.data_set['btnConf'];
        // this.sharedDataService.sendBackEndEvent({
        //     ty: btnConf.event_type,
        //     nm: btnConf.data_type, vl: this.view_model.value, cv: 1, ac: []
        // });
        if (!Object(__WEBPACK_IMPORTED_MODULE_7_util__["isUndefined"])(this.data_set['btnConf']['undo_times'])) {
            this.logger.debug('undo set');
            this.undo_terms = this.data_set['btnConf']['undo_times'];
        }
    };
    GradingPage.prototype.showKeyboard = function () {
        this.view_disabled_btn_upper = true;
        this.btn_click_view_disabled = true;
        this.undo_disabled = true;
        this.view_disabled = true;
        this.keyboard.show();
    };
    // next lable view
    GradingPage.prototype.nextLable = function () {
        var _this = this;
        try {
            if (!this._selectedItemType) {
                return;
            }
            var idx = this.this_view_conf.view_params.item_types.findIndex(function (item) { return item.value === _this.view_model.recent_grade_type; });
            if (idx < this.this_view_conf.view_params.item_types.length - 1) {
                idx = idx + 1;
            }
            else {
                idx = 0;
            }
            this._selectedItemType = this.this_view_conf.view_params.item_types[idx];
            this.view_model.setRecntGrdnType(this._selectedItemType.value);
            this.logger.trace('next', this._selectedItemType.value, this.this_view_conf.view_params.item_types);
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    // previous lable//
    GradingPage.prototype.previousLable = function () {
        var _this = this;
        try {
            if (!this._selectedItemType) {
                return;
            }
            var idx = this.this_view_conf.view_params.item_types.findIndex(function (item) { return item.value === _this.view_model.recent_grade_type; });
            if (idx > 0) {
                idx = idx - 1;
            }
            else {
                idx = this.this_view_conf.view_params.item_types.length - 1;
            }
            this._selectedItemType = this.this_view_conf.view_params.item_types[idx];
            this.logger.trace('previos', this._selectedItemType.value);
            this.view_model.setRecntGrdnType(this._selectedItemType.value);
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    // Event way
    GradingPage.prototype.numberClick = function (key) {
        try {
            if (this.anyNumber === '') {
                this.anyNumber = this.anyNumber + '' + key;
            }
            else if (this.anyNumber === '00000') {
                this.speakOut('please insert standard value');
                this.anyNumber = '';
                this.keyboard.hide();
                this.view_disabled_btn_upper = false;
                this.btn_click_view_disabled = false;
                this.undo_disabled = false;
            }
            else if (parseInt(this.anyNumber) < 1000) {
                this.anyNumber = this.anyNumber + '' + key;
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    GradingPage.prototype.numberBackSpace = function () {
        this.anyNumber = this.anyNumber.slice(0, -1);
    };
    GradingPage.prototype.hideKeyboard = function (action) {
        var _this = this;
        try {
            var quantityLength = this.this_view_conf.view_params.sec_categories.options.length;
            this.view_disabled_btn_upper = false;
            this.btn_click_view_disabled = false;
            this.undo_disabled = false;
            this.view_disabled = false;
            if (action === 'done') {
                if (this.anyNumber !== '' && parseInt(this.anyNumber) !== 0) {
                    var anyValue = parseInt(this.anyNumber);
                    var index = this.quantityOptions.findIndex(function (item) { return item.type === 'any'; });
                    if (index > -1) {
                        this.quantityOptions.splice(index, 1);
                    }
                    // add new item
                    var newNum = parseInt(this.anyNumber);
                    this.quantityOptions[quantityLength] = {
                        name: newNum.toString(),
                        value: anyValue,
                        type: 'any',
                        color: 'red'
                    };
                    var idx_1 = quantityLength + 1;
                    this.logger.trace('after add new', idx_1);
                    this._hasCustomSize = true;
                    this._selectedCatTwo = { name: this.anyNumber, value: anyValue, type: 'any', color: 'red' };
                    this.view_model.setValue(anyValue);
                    // this.dataLoader.storeGradingdata(this.this_view_conf.view_data, this.quantityOptions);
                    this.slides.update(10);
                    setTimeout(function () {
                        _this.slides.slideTo(idx_1 - 1, 400);
                    }, 400);
                    this.anyNumber = '';
                }
                else {
                    this.speakOut('please enter valid quantity');
                    this.anyNumber = '';
                }
                this.keyboard.hide();
            }
            else if (action === 'cancel') {
                this.keyboard.hide();
                this.anyNumber = '';
            }
        }
        catch (e) {
            // console.error('error occurred while hiding keyboard');
        }
    };
    GradingPage.prototype.slideChanged = function () {
        try {
            var quantityLength = this.this_view_conf.view_params.sec_categories.options.length;
            var currentIndex = this.slides.getActiveIndex();
            this.logger.debug('slider change', currentIndex);
            if (currentIndex > -1) {
                // this._selectedCatTwo = this.quantityOptions[currentIndex];
                if (this.quantityOptions[currentIndex]) {
                    this.view_model.setValue(this.quantityOptions[currentIndex].value);
                }
            }
            this.logger.debug('slider change....', quantityLength, currentIndex, this._hasCustomSize);
            if (quantityLength > currentIndex) {
                this._hasCustomSize = false;
            }
            else {
                this._hasCustomSize = true;
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    GradingPage.prototype.changeCustomQuantity = function (op) {
        var _this = this;
        try {
            var quantityLength_1 = this.this_view_conf.view_params.sec_categories.options.length;
            var index = this.slides.getActiveIndex();
            if (Object(__WEBPACK_IMPORTED_MODULE_7_util__["isUndefined"])(this.quantityOptions[quantityLength_1])) {
                this.quantityOptions[quantityLength_1] = { name: '', value: 0, type: 'any', color: 'red' };
            }
            if (op === '+' && index > -1 && this.quantityOptions[index]) {
                if (parseInt(this.quantityOptions[index]['value']) < 10000) {
                    this.quantityOptions[quantityLength_1]['value'] = this.quantityOptions[index]['value'] + 1;
                }
            }
            else if (op === '-' && index > -1 && this.quantityOptions[index]) {
                if (parseInt(this.quantityOptions[index]['value']) > 1) {
                    this.quantityOptions[quantityLength_1]['value'] = this.quantityOptions[index]['value'] - 1;
                }
            }
            this.quantityOptions[quantityLength_1]['name'] = '' + this.quantityOptions[quantityLength_1]['value'];
            this.view_model.setValue(this.quantityOptions[quantityLength_1]['value']);
            this.slides.update(10);
            setTimeout(function () {
                _this.slides.slideTo(quantityLength_1, 400);
            }, 400);
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    GradingPage.prototype.speakOut = function (message) {
        try {
            this.tts.speak(message)
                .then(function () {
            })
                .catch(function (reason) {
            });
            var toast = this.toastCtrl.create({
                message: message,
                duration: 3000,
                position: 'top',
                cssClass: 'success-toast'
            });
            toast.onDidDismiss(function () {
            });
            toast.present();
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    // next method for page navigation //
    GradingPage.prototype.next = function () {
        try {
            if (this.this_view_conf.next_view_ref === 'page_order_end') {
            }
            else {
                this.logger.debug('data store', this.view_model);
                this.navProvider.nextView(this.this_view_conf.next_view_ref, {
                    data: this.previous_data_set, model: this.view_model,
                    btnConf: this.data_set['btnConf']
                });
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    // undo last update//
    GradingPage.prototype.undoCounting = function () {
        var _this = this;
        try {
            this.logger.debug('undo terms..', this.undo_terms);
            var dtx = this.appMsDtPrv.getCurrentList(this.this_view_conf.view_data);
            if (dtx) {
                this.grade_data_set = dtx.list;
            }
            else {
                this.mappingIncomplete();
            }
            // if (this.undo_terms > 0) {
            if (this.view_model.value > 0 && this.view_model.count >= this.view_model.value) {
                if (!this.this_view_conf.bulk_record) {
                    this.view_disabled_btn_upper = false;
                    this.sharedDataService.updateSharedDataService(this.data_set['btnConf'], -this.view_model.value, this.view_model, this.ac_event);
                    var dataModel_1 = this.sharedDataService.getDataSharedDataService(this.data_set['btnConf']['id']);
                    if (dataModel_1.value === 0) {
                        this.goToSlide(0);
                    }
                    var qtyIndex = this.quantityOptions.findIndex(function (item) { return item.value === dataModel_1.value; });
                    this.logger.trace('qty index', qtyIndex, dataModel_1.value);
                    this.goToSlide(qtyIndex);
                    if (dataModel_1.recent_grade_type === null) {
                        var gradeType = this.this_view_conf.view_params.item_types;
                        dataModel_1.setRecntGrdnType(gradeType[0].value);
                        this._selectedItemType = this.this_view_conf.view_params.item_types[0];
                    }
                    else {
                        var qtyIndex_2 = this.this_view_conf.view_params.item_types.findIndex(function (item) {
                            return item.value === dataModel_1.recent_grade_type;
                        });
                        this._selectedItemType = this.this_view_conf.view_params.item_types[qtyIndex_2];
                    }
                    if (dataModel_1 instanceof __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["c" /* GradingModel */]) {
                        this.view_model = new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["c" /* GradingModel */](this.sharedDataService.getDataSharedDataService(this.data_set['btnConf']['id']));
                    }
                    else if (dataModel_1 instanceof __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["a" /* ClassificationModel */]) {
                        this.view_model = new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["a" /* ClassificationModel */](this.sharedDataService.getDataSharedDataService(this.data_set['btnConf']['id']));
                    }
                    var btnConf = this.data_set['btnConf'];
                    dataModel_1.setGrades(dtx.list); // restore grading list
                }
                else {
                    if (this.bulk_record_arr.length > 0) {
                        if (this.undo_terms > 0) {
                            var lastRecord = this.bulk_record_arr[this.bulk_record_arr.length - 1];
                            this.bulk_record_arr.pop();
                            var dataModel_2 = this.bulk_record_arr[this.bulk_record_arr.length - 1];
                            if (!Object(__WEBPACK_IMPORTED_MODULE_7_util__["isUndefined"])(dataModel_2)) {
                                this.count = this.count - lastRecord.value;
                                if (dataModel_2.grades.length === 0) {
                                    dataModel_2.setGrades(this.grade_data_set);
                                }
                                if (dataModel_2.value === 0) {
                                    this.goToSlide(0);
                                }
                                var qtyIndex = this.quantityOptions.findIndex(function (item) { return item.value === dataModel_2.value; });
                                this.logger.trace('qty index', qtyIndex, dataModel_2.value);
                                this.goToSlide(qtyIndex);
                                if (dataModel_2.recent_grade_type === null) {
                                    var gradeType = this.this_view_conf.view_params.item_types;
                                    dataModel_2.setRecntGrdnType(gradeType[0].value);
                                    this._selectedItemType = this.this_view_conf.view_params.item_types[0];
                                }
                                this.view_model = new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["c" /* GradingModel */](dataModel_2);
                            }
                            else {
                                this.count = 0;
                                var gradList = this.grade_data_set;
                                this.view_model.grades = [];
                                this.view_model.grade_qtys = {};
                                gradList.forEach(function (v) {
                                    return _this.view_model.grades.push({
                                        name: v.name,
                                        value: 0
                                    });
                                });
                                this.logger.trace(this.bulk_record_arr_temp[0].count, 'get previos count');
                                this.view_model.count = this.bulk_record_arr_temp[0].count;
                                this.logger.trace(this.view_model, 'set count');
                                this.view_model = new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["c" /* GradingModel */](this.view_model);
                            }
                            this.undo_terms--;
                        }
                    }
                }
                // this.undo_terms--;
            }
            // this.view_model.setGrades(dtx.list);
            // }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    // get View configure file//
    GradingPage.prototype.getStyleSizes = function (dataType) {
        var _this = this;
        var url = this.envProvider.getEnvVar(__WEBPACK_IMPORTED_MODULE_15__providers_ccenv_provider__["b" /* CCServiceEndPoints */].DATA_SERVICE);
        try {
            var response_1 = null;
            return this.cacheSvc.get(__WEBPACK_IMPORTED_MODULE_13__candc_module__["b" /* CC_MOD_KEY */], __WEBPACK_IMPORTED_MODULE_13__candc_module__["c" /* Crnt_M_D */]).then(function (respn) {
                if (respn) {
                    _this.logger.trace('response for grading list', respn[dataType], dataType);
                    var resdata = respn[dataType];
                    response_1 = resdata.list;
                }
                else {
                    _this.logger.trace('<<<< grading list not listenForStateChanges >>>>>');
                    // this.appMsDtPrv.setAvailableCntxtMstData();
                    // this.getStyleSizes(dataType);
                }
                return response_1;
            });
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    // copied from rectified.ts file//
    GradingPage.prototype.navigationClick = function (type) {
        var _this = this;
        // let outPut = new Object();
        // outPut['0'] = {
        //     'grading': this.view_model.recent_grade
        // };
        // this.view_model.copyOutPutData(outPut);
        try {
            if (type === 'cancel') {
                this.navProvider.exitToRoot(null);
            }
            else if (type === 'ok') {
                if (!this.this_view_conf.bulk_record) {
                    if (this.view_model.value !== this._selectedCatTwo.value) {
                    }
                    if (this.this_view_conf.next_view_ref === 'EXIT') {
                        var data = {};
                        data['type'] = 'push';
                        data['next_page'] = this.this_view_conf.next_view_ref;
                    }
                    else if (this.this_view_conf.next_view_ref !== 'page_order_end') {
                        // this.navigationProvider.rootView(this.classOne_selected_list);
                        this.logger.debug('select View', this.this_view_conf.next_view_ref);
                        var data = {};
                        data['type'] = 'remove_all';
                        data['next_page'] = this.this_view_conf.next_view_ref;
                        this.navProvider.nextView(this.this_view_conf.next_view_ref, {
                            data: this.previous_data_set,
                            model: this.view_model,
                        });
                        // save event in recent list if this is the exit page
                    }
                    else if (this.this_view_conf.next_view_ref === 'page_order_end') {
                        this.logger.trace('end');
                        this.navProvider.exitToRoot(null);
                    }
                }
                else {
                    if (this.this_view_conf.next_view_ref !== 'page_order_end') {
                        if (JSON.stringify(this.view_model.grade_qtys) !== '{}') {
                            this.navProvider.nextView(this.this_view_conf.next_view_ref, {
                                data: this.previous_data_set,
                                model: this.bulk_record_arr,
                                btnConf: this.data_set['btnConf']
                            });
                        }
                        else {
                            this.emptyBulkAlert();
                        }
                    }
                    else {
                        if (this.bulk_record_arr.length > 0) {
                            var bulk_arr_1 = [];
                            this.count = 0;
                            this.bulk_record_arr.forEach(function (blkdt) {
                                // this.view_model.grades.forEach(grd => {
                                //         if (blkdt.recent_grade === grd.name) {
                                _this.count = _this.count + blkdt.value;
                                bulk_arr_1.push(blkdt);
                                //     }
                                // });
                            });
                            if (bulk_arr_1.length > 0) {
                                bulk_arr_1.forEach(function (data) {
                                    _this.ac_event = [
                                        {
                                            size: {
                                                name: data.recent_grade
                                            }
                                        }
                                    ];
                                    _this.sharedDataService.updateSharedDataService(_this.data_set['btnConf'], data.value, new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["c" /* GradingModel */](data), _this.ac_event);
                                    // let btnConf = this.data_set['btnConf'];
                                    // this.sharedDataService.sendBackEndEvent({
                                    //     ty: btnConf.event_type,
                                    //     nm: btnConf.data_type, vl: data.value, cv: 1, ac: []
                                    // });
                                });
                                this.view_model.resetGradeQtys();
                                // this.view_model.grades = this.setGradesZero(this.view_model.grades);
                                this.view_model.setGrades(this.setGradesZero(this.view_model.grades));
                                this.view_model.setValue(0);
                                // this.view_model.setRecentGrade(null);
                                this.count = 0;
                                // this.navProvider.exitToRoot(null);
                                var gradeType = this.this_view_conf.view_params.item_types;
                                this.view_model.setRecntGrdnType(gradeType[0].value);
                                this._selectedCatTwo = this.quantityOptions[0];
                                this.random_group_id = Math.random();
                                this.bulk_record_arr = [];
                                // this.logger.trace('qty index', qtyIndex, dataModel.value);
                                this.goToSlide(0);
                                this.presentAlert();
                            }
                            else {
                                this.emptyBulkAlert();
                            }
                        }
                    }
                }
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    GradingPage.prototype.goToSlide = function (idx) {
        var _this = this;
        setTimeout(function () {
            _this.slides.slideTo(idx, 400);
        }, 400);
    };
    // view disabled & enabled due to button collection sector//
    GradingPage.prototype.viewUpdate = function (event) {
        this.view_disabled = event.view_disabled;
        this.view_disabled_btn = event.view_disabled;
    };
    /*
     listenForStateChanges page main data set
     */
    GradingPage.prototype.pageDataLoader = function () {
        var _this = this;
        try {
            this.data_set = this.navParams.get('data');
            this.first_category_name = this.this_view_conf.first_category_name;
            this.sec_category_name = this.this_view_conf.sec_category_name;
            if (this.this_view_conf.undo_disabled) {
                this.undo_disabled = true;
            }
            else {
                this.undo_disabled = false;
            }
            var gradeType = this.this_view_conf.view_params.item_types;
            if (gradeType.length === 1) {
                this.arrow_disabled = true;
            }
            if (!this.this_view_conf['next_page']) {
                this.view_model = new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["c" /* GradingModel */](this.data_set['model']);
                if (!this.view_model.name) {
                    this.view_model.setName(this.data_set['btnConf']['data_type']);
                }
            }
            else if (this.this_view_conf['next_page']) {
                this.view_model = new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["a" /* ClassificationModel */](this.data_set['model']);
                if (!this.view_model.name) {
                    this.view_model.setName(this.data_set['btnConf']['data_type']);
                }
            }
            if (this.view_model.recent_grade_type === null) {
                this.view_model.setRecntGrdnType(gradeType[0].value);
                this._selectedItemType = this.this_view_conf.view_params.item_types[0];
            }
            else {
                var qtyIndex = this.this_view_conf.view_params.item_types.findIndex(function (item) {
                    return item.value === _this.view_model.recent_grade_type;
                });
                this._selectedItemType = this.this_view_conf.view_params.item_types[qtyIndex];
            }
            if (this.this_view_conf.bulk_record) {
                this.random_group_id = Math.random();
                this.bulk_record_arr_temp = [];
                this.bulk_record_arr_temp.push(Object.assign({}, new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["c" /* GradingModel */](this.view_model)));
                this.logger.trace(this.bulk_record_arr_temp, 'bulk temp arr');
            }
            this.logger.trace('view model', this.view_model);
            this.currentPagebuttons = this.this_view_conf.view_controles;
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    /*
     set grades zero
     */
    GradingPage.prototype.setGradesZero = function (grades) {
        grades.forEach(function (data) {
            data.value = 0;
            if (data.active) {
                data.active = false;
            }
        });
        return grades;
    };
    /*
     scanner call method
     */
    GradingPage.prototype.openCamera = function () {
        this.logger.trace('scanner click');
        this.readerSvc.startScan('cncreader');
    };
    /*
     scanner qty set to grading
     */
    GradingPage.prototype.setScannerQty = function (qty) {
        var _this = this;
        try {
            var quantityLength = this.this_view_conf.view_params.sec_categories.options.length;
            var anyValue = parseInt(qty);
            var index = this.quantityOptions.findIndex(function (item) { return item.type === 'any'; });
            if (index > -1) {
                this.quantityOptions.splice(index, 1);
            }
            // add new item
            this.quantityOptions[quantityLength] = { name: qty, value: anyValue, type: 'any', color: 'red' };
            var idx_2 = quantityLength + 1;
            this.logger.trace('after add new', idx_2);
            this._hasCustomSize = true;
            this._selectedCatTwo = { name: qty, value: anyValue, type: 'any', color: 'red' };
            this.view_model.setValue(anyValue);
            // this.dataLoader.storeGradingdata(this.this_view_conf.view_data, this.quantityOptions);
            this.slides.update(10);
            setTimeout(function () {
                _this.slides.slideTo(idx_2 - 1, 400);
            }, 400);
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    /*
     grading btn auto detect
     */
    GradingPage.prototype.autoDetectGrading = function (size, qty) {
        var _this = this;
        try {
            var opt_1;
            var boolVal_1 = false;
            this.view_model.grades.forEach(function (data) {
                if (data.name.toUpperCase() === size.toUpperCase()) {
                    opt_1 = data;
                    boolVal_1 = true;
                    _this.logger.trace('read data', data, data.name.toUpperCase(), size.toUpperCase(), 'boolVal', boolVal_1);
                }
            });
            if (boolVal_1) {
                this.setScannerQty(qty);
                this.btn_click_view_disabled = false;
                this._selectedCatOne = opt_1;
                this.categoryCounts[opt_1['name']] = this.categoryCounts[opt_1['name']] + this._selectedCatTwo.value;
                this.view_model.setRecentGrade(opt_1['name']);
                if (this.this_view_conf.next_view_ref && this.this_view_conf.next_page) {
                    this.next();
                }
                else {
                    if (this.this_view_conf.bulk_record) {
                        this.speakOut(this.view_model.value + ' ' + this.view_model.recent_grade_type + '   Added');
                        this.view_model.updateGrades(opt_1['name']);
                        this.view_model.increment();
                        this.view_model.setRecentGrade(opt_1['name']);
                        this.view_model.setGroupId(this.random_group_id);
                        var gradList = this.view_model.grades;
                        this.view_model.grades = [];
                        gradList.forEach(function (v) {
                            _this.view_model.grades.push(Object.assign({}, v));
                            // this.view_model.grade_qtys = {};
                        });
                        this.logger.debug('output', this.view_model.grades, this.data_set['model']);
                        this.count = this.count + this.view_model.value;
                        this.bulk_record_arr.push(Object.assign({}, new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["c" /* GradingModel */](this.view_model)));
                        this.logger.trace(this.bulk_record_arr, 'bulk_record_arr');
                        if (!Object(__WEBPACK_IMPORTED_MODULE_7_util__["isUndefined"])(this.data_set['btnConf']['undo_times'])) {
                            this.logger.debug('undo set');
                            this.undo_terms = this.data_set['btnConf']['undo_times'];
                        }
                    }
                }
            }
            else {
                this.speakOut('Size is not available...');
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    /*
     alert present for bulk scenario
     */
    GradingPage.prototype.presentAlert = function () {
        var msg = this.this_view_conf.popup;
        var alert = this.alertCtrl.create({
            title: msg.title,
            subTitle: msg.subTitle
        });
        alert.present();
        setTimeout(function () {
            alert.dismiss();
        }, 2000);
    };
    /*
     alert for empty bulk records
     */
    GradingPage.prototype.emptyBulkAlert = function () {
        var alert = this.alertCtrl.create({
            title: 'Cannot Proceed',
            subTitle: 'Please select grades'
        });
        alert.present();
        setTimeout(function () {
            alert.dismiss();
        }, 2000);
    };
    GradingPage.prototype.addGrading = function () {
        var modelArgs = {};
        modelArgs['model'] = this.view_model;
        modelArgs['btnConf'] = this.data_set['btnConf'];
        modelArgs['pgConf'] = this.this_view_conf;
        var modal = this.modalCtrl.create(__WEBPACK_IMPORTED_MODULE_16__grading_selected__["a" /* GradingSelected */], modelArgs, { cssClass: 'grading-selected' });
        modal.present();
        var _self = this;
        modal.onDidDismiss(function (res) {
            _self.handleAfterFilter(res);
        });
    };
    GradingPage.prototype.handleAfterFilter = function (res) {
        if (!res) {
            return true;
        }
        this.loadSelectDataList();
        var conf = this.data_set['btnConf'];
        if (this.this_view_conf.bulk_record) {
            this.handleFilterAfterInBulk();
        }
        if (!this.this_view_conf.bulk_record) {
            if (this.view_model.value === 0) {
                this.view_model.setValue(this.quantityOptions[0].value);
                this.slides.slideTo(0, 400);
            }
            this.sharedDataService.UpdateSharedDataServiceOnly(conf.id, this.view_model);
            // TODO: to save in appcache
            this.sharedDataService.count_updates.next('related-count-update');
        }
    };
    GradingPage.prototype.handleFilterAfterInBulk = function () {
        var _this = this;
        this.logger.trace('!!!!!!!!!!!!!!!!!!', this.bulk_record_arr, this.view_model);
        var conf = this.data_set['btnConf'];
        var temp_arr = [];
        var temp_qty = {};
        var _loop_1 = function (key) {
            if (key) {
                this_1.view_model.grades.forEach(function (grd) {
                    if (grd.name === key) {
                        temp_qty[grd.name] = _this.view_model.grade_qtys[grd.name];
                    }
                });
            }
        };
        var this_1 = this;
        // this.logger.debug('GRD',this.view_model.grade_qtys);
        // replace quantities only for available grades
        for (var key in this.view_model.grade_qtys) {
            _loop_1(key);
        }
        // this.logger.debug('GRD',this.view_model.count);
        // let temp_count = this.view_model.count - this.count;
        this.view_model.grade_qtys = temp_qty;
        // this.logger.debug('GRD',this.view_model.grade_qtys);
        this.count = 0;
        var tmp = this.sharedDataService.getDataSharedDataService(conf.id);
        this.view_model.grades.forEach(function (grd) {
            var nm = grd.name;
            if (_this.view_model.grade_qtys[nm]) {
                _this.count += _this.view_model.grade_qtys[nm];
                _this.bulk_record_arr.forEach(function (bl_grd) {
                    if (bl_grd.recent_grade === nm) {
                        temp_arr.push(bl_grd);
                    }
                });
            }
        });
        // this.logger.debug('GRD',temp_arr);
        // this.logger.debug('GRD tmp.count',tmp.count);
        // this.logger.debug('GRD this.count',this.count);
        this.slides.slideTo(0, 400);
        if (temp_arr.length > 0) {
            var lst = temp_arr[temp_arr.length - 1];
            this.view_model.value = lst.value;
            temp_arr.pop();
            temp_arr.push(Object.assign({}, new __WEBPACK_IMPORTED_MODULE_8__models_btnModel__["c" /* GradingModel */](this.view_model)));
        }
        this.view_model.count = tmp.count + this.count; // restore total count
        // this.logger.debug('GRD  this.view_model.count', this.view_model.count);
        // this.view_model.count = temp_count;
        this.bulk_record_arr = [];
        this.bulk_record_arr = temp_arr.slice(0);
        // update updated model in shared place
        this.sharedDataService.UpdateSharedDataServiceOnly(conf.id, tmp);
        // TODO: to save in appcache
        this.sharedDataService.count_updates.next('related-count-update');
    };
    /*
     generate ID & rounds
     */
    GradingPage.prototype.generateIdRound = function (clPreData) {
        this.logger.trace('/////////////////////////// id /////////// round ///////////////////', clPreData);
        try {
            if (Object(__WEBPACK_IMPORTED_MODULE_7_util__["isUndefined"])(clPreData['id'])) {
                var _id = new Date() + '_' + this.data_set['btnConf']['id'] + '_' + Math.random();
                this.view_model['id'] = _id;
                this.logger.trace('model _id -->', _id);
            }
            else {
                this.logger.trace('pre data set ====>>', this.view_model['id']);
            }
            if (clPreData['rounds'] === null) {
                this.data_set['model']['rounds'] = 0;
                this.logger.trace('model _id -->', this.data_set['model']['rounds']);
            }
            else {
                this.data_set['model']['rounds'] = clPreData.rounds + 1;
                this.logger.trace('pre data set ====>>', this.data_set['model']);
            }
        }
        catch (e) {
            this.logger.error(e);
        }
    };
    /*
    alert for empty masterdata mapping
     */
    GradingPage.prototype.mappingIncomplete = function () {
        var mapping = this.alertCtrl.create({
            title: 'Please chek mapping',
            subTitle: 'There is not mapping list for selected style'
        });
        mapping.present();
    };
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])(__WEBPACK_IMPORTED_MODULE_2__components_keypad_ion_digit_keyboard_cmp__["a" /* IonDigitKeyboardCmp */]),
        __metadata("design:type", Object)
    ], GradingPage.prototype, "keyboard", void 0);
    __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["t" /* Slides */]),
        __metadata("design:type", __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["t" /* Slides */])
    ], GradingPage.prototype, "slides", void 0);
    GradingPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* IonicPage */])(),
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({ selector: 'grading-count', template: __WEBPACK_IMPORTED_MODULE_5__grading_template__["a" /* GRADING_TEMPLATE_HTML */] }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_3__ionic_native_text_to_speech__["a" /* TextToSpeech */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["w" /* ToastController */], __WEBPACK_IMPORTED_MODULE_4_ngx_logger__["b" /* NGXLogger */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["p" /* NavParams */], __WEBPACK_IMPORTED_MODULE_6__ncinga_sp_nsp_app_core_dist_providers_navigation_manager__["a" /* NavigationManager */],
            __WEBPACK_IMPORTED_MODULE_9__providers_shared_data_service_shared_data_service__["a" /* SharedDataProvider */], __WEBPACK_IMPORTED_MODULE_10__ncinga_sp_nsp_reader_dist_providers_scanner_listener__["a" /* ScannerListenerProvider */],
            __WEBPACK_IMPORTED_MODULE_11__providers_activity_log_activity_log__["a" /* ActivityLogProvider */], __WEBPACK_IMPORTED_MODULE_14__ncinga_sp_nsp_app_core_dist__["h" /* CacheService */], __WEBPACK_IMPORTED_MODULE_18__providers_masterdata_service_masterdata_service__["a" /* AppMasterDataCntrl */],
            __WEBPACK_IMPORTED_MODULE_15__providers_ccenv_provider__["a" /* CCEnvProvider */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* AlertController */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["m" /* ModalController */],
            __WEBPACK_IMPORTED_MODULE_17__ncinga_sp_nsp_app_core_dist_providers_business_context__["a" /* BusinessContext */], __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["o" /* NavController */]])
    ], GradingPage);
    return GradingPage;
}());

//# sourceMappingURL=grading.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GRADING_TEMPLATE_HTML; });
/**
 * Created by dilshan on 5/3/18.
 */
var GRADING_TEMPLATE_HTML = "\n<ion-header>\n      <common-main-header [title]=\"this_view_conf?.title\" [tools]=\"tools\" [header_disabled]=\"this_view_conf?.subject_disable\">\n      </common-main-header>\n</ion-header>\n<ion-content class=\"offwhite-bg\">\n   <ion-grid no-padding >\n      <ion-row class=\"summary-row\">\n         <ion-col *ngIf=\"this_view_conf?.order_heading\">\n            <core-domain-header [lable]=\"this_view_conf?.lable\"></core-domain-header>\n         </ion-col>\n      </ion-row>\n   </ion-grid>\n   <ion-grid  class=\"main-grid top-margin-content\" no-padding>\n      <ion-row no-padding class=\"grading-body\">\n         <ion-col class=\"bottum-border bdr-rght bdr-top\" col-12 col-lg-3 col-md-3 no-padding>\n            <ion-row no-padding class=\"bottum-border\">\n               <div class=\"category-title r-align-flx\">{{sec_category_name}}</div>\n               <div end class=\"sub-hdr-btn\" no-padding>\n                  <button [disabled]=\"this_view_conf?.advance_view\" class=\"help-category-btn\"\n                  ion-button end icon-right icon-only clear (click)=\"showKeyboard()\">\n                     <ion-icon name=\"add\"></ion-icon>\n                  </button>\n               </div>\n               <ion-col *ngIf=\"false\" end class=\"sub-hdr-btn-rght\" no-padding>\n                  <button class=\"help-category-btn\" ion-button end (click)=\"addGrading()\" icon-right icon-only clear>\n                     <ion-icon name=\"md-settings\"></ion-icon>\n                  </button>\n               </ion-col>\n            </ion-row>\n            <ion-row no-padding *ngIf=\"quantityOptions.length>0\" class=\"header-btn itm-slect\">\n                  <button [disabled]=\"arrow_disabled\" class=\"header-button btn-count-type\" ion-button\n                    icon-left clear (click)=\"previousLable()\">\n                     <ion-icon name=\"md-arrow-dropleft\"></ion-icon>\n                  </button>\n                  <button class=\"header-button btn-count-type label-btn r-align-flx\" ion-button clear>\n                     <ion-icon [name]=\"_selectedItemType.icon\"></ion-icon>\n                     {{view_model?.recent_grade_type}}\n                  </button>\n                  <button [disabled]=\"arrow_disabled\" class=\"header-button btn-count-type\" ion-button\n                    clear (click)=\"nextLable()\">\n                     <ion-icon name=\"md-arrow-dropright\"></ion-icon>\n                  </button>\n            </ion-row>\n            <ion-row class=\"slider-style\" >\n               <ion-slides pager (ionSlideDidChange)=\"slideChanged()\" >\n                  <ion-slide *ngFor=\"let qty of quantityOptions\">\n                     <button class=\"second-category-btn slide-btn btn-count-type count-btn\"\n                     (click)=\"selectCatTwo(qty)\" [ngClass]=\"qty.color\">{{qty.name}}</button>\n                  </ion-slide>\n               </ion-slides>\n            </ion-row>\n            <ion-row class=\"footer-btn\">\n               <ion-col col-6>\n                  <button ion-button [disabled]=\"this_view_conf?.advance_view\"\n                     class=\"help-category-btn red-btn\" block (click)=\"changeCustomQuantity('-')\">-1\n                  </button>\n               </ion-col>\n               <ion-col col-6>\n                  <button ion-button [disabled]=\"this_view_conf?.advance_view\"\n                     class=\"help-category-btn green-btn\" block (click)=\"changeCustomQuantity('+')\">\n                  +1\n                  </button>\n               </ion-col>\n            </ion-row>\n            <ion-digit-keyboard\n            [align]=\"keyboardSettings.align\"\n            [width]=\"keyboardSettings.width\"\n            [visible]=\"keyboardSettings.visible\"\n            [leftActionOptions]=\"keyboardSettings.leftActionOptions\"\n            [rightActionOptions]=\"keyboardSettings.rightActionOptions\"\n            [roundButtons]=\"keyboardSettings.roundButtons\"\n            [showLetters]=\"keyboardSettings.showLetters\"\n            [swipeToHide]=\"keyboardSettings.swipeToHide\"\n            [theme]=\"keyboardSettings.theme\"\n            (numberClick)=\"numberClick($event)\"\n            (leftActionClick)=\"numberBackSpace()\"\n            (rightActionClick)=\"hideKeyboard('done')\">\n            <ion-toolbar no-border-bottom>\n               <ion-title class=\"cutom_number\">{{anyNumber}}</ion-title>\n               <ion-buttons start>\n                  <button ion-button (click)=\"hideKeyboard('cancel')\">Cancel</button>\n               </ion-buttons>\n            </ion-toolbar>\n            </ion-digit-keyboard>\n         </ion-col>\n         <ion-col class=\"bottum-border spret-bdr bdr-top\" col-12 col-lg-9 col-md-9>\n            <ion-row no-padding class=\"bottum-border left-border itm-h-align\">\n            <div class=\"r-align-flx\">\n            <!-- Button Label -->\n            <div class=\"category-title\">\n                  <div>{{first_category_name}}</div>\n               </div>\n            </div>\n            <div>\n               <div class=\"sub-hdr-btn-lable counting-btn-lable\" no-padding>\n                  <span class=\"btn-type-lbl\">{{this_view_conf?.label}}</span>\n               </div>\n            </div>\n            <div>\n               <!-- Button Label -->\n               <div *ngIf=\"!this_view_conf?.bulk_record\" class=\"sub-hdr-btn-lable counting-btn-lable\" no-padding>\n                  <span>{{view_model?.count}}</span>\n               </div>\n               <div *ngIf=\"this_view_conf?.bulk_record\" class=\"sub-hdr-btn-lable counting-btn-lable\" no-padding>\n                  <span class=\"counting-btn-lable\" >{{count}}</span>\n               </div>\n            </div>\n\n               <div *ngIf=\"!this_view_conf?.undo_hide\" class=\"left-border sub-hdr-btn\" no-padding>\n                  <button block [disabled]=\"undo_disabled\" class=\"help-category-btn\"\n                  (click)=\"undoCounting()\" ion-button  icon-only >\n                     <ion-icon name=\"md-undo\" clear></ion-icon>\n                  </button>\n               </div>\n\n               <div  *ngIf=\"this_view_conf?.scanner\" color=\"c3\" class=\"left-border sub-hdr-btn\" no-padding>\n                  <button block class=\"help-category-btn\" (click)=\"openCamera()\" ion-button  icon-only>\n                     <ion-icon name=\"md-barcode\" clear></ion-icon>\n                  </button>\n               </div>\n\n               <div  *ngIf=\"this_view_conf?.setting_option\" color=\"c2\" class=\"left-border sub-hdr-btn-rght\" no-padding>\n                  <button block class=\"help-category-btn\" ion-button (click)=\"addGrading()\" icon-only>\n                     <ion-icon name=\"md-settings\"></ion-icon>\n                  </button>\n               </div>\n            </ion-row>\n            <ion-row *ngIf=\"!loading_msg && view_model\" class=\"left-border hght-calc grd-size-list\">\n               <ion-col col-6 col-lg-3 col-md-3 *ngFor=\"let option of grade_data_set; index as i\">\n                  <button [disabled]=\"view_disabled_btn_upper\" ion-button [outline]=\"lastOptionIdx != i \"\n                  class=\"first-category-btn blue-btn\" (click)=\"selectCatOne(option,i)\">\n                  <ion-badge [ngClass]=\"{'active-badge':i==lastIndex}\">{{view_model.grade_qtys[option.name]}}</ion-badge>\n                  {{option.name}}\n                  </button>\n                  </ion-col>\n            </ion-row>\n            <ion-row *ngIf=\"loading_msg\" no-padding class=\"data-loader-msg\">\n            {{first_category_name}} Loading <span class=\"d\">.</span><span class=\"d d-2\">.</span><span class=\"d d-3\">.</span>\n            <span class=\"d d-4\">.</span><span class=\"d d-5\">.</span>\n            </ion-row>\n         </ion-col>\n      </ion-row>\n   </ion-grid>\n</ion-content>\n<ion-footer  no-padding>\n   <ion-navbar  no-padding>\n      <ion-grid  no-padding>\n         <ion-row justify-content-end class=\"right-pdn\">\n            <ion-col *ngFor=\"let button of currentPagebuttons \" col-5 col-lg-2 col-md-3 class=\"right-pdn\">\n               <button block [ngClass]=\"button.button_type\" color=\"c22\" [disabled]=\"btn_click_view_disabled\"\n               ion-button [hidden]=\"!button.display\"\n               (tap)=\"navigationClick(button.button_type)\" class=\"page-button help-category-btn right-pdn\">\n               {{button.button_name}}\n               </button>\n            </ion-col>\n         </ion-row>\n      </ion-grid>\n   </ion-navbar>\n</ion-footer>\n\n";
//# sourceMappingURL=grading-template.js.map

/***/ }),

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

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ContextCompareUtil; });
var ContextCompareUtil = /** @class */ (function () {
    function ContextCompareUtil() {
    }
    ContextCompareUtil.contextMatch = function (source, target) {
        // TO DO//
        return true;
    };
    return ContextCompareUtil;
}());

//# sourceMappingURL=ContextCompareUtil.js.map

/***/ })

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