var __awaiter=this&&this.__awaiter||function(r,n,t,e){function i(r){return r instanceof t?r:new t((function(n){n(r)}))}return new(t||(t=Promise))((function(t,o){function u(r){try{f(e.next(r))}catch(r){o(r)}}function a(r){try{f(e["throw"](r))}catch(r){o(r)}}function f(r){r.done?t(r.value):i(r.value).then(u,a)}f((e=e.apply(r,n||[])).next())}))};var __generator=this&&this.__generator||function(r,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},e,i,o,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(r){return function(n){return f([r,n])}}function f(a){if(e)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(t=0)),t)try{if(e=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;i=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]0&&(r.tagName==="ION-MODAL"||r.tagName==="ION-POPOVER")){v=c=r.children[0];if(!v.classList.contains("ion-delegate-host")){d=(f=r.ownerDocument)===null||f===void 0?void 0:f.createElement("div");d.classList.add("ion-delegate-host");u.forEach((function(r){return d.classList.add(r)}));d.append.apply(d,r.children);r.appendChild(d);c=d}}l.label=3;case 3:h=document.querySelector("ion-app")||document.body;e=document.createComment("ionic teleport");r.parentNode.insertBefore(e,r);h.appendChild(r);return[2,c!==null&&c!==void 0?c:r]}}))}))};var o=function(){if(r&&e){e.parentNode.insertBefore(r,e);e.remove()}return Promise.resolve()};return{attachViewToDom:i,removeViewFromDom:o}}))}}}));