function ar(){this.Init()}v("AdfSessionTimeoutHelper",ar);v("AdfSessionTimeoutHelper",ar);z.l(ar);ar.jw={NONE:0,T5a:1,R3:2};v("AdfSessionTimeoutHelper.TimeoutWindowStates",ar.jw);ar.prototype.Iga=r("WH");z.a("AdfSessionTimeoutHelper.prototype.getTimeoutWindowState",{Iga:ar.prototype.Iga});ar.prototype.Init=function(){ar.f.Init.call(this);this.WH=ar.jw.NONE};z.a("AdfSessionTimeoutHelper.prototype.Init",{Init:ar.prototype.Init});
ar.prototype.HM=function(a,b,d){DA(a);this.Do();EA(this,a,b);this.Nl=a;this.Hk=b;this.uY=d;a=w.b;if((a.$j()?a.cs("oracle.adfinternal.view.rich.sessionKeysCleaned"):n)==n)this.Fr=F.c.oa(this,this.JSa,n,6E4),a.$j()&&a.cq("oracle.adfinternal.view.rich.sessionKeysCleaned","scheduled")};z.a("AdfSessionTimeoutHelper.prototype.__initializeSessionTimeoutTimer",{HM:ar.prototype.HM});
ar.prototype.Do=function(){var a=D.i;this.Fr&&(F.c.ac(this.Fr),a.xd(D.INFO)&&a.info("Cancelled session timeout warning dialog timer with id ",this.Fr),this.Fr=n);this.ri&&(F.c.ac(this.ri),a.xd(D.INFO)&&a.info("Cancelled final session timeout dialog timer with id ",this.ri),this.ri=n)};z.a("AdfSessionTimeoutHelper.prototype.__cancelSessionTimeoutTimer",{Do:ar.prototype.Do});ar.prototype.x8=function(){DA(this.Nl);EA(this,this.Nl,this.Hk)};
z.a("AdfSessionTimeoutHelper.prototype.__startSessionTimeoutTimer",{x8:ar.prototype.x8});ar.prototype.Ora=function(){this.Nl=0;var a=wh.O();if(a.Kn()){var b="oracle.adfinternal.view.rich.sessionKey_"+F.c.Qu();a.VR(b)}a=this.Nl;b=this.Hk;this.Do();EA(this,a,b)};z.a("AdfSessionTimeoutHelper.prototype.__alertTimeout",{Ora:ar.prototype.Ora});
ar.prototype.q8=function(a){if("click"==a.type||"keypress"==a.type){var b=wh.O();if(b.Kn()){a=new Date;var d="oracle.adfinternal.view.rich.userActivityKey_"+F.c.Qu();b.M1(d,a.getTime());b=D.i;b.xd(D.INFO)&&b.info("Last user activity on client for ",d," at ",a)}}};z.a("AdfSessionTimeoutHelper.prototype.__recordUserActivity",{q8:ar.prototype.q8});u=ar.prototype;
u.JSa=function(){var a=wh.O();if(a.Kn()){var b=(new Date).getTime(),d=a.fga();D.i.info("Cleaning expired session info from web local storage");for(var e=0;e<d.length;e++)if(0==d[e].indexOf("oracle.adfinternal.view.rich.sessionKey_")){var f=a.ZI(d[e]);36E4<b-f&&(a.VR(d[e]),a.VR("oracle.adfinternal.view.rich.userActivityKey_"+d[e].split("_")[1]))}a=w.b;a.$j()?a.cq("oracle.adfinternal.view.rich.sessionKeysCleaned","complete"):D.i.info("Could not mark that we cleaned web local storage because session storage is not enabled")}};
function EA(a,b,d){var e=(new Date).getTime(),f=D.i,g=b-d;a.WH=ar.jw.NONE;0<g&&12E4<=d?(a.Fr=F.c.oa(a,a.U0a,n,g),f.xd(D.INFO)&&f.info("Scheduled session timeout warning dialog timer with id ",a.Fr," to be shown at : ",new Date(e+g))):(a.ri=F.c.oa(a,a.P0a,n,b),f.xd(D.INFO)&&f.info("Scheduled final session timeout dialog timer with id ",a.ri," to be shown at : ",new Date(e+b)))}
function DA(a){var b=wh.O();if(b.Kn()){a=(new Date).getTime()+a;var d="oracle.adfinternal.view.rich.sessionKey_"+F.c.Qu(),e=b.ZI(d);if(e==n||e<a)b.M1(d,a),b=D.i,b.xd(D.INFO)&&b.info("Web local storage for key ",d," reset to : ",new Date(a))}}
function FA(a){var b=wh.O();if(b.Kn()){var d="oracle.adfinternal.view.rich.userActivityKey_"+F.c.Qu();if(b=b.ZI(d))if(b=(new Date).getTime()-b,b<a)return d=D.i,d.xd(D.INFO)&&d.info("User activity on client ",b/1E3," seconds ago. Duration checked for activity ",a/1E3," seconds"),l}return p}function GA(){var a=wh.O();if(a.Kn()){var b="oracle.adfinternal.view.rich.sessionKey_"+F.c.Qu();if(a=a.ZI(b))return a-(new Date).getTime()}return n}
u.U0a=function(){var a=GA();if(a&&(a<this.Hk-2E3||a>this.Hk+2E3)){var b=this.Hk;this.Do();EA(this,a,b);return-1}if(FA(this.Nl-this.Hk))return HA(this),-1;this.Fr=n;a=F.c;this.ri&&(a.ac(this.ri),this.ri=n);var d=F.c.u(),b=6E4<=this.Hk?d.V("af_document.PRE_SESSION_TIMEOUT_MSG",Math.floor(this.Hk/6E4)):d.V("af_document.PRE_SESSION_TIMEOUT_MSG_SECOND",this.Hk/1E3),d=d.V("af_document.PRE_SESSION_TIMEOUT_CONFIRM_TITLE");d==n&&(d="Expiration Warning");var e=this.o(this.$Wa);this.WH=ar.jw.R3;this.Aya=(new Date).getTime();
a.Rra(d,b,e,this.Hk,l);return-1};u.$Wa=function(a){this.WH=ar.jw.NONE;if(a.Xj()==ab.fl)HA(this);else if(a.Xj()==ab.vm){a=GA();a||(a=this.Hk-((new Date).getTime()-this.Aya),this.Aya=n);var b=this.Hk;this.Do();EA(this,a,b)}};
u.P0a=function(){var a=GA();if(a&&0<a&&0<a){var b=this.Hk;this.Do();EA(this,a,b);return-1}if(FA(this.Nl))return HA(this),-1;this.ri=n;a=F.c;this.Fr&&(a.ac(this.Fr),this.Fr=n);var d=a.u(),b=d.V("af_document.POST_SESSION_TIMEOUT_MSG");this.uY&&(b+=" "+d.V("af_document.POST_SESSION_TIMEOUT_MSG_CONTINUE"));d=d.V("af_document.POST_SESSION_TIMEOUT_ALERT_TITLE");d==n&&(d="Window Expired");ne.O().nI();var e=w.b.getElementById(a.mi);H.setVisible(e,p);e=this.o(this.zWa);this.WH=ar.jw.R3;a.Nra(d,b,e);return-1};
u.zWa=function(){this.ri=n;var a=F.c;this.WH=ar.jw.NONE;if(this.uY)a.R().location.replace(this.uY);else{var b=a.u().V("af_document.POST_SESSION_TIMEOUT_MSG"),d=w.b,e=a.w().createElement("div");H.setVisible(e,p);d.yb(e,b);d.getElementById(a.mi).parentNode.appendChild(e);H.setVisible(e,l);a.R().setTimeout(a.o(a.WD),1)}};
function HA(a){var b=F.c.w().location.href,b=-1==b.indexOf("?")?b+"?":b+"\x26",b=b+("_afrTS\x3d"+(new Date).getTime()),d=new Ye;d.tD(p);d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(b,n);d.tn();delete d;D.i.info("Extended session lifetime");DA(a.Nl);b=a.Nl;d=a.Hk;a.Do();EA(a,b,d)};