- md5
- f852468ac79cd3df07b7e196b1bb2f8f
- sha1
- dded4e67697572fd5ca8fd4909a5d597fb2a90a1
- sha256
- 2e56e210e72e34e00610c29cb37766676d173ba7c6bb7ee29aa8c6f7770b7f97
import{M as Manipulator,S as SelectorEngine,j as execute,r as reflow,a as typeCheckConfig,E as EventHandler,k as getTransitionDurationFromElement,l as emulateTransitionEnd,B as BaseComponent,b as isRTL,g as getElementFromSelector,i as isVisible,d as defineJQueryPlugin}from"./dom.min.js?1623769888";const SELECTOR_FIXED_CONTENT=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",SELECTOR_STICKY_CONTENT=".sticky-top",getWidth=()=>{const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)},hide=(e=getWidth())=>{_disableOverFlow(),_setElementAttributes("body","paddingRight",(t=>t+e)),_setElementAttributes(SELECTOR_FIXED_CONTENT,"paddingRight",(t=>t+e)),_setElementAttributes(".sticky-top","marginRight",(t=>t-e))},_disableOverFlow=()=>{const e=document.body.style.overflow;e&&Manipulator.setDataAttribute(document.body,"overflow",e),document.body.style.overflow="hidden"},_setElementAttributes=(e,t,i)=>{const o=getWidth();SelectorEngine.find(e).forEach((e=>{if(e!==document.body&&window.innerWidth>e.clientWidth+o)return;const n=e.style[t],s=window.getComputedStyle(e)[t];Manipulator.setDataAttribute(e,t,n),e.style[t]=`${i(Number.parseFloat(s))}px`}))},reset=()=>{_resetElementAttributes("body","overflow"),_resetElementAttributes("body","paddingRight"),_resetElementAttributes(SELECTOR_FIXED_CONTENT,"paddingRight"),_resetElementAttributes(".sticky-top","marginRight")},_resetElementAttributes=(e,t)=>{SelectorEngine.find(e).forEach((e=>{const i=Manipulator.getDataAttribute(e,t);void 0===i?e.style.removeProperty(t):(Manipulator.removeDataAttribute(e,t),e.style[t]=i)}))},Default$1={isVisible:!0,isAnimated:!1,rootElement:document.body,clickCallback:null},DefaultType$1={isVisible:"boolean",isAnimated:"boolean",rootElement:"element",clickCallback:"(function|null)"},NAME$1="backdrop",CLASS_NAME_BACKDROP="modal-backdrop",CLASS_NAME_FADE$1="fade",CLASS_NAME_SHOW$1="show",EVENT_MOUSEDOWN="mousedown.bs.backdrop";class Backdrop{constructor(e){this._config=this._getConfig(e),this._isAppended=!1,this._element=null}show(e){this._config.isVisible?(this._append(),this._config.isAnimated&&reflow(this._getElement()),this._getElement().classList.add("show"),this._emulateAnimation((()=>{execute(e)}))):execute(e)}hide(e){this._config.isVisible?(this._getElement().classList.remove("show"),this._emulateAnimation((()=>{this.dispose(),execute(e)}))):execute(e)}_getElement(){if(!this._element){const e=document.createElement("div");e.className="modal-backdrop",this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_getConfig(e){return(e={...Default$1,..."object"==typeof e?e:{}}).rootElement=e.rootElement||document.body,typeCheckConfig(NAME$1,e,DefaultType$1),e}_append(){this._isAppended||(this._config.rootElement.appendChild(this._getElement()),EventHandler.on(this._getElement(),EVENT_MOUSEDOWN,(()=>{execute(this._config.clickCallback)})),this._isAppended=!0)}dispose(){this._isAppended&&(EventHandler.off(this._element,EVENT_MOUSEDOWN),this._getElement().parentNode.removeChild(this._element),this._isAppended=!1)}_emulateAnimation(e){if(!this._config.isAnimated)return void execute(e);const t=getTransitionDurationFromElement(this._getElement());EventHandler.one(this._getElement(),"transitionend",(()=>execute(e))),emulateTransitionEnd(this._getElement(),t)}}const NAME="modal",DATA_KEY="bs.modal",EVENT_KEY=".bs.modal",DATA_API_KEY=".data-api",ESCAPE_KEY="Escape",Default={backdrop:!0,keyboard:!0,focus:!0},DefaultType={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean"},EVENT_HIDE="hide.bs.modal",EVENT_HIDE_PREVENTED="hidePrevented.bs.modal",EVENT_HIDDEN="hidden.bs.modal",EVENT_SHOW="show.bs.modal",EVENT_SHOWN="shown.bs.modal",EVENT_FOCUSIN="focusin.bs.modal",EVENT_RESIZE="resize.bs.modal",EVENT_CLICK_DISMISS="click.dismiss.bs.modal",EVENT_KEYDOWN_DISMISS="keydown.dismiss.bs.modal",EVENT_MOUSEUP_DISMISS="mouseup.dismiss.bs.modal",EVENT_MOUSEDOWN_DISMISS="mousedown.dismiss.bs.modal",EVENT_CLICK_DATA_API="click.bs.modal.data-api",CLASS_NAME_OPEN="modal-open",CLASS_NAME_FADE="fade",CLASS_NAME_SHOW="show",CLASS_NAME_STATIC="modal-static",SELECTOR_DIALOG=".modal-dialog",SELECTOR_MODAL_BODY=".modal-body",SELECTOR_DATA_TOGGLE='[data-bs-toggle="modal"]',SELECTOR_DATA_DISMISS='[data-bs-dismiss="modal"]';class Modal extends BaseComponent{constructor(e,t){super(e),this._config=this._getConfig(t),this._dialog=SelectorEngine.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._isShown=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1}static get Default(){return Default}static get NAME(){return NAME}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||this._isTransitioning)return;this._isAnimated()&&(this._isTransitioning=!0);const t=EventHandler.trigger(this._element,EVENT_SHOW,{relatedTarget:e});this._isShown||t.defaultPrevented||(this._isShown=!0,hide(),document.body.classList.add("modal-open"),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),EventHandler.on(this._element,EVENT_CLICK_DISMISS,SELECTOR_DATA_DISMISS,(e=>this.hide(e))),EventHandler.on(this._dialog,EVENT_MOUSEDOWN_DISMISS,(()=>{EventHandler.one(this._element,EVENT_MOUSEUP_DISMISS,(e=>{e.target===this._element&&(this._ignoreBackdropClick=!0)}))})),this._showBackdrop((()=>this._showElement(e))))}hide(e){if(e&&e.preventDefault(),!this._isShown||this._isTransitioning)return;if(EventHandler.trigger(this._element,EVENT_HIDE).defaultPrevented)return;this._isShown=!1;const t=this._isAnimated();t&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),EventHandler.off(document,EVENT_FOCUSIN),this._element.classList.remove("show"),EventHandler.off(this._element,EVENT_CLICK_DISMISS),EventHandler.off(this._dialog,EVENT_MOUSEDOWN_DISMISS),this._queueCallback((()=>this._hideModal()),this._element,t)}dispose(){[window,this._dialog].forEach((e=>EventHandler.off(e,EVENT_KEY))),this._backdrop.dispose(),super.dispose(),EventHandler.off(document,EVENT_FOCUSIN)}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Backdrop({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_getConfig(e){return e={...Default,...Manipulator.getDataAttributes(this._element),...e},typeCheckConfig(NAME,e,DefaultType),e}_showElement(e){const t=this._isAnimated(),i=SelectorEngine.findOne(".modal-body",this._dialog);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0,i&&(i.scrollTop=0),t&&reflow(this._element),this._element.classList.add("show"),this._config.focus&&this._enforceFocus();this._queueCallback((()=>{this._config.focus&&this._element.focus(),this._isTransitioning=!1,EventHandler.trigger(this._element,EVENT_SHOWN,{relatedTarget:e})}),this._dialog,t)}_enforceFocus(){EventHandler.off(document,EVENT_FOCUSIN),EventHandler.on(document,EVENT_FOCUSIN,(e=>{document===e.target||this._element===e.target||this._element.contains(e.target)||this._element.focus()}))}_setEscapeEvent(){this._isShown?EventHandler.on(this._element,EVENT_KEYDOWN_DISMISS,(e=>{this._config.keyboard&&"Escape"===e.key?(e.preventDefault(),this.hide()):this._config.keyboard||"Escape"!==e.key||this._triggerBackdropTransition()})):EventHandler.off(this._element,EVENT_KEYDOWN_DISMISS)}_setResizeEvent(){this._isShown?EventHandler.on(window,EVENT_RESIZE,(()=>this._adjustDialog())):EventHandler.off(window,EVENT_RESIZE)}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove("modal-open"),this._resetAdjustments(),reset(),EventHandler.trigger(this._element,EVENT_HIDDEN)}))}_showBackdrop(e){EventHandler.on(this._element,EVENT_CLICK_DISMISS,(e=>{this._ignoreBackdropClick?this._ignoreBackdropClick=!1:e.target===e.currentTarget&&(!0===this._config.backdrop?this.hide():"static"===this._config.backdrop&&this._triggerBackdropTransition())})),this._backdrop.show(e)}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight;e||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static");const t=getTransitionDurationFromElement(this._dialog);EventHandler.off(this._element,"transitionend"),EventHandler.one(this._element,"transitionend",(()=>{this._element.classList.remove("modal-static"),e||(EventHandler.one(this._element,"transitionend",(()=>{this._element.style.overflowY=""})),emulateTransitionEnd(this._element,t))})),emulateTransitionEnd(this._element,t),this._element.focus()}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=getWidth(),i=t>0;(!i&&e&&!isRTL()||i&&!e&&isRTL())&&(this._element.style.paddingLeft=`${t}px`),(i&&!e&&!isRTL()||!i&&e&&isRTL())&&(this._element.style.paddingRight=`${t}px`)}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each((function(){const i=Modal.getInstance(this)||new Modal(this,"object"==typeof e?e:{});if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e](t)}}))}}EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,(function(e){const t=getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),EventHandler.one(t,EVENT_SHOW,(e=>{e.defaultPrevented||EventHandler.one(t,EVENT_HIDDEN,(()=>{isVisible(this)&&this.focus()}))}));(Modal.getInstance(t)||new Modal(t)).toggle(this)})),defineJQueryPlugin(Modal),Joomla=Joomla||{},Joomla.Modal=Joomla.Modal||{},window.bootstrap=window.bootstrap||{},window.bootstrap.Modal=Modal;const allowed={iframe:["src","name","width","height"]};if(Joomla.initialiseModal=(e,t)=>{e instanceof Element&&(new window.bootstrap.Modal(e,t),e.open=()=>{window.bootstrap.Modal.getInstance(e).show(e)},e.close=()=>{window.bootstrap.Modal.getInstance(e).hide()},e.addEventListener("show.bs.modal",(()=>{if(Joomla.Modal.setCurrent(e),e.dataset.url){const t=e.querySelector(".modal-body"),i=t.querySelector("iframe");if(i){const t=e.querySelector("joomla-field-mediamore");t&&t.parentNode.removeChild(t),i.parentNode.removeChild(i)}if(e.dataset.iframe.indexOf("document.getElementById")>0){const i=e.dataset.iframe.split("+"),o=i[1].split('"');let n;if(o[0]=o[0].replace(/"/g,'"'),document.getElementById(o[1]))n=document.getElementById(o[1]).value;else{n=new Function(`return ${o[0]}`).call(null)}t.insertAdjacentHTML("afterbegin",Joomla.sanitizeHtml(`${i[0]}${n}${i[2]}`,allowed))}else t.insertAdjacentHTML("afterbegin",Joomla.sanitizeHtml(e.dataset.iframe,allowed))}})),e.addEventListener("shown.bs.modal",(()=>{const t=e.querySelector(".modal-body"),i=e.querySelector(".modal-header"),o=e.querySelector(".modal-footer");let n=0,s=0,a=0,l=0,d=0;if(t){if(i){n=i.getBoundingClientRect().height,d=t.offsetHeight}o&&(s=parseFloat(getComputedStyle(o,null).height.replace("px","")));const e=parseFloat(getComputedStyle(t,null).height.replace("px","")),r=t.offsetTop;l=d-e,a=parseFloat(getComputedStyle(document.body,null).height.replace("px",""))-2*r-(n+s+l)}if(e.dataset.url){const i=e.querySelector("iframe");parseFloat(getComputedStyle(i,null).height.replace("px",""))>a&&(t.style.maxHeight=a,t.style.overflowY="auto",i.style.maxHeight=a-l)}})),e.addEventListener("hide.bs.modal",(()=>{e.querySelector(".modal-body").style.maxHeight="initial"})),e.addEventListener("hidden.bs.modal",(()=>{Joomla.Modal.setCurrent("")})))},Joomla.iframeButtonClick=e=>{if(!e.iframeSelector||!e.buttonSelector)throw new Error("Selector is missing");const t=document.querySelector(`${e.iframeSelector} iframe`);if(t){const i=t.contentWindow.document.querySelector(e.buttonSelector);i&&i.click()}},Joomla&&Joomla.getOptions){const e=Joomla.getOptions("bootstrap.modal");"object"==typeof e&&null!==e&&Object.keys(e).forEach((t=>{const i=e[t],o={backdrop:!i.backdrop||i.backdrop,keyboard:!i.keyboard||i.keyboard,focus:!i.focus||i.focus};Array.from(document.querySelectorAll(t)).map((e=>Joomla.initialiseModal(e,o)))}))}export{Backdrop as B,Modal as M,hide as h,reset as r};
No other release has this exact content. See every version of this file.