diff --git a/javascript/build.xml b/javascript/build.xml index e5939e332..f00dbfc76 100644 --- a/javascript/build.xml +++ b/javascript/build.xml @@ -13,50 +13,48 @@ value="${basedir}/../../python-gflags" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -95,40 +93,44 @@ - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + diff --git a/javascript/i18n/phonenumbers/demo-compiled.js b/javascript/i18n/phonenumbers/demo-compiled.js index 36effb437..699a2b16f 100644 --- a/javascript/i18n/phonenumbers/demo-compiled.js +++ b/javascript/i18n/phonenumbers/demo-compiled.js @@ -3,10 +3,107 @@ Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ -var aa=this||self;function ba(a){a.fa=void 0;a.ea=function(){return a.fa?a.fa:a.fa=new a}}function k(a,b){function c(){}c.prototype=b.prototype;a.ga=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.qa=function(d,e,f){for(var g=Array(arguments.length-2),h=2;hc?Math.max(0,a.length+c):c;if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,c);for(;cb?1:aa.h&&(a.h++,b.next=a.g,a.g=b)};function ya(){this.h=this.g=null}ya.prototype.add=function(a,b){var c=za.get();c.set(a,b);this.h?this.h.next=c:this.g=c;this.h=c};function Aa(){var a=Ba,b=null;a.g&&(b=a.g,a.g=a.g.next,a.g||(a.h=null),b.next=null);return b}var za=new wa(function(){return new Ea},function(a){return a.reset()});function Ea(){this.next=this.g=this.h=null}Ea.prototype.set=function(a,b){this.h=a;this.g=b;this.next=null};Ea.prototype.reset=function(){this.next=this.g=this.h=null};var Fa=Array.prototype.indexOf?function(a,b,c){return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,c);for(;cb?1:ab?1:0};var Pa;a:{var Qa=p.navigator;if(Qa){var Ra=Qa.userAgent;if(Ra){Pa=Ra;break a}}Pa=""}function u(a){return-1!=Pa.indexOf(a)};function Sa(a,b,c){for(var d in a)b.call(c,a[d],d,a)}function Ta(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function Xa(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function Ya(a,b){a:{for(var c in a)if(b.call(void 0,a[c],c,a)){b=c;break a}b=void 0}return b&&a[b]};function Za(a,b){this.g=b===$a?a:""}Za.prototype.h=!0;Za.prototype.toString=function(){return this.g.toString()};var ab=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,$a={};function bb(a){return String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()})};function cb(a,b){var c=db;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var eb=u("Opera"),fb=u("Trident")||u("MSIE"),gb=u("Edge"),hb=u("Gecko")&&!(-1!=Pa.toLowerCase().indexOf("webkit")&&!u("Edge"))&&!(u("Trident")||u("MSIE"))&&!u("Edge"),ib=-1!=Pa.toLowerCase().indexOf("webkit")&&!u("Edge"),jb; +a:{var kb="",lb=function(){var a=Pa;if(hb)return/rv:([^\);]+)(\)|;)/.exec(a);if(gb)return/Edge\/([\d\.]+)/.exec(a);if(fb)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(ib)return/WebKit\/(\S+)/.exec(a);if(eb)return/(?:Version)[ \/]?(\S+)/.exec(a)}();lb&&(kb=lb?lb[1]:"");if(fb){var mb,nb=p.document;mb=nb?nb.documentMode:void 0;if(null!=mb&&mb>parseFloat(kb)){jb=String(mb);break a}}jb=kb}var db={}; +function ob(a){return cb(a,function(){for(var b=0,c=Na(String(jb)).split("."),d=Na(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f))(?: \[as ([a-zA-Z_$][\w$]*)\])?)? (?:\(unknown source\)|\(native\)|\((.+)\)|(.+))$/,hc=/^([a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*)?(\(.*\))?@(?::0|((?:http|https|file):\/\/[^\s)]+|javascript:.*))$/,ic=/^(?:(?:([a-zA-Z_$][\w$]*)|)(\(.*\)))?@((?:http|https|file):\/\/[^\s)]+|javascript:.*)?$/,jc= +/^function ([a-zA-Z_$][\w$]*)/,kc=/^ at ([a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*(?:\s+\w+)*)\s*\((eval code:[^)]*|Unknown script code:[^)]*|((?:http|https|file):\/\/[^\s)]+|javascript:.*))\)?$/;function sc(){for(var a=[],b=arguments.callee.caller,c=0;b&&20>c;){var d=Function.prototype.toString.call(b).match(jc);a.push(new ec("",d?d[1]:"","",""));try{b=b.caller}catch(e){break}c++}return a} +function tc(a){var b=a.match(gc);return b?new ec(b[1]||"",b[2]||"",b[3]||"",b[4]||b[5]||b[6]||""):5E5/g,">").replace(/"/g,""")} +function wc(){var a=Error();if(a.stack)return a.stack;try{null.x()}catch(b){return b.stack}return""}r("setDeobfuscateFunctionName",function(a){dc=a});function xc(a,b){this.Wa=!0;this.message=(a||"")+(a&&b?"\n":"")+(b||"");if(a=wc())if(Array.isArray(a)){for(var c=[],d=0;d ");if(a[f]){e=d;g=e.push;var h=a[f],k=[h.h?vc(h.h)+".":"",h.g?vc(uc(h.g)):"anonymous",h.i?" [as "+vc(uc(h.i))+"]":""];h.j&&(k.push(" at "),k.push(vc(h.j)));g.call(e,k.join(""))}else d.push("(unknown)");d.push("\n")}this.g=b||"";Error.captureStackTrace?Error.captureStackTrace(this,xc):this.stack=Error().stack||""}t(xc,Error);xc.prototype.toString=function(){return this.message||this.g};function yc(a,b){return a==b}function zc(a,b){return a.toString()===b.toString()}var Ac="String Boolean Number Array RegExp Date Function".split(" ");"function"===typeof ArrayBuffer&&Ac.push("ArrayBuffer");var Bc={String:yc,Number:yc,Bigint:yc,Boolean:yc,Date:function(a,b){return a.getTime()==b.getTime()},RegExp:zc,Function:zc};function Cc(a,b,c){return Math.abs(a-b)<=c}var Dc={Number:Cc}; +function Ec(a){var b=typeof a;try{switch(b){case "object":if(null==a){b="null";break}case "function":for(var c=!1,d=0;d"}catch(c){b=""}null!==a&&void 0!==a&&(b+=" ("+Ec(a)+")");return b} +function Fc(a){y("Call to fail()",!1,a)}function A(a,b){return b.length==a+1?b[0]:null}function D(a,b,c){return c.length==b+1?c[a]:c[a-1]}function E(a,b){b.length==a||b.length==a+1&&"string"===typeof b[0]||Gc("Incorrect arguments passed to assert function.\nExpected "+a+" argument(s) plus optional comment; got "+b.length+".")} +function Hc(){if(!Ic)return p.console&&p.console.error("Missing goog.testing.TestCase, add /* @suppress {extraRequire} */goog.require('goog.testing.TestCase'"),null;var a=p.G_testRunner;return a&&a.o?a.o:Jc}function y(a,b,c){var d="undefined"!==typeof window&&window["Closure assert adapter"];if(d&&(d.assertWithMessage(b,(a||"")+(a&&c?"\n":"")+(c||"")),!b))throw Error("goog.testing assertion failed");b||Gc(a,c)} +function F(a,b){var c=x(a),d=x(b);c=["Expected",c,"but was",d].join(40d&&(f=0);if(2a?"0"+a:String(a)} +function vd(a,b,c){if(!(c&&c.isJsUnitException&&c.loggedJsUnitException)){var d=Ed(a,b,c);a.g.u.push(d);b in a.g.g?a.g.g[b].push(d):a.g.g[b]=[d];c&&c.isJsUnitException&&(c.loggedJsUnitException=!0)}} +function Ed(a,b,c){c&&a.log(c);c=Wb(c);var d;if(d=c.stack){d=d.replace("Error: "+c.message+"\n","Error\n");for(var e=0;ef)break;e=d.indexOf("Caused by:",f);e=0>e?d.length:e;d=d.substring(0,f+1)+d.substring(e)}}else d=void 0;b=new Fd(b,c.message,d);gd(a,b.toString()); +return b}function Cd(a,b,c,d){this.name=a;this.m=b||function(){};this.j=c||null;this.h=[];this.g=[];this.i=d||[];if(d){for(a=0;a>>0)+"-"+window.location.pathname.replace(/.*\//,"").replace(/\.html.*$/,"");if(!fb||ob(11)){var a=this;window.addEventListener("pagehide",function(){a.s="pagehide"})}}m=Md.prototype;m.Ta=function(){return this.s};m.Fa=function(a){if(this.o&&this.o.ea)throw Error("The test runner is already waiting for a test to complete");this.o=a;this.h=!0};m.$a=function(a){this.m=a};m.Va=function(){return this.h}; +m.Ua=function(){return 0 "==d.substr(0,2)?h.innerHTML=d:h.appendChild(document.createTextNode(d));if(d=/(\S+) (\[[^\]]*] )?: (FAILED|ERROR|PASSED)/.exec(d)){d="runTests="+d[1];var k=window.location.search;if(k){var l=/runTests=([^&]*)/.exec(k);d=l?k.substr(0,l.index)+ +d+k.substr(l.index+l[0].length):k+"&"+d}else d="?"+d;l=window.location.href;(k=window.location.hash)&&"#"!=k.charAt(0)&&(k="#"+k);l=l.split("#")[0].split("?")[0]+d+k;d=qb("A");d.textContent="(run individually)";d.style.fontSize="0.8em";d.style.color="#888";k=d;a:{try{var n=k&&k.ownerDocument,v=n&&(n.defaultView||n.parentWindow);v=v||p;if(v.Element&&v.Location){var z=v;break a}}catch(I){}z=null}if(z&&"undefined"!=typeof z.HTMLAnchorElement&&(!k||!(k instanceof z.HTMLAnchorElement)&&(k instanceof z.Location|| +k instanceof z.Element))){var C=k;if(pa(C))try{var M=C.constructor.displayName||C.constructor.name||Object.prototype.toString.call(C)}catch(I){M=""}else M=void 0===C?"undefined":null===C?"null":typeof C;va("Argument is not a %s (or a non-Element, non-Location mock); got: %s","HTMLAnchorElement",M)}l instanceof Za||l instanceof Za||(l="object"==typeof l&&l.h?l.g.toString():String(l),ab.test(l)||(l="about:invalid#zClosurez"),l=new Za(l,$a));l instanceof Za&&l.constructor=== +Za?l=l.g:(va("expected object of type SafeUrl, got '"+l+"' of type "+na(l)),l="type_error:SafeUrl");k.href=l;h.appendChild(document.createTextNode(" "));h.appendChild(d)}h.style.color=f;h.style.font="normal 100% monospace";h.style.wordWrap="break-word";0==c&&(h.style.padding="20px",h.style.marginBottom="10px",e?(h.style.border="1px solid "+f,h.style.backgroundColor="#eeffee"):g?(h.style.border="5px solid "+f,h.style.backgroundColor="#ffeeee"):(h.style.border="1px solid black",h.style.backgroundColor= +"#eeeeee"));try{h.style.whiteSpace="pre-wrap"}catch(I){}2>c&&(h.style.fontWeight="bold");a.i.appendChild(h)}}m.log=function(a){this.o&&this.o.log(a)};m.Pa=function(){return this.o?qd(this.o):null};m.Sa=function(){if(this.o){var a=qd(this.o);if(0a.length?!1:L(Va,a)}function cb(a){return L(Sa,a)?M(a,La):M(a,I)}function db(a){var b=cb(a.toString());n(a);a.a(b)}function eb(a){return null!=a&&(1!=A(a,9)||-1!=y(a,9)[0])} -function M(a,b){for(var c=new l,d,e=a.length,f=0;f=e?c=b:(d=d.substring(0,e),d=M(d,I),0==d.length?c=b:(g=g.clone(),za(g,4),d=[g],g=z(a,1),b=P(a),g in E?(c=R(c,g,S(g)),e=nb(d,b),null!=e&&(d=e.clone(),e=z(e,4),0b?2:f[f.length-1]=e&&e<=d;++e)if(c=parseInt(a.substring(0,e),10),c in E)return b.a(a.substring(e)),c;return 0} -function zb(a,b,c,d,e,f){if(0==b.length)return 0;b=new l(b);var g;null!=c&&(g=w(c,11));null==g&&(g="NonMatch");var h=b.toString();if(0==h.length)g=20;else if(J.test(h))h=h.replace(J,""),n(b),b.a(cb(h)),g=1;else{h=new RegExp(g);db(b);g=b.toString();if(0==g.search(h)){h=g.match(h)[0].length;var m=g.substring(h).match(Oa);m&&null!=m[1]&&0=b.b.length)throw Error("Phone number too short after IDD"); -a=yb(b,d);if(0!=a)return x(f,1,a),a;throw Error("Invalid country calling code");}if(null!=c&&(g=z(c,10),h=""+g,m=b.toString(),0==m.lastIndexOf(h,0)&&(h=new l(m.substring(h.length)),m=w(c,1),m=new RegExp(z(m,2)),Ab(h,c,null),h=h.toString(),!L(m,b.toString())&&L(m,h)||3==wb(a,b.toString(),c,-1))))return d.a(h),e&&x(f,6,10),x(f,1,g),g;x(f,1,0);return 0} -function Ab(a,b,c){var d=a.toString(),e=d.length,f=w(b,15);if(0!=e&&null!=f&&0!=f.length){var g=new RegExp("^(?:"+f+")");if(e=g.exec(d)){f=new RegExp(z(w(b,1),2));var h=L(f,d),m=e.length-1;b=w(b,16);if(null==b||0==b.length||null==e[m]||0==e[m].length){if(!h||L(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 l,e=new l(b.toString()),Ab(e,g,c),a=wb(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(17a.length?!1:V(df,a)}function lf(a){return V($e,a)?mf(a,Se):mf(a,Qe)}function nf(a){var b=lf(a.toString());S(a);a.g(b)}function of(a){return null!=a&&(1!=Q(a,9)||-1!=N(a,9)[0])}function mf(a,b){for(var c=new R,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 U)return b.g(a.substring(e)),c;return 0} +function Jf(a,b,c,d,e,f){if(0==b.length)return 0;b=new R(b);var g;null!=c&&(g=K(c,11));null==g&&(g="NonMatch");var h=b.toString();if(0==h.length)g=20;else if(Ve.test(h))h=h.replace(Ve,""),S(b),b.g(lf(h)),g=1;else{h=new RegExp(g);nf(b);g=b.toString();if(0==g.search(h)){h=g.match(h)[0].length;var k=g.substring(h).match(We);k&&null!=k[1]&&0=b.h.length)throw Error("Phone number too short after IDD"); +a=If(b,d);if(0!=a)return L(f,1,a),a;throw Error("Invalid country calling code");}if(null!=c&&(g=P(c,10),h=""+g,k=b.toString(),0==k.lastIndexOf(h,0)&&(h=new R(k.substring(h.length)),k=K(c,1),k=new RegExp(P(k,2)),Kf(h,c,null),h=h.toString(),!V(k,b.toString())&&V(k,h)||3==Gf(a,b.toString(),c,-1))))return d.g(h),e&&L(f,6,10),L(f,1,g),g;L(f,1,0);return 0} +function Kf(a,b,c){var d=a.toString(),e=d.length,f=K(b,15);if(0!=e&&null!=f&&0!=f.length){var g=new RegExp("^(?:"+f+")");if(e=g.exec(d)){f=new RegExp(P(K(b,1),2));var h=V(f,d),k=e.length-1;b=K(b,16);if(null==b||0==b.length||null==e[k]||0==e[k].length){if(!h||V(f,d.substring(e[0].length)))null!=c&&0b.h.length)throw Error("The string supplied is too short to be a phone number");null!=g&&(c=new R,e=new R(b.toString()),Kf(e,g,c),a=Gf(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=De)O=Wa;else if(Ha=Ha.substring(0,De),Ha=mf(Ha,Qe),0==Ha.length)O=Wa;else{var Ee=oc.clone();ge(Ee,4);Ua=[Ee];var tb=P(f,1),ub=X(f);if(tb in U){var Fe=sf(n,tb,tf(tb)),pc=zf(Ua,ub);if(null==pc)var Ge= +ub;else{var qc=pc.clone(),vb=P(pc,4);if(0