line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# automatically generated file, don't edit |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Copyright 2023 David Cantrell, derived from data from libphonenumber |
6
|
|
|
|
|
|
|
# http://code.google.com/p/libphonenumber/ |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
9
|
|
|
|
|
|
|
# you may not use this file except in compliance with the License. |
10
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
15
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
16
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
18
|
|
|
|
|
|
|
# limitations under the License. |
19
|
|
|
|
|
|
|
package Number::Phone::StubCountry::CL; |
20
|
2
|
|
|
2
|
|
1121
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
214
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
47
|
|
23
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
53
|
|
24
|
2
|
|
|
2
|
|
15
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
17
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131445; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1', |
30
|
|
|
|
|
|
|
'intl_format' => 'NA', |
31
|
|
|
|
|
|
|
'leading_digits' => ' |
32
|
|
|
|
|
|
|
1(?: |
33
|
|
|
|
|
|
|
[03-589]| |
34
|
|
|
|
|
|
|
21 |
35
|
|
|
|
|
|
|
)| |
36
|
|
|
|
|
|
|
[29]0| |
37
|
|
|
|
|
|
|
78 |
38
|
|
|
|
|
|
|
', |
39
|
|
|
|
|
|
|
'pattern' => '(\\d{4})' |
40
|
|
|
|
|
|
|
}, |
41
|
|
|
|
|
|
|
{ |
42
|
|
|
|
|
|
|
'format' => '$1 $2', |
43
|
|
|
|
|
|
|
'leading_digits' => '2196', |
44
|
|
|
|
|
|
|
'national_rule' => '($1)', |
45
|
|
|
|
|
|
|
'pattern' => '(\\d{5})(\\d{4})' |
46
|
|
|
|
|
|
|
}, |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
49
|
|
|
|
|
|
|
'leading_digits' => '44', |
50
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
51
|
|
|
|
|
|
|
}, |
52
|
|
|
|
|
|
|
{ |
53
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
54
|
|
|
|
|
|
|
'leading_digits' => '2[1-36]', |
55
|
|
|
|
|
|
|
'national_rule' => '($1)', |
56
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{4})(\\d{4})' |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
60
|
|
|
|
|
|
|
'leading_digits' => '9[2-9]', |
61
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{4})(\\d{4})' |
62
|
|
|
|
|
|
|
}, |
63
|
|
|
|
|
|
|
{ |
64
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
65
|
|
|
|
|
|
|
'leading_digits' => ' |
66
|
|
|
|
|
|
|
3[2-5]| |
67
|
|
|
|
|
|
|
[47]| |
68
|
|
|
|
|
|
|
5[1-3578]| |
69
|
|
|
|
|
|
|
6[13-57]| |
70
|
|
|
|
|
|
|
8(?: |
71
|
|
|
|
|
|
|
0[1-9]| |
72
|
|
|
|
|
|
|
[1-9] |
73
|
|
|
|
|
|
|
) |
74
|
|
|
|
|
|
|
', |
75
|
|
|
|
|
|
|
'national_rule' => '($1)', |
76
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
77
|
|
|
|
|
|
|
}, |
78
|
|
|
|
|
|
|
{ |
79
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
80
|
|
|
|
|
|
|
'leading_digits' => ' |
81
|
|
|
|
|
|
|
60| |
82
|
|
|
|
|
|
|
8 |
83
|
|
|
|
|
|
|
', |
84
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})' |
85
|
|
|
|
|
|
|
}, |
86
|
|
|
|
|
|
|
{ |
87
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
88
|
|
|
|
|
|
|
'leading_digits' => '1', |
89
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})(\\d{4})' |
90
|
|
|
|
|
|
|
}, |
91
|
|
|
|
|
|
|
{ |
92
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
93
|
|
|
|
|
|
|
'leading_digits' => '60', |
94
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{3})' |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
]; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
my $validators = { |
99
|
|
|
|
|
|
|
'geographic' => ' |
100
|
|
|
|
|
|
|
2(?: |
101
|
|
|
|
|
|
|
1982[0-6]| |
102
|
|
|
|
|
|
|
3314[05-9] |
103
|
|
|
|
|
|
|
)\\d{3}| |
104
|
|
|
|
|
|
|
(?: |
105
|
|
|
|
|
|
|
2(?: |
106
|
|
|
|
|
|
|
1(?: |
107
|
|
|
|
|
|
|
160| |
108
|
|
|
|
|
|
|
962 |
109
|
|
|
|
|
|
|
)| |
110
|
|
|
|
|
|
|
3(?: |
111
|
|
|
|
|
|
|
2\\d\\d| |
112
|
|
|
|
|
|
|
3(?: |
113
|
|
|
|
|
|
|
[03467]\\d| |
114
|
|
|
|
|
|
|
1[0-35-9]| |
115
|
|
|
|
|
|
|
2[1-9]| |
116
|
|
|
|
|
|
|
5[0-24-9]| |
117
|
|
|
|
|
|
|
8[0-3] |
118
|
|
|
|
|
|
|
)| |
119
|
|
|
|
|
|
|
600 |
120
|
|
|
|
|
|
|
)| |
121
|
|
|
|
|
|
|
646[59] |
122
|
|
|
|
|
|
|
)| |
123
|
|
|
|
|
|
|
80[1-9]\\d\\d| |
124
|
|
|
|
|
|
|
9(?: |
125
|
|
|
|
|
|
|
3(?: |
126
|
|
|
|
|
|
|
[0-57-9]\\d\\d| |
127
|
|
|
|
|
|
|
6(?: |
128
|
|
|
|
|
|
|
0[02-9]| |
129
|
|
|
|
|
|
|
[1-9]\\d |
130
|
|
|
|
|
|
|
) |
131
|
|
|
|
|
|
|
)| |
132
|
|
|
|
|
|
|
6(?: |
133
|
|
|
|
|
|
|
[0-8]\\d\\d| |
134
|
|
|
|
|
|
|
9(?: |
135
|
|
|
|
|
|
|
[02-79]\\d| |
136
|
|
|
|
|
|
|
1[05-9] |
137
|
|
|
|
|
|
|
) |
138
|
|
|
|
|
|
|
)| |
139
|
|
|
|
|
|
|
7[1-9]\\d\\d| |
140
|
|
|
|
|
|
|
9(?: |
141
|
|
|
|
|
|
|
[03-9]\\d\\d| |
142
|
|
|
|
|
|
|
1(?: |
143
|
|
|
|
|
|
|
[0235-9]\\d| |
144
|
|
|
|
|
|
|
4[0-24-9] |
145
|
|
|
|
|
|
|
)| |
146
|
|
|
|
|
|
|
2(?: |
147
|
|
|
|
|
|
|
[0-79]\\d| |
148
|
|
|
|
|
|
|
8[0-46-9] |
149
|
|
|
|
|
|
|
) |
150
|
|
|
|
|
|
|
) |
151
|
|
|
|
|
|
|
) |
152
|
|
|
|
|
|
|
)\\d{4}| |
153
|
|
|
|
|
|
|
(?: |
154
|
|
|
|
|
|
|
22| |
155
|
|
|
|
|
|
|
3[2-5]| |
156
|
|
|
|
|
|
|
[47][1-35]| |
157
|
|
|
|
|
|
|
5[1-3578]| |
158
|
|
|
|
|
|
|
6[13-57]| |
159
|
|
|
|
|
|
|
8[1-9]| |
160
|
|
|
|
|
|
|
9[2458] |
161
|
|
|
|
|
|
|
)\\d{7} |
162
|
|
|
|
|
|
|
', |
163
|
|
|
|
|
|
|
'pager' => '', |
164
|
|
|
|
|
|
|
'personal_number' => '', |
165
|
|
|
|
|
|
|
'specialrate' => '(600\\d{7,8})', |
166
|
|
|
|
|
|
|
'toll_free' => ' |
167
|
|
|
|
|
|
|
(?: |
168
|
|
|
|
|
|
|
123| |
169
|
|
|
|
|
|
|
8 |
170
|
|
|
|
|
|
|
)00\\d{6} |
171
|
|
|
|
|
|
|
', |
172
|
|
|
|
|
|
|
'voip' => '44\\d{7}' |
173
|
|
|
|
|
|
|
}; |
174
|
|
|
|
|
|
|
my %areanames = (); |
175
|
|
|
|
|
|
|
$areanames{es} = {"562198", "Santiago\,\ Región\ Metropolitana", |
176
|
|
|
|
|
|
|
"5626", "Santiago\,\ Región\ Metropolitana", |
177
|
|
|
|
|
|
|
"5623", "Santiago\,\ Región\ Metropolitana", |
178
|
|
|
|
|
|
|
"5661", "Punta\ Arenas\,\ Magallanes", |
179
|
|
|
|
|
|
|
"5658", "Arica\,\ Arica\ y\ Parinacota", |
180
|
|
|
|
|
|
|
"56211", "Santiago\,\ Región\ Metropolitana", |
181
|
|
|
|
|
|
|
"5667", "Coihaique\,\ Aysén", |
182
|
|
|
|
|
|
|
"5622", "Santiago\,\ Región\ Metropolitana",}; |
183
|
|
|
|
|
|
|
$areanames{en} = {"5653244", "Ovalle\,\ Coquimbo", |
184
|
|
|
|
|
|
|
"5657", "Iquique\,\ Tarapacá", |
185
|
|
|
|
|
|
|
"56539", "Ovalle\,\ Coquimbo", |
186
|
|
|
|
|
|
|
"565327", "Ovalle\,\ Coquimbo", |
187
|
|
|
|
|
|
|
"5641", "Concepción\,\ Biobío", |
188
|
|
|
|
|
|
|
"5655", "Antofagasta", |
189
|
|
|
|
|
|
|
"56530", "Ovalle\,\ Coquimbo", |
190
|
|
|
|
|
|
|
"5653246", "Ovalle\,\ Coquimbo", |
191
|
|
|
|
|
|
|
"56532452", "Ovalle\,\ Coquimbo", |
192
|
|
|
|
|
|
|
"5634", "San\ Felipe\,\ Valparaíso", |
193
|
|
|
|
|
|
|
"5658", "Arica\,\ Arica\ and\ Parinacota", |
194
|
|
|
|
|
|
|
"5632", "Valparaíso", |
195
|
|
|
|
|
|
|
"565322", "Ovalle\,\ Coquimbo", |
196
|
|
|
|
|
|
|
"56211", "Santiago\,\ Metropolitan\ Region", |
197
|
|
|
|
|
|
|
"5653243", "Ovalle\,\ Coquimbo", |
198
|
|
|
|
|
|
|
"5642", "Chillán\,\ Biobío", |
199
|
|
|
|
|
|
|
"5623", "Santiago\,\ Metropolitan\ Region", |
200
|
|
|
|
|
|
|
"565329", "Ovalle\,\ Coquimbo", |
201
|
|
|
|
|
|
|
"5672", "Rancagua\,\ O\'Higgins", |
202
|
|
|
|
|
|
|
"565320", "Ovalle\,\ Coquimbo", |
203
|
|
|
|
|
|
|
"5661", "Punta\ Arenas\,\ Magallanes\ and\ Antártica\ Chilena", |
204
|
|
|
|
|
|
|
"565328", "Ovalle\,\ Coquimbo", |
205
|
|
|
|
|
|
|
"56538", "Ovalle\,\ Coquimbo", |
206
|
|
|
|
|
|
|
"5653248", "Ovalle\,\ Coquimbo", |
207
|
|
|
|
|
|
|
"565326", "Ovalle\,\ Coquimbo", |
208
|
|
|
|
|
|
|
"565323", "Ovalle\,\ Coquimbo", |
209
|
|
|
|
|
|
|
"56533", "Ovalle\,\ Coquimbo", |
210
|
|
|
|
|
|
|
"56532455", "Ovalle\,\ Coquimbo", |
211
|
|
|
|
|
|
|
"5664", "Osorno\,\ Los\ Lagos", |
212
|
|
|
|
|
|
|
"562198", "Santiago\,\ Metropolitan\ Region", |
213
|
|
|
|
|
|
|
"565325", "Ovalle\,\ Coquimbo", |
214
|
|
|
|
|
|
|
"5626", "Santiago\,\ Metropolitan\ Region", |
215
|
|
|
|
|
|
|
"5671", "Talca\,\ Maule", |
216
|
|
|
|
|
|
|
"5653241", "Ovalle\,\ Coquimbo", |
217
|
|
|
|
|
|
|
"565321", "Ovalle\,\ Coquimbo", |
218
|
|
|
|
|
|
|
"56534", "Ovalle\,\ Coquimbo", |
219
|
|
|
|
|
|
|
"5622", "Santiago\,\ Metropolitan\ Region", |
220
|
|
|
|
|
|
|
"5653247", "Ovalle\,\ Coquimbo", |
221
|
|
|
|
|
|
|
"56532453", "Ovalle\,\ Coquimbo", |
222
|
|
|
|
|
|
|
"56532454", "Ovalle\,\ Coquimbo", |
223
|
|
|
|
|
|
|
"56532458", "Ovalle\,\ Coquimbo", |
224
|
|
|
|
|
|
|
"5673", "Linares\,\ Maule", |
225
|
|
|
|
|
|
|
"5652", "Copiapó\,\ Atacama", |
226
|
|
|
|
|
|
|
"56532459", "Ovalle\,\ Coquimbo", |
227
|
|
|
|
|
|
|
"56532456", "Ovalle\,\ Coquimbo", |
228
|
|
|
|
|
|
|
"5651", "La\ Serena\,\ Coquimbo", |
229
|
|
|
|
|
|
|
"5663", "Valdivia\,\ Los\ Ríos", |
230
|
|
|
|
|
|
|
"5645", "Temuco\,\ Araucanía", |
231
|
|
|
|
|
|
|
"56535", "Ovalle\,\ Coquimbo", |
232
|
|
|
|
|
|
|
"5635", "San\ Antonio\,\ Valparaíso", |
233
|
|
|
|
|
|
|
"5653240", "Ovalle\,\ Coquimbo", |
234
|
|
|
|
|
|
|
"56536", "Ovalle\,\ Coquimbo", |
235
|
|
|
|
|
|
|
"5653242", "Ovalle\,\ Coquimbo", |
236
|
|
|
|
|
|
|
"56531", "Ovalle\,\ Coquimbo", |
237
|
|
|
|
|
|
|
"5675", "Curicó\,\ Maule", |
238
|
|
|
|
|
|
|
"56532457", "Ovalle\,\ Coquimbo", |
239
|
|
|
|
|
|
|
"5653249", "Ovalle\,\ Coquimbo", |
240
|
|
|
|
|
|
|
"56537", "Ovalle\,\ Coquimbo", |
241
|
|
|
|
|
|
|
"5667", "Coyhaique\,\ Aisén", |
242
|
|
|
|
|
|
|
"5633", "Quillota\,\ Valparaíso", |
243
|
|
|
|
|
|
|
"5643", "Los\ Angeles\,\ Biobío", |
244
|
|
|
|
|
|
|
"5665", "Puerto\ Montt\,\ Los\ Lagos",}; |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
sub new { |
247
|
16
|
|
|
16
|
1
|
44
|
my $class = shift; |
248
|
16
|
|
|
|
|
31
|
my $number = shift; |
249
|
16
|
|
|
|
|
107
|
$number =~ s/(^\+56|\D)//g; |
250
|
16
|
|
|
|
|
104
|
my $self = bless({ country_code => '56', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
251
|
16
|
100
|
|
|
|
77
|
return $self->is_valid() ? $self : undef; |
252
|
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
1; |