var __awaiter=this&&this.__awaiter||function(n,t,r,e){function i(n){return n instanceof r?n:new r((function(t){t(n)}))}return new(r||(r=Promise))((function(r,u){function a(n){try{c(e.next(n))}catch(n){u(n)}}function o(n){try{c(e["throw"](n))}catch(n){u(n)}}function c(n){n.done?r(n.value):i(n.value).then(a,o)}c((e=e.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},e,i,u,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(n){return function(t){return c([n,t])}}function c(o){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(r=0)),r)try{if(e=1,i&&(u=o[0]&2?i["return"]:o[0]?i["throw"]||((u=i["return"])&&u.call(i),0):i.next)&&!(u=u.call(i,o[1])).done)return u;if(i=0,u)o=[o[0]&2,u.value];switch(o[0]){case 0:case 1:u=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;i=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(u=r.trys,u=u.length>0&&u[u.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!u||o[1]>u[0]&&o[1]<u[3])){r.label=o[1];break}if(o[0]===6&&r.label<u[1]){r.label=u[1];u=o;break}if(u&&r.label<u[2]){r.label=u[2];r.ops.push(o);break}if(u[2])r.ops.pop();r.trys.pop();continue}o=t.call(n,r)}catch(n){o=[6,n];i=0}finally{e=u=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-df0014ec.system.js","./p-379464d8.system.js"],(function(n){"use strict";var t,r,e;return{setters:[function(n){t=n.b},function(n){r=n.j;e=n.r}],execute:function(){var i=this;var u=0;var a="backdrop";var o=n("p",(function(n){if(t.hasDocument){s(document)}var r=u++;n.overlayIndex=r;if(!n.el.hasAttribute("id")){n.el.id="bal-overlay-".concat(r)}}));var c=n("g",(function(n,t){if(t===undefined){t="bal-modal,bal-snackbar,bal-toast"}return Array.from(n.querySelectorAll(t)).filter((function(n){return n.overlayIndex>0}))}));var f=n("a",(function(n,t,r){var e=c(n,t);return r===undefined?e[e.length-1]:e.find((function(n){return n.id===r}))}));var s=function(n){if(u===0){u=1;n.addEventListener("keyup",(function(t){if(t.key==="Escape"){var r=f(n);if(r){r.dismiss(undefined,a)}}}))}};var v=n("d",(function(n,t,r,e){return __awaiter(i,void 0,void 0,(function(){var i;return __generator(this,(function(u){switch(u.label){case 0:if(!n.presented){return[2,false]}u.label=1;case 1:u.trys.push([1,3,,4]);n.el.style.setProperty("pointer-events","none");n.willDismiss.emit({data:t,role:r});return[4,e()];case 2:u.sent();n.presented=false;n.didDismiss.emit({data:t,role:r});return[3,4];case 3:i=u.sent();n.presented=false;console.error(i);return[3,4];case 4:n.el.remove();return[2,true]}}))}))}));var l=n("e",(function(n,t){var r;var e=new Promise((function(n){return r=n}));d(n,t,(function(n){r(n.detail)}));return e}));var d=function(n,t,i){var u=function(r){e(n,t,u);i(r)};r(n,t,u)}}}}));