@saasquatch/mint-components 1.6.1-9 → 1.6.2-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/dist/cjs/{GenericTableView-9d93f114.js → GenericTableView-4921be4b.js} +5 -1
  2. package/dist/cjs/{ShadowViewAddon-1bbdf477.js → ShadowViewAddon-7b7dd5e3.js} +21 -16
  3. package/dist/cjs/{global-22fb2ec7.js → global-6e1584a6.js} +2 -2
  4. package/dist/cjs/{index.module-fb61a163.js → index.module-d169a23f.js} +30 -29
  5. package/dist/cjs/loader.cjs.js +3 -3
  6. package/dist/cjs/mint-components.cjs.js +3 -3
  7. package/dist/cjs/raisins-plop-target.cjs.entry.js +25 -0
  8. package/dist/cjs/{re-render-7248fc06.js → re-render-83d1c1f0.js} +4 -4
  9. package/dist/cjs/sqm-asset-card.cjs.entry.js +2 -2
  10. package/dist/cjs/sqm-big-stat_35.cjs.entry.js +103 -3965
  11. package/dist/cjs/sqm-empty_5.cjs.entry.js +5 -1
  12. package/dist/cjs/sqm-graphql-client-provider.cjs.entry.js +5 -5
  13. package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +6 -6
  14. package/dist/cjs/{sqm-navigation-sidebar-item-view-52ab014f.js → sqm-navigation-sidebar-item-view-7ff14840.js} +2 -2
  15. package/dist/cjs/sqm-navigation-sidebar-item.cjs.entry.js +4 -4
  16. package/dist/cjs/sqm-password-field.cjs.entry.js +2 -2
  17. package/dist/cjs/sqm-popup-container.cjs.entry.js +4 -4
  18. package/dist/cjs/{sqm-portal-email-verification-view-fc30fd1a.js → sqm-portal-email-verification-view-6b4ef802.js} +1 -1
  19. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +10 -8
  20. package/dist/cjs/{sqm-portal-footer-view-78528c31.js → sqm-portal-footer-view-204583ac.js} +1 -1
  21. package/dist/cjs/sqm-portal-footer.cjs.entry.js +3 -3
  22. package/dist/cjs/sqm-portal-forgot-password.cjs.entry.js +8 -6
  23. package/dist/cjs/sqm-portal-logout.cjs.entry.js +4 -4
  24. package/dist/cjs/{sqm-portal-profile-view-64e85659.js → sqm-portal-profile-view-444c8e2c.js} +1 -1
  25. package/dist/cjs/sqm-portal-profile.cjs.entry.js +7 -7
  26. package/dist/cjs/sqm-portal-protected-route.cjs.entry.js +7 -6
  27. package/dist/cjs/sqm-portal-registration-form.cjs.entry.js +309 -0
  28. package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +17 -9
  29. package/dist/cjs/sqm-portal-verify-email.cjs.entry.js +9 -8
  30. package/dist/cjs/sqm-qa-referral-card.cjs.entry.js +89 -0
  31. package/dist/cjs/sqm-qa-tabs.cjs.entry.js +100 -0
  32. package/dist/cjs/sqm-qa.cjs.entry.js +1 -0
  33. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +33 -9
  34. package/dist/cjs/sqm-rewards-table-customer-note-column.cjs.entry.js +2 -2
  35. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +34 -14
  36. package/dist/cjs/sqm-stencilbook.cjs.entry.js +169 -96
  37. package/dist/cjs/sqm-tabs.cjs.entry.js +19 -5
  38. package/dist/cjs/{useChildElements-24538fc5.js → useChildElements-36106d83.js} +2 -2
  39. package/dist/cjs/{useReferralTable-1e71d2dc.js → useReferralTable-1aab8416.js} +8 -8
  40. package/dist/cjs/useValidationState-733d7e8c.js +3886 -0
  41. package/dist/collection/collection-manifest.json +4 -0
  42. package/dist/collection/components/sqm-big-stat/sqm-big-stat.js +9 -5
  43. package/dist/collection/components/sqm-big-stat/useBigStat.js +3 -0
  44. package/dist/collection/components/sqm-big-stat/useDemoBigStat.js +3 -0
  45. package/dist/collection/components/sqm-brand/sqm-brand.js +1 -1
  46. package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +4 -0
  47. package/dist/collection/components/sqm-dropdown-field/sqm-dropdown-field.js +4 -0
  48. package/dist/collection/components/sqm-hero-image/sqm-hero-image.js +4 -0
  49. package/dist/collection/components/sqm-input-field/sqm-input-field.js +4 -0
  50. package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +74 -2
  51. package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +4 -0
  52. package/dist/collection/components/sqm-portal-change-password/usePortalChangePassword.js +2 -2
  53. package/dist/collection/components/sqm-portal-container/sqm-portal-container.js +1 -1
  54. package/dist/collection/components/sqm-portal-email-verification/usePortalEmailVerification.js +4 -2
  55. package/dist/collection/components/sqm-portal-forgot-password/usePortalForgotPassword.js +4 -2
  56. package/dist/collection/components/sqm-portal-login/usePortalLogin.js +3 -2
  57. package/dist/collection/components/sqm-portal-protected-route/sqm-portal-protected-route.js +4 -0
  58. package/dist/collection/components/sqm-portal-register/sqm-portal-register.js +8 -0
  59. package/dist/collection/components/sqm-portal-register/usePortalRegister.js +2 -2
  60. package/dist/collection/components/sqm-portal-registration-form/PortalRegistrationForm.stories.js +104 -0
  61. package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form-view.js +74 -0
  62. package/dist/collection/components/sqm-portal-registration-form/sqm-portal-registration-form.js +409 -0
  63. package/dist/collection/components/sqm-portal-registration-form/usePortalRegistrationForm.js +119 -0
  64. package/dist/collection/components/sqm-portal-reset-password/sqm-portal-reset-password.js +4 -0
  65. package/dist/collection/components/sqm-portal-reset-password/usePortalResetPassword.js +10 -3
  66. package/dist/collection/components/sqm-portal-verify-email/usePortalVerifyEmail.js +3 -2
  67. package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step.js +1 -1
  68. package/dist/collection/components/sqm-qa/sqm-qa.js +13 -0
  69. package/dist/collection/components/sqm-qa-referral-card/ReferralCard.stories.js +79 -0
  70. package/dist/collection/components/sqm-qa-referral-card/sqm-referral-card-view.js +56 -0
  71. package/dist/collection/components/sqm-qa-referral-card/sqm-referral-card.js +70 -0
  72. package/dist/collection/components/sqm-qa-tabs/Tabs.stories.js +491 -0
  73. package/dist/collection/components/sqm-qa-tabs/sqm-tabs-view.js +31 -0
  74. package/dist/collection/components/sqm-qa-tabs/sqm-tabs.js +59 -0
  75. package/dist/collection/components/sqm-qa-tabs/useTabs.js +46 -0
  76. package/dist/collection/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.js +4 -0
  77. package/dist/collection/components/sqm-referral-table/sqm-referral-table.js +29 -3
  78. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-plop-target.js +58 -0
  79. package/dist/collection/components/sqm-rewards-table/columns/sqm-rewards-table-status-column.js +10 -6
  80. package/dist/collection/components/sqm-rewards-table/sqm-rewards-table.js +18 -2
  81. package/dist/collection/components/sqm-scroll/sqm-scroll.js +4 -6
  82. package/dist/collection/components/sqm-share-button/sqm-share-button.js +8 -0
  83. package/dist/collection/components/sqm-tab/sqm-tab.js +1 -1
  84. package/dist/collection/components/sqm-tabs/sqm-tabs-view.js +5 -0
  85. package/dist/collection/components/sqm-tabs/useTabs.js +11 -2
  86. package/dist/collection/components/sqm-task-card/sqm-task-card.js +17 -1
  87. package/dist/collection/components/sqm-timeline/sqm-timeline-entry.js +1 -1
  88. package/dist/collection/components/sqm-titled-section/sqm-titled-section.js +9 -5
  89. package/dist/collection/tables/GenericTableView.js +5 -1
  90. package/dist/esm/{GenericTableView-ebc09be0.js → GenericTableView-59c5d47c.js} +5 -1
  91. package/dist/esm/{ShadowViewAddon-e2996624.js → ShadowViewAddon-82a3c62b.js} +23 -18
  92. package/dist/esm/{global-5c84f57f.js → global-59aa17be.js} +3 -3
  93. package/dist/esm/{index.module-f5e17a4e.js → index.module-c6c6943f.js} +5 -5
  94. package/dist/esm/loader.js +5 -5
  95. package/dist/esm/{luxon-f44215d9.js → luxon-578505e2.js} +1 -1
  96. package/dist/esm/mint-components.js +5 -5
  97. package/dist/esm/raisins-plop-target.entry.js +21 -0
  98. package/dist/esm/{re-render-69774e13.js → re-render-e804551e.js} +5 -5
  99. package/dist/esm/sqm-asset-card.entry.js +4 -4
  100. package/dist/esm/sqm-big-stat_35.entry.js +101 -3963
  101. package/dist/esm/sqm-empty_5.entry.js +6 -2
  102. package/dist/esm/sqm-form-message.entry.js +1 -1
  103. package/dist/esm/sqm-graphql-client-provider.entry.js +7 -7
  104. package/dist/esm/{sqm-hero-view-71d1202f.js → sqm-hero-view-b54265df.js} +2 -2
  105. package/dist/esm/sqm-hero.entry.js +3 -3
  106. package/dist/esm/sqm-leaderboard-rank.entry.js +8 -8
  107. package/dist/esm/{sqm-navigation-sidebar-item-view-51714c31.js → sqm-navigation-sidebar-item-view-4181f286.js} +2 -2
  108. package/dist/esm/sqm-navigation-sidebar-item.entry.js +6 -6
  109. package/dist/esm/sqm-navigation-sidebar.entry.js +1 -1
  110. package/dist/esm/sqm-password-field.entry.js +4 -4
  111. package/dist/esm/sqm-popup-container.entry.js +6 -6
  112. package/dist/esm/{sqm-portal-email-verification-view-ac38b167.js → sqm-portal-email-verification-view-5b888e5c.js} +1 -1
  113. package/dist/esm/sqm-portal-email-verification.entry.js +12 -10
  114. package/dist/esm/{sqm-portal-footer-view-a6d09022.js → sqm-portal-footer-view-56689d55.js} +1 -1
  115. package/dist/esm/sqm-portal-footer.entry.js +5 -5
  116. package/dist/esm/sqm-portal-forgot-password.entry.js +10 -8
  117. package/dist/esm/sqm-portal-logout.entry.js +6 -6
  118. package/dist/esm/{sqm-portal-profile-view-419d1eb9.js → sqm-portal-profile-view-148efa76.js} +1 -1
  119. package/dist/esm/sqm-portal-profile.entry.js +9 -9
  120. package/dist/esm/sqm-portal-protected-route.entry.js +9 -8
  121. package/dist/esm/sqm-portal-registration-form.entry.js +305 -0
  122. package/dist/esm/sqm-portal-reset-password.entry.js +19 -11
  123. package/dist/esm/sqm-portal-verify-email.entry.js +11 -10
  124. package/dist/esm/sqm-qa-referral-card.entry.js +85 -0
  125. package/dist/esm/sqm-qa-tabs.entry.js +96 -0
  126. package/dist/esm/sqm-qa.entry.js +2 -1
  127. package/dist/esm/sqm-referral-table_11.entry.js +36 -12
  128. package/dist/esm/sqm-rewards-table-customer-note-cell.entry.js +1 -1
  129. package/dist/esm/sqm-rewards-table-customer-note-column.entry.js +4 -4
  130. package/dist/esm/sqm-rewards-table_9.entry.js +37 -17
  131. package/dist/esm/sqm-stencilbook.entry.js +173 -100
  132. package/dist/esm/sqm-tabs.entry.js +21 -7
  133. package/dist/esm/sqm-text-span.entry.js +1 -1
  134. package/dist/esm/{stencil-hooks.module-acc8a613.js → stencil-hooks.module-e39af977.js} +1 -1
  135. package/dist/esm/{use-callback-7e0bfd3b.js → use-callback-697e2ff0.js} +1 -1
  136. package/dist/esm/{useChildElements-a8347aea.js → useChildElements-31287783.js} +3 -3
  137. package/dist/esm/{useReferralTable-5cac5b13.js → useReferralTable-1693d531.js} +9 -9
  138. package/dist/esm/useValidationState-f5db8783.js +3882 -0
  139. package/dist/esm-es5/{GenericTableView-ebc09be0.js → GenericTableView-59c5d47c.js} +1 -1
  140. package/dist/esm-es5/ShadowViewAddon-82a3c62b.js +1 -0
  141. package/dist/esm-es5/{global-5c84f57f.js → global-59aa17be.js} +2 -2
  142. package/dist/esm-es5/{index.module-f5e17a4e.js → index.module-c6c6943f.js} +1 -1
  143. package/dist/esm-es5/loader.js +1 -1
  144. package/dist/esm-es5/{luxon-f44215d9.js → luxon-578505e2.js} +1 -1
  145. package/dist/esm-es5/mint-components.js +1 -1
  146. package/dist/esm-es5/raisins-plop-target.entry.js +1 -0
  147. package/dist/esm-es5/re-render-e804551e.js +1 -0
  148. package/dist/esm-es5/sqm-asset-card.entry.js +1 -1
  149. package/dist/esm-es5/sqm-big-stat_35.entry.js +1 -1
  150. package/dist/esm-es5/sqm-empty_5.entry.js +1 -1
  151. package/dist/esm-es5/sqm-form-message.entry.js +1 -1
  152. package/dist/esm-es5/sqm-graphql-client-provider.entry.js +1 -1
  153. package/dist/esm-es5/{sqm-hero-view-71d1202f.js → sqm-hero-view-b54265df.js} +1 -1
  154. package/dist/esm-es5/sqm-hero.entry.js +1 -1
  155. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  156. package/dist/esm-es5/sqm-navigation-sidebar-item-view-4181f286.js +1 -0
  157. package/dist/esm-es5/sqm-navigation-sidebar-item.entry.js +1 -1
  158. package/dist/esm-es5/sqm-navigation-sidebar.entry.js +1 -1
  159. package/dist/esm-es5/sqm-password-field.entry.js +1 -1
  160. package/dist/esm-es5/sqm-popup-container.entry.js +1 -1
  161. package/dist/esm-es5/{sqm-portal-email-verification-view-ac38b167.js → sqm-portal-email-verification-view-5b888e5c.js} +1 -1
  162. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  163. package/dist/esm-es5/{sqm-portal-footer-view-a6d09022.js → sqm-portal-footer-view-56689d55.js} +1 -1
  164. package/dist/esm-es5/sqm-portal-footer.entry.js +1 -1
  165. package/dist/esm-es5/sqm-portal-forgot-password.entry.js +1 -1
  166. package/dist/esm-es5/sqm-portal-logout.entry.js +1 -1
  167. package/dist/esm-es5/{sqm-portal-profile-view-419d1eb9.js → sqm-portal-profile-view-148efa76.js} +1 -1
  168. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  169. package/dist/esm-es5/sqm-portal-protected-route.entry.js +1 -1
  170. package/dist/esm-es5/sqm-portal-registration-form.entry.js +1 -0
  171. package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
  172. package/dist/esm-es5/sqm-portal-verify-email.entry.js +1 -1
  173. package/dist/esm-es5/sqm-qa-referral-card.entry.js +1 -0
  174. package/dist/esm-es5/sqm-qa-tabs.entry.js +1 -0
  175. package/dist/esm-es5/sqm-qa.entry.js +1 -1
  176. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  177. package/dist/esm-es5/sqm-rewards-table-customer-note-cell.entry.js +1 -1
  178. package/dist/esm-es5/sqm-rewards-table-customer-note-column.entry.js +1 -1
  179. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  180. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  181. package/dist/esm-es5/sqm-tabs.entry.js +1 -1
  182. package/dist/esm-es5/sqm-text-span.entry.js +1 -1
  183. package/dist/esm-es5/{stencil-hooks.module-acc8a613.js → stencil-hooks.module-e39af977.js} +1 -1
  184. package/dist/esm-es5/use-callback-697e2ff0.js +1 -0
  185. package/dist/esm-es5/useChildElements-31287783.js +1 -0
  186. package/dist/esm-es5/useReferralTable-1693d531.js +1 -0
  187. package/dist/esm-es5/useValidationState-f5db8783.js +1 -0
  188. package/dist/mint-components/mint-components.esm.js +1 -1
  189. package/dist/mint-components/mint-components.js +1 -1
  190. package/dist/mint-components/p-0616e87e.system.entry.js +1 -0
  191. package/dist/mint-components/{p-48f9babc.system.entry.js → p-0accfb5c.system.entry.js} +1 -1
  192. package/dist/mint-components/p-0b3b7596.entry.js +1 -0
  193. package/dist/mint-components/{p-ee26e870.entry.js → p-10483359.entry.js} +2 -2
  194. package/dist/mint-components/p-1125c6ef.entry.js +1 -0
  195. package/dist/mint-components/{p-3970de96.js → p-11a1a6a8.js} +1 -1
  196. package/dist/mint-components/p-144583fb.entry.js +1 -0
  197. package/dist/mint-components/{p-c0d24b76.system.entry.js → p-1537ba4c.system.entry.js} +1 -1
  198. package/dist/mint-components/{p-e01d8fdc.system.js → p-154958ee.system.js} +1 -1
  199. package/dist/mint-components/p-165bfabc.entry.js +1 -0
  200. package/dist/mint-components/{p-bd7b8620.system.entry.js → p-1706b667.system.entry.js} +1 -1
  201. package/dist/mint-components/{p-4b0e876f.js → p-199defdf.js} +2 -2
  202. package/dist/mint-components/{p-7548e059.system.entry.js → p-1e665fe0.system.entry.js} +1 -1
  203. package/dist/mint-components/p-22b1898f.entry.js +1 -0
  204. package/dist/mint-components/p-29ceaa99.system.entry.js +1 -0
  205. package/dist/mint-components/{p-f298a1bc.system.entry.js → p-2ba9b60a.system.entry.js} +1 -1
  206. package/dist/mint-components/p-2c64d0fb.entry.js +1 -0
  207. package/dist/mint-components/{p-27455c4c.js → p-30b3592f.js} +1 -1
  208. package/dist/mint-components/p-31553b15.entry.js +1 -0
  209. package/dist/mint-components/{p-6738565c.entry.js → p-33e657bf.entry.js} +1 -1
  210. package/dist/mint-components/p-3521c62c.entry.js +1 -0
  211. package/dist/mint-components/p-3913a42f.system.entry.js +1 -0
  212. package/dist/mint-components/{p-5ab46a89.entry.js → p-3915b77c.entry.js} +1 -1
  213. package/dist/mint-components/p-3b99eaf1.js +1 -0
  214. package/dist/mint-components/p-408f983a.system.js +1 -0
  215. package/dist/mint-components/{p-bbf96ff3.system.js → p-4519c6d9.system.js} +1 -1
  216. package/dist/mint-components/{p-e707831a.entry.js → p-46aabfb7.entry.js} +1 -1
  217. package/dist/mint-components/{p-cf9cfac0.entry.js → p-48a1e759.entry.js} +1 -1
  218. package/dist/mint-components/p-4d90bec1.system.entry.js +1 -0
  219. package/dist/mint-components/{p-ba99d04e.system.entry.js → p-51c3cec9.system.entry.js} +1 -1
  220. package/dist/mint-components/{p-596902cd.system.entry.js → p-55678b75.system.entry.js} +1 -1
  221. package/dist/mint-components/{p-97650e34.js → p-5674fe4d.js} +1 -1
  222. package/dist/mint-components/p-5ad360ab.entry.js +13 -0
  223. package/dist/mint-components/p-5b2d40f4.system.entry.js +1 -0
  224. package/dist/mint-components/{p-72751bb7.entry.js → p-6352cbee.entry.js} +1 -1
  225. package/dist/mint-components/p-648022ed.entry.js +159 -0
  226. package/dist/mint-components/p-675d6c48.system.entry.js +1 -0
  227. package/dist/mint-components/{p-0494f792.js → p-6882f2bb.js} +1 -1
  228. package/dist/mint-components/{p-4ebe044d.entry.js → p-69f10938.entry.js} +1 -1
  229. package/dist/mint-components/p-6dabc870.system.entry.js +1 -0
  230. package/dist/mint-components/p-6dc6ed05.entry.js +1 -0
  231. package/dist/mint-components/p-706e42f0.system.js +1 -0
  232. package/dist/mint-components/{p-f92e3e87.system.js → p-71a504fd.system.js} +1 -1
  233. package/dist/mint-components/{p-eb314fed.js → p-72ebbd38.js} +1 -1
  234. package/dist/mint-components/p-73046229.js +1 -0
  235. package/dist/mint-components/p-745255d9.entry.js +1 -0
  236. package/dist/mint-components/{p-19042a54.system.entry.js → p-79c04821.system.entry.js} +1 -1
  237. package/dist/mint-components/p-7c660f98.entry.js +1 -0
  238. package/dist/mint-components/{p-3c96bae3.entry.js → p-7cec4e63.entry.js} +1 -1
  239. package/dist/mint-components/p-8153deff.entry.js +99 -0
  240. package/dist/mint-components/{p-60de562c.entry.js → p-82d1bb86.entry.js} +1 -1
  241. package/dist/mint-components/p-8425534f.entry.js +9 -0
  242. package/dist/mint-components/p-8858d00c.system.js +1 -0
  243. package/dist/mint-components/{p-6ee04453.entry.js → p-8f09f202.entry.js} +1 -1
  244. package/dist/mint-components/{p-82ecbcd1.js → p-8f12df83.js} +1 -1
  245. package/dist/mint-components/p-90efeeb4.entry.js +1 -0
  246. package/dist/mint-components/{p-7794c289.js → p-916a8f50.js} +1 -1
  247. package/dist/mint-components/{p-819298a8.system.js → p-92c99ab9.system.js} +1 -1
  248. package/dist/mint-components/{p-6549ad6a.system.js → p-946de27f.system.js} +1 -1
  249. package/dist/mint-components/{p-5cdcff11.system.entry.js → p-965b2770.system.entry.js} +1 -1
  250. package/dist/mint-components/p-97a63829.js +1 -0
  251. package/dist/mint-components/p-98eab726.system.js +1 -0
  252. package/dist/mint-components/p-a4a62f35.entry.js +1 -0
  253. package/dist/mint-components/p-a8efda40.js +1 -0
  254. package/dist/mint-components/p-aa998fc1.entry.js +1 -0
  255. package/dist/mint-components/{p-e4e5168b.entry.js → p-ae1a283d.entry.js} +1 -1
  256. package/dist/mint-components/p-b0bcbf67.js +268 -0
  257. package/dist/mint-components/{p-e2f8b782.system.entry.js → p-b1918aeb.system.entry.js} +1 -1
  258. package/dist/mint-components/{p-c11ce36c.js → p-b22b94ac.js} +1 -1
  259. package/dist/mint-components/p-c11237bf.system.entry.js +1 -0
  260. package/dist/mint-components/{p-0221bfef.system.entry.js → p-c14b6ff9.system.entry.js} +1 -1
  261. package/dist/mint-components/{p-e1d01511.system.js → p-c1c9bd9d.system.js} +1 -1
  262. package/dist/mint-components/{p-c0a8476e.system.entry.js → p-c4b55529.system.entry.js} +1 -1
  263. package/dist/mint-components/p-c5debea4.entry.js +1 -0
  264. package/dist/mint-components/p-c8c4e727.system.entry.js +1 -0
  265. package/dist/mint-components/{p-a6d4cffd.system.entry.js → p-c8c83a9e.system.entry.js} +1 -1
  266. package/dist/mint-components/p-d67a6057.entry.js +1 -0
  267. package/dist/mint-components/{p-63136070.system.entry.js → p-d8d0ec81.system.entry.js} +1 -1
  268. package/dist/mint-components/p-d9c3f39a.system.entry.js +1 -0
  269. package/dist/mint-components/{p-48ec6605.system.js → p-dc7b06ef.system.js} +1 -1
  270. package/dist/mint-components/p-dced4933.system.entry.js +1 -0
  271. package/dist/mint-components/p-ddeba605.system.entry.js +1 -0
  272. package/dist/mint-components/{p-dcdbf128.system.js → p-dfb6765a.system.js} +1 -1
  273. package/dist/mint-components/{p-4ac2d13b.system.entry.js → p-e00abc43.system.entry.js} +1 -1
  274. package/dist/mint-components/{p-28d44352.js → p-e175ad25.js} +1 -1
  275. package/dist/mint-components/p-e28dd7a3.system.js +1 -0
  276. package/dist/mint-components/{p-fc942cbd.system.js → p-e2bf9132.system.js} +1 -1
  277. package/dist/mint-components/p-e39919d4.system.js +1 -0
  278. package/dist/mint-components/{p-f6d3a2d4.system.js → p-e3acae66.system.js} +1 -1
  279. package/dist/mint-components/{p-78640db1.system.entry.js → p-ea5afb36.system.entry.js} +1 -1
  280. package/dist/mint-components/p-ee461c80.js +1 -0
  281. package/dist/mint-components/p-eeca87d4.system.entry.js +1 -0
  282. package/dist/mint-components/p-f0e2df53.system.entry.js +1 -0
  283. package/dist/mint-components/{p-047a840f.system.entry.js → p-f86ba72a.system.entry.js} +1 -1
  284. package/dist/mint-components/{p-0ee797b8.system.js → p-fb7288a2.system.js} +1 -1
  285. package/dist/types/components/sqm-big-stat/sqm-big-stat.d.ts +6 -5
  286. package/dist/types/components/sqm-brand/sqm-brand.d.ts +1 -1
  287. package/dist/types/components/sqm-checkbox-field/sqm-checkbox-field.d.ts +1 -0
  288. package/dist/types/components/sqm-dropdown-field/sqm-dropdown-field.d.ts +1 -0
  289. package/dist/types/components/sqm-hero-image/sqm-hero-image.d.ts +1 -0
  290. package/dist/types/components/sqm-input-field/sqm-input-field.d.ts +1 -0
  291. package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +1 -0
  292. package/dist/types/components/sqm-portal-container/sqm-portal-container.d.ts +1 -1
  293. package/dist/types/components/sqm-portal-protected-route/sqm-portal-protected-route.d.ts +1 -0
  294. package/dist/types/components/sqm-portal-register/sqm-portal-register.d.ts +2 -0
  295. package/dist/types/components/sqm-portal-registration-form/PortalRegistrationForm.stories.d.ts +10 -0
  296. package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form-view.d.ts +32 -0
  297. package/dist/types/components/sqm-portal-registration-form/sqm-portal-registration-form.d.ts +76 -0
  298. package/dist/types/components/sqm-portal-registration-form/usePortalRegistrationForm.d.ts +25 -0
  299. package/dist/types/components/sqm-portal-reset-password/sqm-portal-reset-password.d.ts +1 -0
  300. package/dist/types/components/sqm-program-explainer-step/sqm-program-explainer-step.d.ts +1 -1
  301. package/dist/types/components/sqm-qa/sqm-qa.d.ts +4 -0
  302. package/dist/types/components/sqm-qa-referral-card/ReferralCard.stories.d.ts +14 -0
  303. package/dist/types/components/sqm-qa-referral-card/sqm-referral-card-view.d.ts +9 -0
  304. package/dist/types/components/sqm-qa-referral-card/sqm-referral-card.d.ts +20 -0
  305. package/dist/types/components/sqm-qa-tabs/Tabs.stories.d.ts +15 -0
  306. package/dist/types/components/sqm-qa-tabs/sqm-tabs-view.d.ts +9 -0
  307. package/dist/types/components/sqm-qa-tabs/sqm-tabs.d.ts +23 -0
  308. package/dist/types/components/sqm-qa-tabs/useTabs.d.ts +9 -0
  309. package/dist/types/components/sqm-referral-table/columns/sqm-referral-table-rewards-column.d.ts +1 -0
  310. package/dist/types/components/sqm-referral-table/sqm-referral-table.d.ts +2 -1
  311. package/dist/types/components/sqm-rewards-table/columns/RewardTableColumn.d.ts +1 -1
  312. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-plop-target.d.ts +11 -0
  313. package/dist/types/components/sqm-rewards-table/columns/sqm-rewards-table-status-column.d.ts +6 -2
  314. package/dist/types/components/sqm-rewards-table/sqm-rewards-table.d.ts +1 -1
  315. package/dist/types/components/sqm-scroll/sqm-scroll.d.ts +5 -2
  316. package/dist/types/components/sqm-share-button/sqm-share-button.d.ts +2 -0
  317. package/dist/types/components/sqm-tab/sqm-tab.d.ts +1 -1
  318. package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +5 -1
  319. package/dist/types/components/sqm-timeline/sqm-timeline-entry.d.ts +1 -1
  320. package/dist/types/components/sqm-titled-section/sqm-titled-section.d.ts +6 -2
  321. package/dist/types/components.d.ts +275 -12
  322. package/dist/types/global/android.d.ts +7 -0
  323. package/dist/types/global/demo.d.ts +1 -0
  324. package/dist/types/stories/features.d.ts +4 -0
  325. package/dist/types/stories/templates.d.ts +4 -0
  326. package/docs/docs.docx +0 -0
  327. package/docs/grapesjs.js +54 -0
  328. package/docs/raisins.json +1 -1
  329. package/grapesjs/grapesjs.js +1 -1
  330. package/package.json +3 -3
  331. package/dist/esm-es5/ShadowViewAddon-e2996624.js +0 -1
  332. package/dist/esm-es5/re-render-69774e13.js +0 -1
  333. package/dist/esm-es5/sqm-navigation-sidebar-item-view-51714c31.js +0 -1
  334. package/dist/esm-es5/use-callback-7e0bfd3b.js +0 -1
  335. package/dist/esm-es5/useChildElements-a8347aea.js +0 -1
  336. package/dist/esm-es5/useReferralTable-5cac5b13.js +0 -1
  337. package/dist/mint-components/p-03828842.system.entry.js +0 -1
  338. package/dist/mint-components/p-12a9ade0.entry.js +0 -99
  339. package/dist/mint-components/p-13086b8d.js +0 -1
  340. package/dist/mint-components/p-232672a2.entry.js +0 -13
  341. package/dist/mint-components/p-25ac7c14.system.entry.js +0 -1
  342. package/dist/mint-components/p-38d6112f.entry.js +0 -1
  343. package/dist/mint-components/p-3facf714.js +0 -268
  344. package/dist/mint-components/p-4a1f24ef.entry.js +0 -1
  345. package/dist/mint-components/p-4a2782fd.system.entry.js +0 -1
  346. package/dist/mint-components/p-4f8830b7.entry.js +0 -1
  347. package/dist/mint-components/p-4fe59c93.system.entry.js +0 -1
  348. package/dist/mint-components/p-60b01103.js +0 -1
  349. package/dist/mint-components/p-66ce7f0e.entry.js +0 -9
  350. package/dist/mint-components/p-71969ce5.system.entry.js +0 -1
  351. package/dist/mint-components/p-71ecbb3b.system.js +0 -1
  352. package/dist/mint-components/p-83e4168e.system.entry.js +0 -1
  353. package/dist/mint-components/p-91acec3d.entry.js +0 -159
  354. package/dist/mint-components/p-94096609.system.js +0 -1
  355. package/dist/mint-components/p-95398ce2.js +0 -1
  356. package/dist/mint-components/p-95bbe8a7.entry.js +0 -1
  357. package/dist/mint-components/p-982ad256.js +0 -1
  358. package/dist/mint-components/p-9eb6d960.entry.js +0 -1
  359. package/dist/mint-components/p-a57057c4.system.entry.js +0 -1
  360. package/dist/mint-components/p-ac6c93ee.entry.js +0 -1
  361. package/dist/mint-components/p-c7d34b6a.system.entry.js +0 -1
  362. package/dist/mint-components/p-cc6d91bd.entry.js +0 -1
  363. package/dist/mint-components/p-cccba50e.entry.js +0 -1
  364. package/dist/mint-components/p-d3cc0d60.system.js +0 -1
  365. package/dist/mint-components/p-d7bc7e50.entry.js +0 -1
  366. package/dist/mint-components/p-d815567f.system.js +0 -1
  367. package/dist/mint-components/p-e0d5d38e.system.entry.js +0 -1
  368. package/dist/mint-components/p-ef3f3523.entry.js +0 -1
  369. package/dist/mint-components/p-f7fba9e4.system.entry.js +0 -1
  370. package/dist/mint-components/p-fd2852a7.entry.js +0 -1
  371. package/dist/mint-components/p-fd4d90b9.system.js +0 -1
  372. package/dist/mint-components/p-ff932bfa.entry.js +0 -1
