import {IDesignOptions} from './types';
export function _getContentCancelModal(design?: IDesignOptions): string {
return `
Cancel Transaction?
?
If you haven't paid yet, you can safely cancel this process.
`;
}
export function _getContentCoreCss(design?: IDesignOptions): string {
const mode = design?.mode || 'light';
const isDark = mode.includes('dark');
const isTranslucent = mode.includes('translucent');
let cardBg = isDark ? '#1c1c1e' : '#ffffff';
if (isTranslucent) {
cardBg = isDark ? 'rgba(28, 28, 30, 0.75)' : 'rgba(255, 255, 255, 0.75)';
}
const backdrop = isTranslucent ? 'blur(20px)' : 'none';
return `
@import url('https://fonts.googleapis.com/css2?family=Padauk:wght@400;700&display=swap');
#mmpay-full-modal {
--mmp-card-bg: ${cardBg};
--mmp-card-backdrop: ${backdrop};
--mmp-text-main: ${isDark ? '#f5f5f7' : '#1d1d1f'};
--mmp-text-sub: ${isDark ? 'rgba(235, 235, 245, 0.6)' : '#86868b'};
--mmp-border: ${isDark ? 'rgba(255,255,255,0.1)' : 'rgba(0,0,0,0.06)'};
--mmp-btn-main-bg: ${isDark ? '#ffffff' : '#3a3a3c'};
--mmp-btn-main-text: ${isDark ? '#000000' : '#ffffff'};
--mmp-btn-sec-bg: ${isDark ? '#2c2c2e' : '#ffffff'};
--mmp-btn-sec-text: ${isDark ? '#f5f5f7' : '#1d1d1f'};
--mmp-btn-sec-border: ${isDark ? '#3a3a3c' : '#e5e5ea'};
--mmp-detail-bg: ${isDark ? '#2c2c2e' : '#f9f9fb'};
--mmp-toggle-bg: ${isDark ? '#2c2c2e' : '#f5f5f7'};
--mmp-toggle-btn-active: ${isDark ? '#636366' : '#ffffff'};
--mmp-toggle-btn-text: ${isDark ? '#ffffff' : '#1d1d1f'};
--mmp-progress-track: ${isDark ? '#2c2c2e' : '#f1f5f9'};
--mmp-progress-ind: ${isDark ? 'linear-gradient(90deg, transparent, #ffffff, transparent)' : 'linear-gradient(90deg, transparent, #0f172a, transparent)'};
--mmp-success-bg: ${isDark ? 'rgba(52, 199, 89, 0.2)' : '#e8f8ec'};
--mmp-fail-bg: ${isDark ? 'rgba(255, 59, 48, 0.2)' : '#fce8e6'};
--mmp-warn-bg: ${isDark ? 'rgba(255, 149, 0, 0.2)' : '#fff4e5'};
--mmp-close-btn-hover: ${isDark ? '#3a3a3c' : '#e5e5ea'};
position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
background-color: rgba(0, 0, 0, 0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
z-index: 99999; display: flex; align-items: center; justify-content: center;
transition: opacity 0.2s ease; box-sizing: border-box; padding: 16px;
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, 'Padauk';
}
.mmpay-lang-en .mm-text { display: none !important; }
.mmpay-lang-mm .en-text { display: none !important; }
.mmpay-toggle-container {
position: absolute; top: 16px; left: 16px; display: flex; background: var(--mmp-toggle-bg);
border-radius: 10px; padding: 3px; z-index: 10; border: 1px solid var(--mmp-border);
}
.mmpay-toggle-btn {
font-family: -apple-system, BlinkMacSystemFont, sans-serif; font-size: 0.75rem; font-weight: 600;
padding: 5px 10px; border-radius: 8px; cursor: pointer; color: var(--mmp-text-sub); border: none; background: transparent; transition: all 0.2s ease;
}
.mmpay-lang-en .btn-en, .mmpay-lang-mm .btn-mm { background: var(--mmp-toggle-btn-active); color: var(--mmp-toggle-btn-text); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.mmpay-overlay-content { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.mmpay-card {
background: var(--mmp-card-bg); backdrop-filter: var(--mmp-card-backdrop); -webkit-backdrop-filter: var(--mmp-card-backdrop);
border-radius: 24px; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--mmp-border);
text-align: center; animation: mmpayFadeIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); box-sizing: border-box;
position: relative; width: 100%; max-width: 360px; overflow: hidden; display: flex; flex-direction: column;
}
@keyframes mmpayFadeIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.mmpay-close-btn {
position: absolute; top: 16px; right: 16px; background: var(--mmp-toggle-bg); border: none; cursor: pointer; padding: 0;
color: var(--mmp-text-sub); border-radius: 50%; transition: all 0.2s ease; z-index: 10; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
}
.mmpay-close-btn:hover { background-color: var(--mmp-close-btn-hover); color: var(--mmp-text-main); }
.mmpay-button {
background: var(--mmp-btn-main-bg); color: var(--mmp-btn-main-text); border: none; padding: 14px 20px; border-radius: 14px;
font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 10px; transition: all 0.2s ease; width: 100%; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.mmpay-button:hover { filter: brightness(1.1); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); }
.mmpay-button:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.mmpay-button-secondary { background: var(--mmp-btn-sec-bg); color: var(--mmp-btn-sec-text); border: 1px solid var(--mmp-btn-sec-border); box-shadow: none; }
.mmpay-button-secondary:hover { background: var(--mmp-toggle-bg); box-shadow: none; }
.mmpay-button-danger { background: var(--mmp-fail-bg); color: #ff3b30; box-shadow: none; }
.mmpay-button-danger:hover { filter: brightness(0.95); box-shadow: none; }
`;
}
export function _getContentQRDisplay(qrContainerId: string, merchantName: string, formattedAmount: string, apiResponse: any, design?: IDesignOptions): string {
let customBtnStyle = '';
if (design?.color) {
customBtnStyle = `style="background-color: ${design.color} !important; color: #ffffff !important;"`;
}
return `
${formattedAmount}
MMK
Payment powered by MyanMyanPay
MyanMyanPay
Order ID
${apiResponse.orderId}
MMQR Ref No
${apiResponse.vendorQrRefId}
`;
}
export function _getContentAfterModal(status: 'SUCCESS' | 'FAILED' | 'EXPIRED' | 'CANCELLED', orderId: string, messageHtml: string, design?: IDesignOptions): string {
const isSuccess = status === 'SUCCESS';
const isCancelled = status === 'CANCELLED';
const iconColor = isSuccess ? '#34c759' : (isCancelled ? '#ff9500' : '#ff3b30');
const iconBgVar = isSuccess ? 'var(--mmp-success-bg)' : (isCancelled ? 'var(--mmp-warn-bg)' : 'var(--mmp-fail-bg)');
let iconSvg: string;
let statusTextEn: string;
let statusTextMm: string;
if (isSuccess) {
statusTextEn = 'Success';
statusTextMm = ' ';
iconSvg = ``;
} else if (isCancelled) {
statusTextEn = 'Cancelled';
statusTextMm = ' ';
iconSvg = ``;
} else {
statusTextEn = status === 'EXPIRED' ? 'Expired' : 'Failed';
statusTextMm = status === 'EXPIRED' ? ' ' : ' ';
iconSvg = ``;
}
return `
${iconSvg}
${statusTextEn}
${statusTextMm}
${messageHtml}
`;
}
export function _getPreloadScreen(design?: IDesignOptions): string {
return `
Securing Transaction
Establishing end-to-end encryption...
...
`;
}