import{__awaiter,__generator,__spreadArray}from"tslib"; /*! * (C) Ionic http://ionicframework.com - MIT License */import{c as componentOnReady}from"./helpers-be245865.js";var attachComponent=function(e,r,n,t,o,i){return __awaiter(void 0,void 0,void 0,(function(){var a,u;return __generator(this,(function(c){switch(c.label){case 0:if(e){return[2,e.attachViewToDom(r,n,o,t)]}if(!i&&typeof n!=="string"&&!(n instanceof HTMLElement)){throw new Error("framework delegate is missing")}u=typeof n==="string"?(a=r.ownerDocument)===null||a===void 0?void 0:a.createElement(n):n;if(t){t.forEach((function(e){return u.classList.add(e)}))}if(o){Object.assign(u,o)}r.appendChild(u);return[4,new Promise((function(e){return componentOnReady(u,e)}))];case 1:c.sent();return[2,u]}}))}))};var detachComponent=function(e,r){if(r){if(e){var n=r.parentElement;return e.removeViewFromDom(n,r)}r.remove()}return Promise.resolve()};var CoreDelegate=function(){var e;var r;var n=function(n,t){var o=[];for(var i=2;i0&&(e.tagName==="ION-MODAL"||e.tagName==="ION-POPOVER")){s=c=e.children[0];if(!s.classList.contains("ion-delegate-host")){d=(u=e.ownerDocument)===null||u===void 0?void 0:u.createElement("div");d.classList.add("ion-delegate-host");i.forEach((function(e){return d.classList.add(e)}));d.append.apply(d,e.children);e.appendChild(d);c=d}}m.label=3;case 3:v=document.querySelector("ion-app")||document.body;r=document.createComment("ionic teleport");e.parentNode.insertBefore(r,e);v.appendChild(e);return[2,c!==null&&c!==void 0?c:e]}}))}))};var t=function(){if(e&&r){r.parentNode.insertBefore(e,r);r.remove()}return Promise.resolve()};return{attachViewToDom:n,removeViewFromDom:t}};export{CoreDelegate as C,attachComponent as a,detachComponent as d};