import{r as o,e as n,B as a,h as e}from"./p-a89095f5.js";import{t as s}from"./p-3e7f0e42.js";import"./p-29ec504c.js";import"./p-8cd54418.js";const t=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 s.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[e("ion-header",null,e("ion-toolbar",null,e("ion-title",null,"Scan QR Code"),e("ion-buttons",{slot:"end"},e("ion-button",{onClick:()=>this.floodteamCloseModal.emit(),style:{"--color":"var(--ion-text-color)","--color-hover":"var(--ion-color-danger"}},e("ion-icon",{slot:"icon-only",name:"close-circle-outline"}))))),e("ion-content",null,e("div",{id:"reader"}))]}};t.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{t as modal_scanner}