var __awaiter=this&&this.__awaiter||function(t,n,i,e){function o(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,r){function s(t){try{a(e.next(t))}catch(t){r(t)}}function c(t){try{a(e["throw"](t))}catch(t){r(t)}}function a(t){t.done?i(t.value):o(t.value).then(s,c)}a((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},e,o,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(t){return function(n){return a([t,n])}}function a(c){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(i=0)),i)try{if(e=1,o&&(r=c[0]&2?o["return"]:c[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,c[1])).done)return r;if(o=0,r)c=[c[0]&2,r.value];switch(c[0]){case 0:case 1:r=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;o=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){i.label=c[1];break}if(c[0]===6&&i.label<r[1]){i.label=r[1];r=c;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(c);break}if(r[2])i.ops.pop();i.trys.pop();continue}c=n.call(t,i)}catch(t){c=[6,t];o=0}finally{e=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-14b5f59f.system.js","./p-c9c9cc3a.system.js","./p-81f62123.system.js"],(function(t){"use strict";var n,i,e,o,r,s,c,a,u;return{setters:[function(t){n=t.r;i=t.h;e=t.H;o=t.g},function(t){r=t.c},function(t){s=t.c;c=t.f;a=t.s;u=t.o}],execute:function(){var f="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}";var h=f;var d=t("x_dropdown",function(){function t(t){n(this,t);this.show=false;this.align="bottom";this.hover=false;this.syncWidth=false;this.offset=0}t.prototype.watchAlignAndShow=function(){this.updateDropdownContainer()};t.prototype.componentDidLoad=function(){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))};t.prototype.disconectedCallback=function(){if(this.el){this.el.removeEventListener("mouseenter",this.onMouseEnterOnContainer);this.el.removeEventListener("mouseleave",this.onMouseLeaveOnContainer)}};t.prototype.onMouseEnterOnContainer=function(){if(this.hover){this.show=true}};t.prototype.onMouseLeaveOnContainer=function(){if(this.hover){this.show=false}};t.prototype.updateDropdownContainer=function(){var t=this;if(this.syncWidth){this.container.style.maxWidth="".concat(this.el.offsetWidth,"px");this.container.style.width="100%"}else{this.container.style.maxWidth="auto";this.container.style.width="auto"}setTimeout((function(){s(t.el,t.container,{placement:t.align,middleware:[c(),a({padding:10}),u(t.offset)]}).then((function(n){var i=n.x,e=n.y;t.container.style.left="".concat(i,"px");t.container.style.top="".concat(e,"px")}))}),50)};t.prototype.display=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){this.show=t;return[2]}))}))};t.prototype.render=function(){return i(e,{key:"48df29d08ae8077798b586c71443872e1894f0bf"},i("slot",{key:"4c623391741dfad19c2e61e20a57327f0ca13c92"}),i("div",{key:"2d058e90c91481f871c41354c964ce87975e7732",class:r("dropdown-container",{"dropdown-show":this.show,"dropdown-hover":this.hover})},i("slot",{key:"71cc31936e0aefa2fd1570ede53838f1278139ff",name:"dropdown"})))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{align:["watchAlignAndShow"],show:["watchAlignAndShow"]}},enumerable:false,configurable:true});return t}());d.style=h}}}));