var OmniFaces=OmniFaces||{EVENT:"omnifaces.event",VIEW_STATE_PARAM:"javax.faces.ViewState",CLIENT_WINDOW_PARAM:"javax.faces.ClientWindow"}; OmniFaces.Util=function(d,g){function h(a,f,b,k,d){k=k.replace(/^\s+|\s+$/g,"").split(/\s+/);for(var c=0;ce||e>=h.length)){var b=h[e];d.loadScript(b.url,null,b.begin,b.success,b.error,function(){g(e+1)})}}var h=[];return{add:function(e,b,a,f){h.push({url:e,begin:b,success:a,error:f});1==h.length&&d.addOnloadListener(function(){g(0)})}}}(OmniFaces.Util); OmniFaces.Unload=function(d,g,h){var e,b,a={init:function(f){if(h.XMLHttpRequest){if(null==e){var c=d.getFacesForm();if(!c)return;d.addEventListener(h,"onpagehide"in h?"pagehide":"onbeforeunload"in h&&!h.onbeforeunload?"beforeunload":"unload",function(){if(b)a.reenable();else try{var f=c.action,d=OmniFaces.EVENT+"\x3dunload\x26id\x3d"+e+"\x26"+OmniFaces.VIEW_STATE_PARAM+"\x3d"+encodeURIComponent(c[OmniFaces.VIEW_STATE_PARAM].value);if(g.sendBeacon)g.sendBeacon(f,new Blob([d],{type:"application/x-www-form-urlencoded"})); else{var h=new XMLHttpRequest;h.open("POST",f,!1);h.setRequestHeader("X-Requested-With","XMLHttpRequest");h.setRequestHeader("Content-Type","application/x-www-form-urlencoded");h.send(d)}}catch(q){}});d.addSubmitListener(function(){a.disable()})}e=f;b=!1}},disable:function(){b=!0},reenable:function(){b=!1}};return a}(OmniFaces.Util,navigator,window); OmniFaces.Push=function(d,g){function h(a,b,f,d,e,h,g){var c,k,l=this;l.open=function(){c&&1==c.readyState||(c=new WebSocket(a),c.onopen=function(){null==k&&f(b);k=0},c.onmessage=function(a){var c=JSON.parse(a.data);d(c,b,a);if((a=g[c])&&a.length)for(c=0;ca){a=f.name;var c;d.mojarra&&(c=e.form.enctype,e.form.enctype="application/x-www-form-urlencoded");e.type="text";e.type="file";a={fileName:a};a[OmniFaces.EVENT]="validationFailed";jsf.ajax.request(e.id,h,a);c&&(e.form.enctype=c);return!1}}return!0}}}(window,document); OmniFaces.Form=function(d,g){d.addOnloadListener(function(){if(g.jsf){var d=jsf.getViewState;jsf.getViewState=function(e){var b=d(e);if("true"!=e.attributes["data-partialsubmit"])return b;var a=jsf.ajax.request.arguments,f=a?a[2].execute:null;if(!f||-1!=f.indexOf("@form")||-1!=f.indexOf("@all"))return b;var c=[];-1==f.indexOf("@none")&&(c=f.replace("@this",a[0].id).split(" ").map(encodeURIComponent),c.push(encodeURIComponent(e.id)));c.push(OmniFaces.VIEW_STATE_PARAM);c.push(OmniFaces.CLIENT_WINDOW_PARAM); var g=[];b.replace(/([^=&]+)=([^&]*)/g,function(a,b,f){-1