import{g as o,c as n}from"./p-d2ac57a0.js";import{c as t,q as e,m as a,n as i,l as r}from"./p-f44f0a67.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const s=99,c=Object.freeze({__proto__:null,blockHardwareBackButton:()=>{document.addEventListener("backbutton",(()=>{}))},startHardwareBackButton:()=>{const o=document;let n=!1;o.addEventListener("backbutton",(()=>{if(n)return;let t=0,e=[];const a=new CustomEvent("ionBackButton",{bubbles:!1,detail:{register(o,n){e.push({priority:o,handler:n,id:t++})}}});o.dispatchEvent(a);const i=()=>{if(e.length>0){let o={priority:Number.MIN_SAFE_INTEGER,handler:()=>{},id:-1};e.forEach((n=>{n.priority>=o.priority&&(o=n)})),n=!0,e=e.filter((n=>n.id!==o.id)),(async o=>{try{if(null==o?void 0:o.handler){const n=o.handler(i);null!=n&&await n}}catch(o){console.error(o)}})(o).then((()=>n=!1))}};i()}))},OVERLAY_BACK_BUTTON_PRIORITY:100,MENU_BACK_BUTTON_PRIORITY:99});
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
let d=0;const l=new WeakMap,u=o=>({create:n=>h(o,n),dismiss:(n,t,e)=>_(document,n,t,o,e),getTop:async()=>T(document,o)}),p=u("ion-alert"),v=u("ion-action-sheet"),m=u("ion-loading"),f=u("ion-modal"),b=u("ion-popover"),y=u("ion-toast"),w=o=>{"undefined"!=typeof document&&O(document);const n=d++;o.overlayIndex=n,o.hasAttribute("id")||(o.id=`ion-overlay-${n}`)},h=(o,n)=>"undefined"!=typeof window&&void 0!==window.customElements?window.customElements.whenDefined(o).then((()=>{const e=document.createElement(o);return e.classList.add("overlay-hidden"),Object.assign(e,Object.assign(Object.assign({},n),{hasController:!0})),I(document).appendChild(e),new Promise((o=>t(e,o)))})):Promise.resolve(),k='[tabindex]:not([tabindex^="-"]), input:not([type=hidden]):not([tabindex^="-"]), textarea:not([tabindex^="-"]), button:not([tabindex^="-"]), select:not([tabindex^="-"]), .ion-focusable:not([tabindex^="-"])',B=(o,n)=>{let t=o.querySelector(k);const a=null==t?void 0:t.shadowRoot;a&&(t=a.querySelector(k)||t),t?e(t):n.focus()},x=(o,n)=>{const t=Array.from(o.querySelectorAll(k));let e=t.length>0?t[t.length-1]:null;const a=null==e?void 0:e.shadowRoot;a&&(e=a.querySelector(k)||e),e?e.focus():n.focus()},O=o=>{0===d&&(d=1,o.addEventListener("focus",(n=>{((o,n)=>{const t=T(n,"ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover"),e=o.target;t&&e&&(t.classList.contains("ion-disable-focus-trap")||(t.shadowRoot?(()=>{if(t.contains(e))t.lastFocus=e;else{const o=t.lastFocus;B(t,t),o===n.activeElement&&x(t,t),t.lastFocus=n.activeElement}})():(()=>{if(t===e)t.lastFocus=void 0;else{const o=r(t);if(!o.contains(e))return;const a=o.querySelector(".ion-overlay-wrapper");if(!a)return;if(a.contains(e))t.lastFocus=e;else{const o=t.lastFocus;B(a,t),o===n.activeElement&&x(a,t),t.lastFocus=n.activeElement}}})()))})(n,o)}),!0),o.addEventListener("ionBackButton",(n=>{const t=T(o);(null==t?void 0:t.backdropDismiss)&&n.detail.register(100,(()=>t.dismiss(void 0,Y)))})),o.addEventListener("keyup",(n=>{if("Escape"===n.key){const n=T(o);(null==n?void 0:n.backdropDismiss)&&n.dismiss(void 0,Y)}})))},_=(o,n,t,e,a)=>{const i=T(o,e,a);return i?i.dismiss(n,t):Promise.reject("overlay does not exist")},T=(o,n,t)=>{const e=((o,n)=>(void 0===n&&(n="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(o.querySelectorAll(n)).filter((o=>o.overlayIndex>0))))(o,n).filter((o=>!o.classList.contains("overlay-hidden")));return void 0===t?e[e.length-1]:e.find((o=>o.id===t))},g=(o=!1)=>{const n=I(document).querySelector("ion-router-outlet, ion-nav, #ion-view-container-root");n&&(o?n.setAttribute("aria-hidden","true"):n.removeAttribute("aria-hidden"))},j=async(t,e,a,i,r)=>{var s,c;if(t.presented)return;g(!0),t.presented=!0,t.willPresent.emit(),null===(s=t.willPresentShorthand)||void 0===s||s.emit();const d=o(t),l=t.enterAnimation?t.enterAnimation:n.get(e,"ios"===d?a:i);await N(t,l,t.el,r)&&(t.didPresent.emit(),null===(c=t.didPresentShorthand)||void 0===c||c.emit()),"ION-TOAST"!==t.el.tagName&&A(t.el),!t.keyboardClose||null!==document.activeElement&&t.el.contains(document.activeElement)||t.el.focus()},A=async o=>{let n=document.activeElement;if(!n)return;const t=null==n?void 0:n.shadowRoot;t&&(n=t.querySelector(k)||n),await o.onDidDismiss(),n.focus()},P=async(t,e,a,i,r,s,c)=>{var d,u;if(!t.presented)return!1;g(!1),t.presented=!1;try{t.el.style.setProperty("pointer-events","none"),t.willDismiss.emit({data:e,role:a}),null===(d=t.willDismissShorthand)||void 0===d||d.emit({data:e,role:a});const p=o(t),v=t.leaveAnimation?t.leaveAnimation:n.get(i,"ios"===p?r:s);"gesture"!==a&&await N(t,v,t.el,c),t.didDismiss.emit({data:e,role:a}),null===(u=t.didDismissShorthand)||void 0===u||u.emit({data:e,role:a}),l.delete(t),t.el.classList.add("overlay-hidden"),t.el.style.removeProperty("pointer-events")}catch(o){console.error(o)}return t.el.remove(),!0},I=o=>o.querySelector("ion-app")||o.body,N=async(o,t,e,a)=>{e.classList.remove("overlay-hidden");const i=t(o.el,a);o.animated&&n.getBoolean("animated",!0)||i.duration(0),o.keyboardClose&&i.beforeAddWrite((()=>{const o=e.ownerDocument.activeElement;(null==o?void 0:o.matches("input,ion-input, ion-textarea"))&&o.blur()}));const r=l.get(o)||[];return l.set(o,[...r,i]),await i.play(),!0},R=(o,n)=>{let t;const e=new Promise((o=>t=o));return C(o,n,(o=>{t(o.detail)})),e},C=(o,n,t)=>{const e=a=>{i(o,n,e),t(a)};a(o,n,e)},E=o=>"cancel"===o||o===Y,M=o=>o(),U=(o,t)=>{if("function"==typeof o)return n.get("_zoneGate",M)((()=>{try{return o(t)}catch(o){throw o}}))},Y="backdrop";export{Y as B,s as M,j as a,w as b,v as c,P as d,R as e,B as f,T as g,p as h,E as i,l as j,c as k,m as l,f as m,b as p,U as s,y as t}