UNPKG

profoundjs

Version:

Profound.js Framework and Server

114 lines 611 kB
window.pui||(window.pui={});window.pui.baseVersion="6";window.pui.fixPackVersion="32.0";window.pui.version=window.pui.baseVersion+"."+window.pui.fixPackVersion;function b(c){this.onready=this.onfail=this.onsuccess=this.cacheBuster=this.suppressAlert=this.password=this.user=this.async=this.url=this.reqData=this.postData=this.method=null;this.headers={};this.params=null;this.sendAsBinary=true;var a=this.overrideMimeType=null,d=null,e=null,f=null,g=typeof pui!="undefined"&&typeof pui.alert!="undefined"?pui.alert:alert,h=this;if(b.defaultHeaders)this.headers=b.defaultHeaders;if(typeof c=="object")for(var j in c){if(typeof this[j]!="undefined")this[j]=c[j]}else this.url= c;if(window.XMLHttpRequest)a=new XMLHttpRequest;else if(window.ze)a=new ActiveXObject("Microsoft.XMLHTTP");else{g("Ajax request error: Unsupported browser.");return}this.send=this.send=function(){function k(){if(a.readyState==4){d=a.status===0?C?"Request aborted.":"Request failed. Check the browser console for more details.":a.status+" - "+a.statusText;h.onready!=null&&h.onready(h);if(a.status==200){e=true;h.onsuccess!=null&&h.onsuccess(h)}else{e=false;h.suppressAlert!=true&&g(d);h.onfail!=null&& h.onfail(h)}f=false}}var i,l=null,n=null,m=null;if(h.method==null)l="GET";else if(typeof h.method!="string"&&(h.method.toUpperCase()!="GET"||h.method.toUpperCase()!="POST"||h.method.toUpperCase()!="PUT"||h.method.toUpperCase()!="DELETE")){g('Invalid value for property: "method".');return}else l=h.method.toUpperCase();if(l=="POST"||l=="PUT"||l=="DELETE"){if(h.reqData!=null)m=h.reqData;else if(h.postData!=null)m=h.postData;if(m!=null){if(typeof m!="string"){g('Invalid value for property: "postData".'); return}}else m=""}if(h.async==null)n=true;else if(h.async!=true&&h.async!=false){g('Invalid value for property: "async".');return}else n=h.async;if(typeof h.url!="string")g('Invalid value for property: "url".');else{if(h.user!=null)if(typeof h.user!="string"){g('Invalid value for property: "user".');return}if(h.password!=null)if(typeof h.password!="string"){g('Invalid value for property: "password".');return}if(h.onsuccess!=null)if(typeof h.onsuccess!="function"){g('Invalid value for event: "onsuccess".'); return}if(h.onfail!=null)if(typeof h.onfail!="function"){g('Invalid value for event: "onfail".');return}if(h.onready!=null)if(typeof h.onready!="function"){g('Invalid value for event: "onready".');return}var o=true;if(m!=null)for(i in h.headers)if(i.toUpperCase()=="CONTENT-TYPE")if(h.headers[i].toLowerCase().indexOf("www-form-urlencoded")==-1)o=false;var p=h.url,r=h.params;if(typeof r=="object"){var q="";for(i in r){var u=r[i],x=[];if(typeof u=="object"){if(u.length!=null&&u.length>0)x=u}else x.push(u); for(u=0;u<x.length;u++){if(q!="")q+="&";q+=encodeURIComponent(i)+"="+encodeURIComponent(x[u])}}if(q!="")if(o&&(l=="POST"||l=="PUT"||l=="DELETE")){if(m!=null&&m!="")m+="&";else m="";m+=q}else{o=p.split("?");if(o.length==2&&o[1]!="")p=o[0]+"?"+o[1]+"&"+q;else p+="?"+q}}if(l==="GET"&&(h.cacheBuster===null||h.cacheBuster===true))p=pui.addUrlCacheBuster(p);try{typeof h.user=="string"&&typeof h.password=="string"?a.open(l,p,n,h.user,h.password):a.open(l,p,n);p=false;var z=h.headers;for(i in z){a.setRequestHeader(i, z[i]);if(i.toUpperCase()=="CONTENT-TYPE")p=true}if(l=="POST"||l=="PUT"||l=="DELETE")p||a.setRequestHeader("Content-type","application/x-www-form-urlencoded");typeof h.overrideMimeType=="string"&&typeof a.overrideMimeType=="function"&&a.overrideMimeType(h.overrideMimeType)}catch(D){g(D);return}f=true;var C=false;if(n==true){a.onload=k;a.onerror=k;a.onabort=function(){C=true;k()}}if(h.sendAsBinary==true)try{a.sendAsBinary(m)}catch(J){a.send(m)}else a.send(m);n!=true&&k()}};this.ok=this.ic=function(){return e!= null?e:false};this.getResponseText=this.W=function(){return a.responseText};this.getResponseXML=this.bc=function(){return a.responseXML};this.getStatus=this.X=function(){return a.status};this.getStatusText=this.jb=function(){return a.statusText};this.getStatusMessage=this.ib=function(){return d};this.getAllResponseHeaders=this.getAllResponseHeaders=function(){if(e)try{return a.getAllResponseHeaders()}catch(k){g(k)}};this.getResponseHeader=this.getResponseHeader=function(k){if(e)try{return a.getResponseHeader(k)}catch(i){g(i)}}; this.setRequestHeader=this.setRequestHeader=function(k,i){h.headers[k]=i};this.abort=this.abort=function(){if(f===true)try{a.abort()}catch(k){g(k)}}} function I(c,a){var d,e,f,g="";if(arguments.length==1&&typeof arguments[0]=="object"){d=arguments[0];d.async=null;d.onsuccess=null;if(typeof d.handler=="function"){e=true;f=d.handler}else e=false}else if(a!=null&&typeof a=="function"){e=true;f=a}else e=false;d=new b(arguments[0]);d.async=e;d.onsuccess=function(h){g+=h.W();e==true&&f(g)};d.send();if(e==false)return g} function K(c,a){var d,e,f,g=null,h=false;if(arguments.length==1&&typeof arguments[0]=="object"){d=arguments[0];d.async=null;d.onsuccess=null;if(d.saveResponse==true)h=true;if(typeof d.handler=="function"){e=true;f=d.handler}else e=false}else if(a!=null&&typeof a=="function"){e=true;f=a}else e=false;d=new b(arguments[0]);d.async=e;d.onsuccess=function(j){j=j.W();if(h&&typeof pui=="object")pui.savedJSON=j;try{g=eval("("+j+")")}catch(k){f(null,k);return}e==true&&f(g)};d.send();if(e==false)return g} if(typeof window.pui=="undefined")window.pui={};window.RPGspRequest=b;window.pui.Ajax=b;window.pui.AjaxRequest=b;window.ajax=I; window.ajaxXML=function(c,a){var d,e,f,g=null;if(arguments.length==1&&typeof arguments[0]=="object"){d=arguments[0];d.async=null;d.onsuccess=null;d.onfail=null;d.onsuccess=null;if(typeof d.handler=="function"){e=true;f=d.handler}else e=false}else if(a!=null&&typeof a=="function"){e=true;f=a}else e=false;d=new b(arguments[0]);d.async=e;d.onsuccess=function(h){g=h.bc();e==true&&f(g)};d.send();if(e==false)return g};window.ajaxJSON=K; window.ajaxSubmit=function(c,a){var d,e="",f=typeof pui!="undefined"&&typeof pui.alert!="undefined"?pui.alert:alert;if(typeof c=="object")d=c;else{d=document.getElementById(c);if(d==null)d=document.forms[c]}var g;if(d!=null)g=d.tagName;if(d==null||g==null||g.toUpperCase()!="FORM"){f("Ajax request error: Invalid form object.");return""}if(c.action==""){f("Ajax request error: Invalid form action.");return""}for(f=0;f<d.elements.length;f++){g=d.elements[f];if(g.name!=null&&g.name!=""){var h=false;if(g.tagName== "INPUT"){var j=g.type;j=j.toLowerCase();if(j=="hidden")h=true;if(j=="password")h=true;if(j=="text")h=true;if(pui.af(j))h=true;if(j=="")h=true;if(j=="checkbox"||j=="radio")if(g.checked)h=true}if(g.tagName=="TEXTAREA")h=true;if(g.tagName=="SELECT")h=true;if(h){if(e!="")e+="&";e+=g.name+"="+encodeURIComponent(g.value)}}}d=new b(d.action);d.method="POST";d.postData=e;var k="",i;if(a!=null&&typeof a=="function")i=true;else{i=false;d.async=false}d.onsuccess=function(l){k+=l.W();i==true&&a(k)};d.send(); if(i==false)return k};if(typeof window.pui=="undefined")window.pui={};function aa(c){if(document.getElementById("PCCommandApplet")==null){var a=document.createElement("applet");a.id="PCCommandApplet";a.archive="/profoundui/proddata/applet/PCIntegration.jar";a.code="com.profoundlogic.genie.PCIntegration";a.style.height="0px";a.style.width="0px";if(typeof eval(c)=="function"){var d=document.createElement("param");d.setAttribute("name","callback");d.setAttribute("value",c);a.appendChild(d)}document.body.appendChild(a)}} window.copyToClipboardCb=function(){copyToClipboardCb(pui.Vc);pui.Vc=null};function ba(c,a){var d,e;d=c!=null&&typeof c=="object"?c:document.getElementById(c);if(d==null)return"";e="";if(d.tagName.toLowerCase()=="div"){e=d.firstChild;e=e!=null&&e.tagName!=null&&e.tagName=="A"?e.innerHTML:d.innerHTML}if(d.tagName=="INPUT"&&d.type=="checkbox"){if(d.indeterminate===true)return d.indeterminateValue;if(d.checked&&d.$a!=null)return d.$a;if(!d.checked&&d.qe!=null)return d.qe;return d.checked}if(d.tagName=="INPUT"&&d.type=="radio")return d.checked;if(d.tagName=="TEXTAREA")e=d.value; else if(d.tagName=="INPUT"){var f=d.Wa;if(a&&f!=null&&typeof f.value==="string")if(f.value.length>0)e=d.Wa.value;else{if(pui["force auto complete match"]==false)e=d.value}else e=d.value}else if(d.tagName=="SELECT"){e=d.selectedIndex;e=e>=0?d.options[e].value:d.z&&d.z.Ia&&d.z.Ia.value?d.z.Ia.value:d.value}if(d.ta!=null)e=d.ta.getValue();if(d.va!=null)e=d.va.getValue();if(d.le!=null)e=d.le.getValue();if(d.xc!=null)e=String(d.value);if(d.qa!=null){e="";if(d.qa.Ld&&d.qa.Td!=null)e=d.qa.Td;else if(!d.qa.Ld&& d.qa.Rd!=null)e=d.qa.Rd}if(d.z&&d.z.Bb&&typeof d.z.Bb.getPropertyValue==="function")e=d.z.Bb.getPropertyValue("value");for(e=e.replace(/&nbsp;/g," ");e.indexOf(String.fromCharCode(160))!=-1;)e=e.replace(String.fromCharCode(160)," ");if(e==d.emptyText)e="";return e}function ca(c){if(typeof c!=="string")return c;for(;c.charAt(0)==" ";)c=c.replace(c.charAt(0),"");return c}function L(c){if(typeof c!=="string")return c;return c.replace(/^\s*|\s*$/g,"")} pui.detachCalendar=function(c){if(typeof c=="string")c=document.getElementById(c);c!=null&&pui.jf(c)}; function M(c,a,d){var e=false,f=location.href;f=f.split("?")[0];f=f.split("/");if(f.length>2&&f[f.length-2].toLowerCase()=="auth")e=true;f="/profoundui/";var g=["PUI0009101.PGM","PUI0009102.PGM","PUI0009103.PGM","PUI0009104.PGM","PUI0009107.PGM","PUI0009109.PGM","PUI0009110.PGM","PUI0009119.PGM"];if(typeof pui.widgetURLPrefix==="string"&&g.indexOf(c.toUpperCase())!=-1){f=pui.widgetURLPrefix;if(f.substr(f.length-1)!="/")f+="/"}if(e==true||d==true)f+="auth/";f+=c;if(a!=null&&a==true)f+="/"+PSID;if(pui.serverURL!= null)f=pui.serverURL+f;return f}pui.getProgramURL=M;pui.Ve=function(c){return pui.ac(c).x};pui.We=function(c){return pui.ac(c).y}; pui.ac=function(c){c=c||window.event;var a={x:0,y:0};if(c!=null&&c.touches!=null&&c.touches.length==1){a.x=c.touches[0].pageX;a.y=c.touches[0].pageY}else if(c!=null){if(c.pageX)a.x=c.pageX;else if(c.clientX)a.x=c.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);if(c.pageY)a.y=c.pageY;else if(c.clientY)a.y=c.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)}return a}; function O(){var c={},a="";a=location.search.substring(1,location.search.length);if(a.length==0)return c;a=a.replace(/\+/g," ");a=a.split("&");for(var d=0;d<a.length;d++){var e=a[d].split("="),f=decodeURIComponent(e[0]),g="";if(e.length==2)g=decodeURIComponent(e[1]);c[f]=g}return c}if(typeof applyDesignProperty!="undefined")window.De=applyDesignProperty; pui.Hb={encode:function(c){for(var a="",d=0;d<c.length;d++){var e=c.codePointAt(d);e>65535&&d++;if(e<128)a+=String.fromCharCode(e);else{if(e<2048)a+=String.fromCharCode(e>>6|192);else{if(e<65536)a+=String.fromCharCode(e>>12|224);else{a+=String.fromCharCode(e>>18|240);a+=String.fromCharCode(e>>12&63|128)}a+=String.fromCharCode(e>>6&63|128)}a+=String.fromCharCode(e&63|128)}}return a},decode:function(c){for(var a="",d=0,e=0,f=0,g=0,h=0;d<c.length;){e=c.charCodeAt(d);if(e<128){a+=String.fromCharCode(e); d++}else if(e<224){f=c.charCodeAt(d+1);a+=String.fromCharCode((e&31)<<6|f&63);d+=2}else if(e<240){f=c.charCodeAt(d+1);g=c.charCodeAt(d+2);a+=String.fromCharCode((e&15)<<12|(f&63)<<6|g&63);d+=3}else{f=c.charCodeAt(d+1);g=c.charCodeAt(d+2);h=c.charCodeAt(d+3);a+=String.fromCodePoint((e&7)<<18|(f&63)<<12|(g&63)<<6|h&63);d+=4}}return a}}; pui.p={V:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(c){var a="",d,e,f,g,h,j,k=0;for(c=pui.Hb.encode(c);k<c.length;){d=c.charCodeAt(k++);e=c.charCodeAt(k++);f=c.charCodeAt(k++);g=d>>2;d=(d&3)<<4|e>>4;h=(e&15)<<2|f>>6;j=f&63;if(isNaN(e))h=j=64;else if(isNaN(f))j=64;a=a+this.V.charAt(g)+this.V.charAt(d)+this.V.charAt(h)+this.V.charAt(j)}return a},decode:function(c){var a="",d,e,f,g,h,j=0;for(c=c.replace(/[^A-Za-z0-9+/=]/g,"");j<c.length;){d=this.V.indexOf(c.charAt(j++)); e=this.V.indexOf(c.charAt(j++));g=this.V.indexOf(c.charAt(j++));h=this.V.indexOf(c.charAt(j++));d=d<<2|e>>4;e=(e&15)<<4|g>>2;f=(g&3)<<6|h;a+=String.fromCharCode(d);if(g!=64)a+=String.fromCharCode(e);if(h!=64)a+=String.fromCharCode(f)}return a=pui.Hb.decode(a)}}; pui.downloadJSON=function(){if(pui.hf)pui.saveRecording();else if(pui.savedJSON==null)pui.alert("JSON is not available.");else{var c=pui.savedJSON;if(typeof JSON==="object"&&typeof JSON.parse==="function"&&typeof JSON.stringify==="function")try{c=JSON.stringify(JSON.parse(pui.savedJSON),null," ")}catch(a){}pui.Ad("text/plain","json.txt",c)}}; pui.saveRecording=function(c){for(var a=null,d=0;d<pui.R.payloads.length;d++){if(!a&&pui.R.responses[d].ea)a=pui.R.responses[d].ea.yf;pui.R.payloads[d].response=pui.R.responses[d]}var e=O().testid;(d=e)||(d=prompt("Enter recording name"));if(d)if(pui.pjsServer)if(pui.R.payloads.length===0)pui.alert("No recording to save.");else{a={id:e,appuser:a,payloads:pui.R.payloads};d={"Content-Type":"application/json"};if(sessionStorage["atrium-token"])d.Authorization="Basic "+sessionStorage["atrium-token"]; fetch("/auto-testing/save-recording",{method:"POST",headers:d,body:JSON.stringify(a)}).then(function(g){if(g.ok){window.parent&&window.parent.Atrium&&window.parent.Atrium.api&&typeof window.parent.Atrium.api.reloadNavParent==="function"&&window.parent.Atrium.api.reloadNavParent("test-"+e);pui.R={payloads:[],responses:[]};typeof c==="function"?c():pui.alert("Recording saved.")}else pui.alert("Failed to save recording.")})["catch"](function(g){pui.alert("Error: Unable to save recording.");console.error("Fetch error:", g)})}else{a=JSON.stringify({user:a,payloads:pui.R.payloads});var f=d;f.Re(".json")||(f+=".json");if(pui["recording path"]){d=[];d.push({name:"path",value:pui["recording path"]+f});d.push({name:"text",value:"1"});d.push({name:"replace",value:"Y"});d.push({name:"json",value:a,fileName:f});a=new pui.Ae;a.Be(d);d=M("PUI0001109.pgm");d=d.replace("/auth","");a.send(d,function(g){var h,j={};if(g.X()!=200)h=g.ib();if(!h){j=eval("("+g.W()+")");j.success||(h=j.errorText)}if(h)pui.alert(h);else{pui.alert("Recording saved."); pui.R={payloads:[],responses:[]}}})}else pui.Ad("text/plain",f,a)}}; pui.keepAlive=function(){var c;if(!(context=="genie"&&pui.j.Fa==true)){if(context=="dspf")c=pui.j==null?M("PUI0001200.pgm"):M("PUI0002110.pgm");else if(context=="genie")c=window.DOCUMENT_URI;else return false;if(pui.ub!=null&&pui.ub!="")c+="/"+pui.ub;if(pui.overrideSubmitUrl!=null&&typeof pui.overrideSubmitUrl=="function")try{c=pui.overrideSubmitUrl(c)}catch(a){}if(context=="genie")pui.zc(pui.j.Fa=true);if(context=="dspf")pui.xb=false;pui.pf();var d={keepalive:"1"};if(pui.isCloud)d.workspace_id=pui.Zc.xe.id; I({url:pui.Ce(c),method:"post",params:d,sendAsBinary:false,suppressAlert:true,handler:function(){pui.Jd();if(context=="genie")pui.zc(pui.j.Fa=false);if(context=="dspf")pui.xb=true;for(var e=0;e<pui.lb.length;e++)pui.lb[e].unMask()},onfail:function(e){pui.onoffline==null&&!pui["suppress comm errors"]&&pui.alert(pui.Xe(e));pui.Jd();if(context=="genie")pui.zc(pui.j.Fa=false);if(context=="dspf")pui.xb=true;for(e=0;e<pui.lb.length;e++)pui.lb[e].unMask();pui.onoffline!=null&&pui.onoffline()}});return true}}; pui.getWindowSize=function(){var c,a;if(document.body&&document.body.offsetWidth){c=document.body.offsetWidth;a=document.body.offsetHeight}if(document.compatMode=="CSS1Compat"&&document.documentElement&&document.documentElement.offsetWidth){c=document.documentElement.offsetWidth;a=document.documentElement.offsetHeight}if(window.innerWidth&&window.innerHeight){c=window.innerWidth;a=window.innerHeight}if(window.Na&&window.Na.width&&window.Na.height){c=window.Na.width;a=window.Na.height}if(document.documentElement&& document.documentElement.clientWidth){c=document.documentElement.clientWidth;a=document.documentElement.clientHeight}if(c==null&&screen!=null)c=screen.width;if(a==null&&screen!=null)a=screen.height;if(c==null)c=800;if(a==null)a=600;return{width:c,height:a}};pui.openURL=function(c){window.open(c)}; pui.rb=function(c,a){if(c==null||typeof c!="string")return"";if(a==true&&window.puiMobileClient==null)return c;if(c.substr(0,5).toLowerCase()=="http:"||c.substr(0,6).toLowerCase()=="https:"||c.substr(0,5).toLowerCase()=="data:")return c;return pui.serverURL!=null?pui.serverURL+c:window.cordova&&c.substr(0,1)=="/"?c.substr(1):c}; pui.animate=function(c){var a,d,e=c.element;if(typeof e=="string")e=document.getElementById(e);if(e!=null){var f;a=c.effect;if(a=="fly in left"||a=="fly in right"||a=="fly out left"||a=="fly out right")f="left";else if(a=="fly in up"||a=="fly in down"||a=="fly out up"||a=="fly out down")f="top";else if(a=="fade in"||a=="fade out")f="opacity";else{f=c.properties;if(f==null){f=c.property;if(f==null)return}}if(typeof f=="string")f=[f];var g=c.duration;if(g==null)g="500ms";if(g.substr(g.length-1,1)!= "s")g+="s";var h=parseInt(g)*1E3;if(g.length>2&&g.substr(g.length-2,2)=="ms")h=parseInt(g);var j=c.type;if(j==null)j="ease";var k=c.from,i=c.to;switch(a){case "fly in right":k=-e.offsetWidth;k+="px";i="0px";break;case "fly in left":k=e.offsetWidth;k+="px";i="0px";break;case "fly out left":i=-e.offsetWidth;i+="px";k="0px";break;case "fly out right":i=e.offsetWidth;i+="px";k="0px";break;case "fly out down":i=e.offsetHeight;i+="px";k="0px";break;case "fly out up":i=-e.offsetHeight;i+="px";k="0px";break; case "fly in up":k=e.offsetHeight;k+="px";i="0px";break;case "fly in down":k=-e.offsetHeight;k+="px";i="0px";break;case "fade in":k="0";i="100";break;case "fade out":k="100";i="0";break}if(i!=null){var l="";for(a=0;a<f.length;a++){d=f[a];if(l!="")l+=", ";l+=d+" "+g+" "+j}var n=["transition","MozTransition","WebkitTransition","msTransition","OTransition"];if(k!=null){if(typeof k=="string"||typeof k=="number")k=[k];for(a=0;a<f.length;a++){d=f[a];e.style[d]=k[a]}}setTimeout(function(){for(var m=0;m< n.length;m++)e.style[n[m]]=l;setTimeout(function(){if(typeof i=="string"||typeof i=="number")i=[i];for(var o=0;o<f.length;o++)e.style[f[o]]=i[o];setTimeout(function(){for(var p=0;p<n.length;p++)e.style[n[p]]="";c.oncomplete!=null&&c.oncomplete()},h)},1)},1)}}};pui.getActiveElement=function(){return context=="genie"?lastActiveElement:pui.activeElement};pui.fieldExit=function(c){var a=pui.getActiveElement();if(a!=null){var d=false;if(c!=null)d=true;context=="genie"?fieldExit(a,d):pui.Pe(a)}}; pui.gotoNextElement=function(c){P(c,true)};pui.gotoPreviousElement=function(c){P(c,false)}; function P(c,a){var d=a?1:-1,e=document.querySelectorAll("INPUT,SELECT,TEXTAREA"),f=e.length;if(!(f<2))for(var g=Array.prototype.indexOf.call(e,c),h=g+d,j;;){if(h===g)break;if(h===f)h=0;else if(h===-1)h=f-1;else{var k=j=e[h];if(j!=null&&j.ta!=null)k=j.ta.getBox();if(j!=null&&j.va!=null)k=j.va.getBox();if(k.readOnly||k.disabled||k.style.visibility==="hidden"||k.tabIndex==="-1"||!k.clientHeight||!k.clientWidth)h+=d;else{try{k.focus();if(document.activeElement!=k){h+=d;continue}setTimeout(function(){pui["highlight on focus"]&& typeof k.select=="function"&&k.select();pui.lf(null,k)},0)}catch(i){}break}}}}pui.showCalendar=function(c){var a=c;if(typeof c=="string")a=document.getElementById(c);if(a!=null)if(typeof a=="object"){var d=a.Fe;if(d!=null)if(d.click!=null&&typeof d.click=="function")d.click();else d.onclick!=null&&typeof d.onclick=="function"&&setTimeout(function(){d.onclick()},250)}}; pui.getComputedStyle=function(c){var a=null;if(window.getComputedStyle)a=window.getComputedStyle(c);else if(c.currentStyle)a=c.currentStyle;return a}; pui.upload=function(c,a){var d,e,f=c.dir,g=c.overwrite===true,h;if(typeof c.slimit=="number")h=c.slimit;var j;if(typeof c.flimit=="number")j=c.flimit;var k="";if(typeof c.altname=="string")k=c.altname;var i;if(typeof c.allowedTypes&&c.allowedTypes instanceof Array)i=c.allowedTypes;if(j==null)j=c.files.length;if(h==null||i==null){var l,n=[];for(d=0;d<c.files.length;d++){e=c.files[d];var m=typeof e.type!="undefined"&&e.type!=""?e.type:"application/octet-stream";pui.Ee(n,m)==-1&&n.push(m);e=e.data&& e.data instanceof ArrayBuffer?e.data.byteLength:e.size;e=Math.ceil(e/1048576);if(l==null||e>l)l=e}if(h==null)h=l;if(i==null)i=n}l=M("PUI0009109.PGM");l+="?AUTH="+encodeURIComponent(pui.sb?pui.sb:pui.appJob.auth);if(c.mode!=="widget")l+="&mode=ajax";if(c.id)l+="&id="+encodeURIComponent(c.id);l+="&r="+Math.floor(Math.random()*1E9);if(pui.isCloud)l+="&workspace_id="+pui.Zc.xe.id;n=new FormData;n.append("dir",f);n.append("overwrite",g?"1":"0");n.append("flimit",j);n.append("slimit",h);n.append("altname", k);typeof c.generateNames=="string"&&n.append("generateNames",c.generateNames);for(d=0;d<i.length;d++)n.append("type",i[d]);for(d=0;d<c.files.length;d++){e=c.files[d];if(e.data&&e.data instanceof ArrayBuffer){var o;try{o=new Blob([e.data])}catch(p){f=new window.WebKitBlobBuilder;f.append(e.data);o=f.getBlob()}n.append("file",o)}else n.append("file",e);n.append("filename",e.name)}var r=new XMLHttpRequest;r.open("POST",l,true);r.onreadystatechange=function(){if(r.readyState==4){var q=true,u;if(r.status== 200){var x;try{x=eval("("+r.responseText+")")}catch(z){q=false;u="Server response missing or invalid."}if(x){q=x.success;if(!q)if(x.key){u=pui.getLanguageText("runtimeMsg","upload "+x.key);if(x.key=="file limit")u=u.replace("&1",j);if(x.key=="size limit")u=u.replace("&1",h)}else u=x.error}}else{q=false;u=r.status+" - "+r.statusText+".";if(r.status==0&&r.statusText=="")u="The FILE could not be found in the system."}typeof a=="function"&&a(q,u)}};if(typeof c.onabort=="function")r.onabort=c.onabort; if(typeof c.onprogress=="function"&&"upload"in r)r.upload.onprogress=c.onprogress;if(typeof c.onload=="function")r.onload=c.onload;r.send(n);return r};pui.getCookie=function(c){var a=document.cookie.split(";"),d="",e="",f="",g="";for(g=0;g<a.length;g++){d=a[g].split("=");e=d[0].replace(/^\s+|\s+$/g,"");if(e==c){if(d.length>1)f=unescape(d[1].replace(/^\s+|\s+$/g,""));return f}}return null}; pui.setCookie=function(c,a,d,e,f,g,h){var j=new Date;j.setTime(j.getTime());if(d)d=d*1E3*60*60*24;j=new Date(j.getTime()+d);document.cookie=c+"="+escape(a)+(d?";expires="+j.toGMTString():"")+(e?";path="+e:"")+(f?";domain="+f:"")+(g?";secure":"")+(h?";SameSite="+h:"")};pui.deleteCookie=function(c,a,d,e,f){if(pui.getCookie(c))document.cookie=c+"="+(a?";path="+a:"")+(d?";domain="+d:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"+(e?";Secure":"")+(f?";SameSite="+f:"")}; pui.refresh=function(c){if(c==null)c={};var a=c.url;c=c.skin;pui.setCookie("puiRefreshId",pui.ub,null,"/",null,null,"Strict");pui.qf=true;pui.ie=false;pui.ad=false;if(c!=null){c="skin="+encodeURIComponent(c);a=window.location.href;var d=a.split("?");a=d[0];d=d[1];if(d==null)d="";d=d.split("&");for(var e=false,f=0;f<d.length;f++)if(d[f].length>=5&&d[f].substr(0,5).toLowerCase()=="skin="){d[f]=c;e=true}if(!e)if(d.length==1&&d[0]=="")d[0]=c;else d.push(c);d=d.join("&");a=a+"?"+d}if(a!=null)window.location.href= a;else window.location.reload()}; pui.downloadURL=function(c){if(pui==null||pui.appJob==null||pui.appJob.auth==null||pui.appJob.auth=="")return pui.is_ie?"":"data:text/html,<!DOCTYPE html><html><body><p>To download, please connect to a Profound UI session.</p></body></html>";var a=c.inline===true;if(c.id==null)return"";var d=M("PUI0009110.PGM");d+="?id="+encodeURIComponent(c.id);if(c.contentType!=null)d+="&type="+encodeURIComponent(c.contentType);if(a)d+="&inline=1";d+="&usehttprc=0";d+="&AUTH="+encodeURIComponent(pui.sb?pui.sb:pui.appJob.auth); d+="&r="+Math.floor(Math.random()*1E9);return d};pui.download=function(c){var a=pui.downloadURL(c);c=c.inline===true;if(pui==null||pui.appJob==null||pui.appJob.auth==null||pui.appJob.auth=="")c=true;c?pui.openURL(a):pui.link(a)}; pui.downloadFile=function(c){if(typeof c==="undefined"||c==null||typeof c.id!=="string"||c.id.length<1)pui.alert("Error downloading file. \n\n No file path given",null,"Error","Close");else{var a=pui.downloadURL(c),d=c.id,e=new XMLHttpRequest;e.responseType="blob";e.open("GET",a,true);e.send();var f=null,g=null,h=null,j=null;e.onprogress=function(k){var i=pui.extractFileNameFromContentDisposition(e.getResponseHeader("Content-Disposition"));if(!(d.split("/").pop()!=i&&i=="error.txt")){if(typeof e.onprogress.diaglogShown=== "undefined"){e.onprogress.diaglogShown=true;f=document.createElement("dialog");document.body.appendChild(f);g=document.createElement("p");f.appendChild(g);h=document.createElement("button");h.innerHTML="OK";h.onclick=function(){f.close();f.remove()};j=document.createElement("button");j.innerHTML="Cancel";j.id="cancelButton";j.onclick=function(){e.abort();f.close();f.remove()};f.appendChild(j);g.innerHTML="Downloading file: "+d+"<br> Starting download...";f.showModal();e.onprogress.lastTime=Date.now()}if(Date.now()> e.onprogress.lastTime+2E3){g.innerHTML="Downloading file: "+d+"<br>"+k.type+" "+(k.loaded/1048576).toFixed(4)+" mb loaded";e.onprogress.lastTime=Date.now()}}};e.onloadend=function(){if(f!=null){f.querySelector("button[id='cancelButton']").remove();f.appendChild(h);g.innerHTML="File "+d+" downloaded successfully."}};e.onreadystatechange=function(){if(e.readyState==4&&e.status==200){var k=pui.extractFileNameFromContentDisposition(e.getResponseHeader("Content-Disposition"));if(d.split("/").pop()!=k&& k=="error.txt"){var i=new FileReader;i.onload=function(){pui.alert("Error downloading file: "+d+"\n\n"+i.result,null,"Error","Close");console.log(i.result)};i.readAsText(e.response)}else{var l=null;if(typeof c.contentType==="string"&&c.contentType.length>0)l=c.contentType;else{l=e.getResponseHeader("Content-Type").split(";")[0];if(typeof l==="string"&&l=="application/octet-stream"){var n=k.split(".").pop();if(typeof n==="string")switch(n.toLowerCase()){case "pdf":l="application/pdf";break;case "txt":l= "text/plain";break;case "csv":l="text/csv";break;case "json":l="application/json";break;case "xml":l="application/xml";break;case "html":l="text/html";break;case "htm":l="text/html";break;case "jpg":l="image/jpeg";break;case "jpeg":l="image/jpeg";break;case "png":l="image/png";break;case "gif":l="image/gif";break}}}n=["application/pdf","text/plain","text/csv","application/json","application/xml","text/html","image/jpeg","image/png","image/gif"];var m=new File([e.response],k,{type:l});m=URL.createObjectURL(m); var o=document.createElement("a");if(typeof c.inline==="boolean"&&c.inline&&n.$e(l))o.target="_blank";else o.download=k;o.name=k;o.href=m;document.body.appendChild(o);o.dispatchEvent(new MouseEvent("click",{bubbles:true,cancelable:true,view:window}));document.body.removeChild(o)}}}}};pui.extractFileNameFromContentDisposition=function(c){c=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(c);if(c!=null&&c[1])return c[1].replace(/['"]/g,"");return null}; pui.focusOnContainer=function(){window.parent!=window&&pui.we(window.parent)&&window.parent.Qd||setTimeout(function(){if(pui.C==null){pui.C=document.createElement("input");pui.C.type=pui.is_touch?"button":"text";pui.C.readOnly=true;pui.C.style.position="absolute";pui.C.style.left="-999px";pui.C.style.top="-999px";pui.C.style.width="10px";pui.C.style.borderStyle="none";pui.C.style.backgroundColor="transparent";pui.qc&&pui.qc.appendChild(pui.C)}pui.Kd=true;pui.C.focus();setTimeout(function(){pui.Kd= false},0)},1)};pui.addCSS=function(c){var a=document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css";if(pui.is_old_ie)d.styleSheet.cssText=c;else d.innerHTML=c;a.appendChild(d)}; pui.loadCSS=function(c){if(pui.Fd(c)!=null)return false;var a=document.getElementsByTagName("head")[0],d=document.createElement("link");d.setAttribute("rel","stylesheet");d.setAttribute("type","text/css");d.setAttribute("media","screen");d.setAttribute("href",pui.rb(c));a.appendChild(d);return true}; pui.removeCSS=function(c){var a=document.getElementsByTagName("head")[0],d=pui.Fd(c);if(d==null){d=a.getElementsByTagName("style");for(var e=0;e<d.length;e++){var f=d[e];if(f.innerHTML==c||f.styleSheet!=null&&f.styleSheet.cssText==c){a.removeChild(f);return true}}return false}else{a.removeChild(d);return true}}; pui.loadJS=function(c){if(c==null)return null;var a,d,e,f;if(typeof c=="string")a=c;if(typeof c=="object"){a=c.path;d=c.callback;e=c.onerror;f=c.test;if(f!=null&&typeof f=="function"&&f()==true)return false}if(a==null)return null;if(pui.Ye(pui.rb(a))!=null)return false;c=document.getElementsByTagName("head")[0];var g=false,h=document.createElement("script");h.type="text/javascript";h.onreadystatechange=function(){if(h.readyState=="complete"||h.readyState=="loaded")if(!(f!=null&&typeof f=="function"&& f()!=true)){!g&&d!=null&&d();g=true}};h.onload=function(){if(!(f!=null&&typeof f=="function"&&f()!=true)){!g&&d!=null&&d();g=true}};if(e)h.onerror=e;h.src=pui.rb(a);c.appendChild(h);return true}; pui.endOfSession=function(c){pui.ad=false;pui.ie=false;if(window.puiMobileClient!=null){window.location.href="index.html";c!=null&&pui.alert(c)}else{var a=O().gobackto;if(a!=null){document.body.innerHTML="";c!=null&&pui.alert(c);location.href=a}if(navigator.app!=null&&navigator.app.exitApp!=null){document.body.innerHTML="";c!=null?pui.alert(c,function(){navigator.app.exitApp()}):navigator.app.exitApp()}}}; pui.addUrlCacheBuster=function(c,a){var d=Date.now();if(typeof a==="string"&&a.toLowerCase()!=="get")return c;if(/[&?]r=[^&]+/.test(c))c=c.replace(/([&?]r=)[^&]+/,function(f,g){return g+d});else{var e=c.indexOf("?")==-1?"?":"&";c=c+e+"r="+d}return c}; pui.alert=function(c,a,d,e){if(window.cordova&&window.device.platform=="iOS"&&a==null&&d==null&&e==null)window.alert(c);else if(window.navigator!=null&&window.navigator.notification!=null&&window.navigator.notification.alert!=null)if(a==null&&d==null&&e==null&&window.puiMobileClient!=null&&window.puiMobileClient.alert!=null)window.puiMobileClient.alert(c);else{if(a==null)a=function(){};if(d==null)d="Profound UI";if(e==null)e="OK";window.navigator.notification.alert(c,a,d,e)}else pui.bf&&window.parent&& window.parent!=window&&pui.we(window.parent)&&window.parent.Qd?console.log("Suppressed alert: "+c):alert(c)};pui.applyProperty=function(c,a,d){return window.applyProperty(c,a,d)};pui.get=function(c){return L(ba(c,void 0))}; pui.set=function(c,a){var d;d=typeof c=="object"?c:document.getElementById(c);if(d!=null){if(d.tagName=="DIV")if(d.xc!=null)d.xc.setValue(a);else if(d.ta!=null)d.ta.setValue(a);else if(d.va!=null)d.va.setValue(a);else if(d.button&&d.button.oe)d.button.oe.innerHTML=a;else if(d.z&&d.z.Bb)applyProperty(d,"value",a);else d.innerHTML=a;else if(d.tagName=="INPUT"||d.tagName=="SELECT"||d.tagName=="TEXTAREA")if(d.tagName=="INPUT"&&d.type=="checkbox")d.checked=typeof a=="boolean"?a:d.$a!=null&&a==d.$a?true: false;else{context=="genie"&&a!=d.value&&pui.j.ff(d);d.value=a;if(d.Wa!=null)d.Wa.value=a}if(context=="dspf"||pui.se&&d.eb==null){d.modified=true;pui.xf(d);var e=d.zf;if(d.id!=null&&d.id.indexOf(".")==-1&&d.od!=null)pui.Le[d.od]=true;if(e!=null){e.hide();e.Qe=true;pui.kf(d,e.Ue())}}if(context=="genie"&&d.eb!=null&&d.eb.idx!=null)pui.response[d.eb.idx]=d;pui.Ge(d);if(d.z&&d.z.Ia)d.z.Ia.value=a}}; pui.getActiveContainer=function(){if(context=="genie"){for(var c=1,a=document.getElementById("window"+c);a;){var d=document.getElementById("window"+ ++c);if(d)a=d;else break}if(a)return a}else if(context=="dspf"&&pui.Md)return pui.Md;return pui.qc};pui.getDisplayType=function(){return pui.se?"5250-handler":context=="dspf"?"rdf":"5250"}; function Q(c){function a(){if(!(l>=i.length)){o=i[l].command;p=i[l].wait;l+=1;if(typeof pui.onPCCommand=="function")try{var q=pui.onPCCommand(o,p);if(q==null||q==true){setTimeout(a,0);return}}catch(u){showFailureMessage(o)}m="?cmd="+encodeURIComponent(o)+"&wait="+(p?"1":"0");if(h==1||h==2)if(j){r.params.cmd=o;r.params.sign=1;r.params.hashalg=typeof pui["pccmd hash sign algorithm"]==="string"?pui["pccmd hash sign algorithm"].toUpperCase():"SHA-512";r.handler=f;K(r)}else d("");else if(h==3){r.params.cmd= o;r.handler=e;K(r)}else{if(l==0&&i.length>0){q=[];for(var x=0;x<i.length;x++)q.push("("+i[x].Je+")");o=q.join(" && ")}try{k.runCommand(o)}catch(z){q='Unable to execute "'+o+'".\n\n';if(z!=null)q+=z.name+":\n\n"+z.message+".";alert(q)}}}}function d(q){if(h==2){var u=new Image;u.onload=a;u.onerror=function(){console.log("PC Command Listener image mode failure.");g(o)};u.src=n+m+"&type=image&rnd="+String(Math.random())+String((new Date).getTime())+q}else{q=new pui.Ajax(n+m+q);q.method="GET";q.async= p?false:true;q.suppressAlert=true;q.onfail=function(z){if(z.X()!=200){console.log("PC Command Listener comm. failure: "+z.ib());g(o)}};q.onsuccess=function(z){try{var D=JSON.parse(z.W());if(!D.success&&typeof D.error==="string"){console.log("PC Command Listener failure.",D.error);g(o);return}}catch(C){}a()};try{q.send()}catch(x){console.log("PC Command Listener failure.",x);g(o)}}}function e(q,u){try{if(u)throw u;if(q==null)throw Error("Empty response from PCCMD crypt program.");if(q.error!=null|| typeof q.error==="string"&&q.error.length>0)throw Error("PCCMD crypt error: "+String(q.error));if(typeof q.cmd!=="string"||q.cmd.length==0)throw Error("PCCMD crypt response was missing a command.");var x="puilaunch:"+encodeURIComponent(q.cmd),z=document.createElement("iframe");z.style.display="none";z.src=x;document.body.appendChild(z);setTimeout(function(){z!=null&&z.parentNode!=null&&document.body.removeChild(z);z=null;a()},5E3)}catch(D){console.log(D)}}function f(q,u){try{if(u)throw u;if(typeof q!== "object"||q===null)throw Error("Empty response");if(q.success!==true)throw typeof q.error==="string"&&q.error.length>0?q.error:"Unknown error";var x="";if(typeof q.sig==="string"&&q.sig.length>0)x="&sig="+encodeURIComponent(q.sig);d(x)}catch(z){console.log(z);g(o)}}function g(q){console.log("Command: "+q);q=pui.getLanguageText("runtimeMsg","pccommand error");pui["alert pccommand errors"]!==false?alert(q):console.log(q);console.log("Visit https://docs.profoundlogic.com/x/aQFK for more information on supporting STRPCCMD.")} var h=1,j=false;if(pui["use pc listener"])h=1;if(window.HTTPS!=null&&window.HTTPS=="ON"&&h==1)h=2;if(pui["pc listener mode"])h=parseInt(pui["pc listener mode"]);if(typeof pui["pc command mode"]=="string")switch(pui["pc command mode"]){case "applet":h=0;break;case "listener":case "listener_m1":h=1;break;case "listener_m1s":h=1;j=true;break;case "listener_m2":h=2;break;case "listener_m2s":h=2;j=true;break;case "launcher":h=3;break;default:h=1;console.log("Unsupported pc command mode:",pui["pc command mode"])}if(h== 0){var k=document.getElementById("PCCommandApplet");if(!k){pui.Lb=c;aa("runCommandCb");return}}var i=[],l=0;i=typeof c=="string"?[{command:c,wait:false}]:c;c=parseInt(pui["pc listener port"],10);if(isNaN(c))c="80";var n="http://localhost:"+c+"/",m="",o,p,r={url:M("PUI0009117.pgm"),method:"post",params:{auth:pui.appJob&&pui.appJob.auth?pui.appJob.auth:""},async:true};a()}window.runCommandCb=function(){Q(pui.Lb);pui.Lb=null};pui.runPCCommand=Q; pui.isServerBusy=function(){if(typeof context=="undefined")return false;if(context=="dspf"&&pui.xb===false||context=="genie"&&pui.j.Fa===true)return true;for(var c=document.getElementsByTagName("iframe"),a=0;a<c.length;a++){var d=c[a].contentWindow;if(d!=null){var e=null;try{e=d.z}catch(f){}if(e!=null)if(typeof e==="object")if(typeof e.isServerBusy==="function")if(e.isServerBusy())return true}}return false}; pui.showLastError=function(){if(errors.length==0)alert("No errors have been reported.");else{var c=errors.length-1;alert("Operation: "+errors[c].gf+"\nId: "+errors[c].id+"\n\nMessage: "+errors[c].text+"\n"+errors[c].vf)}}; pui.editCode=function(c,a){function d(A,y){var s=["","","","nn/n","nn/nn","nn/nn/n","nn/nn/nn","nnn/nn/nn","nn/nn/nnnn","nnn/nn/nnnn"];if(j.dateEdit==="*ymd"){s[8]="nnnn/nn/nn";s[9]="nnnnn/nn/nn"}s=s[D];A=String(A);A=A.replace(".","");A=A.replace(",","");A=A.replace("-","");A="0000000000"+A;A=A.substr(A.length-y);var t="/";if(j.dateEditSeparator!=null)t=j.dateEditSeparator;for(var w=false,v=0,B="",E=0;E<s.length;E++){var F=s.substr(E,1),H=s.substr(E+1,1);if(F==="/"||H==="/")w=true;if(F==="/")F=t; else{F=A.substr(v,1);v+=1;if(F==="0")w||(F=" ");else w=true}B+=F}return B}function e(A,y,s){for(A+="";A.length<y;)A+=s;return A}var f=null,g=0,h=null,j={},k=2;if(typeof arguments[k]==="number"){f=arguments[k];k++;if(typeof arguments[k]==="number"){g=arguments[k];k++}}if(typeof arguments[k]==="string"){h=arguments[k];k++}if(typeof arguments[k]==="object"){j=arguments[k];k++}var i=false;if(h==="*astfill"){i=true;h=null}var l=false,n=null,m=false,o=k=false;k=" ";if(pui.ea&&typeof pui.ea.decimalFormat=== "string")k=pui.ea.decimalFormat;var p=k==="I"||k==="J",r=k==="J";if(j.decimalEdit!=null){p=j.decimalEdit===","||j.decimalEdit==="0,";r=j.decimalEdit==="0."||j.decimalEdit==="0,"}if(a>="1"&&a<="4")n="999.00";if(a>="A"&&a<="D")n="999.00CR";if(a>="J"&&a<="M")n="999.00-";if(a>="N"&&a<="Q")n="-999.00";if(a=="1"||a=="A"||a=="J"||a=="N"||a=="2"||a=="B"||a=="K"||a=="O")m=true;k=a=="1"||a=="A"||a=="J"||a=="N"||a=="3"||a=="C"||a=="L"||a=="P"?true:false;if(a=="Z")n="999.00";if(a==="X"||a==="Z")o=true;if(a=== "X")l=true;a>="5"&&a<="9"&&pui.alert("User-defined edit code not supported: "+a+".");a>="1"&&a<="9"||a>="A"&&a<="D"||a>="J"&&a<="Q"||a>="X"&&a<="Z"||pui.alert("Invalid edit code: "+a+".");var q=(c||0)+"",u=parseFloat(q,10)||0,x;x=q.replace(/\..*/,"");if(x==="-0")x="-";if((x==""||x=="-")&&r)x="0";var z;z=q;if(z.indexOf(".")==-1)z+=".";z=z.replace(/.*\./,"");var D=x.length;if(D<3)D=3;var C=z.length;if(typeof f==="number")D=f;if(typeof g==="number")C=g;if(a=="Y"){if(D<3||D>9)pui.alert("Length not valid for edit code Y."); return d(u,D)}f=".";if(p)f=",";if(o)f="";if(C>0){z=e(z,C,"0");if(x==="0"&&!r)x="";q=x+f+z}var J=" ";if(l)J="0";if(i)J="*";if(m){for(g=/(\d+)(\d{3})/;g.test(x);)x=x.replace(g,"$1"+(p?".":",")+"$2");q=x+(C>0?f+z:"")}p=u<0;q=q.replace(/-/g,"");if(n==="(999.00)"){if(p)q="("+q+")"}else if(n==="999.00-")q+=p?"-":" ";else if(n==="999.00CR")q+=p?"CR":" ";else if(n==="-999.00")if(p)q="-"+q;if(h)q=h=="EUR"?q+" EUR":h=="$"?q.substr(0,1)=="-"?"-"+h+q.substr(1):h+q:h+q;if(!k)if(u===0)q="";(function(){var A=D; A+=C&&!o?1:0;if(m)A+=parseInt((D-C-1)/3);if(n==="999.00CR")A+=2;if(n==="999.00-")A+=1;if(n==="-999.00")A+=1;if(typeof h==="string")A+=h.length;var y=q;for(y+="";y.length<A;)y=J+y;q=y})();return q}; pui.editWord=function(c,a,d){function e(){if(r.length>0){var x=r.substr(r.length-1,1);r=r.substr(0,r.length-1);if(x=="0"&&r.length==0&&u)x=q?"*":" "}else{x="0";if(u)x=" ";if(q)x="*"}return x}var f,g;c=String(c);var h={};if(typeof d==="object")h=d;d="$";if(h.currencySymbol!=null)d=h.currencySymbol;var j=a.indexOf("0")+1,k=a.indexOf("*")+1;if(j==0||k!=0&&k<j)j=k;var i=-1;for(f=a.length-1;f>=0;f-=1)if(f+1==j||a.substr(f,1)==" "){i=f;break}k=a.substr(0,i+1);var l="",n="",m=false,o=false,p=a.substr(i+ 1).indexOf("-")>=0||a.substr(i+1).indexOf("CR")>=0;for(f=i+1;f<a.length;f++){g=a.substr(f,1);if(a.substr(f,2)=="CR"){o=true;f++}else if(g=="-")o=true;else if(g!="&")if(!(g=="*"&&!o))if(g.toUpperCase()>="A"&&g.toUpperCase()<="Z"&&p&&!o)a=a.substr(0,f)+" "+a.substr(f+1);else{l=a.substring(i+1,f);n=a.substr(f);m=true;break}}m||(l=a.substr(i+1));g=".";f=" ";if(pui.ea&&typeof pui.ea.decimalFormat==="string")f=pui.ea.decimalFormat;if(typeof h.decimalFormat==="string")f=h.decimalFormat;if(f==="I"||f==="J")g= ",";f=0;g=k.split(g);if(g.length>1)f=g[1].replace(/[^ ]/g,"").length;var r;r=isNaN(Number(c))?"0":String(c);r=r.replace("-","");g=r.split(".");h=g[0];a="";i=null;if(g.length>1)a=g[1];if(i==null||isNaN(i))i=f;for(;a.length>i;)a=a.substr(0,a.length-1);for(;i>a.length;)a+="0";for(r=h+a;r.substr(0,1)=="0";)r=r.substr(1);h="";var q=i=false;var u=a=false;if(j==0)u=true;for(f=k.length-1;f>=0;f-=1){m=g=k.substr(f,1);if(g==" ")m=e();else if(g=="&")m=" ";else if(g=="0"&&f+1==j)m=e();else if(g=="*"){q=true; m=e()}else if(g==d){if(f+2==j){m=e();a=true}}else if(i){m=" ";if(q)m="*"}h=m+h;if(f<=j)u=true;if(u&&r.length==0)i=true}l=l.replace(/&/g," ");l=l.replace(/\*/g," ");if(c>=0){l=l.replace("CR"," ");l=l.replace("-"," ")}h=h+l+n;c=h.length-1;h=ca(h);if(q&&h.substr(0,1)!="*")h="*"+h;if(a)h=d+h;d=0;if(h[h.length-1]==="-")d=1;for(;h.length<=c;)h=" "+h;return h}; pui.getRadioGroupValue=function(c){if(typeof c!=="string")return null;if(typeof pui.oc!=="object")return null;for(var a=null,d=pui.Me,e=d.length-1;e>=0;e--){var f=d[e].toUpperCase()+"."+c.toUpperCase();if(typeof pui.oc[f]!=="undefined"){a=pui.oc[f];break}}if(a==null)return null;c=null;for(d=0;d<a.length;d++){e=a[d];if(e.checked&&e.radioValue!=null){c=e.radioValue;break}}return c};pui.ke=function(){for(var c=document.getElementById("auth-form"),a=document.cookie.split("; "),d=false,e=0;e<a.length;e++){var f=a[e].split("=");if(unescape(f[0])=="pui-signon-"+c.action)if(unescape(f[1])=="1"){d=true;break}}if(typeof Storage!="undefined"){a=O();if(a.workstnid)sessionStorage["atrium-params-workstnid"]=a.workstnid;else try{delete sessionStorage["atrium-params-workstnid"]}catch(g){}if(a.suffixid)sessionStorage["atrium-params-suffixid"]=a.suffixid;else try{delete sessionStorage["atrium-params-suffixid"]}catch(h){}if(a.duplicateid)sessionStorage["atrium-params-duplicateid"]= a.duplicateid;else try{delete sessionStorage["atrium-params-duplicateid"]}catch(j){}}if(d)location.href=c.action;else{if(d=document.getElementById("auth-box"))d.style.display="";c.elements["auth-user"].focus()}}; pui.je=function(){var c=document.getElementById("auth-form"),a=c.elements["auth-user"].value,d=c.elements["auth-password"].value,e=document.getElementById("auth-message"),f={"server unavailable":"The server could not be reached at {connectorURL}.<br>Please check your network connection and try again.","error authenticating":"An error occurred while authenticating the user."},g="";e.innerHTML="";if(L(a)==""){e.innerHTML=authMessages["user required"];c.elements["auth-user"].focus();return false}else if(L(d)== ""){e.innerHTML=authMessages["password required"];c.elements["auth-password"].focus();return false}if(pui.pjsServer){var h="Basic "+btoa(L(a)+":"+L(d));fetch("/profoundui/atrium/authenticate",{method:"POST",headers:{Authorization:h}}).then(function(j){if(j.ok){document.cookie=escape("pui-signon-"+c.action)+"=1; path=/";sessionStorage.setItem("atrium-token",btoa(L(a)+":"+L(d)));location.href=c.action}else if(j.status===401){e.innerHTML=authMessages["invalid credentials"];c.elements["auth-user"].focus()}else if(j.status=== 503)j.json().then(function(k){g=authMessages["server unavailable"]||f["server unavailable"];e.innerHTML=g.replace(/{connectorURL}/,k.sf);c.elements["auth-user"].focus()});else{g=authMessages["error authenticating"]||f["error authenticating"];e.innerHTML=g;c.elements["auth-user"].focus()}})["catch"](function(j){g=authMessages["error authenticating"]||f["error authenticating"];e.innerHTML=g;c.elements["auth-user"].focus();console.error("Error during Atrium authentication:",j)});return false}pui.ma(function(){localStorage["pui-http-auth-invalid"]&& delete localStorage["pui-http-auth-invalid"];var j=new pui.Ajax("/profoundui/pui0005010.pgm");j.async=true;j.method="POST";pui.setReqAuth(j,a,d);j.suppressAlert=true;j.onready=function(k){if(k.X()==200){var i=eval("("+k.W()+")");k=i.days;var l=false;if(i.warn==true)if(k==0){i=authMessages["password expired"];pui.alert(i);l=true}else{i=authMessages["password pending expiration"];i=i.replace(/{DAYS}/g,k);l=confirm(i)}if(l){k="/profoundui/changepass";k+="?user="+encodeURIComponent(a);k+="&next="+encodeURIComponent(c.action); k+="&back="+encodeURIComponent(location.href);location.href=k}else{document.cookie=escape("pui-signon-"+c.action)+"=1; path=/";location.href=c.action}}else{e.innerHTML=authMessages["invalid credentials"];c.elements["auth-user"].focus()}};j.send()});return false}; pui.ma=function(c){if(S.pjsServer){sessionStorage.removeItem("atrium-token");c()}else{var a=new pui.Ajax("/profoundui/pui0005010.pgm");a.async=typeof c==="function"?true:false;a.method="POST";pui.setReqAuth(a,"PUI_SIGNOFF_USER","PUI_SIGNOFF_USER");a.suppressAlert=true;if(typeof c==="function")a.onready=function(){typeof c=="function"&&c()};a.send()}};window.pui.signOn=pui.je;window.pui.clearCredentials=pui.ma;window.pui.signOnInit=pui.ke; pui.Wd=function(){var c=O(),a=document.getElementById("change-user"),d=document.getElementById("change-current"),e=a,f=document.getElementById("change-cancel");if(typeof c.user!="undefined"){a.value=c.user.toUpperCase();a.readOnly=true;a.className+=" read-only";e=d}if(typeof c.back=="undefined")f.style.display="none";document.getElementById("change-box").style.display="block";e.focus()};pui.Vd=function(){var c=O();if(typeof c.back!="undefined")location.href=c.back}; pui.Xc=function(){if(!S.pjsServer){var c=O(),a=document.getElementById("change-form"),d=a.elements["change-user"].value,e=a.elements["change-current"].value,f=a.elements["change-new"].value,g=a.elements["change-confirm"].value,h=document.getElementById("change-message");h.innerHTML="";if(L(d)==""){h.innerHTML=passMessages["user required"];a.elements["change-user"].focus();return false}else if(L(e)==""){h.innerHTML=passMessages["current required"];a.elements["change-current"].focus();return false}else if(L(f)== ""){h.innerHTML=passMessages["new required"];a.elements["change-new"].focus();return false}else if(L(g)==""){h.innerHTML=passMessages["confirm required"];a.elements["change-confirm"].focus();return false}else if(f!=g){h.innerHTML=passMessages["must match"];a.elements["change-new"].focus();return false}g=new pui.Ajax("/profoundui/pui0005011.pgm");g.async=true;g.method="POST";g.params={};g.params.user=d;g.params.current=e;g.params["new"]=f;g.suppressAlert=true;g.onready=function(j){if(j.X()!=200){h.innerHTML= "HTTP "+j.X()+" - "+j.jb()+".";a.elements["change-user"].focus()}else{var k;try{k=eval("("+j.W()+")");if(typeof k.success!="boolean")throw Error("Invalid response format: 'success' is not a boolean.");if(!k.success&&typeof k.error!="string")throw Error("Invalid response format: 'error' is not a string.");}catch(i){k={};k.success=false;k.error="The server response is missing or invalid."}if(k.success==false){h.innerHTML=k.error;a.elements["change-user"].focus()}else{pui.alert(passMessages.success); pui.ma(function(){var l=new pui.Ajax("/profoundui/pui0005010.pgm");l.async=true;l.method="POST";pui.setReqAuth(l,d,f);l.suppressAlert=true;l.onready=function(n){if(n.X()==200){if(typeof c.next!="undefined")location.href=c.next}else{pui.alert("HTTP "+n.X()+" - "+n.jb()+".");a.elements["change-user"].focus()}};l.send()})}}};g.send();return false}}; pui.setReqAuth=function(c,a,d){var e=navigator.userAgent.indexOf("Edge")!=-1,f=!e&&navigator.userAgent.indexOf("Chrome")!=-1;e=!e&&navigator.userAgent.indexOf("Safari")!=-1&&!f;var g=navigator.userAgent.indexOf("Firefox")!=-1;if(e||f||g){c.user=encodeURIComponent(a);c.password=encodeURIComponent(d)}else{c.user=a;c.password=d}};window.pui.passInit=pui.Wd;window.pui.passCancel=pui.Vd;window.pui.changePass=pui.Xc;function T(c){var a={};switch(c){case "runtimeMsg":a.closeMessage="This will end your session.";a["no connection message"]="Unable to reach server. Check your connection and try again.";a["upload file limit"]="Limit of &1 file(s) exceeded.";a["upload size limit"]="Limit of &1MB per file exceeded";a["upload no files"]="No files selected.";a["upload duplicate file"]="Duplicate files selected.";a["upload file exists"]="One or more files already exist on the file system.";a["upload prevented"]="Operation prevented by exit program."; a["upload input limit"]="Total input size limit exceeded.";a["upload no session"]="Not connected to a valid session.";a["upload timeout"]="Transaction timed out.";a["upload invalid response"]="The server response is missing or invalid.";a["upload cancelled"]="Upload canceled.";a["close browser text"]="To complete the log off process, please close your browser window.";a["session ended text"]="Your session has ended.";a["outside ucs2"]="Characters are outside of UCS-2 range.";a["invalid number"]="&1 is not a valid number."; a["invalid length"]="&1 has an incorrect data length or decimal position.";a["invalid decimal"]="&1 has too many decimal places. (max: &2)";a["invalid choice"]='"&1" is invalid. Valid choices are: "&2" or "&3".';a["invalid date"]='"&1" is not a valid date. Example format: &2';a["invalid time"]='"&1" is not a valid time. Example format: &2';a["invalid time stamp"]='"&1" is not a valid time stamp. Example format: &2';a["invalid percent"]="&1 is not a valid decimal.";a["invalid digits"]='"&1" contains too many digits. Max: &2'; a["exceeds whole"]='"&1" exceeds the maximum number of digits for the whole number portion (&2 digits).';a["exceeds decimal"]='"&1" exceeds the maximum number of digits for the decimal portion (&2 digits).';a["zip too long"]="Zip code is too long. (Maximum: &1 digits)";a["phone too long"]="Phone number is too long. (Maximum: &1 digits)";a["ssno too long"]="Social security number is too long. (Maximum: &1 digits)";a["invalid custom val"]="Invalid custom validation function.";a["error custom val"]= "Error in custom validation function.";a.ME="Mandatory entry field. You must enter data.";a.MF="Mandatory fill field. You must fill the input box completely.";a.required="The value cannot be blank. This field is required.";a["file required"]="You must select at least one file.";a["signature overflow"]="The signature drawing size exceeds the maximum number of bytes available for storing the signature. Please clear the signature pad and try again.";a.validValues="Value entered is not valid. Valid values are: "; a.blank="blank";a.or="or";a["upload invalid type"]="One or more files are of invalid type.";a["invalid email"]="Invalid email address.";a["session timed out"]="Your session has timed out.";a["invalid low range"]="Value must be greater than or equal to &1.";a["invalid high range"]="Value must be less than or equal to &1.";a["invalid range"]="Valid range is &1 to &2.";a["unmonitored exception"]="The program has encountered an unmonitored exception. Please contact the system administrator for assistance."; a["loading x"]="Loading &1...";a["data