"use strict";(self.webpackChunk_pixelpay_ui_core=self.webpackChunk_pixelpay_ui_core||[]).push([[8354],{"./dist/ui-stencil/p-2af82ef0.entry.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{x_dropdown:()=>r});var _p_444192d7_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./dist/ui-stencil/p-444192d7.js"),_p_933ea891_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./dist/ui-stencil/p-933ea891.js"),_p_384ed661_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./dist/ui-stencil/p-384ed661.js");const r=class{constructor(i){(0,_p_444192d7_js__WEBPACK_IMPORTED_MODULE_0__.r)(this,i),this.show=!1,this.align="bottom",this.hover=!1,this.syncWidth=!1,this.offset=0}watchAlignAndShow(){this.updateDropdownContainer()}componentDidLoad(){this.container=this.el.querySelector(".dropdown-container"),this.updateDropdownContainer(),this.el.addEventListener("mouseenter",this.onMouseEnterOnContainer.bind(this)),this.el.addEventListener("mouseleave",this.onMouseLeaveOnContainer.bind(this))}disconectedCallback(){this.el&&(this.el.removeEventListener("mouseenter",this.onMouseEnterOnContainer),this.el.removeEventListener("mouseleave",this.onMouseLeaveOnContainer))}onMouseEnterOnContainer(){this.hover&&(this.show=!0)}onMouseLeaveOnContainer(){this.hover&&(this.show=!1)}updateDropdownContainer(){this.syncWidth?(this.container.style.maxWidth=`${this.el.offsetWidth}px`,this.container.style.width="100%"):(this.container.style.maxWidth="auto",this.container.style.width="auto"),setTimeout((()=>{(0,_p_384ed661_js__WEBPACK_IMPORTED_MODULE_1__.c)(this.el,this.container,{placement:this.align,middleware:[(0,_p_384ed661_js__WEBPACK_IMPORTED_MODULE_1__.f)(),(0,_p_384ed661_js__WEBPACK_IMPORTED_MODULE_1__.s)({padding:10}),(0,_p_384ed661_js__WEBPACK_IMPORTED_MODULE_1__.o)(this.offset)]}).then((({x:t,y:i})=>{this.container.style.left=`${t}px`,this.container.style.top=`${i}px`}))}),50)}async display(t){this.show=t}render(){return(0,_p_444192d7_js__WEBPACK_IMPORTED_MODULE_0__.h)(_p_444192d7_js__WEBPACK_IMPORTED_MODULE_0__.H,{key:"48df29d08ae8077798b586c71443872e1894f0bf"},(0,_p_444192d7_js__WEBPACK_IMPORTED_MODULE_0__.h)("slot",{key:"4c623391741dfad19c2e61e20a57327f0ca13c92"}),(0,_p_444192d7_js__WEBPACK_IMPORTED_MODULE_0__.h)("div",{key:"2d058e90c91481f871c41354c964ce87975e7732",class:(0,_p_933ea891_js__WEBPACK_IMPORTED_MODULE_2__.c)("dropdown-container",{"dropdown-show":this.show,"dropdown-hover":this.hover})},(0,_p_444192d7_js__WEBPACK_IMPORTED_MODULE_0__.h)("slot",{key:"71cc31936e0aefa2fd1570ede53838f1278139ff",name:"dropdown"})))}get el(){return(0,_p_444192d7_js__WEBPACK_IMPORTED_MODULE_0__.g)(this)}static get watchers(){return{align:["watchAlignAndShow"],show:["watchAlignAndShow"]}}};r.style="x-dropdown{display:inherit;text-align:inherit}x-dropdown .dropdown-container{display:block;width:-webkit-max-content;width:-moz-max-content;width:max-content;top:0;left:0;position:absolute;z-index:10000;visibility:hidden;opacity:0;-webkit-transition:opacity 0.3s;transition:opacity 0.3s;pointer-events:none}x-dropdown .dropdown-container.dropdown-show{pointer-events:initial;opacity:1;visibility:visible}"}}]);