text: /**
   * Minified by jsDelivr using Terser v5.7.1.
   * Original file: /npm/bootstrap@5.1.3/js/src/dom/event-handler.js
   *
   * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
   */
  import{getjQuery}from"../util/index";const namespaceRegex=/[^.]*(?=\..*)\.|.*/,stripNameRegex=/\..*/,stripUidRegex=/::\d+$/,eventRegistry={};let uidEvent=1;const customEvents={mouseenter:"mouseover",mouseleave:"mouseout"},customEventsRegex=/^(mouseenter|mouseleave)/i,nativeEvents=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function getUidEvent(e,t){return t&&`${t}::${uidEvent++}`||e.uidEvent||uidEvent++}function getEvent(e){const t=getUidEvent(e);return e.uidEvent=t,eventRegistry[t]=eventRegistry[t]||{},eventRegistry[t]}function bootstrapHandler(e,t){return function n(r){return r.delegateTarget=e,n.oneOff&&EventHandler.off(e,r.type,t),t.apply(e,[r])}}function bootstrapDelegationHandler(e,t,n){return function r(o){const a=e.querySelectorAll(t);for(let{target:l}=o;l&&l!==this;l=l.parentNode)for(let i=a.length;i--;)if(a[i]===l)return o.delegateTarget=l,r.oneOff&&EventHandler.off(e,o.type,t,n),n.apply(l,[o]);return null}}function findHandler(e,t,n=null){const r=Object.keys(e);for(let o=0,a=r.length;o<a;o++){const a=e[r[o]];if(a.originalHandler===t&&a.delegationSelector===n)return a}return null}function normalizeParams(e,t,n){const r="string"==typeof t,o=r?n:t;let a=getTypeEvent(e);return nativeEvents.has(a)||(a=e),[r,o,a]}function addHandler(e,t,n,r,o){if("string"!=typeof t||!e)return;if(n||(n=r,r=null),customEventsRegex.test(t)){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};r?r=e(r):n=e(n)}const[a,l,i]=normalizeParams(t,n,r),s=getEvent(e),u=s[i]||(s[i]={}),d=findHandler(u,l,a?n:null);if(d)return void(d.oneOff=d.oneOff&&o);const c=getUidEvent(l,t.replace(namespaceRegex,"")),v=a?bootstrapDelegationHandler(e,n,r):bootstrapHandler(e,n);v.delegationSelector=a?n:null,v.originalHandler=l,v.oneOff=o,v.uidEvent=c,u[c]=v,e.addEventListener(i,v,a)}function removeHandler(e,t,n,r,o){const a=findHandler(t[n],r,o);a&&(e.removeEventListener(n,a,Boolean(o)),delete t[n][a.uidEvent])}function removeNamespacedHandlers(e,t,n,r){const o=t[n]||{};Object.keys(o).forEach((a=>{if(a.includes(r)){const r=o[a];removeHandler(e,t,n,r.originalHandler,r.delegationSelector)}}))}function getTypeEvent(e){return e=e.replace(stripNameRegex,""),customEvents[e]||e}const EventHandler={on(e,t,n,r){addHandler(e,t,n,r,!1)},one(e,t,n,r){addHandler(e,t,n,r,!0)},off(e,t,n,r){if("string"!=typeof t||!e)return;const[o,a,l]=normalizeParams(t,n,r),i=l!==t,s=getEvent(e),u=t.startsWith(".");if(void 0!==a){if(!s||!s[l])return;return void removeHandler(e,s,l,a,o?n:null)}u&&Object.keys(s).forEach((n=>{removeNamespacedHandlers(e,s,n,t.slice(1))}));const d=s[l]||{};Object.keys(d).forEach((n=>{const r=n.replace(stripUidRegex,"");if(!i||t.includes(r)){const t=d[n];removeHandler(e,s,l,t.originalHandler,t.delegationSelector)}}))},trigger(e,t,n){if("string"!=typeof t||!e)return null;const r=getjQuery(),o=getTypeEvent(t),a=t!==o,l=nativeEvents.has(o);let i,s=!0,u=!0,d=!1,c=null;return a&&r&&(i=r.Event(t,n),r(e).trigger(i),s=!i.isPropagationStopped(),u=!i.isImmediatePropagationStopped(),d=i.isDefaultPrevented()),l?(c=document.createEvent("HTMLEvents"),c.initEvent(o,s,!0)):c=new CustomEvent(t,{bubbles:s,cancelable:!0}),void 0!==n&&Object.keys(n).forEach((e=>{Object.defineProperty(c,e,{get:()=>n[e]})})),d&&c.preventDefault(),u&&e.dispatchEvent(c),c.defaultPrevented&&void 0!==i&&i.preventDefault(),c}};export default EventHandler;
  //# sourceMappingURL=/sm/a68b1f5eec6210382792651fad9fbd85f20ac370e2a4d9059e0957bc6a1b126e.map