(function () { 'use strict'; // htmx dispatches `htmx:confirm` in place of `window.confirm()` whenever the element that // would issue a request carries `hx-confirm`. Intercepting it here upgrades every // `hx-confirm` in the project to a Bootstrap modal, without touching the element that // requested it or the request itself: cancelling is a no-op, confirming resumes the exact // same request via `evt.detail.issueRequest(true)`. if (typeof bootstrap === 'undefined' || !bootstrap.Modal) { return; } var modalEl = null; var questionEl = null; var pendingEvent = null; function ensureModal() { if (modalEl) { return; } var okLabel = document.body.dataset.confirmOk || 'OK'; var cancelLabel = document.body.dataset.confirmCancel || 'Cancel'; modalEl = document.createElement('div'); modalEl.className = 'modal fade'; modalEl.tabIndex = -1; modalEl.setAttribute('aria-hidden', 'true'); modalEl.innerHTML = '