META-INF.resources.primefaces-extensions.inputphone.utils.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of primefaces-extensions Show documentation
Show all versions of primefaces-extensions Show documentation
PrimeFaces Extensions components and utilities for PrimeFaces.
(function(){/*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
*/
var aa=this||self;function k(a,b){a=a.split(".");var c=aa;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b}function m(a,b){function c(){}c.prototype=b.prototype;a.ma=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.sa=function(d,e,f){for(var g=Array(arguments.length-2),h=2;ha.length?!1:N(Ja,a)}function Na(a){return N(Ea,a)?O(a,ya):O(a,K)}function Oa(a){var b=Na(a.toString());C(a);a.g(b)}function Pa(a){return null!=a&&(1!=w(a,9)||-1!=t(a,9)[0])}function O(a,b){for(var c=new B,d,e=a.length,f=0;fb?2:f[f.length-1]=e&&e<=d;++e)if(c=parseInt(a.substring(0,e),10),c in I)return b.g(a.substring(e)),c;return 0}
function Xa(a,b,c,d,e,f){if(0==b.length)return 0;b=new B(b);var g;null!=c&&(g=q(c,11));null==g&&(g="NonMatch");var h=b.toString();if(0==h.length)g=20;else if(L.test(h))h=h.replace(L,""),C(b),b.g(Na(h)),g=1;else{h=new RegExp(g);Oa(b);g=b.toString();if(0==g.search(h)){h=g.match(h)[0].length;var l=g.substring(h).match(Aa);l&&null!=l[1]&&0=b.h.length)throw Error("Phone number too short after IDD");
a=Wa(b,d);if(0!=a)return r(f,1,a),a;throw Error("Invalid country calling code");}if(null!=c&&(g=v(c,10),h=""+g,l=b.toString(),0==l.lastIndexOf(h,0)&&(h=new B(l.substring(h.length)),l=q(c,1),l=new RegExp(v(l,2)),Ya(h,c,null),h=h.toString(),!N(l,b.toString())&&N(l,h)||3==W(a,b.toString(),c,-1))))return d.g(h),e&&r(f,6,10),r(f,1,g),g;r(f,1,0);return 0}
function Ya(a,b,c){var d=a.toString(),e=d.length,f=q(b,15);if(0!=e&&null!=f&&0!=f.length){var g=new RegExp("^(?:"+f+")");if(e=g.exec(d)){f=new RegExp(v(q(b,1),2));var h=N(f,d),l=e.length-1;b=q(b,16);if(null==b||0==b.length||null==e[l]||0==e[l].length){if(!h||N(f,d.substring(e[0].length)))null!=c&&0=b.length)f="";else{var g=b.indexOf(";",f);f=-1!==g?b.substring(f,g):b.substring(f)}var h=f;null==h?g=!0:0===h.length?g=!1:(g=Fa.exec(h),h=Ga.exec(h),g=null!==g||null!==h);if(!g)throw Error("The string supplied did not seem to be a phone number");
null!=f?("+"===f.charAt(0)&&e.g(f),f=b.indexOf("tel:"),e.g(b.substring(0<=f?f+4:0,b.indexOf(";phone-context=")))):(f=e.g,g=b??"",h=g.search(Ba),0<=h?(g=g.substring(h),g=g.replace(Da,""),h=g.search(Ca),0<=h&&(g=g.substring(0,h))):g="",f.call(e,g));f=e.toString();g=f.indexOf(";isub=");0b.h.length)throw Error("The string supplied is too short to be a phone number");null!=g&&(c=new B,e=new B(b.toString()),Ya(e,g,c),a=W(a,e.toString(),g,-1),2!=a&&4!=a&&5!=a&&(b=e,d&&0a)throw Error("The string supplied is too short to be a phone number");if(17{try{const c=a.replace(/[^+0-9]/g,""),d=new $a(b);let e="";for(let f=0;f{try{const e=J.g(),f=Y(e,a,b);var d=X(e,f,-1);return 0==d||4==d?Ra(e,f,"undefined"===typeof c?0:c):a}catch(e){return a}});
k("intlTelInputUtils.getExampleNumber",(a,b,c)=>{try{const h=J.g();a:{var d=h;if(P(a)){var e=U(T(d,a),c);try{if(p(e,6)){var f=q(e,6);var g=Za(d,f,a,!1);break a}}catch(l){}}g=null}return Ra(h,g,b?2:1)}catch(h){return""}});k("intlTelInputUtils.getExtension",(a,b)=>{try{return q(Y(J.g(),a,b),3)}catch(c){return""}});k("intlTelInputUtils.getNumberType",(a,b)=>{try{const h=J.g();var c=Y(h,a,b);a=h;var d=Ua(a,c),e=R(a,v(c,1),d);if(null==e)var f=-1;else{var g=Q(c);f=Ta(g,e)}return f}catch(h){return-99}});
k("intlTelInputUtils.getValidationError",(a,b)=>{try{const c=J.g(),d=Y(c,a,b);return X(c,d,-1)}catch(c){return"Invalid country calling code"===c.message?1:3>=a.length||"Phone number too short after IDD"===c.message||"The string supplied is too short to be a phone number"===c.message?2:"The string supplied is too long to be a phone number"===c.message?3:-99}});
k("intlTelInputUtils.isValidNumber",(a,b)=>{try{const l=J.g();var c=Y(l,a,b);a=l;var d=Ua(a,c);var e=v(c,1),f=R(a,e,d);if(null==f||"001"!=d&&e!=Va(a,d))var g=!1;else{var h=Q(c);g=-1!=Ta(h,f)}return g}catch(l){return!1}});k("intlTelInputUtils.isPossibleNumber",(a,b,c)=>{try{const d=J.g(),e=Y(d,a,b);if(c)return 0===X(d,e,1);const f=0===X(d,e,-1);a=!0;const g=q(e,2).toString();"gb"===b&&"7"===g.charAt(0)&&(a=10===g.length);return f&&a}catch(d){return!1}});
k("intlTelInputUtils.numberFormat",{E164:0,INTERNATIONAL:1,NATIONAL:2,RFC3966:3});k("intlTelInputUtils.numberType",{FIXED_LINE:0,MOBILE:1,FIXED_LINE_OR_MOBILE:2,TOLL_FREE:3,PREMIUM_RATE:4,SHARED_COST:5,VOIP:6,PERSONAL_NUMBER:7,PAGER:8,UAN:9,VOICEMAIL:10,UNKNOWN:-1});k("intlTelInputUtils.validationError",{IS_POSSIBLE:0,INVALID_COUNTRY_CODE:1,TOO_SHORT:2,TOO_LONG:3,IS_POSSIBLE_LOCAL_ONLY:4,INVALID_LENGTH:5});})();