The Ultimate Wedding Planning Checklist & DashboardWelcome to Your Wedding Planner!
Let's get started by personalizing your plan.
Set Your Currency
Please select the currency you'll be using for your budget.
`);
printWindow.document.close();
printWindow.focus();
setTimeout(() => { printWindow.print(); }, 500);
}function populateSelect(elementId, options) {
const select = getEl(elementId);
select.innerHTML = options.map(opt => `
`).join('');
}function escapeHTML(str) {
if (typeof str !== 'string') return '';
const p = document.createElement('p');
p.textContent = str;
return p.innerHTML;
}function exportPlan() {
const dataStr = JSON.stringify(appState);
const dataBlob = new Blob([dataStr], {type: 'application/json'});
const url = URL.createObjectURL(dataBlob);
const link = document.createElement('a');
link.download = `wedding-plan-${new Date().toISOString().slice(0,10)}.json`;
link.href = url;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);
}function importPlan(event) {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = function(e) {
try {
const importedState = JSON.parse(e.target.result);
if (importedState.weddingDate) {
appState = importedState;
appState.forceRegen = true;
saveState();
setupApp();
alert('Plan imported successfully!');
} else {
alert('Invalid plan file.');
}
} catch (err) { alert('Error reading file.'); }
};
reader.readAsText(file);
}function loadState() {
const savedState = localStorage.getItem('weddingPlannerState');
if (savedState) {
appState = JSON.parse(savedState);
} else {
appState = { budget: [], vendors: [], openCategories: [] };
}
}
function simulateDesktopViewOnMobile() {
const viewportMeta = document.querySelector('meta[name="viewport"]');
if (viewportMeta && window.innerWidth < 768) {
// Setting a fixed width forces the browser to render the page as if on a wider screen.
viewportMeta.setAttribute('content', 'width=1200');
console.log('Desktop view simulated for mobile.');
}
}
simulateDesktopViewOnMobile();function saveState() {
localStorage.setItem('weddingPlannerState', JSON.stringify(appState));
}init();})();