{{ attach_library('naomi_2025/paragraph.subscribe') }}

{% set dialog_options = {
  "classes": {
    "ui-dialog": "modal modal--ajax",
    "ui-dialog-titlebar-close": "modal__close",
    "ui-dialog-titlebar": "modal__titlebar",
    "ui-dialog-title": "modal__title",
    "ui-dialog-content": "modal__content",
  },
  "title": "Subscribe",
  "position": { my: null, at: null, of: window },
  "width": "var(--modal--width)",
} %}

{% include "@ui-paragraph/subscribe/component/paragraph.subscribe.twig" with {
  paragraph_link:
    link('Sign up', 'internal:' ~ path('entity.webform.canonical', {'webform': 'signup'}), {
      class: 'use-ajax',
      'data-dialog-options': dialog_options|json_encode(),
      'data-dialog-type': 'modal'
    }),
} %}
