s(e.detail.xhr.status)) {
            showSuccessAlert('Job updated successfully.');
          } else {
            showErrorAlert('Something went wrong updating the job, please try again later.');
          }
        }
      });
    }

    // On preview button click, show the preview modal
    const previewButton = document.getElementById('preview-button');
    if (previewButton) {
      previewButton.addEventListener('htmx:afterRequest', (e) => {
        if (isSuccessfulXHRStatus(e.detail.xhr.status)) {
 