Current File : /home/pacjaorg/.trash/media.1/system/js/fields/validate.min.js
(function(){"use strict";const A="-",R=/^xn--/,N=/[^\0-\x7F]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,V={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=35,d=Math.floor,L=String.fromCharCode;function b(o){throw new RangeError(V[o])}function q(o,t){const e=[];let s=o.length;for(;s--;)e[s]=t(o[s]);return e}function I(o,t){const e=o.split("@");let s="";e.length>1&&(s=e[0]+"@",o=e[1]),o=o.replace(y,".");const i=o.split("."),a=q(i,t).join(".");return s+a}function m(o){const t=[];let e=0;const s=o.length;for(;e<s;){const i=o.charCodeAt(e++);if(i>=55296&&i<=56319&&e<s){const a=o.charCodeAt(e++);(a&64512)==56320?t.push(((i&1023)<<10)+(a&1023)+65536):(t.push(i),e--)}else t.push(i)}return t}const T=o=>String.fromCodePoint(...o),J=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:36},C=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},M=function(t,e,s){let i=0;for(t=s?d(t/700):t>>1,t+=d(t/e);t>v*26>>1;i+=36)t=d(t/v);return d(i+(v+1)*t/(t+38))},k=function(t){const e=[],s=t.length;let i=0,a=128,r=72,n=t.lastIndexOf(A);n<0&&(n=0);for(let c=0;c<n;++c)t.charCodeAt(c)>=128&&b("not-basic"),e.push(t.charCodeAt(c));for(let c=n>0?n+1:0;c<s;){const l=i;for(let u=1,f=36;;f+=36){c>=s&&b("invalid-input");const h=J(t.charCodeAt(c++));h>=36&&b("invalid-input"),h>d((2147483647-i)/u)&&b("overflow"),i+=h*u;const p=f<=r?1:f>=r+26?26:f-r;if(h<p)break;const x=36-p;u>d(2147483647/x)&&b("overflow"),u*=x}const g=e.length+1;r=M(i-l,g,l==0),d(i/g)>2147483647-a&&b("overflow"),a+=d(i/g),i%=g,e.splice(i++,0,a)}return String.fromCodePoint(...e)},E=function(t){const e=[];t=m(t);const s=t.length;let i=128,a=0,r=72;for(const l of t)l<128&&e.push(L(l));const n=e.length;let c=n;for(n&&e.push(A);c<s;){let l=2147483647;for(const u of t)u>=i&&u<l&&(l=u);const g=c+1;l-i>d((2147483647-a)/g)&&b("overflow"),a+=(l-i)*g,i=l;for(const u of t)if(u<i&&++a>2147483647&&b("overflow"),u===i){let f=a;for(let h=36;;h+=36){const p=h<=r?1:h>=r+26?26:h-r;if(f<p)break;const x=f-p,_=36-p;e.push(L(C(p+x%_,0))),f=d(x/_)}e.push(L(C(f,0))),r=M(a,g,c===n),a=0,++c}++a,++i}return e.join("")},w={version:"2.3.1",ucs2:{decode:m,encode:T},decode:k,encode:E,toASCII:function(t){return I(t,function(e){return N.test(e)?"xn--"+E(e):e})},toUnicode:function(t){return I(t,function(e){return R.test(e)?k(e.slice(4).toLowerCase()):e})}};/**
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */class F{constructor(){this.customValidators={},this.handlers=[],this.handlers={},this.removeMarking=this.removeMarking.bind(this),this.inputEmail=()=>{const t=document.createElement("input");return t.setAttribute("type","email"),t.type!=="text"},this.setHandler("username",t=>!/[<|>|"|'|%|;|(|)|&]/i.test(t)),this.setHandler("password",t=>/^\S[\S ]{2,98}\S$/.test(t)),this.setHandler("numeric",t=>/^(\d|-)?(\d|,)*\.?\d*$/.test(t)),this.setHandler("email",t=>{const e=w.toASCII(t);return/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(e)}),document.querySelectorAll("form").forEach(t=>{t.classList.contains("form-validate")&&this.attachToForm(t)})}get custom(){return this.customValidators}set custom(t){this.customValidators=t}setHandler(t,e,s){const i=s===""?!0:s;this.handlers[t]={enabled:i,exec:e}}markValid(t){const e=t.form.querySelector(`label[for="${t.id}"]`);let s;(t.classList.contains("required")||t.getAttribute("required"))&&e&&(s=e.querySelector("span.form-control-feedback")),t.classList.remove("form-control-danger","invalid"),t.classList.add("form-control-success"),t.parentNode.classList.remove("has-danger"),t.parentNode.classList.add("has-success"),t.setAttribute("aria-invalid","false"),s&&s.parentNode.removeChild(s),e&&e.classList.remove("invalid")}markInvalid(t,e){const s=t.form.querySelector(`label[for="${t.id}"]`);t.classList.remove("form-control-success","valid"),t.classList.add("form-control-danger","invalid"),t.parentNode.classList.remove("has-success"),t.parentNode.classList.add("has-danger"),t.setAttribute("aria-invalid","true");let i;const a=t.getAttribute("data-validation-text");if(s&&(i=s.querySelector("span.form-control-feedback")),!i){const r=document.createElement("span");r.classList.add("form-control-feedback"),e&&e==="checkbox"?r.innerHTML=a!==null?Joomla.sanitizeHtml(a):Joomla.sanitizeHtml(Joomla.Text._("JLIB_FORM_FIELD_REQUIRED_CHECK")):e&&e==="value"?r.innerHTML=a!==null?Joomla.sanitizeHtml(a):Joomla.sanitizeHtml(Joomla.Text._("JLIB_FORM_FIELD_REQUIRED_VALUE")):r.innerHTML=a!==null?Joomla.sanitizeHtml(a):Joomla.sanitizeHtml(Joomla.Text._("JLIB_FORM_FIELD_INVALID_VALUE")),s&&s.appendChild(r)}s&&s.classList.add("invalid")}removeMarking(t){let e;const s=t.form.querySelector(`label[for="${t.id}"]`);s&&(e=s.querySelector("span.form-control-feedback")),t.classList.remove("form-control-danger","form-control-success","remove"),t.classList.add("valid"),t.parentNode.classList.remove("has-danger","has-success"),e&&s&&s.removeChild(e),s&&s.classList.remove("invalid")}handleResponse(t,e,s){const i=e.tagName.toLowerCase();(i!=="button"&&e.value!==void 0||i==="fieldset")&&(t===!1?this.markInvalid(e,s):this.markValid(e))}validate(t){let e;if(t.getAttribute("disabled")==="disabled"||t.getAttribute("display")==="none")return this.handleResponse(!0,t),!0;if(t.getAttribute("required")||t.classList.contains("required"))if(e=t.tagName.toLowerCase(),e==="fieldset"&&(t.classList.contains("radio")||t.classList.contains("checkboxes"))){if(t.querySelector("input:checked")===null)return this.handleResponse(!1,t,"checkbox"),!1}else{if(t.getAttribute("type")==="checkbox"&&t.checked!==!0||e==="select"&&!t.value.length)return this.handleResponse(!1,t,"checkbox"),!1;if(!t.value||t.classList.contains("placeholder"))return this.handleResponse(!1,t,"value"),!1}const s=t.getAttribute("class")&&t.getAttribute("class").match(/validate-([a-zA-Z0-9_-]+)/)?t.getAttribute("class").match(/validate-([a-zA-Z0-9_-]+)/)[1]:"";if(t.getAttribute("pattern")&&t.getAttribute("pattern")!==""){if(t.value.length){const i=new RegExp(`^${t.getAttribute("pattern")}$`).test(t.value);return this.handleResponse(i,t,"empty"),i}return t.hasAttribute("required")||t.classList.contains("required")?(this.handleResponse(!1,t,"empty"),!1):(this.handleResponse(!0,t),!0)}return s===""?(this.handleResponse(!0,t),!0):s&&s!=="none"&&this.handlers[s]&&t.value&&this.handlers[s].exec(t.value,t)!==!0?(this.handleResponse(!1,t,"invalid_value"),!1):(this.handleResponse(!0,t),!0)}isValid(t){let e=!0,s,i,a;const r=[];return t.nodeName==="FORM"?a=[].slice.call(t.elements):a=t.querySelectorAll("input, textarea, select, button, fieldset"),a.forEach(n=>{this.validate(n)===!1&&(e=!1,r.push(n))}),Object.keys(this.customValidators).length&&Object.keys(this.customValidators).foreach(n=>{this.customValidators[n].exec()!==!0&&(e=!1)}),!e&&r.length>0&&(t.getAttribute("data-validation-text")?s=t.getAttribute("data-validation-text"):s=Joomla.Text._("JLIB_FORM_CONTAINS_INVALID_FIELDS"),i={error:[s]},Joomla.renderMessages(i)),e}attachToForm(t){let e;t.nodeName==="FORM"?e=[].slice.call(t.elements):e=t.querySelectorAll("input, textarea, select, button, fieldset"),e.forEach(s=>{const i=s.tagName.toLowerCase();["input","textarea","select","fieldset"].indexOf(i)>-1&&s.classList.contains("required")&&s.setAttribute("required",""),(i==="input"||i==="button")&&(s.getAttribute("type")==="submit"||s.getAttribute("type")==="image")?s.classList.contains("validate")&&s.addEventListener("click",()=>this.isValid(t)):i!=="button"&&!(i==="input"&&s.getAttribute("type")==="button")&&i!=="fieldset"&&(s.addEventListener("blur",({target:a})=>this.validate(a)),s.addEventListener("focus",({target:a})=>this.removeMarking(a)),s.classList.contains("validate-email")&&this.inputEmail&&s.setAttribute("type","email"))})}}const S=()=>{document.formvalidator=new F,document.removeEventListener("DOMContentLoaded",S)};document.addEventListener("DOMContentLoaded",S),window.JFormValidator=F,window.punycode=w})();
Site is undergoing maintenance

PACJA Events

Maintenance mode is on

Site will be available soon. Thank you for your patience!