51 lines
14 KiB
JavaScript
51 lines
14 KiB
JavaScript
!function(){function n(n,l){var t=n.split("."),e=U;t[0]in e||!e.execScript||e.execScript("var "+t[0]);for(var u;t.length&&(u=t.shift());)t.length||void 0===l?e=e[u]?e[u]:e[u]={}:e[u]=l}function l(n,l){function t(){}t.prototype=l.prototype,n.M=l.prototype,n.prototype=new t,n.prototype.constructor=n,n.N=function(n,t,e){for(var u=Array(arguments.length-2),r=2;r<arguments.length;r++)u[r-2]=arguments[r];return l.prototype[t].apply(n,u)}}function t(n,l){null!=n&&this.a.apply(this,arguments)}function e(n){n.b=""}function u(n,l){n.sort(l||r)}function r(n,l){return n>l?1:n<l?-1:0}function i(n){var l,t=[],e=0;for(l in n)t[e++]=n[l];return t}function a(n,l){this.b=n,this.a={};for(var t=0;t<l.length;t++){var e=l[t];this.a[e.b]=e}}function o(n){return n=i(n.a),u(n,function(n,l){return n.b-l.b}),n}function s(n,l){switch(this.b=n,this.g=!!l.v,this.a=l.c,this.i=l.type,this.h=!1,this.a){case J:case K:case L:case O:case Z:case k:case Y:this.h=!0}this.f=l.defaultValue}function f(){this.a={},this.f=this.j().a,this.b=this.g=null}function p(n,l){for(var t=o(n.j()),e=0;e<t.length;e++){var u=t[e],r=u.b;if(null!=l.a[r]){n.b&&delete n.b[u.b];var i=11==u.a||10==u.a;if(u.g)for(var u=c(l,r)||[],a=0;a<u.length;a++){var s=n,f=r,h=i?u[a].clone():u[a];s.a[f]||(s.a[f]=[]),s.a[f].push(h),s.b&&delete s.b[f]}else u=c(l,r),i?(i=c(n,r))?p(i,u):b(n,r,u.clone()):b(n,r,u)}}}function c(n,l){var t=n.a[l];if(null==t)return null;if(n.g){if(!(l in n.b)){var e=n.g,u=n.f[l];if(null!=t)if(u.g){for(var r=[],i=0;i<t.length;i++)r[i]=e.b(u,t[i]);t=r}else t=e.b(u,t);return n.b[l]=t}return n.b[l]}return t}function h(n,l,t){var e=c(n,l);return n.f[l].g?e[t||0]:e}function g(n,l){var t;if(null!=n.a[l])t=h(n,l,void 0);else n:{if(t=n.f[l],void 0===t.f){var e=t.i;if(e===Boolean)t.f=!1;else if(e===Number)t.f=0;else{if(e!==String){t=new e;break n}t.f=t.h?"0":""}}t=t.f}return t}function m(n,l){return n.f[l].g?null!=n.a[l]?n.a[l].length:0:null!=n.a[l]?1:0}function b(n,l,t){n.a[l]=t,n.b&&(n.b[l]=t)}function y(n,l){var t,e=[];for(t in l)0!=t&&e.push(new s(t,l[t]));return new a(n,e)}/*
|
||
|
||
Protocol Buffer 2 Copyright 2008 Google Inc.
|
||
All other code copyright its respective owners.
|
||
Copyright (C) 2010 The Libphonenumber Authors
|
||
|
||
Licensed under the Apache License, Version 2.0 (the "License");
|
||
you may not use this file except in compliance with the License.
|
||
You may obtain a copy of the License at
|
||
|
||
http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
Unless required by applicable law or agreed to in writing, software
|
||
distributed under the License is distributed on an "AS IS" BASIS,
|
||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
See the License for the specific language governing permissions and
|
||
limitations under the License.
|
||
*/
|
||
function v(){f.call(this)}function d(){f.call(this)}function _(){f.call(this)}function S(){}function w(){}function x(){}/*
|
||
|
||
Copyright (C) 2010 The Libphonenumber Authors.
|
||
|
||
Licensed under the Apache License, Version 2.0 (the "License");
|
||
you may not use this file except in compliance with the License.
|
||
You may obtain a copy of the License at
|
||
|
||
http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
Unless required by applicable law or agreed to in writing, software
|
||
distributed under the License is distributed on an "AS IS" BASIS,
|
||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
See the License for the specific language governing permissions and
|
||
limitations under the License.
|
||
*/
|
||
function $(){this.a={}}function A(n){return 0==n.length||rn.test(n)}function N(n,l){if(null==l)return null;l=l.toUpperCase();var t=n.a[l];if(null==t){if(t=ln[l],null==t)return null;t=(new x).a(_.j(),t),n.a[l]=t}return t}function E(n){return n=nn[n],null==n?"ZZ":n[0]}function j(n){this.H=RegExp(" "),this.C="",this.m=new t,this.w="",this.i=new t,this.u=new t,this.l=!0,this.A=this.o=this.F=!1,this.G=$.b(),this.s=0,this.b=new t,this.B=!1,this.h="",this.a=new t,this.f=[],this.D=n,this.J=this.g=B(this,this.D)}function B(n,l){var t;if(null!=l&&isNaN(l)&&l.toUpperCase()in ln){if(t=N(n.G,l),null==t)throw Error("Invalid region code: "+l);t=g(t,10)}else t=0;return t=N(n.G,E(t)),null!=t?t:an}function R(n){for(var l=n.f.length,t=0;t<l;++t){var u=n.f[t],r=g(u,1);if(n.w==r)return!1;var i;i=n;var a=u,o=g(a,1);if(-1!=o.indexOf("|"))i=!1;else{o=o.replace(on,"\\d"),o=o.replace(sn,"\\d"),e(i.m);var s;s=i;var a=g(a,2),f="999999999999999".match(o)[0];f.length<s.a.b.length?s="":(s=f.replace(new RegExp(o,"g"),a),s=s.replace(RegExp("9","g")," ")),0<s.length?(i.m.a(s),i=!0):i=!1}if(i)return n.w=r,n.B=pn.test(h(u,4)),n.s=0,!0}return n.l=!1}function F(n,l){for(var t=[],e=l.length-3,u=n.f.length,r=0;r<u;++r){var i=n.f[r];0==m(i,3)?t.push(n.f[r]):(i=h(i,3,Math.min(e,m(i,3)-1)),0==l.search(i)&&t.push(n.f[r]))}n.f=t}function C(n,l){n.i.a(l);var t=l;if(un.test(t)||1==n.i.b.length&&en.test(t)){var u,t=l;"+"==t?(u=t,n.u.a(t)):(u=tn[t],n.u.a(u),n.a.a(u)),l=u}else n.l=!1,n.F=!0;if(!n.l){if(!n.F)if(P(n)){if(q(n))return I(n)}else if(0<n.h.length&&(t=n.a.toString(),e(n.a),n.a.a(n.h),n.a.a(t),t=n.b.toString(),u=t.lastIndexOf(n.h),e(n.b),n.b.a(t.substring(0,u))),n.h!=G(n))return n.b.a(" "),I(n);return n.i.toString()}switch(n.u.b.length){case 0:case 1:case 2:return n.i.toString();case 3:if(!P(n))return n.h=G(n),H(n);n.A=!0;default:return n.A?(q(n)&&(n.A=!1),n.b.toString()+n.a.toString()):0<n.f.length?(t=T(n,l),u=M(n),0<u.length?u:(F(n,n.a.toString()),R(n)?V(n):n.l?D(n,t):n.i.toString())):H(n)}}function I(n){return n.l=!0,n.A=!1,n.f=[],n.s=0,e(n.m),n.w="",H(n)}function M(n){for(var l=n.a.toString(),t=n.f.length,e=0;e<t;++e){var u=n.f[e],r=g(u,1);if(new RegExp("^(?:"+r+")$").test(l))return n.B=pn.test(h(u,4)),l=l.replace(new RegExp(r,"g"),h(u,2)),D(n,l)}return""}function D(n,l){var t=n.b.b.length;return n.B&&0<t&&" "!=n.b.toString().charAt(t-1)?n.b+" "+l:n.b+l}function H(n){var l=n.a.toString();if(3<=l.length){for(var t=n.o&&0==n.h.length&&0<m(n.g,20)?c(n.g,20)||[]:c(n.g,19)||[],e=t.length,u=0;u<e;++u){var r=t[u];0<n.h.length&&A(g(r,4))&&!h(r,6)&&null==r.a[5]||(0!=n.h.length||n.o||A(g(r,4))||h(r,6))&&fn.test(g(r,2))&&n.f.push(r)}return F(n,l),l=M(n),0<l.length?l:R(n)?V(n):n.i.toString()}return D(n,l)}function V(n){var l=n.a.toString(),t=l.length;if(0<t){for(var e="",u=0;u<t;u++)e=T(n,l.charAt(u));return n.l?D(n,e):n.i.toString()}return n.b.toString()}function G(n){var l,t=n.a.toString(),u=0;return 1!=h(n.g,10)?l=!1:(l=n.a.toString(),l="1"==l.charAt(0)&&"0"!=l.charAt(1)&&"1"!=l.charAt(1)),l?(u=1,n.b.a("1").a(" "),n.o=!0):null!=n.g.a[15]&&(l=new RegExp("^(?:"+h(n.g,15)+")"),l=t.match(l),null!=l&&null!=l[0]&&0<l[0].length&&(n.o=!0,u=l[0].length,n.b.a(t.substring(0,u)))),e(n.a),n.a.a(t.substring(u)),t.substring(0,u)}function P(n){var l=n.u.toString(),t=new RegExp("^(?:\\+|"+h(n.g,11)+")"),t=l.match(t);return null!=t&&null!=t[0]&&0<t[0].length&&(n.o=!0,t=t[0].length,e(n.a),n.a.a(l.substring(t)),e(n.b),n.b.a(l.substring(0,t)),"+"!=l.charAt(0)&&n.b.a(" "),!0)}function q(n){if(0==n.a.b.length)return!1;var l,u=new t;n:{if(l=n.a.toString(),0!=l.length&&"0"!=l.charAt(0))for(var r,i=l.length,a=1;3>=a&&a<=i;++a)if(r=parseInt(l.substring(0,a),10),r in nn){u.a(l.substring(a)),l=r;break n}l=0}return 0!=l&&(e(n.a),n.a.a(u.toString()),u=E(l),"001"==u?n.g=N(n.G,""+l):u!=n.D&&(n.g=B(n,u)),n.b.a(""+l).a(" "),n.h="",!0)}function T(n,l){var t=n.m.toString();if(0<=t.substring(n.s).search(n.H)){var u=t.search(n.H),t=t.replace(n.H,l);return e(n.m),n.m.a(t),n.s=u,t.substring(0,n.s+1)}return 1==n.f.length&&(n.l=!1),n.w="",n.i.toString()}var U=this;t.prototype.b="",t.prototype.set=function(n){this.b=""+n},t.prototype.a=function(n,l,t){if(this.b+=String(n),null!=l)for(var e=1;e<arguments.length;e++)this.b+=arguments[e];return this},t.prototype.toString=function(){return this.b};var Y=1,k=2,J=3,K=4,L=6,O=16,Z=18;f.prototype.set=function(n,l){b(this,n.b,l)},f.prototype.clone=function(){var n=new this.constructor;return n!=this&&(n.a={},n.b&&(n.b={}),p(n,this)),n},l(v,f);var z=null;l(d,f);var Q=null;l(_,f);var W=null;v.prototype.j=function(){var n=z;return n||(z=n=y(v,{0:{name:"NumberFormat",I:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,c:9,type:String},2:{name:"format",required:!0,c:9,type:String},3:{name:"leading_digits_pattern",v:!0,c:9,type:String},4:{name:"national_prefix_formatting_rule",c:9,type:String},6:{name:"national_prefix_optional_when_formatting",c:8,defaultValue:!1,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",c:9,type:String}})),n},v.j=v.prototype.j,d.prototype.j=function(){var n=Q;return n||(Q=n=y(d,{0:{name:"PhoneNumberDesc",I:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",c:9,type:String},9:{name:"possible_length",v:!0,c:5,type:Number},10:{name:"possible_length_local_only",v:!0,c:5,type:Number},6:{name:"example_number",c:9,type:String}})),n},d.j=d.prototype.j,_.prototype.j=function(){var n=W;return n||(W=n=y(_,{0:{name:"PhoneMetadata",I:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",c:11,type:d},2:{name:"fixed_line",c:11,type:d},3:{name:"mobile",c:11,type:d},4:{name:"toll_free",c:11,type:d},5:{name:"premium_rate",c:11,type:d},6:{name:"shared_cost",c:11,type:d},7:{name:"personal_number",c:11,type:d},8:{name:"voip",c:11,type:d},21:{name:"pager",c:11,type:d},25:{name:"uan",c:11,type:d},27:{name:"emergency",c:11,type:d},28:{name:"voicemail",c:11,type:d},29:{name:"short_code",c:11,type:d},30:{name:"standard_rate",c:11,type:d},31:{name:"carrier_specific",c:11,type:d},33:{name:"sms_services",c:11,type:d},24:{name:"no_international_dialling",c:11,type:d},9:{name:"id",required:!0,c:9,type:String},10:{name:"country_code",c:5,type:Number},11:{name:"international_prefix",c:9,type:String},17:{name:"preferred_international_prefix",c:9,type:String},12:{name:"national_prefix",c:9,type:String},13:{name:"preferred_extn_prefix",c:9,type:String},15:{name:"national_prefix_for_parsing",c:9,type:String},16:{name:"national_prefix_transform_rule",c:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",c:8,defaultValue:!1,type:Boolean},19:{name:"number_format",v:!0,c:11,type:v},20:{name:"intl_number_format",v:!0,c:11,type:v},22:{name:"main_country_for_code",c:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",c:9,type:String},26:{name:"leading_zero_possible",c:8,defaultValue:!1,type:Boolean}})),n},_.j=_.prototype.j,S.prototype.a=function(n){throw new n.b,Error("Unimplemented")},S.prototype.b=function(n,l){if(11==n.a||10==n.a)return l instanceof f?l:this.a(n.i.prototype.j(),l);if(14==n.a){if("string"==typeof l&&X.test(l)){var t=Number(l);if(0<t)return t}return l}if(!n.h)return l;if(t=n.i,t===String){if("number"==typeof l)return String(l)}else if(t===Number&&"string"==typeof l&&("Infinity"===l||"-Infinity"===l||"NaN"===l||X.test(l)))return Number(l);return l};var X=/^-?[0-9]+$/;l(w,S),w.prototype.a=function(n,l){var t=new n.b;return t.g=this,t.a=l,t.b={},t},l(x,w),x.prototype.b=function(n,l){return 8==n.a?!!l:S.prototype.b.apply(this,arguments)},x.prototype.a=function(n,l){return x.M.a.call(this,n,l)};/*
|
||
|
||
Copyright (C) 2010 The Libphonenumber Authors
|
||
|
||
Licensed under the Apache License, Version 2.0 (the "License");
|
||
you may not use this file except in compliance with the License.
|
||
You may obtain a copy of the License at
|
||
|
||
http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
Unless required by applicable law or agreed to in writing, software
|
||
distributed under the License is distributed on an "AS IS" BASIS,
|
||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
See the License for the specific language governing permissions and
|
||
limitations under the License.
|
||
*/
|
||
var nn={212:["MA","EH"]},ln={EH:[null,[null,null,"[5-8]\\d{8}",null,null,null,null,null,null,[9]],[null,null,"528[89]\\d{5}",null,null,null,"528812345"],[null,null,"(?:6(?:[0-79]\\d|8[0-247-9])|7(?:0[067]|6[1267]|7[017]))\\d{6}",null,null,null,"650123456"],[null,null,"80\\d{7}",null,null,null,"801234567"],[null,null,"89\\d{7}",null,null,null,"891234567"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5924[01]\\d{4}",null,null,null,"592401234"],"EH",212,"00","0",null,null,"0",null,null,null,null,null,[null,null,null,null,null,null,null,null,null,[-1]],null,"528[89]",[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]],MA:[null,[null,null,"[5-8]\\d{8}",null,null,null,null,null,null,[9]],[null,null,"5(?:2(?:[015-79]\\d|2[02-9]|3[2-57]|4[2-8]|8[235-7])|3(?:[0-48]\\d|[57][2-9]|6[2-8]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}",null,null,null,"520123456"],[null,null,"(?:6(?:[0-79]\\d|8[0-247-9])|7(?:0[067]|6[1267]|7[017]))\\d{6}",null,null,null,"650123456"],[null,null,"80\\d{7}",null,null,null,"801234567"],[null,null,"89\\d{7}",null,null,null,"891234567"],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,"5924[01]\\d{4}",null,null,null,"592401234"],"MA",212,"00","0",null,null,"0",null,null,null,[[null,"(\\d{3})(\\d{6})","$1-$2",["5(?:2[015-7]|3[0-4])|[67]"],"0$1"],[null,"(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-48]|9[0-7])|3(?:[5-79]|8[0-7])|9)|892"],"0$1"],[null,"(\\d{5})(\\d{4})","$1-$2",["5[23]"],"0$1"],[null,"(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5"],"0$1"],[null,"(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"]],null,[null,null,null,null,null,null,null,null,null,[-1]],1,null,[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]]};$.b=function(){return $.a?$.a:$.a=new $};var tn={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"},en=RegExp("[++]+"),un=RegExp("([0-90-9٠-٩۰-۹])"),rn=/^\(?\$1\)?$/,an=new _;b(an,11,"NA");var on=/\[([^\[\]])*\]/g,sn=/\d(?=[^,}][^,}])/g,fn=RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)+$"),pn=/[- ]/;j.prototype.K=function(){this.C="",e(this.i),e(this.u),e(this.m),this.s=0,this.w="",e(this.b),this.h="",e(this.a),this.l=!0,this.A=this.o=this.F=!1,this.f=[],this.B=!1,this.g!=this.J&&(this.g=B(this,this.D))},j.prototype.L=function(n){return this.C=C(this,n)},n("Cleave.AsYouTypeFormatter",j),n("Cleave.AsYouTypeFormatter.prototype.inputDigit",j.prototype.L),n("Cleave.AsYouTypeFormatter.prototype.clear",j.prototype.K)}.call("object"==typeof global&&global?global:window); |