import{g as n,c as o}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 n=document;let o=!1;n.addEventListener("backbutton",(()=>{if(o)return;let t=0,e=[];const a=new CustomEvent("ionBackButton",{bubbles:!1,detail:{register(n,o){e.push({priority:n,handler:o,id:t++})}}});n.dispatchEvent(a);const i=()=>{if(e.length>0){let n={priority:Number.MIN_SAFE_INTEGER,handler:()=>{},id:-1};e.forEach((o=>{o.priority>=n.priority&&(n=o)})),o=!0,e=e.filter((o=>o.id!==n.id)),(async n=>{try{if(null==n?void 0:n.handler){const o=n.handler(i);null!=o&&await o}}catch(n){console.error(n)}})(n).then((()=>o=!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=n=>({create:o=>w(n,o),dismiss:(o,t,e)=>_(document,o,t,n,e),getTop:async()=>T(document,n)}),p=u("ion-alert"),v=u("ion-action-sheet"),f=u("ion-modal"),m=u("ion-popover"),b=u("ion-toast"),y=n=>{"undefined"!=typeof document&&O(document);const o=d++;n.overlayIndex=o,n.hasAttribute("id")||(n.id=`ion-overlay-${o}`)},w=(n,o)=>"undefined"!=typeof window&&void 0!==window.customElements?window.customElements.whenDefined(n).then((()=>{const e=document.createElement(n);return e.classList.add("overlay-hidden"),Object.assign(e,Object.assign(Object.assign({},o),{hasController:!0})),I(document).appendChild(e),new Promise((n=>t(e,n)))})):Promise.resolve(),h='[tabindex]:not([tabindex^="-"]), input:not([type=hidden]):not([tabindex^="-"]), textarea:not([tabindex^="-"]), button:not([tabindex^="-"]), select:not([tabindex^="-"]), .ion-focusable:not([tabindex^="-"])',k="input:not([type=hidden]), textarea, button, select",B=(n,o)=>{let t=n.querySelector(h);const a=null==t?void 0:t.shadowRoot;a&&(t=a.querySelector(k)||t),t?e(t):o.focus()},x=(n,o)=>{const t=Array.from(n.querySelectorAll(h));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():o.focus()},O=n=>{0===d&&(d=1,n.addEventListener("focus",(o=>{((n,o)=>{const t=T(o,"ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover"),e=n.target;t&&e&&(t.classList.contains("ion-disable-focus-trap")||(t.shadowRoot?(()=>{if(t.contains(e))t.lastFocus=e;else{const n=t.lastFocus;B(t,t),n===o.activeElement&&x(t,t),t.lastFocus=o.activeElement}})():(()=>{if(t===e)t.lastFocus=void 0;else{const n=r(t);if(!n.contains(e))return;const a=n.querySelector(".ion-overlay-wrapper");if(!a)return;if(a.contains(e))t.lastFocus=e;else{const n=t.lastFocus;B(a,t),n===o.activeElement&&x(a,t),t.lastFocus=o.activeElement}}})()))})(o,n)}),!0),n.addEventListener("ionBackButton",(o=>{const t=T(n);(null==t?void 0:t.backdropDismiss)&&o.detail.register(100,(()=>t.dismiss(void 0,Y)))})),n.addEventListener("keyup",(o=>{if("Escape"===o.key){const o=T(n);(null==o?void 0:o.backdropDismiss)&&o.dismiss(void 0,Y)}})))},_=(n,o,t,e,a)=>{const i=T(n,e,a);return i?i.dismiss(o,t):Promise.reject("overlay does not exist")},T=(n,o,t)=>{const e=((n,o)=>(void 0===o&&(o="ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast"),Array.from(n.querySelectorAll(o)).filter((n=>n.overlayIndex>0))))(n,o).filter((n=>!n.classList.contains("overlay-hidden")));return void 0===t?e[e.length-1]:e.find((n=>n.id===t))},g=(n=!1)=>{const o=I(document).querySelector("ion-router-outlet, ion-nav, #ion-view-container-root");o&&(n?o.setAttribute("aria-hidden","true"):o.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=n(t),l=t.enterAnimation?t.enterAnimation:o.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&&t.el.focus()},A=async n=>{let o=document.activeElement;if(!o)return;const t=null==o?void 0:o.shadowRoot;t&&(o=t.querySelector(k)||o),await n.onDidDismiss(),o.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=n(t),v=t.leaveAnimation?t.leaveAnimation:o.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(n){console.error(n)}return t.el.remove(),!0},I=n=>n.querySelector("ion-app")||n.body,N=async(n,t,e,a)=>{e.classList.remove("overlay-hidden");const i=t(n.el,a);n.animated&&o.getBoolean("animated",!0)||i.duration(0),n.keyboardClose&&i.beforeAddWrite((()=>{const n=e.ownerDocument.activeElement;(null==n?void 0:n.matches("input,ion-input, ion-textarea"))&&n.blur()}));const r=l.get(n)||[];return l.set(n,[...r,i]),await i.play(),!0},R=(n,o)=>{let t;const e=new Promise((n=>t=n));return C(n,o,(n=>{t(n.detail)})),e},C=(n,o,t)=>{const e=a=>{i(n,o,e),t(a)};a(n,o,e)},E=n=>"cancel"===n||n===Y,M=n=>n(),U=(n,t)=>{if("function"==typeof n)return o.get("_zoneGate",M)((()=>{try{return n(t)}catch(n){throw n}}))},Y="backdrop";export{Y as B,s as M,j as a,y 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,f as m,m as p,U as s,b as t}