@iankibetsh/shframework 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3395 @@
1
+ 'use strict';
2
+
3
+ var Axios = require('axios');
4
+ var NProgress = require('nprogress');
5
+ var vue = require('vue');
6
+ var moment = require('moment');
7
+ var Swal = require('sweetalert2');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var Axios__default = /*#__PURE__*/_interopDefaultLegacy(Axios);
12
+ var NProgress__default = /*#__PURE__*/_interopDefaultLegacy(NProgress);
13
+ var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
14
+ var Swal__default = /*#__PURE__*/_interopDefaultLegacy(Swal);
15
+
16
+ function setItem (key, value) {
17
+ let toStore = value;
18
+ if (typeof value === 'object') {
19
+ toStore = JSON.stringify(value);
20
+ }
21
+ return localStorage.setItem(key, toStore)
22
+ }
23
+
24
+ function getItem (key) {
25
+ return localStorage.getItem(key)
26
+ }
27
+ function removeItem (key) {
28
+ return localStorage.removeItem(key)
29
+ }
30
+ var shstorage = {
31
+ setItem,
32
+ getItem,
33
+ removeItem
34
+ };
35
+
36
+ let apiUrl = undefined.VITE_APP_API_URL;
37
+ if (process.env.NODE_ENV === 'production') {
38
+ apiUrl = undefined.VITE_APP_API_PRODUCTION_URL;
39
+ }
40
+ const axios = Axios__default["default"].create({
41
+ baseURL: apiUrl
42
+ });
43
+ function doGet (endPoint, data) {
44
+ return axios.get(endPoint, {
45
+ params: data,
46
+ crossOrigin: true,
47
+ headers: {
48
+ Authorization: 'Bearer ' + shstorage.getItem('access_token')
49
+ // 'X-CSRF-TOKEN': 'INVALID'
50
+ }
51
+ })
52
+ }
53
+ function doPost (endPoint, data) {
54
+ return axios.post(endPoint,
55
+ data,
56
+ {
57
+ headers: {
58
+ Authorization: 'Bearer ' + shstorage.getItem('access_token')
59
+ }
60
+ }
61
+ )
62
+ }
63
+
64
+ var apis = {
65
+ doGet,
66
+ doPost
67
+ };
68
+
69
+ const countries = [
70
+ {
71
+ name: 'Afghanistan',
72
+ dialCode: '+93',
73
+ isoCode: 'AF',
74
+ flag: 'https://www.countryflags.io/AF/flat/64.png'
75
+ },
76
+ {
77
+ name: 'Aland Islands',
78
+ dialCode: '+358',
79
+ isoCode: 'AX',
80
+ flag: 'https://www.countryflags.io/AX/flat/64.png'
81
+ },
82
+ {
83
+ name: 'Albania',
84
+ dialCode: '+355',
85
+ isoCode: 'AL',
86
+ flag: 'https://www.countryflags.io/AL/flat/64.png'
87
+ },
88
+ {
89
+ name: 'Algeria',
90
+ dialCode: '+213',
91
+ isoCode: 'DZ',
92
+ flag: 'https://www.countryflags.io/DZ/flat/64.png'
93
+ },
94
+ {
95
+ name: 'AmericanSamoa',
96
+ dialCode: '+1684',
97
+ isoCode: 'AS',
98
+ flag: 'https://www.countryflags.io/AS/flat/64.png'
99
+ },
100
+ {
101
+ name: 'Andorra',
102
+ dialCode: '+376',
103
+ isoCode: 'AD',
104
+ flag: 'https://www.countryflags.io/AD/flat/64.png'
105
+ },
106
+ {
107
+ name: 'Angola',
108
+ dialCode: '+244',
109
+ isoCode: 'AO',
110
+ flag: 'https://www.countryflags.io/AO/flat/64.png'
111
+ },
112
+ {
113
+ name: 'Anguilla',
114
+ dialCode: '+1264',
115
+ isoCode: 'AI',
116
+ flag: 'https://www.countryflags.io/AI/flat/64.png'
117
+ },
118
+ {
119
+ name: 'Antarctica',
120
+ dialCode: '+672',
121
+ isoCode: 'AQ',
122
+ flag: 'https://www.countryflags.io/AQ/flat/64.png'
123
+ },
124
+ {
125
+ name: 'Antigua and Barbuda',
126
+ dialCode: '+1268',
127
+ isoCode: 'AG',
128
+ flag: 'https://www.countryflags.io/AG/flat/64.png'
129
+ },
130
+ {
131
+ name: 'Argentina',
132
+ dialCode: '+54',
133
+ isoCode: 'AR',
134
+ flag: 'https://www.countryflags.io/AR/flat/64.png'
135
+ },
136
+ {
137
+ name: 'Armenia',
138
+ dialCode: '+374',
139
+ isoCode: 'AM',
140
+ flag: 'https://www.countryflags.io/AM/flat/64.png'
141
+ },
142
+ {
143
+ name: 'Aruba',
144
+ dialCode: '+297',
145
+ isoCode: 'AW',
146
+ flag: 'https://www.countryflags.io/AW/flat/64.png'
147
+ },
148
+ {
149
+ name: 'Ascension Island',
150
+ dialCode: '+247',
151
+ isoCode: 'AC',
152
+ flag: 'https://cdn.kcak11.com/flags/AC_64.png'
153
+ },
154
+ {
155
+ name: 'Australia',
156
+ dialCode: '+61',
157
+ isoCode: 'AU',
158
+ flag: 'https://www.countryflags.io/AU/flat/64.png'
159
+ },
160
+ {
161
+ name: 'Austria',
162
+ dialCode: '+43',
163
+ isoCode: 'AT',
164
+ flag: 'https://www.countryflags.io/AT/flat/64.png'
165
+ },
166
+ {
167
+ name: 'Azerbaijan',
168
+ dialCode: '+994',
169
+ isoCode: 'AZ',
170
+ flag: 'https://www.countryflags.io/AZ/flat/64.png'
171
+ },
172
+ {
173
+ name: 'Bahamas',
174
+ dialCode: '+1242',
175
+ isoCode: 'BS',
176
+ flag: 'https://www.countryflags.io/BS/flat/64.png'
177
+ },
178
+ {
179
+ name: 'Bahrain',
180
+ dialCode: '+973',
181
+ isoCode: 'BH',
182
+ flag: 'https://www.countryflags.io/BH/flat/64.png'
183
+ },
184
+ {
185
+ name: 'Bangladesh',
186
+ dialCode: '+880',
187
+ isoCode: 'BD',
188
+ flag: 'https://www.countryflags.io/BD/flat/64.png'
189
+ },
190
+ {
191
+ name: 'Barbados',
192
+ dialCode: '+1246',
193
+ isoCode: 'BB',
194
+ flag: 'https://www.countryflags.io/BB/flat/64.png'
195
+ },
196
+ {
197
+ name: 'Belarus',
198
+ dialCode: '+375',
199
+ isoCode: 'BY',
200
+ flag: 'https://www.countryflags.io/BY/flat/64.png'
201
+ },
202
+ {
203
+ name: 'Belgium',
204
+ dialCode: '+32',
205
+ isoCode: 'BE',
206
+ flag: 'https://www.countryflags.io/BE/flat/64.png'
207
+ },
208
+ {
209
+ name: 'Belize',
210
+ dialCode: '+501',
211
+ isoCode: 'BZ',
212
+ flag: 'https://www.countryflags.io/BZ/flat/64.png'
213
+ },
214
+ {
215
+ name: 'Benin',
216
+ dialCode: '+229',
217
+ isoCode: 'BJ',
218
+ flag: 'https://www.countryflags.io/BJ/flat/64.png'
219
+ },
220
+ {
221
+ name: 'Bermuda',
222
+ dialCode: '+1441',
223
+ isoCode: 'BM',
224
+ flag: 'https://www.countryflags.io/BM/flat/64.png'
225
+ },
226
+ {
227
+ name: 'Bhutan',
228
+ dialCode: '+975',
229
+ isoCode: 'BT',
230
+ flag: 'https://www.countryflags.io/BT/flat/64.png'
231
+ },
232
+ {
233
+ name: 'Bolivia',
234
+ dialCode: '+591',
235
+ isoCode: 'BO',
236
+ flag: 'https://www.countryflags.io/BO/flat/64.png'
237
+ },
238
+ {
239
+ name: 'Bosnia and Herzegovina',
240
+ dialCode: '+387',
241
+ isoCode: 'BA',
242
+ flag: 'https://www.countryflags.io/BA/flat/64.png'
243
+ },
244
+ {
245
+ name: 'Botswana',
246
+ dialCode: '+267',
247
+ isoCode: 'BW',
248
+ flag: 'https://www.countryflags.io/BW/flat/64.png'
249
+ },
250
+ {
251
+ name: 'Brazil',
252
+ dialCode: '+55',
253
+ isoCode: 'BR',
254
+ flag: 'https://www.countryflags.io/BR/flat/64.png'
255
+ },
256
+ {
257
+ name: 'British Indian Ocean Territory',
258
+ dialCode: '+246',
259
+ isoCode: 'IO',
260
+ flag: 'https://www.countryflags.io/IO/flat/64.png'
261
+ },
262
+ {
263
+ name: 'Brunei Darussalam',
264
+ dialCode: '+673',
265
+ isoCode: 'BN',
266
+ flag: 'https://www.countryflags.io/BN/flat/64.png'
267
+ },
268
+ {
269
+ name: 'Bulgaria',
270
+ dialCode: '+359',
271
+ isoCode: 'BG',
272
+ flag: 'https://www.countryflags.io/BG/flat/64.png'
273
+ },
274
+ {
275
+ name: 'Burkina Faso',
276
+ dialCode: '+226',
277
+ isoCode: 'BF',
278
+ flag: 'https://www.countryflags.io/BF/flat/64.png'
279
+ },
280
+ {
281
+ name: 'Burundi',
282
+ dialCode: '+257',
283
+ isoCode: 'BI',
284
+ flag: 'https://www.countryflags.io/BI/flat/64.png'
285
+ },
286
+ {
287
+ name: 'Cambodia',
288
+ dialCode: '+855',
289
+ isoCode: 'KH',
290
+ flag: 'https://www.countryflags.io/KH/flat/64.png'
291
+ },
292
+ {
293
+ name: 'Cameroon',
294
+ dialCode: '+237',
295
+ isoCode: 'CM',
296
+ flag: 'https://www.countryflags.io/CM/flat/64.png'
297
+ },
298
+ {
299
+ name: 'Canada',
300
+ dialCode: '+1',
301
+ isoCode: 'CA',
302
+ flag: 'https://www.countryflags.io/CA/flat/64.png'
303
+ },
304
+ {
305
+ name: 'Cape Verde',
306
+ dialCode: '+238',
307
+ isoCode: 'CV',
308
+ flag: 'https://www.countryflags.io/CV/flat/64.png'
309
+ },
310
+ {
311
+ name: 'Cayman Islands',
312
+ dialCode: '+1345',
313
+ isoCode: 'KY',
314
+ flag: 'https://www.countryflags.io/KY/flat/64.png'
315
+ },
316
+ {
317
+ name: 'Central African Republic',
318
+ dialCode: '+236',
319
+ isoCode: 'CF',
320
+ flag: 'https://www.countryflags.io/CF/flat/64.png'
321
+ },
322
+ {
323
+ name: 'Chad',
324
+ dialCode: '+235',
325
+ isoCode: 'TD',
326
+ flag: 'https://www.countryflags.io/TD/flat/64.png'
327
+ },
328
+ {
329
+ name: 'Chile',
330
+ dialCode: '+56',
331
+ isoCode: 'CL',
332
+ flag: 'https://www.countryflags.io/CL/flat/64.png'
333
+ },
334
+ {
335
+ name: 'China',
336
+ dialCode: '+86',
337
+ isoCode: 'CN',
338
+ flag: 'https://www.countryflags.io/CN/flat/64.png'
339
+ },
340
+ {
341
+ name: 'Christmas Island',
342
+ dialCode: '+61',
343
+ isoCode: 'CX',
344
+ flag: 'https://www.countryflags.io/CX/flat/64.png'
345
+ },
346
+ {
347
+ name: 'Cocos (Keeling) Islands',
348
+ dialCode: '+61',
349
+ isoCode: 'CC',
350
+ flag: 'https://www.countryflags.io/CC/flat/64.png'
351
+ },
352
+ {
353
+ name: 'Colombia',
354
+ dialCode: '+57',
355
+ isoCode: 'CO',
356
+ flag: 'https://www.countryflags.io/CO/flat/64.png'
357
+ },
358
+ {
359
+ name: 'Comoros',
360
+ dialCode: '+269',
361
+ isoCode: 'KM',
362
+ flag: 'https://www.countryflags.io/KM/flat/64.png'
363
+ },
364
+ {
365
+ name: 'Congo',
366
+ dialCode: '+242',
367
+ isoCode: 'CG',
368
+ flag: 'https://www.countryflags.io/CG/flat/64.png'
369
+ },
370
+ {
371
+ name: 'Cook Islands',
372
+ dialCode: '+682',
373
+ isoCode: 'CK',
374
+ flag: 'https://www.countryflags.io/CK/flat/64.png'
375
+ },
376
+ {
377
+ name: 'Costa Rica',
378
+ dialCode: '+506',
379
+ isoCode: 'CR',
380
+ flag: 'https://www.countryflags.io/CR/flat/64.png'
381
+ },
382
+ {
383
+ name: 'Croatia',
384
+ dialCode: '+385',
385
+ isoCode: 'HR',
386
+ flag: 'https://www.countryflags.io/HR/flat/64.png'
387
+ },
388
+ {
389
+ name: 'Cuba',
390
+ dialCode: '+53',
391
+ isoCode: 'CU',
392
+ flag: 'https://www.countryflags.io/CU/flat/64.png'
393
+ },
394
+ {
395
+ name: 'Cyprus',
396
+ dialCode: '+357',
397
+ isoCode: 'CY',
398
+ flag: 'https://www.countryflags.io/CY/flat/64.png'
399
+ },
400
+ {
401
+ name: 'Czech Republic',
402
+ dialCode: '+420',
403
+ isoCode: 'CZ',
404
+ flag: 'https://www.countryflags.io/CZ/flat/64.png'
405
+ },
406
+ {
407
+ name: 'Democratic Republic of the Congo',
408
+ dialCode: '+243',
409
+ isoCode: 'CD',
410
+ flag: 'https://www.countryflags.io/CD/flat/64.png'
411
+ },
412
+ {
413
+ name: 'Denmark',
414
+ dialCode: '+45',
415
+ isoCode: 'DK',
416
+ flag: 'https://www.countryflags.io/DK/flat/64.png'
417
+ },
418
+ {
419
+ name: 'Djibouti',
420
+ dialCode: '+253',
421
+ isoCode: 'DJ',
422
+ flag: 'https://www.countryflags.io/DJ/flat/64.png'
423
+ },
424
+ {
425
+ name: 'Dominica',
426
+ dialCode: '+1767',
427
+ isoCode: 'DM',
428
+ flag: 'https://www.countryflags.io/DM/flat/64.png'
429
+ },
430
+ {
431
+ name: 'Dominican Republic',
432
+ dialCode: '+1849',
433
+ isoCode: 'DO',
434
+ flag: 'https://www.countryflags.io/DO/flat/64.png'
435
+ },
436
+ {
437
+ name: 'Ecuador',
438
+ dialCode: '+593',
439
+ isoCode: 'EC',
440
+ flag: 'https://www.countryflags.io/EC/flat/64.png'
441
+ },
442
+ {
443
+ name: 'Egypt',
444
+ dialCode: '+20',
445
+ isoCode: 'EG',
446
+ flag: 'https://www.countryflags.io/EG/flat/64.png'
447
+ },
448
+ {
449
+ name: 'El Salvador',
450
+ dialCode: '+503',
451
+ isoCode: 'SV',
452
+ flag: 'https://www.countryflags.io/SV/flat/64.png'
453
+ },
454
+ {
455
+ name: 'Equatorial Guinea',
456
+ dialCode: '+240',
457
+ isoCode: 'GQ',
458
+ flag: 'https://www.countryflags.io/GQ/flat/64.png'
459
+ },
460
+ {
461
+ name: 'Eritrea',
462
+ dialCode: '+291',
463
+ isoCode: 'ER',
464
+ flag: 'https://www.countryflags.io/ER/flat/64.png'
465
+ },
466
+ {
467
+ name: 'Estonia',
468
+ dialCode: '+372',
469
+ isoCode: 'EE',
470
+ flag: 'https://www.countryflags.io/EE/flat/64.png'
471
+ },
472
+ {
473
+ name: 'Eswatini',
474
+ dialCode: '+268',
475
+ isoCode: 'SZ',
476
+ flag: 'https://www.countryflags.io/SZ/flat/64.png'
477
+ },
478
+ {
479
+ name: 'Ethiopia',
480
+ dialCode: '+251',
481
+ isoCode: 'ET',
482
+ flag: 'https://www.countryflags.io/ET/flat/64.png'
483
+ },
484
+ {
485
+ name: 'Falkland Islands (Malvinas)',
486
+ dialCode: '+500',
487
+ isoCode: 'FK',
488
+ flag: 'https://www.countryflags.io/FK/flat/64.png'
489
+ },
490
+ {
491
+ name: 'Faroe Islands',
492
+ dialCode: '+298',
493
+ isoCode: 'FO',
494
+ flag: 'https://www.countryflags.io/FO/flat/64.png'
495
+ },
496
+ {
497
+ name: 'Fiji',
498
+ dialCode: '+679',
499
+ isoCode: 'FJ',
500
+ flag: 'https://www.countryflags.io/FJ/flat/64.png'
501
+ },
502
+ {
503
+ name: 'Finland',
504
+ dialCode: '+358',
505
+ isoCode: 'FI',
506
+ flag: 'https://www.countryflags.io/FI/flat/64.png'
507
+ },
508
+ {
509
+ name: 'France',
510
+ dialCode: '+33',
511
+ isoCode: 'FR',
512
+ flag: 'https://www.countryflags.io/FR/flat/64.png'
513
+ },
514
+ {
515
+ name: 'French Guiana',
516
+ dialCode: '+594',
517
+ isoCode: 'GF',
518
+ flag: 'https://www.countryflags.io/GF/flat/64.png'
519
+ },
520
+ {
521
+ name: 'French Polynesia',
522
+ dialCode: '+689',
523
+ isoCode: 'PF',
524
+ flag: 'https://www.countryflags.io/PF/flat/64.png'
525
+ },
526
+ {
527
+ name: 'Gabon',
528
+ dialCode: '+241',
529
+ isoCode: 'GA',
530
+ flag: 'https://www.countryflags.io/GA/flat/64.png'
531
+ },
532
+ {
533
+ name: 'Gambia',
534
+ dialCode: '+220',
535
+ isoCode: 'GM',
536
+ flag: 'https://www.countryflags.io/GM/flat/64.png'
537
+ },
538
+ {
539
+ name: 'Georgia',
540
+ dialCode: '+995',
541
+ isoCode: 'GE',
542
+ flag: 'https://www.countryflags.io/GE/flat/64.png'
543
+ },
544
+ {
545
+ name: 'Germany',
546
+ dialCode: '+49',
547
+ isoCode: 'DE',
548
+ flag: 'https://www.countryflags.io/DE/flat/64.png'
549
+ },
550
+ {
551
+ name: 'Ghana',
552
+ dialCode: '+233',
553
+ isoCode: 'GH',
554
+ flag: 'https://www.countryflags.io/GH/flat/64.png'
555
+ },
556
+ {
557
+ name: 'Gibraltar',
558
+ dialCode: '+350',
559
+ isoCode: 'GI',
560
+ flag: 'https://www.countryflags.io/GI/flat/64.png'
561
+ },
562
+ {
563
+ name: 'Greece',
564
+ dialCode: '+30',
565
+ isoCode: 'GR',
566
+ flag: 'https://www.countryflags.io/GR/flat/64.png'
567
+ },
568
+ {
569
+ name: 'Greenland',
570
+ dialCode: '+299',
571
+ isoCode: 'GL',
572
+ flag: 'https://www.countryflags.io/GL/flat/64.png'
573
+ },
574
+ {
575
+ name: 'Grenada',
576
+ dialCode: '+1473',
577
+ isoCode: 'GD',
578
+ flag: 'https://www.countryflags.io/GD/flat/64.png'
579
+ },
580
+ {
581
+ name: 'Guadeloupe',
582
+ dialCode: '+590',
583
+ isoCode: 'GP',
584
+ flag: 'https://www.countryflags.io/GP/flat/64.png'
585
+ },
586
+ {
587
+ name: 'Guam',
588
+ dialCode: '+1671',
589
+ isoCode: 'GU',
590
+ flag: 'https://www.countryflags.io/GU/flat/64.png'
591
+ },
592
+ {
593
+ name: 'Guatemala',
594
+ dialCode: '+502',
595
+ isoCode: 'GT',
596
+ flag: 'https://www.countryflags.io/GT/flat/64.png'
597
+ },
598
+ {
599
+ name: 'Guernsey',
600
+ dialCode: '+44',
601
+ isoCode: 'GG',
602
+ flag: 'https://www.countryflags.io/GG/flat/64.png'
603
+ },
604
+ {
605
+ name: 'Guinea',
606
+ dialCode: '+224',
607
+ isoCode: 'GN',
608
+ flag: 'https://www.countryflags.io/GN/flat/64.png'
609
+ },
610
+ {
611
+ name: 'Guinea-Bissau',
612
+ dialCode: '+245',
613
+ isoCode: 'GW',
614
+ flag: 'https://www.countryflags.io/GW/flat/64.png'
615
+ },
616
+ {
617
+ name: 'Guyana',
618
+ dialCode: '+592',
619
+ isoCode: 'GY',
620
+ flag: 'https://www.countryflags.io/GY/flat/64.png'
621
+ },
622
+ {
623
+ name: 'Haiti',
624
+ dialCode: '+509',
625
+ isoCode: 'HT',
626
+ flag: 'https://www.countryflags.io/HT/flat/64.png'
627
+ },
628
+ {
629
+ name: 'Holy See (Vatican City State)',
630
+ dialCode: '+379',
631
+ isoCode: 'VA',
632
+ flag: 'https://www.countryflags.io/VA/flat/64.png'
633
+ },
634
+ {
635
+ name: 'Honduras',
636
+ dialCode: '+504',
637
+ isoCode: 'HN',
638
+ flag: 'https://www.countryflags.io/HN/flat/64.png'
639
+ },
640
+ {
641
+ name: 'Hong Kong',
642
+ dialCode: '+852',
643
+ isoCode: 'HK',
644
+ flag: 'https://www.countryflags.io/HK/flat/64.png'
645
+ },
646
+ {
647
+ name: 'Hungary',
648
+ dialCode: '+36',
649
+ isoCode: 'HU',
650
+ flag: 'https://www.countryflags.io/HU/flat/64.png'
651
+ },
652
+ {
653
+ name: 'Iceland',
654
+ dialCode: '+354',
655
+ isoCode: 'IS',
656
+ flag: 'https://www.countryflags.io/IS/flat/64.png'
657
+ },
658
+ {
659
+ name: 'India',
660
+ dialCode: '+91',
661
+ isoCode: 'IN',
662
+ flag: 'https://www.countryflags.io/IN/flat/64.png'
663
+ },
664
+ {
665
+ name: 'Indonesia',
666
+ dialCode: '+62',
667
+ isoCode: 'ID',
668
+ flag: 'https://www.countryflags.io/ID/flat/64.png'
669
+ },
670
+ {
671
+ name: 'Iran',
672
+ dialCode: '+98',
673
+ isoCode: 'IR',
674
+ flag: 'https://www.countryflags.io/IR/flat/64.png'
675
+ },
676
+ {
677
+ name: 'Iraq',
678
+ dialCode: '+964',
679
+ isoCode: 'IQ',
680
+ flag: 'https://www.countryflags.io/IQ/flat/64.png'
681
+ },
682
+ {
683
+ name: 'Ireland',
684
+ dialCode: '+353',
685
+ isoCode: 'IE',
686
+ flag: 'https://www.countryflags.io/IE/flat/64.png'
687
+ },
688
+ {
689
+ name: 'Isle of Man',
690
+ dialCode: '+44',
691
+ isoCode: 'IM',
692
+ flag: 'https://www.countryflags.io/IM/flat/64.png'
693
+ },
694
+ {
695
+ name: 'Israel',
696
+ dialCode: '+972',
697
+ isoCode: 'IL',
698
+ flag: 'https://www.countryflags.io/IL/flat/64.png'
699
+ },
700
+ {
701
+ name: 'Italy',
702
+ dialCode: '+39',
703
+ isoCode: 'IT',
704
+ flag: 'https://www.countryflags.io/IT/flat/64.png'
705
+ },
706
+ {
707
+ name: 'Ivory Coast / Cote d\'Ivoire',
708
+ dialCode: '+225',
709
+ isoCode: 'CI',
710
+ flag: 'https://www.countryflags.io/CI/flat/64.png'
711
+ },
712
+ {
713
+ name: 'Jamaica',
714
+ dialCode: '+1876',
715
+ isoCode: 'JM',
716
+ flag: 'https://www.countryflags.io/JM/flat/64.png'
717
+ },
718
+ {
719
+ name: 'Japan',
720
+ dialCode: '+81',
721
+ isoCode: 'JP',
722
+ flag: 'https://www.countryflags.io/JP/flat/64.png'
723
+ },
724
+ {
725
+ name: 'Jersey',
726
+ dialCode: '+44',
727
+ isoCode: 'JE',
728
+ flag: 'https://www.countryflags.io/JE/flat/64.png'
729
+ },
730
+ {
731
+ name: 'Jordan',
732
+ dialCode: '+962',
733
+ isoCode: 'JO',
734
+ flag: 'https://www.countryflags.io/JO/flat/64.png'
735
+ },
736
+ {
737
+ name: 'Kazakhstan',
738
+ dialCode: '+77',
739
+ isoCode: 'KZ',
740
+ flag: 'https://www.countryflags.io/KZ/flat/64.png'
741
+ },
742
+ {
743
+ name: 'Kenya',
744
+ dialCode: '+254',
745
+ isoCode: 'KE',
746
+ flag: 'https://www.countryflags.io/KE/flat/64.png'
747
+ },
748
+ {
749
+ name: 'Kiribati',
750
+ dialCode: '+686',
751
+ isoCode: 'KI',
752
+ flag: 'https://www.countryflags.io/KI/flat/64.png'
753
+ },
754
+ {
755
+ name: 'Korea, Democratic People\'s Republic of Korea',
756
+ dialCode: '+850',
757
+ isoCode: 'KP',
758
+ flag: 'https://www.countryflags.io/KP/flat/64.png'
759
+ },
760
+ {
761
+ name: 'Korea, Republic of South Korea',
762
+ dialCode: '+82',
763
+ isoCode: 'KR',
764
+ flag: 'https://www.countryflags.io/KR/flat/64.png'
765
+ },
766
+ {
767
+ name: 'Kosovo',
768
+ dialCode: '+383',
769
+ isoCode: 'XK',
770
+ flag: 'https://www.countryflags.io/XK/flat/64.png'
771
+ },
772
+ {
773
+ name: 'Kuwait',
774
+ dialCode: '+965',
775
+ isoCode: 'KW',
776
+ flag: 'https://www.countryflags.io/KW/flat/64.png'
777
+ },
778
+ {
779
+ name: 'Kyrgyzstan',
780
+ dialCode: '+996',
781
+ isoCode: 'KG',
782
+ flag: 'https://www.countryflags.io/KG/flat/64.png'
783
+ },
784
+ {
785
+ name: 'Laos',
786
+ dialCode: '+856',
787
+ isoCode: 'LA',
788
+ flag: 'https://www.countryflags.io/LA/flat/64.png'
789
+ },
790
+ {
791
+ name: 'Latvia',
792
+ dialCode: '+371',
793
+ isoCode: 'LV',
794
+ flag: 'https://www.countryflags.io/LV/flat/64.png'
795
+ },
796
+ {
797
+ name: 'Lebanon',
798
+ dialCode: '+961',
799
+ isoCode: 'LB',
800
+ flag: 'https://www.countryflags.io/LB/flat/64.png'
801
+ },
802
+ {
803
+ name: 'Lesotho',
804
+ dialCode: '+266',
805
+ isoCode: 'LS',
806
+ flag: 'https://www.countryflags.io/LS/flat/64.png'
807
+ },
808
+ {
809
+ name: 'Liberia',
810
+ dialCode: '+231',
811
+ isoCode: 'LR',
812
+ flag: 'https://www.countryflags.io/LR/flat/64.png'
813
+ },
814
+ {
815
+ name: 'Libya',
816
+ dialCode: '+218',
817
+ isoCode: 'LY',
818
+ flag: 'https://www.countryflags.io/LY/flat/64.png'
819
+ },
820
+ {
821
+ name: 'Liechtenstein',
822
+ dialCode: '+423',
823
+ isoCode: 'LI',
824
+ flag: 'https://www.countryflags.io/LI/flat/64.png'
825
+ },
826
+ {
827
+ name: 'Lithuania',
828
+ dialCode: '+370',
829
+ isoCode: 'LT',
830
+ flag: 'https://www.countryflags.io/LT/flat/64.png'
831
+ },
832
+ {
833
+ name: 'Luxembourg',
834
+ dialCode: '+352',
835
+ isoCode: 'LU',
836
+ flag: 'https://www.countryflags.io/LU/flat/64.png'
837
+ },
838
+ {
839
+ name: 'Macau',
840
+ dialCode: '+853',
841
+ isoCode: 'MO',
842
+ flag: 'https://www.countryflags.io/MO/flat/64.png'
843
+ },
844
+ {
845
+ name: 'Madagascar',
846
+ dialCode: '+261',
847
+ isoCode: 'MG',
848
+ flag: 'https://www.countryflags.io/MG/flat/64.png'
849
+ },
850
+ {
851
+ name: 'Malawi',
852
+ dialCode: '+265',
853
+ isoCode: 'MW',
854
+ flag: 'https://www.countryflags.io/MW/flat/64.png'
855
+ },
856
+ {
857
+ name: 'Malaysia',
858
+ dialCode: '+60',
859
+ isoCode: 'MY',
860
+ flag: 'https://www.countryflags.io/MY/flat/64.png'
861
+ },
862
+ {
863
+ name: 'Maldives',
864
+ dialCode: '+960',
865
+ isoCode: 'MV',
866
+ flag: 'https://www.countryflags.io/MV/flat/64.png'
867
+ },
868
+ {
869
+ name: 'Mali',
870
+ dialCode: '+223',
871
+ isoCode: 'ML',
872
+ flag: 'https://www.countryflags.io/ML/flat/64.png'
873
+ },
874
+ {
875
+ name: 'Malta',
876
+ dialCode: '+356',
877
+ isoCode: 'MT',
878
+ flag: 'https://www.countryflags.io/MT/flat/64.png'
879
+ },
880
+ {
881
+ name: 'Marshall Islands',
882
+ dialCode: '+692',
883
+ isoCode: 'MH',
884
+ flag: 'https://www.countryflags.io/MH/flat/64.png'
885
+ },
886
+ {
887
+ name: 'Martinique',
888
+ dialCode: '+596',
889
+ isoCode: 'MQ',
890
+ flag: 'https://www.countryflags.io/MQ/flat/64.png'
891
+ },
892
+ {
893
+ name: 'Mauritania',
894
+ dialCode: '+222',
895
+ isoCode: 'MR',
896
+ flag: 'https://www.countryflags.io/MR/flat/64.png'
897
+ },
898
+ {
899
+ name: 'Mauritius',
900
+ dialCode: '+230',
901
+ isoCode: 'MU',
902
+ flag: 'https://www.countryflags.io/MU/flat/64.png'
903
+ },
904
+ {
905
+ name: 'Mayotte',
906
+ dialCode: '+262',
907
+ isoCode: 'YT',
908
+ flag: 'https://www.countryflags.io/YT/flat/64.png'
909
+ },
910
+ {
911
+ name: 'Mexico',
912
+ dialCode: '+52',
913
+ isoCode: 'MX',
914
+ flag: 'https://www.countryflags.io/MX/flat/64.png'
915
+ },
916
+ {
917
+ name: 'Micronesia, Federated States of Micronesia',
918
+ dialCode: '+691',
919
+ isoCode: 'FM',
920
+ flag: 'https://www.countryflags.io/FM/flat/64.png'
921
+ },
922
+ {
923
+ name: 'Moldova',
924
+ dialCode: '+373',
925
+ isoCode: 'MD',
926
+ flag: 'https://www.countryflags.io/MD/flat/64.png'
927
+ },
928
+ {
929
+ name: 'Monaco',
930
+ dialCode: '+377',
931
+ isoCode: 'MC',
932
+ flag: 'https://www.countryflags.io/MC/flat/64.png'
933
+ },
934
+ {
935
+ name: 'Mongolia',
936
+ dialCode: '+976',
937
+ isoCode: 'MN',
938
+ flag: 'https://www.countryflags.io/MN/flat/64.png'
939
+ },
940
+ {
941
+ name: 'Montenegro',
942
+ dialCode: '+382',
943
+ isoCode: 'ME',
944
+ flag: 'https://www.countryflags.io/ME/flat/64.png'
945
+ },
946
+ {
947
+ name: 'Montserrat',
948
+ dialCode: '+1664',
949
+ isoCode: 'MS',
950
+ flag: 'https://www.countryflags.io/MS/flat/64.png'
951
+ },
952
+ {
953
+ name: 'Morocco',
954
+ dialCode: '+212',
955
+ isoCode: 'MA',
956
+ flag: 'https://www.countryflags.io/MA/flat/64.png'
957
+ },
958
+ {
959
+ name: 'Mozambique',
960
+ dialCode: '+258',
961
+ isoCode: 'MZ',
962
+ flag: 'https://www.countryflags.io/MZ/flat/64.png'
963
+ },
964
+ {
965
+ name: 'Myanmar',
966
+ dialCode: '+95',
967
+ isoCode: 'MM',
968
+ flag: 'https://www.countryflags.io/MM/flat/64.png'
969
+ },
970
+ {
971
+ name: 'Namibia',
972
+ dialCode: '+264',
973
+ isoCode: 'NA',
974
+ flag: 'https://www.countryflags.io/NA/flat/64.png'
975
+ },
976
+ {
977
+ name: 'Nauru',
978
+ dialCode: '+674',
979
+ isoCode: 'NR',
980
+ flag: 'https://www.countryflags.io/NR/flat/64.png'
981
+ },
982
+ {
983
+ name: 'Nepal',
984
+ dialCode: '+977',
985
+ isoCode: 'NP',
986
+ flag: 'https://www.countryflags.io/NP/flat/64.png'
987
+ },
988
+ {
989
+ name: 'Netherlands',
990
+ dialCode: '+31',
991
+ isoCode: 'NL',
992
+ flag: 'https://www.countryflags.io/NL/flat/64.png'
993
+ },
994
+ {
995
+ name: 'Netherlands Antilles',
996
+ dialCode: '+599',
997
+ isoCode: 'AN',
998
+ flag: 'https://www.countryflags.io/AN/flat/64.png'
999
+ },
1000
+ {
1001
+ name: 'New Caledonia',
1002
+ dialCode: '+687',
1003
+ isoCode: 'NC',
1004
+ flag: 'https://www.countryflags.io/NC/flat/64.png'
1005
+ },
1006
+ {
1007
+ name: 'New Zealand',
1008
+ dialCode: '+64',
1009
+ isoCode: 'NZ',
1010
+ flag: 'https://www.countryflags.io/NZ/flat/64.png'
1011
+ },
1012
+ {
1013
+ name: 'Nicaragua',
1014
+ dialCode: '+505',
1015
+ isoCode: 'NI',
1016
+ flag: 'https://www.countryflags.io/NI/flat/64.png'
1017
+ },
1018
+ {
1019
+ name: 'Niger',
1020
+ dialCode: '+227',
1021
+ isoCode: 'NE',
1022
+ flag: 'https://www.countryflags.io/NE/flat/64.png'
1023
+ },
1024
+ {
1025
+ name: 'Nigeria',
1026
+ dialCode: '+234',
1027
+ isoCode: 'NG',
1028
+ flag: 'https://www.countryflags.io/NG/flat/64.png'
1029
+ },
1030
+ {
1031
+ name: 'Niue',
1032
+ dialCode: '+683',
1033
+ isoCode: 'NU',
1034
+ flag: 'https://www.countryflags.io/NU/flat/64.png'
1035
+ },
1036
+ {
1037
+ name: 'Norfolk Island',
1038
+ dialCode: '+672',
1039
+ isoCode: 'NF',
1040
+ flag: 'https://www.countryflags.io/NF/flat/64.png'
1041
+ },
1042
+ {
1043
+ name: 'North Macedonia',
1044
+ dialCode: '+389',
1045
+ isoCode: 'MK',
1046
+ flag: 'https://www.countryflags.io/MK/flat/64.png'
1047
+ },
1048
+ {
1049
+ name: 'Northern Mariana Islands',
1050
+ dialCode: '+1670',
1051
+ isoCode: 'MP',
1052
+ flag: 'https://www.countryflags.io/MP/flat/64.png'
1053
+ },
1054
+ {
1055
+ name: 'Norway',
1056
+ dialCode: '+47',
1057
+ isoCode: 'NO',
1058
+ flag: 'https://www.countryflags.io/NO/flat/64.png'
1059
+ },
1060
+ {
1061
+ name: 'Oman',
1062
+ dialCode: '+968',
1063
+ isoCode: 'OM',
1064
+ flag: 'https://www.countryflags.io/OM/flat/64.png'
1065
+ },
1066
+ {
1067
+ name: 'Pakistan',
1068
+ dialCode: '+92',
1069
+ isoCode: 'PK',
1070
+ flag: 'https://www.countryflags.io/PK/flat/64.png'
1071
+ },
1072
+ {
1073
+ name: 'Palau',
1074
+ dialCode: '+680',
1075
+ isoCode: 'PW',
1076
+ flag: 'https://www.countryflags.io/PW/flat/64.png'
1077
+ },
1078
+ {
1079
+ name: 'Palestine',
1080
+ dialCode: '+970',
1081
+ isoCode: 'PS',
1082
+ flag: 'https://www.countryflags.io/PS/flat/64.png'
1083
+ },
1084
+ {
1085
+ name: 'Panama',
1086
+ dialCode: '+507',
1087
+ isoCode: 'PA',
1088
+ flag: 'https://www.countryflags.io/PA/flat/64.png'
1089
+ },
1090
+ {
1091
+ name: 'Papua New Guinea',
1092
+ dialCode: '+675',
1093
+ isoCode: 'PG',
1094
+ flag: 'https://www.countryflags.io/PG/flat/64.png'
1095
+ },
1096
+ {
1097
+ name: 'Paraguay',
1098
+ dialCode: '+595',
1099
+ isoCode: 'PY',
1100
+ flag: 'https://www.countryflags.io/PY/flat/64.png'
1101
+ },
1102
+ {
1103
+ name: 'Peru',
1104
+ dialCode: '+51',
1105
+ isoCode: 'PE',
1106
+ flag: 'https://www.countryflags.io/PE/flat/64.png'
1107
+ },
1108
+ {
1109
+ name: 'Philippines',
1110
+ dialCode: '+63',
1111
+ isoCode: 'PH',
1112
+ flag: 'https://www.countryflags.io/PH/flat/64.png'
1113
+ },
1114
+ {
1115
+ name: 'Pitcairn',
1116
+ dialCode: '+872',
1117
+ isoCode: 'PN',
1118
+ flag: 'https://www.countryflags.io/PN/flat/64.png'
1119
+ },
1120
+ {
1121
+ name: 'Poland',
1122
+ dialCode: '+48',
1123
+ isoCode: 'PL',
1124
+ flag: 'https://www.countryflags.io/PL/flat/64.png'
1125
+ },
1126
+ {
1127
+ name: 'Portugal',
1128
+ dialCode: '+351',
1129
+ isoCode: 'PT',
1130
+ flag: 'https://www.countryflags.io/PT/flat/64.png'
1131
+ },
1132
+ {
1133
+ name: 'Puerto Rico',
1134
+ dialCode: '+1939',
1135
+ isoCode: 'PR',
1136
+ flag: 'https://www.countryflags.io/PR/flat/64.png'
1137
+ },
1138
+ {
1139
+ name: 'Qatar',
1140
+ dialCode: '+974',
1141
+ isoCode: 'QA',
1142
+ flag: 'https://www.countryflags.io/QA/flat/64.png'
1143
+ },
1144
+ {
1145
+ name: 'Reunion',
1146
+ dialCode: '+262',
1147
+ isoCode: 'RE',
1148
+ flag: 'https://www.countryflags.io/RE/flat/64.png'
1149
+ },
1150
+ {
1151
+ name: 'Romania',
1152
+ dialCode: '+40',
1153
+ isoCode: 'RO',
1154
+ flag: 'https://www.countryflags.io/RO/flat/64.png'
1155
+ },
1156
+ {
1157
+ name: 'Russia',
1158
+ dialCode: '+7',
1159
+ isoCode: 'RU',
1160
+ flag: 'https://www.countryflags.io/RU/flat/64.png'
1161
+ },
1162
+ {
1163
+ name: 'Rwanda',
1164
+ dialCode: '+250',
1165
+ isoCode: 'RW',
1166
+ flag: 'https://www.countryflags.io/RW/flat/64.png'
1167
+ },
1168
+ {
1169
+ name: 'Saint Barthelemy',
1170
+ dialCode: '+590',
1171
+ isoCode: 'BL',
1172
+ flag: 'https://www.countryflags.io/BL/flat/64.png'
1173
+ },
1174
+ {
1175
+ name: 'Saint Helena, Ascension and Tristan Da Cunha',
1176
+ dialCode: '+290',
1177
+ isoCode: 'SH',
1178
+ flag: 'https://www.countryflags.io/SH/flat/64.png'
1179
+ },
1180
+ {
1181
+ name: 'Saint Kitts and Nevis',
1182
+ dialCode: '+1869',
1183
+ isoCode: 'KN',
1184
+ flag: 'https://www.countryflags.io/KN/flat/64.png'
1185
+ },
1186
+ {
1187
+ name: 'Saint Lucia',
1188
+ dialCode: '+1758',
1189
+ isoCode: 'LC',
1190
+ flag: 'https://www.countryflags.io/LC/flat/64.png'
1191
+ },
1192
+ {
1193
+ name: 'Saint Martin',
1194
+ dialCode: '+590',
1195
+ isoCode: 'MF',
1196
+ flag: 'https://www.countryflags.io/MF/flat/64.png'
1197
+ },
1198
+ {
1199
+ name: 'Saint Pierre and Miquelon',
1200
+ dialCode: '+508',
1201
+ isoCode: 'PM',
1202
+ flag: 'https://www.countryflags.io/PM/flat/64.png'
1203
+ },
1204
+ {
1205
+ name: 'Saint Vincent and the Grenadines',
1206
+ dialCode: '+1784',
1207
+ isoCode: 'VC',
1208
+ flag: 'https://www.countryflags.io/VC/flat/64.png'
1209
+ },
1210
+ {
1211
+ name: 'Samoa',
1212
+ dialCode: '+685',
1213
+ isoCode: 'WS',
1214
+ flag: 'https://www.countryflags.io/WS/flat/64.png'
1215
+ },
1216
+ {
1217
+ name: 'San Marino',
1218
+ dialCode: '+378',
1219
+ isoCode: 'SM',
1220
+ flag: 'https://www.countryflags.io/SM/flat/64.png'
1221
+ },
1222
+ {
1223
+ name: 'Sao Tome and Principe',
1224
+ dialCode: '+239',
1225
+ isoCode: 'ST',
1226
+ flag: 'https://www.countryflags.io/ST/flat/64.png'
1227
+ },
1228
+ {
1229
+ name: 'Saudi Arabia',
1230
+ dialCode: '+966',
1231
+ isoCode: 'SA',
1232
+ flag: 'https://www.countryflags.io/SA/flat/64.png'
1233
+ },
1234
+ {
1235
+ name: 'Senegal',
1236
+ dialCode: '+221',
1237
+ isoCode: 'SN',
1238
+ flag: 'https://www.countryflags.io/SN/flat/64.png'
1239
+ },
1240
+ {
1241
+ name: 'Serbia',
1242
+ dialCode: '+381',
1243
+ isoCode: 'RS',
1244
+ flag: 'https://www.countryflags.io/RS/flat/64.png'
1245
+ },
1246
+ {
1247
+ name: 'Seychelles',
1248
+ dialCode: '+248',
1249
+ isoCode: 'SC',
1250
+ flag: 'https://www.countryflags.io/SC/flat/64.png'
1251
+ },
1252
+ {
1253
+ name: 'Sierra Leone',
1254
+ dialCode: '+232',
1255
+ isoCode: 'SL',
1256
+ flag: 'https://www.countryflags.io/SL/flat/64.png'
1257
+ },
1258
+ {
1259
+ name: 'Singapore',
1260
+ dialCode: '+65',
1261
+ isoCode: 'SG',
1262
+ flag: 'https://www.countryflags.io/SG/flat/64.png'
1263
+ },
1264
+ {
1265
+ name: 'Sint Maarten',
1266
+ dialCode: '+1721',
1267
+ isoCode: 'SX',
1268
+ flag: 'https://www.countryflags.io/SX/flat/64.png'
1269
+ },
1270
+ {
1271
+ name: 'Slovakia',
1272
+ dialCode: '+421',
1273
+ isoCode: 'SK',
1274
+ flag: 'https://www.countryflags.io/SK/flat/64.png'
1275
+ },
1276
+ {
1277
+ name: 'Slovenia',
1278
+ dialCode: '+386',
1279
+ isoCode: 'SI',
1280
+ flag: 'https://www.countryflags.io/SI/flat/64.png'
1281
+ },
1282
+ {
1283
+ name: 'Solomon Islands',
1284
+ dialCode: '+677',
1285
+ isoCode: 'SB',
1286
+ flag: 'https://www.countryflags.io/SB/flat/64.png'
1287
+ },
1288
+ {
1289
+ name: 'Somalia',
1290
+ dialCode: '+252',
1291
+ isoCode: 'SO',
1292
+ flag: 'https://www.countryflags.io/SO/flat/64.png'
1293
+ },
1294
+ {
1295
+ name: 'South Africa',
1296
+ dialCode: '+27',
1297
+ isoCode: 'ZA',
1298
+ flag: 'https://www.countryflags.io/ZA/flat/64.png'
1299
+ },
1300
+ {
1301
+ name: 'South Georgia and the South Sandwich Islands',
1302
+ dialCode: '+500',
1303
+ isoCode: 'GS',
1304
+ flag: 'https://www.countryflags.io/GS/flat/64.png'
1305
+ },
1306
+ {
1307
+ name: 'South Sudan',
1308
+ dialCode: '+211',
1309
+ isoCode: 'SS',
1310
+ flag: 'https://www.countryflags.io/SS/flat/64.png'
1311
+ },
1312
+ {
1313
+ name: 'Spain',
1314
+ dialCode: '+34',
1315
+ isoCode: 'ES',
1316
+ flag: 'https://www.countryflags.io/ES/flat/64.png'
1317
+ },
1318
+ {
1319
+ name: 'Sri Lanka',
1320
+ dialCode: '+94',
1321
+ isoCode: 'LK',
1322
+ flag: 'https://www.countryflags.io/LK/flat/64.png'
1323
+ },
1324
+ {
1325
+ name: 'Sudan',
1326
+ dialCode: '+249',
1327
+ isoCode: 'SD',
1328
+ flag: 'https://www.countryflags.io/SD/flat/64.png'
1329
+ },
1330
+ {
1331
+ name: 'Suriname',
1332
+ dialCode: '+597',
1333
+ isoCode: 'SR',
1334
+ flag: 'https://www.countryflags.io/SR/flat/64.png'
1335
+ },
1336
+ {
1337
+ name: 'Svalbard and Jan Mayen',
1338
+ dialCode: '+47',
1339
+ isoCode: 'SJ',
1340
+ flag: 'https://www.countryflags.io/SJ/flat/64.png'
1341
+ },
1342
+ {
1343
+ name: 'Sweden',
1344
+ dialCode: '+46',
1345
+ isoCode: 'SE',
1346
+ flag: 'https://www.countryflags.io/SE/flat/64.png'
1347
+ },
1348
+ {
1349
+ name: 'Switzerland',
1350
+ dialCode: '+41',
1351
+ isoCode: 'CH',
1352
+ flag: 'https://www.countryflags.io/CH/flat/64.png'
1353
+ },
1354
+ {
1355
+ name: 'Syrian Arab Republic',
1356
+ dialCode: '+963',
1357
+ isoCode: 'SY',
1358
+ flag: 'https://www.countryflags.io/SY/flat/64.png'
1359
+ },
1360
+ {
1361
+ name: 'Taiwan',
1362
+ dialCode: '+886',
1363
+ isoCode: 'TW',
1364
+ flag: 'https://www.countryflags.io/TW/flat/64.png'
1365
+ },
1366
+ {
1367
+ name: 'Tajikistan',
1368
+ dialCode: '+992',
1369
+ isoCode: 'TJ',
1370
+ flag: 'https://www.countryflags.io/TJ/flat/64.png'
1371
+ },
1372
+ {
1373
+ name: 'Tanzania, United Republic of Tanzania',
1374
+ dialCode: '+255',
1375
+ isoCode: 'TZ',
1376
+ flag: 'https://www.countryflags.io/TZ/flat/64.png'
1377
+ },
1378
+ {
1379
+ name: 'Thailand',
1380
+ dialCode: '+66',
1381
+ isoCode: 'TH',
1382
+ flag: 'https://www.countryflags.io/TH/flat/64.png'
1383
+ },
1384
+ {
1385
+ name: 'Timor-Leste',
1386
+ dialCode: '+670',
1387
+ isoCode: 'TL',
1388
+ flag: 'https://www.countryflags.io/TL/flat/64.png'
1389
+ },
1390
+ {
1391
+ name: 'Togo',
1392
+ dialCode: '+228',
1393
+ isoCode: 'TG',
1394
+ flag: 'https://www.countryflags.io/TG/flat/64.png'
1395
+ },
1396
+ {
1397
+ name: 'Tokelau',
1398
+ dialCode: '+690',
1399
+ isoCode: 'TK',
1400
+ flag: 'https://www.countryflags.io/TK/flat/64.png'
1401
+ },
1402
+ {
1403
+ name: 'Tonga',
1404
+ dialCode: '+676',
1405
+ isoCode: 'TO',
1406
+ flag: 'https://www.countryflags.io/TO/flat/64.png'
1407
+ },
1408
+ {
1409
+ name: 'Trinidad and Tobago',
1410
+ dialCode: '+1868',
1411
+ isoCode: 'TT',
1412
+ flag: 'https://www.countryflags.io/TT/flat/64.png'
1413
+ },
1414
+ {
1415
+ name: 'Tunisia',
1416
+ dialCode: '+216',
1417
+ isoCode: 'TN',
1418
+ flag: 'https://www.countryflags.io/TN/flat/64.png'
1419
+ },
1420
+ {
1421
+ name: 'Turkey',
1422
+ dialCode: '+90',
1423
+ isoCode: 'TR',
1424
+ flag: 'https://www.countryflags.io/TR/flat/64.png'
1425
+ },
1426
+ {
1427
+ name: 'Turkmenistan',
1428
+ dialCode: '+993',
1429
+ isoCode: 'TM',
1430
+ flag: 'https://www.countryflags.io/TM/flat/64.png'
1431
+ },
1432
+ {
1433
+ name: 'Turks and Caicos Islands',
1434
+ dialCode: '+1649',
1435
+ isoCode: 'TC',
1436
+ flag: 'https://www.countryflags.io/TC/flat/64.png'
1437
+ },
1438
+ {
1439
+ name: 'Tuvalu',
1440
+ dialCode: '+688',
1441
+ isoCode: 'TV',
1442
+ flag: 'https://www.countryflags.io/TV/flat/64.png'
1443
+ },
1444
+ {
1445
+ name: 'Uganda',
1446
+ dialCode: '+256',
1447
+ isoCode: 'UG',
1448
+ flag: 'https://www.countryflags.io/UG/flat/64.png'
1449
+ },
1450
+ {
1451
+ name: 'Ukraine',
1452
+ dialCode: '+380',
1453
+ isoCode: 'UA',
1454
+ flag: 'https://www.countryflags.io/UA/flat/64.png'
1455
+ },
1456
+ {
1457
+ name: 'United Arab Emirates',
1458
+ dialCode: '+971',
1459
+ isoCode: 'AE',
1460
+ flag: 'https://www.countryflags.io/AE/flat/64.png'
1461
+ },
1462
+ {
1463
+ name: 'United Kingdom',
1464
+ dialCode: '+44',
1465
+ isoCode: 'GB',
1466
+ flag: 'https://www.countryflags.io/GB/flat/64.png'
1467
+ },
1468
+ {
1469
+ name: 'United States',
1470
+ dialCode: '+1',
1471
+ isoCode: 'US',
1472
+ flag: 'https://www.countryflags.io/US/flat/64.png'
1473
+ },
1474
+ {
1475
+ name: 'Uruguay',
1476
+ dialCode: '+598',
1477
+ isoCode: 'UY',
1478
+ flag: 'https://www.countryflags.io/UY/flat/64.png'
1479
+ },
1480
+ {
1481
+ name: 'Uzbekistan',
1482
+ dialCode: '+998',
1483
+ isoCode: 'UZ',
1484
+ flag: 'https://www.countryflags.io/UZ/flat/64.png'
1485
+ },
1486
+ {
1487
+ name: 'Vanuatu',
1488
+ dialCode: '+678',
1489
+ isoCode: 'VU',
1490
+ flag: 'https://www.countryflags.io/VU/flat/64.png'
1491
+ },
1492
+ {
1493
+ name: 'Venezuela, Bolivarian Republic of Venezuela',
1494
+ dialCode: '+58',
1495
+ isoCode: 'VE',
1496
+ flag: 'https://www.countryflags.io/VE/flat/64.png'
1497
+ },
1498
+ {
1499
+ name: 'Vietnam',
1500
+ dialCode: '+84',
1501
+ isoCode: 'VN',
1502
+ flag: 'https://www.countryflags.io/VN/flat/64.png'
1503
+ },
1504
+ {
1505
+ name: 'Virgin Islands, British',
1506
+ dialCode: '+1284',
1507
+ isoCode: 'VG',
1508
+ flag: 'https://www.countryflags.io/VG/flat/64.png'
1509
+ },
1510
+ {
1511
+ name: 'Virgin Islands, U.S.',
1512
+ dialCode: '+1340',
1513
+ isoCode: 'VI',
1514
+ flag: 'https://www.countryflags.io/VI/flat/64.png'
1515
+ },
1516
+ {
1517
+ name: 'Wallis and Futuna',
1518
+ dialCode: '+681',
1519
+ isoCode: 'WF',
1520
+ flag: 'https://www.countryflags.io/WF/flat/64.png'
1521
+ },
1522
+ {
1523
+ name: 'Yemen',
1524
+ dialCode: '+967',
1525
+ isoCode: 'YE',
1526
+ flag: 'https://www.countryflags.io/YE/flat/64.png'
1527
+ },
1528
+ {
1529
+ name: 'Zambia',
1530
+ dialCode: '+260',
1531
+ isoCode: 'ZM',
1532
+ flag: 'https://www.countryflags.io/ZM/flat/64.png'
1533
+ },
1534
+ {
1535
+ name: 'Zimbabwe',
1536
+ dialCode: '+263',
1537
+ isoCode: 'ZW',
1538
+ flag: 'https://www.countryflags.io/ZW/flat/64.png'
1539
+ }
1540
+ ];
1541
+
1542
+ var script$6 = {
1543
+ name: 'ShPhone',
1544
+ props: ['modelValue', 'country_code'],
1545
+ data () {
1546
+ return {
1547
+ input: this.modelValue,
1548
+ countries: countries,
1549
+ selectedCountry: {
1550
+ name: 'Kenya',
1551
+ dialCode: '+254',
1552
+ isoCode: 'KE',
1553
+ flag: 'https://www.countryflags.io/KE/flat/64.png'
1554
+ },
1555
+ flag: undefined.VITE_APP_HOME_URL + 'flags/ke.svg',
1556
+ appUrl: undefined.VITE_APP_HOME_URL
1557
+ }
1558
+ },
1559
+ updated () {
1560
+ if (!this.selectedCountry || !this.input) ;
1561
+ },
1562
+ mounted () {
1563
+ this.setSelectedCountry();
1564
+ },
1565
+ methods: {
1566
+ updateValue: function () {
1567
+ let phone = this.input;
1568
+ phone = '-' + phone;
1569
+ phone = phone.replace('-0', '');
1570
+ phone = phone.replace('-', '');
1571
+ // this.input = phone
1572
+ if (this.selectedCountry) {
1573
+ phone = this.selectedCountry.dialCode + '' + phone;
1574
+ }
1575
+ this.$emit('update:modelValue', phone);
1576
+ this.flag = this.appUrl + 'flags/' + this.selectedCountry.isoCode.toLowerCase() + '.svg';
1577
+ },
1578
+ setSelectedCountry: function () {
1579
+ let countryCode = 'KE';
1580
+ if (this.country_code) {
1581
+ countryCode = this.country_code;
1582
+ }
1583
+ this.input = this.modelValue;
1584
+ const country = this.countries.find(function (country) {
1585
+ if (countryCode.toUpperCase() === country.isoCode) {
1586
+ return country
1587
+ }
1588
+ }, this);
1589
+ if (this.input) {
1590
+ if (!this.input.includes('+')) {
1591
+ this.input = '+' + this.input;
1592
+ }
1593
+ this.flag = this.appUrl + 'flags/' + country.isoCode.toLowerCase() + '.svg';
1594
+ this.input = this.input.replace(country.dialCode, '');
1595
+ this.input = this.input.replace(':', '');
1596
+ this.input = this.input.replace(':', '');
1597
+ this.input = this.input.replace(':', '');
1598
+ this.selectedCountry = country;
1599
+ }
1600
+ }
1601
+ }
1602
+ };
1603
+
1604
+ const _hoisted_1$6 = { class: "sh-phone mb-3" };
1605
+ const _hoisted_2$6 = {
1606
+ key: 0,
1607
+ style: {"display":"contents"}
1608
+ };
1609
+ const _hoisted_3$6 = ["src"];
1610
+ const _hoisted_4$5 = ["value"];
1611
+
1612
+ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
1613
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
1614
+ ($data.selectedCountry)
1615
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$6, [
1616
+ vue.createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$6),
1617
+ vue.createTextVNode(" " + vue.toDisplayString($data.selectedCountry.dialCode), 1 /* TEXT */)
1618
+ ]))
1619
+ : vue.createCommentVNode("v-if", true),
1620
+ vue.withDirectives(vue.createElementVNode("select", {
1621
+ onChange: _cache[0] || (_cache[0] = (...args) => ($options.updateValue && $options.updateValue(...args))),
1622
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.selectedCountry) = $event)),
1623
+ class: "phone-country"
1624
+ }, [
1625
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.countries, (country) => {
1626
+ return (vue.openBlock(), vue.createElementBlock("option", {
1627
+ value: country,
1628
+ key: country.dialCode
1629
+ }, vue.toDisplayString(country.name + '(' + country.dialCode + ')'), 9 /* TEXT, PROPS */, _hoisted_4$5))
1630
+ }), 128 /* KEYED_FRAGMENT */))
1631
+ ], 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
1632
+ [vue.vModelSelect, $data.selectedCountry]
1633
+ ]),
1634
+ vue.withDirectives(vue.createElementVNode("input", {
1635
+ type: "text",
1636
+ class: "phone-number",
1637
+ "data-cy": "phone_input",
1638
+ onInput: _cache[2] || (_cache[2] = (...args) => ($options.updateValue && $options.updateValue(...args))),
1639
+ placeholder: "712345678",
1640
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (($data.input) = $event))
1641
+ }, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
1642
+ [vue.vModelText, $data.input]
1643
+ ])
1644
+ ]))
1645
+ }
1646
+
1647
+ script$6.render = render$6;
1648
+ script$6.__file = "src/views/ShPhone.vue";
1649
+
1650
+ var script$5 = {
1651
+ name: 'ShForm',
1652
+ inject: ['global'],
1653
+ components: {
1654
+ ShPhone: script$6
1655
+ },
1656
+ props: ['action', 'classes', 'hasTerms', 'country_code', 'submit_btn_class', 'fields', 'columns', 'placeholders', 'field_permissions', 'retain_data_after_submission', 'current_data', 'action_label', 'fill_selects', 'phones', 'success_callback', 'failed_callback', 'labels'],
1657
+ data: function () {
1658
+ return {
1659
+ form_elements: {},
1660
+ form_errors: {},
1661
+ form_status: 0,
1662
+ error_res: null,
1663
+ form_files: {},
1664
+ exiting_fields: [],
1665
+ selectData: {},
1666
+ users: [],
1667
+ allPlaceHolders: {},
1668
+ user: this.global.state.user,
1669
+ allLabels: {}
1670
+ }
1671
+ },
1672
+ computed: {
1673
+ currentData () {
1674
+ return this.current_data
1675
+ }
1676
+ },
1677
+ methods: {
1678
+ getSubmitBtnClass: function () {
1679
+ const btnClass = this.submit_btn_class;
1680
+ if (!btnClass) {
1681
+ return 'btn btn-primary mt-2'
1682
+ } else {
1683
+ return btnClass
1684
+ }
1685
+ },
1686
+ getColumns: function () {
1687
+ let cols = parseFloat(this.columns);
1688
+ if (!cols) {
1689
+ cols = 1;
1690
+ }
1691
+ const allowedColumns = [1, 2, 3, 4, 6, 12];
1692
+ if (!allowedColumns.includes(cols)) {
1693
+ return '12'
1694
+ } else {
1695
+ return 12 / parseFloat(cols)
1696
+ }
1697
+ },
1698
+ getFieldType: function (field) {
1699
+ const textareas = ['message', 'meta_description', 'comment', 'call_response', 'comments', 'description'];
1700
+ const selects = ['gender', 'payment_method', 'allow_view_mode', 'reasons_name', 'has_free_tier', 'payment_period', 'role', 'register_as', 'account_type'];
1701
+ const numbers = ['age'];
1702
+ const datePickers = ['free_tier_days', 'recurring_date', 'date', 'paid_at'];
1703
+ const editors = ['html_content', 'listing_description', 'mail'];
1704
+ const mapLocations = ['building_location'];
1705
+ const files = ['file', 'logo'];
1706
+ const phones = ['phone'];
1707
+ if (field.includes('_id') || this.selectData[field]) {
1708
+ return 'select'
1709
+ }
1710
+ if (field === 'email') {
1711
+ return 'email'
1712
+ }
1713
+ if (field.includes('password')) {
1714
+ return 'password'
1715
+ }
1716
+ if (field.includes('file')) {
1717
+ return 'file'
1718
+ }
1719
+ if (textareas.includes(field)) {
1720
+ return 'textarea'
1721
+ }
1722
+ if (phones.includes(field)) {
1723
+ return 'phone'
1724
+ }
1725
+ if (mapLocations.includes(field)) {
1726
+ return 'location'
1727
+ }
1728
+ if (editors.includes(field)) {
1729
+ return 'editor'
1730
+ }
1731
+ if (numbers.includes(field)) {
1732
+ // alert('found')
1733
+ return 'numeric'
1734
+ }
1735
+ if (datePickers.includes(field)) {
1736
+ return 'datepicker'
1737
+ }
1738
+ if (selects.includes(field)) {
1739
+ return 'select'
1740
+ }
1741
+ if (files.includes(field)) {
1742
+ return 'file'
1743
+ }
1744
+ return 'text'
1745
+ },
1746
+ getLabel: function (field) {
1747
+ if (field in this.allLabels) {
1748
+ return this.allLabels[field]
1749
+ } else {
1750
+ return field.replace(/_/g, ' ')
1751
+ }
1752
+ },
1753
+ isDisabled: function (field) {
1754
+ if (typeof this.field_permissions === 'undefined') {
1755
+ return false
1756
+ }
1757
+ if (typeof this.user.isAllowedTo !== 'undefined') {
1758
+ return !this.user.isAllowedTo(this.field_permissions[field])
1759
+ }
1760
+ return true
1761
+ },
1762
+ validateEssentials: function () {
1763
+ if (this.fields.includes('password_confirmation')) {
1764
+ if (!this.form_elements.password) {
1765
+ this.form_errors = {
1766
+ password: ['Password field is required']
1767
+ };
1768
+ return false
1769
+ } else
1770
+ if (this.form_elements.password !== this.form_elements.password_confirmation) {
1771
+ this.form_errors = {
1772
+ password: ['Password confirmation does not match']
1773
+ };
1774
+ return false
1775
+ }
1776
+ }
1777
+ },
1778
+ closeModal: function () {
1779
+ document.body.style = '';
1780
+ setTimeout(() => {
1781
+ const form = this.$refs.ShAutoForm;
1782
+ if (form) {
1783
+ const modal = form.closest('.modal.show');
1784
+ if (modal) {
1785
+ modal.click();
1786
+ }
1787
+ } else {
1788
+ const backdrops = document.getElementsByClassName('modal-backdrop fade show');
1789
+ if (backdrops.length > 0) {
1790
+ backdrops[0].remove();
1791
+ }
1792
+ }
1793
+ this.form_status = 0;
1794
+ }, 1500);
1795
+ },
1796
+ submitForm: async function () {
1797
+ // return false;
1798
+ // if (!this.validateEssentials()) {
1799
+ // return false
1800
+ // }
1801
+ NProgress__default["default"].start();
1802
+ this.form_status = 1;
1803
+ const data = new FormData();
1804
+ console.log(this.form_elements);
1805
+ Object.keys(this.form_elements).forEach(key => {
1806
+ if (typeof this.form_elements[key] === 'object') {
1807
+ data.append(key, JSON.stringify(this.form_elements[key]));
1808
+ } else if (typeof this.form_elements[key] !== 'undefined') { data.append(key, this.form_elements[key]); }
1809
+ });
1810
+ Object.keys(this.form_files).forEach(key => {
1811
+ data.append(key, this.form_files[key].value);
1812
+ });
1813
+ apis.doPost(this.action, data).then(res => {
1814
+ // console.log(res)
1815
+ this.form_status = 2;
1816
+ Object.keys(this.form_elements).forEach(key => {
1817
+ this.form_errors[key] = null;
1818
+ if (!this.retain_data_after_submission) {
1819
+ this.form_elements[key] = '';
1820
+ }
1821
+ });
1822
+ Object.keys(this.form_files).forEach(key => {
1823
+ this.form_errors[key] = null;
1824
+ });
1825
+ if (this.success_callback) {
1826
+ if (typeof this.success_callback === 'function') {
1827
+ this.success_callback(res.data);
1828
+ } else {
1829
+ this.$emit(this.success_callback, res.data);
1830
+ }
1831
+ }
1832
+ NProgress__default["default"].done();
1833
+ if (!this.retain_modal_after_submission) {
1834
+ this.closeModal();
1835
+ }
1836
+ }).catch((reason, data) => {
1837
+ NProgress__default["default"].done();
1838
+ this.form_status = 3;
1839
+ if (typeof reason !== 'undefined') {
1840
+ if (typeof reason.response !== 'undefined') {
1841
+ this.setErrors(reason.response);
1842
+ } else {
1843
+ console.log('catch error');
1844
+ console.log(reason);
1845
+ }
1846
+ } else {
1847
+ console.log(reason);
1848
+ }
1849
+ });
1850
+ return false
1851
+ },
1852
+ removeErrors: function (field) {
1853
+ this.form_errors[field] = null;
1854
+ this.form_status = 0;
1855
+ },
1856
+ setErrors: function (reason) {
1857
+ console.log(reason);
1858
+ if (reason.status === 422) { // change this to 422 validation error response as received from laravel
1859
+ this.form_errors = reason.data.errors;
1860
+ }
1861
+ },
1862
+ handleFileUpload: function (key) {
1863
+ this.form_files[key].value = event.target.files[0];
1864
+ },
1865
+ setCurrentData: function () {
1866
+ this.exiting_fields = [];
1867
+ if (this.currentData) {
1868
+ this.exiting_fields = this.currentData;
1869
+ }
1870
+ this.form_elements.id = this.exiting_fields.id;
1871
+ this.fields.forEach(field => {
1872
+ if (this.getFieldType(field) === 'file') {
1873
+ this.form_files[field] = { key: 'file', value: null };
1874
+ } else {
1875
+ if (this.exiting_fields[field] !== null) {
1876
+ this.form_elements[field] = this.exiting_fields[field];
1877
+ } else {
1878
+ this.form_elements[field] = '';
1879
+ }
1880
+ }
1881
+ this.form_errors[field] = null;
1882
+ });
1883
+ }
1884
+ },
1885
+ mounted: async function () {
1886
+ const selectData = {};
1887
+ if (this.fill_selects) {
1888
+ Object.keys(this.fill_selects).forEach(key => {
1889
+ if (this.fill_selects[key].data) {
1890
+ selectData[key] = this.fill_selects[key].data;
1891
+ this.selectData = selectData;
1892
+ console.log(this.selectData);
1893
+ } else {
1894
+ apis.doGet(this.fill_selects[key].url, { all: 1 }).then(res => {
1895
+ // selectData[key] = res.data
1896
+ // console.log(res)
1897
+ this.selectData[key] = res.data.data;
1898
+ }).catch(res => {
1899
+ console.log(res);
1900
+ });
1901
+ }
1902
+ });
1903
+ console.log(selectData);
1904
+ }
1905
+ },
1906
+ created: function () {
1907
+ console.log('created');
1908
+ if (this.labels) {
1909
+ this.allLabels = this.labels;
1910
+ }
1911
+ this.setCurrentData();
1912
+ if (this.placeholders) {
1913
+ this.allPlaceHolders = this.placeholders;
1914
+ }
1915
+ },
1916
+ watch: {
1917
+ currentData: function () {
1918
+ this.setCurrentData();
1919
+ }
1920
+ }
1921
+ };
1922
+
1923
+ const _hoisted_1$5 = { ref: "ShAutoForm" };
1924
+ const _hoisted_2$5 = {
1925
+ key: 0,
1926
+ class: "alert alert-danger"
1927
+ };
1928
+ const _hoisted_3$5 = /*#__PURE__*/vue.createElementVNode("i", { class: "fa fa-warning" }, null, -1 /* HOISTED */);
1929
+ const _hoisted_4$4 = /*#__PURE__*/vue.createTextVNode(" Error");
1930
+ const _hoisted_5$3 = [
1931
+ _hoisted_3$5,
1932
+ _hoisted_4$4
1933
+ ];
1934
+ const _hoisted_6$2 = { class: "row" };
1935
+ const _hoisted_7$2 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
1936
+ const _hoisted_8$1 = { class: "col-md-12" };
1937
+ const _hoisted_9$1 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
1938
+ const _hoisted_10$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
1939
+ const _hoisted_11$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
1940
+ const _hoisted_12$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
1941
+ const _hoisted_13$2 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
1942
+ const _hoisted_14$2 = ["disabled", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
1943
+ const _hoisted_15$2 = ["name", "onFocus", "onUpdate:modelValue"];
1944
+ const _hoisted_16$2 = ["name", "onFocus", "onUpdate:modelValue"];
1945
+ const _hoisted_17$2 = ["value"];
1946
+ const _hoisted_18$2 = {
1947
+ key: 9,
1948
+ class: "invalid-feedback"
1949
+ };
1950
+ const _hoisted_19$2 = {
1951
+ key: 1,
1952
+ class: "row"
1953
+ };
1954
+ const _hoisted_20$2 = /*#__PURE__*/vue.createElementVNode("h5", null, "Confirm and Submit", -1 /* HOISTED */);
1955
+ const _hoisted_21$2 = /*#__PURE__*/vue.createElementVNode("p", null, [
1956
+ /*#__PURE__*/vue.createTextVNode("By clicking submit, you agree to our "),
1957
+ /*#__PURE__*/vue.createElementVNode("a", {
1958
+ target: "_blank",
1959
+ href: "/"
1960
+ }, "terms and conditions"),
1961
+ /*#__PURE__*/vue.createTextVNode(" and that you have read our "),
1962
+ /*#__PURE__*/vue.createElementVNode("a", {
1963
+ target: "_blank",
1964
+ href: "https://hauzisha.co.ke/privacy-policy"
1965
+ }, "privacy policy")
1966
+ ], -1 /* HOISTED */);
1967
+ const _hoisted_22$2 = [
1968
+ _hoisted_20$2,
1969
+ _hoisted_21$2
1970
+ ];
1971
+ const _hoisted_23$2 = {
1972
+ key: 0,
1973
+ style: {"height":"1rem"},
1974
+ class: "float-left",
1975
+ src: "/assets/img/spinner.gif"
1976
+ };
1977
+
1978
+ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
1979
+ const _component_ShPhone = vue.resolveComponent("ShPhone");
1980
+
1981
+ return (vue.openBlock(), vue.createElementBlock("form", _hoisted_1$5, [
1982
+ vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
1983
+ vue.createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
1984
+ (_ctx.form_status == 3)
1985
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$5, _hoisted_5$3))
1986
+ : vue.createCommentVNode("v-if", true),
1987
+ vue.withDirectives(vue.createElementVNode("input", {
1988
+ type: "hidden",
1989
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.form_elements['id']) = $event))
1990
+ }, null, 512 /* NEED_PATCH */), [
1991
+ [vue.vModelText, _ctx.form_elements['id']]
1992
+ ]),
1993
+ vue.createElementVNode("div", _hoisted_6$2, [
1994
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.fields, (field) => {
1995
+ return (vue.openBlock(), vue.createElementBlock("div", {
1996
+ class: vue.normalizeClass(["form-group", 'col-md-' + $options.getColumns()]),
1997
+ key: field
1998
+ }, [
1999
+ vue.createElementVNode("label", _hoisted_7$2, vue.toDisplayString($options.getLabel(field)), 1 /* TEXT */),
2000
+ vue.createElementVNode("div", _hoisted_8$1, [
2001
+ ($options.getFieldType(field) === 'file')
2002
+ ? (vue.openBlock(), vue.createElementBlock("input", {
2003
+ key: 0,
2004
+ "data-cy": field,
2005
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2006
+ name: field,
2007
+ onFocus: $event => ($options.removeErrors(field)),
2008
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2009
+ ref_for: true,
2010
+ ref: 'file_'+field,
2011
+ onChange: $event => ($options.handleFileUpload(field)),
2012
+ type: "file"
2013
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_9$1))
2014
+ : vue.createCommentVNode("v-if", true),
2015
+ ($options.getFieldType(field) === 'numeric')
2016
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2017
+ key: 1,
2018
+ "data-cy": field,
2019
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2020
+ name: field,
2021
+ onFocus: $event => ($options.removeErrors(field)),
2022
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2023
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2024
+ type: "number"
2025
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_10$2)), [
2026
+ [vue.vModelText, _ctx.form_elements[field]]
2027
+ ])
2028
+ : vue.createCommentVNode("v-if", true),
2029
+ ($options.getFieldType(field) === 'password')
2030
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2031
+ key: 2,
2032
+ "data-cy": field,
2033
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2034
+ name: field,
2035
+ onFocus: $event => ($options.removeErrors(field)),
2036
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2037
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2038
+ type: "password"
2039
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_11$2)), [
2040
+ [vue.vModelText, _ctx.form_elements[field]]
2041
+ ])
2042
+ : vue.createCommentVNode("v-if", true),
2043
+ ($options.getFieldType(field) === 'email')
2044
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2045
+ key: 3,
2046
+ "data-cy": field,
2047
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2048
+ name: field,
2049
+ onFocus: $event => ($options.removeErrors(field)),
2050
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2051
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2052
+ type: "email",
2053
+ required: ""
2054
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_12$2)), [
2055
+ [vue.vModelText, _ctx.form_elements[field]]
2056
+ ])
2057
+ : vue.createCommentVNode("v-if", true),
2058
+ ($options.getFieldType(field) === 'datepicker' && $options.isDisabled(field) === false)
2059
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2060
+ key: 4,
2061
+ "data-cy": field,
2062
+ type: "datetime-local",
2063
+ name: field,
2064
+ onFocus: $event => ($options.removeErrors(field)),
2065
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control active"]),
2066
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2067
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_13$2)), [
2068
+ [vue.vModelText, _ctx.form_elements[field]]
2069
+ ])
2070
+ : vue.createCommentVNode("v-if", true),
2071
+ ($options.getFieldType(field) === 'phone')
2072
+ ? (vue.openBlock(), vue.createBlock(_component_ShPhone, {
2073
+ key: 5,
2074
+ country_code: $props.country_code,
2075
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2076
+ name: field,
2077
+ onFocus: $event => ($options.removeErrors(field)),
2078
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2079
+ modelValue: _ctx.form_elements[field],
2080
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2081
+ required: ""
2082
+ }, null, 8 /* PROPS */, ["country_code", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2083
+ : vue.createCommentVNode("v-if", true),
2084
+ ($options.getFieldType(field) === 'text')
2085
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2086
+ key: 6,
2087
+ disabled: $options.isDisabled(field),
2088
+ placeholder: field === 'phone_number' ? 'e.g 0712 345 678':'',
2089
+ name: field,
2090
+ onFocus: $event => ($options.removeErrors(field)),
2091
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2092
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2093
+ type: "text"
2094
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_14$2)), [
2095
+ [vue.vModelText, _ctx.form_elements[field]]
2096
+ ])
2097
+ : vue.createCommentVNode("v-if", true),
2098
+ ($options.getFieldType(field) === 'textarea')
2099
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", {
2100
+ key: 7,
2101
+ name: field,
2102
+ onFocus: $event => ($options.removeErrors(field)),
2103
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2104
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2105
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_15$2)), [
2106
+ [vue.vModelText, _ctx.form_elements[field]]
2107
+ ])
2108
+ : vue.createCommentVNode("v-if", true),
2109
+ ($options.getFieldType(field) === 'select' && _ctx.selectData[field] != null)
2110
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("select", {
2111
+ key: 8,
2112
+ name: field,
2113
+ onFocus: $event => ($options.removeErrors(field)),
2114
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2115
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2116
+ }, [
2117
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.selectData[field], (item) => {
2118
+ return (vue.openBlock(), vue.createElementBlock("option", {
2119
+ key: item.id,
2120
+ value: item.id
2121
+ }, vue.toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_17$2))
2122
+ }), 128 /* KEYED_FRAGMENT */))
2123
+ ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$2)), [
2124
+ [vue.vModelSelect, _ctx.form_elements[field]]
2125
+ ])
2126
+ : vue.createCommentVNode("v-if", true),
2127
+ (_ctx.form_errors[field] != null )
2128
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$2, vue.toDisplayString(_ctx.form_errors[field][0]), 1 /* TEXT */))
2129
+ : vue.createCommentVNode("v-if", true)
2130
+ ])
2131
+ ], 2 /* CLASS */))
2132
+ }), 128 /* KEYED_FRAGMENT */))
2133
+ ]),
2134
+ ($props.hasTerms)
2135
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19$2, _hoisted_22$2))
2136
+ : vue.createCommentVNode("v-if", true),
2137
+ vue.createElementVNode("button", {
2138
+ "data-cy": "sh_form_submit",
2139
+ class: vue.normalizeClass(["mb-2 form-submit-btn", _ctx.form_status == 1 ? $options.getSubmitBtnClass() + ' disabled': $options.getSubmitBtnClass()]),
2140
+ type: "button",
2141
+ onClick: _cache[1] || (_cache[1] = (...args) => ($options.submitForm && $options.submitForm(...args)))
2142
+ }, [
2143
+ vue.createTextVNode(vue.toDisplayString($props.action_label ? $props.action_label:'Submit') + " ", 1 /* TEXT */),
2144
+ (_ctx.form_status == 1)
2145
+ ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_23$2))
2146
+ : vue.createCommentVNode("v-if", true)
2147
+ ], 2 /* CLASS */)
2148
+ ], 512 /* NEED_PATCH */))
2149
+ }
2150
+
2151
+ script$5.render = render$5;
2152
+ script$5.__file = "src/views/ShForm.vue";
2153
+
2154
+ var script$4 = {
2155
+ name: 'ShCanvas',
2156
+ props: ['canvas_title', 'canvas_id', 'position'],
2157
+ components: {
2158
+ },
2159
+ data () {
2160
+ return {
2161
+ side: this.position === undefined ? 'offcanvas-bottom' : 'offcanvas-' + this.position
2162
+ }
2163
+ },
2164
+ methods: {
2165
+ modalClosed: function () {
2166
+ this.$emit('modalClosed');
2167
+ }
2168
+ }
2169
+ };
2170
+
2171
+ const _hoisted_1$4 = ["id"];
2172
+ const _hoisted_2$4 = { class: "offcanvas-header" };
2173
+ const _hoisted_3$4 = {
2174
+ class: "offcanvas-title",
2175
+ id: "offcanvasScrollingLabel"
2176
+ };
2177
+ const _hoisted_4$3 = { class: "offcanvas-body" };
2178
+
2179
+ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2180
+ return (vue.openBlock(), vue.createElementBlock("div", {
2181
+ class: vue.normalizeClass(["offcanvas", $data.side]),
2182
+ "data-bs-scroll": "true",
2183
+ tabindex: "-1",
2184
+ id: $props.canvas_id,
2185
+ "aria-labelledby": "offcanvasScrollingLabel"
2186
+ }, [
2187
+ vue.createElementVNode("div", _hoisted_2$4, [
2188
+ vue.createElementVNode("h5", _hoisted_3$4, vue.toDisplayString($props.canvas_title), 1 /* TEXT */),
2189
+ vue.createElementVNode("button", {
2190
+ type: "button",
2191
+ ref: "closecanvas",
2192
+ onClick: _cache[0] || (_cache[0] = (...args) => ($options.modalClosed && $options.modalClosed(...args))),
2193
+ class: "btn-close text-reset",
2194
+ "data-bs-dismiss": "offcanvas",
2195
+ "aria-label": "Close"
2196
+ }, null, 512 /* NEED_PATCH */)
2197
+ ]),
2198
+ vue.createElementVNode("div", _hoisted_4$3, [
2199
+ vue.renderSlot(_ctx.$slots, "default")
2200
+ ])
2201
+ ], 10 /* CLASS, PROPS */, _hoisted_1$4))
2202
+ }
2203
+
2204
+ script$4.render = render$4;
2205
+ script$4.__file = "src/views/ShCanvas.vue";
2206
+
2207
+ var script$3 = {
2208
+ name: 'ShModal',
2209
+ props: ['modal_title', 'modal_id', 'modal_size'],
2210
+ components: {
2211
+
2212
+ }
2213
+ };
2214
+
2215
+ const _hoisted_1$3 = ["id"];
2216
+ const _hoisted_2$3 = { class: "modal-content" };
2217
+ const _hoisted_3$3 = { class: "modal-header" };
2218
+ const _hoisted_4$2 = { class: "modal-title" };
2219
+ const _hoisted_5$2 = /*#__PURE__*/vue.createElementVNode("button", {
2220
+ class: "btn btn-danger btn-sm",
2221
+ "data-bs-dismiss": "modal",
2222
+ "data-dismiss": "modal"
2223
+ }, "×", -1 /* HOISTED */);
2224
+ const _hoisted_6$1 = { class: "modal-body" };
2225
+ const _hoisted_7$1 = { class: "section" };
2226
+
2227
+ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2228
+ return (vue.openBlock(), vue.createElementBlock("div", {
2229
+ class: "modal fade",
2230
+ tabindex: "-1",
2231
+ id: $props.modal_id,
2232
+ "data-focus": "false",
2233
+ "aria-hidden": "true"
2234
+ }, [
2235
+ vue.createElementVNode("div", {
2236
+ class: vue.normalizeClass(["modal-dialog", `modal-${$props.modal_size}`])
2237
+ }, [
2238
+ vue.createElementVNode("div", _hoisted_2$3, [
2239
+ vue.createElementVNode("div", _hoisted_3$3, [
2240
+ vue.createElementVNode("h3", _hoisted_4$2, vue.toDisplayString($props.modal_title), 1 /* TEXT */),
2241
+ _hoisted_5$2
2242
+ ]),
2243
+ vue.createElementVNode("div", _hoisted_6$1, [
2244
+ vue.createElementVNode("div", _hoisted_7$1, [
2245
+ vue.renderSlot(_ctx.$slots, "default")
2246
+ ])
2247
+ ])
2248
+ ])
2249
+ ], 2 /* CLASS */)
2250
+ ], 8 /* PROPS */, _hoisted_1$3))
2251
+ }
2252
+
2253
+ script$3.render = render$3;
2254
+ script$3.__file = "src/views/ShModal.vue";
2255
+
2256
+ var script$2 = {
2257
+ name: 'Pagination',
2258
+ props: ['pagination_data', 'loadMore', 'hideCount', 'hideLoadMore'],
2259
+ data () {
2260
+ return {
2261
+ current_page: this.pagination_data.current,
2262
+ per_page: this.pagination_data.per_page,
2263
+ loadingMore: 0
2264
+ }
2265
+ },
2266
+ methods: {
2267
+ changeTableKey: function (key, value) {
2268
+ this.$emit('changeKey', key, value);
2269
+ },
2270
+ changePerPage: function () {
2271
+ this.$emit('changeKey', 'per_page', this.per_page);
2272
+ },
2273
+ loadMoreRecords: function () {
2274
+ this.$emit('loadMoreRecords', 'now');
2275
+ }
2276
+ },
2277
+ computed: {
2278
+ getActivePage: function () {
2279
+ return this.pagination_data.current
2280
+ },
2281
+ getPerPage: function () {
2282
+ return this.per_page
2283
+ },
2284
+ getPages: function () {
2285
+ const pages = this.pagination_data.end;
2286
+ const current = this.pagination_data.current;
2287
+ var displayPages = [];
2288
+ if (pages < 13) {
2289
+ return this.pagination_data.end
2290
+ } else {
2291
+ if (current < 7) {
2292
+ for (let i = 1; i < 9; i++) {
2293
+ displayPages.push(i);
2294
+ }
2295
+ displayPages.push('...');
2296
+ displayPages.push(pages - 1);
2297
+ displayPages.push(pages);
2298
+ return displayPages
2299
+ } else if ((pages - current) < 6) {
2300
+ displayPages.push(1);
2301
+ displayPages.push(2);
2302
+ displayPages.push('...');
2303
+ var max = pages - 9;
2304
+ let l = 1;
2305
+ for (let i = pages; i > max; i--) {
2306
+ displayPages.push(max + l);
2307
+ l++;
2308
+ }
2309
+ return displayPages
2310
+ } else {
2311
+ displayPages.push(1);
2312
+ displayPages.push(2);
2313
+ displayPages.push('...');
2314
+ for (let i = current - 3; i < current + 4; i++) {
2315
+ displayPages.push(i);
2316
+ }
2317
+ displayPages.push('..');
2318
+ displayPages.push(pages - 1);
2319
+ displayPages.push(pages);
2320
+ return displayPages
2321
+ }
2322
+ }
2323
+ }
2324
+ }
2325
+ };
2326
+
2327
+ const _hoisted_1$2 = { key: 0 };
2328
+ const _hoisted_2$2 = { class: "record_count_body mb-3" };
2329
+ const _hoisted_3$2 = /*#__PURE__*/vue.createElementVNode("span", { class: "per_page_show" }, "Showing", -1 /* HOISTED */);
2330
+ const _hoisted_4$1 = /*#__PURE__*/vue.createTextVNode("  ");
2331
+ const _hoisted_5$1 = /*#__PURE__*/vue.createStaticVNode("<option value=\"10\">10</option><option value=\"25\">25</option><option value=\"50\">50</option><option value=\"100\">100</option><option value=\"200\">200</option>", 5);
2332
+ const _hoisted_10$1 = [
2333
+ _hoisted_5$1
2334
+ ];
2335
+ const _hoisted_11$1 = { class: "record_counts" };
2336
+ const _hoisted_12$1 = {
2337
+ key: 0,
2338
+ "aria-label": "Page navigation"
2339
+ };
2340
+ const _hoisted_13$1 = { class: "pagination" };
2341
+ const _hoisted_14$1 = {
2342
+ key: 0,
2343
+ class: "page-link"
2344
+ };
2345
+ const _hoisted_15$1 = {
2346
+ key: 1,
2347
+ class: "page-link"
2348
+ };
2349
+ const _hoisted_16$1 = ["onClick"];
2350
+ const _hoisted_17$1 = { key: 1 };
2351
+ const _hoisted_18$1 = {
2352
+ key: 0,
2353
+ class: "text-center"
2354
+ };
2355
+ const _hoisted_19$1 = /*#__PURE__*/vue.createElementVNode("div", {
2356
+ class: "spinner-border",
2357
+ role: "status"
2358
+ }, null, -1 /* HOISTED */);
2359
+ const _hoisted_20$1 = [
2360
+ _hoisted_19$1
2361
+ ];
2362
+ const _hoisted_21$1 = {
2363
+ key: 1,
2364
+ class: "text-center"
2365
+ };
2366
+ const _hoisted_22$1 = { class: "per_page_show" };
2367
+ const _hoisted_23$1 = {
2368
+ key: 2,
2369
+ class: "text-center"
2370
+ };
2371
+
2372
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
2373
+ return (!$props.loadMore)
2374
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
2375
+ vue.createElementVNode("div", _hoisted_2$2, [
2376
+ _hoisted_3$2,
2377
+ _hoisted_4$1,
2378
+ vue.withDirectives(vue.createElementVNode("select", {
2379
+ class: "select_per_page",
2380
+ onChange: _cache[0] || (_cache[0] = (...args) => ($options.changePerPage && $options.changePerPage(...args))),
2381
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.per_page) = $event))
2382
+ }, _hoisted_10$1, 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
2383
+ [vue.vModelSelect, $data.per_page]
2384
+ ]),
2385
+ vue.createElementVNode("span", _hoisted_11$1, " of " + vue.toDisplayString($props.pagination_data.record_count) + " items", 1 /* TEXT */)
2386
+ ]),
2387
+ ($props.pagination_data != null)
2388
+ ? (vue.openBlock(), vue.createElementBlock("nav", _hoisted_12$1, [
2389
+ vue.createElementVNode("ul", _hoisted_13$1, [
2390
+ vue.createElementVNode("li", {
2391
+ class: vue.normalizeClass([$options.getActivePage === 1 ? 'disabled' : '' , "page-item"])
2392
+ }, [
2393
+ vue.createElementVNode("a", {
2394
+ onClick: _cache[2] || (_cache[2] = $event => ($options.changeTableKey('page',$options.getActivePage - 1))),
2395
+ class: "page-link"
2396
+ }, "«")
2397
+ ], 2 /* CLASS */),
2398
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.getPages, (page) => {
2399
+ return (vue.openBlock(), vue.createElementBlock("li", {
2400
+ class: vue.normalizeClass(["page-item", $options.getActivePage === page ? 'active':'']),
2401
+ key: page
2402
+ }, [
2403
+ ($options.getActivePage === page)
2404
+ ? (vue.openBlock(), vue.createElementBlock("a", _hoisted_14$1, vue.toDisplayString(page), 1 /* TEXT */))
2405
+ : (['..','...'].includes(page))
2406
+ ? (vue.openBlock(), vue.createElementBlock("a", _hoisted_15$1, vue.toDisplayString(page), 1 /* TEXT */))
2407
+ : (vue.openBlock(), vue.createElementBlock("a", {
2408
+ key: 2,
2409
+ onClick: $event => ($options.changeTableKey('page',page)),
2410
+ class: "page-link"
2411
+ }, vue.toDisplayString(page), 9 /* TEXT, PROPS */, _hoisted_16$1))
2412
+ ], 2 /* CLASS */))
2413
+ }), 128 /* KEYED_FRAGMENT */)),
2414
+ vue.createElementVNode("li", {
2415
+ class: vue.normalizeClass([$options.getActivePage === this.pagination_data.end ? 'disabled' : '' , "page-item"])
2416
+ }, [
2417
+ vue.createElementVNode("a", {
2418
+ onClick: _cache[3] || (_cache[3] = $event => ($options.changeTableKey('page',$options.getActivePage + 1))),
2419
+ class: "page-link"
2420
+ }, "»")
2421
+ ], 2 /* CLASS */)
2422
+ ])
2423
+ ]))
2424
+ : vue.createCommentVNode("v-if", true)
2425
+ ]))
2426
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$1, [
2427
+ (this.pagination_data.loading === 1)
2428
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$1, _hoisted_20$1))
2429
+ : vue.createCommentVNode("v-if", true),
2430
+ (!$props.hideCount)
2431
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_21$1, [
2432
+ vue.createElementVNode("span", _hoisted_22$1, "Showing " + vue.toDisplayString($props.pagination_data.displayCount) + " of " + vue.toDisplayString($props.pagination_data.record_count) + " items", 1 /* TEXT */)
2433
+ ]))
2434
+ : vue.createCommentVNode("v-if", true),
2435
+ (this.pagination_data.loading !== 1 && $props.pagination_data.displayCount < $props.pagination_data.record_count && !$props.hideLoadMore)
2436
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_23$1, [
2437
+ vue.createElementVNode("button", {
2438
+ class: "btn btn-sm btn-primary mt-1",
2439
+ onClick: _cache[4] || (_cache[4] = (...args) => ($options.loadMoreRecords && $options.loadMoreRecords(...args)))
2440
+ }, "Load More")
2441
+ ]))
2442
+ : vue.createCommentVNode("v-if", true)
2443
+ ]))
2444
+ }
2445
+
2446
+ script$2.render = render$2;
2447
+ script$2.__file = "src/views/list_templates/Pagination.vue";
2448
+
2449
+ function swalSuccess (message) {
2450
+ Swal__default["default"].fire('Success!', message, 'success');
2451
+ }
2452
+ function swalError (message) {
2453
+ Swal__default["default"].fire('Error!', message, 'error');
2454
+ }
2455
+
2456
+ function swalHttpError (reason) {
2457
+ let error = '';
2458
+ if (typeof reason !== 'undefined') {
2459
+ if (typeof reason.response !== 'undefined') {
2460
+ let reasonString = '';
2461
+ if (typeof reason.response.data === 'string') {
2462
+ reasonString = reason.response.data;
2463
+ } else {
2464
+ reasonString = JSON.stringify(reason.response.data);
2465
+ }
2466
+ error = reason.response.status + ': ' + reason.response.statusText + '<br/>' + reasonString;
2467
+ } else {
2468
+ if (typeof reason !== 'string') {
2469
+ error = 'A Unexpected script error occurred<br/>' + JSON.stringify(reason);
2470
+ } else {
2471
+ error = 'A Unexpected script error occurred<br/>' + JSON.stringify(reason);
2472
+ }
2473
+ }
2474
+ } else {
2475
+ if (typeof reason !== 'string') {
2476
+ error = 'A Unexpected script error occurred<br/>' + JSON.stringify(reason);
2477
+ } else {
2478
+ error = 'A Unexpected script error occurred<br/>' + JSON.stringify(reason);
2479
+ }
2480
+ }
2481
+ Swal__default["default"].fire('Error!', error, 'error');
2482
+ }
2483
+
2484
+ function runSilentRequest (url) {
2485
+ return apis.doPost(url)
2486
+ }
2487
+
2488
+ function setTabCounts (url) {
2489
+ apis.doGet(url).then(res => {
2490
+ Object.keys(res.data).forEach(key => {
2491
+ const elem = document.getElementById(key);
2492
+ if (elem === null) {
2493
+ return
2494
+ }
2495
+ if (typeof elem !== 'undefined') {
2496
+ let txt = elem.innerHTML;
2497
+ txt = txt.split('<i class="d-none"></i>')[0];
2498
+ if (parseInt(res.data[key]) > 0) {
2499
+ elem.innerHTML = txt + '<i class="d-none"></i><sup class="rounded-circle p-1 bg-info text-white">' + res.data[key] + '</sup>';
2500
+ }
2501
+ }
2502
+ // document.getElementById(key).innerHTML res.data[key]
2503
+ });
2504
+ });
2505
+ }
2506
+ function formatHttpCatchError (reason) {
2507
+ console.log(reason);
2508
+ let error = '';
2509
+ if (typeof reason !== 'undefined') {
2510
+ if (typeof reason.response !== 'undefined') {
2511
+ alert('here');
2512
+ let reasonString = '';
2513
+ if (typeof reason.response.data === 'string') {
2514
+ reasonString = reason.response.data;
2515
+ } else {
2516
+ reasonString = JSON.stringify(reason.response.data);
2517
+ }
2518
+ error = reason.response.status + ': ' + reason.response.statusText + '<br/>' + reasonString;
2519
+ } else {
2520
+ if (typeof reason !== 'string') {
2521
+ error = 'A Unexpected script error occurred<br/>' + JSON.stringify(reason);
2522
+ } else {
2523
+ error = 'A Unexpected script error occurred<br/>' + JSON.stringify(reason);
2524
+ }
2525
+ }
2526
+ } else {
2527
+ if (typeof reason !== 'string') {
2528
+ error = 'A Unexpected script error occurred<br/>' + JSON.stringify(reason);
2529
+ } else {
2530
+ error = 'A Unexpected script error occurred<br/>' + JSON.stringify(reason);
2531
+ }
2532
+ }
2533
+ return error
2534
+ }
2535
+ function getMenuCount (url) {
2536
+ apis.doGet(url).then(res => {
2537
+ console.log(res);
2538
+ });
2539
+ }
2540
+ const Toast = Swal__default["default"].mixin({
2541
+ toast: true,
2542
+ position: 'top-end',
2543
+ showConfirmButton: false,
2544
+ customClass: {
2545
+ popup: 'colored-toast'
2546
+ },
2547
+ iconColor: 'white',
2548
+ timer: 2000,
2549
+ timerProgressBar: true,
2550
+ didOpen: (toast) => {
2551
+ toast.addEventListener('mouseenter', Swal__default["default"].stopTimer);
2552
+ toast.addEventListener('mouseleave', Swal__default["default"].resumeTimer);
2553
+ }
2554
+ });
2555
+ function showToast (message, toastType) {
2556
+ if (!toastType) {
2557
+ toastType = 'success';
2558
+ }
2559
+ Toast.fire({
2560
+ icon: toastType,
2561
+ title: message
2562
+ });
2563
+ }
2564
+
2565
+ async function runPlainRequest (url, message, title, data) {
2566
+ if (typeof title === 'undefined') {
2567
+ title = null;
2568
+ }
2569
+ return Swal__default["default"].fire({
2570
+ title: title !== null ? title : 'Are you sure?',
2571
+ html: message,
2572
+ showCancelButton: true,
2573
+ confirmButtonColor: '#32c787',
2574
+ cancelButtonText: 'No, cancel',
2575
+ confirmButtonText: 'Yes, Proceed!',
2576
+ reverseButtons: true,
2577
+ showLoaderOnConfirm: true,
2578
+ preConfirm: () => {
2579
+ return apis.doPost(url, data).then(function (response) {
2580
+ Swal__default["default"].fire('Success!', 'Action completed successfully', 'success');
2581
+ return {
2582
+ response: response.data,
2583
+ success: true
2584
+ }
2585
+ })
2586
+ .catch(reason => {
2587
+ if (typeof reason.response === 'undefined') {
2588
+ Swal__default["default"].fire('Error!', `Connection to ${url} lost`, 'error');
2589
+ } else {
2590
+ Swal__default["default"].fire(`Error ${reason.response.status}`, reason.response.statusText, 'error');
2591
+ }
2592
+ return {
2593
+ success: false
2594
+ }
2595
+ })
2596
+ },
2597
+ allowOutsideClick: () => !Swal__default["default"].isLoading()
2598
+ })
2599
+ }
2600
+
2601
+ function formatDate(date, format) {
2602
+ if (!format) {
2603
+ format = 'lll';
2604
+ }
2605
+ return moment__default["default"](date).format(format)
2606
+ }
2607
+
2608
+ var helpers = {
2609
+ swalSuccess,
2610
+ swalError,
2611
+ runPlainRequest,
2612
+ getMenuCount,
2613
+ setTabCounts,
2614
+ showToast,
2615
+ runSilentRequest,
2616
+ swalHttpError,
2617
+ formatHttpCatchError,
2618
+ formatDate
2619
+ };
2620
+
2621
+ var script$1 = {
2622
+ name: 'sh-table',
2623
+ props: ['end_point', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'mobile_view', 'hideSearch', 'custom_template', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields'],
2624
+ inject: ['channel', 'global'],
2625
+ data () {
2626
+ return {
2627
+ order_by: '',
2628
+ order_method: '',
2629
+ per_page: this.pageCount ? this.pageCount : 30,
2630
+ page: 1,
2631
+ filter_value: '',
2632
+ loading: 'loading',
2633
+ loading_error: '',
2634
+ records: [],
2635
+ total: 0,
2636
+ pagination_data: null,
2637
+ moreDetailsId: null,
2638
+ moreDetailsModel: null,
2639
+ downloading: false,
2640
+ appUrl: undefined.VITE_APP_API_URL
2641
+ }
2642
+ },
2643
+ mounted () {
2644
+ if (this.event) ;
2645
+ },
2646
+ methods: {
2647
+ newRecordAdded: function (ev) {
2648
+ const record = ev.log;
2649
+ if (record.user) {
2650
+ record.user = record.user.name;
2651
+ }
2652
+ this.records.unshift(record);
2653
+ console.log(event, record);
2654
+ },
2655
+ rowSelected: function (row) {
2656
+ this.$emit('rowSelected', row);
2657
+ },
2658
+ changeKey: function (key, value) {
2659
+ this[key] = value;
2660
+ if (key === 'order_by') {
2661
+ this.order_method = (this.order_method === 'desc') ? 'asc' : 'desc';
2662
+ }
2663
+ if (key === 'per_page') {
2664
+ this.page = 1;
2665
+ }
2666
+ this.reloadData();
2667
+ },
2668
+ getLinkClass: function (config) {
2669
+ console.log(config);
2670
+ if (typeof config === 'object') {
2671
+ return config.class
2672
+ }
2673
+ return ''
2674
+ },
2675
+ reloadNotifications: function () {
2676
+ this.reloadData();
2677
+ },
2678
+ replaceActionUrl: function (path, obj) {
2679
+ if (path) {
2680
+ var matches = path.match(/\{(.*?)\}/g);
2681
+ matches.forEach(key => {
2682
+ key = key.replace('{', '');
2683
+ key = key.replace('}', '');
2684
+ path = path.replace(`{${key}}`, obj[key]);
2685
+ });
2686
+ return path
2687
+ }
2688
+ return ''
2689
+ },
2690
+ doEmitAction: function (action, data) {
2691
+ if (typeof action === 'function') {
2692
+ action(data);
2693
+ } else {
2694
+ this.$emit(action, data);
2695
+ }
2696
+ },
2697
+ getFieldType: function (field) {
2698
+ const numbers = ['age', 'interest_rate_pa'];
2699
+ const moneys = ['amount', 'paid_amount', 'total_paid', 'total', 'monthly_fee', 'share_cost', 'min_contribution', 'min_membership_contribution'];
2700
+ const dates = ['invoice_date', 'free_tier_days', 'updated_at', 'created_at', 'end_time'];
2701
+ if (numbers.includes(field)) {
2702
+ return 'numeric'
2703
+ }
2704
+ if (moneys.includes(field)) {
2705
+ return 'money'
2706
+ }
2707
+ if (dates.includes(field)) {
2708
+ return 'date'
2709
+ }
2710
+ return 'string'
2711
+ },
2712
+ replaceLinkUrl: function (path, obj) {
2713
+ if (typeof path === 'object') {
2714
+ path = path.link;
2715
+ }
2716
+ var matches = path.match(/\{(.*?)\}/g);
2717
+ matches.forEach(key => {
2718
+ key = key.replace('{', '');
2719
+ key = key.replace('}', '');
2720
+ path = path.replace(`{${key}}`, obj[key]);
2721
+ });
2722
+ return path
2723
+ },
2724
+ formatDate: function (date) {
2725
+ return moment__default["default"](date).format('lll')
2726
+ },
2727
+ setMoreDetailsModel: function (row) {
2728
+ this.moreDetailsModel = null;
2729
+ this.moreDetailsModel = row;
2730
+ },
2731
+ loadMoreRecords: function () {
2732
+ this.reloadData(this.page + 1, 1);
2733
+ },
2734
+ exportData: function (template) {
2735
+ this.downloading = true;
2736
+ const headers = [];
2737
+ const fields = this.downloadFields ? this.downloadFields : this.headers;
2738
+ fields.forEach(header => {
2739
+ if (typeof header === 'string') {
2740
+ headers.push(header);
2741
+ }
2742
+ });
2743
+ const data = {
2744
+ titles: headers,
2745
+ export: 1
2746
+ };
2747
+ apis.doPost(this.end_point, data).then(res => {
2748
+ this.downloading = false;
2749
+ if (res.data.file) {
2750
+ const url = this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name;
2751
+ window.location.href = url;
2752
+ // window.open('https://facebook.com')
2753
+ // window.open(this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name, '_blank').focus()
2754
+ }
2755
+ }).catch(reason => {
2756
+ console.log(reason);
2757
+ this.downloading = false;
2758
+ const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText}`;
2759
+ helpers.swalError('Error', error);
2760
+ });
2761
+ },
2762
+ reloadData: function (page, append) {
2763
+ if (typeof page !== 'undefined') { this.page = page; }
2764
+ if (!append) {
2765
+ this.loading = 'loading';
2766
+ }
2767
+ const data = {
2768
+ order_by: this.order_by,
2769
+ order_method: this.order_method,
2770
+ per_page: this.per_page,
2771
+ page: this.page,
2772
+ filter_value: this.filter_value
2773
+ };
2774
+ if (this.pagination_data) {
2775
+ this.pagination_data.loading = 1;
2776
+ }
2777
+ apis.doGet(this.end_point, data).then(req => {
2778
+ this.loading = 'done';
2779
+ const response = req.data.data;
2780
+ this.pagination_data = {
2781
+ current: response.current_page,
2782
+ start: response.from,
2783
+ end: response.last_page,
2784
+ record_count: response.total,
2785
+ per_page: response.per_page,
2786
+ loading: 0,
2787
+ displayCount: response.total > response.per_page ? response.per_page : response.total
2788
+ };
2789
+ if (append) {
2790
+ this.records.push(...response.data);
2791
+ let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
2792
+ if (totalShown > response.total) {
2793
+ totalShown = response.total;
2794
+ }
2795
+ this.pagination_data.displayCount = totalShown;
2796
+ const scrollingElement = (document.scrollingElement || document.body);
2797
+ scrollingElement.scrollTop = scrollingElement.scrollHeight;
2798
+ // const all = []
2799
+ // console.log(all.push(response.data))
2800
+ // console.log(this.records, response.data)
2801
+ } else {
2802
+ this.records = response.data;
2803
+ }
2804
+ }).catch(reason => {
2805
+ const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText} (${this.end_point})`;
2806
+ this.loading_error = error;
2807
+ this.loading = 'error';
2808
+ });
2809
+ }
2810
+ },
2811
+ watch: {
2812
+ reload () {
2813
+ this.reloadData();
2814
+ }
2815
+ },
2816
+ created () {
2817
+ this.reloadData();
2818
+ },
2819
+ components: {
2820
+ pagination: script$2
2821
+ },
2822
+ computed: {
2823
+ windowWidth: function () {
2824
+ return window.innerWidth
2825
+ },
2826
+ hasDefaultSlot () {
2827
+ return !!this.$slots.default
2828
+ },
2829
+ user () {
2830
+ return this.global.state.user
2831
+ }
2832
+ }
2833
+ };
2834
+
2835
+ const _withScopeId = n => (vue.pushScopeId("data-v-a10546a2"),n=n(),vue.popScopeId(),n);
2836
+ const _hoisted_1$1 = { class: "auto-table mt-2" };
2837
+ const _hoisted_2$1 = {
2838
+ key: 0,
2839
+ class: "col-md-4 mb-2"
2840
+ };
2841
+ const _hoisted_3$1 = ["disabled"];
2842
+ const _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/vue.createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */));
2843
+ const _hoisted_5 = /*#__PURE__*/vue.createTextVNode(" Export ");
2844
+ const _hoisted_6 = {
2845
+ key: 0,
2846
+ style: {"height":"1rem"},
2847
+ class: "float-start",
2848
+ src: "/assets/img/spinner.gif"
2849
+ };
2850
+ const _hoisted_7 = /*#__PURE__*/vue.createTextVNode(" Exporting ... ");
2851
+ const _hoisted_8 = {
2852
+ key: 1,
2853
+ class: "row"
2854
+ };
2855
+ const _hoisted_9 = { class: "col-12 mb-3" };
2856
+ const _hoisted_10 = { class: "sh-search-bar" };
2857
+ const _hoisted_11 = ["placeholder"];
2858
+ const _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/vue.createElementVNode("span", { class: "sh-search-icon" }, [
2859
+ /*#__PURE__*/vue.createElementVNode("i", { class: "bi bi-search mb-0" })
2860
+ ], -1 /* HOISTED */));
2861
+ const _hoisted_13 = {
2862
+ key: 2,
2863
+ class: "table"
2864
+ };
2865
+ const _hoisted_14 = ["onClick"];
2866
+ const _hoisted_15 = ["onClick"];
2867
+ const _hoisted_16 = ["onClick"];
2868
+ const _hoisted_17 = {
2869
+ key: 0,
2870
+ class: "text-capitalize"
2871
+ };
2872
+ const _hoisted_18 = {
2873
+ key: 0,
2874
+ class: "text-center"
2875
+ };
2876
+ const _hoisted_19 = ["colspan"];
2877
+ const _hoisted_20 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/vue.createElementVNode("img", { src: "/assets/img/loading.gif" }, null, -1 /* HOISTED */));
2878
+ const _hoisted_21 = [
2879
+ _hoisted_20
2880
+ ];
2881
+ const _hoisted_22 = {
2882
+ key: 1,
2883
+ class: "text-center alert alert-danger"
2884
+ };
2885
+ const _hoisted_23 = ["colspan"];
2886
+ const _hoisted_24 = {
2887
+ key: 2,
2888
+ class: "text-center alert alert-info no_records"
2889
+ };
2890
+ const _hoisted_25 = ["colspan"];
2891
+ const _hoisted_26 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/vue.createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */));
2892
+ const _hoisted_27 = /*#__PURE__*/vue.createTextVNode(" No records found ");
2893
+ const _hoisted_28 = [
2894
+ _hoisted_26,
2895
+ _hoisted_27
2896
+ ];
2897
+ const _hoisted_29 = ["onClick"];
2898
+ const _hoisted_30 = { key: 1 };
2899
+ const _hoisted_31 = {
2900
+ key: 2,
2901
+ class: "text-success fw-bold"
2902
+ };
2903
+ const _hoisted_32 = { key: 3 };
2904
+ const _hoisted_33 = ["innerHTML"];
2905
+ const _hoisted_34 = ["innerHTML"];
2906
+ const _hoisted_35 = ["innerHTML"];
2907
+ const _hoisted_36 = {
2908
+ key: 0,
2909
+ style: {"white-space":"nowrap"}
2910
+ };
2911
+ const _hoisted_37 = ["title", "onClick"];
2912
+ const _hoisted_38 = { key: 3 };
2913
+ const _hoisted_39 = {
2914
+ key: 0,
2915
+ class: "text-center"
2916
+ };
2917
+ const _hoisted_40 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/vue.createElementVNode("span", { colspan: 2 }, [
2918
+ /*#__PURE__*/vue.createElementVNode("img", { src: "/assets/img/loading.gif" })
2919
+ ], -1 /* HOISTED */));
2920
+ const _hoisted_41 = [
2921
+ _hoisted_40
2922
+ ];
2923
+ const _hoisted_42 = { key: 1 };
2924
+ const _hoisted_43 = { colspan: 2 };
2925
+ const _hoisted_44 = {
2926
+ key: 2,
2927
+ class: "mobile-list-items"
2928
+ };
2929
+ const _hoisted_45 = ["onClick"];
2930
+ const _hoisted_46 = {
2931
+ key: 0,
2932
+ class: "mb-1 font-weight-bold text-capitalize profile-form-title"
2933
+ };
2934
+ const _hoisted_47 = {
2935
+ key: 1,
2936
+ class: "mb-1 font-weight-bold text-capitalize profile-form-title"
2937
+ };
2938
+ const _hoisted_48 = {
2939
+ key: 2,
2940
+ class: "mb-1 font-weight-bold text-capitalize profile-form-title"
2941
+ };
2942
+ const _hoisted_49 = { key: 1 };
2943
+ const _hoisted_50 = {
2944
+ key: 2,
2945
+ class: "text-primary fw-bold"
2946
+ };
2947
+ const _hoisted_51 = ["innerHTML"];
2948
+ const _hoisted_52 = ["innerHTML"];
2949
+ const _hoisted_53 = ["innerHTML"];
2950
+ const _hoisted_54 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/vue.createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */));
2951
+ const _hoisted_55 = { key: 0 };
2952
+ const _hoisted_56 = ["title", "onClick"];
2953
+
2954
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
2955
+ const _component_router_link = vue.resolveComponent("router-link");
2956
+ const _component_pagination = vue.resolveComponent("pagination");
2957
+
2958
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
2959
+ ($props.hasDownload)
2960
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
2961
+ vue.createElementVNode("button", {
2962
+ disabled: $data.downloading,
2963
+ class: "btn btn-warning btn-sm",
2964
+ onClick: _cache[0] || (_cache[0] = $event => ($options.exportData()))
2965
+ }, [
2966
+ (!$data.downloading)
2967
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
2968
+ _hoisted_4,
2969
+ _hoisted_5
2970
+ ], 64 /* STABLE_FRAGMENT */))
2971
+ : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
2972
+ ($data.downloading)
2973
+ ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_6))
2974
+ : vue.createCommentVNode("v-if", true),
2975
+ _hoisted_7
2976
+ ], 64 /* STABLE_FRAGMENT */))
2977
+ ], 8 /* PROPS */, _hoisted_3$1)
2978
+ ]))
2979
+ : vue.createCommentVNode("v-if", true),
2980
+ (!$props.hideSearch)
2981
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
2982
+ vue.createElementVNode("div", _hoisted_9, [
2983
+ vue.createElementVNode("div", _hoisted_10, [
2984
+ vue.withDirectives(vue.createElementVNode("input", {
2985
+ type: "text",
2986
+ onChange: _cache[1] || (_cache[1] = $event => ($options.reloadData(1))),
2987
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (($data.filter_value) = $event)),
2988
+ placeholder: $props.searchPlaceholder ? $props.searchPlaceholder : 'Search',
2989
+ class: "form-control sh-search-input"
2990
+ }, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_11), [
2991
+ [vue.vModelText, $data.filter_value]
2992
+ ]),
2993
+ _hoisted_12
2994
+ ])
2995
+ ])
2996
+ ]))
2997
+ : vue.createCommentVNode("v-if", true),
2998
+ ($options.windowWidth > 700)
2999
+ ? (vue.openBlock(), vue.createElementBlock("table", _hoisted_13, [
3000
+ vue.createElementVNode("thead", null, [
3001
+ vue.createElementVNode("tr", null, [
3002
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (title) => {
3003
+ return (vue.openBlock(), vue.createElementBlock("th", {
3004
+ key: title[0]
3005
+ }, [
3006
+ (typeof title === 'string')
3007
+ ? (vue.openBlock(), vue.createElementBlock("a", {
3008
+ key: 0,
3009
+ class: "text-capitalize",
3010
+ onClick: $event => ($options.changeKey('order_by',title))
3011
+ }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_14))
3012
+ : (typeof title === 'function')
3013
+ ? (vue.openBlock(), vue.createElementBlock("a", {
3014
+ key: 1,
3015
+ class: "text-capitalize",
3016
+ onClick: $event => ($options.changeKey('order_by',title))
3017
+ }, vue.toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_15))
3018
+ : (vue.openBlock(), vue.createElementBlock("a", {
3019
+ key: 2,
3020
+ class: "text-capitalize",
3021
+ onClick: $event => ($options.changeKey('order_by',title[0]))
3022
+ }, vue.toDisplayString(title[1].replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_16))
3023
+ ]))
3024
+ }), 128 /* KEYED_FRAGMENT */)),
3025
+ ($props.actions)
3026
+ ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_17, vue.toDisplayString($props.actions.label), 1 /* TEXT */))
3027
+ : vue.createCommentVNode("v-if", true)
3028
+ ])
3029
+ ]),
3030
+ vue.createElementVNode("tbody", null, [
3031
+ ($data.loading === 'loading')
3032
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_18, [
3033
+ vue.createElementVNode("td", {
3034
+ colspan: $props.headers.length
3035
+ }, _hoisted_21, 8 /* PROPS */, _hoisted_19)
3036
+ ]))
3037
+ : ($data.loading === 'error')
3038
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_22, [
3039
+ vue.createElementVNode("td", {
3040
+ colspan: $props.headers.length
3041
+ }, vue.toDisplayString($data.loading_error), 9 /* TEXT, PROPS */, _hoisted_23)
3042
+ ]))
3043
+ : ($data.records.length === 0)
3044
+ ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_24, [
3045
+ vue.createElementVNode("td", {
3046
+ colspan: $props.actions ? $props.headers.length + 1 : $props.headers.length
3047
+ }, _hoisted_28, 8 /* PROPS */, _hoisted_25)
3048
+ ]))
3049
+ : ($data.loading === 'done')
3050
+ ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList($data.records, (record, index) => {
3051
+ return (vue.openBlock(), vue.createElementBlock("tr", {
3052
+ key: record.id,
3053
+ class: vue.normalizeClass(record.class),
3054
+ onClick: $event => ($options.rowSelected(record))
3055
+ }, [
3056
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (key) => {
3057
+ return (vue.openBlock(), vue.createElementBlock("td", {
3058
+ key: key[0]
3059
+ }, [
3060
+ (typeof key === 'string' && $props.links && $props.links[key])
3061
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3062
+ key: 0,
3063
+ to: $options.replaceLinkUrl($props.links[key],record),
3064
+ class: vue.normalizeClass($options.getLinkClass($props.links[key])),
3065
+ innerHTML: record[key]
3066
+ }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3067
+ : ($options.getFieldType(key) === 'numeric')
3068
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_30, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3069
+ : ($options.getFieldType(key) === 'money')
3070
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_31, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3071
+ : ($options.getFieldType(key) === 'date')
3072
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_32, vue.toDisplayString($options.formatDate(record[key])), 1 /* TEXT */))
3073
+ : (typeof key === 'string')
3074
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3075
+ key: 4,
3076
+ innerHTML: record[key]
3077
+ }, null, 8 /* PROPS */, _hoisted_33))
3078
+ : (typeof key === 'function')
3079
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3080
+ key: 5,
3081
+ innerHTML: key(record, index)
3082
+ }, null, 8 /* PROPS */, _hoisted_34))
3083
+ : (vue.openBlock(), vue.createElementBlock("span", {
3084
+ key: 6,
3085
+ innerHTML: record[key[0]]
3086
+ }, null, 8 /* PROPS */, _hoisted_35))
3087
+ ]))
3088
+ }), 128 /* KEYED_FRAGMENT */)),
3089
+ ($props.actions)
3090
+ ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_36, [
3091
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.actions.actions, (act) => {
3092
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3093
+ key: act.path
3094
+ }, [
3095
+ (!act.permission || $options.user.isAllowedTo(act.permission))
3096
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3097
+ (!act.validator || act.validator(record))
3098
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3099
+ (act.emits)
3100
+ ? (vue.openBlock(), vue.createElementBlock("button", {
3101
+ key: 0,
3102
+ title: act.title,
3103
+ class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
3104
+ onClick: $event => ($options.doEmitAction(act.emits,record))
3105
+ }, vue.toDisplayString(act.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_37))
3106
+ : vue.createCommentVNode("v-if", true),
3107
+ (!act.emits)
3108
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3109
+ key: 1,
3110
+ title: act.title,
3111
+ to: $options.replaceActionUrl(act.path,record),
3112
+ class: vue.normalizeClass(act.class)
3113
+ }, {
3114
+ default: vue.withCtx(() => [
3115
+ vue.createTextVNode(vue.toDisplayString(act.label), 1 /* TEXT */)
3116
+ ]),
3117
+ _: 2 /* DYNAMIC */
3118
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3119
+ : vue.createCommentVNode("v-if", true)
3120
+ ], 64 /* STABLE_FRAGMENT */))
3121
+ : vue.createCommentVNode("v-if", true)
3122
+ ], 64 /* STABLE_FRAGMENT */))
3123
+ : vue.createCommentVNode("v-if", true)
3124
+ ], 64 /* STABLE_FRAGMENT */))
3125
+ }), 128 /* KEYED_FRAGMENT */))
3126
+ ]))
3127
+ : vue.createCommentVNode("v-if", true)
3128
+ ], 10 /* CLASS, PROPS */, _hoisted_29))
3129
+ }), 128 /* KEYED_FRAGMENT */))
3130
+ : vue.createCommentVNode("v-if", true)
3131
+ ])
3132
+ ]))
3133
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_38, [
3134
+ ($data.loading === 'loading')
3135
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_39, _hoisted_41))
3136
+ : ($data.loading === 'error')
3137
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_42, [
3138
+ vue.createElementVNode("span", _hoisted_43, vue.toDisplayString($data.loading_error), 1 /* TEXT */)
3139
+ ]))
3140
+ : ($data.loading === 'done')
3141
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_44, [
3142
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.records, (record, index) => {
3143
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3144
+ key: record.id
3145
+ }, [
3146
+ vue.createElementVNode("h3", null, vue.toDisplayString($props.mobile_view), 1 /* TEXT */),
3147
+ vue.createElementVNode("div", {
3148
+ class: "single-mobile-req bg-light p-3",
3149
+ onClick: $event => ($options.rowSelected(record))
3150
+ }, [
3151
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.headers, (key) => {
3152
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3153
+ key: key[0]
3154
+ }, [
3155
+ (typeof key === 'string' )
3156
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_46, vue.toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
3157
+ : (typeof key === 'function')
3158
+ ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_47, vue.toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
3159
+ : (vue.openBlock(), vue.createElementBlock("p", _hoisted_48, vue.toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
3160
+ vue.createElementVNode("span", null, [
3161
+ (typeof key === 'string' && $props.links && $props.links[key])
3162
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3163
+ key: 0,
3164
+ to: $options.replaceLinkUrl($props.links[key],record),
3165
+ class: vue.normalizeClass($options.getLinkClass($props.links[key])),
3166
+ innerHTML: record[key]
3167
+ }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
3168
+ : ($options.getFieldType(key) === 'numeric')
3169
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_49, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3170
+ : ($options.getFieldType(key) === 'money')
3171
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_50, "KES " + vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
3172
+ : (typeof key === 'string')
3173
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3174
+ key: 3,
3175
+ innerHTML: record[key]
3176
+ }, null, 8 /* PROPS */, _hoisted_51))
3177
+ : (typeof key === 'function')
3178
+ ? (vue.openBlock(), vue.createElementBlock("span", {
3179
+ key: 4,
3180
+ innerHTML: key(record, index )
3181
+ }, null, 8 /* PROPS */, _hoisted_52))
3182
+ : (vue.openBlock(), vue.createElementBlock("span", {
3183
+ key: 5,
3184
+ innerHTML: record[key[0]]
3185
+ }, null, 8 /* PROPS */, _hoisted_53))
3186
+ ]),
3187
+ _hoisted_54
3188
+ ], 64 /* STABLE_FRAGMENT */))
3189
+ }), 128 /* KEYED_FRAGMENT */)),
3190
+ ($props.actions)
3191
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_55, [
3192
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.actions.actions, (act) => {
3193
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
3194
+ key: act.path
3195
+ }, [
3196
+ (!act.permission || $options.user.isAllowedTo(act.permission))
3197
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3198
+ (!act.validator || act.validator(record))
3199
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3200
+ (act.emits)
3201
+ ? (vue.openBlock(), vue.createElementBlock("button", {
3202
+ key: 0,
3203
+ title: act.title,
3204
+ class: vue.normalizeClass(act.class ? act.class:'btn btn-default'),
3205
+ onClick: $event => ($options.doEmitAction(act.emits,record))
3206
+ }, vue.toDisplayString(act.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_56))
3207
+ : vue.createCommentVNode("v-if", true),
3208
+ (!act.emits)
3209
+ ? (vue.openBlock(), vue.createBlock(_component_router_link, {
3210
+ key: 1,
3211
+ title: act.title,
3212
+ to: $options.replaceActionUrl(act.path,record),
3213
+ class: vue.normalizeClass(act.class)
3214
+ }, {
3215
+ default: vue.withCtx(() => [
3216
+ vue.createTextVNode(vue.toDisplayString(act.label), 1 /* TEXT */)
3217
+ ]),
3218
+ _: 2 /* DYNAMIC */
3219
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "to", "class"]))
3220
+ : vue.createCommentVNode("v-if", true)
3221
+ ], 64 /* STABLE_FRAGMENT */))
3222
+ : vue.createCommentVNode("v-if", true)
3223
+ ], 64 /* STABLE_FRAGMENT */))
3224
+ : vue.createCommentVNode("v-if", true)
3225
+ ], 64 /* STABLE_FRAGMENT */))
3226
+ }), 128 /* KEYED_FRAGMENT */))
3227
+ ]))
3228
+ : vue.createCommentVNode("v-if", true)
3229
+ ], 8 /* PROPS */, _hoisted_45)
3230
+ ], 64 /* STABLE_FRAGMENT */))
3231
+ }), 128 /* KEYED_FRAGMENT */))
3232
+ ]))
3233
+ : vue.createCommentVNode("v-if", true)
3234
+ ])),
3235
+ ($data.pagination_data)
3236
+ ? (vue.openBlock(), vue.createBlock(_component_pagination, {
3237
+ key: 4,
3238
+ onLoadMoreRecords: $options.loadMoreRecords,
3239
+ "hide-load-more": $props.hideLoadMore,
3240
+ "hide-count": $props.hideCount,
3241
+ pagination_data: $data.pagination_data,
3242
+ onChangeKey: $options.changeKey,
3243
+ "load-more": "1"
3244
+ }, null, 8 /* PROPS */, ["onLoadMoreRecords", "hide-load-more", "hide-count", "pagination_data", "onChangeKey"]))
3245
+ : vue.createCommentVNode("v-if", true)
3246
+ ]))
3247
+ }
3248
+
3249
+ script$1.render = render$1;
3250
+ script$1.__scopeId = "data-v-a10546a2";
3251
+ script$1.__file = "src/views/ShTable.vue";
3252
+
3253
+ var script = {
3254
+ name: 'ShTabs',
3255
+ props: ['tabs', 'base_url', 'shared_data', 'tab_counts'],
3256
+ inject: ['global'],
3257
+ data () {
3258
+ return {
3259
+ currentTab: ''
3260
+ }
3261
+ },
3262
+ watch: {
3263
+ refreshStatus: function (state) {
3264
+ if (state === 0) {
3265
+ if (this.tab_counts) {
3266
+ this.setTabCounts(this.tab_counts);
3267
+ }
3268
+ }
3269
+ },
3270
+ tab_counts: function () {
3271
+ this.resetTabCounts();
3272
+ }
3273
+ },
3274
+ computed: {
3275
+ refreshStatus () {
3276
+ return this.global.state.refetch
3277
+ }
3278
+ },
3279
+ mounted () {
3280
+ this.resetTabCounts();
3281
+ },
3282
+ methods: {
3283
+ setTabCounts: function (tabCounts) {
3284
+ if (typeof tabCounts === 'object') {
3285
+ this.setCounts(tabCounts);
3286
+ } else {
3287
+ apis.doGet(tabCounts).then(res => {
3288
+ this.setCounts(res.data);
3289
+ });
3290
+ }
3291
+ },
3292
+ resetTabCounts: function () {
3293
+ const arr = this.$route.fullPath.split('/');
3294
+ if (!this.tabExistsInUrl()) {
3295
+ this.$router.push(this.$route.fullPath + '/tab/' + this.tabs[0]);
3296
+ } else {
3297
+ this.currentTab = arr[arr.length - 1];
3298
+ }
3299
+ if (this.tab_counts) {
3300
+ this.setTabCounts(this.tab_counts);
3301
+ }
3302
+ },
3303
+ tabExistsInUrl: function () {
3304
+ let exists = false;
3305
+ this.tabs.forEach(tab => {
3306
+ if (this.$route.fullPath.includes(tab)) {
3307
+ exists = true;
3308
+ }
3309
+ });
3310
+ return exists
3311
+ },
3312
+ setCounts: function (res) {
3313
+ Object.keys(res).forEach(key => {
3314
+ const elem = document.getElementById('sh_tab_' + key);
3315
+ if (elem) {
3316
+ let txt = elem.innerHTML;
3317
+ txt = txt.split('<i class="d-none"></i>')[0];
3318
+ if (parseInt(res[key]) > 0) {
3319
+ elem.innerHTML = txt + '<i class="d-none"></i><sup class="sh_tab_count">' + res[key] + '</sup>';
3320
+ }
3321
+ }
3322
+ });
3323
+ }
3324
+ }
3325
+ };
3326
+
3327
+ const _hoisted_1 = { class: "common_tabs" };
3328
+ const _hoisted_2 = {
3329
+ class: "nav nav-tabs mb-2",
3330
+ id: "myTab",
3331
+ role: "tablist"
3332
+ };
3333
+ const _hoisted_3 = { class: "tab-content" };
3334
+
3335
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
3336
+ const _component_router_link = vue.resolveComponent("router-link");
3337
+ const _component_router_view = vue.resolveComponent("router-view");
3338
+
3339
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
3340
+ vue.createElementVNode("ul", _hoisted_2, [
3341
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.tabs, (tab) => {
3342
+ return (vue.openBlock(), vue.createElementBlock("li", {
3343
+ class: "nav-item",
3344
+ key: tab
3345
+ }, [
3346
+ vue.createVNode(_component_router_link, {
3347
+ "active-class": 'active',
3348
+ class: "nav-link text-capitalize",
3349
+ to: $props.base_url+'/tab/'+tab,
3350
+ role: "tab",
3351
+ id: 'sh_tab_' + tab
3352
+ }, {
3353
+ default: vue.withCtx(() => [
3354
+ vue.createTextVNode(vue.toDisplayString(tab.replace(/_/g, ' ')), 1 /* TEXT */)
3355
+ ]),
3356
+ _: 2 /* DYNAMIC */
3357
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["to", "id"])
3358
+ ]))
3359
+ }), 128 /* KEYED_FRAGMENT */))
3360
+ ]),
3361
+ vue.createElementVNode("div", _hoisted_3, [
3362
+ vue.createVNode(_component_router_view, {
3363
+ current_tab: $data.currentTab,
3364
+ shared_data: $props.shared_data,
3365
+ tab_counts: $props.tab_counts
3366
+ }, null, 8 /* PROPS */, ["current_tab", "shared_data", "tab_counts"])
3367
+ ])
3368
+ ]))
3369
+ }
3370
+
3371
+ script.render = render;
3372
+ script.__scopeId = "data-v-3628b6a6";
3373
+ script.__file = "src/views/ShTabs.vue";
3374
+
3375
+ var components = {
3376
+ ShForm: script$5,
3377
+ ShCanvas: script$4,
3378
+ ShModal: script$3,
3379
+ ShPhone: script$6,
3380
+ ShTable: script$1,
3381
+ ShTabs: script
3382
+ };
3383
+
3384
+ const plugin = {
3385
+ install (Vue) {
3386
+ for (const prop in components) {
3387
+ if (components.hasOwnProperty(prop)) {
3388
+ const component = components[prop];
3389
+ Vue.component(component.name, component);
3390
+ }
3391
+ }
3392
+ }
3393
+ };
3394
+
3395
+ module.exports = plugin;