{% if site.use_show_widgets_button and page.has_widgets %}
<!-- Include nbinteract for interactive widgets -->
<script src="https://unpkg.com/nbinteract-core" async></script>

<script>
let interact

const initializeNbinteract = () => {
  // If NbInteract hasn't loaded, wait one second and try again
  if (window.NbInteract === undefined) {
    setTimeout(initializeNbinteract, 1000)
    return
  }

  if (interact === undefined) {
    console.log('Initializing nbinteract...')
    interact = new window.NbIntera