diff --git a/bower.json b/bower.json index b99640a..7ed8e34 100644 --- a/bower.json +++ b/bower.json @@ -27,9 +27,9 @@ "src" ], "devDependencies": { - "closure-library": "git@github.com:google/closure-library.git#eb26f425dbd99a70d2955d8fcc892f2fd0178acb", + "closure-library": "git@github.com:google/closure-library.git#78f06b00b393d0007e0da3ba51d1bc18c8b659a1", "closure-compiler": "http://dl.google.com/closure-compiler/compiler-latest.tar.gz", - "libphonenumber": "git@github.com:googlei18n/libphonenumber.git#libphonenumber-7.0.6" + "libphonenumber": "git@github.com:googlei18n/libphonenumber.git#v8.9.10" }, "keywords": [ "phone", diff --git a/dist/i18n.phonenumbers.min.js b/dist/i18n.phonenumbers.min.js index 82fa05b..a26edc9 100644 --- a/dist/i18n.phonenumbers.min.js +++ b/dist/i18n.phonenumbers.min.js @@ -1,409 +1,420 @@ -(function(){'use strict';var aa=this;function k(a){return"string"==typeof a}function l(a,b){var c=a.split("."),d=aa;c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(var f;c.length&&(f=c.shift());)c.length||void 0===b?d[f]?d=d[f]:d=d[f]={}:d[f]=b}function n(a,b){function c(){}c.prototype=b.prototype;a.ja=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.oa=function(a,c,e){for(var g=Array(arguments.length-2),h=2;hc?Math.max(0,a.length+c):c;if(k(a))return k(b)&&1==b.length?a.indexOf(b,c):-1;for(;cb?1:aa.length?!1:M(Ja,a)}function Ra(a){return M(Ha,a)?N(a,Aa):N(a,K)}function Sa(a){var b=Ra(a.toString());r(a);a.a(b)}function Ta(){return da(Object.keys(ba),function(a){return isNaN(a)})} -function N(a,b){for(var c=new q,d,f=a.length,e=0;e=e&&e<=f;++e)if(d=parseInt(c.substring(0,e),10),d in p)return b.a(c.substring(e)),d;return 0} -function lb(a,b,c,d,f){if(0==a.length)return 0;a=new q(a);var e;null!=b&&(e=z(b,11));null==e&&(e="NonMatch");var g=a.toString();if(0==g.length)e=20;else if(L.test(g))g=g.replace(L,""),r(a),a.a(Ra(g)),e=1;else{g=new RegExp(e);Sa(a);e=a.toString();if(0==e.search(g)){var g=e.match(g)[0].length,h=e.substring(g).match(Da);h&&null!=h[1]&&0=a.b.length)throw"Phone number too short after IDD";c= -kb(a,c);if(0!=c)return y(f,1,c),c;throw"Invalid country calling code";}if(null!=b&&(e=A(b,10),g=""+e,h=a.toString(),0==h.lastIndexOf(g,0))){var m=new q(h.substring(g.length)),h=z(b,1),g=new RegExp(A(h,2));mb(m,b,null);b=m.toString();h=A(h,3);if(!M(g,a.toString())&&M(g,b)||3==hb(h,a.toString()))return c.a(b),d&&y(f,6,10),y(f,1,e),e}y(f,1,0);return 0} -function mb(a,b,c){var d=a.toString(),f=d.length,e=z(b,15);if(0!=f&&null!=e&&0!=e.length&&(e=new RegExp("^(?:"+e+")"),f=e.exec(d))){var g=RegExp,h;h=z(b,1);h=A(h,2);g=new g(h);h=M(g,d);var m=f.length-1;b=z(b,16);if(null==b||0==b.length||null==f[m]||0==f[m].length){if(!h||M(g,d.substring(f[0].length)))null!=c&&0g.b.length)throw"The string supplied is too short to be a phone number";null!=b&&(a=new q,c=new q(g.toString()),mb(c,b,a),ib(b,c.toString())||(g=c,d&&y(e,7,a.toString())));d=g.toString();a=d.length;if(2>a)throw"The string supplied is too short to be a phone number";if(17=g){f=d;break}e=e.substring(0,g);e=N(e,K);if(0==e.length){f=d;break}h=h.clone();C(h,4);e=[h];h=A(c,1);d=R(c);h in p?(f=T(f,h,U(h)),g="",g=Za(e,d),null==g?g=d:(e=g.clone(),g=A(g,4),0c?Math.max(0,a.length+c):c;if(k(a))return k(b)&&1==b.length?a.indexOf(b,c):-1;for(;cb?1:aa.length?!1:M(Na,a)}function Va(a){return M(La,a)?N(a,Ea):N(a,J)}function Wa(a){var b=Va(a.toString());H(a);a.a(b)}function Xa(){return ca(Object.keys(ba),function(a){return isNaN(a)})}function Ya(a){return null!=a&&(1!=z(a,9)||-1!=w(a,9)[0])} +function N(a,b){for(var c=new G,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 p)return b.a(a.substring(e)),c;return 0} +function pb(a,b,c,d,e,f){if(0==b.length)return 0;b=new G(b);var g;null!=c&&(g=u(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,""),H(b),b.a(Va(h)),g=1;else{h=new RegExp(g);Wa(b);g=b.toString();if(0==g.search(h)){h=g.match(h)[0].length;var m=g.substring(h).match(Ha);m&&null!=m[1]&&0=b.b.length)throw Error("Phone number too short after IDD"); +a=ob(b,d);if(0!=a)return v(f,1,a),a;throw Error("Invalid country calling code");}if(null!=c&&(g=y(c,10),h=""+g,m=b.toString(),0==m.lastIndexOf(h,0)&&(h=new G(m.substring(h.length)),m=u(c,1),m=new RegExp(y(m,2)),qb(h,c,null),h=h.toString(),!M(m,b.toString())&&M(m,h)||3==W(a,b.toString(),c,-1))))return d.a(h),e&&v(f,6,10),v(f,1,g),g;v(f,1,0);return 0} +function qb(a,b,c){var d=a.toString(),e=d.length,f=u(b,15);if(0!=e&&null!=f&&0!=f.length){var g=new RegExp("^(?:"+f+")");if(e=g.exec(d)){f=new RegExp(y(u(b,1),2));var h=M(f,d),m=e.length-1;b=u(b,16);if(null==b||0==b.length||null==e[m]||0==e[m].length){if(!h||M(f,d.substring(e[0].length)))null!=c&&0b.b.length)throw Error("The string supplied is too short to be a phone number");null!=g&&(c=new G,e=new G(b.toString()),qb(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=e?b=c:(d=d.substring(0,e),d=N(d,J),0==d.length?b=c:(g=g.clone(),A(g,4),d=[g],g=y(a,1),c=Q(a),g in p?(b=S(b,g,T(g)),e=eb(d,c),null!=e&&(d=e.clone(),e=y(e,4),0c?Math.max(0,a.length+c):c;if(k(a))return k(b)&&1==b.length?a.indexOf(b,c):-1;for(;cb?1:aa.length?!1:M(Ja,a)}function Ra(a){return M(Ha,a)?N(a,Aa):N(a,K)}function Sa(a){var b=Ra(a.toString());F(a);a.a(b)}function Ta(){return da(Object.keys(ba),function(a){return isNaN(a)})} -function N(a,b){for(var c=new E,d,f=a.length,e=0;e=e&&e<=f;++e)if(d=parseInt(c.substring(0,e),10),d in p)return b.a(c.substring(e)),d;return 0} -function lb(a,b,c,d,f){if(0==a.length)return 0;a=new E(a);var e;null!=b&&(e=x(b,11));null==e&&(e="NonMatch");var g=a.toString();if(0==g.length)e=20;else if(L.test(g))g=g.replace(L,""),F(a),a.a(Ra(g)),e=1;else{g=new RegExp(e);Sa(a);e=a.toString();if(0==e.search(g)){var g=e.match(g)[0].length,h=e.substring(g).match(Da);h&&null!=h[1]&&0=a.b.length)throw"Phone number too short after IDD";c= -kb(a,c);if(0!=c)return w(f,1,c),c;throw"Invalid country calling code";}if(null!=b&&(e=y(b,10),g=""+e,h=a.toString(),0==h.lastIndexOf(g,0))){var m=new E(h.substring(g.length)),h=x(b,1),g=new RegExp(y(h,2));mb(m,b,null);b=m.toString();h=y(h,3);if(!M(g,a.toString())&&M(g,b)||3==hb(h,a.toString()))return c.a(b),d&&w(f,6,10),w(f,1,e),e}w(f,1,0);return 0} -function mb(a,b,c){var d=a.toString(),f=d.length,e=x(b,15);if(0!=f&&null!=e&&0!=e.length&&(e=new RegExp("^(?:"+e+")"),f=e.exec(d))){var g=RegExp,h;h=x(b,1);h=y(h,2);g=new g(h);h=M(g,d);var m=f.length-1;b=x(b,16);if(null==b||0==b.length||null==f[m]||0==f[m].length){if(!h||M(g,d.substring(f[0].length)))null!=c&&0g.b.length)throw"The string supplied is too short to be a phone number";null!=b&&(a=new E,c=new E(g.toString()),mb(c,b,a),ib(b,c.toString())||(g=c,d&&w(e,7,a.toString())));d=g.toString();a=d.length;if(2>a)throw"The string supplied is too short to be a phone number";if(17=g){f=d;break}e=e.substring(0,g);e=N(e,K);if(0==e.length){f=d;break}h=h.clone();A(h,4);e=[h];h=y(c,1);d=R(c);h in p?(f=T(f,h,U(h)),g="",g=Za(e,d),null==g?g=d:(e=g.clone(),g=y(g,4),0c?Math.max(0,a.length+c):c;if(k(a))return k(b)&&1==b.length?a.indexOf(b,c):-1;for(;cb?1:aa.length?!1:M(Na,a)}function Va(a){return M(La,a)?N(a,Ea):N(a,J)}function Wa(a){var b=Va(a.toString());G(a);a.a(b)}function Xa(){return ca(Object.keys(ba),function(a){return isNaN(a)})}function Ya(a){return null!=a&&(1!=z(a,9)||-1!=w(a,9)[0])} +function N(a,b){for(var c=new F,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 p)return b.a(a.substring(e)),c;return 0} +function pb(a,b,c,d,e,f){if(0==b.length)return 0;b=new F(b);var g;null!=c&&(g=u(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,""),G(b),b.a(Va(h)),g=1;else{h=new RegExp(g);Wa(b);g=b.toString();if(0==g.search(h)){h=g.match(h)[0].length;var m=g.substring(h).match(Ha);m&&null!=m[1]&&0=b.b.length)throw Error("Phone number too short after IDD"); +a=ob(b,d);if(0!=a)return v(f,1,a),a;throw Error("Invalid country calling code");}if(null!=c&&(g=y(c,10),h=""+g,m=b.toString(),0==m.lastIndexOf(h,0)&&(h=new F(m.substring(h.length)),m=u(c,1),m=new RegExp(y(m,2)),qb(h,c,null),h=h.toString(),!M(m,b.toString())&&M(m,h)||3==W(a,b.toString(),c,-1))))return d.a(h),e&&v(f,6,10),v(f,1,g),g;v(f,1,0);return 0} +function qb(a,b,c){var d=a.toString(),e=d.length,f=u(b,15);if(0!=e&&null!=f&&0!=f.length){var g=new RegExp("^(?:"+f+")");if(e=g.exec(d)){f=new RegExp(y(u(b,1),2));var h=M(f,d),m=e.length-1;b=u(b,16);if(null==b||0==b.length||null==e[m]||0==e[m].length){if(!h||M(f,d.substring(e[0].length)))null!=c&&0b.b.length)throw Error("The string supplied is too short to be a phone number");null!=g&&(c=new F,e=new F(b.toString()),qb(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=e?b=c:(d=d.substring(0,e),d=N(d,J),0==d.length?b=c:(g=g.clone(),A(g,4),d=[g],g=y(a,1),c=Q(a),g in p?(b=S(b,g,T(g)),e=eb(d,c),null!=e&&(d=e.clone(),e=y(e,4),0