import{r as o,d as n,B as a,h as s}from"./p-846bd001.js";import{t}from"./p-9732f456.js";import"./p-18891da7.js";import"./p-8cd54418.js";const e=class{constructor(a){o(this,a),this.floodteamCloseModal=n(this,"floodteamCloseModal",7)}onReset(o){var n;if("bulkUpdateUsers"===(null===(n=o.detail)||void 0===n?void 0:n.endpoint)){const o=document.querySelector("ion-modal.modal-scanner");(null==o?void 0:o.dismiss)&&o.dismiss()}}async onSuccess(o){var n;if("bulkUpdateUsers"===(null===(n=o.detail)||void 0===n?void 0:n.endpoint)){const o=document.querySelector("ion-modal.modal-scanner");(null==o?void 0:o.dismiss)&&(await o.dismiss(),this.presentToast())}}async presentToast(){(await t.create({message:"Scanning...",duration:2e3})).present()}onScanSuccess(o,n){console.log(`Scan result: ${o}`,n),this.qrCodeScanner.clear()}componentDidLoad(){(null==a?void 0:a.isBrowser)&&setTimeout((()=>{this.qrCodeScanner=new window.Html5QrcodeScanner("reader",{fps:10,qrbox:250}),this.qrCodeScanner.render(this.onScanSuccess.bind(this))}),100)}render(){return[s("ion-header",null,s("ion-toolbar",null,s("ion-title",null,"Scan QR Code"),s("ion-buttons",{slot:"end"},s("ion-button",{onClick:()=>this.floodteamCloseModal.emit(),style:{"--color":"var(--ion-text-color)","--color-hover":"var(--ion-color-danger"}},s("ion-icon",{slot:"icon-only",name:"close-circle-outline"}))))),s("ion-content",null,s("div",{id:"reader"}))]}};e.style="modal-scanner .banner{background-color:var(--ion-color-secondary)}modal-scanner h1{color:#fff}modal-scanner p{margin:0 0 15px 0;color:rgba(255, 255, 255, 0.8);font-weight:normal}.modal-scanner{--width:700px;--max-width:700px}@media only screen and (max-width: 800px){.modal-scanner{--width:100%;--max-width:auto}}";export{e as modal_scanner}