@@ -1,20 +1,21 @@
1
1
  import { r as registerInstance, h as h$1, c as Host } from './index-17b4da69.js';
2
- import { m as h, e as useEffect, k as useState, y, o as d, f as useRef, b as browser, u as useReducer } from './stencil-hooks.module-acc8a613.js';
3
- import { i as intl } from './global-5c84f57f.js';
4
- import { u as useCallback } from './use-callback-7e0bfd3b.js';
5
- import { j as jn, P, d as dist, i as ie, b as sn, q as qe, M, A as An, r as rn, c as dn, g as $e, E as Ee, D as De, H as He, l as ln, R as Rn } from './index.module-f5e17a4e.js';
2
+ import { m as h, e as useEffect, k as useState, o as d, i as useRef, b as browser, u as useReducer } from './stencil-hooks.module-e39af977.js';
3
+ import { i as intl } from './global-59aa17be.js';
4
+ import { u as useCallback } from './use-callback-697e2ff0.js';
5
+ import { T, k, d as dist, o as oe, a as kt, O as Oe, F, M, P as Pt, c as Ft, Z as Ze, A as Ae, N as Ne, i as at, R as Rt, H } from './index.module-c6c6943f.js';
6
6
  import './extends-c31f1eff.js';
7
7
  import { j as jsonpointer } from './jsonpointer-388a7082.js';
8
8
  import { c as cjs } from './cjs-bdfb4486.js';
9
9
  import './mixins-f60a614c.js';
10
10
  import { c as createStyleSheet } from './JSS-f00f9536.js';
11
- import { a as useRequestRerender } from './re-render-69774e13.js';
12
- import { u as useChildElements } from './useChildElements-a8347aea.js';
13
- import './luxon-f44215d9.js';
11
+ import { a as useRequestRerender } from './re-render-e804551e.js';
12
+ import { u as useChildElements } from './useChildElements-31287783.js';
13
+ import './luxon-578505e2.js';
14
14
  import { g as getProps, a as getMissingProps, s as sanitizeUrlPath } from './utils-334c1e34.js';
15
15
  import './sqm-text-span-view-0ba1484d.js';
16
16
  import './sqm-portal-container-view-ca454627.js';
17
- import { c as useDemoBigStat, K as useBigStat, B as BigStatView, H as autoColorScaleCss, G as CardFeedView, C as CheckboxFieldView, D as DropdownFieldView, E as EditProfileView, I as InputFieldView, M as withShadowView, L as LeaderboardView, N as NameFieldsView, e as PortalChangePasswordView, P as PortalFrameView, f as PortalLoginView, g as PortalRegisterView, R as ReferralIframeView, O as demoRewardExchange, i as RewardExchangeView, Q as pathToRegexp, b as useShareButton, S as ShareButtonView, a as ShareLinkView, u as useShareLink, d as StatContainerView, T as TaskCardView } from './ShadowViewAddon-e2996624.js';
17
+ import { F as FORM_VALIDATION_CONTEXT, u as useValidationState, A as AsYouType } from './useValidationState-f5db8783.js';
18
+ import { c as useDemoBigStat, K as useBigStat, B as BigStatView, H as autoColorScaleCss, G as CardFeedView, C as CheckboxFieldView, D as DropdownFieldView, E as EditProfileView, I as InputFieldView, M as withShadowView, L as LeaderboardView, N as NameFieldsView, e as PortalChangePasswordView, P as PortalFrameView, f as PortalLoginView, g as PortalRegisterView, R as ReferralIframeView, O as demoRewardExchange, i as RewardExchangeView, Q as pathToRegexp, b as useShareButton, S as ShareButtonView, a as ShareLinkView, u as useShareLink, d as StatContainerView, T as TaskCardView } from './ShadowViewAddon-82a3c62b.js';
18
19
  import './sqm-portal-section-view-6c249c74.js';
19
20
 
