PageSourceSearch

https://jaisteel.in/assets/custom/js/assets/validation.js

js jaisteel.in collected 2026-09-24 15:02:27 UTC 60,228 bytes, 1,099 lines download raw bytes

1(function (w, d) {
2    var u = null;
3    w.__FILE__ = (function () {
4        try {
5            u();
6        } catch (err) {
7            if (err.stack) {
8                u = (/(http[s]?:\/\/.*):\d+:\d+/m).exec(err.stack);
9                if (u && u.length > 1) {
10                    return u[1];
11                }
12            }
13            u = (d.scripts.length > 0) ? d.scripts[d.scripts.length - 1].src : "";
14            if (u.length > 0 && u.indexOf("://") < 0 && u.substring(0, 1) != "/") {
15                u = location.protocol + "//" + location.host + "/" + u;
16            }
17            return u;
18        }
19    })();
20    w.__DIR__ = (function (f) {
21        f = (/^(.*\/)[a-z0-9 -_]+\.[a-z]+$/i).exec(f);
22        return (f && f.length > 1) ? f[1] : "";
23    })(w.__FILE__);
24})(window, document);
25Date.prototype.addYears = function (years) {
26    var date = new Date(this.valueOf());
27    date.setFullYear(parseInt(date.getFullYear()) + years);
28    return date;
29}
30Date.prototype.addMonths = function (months) {
31    var date = new Date(this.valueOf());
32    date.setMonth(parseInt(date.getMonth()) + months);
33    return date;
34}
35Date.prototype.addDays = function (days) {
36    var date = new Date(this.valueOf());
37    date.setDate(parseInt(date.getDate()) + days);
38    return date;
39}
40Date.prototype.addHours = function (hours) {
41    var date = new Date(this.valueOf());
42    date.setHours(parseInt(date.getHours()) + hours);
43    return date;
44}
45Date.prototype.addMinutes = function (minutes) {
46    var date = new Date(this.valueOf());
47    date.setMinutes(parseInt(date.getMinutes()) + minutes);
48    return date;
49}
50Date.prototype.addSeconds = function (seconds) {
51    var date = new Date(this.valueOf());
52    date.setSeconds(parseInt(date.getSeconds()) + seconds);
53    return date;
54}
55
56function jsUCfirst(string) {
57    return string.charAt(0).toUpperCase() + string.slice(1);
58}
59function json2csv(JSONData, ReportTitle) {
60    var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData;
61    var CSV = '';
62    for (var i = 0; i < arrData.length; i++) {
63        var row = "";
64        for (var index in arrData[i]) {
65            row += '"' + arrData[i][index] + '",';
66        }
67        row.slice(0, row.length - 1);
68        CSV += row + '\r\n';
69    }
70    if (CSV == '') {
71        iziToast.error({//show,error,success,info
72            title: 'Error',
73            message: 'Invalid data',
74            position: 'topCenter' // bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, center
75        });
76        return;
77    }
78    var link = document.createElement("a");
79    link.id = "lnkDwnldLnk";
80    document.body.appendChild(link);
81    var csv = CSV;
82    blob = new Blob([csv], {type: 'text/csv'});
83    var csvUrl = window.webkitURL ? window.webkitURL.createObjectURL(blob) : window.URL.createObjectURL(blob);
84    var filename = ReportTitle + '.csv';
85    $("#lnkDwnldLnk")
86            .attr({
87                'download': filename,
88                'href': csvUrl
89            });
90    $('#lnkDwnldLnk')[0].click();
91    document.body.removeChild(link);
92}
93angular.module("validation", [])
94        .factory("$custom", function ($http, $q) {
95            var $custom = {};
96            $custom.getAge = function (dob) {
97                var age = new Date().getFullYear() - dob.getFullYear();
98                var m = new Date().getMonth() - dob.getMonth();
99                if (m < 0 || (m === 0 && new Date().getDate() < dob.getDate())) {
100                    age = age - 1;
101                }
102                return age;
103            };
104            $custom.formatDate = function (date, UTC) {
105                var dd = date.getDate();
106                dd = dd < 10 ? '0' + dd : dd;
107                var mm = parseInt(date.getMonth()) + 1;
108                mm = mm < 10 ? '0' + mm : mm;
109                return UTC ? date.getFullYear() + '-' + mm + '-' + dd : dd + '/' + mm + '/' + date.getFullYear();
110            };
111            $custom.dateObj = function (date) {
112                date = date.split('/');
113                return new Date(date[2], parseInt(date[1]) - 1, parseInt(date[0]));
114            };
115            $custom.getMonth = function (date) {
116                var month = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
117                var mm = date.getMonth();
118                var yy = date.getFullYear();
119                return {
120                    mm: mm,
121                    month: month[mm],
122                    year: yy,
123                    fullText: month[mm] + ' ' + yy,
124                    date: date
125                };
126            };
127            $custom.date=function(date){
128                date=new Date(date);
129                var mon=['Jan','Feb', 'Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
130                var month=['January','February', 'March','April','May','June','July','August','September','October','November','December'];
131                var shortDay=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
132                var fullDay=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
133                var dd=date.getDate();
134                var fulldd=dd<10?'0'+dd:dd;
135                var mm=date.getMonth();
136                var fullmm=(parseInt(mm)+1)<10?'0'+(parseInt(mm)+1):(parseInt(mm)+1);
137                var hr=date.getHours();
138                var fullhr=hr<10?'0'+hr:hr;
139                var min=date.getMinutes();
140                var fullmin=min<10?'0'+min:min;
141                var ss=date.getSeconds();
142                var fullss=ss<10?'0'+ss:ss;
143                var mil=date.getMilliseconds();
144                var yyyy=date.getFullYear();
145                var day=date.getDay();
146                var yearstamp=new Date(yyyy,0);
147                var monthstamp=new Date(yyyy,mm);
148                var datestamp=new Date(yyyy,mm,dd);
149                var month_last_date=monthstamp.addMonths(1).addDays(-1).getDate();
150                var fullbint=month_last_date<10?'0'+month_last_date:month_last_date;
151                return {
152                    date:dd,
153                    numMonth:mm,
154                    hour:hr,
155                    minute:min,
156                    second:ss,
157                    millisecond:mil,
158                    weekday:day,
159                    monthLastDate:month_last_date,
160                    dd:fulldd,
161                    mm:fullmm,
162                    mon:mon[mm],
163                    month:month[mm],
164                    year:yyyy,
165                    hr:fullhr,
166                    min:fullmin,
167                    ss:fullss,
168                    yearstamp:yearstamp.getTime(),
169                    monthstamp:monthstamp.getTime(),
170                    datestamp:datestamp.getTime(),
171                    timestamp:date.getTime(),
172                    shortDay:shortDay[day],
173                    day:fullDay[day],
174                    now:date,
175                    t:fullbint,
176                    format:function(format){
177                        return format.replace('ddd',dd).replace('mmm',parseInt(mm)+1).replace('hhh',hr).replace('iii',min).replace('sss',ss).replace('ttt',fullbint).replace('dd',fulldd).replace('fullday',fullDay[day].toLowerCase()).replace('Fullday',fullDay[day]).replace('FULLDAY',fullDay[day].toUpperCase()).replace('day',shortDay[day].toLowerCase()).replace('Day',shortDay[day]).replace('DAY',shortDay[day].toUpperCase()).replace('mm',fullmm).replace('month',month[mm].toLowerCase()).replace('Month',month[mm]).replace('MONTH',month[mm].toUpperCase()).replace('mon',mon[mm].toLowerCase()).replace('Mon',mon[mm]).replace('MON',mon[mm].toUpperCase()).replace('yyyy',yyyy).replace('yy',yyyy.toString().substr(2,2)).replace('hh',fullhr).replace('ii',fullmin).replace('ss',fullss).replace('milli',mil);
178                    }
179                };
180            };
181            $custom.download = function (data, title, header) {
182                var print_data = [];
183                var header_defined = false;
184                angular.forEach(data, function (v, k) {
185                    var row = [];
186                    if (header && !header_defined) {
187                        for (x in header) {
188                            if (typeof v[x] != 'undefined') {
189                                row[x] = header[x];
190                            } else if (typeof v[header[x]] != 'undefined') {
191                                row.push(header[x]);
192                            }
193                        }
194                        print_data.push(row);
195                        row = [];
196                        header_defined = true;
197                    }
198                    if (header) {
199                        for (x in header) {
200                            if (typeof v[x] != 'undefined') {
201                                row[x] = v[x];
202                            } else if (typeof v[header[x]] != 'undefined') {
203                                row.push(v[header[x]]);
204                            }
205                        }
206                    } else {
207                        angular.forEach(v, function (val, k) {
208                            row.push(val);
209                        });
210                    }
211                    print_data.push(row);
212                });
213                json2csv(print_data, title + new Date().toString() + '.csv');
214            };
215            $custom.download1 = function (data, title, header,arrr) {
216                var print_data = [];
217                var header_defined = false;
218                angular.forEach(data, function (v, k) {
219                    var row = [];
220                    if (header && !header_defined) {
221                        for (x in header) {
222                            if (typeof v[x] != 'undefined') {
223                                row[x] = header[x];
224                            } else if (typeof v[header[x]] != 'undefined') {
225                                row.push(header[x]);
226                            }
227                        }
228                        print_data.push(row);
229                        row = [];
230                        header_defined = true;
231                    }
232                    if (header) {
233                        for (x in header) {
234                            if (typeof v[x] != 'undefined') {
235                                if(x == 'boarding_form' || x == 'boarding_to'){
236                                    row[x] = arrr[v[x]];    
237                                }
238                                else
239                                {
240                                    row[x] = v[x];
241                                }
242                                if(row[x] == null){
243                                    row[x] = 0;
244                                }
245                            } else if (typeof v[header[x]] != 'undefined') {
246                                row.push(v[header[x]]);
247                            }
248                        }
249                    } else {
250                        angular.forEach(v, function (val, k) {
251                            row.push(val);
252                        });
253                    }
254                    print_data.push(row);
255                });
256                json2csv(print_data, title + new Date().toString() + '.csv');
257            };
258            $custom.download2 = function (data, title, header,arrr) {
259                var print_data = [];
260                var header_defined = false;
261                angular.forEach(data, function (v, k) {
262                    var row = [];
263                    if (header && !header_defined) {
264                        for (x in header) {
265                            if (typeof v[x] != 'undefined') {
266                                row[x] = header[x];
267                            } else if (typeof v[header[x]] != 'undefined') {
268                                row.push(header[x]);
269                            }
270                        }
271                        print_data.push(row);
272                        row = [];
273                        header_defined = true;
274                    }
275                    if (header) {
276                        for (x in header) {
277                            if (typeof v[x] != 'undefined') {
278                                if(x == 'boarding_form' || x == 'boarding_to'){
279                                    row[x] = v[x];    
280                                }
281                                else if(x == 'parent_id'){
282                                    row[x] = arrr[v[x]];    
283                                }
284                                else
285                                {
286                                    row[x] = v[x];
287                                }
288                                if(row[x] == null){
289                                    row[x] = 0;
290                                }
291                            } else if (typeof v[header[x]] != 'undefined') {
292                                row.push(v[header[x]]);
293                            }
294                        }
295                    } else {
296                        angular.forEach(v, function (val, k) {
297                            row.push(val);
298                        });
299                    }
300                    print_data.push(row);
301                });
302                json2csv(print_data, title + new Date().toString() + '.csv');
303            };
304            $custom.Rs = function (amount) {
305                var words = new Array();
306                words[0] = 'Zero';
307                words[1] = 'One';
308                words[2] = 'Two';
309                words[3] = 'Three';
310                words[4] = 'Four';
311                words[5] = 'Five';
312                words[6] = 'Six';
313                words[7] = 'Seven';
314                words[8] = 'Eight';
315                words[9] = 'Nine';
316                words[10] = 'Ten';
317                words[11] = 'Eleven';
318                words[12] = 'Twelve';
319                words[13] = 'Thirteen';
320                words[14] = 'Fourteen';
321                words[15] = 'Fifteen';
322                words[16] = 'Sixteen';
323                words[17] = 'Seventeen';
324                words[18] = 'Eighteen';
325                words[19] = 'Nineteen';
326                words[20] = 'Twenty';
327                words[30] = 'Thirty';
328                words[40] = 'Forty';
329                words[50] = 'Fifty';
330                words[60] = 'Sixty';
331                words[70] = 'Seventy';
332                words[80] = 'Eighty';
333                words[90] = 'Ninety';
334                var op;
335                amount = amount.toString();
336                var atemp = amount.split(".");
337                var number = atemp[0].split(",").join("");
338                var n_length = number.length;
339                var words_string = "";
340                if (n_length <= 9) {
341                    var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0);
342                    var received_n_array = new Array();
343                    for (var i = 0; i < n_length; i++) {
344                        received_n_array[i] = number.substr(i, 1);
345                    }
346                    for (var i = 9 - n_length, j = 0; i < 9; i++, j++) {
347                        n_array[i] = received_n_array[j];
348                    }
349                    for (var i = 0, j = 1; i < 9; i++, j++) {
350                        if (i == 0 || i == 2 || i == 4 || i == 7) {
351                            if (n_array[i] == 1) {
352                                n_array[j] = 10 + parseInt(n_array[j]);
353                                n_array[i] = 0;
354                            }
355                        }
356                    }
357                    value = "";
358                    for (var i = 0; i < 9; i++) {
359                        if (i == 0 || i == 2 || i == 4 || i == 7) {
360                            value = n_array[i] * 10;
361                        } else {
362                            value = n_array[i];
363                        }
364                        if (value != 0) {
365                            words_string += words[value] + " ";
366                        }
367                        if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) {
368                            words_string += "Crores ";
369                        }
370                        if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) {
371                            words_string += "Lakhs ";
372                        }
373                        if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) {
374                            words_string += "Thousand ";
375                        }
376                        if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) {
377                            words_string += "Hundred and ";
378                        } else if (i == 6 && value != 0) {
379                            words_string += "Hundred ";
380                        }
381                    }
382                    words_string = words_string.split(" ").join(" ");
383                }
384                return words_string;
385            };
386            $custom.RsPaise = function (n) {
387                nums = n.toString().split('.')
388                var whole = $custom.Rs(nums[0])
389                if (nums[1] == null)
390                    nums[1] = 0;
391                if (nums[1].length == 1)
392                    nums[1] = nums[1] + '0';
393                if (nums[1].length > 2) {
394                    nums[1] = nums[1].substring(2, length - 1)
395                }
396                if (nums.length == 2) {
397                    if (nums[0] <= 9) {
398                        nums[0] = nums[0] * 10
399                    } else {
400                        nums[0] = nums[0]
401                    }
402                    ;
403                    var fraction = $custom.Rs(nums[1])
404                    if (whole == '' && fraction == '') {
405                        op = 'Zero only';
406                    }
407                    if (whole == '' && fraction != '') {
408                        op = 'paise ' + fraction + ' only';
409                    }
410                    if (whole != '' && fraction == '') {
411                        op = 'Rupees ' + whole + ' only';
412                    }
413                    if (whole != '' && fraction != '') {
414                        op = 'Rupees ' + whole + 'and paise ' + fraction + ' only';
415                    }
416                    amt = n;
417                    if (amt > 999999999.99) {
418                        op = 'Oops!!! The amount is too big to convert';
419                    }
420                    if (isNaN(amt) == true) {
421                        op = 'Error : Amount in number appears to be incorrect. Please Check.';
422                    }
423                    return op;
424                }
425            };
426            $custom.post = function (url, data) {
427                var canceller = $q.defer();
428                var cancel = function (reason) {
429                    canceller.resolve(reason);
430                };
431                var promise = $http({
432                    method: "POST",
433                    url: url,
434                    data: 'data=' + data,
435                    timeout: canceller.promise,
436                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
437                }).then(function (res) {
438                    return res;
439                });
440                return {
441                    promise: promise,
442                    cancel: cancel
443                }
444            };
445            return $custom;
446        }).directive('validation', function () {
447    return {
448        restrict: 'AC',
449        scope: {
450            val: '=ngModel',
451            required: '=ngRequired',
452            assignValue: '=',
453            assignCond: '=',
454            onChange: '=',
455            changeVar: '=',
456            onValidate: '=',
457            validateVar: '=',
458            dateAge: '=',
459            isMinor: '=',
460            maxDate: '=',
461            minDate: '=',
462            maxValue: '=',
463            minValue: '=',
464            validationMessage: '=',
465            minLength: '=',
466            maxLength: '=',
467            camelCase: '=',
468            myMaxValue: '=',
469        },
470        link: function (scope, element, attrs) {
471            scope.$watch('val', function (newVal, oldVal) {
472                var required = typeof scope.required == 'undefined' ? element.prop('required') : scope.required;
473                if (newVal) {
474                    var valid = true;
475                    var message = '';
476                    if (element.attr('validation')) {
477                        if (/^[a-z0-9\_\-\.]+/.test(element.attr('validation'))) {
478                            if (element.attr('validation') == 'number') {
479                                if (!/^[\-]?[0-9]*$/.test(scope.val)) {
480                                    scope.val = oldVal;
481                                }
482                                scope.val = parseFloat(scope.val);
483                            }
484                            if (element.attr('validation') == 'integer') {
485                                if (!/^[\-]?[1-9][0-9]*$/.test(scope.val)) {
486                                    scope.val = oldVal;
487                                    scope.val = parseInt(scope.val);
488                                }
489                            }
490                            if (element.attr('validation') == 'float') {
491                                if (!/^[\-]?[1-9][0-9]*(\.)?[0-9]*$/.test(scope.val)) {
492                                    scope.val = oldVal;
493                                }
494//                                scope.val = parseFloat(scope.val);
495                                valid = /^[\-]?[1-9][0-9]*(\.[0-9]+)?$/.test(scope.val);
496                                if (!valid) {
497                                    message = 'Invalid Validation type Float';
498                                }
499                            }
500                            if (element.attr('validation') == 'numeric') {
501                                if (!/^[\-]?[0-9]*(\.)?[0-9]*$/.test(scope.val)) {
502                                    scope.val = oldVal;
503                                }
504//                                scope.val = parseFloat(scope.val);
505                                valid = /^[\-]?[0-9]*(\.[0-9]+)?$/.test(scope.val);
506                                if (!valid) {
507                                    message = 'Invalid Validation type Numeric';
508                                }
509                            }
510                            if (element.attr('validation') == 'alphabet') {
511                                if (!/^[a-z]*$/i.test(scope.val)) {
512                                    scope.val = oldVal;
513                                }
514                                if(typeof scope.camelCase=='boolean' && scope.camelCase){
515                                    var val=scope.val.split(' ');
516                                    angular.forEach(val,function(v,k){
517                                        val[k]=jsUCfirst(v);
518                                    });
519                                    scope.val=val.join(' ');
520                                }
521                            }
522                            if (element.attr('validation') == 'alpha-space') {
523                                if (!/^[a-z][a-z \s]*$/i.test(scope.val)) {
524                                    scope.val = oldVal;
525                                }
526                                if(typeof scope.camelCase=='boolean' && scope.camelCase){
527                                    var val=scope.val.split(' ');
528                                    angular.forEach(val,function(v,k){
529                                        val[k]=jsUCfirst(v);
530                                    });
531                                    scope.val=val.join(' ');
532                                }
533                            }
534                            if (element.attr('validation') == 'alpha-numeric') {
535                                if (!/^[a-z0-9]*$/i.test(scope.val)) {
536                                    scope.val = oldVal;
537                                }
538                                if(typeof scope.camelCase=='boolean' && scope.camelCase){
539                                    var val=scope.val.split(' ');
540                                    angular.forEach(val,function(v,k){
541                                        val[k]=jsUCfirst(v);
542                                    });
543                                    scope.val=val.join(' ');
544                                }
545                            }
546                            if (element.attr('validation') == 'alpha-numeric-space') {
547                                if (!/^[a-z0-9][a-z0-9 \s]*$/i.test(scope.val)) {
548                                    scope.val = oldVal;
549                                }
550                                if(typeof scope.camelCase=='boolean' && scope.camelCase){
551                                    var val=scope.val.split(' ');
552                                    angular.forEach(val,function(v,k){
553                                        val[k]=jsUCfirst(v);
554                                    });
555                                    scope.val=val.join(' ');
556                                }
557                            }
558                            if (element.attr('validation') == 'pincode') {
559                                if (!/^[1-9][0-9]{0,5}$/.test(scope.val)) {
560                                    scope.val = oldVal;
561                                }
562                                if (typeof scope.val != 'undefined' && scope.val.length < 6) {
563                                    valid = false;
564                                    message = 'Invalid PIN Code';
565                                }
566                            }
567                            if (element.attr('validation') == 'mobile') {
568                                if (!/^[6-9][0-9]{0,9}$/.test(scope.val)) {
569                                    scope.val = oldVal;
570                                }
571                                if (typeof scope.val != 'undefined' && scope.val.length < 10) {
572                                    valid = false;
573                                    message = 'Invalid Mobile No.';
574                                }
575                            }
576                            if (element.attr('validation') == 'email') {
577                                if (!/(^[a-z0-9]+$)|(^[a-z0-9]+[\_\.\-]$)|(^[a-z0-9]+([\_\.\-][a-z0-9]+)*$)|(^[a-z0-9]+([\_\.\-][a-z0-9]+)*@$)|(^[a-z0-9]+([\_\.\-][a-z0-9]+)*@[a-z0-9]+$)|(^[a-z0-9]+([\_\.\-][a-z0-9]+)*@[a-z0-9]+[\_\.\-]$)|(^[a-z0-9]+([\_\.\-][a-z0-9]+)*@[a-z0-9]+([\_\.\-][a-z0-9]+)*$)|(^[a-z0-9]+([\_\.\-][a-z0-9]+)*@[a-z0-9]+([\_\.\-][a-z0-9]+)*\.$)|(^[a-z0-9]+([\_\.\-][a-z0-9]+)*@[a-z0-9]+([\_\.\-][a-z0-9]+)*\.[a-z0-9]+$)|(^[a-z0-9]+([\_\.\-][a-z0-9]+)*@[a-z0-9]+([\_\.\-][a-z0-9]+)*\.[a-z0-9]+[\_\.\-]$)|(^[a-z0-9]+([\_\.\-][a-z0-9]+)*@[a-z0-9]+([\_\.\-][a-z0-9]+)*\.[a-z0-9]+([\_\.\-][a-z0-9]+)*$)/i.test(scope.val)) {
578                                    scope.val = oldVal;
579                                }
580                                valid = /^[a-z0-9]+([\_\.\-][a-z0-9]+)*@[a-z0-9]+([\_\.\-][a-z0-9]+)*\.[a-z0-9]+([\_\.\-][a-z0-9]+)*$/i.test(scope.val);
581                                if (!valid) {
582                                    message = 'Invalid Email No.';
583                                }
584                            }
585                            if (element.attr('validation') == 'pan') {
586                                if ((newVal.length <= 3 && !/^[a-z]+$/i.test(newVal)) || (newVal.length > 3 && newVal.length <= 5 && !/^[a-z]{3}[pfbhalcjgrt][a-z]?$/i.test(newVal)) || (newVal.length > 5 && newVal.length <= 9 && !/^[a-z]{3}[pfbhalcjgrt][a-z][0-9]{0,4}$/i.test(newVal)) || (newVal.length == 10 && !/^[a-z]{3}[pfbhalcjgrt][a-z][0-9]{4}[a-z]$/i.test(newVal)) || newVal.length > 10) {
587                                    scope.val = oldVal;
588                                }
589                                valid = typeof scope.val != 'undefined' && scope.val.length == 10;
590                                if (!valid) {
591                                    message = 'Invalid PAN No.';
592                                }
593                            }
594                            if (element.attr('validation') == 'gst') {
595                                var gst = [];
596                                if (newVal.length > 0 && newVal.length <= 2) {
597                                    if (!/(^0[1-9]?$)|(^[12][0-9]?$)|(^3[1-7]?$)/.test(newVal)) {
598                                        scope.val = oldVal;
599                                    }
600                                } else {
601                                    gst.push(parseInt(newVal.substring(0, 2)));
602                                    if (!/(^0[1-9]?$)|(^[12][0-9]?$)|(^3[1-7]?$)/.test(gst[0])) {
603                                        scope.val = oldVal;
604                                    } else {
605                                        gst.push(newVal.substring(2, 12));
606                                        if ((gst[1].length <= 3 && !/^[a-z]+$/i.test(gst[1])) || (gst[1].length > 3 && gst[1].length <= 5 && !/^[a-z]{3}[pfbhalcjgrt][a-z]?$/i.test(gst[1])) || (gst[1].length > 5 && gst[1].length <= 9 && !/^[a-z]{3}[pfbhalcjgrt][a-z][0-9]{0,4}$/i.test(gst[1])) || (gst[1].length == 10 && !/^[a-z]{3}[pfbhalcjgrt][a-z][0-9]{4}[a-z]$/i.test(gst[1])) || gst[1].length > 10) {
607                                            gst.push(parseInt(gst[1].substring(0, 2)));
608                                            var y = parseInt(new Date().getFullYear().toString().substring(2));
609                                            if (isNaN(gst[2]) || (gst[2] < 10 && (gst[2] == 0 || gst[2] > parseInt(y.toString().substring(0, 1)))) || (gst[2] >= 10 && gst[2] < 17) || gst[2] > y) {
610                                                scope.val = oldVal;
611                                            } else {
612                                                if (gst[1].length > 2) {
613                                                    var cc = ['AFG', 'ALA', 'ALB', 'DZA', 'AS
613M', 'AND', 'AGO', 'AIA', 'ATA', 'ATG', 'ARG', 'ARM', 'ABW', 'AUS', 'AUT', 'AZE', 'BHS', 'BHR', 'BGD', 'BRB', 'BLR', 'BEL', 'BLZ', 'BEN', 'BMU', 'BTN', 'BOL', 'BIH', 'BWA', 'BVT', 'BRA', 'VGB', 'IOT', 'BRN', 'BGR', 'BFA', 'BDI', 'KHM', 'CMR', 'CAN', 'CPV', 'CYM', 'CAF', 'TCD', 'CHL', 'CHN', 'HKG', 'MAC', 'CXR', 'CCK', 'COL', 'COM', 'COG', 'COD', 'COK', 'CRI', 'CIV', 'HRV', 'CUB', 'CYP', 'CZE', 'DNK', 'DJI', 'DMA', 'DOM', 'ECU', 'EGY', 'SLV', 'GNQ', 'ERI', 'EST', 'ETH', 'FLK', 'FRO', 'FJI', 'FIN', 'FRA', 'GUF', 'PYF', 'ATF', 'GAB', 'GMB', 'GEO', 'DEU', 'GHA', 'GIB', 'GRC', 'GRL', 'GRD', 'GLP', 'GUM', 'GTM', 'GGY', 'GIN', 'GNB', 'GUY', 'HTI', 'HMD', 'VAT', 'HND', 'HUN', 'ISL', 'IND', 'IDN', 'IRN', 'IRQ', 'IRL', 'IMN', 'ISR', 'ITA', 'JAM', 'JPN', 'JEY', 'JOR', 'KAZ', 'KEN', 'KIR', 'PRK', 'KOR', 'KWT', 'KGZ', 'LAO', 'LVA', 'LBN', 'LSO', 'LBR', 'LBY', 'LIE', 'LTU', 'LUX', 'MKD', 'MDG', 'MWI', 'MYS', 'MDV', 'MLI', 'MLT', 'MHL', 'MTQ', 'MRT', 'MUS', 'MYT', 'MEX', 'FSM', 'MDA', 'MCO', 'MNG', 'MNE', 'MSR', 'MAR', 'MOZ', 'MMR', 'NAM', 'NRU', 'NPL', 'NLD', 'ANT', 'NCL', 'NZL', 'NIC', 'NER', 'NGA', 'NIU', 'NFK', 'MNP', 'NOR', 'OMN', 'PAK', 'PLW', 'PSE', 'PAN', 'PNG', 'PRY', 'PER', 'PHL', 'PCN', 'POL', 'PRT', 'PRI', 'QAT', 'REU', 'ROU', 'RUS', 'RWA', 'BLM', 'SHN', 'KNA', 'LCA', 'MAF', 'SPM', 'VCT', 'WSM', 'SMR', 'STP', 'SAU', 'SEN', 'SRB', 'SYC', 'SLE', 'SGP', 'SVK', 'SVN', 'SLB', 'SOM', 'ZAF', 'SGS', 'SSD', 'ESP', 'LKA', 'SDN', 'SUR', 'SJM', 'SWZ', 'SWE', 'CHE', 'SYR', 'TWN', 'TJK', 'TZA', 'THA', 'TLS', 'TGO', 'TKL', 'TON', 'TTO', 'TUN', 'TUR', 'TKM', 'TCA', 'TUV', 'UGA', 'UKR', 'ARE', 'GBR', 'USA', 'UMI', 'URY', 'UZB', 'VUT', 'VEN', 'VNM', 'VIR', 'WLF', 'ESH', 'YEM', 'ZMB', 'ZWE'];
614                                                    gst.push(gst[1].substring(2, 5));
615                                                    var proceed = true;
616                                                    if (isNaN(parseInt(gst[3]))) {
617                                                        var matched = false;
618                                                        for (x in cc) {
619                                                            eval("var patt=/^" + gst[3] + "/i;");
620                                                            if (patt.test(cc[x])) {
621                                                                matched = true;
622                                                                break;
623                                                            }
624                                                        }
625                                                        if (!matched) {
626                                                            scope.val = oldVal;
627                                                            proceed = false;
628                                                        } else if ((newVal.length > 12 && (!/^[nuo]$/i.test(newVal[12]) || (newVal.length > 13 && (((/^[n]$/i.test(newVal[12]) && !/^[f]$/i.test(newVal[13])) || (/^[uo]$/i.test(newVal[12]) && !/^[n]$/i.test(newVal[13]))) || (newVal.length > 14 && ((/^[n]$/i.test(newVal[12]) && /^[f]$/i.test(newVal[13]) && !/^[t]$/i.test(newVal[14])) || (/^[u]$/i.test(newVal[12]) && /^[n]$/i.test(newVal[13]) && isNaN(newVal[14])) || (/^[o]$/i.test(newVal[12]) && /^[n]$/i.test(newVal[13]) && !/^[p]$/i.test(newVal[14])))))))) || newVal.length > 15) {
629                                                            scope.val = oldVal;
630                                                        }
631                                                    }
632                                                    if (proceed && gst[1].length > 5) {
633                                                        gst.push(parseInt(gst[1].substring(5, 10)));
634                                                        if (isNaN(gst[4]) || (newVal.length > 12 && (!/^[t]$/i.test(newVal[12]) || (newVal.length > 13 && (!/^[rm]$/i.test(newVal[13]) || (newVal.length > 14 && !/^[p]$/i.test(newVal[13]))))))) {
635                                                            scope.val = oldVal;
636                                                        }
637                                                    }
638                                                }
639                                            }
640                                        } else if ((newVal.length > 12 && (!/^[1-9a-z]$/i.test(newVal[12]) || (newVal.length > 13 && (!/^[sz1-9a-j]$/i.test(newVal[13]) || (newVal.length > 14 && isNaN(newVal[14])))))) || newVal.length > 15) {
641                                            scope.val = oldVal;
642                                        }
643                                    }
644                                }
645                                valid = typeof scope.val != 'undefined' && scope.val.length == 15;
646                                if (!valid) {
647                                    message = 'Invalid GSTN';
648                                }
649                            }
650                            if (element.attr('validation') == 'aadhaar') {
651                                if (!/^[2-9][0-9]*$/.test(scope.val) || scope.val.length > 12) {
652                                    scope.val = oldVal;
653                                }
654                                valid = /^[2-9][0-9]{11}$/.test(scope.val);
655                                element.attr('validated', valid);
656                                if (!valid) {
657                                    message = 'Invalid Aadhaar No.';
658                                }
659                            }
660                            if (element.attr('validation') == 'date') {
661                                valid = false;
662                                if (newVal.length == 1 && !/^[0-3]$/.test(newVal)) {
663                                    scope.val = oldVal;
664                                }
665                                if (newVal.length == 2) {
666                                    if (/^([0][1-9])|([12][0-9])|([3][01])$/.test(newVal)) {
667                                        if (newVal.length > oldVal.length) {
668                                            scope.val += '/';
669                                        }
670                                    } else {
671                                        scope.val = oldVal;
672                                    }
673                                }
674                                if (newVal.length == 3 && !/^(([0][1-9])|([12][0-9])|([3][01]))[\/]$/.test(newVal)) {
675                                    scope.val = oldVal;
676                                }
677                                if (newVal.length == 4 && !/^(([0][1-9])|([12][0-9])|([3][01]))[\/][01]$/.test(newVal)) {
678                                    scope.val = oldVal;
679                                }
680                                if (newVal.length == 5) {
681                                    if (/^(([0][1-9])|([12][0-9])|([3][01]))[\/](([0][1-9])|([1][012]))$/.test(newVal)) {
682                                        if (newVal.length > oldVal.length) {
683                                            scope.val += '/';
684                                        }
685                                    } else {
686                                        scope.val = oldVal;
687                                    }
688                                }
689                                if (newVal.length == 6 && !/^(([0][1-9])|([12][0-9])|([3][01]))[\/](([0][1-9])|([1][012]))[\/]$/.test(newVal)) {
690                                    scope.val = oldVal;
691                                }
692                                if (newVal.length >= 7 && !/^(([0][1-9])|([12][0-9])|([3][01]))[\/](([0][1-9])|([1][012]))[\/][012][0-9]{0,3}$/.test(newVal)) {
693                                    scope.val = oldVal;
694                                }
695                                if (newVal.length >= 5) {
696                                    var dob = scope.val.split('/');
697                                    if (dob[0] == 31 && [1, 3, 5, 7, 8, 10, 12].indexOf(parseInt(dob[1])) == -1) {
698                                        scope.val = oldVal;
699                                    }
700                                    if (dob[0] == 30 && parseInt(dob[1]) == 2) {
701                                        scope.val = oldVal;
702                                    }
703                                }
704                                if (newVal.length == 10) {
705                                    var d = new Date(dob[2], parseInt(dob[1]) - 1, parseInt(dob[0]));
706                                    if (d.getFullYear() != dob[2] || d.getMonth() != parseInt(dob[1]) - 1 || d.getDate() != parseInt(dob[0])) {
707                                        scope.val = oldVal;
708                                    } else {
709                                        var max = scope.maxDate && scope.maxDate != '' ? new Date(scope.maxDate).getTime() : scope.maxDate;
710                                        var min = scope.minDate && scope.minDate != '' ? new Date(scope.minDate).getTime() : scope.minDate;
711                                        var current = d.getTime();
712                                        if ((max && current > max) || (min && current < min)) {
713                                            scope.val = oldVal;
714                                        } else {
715                                            var age = new Date().getFullYear() - d.getFullYear();
716                                            var m = new Date().getMonth() - d.getMonth();
717                                            if (m < 0 || (m === 0 && new Date().getDate() < d.getDate())) {
718                                                age = age - 1;
719                                            }
720                                            if (typeof scope.dateAge != 'undefined') {
721                                                scope.dateAge = age.toString();
722                                            }
723                                            if (typeof scope.isMinor != 'undefined') {
724                                                scope.isMinor = age < 18;
725                                            }
726                                            valid = true;
727                                        }
728                                    }
729                                }
730                                if (newVal.length > 10) {
731                                    scope.val = oldVal;
732                                }
733                                valid = scope.val.length == 10 ? true : valid;
734                                if (!valid) {
735                                    message = 'Invalid Date';
736                                }
737                            }
738                        } else {
739                            if (!eval(element.attr('validation') + ".test(scope.val)")) {
740                                scope.val = oldVal;
741                            }
742                        }
743                        if (scope.maxValue) {
744                            if (parseFloat(scope.maxValue) < parseFloat(scope.val)) {
745                                if (scope.maxValue >= 0) {
746                                    scope.val = oldVal;
747                                } else {
748                                    valid = false;
749                                }
750                            }
751                        }
752                    }
753                    if (element.attr('max-length') && newVal.length > parseFloat(scope.maxLength)) {
754                        scope.val = oldVal;
755                    }
756                    if (element.attr('my-max-value') && newVal > parseInt(scope.myMaxValue)) {
757                        scope.val = oldVal;
758                    }
759                    valid = element.attr('min-length') && newVal.length < parseFloat(scope.minLength) ? false : valid;
760                    if (scope.minValue || scope.minValue == '0') {
761                        if (isNaN(parseFloat(scope.val))) {
762                            valid = false;
763                        } else {
764                            if (parseFloat(scope.minValue) > parseFloat(scope.val)) {
765                                if (scope.minValue > 0) {
766                                    valid = false;
767                                } else {
768                                    scope.val = oldVal;
769                                }
770                            }
771                        }
772                    }
773                    element.attr('validated', valid);
774                } else {
775                    element.attr('validated', !required);
776                }
777                if (element.attr('assign-cond')) {
778                    if (scope.assignCond) {
779                        scope.assignValue = scope.val;
780                    }
781                } else {
782                    if (element.attr('assign-value')) {
783                        scope.assignValue = scope.val;
784                    }
785                }
786                if (element.attr('validated') == 'true' && element.attr('on-validate') && typeof scope.onValidate != 'undefined') {
787//                    console.log(true);
788                    if (element.attr('validate-var') && typeof scope.validateVar != 'undefined') {
789                        scope.onValidate(scope.validateVar, function (ret) {
790                            element.attr('validated', ret.success);
791                            if (!ret.success) {
792                                if (ret.message) {
793                                    element.attr('title', ret.message);
794                                }
795                                if (ret.oldvar) {
796                                    scope.val = oldVal;
797                                }
798                                if (ret.validatevar) {
799                                    scope.val = ret.validatevar;
800                                }
801                            }
802                        });
803                    } else {
804                        scope.onValidate(function (ret) {
805                            element.attr('validated', ret.success);
806                            if (!ret.success) {
807                                if (ret.message) {
808                                    element.attr('title', ret.message);
809                                }
810                                if (ret.oldvar) {
811                                    scope.val = oldVal;
812                                }
813                                if (ret.validatevar) {
814                                    scope.val = ret.validatevar;
815                                }
816                            }
817                        });
818                    }
819                }
820                if (element.attr('on-change') && typeof scope.onChange != 'undefined') {
821                    if (element.attr('change-var') && typeof scope.changeVar != 'undefined') {
822                        scope.onChange(scope.changeVar, function (ret) {
823                            element.attr('validated', ret.success);
824                            if (!ret.success) {
825                                if (ret.message) {
826                                    element.attr('title', ret.message);
827                                }
828                                if (ret.oldvar) {
829                                    scope.val = oldVal;
830                                }
831                            }
832                        });
833                    } else {
834                        scope.onChange(function (ret) {
835                            element.attr('validated', ret.success);
836                            if (!ret.success) {
837                                if (ret.message) {
838                                    element.attr('title', ret.message);
839                                }
840                                if (ret.oldvar) {
841                                    scope.val = oldVal;
842                                }
843                            }
844                        });
845                    }
846                }
847            }, true);
848        }
849    }
850}).directive('loadingLoader', ['$http', function ($http) {
851        return {
852            restrict: 'A',
853            link: function (scope, elm, attrs) {
854//                console.log($('ng-controller').length);
855                scope.isLoading = function () {
856                    return $http.pendingRequests.length > 0;
857                };
858                scope.$watch(scope.isLoading, function (v) {
859                    if (v) {
860                        var show = false;
861                        angular.forEach($http.pendingRequests, function (a) {
862                            a = decodeURIComponent(a.url.split('?').splice(1, 1).join('?')).split('&');
863                            angular.forEach(a, function (b) {
864                                if (/^loading-loader/.test(b)) {
865                                    b = b.split('=').splice(1, 1).join('=');
866                                    if (b == 'true') {
867                                        show = 'true';
868                                    }
869                                }
870                            });
871                        });
872                        if (!show) {
873                            show = 'true';
874                        }
875                        if (show == 'true') {
876                        $(elm).css('display','block');
877                         $('#preloaders').css('display','block');
878                      $(elm).show();
879                        }
880                    } else {
881                         $('#preloaders').css('display','none');
882                        $(elm).css('display','none');
883                      $(elm).hide();
884                    }
885                });
886            }
887        };
888    }]).directive('autoSuggest', function ($compile, $timeout) {
889    return {
890        restrict: 'A',
891        scope: {
892            source: '=',
893            ngModel: '=ngModel',
894        },
895        link: function (scope, element, attr) {
896            scope.src = scope.source;
897            var elementNum = angular.element(document).find('validation-select').length;
898            var container = angular.element('<span class="validation-select"></span>');
899            var e = angular.element('<input type="text" ng-model="myelementcustommodelfortypeahead' + elementNum + '" ng-keydown="assignActive($event)">');
900            var ul = angular.element('<ul><li ng-repeat="x in src track by $index" data-index="{{$index}}" ng-click="assign(x)">{{x.' + attr.view + '}}</li></ul>');
901            angular.forEach(attr, function (v, k) {
902                if (typeof v == 'string' && k != 'my-element' && k != 'ng-model') {
903                    e.attr(k, v);
904                    element.removeAttr(k);
905                }
906            });
907            ul.on('mouseenter', 'li', function () {
908                $(this).addClass('active');
909            });
910            ul.on('mouseleave', 'li', function () {
911                $(this).removeClass('active');
912            });
913            e.on('focus', function () {
914                ul.show();
915            });
916            angular.element(document).click(function (event) {
917                if (event.target.closest('.validation-select input')) {
918                    ul.show();
919                } else {
920                    ul.hide();
921                }
922            });
923            scope.assign = function (data) {
924                if (element.attr('ng-model') && element.attr('ng-model') != '') {
925                    scope.ngModel = data;
926                    scope['myelementcustommodelfortypeahead' + elementNum] = data[attr.view];
927                }
928                if (ul.find('li.active').length) {
929                    ul.find('li.selected').removeClass('selected');
930                    ul.find('li.active').addClass('selected');
931                }
932                ul.hide();
933            };
934            scope.assignActive = function (event) {
935                if ((event.which || event.keyCode) == '9') {//tab
936                    if (ul.find('li.active').length) {
937                        ul.find('li.active').addClass('selected');
938                        scope.assign(scope.src[ul.find('li.active').data('index')]);
939                    } else {
940                        var firstSelected = false;
941                        ul.find('li').each(function () {
942                            if (!firstSelected) {
943                                eval('var patt=/^' + scope['myelementcustommodelfortypeahead' + elementNum] + '/i;');
944                                if (patt.test(scope.src[angular.element(this).data('index')][attr.view])) {
945                                    firstSelected = angular.element(this);
946                                }
947                            }
948                        });
949                        if (firstSelected) {
950                            ul.find('li.active').removeClass('active');
951                            ul.find('li.selected').removeClass('selected');
952                            firstSelected.addClass('active');
953                            firstSelected.addClass('selected');
954                            scope.assign(scope.src[firstSelected.data('index')]);
955                        }
956                    }
957                    $timeout(function () {
958                        ul.hide();
959                    }, 10);
960                }
961                if ((event.which || event.keyCode) == '13') {//enter
962                    if (ul.css('display') == 'none') {
963                        ul.show();
964                    } else {
965                        if (ul.find('li.active').length) {
966                            ul.find('li.active').addClass('selected');
967                            scope.assign(scope.src[ul.find('li.active').data('index')]);
968                        } else {
969                            var firstSelected = false;
970                            ul.find('li').each(function () {
971                                if (!firstSelected) {
972                                    eval('var patt=/^' + scope['myelementcustommodelfortypeahead' + elementNum] + '/i;');
973                                    if (patt.test(scope.src[angular.element(this).data('index')][attr.view])) {
974                                        firstSelected = angular.element(this);
975                                    }
976                                }
977                            });
978                            if (firstSelected) {
979                                ul.find('li.active').removeClass('active');
980                                ul.find('li.selected').removeClass('selected');
981                                firstSelected.addClass('active');
982                                firstSelected.addClass('selected');
983                                scope.assign(scope.src[firstSelected.data('index')]);
984                            }
985                        }
986                        $timeout(function () {
987                            ul.hide();
988                        }, 10);
989                    }
990                }
991                if ((event.which || event.keyCode) == '38') {//up arrow
992                    if (ul.css('display') == 'none') {
993                        ul.show();
994                    } else {
995                        var elem = ul.find('li.active');
996                        if (elem.length) {
997                            if (ul.find('li').first().hasClass('active')) {
998                                elem.removeClass('active');
999                                ul.find('li').last().addClass('active');
1000                            } else {
1001                                elem.removeClass('active');
1002                                elem.prev().addClass('active');
1003                            }
1004                        } else {
1005                            ul.find('li').last().addClass('active');
1006                        }
1007                    }
1008                }
1009                if ((event.which || event.keyCode) == '40') {//down arrow
1010                    if (ul.css('display') == 'none') {
1011                        ul.show();
1012                    } else {
1013                        var elem = ul.find('li.active');
1014                        if (elem.length) {
1015                            if (ul.find('li').last().hasClass('active')) {
1016                                elem.removeClass('active');
1017                                ul.find('li').first().addClass('active');
1018                            } else {
1019                                elem.removeClass('active');
1020                                elem.next().addClass('active');
1021                            }
1022                        } else {
1023                            ul.find('li').first().addClass('active');
1024                        }
1025                    }
1026                }
1027            };
1028            container.append(e);
1029            container.append(ul);
1030            $compile(container)(scope);
1031            container.insertAfter(element);
1032            element.hide();
1033            ul.width(e.width() + 25);
1034            angular.element(window).resize(function () {
1035                ul.width(e.width() + 25);
1036            });
1037            scope.$watch('myelementcustommodelfortypeahead' + elementNum, function (newval, oldval) {
1038                if (newval) {
1039                    var src = [];
1040                    var found = false;
1041                    angular.forEach(scope.source, function (v, k) {
1042                        eval('var patt=/' + newval + '/i;');
1043                        if (patt.test(v[attr.search])) {
1044                            src.push(v);
1045                            if (newval == v[attr.search] && !found) {
1046                                found = true;
1047                            }
1048                        }
1049                    });
1050                    if (!found) {
1051                        scope.ngModel = null;
1052                    }
1053                    scope.src = src;
1054                    if (scope.src.length) {
1055                        ul.show();
1056                    }
1057                } else {
1058                    scope.ngModel = null;
1059                    scope.src = scope.source;
1060                }
1061            });
1062        }
1063    }
1064});
1065//$('[ng-controller]').each(function () {
1066//    if (!$(this).find('[loading-loader]').length) {
1067//        $(this).append('<div loading-loader><div style="position:fixed;top:0px;left:0px;bottom:0px;right:0px;background-color:#000;z-index:1001!important;opacity:0.5;"></div><img style="position:fixed;top:0;left:0;bottom:0;right:0;margin:auto;z-index:1002!important;" height="100" src="' + __DIR__ + 'loader.gif"></div>');
1068//    }
1069//});
1070$('[ng-controller]').first().each(function () {
1071    if (!$(this).find('[loading-loader]').length) {
1072//        var path = window.location.pathname;
1073////        if(path.indexOf('/fly') != -1 || path.indexOf('/flight') != -1 || path == '/flight-passengers'){
1074////            $(this).append('<div id="preloader" loading-loader ><div class="loader_flight"><div class="plane"><img src="' + __DIR__ + '6vlb.gif" class="plane-img img-fluid"></div><div class="earth-wrapper"><div class="earth"></div></div></div></div>');
1075////        } else {
1076////            $(this).append('<div id="preloaders"  loading-loader ><div class="containers"><div class="contents"><div class="track"></div><div class="train"><div class="front"></div><div class="wheels"><div class="smallOne"></div><div class="smallTwo"></div><div class="smallThree"></div><div class="smallFour"></div><div class="smallFive"></div><div class="smallSix"></div><div class="big"></div></div><div class="cord"></div><div class="coach"></div><div class="coachTwo"></div><div class="windows"></div><div id="up" class="steam"></div><div id="up" class="steam2"></div><div id="up" class="steam3"></div></div></div></div></div>');
1077//              $(this).append('<div loading-loader><div style="position:fixed;top:0px;left:0px;bottom:0px;right:0px;background-color:#000;z-index:1001!important;opacity:0.5;"></div><img style="position:fixed;top:0;left:0;bottom:0;right:0;margin:auto;z-index:1002!important;width:160px;height:160px;border-radius: 100px;box-shadow:0px 0px 12px 1px rgb(0 0 0 / 40%);" src="' + __DIR__ + 'jsLoaderNew.gif"></div>');
1078////        }
1079//            if (wl != 1) {
1080                $(this).append('<div loading-loader><div style="position:fixed;top:0px;left:0px;bottom:0px;right:0px;background-color:#000;z-index:1001!important;opacity:0.5;"></div><img style="position:fixed;top:0;left:0;bottom:0;right:0;margin:auto;z-index:1002!important;width:160px;height:160px;border-radius: 100px;box-shadow:0px 0px 12px 1px rgb(0 0 0 / 40%);" src="' + __DIR__ + 'loaderO.gif"></div>');
1081//            } else {
1082//              $(this).append('<div loading-loader><div style="position:fixed;top:0px;left:0px;bottom:0px;right:0px;background-color:#000;z-index:1001!important;opacity:0.5;"></div><img style="position:fixed;top:0;left:0;bottom:0;right:0;margin:auto;z-index:1002!important;width:180px;border-radius: 100px;transform:scale(1.1);box-shadow:0px 0px 12px 1px rgb(0 0 0 / 40%);" src="' + __DIR__ + 'newLoader.gif"></div>');
1083//            }
1084    }
1085});
1086function convertNumberToWords(num) {
1087    var ones = ["", "One ", "Two ", "Three ", "Four ", "Five ", "Six ", "Seven ", "Eight ", "Nine ", "Ten ", "Eleven ", "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ", "Sixteen ", "Seventeen ", "Eighteen ", "Nineteen "];
1088    var tens = ["", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"];
1089    if ((num = num.toString()).length > 9) return "Overflow: Maximum 9 digits supported";
1090    n = ("000000000" + num).substr(-9).match(/^(\d{2})(\d{2})(\d{2})(\d{1})(\d{2})$/);
1091    if (!n) return;
1092    var str = "";
1093    str += n[1] != 0 ? (ones[Number(n[1])] || tens[n[1][0]] + " " + ones[n[1][1]]) + "Crore " : "";
1094    str += n[2] != 0 ? (ones[Number(n[2])] || tens[n[2][0]] + " " + ones[n[2][1]]) + "Lakh " : "";
1095    str += n[3] != 0 ? (ones[Number(n[3])] || tens[n[3][0]] + " " + ones[n[3][1]]) + "Thousand " : "";
1096    str += n[4] != 0 ? (ones[Number(n[4])] || tens[n[4][0]] + " " + ones[n[4][1]]) + "Hundred " : "";
1097    str += n[5] != 0 ? (str != "" ? "and " : "") + (ones[Number(n[5])] || tens[n[5][0]] + " " + ones[n[5][1]]) : "";
1098    return str;
1099}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.