fernotify 1.2.1 → 1.2.8
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.
- package/NOTIFICATION_SYSTEM_GUIDE.md +56 -7
- package/README.md +72 -12
- package/dist/notification-system.esm.js +564 -627
- package/dist/notification-system.esm.min.js +1 -1
- package/dist/notification-system.js +564 -626
- package/dist/notification-system.min.js +1 -1
- package/package.json +6 -4
|
@@ -13,52 +13,39 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
// Importar el código UMD y ejecutarlo para generar window.notify
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
initFerNotify
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
script
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (!document.querySelector('link[href*="boxicons"]')) {
|
|
50
|
-
const link = document.createElement('link');
|
|
51
|
-
link.rel = 'stylesheet';
|
|
52
|
-
link.href = 'https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css';
|
|
53
|
-
document.head.appendChild(link);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Inyectar estilos CSS
|
|
59
|
-
*/
|
|
60
|
-
injectStyles() {
|
|
61
|
-
const style = document.createElement('style');
|
|
16
|
+
"use strict";
|
|
17
|
+
(function ensureAnimeDependency() {
|
|
18
|
+
if (typeof anime !== 'undefined') {
|
|
19
|
+
initFerNotify();
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const script = document.createElement('script');
|
|
23
|
+
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js';
|
|
24
|
+
script.onload = initFerNotify;
|
|
25
|
+
script.onerror = () => {
|
|
26
|
+
console.error('FerNotify: No se pudo cargar anime.js. Por favor, cargalo manualmente.');
|
|
27
|
+
};
|
|
28
|
+
document.head.appendChild(script);
|
|
29
|
+
}
|
|
30
|
+
function initFerNotify() {
|
|
31
|
+
class NotificationSystem {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.currentNotification = null;
|
|
34
|
+
this._lastActiveElement = null;
|
|
35
|
+
this._currentLoadingPromise = null;
|
|
36
|
+
this.injectStyles();
|
|
37
|
+
this.loadBoxicons();
|
|
38
|
+
}
|
|
39
|
+
loadBoxicons() {
|
|
40
|
+
if (!document.querySelector('link[href*="boxicons"]')) {
|
|
41
|
+
const link = document.createElement('link');
|
|
42
|
+
link.rel = 'stylesheet';
|
|
43
|
+
link.href = 'https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css';
|
|
44
|
+
document.head.appendChild(link);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
injectStyles() {
|
|
48
|
+
const style = document.createElement('style');
|
|
62
49
|
style.textContent = `
|
|
63
50
|
.notification-overlay {
|
|
64
51
|
position: fixed;
|
|
@@ -228,6 +215,14 @@
|
|
|
228
215
|
.notification-icon.info::before {
|
|
229
216
|
background: #3b82f6;
|
|
230
217
|
}
|
|
218
|
+
.notification-icon.question {
|
|
219
|
+
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
|
220
|
+
color: white;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.notification-icon.question::before {
|
|
224
|
+
background: #3b82f6;
|
|
225
|
+
}
|
|
231
226
|
|
|
232
227
|
.notification-title {
|
|
233
228
|
font-size: 24px;
|
|
@@ -264,6 +259,15 @@
|
|
|
264
259
|
transform: translateY(0);
|
|
265
260
|
}
|
|
266
261
|
|
|
262
|
+
/* group container for multiple action buttons */
|
|
263
|
+
.notification-button-group {
|
|
264
|
+
display: flex;
|
|
265
|
+
gap: 12px;
|
|
266
|
+
justify-content: center;
|
|
267
|
+
flex-wrap: wrap;
|
|
268
|
+
margin-top: 10px;
|
|
269
|
+
}
|
|
270
|
+
|
|
267
271
|
.notification-icon-checkmark {
|
|
268
272
|
animation: checkmark-draw 0.6s ease-in-out;
|
|
269
273
|
}
|
|
@@ -335,587 +339,520 @@
|
|
|
335
339
|
.dark .notification-loading-text {
|
|
336
340
|
color: #cbd5e1;
|
|
337
341
|
}
|
|
338
|
-
`;
|
|
339
|
-
document.head.appendChild(style);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
'
|
|
364
|
-
'
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
'
|
|
375
|
-
'
|
|
376
|
-
'
|
|
377
|
-
'
|
|
378
|
-
};
|
|
379
|
-
return
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
overlay.
|
|
594
|
-
document.
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
e.
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
title,
|
|
853
|
-
message,
|
|
854
|
-
hideButton: true,
|
|
855
|
-
allowOutsideClick: false,
|
|
856
|
-
allowEscapeKey: false,
|
|
857
|
-
...options
|
|
858
|
-
};
|
|
859
|
-
|
|
860
|
-
// Crear una promesa wrapper para poder guardar la referencia y resolver después
|
|
861
|
-
const loadingPromise = this.show(loadingOptions);
|
|
862
|
-
|
|
863
|
-
// Guardar referencia a esta promesa para poder cerrarla después
|
|
864
|
-
this._currentLoadingPromise = loadingPromise;
|
|
865
|
-
|
|
866
|
-
return loadingPromise;
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
/**
|
|
870
|
-
* Cerrar la notificación de carga actual
|
|
871
|
-
*
|
|
872
|
-
* @param {Function} callback - Callback al cerrar (opcional)
|
|
873
|
-
* @returns {Promise} Promesa que se resuelve cuando se cierre
|
|
874
|
-
*
|
|
875
|
-
* @example
|
|
876
|
-
* notify.closeLoading();
|
|
877
|
-
* // o con callback
|
|
878
|
-
* notify.closeLoading(() => console.log('Loading cerrado'));
|
|
879
|
-
*/
|
|
880
|
-
closeLoading(callback = null) {
|
|
881
|
-
this._currentLoadingPromise = null;
|
|
882
|
-
return this.close(callback);
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
/**
|
|
886
|
-
* Alias para cerrar/ocultar la notificación actual
|
|
887
|
-
*/
|
|
888
|
-
hide(callback = null) {
|
|
889
|
-
return this.close(callback);
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
/**
|
|
893
|
-
* Compatibilidad con nombre mal escrito 'hiden'
|
|
894
|
-
*/
|
|
895
|
-
hiden(callback = null) {
|
|
896
|
-
return this.close(callback);
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
/**
|
|
900
|
-
* Formatea segundos a mm:ss
|
|
901
|
-
*/
|
|
902
|
-
_formatTime(seconds) {
|
|
903
|
-
const s = Math.max(0, Math.floor(seconds));
|
|
904
|
-
const mm = Math.floor(s / 60).toString().padStart(2, '0');
|
|
905
|
-
const ss = (s % 60).toString().padStart(2, '0');
|
|
906
|
-
return `${mm}:${ss}`;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
// Crear instancia global
|
|
912
|
-
window.notify = new NotificationSystem();
|
|
913
|
-
|
|
914
|
-
// Exponer también como objeto global para compatibilidad
|
|
915
|
-
window.Notification = window.notify;
|
|
916
|
-
}
|
|
917
|
-
})();
|
|
918
|
-
|
|
342
|
+
`;
|
|
343
|
+
document.head.appendChild(style);
|
|
344
|
+
}
|
|
345
|
+
getIcon(type) {
|
|
346
|
+
const icons = {
|
|
347
|
+
'success': '<i class="bx bx-check" aria-hidden="true"></i>',
|
|
348
|
+
'error': '<i class="bx bx-x" aria-hidden="true"></i>',
|
|
349
|
+
'warning': '<i class="bx bx-error" aria-hidden="true"></i>',
|
|
350
|
+
'info': '<i class="bx bx-info-circle" aria-hidden="true"></i>',
|
|
351
|
+
'question': '<i class="bx bx-question-mark" aria-hidden="true"></i>'
|
|
352
|
+
};
|
|
353
|
+
return icons[type] || icons.info;
|
|
354
|
+
}
|
|
355
|
+
getDefaultTitle(type) {
|
|
356
|
+
const titles = {
|
|
357
|
+
'success': '¡Éxito!',
|
|
358
|
+
'error': 'Error',
|
|
359
|
+
'warning': 'Advertencia',
|
|
360
|
+
'info': 'Información',
|
|
361
|
+
'question': 'Pregunta'
|
|
362
|
+
};
|
|
363
|
+
return titles[type] || 'Notificación';
|
|
364
|
+
}
|
|
365
|
+
getButtonGradient(type) {
|
|
366
|
+
const gradients = {
|
|
367
|
+
'success': 'linear-gradient(135deg, #10b981 0%, #059669 100%)',
|
|
368
|
+
'error': 'linear-gradient(135deg, #ef4444 0%, #dc2626 100%)',
|
|
369
|
+
'warning': 'linear-gradient(135deg, #f59e0b 0%, #d97706 100%)',
|
|
370
|
+
'info': 'linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)',
|
|
371
|
+
'question': 'linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%)'
|
|
372
|
+
};
|
|
373
|
+
return gradients[type] || gradients.info;
|
|
374
|
+
}
|
|
375
|
+
getButtonShadow(type) {
|
|
376
|
+
const shadows = {
|
|
377
|
+
'success': 'rgba(16, 185, 129, 0)',
|
|
378
|
+
'error': 'rgba(239, 68, 68, 0)',
|
|
379
|
+
'warning': 'rgba(245, 159, 11, 0)',
|
|
380
|
+
'info': 'rgba(59, 131, 246, 0)',
|
|
381
|
+
'question': 'rgba(108, 99, 245, 0)'
|
|
382
|
+
};
|
|
383
|
+
return shadows[type] || shadows.info;
|
|
384
|
+
}
|
|
385
|
+
show(options = {}) {
|
|
386
|
+
// Cerrar notificación existente si hay (esperar a que termine)
|
|
387
|
+
if (this.currentNotification) {
|
|
388
|
+
const oldOverlay = this.currentNotification;
|
|
389
|
+
this.currentNotification = null;
|
|
390
|
+
try {
|
|
391
|
+
if (oldOverlay && oldOverlay.parentNode) {
|
|
392
|
+
oldOverlay.parentNode.removeChild(oldOverlay);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
catch (e) { }
|
|
396
|
+
}
|
|
397
|
+
const { type = 'info', title = this.getDefaultTitle(type), message = '', buttonText = 'OK', buttonColor = null, onClose = null, timer = null, allowOutsideClick = true, allowEscapeKey = true, hideButton = false, buttons = null } = options;
|
|
398
|
+
const showCloseButton = options.showCloseButton === true;
|
|
399
|
+
try {
|
|
400
|
+
document.body.style.overflow = 'hidden';
|
|
401
|
+
}
|
|
402
|
+
catch (e) { }
|
|
403
|
+
try {
|
|
404
|
+
document.documentElement.style.overflow = 'hidden';
|
|
405
|
+
}
|
|
406
|
+
catch (e) { }
|
|
407
|
+
const overlay = document.createElement('div');
|
|
408
|
+
overlay.className = 'notification-overlay';
|
|
409
|
+
overlay.tabIndex = -1;
|
|
410
|
+
overlay.setAttribute('role', 'dialog');
|
|
411
|
+
overlay.setAttribute('aria-modal', 'true');
|
|
412
|
+
overlay.style.pointerEvents = 'auto';
|
|
413
|
+
const box = document.createElement('div');
|
|
414
|
+
box.className = 'notification-box';
|
|
415
|
+
const icon = document.createElement('div');
|
|
416
|
+
icon.className = `notification-icon ${type}`;
|
|
417
|
+
if (hideButton && type === 'info') {
|
|
418
|
+
icon.className = 'notification-loading-container';
|
|
419
|
+
icon.innerHTML = '<div class="notification-spinner"></div>';
|
|
420
|
+
icon.style.background = 'transparent';
|
|
421
|
+
icon.style.boxShadow = 'none';
|
|
422
|
+
icon.style.width = '100px';
|
|
423
|
+
icon.style.height = '100px';
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
icon.innerHTML = this.getIcon(type);
|
|
427
|
+
}
|
|
428
|
+
const titleElement = document.createElement('h3');
|
|
429
|
+
titleElement.className = 'notification-title';
|
|
430
|
+
titleElement.textContent = title;
|
|
431
|
+
const messageElement = document.createElement('p');
|
|
432
|
+
messageElement.className = 'notification-message';
|
|
433
|
+
messageElement.textContent = message;
|
|
434
|
+
let customContent = null;
|
|
435
|
+
if (options.html || options.content) {
|
|
436
|
+
customContent = document.createElement('div');
|
|
437
|
+
customContent.className = 'notification-content';
|
|
438
|
+
if (options.html) {
|
|
439
|
+
try {
|
|
440
|
+
customContent.innerHTML = options.html;
|
|
441
|
+
}
|
|
442
|
+
catch (e) {
|
|
443
|
+
customContent.textContent = options.html;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
else if (options.content && options.content instanceof HTMLElement) {
|
|
447
|
+
customContent.appendChild(options.content);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
const closeHandler = () => {
|
|
451
|
+
return this.close(onClose);
|
|
452
|
+
};
|
|
453
|
+
let button = null;
|
|
454
|
+
let buttonContainer = null;
|
|
455
|
+
if (!hideButton) {
|
|
456
|
+
if (Array.isArray(buttons) && buttons.length) {
|
|
457
|
+
buttonContainer = document.createElement('div');
|
|
458
|
+
buttonContainer.className = 'notification-button-group';
|
|
459
|
+
buttons.forEach((btn) => {
|
|
460
|
+
const btnEl = document.createElement('button');
|
|
461
|
+
btnEl.className = 'notification-button';
|
|
462
|
+
btnEl.textContent = btn.text || 'OK';
|
|
463
|
+
const finalBtnColor = btn.color || this.getButtonGradient(type);
|
|
464
|
+
const btnShadow = btn.shadowColor || this.getButtonShadow(type);
|
|
465
|
+
btnEl.style.background = finalBtnColor;
|
|
466
|
+
btnEl.style.boxShadow = `0 4px 12px ${btnShadow}`;
|
|
467
|
+
btnEl.addEventListener('click', (e) => {
|
|
468
|
+
e.stopPropagation();
|
|
469
|
+
e.preventDefault();
|
|
470
|
+
try {
|
|
471
|
+
closeHandler().then(() => {
|
|
472
|
+
if (typeof btn.onClick === 'function') {
|
|
473
|
+
try {
|
|
474
|
+
const res = btn.onClick();
|
|
475
|
+
if (res && typeof res.then === 'function') {
|
|
476
|
+
res.catch((err) => console.error(err));
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
catch (err) {
|
|
480
|
+
console.error(err);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}).catch(() => { });
|
|
484
|
+
}
|
|
485
|
+
catch (err) {
|
|
486
|
+
console.error(err);
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
btnEl.addEventListener('mouseenter', () => {
|
|
490
|
+
btnEl.style.boxShadow = `0 6px 16px ${btnShadow}`;
|
|
491
|
+
});
|
|
492
|
+
btnEl.addEventListener('mouseleave', () => {
|
|
493
|
+
btnEl.style.boxShadow = `0 4px 12px ${btnShadow}`;
|
|
494
|
+
});
|
|
495
|
+
buttonContainer.appendChild(btnEl);
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
else if (options.onConfirm || options.onCancel || options.confirmText || options.cancelText) {
|
|
499
|
+
buttonContainer = document.createElement('div');
|
|
500
|
+
buttonContainer.className = 'notification-button-group';
|
|
501
|
+
const cancelText = options.cancelText || 'Cancelar';
|
|
502
|
+
const confirmText = options.confirmText || 'Aceptar';
|
|
503
|
+
const cancelBtn = document.createElement('button');
|
|
504
|
+
cancelBtn.className = 'notification-button';
|
|
505
|
+
cancelBtn.textContent = cancelText;
|
|
506
|
+
const cancelColor = options.cancelColor || 'linear-gradient(135deg, #9ca3af 0%, #6b7280 100%)';
|
|
507
|
+
const cancelShadow = options.cancelShadow || 'rgba(107,114,128,0.25)';
|
|
508
|
+
cancelBtn.style.background = cancelColor;
|
|
509
|
+
cancelBtn.style.boxShadow = `0 4px 12px ${cancelShadow}`;
|
|
510
|
+
cancelBtn.addEventListener('click', (e) => {
|
|
511
|
+
e.stopPropagation();
|
|
512
|
+
e.preventDefault();
|
|
513
|
+
closeHandler().then(() => {
|
|
514
|
+
try {
|
|
515
|
+
if (typeof options.onCancel === 'function') {
|
|
516
|
+
const res = options.onCancel();
|
|
517
|
+
if (res && typeof res.then === 'function') {
|
|
518
|
+
res.catch((err) => console.error(err));
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
catch (err) {
|
|
523
|
+
console.error(err);
|
|
524
|
+
}
|
|
525
|
+
}).catch(() => { });
|
|
526
|
+
});
|
|
527
|
+
cancelBtn.addEventListener('mouseenter', () => { cancelBtn.style.boxShadow = `0 6px 16px ${cancelShadow}`; });
|
|
528
|
+
cancelBtn.addEventListener('mouseleave', () => { cancelBtn.style.boxShadow = `0 4px 12px ${cancelShadow}`; });
|
|
529
|
+
const confirmBtn = document.createElement('button');
|
|
530
|
+
confirmBtn.className = 'notification-button';
|
|
531
|
+
confirmBtn.textContent = confirmText;
|
|
532
|
+
const confirmColor = options.confirmColor || this.getButtonGradient(type);
|
|
533
|
+
const confirmShadow = options.confirmShadow || this.getButtonShadow(type);
|
|
534
|
+
confirmBtn.style.background = confirmColor;
|
|
535
|
+
confirmBtn.style.boxShadow = `0 4px 12px ${confirmShadow}`;
|
|
536
|
+
confirmBtn.addEventListener('click', async (e) => {
|
|
537
|
+
e.stopPropagation();
|
|
538
|
+
e.preventDefault();
|
|
539
|
+
try {
|
|
540
|
+
await closeHandler();
|
|
541
|
+
if (typeof options.onConfirm === 'function') {
|
|
542
|
+
const res = options.onConfirm();
|
|
543
|
+
if (res && typeof res.then === 'function') {
|
|
544
|
+
await res;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
catch (err) {
|
|
549
|
+
console.error(err);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
confirmBtn.addEventListener('mouseenter', () => { confirmBtn.style.boxShadow = `0 6px 16px ${confirmShadow}`; });
|
|
553
|
+
confirmBtn.addEventListener('mouseleave', () => { confirmBtn.style.boxShadow = `0 4px 12px ${confirmShadow}`; });
|
|
554
|
+
buttonContainer.appendChild(cancelBtn);
|
|
555
|
+
buttonContainer.appendChild(confirmBtn);
|
|
556
|
+
}
|
|
557
|
+
else if (buttonText) {
|
|
558
|
+
button = document.createElement('button');
|
|
559
|
+
button.className = 'notification-button';
|
|
560
|
+
button.textContent = buttonText;
|
|
561
|
+
const finalButtonColor = buttonColor || this.getButtonGradient(type);
|
|
562
|
+
const buttonShadowColor = this.getButtonShadow(type);
|
|
563
|
+
button.style.background = finalButtonColor;
|
|
564
|
+
button.style.boxShadow = `0 4px 12px ${buttonShadowColor}`;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
let closeBtn = null;
|
|
568
|
+
if (showCloseButton) {
|
|
569
|
+
closeBtn = document.createElement('button');
|
|
570
|
+
closeBtn.setAttribute('aria-label', 'Cerrar');
|
|
571
|
+
closeBtn.className = 'notification-close';
|
|
572
|
+
closeBtn.innerHTML = '×';
|
|
573
|
+
closeBtn.addEventListener('click', (e) => {
|
|
574
|
+
e.stopPropagation();
|
|
575
|
+
closeHandler();
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
box.appendChild(icon);
|
|
579
|
+
if (customContent) {
|
|
580
|
+
const descId = 'notify-desc-' + Date.now();
|
|
581
|
+
customContent.id = descId;
|
|
582
|
+
overlay.setAttribute('aria-describedby', descId);
|
|
583
|
+
box.appendChild(customContent);
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
box.appendChild(titleElement);
|
|
587
|
+
box.appendChild(messageElement);
|
|
588
|
+
}
|
|
589
|
+
if (closeBtn)
|
|
590
|
+
box.appendChild(closeBtn);
|
|
591
|
+
if (buttonContainer) {
|
|
592
|
+
box.appendChild(buttonContainer);
|
|
593
|
+
}
|
|
594
|
+
else if (button) {
|
|
595
|
+
box.appendChild(button);
|
|
596
|
+
}
|
|
597
|
+
overlay.appendChild(box);
|
|
598
|
+
document.body.appendChild(overlay);
|
|
599
|
+
const overlayMeta = overlay;
|
|
600
|
+
const closePromise = new Promise((resolveClose) => {
|
|
601
|
+
try {
|
|
602
|
+
overlayMeta._externalResolve = resolveClose;
|
|
603
|
+
}
|
|
604
|
+
catch (e) { }
|
|
605
|
+
});
|
|
606
|
+
try {
|
|
607
|
+
const live = document.getElementById('notify-live');
|
|
608
|
+
if (live) {
|
|
609
|
+
live.textContent = `${title}: ${message}`;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
catch (e) { }
|
|
613
|
+
try {
|
|
614
|
+
this._lastActiveElement = document.activeElement;
|
|
615
|
+
}
|
|
616
|
+
catch (e) {
|
|
617
|
+
this._lastActiveElement = null;
|
|
618
|
+
}
|
|
619
|
+
this.currentNotification = overlay;
|
|
620
|
+
try {
|
|
621
|
+
const focusable = box.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])');
|
|
622
|
+
if (focusable && focusable.length) {
|
|
623
|
+
focusable[0].focus();
|
|
624
|
+
}
|
|
625
|
+
else if (button) {
|
|
626
|
+
button.focus();
|
|
627
|
+
}
|
|
628
|
+
else {
|
|
629
|
+
overlay.focus();
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
catch (e) {
|
|
633
|
+
try {
|
|
634
|
+
overlay.focus();
|
|
635
|
+
}
|
|
636
|
+
catch (err) { }
|
|
637
|
+
}
|
|
638
|
+
const focusTrap = (e) => {
|
|
639
|
+
if (e.key !== 'Tab')
|
|
640
|
+
return;
|
|
641
|
+
const focusableNodes = Array.from(box.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, [tabindex]:not([tabindex="-1"])'));
|
|
642
|
+
const focusable = focusableNodes.filter((el) => el instanceof HTMLElement && el.offsetParent !== null);
|
|
643
|
+
if (!focusable.length) {
|
|
644
|
+
e.preventDefault();
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
const first = focusable[0];
|
|
648
|
+
const last = focusable[focusable.length - 1];
|
|
649
|
+
if (!e.shiftKey && document.activeElement === last) {
|
|
650
|
+
e.preventDefault();
|
|
651
|
+
first.focus();
|
|
652
|
+
}
|
|
653
|
+
else if (e.shiftKey && document.activeElement === first) {
|
|
654
|
+
e.preventDefault();
|
|
655
|
+
last.focus();
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
overlayMeta._focusTrap = focusTrap;
|
|
659
|
+
document.addEventListener('keydown', focusTrap);
|
|
660
|
+
const anim = options.anim || {};
|
|
661
|
+
const overlayDuration = typeof anim.overlayDuration === 'number' ? anim.overlayDuration : 150;
|
|
662
|
+
const overlayEasing = anim.overlayEasing || 'easeOutQuad';
|
|
663
|
+
const boxDuration = typeof anim.boxDuration === 'number' ? anim.boxDuration : 200;
|
|
664
|
+
const boxDelay = typeof anim.boxDelay === 'number' ? anim.boxDelay : 50;
|
|
665
|
+
const boxEasing = anim.boxEasing || 'easeOutBack';
|
|
666
|
+
const boxStartScale = typeof anim.boxStartScale === 'number' ? anim.boxStartScale : 0.8;
|
|
667
|
+
const iconDuration = typeof anim.iconDuration === 'number' ? anim.iconDuration : 250;
|
|
668
|
+
const iconDelay = typeof anim.iconDelay === 'number' ? anim.iconDelay : 100;
|
|
669
|
+
const iconRotate = (typeof anim.iconRotate === 'number') ? anim.iconRotate : (type === 'success' ? -90 : type === 'error' ? 90 : 0);
|
|
670
|
+
if (typeof anim.overlayOpacity === 'number') {
|
|
671
|
+
overlay.style.backgroundColor = `rgba(0,0,0,${anim.overlayOpacity})`;
|
|
672
|
+
}
|
|
673
|
+
anime({
|
|
674
|
+
targets: overlay,
|
|
675
|
+
opacity: [0, 1],
|
|
676
|
+
duration: overlayDuration,
|
|
677
|
+
easing: overlayEasing
|
|
678
|
+
});
|
|
679
|
+
anime({
|
|
680
|
+
targets: box,
|
|
681
|
+
scale: [boxStartScale, 1],
|
|
682
|
+
opacity: [0, 1],
|
|
683
|
+
duration: boxDuration,
|
|
684
|
+
easing: boxEasing,
|
|
685
|
+
delay: boxDelay
|
|
686
|
+
});
|
|
687
|
+
anime({
|
|
688
|
+
targets: icon,
|
|
689
|
+
scale: [0, 1],
|
|
690
|
+
rotate: [iconRotate, 0],
|
|
691
|
+
duration: iconDuration,
|
|
692
|
+
easing: boxEasing,
|
|
693
|
+
delay: iconDelay
|
|
694
|
+
});
|
|
695
|
+
if (button) {
|
|
696
|
+
const buttonShadowColor = this.getButtonShadow(type);
|
|
697
|
+
button.addEventListener('mouseenter', () => {
|
|
698
|
+
button.style.boxShadow = `0 6px 16px ${buttonShadowColor}`;
|
|
699
|
+
});
|
|
700
|
+
button.addEventListener('mouseleave', () => {
|
|
701
|
+
button.style.boxShadow = `0 4px 12px ${buttonShadowColor}`;
|
|
702
|
+
});
|
|
703
|
+
button.addEventListener('click', (e) => {
|
|
704
|
+
e.stopPropagation();
|
|
705
|
+
e.preventDefault();
|
|
706
|
+
closeHandler().catch(() => { });
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
if (allowOutsideClick) {
|
|
710
|
+
overlay.addEventListener('click', (e) => {
|
|
711
|
+
if (!box.contains(e.target)) {
|
|
712
|
+
closeHandler();
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
if (timer) {
|
|
717
|
+
setTimeout(() => {
|
|
718
|
+
closeHandler();
|
|
719
|
+
}, timer);
|
|
720
|
+
}
|
|
721
|
+
if (allowEscapeKey) {
|
|
722
|
+
const escHandler = (e) => {
|
|
723
|
+
if (e.key === 'Escape') {
|
|
724
|
+
closeHandler();
|
|
725
|
+
document.removeEventListener('keydown', escHandler);
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
overlayMeta._escHandler = escHandler;
|
|
729
|
+
document.addEventListener('keydown', escHandler);
|
|
730
|
+
}
|
|
731
|
+
return closePromise;
|
|
732
|
+
}
|
|
733
|
+
close(callback = null) {
|
|
734
|
+
if (!this.currentNotification) {
|
|
735
|
+
return Promise.resolve();
|
|
736
|
+
}
|
|
737
|
+
const overlay = this.currentNotification;
|
|
738
|
+
const overlayMeta = overlay;
|
|
739
|
+
const box = overlay.querySelector('.notification-box');
|
|
740
|
+
this.currentNotification = null;
|
|
741
|
+
anime({
|
|
742
|
+
targets: box,
|
|
743
|
+
scale: 0.8,
|
|
744
|
+
opacity: 0,
|
|
745
|
+
duration: 100,
|
|
746
|
+
easing: 'easeInQuad'
|
|
747
|
+
});
|
|
748
|
+
return new Promise((resolve) => {
|
|
749
|
+
anime({
|
|
750
|
+
targets: overlay,
|
|
751
|
+
opacity: 0,
|
|
752
|
+
duration: 100,
|
|
753
|
+
easing: 'easeInQuad',
|
|
754
|
+
complete: () => {
|
|
755
|
+
try {
|
|
756
|
+
if (overlayMeta && overlayMeta._escHandler) {
|
|
757
|
+
document.removeEventListener('keydown', overlayMeta._escHandler);
|
|
758
|
+
overlayMeta._escHandler = undefined;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
catch (e) { }
|
|
762
|
+
try {
|
|
763
|
+
if (overlayMeta && overlayMeta._focusTrap) {
|
|
764
|
+
document.removeEventListener('keydown', overlayMeta._focusTrap);
|
|
765
|
+
overlayMeta._focusTrap = undefined;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
catch (e) { }
|
|
769
|
+
try {
|
|
770
|
+
if (overlayMeta && typeof overlayMeta._externalResolve === 'function') {
|
|
771
|
+
try {
|
|
772
|
+
overlayMeta._externalResolve();
|
|
773
|
+
}
|
|
774
|
+
catch (er) { }
|
|
775
|
+
overlayMeta._externalResolve = undefined;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
catch (e) { }
|
|
779
|
+
try {
|
|
780
|
+
if (overlay && overlay.parentNode) {
|
|
781
|
+
overlay.parentNode.removeChild(overlay);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
catch (e) {
|
|
785
|
+
try {
|
|
786
|
+
overlay.remove();
|
|
787
|
+
}
|
|
788
|
+
catch (er) { }
|
|
789
|
+
}
|
|
790
|
+
if (!this.currentNotification) {
|
|
791
|
+
try {
|
|
792
|
+
document.body.style.overflow = '';
|
|
793
|
+
}
|
|
794
|
+
catch (e) { }
|
|
795
|
+
try {
|
|
796
|
+
document.documentElement.style.overflow = '';
|
|
797
|
+
}
|
|
798
|
+
catch (e) { }
|
|
799
|
+
}
|
|
800
|
+
try {
|
|
801
|
+
if (this._lastActiveElement && typeof this._lastActiveElement.focus === 'function') {
|
|
802
|
+
this._lastActiveElement.focus();
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
catch (e) { }
|
|
806
|
+
this._lastActiveElement = null;
|
|
807
|
+
if (callback)
|
|
808
|
+
callback();
|
|
809
|
+
resolve();
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
success(message, title = null, options = {}) {
|
|
815
|
+
this.show(Object.assign({ type: 'success', title: title || this.getDefaultTitle('success'), message }, options));
|
|
816
|
+
}
|
|
817
|
+
error(message, title = null, options = {}) {
|
|
818
|
+
this.show(Object.assign({ type: 'error', title: title || this.getDefaultTitle('error'), message }, options));
|
|
819
|
+
}
|
|
820
|
+
warning(message, title = null, options = {}) {
|
|
821
|
+
this.show(Object.assign({ type: 'warning', title: title || this.getDefaultTitle('warning'), message }, options));
|
|
822
|
+
}
|
|
823
|
+
question(message, title = null, options = {}) {
|
|
824
|
+
this.show(Object.assign({ type: 'question', title: title || this.getDefaultTitle('question'), message }, options));
|
|
825
|
+
}
|
|
826
|
+
info(message, title = null, options = {}) {
|
|
827
|
+
this.show(Object.assign({ type: 'info', title: title || this.getDefaultTitle('info'), message }, options));
|
|
828
|
+
}
|
|
829
|
+
loading(message = 'Cargando...', title = 'Espera', options = {}) {
|
|
830
|
+
const loadingOptions = Object.assign({ type: 'info', title,
|
|
831
|
+
message, hideButton: true, allowOutsideClick: false, allowEscapeKey: false }, options);
|
|
832
|
+
const loadingPromise = this.show(loadingOptions);
|
|
833
|
+
this._currentLoadingPromise = loadingPromise;
|
|
834
|
+
return loadingPromise;
|
|
835
|
+
}
|
|
836
|
+
closeLoading(callback = null) {
|
|
837
|
+
this._currentLoadingPromise = null;
|
|
838
|
+
return this.close(callback);
|
|
839
|
+
}
|
|
840
|
+
hide(callback = null) { return this.close(callback); }
|
|
841
|
+
hiden(callback = null) { return this.close(callback); }
|
|
842
|
+
_formatTime(seconds) {
|
|
843
|
+
const s = Math.max(0, Math.floor(seconds));
|
|
844
|
+
const mm = Math.floor(s / 60).toString().padStart(2, '0');
|
|
845
|
+
const ss = (s % 60).toString().padStart(2, '0');
|
|
846
|
+
return `${mm}:${ss}`;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
const notifyInstance = new NotificationSystem();
|
|
850
|
+
const w = window;
|
|
851
|
+
w.notify = notifyInstance;
|
|
852
|
+
w.Notification = notifyInstance;
|
|
853
|
+
}
|
|
854
|
+
})();
|
|
855
|
+
//# sourceMappingURL=notification-system.js.map
|
|
919
856
|
|
|
920
857
|
// Extraer la clase desde la instancia global
|
|
921
858
|
const NotificationSystem = window.notify?.constructor || function() {
|