How to open/utilize Elementor Pro’s built-in lightbox using javascript

In it’s most bare bones form, I’m trying to add some javascript to my WordPress site (created with Elementor Pro) that will open a link as an iframe in Elementor’s built-in lightbox. I don’t need to modify any existing widgets nor do I need to build my own. I just need to attach a click event listener to a specific element that will run the code necessary to open a specified URL in an Elementor lightbox with specified properties.

I know there are codeless ways to have a link open a lightbox and I’m also aware that it can be done by adding certain markup to the element. For this circumstance, let’s just just move forward without either of those being options. As such, I believe I am left with trying to hook into Elementor’s frontend and do it from there.

So far I have:

jQuery(window).on('elementor/frontend/init', () => {
  document.addEventListener('click', function (e) {
    if (e.target.closest('#do-lightbox')) {
      const url = 'https://www.google.com';
      openLightbox(url);
    }
  });

  const openLightbox = url => {
    elementorFrontend.utils.lightbox.showModal({
      type: 'iframe',
      url: url,
      modalOptions: {
        id: 'elementor-lightbox-' + Date.now(),
        entranceAnimation: 'zoomIn',
        exitAnimation: 'zoomOut',
        closeButton: true,
      },
    });
});

This script is enqueued after all Elementor’s frotnend scripts using the elementor/frontend/after_enqueue_scripts hook.

Clicking the element produces the following error:

partner-logos-lightbox.js?ver=1731539592:28 Uncaught TypeError: elementorFrontend.utils.lightbox.showModal is not a function

Typing elementorFrontend.utils.lightbox in the console indicates that it is a fulfilled Promise, and as such does not have a showModal method available. So I guess the error makes sense. i’m just not sure how else to access the lightbox.

Any guidance would be greatly appreciated.