static/js/common/common.js';
    import {
      showErrorAlert,
    } from '/static/js/common/alerts.js';

    // On preview button click, show the preview modal
    const previewButtons = document.querySelectorAll('.preview-button');
    previewButtons.forEach((button) => {
      button.addEventListener('htmx:afterRequest', (e) => {
        if (isSuccessfulXHRStatus(e.detail.xhr.status)) {
          toggleModalVisibility('preview-modal', "open");
        } else {
          // When the preview is not availa