%
// Playlist editor modal — included once per page (in admin-playlists, and in
// post-edit when present). Exposes `window.openPlaylistEditor({ mode, id?, onSaved? })`.
//
// mode: 'create' or 'edit'
// id : (edit only) playlist id to load
// onSaved: callback receiving { id, playlist } — used by post-editor
// to insert [[playlist:id]] at the cursor.
//
// The modal itself is appended on first call; subsequent calls reuse the
// same DOM. CSS is included once. JS lives below.
const _csrf = (typeof csrfToken !== 'undefined' && csrfToken) || '';
%>