import{M as t}from"./p-c5cf028c.js";import{c as n}from"./p-7cbdb4ea.js";import{g as s}from"./p-4cb16df5.js";import{c as e}from"./p-d5da637d.js";
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const r=t=>e().duration(t?400:300);
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const o=t=>{let n;let o;const a=t.width+8;const c=e();const i=e();if(t.isEndSide){n=a+"px";o="0px"}else{n=-a+"px";o="0px"}c.addElement(t.menuInnerEl).fromTo("transform",`translateX(${n})`,`translateX(${o})`);const u=s(t);const f=u==="ios";const l=f?.2:.25;i.addElement(t.backdropEl).fromTo("opacity",.01,l);return r(f).addAnimation([c,i])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const a=t=>{let n;let o;const a=s(t);const c=t.width;if(t.isEndSide){n=-c+"px";o=c+"px"}else{n=c+"px";o=-c+"px"}const i=e().addElement(t.menuInnerEl).fromTo("transform",`translateX(${o})`,"translateX(0px)");const u=e().addElement(t.contentEl).fromTo("transform","translateX(0px)",`translateX(${n})`);const f=e().addElement(t.backdropEl).fromTo("opacity",.01,.32);return r(a==="ios").addAnimation([i,u,f])};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const c=t=>{const n=s(t);const o=t.width*(t.isEndSide?-1:1)+"px";const a=e().addElement(t.contentEl).fromTo("transform","translateX(0px)",`translateX(${o})`);return r(n==="ios").addAnimation(a)};
/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */const i=()=>{const s=new Map;const e=[];const r=async t=>{const n=await m(t);if(n){return n.open()}return false};const i=async t=>{const n=await(t!==undefined?m(t):w());if(n!==undefined){return n.close()}return false};const u=async t=>{const n=await m(t);if(n){return n.toggle()}return false};const f=async(t,n)=>{const s=await m(n);if(s){s.disabled=!t}return s};const l=async(t,n)=>{const s=await m(n);if(s){s.swipeGesture=t}return s};const p=async t=>{if(t!=null){const n=await m(t);return n!==undefined&&n.isOpen()}else{const t=await w();return t!==undefined}};const d=async t=>{const n=await m(t);if(n){return!n.disabled}return false};const m=async t=>{await h();if(t==="start"||t==="end"){const n=v((n=>n.side===t&&!n.disabled));if(n){return n}return v((n=>n.side===t))}else if(t!=null){return v((n=>n.menuId===t))}const n=v((t=>!t.disabled));if(n){return n}return e.length>0?e[0].el:undefined};const w=async()=>{await h();return j()};const y=async()=>{await h();return M()};const x=async()=>{await h();return O()};const g=(t,n)=>{s.set(t,n)};const X=t=>{if(e.indexOf(t)<0){if(!t.disabled){b(t)}e.push(t)}};const _=t=>{const n=e.indexOf(t);if(n>-1){e.splice(n,1)}};const b=t=>{const n=t.side;e.filter((s=>s.side===n&&s!==t)).forEach((t=>t.disabled=true))};const A=async(t,n,s)=>{if(O()){return false}if(n){const n=await w();if(n&&t.el!==n){await n.setOpen(false,false)}}return t._setOpen(n,s)};const $=(t,n)=>{const e=s.get(t);if(!e){throw new Error("animation not registered")}const r=e(n);return r};const j=()=>v((t=>t._isOpen));const M=()=>e.map((t=>t.el));const O=()=>e.some((t=>t.isAnimating));const v=t=>{const n=e.find(t);if(n!==undefined){return n.el}return undefined};const h=()=>Promise.all(Array.from(document.querySelectorAll("ion-menu")).map((t=>new Promise((s=>n(t,s))))));g("reveal",c);g("push",a);g("overlay",o);if(typeof document!=="undefined"){document.addEventListener("ionBackButton",(n=>{const s=j();if(s){n.detail.register(t,(()=>s.close()))}}))}return{registerAnimation:g,get:m,getMenus:y,getOpen:w,isEnabled:d,swipeGesture:l,isAnimating:x,isOpen:p,enable:f,toggle:u,close:i,open:r,_getOpenSync:j,_createAnimation:$,_register:X,_unregister:_,_setOpen:A,_setActiveMenu:b}};const u=i();export{u as m};
//# sourceMappingURL=p-4d375a3e.js.map