import{w as a}from"./chunk-ZVAMPSQU.js";import{j as n}from"./chunk-FB5LSH2R.js";var o=(()=>{let t=class t{constructor(){this.isCapable="wakeLock"in navigator,this.wakeLock=null,this.wakeLockPending=null,this.wakeLockRequests=[],document.addEventListener("visibilitychange",()=>this.onVisiblityChange()),document.addEventListener("fullscreenchange",()=>this.onVisiblityChange())}request(){return n(this,null,function*(){let e={release:()=>{this.release(e)}};return this.wakeLockRequests.push(e),this.requestWakeLock(),e})}release(e){let i=this.wakeLockRequests.indexOf(e);i>-1&&this.wakeLockRequests.splice(i,1),this.wakeLockRequests.length===0&&this.releaseWakeLock()}requestWakeLock(){return n(this,null,function*(){if(this.wakeLock||this.wakeLockPending||!this.isCapable)return;let e;try{this.wakeLockPending=navigator.wakeLock.request("screen"),e=yield this.wakeLockPending}catch(i){return}finally{this.wakeLockPending=null}if(this.wakeLockRequests.length===0){this.releaseSentinel(e);return}this.wakeLock=e,e.addEventListener("release",()=>{this.wakeLock===e&&(this.wakeLock=null)}),console.log("WakeLock requested")})}releaseWakeLock(){return n(this,null,function*(){if(!this.wakeLock)return;let e=this.wakeLock;this.wakeLock=null,this.releaseSentinel(e),console.log("WakeLock released")})}releaseSentinel(e){e.release().catch(()=>{})}onVisiblityChange(){this.wakeLockRequests.length>0&&document.visibilityState==="visible"&&this.requestWakeLock()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var k=(()=>{let t=class t{constructor(){this.isCapable=!!document.documentElement.requestFullscreen}get isActive(){return!!document.fullscreenElement}request(){return n(this,null,function*(){if(!(!this.isCapable||this.isActive))try{yield document.documentElement.requestFullscreen()}catch(e){}})}exit(){return n(this,null,function*(){if(document.fullscreenElement)try{yield document.exitFullscreen()}catch(e){}})}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();export{o as a,k as b};
