import{D as x,H as u,I as C,K as l,X as O,a as T,ea as a,fa as D,lc as N,n as k,pa as L,q as M,r as E}from"./chunk-VZVHAHX6.js";var p=class{constructor(e,t){this.source=e,e.initialize&&e.initialize(t)}subscribe(e){this.sub=this.source.onInterrupt.subscribe(e)}unsubscribe(){this.sub.unsubscribe(),this.sub=null}resume(){this.source.attach()}pause(){this.source.detach()}},h=class{constructor(){this.idValue=new Date,this.idlingValue=!1}id(e){if(e!==void 0){if(!e)throw new Error("A value must be specified for the ID.");this.idValue=e}return this.idValue}idling(e){return e!==void 0&&(this.idlingValue=e),this.idlingValue}now(){return new Date}isExpired(){let e=this.last();return e!=null&&e{class i{constructor(){this.storage=this.getStorage()}getStorage(){try{let t=localStorage;return t.setItem("ng2IdleStorage",""),t.removeItem("ng2IdleStorage"),t}catch{return new m}}getItem(t){return this.storage.getItem("ng2Idle."+t)}removeItem(t){this.storage.removeItem("ng2Idle."+t)}setItem(t,s){this.storage.setItem("ng2Idle."+t,s)}_wrapped(){return this.storage}static{this.\u0275fac=function(s){return new(s||i)}}static{this.\u0275prov=u({token:i,factory:i.\u0275fac})}}return i})(),f=(()=>{class i extends h{constructor(t){super(),this.localStorage=t,this.idleName="main"}last(t){return t!==void 0&&this.setExpiry(t),this.getExpiry()}idling(t){return t!==void 0&&this.setIdling(t),this.getIdling()}getIdleName(){return this.idleName}setIdleName(t){t&&(this.idleName=t)}getExpiry(){let t=this.localStorage.getItem(this.idleName+".expiry");return t?new Date(parseInt(t,10)):null}setExpiry(t){t?this.localStorage.setItem(this.idleName+".expiry",t.getTime().toString()):this.localStorage.removeItem(this.idleName+".expiry")}getIdling(){let t=this.localStorage.getItem(this.idleName+".idling");return t?t==="true":!1}setIdling(t){t?this.localStorage.setItem(this.idleName+".idling",t.toString()):this.localStorage.setItem(this.idleName+".idling","false")}static{this.\u0275fac=function(s){return new(s||i)(l(K))}}static{this.\u0275prov=u({token:i,factory:i.\u0275fac})}}return i})(),g=class{},d=(function(i){return i[i.disabled=0]="disabled",i[i.idle=1]="idle",i[i.notIdle=2]="notIdle",i})(d||{}),R=(()=>{class i{constructor(t,s,r,n){this.expiry=t,this.zone=s,this.platformId=n,this.idle=1200,this.timeoutVal=30,this.autoResume=d.idle,this.interrupts=new Array,this.running=!1,this.keepaliveEnabled=!1,this.onIdleStart=new a,this.onIdleEnd=new a,this.onTimeoutWarning=new a,this.onTimeout=new a,this.onInterrupt=new a,r&&(this.keepaliveSvc=r,this.keepaliveEnabled=!0),this.setIdling(!1)}setIdleName(t){if(this.expiry instanceof f)this.expiry.setIdleName(t);else throw new Error("Cannot set expiry key name because no LocalStorageExpiry has been provided.")}getKeepaliveEnabled(){return this.keepaliveEnabled}setKeepaliveEnabled(t){if(!this.keepaliveSvc)throw new Error("Cannot enable keepalive integration because no KeepaliveSvc has been provided.");return this.keepaliveEnabled=t}getTimeout(){return this.timeoutVal}setTimeout(t){if(t===!1)this.timeoutVal=0;else if(typeof t=="number"&&t>=0)this.timeoutVal=t;else throw new Error("'seconds' can only be 'false' or a positive number.");return this.timeoutVal}getIdle(){return this.idle}setIdle(t){if(t{s.interrupt(S.force,S.innerArgs)}),this.interrupts.push(o)}return this.interrupts}getInterrupts(){return this.interrupts}clearInterrupts(){for(let t of this.interrupts)t.pause(),t.unsubscribe();this.interrupts.length=0}isRunning(){return this.running}isIdling(){return this.idling}watch(t){this.safeClearInterval("idleHandle"),this.safeClearInterval("timeoutHandle");let s=this.timeoutVal?this.timeoutVal:0;if(!t){let n=new Date(this.expiry.now().getTime()+(this.idle+s)*1e3);this.expiry.last(n)}this.idling&&this.toggleState(),this.running||(this.startKeepalive(),this.toggleInterrupts(!0)),this.running=!0;let r=()=>{this.zone.run(()=>{this.getExpiryDiff(s)>0?(this.safeClearInterval("idleHandle"),this.setIdleIntervalOutsideOfZone(r,1e3)):this.toggleState()})};this.setIdleIntervalOutsideOfZone(r,1e3)}setIdleIntervalOutsideOfZone(t,s){this.zone.runOutsideAngular(()=>{this.idleHandle=setInterval(t,s)})}stop(){this.stopKeepalive(),this.toggleInterrupts(!1),this.safeClearInterval("idleHandle"),this.safeClearInterval("timeoutHandle"),this.setIdling(!1),this.running=!1,this.expiry.last(null)}timeout(){this.stopKeepalive(),this.toggleInterrupts(!1),this.safeClearInterval("idleHandle"),this.safeClearInterval("timeoutHandle"),this.setIdling(!0),this.running=!1,this.countdown=0,this.onTimeout.emit(null)}interrupt(t,s){if(this.running){if(this.timeoutVal&&this.expiry.isExpired()){this.timeout();return}this.onInterrupt.emit(s),(t===!0||this.autoResume===d.idle||this.autoResume===d.notIdle&&!this.expiry.idling())&&this.watch(t)}}setIdling(t){this.idling=t,this.expiry.idling(t)}toggleState(){this.setIdling(!this.idling),this.idling?(this.onIdleStart.emit(null),this.stopKeepalive(),this.timeoutVal>0&&(this.countdown=this.timeoutVal,this.doCountdown(),this.setTimeoutIntervalOutsideZone(()=>{this.doCountdownInZone()},1e3))):(this.toggleInterrupts(!0),this.onIdleEnd.emit(null),this.startKeepalive()),this.safeClearInterval("idleHandle")}setTimeoutIntervalOutsideZone(t,s){this.zone.runOutsideAngular(()=>{this.timeoutHandle=setInterval(()=>{t()},s)})}toggleInterrupts(t){for(let s of this.interrupts)t?s.resume():s.pause()}getExpiryDiff(t){let s=this.expiry.now();return(this.expiry.last()||s).getTime()-s.getTime()-t*1e3}doCountdownInZone(){this.zone.run(()=>{this.doCountdown()})}doCountdown(){let t=this.getExpiryDiff(this.timeoutVal);if(t>0){this.safeClearInterval("timeoutHandle"),this.interrupt(!0);return}if(!this.idling)return;if(this.countdownthis.attach());return}!this.isAttached&&this.attachFn&&this.attachFn(this),this.isAttached=!0}detach(){this.isAttached&&this.detachFn&&this.detachFn(this),this.isAttached=!1}},F=500,c=class extends y{constructor(e,t,s){super(null,null),this.target=e,this.events=t,this.opts=s,this.eventSubscription=new T,typeof this.opts=="number"&&(this.opts={throttleDelay:this.opts,passive:!1}),this.opts=this.opts||{passive:!1,throttleDelay:F},(this.opts.throttleDelay===void 0||this.opts.throttleDelay===null)&&(this.opts.throttleDelay=F),this.throttleDelay=this.opts.throttleDelay,this.passive=!!this.opts.passive}initialize(e){if(e?.platformId&&N(e.platformId))return;let t=typeof this.target=="function"?this.target():this.target,s=this.passive?{passive:!0}:null,r=this.events.split(" ").map(o=>k(t,o,s));this.eventSrc=M(...r),this.eventSrc=this.eventSrc.pipe(E(o=>!this.filterEvent(o))),this.throttleDelay>0&&(this.eventSrc=this.eventSrc.pipe(x(this.throttleDelay)));let n=o=>this.onInterrupt.emit(new v(this,o));this.attachFn=()=>this.eventSubscription=this.eventSrc.subscribe(n),this.detachFn=()=>this.eventSubscription.unsubscribe()}filterEvent(e){return!1}get options(){return{passive:this.passive,throttleDelay:this.throttleDelay}}},I=class extends c{constructor(e,t){super(()=>document.documentElement,e,t)}filterEvent(e){return!!(e.type==="mousemove"&&(e.originalEvent&&e.originalEvent.movementX===0&&e.originalEvent.movementY===0||e.movementX!==void 0&&!e.movementX||!e.movementY))}},b=class extends c{constructor(e,t){super(()=>window,e,t)}},w=class extends b{constructor(e=500){super("storage",e)}filterEvent(e){return!(e.key&&e.key.indexOf("ng2Idle.")>=0&&e.key.indexOf(".expiry")>=0)}};var Y=(()=>{class i{static forRoot(){return{ngModule:i,providers:[f,{provide:h,useExisting:f},R]}}static{this.\u0275fac=function(s){return new(s||i)}}static{this.\u0275mod=L({type:i})}static{this.\u0275inj=C({providers:[K]})}}return i})();function V(i){return[new I("mousemove keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll",i),new w(i)]}var X=V();var wt="/pages/kiosk";export{R as a,Y as b,X as c,wt as d};