import{b as s}from"./p-CS7huZb4.js";import{L as t,a as i}from"./p-DCgTymE2.js";import{K as e}from"./p-PmQf2Yvi.js";class h extends t{async connect(s){super.connect(s),await this.loadLib(),this.PointerListenerLib&&(this.pointerListener=new this.PointerListenerLib(s,{handleTouchEvents:!1}),this.pointerListener.on("swipeleft",(()=>this.notify({left:!0,right:!1}))),this.pointerListener.on("swiperight",(()=>this.notify({left:!1,right:!0}))))}disconnect(){var s;super.disconnect(),null===(s=this.pointerListener)||void 0===s||s.destroy()}async loadLib(){return new Promise(((s,t)=>{e((async()=>{import("./p-BkEdlCZJ.js").then((t=>{this.PointerListenerLib=t.PointerListener,s()})).catch(t)}))}))}}class r extends i{constructor(s={mobileOnly:!1}){super(((s,t)=>{t&&s.swipeListener(t)})),this.options=s,this.listener=new h}attach(t){(!0===this.options.mobileOnly&&s.isMobile||!0!==this.options.mobileOnly)&&(super.attach(t),this.listener.connect(t.el),this.listener.add((s=>super.notify(s))))}detach(){super.detach(),this.listener.disconnect()}}export{r as B}