'use strict'; // Planner: Calendar and Tasks in one menu entry. Each part keeps its own address (#/calendar, #/tasks) so links and reminders still work. const PLANNER_PANES = [['calendar', 'Calendar'], ['tasks', 'Tasks']]; function viewPlanner(args = []) { const ok = PLANNER_PANES.map(p => p[0]).filter(p => allowed(p)); const want = args[0] && ok.includes(args[0]) ? args[0] : store.get('planner_pane', ok[0]); location.replace('#/' + (ok.includes(want) ? want : ok[0] || 'home')); } /** One compact toolbar instead of stacked rows: title, Calendar | Tasks switch, then `mid` (the view switch) and `extra` (a button) pushed to the right. */ function plannerHead(active, extra = '', mid = '') { try { localStorage.setItem(nk('planner_pane'), JSON.stringify(active)); } catch {} const panes = PLANNER_PANES.filter(p => allowed(p[0])); const two = panes.length > 1; const group = two ? `