20
21
  const BigStat = class {
@@ -24,6 +25,7 @@ const BigStat = class {
24
25
  * Controls the order of the stat value & description column
25
26
  *
26
27
  * @uiName Flex Reverse
28
+ * @default
27
29
  */
28
30
  this.flexReverse = false;
29
31
  this.ignored = true;
@@ -32,8 +34,8 @@ const BigStat = class {
32
34
  disconnectedCallback() { }
33
35
  render() {
34
36
  var _a;
35
- const { props, label } = jn() ? useDemoBigStat(this) : useBigStat(this);
36
- const host = P();
37
+ const { props, label } = T() ? useDemoBigStat(this) : useBigStat(this);
38
+ const host = k();
37
39
  const hasLabel = !!((_a = host.innerHTML) === null || _a === void 0 ? void 0 : _a.trim());
38
40
  const labelSlot = h$1("slot", { name: "label" }, hasLabel ? h$1("slot", null) : label);
39
41
  return h$1(BigStatView, Object.assign({}, props, { labelSlot: labelSlot }));
@@ -145,7 +147,7 @@ const styleString = sheet.toString();
145
147
  function RequiredPropsError({ missingProps, heading = "There was a problem loading this section", subheading = "There was a technical problem that prevented this section from loading. Please contact us with the link to this page.", description = "Error occured while loading <{tagName}>. Values for the following attributes are missing:", }, children) {
146
148
  if (!missingProps)
147
149
  return false;
148
- const host = P();
150
+ const host = k();
149
151
  const [detailsOpen, setDetailsOpen] = useState(false);
150
152
  return (h$1("sl-alert", { type: "danger", open: true },
151
153
  h$1("style", { type: "text/css" }, styleString),
@@ -173,13 +175,6 @@ function RequiredPropsError({ missingProps, heading = "There was a problem loadi
173
175
  h$1("div", { class: sheet.classes.Children }, children)));
174
176
  }
175
177
 
176
- const FORM_VALIDATION_CONTEXT = "sq:validation-state";
177
- function useValidationState(formState) {
178
- const host = P();
179
- const [validationState, setValidationState] = y(host, FORM_VALIDATION_CONTEXT, formState);
180
- return { validationState, setValidationState };
181
- }
182
-
183
178
  function useCheckboxField() {
184
179
  const validationState = d(FORM_VALIDATION_CONTEXT);
185
180
  const [checked, setChecked] = useState(false);
@@ -218,6 +213,7 @@ const CheckboxField = class {
218
213
  this.errorMessage = "Must be checked";
219
214
  /**
220
215
  * @uiName Optional
216
+ * @default
221
217
  */
222
218
  this.checkboxOptional = false;
223
219
  h(this);
@@ -230,13 +226,13 @@ const CheckboxField = class {
230
226
  value: this.checkboxName,
231
227
  },
232
228
  ]);
233
- if (!jn() && missingProps) {
229
+ if (!T() && missingProps) {
234
230
  return (h$1(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
235
231
  }
236
232
  const content = {
237
233
  ...getProps(this),
238
234
  };
239
- const { states, callbacks } = jn()
235
+ const { states, callbacks } = T()
240
236
  ? useCheckboxFieldDemo(this)
241
237
  : useCheckboxField();
242
238
  return (h$1(CheckboxFieldView, { states: states, content: content, callbacks: callbacks }));
@@ -344,6 +340,7 @@ const DropdownField = class {
344
340
  this.errorMessage = "Select an option";
345
341
  /**
346
342
  * @uiName Optional
343
+ * @default
347
344
  */
348
345
  this.dropdownOptional = false;
349
346
  h(this);
@@ -356,14 +353,14 @@ const DropdownField = class {
356
353
  value: this.dropdownName,
357
354
  },
358
355
  ]);
359
- if (!jn() && missingProps) {
356
+ if (!T() && missingProps) {
360
357
  return (h$1(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this drop down field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }, h$1("slot", null)));
361
358
  }
362
359
  const content = {
363
360
  ...getProps(this),
364
361
  selectOptions: h$1("slot", null),
365
362
  };
366
- const { states } = jn()
363
+ const { states } = T()
367
364
  ? useDropdownFieldDemo(this)
368
365
  : useDropdownField();
369
366
  return (h$1(DropdownFieldView, { states: states, content: content }));
@@ -420,13 +417,13 @@ const defaultFormState = {
420
417
  error: "",
421
418
  };
422
419
  function useEditProfile(props) {
423
- const userIdent = ie();
420
+ const userIdent = oe();
424
421
  const [showEdit, setShowEdit] = useState(false);
425
422
  const [error, setError] = useState("");
426
423
  const [userData, setUserData] = useState(undefined);
427
424
  const [formState, setFormState] = useState(defaultFormState);
428
- const userDataResponse = sn(GET_USER, {}, !(userIdent === null || userIdent === void 0 ? void 0 : userIdent.jwt));
429
- const [upsertUser, upsertUserResponse] = qe(UPSERT_USER);
425
+ const userDataResponse = kt(GET_USER, {}, !(userIdent === null || userIdent === void 0 ? void 0 : userIdent.jwt));
426
+ const [upsertUser, upsertUserResponse] = Oe(UPSERT_USER);
430
427
  useEffect(() => {
431
428
  if ((upsertUserResponse === null || upsertUserResponse === void 0 ? void 0 : upsertUserResponse.loading) || !showEdit)
432
429
  return;
@@ -540,7 +537,7 @@ const EditProfile = class {
540
537
  }
541
538
  disconnectedCallback() { }
542
539
  render() {
543
- const props = jn()
540
+ const props = T()
544
541
  ? useEditProfileDemo(getProps(this))
545
542
  : useEditProfile(getProps(this));
546
543
  return h$1(EditProfileView, Object.assign({}, props));
@@ -773,6 +770,7 @@ const HeroImage = class {
773
770
  this.imageMobilePos = "top";
774
771
  /**
775
772
  * @uiName Open Link in New Tab
773
+ * @default
776
774
  */
777
775
  this.buttonNewTab = false;
778
776
  /**
@@ -836,6 +834,7 @@ const InputField = class {
836
834
  this.errorMessage = "Cannot be empty";
837
835
  /**
838
836
  * @uiName Optional
837
+ * @default
839
838
  */
840
839
  this.fieldOptional = false;
841
840
  h(this);
@@ -851,10 +850,10 @@ const InputField = class {
851
850
  value: this.fieldName,
852
851
  },
853
852
  ]);
854
- if (!jn() && missingProps) {
853
+ if (!T() && missingProps) {
855
854
  return (h$1(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this form", subheading: "A technical problem prevented this input field from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
856
855
  }
857
- const { states } = jn() ? useInputFieldDemo(this) : useInputField();
856
+ const { states } = T() ? useInputFieldDemo(this) : useInputField();
858
857
  return h$1(InputFieldView, { states: states, content: content });
859
858
  }
860
859
  };
@@ -910,11 +909,11 @@ const GET_RANK = dist.gql `
910
909
  `;
911
910
  function useLeaderboard(props) {
912
911
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
913
- const programIdContext = M();
912
+ const programIdContext = F();
914
913
  // Default to context, overriden by props
915
914
  const programId = (_a = props.programId) !== null && _a !== void 0 ? _a : programIdContext;
916
- const user = ie();
917
- const locale = An();
915
+ const user = oe();
916
+ const locale = M();
918
917
  const variables = programId
919
918
  ? {
920
919
  type: props.leaderboardType,
@@ -933,8 +932,8 @@ function useLeaderboard(props) {
933
932
  if (props.maxRows > 0) {
934
933
  variables["limit"] = props.maxRows;
935
934
  }
936
- const { data: leaderboardData, loading: loadingLeaderboard } = sn(GET_LEADERBOARD, variables, !(user === null || user === void 0 ? void 0 : user.jwt));
937
- const { data: rankData } = sn(GET_RANK, variables, !(user === null || user === void 0 ? void 0 : user.jwt));
935
+ const { data: leaderboardData, loading: loadingLeaderboard } = kt(GET_LEADERBOARD, variables, !(user === null || user === void 0 ? void 0 : user.jwt));
936
+ const { data: rankData } = kt(GET_RANK, variables, !(user === null || user === void 0 ? void 0 : user.jwt));
938
937
  const leaderboardRows = (_b = leaderboardData === null || leaderboardData === void 0 ? void 0 : leaderboardData.userLeaderboard) === null || _b === void 0 ? void 0 : _b.rows;
939
938
  const flattenedLeaderboard = getFlattenedLeaderboard(leaderboardRows);
940
939
  const sortedLeaderboard = flattenedLeaderboard === null || flattenedLeaderboard === void 0 ? void 0 : flattenedLeaderboard.sort(function (a, b) {
@@ -984,6 +983,7 @@ const Leaderboard = class {
984
983
  * Hide the viewer's leaderboard row if not in the top results.
985
984
  *
986
985
  * @uiName Hide Viewing User
986
+ * @default
987
987
  */
988
988
  this.hideViewer = false;
989
989
  /**
@@ -1019,7 +1019,7 @@ const Leaderboard = class {
1019
1019
  showRank: this.showRank,
1020
1020
  };
1021
1021
  const demoProps = { ...props, demoData: this.demoData };
1022
- const viewprops = jn()
1022
+ const viewprops = T()
1023
1023
  ? useLeaderboardDemo(demoProps)
1024
1024
  : useLeaderboard(props);
1025
1025
  return h$1(LeaderboardView, Object.assign({}, viewprops));
@@ -1129,7 +1129,7 @@ const NameFields = class {
1129
1129
  }
1130
1130
  disconnectedCallback() { }
1131
1131
  render() {
1132
- const { states } = jn() ? useNameFieldsDemo(this) : useNameFields(this);
1132
+ const { states } = T() ? useNameFieldsDemo(this) : useNameFields(this);
1133
1133
  return h$1(NameFieldsView, { states: states });
1134
1134
  }
1135
1135
  };
@@ -1160,12 +1160,12 @@ function NavigationMenuView(props) {
1160
1160
  }
1161
1161
 
1162
1162
  function handleMenu(e) {
1163
- dn.push(e.detail.item.value);
1163
+ Ft.push(e.detail.item.value);
1164
1164
  }
1165
1165
  function useNavigationMenu(props) {
1166
1166
  const ref = useRef();
1167
- const [, rerender] = rn();
1168
- const user = ie();
1167
+ const [, rerender] = Pt();
1168
+ const user = oe();
1169
1169
  useEffect(() => {
1170
1170
  var _a;
1171
1171
  (_a = ref.current) === null || _a === void 0 ? void 0 : _a.addEventListener("sl-select", (e) => handleMenu(e));
@@ -1194,7 +1194,7 @@ const NavigationMenu = class {
1194
1194
  }
1195
1195
  disconnectedCallback() { }
1196
1196
  render() {
1197
- const props = jn()
1197
+ const props = T()
1198
1198
  ? useNavigationMenuDemo(getProps(this))
1199
1199
  : useNavigationMenu(getProps(this));
1200
1200
  return (h$1(Host, { slot: "sqm-navigation-menu" }, h$1(NavigationMenuView, Object.assign({}, props))));
@@ -1218,12 +1218,12 @@ function useNavigationMenuDemo(props) {
1218
1218
  NavigationMenu.style = sqmNavigationMenuCss;
1219
1219
 
1220
1220
  function usePortalChangePassword(props) {
1221
- var _a, _b, _c, _d;
1222
- const [request, { loading, errors, data }] = $e();
1221
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1222
+ const [request, { loading, errors, data }] = Ze();
1223
1223
  const [open, setOpen] = useState(false);
1224
1224
  const [error, setError] = useState("");
1225
1225
  const [success, setSuccess] = useState(false);
1226
- const user = ie();
1226
+ const user = oe();
1227
1227
  const submit = async (event) => {
1228
1228
  var _a;
1229
1229
  setSuccess(false);
@@ -1256,7 +1256,7 @@ function usePortalChangePassword(props) {
1256
1256
  open,
1257
1257
  loading,
1258
1258
  success,
1259
- error: error || ((_d = (_c = (_b = errors === null || errors === void 0 ? void 0 : errors.response) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.message),
1259
+ error: error || ((_e = (_d = (_c = (_b = errors === null || errors === void 0 ? void 0 : errors.response) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.extensions) === null || _e === void 0 ? void 0 : _e.message) || ((_h = (_g = (_f = errors === null || errors === void 0 ? void 0 : errors.response) === null || _f === void 0 ? void 0 : _f.errors) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.message),
1260
1260
  content: {
1261
1261
  modalChangePasswordHeader: props.modalChangePasswordHeader,
1262
1262
  cancelText: props.cancelText,
@@ -1328,7 +1328,7 @@ const PortalChangePassword = class {
1328
1328
  }
1329
1329
  disconnectedCallback() { }
1330
1330
  render() {
1331
- const { states, callbacks } = jn()
1331
+ const { states, callbacks } = T()
1332
1332
  ? usePortalChangePasswordDemo(this)
1333
1333
  : usePortalChangePassword(this);
1334
1334
  return h$1(PortalChangePasswordView, { states: states, callbacks: callbacks });
@@ -1358,7 +1358,7 @@ function usePortalChangePasswordDemo(props) {
1358
1358
  }
1359
1359
 
1360
1360
  function usePortalFrame(footerContent, headerContent) {
1361
- const [, rerender] = rn();
1361
+ const [, rerender] = Pt();
1362
1362
  return {
1363
1363
  data: {
1364
1364
  footer: footerContent,
@@ -1380,7 +1380,7 @@ const PortalFrame = class {
1380
1380
  render() {
1381
1381
  const footerContent = h$1("slot", { name: "footer" });
1382
1382
  const headerContent = h$1("slot", { name: "header" });
1383
- const props = jn()
1383
+ const props = T()
1384
1384
  ? usePortalFrameDemo(footerContent, headerContent, this)
1385
1385
  : usePortalFrame(footerContent, headerContent);
1386
1386
  return (h$1(PortalFrameView, Object.assign({}, props), h$1("slot", null)));
@@ -1402,8 +1402,8 @@ function usePortalFrameDemo(footerContent, headerContent, props) {
1402
1402
  }
1403
1403
 
1404
1404
  function usePortalLogin(props) {
1405
- var _a, _b, _c, _d;
1406
- const [request, { loading, errors, data }] = Ee();
1405
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1406
+ const [request, { loading, errors, data }] = Ae();
1407
1407
  const [error, setError] = useState("");
1408
1408
  const urlParams = new URLSearchParams(window.location.search);
1409
1409
  const nextPageOverride = urlParams.get("nextPage");
@@ -1421,7 +1421,7 @@ function usePortalLogin(props) {
1421
1421
  if ((_a = data === null || data === void 0 ? void 0 : data.authenticateManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token) {
1422
1422
  urlParams.delete("nextPage");
1423
1423
  const url = sanitizeUrlPath(nextPageOverride || props.nextPage);
1424
- dn.push(url.href);
1424
+ Ft.push(url.href);
1425
1425
  }
1426
1426
  }, [(_a = data === null || data === void 0 ? void 0 : data.authenticateManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token]);
1427
1427
  useEffect(() => {
@@ -1430,7 +1430,8 @@ function usePortalLogin(props) {
1430
1430
  setError("Network request failed.");
1431
1431
  }
1432
1432
  }, [errors]);
1433
- const errorMessage = ((_d = (_c = (_b = errors === null || errors === void 0 ? void 0 : errors.response) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.message) || error;
1433
+ const errorMessage = ((_e = (_d = (_c = (_b = errors === null || errors === void 0 ? void 0 : errors.response) === null || _b === void 0 ? void 0 : _b.errors) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.extensions) === null || _e === void 0 ? void 0 : _e.message) || ((_h = (_g = (_f = errors === null || errors === void 0 ? void 0 : errors.response) === null || _f === void 0 ? void 0 : _f.errors) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.message) ||
1434
+ error;
1434
1435
  return {
1435
1436
  states: {
1436
1437
  loading,
@@ -1504,12 +1505,12 @@ const PortalLogin = class {
1504
1505
  }
1505
1506
  disconnectedCallback() { }
1506
1507
  render() {
1507
- const { states, callbacks } = jn()
1508
+ const { states, callbacks } = T()
1508
1509
  ? useLoginDemo(this)
1509
1510
  : usePortalLogin(this);
1510
1511
  const content = {
1511
- forgotPasswordButton: (h$1("slot", { name: "forgotPassword" }, h$1("a", { onClick: () => dn.push(states.forgotPasswordPath) }, this.forgotPasswordLabel))),
1512
- secondaryButton: (h$1("slot", { name: "secondaryButton" }, h$1("sl-button", { type: "text", disabled: states.loading, onClick: () => dn.push(states.registerPath) }, this.registerLabel))),
1512
+ forgotPasswordButton: (h$1("slot", { name: "forgotPassword" }, h$1("a", { onClick: () => Ft.push(states.forgotPasswordPath) }, this.forgotPasswordLabel))),
1513
+ secondaryButton: (h$1("slot", { name: "secondaryButton" }, h$1("sl-button", { type: "text", disabled: states.loading, onClick: () => Ft.push(states.registerPath) }, this.registerLabel))),
1513
1514
  emailLabel: this.emailLabel,
1514
1515
  passwordLabel: this.passwordLabel,
1515
1516
  submitLabel: this.submitLabel,
@@ -1534,3882 +1535,11 @@ function useLoginDemo(props) {
1534
1535
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
1535
1536
  }
1536
1537
 
1537
- // This file is a workaround for a bug in web browsers' "native"
1538
- // ES6 importing system which is uncapable of importing "*.json" files.
1539
- // https://github.com/catamphetamine/libphonenumber-js/issues/239
1540
- const metadata = {"version":4,"country_calling_codes":{"1":["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],"7":["RU","KZ"],"20":["EG"],"27":["ZA"],"30":["GR"],"31":["NL"],"32":["BE"],"33":["FR"],"34":["ES"],"36":["HU"],"39":["IT","VA"],"40":["RO"],"41":["CH"],"43":["AT"],"44":["GB","GG","IM","JE"],"45":["DK"],"46":["SE"],"47":["NO","SJ"],"48":["PL"],"49":["DE"],"51":["PE"],"52":["MX"],"53":["CU"],"54":["AR"],"55":["BR"],"56":["CL"],"57":["CO"],"58":["VE"],"60":["MY"],"61":["AU","CC","CX"],"62":["ID"],"63":["PH"],"64":["NZ"],"65":["SG"],"66":["TH"],"81":["JP"],"82":["KR"],"84":["VN"],"86":["CN"],"90":["TR"],"91":["IN"],"92":["PK"],"93":["AF"],"94":["LK"],"95":["MM"],"98":["IR"],"211":["SS"],"212":["MA","EH"],"213":["DZ"],"216":["TN"],"218":["LY"],"220":["GM"],"221":["SN"],"222":["MR"],"223":["ML"],"224":["GN"],"225":["CI"],"226":["BF"],"227":["NE"],"228":["TG"],"229":["BJ"],"230":["MU"],"231":["LR"],"232":["SL"],"233":["GH"],"234":["NG"],"235":["TD"],"236":["CF"],"237":["CM"],"238":["CV"],"239":["ST"],"240":["GQ"],"241":["GA"],"242":["CG"],"243":["CD"],"244":["AO"],"245":["GW"],"246":["IO"],"247":["AC"],"248":["SC"],"249":["SD"],"250":["RW"],"251":["ET"],"252":["SO"],"253":["DJ"],"254":["KE"],"255":["TZ"],"256":["UG"],"257":["BI"],"258":["MZ"],"260":["ZM"],"261":["MG"],"262":["RE","YT"],"263":["ZW"],"264":["NA"],"265":["MW"],"266":["LS"],"267":["BW"],"268":["SZ"],"269":["KM"],"290":["SH","TA"],"291":["ER"],"297":["AW"],"298":["FO"],"299":["GL"],"350":["GI"],"351":["PT"],"352":["LU"],"353":["IE"],"354":["IS"],"355":["AL"],"356":["MT"],"357":["CY"],"358":["FI","AX"],"359":["BG"],"370":["LT"],"371":["LV"],"372":["EE"],"373":["MD"],"374":["AM"],"375":["BY"],"376":["AD"],"377":["MC"],"378":["SM"],"380":["UA"],"381":["RS"],"382":["ME"],"383":["XK"],"385":["HR"],"386":["SI"],"387":["BA"],"389":["MK"],"420":["CZ"],"421":["SK"],"423":["LI"],"500":["FK"],"501":["BZ"],"502":["GT"],"503":["SV"],"504":["HN"],"505":["NI"],"506":["CR"],"507":["PA"],"508":["PM"],"509":["HT"],"590":["GP","BL","MF"],"591":["BO"],"592":["GY"],"593":["EC"],"594":["GF"],"595":["PY"],"596":["MQ"],"597":["SR"],"598":["UY"],"599":["CW","BQ"],"670":["TL"],"672":["NF"],"673":["BN"],"674":["NR"],"675":["PG"],"676":["TO"],"677":["SB"],"678":["VU"],"679":["FJ"],"680":["PW"],"681":["WF"],"682":["CK"],"683":["NU"],"685":["WS"],"686":["KI"],"687":["NC"],"688":["TV"],"689":["PF"],"690":["TK"],"691":["FM"],"692":["MH"],"850":["KP"],"852":["HK"],"853":["MO"],"855":["KH"],"856":["LA"],"880":["BD"],"886":["TW"],"960":["MV"],"961":["LB"],"962":["JO"],"963":["SY"],"964":["IQ"],"965":["KW"],"966":["SA"],"967":["YE"],"968":["OM"],"970":["PS"],"971":["AE"],"972":["IL"],"973":["BH"],"974":["QA"],"975":["BT"],"976":["MN"],"977":["NP"],"992":["TJ"],"993":["TM"],"994":["AZ"],"995":["GE"],"996":["KG"],"998":["UZ"]},"countries":{"AC":["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],"AD":["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],"AE":["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],"AF":["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],"AG":["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([457]\\d{6})$","268$1",0,"268"],"AI":["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2457]\\d{6})$","264$1",0,"264"],"AL":["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],"AM":["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],"AO":["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],"AR":["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],"AS":["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"1|([267]\\d{6})$","684$1",0,"684"],"AT":["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],"AU":["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7,8}|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"0|(183[12])",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:83[0-38]|93[0-4])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}",[6,8,10]]],"0011"],"AW":["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],"AX":["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],"AZ":["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365|46","1[28]|2|365(?:[0-46-9]|5[0-35-9])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],"BA":["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],"BB":["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","246$1",0,"246"],"BD":["880","00","1\\d{9}|2\\d{7,8}|88\\d{4,6}|(?:8[0-79]|9\\d)\\d{4,8}|(?:[346]\\d|[57])\\d{5,8}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],"BE":["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],"BF":["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],"BG":["359","00","[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],"BH":["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[047]"]]]],"BI":["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],"BJ":["229","00","[25689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[25689]"]]]],"BL":["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],"BM":["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","441$1",0,"441"],"BN":["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],"BO":["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],"BQ":["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],"BR":["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-24679]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],"BS":["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([3-8]\\d{6})$","242$1",0,"242"],"BT":["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],"BW":["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-79]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],"BY":["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],"BZ":["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],"CA":["1","011","(?:[2-8]\\d|90)\\d{8}",[10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|6[578])|4(?:03|1[68]|3[178]|50|74)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47|72)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}"],0,0,0,["600[2-9]\\d{6}"]]],"CC":["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d|8[0-24-9])\\d{7}|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:83[0-38]|93[0-4])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}",[6,8,10]]],"0011"],"CD":["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],"CF":["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],"CG":["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["801"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],"CH":["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],"CI":["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],"CK":["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],"CL":["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-3]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],"CM":["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],"CN":["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","(?:10|2[0-57-9])(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"0|(1(?:[12]\\d|79)\\d\\d)",0,0,0,0,"00"],"CO":["57","00(?:4(?:[14]4|56)|[579])","(?:(?:1\\d|3)\\d{3}|9101)\\d{6}|[124-8]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1 $2",["[14][2-9]|[25-8]"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["[39]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],"CR":["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],"CU":["53","119","[27]\\d{6,7}|[34]\\d{5,7}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["5"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],"CV":["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],"CW":["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],"CX":["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d|8[0-24-9])\\d{7}|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:83[0-38]|93[0-4])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}",[6,8,10]]],"0011"],"CY":["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],"CZ":["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],"DE":["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:[12]\\d|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[05]\\d|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],"DJ":["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],"DK":["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],"DM":["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","767$1",0,"767"],"DO":["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],"DZ":["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],"EC":["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],"EE":["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],"EG":["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[189]"],"0$1"]],"0"],"EH":["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],"ER":["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],"ES":["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],"ET":["251","00","(?:11|[2-59]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-59]"],"0$1"]],"0"],"FI":["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],"FJ":["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],"FK":["500","00","[2-7]\\d{4}",[5]],"FM":["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],"FO":["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],"FR":["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],"GA":["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]]],0,0,"0(11\\d{6}|6[256]\\d{6}|7[47]\\d{6})","$1"],"GB":["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[023])|4(?:[0-5]\\d\\d|69[7-9]|70[059])|(?:5[0-26-9]|[78][0-49])\\d\\d|6(?:[0-4]\\d\\d|50[259]))|2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d\\d|1(?:[0-7]\\d\\d|8(?:[02]\\d|1[278])))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],"GD":["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","473$1",0,"473"],"GE":["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],"GF":["594","00","(?:[56]94|80\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"GG":["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"0|([25-9]\\d{5})$","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],"GH":["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],"GI":["350","00","(?:[25]\\d\\d|606)\\d{5}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],"GL":["299","00","(?:19|[2-689]\\d)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-689]"]]]],"GM":["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],"GN":["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],"GP":["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|1[0-2]|2[0-68]|3[1289]|4[0-24-9]|5[3-579]|6[0189]|7[08]|8[0-689]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],"GQ":["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],"GR":["30","00","5005000\\d{3}|8\\d{9,10}|(?:[269]\\d|70)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["8"]]]],"GT":["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],"GU":["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"1|([3-9]\\d{6})$","671$1",0,"671"],"GW":["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],"GY":["592","001","(?:862\\d|9008)\\d{3}|(?:[2-46]\\d|77)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-46-9]"]]]],"HK":["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4}(?:\\d(?:\\d(?:\\d{4})?)?)?|(?:[235-79]\\d|46)\\d{6}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],"HN":["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],"HR":["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],"HT":["509","00","[2-489]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-489]"]]]],"HU":["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],"ID":["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],"IE":["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"IL":["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],"IM":["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([25-8]\\d{5})$","1624$1",0,"74576|(?:16|7[56])24"],"IN":["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],"IO":["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],"IQ":["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],"IR":["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],"IS":["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],"IT":["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[245])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1[4679]|[38]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d\\d|89(?:2|4[5-9]\\d))\\d{3}|89[45][0-4]\\d\\d|(?:1(?:44|6[346])|89(?:5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],"JE":["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([0-24-8]\\d{5})$","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\d{6}"],["56\\d{8}"]]],"JM":["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],"JO":["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],"JP":["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0"],"KE":["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],"KG":["996","00","8\\d{9}|(?:[235-8]\\d|99)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"KH":["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],"KI":["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],"KM":["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],"KN":["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","869$1",0,"869"],"KP":["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],"KR":["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],"KW":["965","00","(?:18|[2569]\\d\\d)\\d{5}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[25]"]]]],"KY":["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","345$1",0,"345"],"KZ":["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],"LA":["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],"LB":["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],"LC":["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","758$1",0,"758"],"LI":["423","00","90\\d{5}|(?:[2378]|6\\d\\d)\\d{6}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[237-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"0|(1001)"],"LK":["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],"LR":["231","00","(?:2|33|5\\d|77|88)\\d{7}|[4-6]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3578]"],"0$1"]],"0"],"LS":["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],"LT":["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],"LU":["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],"LV":["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],"LY":["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],"MA":["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29|38)[89]","5(?:29|38)[89]0"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:29(?:[189][05]|2[29]|3[01])|38[89][05])\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|90)|3(?:[0-47]\\d|5[02-9]|6[02-8]|80|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:0\\d|1[0-3]|6[1267]|7[0-57]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],"MC":["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],"MD":["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],"ME":["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],"MF":["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],"MG":["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"0|([24-9]\\d{6})$","20$1"],"MH":["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],"MK":["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],"ML":["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],"MM":["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],"MN":["976","001","[12]\\d{7,9}|[57-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[57-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],"MO":["853","00","08005\\d\\d|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],"MP":["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","670$1",0,"670"],"MQ":["596","00","(?:69|80)\\d{7}|(?:59|97)6\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"MR":["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],"MS":["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"1|([34]\\d{6})$","664$1",0,"664"],"MT":["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],"MU":["230","0(?:0|[24-7]0|3[03])","(?:5|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["5"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],"MV":["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[3467]|9[13-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],"MW":["265","00","(?:[19]\\d|[23]1|77|88)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],"MX":["52","0[09]","199[1-9]\\d{7}|(?:1(?:[01467]\\d|[235][1-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],"MY":["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9])|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1[36-8]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],"MZ":["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],"NA":["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],"NC":["687","00","[2-57-9]\\d{5}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[2-57-9]"]]]],"NE":["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[04]"]]]],"NF":["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],"NG":["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],"NI":["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],"NL":["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|[89]\\d{6,9}|1\\d{4,5}",[5,6,7,8,9,10],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-57-9]"],"0$1"]],"0"],"NO":["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[489]|59"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],"NP":["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-579]|6[2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],"NR":["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],"NU":["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],"NZ":["64","0(?:0|161)","[29]\\d{7,9}|50\\d{5}(?:\\d{2,3})?|6[0-35-9]\\d{6}|7\\d{7,8}|8\\d{4,9}|(?:11\\d|[34])\\d{7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-579]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|[89]0","50(?:[0367]|88)|[89]0"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[59]|80"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7|86"],"0$1"]],"0",0,0,0,0,0,0,"00"],"OM":["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],"PA":["507","00","8\\d{9}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],"PE":["51","19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,0," Anexo "],"PF":["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],"PG":["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],"PH":["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],"PK":["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],"PL":["48","00","6\\d{5}(?:\\d{2})?|8\\d{9}|[1-9]\\d{6}(?:\\d{2})?",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],"PM":["508","00","(?:[45]|80\\d\\d)\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],"PR":["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],"PS":["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],"PT":["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],"PW":["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],"PY":["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],"QA":["974","00","[2-7]\\d{7}|(?:2\\d\\d|800)\\d{4}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["2[126]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]]]],"RE":["262","00","9769\\d{5}|(?:26|[68]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,"26[23]|69|[89]"],"RO":["40","00","(?:[237]\\d|[89]0)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],"RS":["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],"RU":["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],"RW":["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]]],"0"],"SA":["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],"SB":["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],"SC":["248","010|0[0-2]","8000\\d{3}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],"SD":["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],"SE":["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],"SG":["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-4]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],"SH":["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],"SI":["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],"SJ":["47","00","0\\d{4}|(?:[489]\\d|[57]9)\\d{6}",[5,8],0,0,0,0,0,0,"79"],"SK":["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],"SL":["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],"SM":["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],"SN":["221","00","(?:[378]\\d{4}|93330)\\d{4}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],"SO":["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["24|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3478]|64|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[1-35-9]|9[2-9]"]]],"0"],"SR":["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],"SS":["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],"ST":["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],"SV":["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],"SX":["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|(5\\d{6})$","721$1",0,"721"],"SY":["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],"SZ":["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],"TA":["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],"TC":["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"1|([2-479]\\d{6})$","649$1",0,"649"],"TD":["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],"TG":["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],"TH":["66","00[1-9]","1\\d{9}|[1689]\\d{8}|[1-57]\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],"TJ":["992","810","(?:00|11|[2-57-9]\\d)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"],0,1],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"],0,1],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"],0,1],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02-57-9]|11"],0,1]],"8",0,0,0,0,0,0,"8~10"],"TK":["690","00","[2-47]\\d{3,6}",[4,5,6,7]],"TL":["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],"TM":["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],"TN":["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],"TO":["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],"TR":["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],"TT":["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-46-8]\\d{6})$","868$1",0,"868"],"TV":["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],"TW":["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],"TZ":["255","00[056]","(?:[26-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],"UA":["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["4[45][0-5]|5(?:0|6[37])|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]","4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["[3-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],"UG":["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],"US":["1","011","[2-9]\\d{9}",[10],[["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}"]]],"UY":["598","0(?:0|1[3-9]\\d)","4\\d{9}|[249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[24]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"]],"0",0,0,0,0,0,0,"00"," int. "],"UZ":["998","810","(?:33|55|[679]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[35-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],"VA":["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],"VC":["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","784$1",0,"784"],"VE":["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],"VG":["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-578]\\d{6})$","284$1",0,"284"],"VI":["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","340$1",0,"340"],"VN":["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[69]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3578]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],"VU":["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],"WF":["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],"WS":["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],"XK":["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],"YE":["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7[24-68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],"YT":["262","00","80\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,"269|63"],"ZA":["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],"ZM":["260","00","(?:63|80)0\\d{6}|(?:21|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],"ZW":["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},"nonGeographic":{"800":["800",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,["[1-9]\\d{7}"]]],"808":["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],"870":["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],"878":["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],"881":["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],"882":["882",0,"[13]\\d{6}(?:\\d{2,5})?|285\\d{9}|(?:[19]\\d|49)\\d{6}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["4"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[19]"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["34[57]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-3]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|3(?:2|47|7\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:(?:285\\d\\d|3(?:45|[69]\\d{3}))\\d|9[89])\\d{6}"]]],"883":["883",0,"210\\d{7}|51\\d{7}(?:\\d{3})?",[9,10,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["510"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["5"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:210|51[013]0\\d)\\d{7}|5100\\d{5}"]]],"888":["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],"979":["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};
1541
-
1542
- // The minimum length of the national significant number.
1543
-
1544
- var MAX_LENGTH_COUNTRY_CODE = 3; // Digits accepted in phone numbers
1545
- // (ascii, fullwidth, arabic-indic, and eastern arabic digits).
1546
-
1547
- var VALID_DIGITS = "0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9"; // `DASHES` will be right after the opening square bracket of the "character class"
1548
-
1549
- var DASHES = "-\u2010-\u2015\u2212\u30FC\uFF0D";
1550
- var SLASHES = "\uFF0F/";
1551
- var DOTS = "\uFF0E.";
1552
- var WHITESPACE = " \xA0\xAD\u200B\u2060\u3000";
1553
- var BRACKETS = "()\uFF08\uFF09\uFF3B\uFF3D\\[\\]"; // export const OPENING_BRACKETS = '(\uFF08\uFF3B\\\['
1554
-
1555
- var TILDES = "~\u2053\u223C\uFF5E"; // Regular expression of acceptable punctuation found in phone numbers. This
1556
- // excludes punctuation found as a leading character only. This consists of dash
1557
- // characters, white space characters, full stops, slashes, square brackets,
1558
- // parentheses and tildes. Full-width variants are also present.
1559
-
1560
- var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
1561
- var PLUS_CHARS = "+\uFF0B"; // const LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+')
1562
-
1563
- // Copy-pasted from:
1564
- // https://github.com/substack/semver-compare/blob/master/index.js
1565
- //
1566
- // Inlining this function because some users reported issues with
1567
- // importing from `semver-compare` in a browser with ES6 "native" modules.
1568
- //
1569
- // Fixes `semver-compare` not being able to compare versions with alpha/beta/etc "tags".
1570
- // https://github.com/catamphetamine/libphonenumber-js/issues/381
1571
- function compare (a, b) {
1572
- a = a.split('-');
1573
- b = b.split('-');
1574
- var pa = a[0].split('.');
1575
- var pb = b[0].split('.');
1576
-
1577
- for (var i = 0; i < 3; i++) {
1578
- var na = Number(pa[i]);
1579
- var nb = Number(pb[i]);
1580
- if (na > nb) return 1;
1581
- if (nb > na) return -1;
1582
- if (!isNaN(na) && isNaN(nb)) return 1;
1583
- if (isNaN(na) && !isNaN(nb)) return -1;
1584
- }
1585
-
1586
- if (a[1] && b[1]) {
1587
- return a[1] > b[1] ? 1 : a[1] < b[1] ? -1 : 0;
1588
- }
1589
-
1590
- return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0;
1591
- }
1592
-
1593
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1594
-
1595
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1596
-
1597
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1598
-
1599
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1600
-
1601
- var V3 = '1.2.0'; // Moved `001` country code to "nonGeographic" section of metadata.
1602
-
1603
- var V4 = '1.7.35';
1604
- var DEFAULT_EXT_PREFIX = ' ext. ';
1605
- var CALLING_CODE_REG_EXP = /^\d+$/;
1606
- /**
1607
- * See: https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md
1608
- */
1609
-
1610
- var Metadata =
1611
- /*#__PURE__*/
1612
- function () {
1613
- function Metadata(metadata) {
1614
- _classCallCheck(this, Metadata);
1615
-
1616
- validateMetadata(metadata);
1617
- this.metadata = metadata;
1618
- setVersion.call(this, metadata);
1619
- }
1620
-
1621
- _createClass(Metadata, [{
1622
- key: "getCountries",
1623
- value: function getCountries() {
1624
- return Object.keys(this.metadata.countries).filter(function (_) {
1625
- return _ !== '001';
1626
- });
1627
- }
1628
- }, {
1629
- key: "getCountryMetadata",
1630
- value: function getCountryMetadata(countryCode) {
1631
- return this.metadata.countries[countryCode];
1632
- }
1633
- }, {
1634
- key: "nonGeographic",
1635
- value: function nonGeographic() {
1636
- if (this.v1 || this.v2 || this.v3) return; // `nonGeographical` was a typo.
1637
- // It's present in metadata generated from `1.7.35` to `1.7.37`.
1638
-
1639
- return this.metadata.nonGeographic || this.metadata.nonGeographical;
1640
- }
1641
- }, {
1642
- key: "hasCountry",
1643
- value: function hasCountry(country) {
1644
- return this.getCountryMetadata(country) !== undefined;
1645
- }
1646
- }, {
1647
- key: "hasCallingCode",
1648
- value: function hasCallingCode(callingCode) {
1649
- if (this.getCountryCodesForCallingCode(callingCode)) {
1650
- return true;
1651
- }
1652
-
1653
- if (this.nonGeographic()) {
1654
- if (this.nonGeographic()[callingCode]) {
1655
- return true;
1656
- }
1657
- } else {
1658
- // A hacky workaround for old custom metadata (generated before V4).
1659
- var countryCodes = this.countryCallingCodes()[callingCode];
1660
-
1661
- if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {
1662
- return true;
1663
- }
1664
- }
1665
- }
1666
- }, {
1667
- key: "isNonGeographicCallingCode",
1668
- value: function isNonGeographicCallingCode(callingCode) {
1669
- if (this.nonGeographic()) {
1670
- return this.nonGeographic()[callingCode] ? true : false;
1671
- } else {
1672
- return this.getCountryCodesForCallingCode(callingCode) ? false : true;
1673
- }
1674
- } // Deprecated.
1675
-
1676
- }, {
1677
- key: "country",
1678
- value: function country(countryCode) {
1679
- return this.selectNumberingPlan(countryCode);
1680
- }
1681
- }, {
1682
- key: "selectNumberingPlan",
1683
- value: function selectNumberingPlan(countryCode, callingCode) {
1684
- // Supports just passing `callingCode` as the first argument.
1685
- if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {
1686
- callingCode = countryCode;
1687
- countryCode = null;
1688
- }
1689
-
1690
- if (countryCode && countryCode !== '001') {
1691
- if (!this.hasCountry(countryCode)) {
1692
- throw new Error("Unknown country: ".concat(countryCode));
1693
- }
1694
-
1695
- this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);
1696
- } else if (callingCode) {
1697
- if (!this.hasCallingCode(callingCode)) {
1698
- throw new Error("Unknown calling code: ".concat(callingCode));
1699
- }
1700
-
1701
- this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);
1702
- } else {
1703
- this.numberingPlan = undefined;
1704
- }
1705
-
1706
- return this;
1707
- }
1708
- }, {
1709
- key: "getCountryCodesForCallingCode",
1710
- value: function getCountryCodesForCallingCode(callingCode) {
1711
- var countryCodes = this.countryCallingCodes()[callingCode];
1712
-
1713
- if (countryCodes) {
1714
- // Metadata before V4 included "non-geographic entity" calling codes
1715
- // inside `country_calling_codes` (for example, `"881":["001"]`).
1716
- // Now the semantics of `country_calling_codes` has changed:
1717
- // it's specifically for "countries" now.
1718
- // Older versions of custom metadata will simply skip parsing
1719
- // "non-geographic entity" phone numbers with new versions
1720
- // of this library: it's not considered a bug,
1721
- // because such numbers are extremely rare,
1722
- // and developers extremely rarely use custom metadata.
1723
- if (countryCodes.length === 1 && countryCodes[0].length === 3) {
1724
- return;
1725
- }
1726
-
1727
- return countryCodes;
1728
- }
1729
- }
1730
- }, {
1731
- key: "getCountryCodeForCallingCode",
1732
- value: function getCountryCodeForCallingCode(callingCode) {
1733
- var countryCodes = this.getCountryCodesForCallingCode(callingCode);
1734
-
1735
- if (countryCodes) {
1736
- return countryCodes[0];
1737
- }
1738
- }
1739
- }, {
1740
- key: "getNumberingPlanMetadata",
1741
- value: function getNumberingPlanMetadata(callingCode) {
1742
- var countryCode = this.getCountryCodeForCallingCode(callingCode);
1743
-
1744
- if (countryCode) {
1745
- return this.getCountryMetadata(countryCode);
1746
- }
1747
-
1748
- if (this.nonGeographic()) {
1749
- var metadata = this.nonGeographic()[callingCode];
1750
-
1751
- if (metadata) {
1752
- return metadata;
1753
- }
1754
- } else {
1755
- // A hacky workaround for old custom metadata (generated before V4).
1756
- var countryCodes = this.countryCallingCodes()[callingCode];
1757
-
1758
- if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {
1759
- return this.metadata.countries['001'];
1760
- }
1761
- }
1762
- } // Deprecated.
1763
-
1764
- }, {
1765
- key: "countryCallingCode",
1766
- value: function countryCallingCode() {
1767
- return this.numberingPlan.callingCode();
1768
- } // Deprecated.
1769
-
1770
- }, {
1771
- key: "IDDPrefix",
1772
- value: function IDDPrefix() {
1773
- return this.numberingPlan.IDDPrefix();
1774
- } // Deprecated.
1775
-
1776
- }, {
1777
- key: "defaultIDDPrefix",
1778
- value: function defaultIDDPrefix() {
1779
- return this.numberingPlan.defaultIDDPrefix();
1780
- } // Deprecated.
1781
-
1782
- }, {
1783
- key: "nationalNumberPattern",
1784
- value: function nationalNumberPattern() {
1785
- return this.numberingPlan.nationalNumberPattern();
1786
- } // Deprecated.
1787
-
1788
- }, {
1789
- key: "possibleLengths",
1790
- value: function possibleLengths() {
1791
- return this.numberingPlan.possibleLengths();
1792
- } // Deprecated.
1793
-
1794
- }, {
1795
- key: "formats",
1796
- value: function formats() {
1797
- return this.numberingPlan.formats();
1798
- } // Deprecated.
1799
-
1800
- }, {
1801
- key: "nationalPrefixForParsing",
1802
- value: function nationalPrefixForParsing() {
1803
- return this.numberingPlan.nationalPrefixForParsing();
1804
- } // Deprecated.
1805
-
1806
- }, {
1807
- key: "nationalPrefixTransformRule",
1808
- value: function nationalPrefixTransformRule() {
1809
- return this.numberingPlan.nationalPrefixTransformRule();
1810
- } // Deprecated.
1811
-
1812
- }, {
1813
- key: "leadingDigits",
1814
- value: function leadingDigits() {
1815
- return this.numberingPlan.leadingDigits();
1816
- } // Deprecated.
1817
-
1818
- }, {
1819
- key: "hasTypes",
1820
- value: function hasTypes() {
1821
- return this.numberingPlan.hasTypes();
1822
- } // Deprecated.
1823
-
1824
- }, {
1825
- key: "type",
1826
- value: function type(_type) {
1827
- return this.numberingPlan.type(_type);
1828
- } // Deprecated.
1829
-
1830
- }, {
1831
- key: "ext",
1832
- value: function ext() {
1833
- return this.numberingPlan.ext();
1834
- }
1835
- }, {
1836
- key: "countryCallingCodes",
1837
- value: function countryCallingCodes() {
1838
- if (this.v1) return this.metadata.country_phone_code_to_countries;
1839
- return this.metadata.country_calling_codes;
1840
- } // Deprecated.
1841
-
1842
- }, {
1843
- key: "chooseCountryByCountryCallingCode",
1844
- value: function chooseCountryByCountryCallingCode(callingCode) {
1845
- return this.selectNumberingPlan(callingCode);
1846
- }
1847
- }, {
1848
- key: "hasSelectedNumberingPlan",
1849
- value: function hasSelectedNumberingPlan() {
1850
- return this.numberingPlan !== undefined;
1851
- }
1852
- }]);
1853
-
1854
- return Metadata;
1855
- }();
1856
-
1857
- var NumberingPlan =
1858
- /*#__PURE__*/
1859
- function () {
1860
- function NumberingPlan(metadata, globalMetadataObject) {
1861
- _classCallCheck(this, NumberingPlan);
1862
-
1863
- this.globalMetadataObject = globalMetadataObject;
1864
- this.metadata = metadata;
1865
- setVersion.call(this, globalMetadataObject.metadata);
1866
- }
1867
-
1868
- _createClass(NumberingPlan, [{
1869
- key: "callingCode",
1870
- value: function callingCode() {
1871
- return this.metadata[0];
1872
- } // Formatting information for regions which share
1873
- // a country calling code is contained by only one region
1874
- // for performance reasons. For example, for NANPA region
1875
- // ("North American Numbering Plan Administration",
1876
- // which includes USA, Canada, Cayman Islands, Bahamas, etc)
1877
- // it will be contained in the metadata for `US`.
1878
-
1879
- }, {
1880
- key: "getDefaultCountryMetadataForRegion",
1881
- value: function getDefaultCountryMetadataForRegion() {
1882
- return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
1883
- }
1884
- }, {
1885
- key: "IDDPrefix",
1886
- value: function IDDPrefix() {
1887
- if (this.v1 || this.v2) return;
1888
- return this.metadata[1];
1889
- }
1890
- }, {
1891
- key: "defaultIDDPrefix",
1892
- value: function defaultIDDPrefix() {
1893
- if (this.v1 || this.v2) return;
1894
- return this.metadata[12];
1895
- }
1896
- }, {
1897
- key: "nationalNumberPattern",
1898
- value: function nationalNumberPattern() {
1899
- if (this.v1 || this.v2) return this.metadata[1];
1900
- return this.metadata[2];
1901
- }
1902
- }, {
1903
- key: "possibleLengths",
1904
- value: function possibleLengths() {
1905
- if (this.v1) return;
1906
- return this.metadata[this.v2 ? 2 : 3];
1907
- }
1908
- }, {
1909
- key: "_getFormats",
1910
- value: function _getFormats(metadata) {
1911
- return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];
1912
- } // For countries of the same region (e.g. NANPA)
1913
- // formats are all stored in the "main" country for that region.
1914
- // E.g. "RU" and "KZ", "US" and "CA".
1915
-
1916
- }, {
1917
- key: "formats",
1918
- value: function formats() {
1919
- var _this = this;
1920
-
1921
- var formats = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];
1922
- return formats.map(function (_) {
1923
- return new Format(_, _this);
1924
- });
1925
- }
1926
- }, {
1927
- key: "nationalPrefix",
1928
- value: function nationalPrefix() {
1929
- return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
1930
- }
1931
- }, {
1932
- key: "_getNationalPrefixFormattingRule",
1933
- value: function _getNationalPrefixFormattingRule(metadata) {
1934
- return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];
1935
- } // For countries of the same region (e.g. NANPA)
1936
- // national prefix formatting rule is stored in the "main" country for that region.
1937
- // E.g. "RU" and "KZ", "US" and "CA".
1938
-
1939
- }, {
1940
- key: "nationalPrefixFormattingRule",
1941
- value: function nationalPrefixFormattingRule() {
1942
- return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());
1943
- }
1944
- }, {
1945
- key: "_nationalPrefixForParsing",
1946
- value: function _nationalPrefixForParsing() {
1947
- return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
1948
- }
1949
- }, {
1950
- key: "nationalPrefixForParsing",
1951
- value: function nationalPrefixForParsing() {
1952
- // If `national_prefix_for_parsing` is not set explicitly,
1953
- // then infer it from `national_prefix` (if any)
1954
- return this._nationalPrefixForParsing() || this.nationalPrefix();
1955
- }
1956
- }, {
1957
- key: "nationalPrefixTransformRule",
1958
- value: function nationalPrefixTransformRule() {
1959
- return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
1960
- }
1961
- }, {
1962
- key: "_getNationalPrefixIsOptionalWhenFormatting",
1963
- value: function _getNationalPrefixIsOptionalWhenFormatting() {
1964
- return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
1965
- } // For countries of the same region (e.g. NANPA)
1966
- // "national prefix is optional when formatting" flag is
1967
- // stored in the "main" country for that region.
1968
- // E.g. "RU" and "KZ", "US" and "CA".
1969
-
1970
- }, {
1971
- key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
1972
- value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
1973
- return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());
1974
- }
1975
- }, {
1976
- key: "leadingDigits",
1977
- value: function leadingDigits() {
1978
- return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
1979
- }
1980
- }, {
1981
- key: "types",
1982
- value: function types() {
1983
- return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
1984
- }
1985
- }, {
1986
- key: "hasTypes",
1987
- value: function hasTypes() {
1988
- // Versions 1.2.0 - 1.2.4: can be `[]`.
1989
-
1990
- /* istanbul ignore next */
1991
- if (this.types() && this.types().length === 0) {
1992
- return false;
1993
- } // Versions <= 1.2.4: can be `undefined`.
1994
- // Version >= 1.2.5: can be `0`.
1995
-
1996
-
1997
- return !!this.types();
1998
- }
1999
- }, {
2000
- key: "type",
2001
- value: function type(_type2) {
2002
- if (this.hasTypes() && getType(this.types(), _type2)) {
2003
- return new Type(getType(this.types(), _type2), this);
2004
- }
2005
- }
2006
- }, {
2007
- key: "ext",
2008
- value: function ext() {
2009
- if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;
2010
- return this.metadata[13] || DEFAULT_EXT_PREFIX;
2011
- }
2012
- }]);
2013
-
2014
- return NumberingPlan;
2015
- }();
2016
-
2017
- var Format =
2018
- /*#__PURE__*/
2019
- function () {
2020
- function Format(format, metadata) {
2021
- _classCallCheck(this, Format);
2022
-
2023
- this._format = format;
2024
- this.metadata = metadata;
2025
- }
2026
-
2027
- _createClass(Format, [{
2028
- key: "pattern",
2029
- value: function pattern() {
2030
- return this._format[0];
2031
- }
2032
- }, {
2033
- key: "format",
2034
- value: function format() {
2035
- return this._format[1];
2036
- }
2037
- }, {
2038
- key: "leadingDigitsPatterns",
2039
- value: function leadingDigitsPatterns() {
2040
- return this._format[2] || [];
2041
- }
2042
- }, {
2043
- key: "nationalPrefixFormattingRule",
2044
- value: function nationalPrefixFormattingRule() {
2045
- return this._format[3] || this.metadata.nationalPrefixFormattingRule();
2046
- }
2047
- }, {
2048
- key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
2049
- value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
2050
- return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
2051
- }
2052
- }, {
2053
- key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
2054
- value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {
2055
- // National prefix is omitted if there's no national prefix formatting rule
2056
- // set for this country, or when the national prefix formatting rule
2057
- // contains no national prefix itself, or when this rule is set but
2058
- // national prefix is optional for this phone number format
2059
- // (and it is not enforced explicitly)
2060
- return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
2061
- } // Checks whether national prefix formatting rule contains national prefix.
2062
-
2063
- }, {
2064
- key: "usesNationalPrefix",
2065
- value: function usesNationalPrefix() {
2066
- return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one.
2067
- !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) // In compressed metadata, `this.nationalPrefixFormattingRule()` is `0`
2068
- // when `national_prefix_formatting_rule` is not present.
2069
- // So, `true` or `false` are returned explicitly here, so that
2070
- // `0` number isn't returned.
2071
- ? true : false;
2072
- }
2073
- }, {
2074
- key: "internationalFormat",
2075
- value: function internationalFormat() {
2076
- return this._format[5] || this.format();
2077
- }
2078
- }]);
2079
-
2080
- return Format;
2081
- }();
2082
- /**
2083
- * A pattern that is used to determine if the national prefix formatting rule
2084
- * has the first group only, i.e., does not start with the national prefix.
2085
- * Note that the pattern explicitly allows for unbalanced parentheses.
2086
- */
2087
-
2088
-
2089
- var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
2090
-
2091
- var Type =
2092
- /*#__PURE__*/
2093
- function () {
2094
- function Type(type, metadata) {
2095
- _classCallCheck(this, Type);
2096
-
2097
- this.type = type;
2098
- this.metadata = metadata;
2099
- }
2100
-
2101
- _createClass(Type, [{
2102
- key: "pattern",
2103
- value: function pattern() {
2104
- if (this.metadata.v1) return this.type;
2105
- return this.type[0];
2106
- }
2107
- }, {
2108
- key: "possibleLengths",
2109
- value: function possibleLengths() {
2110
- if (this.metadata.v1) return;
2111
- return this.type[1] || this.metadata.possibleLengths();
2112
- }
2113
- }]);
2114
-
2115
- return Type;
2116
- }();
2117
-
2118
- function getType(types, type) {
2119
- switch (type) {
2120
- case 'FIXED_LINE':
2121
- return types[0];
2122
-
2123
- case 'MOBILE':
2124
- return types[1];
2125
-
2126
- case 'TOLL_FREE':
2127
- return types[2];
2128
-
2129
- case 'PREMIUM_RATE':
2130
- return types[3];
2131
-
2132
- case 'PERSONAL_NUMBER':
2133
- return types[4];
2134
-
2135
- case 'VOICEMAIL':
2136
- return types[5];
2137
-
2138
- case 'UAN':
2139
- return types[6];
2140
-
2141
- case 'PAGER':
2142
- return types[7];
2143
-
2144
- case 'VOIP':
2145
- return types[8];
2146
-
2147
- case 'SHARED_COST':
2148
- return types[9];
2149
- }
2150
- }
2151
-
2152
- function validateMetadata(metadata) {
2153
- if (!metadata) {
2154
- throw new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.');
2155
- } // `country_phone_code_to_countries` was renamed to
2156
- // `country_calling_codes` in `1.0.18`.
2157
-
2158
-
2159
- if (!is_object(metadata) || !is_object(metadata.countries)) {
2160
- throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(is_object(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + type_of(metadata) + ': ' + metadata, "."));
2161
- }
2162
- } // Babel transforms `typeof` into some "branches"
2163
- // so istanbul will show this as "branch not covered".
2164
-
2165
- /* istanbul ignore next */
2166
-
2167
- var is_object = function is_object(_) {
2168
- return _typeof(_) === 'object';
2169
- }; // Babel transforms `typeof` into some "branches"
2170
- // so istanbul will show this as "branch not covered".
2171
-
2172
- /* istanbul ignore next */
2173
-
2174
-
2175
- var type_of = function type_of(_) {
2176
- return _typeof(_);
2177
- };
2178
- /**
2179
- * Returns "country calling code" for a country.
2180
- * Throws an error if the country doesn't exist or isn't supported by this library.
2181
- * @param {string} country
2182
- * @param {object} metadata
2183
- * @return {string}
2184
- * @example
2185
- * // Returns "44"
2186
- * getCountryCallingCode("GB")
2187
- */
2188
-
2189
- function getCountryCallingCode(country, metadata) {
2190
- metadata = new Metadata(metadata);
2191
-
2192
- if (metadata.hasCountry(country)) {
2193
- return metadata.country(country).countryCallingCode();
2194
- }
2195
-
2196
- throw new Error("Unknown country: ".concat(country));
2197
- }
2198
-
2199
- function setVersion(metadata) {
2200
- var version = metadata.version;
2201
-
2202
- if (typeof version === 'number') {
2203
- this.v1 = version === 1;
2204
- this.v2 = version === 2;
2205
- this.v3 = version === 3;
2206
- this.v4 = version === 4;
2207
- } else {
2208
- if (!version) {
2209
- this.v1 = true;
2210
- } else if (compare(version, V3) === -1) {
2211
- this.v2 = true;
2212
- } else if (compare(version, V4) === -1) {
2213
- this.v3 = true;
2214
- } else {
2215
- this.v4 = true;
2216
- }
2217
- }
2218
- } // const ISO_COUNTRY_CODE = /^[A-Z]{2}$/
2219
- // function isCountryCode(countryCode) {
2220
- // return ISO_COUNTRY_CODE.test(countryCodeOrCountryCallingCode)
2221
- // }
2222
-
2223
- // These mappings map a character (key) to a specific digit that should
2224
- // replace it for normalization purposes. Non-European digits that
2225
- // may be used in phone numbers are mapped to a European equivalent.
2226
- //
2227
- // E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.
2228
- //
2229
- var DIGITS = {
2230
- '0': '0',
2231
- '1': '1',
2232
- '2': '2',
2233
- '3': '3',
2234
- '4': '4',
2235
- '5': '5',
2236
- '6': '6',
2237
- '7': '7',
2238
- '8': '8',
2239
- '9': '9',
2240
- "\uFF10": '0',
2241
- // Fullwidth digit 0
2242
- "\uFF11": '1',
2243
- // Fullwidth digit 1
2244
- "\uFF12": '2',
2245
- // Fullwidth digit 2
2246
- "\uFF13": '3',
2247
- // Fullwidth digit 3
2248
- "\uFF14": '4',
2249
- // Fullwidth digit 4
2250
- "\uFF15": '5',
2251
- // Fullwidth digit 5
2252
- "\uFF16": '6',
2253
- // Fullwidth digit 6
2254
- "\uFF17": '7',
2255
- // Fullwidth digit 7
2256
- "\uFF18": '8',
2257
- // Fullwidth digit 8
2258
- "\uFF19": '9',
2259
- // Fullwidth digit 9
2260
- "\u0660": '0',
2261
- // Arabic-indic digit 0
2262
- "\u0661": '1',
2263
- // Arabic-indic digit 1
2264
- "\u0662": '2',
2265
- // Arabic-indic digit 2
2266
- "\u0663": '3',
2267
- // Arabic-indic digit 3
2268
- "\u0664": '4',
2269
- // Arabic-indic digit 4
2270
- "\u0665": '5',
2271
- // Arabic-indic digit 5
2272
- "\u0666": '6',
2273
- // Arabic-indic digit 6
2274
- "\u0667": '7',
2275
- // Arabic-indic digit 7
2276
- "\u0668": '8',
2277
- // Arabic-indic digit 8
2278
- "\u0669": '9',
2279
- // Arabic-indic digit 9
2280
- "\u06F0": '0',
2281
- // Eastern-Arabic digit 0
2282
- "\u06F1": '1',
2283
- // Eastern-Arabic digit 1
2284
- "\u06F2": '2',
2285
- // Eastern-Arabic digit 2
2286
- "\u06F3": '3',
2287
- // Eastern-Arabic digit 3
2288
- "\u06F4": '4',
2289
- // Eastern-Arabic digit 4
2290
- "\u06F5": '5',
2291
- // Eastern-Arabic digit 5
2292
- "\u06F6": '6',
2293
- // Eastern-Arabic digit 6
2294
- "\u06F7": '7',
2295
- // Eastern-Arabic digit 7
2296
- "\u06F8": '8',
2297
- // Eastern-Arabic digit 8
2298
- "\u06F9": '9' // Eastern-Arabic digit 9
2299
-
2300
- };
2301
- function parseDigit(character) {
2302
- return DIGITS[character];
2303
- }
2304
- /**
2305
- * Parses phone number digits from a string.
2306
- * Drops all punctuation leaving only digits.
2307
- * Also converts wide-ascii and arabic-indic numerals to conventional numerals.
2308
- * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.
2309
- * @param {string} string
2310
- * @return {string}
2311
- * @example
2312
- * ```js
2313
- * parseDigits('8 (800) 555')
2314
- * // Outputs '8800555'.
2315
- * ```
2316
- */
2317
-
2318
- function parseDigits(string) {
2319
- var result = ''; // Using `.split('')` here instead of normal `for ... of`
2320
- // because the importing application doesn't neccessarily include an ES6 polyfill.
2321
- // The `.split('')` approach discards "exotic" UTF-8 characters
2322
- // (the ones consisting of four bytes) but digits
2323
- // (including non-European ones) don't fall into that range
2324
- // so such "exotic" characters would be discarded anyway.
2325
-
2326
- for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
2327
- var _ref;
2328
-
2329
- if (_isArray) {
2330
- if (_i >= _iterator.length) break;
2331
- _ref = _iterator[_i++];
2332
- } else {
2333
- _i = _iterator.next();
2334
- if (_i.done) break;
2335
- _ref = _i.value;
2336
- }
2337
-
2338
- var character = _ref;
2339
- var digit = parseDigit(character);
2340
-
2341
- if (digit) {
2342
- result += digit;
2343
- }
2344
- }
2345
-
2346
- return result;
2347
- }
2348
-
2349
- /**
2350
- * Merges two arrays.
2351
- * @param {*} a
2352
- * @param {*} b
2353
- * @return {*}
2354
- */
2355
- function mergeArrays(a, b) {
2356
- var merged = a.slice();
2357
-
2358
- for (var _iterator = b, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
2359
- var _ref;
2360
-
2361
- if (_isArray) {
2362
- if (_i >= _iterator.length) break;
2363
- _ref = _iterator[_i++];
2364
- } else {
2365
- _i = _iterator.next();
2366
- if (_i.done) break;
2367
- _ref = _i.value;
2368
- }
2369
-
2370
- var element = _ref;
2371
-
2372
- if (a.indexOf(element) < 0) {
2373
- merged.push(element);
2374
- }
2375
- }
2376
-
2377
- return merged.sort(function (a, b) {
2378
- return a - b;
2379
- }); // ES6 version, requires Set polyfill.
2380
- // let merged = new Set(a)
2381
- // for (const element of b) {
2382
- // merged.add(i)
2383
- // }
2384
- // return Array.from(merged).sort((a, b) => a - b)
2385
- }
2386
-
2387
- function checkNumberLength(nationalNumber, metadata) {
2388
- return checkNumberLengthForType(nationalNumber, undefined, metadata);
2389
- } // Checks whether a number is possible for the country based on its length.
2390
- // Should only be called for the "new" metadata which has "possible lengths".
2391
-
2392
- function checkNumberLengthForType(nationalNumber, type, metadata) {
2393
- var type_info = metadata.type(type); // There should always be "<possiblePengths/>" set for every type element.
2394
- // This is declared in the XML schema.
2395
- // For size efficiency, where a sub-description (e.g. fixed-line)
2396
- // has the same "<possiblePengths/>" as the "general description", this is missing,
2397
- // so we fall back to the "general description". Where no numbers of the type
2398
- // exist at all, there is one possible length (-1) which is guaranteed
2399
- // not to match the length of any real phone number.
2400
-
2401
- var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths(); // let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()
2402
- // Metadata before version `1.0.18` didn't contain `possible_lengths`.
2403
-
2404
- if (!possible_lengths) {
2405
- return 'IS_POSSIBLE';
2406
- }
2407
-
2408
- if (type === 'FIXED_LINE_OR_MOBILE') {
2409
- // No such country in metadata.
2410
-
2411
- /* istanbul ignore next */
2412
- if (!metadata.type('FIXED_LINE')) {
2413
- // The rare case has been encountered where no fixedLine data is available
2414
- // (true for some non-geographic entities), so we just check mobile.
2415
- return checkNumberLengthForType(nationalNumber, 'MOBILE', metadata);
2416
- }
2417
-
2418
- var mobile_type = metadata.type('MOBILE');
2419
-
2420
- if (mobile_type) {
2421
- // Merge the mobile data in if there was any. "Concat" creates a new
2422
- // array, it doesn't edit possible_lengths in place, so we don't need a copy.
2423
- // Note that when adding the possible lengths from mobile, we have
2424
- // to again check they aren't empty since if they are this indicates
2425
- // they are the same as the general desc and should be obtained from there.
2426
- possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths()); // The current list is sorted; we need to merge in the new list and
2427
- // re-sort (duplicates are okay). Sorting isn't so expensive because
2428
- // the lists are very small.
2429
- // if (local_lengths) {
2430
- // local_lengths = mergeArrays(local_lengths, mobile_type.possibleLengthsLocal())
2431
- // } else {
2432
- // local_lengths = mobile_type.possibleLengthsLocal()
2433
- // }
2434
- }
2435
- } // If the type doesn't exist then return 'INVALID_LENGTH'.
2436
- else if (type && !type_info) {
2437
- return 'INVALID_LENGTH';
2438
- }
2439
-
2440
- var actual_length = nationalNumber.length; // In `libphonenumber-js` all "local-only" formats are dropped for simplicity.
2441
- // // This is safe because there is never an overlap beween the possible lengths
2442
- // // and the local-only lengths; this is checked at build time.
2443
- // if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0)
2444
- // {
2445
- // return 'IS_POSSIBLE_LOCAL_ONLY'
2446
- // }
2447
-
2448
- var minimum_length = possible_lengths[0];
2449
-
2450
- if (minimum_length === actual_length) {
2451
- return 'IS_POSSIBLE';
2452
- }
2453
-
2454
- if (minimum_length > actual_length) {
2455
- return 'TOO_SHORT';
2456
- }
2457
-
2458
- if (possible_lengths[possible_lengths.length - 1] < actual_length) {
2459
- return 'TOO_LONG';
2460
- } // We skip the first element since we've already checked it.
2461
-
2462
-
2463
- return possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';
2464
- }
2465
-
2466
- function isPossiblePhoneNumber(input, options, metadata) {
2467
- /* istanbul ignore if */
2468
- if (options === undefined) {
2469
- options = {};
2470
- }
2471
-
2472
- metadata = new Metadata(metadata);
2473
-
2474
- if (options.v2) {
2475
- if (!input.countryCallingCode) {
2476
- throw new Error('Invalid phone number object passed');
2477
- }
2478
-
2479
- metadata.selectNumberingPlan(input.countryCallingCode);
2480
- } else {
2481
- if (!input.phone) {
2482
- return false;
2483
- }
2484
-
2485
- if (input.country) {
2486
- if (!metadata.hasCountry(input.country)) {
2487
- throw new Error("Unknown country: ".concat(input.country));
2488
- }
2489
-
2490
- metadata.country(input.country);
2491
- } else {
2492
- if (!input.countryCallingCode) {
2493
- throw new Error('Invalid phone number object passed');
2494
- }
2495
-
2496
- metadata.selectNumberingPlan(input.countryCallingCode);
2497
- }
2498
- }
2499
-
2500
- if (metadata.possibleLengths()) {
2501
- return isPossibleNumber(input.phone || input.nationalNumber, metadata);
2502
- } else {
2503
- // There was a bug between `1.7.35` and `1.7.37` where "possible_lengths"
2504
- // were missing for "non-geographical" numbering plans.
2505
- // Just assume the number is possible in such cases:
2506
- // it's unlikely that anyone generated their custom metadata
2507
- // in that short period of time (one day).
2508
- // This code can be removed in some future major version update.
2509
- if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {
2510
- // "Non-geographic entities" did't have `possibleLengths`
2511
- // due to a bug in metadata generation process.
2512
- return true;
2513
- } else {
2514
- throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
2515
- }
2516
- }
2517
- }
2518
- function isPossibleNumber(nationalNumber, metadata) {
2519
- //, isInternational) {
2520
- switch (checkNumberLength(nationalNumber, metadata)) {
2521
- case 'IS_POSSIBLE':
2522
- return true;
2523
- // This library ignores "local-only" phone numbers (for simplicity).
2524
- // See the readme for more info on what are "local-only" phone numbers.
2525
- // case 'IS_POSSIBLE_LOCAL_ONLY':
2526
- // return !isInternational
2527
-
2528
- default:
2529
- return false;
2530
- }
2531
- }
2532
-
2533
- /**
2534
- * @param {object} - `{ ?number, ?extension }`.
2535
- * @return {string} Phone URI (RFC 3966).
2536
- */
2537
-
2538
- function formatRFC3966(_ref2) {
2539
- var number = _ref2.number,
2540
- ext = _ref2.ext;
2541
-
2542
- if (!number) {
2543
- return '';
2544
- }
2545
-
2546
- if (number[0] !== '+') {
2547
- throw new Error("\"formatRFC3966()\" expects \"number\" to be in E.164 format.");
2548
- }
2549
-
2550
- return "tel:".concat(number).concat(ext ? ';ext=' + ext : '');
2551
- }
2552
-
2553
- /**
2554
- * Checks whether the entire input sequence can be matched
2555
- * against the regular expression.
2556
- * @return {boolean}
2557
- */
2558
- function matchesEntirely(text, regular_expression) {
2559
- // If assigning the `''` default value is moved to the arguments above,
2560
- // code coverage would decrease for some weird reason.
2561
- text = text || '';
2562
- return new RegExp('^(?:' + regular_expression + ')$').test(text);
2563
- }
2564
-
2565
- var NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL']; // Finds out national phone number type (fixed line, mobile, etc)
2566
-
2567
- function getNumberType(input, options, metadata) {
2568
- // If assigning the `{}` default value is moved to the arguments above,
2569
- // code coverage would decrease for some weird reason.
2570
- options = options || {}; // When `parse()` returned `{}`
2571
- // meaning that the phone number is not a valid one.
2572
-
2573
- if (!input.country) {
2574
- return;
2575
- }
2576
-
2577
- metadata = new Metadata(metadata);
2578
- metadata.selectNumberingPlan(input.country, input.countryCallingCode);
2579
- var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // The following is copy-pasted from the original function:
2580
- // https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835
2581
- // Is this national number even valid for this country
2582
-
2583
- if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {
2584
- return;
2585
- } // Is it fixed line number
2586
-
2587
-
2588
- if (isNumberTypeEqualTo(nationalNumber, 'FIXED_LINE', metadata)) {
2589
- // Because duplicate regular expressions are removed
2590
- // to reduce metadata size, if "mobile" pattern is ""
2591
- // then it means it was removed due to being a duplicate of the fixed-line pattern.
2592
- //
2593
- if (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {
2594
- return 'FIXED_LINE_OR_MOBILE';
2595
- } // v1 metadata.
2596
- // Legacy.
2597
- // Deprecated.
2598
-
2599
-
2600
- if (!metadata.type('MOBILE')) {
2601
- return 'FIXED_LINE_OR_MOBILE';
2602
- } // Check if the number happens to qualify as both fixed line and mobile.
2603
- // (no such country in the minimal metadata set)
2604
-
2605
- /* istanbul ignore if */
2606
-
2607
-
2608
- if (isNumberTypeEqualTo(nationalNumber, 'MOBILE', metadata)) {
2609
- return 'FIXED_LINE_OR_MOBILE';
2610
- }
2611
-
2612
- return 'FIXED_LINE';
2613
- }
2614
-
2615
- for (var _i = 0, _NON_FIXED_LINE_PHONE = NON_FIXED_LINE_PHONE_TYPES; _i < _NON_FIXED_LINE_PHONE.length; _i++) {
2616
- var type = _NON_FIXED_LINE_PHONE[_i];
2617
-
2618
- if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {
2619
- return type;
2620
- }
2621
- }
2622
- }
2623
- function isNumberTypeEqualTo(nationalNumber, type, metadata) {
2624
- type = metadata.type(type);
2625
-
2626
- if (!type || !type.pattern()) {
2627
- return false;
2628
- } // Check if any possible number lengths are present;
2629
- // if so, we use them to avoid checking
2630
- // the validation pattern if they don't match.
2631
- // If they are absent, this means they match
2632
- // the general description, which we have
2633
- // already checked before a specific number type.
2634
-
2635
-
2636
- if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {
2637
- return false;
2638
- }
2639
-
2640
- return matchesEntirely(nationalNumber, type.pattern());
2641
- }
2642
-
2643
- /**
2644
- * Checks if a given phone number is valid.
2645
- *
2646
- * If the `number` is a string, it will be parsed to an object,
2647
- * but only if it contains only valid phone number characters (including punctuation).
2648
- * If the `number` is an object, it is used as is.
2649
- *
2650
- * The optional `defaultCountry` argument is the default country.
2651
- * I.e. it does not restrict to just that country,
2652
- * e.g. in those cases where several countries share
2653
- * the same phone numbering rules (NANPA, Britain, etc).
2654
- * For example, even though the number `07624 369230`
2655
- * belongs to the Isle of Man ("IM" country code)
2656
- * calling `isValidNumber('07624369230', 'GB', metadata)`
2657
- * still returns `true` because the country is not restricted to `GB`,
2658
- * it's just that `GB` is the default one for the phone numbering rules.
2659
- * For restricting the country see `isValidNumberForRegion()`
2660
- * though restricting a country might not be a good idea.
2661
- * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion
2662
- *
2663
- * Examples:
2664
- *
2665
- * ```js
2666
- * isValidNumber('+78005553535', metadata)
2667
- * isValidNumber('8005553535', 'RU', metadata)
2668
- * isValidNumber('88005553535', 'RU', metadata)
2669
- * isValidNumber({ phone: '8005553535', country: 'RU' }, metadata)
2670
- * ```
2671
- */
2672
-
2673
- function isValidNumber(input, options, metadata) {
2674
- // If assigning the `{}` default value is moved to the arguments above,
2675
- // code coverage would decrease for some weird reason.
2676
- options = options || {};
2677
- metadata = new Metadata(metadata); // This is just to support `isValidNumber({})`
2678
- // for cases when `parseNumber()` returns `{}`.
2679
-
2680
- if (!input.country) {
2681
- return false;
2682
- }
2683
-
2684
- metadata.selectNumberingPlan(input.country, input.countryCallingCode); // By default, countries only have type regexps when it's required for
2685
- // distinguishing different countries having the same `countryCallingCode`.
2686
-
2687
- if (metadata.hasTypes()) {
2688
- return getNumberType(input, options, metadata.metadata) !== undefined;
2689
- } // If there are no type regexps for this country in metadata then use
2690
- // `nationalNumberPattern` as a "better than nothing" replacement.
2691
-
2692
-
2693
- var national_number = options.v2 ? input.nationalNumber : input.phone;
2694
- return matchesEntirely(national_number, metadata.nationalNumberPattern());
2695
- }
2696
-
2697
- //
2698
- // E.g. "(999) 111-22-33" -> "999 111 22 33"
2699
- //
2700
- // For some reason Google's metadata contains `<intlFormat/>`s with brackets and dashes.
2701
- // Meanwhile, there's no single opinion about using punctuation in international phone numbers.
2702
- //
2703
- // For example, Google's `<intlFormat/>` for USA is `+1 213-373-4253`.
2704
- // And here's a quote from WikiPedia's "North American Numbering Plan" page:
2705
- // https://en.wikipedia.org/wiki/North_American_Numbering_Plan
2706
- //
2707
- // "The country calling code for all countries participating in the NANP is 1.
2708
- // In international format, an NANP number should be listed as +1 301 555 01 00,
2709
- // where 301 is an area code (Maryland)."
2710
- //
2711
- // I personally prefer the international format without any punctuation.
2712
- // For example, brackets are remnants of the old age, meaning that the
2713
- // phone number part in brackets (so called "area code") can be omitted
2714
- // if dialing within the same "area".
2715
- // And hyphens were clearly introduced for splitting local numbers into memorizable groups.
2716
- // For example, remembering "5553535" is difficult but "555-35-35" is much simpler.
2717
- // Imagine a man taking a bus from home to work and seeing an ad with a phone number.
2718
- // He has a couple of seconds to memorize that number until it passes by.
2719
- // If it were spaces instead of hyphens the man wouldn't necessarily get it,
2720
- // but with hyphens instead of spaces the grouping is more explicit.
2721
- // I personally think that hyphens introduce visual clutter,
2722
- // so I prefer replacing them with spaces in international numbers.
2723
- // In the modern age all output is done on displays where spaces are clearly distinguishable
2724
- // so hyphens can be safely replaced with spaces without losing any legibility.
2725
- //
2726
-
2727
- function applyInternationalSeparatorStyle(formattedNumber) {
2728
- return formattedNumber.replace(new RegExp("[".concat(VALID_PUNCTUATION, "]+"), 'g'), ' ').trim();
2729
- }
2730
-
2731
- // first group is not used in the national pattern (e.g. Argentina) so the $1
2732
- // group does not match correctly. Therefore, we use `\d`, so that the first
2733
- // group actually used in the pattern will be matched.
2734
-
2735
- var FIRST_GROUP_PATTERN = /(\$\d)/;
2736
- function formatNationalNumberUsingFormat(number, format, _ref) {
2737
- var useInternationalFormat = _ref.useInternationalFormat,
2738
- withNationalPrefix = _ref.withNationalPrefix;
2739
- var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : // This library doesn't use `domestic_carrier_code_formatting_rule`,
2740
- // because that one is only used when formatting phone numbers
2741
- // for dialing from a mobile phone, and this is not a dialing library.
2742
- // carrierCode && format.domesticCarrierCodeFormattingRule()
2743
- // // First, replace the $CC in the formatting rule with the desired carrier code.
2744
- // // Then, replace the $FG in the formatting rule with the first group
2745
- // // and the carrier code combined in the appropriate way.
2746
- // ? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))
2747
- // : (
2748
- // withNationalPrefix && format.nationalPrefixFormattingRule()
2749
- // ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())
2750
- // : format.format()
2751
- // )
2752
- withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());
2753
-
2754
- if (useInternationalFormat) {
2755
- return applyInternationalSeparatorStyle(formattedNumber);
2756
- }
2757
-
2758
- return formattedNumber;
2759
- }
2760
-
2761
- /**
2762
- * Pattern that makes it easy to distinguish whether a region has a single
2763
- * international dialing prefix or not. If a region has a single international
2764
- * prefix (e.g. 011 in USA), it will be represented as a string that contains
2765
- * a sequence of ASCII digits, and possibly a tilde, which signals waiting for
2766
- * the tone. If there are multiple available international prefixes in a
2767
- * region, they will be represented as a regex string that always contains one
2768
- * or more characters that are not ASCII digits or a tilde.
2769
- */
2770
-
2771
- var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/; // For regions that have multiple IDD prefixes
2772
- // a preferred IDD prefix is returned.
2773
-
2774
- function getIddPrefix(country, callingCode, metadata) {
2775
- var countryMetadata = new Metadata(metadata);
2776
- countryMetadata.selectNumberingPlan(country, callingCode);
2777
-
2778
- if (countryMetadata.defaultIDDPrefix()) {
2779
- return countryMetadata.defaultIDDPrefix();
2780
- }
2781
-
2782
- if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {
2783
- return countryMetadata.IDDPrefix();
2784
- }
2785
- }
2786
-
2787
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
2788
-
2789
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2790
- var DEFAULT_OPTIONS = {
2791
- formatExtension: function formatExtension(formattedNumber, extension, metadata) {
2792
- return "".concat(formattedNumber).concat(metadata.ext()).concat(extension);
2793
- } // Formats a phone number
2794
- //
2795
- // Example use cases:
2796
- //
2797
- // ```js
2798
- // formatNumber('8005553535', 'RU', 'INTERNATIONAL')
2799
- // formatNumber('8005553535', 'RU', 'INTERNATIONAL', metadata)
2800
- // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL')
2801
- // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', metadata)
2802
- // formatNumber('+78005553535', 'NATIONAL')
2803
- // formatNumber('+78005553535', 'NATIONAL', metadata)
2804
- // ```
2805
- //
2806
-
2807
- };
2808
- function formatNumber(input, format, options, metadata) {
2809
- // Apply default options.
2810
- if (options) {
2811
- options = _objectSpread({}, DEFAULT_OPTIONS, options);
2812
- } else {
2813
- options = DEFAULT_OPTIONS;
2814
- }
2815
-
2816
- metadata = new Metadata(metadata);
2817
-
2818
- if (input.country && input.country !== '001') {
2819
- // Validate `input.country`.
2820
- if (!metadata.hasCountry(input.country)) {
2821
- throw new Error("Unknown country: ".concat(input.country));
2822
- }
2823
-
2824
- metadata.country(input.country);
2825
- } else if (input.countryCallingCode) {
2826
- metadata.selectNumberingPlan(input.countryCallingCode);
2827
- } else return input.phone || '';
2828
-
2829
- var countryCallingCode = metadata.countryCallingCode();
2830
- var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // This variable should have been declared inside `case`s
2831
- // but Babel has a bug and it says "duplicate variable declaration".
2832
-
2833
- var number;
2834
-
2835
- switch (format) {
2836
- case 'NATIONAL':
2837
- // Legacy argument support.
2838
- // (`{ country: ..., phone: '' }`)
2839
- if (!nationalNumber) {
2840
- return '';
2841
- }
2842
-
2843
- number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);
2844
- return addExtension(number, input.ext, metadata, options.formatExtension);
2845
-
2846
- case 'INTERNATIONAL':
2847
- // Legacy argument support.
2848
- // (`{ country: ..., phone: '' }`)
2849
- if (!nationalNumber) {
2850
- return "+".concat(countryCallingCode);
2851
- }
2852
-
2853
- number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options);
2854
- number = "+".concat(countryCallingCode, " ").concat(number);
2855
- return addExtension(number, input.ext, metadata, options.formatExtension);
2856
-
2857
- case 'E.164':
2858
- // `E.164` doesn't define "phone number extensions".
2859
- return "+".concat(countryCallingCode).concat(nationalNumber);
2860
-
2861
- case 'RFC3966':
2862
- return formatRFC3966({
2863
- number: "+".concat(countryCallingCode).concat(nationalNumber),
2864
- ext: input.ext
2865
- });
2866
- // For reference, here's Google's IDD formatter:
2867
- // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546
2868
- // Not saying that this IDD formatter replicates it 1:1, but it seems to work.
2869
- // Who would even need to format phone numbers in IDD format anyway?
2870
-
2871
- case 'IDD':
2872
- if (!options.fromCountry) {
2873
- return; // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')
2874
- }
2875
-
2876
- var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);
2877
- return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);
2878
-
2879
- default:
2880
- throw new Error("Unknown \"format\" argument passed to \"formatNumber()\": \"".concat(format, "\""));
2881
- }
2882
- }
2883
-
2884
- function formatNationalNumber(number, carrierCode, formatAs, metadata, options) {
2885
- var format = chooseFormatForNumber(metadata.formats(), number);
2886
-
2887
- if (!format) {
2888
- return number;
2889
- }
2890
-
2891
- return formatNationalNumberUsingFormat(number, format, {
2892
- useInternationalFormat: formatAs === 'INTERNATIONAL',
2893
- withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,
2894
- carrierCode: carrierCode,
2895
- metadata: metadata
2896
- });
2897
- }
2898
-
2899
- function chooseFormatForNumber(availableFormats, nationalNnumber) {
2900
- for (var _iterator = availableFormats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
2901
- var _ref;
2902
-
2903
- if (_isArray) {
2904
- if (_i >= _iterator.length) break;
2905
- _ref = _iterator[_i++];
2906
- } else {
2907
- _i = _iterator.next();
2908
- if (_i.done) break;
2909
- _ref = _i.value;
2910
- }
2911
-
2912
- var format = _ref;
2913
-
2914
- // Validate leading digits
2915
- if (format.leadingDigitsPatterns().length > 0) {
2916
- // The last leading_digits_pattern is used here, as it is the most detailed
2917
- var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1]; // If leading digits don't match then move on to the next phone number format
2918
-
2919
- if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) {
2920
- continue;
2921
- }
2922
- } // Check that the national number matches the phone number format regular expression
2923
-
2924
-
2925
- if (matchesEntirely(nationalNnumber, format.pattern())) {
2926
- return format;
2927
- }
2928
- }
2929
- }
2930
-
2931
- function addExtension(formattedNumber, ext, metadata, formatExtension) {
2932
- return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;
2933
- }
2934
-
2935
- function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {
2936
- var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata); // When calling within the same country calling code.
2937
-
2938
- if (fromCountryCallingCode === countryCallingCode) {
2939
- var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata); // For NANPA regions, return the national format for these regions
2940
- // but prefix it with the country calling code.
2941
-
2942
- if (countryCallingCode === '1') {
2943
- return countryCallingCode + ' ' + formattedNumber;
2944
- } // If regions share a country calling code, the country calling code need
2945
- // not be dialled. This also applies when dialling within a region, so this
2946
- // if clause covers both these cases. Technically this is the case for
2947
- // dialling from La Reunion to other overseas departments of France (French
2948
- // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover
2949
- // this edge case for now and for those cases return the version including
2950
- // country calling code. Details here:
2951
- // http://www.petitfute.com/voyage/225-info-pratiques-reunion
2952
- //
2953
-
2954
-
2955
- return formattedNumber;
2956
- }
2957
-
2958
- var iddPrefix = getIddPrefix(fromCountry, undefined, metadata.metadata);
2959
-
2960
- if (iddPrefix) {
2961
- return "".concat(iddPrefix, " ").concat(countryCallingCode, " ").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));
2962
- }
2963
- }
2964
-
2965
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } return target; }
2966
-
2967
- function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2968
-
2969
- function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2970
-
2971
- function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2972
-
2973
- function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
2974
-
2975
- var PhoneNumber =
2976
- /*#__PURE__*/
2977
- function () {
2978
- function PhoneNumber(countryCallingCode, nationalNumber, metadata) {
2979
- _classCallCheck$1(this, PhoneNumber);
2980
-
2981
- if (!countryCallingCode) {
2982
- throw new TypeError('`country` or `countryCallingCode` not passed');
2983
- }
2984
-
2985
- if (!nationalNumber) {
2986
- throw new TypeError('`nationalNumber` not passed');
2987
- }
2988
-
2989
- if (!metadata) {
2990
- throw new TypeError('`metadata` not passed');
2991
- }
2992
-
2993
- var _metadata = new Metadata(metadata); // If country code is passed then derive `countryCallingCode` from it.
2994
- // Also store the country code as `.country`.
2995
-
2996
-
2997
- if (isCountryCode(countryCallingCode)) {
2998
- this.country = countryCallingCode;
2999
-
3000
- _metadata.country(countryCallingCode);
3001
-
3002
- countryCallingCode = _metadata.countryCallingCode();
3003
- }
3004
-
3005
- this.countryCallingCode = countryCallingCode;
3006
- this.nationalNumber = nationalNumber;
3007
- this.number = '+' + this.countryCallingCode + this.nationalNumber;
3008
- this.metadata = metadata;
3009
- }
3010
-
3011
- _createClass$1(PhoneNumber, [{
3012
- key: "isPossible",
3013
- value: function isPossible() {
3014
- return isPossiblePhoneNumber(this, {
3015
- v2: true
3016
- }, this.metadata);
3017
- }
3018
- }, {
3019
- key: "isValid",
3020
- value: function isValid() {
3021
- return isValidNumber(this, {
3022
- v2: true
3023
- }, this.metadata);
3024
- }
3025
- }, {
3026
- key: "isNonGeographic",
3027
- value: function isNonGeographic() {
3028
- var metadata = new Metadata(this.metadata);
3029
- return metadata.isNonGeographicCallingCode(this.countryCallingCode);
3030
- }
3031
- }, {
3032
- key: "isEqual",
3033
- value: function isEqual(phoneNumber) {
3034
- return this.number === phoneNumber.number && this.ext === phoneNumber.ext;
3035
- } // // Is just an alias for `this.isValid() && this.country === country`.
3036
- // // https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion
3037
- // isValidForRegion(country) {
3038
- // return isValidNumberForRegion(this, country, { v2: true }, this.metadata)
3039
- // }
3040
-
3041
- }, {
3042
- key: "getType",
3043
- value: function getType() {
3044
- return getNumberType(this, {
3045
- v2: true
3046
- }, this.metadata);
3047
- }
3048
- }, {
3049
- key: "format",
3050
- value: function format(_format, options) {
3051
- return formatNumber(this, _format, options ? _objectSpread$1({}, options, {
3052
- v2: true
3053
- }) : {
3054
- v2: true
3055
- }, this.metadata);
3056
- }
3057
- }, {
3058
- key: "formatNational",
3059
- value: function formatNational(options) {
3060
- return this.format('NATIONAL', options);
3061
- }
3062
- }, {
3063
- key: "formatInternational",
3064
- value: function formatInternational(options) {
3065
- return this.format('INTERNATIONAL', options);
3066
- }
3067
- }, {
3068
- key: "getURI",
3069
- value: function getURI(options) {
3070
- return this.format('RFC3966', options);
3071
- }
3072
- }]);
3073
-
3074
- return PhoneNumber;
3075
- }();
3076
-
3077
- var isCountryCode = function isCountryCode(value) {
3078
- return /^[A-Z]{2}$/.test(value);
3079
- };
3080
-
3081
- var CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');
3082
- function stripIddPrefix(number, country, callingCode, metadata) {
3083
- if (!country) {
3084
- return;
3085
- } // Check if the number is IDD-prefixed.
3086
-
3087
-
3088
- var countryMetadata = new Metadata(metadata);
3089
- countryMetadata.selectNumberingPlan(country, callingCode);
3090
- var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());
3091
-
3092
- if (number.search(IDDPrefixPattern) !== 0) {
3093
- return;
3094
- } // Strip IDD prefix.
3095
-
3096
-
3097
- number = number.slice(number.match(IDDPrefixPattern)[0].length); // If there're any digits after an IDD prefix,
3098
- // then those digits are a country calling code.
3099
- // Since no country code starts with a `0`,
3100
- // the code below validates that the next digit (if present) is not `0`.
3101
-
3102
- var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);
3103
-
3104
- if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
3105
- if (matchedGroups[1] === '0') {
3106
- return;
3107
- }
3108
- }
3109
-
3110
- return number;
3111
- }
3112
-
3113
- /**
3114
- * Strips any national prefix (such as 0, 1) present in a
3115
- * (possibly incomplete) number provided.
3116
- * "Carrier codes" are only used in Colombia and Brazil,
3117
- * and only when dialing within those countries from a mobile phone to a fixed line number.
3118
- * Sometimes it won't actually strip national prefix
3119
- * and will instead prepend some digits to the `number`:
3120
- * for example, when number `2345678` is passed with `VI` country selected,
3121
- * it will return `{ number: "3402345678" }`, because `340` area code is prepended.
3122
- * @param {string} number — National number digits.
3123
- * @param {object} metadata — Metadata with country selected.
3124
- * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`.
3125
- */
3126
- function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {
3127
- if (number && metadata.numberingPlan.nationalPrefixForParsing()) {
3128
- // See METADATA.md for the description of
3129
- // `national_prefix_for_parsing` and `national_prefix_transform_rule`.
3130
- // Attempt to parse the first digits as a national prefix.
3131
- var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')');
3132
- var prefixMatch = prefixPattern.exec(number);
3133
-
3134
- if (prefixMatch) {
3135
- var nationalNumber;
3136
- var carrierCode; // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule
3137
- // If a `national_prefix_for_parsing` has any "capturing groups"
3138
- // then it means that the national (significant) number is equal to
3139
- // those "capturing groups" transformed via `national_prefix_transform_rule`,
3140
- // and nothing could be said about the actual national prefix:
3141
- // what is it and was it even there.
3142
- // If a `national_prefix_for_parsing` doesn't have any "capturing groups",
3143
- // then everything it matches is a national prefix.
3144
- // To determine whether `national_prefix_for_parsing` matched any
3145
- // "capturing groups", the value of the result of calling `.exec()`
3146
- // is looked at, and if it has non-undefined values where there're
3147
- // "capturing groups" in the regular expression, then it means
3148
- // that "capturing groups" have been matched.
3149
- // It's not possible to tell whether there'll be any "capturing gropus"
3150
- // before the matching process, because a `national_prefix_for_parsing`
3151
- // could exhibit both behaviors.
3152
-
3153
- var capturedGroupsCount = prefixMatch.length - 1;
3154
- var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];
3155
-
3156
- if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {
3157
- nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule()); // If there's more than one captured group,
3158
- // then carrier code is the second one.
3159
-
3160
- if (capturedGroupsCount > 1) {
3161
- carrierCode = prefixMatch[1];
3162
- }
3163
- } // If there're no "capturing groups",
3164
- // or if there're "capturing groups" but no
3165
- // `national_prefix_transform_rule`,
3166
- // then just strip the national prefix from the number,
3167
- // and possibly a carrier code.
3168
- // Seems like there could be more.
3169
- else {
3170
- // `prefixBeforeNationalNumber` is the whole substring matched by
3171
- // the `national_prefix_for_parsing` regular expression.
3172
- // There seem to be no guarantees that it's just a national prefix.
3173
- // For example, if there's a carrier code, it's gonna be a
3174
- // part of `prefixBeforeNationalNumber` too.
3175
- var prefixBeforeNationalNumber = prefixMatch[0];
3176
- nationalNumber = number.slice(prefixBeforeNationalNumber.length); // If there's at least one captured group,
3177
- // then carrier code is the first one.
3178
-
3179
- if (hasCapturedGroups) {
3180
- carrierCode = prefixMatch[1];
3181
- }
3182
- } // Tries to guess whether a national prefix was present in the input.
3183
- // This is not something copy-pasted from Google's library:
3184
- // they don't seem to have an equivalent for that.
3185
- // So this isn't an "officially approved" way of doing something like that.
3186
- // But since there seems no other existing method, this library uses it.
3187
-
3188
-
3189
- var nationalPrefix;
3190
-
3191
- if (hasCapturedGroups) {
3192
- var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);
3193
- var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup); // Example: an Argentinian (AR) phone number `0111523456789`.
3194
- // `prefixMatch[0]` is `01115`, and `$1` is `11`,
3195
- // and the rest of the phone number is `23456789`.
3196
- // The national number is transformed via `9$1` to `91123456789`.
3197
- // National prefix `0` is detected being present at the start.
3198
- // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) {
3199
-
3200
- if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {
3201
- nationalPrefix = metadata.numberingPlan.nationalPrefix();
3202
- }
3203
- } else {
3204
- nationalPrefix = prefixMatch[0];
3205
- }
3206
-
3207
- return {
3208
- nationalNumber: nationalNumber,
3209
- nationalPrefix: nationalPrefix,
3210
- carrierCode: carrierCode
3211
- };
3212
- }
3213
- }
3214
-
3215
- return {
3216
- nationalNumber: number
3217
- };
3218
- }
3219
-
3220
- /**
3221
- * Strips national prefix and carrier code from a complete phone number.
3222
- * The difference from the non-"FromCompleteNumber" function is that
3223
- * it won't extract national prefix if the resultant number is too short
3224
- * to be a complete number for the selected phone numbering plan.
3225
- * @param {string} number — Complete phone number digits.
3226
- * @param {Metadata} metadata — Metadata with a phone numbering plan selected.
3227
- * @return {object} `{ nationalNumber: string, carrierCode: string? }`.
3228
- */
3229
-
3230
- function extractNationalNumber(number, metadata) {
3231
- // Parsing national prefixes and carrier codes
3232
- // is only required for local phone numbers
3233
- // but some people don't understand that
3234
- // and sometimes write international phone numbers
3235
- // with national prefixes (or maybe even carrier codes).
3236
- // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html
3237
- // Google's original library forgives such mistakes
3238
- // and so does this library, because it has been requested:
3239
- // https://github.com/catamphetamine/libphonenumber-js/issues/127
3240
- var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata),
3241
- nationalNumber = _extractNationalNumbe.nationalNumber,
3242
- carrierCode = _extractNationalNumbe.carrierCode;
3243
-
3244
- if (!shouldExtractNationalPrefix(number, nationalNumber, metadata)) {
3245
- // Don't strip the national prefix.
3246
- return {
3247
- nationalNumber: number
3248
- };
3249
- } // If a national prefix has been extracted, check to see
3250
- // if the resultant number isn't too short.
3251
- // Same code in Google's `libphonenumber`:
3252
- // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3291-L3302
3253
- // For some reason, they do this check right after the `national_number_pattern` check
3254
- // this library does in `shouldExtractNationalPrefix()` function.
3255
- // Why is there a second "resultant" number validity check?
3256
- // They don't provide an explanation.
3257
- // This library just copies the behavior.
3258
-
3259
-
3260
- if (number.length !== nationalNumber.length + (carrierCode ? carrierCode.length : 0)) {
3261
- // If not using legacy generated metadata (before version `1.0.18`)
3262
- // then it has "possible lengths", so use those to validate the number length.
3263
- if (metadata.possibleLengths()) {
3264
- // "We require that the NSN remaining after stripping the national prefix and
3265
- // carrier code be long enough to be a possible length for the region.
3266
- // Otherwise, we don't do the stripping, since the original number could be
3267
- // a valid short number."
3268
- // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250
3269
- switch (checkNumberLength(nationalNumber, metadata)) {
3270
- case 'TOO_SHORT':
3271
- case 'INVALID_LENGTH':
3272
- // case 'IS_POSSIBLE_LOCAL_ONLY':
3273
- // Don't strip the national prefix.
3274
- return {
3275
- nationalNumber: number
3276
- };
3277
- }
3278
- }
3279
- }
3280
-
3281
- return {
3282
- nationalNumber: nationalNumber,
3283
- carrierCode: carrierCode
3284
- };
3285
- } // In some countries, the same digit could be a national prefix
3286
- // or a leading digit of a valid phone number.
3287
- // For example, in Russia, national prefix is `8`,
3288
- // and also `800 555 35 35` is a valid number
3289
- // in which `8` is not a national prefix, but the first digit
3290
- // of a national (significant) number.
3291
- // Same's with Belarus:
3292
- // `82004910060` is a valid national (significant) number,
3293
- // but `2004910060` is not.
3294
- // To support such cases (to prevent the code from always stripping
3295
- // national prefix), a condition is imposed: a national prefix
3296
- // is not extracted when the original number is "viable" and the
3297
- // resultant number is not, a "viable" national number being the one
3298
- // that matches `national_number_pattern`.
3299
-
3300
- function shouldExtractNationalPrefix(number, nationalSignificantNumber, metadata) {
3301
- // The equivalent in Google's code is:
3302
- // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004
3303
- if (matchesEntirely(number, metadata.nationalNumberPattern()) && !matchesEntirely(nationalSignificantNumber, metadata.nationalNumberPattern())) {
3304
- return false;
3305
- } // Just "possible" number check would be more relaxed, so it's not used.
3306
- // if (isPossibleNumber(number, metadata) &&
3307
- // !isPossibleNumber(numberWithNationalPrefixExtracted, metadata)) {
3308
- // return false
3309
- // }
3310
-
3311
-
3312
- return true;
3313
- }
3314
-
3315
- /**
3316
- * Sometimes some people incorrectly input international phone numbers
3317
- * without the leading `+`. This function corrects such input.
3318
- * @param {string} number — Phone number digits.
3319
- * @param {string?} country
3320
- * @param {string?} callingCode
3321
- * @param {object} metadata
3322
- * @return {object} `{ countryCallingCode: string?, number: string }`.
3323
- */
3324
-
3325
- function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata) {
3326
- var countryCallingCode = country ? getCountryCallingCode(country, metadata) : callingCode;
3327
-
3328
- if (number.indexOf(countryCallingCode) === 0) {
3329
- metadata = new Metadata(metadata);
3330
- metadata.selectNumberingPlan(country, callingCode);
3331
- var possibleShorterNumber = number.slice(countryCallingCode.length);
3332
-
3333
- var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata),
3334
- possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;
3335
-
3336
- var _extractNationalNumbe2 = extractNationalNumber(number, metadata),
3337
- nationalNumber = _extractNationalNumbe2.nationalNumber; // If the number was not valid before but is valid now,
3338
- // or if it was too long before, we consider the number
3339
- // with the country calling code stripped to be a better result
3340
- // and keep that instead.
3341
- // For example, in Germany (+49), `49` is a valid area code,
3342
- // so if a number starts with `49`, it could be both a valid
3343
- // national German number or an international number without
3344
- // a leading `+`.
3345
-
3346
-
3347
- if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata) === 'TOO_LONG') {
3348
- return {
3349
- countryCallingCode: countryCallingCode,
3350
- number: possibleShorterNumber
3351
- };
3352
- }
3353
- }
3354
-
3355
- return {
3356
- number: number
3357
- };
3358
- }
3359
-
3360
- /**
3361
- * Converts a phone number digits (possibly with a `+`)
3362
- * into a calling code and the rest phone number digits.
3363
- * The "rest phone number digits" could include
3364
- * a national prefix, carrier code, and national
3365
- * (significant) number.
3366
- * @param {string} number — Phone number digits (possibly with a `+`).
3367
- * @param {string} [country] — Default country.
3368
- * @param {string} [callingCode] — Default calling code (some phone numbering plans are non-geographic).
3369
- * @param {object} metadata
3370
- * @return {object} `{ countryCallingCode: string?, number: string }`
3371
- * @example
3372
- * // Returns `{ countryCallingCode: "1", number: "2133734253" }`.
3373
- * extractCountryCallingCode('2133734253', 'US', null, metadata)
3374
- * extractCountryCallingCode('2133734253', null, '1', metadata)
3375
- * extractCountryCallingCode('+12133734253', null, null, metadata)
3376
- * extractCountryCallingCode('+12133734253', 'RU', null, metadata)
3377
- */
3378
-
3379
- function extractCountryCallingCode(number, country, callingCode, metadata) {
3380
- if (!number) {
3381
- return {};
3382
- } // If this is not an international phone number,
3383
- // then either extract an "IDD" prefix, or extract a
3384
- // country calling code from a number by autocorrecting it
3385
- // by prepending a leading `+` in cases when it starts
3386
- // with the country calling code.
3387
- // https://wikitravel.org/en/International_dialling_prefix
3388
- // https://github.com/catamphetamine/libphonenumber-js/issues/376
3389
-
3390
-
3391
- if (number[0] !== '+') {
3392
- // Convert an "out-of-country" dialing phone number
3393
- // to a proper international phone number.
3394
- var numberWithoutIDD = stripIddPrefix(number, country, callingCode, metadata); // If an IDD prefix was stripped then
3395
- // convert the number to international one
3396
- // for subsequent parsing.
3397
-
3398
- if (numberWithoutIDD && numberWithoutIDD !== number) {
3399
- number = '+' + numberWithoutIDD;
3400
- } else {
3401
- // Check to see if the number starts with the country calling code
3402
- // for the default country. If so, we remove the country calling code,
3403
- // and do some checks on the validity of the number before and after.
3404
- // https://github.com/catamphetamine/libphonenumber-js/issues/376
3405
- if (country || callingCode) {
3406
- var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata),
3407
- countryCallingCode = _extractCountryCallin.countryCallingCode,
3408
- shorterNumber = _extractCountryCallin.number;
3409
-
3410
- if (countryCallingCode) {
3411
- return {
3412
- countryCallingCode: countryCallingCode,
3413
- number: shorterNumber
3414
- };
3415
- }
3416
- }
3417
-
3418
- return {
3419
- number: number
3420
- };
3421
- }
3422
- } // Fast abortion: country codes do not begin with a '0'
3423
-
3424
-
3425
- if (number[1] === '0') {
3426
- return {};
3427
- }
3428
-
3429
- metadata = new Metadata(metadata); // The thing with country phone codes
3430
- // is that they are orthogonal to each other
3431
- // i.e. there's no such country phone code A
3432
- // for which country phone code B exists
3433
- // where B starts with A.
3434
- // Therefore, while scanning digits,
3435
- // if a valid country code is found,
3436
- // that means that it is the country code.
3437
- //
3438
-
3439
- var i = 2;
3440
-
3441
- while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {
3442
- var _countryCallingCode = number.slice(1, i);
3443
-
3444
- if (metadata.hasCallingCode(_countryCallingCode)) {
3445
- metadata.selectNumberingPlan(_countryCallingCode);
3446
- return {
3447
- countryCallingCode: _countryCallingCode,
3448
- number: number.slice(i)
3449
- };
3450
- }
3451
-
3452
- i++;
3453
- }
3454
-
3455
- return {};
3456
- }
3457
-
3458
- function getCountryByCallingCode(callingCode, nationalPhoneNumber, metadata) {
3459
-
3460
-
3461
- var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);
3462
-
3463
- if (!possibleCountries) {
3464
- return;
3465
- } // If there's just one country corresponding to the country code,
3466
- // then just return it, without further phone number digits validation.
3467
-
3468
-
3469
- if (possibleCountries.length === 1) {
3470
- return possibleCountries[0];
3471
- }
3472
-
3473
- return selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata.metadata);
3474
- }
3475
-
3476
- function selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata) {
3477
- // Re-create `metadata` because it will be selecting a `country`.
3478
- metadata = new Metadata(metadata);
3479
-
3480
- for (var _iterator = possibleCountries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
3481
- var _ref;
3482
-
3483
- if (_isArray) {
3484
- if (_i >= _iterator.length) break;
3485
- _ref = _iterator[_i++];
3486
- } else {
3487
- _i = _iterator.next();
3488
- if (_i.done) break;
3489
- _ref = _i.value;
3490
- }
3491
-
3492
- var country = _ref;
3493
- metadata.country(country); // Leading digits check would be the simplest one
3494
-
3495
- if (metadata.leadingDigits()) {
3496
- if (nationalPhoneNumber && nationalPhoneNumber.search(metadata.leadingDigits()) === 0) {
3497
- return country;
3498
- }
3499
- } // Else perform full validation with all of those
3500
- // fixed-line/mobile/etc regular expressions.
3501
- else if (getNumberType({
3502
- phone: nationalPhoneNumber,
3503
- country: country
3504
- }, undefined, metadata.metadata)) {
3505
- return country;
3506
- }
3507
- }
3508
- }
3509
-
3510
- function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3511
-
3512
- function _defineProperties$2(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3513
-
3514
- function _createClass$2(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$2(Constructor.prototype, protoProps); if (staticProps) _defineProperties$2(Constructor, staticProps); return Constructor; }
3515
-
3516
- function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3517
-
3518
- var AsYouTypeState =
3519
- /*#__PURE__*/
3520
- function () {
3521
- function AsYouTypeState(_ref) {
3522
- var _this = this;
3523
-
3524
- var onCountryChange = _ref.onCountryChange,
3525
- onCallingCodeChange = _ref.onCallingCodeChange;
3526
-
3527
- _classCallCheck$2(this, AsYouTypeState);
3528
-
3529
- _defineProperty$2(this, "update", function (properties) {
3530
- for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {
3531
- var key = _Object$keys[_i];
3532
- _this[key] = properties[key];
3533
- }
3534
- });
3535
-
3536
- this.onCountryChange = onCountryChange;
3537
- this.onCallingCodeChange = onCallingCodeChange;
3538
- }
3539
-
3540
- _createClass$2(AsYouTypeState, [{
3541
- key: "reset",
3542
- value: function reset(defaultCountry, defaultCallingCode) {
3543
- this.international = false;
3544
- this.IDDPrefix = undefined;
3545
- this.missingPlus = undefined;
3546
- this.callingCode = undefined;
3547
- this.digits = '';
3548
- this.resetNationalSignificantNumber();
3549
- this.initCountryAndCallingCode(defaultCountry, defaultCallingCode);
3550
- }
3551
- }, {
3552
- key: "resetNationalSignificantNumber",
3553
- value: function resetNationalSignificantNumber() {
3554
- this.nationalSignificantNumber = this.getNationalDigits();
3555
- this.nationalSignificantNumberMatchesInput = true;
3556
- this.nationalPrefix = undefined;
3557
- this.carrierCode = undefined;
3558
- this.complexPrefixBeforeNationalSignificantNumber = undefined;
3559
- }
3560
- }, {
3561
- key: "initCountryAndCallingCode",
3562
- value: function initCountryAndCallingCode(country, callingCode) {
3563
- this.setCountry(country);
3564
- this.setCallingCode(callingCode);
3565
- }
3566
- }, {
3567
- key: "setCountry",
3568
- value: function setCountry(country) {
3569
- this.country = country;
3570
- this.onCountryChange(country);
3571
- }
3572
- }, {
3573
- key: "setCallingCode",
3574
- value: function setCallingCode(callingCode) {
3575
- this.callingCode = callingCode;
3576
- return this.onCallingCodeChange(this.country, callingCode);
3577
- }
3578
- }, {
3579
- key: "startInternationalNumber",
3580
- value: function startInternationalNumber() {
3581
- // Prepend the `+` to parsed input.
3582
- this.international = true; // If a default country was set then reset it
3583
- // because an explicitly international phone
3584
- // number is being entered.
3585
-
3586
- this.initCountryAndCallingCode();
3587
- }
3588
- }, {
3589
- key: "appendDigits",
3590
- value: function appendDigits(nextDigits) {
3591
- this.digits += nextDigits;
3592
- }
3593
- }, {
3594
- key: "appendNationalSignificantNumberDigits",
3595
- value: function appendNationalSignificantNumberDigits(nextDigits) {
3596
- this.nationalSignificantNumber += nextDigits;
3597
- }
3598
- /**
3599
- * Returns the part of `this.digits` that corresponds to the national number.
3600
- * Basically, all digits that have been input by the user, except for the
3601
- * international prefix and the country calling code part
3602
- * (if the number is an international one).
3603
- * @return {string}
3604
- */
3605
-
3606
- }, {
3607
- key: "getNationalDigits",
3608
- value: function getNationalDigits() {
3609
- if (this.international) {
3610
- return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0));
3611
- }
3612
-
3613
- return this.digits;
3614
- }
3615
- }, {
3616
- key: "getDigitsWithoutInternationalPrefix",
3617
- value: function getDigitsWithoutInternationalPrefix() {
3618
- if (this.international) {
3619
- if (this.IDDPrefix) {
3620
- return this.digits.slice(this.IDDPrefix.length);
3621
- }
3622
- }
3623
-
3624
- return this.digits;
3625
- }
3626
- }]);
3627
-
3628
- return AsYouTypeState;
3629
- }();
3630
-
3631
- // Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.
3632
- var DIGIT_PLACEHOLDER = 'x'; // '\u2008' (punctuation space)
3633
-
3634
- var DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER); // Counts all occurences of a symbol in a string.
3635
- // http://stackoverflow.com/questions/202605/repeat-string-javascript
3636
-
3637
- function repeat(string, times) {
3638
- if (times < 1) {
3639
- return '';
3640
- }
3641
-
3642
- var result = '';
3643
-
3644
- while (times > 1) {
3645
- if (times & 1) {
3646
- result += string;
3647
- }
3648
-
3649
- times >>= 1;
3650
- string += string;
3651
- }
3652
-
3653
- return result + string;
3654
- }
3655
- function cutAndStripNonPairedParens(string, cutBeforeIndex) {
3656
- if (string[cutBeforeIndex] === ')') {
3657
- cutBeforeIndex++;
3658
- }
3659
-
3660
- return stripNonPairedParens(string.slice(0, cutBeforeIndex));
3661
- }
3662
- function stripNonPairedParens(string) {
3663
- var dangling_braces = [];
3664
- var i = 0;
3665
-
3666
- while (i < string.length) {
3667
- if (string[i] === '(') {
3668
- dangling_braces.push(i);
3669
- } else if (string[i] === ')') {
3670
- dangling_braces.pop();
3671
- }
3672
-
3673
- i++;
3674
- }
3675
-
3676
- var start = 0;
3677
- var cleared_string = '';
3678
- dangling_braces.push(string.length);
3679
-
3680
- for (var _i2 = 0, _dangling_braces = dangling_braces; _i2 < _dangling_braces.length; _i2++) {
3681
- var index = _dangling_braces[_i2];
3682
- cleared_string += string.slice(start, index);
3683
- start = index + 1;
3684
- }
3685
-
3686
- return cleared_string;
3687
- }
3688
- function populateTemplateWithDigits(template, position, digits) {
3689
- // Using `.split('')` to iterate through a string here
3690
- // to avoid requiring `Symbol.iterator` polyfill.
3691
- // `.split('')` is generally not safe for Unicode,
3692
- // but in this particular case for `digits` it is safe.
3693
- // for (const digit of digits)
3694
- for (var _iterator2 = digits.split(''), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
3695
- var _ref2;
3696
-
3697
- if (_isArray2) {
3698
- if (_i3 >= _iterator2.length) break;
3699
- _ref2 = _iterator2[_i3++];
3700
- } else {
3701
- _i3 = _iterator2.next();
3702
- if (_i3.done) break;
3703
- _ref2 = _i3.value;
3704
- }
3705
-
3706
- var digit = _ref2;
3707
-
3708
- // If there is room for more digits in current `template`,
3709
- // then set the next digit in the `template`,
3710
- // and return the formatted digits so far.
3711
- // If more digits are entered than the current format could handle.
3712
- if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {
3713
- return;
3714
- }
3715
-
3716
- position = template.search(DIGIT_PLACEHOLDER_MATCHER);
3717
- template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);
3718
- }
3719
-
3720
- return [template, position];
3721
- }
3722
-
3723
- function formatCompleteNumber(state, format, _ref) {
3724
- var metadata = _ref.metadata,
3725
- shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule,
3726
- getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;
3727
- var matcher = new RegExp("^(?:".concat(format.pattern(), ")$"));
3728
-
3729
- if (matcher.test(state.nationalSignificantNumber)) {
3730
- return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, {
3731
- metadata: metadata,
3732
- shouldTryNationalPrefixFormattingRule: shouldTryNationalPrefixFormattingRule,
3733
- getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix
3734
- });
3735
- }
3736
- }
3737
- function canFormatCompleteNumber(nationalSignificantNumber, metadata) {
3738
- return checkNumberLength(nationalSignificantNumber, metadata) === 'IS_POSSIBLE';
3739
- }
3740
-
3741
- function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {
3742
- var metadata = _ref2.metadata,
3743
- shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule,
3744
- getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;
3745
- // If the resulting formatted number is a valid formatted number, then return it.
3746
- //
3747
- // Google's AsYouType formatter is different in a way that it doesn't try
3748
- // to format using the "national prefix formatting rule", and instead it
3749
- // simply prepends a national prefix followed by a " " character.
3750
- // This code does that too, but as a fallback.
3751
- // The reason is that "national prefix formatting rule" may use parentheses,
3752
- // which wouldn't be included has it used the simpler Google's way.
3753
- //
3754
-
3755
- if (shouldTryNationalPrefixFormattingRule(format)) {
3756
- var formattedNumber = formatNationalNumber$1(state, format, {
3757
- useNationalPrefixFormattingRule: true,
3758
- getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,
3759
- metadata: metadata
3760
- });
3761
-
3762
- if (formattedNumber) {
3763
- return formattedNumber;
3764
- }
3765
- } // Format the number without using `national_prefix_formatting_rule`.
3766
-
3767
-
3768
- return formatNationalNumber$1(state, format, {
3769
- useNationalPrefixFormattingRule: false,
3770
- getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,
3771
- metadata: metadata
3772
- });
3773
- }
3774
-
3775
- function formatNationalNumber$1(state, format, _ref3) {
3776
- var metadata = _ref3.metadata,
3777
- useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule,
3778
- getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;
3779
- var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format, {
3780
- carrierCode: state.carrierCode,
3781
- useInternationalFormat: state.international,
3782
- withNationalPrefix: useNationalPrefixFormattingRule,
3783
- metadata: metadata
3784
- });
3785
-
3786
- if (!useNationalPrefixFormattingRule) {
3787
- if (state.nationalPrefix) {
3788
- // If a national prefix was extracted, then just prepend it,
3789
- // followed by a " " character.
3790
- formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber;
3791
- } else if (state.complexPrefixBeforeNationalSignificantNumber) {
3792
- formattedNationalNumber = state.complexPrefixBeforeNationalSignificantNumber + ' ' + formattedNationalNumber;
3793
- }
3794
- }
3795
-
3796
- if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {
3797
- return formattedNationalNumber;
3798
- }
3799
- } // Check that the formatted phone number contains exactly
3800
- // the same digits that have been input by the user.
3801
- // For example, when "0111523456789" is input for `AR` country,
3802
- // the extracted `this.nationalSignificantNumber` is "91123456789",
3803
- // which means that the national part of `this.digits` isn't simply equal to
3804
- // `this.nationalPrefix` + `this.nationalSignificantNumber`.
3805
- //
3806
- // Also, a `format` can add extra digits to the `this.nationalSignificantNumber`
3807
- // being formatted via `metadata[country].national_prefix_transform_rule`.
3808
- // For example, for `VI` country, it prepends `340` to the national number,
3809
- // and if this check hasn't been implemented, then there would be a bug
3810
- // when `340` "area coude" is "duplicated" during input for `VI` country:
3811
- // https://github.com/catamphetamine/libphonenumber-js/issues/318
3812
- //
3813
- // So, all these "gotchas" are filtered out.
3814
- //
3815
- // In the original Google's code, the comments say:
3816
- // "Check that we didn't remove nor add any extra digits when we matched
3817
- // this formatting pattern. This usually happens after we entered the last
3818
- // digit during AYTF. Eg: In case of MX, we swallow mobile token (1) when
3819
- // formatted but AYTF should retain all the number entered and not change
3820
- // in order to match a format (of same leading digits and length) display
3821
- // in that way."
3822
- // "If it's the same (i.e entered number and format is same), then it's
3823
- // safe to return this in formatted number as nothing is lost / added."
3824
- // Otherwise, don't use this format.
3825
- // https://github.com/google/libphonenumber/commit/3e7c1f04f5e7200f87fb131e6f85c6e99d60f510#diff-9149457fa9f5d608a11bb975c6ef4bc5
3826
- // https://github.com/google/libphonenumber/commit/3ac88c7106e7dcb553bcc794b15f19185928a1c6#diff-2dcb77e833422ee304da348b905cde0b
3827
- //
3828
-
3829
-
3830
- function isValidFormattedNationalNumber(formattedNationalNumber, state) {
3831
- return parseDigits(formattedNationalNumber) === state.getNationalDigits();
3832
- }
3833
-
3834
- function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3835
-
3836
- function _defineProperties$3(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3837
-
3838
- function _createClass$3(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$3(Constructor.prototype, protoProps); if (staticProps) _defineProperties$3(Constructor, staticProps); return Constructor; }
3839
-
3840
- function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3841
- // Could be any digit, I guess.
3842
-
3843
- var DUMMY_DIGIT = '9'; // I don't know why is it exactly `15`
3844
-
3845
- var LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15; // Create a phone number consisting only of the digit 9 that matches the
3846
- // `number_pattern` by applying the pattern to the "longest phone number" string.
3847
-
3848
- var LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH); // A set of characters that, if found in a national prefix formatting rules, are an indicator to
3849
- // us that we should separate the national prefix from the number when formatting.
3850
-
3851
- var NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/; // Deprecated: Google has removed some formatting pattern related code from their repo.
3852
- // An example of a character class is "[1-4]".
3853
-
3854
- var CREATE_CHARACTER_CLASS_PATTERN = function () {
3855
- return /\[([^\[\]])*\]/g;
3856
- }; // Any digit in a regular expression that actually denotes a digit. For
3857
- // example, in the regular expression "80[0-2]\d{6,10}", the first 2 digits
3858
- // (8 and 0) are standalone digits, but the rest are not.
3859
- // Two look-aheads are needed because the number following \\d could be a
3860
- // two-digit number, since the phone number can be as long as 15 digits.
3861
-
3862
-
3863
- var CREATE_STANDALONE_DIGIT_PATTERN = function () {
3864
- return /\d(?=[^,}][^,}])/g;
3865
- }; // A regular expression that is used to determine if a `format` is
3866
- // suitable to be used in the "as you type formatter".
3867
- // A `format` is suitable when the resulting formatted number has
3868
- // the same digits as the user has entered.
3869
- //
3870
- // In the simplest case, that would mean that the format
3871
- // doesn't add any additional digits when formatting a number.
3872
- // Google says that it also shouldn't add "star" (`*`) characters,
3873
- // like it does in some Israeli formats.
3874
- // Such basic format would only contain "valid punctuation"
3875
- // and "captured group" identifiers ($1, $2, etc).
3876
- //
3877
- // An example of a format that adds additional digits:
3878
- //
3879
- // Country: `AR` (Argentina).
3880
- // Format:
3881
- // {
3882
- // "pattern": "(\\d)(\\d{2})(\\d{4})(\\d{4})",
3883
- // "leading_digits_patterns": ["91"],
3884
- // "national_prefix_formatting_rule": "0$1",
3885
- // "format": "$2 15-$3-$4",
3886
- // "international_format": "$1 $2 $3-$4"
3887
- // }
3888
- //
3889
- // In the format above, the `format` adds `15` to the digits when formatting a number.
3890
- // A sidenote: this format actually is suitable because `national_prefix_for_parsing`
3891
- // has previously removed `15` from a national number, so re-adding `15` in `format`
3892
- // doesn't actually result in any extra digits added to user's input.
3893
- // But verifying that would be a complex procedure, so the code chooses a simpler path:
3894
- // it simply filters out all `format`s that contain anything but "captured group" ids.
3895
- //
3896
- // This regular expression is called `ELIGIBLE_FORMAT_PATTERN` in Google's
3897
- // `libphonenumber` code.
3898
- //
3899
-
3900
-
3901
- var NON_ALTERING_FORMAT_REG_EXP = new RegExp('^' + '[' + VALID_PUNCTUATION + ']*' + '(\\$\\d[' + VALID_PUNCTUATION + ']*)+' + '$'); // This is the minimum length of the leading digits of a phone number
3902
- // to guarantee the first "leading digits pattern" for a phone number format
3903
- // to be preemptive.
3904
-
3905
- var MIN_LEADING_DIGITS_LENGTH = 3;
3906
-
3907
- var AsYouTypeFormatter =
3908
- /*#__PURE__*/
3909
- function () {
3910
- function AsYouTypeFormatter(_ref) {
3911
- var _this = this;
3912
-
3913
- var metadata = _ref.metadata;
3914
-
3915
- _classCallCheck$3(this, AsYouTypeFormatter);
3916
-
3917
- _defineProperty$3(this, "getSeparatorAfterNationalPrefix", function (format) {
3918
- // `US` metadata doesn't have a `national_prefix_formatting_rule`,
3919
- // so the `if` condition below doesn't apply to `US`,
3920
- // but in reality there shoudl be a separator
3921
- // between a national prefix and a national (significant) number.
3922
- // So `US` national prefix separator is a "special" "hardcoded" case.
3923
- if (_this.isNANP) {
3924
- return ' ';
3925
- } // If a `format` has a `national_prefix_formatting_rule`
3926
- // and that rule has a separator after a national prefix,
3927
- // then it means that there should be a separator
3928
- // between a national prefix and a national (significant) number.
3929
-
3930
-
3931
- if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) {
3932
- return ' ';
3933
- } // At this point, there seems to be no clear evidence that
3934
- // there should be a separator between a national prefix
3935
- // and a national (significant) number. So don't insert one.
3936
-
3937
-
3938
- return '';
3939
- });
3940
-
3941
- _defineProperty$3(this, "shouldTryNationalPrefixFormattingRule", function (format, _ref2) {
3942
- var international = _ref2.international,
3943
- nationalPrefix = _ref2.nationalPrefix;
3944
-
3945
- if (format.nationalPrefixFormattingRule()) {
3946
- // In some countries, `national_prefix_formatting_rule` is `($1)`,
3947
- // so it applies even if the user hasn't input a national prefix.
3948
- // `format.usesNationalPrefix()` detects such cases.
3949
- var usesNationalPrefix = format.usesNationalPrefix();
3950
-
3951
- if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {
3952
- return true;
3953
- }
3954
- }
3955
- });
3956
-
3957
- this.metadata = metadata;
3958
- this.resetFormat();
3959
- }
3960
-
3961
- _createClass$3(AsYouTypeFormatter, [{
3962
- key: "resetFormat",
3963
- value: function resetFormat() {
3964
- this.chosenFormat = undefined;
3965
- this.template = undefined;
3966
- this.nationalNumberTemplate = undefined;
3967
- this.populatedNationalNumberTemplate = undefined;
3968
- this.populatedNationalNumberTemplatePosition = -1;
3969
- }
3970
- }, {
3971
- key: "reset",
3972
- value: function reset(numberingPlan, state) {
3973
- this.resetFormat();
3974
-
3975
- if (numberingPlan) {
3976
- this.isNANP = numberingPlan.callingCode() === '1';
3977
- this.matchingFormats = numberingPlan.formats();
3978
-
3979
- if (state.nationalSignificantNumber) {
3980
- this.narrowDownMatchingFormats(state);
3981
- }
3982
- } else {
3983
- this.isNANP = undefined;
3984
- this.matchingFormats = [];
3985
- }
3986
- }
3987
- }, {
3988
- key: "format",
3989
- value: function format(nextDigits, state) {
3990
- var _this2 = this;
3991
-
3992
- // See if the phone number digits can be formatted as a complete phone number.
3993
- // If not, use the results from `formatNationalNumberWithNextDigits()`,
3994
- // which formats based on the chosen formatting pattern.
3995
- //
3996
- // Attempting to format complete phone number first is how it's done
3997
- // in Google's `libphonenumber`, so this library just follows it.
3998
- // Google's `libphonenumber` code doesn't explain in detail why does it
3999
- // attempt to format digits as a complete phone number
4000
- // instead of just going with a previoulsy (or newly) chosen `format`:
4001
- //
4002
- // "Checks to see if there is an exact pattern match for these digits.
4003
- // If so, we should use this instead of any other formatting template
4004
- // whose leadingDigitsPattern also matches the input."
4005
- //
4006
- if (canFormatCompleteNumber(state.nationalSignificantNumber, this.metadata)) {
4007
- for (var _iterator = this.matchingFormats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
4008
- var _ref3;
4009
-
4010
- if (_isArray) {
4011
- if (_i >= _iterator.length) break;
4012
- _ref3 = _iterator[_i++];
4013
- } else {
4014
- _i = _iterator.next();
4015
- if (_i.done) break;
4016
- _ref3 = _i.value;
4017
- }
4018
-
4019
- var format = _ref3;
4020
- var formattedCompleteNumber = formatCompleteNumber(state, format, {
4021
- metadata: this.metadata,
4022
- shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format) {
4023
- return _this2.shouldTryNationalPrefixFormattingRule(format, {
4024
- international: state.international,
4025
- nationalPrefix: state.nationalPrefix
4026
- });
4027
- },
4028
- getSeparatorAfterNationalPrefix: this.getSeparatorAfterNationalPrefix
4029
- });
4030
-
4031
- if (formattedCompleteNumber) {
4032
- this.resetFormat();
4033
- this.chosenFormat = format;
4034
- this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\d/g, DIGIT_PLACEHOLDER), state);
4035
- this.populatedNationalNumberTemplate = formattedCompleteNumber; // With a new formatting template, the matched position
4036
- // using the old template needs to be reset.
4037
-
4038
- this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);
4039
- return formattedCompleteNumber;
4040
- }
4041
- }
4042
- } // Format the digits as a partial (incomplete) phone number
4043
- // using the previously chosen formatting pattern (or a newly chosen one).
4044
-
4045
-
4046
- return this.formatNationalNumberWithNextDigits(nextDigits, state);
4047
- } // Formats the next phone number digits.
4048
-
4049
- }, {
4050
- key: "formatNationalNumberWithNextDigits",
4051
- value: function formatNationalNumberWithNextDigits(nextDigits, state) {
4052
- var previouslyChosenFormat = this.chosenFormat; // Choose a format from the list of matching ones.
4053
-
4054
- var newlyChosenFormat = this.chooseFormat(state);
4055
-
4056
- if (newlyChosenFormat) {
4057
- if (newlyChosenFormat === previouslyChosenFormat) {
4058
- // If it can format the next (current) digits
4059
- // using the previously chosen phone number format
4060
- // then return the updated formatted number.
4061
- return this.formatNextNationalNumberDigits(nextDigits);
4062
- } else {
4063
- // If a more appropriate phone number format
4064
- // has been chosen for these "leading digits",
4065
- // then re-format the national phone number part
4066
- // using the newly selected format.
4067
- return this.formatNextNationalNumberDigits(state.getNationalDigits());
4068
- }
4069
- }
4070
- }
4071
- }, {
4072
- key: "narrowDownMatchingFormats",
4073
- value: function narrowDownMatchingFormats(_ref4) {
4074
- var _this3 = this;
4075
-
4076
- var nationalSignificantNumber = _ref4.nationalSignificantNumber,
4077
- nationalPrefix = _ref4.nationalPrefix,
4078
- international = _ref4.international;
4079
- var leadingDigits = nationalSignificantNumber; // "leading digits" pattern list starts with a
4080
- // "leading digits" pattern fitting a maximum of 3 leading digits.
4081
- // So, after a user inputs 3 digits of a national (significant) phone number
4082
- // this national (significant) number can already be formatted.
4083
- // The next "leading digits" pattern is for 4 leading digits max,
4084
- // and the "leading digits" pattern after it is for 5 leading digits max, etc.
4085
- // This implementation is different from Google's
4086
- // in that it searches for a fitting format
4087
- // even if the user has entered less than
4088
- // `MIN_LEADING_DIGITS_LENGTH` digits of a national number.
4089
- // Because some leading digit patterns already match for a single first digit.
4090
-
4091
- var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;
4092
-
4093
- if (leadingDigitsPatternIndex < 0) {
4094
- leadingDigitsPatternIndex = 0;
4095
- }
4096
-
4097
- this.matchingFormats = this.matchingFormats.filter(function (format) {
4098
- return _this3.formatSuits(format, international, nationalPrefix) && _this3.formatMatches(format, leadingDigits, leadingDigitsPatternIndex);
4099
- }); // If there was a phone number format chosen
4100
- // and it no longer holds given the new leading digits then reset it.
4101
- // The test for this `if` condition is marked as:
4102
- // "Reset a chosen format when it no longer holds given the new leading digits".
4103
- // To construct a valid test case for this one can find a country
4104
- // in `PhoneNumberMetadata.xml` yielding one format for 3 `<leadingDigits>`
4105
- // and yielding another format for 4 `<leadingDigits>` (Australia in this case).
4106
-
4107
- if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {
4108
- this.resetFormat();
4109
- }
4110
- }
4111
- }, {
4112
- key: "formatSuits",
4113
- value: function formatSuits(format, international, nationalPrefix) {
4114
- // When a prefix before a national (significant) number is
4115
- // simply a national prefix, then it's parsed as `this.nationalPrefix`.
4116
- // In more complex cases, a prefix before national (significant) number
4117
- // could include a national prefix as well as some "capturing groups",
4118
- // and in that case there's no info whether a national prefix has been parsed.
4119
- // If national prefix is not used when formatting a phone number
4120
- // using this format, but a national prefix has been entered by the user,
4121
- // and was extracted, then discard such phone number format.
4122
- // In Google's "AsYouType" formatter code, the equivalent would be this part:
4123
- // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L175-L184
4124
- if (nationalPrefix && !format.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() &&
4125
- !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {
4126
- return false;
4127
- } // If national prefix is mandatory for this phone number format
4128
- // and there're no guarantees that a national prefix is present in user input
4129
- // then discard this phone number format as not suitable.
4130
- // In Google's "AsYouType" formatter code, the equivalent would be this part:
4131
- // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L185-L193
4132
-
4133
-
4134
- if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {
4135
- return false;
4136
- }
4137
-
4138
- return true;
4139
- }
4140
- }, {
4141
- key: "formatMatches",
4142
- value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) {
4143
- var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length; // If this format is not restricted to a certain
4144
- // leading digits pattern then it fits.
4145
-
4146
- if (leadingDigitsPatternsCount === 0) {
4147
- return true;
4148
- } // Start excluding any non-matching formats only when the
4149
- // national number entered so far is at least 3 digits long,
4150
- // otherwise format matching would give false negatives.
4151
- // For example, when the digits entered so far are `2`
4152
- // and the leading digits pattern is `21` –
4153
- // it's quite obvious in this case that the format could be the one
4154
- // but due to the absence of further digits it would give false negative.
4155
-
4156
-
4157
- if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {
4158
- return true;
4159
- } // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are available
4160
- // then format matching starts narrowing down the list of possible formats
4161
- // (only previously matched formats are considered for next digits).
4162
-
4163
-
4164
- leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);
4165
- var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex]; // Brackets are required for `^` to be applied to
4166
- // all or-ed (`|`) parts, not just the first one.
4167
-
4168
- return new RegExp("^(".concat(leadingDigitsPattern, ")")).test(leadingDigits);
4169
- }
4170
- }, {
4171
- key: "getFormatFormat",
4172
- value: function getFormatFormat(format, international) {
4173
- return international ? format.internationalFormat() : format.format();
4174
- }
4175
- }, {
4176
- key: "chooseFormat",
4177
- value: function chooseFormat(state) {
4178
- var _this4 = this;
4179
-
4180
- var _loop2 = function _loop2() {
4181
- if (_isArray2) {
4182
- if (_i2 >= _iterator2.length) return "break";
4183
- _ref5 = _iterator2[_i2++];
4184
- } else {
4185
- _i2 = _iterator2.next();
4186
- if (_i2.done) return "break";
4187
- _ref5 = _i2.value;
4188
- }
4189
-
4190
- var format = _ref5;
4191
-
4192
- // If this format is currently being used
4193
- // and is still suitable, then stick to it.
4194
- if (_this4.chosenFormat === format) {
4195
- return "break";
4196
- } // Sometimes, a formatting rule inserts additional digits in a phone number,
4197
- // and "as you type" formatter can't do that: it should only use the digits
4198
- // that the user has input.
4199
- //
4200
- // For example, in Argentina, there's a format for mobile phone numbers:
4201
- //
4202
- // {
4203
- // "pattern": "(\\d)(\\d{2})(\\d{4})(\\d{4})",
4204
- // "leading_digits_patterns": ["91"],
4205
- // "national_prefix_formatting_rule": "0$1",
4206
- // "format": "$2 15-$3-$4",
4207
- // "international_format": "$1 $2 $3-$4"
4208
- // }
4209
- //
4210
- // In that format, `international_format` is used instead of `format`
4211
- // because `format` inserts `15` in the formatted number,
4212
- // and `AsYouType` formatter should only use the digits
4213
- // the user has actually input, without adding any extra digits.
4214
- // In this case, it wouldn't make a difference, because the `15`
4215
- // is first stripped when applying `national_prefix_for_parsing`
4216
- // and then re-added when using `format`, so in reality it doesn't
4217
- // add any new digits to the number, but to detect that, the code
4218
- // would have to be more complex: it would have to try formatting
4219
- // the digits using the format and then see if any digits have
4220
- // actually been added or removed, and then, every time a new digit
4221
- // is input, it should re-check whether the chosen format doesn't
4222
- // alter the digits.
4223
- //
4224
- // Google's code doesn't go that far, and so does this library:
4225
- // it simply requires that a `format` doesn't add any additonal
4226
- // digits to user's input.
4227
- //
4228
- // Also, people in general should move from inputting phone numbers
4229
- // in national format (possibly with national prefixes)
4230
- // and use international phone number format instead:
4231
- // it's a logical thing in the modern age of mobile phones,
4232
- // globalization and the internet.
4233
- //
4234
-
4235
- /* istanbul ignore if */
4236
-
4237
-
4238
- if (!NON_ALTERING_FORMAT_REG_EXP.test(_this4.getFormatFormat(format, state.international))) {
4239
- return "continue";
4240
- }
4241
-
4242
- if (!_this4.createTemplateForFormat(format, state)) {
4243
- // Remove the format if it can't generate a template.
4244
- _this4.matchingFormats = _this4.matchingFormats.filter(function (_) {
4245
- return _ !== format;
4246
- });
4247
- return "continue";
4248
- }
4249
-
4250
- _this4.chosenFormat = format;
4251
- return "break";
4252
- };
4253
-
4254
- // When there are multiple available formats, the formatter uses the first
4255
- // format where a formatting template could be created.
4256
- _loop: for (var _iterator2 = this.matchingFormats.slice(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
4257
- var _ref5;
4258
-
4259
- var _ret = _loop2();
4260
-
4261
- switch (_ret) {
4262
- case "break":
4263
- break _loop;
4264
-
4265
- case "continue":
4266
- continue;
4267
- }
4268
- }
4269
-
4270
- if (!this.chosenFormat) {
4271
- // No format matches the national (significant) phone number.
4272
- this.resetFormat();
4273
- }
4274
-
4275
- return this.chosenFormat;
4276
- }
4277
- }, {
4278
- key: "createTemplateForFormat",
4279
- value: function createTemplateForFormat(format, state) {
4280
- // The formatter doesn't format numbers when numberPattern contains '|', e.g.
4281
- // (20|3)\d{4}. In those cases we quickly return.
4282
- // (Though there's no such format in current metadata)
4283
-
4284
- /* istanbul ignore if */
4285
- if ( format.pattern().indexOf('|') >= 0) {
4286
- return;
4287
- } // Get formatting template for this phone number format
4288
-
4289
-
4290
- var template = this.getTemplateForFormat(format, state); // If the national number entered is too long
4291
- // for any phone number format, then abort.
4292
-
4293
- if (template) {
4294
- this.setNationalNumberTemplate(template, state);
4295
- return true;
4296
- }
4297
- }
4298
- }, {
4299
- key: "getInternationalPrefixBeforeCountryCallingCode",
4300
- value: function getInternationalPrefixBeforeCountryCallingCode(_ref6, options) {
4301
- var IDDPrefix = _ref6.IDDPrefix,
4302
- missingPlus = _ref6.missingPlus;
4303
-
4304
- if (IDDPrefix) {
4305
- return options && options.spacing === false ? IDDPrefix : IDDPrefix + ' ';
4306
- }
4307
-
4308
- if (missingPlus) {
4309
- return '';
4310
- }
4311
-
4312
- return '+';
4313
- }
4314
- }, {
4315
- key: "getTemplate",
4316
- value: function getTemplate(state) {
4317
- if (!this.template) {
4318
- return;
4319
- } // `this.template` holds the template for a "complete" phone number.
4320
- // The currently entered phone number is most likely not "complete",
4321
- // so trim all non-populated digits.
4322
-
4323
-
4324
- var index = -1;
4325
- var i = 0;
4326
- var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {
4327
- spacing: false
4328
- }) : '';
4329
-
4330
- while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {
4331
- index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);
4332
- i++;
4333
- }
4334
-
4335
- return cutAndStripNonPairedParens(this.template, index + 1);
4336
- }
4337
- }, {
4338
- key: "setNationalNumberTemplate",
4339
- value: function setNationalNumberTemplate(template, state) {
4340
- this.nationalNumberTemplate = template;
4341
- this.populatedNationalNumberTemplate = template; // With a new formatting template, the matched position
4342
- // using the old template needs to be reset.
4343
-
4344
- this.populatedNationalNumberTemplatePosition = -1; // For convenience, the public `.template` property
4345
- // contains the whole international number
4346
- // if the phone number being input is international:
4347
- // 'x' for the '+' sign, 'x'es for the country phone code,
4348
- // a spacebar and then the template for the formatted national number.
4349
-
4350
- if (state.international) {
4351
- this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\d\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + ' ' + template;
4352
- } else {
4353
- this.template = template;
4354
- }
4355
- }
4356
- /**
4357
- * Generates formatting template for a national phone number,
4358
- * optionally containing a national prefix, for a format.
4359
- * @param {Format} format
4360
- * @param {string} nationalPrefix
4361
- * @return {string}
4362
- */
4363
-
4364
- }, {
4365
- key: "getTemplateForFormat",
4366
- value: function getTemplateForFormat(format, _ref7) {
4367
- var nationalSignificantNumber = _ref7.nationalSignificantNumber,
4368
- international = _ref7.international,
4369
- nationalPrefix = _ref7.nationalPrefix,
4370
- complexPrefixBeforeNationalSignificantNumber = _ref7.complexPrefixBeforeNationalSignificantNumber;
4371
- var pattern = format.pattern();
4372
- /* istanbul ignore else */
4373
-
4374
- {
4375
- pattern = pattern // Replace anything in the form of [..] with \d
4376
- .replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\d') // Replace any standalone digit (not the one in `{}`) with \d
4377
- .replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\d');
4378
- } // Generate a dummy national number (consisting of `9`s)
4379
- // that fits this format's `pattern`.
4380
- //
4381
- // This match will always succeed,
4382
- // because the "longest dummy phone number"
4383
- // has enough length to accomodate any possible
4384
- // national phone number format pattern.
4385
- //
4386
-
4387
-
4388
- var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0]; // If the national number entered is too long
4389
- // for any phone number format, then abort.
4390
-
4391
- if (nationalSignificantNumber.length > digits.length) {
4392
- return;
4393
- } // Get a formatting template which can be used to efficiently format
4394
- // a partial number where digits are added one by one.
4395
- // Below `strictPattern` is used for the
4396
- // regular expression (with `^` and `$`).
4397
- // This wasn't originally in Google's `libphonenumber`
4398
- // and I guess they don't really need it
4399
- // because they're not using "templates" to format phone numbers
4400
- // but I added `strictPattern` after encountering
4401
- // South Korean phone number formatting bug.
4402
- //
4403
- // Non-strict regular expression bug demonstration:
4404
- //
4405
- // this.nationalSignificantNumber : `111111111` (9 digits)
4406
- //
4407
- // pattern : (\d{2})(\d{3,4})(\d{4})
4408
- // format : `$1 $2 $3`
4409
- // digits : `9999999999` (10 digits)
4410
- //
4411
- // '9999999999'.replace(new RegExp(/(\d{2})(\d{3,4})(\d{4})/g), '$1 $2 $3') = "99 9999 9999"
4412
- //
4413
- // template : xx xxxx xxxx
4414
- //
4415
- // But the correct template in this case is `xx xxx xxxx`.
4416
- // The template was generated incorrectly because of the
4417
- // `{3,4}` variability in the `pattern`.
4418
- //
4419
- // The fix is, if `this.nationalSignificantNumber` has already sufficient length
4420
- // to satisfy the `pattern` completely then `this.nationalSignificantNumber`
4421
- // is used instead of `digits`.
4422
-
4423
-
4424
- var strictPattern = new RegExp('^' + pattern + '$');
4425
- var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\d/g, DUMMY_DIGIT); // If `this.nationalSignificantNumber` has already sufficient length
4426
- // to satisfy the `pattern` completely then use it
4427
- // instead of `digits`.
4428
-
4429
- if (strictPattern.test(nationalNumberDummyDigits)) {
4430
- digits = nationalNumberDummyDigits;
4431
- }
4432
-
4433
- var numberFormat = this.getFormatFormat(format, international);
4434
- var nationalPrefixIncludedInTemplate; // If a user did input a national prefix (and that's guaranteed),
4435
- // and if a `format` does have a national prefix formatting rule,
4436
- // then see if that national prefix formatting rule
4437
- // prepends exactly the same national prefix the user has input.
4438
- // If that's the case, then use the `format` with the national prefix formatting rule.
4439
- // Otherwise, use the `format` without the national prefix formatting rule,
4440
- // and prepend a national prefix manually to it.
4441
-
4442
- if (this.shouldTryNationalPrefixFormattingRule(format, {
4443
- international: international,
4444
- nationalPrefix: nationalPrefix
4445
- })) {
4446
- var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()); // If `national_prefix_formatting_rule` of a `format` simply prepends
4447
- // national prefix at the start of a national (significant) number,
4448
- // then such formatting can be used with `AsYouType` formatter.
4449
- // There seems to be no `else` case: everywhere in metadata,
4450
- // national prefix formatting rule is national prefix + $1,
4451
- // or `($1)`, in which case such format isn't even considered
4452
- // when the user has input a national prefix.
4453
-
4454
- /* istanbul ignore else */
4455
-
4456
- if (parseDigits(format.nationalPrefixFormattingRule()) === (nationalPrefix || '') + parseDigits('$1')) {
4457
- numberFormat = numberFormatWithNationalPrefix;
4458
- nationalPrefixIncludedInTemplate = true; // Replace all digits of the national prefix in the formatting template
4459
- // with `DIGIT_PLACEHOLDER`s.
4460
-
4461
- if (nationalPrefix) {
4462
- var i = nationalPrefix.length;
4463
-
4464
- while (i > 0) {
4465
- numberFormat = numberFormat.replace(/\d/, DIGIT_PLACEHOLDER);
4466
- i--;
4467
- }
4468
- }
4469
- }
4470
- } // Generate formatting template for this phone number format.
4471
-
4472
-
4473
- var template = digits // Format the dummy phone number according to the format.
4474
- .replace(new RegExp(pattern), numberFormat) // Replace each dummy digit with a DIGIT_PLACEHOLDER.
4475
- .replace(new RegExp(DUMMY_DIGIT, 'g'), DIGIT_PLACEHOLDER); // If a prefix of a national (significant) number is not as simple
4476
- // as just a basic national prefix, then just prepend such prefix
4477
- // before the national (significant) number, optionally spacing
4478
- // the two with a whitespace.
4479
-
4480
- if (!nationalPrefixIncludedInTemplate) {
4481
- if (complexPrefixBeforeNationalSignificantNumber) {
4482
- // Prepend the prefix to the template manually.
4483
- template = repeat(DIGIT_PLACEHOLDER, complexPrefixBeforeNationalSignificantNumber.length) + ' ' + template;
4484
- } else if (nationalPrefix) {
4485
- // Prepend national prefix to the template manually.
4486
- template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format) + template;
4487
- }
4488
- }
4489
-
4490
- if (international) {
4491
- template = applyInternationalSeparatorStyle(template);
4492
- }
4493
-
4494
- return template;
4495
- }
4496
- }, {
4497
- key: "formatNextNationalNumberDigits",
4498
- value: function formatNextNationalNumberDigits(digits) {
4499
- var result = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);
4500
-
4501
- if (!result) {
4502
- // Reset the format.
4503
- this.resetFormat();
4504
- return;
4505
- }
4506
-
4507
- this.populatedNationalNumberTemplate = result[0];
4508
- this.populatedNationalNumberTemplatePosition = result[1]; // Return the formatted phone number so far.
4509
-
4510
- return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1); // The old way which was good for `input-format` but is not so good
4511
- // for `react-phone-number-input`'s default input (`InputBasic`).
4512
- // return closeNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1)
4513
- // .replace(new RegExp(DIGIT_PLACEHOLDER, 'g'), ' ')
4514
- }
4515
- }]);
4516
-
4517
- return AsYouTypeFormatter;
4518
- }();
4519
-
4520
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
4521
-
4522
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
4523
-
4524
- function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
4525
-
4526
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
4527
-
4528
- function _classCallCheck$4(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4529
-
4530
- function _defineProperties$4(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4531
-
4532
- function _createClass$4(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$4(Constructor.prototype, protoProps); if (staticProps) _defineProperties$4(Constructor, staticProps); return Constructor; }
4533
- var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+';
4534
- var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp('^' + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + '$', 'i');
4535
- var VALID_FORMATTED_PHONE_NUMBER_PART = '(?:' + '[' + PLUS_CHARS + ']' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*' + '|' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + ')';
4536
- var AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp('[^' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + '.*' + '$'); // Tests whether `national_prefix_for_parsing` could match
4537
- // different national prefixes.
4538
- // Matches anything that's not a digit or a square bracket.
4539
-
4540
- var COMPLEX_NATIONAL_PREFIX = /[^\d\[\]]/;
4541
-
4542
- var AsYouTypeParser =
4543
- /*#__PURE__*/
4544
- function () {
4545
- function AsYouTypeParser(_ref) {
4546
- var defaultCountry = _ref.defaultCountry,
4547
- defaultCallingCode = _ref.defaultCallingCode,
4548
- metadata = _ref.metadata,
4549
- onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;
4550
-
4551
- _classCallCheck$4(this, AsYouTypeParser);
4552
-
4553
- this.defaultCountry = defaultCountry;
4554
- this.defaultCallingCode = defaultCallingCode;
4555
- this.metadata = metadata;
4556
- this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;
4557
- }
4558
-
4559
- _createClass$4(AsYouTypeParser, [{
4560
- key: "input",
4561
- value: function input(text, state) {
4562
- var _extractFormattedDigi = extractFormattedDigitsAndPlus(text),
4563
- _extractFormattedDigi2 = _slicedToArray(_extractFormattedDigi, 2),
4564
- formattedDigits = _extractFormattedDigi2[0],
4565
- hasPlus = _extractFormattedDigi2[1];
4566
-
4567
- var digits = parseDigits(formattedDigits); // Checks for a special case: just a leading `+` has been entered.
4568
-
4569
- var justLeadingPlus;
4570
-
4571
- if (hasPlus) {
4572
- if (!state.digits) {
4573
- state.startInternationalNumber();
4574
-
4575
- if (!digits) {
4576
- justLeadingPlus = true;
4577
- }
4578
- }
4579
- }
4580
-
4581
- if (digits) {
4582
- this.inputDigits(digits, state);
4583
- }
4584
-
4585
- return {
4586
- digits: digits,
4587
- justLeadingPlus: justLeadingPlus
4588
- };
4589
- }
4590
- /**
4591
- * Inputs "next" phone number digits.
4592
- * @param {string} digits
4593
- * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage".
4594
- */
4595
-
4596
- }, {
4597
- key: "inputDigits",
4598
- value: function inputDigits(nextDigits, state) {
4599
- var digits = state.digits;
4600
- var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3; // Append phone number digits.
4601
-
4602
- state.appendDigits(nextDigits); // Attempt to extract IDD prefix:
4603
- // Some users input their phone number in international format,
4604
- // but in an "out-of-country" dialing format instead of using the leading `+`.
4605
- // https://github.com/catamphetamine/libphonenumber-js/issues/185
4606
- // Detect such numbers as soon as there're at least 3 digits.
4607
- // Google's library attempts to extract IDD prefix at 3 digits,
4608
- // so this library just copies that behavior.
4609
- // I guess that's because the most commot IDD prefixes are
4610
- // `00` (Europe) and `011` (US).
4611
- // There exist really long IDD prefixes too:
4612
- // for example, in Australia the default IDD prefix is `0011`,
4613
- // and it could even be as long as `14880011`.
4614
- // An IDD prefix is extracted here, and then every time when
4615
- // there's a new digit and the number couldn't be formatted.
4616
-
4617
- if (hasReceivedThreeLeadingDigits) {
4618
- this.extractIddPrefix(state);
4619
- }
4620
-
4621
- if (this.isWaitingForCountryCallingCode(state)) {
4622
- if (!this.extractCountryCallingCode(state)) {
4623
- return;
4624
- }
4625
- } else {
4626
- state.appendNationalSignificantNumberDigits(nextDigits);
4627
- } // If a phone number is being input in international format,
4628
- // then it's not valid for it to have a national prefix.
4629
- // Still, some people incorrectly input such numbers with a national prefix.
4630
- // In such cases, only attempt to strip a national prefix if the number becomes too long.
4631
- // (but that is done later, not here)
4632
-
4633
-
4634
- if (!state.international) {
4635
- if (!this.hasExtractedNationalSignificantNumber) {
4636
- this.extractNationalSignificantNumber(state.getNationalDigits(), state.update);
4637
- }
4638
- }
4639
- }
4640
- }, {
4641
- key: "isWaitingForCountryCallingCode",
4642
- value: function isWaitingForCountryCallingCode(_ref2) {
4643
- var international = _ref2.international,
4644
- callingCode = _ref2.callingCode;
4645
- return international && !callingCode;
4646
- } // Extracts a country calling code from a number
4647
- // being entered in internatonal format.
4648
-
4649
- }, {
4650
- key: "extractCountryCallingCode",
4651
- value: function extractCountryCallingCode$1(state) {
4652
- var _extractCountryCallin = extractCountryCallingCode('+' + state.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),
4653
- countryCallingCode = _extractCountryCallin.countryCallingCode,
4654
- number = _extractCountryCallin.number;
4655
-
4656
- if (countryCallingCode) {
4657
- state.setCallingCode(countryCallingCode);
4658
- state.update({
4659
- nationalSignificantNumber: number
4660
- });
4661
- return true;
4662
- }
4663
- }
4664
- }, {
4665
- key: "reset",
4666
- value: function reset(numberingPlan) {
4667
- if (numberingPlan) {
4668
- this.hasSelectedNumberingPlan = true;
4669
-
4670
- var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();
4671
-
4672
- this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);
4673
- } else {
4674
- this.hasSelectedNumberingPlan = undefined;
4675
- this.couldPossiblyExtractAnotherNationalSignificantNumber = undefined;
4676
- }
4677
- }
4678
- /**
4679
- * Extracts a national (significant) number from user input.
4680
- * Google's library is different in that it only applies `national_prefix_for_parsing`
4681
- * and doesn't apply `national_prefix_transform_rule` after that.
4682
- * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539
4683
- * @return {boolean} [extracted]
4684
- */
4685
-
4686
- }, {
4687
- key: "extractNationalSignificantNumber",
4688
- value: function extractNationalSignificantNumber(nationalDigits, setState) {
4689
- if (!this.hasSelectedNumberingPlan) {
4690
- return;
4691
- }
4692
-
4693
- var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),
4694
- nationalPrefix = _extractNationalNumbe.nationalPrefix,
4695
- nationalNumber = _extractNationalNumbe.nationalNumber,
4696
- carrierCode = _extractNationalNumbe.carrierCode;
4697
-
4698
- if (nationalNumber === nationalDigits) {
4699
- return;
4700
- }
4701
-
4702
- this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
4703
- return true;
4704
- }
4705
- /**
4706
- * In Google's code this function is called "attempt to extract longer NDD".
4707
- * "Some national prefixes are a substring of others", they say.
4708
- * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.
4709
- */
4710
-
4711
- }, {
4712
- key: "extractAnotherNationalSignificantNumber",
4713
- value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {
4714
- if (!this.hasExtractedNationalSignificantNumber) {
4715
- return this.extractNationalSignificantNumber(nationalDigits, setState);
4716
- }
4717
-
4718
- if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {
4719
- return;
4720
- }
4721
-
4722
- var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),
4723
- nationalPrefix = _extractNationalNumbe2.nationalPrefix,
4724
- nationalNumber = _extractNationalNumbe2.nationalNumber,
4725
- carrierCode = _extractNationalNumbe2.carrierCode; // If a national prefix has been extracted previously,
4726
- // then it's always extracted as additional digits are added.
4727
- // That's assuming `extractNationalNumberFromPossiblyIncompleteNumber()`
4728
- // doesn't do anything different from what it currently does.
4729
- // So, just in case, here's this check, though it doesn't occur.
4730
-
4731
- /* istanbul ignore if */
4732
-
4733
-
4734
- if (nationalNumber === prevNationalSignificantNumber) {
4735
- return;
4736
- }
4737
-
4738
- this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
4739
- return true;
4740
- }
4741
- }, {
4742
- key: "onExtractedNationalNumber",
4743
- value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {
4744
- var complexPrefixBeforeNationalSignificantNumber;
4745
- var nationalSignificantNumberMatchesInput; // This check also works with empty `this.nationalSignificantNumber`.
4746
-
4747
- var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber); // If the extracted national (significant) number is the
4748
- // last substring of the `digits`, then it means that it hasn't been altered:
4749
- // no digits have been removed from the national (significant) number
4750
- // while applying `national_prefix_transform_rule`.
4751
- // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule
4752
-
4753
- if (nationalSignificantNumberIndex >= 0 && nationalSignificantNumberIndex === nationalDigits.length - nationalSignificantNumber.length) {
4754
- nationalSignificantNumberMatchesInput = true; // If a prefix of a national (significant) number is not as simple
4755
- // as just a basic national prefix, then such prefix is stored in
4756
- // `this.complexPrefixBeforeNationalSignificantNumber` property and will be
4757
- // prepended "as is" to the national (significant) number to produce
4758
- // a formatted result.
4759
-
4760
- var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex); // `prefixBeforeNationalNumber` is always non-empty,
4761
- // because `onExtractedNationalNumber()` isn't called
4762
- // when a national (significant) number hasn't been actually "extracted":
4763
- // when a national (significant) number is equal to the national part of `digits`,
4764
- // then `onExtractedNationalNumber()` doesn't get called.
4765
-
4766
- if (prefixBeforeNationalNumber !== nationalPrefix) {
4767
- complexPrefixBeforeNationalSignificantNumber = prefixBeforeNationalNumber;
4768
- }
4769
- }
4770
-
4771
- setState({
4772
- nationalPrefix: nationalPrefix,
4773
- carrierCode: carrierCode,
4774
- nationalSignificantNumber: nationalSignificantNumber,
4775
- nationalSignificantNumberMatchesInput: nationalSignificantNumberMatchesInput,
4776
- complexPrefixBeforeNationalSignificantNumber: complexPrefixBeforeNationalSignificantNumber
4777
- }); // `onExtractedNationalNumber()` is only called when
4778
- // the national (significant) number actually did change.
4779
-
4780
- this.hasExtractedNationalSignificantNumber = true;
4781
- this.onNationalSignificantNumberChange();
4782
- }
4783
- }, {
4784
- key: "reExtractNationalSignificantNumber",
4785
- value: function reExtractNationalSignificantNumber(state) {
4786
- // Attempt to extract a national prefix.
4787
- //
4788
- // Some people incorrectly input national prefix
4789
- // in an international phone number.
4790
- // For example, some people write British phone numbers as `+44(0)...`.
4791
- //
4792
- // Also, in some rare cases, it is valid for a national prefix
4793
- // to be a part of an international phone number.
4794
- // For example, mobile phone numbers in Mexico are supposed to be
4795
- // dialled internationally using a `1` national prefix,
4796
- // so the national prefix will be part of an international number.
4797
- //
4798
- // Quote from:
4799
- // https://www.mexperience.com/dialing-cell-phones-in-mexico/
4800
- //
4801
- // "Dialing a Mexican cell phone from abroad
4802
- // When you are calling a cell phone number in Mexico from outside Mexico,
4803
- // it’s necessary to dial an additional “1” after Mexico’s country code
4804
- // (which is “52”) and before the area code.
4805
- // You also ignore the 045, and simply dial the area code and the
4806
- // cell phone’s number.
4807
- //
4808
- // If you don’t add the “1”, you’ll receive a recorded announcement
4809
- // asking you to redial using it.
4810
- //
4811
- // For example, if you are calling from the USA to a cell phone
4812
- // in Mexico City, you would dial +52 – 1 – 55 – 1234 5678.
4813
- // (Note that this is different to calling a land line in Mexico City
4814
- // from abroad, where the number dialed would be +52 – 55 – 1234 5678)".
4815
- //
4816
- // Google's demo output:
4817
- // https://libphonenumber.appspot.com/phonenumberparser?number=%2b5215512345678&country=MX
4818
- //
4819
- if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, state.update)) {
4820
- return true;
4821
- } // If no format matches the phone number, then it could be
4822
- // "a really long IDD" (quote from a comment in Google's library).
4823
- // An IDD prefix is first extracted when the user has entered at least 3 digits,
4824
- // and then here — every time when there's a new digit and the number
4825
- // couldn't be formatted.
4826
- // For example, in Australia the default IDD prefix is `0011`,
4827
- // and it could even be as long as `14880011`.
4828
- //
4829
- // Could also check `!hasReceivedThreeLeadingDigits` here
4830
- // to filter out the case when this check duplicates the one
4831
- // already performed when there're 3 leading digits,
4832
- // but it's not a big deal, and in most cases there
4833
- // will be a suitable `format` when there're 3 leading digits.
4834
- //
4835
-
4836
-
4837
- if (this.extractIddPrefix(state)) {
4838
- this.extractCallingCodeAndNationalSignificantNumber(state);
4839
- return true;
4840
- } // Google's AsYouType formatter supports sort of an "autocorrection" feature
4841
- // when it "autocorrects" numbers that have been input for a country
4842
- // with that country's calling code.
4843
- // Such "autocorrection" feature looks weird, but different people have been requesting it:
4844
- // https://github.com/catamphetamine/libphonenumber-js/issues/376
4845
- // https://github.com/catamphetamine/libphonenumber-js/issues/375
4846
- // https://github.com/catamphetamine/libphonenumber-js/issues/316
4847
-
4848
-
4849
- if (this.fixMissingPlus(state)) {
4850
- this.extractCallingCodeAndNationalSignificantNumber(state);
4851
- return true;
4852
- }
4853
- }
4854
- }, {
4855
- key: "extractIddPrefix",
4856
- value: function extractIddPrefix(state) {
4857
- // An IDD prefix can't be present in a number written with a `+`.
4858
- // Also, don't re-extract an IDD prefix if has already been extracted.
4859
- var international = state.international,
4860
- IDDPrefix = state.IDDPrefix,
4861
- digits = state.digits;
4862
-
4863
- if (international || IDDPrefix) {
4864
- return;
4865
- } // Some users input their phone number in "out-of-country"
4866
- // dialing format instead of using the leading `+`.
4867
- // https://github.com/catamphetamine/libphonenumber-js/issues/185
4868
- // Detect such numbers.
4869
-
4870
-
4871
- var numberWithoutIDD = stripIddPrefix(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);
4872
-
4873
- if (numberWithoutIDD !== undefined && numberWithoutIDD !== digits) {
4874
- // If an IDD prefix was stripped then convert the IDD-prefixed number
4875
- // to international number for subsequent parsing.
4876
- state.update({
4877
- IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length)
4878
- });
4879
- this.startInternationalNumber(state);
4880
- return true;
4881
- }
4882
- }
4883
- }, {
4884
- key: "fixMissingPlus",
4885
- value: function fixMissingPlus(state) {
4886
- if (!state.international) {
4887
- var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),
4888
- newCallingCode = _extractCountryCallin2.countryCallingCode;
4889
-
4890
- if (newCallingCode) {
4891
- state.update({
4892
- missingPlus: true
4893
- });
4894
- this.startInternationalNumber(state);
4895
- return true;
4896
- }
4897
- }
4898
- }
4899
- }, {
4900
- key: "startInternationalNumber",
4901
- value: function startInternationalNumber(state) {
4902
- state.startInternationalNumber(); // If a national (significant) number has been extracted before, reset it.
4903
-
4904
- if (state.nationalSignificantNumber) {
4905
- state.resetNationalSignificantNumber();
4906
- this.onNationalSignificantNumberChange();
4907
- this.hasExtractedNationalSignificantNumber = undefined;
4908
- }
4909
- }
4910
- }, {
4911
- key: "extractCallingCodeAndNationalSignificantNumber",
4912
- value: function extractCallingCodeAndNationalSignificantNumber(state) {
4913
- if (this.extractCountryCallingCode(state)) {
4914
- // `this.extractCallingCode()` is currently called when the number
4915
- // couldn't be formatted during the standard procedure.
4916
- // Normally, the national prefix would be re-extracted
4917
- // for an international number if such number couldn't be formatted,
4918
- // but since it's already not able to be formatted,
4919
- // there won't be yet another retry, so also extract national prefix here.
4920
- this.extractNationalSignificantNumber(state.getNationalDigits(), state.update);
4921
- }
4922
- }
4923
- }]);
4924
-
4925
- return AsYouTypeParser;
4926
- }();
4927
-
4928
- function extractFormattedPhoneNumber(text) {
4929
- // Attempt to extract a possible number from the string passed in.
4930
- var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);
4931
-
4932
- if (startsAt < 0) {
4933
- return;
4934
- } // Trim everything to the left of the phone number.
4935
-
4936
-
4937
- text = text.slice(startsAt); // Trim the `+`.
4938
-
4939
- var hasPlus;
4940
-
4941
- if (text[0] === '+') {
4942
- hasPlus = true;
4943
- text = text.slice('+'.length);
4944
- } // Trim everything to the right of the phone number.
4945
-
4946
-
4947
- text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, ''); // Re-add the previously trimmed `+`.
4948
-
4949
- if (hasPlus) {
4950
- text = '+' + text;
4951
- }
4952
-
4953
- return text;
4954
- }
4955
- /**
4956
- * Extracts formatted phone number digits (and a `+`) from text (if there're any).
4957
- * @param {string} text
4958
- * @return {any[]}
4959
- */
4960
-
4961
-
4962
- function _extractFormattedDigitsAndPlus(text) {
4963
- // Extract a formatted phone number part from text.
4964
- var extractedNumber = extractFormattedPhoneNumber(text) || ''; // Trim a `+`.
4965
-
4966
- if (extractedNumber[0] === '+') {
4967
- return [extractedNumber.slice('+'.length), true];
4968
- }
4969
-
4970
- return [extractedNumber];
4971
- }
4972
- /**
4973
- * Extracts formatted phone number digits (and a `+`) from text (if there're any).
4974
- * @param {string} text
4975
- * @return {any[]}
4976
- */
4977
-
4978
-
4979
- function extractFormattedDigitsAndPlus(text) {
4980
- var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text),
4981
- _extractFormattedDigi4 = _slicedToArray(_extractFormattedDigi3, 2),
4982
- formattedDigits = _extractFormattedDigi4[0],
4983
- hasPlus = _extractFormattedDigi4[1]; // If the extracted phone number part
4984
- // can possibly be a part of some valid phone number
4985
- // then parse phone number characters from a formatted phone number.
4986
-
4987
-
4988
- if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {
4989
- formattedDigits = '';
4990
- }
4991
-
4992
- return [formattedDigits, hasPlus];
4993
- }
4994
-
4995
- function _typeof$1(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
4996
-
4997
- function _slicedToArray$1(arr, i) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _nonIterableRest$1(); }
4998
-
4999
- function _nonIterableRest$1() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
5000
-
5001
- function _iterableToArrayLimit$1(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
5002
-
5003
- function _arrayWithHoles$1(arr) { if (Array.isArray(arr)) return arr; }
5004
-
5005
- function _classCallCheck$5(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5006
-
5007
- function _defineProperties$5(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
5008
-
5009
- function _createClass$5(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$5(Constructor.prototype, protoProps); if (staticProps) _defineProperties$5(Constructor, staticProps); return Constructor; }
5010
-
5011
- var AsYouType =
5012
- /*#__PURE__*/
5013
- function () {
5014
- /**
5015
- * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.
5016
- * @param {Object} metadata
5017
- */
5018
- function AsYouType(optionsOrDefaultCountry, metadata) {
5019
- _classCallCheck$5(this, AsYouType);
5020
-
5021
- this.metadata = new Metadata(metadata);
5022
-
5023
- var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry),
5024
- _this$getCountryAndCa2 = _slicedToArray$1(_this$getCountryAndCa, 2),
5025
- defaultCountry = _this$getCountryAndCa2[0],
5026
- defaultCallingCode = _this$getCountryAndCa2[1];
5027
-
5028
- this.defaultCountry = defaultCountry;
5029
- this.defaultCallingCode = defaultCallingCode;
5030
- this.reset();
5031
- }
5032
-
5033
- _createClass$5(AsYouType, [{
5034
- key: "getCountryAndCallingCode",
5035
- value: function getCountryAndCallingCode(optionsOrDefaultCountry) {
5036
- // Set `defaultCountry` and `defaultCallingCode` options.
5037
- var defaultCountry;
5038
- var defaultCallingCode; // Turns out `null` also has type "object". Weird.
5039
-
5040
- if (optionsOrDefaultCountry) {
5041
- if (_typeof$1(optionsOrDefaultCountry) === 'object') {
5042
- defaultCountry = optionsOrDefaultCountry.defaultCountry;
5043
- defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;
5044
- } else {
5045
- defaultCountry = optionsOrDefaultCountry;
5046
- }
5047
- }
5048
-
5049
- if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {
5050
- defaultCountry = undefined;
5051
- }
5052
-
5053
- return [defaultCountry, defaultCallingCode];
5054
- }
5055
- /**
5056
- * Inputs "next" phone number characters.
5057
- * @param {string} text
5058
- * @return {string} Formatted phone number characters that have been input so far.
5059
- */
5060
-
5061
- }, {
5062
- key: "input",
5063
- value: function input(text) {
5064
- var _this$parser$input = this.parser.input(text, this.state),
5065
- digits = _this$parser$input.digits,
5066
- justLeadingPlus = _this$parser$input.justLeadingPlus;
5067
-
5068
- if (justLeadingPlus) {
5069
- this.formattedOutput = '+';
5070
- } else if (digits) {
5071
- this.determineTheCountryIfNeeded(); // Match the available formats by the currently available leading digits.
5072
-
5073
- if (this.state.nationalSignificantNumber) {
5074
- this.formatter.narrowDownMatchingFormats(this.state);
5075
- }
5076
-
5077
- var formattedNationalNumber;
5078
-
5079
- if (this.metadata.hasSelectedNumberingPlan()) {
5080
- formattedNationalNumber = this.formatter.format(digits, this.state);
5081
- }
5082
-
5083
- if (formattedNationalNumber === undefined) {
5084
- // See if another national (significant) number could be re-extracted.
5085
- if (this.parser.reExtractNationalSignificantNumber(this.state)) {
5086
- this.determineTheCountryIfNeeded(); // If it could, then re-try formatting the new national (significant) number.
5087
-
5088
- var nationalDigits = this.state.getNationalDigits();
5089
-
5090
- if (nationalDigits) {
5091
- formattedNationalNumber = this.formatter.format(nationalDigits, this.state);
5092
- }
5093
- }
5094
- }
5095
-
5096
- this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();
5097
- }
5098
-
5099
- return this.formattedOutput;
5100
- }
5101
- }, {
5102
- key: "reset",
5103
- value: function reset() {
5104
- var _this = this;
5105
-
5106
- this.state = new AsYouTypeState({
5107
- onCountryChange: function onCountryChange(country) {
5108
- // Before version `1.6.0`, the official `AsYouType` formatter API
5109
- // included the `.country` property of an `AsYouType` instance.
5110
- // Since that property (along with the others) have been moved to
5111
- // `this.state`, `this.country` property is emulated for compatibility
5112
- // with the old versions.
5113
- _this.country = country;
5114
- },
5115
- onCallingCodeChange: function onCallingCodeChange(country, callingCode) {
5116
- _this.metadata.selectNumberingPlan(country, callingCode);
5117
-
5118
- _this.formatter.reset(_this.metadata.numberingPlan, _this.state);
5119
-
5120
- _this.parser.reset(_this.metadata.numberingPlan);
5121
- }
5122
- });
5123
- this.formatter = new AsYouTypeFormatter({
5124
- state: this.state,
5125
- metadata: this.metadata
5126
- });
5127
- this.parser = new AsYouTypeParser({
5128
- defaultCountry: this.defaultCountry,
5129
- defaultCallingCode: this.defaultCallingCode,
5130
- metadata: this.metadata,
5131
- state: this.state,
5132
- onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {
5133
- _this.determineTheCountryIfNeeded();
5134
-
5135
- _this.formatter.reset(_this.metadata.numberingPlan, _this.state);
5136
- }
5137
- });
5138
- this.state.reset(this.defaultCountry, this.defaultCallingCode);
5139
- this.formattedOutput = '';
5140
- return this;
5141
- }
5142
- /**
5143
- * Returns `true` if the phone number is being input in international format.
5144
- * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
5145
- * @return {boolean}
5146
- */
5147
-
5148
- }, {
5149
- key: "isInternational",
5150
- value: function isInternational() {
5151
- return this.state.international;
5152
- }
5153
- /**
5154
- * Returns the "country calling code" part of the phone number.
5155
- * Returns `undefined` if the number is not being input in international format.
5156
- * Returns "country calling code" for "non-geographic" phone numbering plans too.
5157
- * @return {string} [callingCode]
5158
- */
5159
-
5160
- }, {
5161
- key: "getCallingCode",
5162
- value: function getCallingCode() {
5163
- return this.state.callingCode;
5164
- } // A legacy alias.
5165
-
5166
- }, {
5167
- key: "getCountryCallingCode",
5168
- value: function getCountryCallingCode() {
5169
- return this.getCallingCode();
5170
- }
5171
- /**
5172
- * Returns a two-letter country code of the phone number.
5173
- * Returns `undefined` for "non-geographic" phone numbering plans.
5174
- * Returns `undefined` if no phone number has been input yet.
5175
- * @return {string} [country]
5176
- */
5177
-
5178
- }, {
5179
- key: "getCountry",
5180
- value: function getCountry() {
5181
- var _this$state = this.state,
5182
- digits = _this$state.digits,
5183
- country = _this$state.country; // If no digits have been input yet,
5184
- // then `this.country` is the `defaultCountry`.
5185
- // Won't return the `defaultCountry` in such case.
5186
-
5187
- if (!digits) {
5188
- return;
5189
- }
5190
-
5191
- var countryCode = country;
5192
-
5193
- return countryCode;
5194
- }
5195
- }, {
5196
- key: "determineTheCountryIfNeeded",
5197
- value: function determineTheCountryIfNeeded() {
5198
- // Suppose a user enters a phone number in international format,
5199
- // and there're several countries corresponding to that country calling code,
5200
- // and a country has been derived from the number, and then
5201
- // a user enters one more digit and the number is no longer
5202
- // valid for the derived country, so the country should be re-derived
5203
- // on every new digit in those cases.
5204
- //
5205
- // If the phone number is being input in national format,
5206
- // then it could be a case when `defaultCountry` wasn't specified
5207
- // when creating `AsYouType` instance, and just `defaultCallingCode` was specified,
5208
- // and that "calling code" could correspond to a "non-geographic entity",
5209
- // or there could be several countries corresponding to that country calling code.
5210
- // In those cases, `this.country` is `undefined` and should be derived
5211
- // from the number. Again, if country calling code is ambiguous, then
5212
- // `this.country` should be re-derived with each new digit.
5213
- //
5214
- if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {
5215
- this.determineTheCountry();
5216
- }
5217
- } // Prepends `+CountryCode ` in case of an international phone number
5218
-
5219
- }, {
5220
- key: "getFullNumber",
5221
- value: function getFullNumber(formattedNationalNumber) {
5222
- var _this2 = this;
5223
-
5224
- if (this.isInternational()) {
5225
- var prefix = function prefix(text) {
5226
- return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {
5227
- spacing: text ? true : false
5228
- }) + text;
5229
- };
5230
-
5231
- var callingCode = this.state.callingCode;
5232
-
5233
- if (!callingCode) {
5234
- return prefix("".concat(this.state.getDigitsWithoutInternationalPrefix()));
5235
- }
5236
-
5237
- if (!formattedNationalNumber) {
5238
- return prefix(callingCode);
5239
- }
5240
-
5241
- return prefix("".concat(callingCode, " ").concat(formattedNationalNumber));
5242
- }
5243
-
5244
- return formattedNationalNumber;
5245
- }
5246
- }, {
5247
- key: "getNonFormattedNationalNumberWithPrefix",
5248
- value: function getNonFormattedNationalNumberWithPrefix() {
5249
- var _this$state2 = this.state,
5250
- nationalSignificantNumber = _this$state2.nationalSignificantNumber,
5251
- complexPrefixBeforeNationalSignificantNumber = _this$state2.complexPrefixBeforeNationalSignificantNumber,
5252
- nationalPrefix = _this$state2.nationalPrefix;
5253
- var number = nationalSignificantNumber;
5254
- var prefix = complexPrefixBeforeNationalSignificantNumber || nationalPrefix;
5255
-
5256
- if (prefix) {
5257
- number = prefix + number;
5258
- }
5259
-
5260
- return number;
5261
- }
5262
- }, {
5263
- key: "getNonFormattedNumber",
5264
- value: function getNonFormattedNumber() {
5265
- var nationalSignificantNumberMatchesInput = this.state.nationalSignificantNumberMatchesInput;
5266
- return this.getFullNumber(nationalSignificantNumberMatchesInput ? this.getNonFormattedNationalNumberWithPrefix() : this.state.getNationalDigits());
5267
- }
5268
- }, {
5269
- key: "getNonFormattedTemplate",
5270
- value: function getNonFormattedTemplate() {
5271
- var number = this.getNonFormattedNumber();
5272
-
5273
- if (number) {
5274
- return number.replace(/[\+\d]/g, DIGIT_PLACEHOLDER);
5275
- }
5276
- }
5277
- }, {
5278
- key: "isCountryCallingCodeAmbiguous",
5279
- value: function isCountryCallingCodeAmbiguous() {
5280
- var callingCode = this.state.callingCode;
5281
- var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);
5282
- return countryCodes && countryCodes.length > 1;
5283
- } // Determines the country of the phone number
5284
- // entered so far based on the country phone code
5285
- // and the national phone number.
5286
-
5287
- }, {
5288
- key: "determineTheCountry",
5289
- value: function determineTheCountry() {
5290
- this.state.setCountry(getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, this.state.nationalSignificantNumber, this.metadata));
5291
- }
5292
- /**
5293
- * Returns an instance of `PhoneNumber` class.
5294
- * Will return `undefined` if no national (significant) number
5295
- * digits have been entered so far, or if no `defaultCountry` has been
5296
- * set and the user enters a phone number not in international format.
5297
- */
5298
-
5299
- }, {
5300
- key: "getNumber",
5301
- value: function getNumber() {
5302
- var _this$state3 = this.state,
5303
- nationalSignificantNumber = _this$state3.nationalSignificantNumber,
5304
- carrierCode = _this$state3.carrierCode;
5305
-
5306
- if (this.isInternational()) {
5307
- if (!this.state.callingCode) {
5308
- return;
5309
- }
5310
- } else {
5311
- if (!this.state.country && !this.defaultCallingCode) {
5312
- return;
5313
- }
5314
- }
5315
-
5316
- if (!nationalSignificantNumber) {
5317
- return;
5318
- }
5319
-
5320
- var countryCode = this.getCountry();
5321
- var callingCode = this.getCountryCallingCode() || this.defaultCallingCode;
5322
- var phoneNumber = new PhoneNumber(countryCode || callingCode, nationalSignificantNumber, this.metadata.metadata);
5323
-
5324
- if (carrierCode) {
5325
- phoneNumber.carrierCode = carrierCode;
5326
- } // Phone number extensions are not supported by "As You Type" formatter.
5327
-
5328
-
5329
- return phoneNumber;
5330
- }
5331
- /**
5332
- * Returns `true` if the phone number is "possible".
5333
- * Is just a shortcut for `PhoneNumber.isPossible()`.
5334
- * @return {boolean}
5335
- */
5336
-
5337
- }, {
5338
- key: "isPossible",
5339
- value: function isPossible() {
5340
- var phoneNumber = this.getNumber();
5341
-
5342
- if (!phoneNumber) {
5343
- return false;
5344
- }
5345
-
5346
- return phoneNumber.isPossible();
5347
- }
5348
- /**
5349
- * Returns `true` if the phone number is "valid".
5350
- * Is just a shortcut for `PhoneNumber.isValid()`.
5351
- * @return {boolean}
5352
- */
5353
-
5354
- }, {
5355
- key: "isValid",
5356
- value: function isValid() {
5357
- var phoneNumber = this.getNumber();
5358
-
5359
- if (!phoneNumber) {
5360
- return false;
5361
- }
5362
-
5363
- return phoneNumber.isValid();
5364
- }
5365
- /**
5366
- * @deprecated
5367
- * This method is used in `react-phone-number-input/source/input-control.js`
5368
- * in versions before `3.0.16`.
5369
- */
5370
-
5371
- }, {
5372
- key: "getNationalNumber",
5373
- value: function getNationalNumber() {
5374
- return this.state.nationalSignificantNumber;
5375
- }
5376
- /**
5377
- * Returns the phone number characters entered by the user.
5378
- * @return {string}
5379
- */
5380
-
5381
- }, {
5382
- key: "getChars",
5383
- value: function getChars() {
5384
- return (this.state.international ? '+' : '') + this.state.digits;
5385
- }
5386
- /**
5387
- * Returns the template for the formatted phone number.
5388
- * @return {string}
5389
- */
5390
-
5391
- }, {
5392
- key: "getTemplate",
5393
- value: function getTemplate() {
5394
- return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || '';
5395
- }
5396
- }]);
5397
-
5398
- return AsYouType;
5399
- }();
5400
-
5401
- function AsYouType$1(country) {
5402
- return AsYouType.call(this, country, metadata)
5403
- }
5404
-
5405
- AsYouType$1.prototype = Object.create(AsYouType.prototype, {});
5406
- AsYouType$1.prototype.constructor = AsYouType$1;
5407
-
5408
1538
  function usePortalRegister(props) {
5409
- var _a, _b, _c, _d, _e, _f;
1539
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
5410
1540
  const formRef = useRef(null);
5411
1541
  const { validationState, setValidationState } = useValidationState({});
5412
- const [request, { loading, errors, data }] = De();
1542
+ const [request, { loading, errors, data }] = Ne();
5413
1543
  const submit = async (event) => {
5414
1544
  let formControls = event.target.getFormControls();
5415
1545
  let formData = {};
@@ -5468,13 +1598,13 @@ function usePortalRegister(props) {
5468
1598
  const name = (_b = (_a = e.target) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.toLowerCase();
5469
1599
  if (name !== "tel")
5470
1600
  return;
5471
- const asYouType = new AsYouType$1("US");
1601
+ const asYouType = new AsYouType("US");
5472
1602
  e.target.value = asYouType.input(e.target.value);
5473
1603
  }, []);
5474
1604
  useEffect(() => {
5475
1605
  var _a;
5476
1606
  if ((_a = data === null || data === void 0 ? void 0 : data.registerManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token) {
5477
- dn.push(props.nextPage);
1607
+ Ft.push(props.nextPage);
5478
1608
  }
5479
1609
  }, [(_a = data === null || data === void 0 ? void 0 : data.registerManagedIdentityWithEmailAndPassword) === null || _a === void 0 ? void 0 : _a.token]);
5480
1610
  useEffect(() => {
@@ -5495,7 +1625,7 @@ function usePortalRegister(props) {
5495
1625
  }
5496
1626
  else {
5497
1627
  errorMessage =
5498
- ((_f = (_e = (_d = errors === null || errors === void 0 ? void 0 : errors.response) === null || _d === void 0 ? void 0 : _d.errors) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.message) || (validationState === null || validationState === void 0 ? void 0 : validationState.error);
1628
+ ((_g = (_f = (_e = (_d = errors === null || errors === void 0 ? void 0 : errors.response) === null || _d === void 0 ? void 0 : _d.errors) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.extensions) === null || _g === void 0 ? void 0 : _g.message) || ((_k = (_j = (_h = errors === null || errors === void 0 ? void 0 : errors.response) === null || _h === void 0 ? void 0 : _h.errors) === null || _j === void 0 ? void 0 : _j[0]) === null || _k === void 0 ? void 0 : _k.message) || (validationState === null || validationState === void 0 ? void 0 : validationState.error);
5499
1629
  }
5500
1630
  return {
5501
1631
  states: {
@@ -5556,6 +1686,7 @@ const PortalRegister = class {
5556
1686
  * Show or hide the confirm password input
5557
1687
  *
5558
1688
  * @uiName Show Confirm Password Field
1689
+ * @default
5559
1690
  */
5560
1691
  this.confirmPassword = false;
5561
1692
  /**
@@ -5566,6 +1697,7 @@ const PortalRegister = class {
5566
1697
  * Hide default input fields to use custom fields
5567
1698
  *
5568
1699
  * @uiName Hide Default Inputs
1700
+ * @default
5569
1701
  */
5570
1702
  this.hideInputs = false;
5571
1703
  /**
@@ -5582,12 +1714,12 @@ const PortalRegister = class {
5582
1714
  }
5583
1715
  disconnectedCallback() { }
5584
1716
  render() {
5585
- const { states, callbacks, refs } = jn()
1717
+ const { states, callbacks, refs } = T()
5586
1718
  ? useRegisterDemo(this)
5587
1719
  : usePortalRegister(this);
5588
1720
  const content = {
5589
1721
  formData: h$1("slot", { name: "formData" }),
5590
- secondaryButton: (h$1("slot", { name: "secondaryButton" }, h$1("sl-button", { type: "text", disabled: states.loading, onClick: () => dn.push(states.loginPath) }, this.loginLabel))),
1722
+ secondaryButton: (h$1("slot", { name: "secondaryButton" }, h$1("sl-button", { type: "text", disabled: states.loading, onClick: () => Ft.push(states.loginPath) }, this.loginLabel))),
5591
1723
  terms: h$1("slot", { name: "terms" }),
5592
1724
  emailLabel: this.emailLabel,
5593
1725
  passwordLabel: this.passwordLabel,
@@ -5749,11 +1881,11 @@ const ProgramExplainerStep = class {
5749
1881
  const debug = browser('sq:useProgramMenu');
5750
1882
  const UPDATE_PROGRAM_EVENT = 'sq:update-program-id';
5751
1883
  function useProgramMenu(props) {
5752
- const programId = M();
5753
- const host = P();
1884
+ const programId = F();
1885
+ const host = k();
5754
1886
  debug({ programId, props });
5755
1887
  const ref = useRef();
5756
- const [, rerender] = rn();
1888
+ const [, rerender] = Pt();
5757
1889
  useEffect(() => {
5758
1890
  var _a;
5759
1891
  (_a = ref.current) === null || _a === void 0 ? void 0 : _a.addEventListener('sl-select', (e) => {
@@ -5879,9 +2011,9 @@ const GET_USER_DETAILS = dist.gql `
5879
2011
  `;
5880
2012
  function useReferralIframe(props) {
5881
2013
  var _a;
5882
- const programId = M();
5883
- const user = ie();
5884
- const { data } = sn(GET_USER_DETAILS, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
2014
+ const programId = F();
2015
+ const user = oe();
2016
+ const { data } = kt(GET_USER_DETAILS, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !programId);
5885
2017
  return {
5886
2018
  states: {
5887
2019
  content: props,
@@ -5919,7 +2051,7 @@ const SqmReferralIframe = class {
5919
2051
  if (missingProps) {
5920
2052
  return (h$1(RequiredPropsError, { missingProps: missingProps, heading: "An error occured while loading this page", subheading: "A technical problem prevented this iframe from loading. Please contact us with the link to this page.", description: "Values for the following attributes are missing:" }));
5921
2053
  }
5922
- const { states, data } = jn()
2054
+ const { states, data } = T()
5923
2055
  ? useReferralIframeDemo(getProps(this))
5924
2056
  : useReferralIframe(getProps(this));
5925
2057
  return (h$1(Host, { style: { display: "contents" } }, h$1(ReferralIframeView, { data: data, states: states })));
@@ -6606,9 +2738,9 @@ function useRewardExchangeList(props) {
6606
2738
  });
6607
2739
  const [open, setOpen] = useState(false);
6608
2740
  const { selectedItem, selectedStep, redeemStage, amount, exchangeError } = exchangeState;
6609
- const user = ie();
6610
- const [exchange, { data: exchangeResponse, loading: exchangeLoading, errors },] = qe(EXCHANGE);
6611
- const { data, loading, refetch, errors: queryError, } = sn(GET_EXCHANGE_LIST, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
2741
+ const user = oe();
2742
+ const [exchange, { data: exchangeResponse, loading: exchangeLoading, errors },] = Oe(EXCHANGE);
2743
+ const { data, loading, refetch, errors: queryError, } = kt(GET_EXCHANGE_LIST, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
6612
2744
  useEffect(() => {
6613
2745
  var _a, _b;
6614
2746
  if ((_b = (_a = exchangeResponse === null || exchangeResponse === void 0 ? void 0 : exchangeResponse.exchangeReward) === null || _a === void 0 ? void 0 : _a.reward) === null || _b === void 0 ? void 0 : _b.id) {
@@ -6627,7 +2759,7 @@ function useRewardExchangeList(props) {
6627
2759
  canvas.confetti || confetti.create(canvas, { resize: true });
6628
2760
  canvas.confetti();
6629
2761
  }, [canvasRef.current]);
6630
- const { refresh } = He();
2762
+ const { refresh } = at();
6631
2763
  async function exchangeReward() {
6632
2764
  if (!selectedItem)
6633
2765
  return;
@@ -6883,7 +3015,7 @@ const SqmRewardExchangeList = class {
6883
3015
  ...getProps(this),
6884
3016
  empty: h$1(EmptySlot$1, null),
6885
3017
  };
6886
- const { states, data, callbacks, refs } = jn()
3018
+ const { states, data, callbacks, refs } = T()
6887
3019
  ? useRewardExchangeListDemo(props)
6888
3020
  : useRewardExchangeList(props);
6889
3021
  return (h$1(Host, { style: { display: "contents" } }, h$1(RewardExchangeView, { states: states, data: data, callbacks: callbacks, refs: refs })));
@@ -6935,8 +3067,8 @@ function matchPath(pattern, page) {
6935
3067
  return regexp.exec(page);
6936
3068
  }
6937
3069
  function useRouter() {
6938
- const location = ln();
6939
- const host = P();
3070
+ const location = Rt();
3071
+ const host = k();
6940
3072
  const [slot, setSlot] = useState(undefined);
6941
3073
  const [container, setContainer] = useState(undefined);
6942
3074
  const page = location.pathname;
@@ -7081,7 +3213,7 @@ const Scroll = class {
7081
3213
  color: "var(--sl-color-primary-text)",
7082
3214
  background: "var(--sl-color-neutral-500)",
7083
3215
  "&:hover": {
7084
- opacity: "0.8"
3216
+ opacity: "0.8",
7085
3217
  },
7086
3218
  },
7087
3219
  },
@@ -7140,10 +3272,12 @@ const ShareButton = class {
7140
3272
  this.iconslot = "prefix";
7141
3273
  /**
7142
3274
  * @uiName Hide Icon
3275
+ * @default
7143
3276
  */
7144
3277
  this.hideicon = false;
7145
3278
  /**
7146
3279
  * @uiName Hide Text
3280
+ * @default
7147
3281
  */
7148
3282
  this.hidetext = false;
7149
3283
  h(this);
@@ -7151,7 +3285,7 @@ const ShareButton = class {
7151
3285
  disconnectedCallback() { }
7152
3286
  render() {
7153
3287
  const thisProps = getProps(this);
7154
- const props = jn()
3288
+ const props = T()
7155
3289
  ? useDemoShareButton(thisProps)
7156
3290
  : useShareButton(thisProps);
7157
3291
  return (h$1(ShareButtonView, Object.assign({}, props), h$1("slot", null)));
@@ -7185,11 +3319,11 @@ const WIDGET_ENGAGEMENT_EVENT = dist.gql `
7185
3319
  `;
7186
3320
  function useShareCode(props) {
7187
3321
  var _a, _b;
7188
- const programId = M();
7189
- const user = ie();
7190
- const engagementMedium = Rn();
7191
- const { data } = sn(MessageLinkQuery, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt));
7192
- const [sendLoadEvent] = qe(WIDGET_ENGAGEMENT_EVENT);
3322
+ const programId = F();
3323
+ const user = oe();
3324
+ const engagementMedium = H();
3325
+ const { data } = kt(MessageLinkQuery, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt));
3326
+ const [sendLoadEvent] = Oe(WIDGET_ENGAGEMENT_EVENT);
7193
3327
  const shareString = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.referralCode) !== null && _b !== void 0 ? _b :
7194
3328
  // Shown during loading
7195
3329
  "...";
@@ -7236,7 +3370,7 @@ const ShareCode = class {
7236
3370
  disconnectedCallback() { }
7237
3371
  render() {
7238
3372
  const thisProps = getProps(this);
7239
- const props = jn()
3373
+ const props = T()
7240
3374
  ? useDemoShareCode(thisProps)
7241
3375
  : useShareCode(thisProps);
7242
3376
  return h$1(ShareLinkView, Object.assign({}, props));
@@ -7279,7 +3413,7 @@ const ShareLink = class {
7279
3413
  disconnectedCallback() { }
7280
3414
  render() {
7281
3415
  const thisProps = getProps(this);
7282
- const props = jn()
3416
+ const props = T()
7283
3417
  ? useDemoShareLink(thisProps)
7284
3418
  : useShareLink(thisProps);
7285
3419
  return h$1(ShareLinkView, Object.assign({}, props));
@@ -7357,10 +3491,10 @@ const SEND_EVENT = dist.gql `
7357
3491
  }
7358
3492
  `;
7359
3493
  function useTaskCard(props) {
7360
- const user = ie();
7361
- const locale = An();
7362
- const [sendUserEvent, { data, loading: loadingEvent }] = qe(SEND_EVENT);
7363
- const { refresh } = He();
3494
+ const user = oe();
3495
+ const locale = M();
3496
+ const [sendUserEvent, { data, loading: loadingEvent }] = Oe(SEND_EVENT);
3497
+ const { refresh } = at();
7364
3498
  useEffect(() => {
7365
3499
  if (data) {
7366
3500
  refresh();
@@ -7417,6 +3551,7 @@ const TaskCard = class {
7417
3551
  /**
7418
3552
  * @uiName Goal Repeatable
7419
3553
  * @uiGroup Goal
3554
+ * @default
7420
3555
  */
7421
3556
  this.repeatable = false;
7422
3557
  /**
@@ -7429,6 +3564,7 @@ const TaskCard = class {
7429
3564
  /**
7430
3565
  * @uiName Show Progress Bar
7431
3566
  * @uiGroup Goal
3567
+ * @default
7432
3568
  */
7433
3569
  this.showProgressBar = false;
7434
3570
  /**
@@ -7441,6 +3577,7 @@ const TaskCard = class {
7441
3577
  /**
7442
3578
  * @uiName Progress Bar Steps
7443
3579
  * @uiGroup Goal
3580
+ * @default
7444
3581
  */
7445
3582
  this.steps = false;
7446
3583
  /**
@@ -7488,17 +3625,18 @@ const TaskCard = class {
7488
3625
  * Button Link Opens in New Tab
7489
3626
  * @uiName Open In New Tab
7490
3627
  * @uiGroup Button
3628
+ * @default
7491
3629
  */
7492
3630
  this.openNewTab = false;
7493
3631
  h(this);
7494
3632
  }
7495
3633
  disconnectedCallback() { }
7496
3634
  render() {
7497
- const { props } = jn()
3635
+ const { props } = T()
7498
3636
  ? useDemoBigStat(this)
7499
3637
  : useBigStat({ ...getProps(this), programId: this.programId });
7500
3638
  const { value, loading } = props;
7501
- const { states, callbacks } = jn()
3639
+ const { states, callbacks } = T()
7502
3640
  ? useTaskCardDemo(this)
7503
3641
  : useTaskCard(this);
7504
3642
  return (h$1(TaskCardView, { callbacks: callbacks, states: {
@@ -7672,8 +3810,8 @@ const GET_USER_NAME = dist.gql `
7672
3810
  `;
7673
3811
  function useUserName(props) {
7674
3812
  var _a, _b, _c, _d, _e, _f, _g, _h;
7675
- const user = ie();
7676
- const res = sn(GET_USER_NAME, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
3813
+ const user = oe();
3814
+ const res = kt(GET_USER_NAME, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
7677
3815
  const loading = res.loading;
7678
3816
  const username = ((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.firstName) || ((_d = (_c = res.data) === null || _c === void 0 ? void 0 : _c.viewer) === null || _d === void 0 ? void 0 : _d.lastName)
7679
3817
  ? `${(_f = (_e = res.data) === null || _e === void 0 ? void 0 : _e.viewer) === null || _f === void 0 ? void 0 : _f.firstName} ${(_h = (_g = res.data) === null || _g === void 0 ? void 0 : _g.viewer) === null || _h === void 0 ? void 0 : _h.lastName}`
@@ -7702,7 +3840,7 @@ const UserName = class {
7702
3840
  }
7703
3841
  disconnectedCallback() { }
7704
3842
  render() {
7705
- const props = jn() ? useUserNameDemo(this) : useUserName(this);
3843
+ const props = T() ? useUserNameDemo(this) : useUserName(this);
7706
3844
  return h$1(UserNameView, Object.assign({}, props));
7707
3845
  }
7708
3846
  };