toastify-pro 1.4.0 → 1.6.0
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/dist/toastify-pro.esm.js +728 -25
- package/dist/toastify-pro.esm.js.map +1 -1
- package/dist/toastify-pro.umd.js +728 -25
- package/dist/toastify-pro.umd.js.map +1 -1
- package/dist/toastify-pro.umd.min.js +10 -6
- package/dist/toastify-pro.umd.min.js.map +1 -1
- package/package.json +2 -2
- package/src/toastify-pro.js +728 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(
|
|
1
|
+
!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* ToastifyPro - Modern Toast Notification Library
|
|
4
4
|
* A beautiful, customizable toast notification library with glassmorphism design,
|
|
@@ -10,18 +10,22 @@
|
|
|
10
10
|
* - Position-aware car swipe exit animations
|
|
11
11
|
* - Description support for enhanced messaging
|
|
12
12
|
* - Six theme variants (success, error, info, warning, dark, light)
|
|
13
|
+
* - Custom color toasts with gradient support (custom method)
|
|
13
14
|
* - Progress bar with shimmer effects
|
|
14
15
|
* - Responsive design for mobile devices
|
|
15
16
|
* - Framework agnostic (works with React, Vue, Angular, etc.)
|
|
16
17
|
* - Confirmation dialogs with customizable buttons and callbacks
|
|
18
|
+
* - Confirmation overlay with blur effect for focus
|
|
17
19
|
* - Center position support for enhanced focus
|
|
18
20
|
* - Independent positioning for confirmations
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
* -
|
|
21
|
+
* - Action buttons in toasts with customizable callbacks
|
|
22
|
+
* - Pause on hover functionality
|
|
23
|
+
* - Queue management (maxToasts, newestOnTop)
|
|
24
|
+
* - Full accessibility support (ARIA, keyboard navigation, reduced motion)
|
|
25
|
+
* - Focus management for confirmation dialogs
|
|
22
26
|
*
|
|
23
|
-
* @version 1.
|
|
27
|
+
* @version 1.6.0
|
|
24
28
|
* @author ToastifyPro Team
|
|
25
29
|
* @license MIT
|
|
26
|
-
*/let n=null;class t{constructor(n={}){"object"==typeof n&&null!==n||(console.warn("ToastifyPro: Invalid options parameter. Using defaults."),n={}),this.defaultOptions={position:n.position||"bottom-center",timeout:n.timeout||3e3,allowClose:!1!==n.allowClose,maxLength:n.maxLength||100};if(["top-left","top-right","bottom-left","bottom-right","top-center","bottom-center","center"].includes(this.defaultOptions.position)||(console.warn(`ToastifyPro: Invalid position "${this.defaultOptions.position}". Using "bottom-center".`),this.defaultOptions.position="bottom-center"),"undefined"==typeof document)throw new Error("ToastifyPro: This library requires a DOM environment (browser).");const t=document.querySelector(`.toastify-pro-container.${this.defaultOptions.position}`);if(t)this.container=t;else try{this.container=document.createElement("div"),this.container.className=`toastify-pro-container ${this.defaultOptions.position}`,document.body.appendChild(this.container)}catch(n){throw new Error("ToastifyPro: Failed to create container element. DOM may not be ready.")}this.injectStyles()}getIconSVG(n){"string"!=typeof n&&(console.warn("ToastifyPro: Invalid icon type. Using default info icon."),n="info");const t={success:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" fill="currentColor"/>\n </svg>',error:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" fill="currentColor"/>\n </svg>',info:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" fill="currentColor"/>\n </svg>',warning:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" fill="currentColor"/>\n </svg>',dark:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" fill="currentColor"/>\n </svg>',light:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 11H7v6h2v-6zm4 0h-2v6h2v-6zm4 0h-2v6h2v-6zm2.5-9H19V1h-2v1H7V1H5v1H4.5C3.11 2 2 3.11 2 4.5v14C2 19.89 3.11 21 4.5 21h15c1.39 0 2.5-1.11 2.5-2.5v-14C22 3.11 20.89 2 19.5 2zm0 16h-15v-11h15v11z" fill="currentColor"/>\n </svg>'};return t[n]||t.info}injectStyles(){if(!document.getElementById("toastify-pro-styles"))try{const n=document.createElement("style");n.id="toastify-pro-styles",n.textContent="\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');\n \n .toastify-pro-container {\n position: fixed;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n gap: 16px;\n pointer-events: none;\n }\n .toastify-pro-container.top-left { top: 50px; left: 24px; align-items: flex-start; }\n .toastify-pro-container.top-right { top: 50px; right: 24px; align-items: flex-end; }\n .toastify-pro-container.bottom-left { bottom: 50px; left: 24px; align-items: flex-start; }\n .toastify-pro-container.bottom-right { bottom: 50px; right: 24px; align-items: flex-end; }\n .toastify-pro-container.top-center { top: 50px; left: 50%; transform: translateX(-50%); }\n .toastify-pro-container.bottom-center { bottom: 50px; left: 50%; transform: translateX(-50%); }\n .toastify-pro-container.center { top: 50%; left: 50%; transform: translate(-50%, -50%); }\n\n .toastify-pro {\n min-width: 280px;\n max-width: 400px;\n padding: 20px 24px;\n border-radius: 16px;\n font-size: 15px;\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n font-weight: 500;\n color: white;\n opacity: 0;\n transform: scale(0.3);\n transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);\n pointer-events: auto;\n position: relative;\n display: flex;\n align-items: center;\n gap: 16px;\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n box-shadow: \n 0 20px 25px -5px rgba(0, 0, 0, 0.1),\n 0 10px 10px -5px rgba(0, 0, 0, 0.04),\n 0 0 0 1px rgba(255, 255, 255, 0.05);\n overflow: hidden;\n }\n \n .toastify-pro::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 3px;\n background: linear-gradient(90deg, \n rgba(255, 255, 255, 0.8) 0%,\n rgba(255, 255, 255, 0.4) 50%,\n rgba(255, 255, 255, 0.8) 100%);\n animation: shimmer 2s infinite;\n transition: opacity 0.8s ease;\n }\n \n .toastify-pro::after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n height: 3px;\n background: rgba(255, 255, 255, 0.6);\n animation: progress var(--duration, 5s) linear;\n border-radius: 0 0 16px 16px;\n }\n \n @keyframes airdropPop {\n 0% { \n opacity: 0;\n transform: scale(0.3) rotateY(-20deg); \n }\n 30% { \n opacity: 0.8;\n transform: scale(1.1) rotateY(10deg); \n }\n 60% { \n opacity: 1;\n transform: scale(0.98) rotateY(-3deg); \n }\n 100% { \n opacity: 1;\n transform: scale(1) rotateY(0deg); \n }\n }\n \n @keyframes carSwipeBottom {\n 0% { \n opacity: 1;\n transform: scale(1) translateY(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateY(-8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateY(200px); \n }\n }\n \n @keyframes carSwipeTop {\n 0% { \n opacity: 1;\n transform: scale(1) translateY(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateY(8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateY(-200px); \n }\n }\n \n @keyframes carSwipeLeft {\n 0% { \n opacity: 1;\n transform: scale(1) translateX(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateX(8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateX(-300px); \n }\n }\n \n @keyframes carSwipeRight {\n 0% { \n opacity: 1;\n transform: scale(1) translateX(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateX(-8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateX(300px); \n }\n }\n \n @keyframes carSwipeCenter {\n 0% { \n opacity: 1;\n transform: scale(1) translateY(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateY(-5px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.6) translateY(150px); \n }\n }\n \n @keyframes progress {\n 0% { width: 100%; }\n 100% { width: 0%; }\n }\n \n @keyframes shimmer {\n 0% { transform: translateX(-100%); }\n 100% { transform: translateX(100%); }\n }\n \n @keyframes shake {\n 0%, 100% { transform: translate(0, 0); }\n 10%, 30%, 50%, 70%, 90% { transform: translate(-10px, 0); }\n 20%, 40%, 60%, 80% { transform: translate(10px, 0); }\n }\n \n @keyframes shakeCenter {\n 0%, 100% { transform: scale(1) translateX(0); }\n 10%, 30%, 50%, 70%, 90% { transform: scale(1) translateX(-10px); }\n 20%, 40%, 60%, 80% { transform: scale(1) translateX(10px); }\n }\n \n .toastify-pro.shake {\n animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;\n }\n \n .toastify-pro-container.center .toastify-pro.shake {\n animation: shakeCenter 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;\n }\n \n .toastify-pro.show { \n opacity: 1; \n transform: scale(1);\n animation: airdropPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);\n }\n \n .toastify-pro.success { \n background: linear-gradient(135deg, \n rgba(34, 197, 94, 0.9) 0%,\n rgba(21, 128, 61, 0.9) 100%);\n border-color: rgba(34, 197, 94, 0.3);\n }\n \n .toastify-pro.error { \n background: linear-gradient(135deg, \n rgba(239, 68, 68, 0.9) 0%,\n rgba(185, 28, 28, 0.9) 100%);\n border-color: rgba(239, 68, 68, 0.3);\n }\n \n .toastify-pro.info { \n background: linear-gradient(135deg, \n rgba(59, 130, 246, 0.9) 0%,\n rgba(29, 78, 216, 0.9) 100%);\n border-color: rgba(59, 130, 246, 0.3);\n }\n \n .toastify-pro.warning { \n background: linear-gradient(135deg, \n rgba(245, 158, 11, 0.9) 0%,\n rgba(217, 119, 6, 0.9) 100%);\n border-color: rgba(245, 158, 11, 0.3);\n }\n \n .toastify-pro.dark { \n background: linear-gradient(135deg, \n rgba(15, 23, 42, 0.95) 0%,\n rgba(30, 41, 59, 0.95) 100%);\n border-color: rgba(148, 163, 184, 0.2);\n }\n \n .toastify-pro.light { \n background: linear-gradient(135deg, \n rgba(255, 255, 255, 0.95) 0%,\n rgba(248, 250, 252, 0.95) 100%);\n color: #1e293b;\n border-color: rgba(226, 232, 240, 0.8);\n box-shadow: \n 0 20px 25px -5px rgba(0, 0, 0, 0.08),\n 0 10px 10px -5px rgba(0, 0, 0, 0.03);\n }\n \n .toastify-pro.light::before {\n background: linear-gradient(90deg, \n rgba(30, 41, 59, 0.8) 0%,\n rgba(30, 41, 59, 0.4) 50%,\n rgba(30, 41, 59, 0.8) 100%);\n }\n \n .toastify-pro.light::after {\n background: rgba(30, 41, 59, 0.6);\n }\n\n .toastify-pro .toast-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n backdrop-filter: blur(10px);\n animation: iconPulse 2s infinite;\n }\n \n @keyframes iconPulse {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.05); }\n }\n \n @keyframes iconBounce {\n 0% { transform: scale(0.2) rotate(-15deg); }\n 40% { transform: scale(1.2) rotate(8deg); }\n 70% { transform: scale(0.95) rotate(-3deg); }\n 100% { transform: scale(1) rotate(0deg); }\n }\n \n @keyframes iconCarExit {\n 0% { \n transform: scale(1) rotate(0deg); \n opacity: 1;\n }\n 20% { \n transform: scale(1.1) rotate(-10deg); \n opacity: 0.9;\n }\n 100% { \n transform: scale(0.3) rotate(180deg); \n opacity: 0;\n }\n }\n \n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n .toastify-pro .toast-icon svg {\n width: 18px;\n height: 18px;\n color: inherit;\n filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));\n }\n\n .toastify-pro.light .toast-icon {\n background: rgba(15, 23, 42, 0.1);\n }\n\n .toastify-pro .toast-content {\n flex: 1;\n line-height: 1.5;\n font-weight: 500;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n\n .toastify-pro .toast-message {\n font-size: 15px;\n font-weight: 500;\n margin-bottom: 0;\n }\n\n .toastify-pro .toast-description {\n font-size: 13px;\n font-weight: 400;\n opacity: 0.85;\n margin-top: 4px;\n line-height: 1.4;\n }\n\n .toastify-pro .close-btn {\n cursor: pointer;\n font-size: 20px;\n color: inherit;\n opacity: 0.7;\n padding: 8px;\n border-radius: 50%;\n transition: all 0.2s ease;\n flex-shrink: 0;\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.1);\n backdrop-filter: blur(10px);\n font-weight: 300;\n line-height: 1;\n }\n \n .toastify-pro .close-btn:hover { \n opacity: 1; \n background: rgba(255, 255, 255, 0.2);\n transform: scale(1.1);\n }\n \n .toastify-pro.light .close-btn {\n background: rgba(15, 23, 42, 0.08);\n }\n \n .toastify-pro.light .close-btn:hover { \n background: rgba(15, 23, 42, 0.15);\n }\n \n @media (max-width: 640px) {\n .toastify-pro {\n min-width: 260px;\n max-width: calc(100vw - 48px);\n margin: 0 8px;\n }\n \n .toastify-pro-container.top-left,\n .toastify-pro-container.bottom-left { left: 16px; }\n .toastify-pro-container.top-right,\n .toastify-pro-container.bottom-right { right: 16px; }\n }\n\n /* Confirmation Toast Styles - Enhanced Modern Design */\n .toastify-pro.confirmation {\n min-width: 380px;\n max-width: 500px;\n padding: 32px 28px 28px;\n flex-direction: column;\n align-items: stretch;\n gap: 24px;\n position: relative;\n backdrop-filter: blur(24px) saturate(180%);\n box-shadow: \n 0 24px 48px -12px rgba(0, 0, 0, 0.25),\n 0 12px 24px -8px rgba(0, 0, 0, 0.15),\n 0 0 0 1px rgba(255, 255, 255, 0.08),\n inset 0 1px 0 0 rgba(255, 255, 255, 0.1);\n border: 1.5px solid rgba(255, 255, 255, 0.15);\n border-radius: 20px;\n }\n\n /* Hide progress bar for confirmation toasts */\n .toastify-pro.confirmation::after {\n display: none;\n }\n\n /* Shimmer effect for confirmation toasts */\n .toastify-pro.confirmation::before {\n opacity: 0.5;\n }\n\n /* Close button for confirmation dialogs */\n .toastify-pro.confirmation .conf-close-btn {\n position: absolute;\n top: 14px;\n right: 14px;\n cursor: pointer;\n font-size: 20px;\n color: inherit;\n opacity: 0.5;\n padding: 6px;\n border-radius: 8px;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.08);\n backdrop-filter: blur(10px);\n font-weight: 300;\n line-height: 1;\n border: 1px solid rgba(255, 255, 255, 0.12);\n }\n \n .toastify-pro.confirmation .conf-close-btn:hover { \n opacity: 0.9; \n background: rgba(255, 255, 255, 0.15);\n transform: scale(1.1) rotate(90deg);\n border-color: rgba(255, 255, 255, 0.25);\n }\n \n .toastify-pro.confirmation.light .conf-close-btn {\n background: rgba(15, 23, 42, 0.06);\n border-color: rgba(15, 23, 42, 0.12);\n opacity: 0.6;\n }\n \n .toastify-pro.confirmation.light .conf-close-btn:hover { \n background: rgba(15, 23, 42, 0.12);\n border-color: rgba(15, 23, 42, 0.2);\n opacity: 1;\n }\n\n /* Icon styling for confirmation */\n .toastify-pro.confirmation .toast-icon {\n width: 56px;\n height: 56px;\n margin: 0 auto 8px;\n background: rgba(255, 255, 255, 0.15);\n backdrop-filter: blur(12px);\n border: 2px solid rgba(255, 255, 255, 0.2);\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);\n }\n\n .toastify-pro.confirmation .toast-icon svg {\n width: 28px;\n height: 28px;\n }\n\n .toastify-pro.confirmation.light .toast-icon {\n background: rgba(15, 23, 42, 0.08);\n border-color: rgba(15, 23, 42, 0.15);\n }\n\n .toastify-pro.confirmation .toast-content {\n text-align: center;\n margin-bottom: 4px;\n }\n\n .toastify-pro.confirmation .toast-message {\n font-weight: 700;\n font-size: 20px;\n margin-bottom: 8px;\n letter-spacing: -0.02em;\n line-height: 1.3;\n }\n\n .toastify-pro.confirmation .toast-description {\n font-size: 15px;\n opacity: 0.85;\n margin-top: 8px;\n line-height: 1.5;\n font-weight: 400;\n }\n\n /* Fix text visibility for dark/light variants */\n .toastify-pro.confirmation.dark .toast-message,\n .toastify-pro.confirmation.dark .toast-description {\n color: white;\n }\n\n .toastify-pro.confirmation.light .toast-message,\n .toastify-pro.confirmation.light .toast-description {\n color: #1e293b;\n }\n\n .toast-actions {\n display: flex;\n gap: 14px;\n margin-top: 4px;\n }\n\n .toast-btn {\n flex: 1;\n padding: 14px 20px;\n border: none;\n border-radius: 12px;\n font-weight: 600;\n font-size: 15px;\n cursor: pointer;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n backdrop-filter: blur(10px);\n position: relative;\n overflow: hidden;\n letter-spacing: 0.01em;\n }\n\n .toast-btn::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 0;\n height: 0;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.3);\n transform: translate(-50%, -50%);\n transition: width 0.6s, height 0.6s;\n }\n\n .toast-btn:hover::after {\n width: 300px;\n height: 300px;\n }\n\n .toast-btn:hover {\n transform: translateY(-2px);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);\n }\n\n .toast-btn:active {\n transform: translateY(0);\n transition: all 0.1s;\n }\n\n .toast-btn-cancel {\n background: rgba(255, 255, 255, 0.1);\n color: rgba(255, 255, 255, 0.9);\n border: 1.5px solid rgba(255, 255, 255, 0.25);\n font-weight: 600;\n }\n\n .toast-btn-cancel:hover {\n background: rgba(255, 255, 255, 0.15);\n color: white;\n border-color: rgba(255, 255, 255, 0.35);\n }\n \n .toast-btn-cancel:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n .toast-btn-confirm {\n color: white;\n font-weight: 700;\n border: 2px solid rgba(255, 255, 255, 0.4);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);\n position: relative;\n overflow: hidden;\n background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));\n }\n\n .toast-btn-confirm::before {\n content: '';\n position: absolute;\n top: 0;\n left: -100%;\n width: 100%;\n height: 100%;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);\n transition: left 0.6s;\n }\n\n .toast-btn-confirm:hover::before {\n left: 100%;\n }\n\n .toast-btn-confirm:hover {\n background: linear-gradient(135deg, rgba(15, 23, 42, 1), rgba(30, 41, 59, 1));\n border-color: rgba(255, 255, 255, 0.5);\n box-shadow: 0 8px 28px rgba(15, 23, 42, 0.5);\n }\n \n .toast-btn-confirm.loading {\n opacity: 0.7;\n cursor: not-allowed;\n pointer-events: none;\n }\n \n .toast-btn-confirm .btn-spinner {\n display: none;\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top-color: white;\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n margin-right: 8px;\n }\n \n .toast-btn-confirm.loading .btn-spinner {\n display: inline-block;\n }\n \n .toast-btn-confirm.loading .btn-text {\n opacity: 0.7;\n }\n\n .toastify-pro.light .toast-btn-cancel {\n background: rgba(15, 23, 42, 0.08);\n color: rgba(15, 23, 42, 0.85);\n border-color: rgba(15, 23, 42, 0.2);\n }\n\n .toastify-pro.light .toast-btn-cancel:hover {\n background: rgba(15, 23, 42, 0.12);\n color: rgba(15, 23, 42, 1);\n border-color: rgba(15, 23, 42, 0.3);\n }\n\n /* Enhanced light theme confirm buttons */\n .toastify-pro.light .toast-btn-confirm {\n border-color: rgba(15, 23, 42, 0.35);\n background: linear-gradient(135deg, #1e293b 0%, #334155 100%);\n color: white;\n }\n\n .toastify-pro.light .toast-btn-confirm:hover {\n background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);\n border-color: rgba(15, 23, 42, 0.5);\n box-shadow: 0 8px 28px rgba(15, 23, 42, 0.3);\n }\n\n @media (max-width: 640px) {\n .toastify-pro.confirmation {\n min-width: 280px;\n max-width: calc(100vw - 32px);\n }\n }\n ",document.head.appendChild(n)}catch(n){console.error("ToastifyPro: Failed to inject styles:",n)}}show(n,t="dark",o={}){if("string"!=typeof n&&(console.warn("ToastifyPro: Message must be a string. Converting to string."),n=String(n)),!n.trim())return void console.warn("ToastifyPro: Empty message provided.");["success","error","info","warning","dark","light"].includes(t)||(console.warn(`ToastifyPro: Invalid type "${t}". Using "dark".`),t="dark"),"object"==typeof o&&null!==o||(console.warn("ToastifyPro: Invalid options parameter. Using defaults."),o={});const e={...this.defaultOptions,...o};try{const o=document.createElement("div");o.className=`toastify-pro ${t}`,e.timeout>0&&o.style.setProperty("--duration",`${e.timeout}ms`);const r=document.createElement("div");r.className="toast-icon",r.innerHTML=this.getIconSVG(t),o.appendChild(r);const a=document.createElement("div");a.className="toast-content";const i=document.createElement("div");if(i.className="toast-message",i.textContent=n.substring(0,e.maxLength),a.appendChild(i),e.description&&"string"==typeof e.description){const n=document.createElement("div");n.className="toast-description",n.textContent=e.description.substring(0,2*e.maxLength),a.appendChild(n)}if(o.appendChild(a),e.allowClose){const n=document.createElement("span");n.className="close-btn",n.innerHTML="×",n.setAttribute("aria-label","Close notification"),n.onclick=()=>this.removeToast(o),o.appendChild(n)}return this.container.appendChild(o),setTimeout(()=>{o.classList.add("show");const n=o.querySelector(".toast-icon");n&&(n.style.animation="iconBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)")},10),e.timeout>0&&setTimeout(()=>this.removeToast(o),e.timeout),o}catch(n){console.error("ToastifyPro: Failed to create toast:",n)}}removeToast(n){if(n&&n.parentNode)try{const t=n.parentNode.className.split(" ")[1];let o="carSwipeBottom";t.includes("bottom")?o="carSwipeBottom":t.includes("top")?o="carSwipeTop":t.includes("left")?o="carSwipeLeft":t.includes("right")?o="carSwipeRight":t.includes("center")&&(o="carSwipeCenter"),n.style.animation=`${o} 0.4s cubic-bezier(0.4, 0.0, 1, 1) forwards`;const e=n.querySelector(".toast-icon");e&&(e.style.animation="iconCarExit 0.4s cubic-bezier(0.4, 0.0, 1, 1) forwards"),setTimeout(()=>{n.parentNode&&n.remove()},400)}catch(t){console.error("ToastifyPro: Error removing toast:",t),n.parentNode&&n.remove()}else console.warn("ToastifyPro: Invalid toast element for removal.")}success(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"success",t)}error(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"error",t)}info(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"info",t)}warning(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"warning",t)}dark(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"dark",t)}light(n,t){"string"==typeof t&&(t={description:t}),this.show(n,"light",t)}conf(t,o,e){if(n&&n.element&&n.element.parentNode){const t=n.element;return t.classList.remove("shake"),t.offsetWidth,t.classList.add("shake"),setTimeout(()=>{t&&t.parentNode&&t.classList.remove("shake")},600),n}let r="",a={},i=null;"function"!=typeof o||e?"string"==typeof o&&"function"==typeof e?(r=o,i=e):"object"==typeof o&&null!==o?(a=o,r=a.description||"",a.onConfirm||a.onCancel?i=null:"function"==typeof e&&(i=e)):"string"==typeof o&&"object"==typeof e&&(r=o,a=e||{},i=null):i=o;const s={timeout:0,allowClose:!1,confirmText:a.confirmText||"Confirm",cancelText:a.cancelText||"Cancel",theme:a.theme||a.color||"dark",position:a.position||"center",primaryColor:a.primaryColor||null,secondaryColor:a.secondaryColor||null,loading:a.loading||!1,...a};"light"===s.theme||"white"===s.theme?s.theme="light":s.theme="dark";const c=n=>{if(!n)return!1;const t=n.replace("#","");return(299*parseInt(t.substr(0,2),16)+587*parseInt(t.substr(2,2),16)+114*parseInt(t.substr(4,2),16))/1e3>155};let l="light"===s.theme?"#1e293b":"white";s.primaryColor&&(l=c(s.primaryColor)?"#1e293b":"white");["top-left","top-right","bottom-left","bottom-right","top-center","bottom-center","center"].includes(s.position)||(console.warn(`ToastifyPro: Invalid confirmation position "${s.position}". Using default position.`),s.position=this.defaultOptions.position);let p=document.querySelector(`.toastify-pro-container.${s.position}`);if(!p)try{p=document.createElement("div"),p.className=`toastify-pro-container ${s.position}`,document.body.appendChild(p)}catch(n){console.warn("ToastifyPro: Failed to create confirmation container. Using default container."),p=this.container}let d=null,f=null,g=null,m=!1,b=!1,h=null;const y=n=>{b=!0,m=n,d&&(n?(d.classList.add("loading"),d.disabled=!0):(d.classList.remove("loading"),d.disabled=!1)),f&&(f.disabled=n,f.style.opacity=n?"0.5":"1",f.style.cursor=n?"not-allowed":"pointer"),g&&(g.style.opacity=n?"0.3":"0.5",g.style.cursor=n?"not-allowed":"pointer",g.style.pointerEvents=n?"none":"auto")},u=()=>{h&&h.parentNode&&(n=null,this.removeToast(h))},x=async n=>{if(n)if(a.onConfirm&&"function"==typeof a.onConfirm)try{const n=a.onConfirm({setLoading:y,close:u});n&&"function"==typeof n.then?(b||y(!0),await n,h&&h.parentNode&&(y(!1),u())):b||u()}catch(n){console.error("ToastifyPro: Error in onConfirm callback:",n),y(!1),u()}else if(i&&"function"==typeof i)try{const n=i(!0,{setLoading:y,close:u});n&&"function"==typeof n.then?(b||y(!0),await n,h&&h.parentNode&&(y(!1),u())):b||u()}catch(n){console.error("ToastifyPro: Error in confirmation callback:",n),y(!1),u()}else u();else{if(m)return;if(a.onCancel&&"function"==typeof a.onCancel)try{a.onCancel()}catch(n){console.error("ToastifyPro: Error in onCancel callback:",n)}if(i&&"function"==typeof i)try{i(!1)}catch(n){console.error("ToastifyPro: Error in confirmation callback:",n)}u()}};try{const o=document.createElement("div");if(o.className=`toastify-pro confirmation ${s.theme}`,h=o,s.primaryColor){const n=s.primaryColor,t=s.secondaryColor;o.style.background=t?`linear-gradient(135deg, ${n} 0%, ${t} 100%)`:n,o.style.color=l;const e=c(n)?"0.2":"0.15";o.style.borderColor=`rgba(255, 255, 255, ${e})`}const e=document.createElement("span");e.className="conf-close-btn",e.innerHTML="×",e.setAttribute("aria-label","Cancel confirmation"),e.onclick=()=>{m||x(!1)},s.primaryColor&&(e.style.color=l),g=e,o.appendChild(e);const a=document.createElement("div");a.className="toast-icon",a.innerHTML=this.getIconSVG("info"),s.primaryColor&&(a.style.color=l),o.appendChild(a);const i=document.createElement("div");i.className="toast-content";const b=document.createElement("div");if(b.className="toast-message",b.textContent=t.substring(0,this.defaultOptions.maxLength),s.primaryColor&&(b.style.color=l),i.appendChild(b),r){const n=document.createElement("div");n.className="toast-description",n.textContent=r.substring(0,2*this.defaultOptions.maxLength),s.primaryColor&&(n.style.color=l),i.appendChild(n)}o.appendChild(i);const w=document.createElement("div");w.className="toast-actions";const v=document.createElement("button");if(v.className="toast-btn toast-btn-cancel",v.textContent=s.cancelText,v.onclick=()=>{m||x(!1)},f=v,s.primaryColor){const n=c(s.primaryColor);v.style.background=n?"rgba(15, 23, 42, 0.08)":"rgba(255, 255, 255, 0.1)",v.style.color=l,v.style.borderColor=n?"rgba(15, 23, 42, 0.2)":"rgba(255, 255, 255, 0.25)"}const k=document.createElement("button");k.className="toast-btn toast-btn-confirm";const C=document.createElement("span");C.className="btn-spinner",k.appendChild(C);const T=document.createElement("span");if(T.className="btn-text",T.textContent=s.confirmText,k.appendChild(T),k.onclick=()=>{m||x(!0)},d=k,s.primaryColor){const n=s.primaryColor,t=s.secondaryColor,o=c(n);k.style.background=t?`linear-gradient(135deg, ${n} 0%, ${t} 100%)`:n,k.style.color=o?"#1e293b":"white",k.style.borderColor=o?"rgba(15, 23, 42, 0.3)":"rgba(255, 255, 255, 0.4)"}w.appendChild(v),w.appendChild(k),o.appendChild(w),p.appendChild(o);const z={element:o,setLoading:y,close:u};return n=z,s.loading&&y(!0),setTimeout(()=>{o.classList.add("show");const n=o.querySelector(".toast-icon");n&&(n.style.animation="iconBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)")},10),z}catch(n){console.error("ToastifyPro: Failed to create confirmation toast:",n)}}confirm(n,t,o){return this.conf(n,t,o)}}"undefined"!=typeof module&&module.exports&&(module.exports=t),"undefined"!=typeof exports&&(exports.ToastifyPro=t,exports.default=t),"function"==typeof define&&define.amd&&define(function(){return t}),"undefined"!=typeof window&&(window.ToastifyPro=t)});
|
|
30
|
+
*/let t=null;class n{constructor(t={}){"object"==typeof t&&null!==t||(console.warn("ToastifyPro: Invalid options parameter. Using defaults."),t={}),this.defaultOptions={position:t.position||"bottom-center",timeout:t.timeout||3e3,allowClose:!1!==t.allowClose,maxLength:t.maxLength||100,primaryColor:t.primaryColor||null,secondaryColor:t.secondaryColor||null,pauseOnHover:!1!==t.pauseOnHover,maxToasts:t.maxToasts||0,newestOnTop:!1!==t.newestOnTop,ariaLive:t.ariaLive||"polite"},this.activeToasts=[];if(["top-left","top-right","bottom-left","bottom-right","top-center","bottom-center","center"].includes(this.defaultOptions.position)||(console.warn(`ToastifyPro: Invalid position "${this.defaultOptions.position}". Using "bottom-center".`),this.defaultOptions.position="bottom-center"),"undefined"==typeof document)throw new Error("ToastifyPro: This library requires a DOM environment (browser).");const n=document.querySelector(`.toastify-pro-container.${this.defaultOptions.position}`);if(n)this.container=n;else try{this.container=document.createElement("div"),this.container.className=`toastify-pro-container ${this.defaultOptions.position}`,document.body.appendChild(this.container)}catch(t){throw new Error("ToastifyPro: Failed to create container element. DOM may not be ready.")}this.injectStyles(),this.setupKeyboardNavigation()}setupKeyboardNavigation(){window._toastifyProKeyboardSetup||(window._toastifyProKeyboardSetup=!0,document.addEventListener("keydown",n=>{if("Escape"===n.key){if(t&&t.element){return void(t.element.querySelector(".toast-btn-confirm.loading")||t.close())}document.querySelectorAll(".toastify-pro-container").forEach(t=>{const n=t.querySelectorAll(".toastify-pro:not(.confirmation)");if(n.length>0){const t=n[n.length-1];t&&t._toastInstance&&t._toastInstance.removeToast(t)}})}}))}getIconSVG(t){"string"!=typeof t&&(console.warn("ToastifyPro: Invalid icon type. Using default info icon."),t="info");const n={success:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" fill="currentColor"/>\n </svg>',error:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" fill="currentColor"/>\n </svg>',info:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" fill="currentColor"/>\n </svg>',warning:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" fill="currentColor"/>\n </svg>',dark:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" fill="currentColor"/>\n </svg>',light:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 11H7v6h2v-6zm4 0h-2v6h2v-6zm4 0h-2v6h2v-6zm2.5-9H19V1h-2v1H7V1H5v1H4.5C3.11 2 2 3.11 2 4.5v14C2 19.89 3.11 21 4.5 21h15c1.39 0 2.5-1.11 2.5-2.5v-14C22 3.11 20.89 2 19.5 2zm0 16h-15v-11h15v11z" fill="currentColor"/>\n </svg>'};return n[t]||n.info}injectStyles(){if(!document.getElementById("toastify-pro-styles"))try{const t=document.createElement("style");t.id="toastify-pro-styles",t.textContent="\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');\n \n .toastify-pro-container {\n position: fixed;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n gap: 16px;\n pointer-events: none;\n }\n .toastify-pro-container.top-left { top: 50px; left: 24px; align-items: flex-start; }\n .toastify-pro-container.top-right { top: 50px; right: 24px; align-items: flex-end; }\n .toastify-pro-container.bottom-left { bottom: 50px; left: 24px; align-items: flex-start; }\n .toastify-pro-container.bottom-right { bottom: 50px; right: 24px; align-items: flex-end; }\n .toastify-pro-container.top-center { top: 50px; left: 50%; transform: translateX(-50%); }\n .toastify-pro-container.bottom-center { bottom: 50px; left: 50%; transform: translateX(-50%); }\n .toastify-pro-container.center { top: 50%; left: 50%; transform: translate(-50%, -50%); }\n\n .toastify-pro {\n min-width: 280px;\n max-width: 400px;\n padding: 20px 24px;\n border-radius: 16px;\n font-size: 15px;\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n font-weight: 500;\n color: white;\n opacity: 0;\n transform: scale(0.3);\n transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);\n pointer-events: auto;\n position: relative;\n display: flex;\n align-items: center;\n gap: 16px;\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n box-shadow: \n 0 20px 25px -5px rgba(0, 0, 0, 0.1),\n 0 10px 10px -5px rgba(0, 0, 0, 0.04),\n 0 0 0 1px rgba(255, 255, 255, 0.05);\n overflow: hidden;\n }\n \n .toastify-pro::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 3px;\n background: linear-gradient(90deg, \n rgba(255, 255, 255, 0.8) 0%,\n rgba(255, 255, 255, 0.4) 50%,\n rgba(255, 255, 255, 0.8) 100%);\n animation: shimmer 2s infinite;\n transition: opacity 0.8s ease;\n }\n \n .toastify-pro::after {\n content: '';\n position: absolute;\n bottom: 0;\n left: 0;\n height: 3px;\n background: rgba(255, 255, 255, 0.6);\n animation: progress var(--duration, 5s) linear;\n border-radius: 0 0 16px 16px;\n }\n \n @keyframes airdropPop {\n 0% { \n opacity: 0;\n transform: scale(0.3) rotateY(-20deg); \n }\n 30% { \n opacity: 0.8;\n transform: scale(1.1) rotateY(10deg); \n }\n 60% { \n opacity: 1;\n transform: scale(0.98) rotateY(-3deg); \n }\n 100% { \n opacity: 1;\n transform: scale(1) rotateY(0deg); \n }\n }\n \n @keyframes carSwipeBottom {\n 0% { \n opacity: 1;\n transform: scale(1) translateY(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateY(-8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateY(200px); \n }\n }\n \n @keyframes carSwipeTop {\n 0% { \n opacity: 1;\n transform: scale(1) translateY(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateY(8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateY(-200px); \n }\n }\n \n @keyframes carSwipeLeft {\n 0% { \n opacity: 1;\n transform: scale(1) translateX(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateX(8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateX(-300px); \n }\n }\n \n @keyframes carSwipeRight {\n 0% { \n opacity: 1;\n transform: scale(1) translateX(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateX(-8px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.8) translateX(300px); \n }\n }\n \n @keyframes carSwipeCenter {\n 0% { \n opacity: 1;\n transform: scale(1) translateY(0); \n }\n 15% { \n opacity: 1;\n transform: scale(1.02) translateY(-5px); \n }\n 100% { \n opacity: 0;\n transform: scale(0.6) translateY(150px); \n }\n }\n \n @keyframes progress {\n 0% { width: 100%; }\n 100% { width: 0%; }\n }\n \n @keyframes shimmer {\n 0% { transform: translateX(-100%); }\n 100% { transform: translateX(100%); }\n }\n \n @keyframes shake {\n 0%, 100% { transform: translate(0, 0); }\n 10%, 30%, 50%, 70%, 90% { transform: translate(-10px, 0); }\n 20%, 40%, 60%, 80% { transform: translate(10px, 0); }\n }\n \n @keyframes shakeCenter {\n 0%, 100% { transform: scale(1) translateX(0); }\n 10%, 30%, 50%, 70%, 90% { transform: scale(1) translateX(-10px); }\n 20%, 40%, 60%, 80% { transform: scale(1) translateX(10px); }\n }\n \n .toastify-pro.shake {\n animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;\n }\n \n .toastify-pro-container.center .toastify-pro.shake {\n animation: shakeCenter 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;\n }\n \n .toastify-pro.show { \n opacity: 1; \n transform: scale(1);\n animation: airdropPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);\n }\n \n .toastify-pro.success { \n background: linear-gradient(135deg, \n rgba(34, 197, 94, 0.9) 0%,\n rgba(21, 128, 61, 0.9) 100%);\n border-color: rgba(34, 197, 94, 0.3);\n }\n \n .toastify-pro.error { \n background: linear-gradient(135deg, \n rgba(239, 68, 68, 0.9) 0%,\n rgba(185, 28, 28, 0.9) 100%);\n border-color: rgba(239, 68, 68, 0.3);\n }\n \n .toastify-pro.info { \n background: linear-gradient(135deg, \n rgba(59, 130, 246, 0.9) 0%,\n rgba(29, 78, 216, 0.9) 100%);\n border-color: rgba(59, 130, 246, 0.3);\n }\n \n .toastify-pro.warning { \n background: linear-gradient(135deg, \n rgba(245, 158, 11, 0.9) 0%,\n rgba(217, 119, 6, 0.9) 100%);\n border-color: rgba(245, 158, 11, 0.3);\n }\n \n .toastify-pro.dark { \n background: linear-gradient(135deg, \n rgba(15, 23, 42, 0.95) 0%,\n rgba(30, 41, 59, 0.95) 100%);\n border-color: rgba(148, 163, 184, 0.2);\n }\n \n .toastify-pro.light { \n background: linear-gradient(135deg, \n rgba(255, 255, 255, 0.95) 0%,\n rgba(248, 250, 252, 0.95) 100%);\n color: #1e293b;\n border-color: rgba(226, 232, 240, 0.8);\n box-shadow: \n 0 20px 25px -5px rgba(0, 0, 0, 0.08),\n 0 10px 10px -5px rgba(0, 0, 0, 0.03);\n }\n \n .toastify-pro.light::before {\n background: linear-gradient(90deg, \n rgba(30, 41, 59, 0.8) 0%,\n rgba(30, 41, 59, 0.4) 50%,\n rgba(30, 41, 59, 0.8) 100%);\n }\n \n .toastify-pro.light::after {\n background: rgba(30, 41, 59, 0.6);\n }\n\n .toastify-pro .toast-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.2);\n backdrop-filter: blur(10px);\n animation: iconPulse 2s infinite;\n }\n \n @keyframes iconPulse {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.05); }\n }\n \n @keyframes iconBounce {\n 0% { transform: scale(0.2) rotate(-15deg); }\n 40% { transform: scale(1.2) rotate(8deg); }\n 70% { transform: scale(0.95) rotate(-3deg); }\n 100% { transform: scale(1) rotate(0deg); }\n }\n \n @keyframes iconCarExit {\n 0% { \n transform: scale(1) rotate(0deg); \n opacity: 1;\n }\n 20% { \n transform: scale(1.1) rotate(-10deg); \n opacity: 0.9;\n }\n 100% { \n transform: scale(0.3) rotate(180deg); \n opacity: 0;\n }\n }\n \n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n .toastify-pro .toast-icon svg {\n width: 18px;\n height: 18px;\n color: inherit;\n filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));\n }\n\n .toastify-pro.light .toast-icon {\n background: rgba(15, 23, 42, 0.1);\n }\n\n .toastify-pro .toast-content {\n flex: 1;\n line-height: 1.5;\n font-weight: 500;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n\n .toastify-pro .toast-message {\n font-size: 15px;\n font-weight: 500;\n margin-bottom: 0;\n }\n\n .toastify-pro .toast-description {\n font-size: 13px;\n font-weight: 400;\n opacity: 0.85;\n margin-top: 4px;\n line-height: 1.4;\n }\n\n .toastify-pro .close-btn {\n cursor: pointer;\n font-size: 20px;\n color: inherit;\n opacity: 0.7;\n padding: 8px;\n border-radius: 50%;\n transition: all 0.2s ease;\n flex-shrink: 0;\n width: 32px;\n border: none;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.1);\n backdrop-filter: blur(10px);\n font-weight: 300;\n line-height: 1;\n }\n \n .toastify-pro .close-btn:hover { \n opacity: 1; \n background: rgba(255, 255, 255, 0.2);\n transform: scale(1.1);\n }\n \n .toastify-pro.light .close-btn {\n background: rgba(15, 23, 42, 0.08);\n }\n \n .toastify-pro.light .close-btn:hover { \n background: rgba(15, 23, 42, 0.15);\n }\n \n @media (max-width: 640px) {\n .toastify-pro {\n min-width: 260px;\n max-width: calc(100vw - 48px);\n margin: 0 8px;\n }\n \n .toastify-pro-container.top-left,\n .toastify-pro-container.bottom-left { left: 16px; }\n .toastify-pro-container.top-right,\n .toastify-pro-container.bottom-right { right: 16px; }\n }\n\n /* Confirmation Toast Styles - Enhanced Modern Design */\n .toastify-pro.confirmation {\n min-width: 380px;\n max-width: 500px;\n padding: 32px 28px 28px;\n flex-direction: column;\n align-items: stretch;\n gap: 24px;\n position: relative;\n backdrop-filter: blur(24px) saturate(180%);\n box-shadow: \n 0 24px 48px -12px rgba(0, 0, 0, 0.25),\n 0 12px 24px -8px rgba(0, 0, 0, 0.15),\n 0 0 0 1px rgba(255, 255, 255, 0.08),\n inset 0 1px 0 0 rgba(255, 255, 255, 0.1);\n border: 1.5px solid rgba(255, 255, 255, 0.15);\n border-radius: 20px;\n }\n\n /* Hide progress bar for confirmation toasts */\n .toastify-pro.confirmation::after {\n display: none;\n }\n\n /* Shimmer effect for confirmation toasts */\n .toastify-pro.confirmation::before {\n opacity: 0.5;\n }\n\n /* Close button for confirmation dialogs */\n .toastify-pro.confirmation .conf-close-btn {\n position: absolute;\n top: 14px;\n right: 14px;\n cursor: pointer;\n font-size: 20px;\n color: inherit;\n opacity: 0.5;\n padding: 6px;\n border-radius: 8px;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.08);\n backdrop-filter: blur(10px);\n font-weight: 300;\n line-height: 1;\n border: 1px solid rgba(255, 255, 255, 0.12);\n }\n \n .toastify-pro.confirmation .conf-close-btn:hover { \n opacity: 0.9; \n background: rgba(255, 255, 255, 0.15);\n transform: scale(1.1) rotate(90deg);\n border-color: rgba(255, 255, 255, 0.25);\n }\n \n .toastify-pro.confirmation.light .conf-close-btn {\n background: rgba(15, 23, 42, 0.06);\n border-color: rgba(15, 23, 42, 0.12);\n opacity: 0.6;\n }\n \n .toastify-pro.confirmation.light .conf-close-btn:hover { \n background: rgba(15, 23, 42, 0.12);\n border-color: rgba(15, 23, 42, 0.2);\n opacity: 1;\n }\n\n /* Icon styling for confirmation */\n .toastify-pro.confirmation .toast-icon {\n width: 56px;\n height: 56px;\n margin: 0 auto 8px;\n background: rgba(255, 255, 255, 0.15);\n backdrop-filter: blur(12px);\n border: 2px solid rgba(255, 255, 255, 0.2);\n box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);\n }\n\n .toastify-pro.confirmation .toast-icon svg {\n width: 28px;\n height: 28px;\n }\n\n .toastify-pro.confirmation.light .toast-icon {\n background: rgba(15, 23, 42, 0.08);\n border-color: rgba(15, 23, 42, 0.15);\n }\n\n .toastify-pro.confirmation .toast-content {\n text-align: center;\n margin-bottom: 4px;\n }\n\n .toastify-pro.confirmation .toast-message {\n font-weight: 700;\n font-size: 20px;\n margin-bottom: 8px;\n letter-spacing: -0.02em;\n line-height: 1.3;\n }\n\n .toastify-pro.confirmation .toast-description {\n font-size: 15px;\n opacity: 0.85;\n margin-top: 8px;\n line-height: 1.5;\n font-weight: 400;\n }\n\n /* Fix text visibility for dark/light variants */\n .toastify-pro.confirmation.dark .toast-message,\n .toastify-pro.confirmation.dark .toast-description {\n color: white;\n }\n\n .toastify-pro.confirmation.light .toast-message,\n .toastify-pro.confirmation.light .toast-description {\n color: #1e293b;\n }\n\n .toast-actions {\n display: flex;\n gap: 14px;\n margin-top: 4px;\n }\n\n .toast-btn {\n flex: 1;\n padding: 14px 20px;\n border: none;\n border-radius: 12px;\n font-weight: 600;\n font-size: 15px;\n cursor: pointer;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n backdrop-filter: blur(10px);\n position: relative;\n overflow: hidden;\n letter-spacing: 0.01em;\n }\n\n .toast-btn::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 0;\n height: 0;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.3);\n transform: translate(-50%, -50%);\n transition: width 0.6s, height 0.6s;\n }\n\n .toast-btn:hover::after {\n width: 300px;\n height: 300px;\n }\n\n .toast-btn:hover {\n transform: translateY(-2px);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);\n }\n\n .toast-btn:active {\n transform: translateY(0);\n transition: all 0.1s;\n }\n\n .toast-btn-cancel {\n background: rgba(255, 255, 255, 0.1);\n color: rgba(255, 255, 255, 0.9);\n border: 1.5px solid rgba(255, 255, 255, 0.25);\n font-weight: 600;\n }\n\n .toast-btn-cancel:hover {\n background: rgba(255, 255, 255, 0.15);\n color: white;\n border-color: rgba(255, 255, 255, 0.35);\n }\n \n .toast-btn-cancel:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n .toast-btn-confirm {\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n font-weight: 700;\n border: 2px solid rgba(255, 255, 255, 0.4);\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);\n position: relative;\n overflow: hidden;\n background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));\n }\n\n .toast-btn-confirm::before {\n content: '';\n position: absolute;\n top: 0;\n left: -100%;\n width: 100%;\n height: 100%;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);\n transition: left 0.6s;\n }\n\n .toast-btn-confirm:hover::before {\n left: 100%;\n }\n\n .toast-btn-confirm:hover {\n background: linear-gradient(135deg, rgba(15, 23, 42, 1), rgba(30, 41, 59, 1));\n border-color: rgba(255, 255, 255, 0.5);\n box-shadow: 0 8px 28px rgba(15, 23, 42, 0.5);\n }\n \n .toast-btn-confirm.loading {\n opacity: 0.7;\n cursor: not-allowed;\n pointer-events: none;\n }\n \n .toast-btn-confirm .btn-spinner {\n display: none;\n align-items: center;\n justify-content: center;\n margin-left: 8px;\n }\n \n .toast-btn-confirm .btn-spinner svg {\n width: 25px;\n height: 25px;\n animation: spin 1s linear infinite;\n color: currentColor;\n }\n \n .toast-btn-confirm.loading .btn-spinner {\n display: inline-flex;\n }\n \n .toast-btn-confirm.loading .btn-text {\n opacity: 0.7;\n }\n\n .toastify-pro.light .toast-btn-cancel {\n background: rgba(15, 23, 42, 0.08);\n color: rgba(15, 23, 42, 0.85);\n border-color: rgba(15, 23, 42, 0.2);\n }\n\n .toastify-pro.light .toast-btn-cancel:hover {\n background: rgba(15, 23, 42, 0.12);\n color: rgba(15, 23, 42, 1);\n border-color: rgba(15, 23, 42, 0.3);\n }\n\n /* Enhanced light theme confirm buttons */\n .toastify-pro.light .toast-btn-confirm {\n border-color: rgba(15, 23, 42, 0.35);\n background: linear-gradient(135deg, #1e293b 0%, #334155 100%);\n color: white;\n }\n\n .toastify-pro.light .toast-btn-confirm:hover {\n background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);\n border-color: rgba(15, 23, 42, 0.5);\n box-shadow: 0 8px 28px rgba(15, 23, 42, 0.3);\n }\n\n @media (max-width: 640px) {\n .toastify-pro.confirmation {\n min-width: 280px;\n max-width: calc(100vw - 32px);\n }\n }\n \n /* Custom toast type */\n .toastify-pro.custom {\n border-color: rgba(255, 255, 255, 0.2);\n }\n \n .toastify-pro.custom.light-text {\n color: #1e293b;\n }\n \n .toastify-pro.custom.light-text .toast-icon {\n background: rgba(15, 23, 42, 0.1);\n }\n \n .toastify-pro.custom.light-text .close-btn {\n background: rgba(15, 23, 42, 0.08);\n }\n \n .toastify-pro.custom.light-text .close-btn:hover {\n background: rgba(15, 23, 42, 0.15);\n }\n \n .toastify-pro.custom.light-text::before {\n background: linear-gradient(90deg, \n rgba(30, 41, 59, 0.8) 0%,\n rgba(30, 41, 59, 0.4) 50%,\n rgba(30, 41, 59, 0.8) 100%);\n }\n \n .toastify-pro.custom.light-text::after {\n background: rgba(30, 41, 59, 0.6);\n }\n \n /* Confirmation Overlay */\n .toastify-pro-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n z-index: 9998;\n opacity: 0;\n transition: opacity 0.3s ease;\n pointer-events: auto;\n }\n \n .toastify-pro-overlay.show {\n opacity: 1;\n }\n \n /* Action Button Styles */\n .toastify-pro .toast-action {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n margin-top: 8px;\n border: none;\n border-radius: 8px;\n font-weight: 600;\n font-size: 13px;\n cursor: pointer;\n transition: all 0.2s ease;\n background: rgba(255, 255, 255, 0.2);\n color: inherit;\n backdrop-filter: blur(10px);\n }\n \n .toastify-pro .toast-action:hover {\n background: rgba(255, 255, 255, 0.3);\n transform: translateY(-1px);\n }\n \n .toastify-pro .toast-action:active {\n transform: translateY(0);\n }\n \n .toastify-pro.light .toast-action {\n background: rgba(15, 23, 42, 0.1);\n }\n \n .toastify-pro.light .toast-action:hover {\n background: rgba(15, 23, 42, 0.15);\n }\n \n /* Paused state - pause progress bar */\n .toastify-pro.paused::after {\n animation-play-state: paused;\n }\n \n /* Focus styles for accessibility */\n .toastify-pro .close-btn:focus,\n .toastify-pro .toast-action:focus,\n .toast-btn:focus {\n outline: 1px solid rgba(255, 255, 255, 0.8);\n }\n \n .toastify-pro.light .close-btn:focus,\n .toastify-pro.light .toast-action:focus {\n outline-color: 1px solid rgba(15, 23, 42, 0.5);\n }\n \n /* Screen reader only class */\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n \n /* Reduced motion support */\n @media (prefers-reduced-motion: reduce) {\n .toastify-pro {\n transition: opacity 0.3s ease;\n transform: none !important;\n }\n \n .toastify-pro.show {\n animation: none !important;\n opacity: 1;\n transform: none !important;\n }\n \n .toastify-pro .toast-icon {\n animation: none !important;\n }\n \n .toastify-pro::before {\n animation: none !important;\n }\n \n .toastify-pro::after {\n animation: progress var(--duration, 5s) linear !important;\n }\n \n .toastify-pro-overlay {\n transition: opacity 0.2s ease;\n }\n \n .toast-btn::after {\n display: none;\n }\n \n .toast-btn:hover {\n transform: none;\n }\n \n .toastify-pro.confirmation .conf-close-btn:hover {\n transform: scale(1.05);\n }\n \n .btn-spinner svg {\n animation: spin 1.5s linear infinite !important;\n }\n }\n ",document.head.appendChild(t)}catch(t){console.error("ToastifyPro: Failed to inject styles:",t)}}show(t,n="dark",o={}){if("string"!=typeof t&&(console.warn("ToastifyPro: Message must be a string. Converting to string."),t=String(t)),!t.trim())return void console.warn("ToastifyPro: Empty message provided.");["success","error","info","warning","dark","light"].includes(n)||(console.warn(`ToastifyPro: Invalid type "${n}". Using "dark".`),n="dark"),"object"==typeof o&&null!==o||(console.warn("ToastifyPro: Invalid options parameter. Using defaults."),o={});const e={...this.defaultOptions,...o};try{if(e.maxToasts>0&&this.activeToasts.length>=e.maxToasts){const t=this.activeToasts.length-e.maxToasts+1;for(let n=0;n<t;n++){const t=this.activeToasts.shift();t&&t.element&&this.removeToast(t.element)}}const o=document.createElement("div");o.className=`toastify-pro ${n}`,o._toastInstance=this;const r="error"===n||"warning"===n?"assertive":e.ariaLive||"polite";o.setAttribute("role","error"===n?"alert":"status"),o.setAttribute("aria-live",r),o.setAttribute("aria-atomic","true"),e.timeout>0&&o.style.setProperty("--duration",`${e.timeout}ms`);const i=document.createElement("div");i.className="toast-icon",i.setAttribute("aria-hidden","true"),i.innerHTML=this.getIconSVG(n),o.appendChild(i);const a=document.createElement("div");a.className="toast-content";const s=document.createElement("div");if(s.className="toast-message",s.textContent=t.substring(0,e.maxLength),a.appendChild(s),e.description&&"string"==typeof e.description){const t=document.createElement("div");t.className="toast-description",t.textContent=e.description.substring(0,2*e.maxLength),a.appendChild(t)}if(e.action&&"object"==typeof e.action){const t=document.createElement("button");t.className="toast-action",t.textContent=e.action.label||"Action",t.setAttribute("type","button"),"function"==typeof e.action.onClick&&(t.onclick=t=>{t.stopPropagation(),e.action.onClick({close:()=>this.removeToast(o),event:t})}),a.appendChild(t)}if(o.appendChild(a),e.allowClose){const t=document.createElement("button");t.className="close-btn",t.innerHTML="×",t.setAttribute("type","button"),t.setAttribute("aria-label","Close notification"),t.onclick=()=>this.removeToast(o),o.appendChild(t)}e.newestOnTop&&this.container.firstChild?this.container.insertBefore(o,this.container.firstChild):this.container.appendChild(o);const c={element:o,timeout:null,remainingTime:e.timeout,startTime:null,isPaused:!1};return this.activeToasts.push(c),setTimeout(()=>{o.classList.add("show");const t=o.querySelector(".toast-icon");t&&(t.style.animation="iconBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)")},10),e.pauseOnHover&&e.timeout>0&&(o.addEventListener("mouseenter",()=>{c.timeout&&(clearTimeout(c.timeout),c.isPaused=!0,c.remainingTime-=Date.now()-c.startTime,o.classList.add("paused"))}),o.addEventListener("mouseleave",()=>{if(c.isPaused&&c.remainingTime>0){c.isPaused=!1,c.startTime=Date.now(),o.classList.remove("paused"),o.style.setProperty("--duration",`${c.remainingTime}ms`);o.querySelector("::after");o.style.animation="none",o.offsetHeight,o.style.animation="",c.timeout=setTimeout(()=>this.removeToast(o),c.remainingTime)}})),e.timeout>0&&(c.startTime=Date.now(),c.timeout=setTimeout(()=>this.removeToast(o),e.timeout)),{element:o,dismiss:()=>this.removeToast(o),update:(t,n)=>this.updateToast(o,t,n)}}catch(t){console.error("ToastifyPro: Failed to create toast:",t)}}updateToast(t,n,o={}){if(!t||!t.parentNode)return;const e=t.querySelector(".toast-message"),r=t.querySelector(".toast-description");if(n&&e&&(e.textContent=n),o.description&&r)r.textContent=o.description;else if(o.description){const n=document.createElement("div");n.className="toast-description",n.textContent=o.description,t.querySelector(".toast-content")?.appendChild(n)}if(o.type){const n=["success","error","info","warning","dark","light"];if(n.includes(o.type)){n.forEach(n=>t.classList.remove(n)),t.classList.add(o.type);const e=t.querySelector(".toast-icon");e&&(e.innerHTML=this.getIconSVG(o.type))}}}removeToast(t){if(t&&t.parentNode)try{const n=this.activeToasts.findIndex(n=>n.element===t);if(n>-1){const t=this.activeToasts[n];t.timeout&&clearTimeout(t.timeout),this.activeToasts.splice(n,1)}const o=t.parentNode.className.split(" ")[1];let e="carSwipeBottom";o.includes("bottom")?e="carSwipeBottom":o.includes("top")?e="carSwipeTop":o.includes("left")?e="carSwipeLeft":o.includes("right")?e="carSwipeRight":o.includes("center")&&(e="carSwipeCenter"),t.style.animation=`${e} 0.4s cubic-bezier(0.4, 0.0, 1, 1) forwards`;const r=t.querySelector(".toast-icon");r&&(r.style.animation="iconCarExit 0.4s cubic-bezier(0.4, 0.0, 1, 1) forwards"),setTimeout(()=>{t.parentNode&&t.remove()},400)}catch(n){console.error("ToastifyPro: Error removing toast:",n),t.parentNode&&t.remove()}else console.warn("ToastifyPro: Invalid toast element for removal.")}dismissAll(t=null){[...this.activeToasts].forEach(n=>{n.element&&(t?n.element.classList.contains(t)&&this.removeToast(n.element):this.removeToast(n.element))})}getActiveCount(){return this.activeToasts.length}success(t,n){"string"==typeof n&&(n={description:n}),this.show(t,"success",n)}error(t,n){"string"==typeof n&&(n={description:n}),this.show(t,"error",n)}info(t,n){"string"==typeof n&&(n={description:n}),this.show(t,"info",n)}warning(t,n){"string"==typeof n&&(n={description:n}),this.show(t,"warning",n)}dark(t,n){"string"==typeof n&&(n={description:n}),this.show(t,"dark",n)}light(t,n){"string"==typeof n&&(n={description:n}),this.show(t,"light",n)}custom(t,n){"string"==typeof n&&(n={description:n});const o=(n=n||{}).primaryColor||this.defaultOptions.primaryColor,e=n.secondaryColor||this.defaultOptions.secondaryColor;if(!o)return this.success(t,n);const r=t=>{if(!t)return!1;const n=t.replace("#","");return(299*parseInt(n.substr(0,2),16)+587*parseInt(n.substr(2,2),16)+114*parseInt(n.substr(4,2),16))/1e3>155},i=(t,n)=>{const o=t.replace("#",""),e=parseInt(o.substr(0,2),16),r=parseInt(o.substr(2,2),16),i=parseInt(o.substr(4,2),16),a=t=>{const o=Math.round(t+n/100*(n>0?255-t:t));return Math.max(0,Math.min(255,o))};return`#${a(e).toString(16).padStart(2,"0")}${a(r).toString(16).padStart(2,"0")}${a(i).toString(16).padStart(2,"0")}`};let a,s=o;if(e)a=e;else{a=i(o,r(o)?-25:25)}const c=r(o),l={...n,customGradient:`linear-gradient(135deg, ${s} 0%, ${a} 100%)`,customTextLight:c};this.showCustom(t,l)}showCustom(t,n={}){if("string"!=typeof t&&(t=String(t)),!t.trim())return void console.warn("ToastifyPro: Empty message provided.");const o={...this.defaultOptions,...n};try{const n=document.createElement("div");n.className="toastify-pro custom"+(o.customTextLight?" light-text":""),n._toastInstance=this,n.setAttribute("role","status"),n.setAttribute("aria-live",o.ariaLive||"polite"),n.setAttribute("aria-atomic","true"),o.customGradient&&(n.style.background=o.customGradient),o.timeout>0&&n.style.setProperty("--duration",`${o.timeout}ms`);const e=document.createElement("div");e.className="toast-icon",e.setAttribute("aria-hidden","true"),e.innerHTML=this.getIconSVG("success"),n.appendChild(e);const r=document.createElement("div");r.className="toast-content";const i=document.createElement("div");if(i.className="toast-message",i.textContent=t.substring(0,o.maxLength),r.appendChild(i),o.description&&"string"==typeof o.description){const t=document.createElement("div");t.className="toast-description",t.textContent=o.description.substring(0,2*o.maxLength),r.appendChild(t)}if(n.appendChild(r),o.allowClose){const t=document.createElement("button");t.className="close-btn",t.innerHTML="×",t.setAttribute("type","button"),t.setAttribute("aria-label","Close notification"),t.onclick=()=>this.removeToast(n),n.appendChild(t)}o.newestOnTop&&this.container.firstChild?this.container.insertBefore(n,this.container.firstChild):this.container.appendChild(n);const a={element:n,timeout:null,remainingTime:o.timeout,startTime:null,isPaused:!1};return this.activeToasts.push(a),o.pauseOnHover&&o.timeout>0&&(n.addEventListener("mouseenter",()=>{a.timeout&&(clearTimeout(a.timeout),a.isPaused=!0,a.remainingTime-=Date.now()-a.startTime,n.classList.add("paused"))}),n.addEventListener("mouseleave",()=>{a.isPaused&&a.remainingTime>0&&(a.isPaused=!1,a.startTime=Date.now(),n.classList.remove("paused"),n.style.setProperty("--duration",`${a.remainingTime}ms`),a.timeout=setTimeout(()=>this.removeToast(n),a.remainingTime))})),setTimeout(()=>{n.classList.add("show");const t=n.querySelector(".toast-icon");t&&(t.style.animation="iconBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)")},10),o.timeout>0&&(a.startTime=Date.now(),a.timeout=setTimeout(()=>this.removeToast(n),o.timeout)),{element:n,dismiss:()=>this.removeToast(n),update:(t,o)=>this.updateToast(n,t,o)}}catch(t){console.error("ToastifyPro: Failed to create custom toast:",t)}}conf(n,o,e){if(t&&t.element&&t.element.parentNode){const n=t.element;return n.classList.remove("shake"),n.offsetWidth,n.classList.add("shake"),setTimeout(()=>{n&&n.parentNode&&n.classList.remove("shake")},600),t}let r="",i={},a=null;"function"!=typeof o||e?"string"==typeof o&&"function"==typeof e?(r=o,a=e):"object"==typeof o&&null!==o?(i=o,r=i.description||"",i.onConfirm||i.onCancel?a=null:"function"==typeof e&&(a=e)):"string"==typeof o&&"object"==typeof e&&(r=o,i=e||{},a=null):a=o;const s={timeout:0,allowClose:!1,confirmText:i.confirmText||"Confirm",cancelText:i.cancelText||"Cancel",theme:i.theme||i.color||"dark",position:i.position||"center",primaryColor:i.primaryColor||null,secondaryColor:i.secondaryColor||null,loading:i.loading||!1,...i};"light"===s.theme||"white"===s.theme?s.theme="light":s.theme="dark";const c=t=>{if(!t)return!1;const n=t.replace("#","");return(299*parseInt(n.substr(0,2),16)+587*parseInt(n.substr(2,2),16)+114*parseInt(n.substr(4,2),16))/1e3>155};let l="light"===s.theme?"#1e293b":"white";s.primaryColor&&(l=c(s.primaryColor)?"#1e293b":"white");["top-left","top-right","bottom-left","bottom-right","top-center","bottom-center","center"].includes(s.position)||(console.warn(`ToastifyPro: Invalid confirmation position "${s.position}". Using default position.`),s.position=this.defaultOptions.position);let p=document.querySelector(`.toastify-pro-container.${s.position}`);if(!p)try{p=document.createElement("div"),p.className=`toastify-pro-container ${s.position}`,document.body.appendChild(p)}catch(t){console.warn("ToastifyPro: Failed to create confirmation container. Using default container."),p=this.container}let d=null,m=null,f=null,g=!1,u=!1,h=null,b=null;const y=t=>{u=!0,g=t,d&&(t?(d.classList.add("loading"),d.disabled=!0):(d.classList.remove("loading"),d.disabled=!1)),m&&(m.disabled=t,m.style.opacity=t?"0.5":"1",m.style.cursor=t?"not-allowed":"pointer"),f&&(f.style.opacity=t?"0.3":"0.5",f.style.cursor=t?"not-allowed":"pointer",f.style.pointerEvents=t?"none":"auto")},x=()=>{h&&h.parentNode&&(t=null,b&&b.parentNode&&(b.classList.remove("show"),setTimeout(()=>{b&&b.parentNode&&b.remove(),b=null},300)),this.removeToast(h))},w=async t=>{if(t)if(i.onConfirm&&"function"==typeof i.onConfirm)try{const t=i.onConfirm({setLoading:y,close:x});t&&"function"==typeof t.then?(u||y(!0),await t,h&&h.parentNode&&(y(!1),x())):u||x()}catch(t){console.error("ToastifyPro: Error in onConfirm callback:",t),y(!1),x()}else if(a&&"function"==typeof a)try{const t=a(!0,{setLoading:y,close:x});t&&"function"==typeof t.then?(u||y(!0),await t,h&&h.parentNode&&(y(!1),x())):u||x()}catch(t){console.error("ToastifyPro: Error in confirmation callback:",t),y(!1),x()}else x();else{if(g)return;if(i.onCancel&&"function"==typeof i.onCancel)try{i.onCancel()}catch(t){console.error("ToastifyPro: Error in onCancel callback:",t)}if(a&&"function"==typeof a)try{a(!1)}catch(t){console.error("ToastifyPro: Error in confirmation callback:",t)}x()}};try{b=document.createElement("div"),b.className="toastify-pro-overlay",document.body.appendChild(b),setTimeout(()=>{b.classList.add("show")},10);const o=document.createElement("div");if(o.className=`toastify-pro confirmation ${s.theme}`,h=o,s.primaryColor){const t=s.primaryColor,n=s.secondaryColor;o.style.background=n?`linear-gradient(135deg, ${t} 0%, ${n} 100%)`:t,o.style.color=l;const e=c(t)?"0.2":"0.15";o.style.borderColor=`rgba(255, 255, 255, ${e})`}const e=document.createElement("button");e.className="conf-close-btn",e.innerHTML="×",e.setAttribute("type","button"),e.setAttribute("aria-label","Cancel confirmation"),e.onclick=()=>{g||w(!1)},s.primaryColor&&(e.style.color=l),f=e,o.appendChild(e);const i=document.createElement("div");i.className="toast-icon",i.setAttribute("aria-hidden","true"),i.innerHTML=this.getIconSVG("info"),s.primaryColor&&(i.style.color=l),o.appendChild(i);const a=document.createElement("div");a.className="toast-content";const u=document.createElement("div");u.className="toast-message",u.textContent=n.substring(0,this.defaultOptions.maxLength),s.primaryColor&&(u.style.color=l),a.appendChild(u);let v=null;r&&(v=document.createElement("div"),v.className="toast-description",v.textContent=r.substring(0,2*this.defaultOptions.maxLength),s.primaryColor&&(v.style.color=l),a.appendChild(v)),o.appendChild(a);const C=document.createElement("div");C.className="toast-actions";const k=document.createElement("button");if(k.className="toast-btn toast-btn-cancel",k.setAttribute("type","button"),k.textContent=s.cancelText,k.onclick=()=>{g||w(!1)},m=k,s.primaryColor){const t=c(s.primaryColor);k.style.background=t?"rgba(15, 23, 42, 0.08)":"rgba(255, 255, 255, 0.1)",k.style.color=l,k.style.borderColor=t?"rgba(15, 23, 42, 0.2)":"rgba(255, 255, 255, 0.25)"}const T=document.createElement("button");T.className="toast-btn toast-btn-confirm",T.setAttribute("type","button");const L=document.createElement("span");L.className="btn-text",L.textContent=s.confirmText,T.appendChild(L);const E=document.createElement("span");if(E.className="btn-spinner",E.innerHTML='\n <svg width="25" height="25" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.5 2.9375V5.5625M9.5 13.4375V16.0625M2.9375 9.5H5.5625M13.4375 9.5H16.0625" stroke="currentColor" stroke-width="1.875" stroke-linecap="round" />\n <path d="M4.86011 4.85961L6.71627 6.71577M12.2847 12.2842L14.1409 14.1404M4.86011 14.1404L6.71627 12.2842M12.2847 6.71577L14.1409 4.85961" stroke="currentColor" stroke-width="1.875" stroke-linecap="round" />\n </svg>\n ',T.appendChild(E),T.onclick=()=>{g||w(!0)},d=T,s.primaryColor){const t=s.primaryColor,n=s.secondaryColor,o=c(t);T.style.background=n?`linear-gradient(135deg, ${t} 0%, ${n} 100%)`:t,T.style.color=o?"#1e293b":"white",T.style.borderColor=o?"rgba(15, 23, 42, 0.3)":"rgba(255, 255, 255, 0.4)"}C.appendChild(k),C.appendChild(T),o.appendChild(C),p.appendChild(o);const S={element:o,setLoading:y,close:x};t=S,s.loading&&y(!0),o.setAttribute("role","alertdialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-labelledby","toast-conf-title"),r&&o.setAttribute("aria-describedby","toast-conf-desc"),u.id="toast-conf-title",r&&v&&(v.id="toast-conf-desc");const N=document.activeElement,P=[k,T,e].filter(Boolean);let z=0;const I=t=>{"Tab"===t.key&&h&&h.parentNode&&(t.preventDefault(),z=t.shiftKey?(z-1+P.length)%P.length:(z+1)%P.length,P[z]?.focus())};document.addEventListener("keydown",I);const M=x,A=()=>{document.removeEventListener("keydown",I),N&&"function"==typeof N.focus&&setTimeout(()=>N.focus(),100),M()};return S.close=A,setTimeout(()=>{o.classList.add("show");const t=o.querySelector(".toast-icon");t&&(t.style.animation="iconBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275)"),setTimeout(()=>{T.focus()},100)},10),S}catch(t){console.error("ToastifyPro: Failed to create confirmation toast:",t)}}confirm(t,n,o){return this.conf(t,n,o)}}"undefined"!=typeof module&&module.exports&&(module.exports=n),"undefined"!=typeof exports&&(exports.ToastifyPro=n,exports.default=n),"function"==typeof define&&define.amd&&define(function(){return n}),"undefined"!=typeof window&&(window.ToastifyPro=n)});
|
|
27
31
|
//# sourceMappingURL=toastify-pro.umd.min.js.map
|