@salla.sa/twilight-components 2.14.393 → 2.14.394

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 (555) hide show
  1. package/dist/cjs/{filepond-D7RVR_w_.js → filepond-C_gLbAbF.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DTuZK2ot.js → filepond-plugin-file-poster-DXWo2FUU.js} +2 -2
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DHc6pF_j.js → filepond-plugin-file-validate-size-fBXMP7ez.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DnkcvJVc.js → filepond-plugin-file-validate-type-DEo7juC7.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-vrZ1s7kw.js → filepond-plugin-image-edit-4j4e1VEp.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-Bn5JSzQK.js → filepond-plugin-image-exif-orientation-DWqiXxv1.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-8qWUFe9n.js → filepond-plugin-image-preview-emT_teia.js} +1 -1
  8. package/dist/cjs/{index-C5VeFDQ0.js → index-B03mYCWz.js} +547 -780
  9. package/dist/cjs/{index-CwD81m7i.js → index-Y-2uyQDK.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +3 -4
  11. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +5 -5
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +15 -19
  13. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +10 -12
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +3 -3
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +5 -5
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +3 -3
  17. package/dist/cjs/salla-apps-icons.cjs.entry.js +3 -3
  18. package/dist/cjs/salla-booking-field_7.cjs.entry.js +23 -25
  19. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +3 -3
  20. package/dist/cjs/salla-cart-coupons.cjs.entry.js +3 -3
  21. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +5 -5
  22. package/dist/cjs/salla-comment-form_8.cjs.entry.js +17 -17
  23. package/dist/cjs/salla-conditional-offer.cjs.entry.js +3 -3
  24. package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
  25. package/dist/cjs/salla-cookies-bar.cjs.entry.js +3 -3
  26. package/dist/cjs/salla-count-down.cjs.entry.js +3 -3
  27. package/dist/cjs/salla-custom-fields.cjs.entry.js +3 -3
  28. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
  30. package/dist/cjs/salla-filters.cjs.entry.js +3 -3
  31. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
  33. package/dist/cjs/salla-hook.cjs.entry.js +2 -5
  34. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +3 -3
  35. package/dist/cjs/salla-installment.cjs.entry.js +3 -3
  36. package/dist/cjs/salla-list-tile.cjs.entry.js +3 -3
  37. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-login-modal.cjs.entry.js +3 -3
  39. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +3 -3
  40. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  41. package/dist/cjs/salla-loyalty.cjs.entry.js +3 -3
  42. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +3 -3
  43. package/dist/cjs/salla-map.cjs.entry.js +3 -3
  44. package/dist/cjs/salla-menu.cjs.entry.js +3 -3
  45. package/dist/cjs/salla-metadata.cjs.entry.js +3 -3
  46. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +5 -5
  47. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +6 -8
  48. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +4 -6
  49. package/dist/cjs/salla-notification-item.cjs.entry.js +3 -3
  50. package/dist/cjs/salla-notifications.cjs.entry.js +3 -3
  51. package/dist/cjs/salla-offer-modal.cjs.entry.js +3 -3
  52. package/dist/cjs/salla-offer.cjs.entry.js +3 -3
  53. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +3 -3
  54. package/dist/cjs/salla-order-details-options.cjs.entry.js +3 -3
  55. package/dist/cjs/salla-order-details.cjs.entry.js +4 -6
  56. package/dist/cjs/salla-order-edit-item.cjs.entry.js +3 -3
  57. package/dist/cjs/salla-order-edit.cjs.entry.js +3 -3
  58. package/dist/cjs/salla-order-summary.cjs.entry.js +3 -3
  59. package/dist/cjs/salla-order-totals-card.cjs.entry.js +4 -6
  60. package/dist/cjs/salla-orders.cjs.entry.js +3 -3
  61. package/dist/cjs/salla-payments.cjs.entry.js +3 -3
  62. package/dist/cjs/salla-placeholder.cjs.entry.js +3 -3
  63. package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
  64. package/dist/cjs/salla-product-card.cjs.entry.js +3 -3
  65. package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
  66. package/dist/cjs/salla-products-list.cjs.entry.js +3 -3
  67. package/dist/cjs/salla-products-slider.cjs.entry.js +3 -3
  68. package/dist/cjs/salla-progress-bar.cjs.entry.js +3 -3
  69. package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
  70. package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -3
  71. package/dist/cjs/salla-scopes.cjs.entry.js +3 -3
  72. package/dist/cjs/salla-search.cjs.entry.js +4 -6
  73. package/dist/cjs/salla-skeleton.cjs.entry.js +3 -3
  74. package/dist/cjs/salla-slider.cjs.entry.js +3 -3
  75. package/dist/cjs/salla-social-share.cjs.entry.js +3 -3
  76. package/dist/cjs/salla-social.cjs.entry.js +3 -3
  77. package/dist/cjs/salla-tab-content_3.cjs.entry.js +7 -7
  78. package/dist/cjs/salla-tiered-offer.cjs.entry.js +3 -3
  79. package/dist/cjs/salla-tooltip.cjs.entry.js +3 -3
  80. package/dist/cjs/salla-trust-badges.cjs.entry.js +3 -3
  81. package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
  82. package/dist/cjs/salla-user-profile.cjs.entry.js +3 -3
  83. package/dist/cjs/salla-user-settings.cjs.entry.js +3 -3
  84. package/dist/cjs/salla-verify.cjs.entry.js +3 -3
  85. package/dist/cjs/salla-wallet.cjs.entry.js +3 -3
  86. package/dist/cjs/twilight.cjs.js +4 -5
  87. package/dist/cjs/{vanilla-picker-yKERbLpx.js → vanilla-picker-CKZvBtHS.js} +1 -1
  88. package/dist/collection/collection-manifest.json +2 -3
  89. package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
  90. package/dist/collection/components/salla-accordion/salla-accordion.js +4 -4
  91. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +19 -19
  92. package/dist/collection/components/salla-alert/salla-alert.js +5 -5
  93. package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +6 -6
  94. package/dist/collection/components/salla-booking-field/salla-booking-field.js +4 -4
  95. package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +9 -9
  96. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +3 -6
  97. package/dist/collection/components/salla-button/salla-button.js +11 -11
  98. package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +1 -2
  99. package/dist/collection/components/salla-cart-item-offers/salla-cart-item-offers.js +8 -8
  100. package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +2 -2
  101. package/dist/collection/components/salla-color-picker/salla-color-picker.js +14 -20
  102. package/dist/collection/components/salla-comment-form/salla-comment-form.js +6 -6
  103. package/dist/collection/components/salla-comments/salla-comment-item.js +3 -2
  104. package/dist/collection/components/salla-comments/salla-comments.js +17 -18
  105. package/dist/collection/components/salla-contacts/salla-contacts.js +10 -10
  106. package/dist/collection/components/salla-count-down/salla-count-down.js +34 -34
  107. package/dist/collection/components/salla-custom-fields/salla-custom-fields.js +7 -9
  108. package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +65 -69
  109. package/dist/collection/components/salla-drawer/salla-drawer.js +11 -11
  110. package/dist/collection/components/salla-file-upload/salla-file-upload.js +84 -85
  111. package/dist/collection/components/salla-filters/salla-filters.js +2 -2
  112. package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +5 -4
  113. package/dist/collection/components/salla-gifting/salla-gifting.js +11 -11
  114. package/dist/collection/components/salla-hook/salla-hook.js +2 -2
  115. package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +6 -6
  116. package/dist/collection/components/salla-installment/salla-installment.js +5 -5
  117. package/dist/collection/components/salla-list-tile/salla-list-tile.js +2 -2
  118. package/dist/collection/components/salla-loading/salla-loading.js +4 -4
  119. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +5 -5
  120. package/dist/collection/components/salla-login-modal/salla-login-modal.js +14 -14
  121. package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +3 -4
  122. package/dist/collection/components/salla-loyalty/salla-loyalty.js +12 -13
  123. package/dist/collection/components/salla-map/salla-map.js +14 -14
  124. package/dist/collection/components/salla-menu/salla-menu.js +9 -10
  125. package/dist/collection/components/salla-metadata/salla-metadata.js +3 -3
  126. package/dist/collection/components/salla-modal/salla-modal.js +11 -11
  127. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +2 -2
  128. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
  129. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +2 -4
  130. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +7 -8
  131. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +2 -2
  132. package/dist/collection/components/salla-notifications/salla-notification-item.js +2 -2
  133. package/dist/collection/components/salla-notifications/salla-notifications.js +3 -3
  134. package/dist/collection/components/salla-offer/salla-offer.js +1 -1
  135. package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +5 -5
  136. package/dist/collection/components/salla-order-details/salla-order-details-options.js +5 -6
  137. package/dist/collection/components/salla-order-details/salla-order-details.js +3 -4
  138. package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +4 -4
  139. package/dist/collection/components/salla-order-edit/salla-order-edit.js +4 -4
  140. package/dist/collection/components/salla-order-summary/salla-order-summary.js +2 -2
  141. package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +3 -4
  142. package/dist/collection/components/salla-orders/salla-orders.js +4 -4
  143. package/dist/collection/components/salla-payments/salla-payments.js +1 -0
  144. package/dist/collection/components/salla-placeholder/salla-placeholder.js +3 -3
  145. package/dist/collection/components/salla-price-range/salla-price-range.js +8 -8
  146. package/dist/collection/components/salla-product-availability/salla-product-availability.js +6 -6
  147. package/dist/collection/components/salla-product-card/salla-product-card.js +18 -18
  148. package/dist/collection/components/salla-product-options/salla-product-options.js +13 -15
  149. package/dist/collection/components/salla-products-list/salla-products-list.js +21 -20
  150. package/dist/collection/components/salla-products-slider/salla-products-slider.js +23 -22
  151. package/dist/collection/components/salla-progress-bar/salla-progress-bar.js +20 -21
  152. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +2 -2
  153. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +17 -16
  154. package/dist/collection/components/salla-quick-order/salla-quick-order.js +11 -11
  155. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +2 -2
  156. package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +8 -8
  157. package/dist/collection/components/salla-review-card/salla-review-card.js +3 -3
  158. package/dist/collection/components/salla-reviews/salla-reviews.js +13 -16
  159. package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +2 -2
  160. package/dist/collection/components/salla-scopes/salla-scopes.js +2 -2
  161. package/dist/collection/components/salla-search/salla-search.js +6 -6
  162. package/dist/collection/components/salla-skeleton/salla-skeleton.js +3 -3
  163. package/dist/collection/components/salla-slider/salla-slider.js +25 -25
  164. package/dist/collection/components/salla-social-share/salla-social-share.js +3 -3
  165. package/dist/collection/components/salla-tabs/salla-tab-content.js +2 -2
  166. package/dist/collection/components/salla-tabs/salla-tab-header.js +5 -5
  167. package/dist/collection/components/salla-tabs/salla-tabs.js +2 -2
  168. package/dist/collection/components/salla-tel-input/salla-tel-input.js +8 -9
  169. package/dist/collection/components/salla-tooltip/salla-tooltip.js +5 -5
  170. package/dist/collection/components/salla-trust-badges/salla-trust-badges.js +1 -1
  171. package/dist/collection/components/salla-user-menu/salla-user-menu.js +5 -5
  172. package/dist/collection/components/salla-user-profile/salla-user-profile.js +1 -1
  173. package/dist/collection/components/salla-verify/salla-verify.js +4 -4
  174. package/dist/components/Helper.js +432 -1
  175. package/dist/components/_commonjsHelpers.js +7 -1
  176. package/dist/components/anime.es.js +1310 -1
  177. package/dist/components/arrow-left.js +8 -1
  178. package/dist/components/axios.js +4240 -2
  179. package/dist/components/bell-ring.js +8 -1
  180. package/dist/components/camera.js +8 -1
  181. package/dist/components/cancel.js +8 -1
  182. package/dist/components/cart.js +8 -1
  183. package/dist/components/check-circle2.js +15 -1
  184. package/dist/components/check.js +8 -1
  185. package/dist/components/facebook.js +10 -1
  186. package/dist/components/filepond-plugin-file-poster.js +662 -2
  187. package/dist/components/filepond-plugin-file-validate-size.js +204 -2
  188. package/dist/components/filepond-plugin-file-validate-type.js +262 -2
  189. package/dist/components/filepond-plugin-image-edit.js +487 -2
  190. package/dist/components/filepond-plugin-image-exif-orientation.js +214 -2
  191. package/dist/components/filepond-plugin-image-preview.js +2237 -2
  192. package/dist/components/filepond.js +11286 -2
  193. package/dist/components/gift.js +8 -1
  194. package/dist/components/image.js +8 -1
  195. package/dist/components/index.d.ts +0 -2
  196. package/dist/components/index.js +8220 -1
  197. package/dist/components/index2.js +1709 -1
  198. package/dist/components/index3.js +2550 -1
  199. package/dist/components/interfaces.js +12 -1
  200. package/dist/components/isObject.js +292 -1
  201. package/dist/components/keyboard_arrow_down.js +8 -1
  202. package/dist/components/keyboard_arrow_right.js +15 -1
  203. package/dist/components/location.js +11 -1
  204. package/dist/components/mail.js +8 -1
  205. package/dist/components/minus.js +15 -1
  206. package/dist/components/salla-accordion-body.js +6 -1
  207. package/dist/components/salla-accordion-body2.js +30 -1
  208. package/dist/components/salla-accordion-head.js +6 -1
  209. package/dist/components/salla-accordion-head2.js +63 -1
  210. package/dist/components/salla-accordion.js +6 -1
  211. package/dist/components/salla-accordion2.js +68 -1
  212. package/dist/components/salla-add-product-button.js +6 -1
  213. package/dist/components/salla-add-product-button2.js +306 -1
  214. package/dist/components/salla-advertisement.js +155 -1
  215. package/dist/components/salla-alert.js +59 -1
  216. package/dist/components/salla-app-install-alert.js +91 -1
  217. package/dist/components/salla-apps-icons.js +63 -1
  218. package/dist/components/salla-booking-field.js +6 -1
  219. package/dist/components/salla-booking-field2.js +221 -1
  220. package/dist/components/salla-bottom-alert.js +214 -1
  221. package/dist/components/salla-breadcrumb.js +226 -1
  222. package/dist/components/salla-bullet-delivery.js +2114 -1
  223. package/dist/components/salla-button.js +6 -1
  224. package/dist/components/salla-button2.js +174 -1
  225. package/dist/components/salla-cart-coupons.js +284 -1
  226. package/dist/components/salla-cart-item-offers.js +143 -1
  227. package/dist/components/salla-cart-summary.js +136 -1
  228. package/dist/components/salla-color-picker.js +6 -1
  229. package/dist/components/salla-color-picker2.js +260 -1
  230. package/dist/components/salla-comment-form.js +6 -1
  231. package/dist/components/salla-comment-form2.js +64 -1
  232. package/dist/components/salla-comment-item.js +6 -1
  233. package/dist/components/salla-comment-item2.js +217 -1
  234. package/dist/components/salla-comments.js +395 -1
  235. package/dist/components/salla-conditional-fields.js +6 -1
  236. package/dist/components/salla-conditional-fields2.js +137 -1
  237. package/dist/components/salla-conditional-offer.js +194 -1
  238. package/dist/components/salla-contacts.js +125 -1
  239. package/dist/components/salla-cookies-bar.js +107 -1
  240. package/dist/components/salla-count-down.js +6 -1
  241. package/dist/components/salla-count-down2.js +271 -1
  242. package/dist/components/salla-custom-fields.js +175 -1
  243. package/dist/components/salla-datetime-picker.js +6 -1
  244. package/dist/components/salla-datetime-picker2.js +342 -1
  245. package/dist/components/salla-delivery-promise.js +263 -1
  246. package/dist/components/salla-drawer.js +6 -1
  247. package/dist/components/salla-drawer2.js +214 -1
  248. package/dist/components/salla-file-upload.js +6 -1
  249. package/dist/components/salla-file-upload2.js +583 -1
  250. package/dist/components/salla-filters-widget.js +6 -1
  251. package/dist/components/salla-filters-widget2.js +245 -1
  252. package/dist/components/salla-filters.js +253 -1
  253. package/dist/components/salla-fulfillment-methods.js +61 -1
  254. package/dist/components/salla-gifting.js +732 -1
  255. package/dist/components/salla-hook.js +47 -1
  256. package/dist/components/salla-infinite-scroll.js +112 -1
  257. package/dist/components/salla-installment.js +306 -1
  258. package/dist/components/salla-list-tile.js +6 -1
  259. package/dist/components/salla-list-tile2.js +47 -1
  260. package/dist/components/salla-loading.js +6 -1
  261. package/dist/components/salla-loading2.js +51 -1
  262. package/dist/components/salla-localization-modal.js +296 -1
  263. package/dist/components/salla-login-modal.js +6 -1
  264. package/dist/components/salla-login-modal2.js +359 -1
  265. package/dist/components/salla-loyalty-prize-item.js +39 -1
  266. package/dist/components/salla-loyalty-program.js +115 -1
  267. package/dist/components/salla-loyalty.js +304 -1
  268. package/dist/components/salla-maintenance-alert.js +57 -1
  269. package/dist/components/salla-map.js +6 -1
  270. package/dist/components/salla-map2.js +766 -1
  271. package/dist/components/salla-menu.js +165 -1
  272. package/dist/components/salla-metadata.js +97 -1
  273. package/dist/components/salla-modal.js +6 -1
  274. package/dist/components/salla-modal2.js +215 -1
  275. package/dist/components/salla-multiple-bundle-product-cart.js +6 -1
  276. package/dist/components/salla-multiple-bundle-product-cart2.js +151 -1
  277. package/dist/components/salla-multiple-bundle-product-details.js +6 -1
  278. package/dist/components/salla-multiple-bundle-product-details2.js +296 -1
  279. package/dist/components/salla-multiple-bundle-product-options-modal.js +6 -1
  280. package/dist/components/salla-multiple-bundle-product-options-modal2.js +598 -1
  281. package/dist/components/salla-multiple-bundle-product-slider.js +6 -1
  282. package/dist/components/salla-multiple-bundle-product-slider2.js +136 -1
  283. package/dist/components/salla-multiple-bundle-product.js +207 -1
  284. package/dist/components/salla-notification-item.js +6 -1
  285. package/dist/components/salla-notification-item2.js +32 -1
  286. package/dist/components/salla-notifications.js +190 -1
  287. package/dist/components/salla-offer-modal.js +328 -1
  288. package/dist/components/salla-offer.js +478 -1
  289. package/dist/components/salla-order-details-multiple-bundle-product.js +6 -1
  290. package/dist/components/salla-order-details-multiple-bundle-product2.js +122 -1
  291. package/dist/components/salla-order-details-options.js +6 -1
  292. package/dist/components/salla-order-details-options2.js +140 -1
  293. package/dist/components/salla-order-details.js +122 -1
  294. package/dist/components/salla-order-edit-item.js +6 -1
  295. package/dist/components/salla-order-edit-item2.js +181 -1
  296. package/dist/components/salla-order-edit.js +288 -1
  297. package/dist/components/salla-order-summary.js +132 -1
  298. package/dist/components/salla-order-totals-card.js +87 -1
  299. package/dist/components/salla-orders.js +271 -1
  300. package/dist/components/salla-payments.js +76 -1
  301. package/dist/components/salla-placeholder.js +6 -1
  302. package/dist/components/salla-placeholder2.js +66 -1
  303. package/dist/components/salla-price-range.js +6 -1
  304. package/dist/components/salla-price-range2.js +204 -1
  305. package/dist/components/salla-product-availability.js +6 -1
  306. package/dist/components/salla-product-availability2.js +206 -1
  307. package/dist/components/salla-product-card.js +6 -1
  308. package/dist/components/salla-product-card2.js +241 -1
  309. package/dist/components/salla-product-options.js +6 -1
  310. package/dist/components/salla-product-options2.js +962 -1
  311. package/dist/components/salla-product-size-guide.js +130 -1
  312. package/dist/components/salla-products-list.js +6 -1
  313. package/dist/components/salla-products-list2.js +812 -1
  314. package/dist/components/salla-products-slider.js +6 -1
  315. package/dist/components/salla-products-slider2.js +215 -1
  316. package/dist/components/salla-progress-bar.js +6 -1
  317. package/dist/components/salla-progress-bar2.js +94 -1
  318. package/dist/components/salla-quantity-input.js +6 -1
  319. package/dist/components/salla-quantity-input2.js +127 -1
  320. package/dist/components/salla-quick-buy.js +6 -1
  321. package/dist/components/salla-quick-buy2.js +1181 -1
  322. package/dist/components/salla-quick-order.js +299 -1
  323. package/dist/components/salla-rating-modal.js +530 -1
  324. package/dist/components/salla-rating-stars.js +6 -1
  325. package/dist/components/salla-rating-stars2.js +162 -1
  326. package/dist/components/salla-review-card.js +6 -1
  327. package/dist/components/salla-review-card2.js +198 -1
  328. package/dist/components/salla-reviews-page.js +726 -1
  329. package/dist/components/salla-reviews-summary.js +6 -1
  330. package/dist/components/salla-reviews-summary2.js +132 -1
  331. package/dist/components/salla-reviews.js +143 -1
  332. package/dist/components/salla-scopes.js +249 -1
  333. package/dist/components/salla-search.js +213 -1
  334. package/dist/components/salla-skeleton.js +6 -1
  335. package/dist/components/salla-skeleton2.js +50 -1
  336. package/dist/components/salla-slider.js +6 -1
  337. package/dist/components/salla-slider2.js +10489 -1
  338. package/dist/components/salla-social-share.js +194 -1
  339. package/dist/components/salla-social.js +89 -1
  340. package/dist/components/salla-tab-content.js +6 -1
  341. package/dist/components/salla-tab-content2.js +55 -1
  342. package/dist/components/salla-tab-header.js +6 -1
  343. package/dist/components/salla-tab-header2.js +85 -1
  344. package/dist/components/salla-tabs.js +6 -1
  345. package/dist/components/salla-tabs2.js +75 -1
  346. package/dist/components/salla-tel-input.js +6 -1
  347. package/dist/components/salla-tel-input2.js +168 -1
  348. package/dist/components/salla-tiered-offer.js +366 -1
  349. package/dist/components/salla-tooltip.js +6 -1
  350. package/dist/components/salla-tooltip2.js +57 -1
  351. package/dist/components/salla-trust-badges.js +90 -1
  352. package/dist/components/salla-user-menu.js +344 -1
  353. package/dist/components/salla-user-profile.js +203 -1
  354. package/dist/components/salla-user-settings.js +139 -1
  355. package/dist/components/salla-verify.js +303 -1
  356. package/dist/components/salla-wallet.js +114 -1
  357. package/dist/components/search.js +8 -1
  358. package/dist/components/shopping-bag.js +8 -1
  359. package/dist/components/special-discount.js +8 -1
  360. package/dist/components/star.js +8 -1
  361. package/dist/components/star2.js +8 -1
  362. package/dist/components/vanilla-picker.js +1034 -2
  363. package/dist/components/whatsapp2.js +8 -1
  364. package/dist/esm/{filepond-DlGaLh8N.js → filepond-Be7JObSq.js} +1 -1
  365. package/dist/esm/{filepond-plugin-file-poster-BTVFYcQx.js → filepond-plugin-file-poster-DF0NWKCQ.js} +2 -2
  366. package/dist/esm/{filepond-plugin-file-validate-size-DGryLmWv.js → filepond-plugin-file-validate-size-DJFlJHtE.js} +1 -1
  367. package/dist/esm/{filepond-plugin-file-validate-type-DxKfCD0V.js → filepond-plugin-file-validate-type-DykpLW1Z.js} +1 -1
  368. package/dist/esm/{filepond-plugin-image-edit-2W7pu9hn.js → filepond-plugin-image-edit-CyIHxrnW.js} +1 -1
  369. package/dist/esm/{filepond-plugin-image-exif-orientation-OQu-IvPH.js → filepond-plugin-image-exif-orientation-DbCOAhSu.js} +1 -1
  370. package/dist/esm/{filepond-plugin-image-preview-DEW_tSNR.js → filepond-plugin-image-preview-CGRGZcft.js} +1 -1
  371. package/dist/esm/{index-DYB20YqN.js → index-Cz6cYzxG.js} +547 -780
  372. package/dist/esm/{index-BDqMkCqE.js → index-_kPnZdm0.js} +1 -1
  373. package/dist/esm/loader.js +3 -4
  374. package/dist/esm/salla-accordion-body_2.entry.js +5 -5
  375. package/dist/esm/salla-accordion_6.entry.js +15 -19
  376. package/dist/esm/salla-add-product-button_4.entry.js +10 -12
  377. package/dist/esm/salla-advertisement.entry.js +3 -3
  378. package/dist/esm/salla-alert_2.entry.js +5 -5
  379. package/dist/esm/salla-app-install-alert.entry.js +3 -3
  380. package/dist/esm/salla-apps-icons.entry.js +3 -3
  381. package/dist/esm/salla-booking-field_7.entry.js +23 -25
  382. package/dist/esm/salla-bullet-delivery.entry.js +3 -3
  383. package/dist/esm/salla-cart-coupons.entry.js +3 -3
  384. package/dist/esm/salla-cart-item-offers_2.entry.js +5 -5
  385. package/dist/esm/salla-comment-form_8.entry.js +17 -17
  386. package/dist/esm/salla-conditional-offer.entry.js +3 -3
  387. package/dist/esm/salla-contacts.entry.js +3 -3
  388. package/dist/esm/salla-cookies-bar.entry.js +3 -3
  389. package/dist/esm/salla-count-down.entry.js +3 -3
  390. package/dist/esm/salla-custom-fields.entry.js +3 -3
  391. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  392. package/dist/esm/salla-filters-widget.entry.js +3 -3
  393. package/dist/esm/salla-filters.entry.js +3 -3
  394. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  395. package/dist/esm/salla-gifting.entry.js +3 -3
  396. package/dist/esm/salla-hook.entry.js +2 -5
  397. package/dist/esm/salla-infinite-scroll.entry.js +3 -3
  398. package/dist/esm/salla-installment.entry.js +3 -3
  399. package/dist/esm/salla-list-tile.entry.js +3 -3
  400. package/dist/esm/salla-localization-modal.entry.js +1 -1
  401. package/dist/esm/salla-login-modal.entry.js +3 -3
  402. package/dist/esm/salla-loyalty-prize-item.entry.js +3 -3
  403. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  404. package/dist/esm/salla-loyalty.entry.js +3 -3
  405. package/dist/esm/salla-maintenance-alert.entry.js +3 -3
  406. package/dist/esm/salla-map.entry.js +3 -3
  407. package/dist/esm/salla-menu.entry.js +3 -3
  408. package/dist/esm/salla-metadata.entry.js +3 -3
  409. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +5 -5
  410. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +6 -8
  411. package/dist/esm/salla-multiple-bundle-product.entry.js +4 -6
  412. package/dist/esm/salla-notification-item.entry.js +3 -3
  413. package/dist/esm/salla-notifications.entry.js +3 -3
  414. package/dist/esm/salla-offer-modal.entry.js +3 -3
  415. package/dist/esm/salla-offer.entry.js +3 -3
  416. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +3 -3
  417. package/dist/esm/salla-order-details-options.entry.js +3 -3
  418. package/dist/esm/salla-order-details.entry.js +4 -6
  419. package/dist/esm/salla-order-edit-item.entry.js +3 -3
  420. package/dist/esm/salla-order-edit.entry.js +3 -3
  421. package/dist/esm/salla-order-summary.entry.js +3 -3
  422. package/dist/esm/salla-order-totals-card.entry.js +4 -6
  423. package/dist/esm/salla-orders.entry.js +3 -3
  424. package/dist/esm/salla-payments.entry.js +3 -3
  425. package/dist/esm/salla-placeholder.entry.js +3 -3
  426. package/dist/esm/salla-price-range.entry.js +3 -3
  427. package/dist/esm/salla-product-card.entry.js +3 -3
  428. package/dist/esm/salla-product-size-guide.entry.js +3 -3
  429. package/dist/esm/salla-products-list.entry.js +3 -3
  430. package/dist/esm/salla-products-slider.entry.js +3 -3
  431. package/dist/esm/salla-progress-bar.entry.js +3 -3
  432. package/dist/esm/salla-quick-order.entry.js +3 -3
  433. package/dist/esm/salla-rating-modal.entry.js +3 -3
  434. package/dist/esm/salla-scopes.entry.js +3 -3
  435. package/dist/esm/salla-search.entry.js +4 -6
  436. package/dist/esm/salla-skeleton.entry.js +3 -3
  437. package/dist/esm/salla-slider.entry.js +3 -3
  438. package/dist/esm/salla-social-share.entry.js +3 -3
  439. package/dist/esm/salla-social.entry.js +3 -3
  440. package/dist/esm/salla-tab-content_3.entry.js +7 -7
  441. package/dist/esm/salla-tiered-offer.entry.js +3 -3
  442. package/dist/esm/salla-tooltip.entry.js +3 -3
  443. package/dist/esm/salla-trust-badges.entry.js +3 -3
  444. package/dist/esm/salla-user-menu.entry.js +3 -3
  445. package/dist/esm/salla-user-profile.entry.js +3 -3
  446. package/dist/esm/salla-user-settings.entry.js +3 -3
  447. package/dist/esm/salla-verify.entry.js +3 -3
  448. package/dist/esm/salla-wallet.entry.js +3 -3
  449. package/dist/esm/twilight.js +4 -5
  450. package/dist/esm/{vanilla-picker-Dt9vZPZF.js → vanilla-picker-C_YV5LtA.js} +1 -1
  451. package/dist/twilight/{p-33779828.entry.js → p-0200cddd.entry.js} +1 -1
  452. package/dist/twilight/p-04dc0b71.entry.js +4 -0
  453. package/dist/twilight/{p-105b1dab.entry.js → p-0bac200e.entry.js} +1 -1
  454. package/dist/twilight/{p-ccfe5308.entry.js → p-0ef99df1.entry.js} +1 -1
  455. package/dist/twilight/{p-647b6d76.entry.js → p-1087f0dd.entry.js} +1 -1
  456. package/dist/twilight/{p-1875537e.entry.js → p-17dd8b68.entry.js} +1 -1
  457. package/dist/twilight/{p-aa7c5de0.entry.js → p-25a9bf1b.entry.js} +1 -1
  458. package/dist/twilight/{p-34b670fc.entry.js → p-2602927d.entry.js} +1 -1
  459. package/dist/twilight/p-268695ff.entry.js +4 -0
  460. package/dist/twilight/{p-aaa0c743.entry.js → p-34920aac.entry.js} +1 -1
  461. package/dist/twilight/{p-817b8ba5.entry.js → p-3656b48d.entry.js} +1 -1
  462. package/dist/twilight/{p-4932857d.entry.js → p-3857beb4.entry.js} +1 -1
  463. package/dist/twilight/{p-af3c74f4.entry.js → p-39c601e3.entry.js} +1 -1
  464. package/dist/twilight/{p-b598c0f7.entry.js → p-3c810881.entry.js} +1 -1
  465. package/dist/twilight/{p-d371d450.entry.js → p-3cf5c61f.entry.js} +1 -1
  466. package/dist/twilight/{p-3ccc532d.entry.js → p-413a7236.entry.js} +1 -1
  467. package/dist/twilight/{p-f176d41d.entry.js → p-42778349.entry.js} +1 -1
  468. package/dist/twilight/{p-b17d055d.entry.js → p-45e4f6f4.entry.js} +1 -1
  469. package/dist/twilight/{p-2abaa633.entry.js → p-4680956b.entry.js} +1 -1
  470. package/dist/twilight/{p-96a20515.entry.js → p-468b999f.entry.js} +1 -1
  471. package/dist/twilight/{p-df6853b5.entry.js → p-46d1823f.entry.js} +1 -1
  472. package/dist/twilight/{p-c87951a2.entry.js → p-49db497f.entry.js} +1 -1
  473. package/dist/twilight/{p-18bb0181.entry.js → p-4b033276.entry.js} +1 -1
  474. package/dist/twilight/{p-296d2dd0.entry.js → p-4f7bc9c3.entry.js} +1 -1
  475. package/dist/twilight/{p-4fa4547a.entry.js → p-543ee624.entry.js} +1 -1
  476. package/dist/twilight/{p-2fe01e44.entry.js → p-5957f774.entry.js} +1 -1
  477. package/dist/twilight/{p-96e78428.entry.js → p-5a4f0b99.entry.js} +1 -1
  478. package/dist/twilight/{p-87c0ca91.entry.js → p-5a8c0fd2.entry.js} +1 -1
  479. package/dist/twilight/{p-e28c0773.entry.js → p-5ab7a295.entry.js} +1 -1
  480. package/dist/twilight/{p-542d3277.entry.js → p-5e496aaa.entry.js} +1 -1
  481. package/dist/twilight/{p-c3ffb88a.entry.js → p-5f440956.entry.js} +1 -1
  482. package/dist/twilight/{p-94dbc1e9.entry.js → p-60fafcd9.entry.js} +1 -1
  483. package/dist/twilight/{p-1ef2602d.entry.js → p-708f02db.entry.js} +1 -1
  484. package/dist/twilight/{p-b64f3155.entry.js → p-7829ea8a.entry.js} +1 -1
  485. package/dist/twilight/{p-7093a427.entry.js → p-7d3e592a.entry.js} +1 -1
  486. package/dist/twilight/{p-96d03a28.entry.js → p-81876026.entry.js} +1 -1
  487. package/dist/twilight/{p-d9f5a8cd.entry.js → p-8306ef5e.entry.js} +1 -1
  488. package/dist/twilight/{p-d4a242f8.entry.js → p-8403cd93.entry.js} +1 -1
  489. package/dist/twilight/{p-7abddca8.entry.js → p-8474c4f6.entry.js} +1 -1
  490. package/dist/twilight/p-8552160a.entry.js +4 -0
  491. package/dist/twilight/p-8c9b0e2a.entry.js +4 -0
  492. package/dist/twilight/{p-2881bb33.entry.js → p-8f2dfc57.entry.js} +1 -1
  493. package/dist/twilight/{p-c091e2dc.entry.js → p-94b1a2ae.entry.js} +1 -1
  494. package/dist/twilight/{p-ede67a08.entry.js → p-95dad1af.entry.js} +1 -1
  495. package/dist/twilight/{p-eac718cd.entry.js → p-964b7db9.entry.js} +1 -1
  496. package/dist/twilight/{p-e3b8e0e1.entry.js → p-99735748.entry.js} +1 -1
  497. package/dist/twilight/{p-X6Yi3bYP.js → p-BZKDQg1s.js} +1 -1
  498. package/dist/twilight/{p-Cw3UBzjl.js → p-B_sN7OnY.js} +1 -1
  499. package/dist/twilight/{p-8r0S6BcZ.js → p-Bpi0aG1F.js} +1 -1
  500. package/dist/twilight/{p-BkClxrC4.js → p-CP8rFQ5n.js} +1 -1
  501. package/dist/twilight/{p-bNzv71Xl.js → p-CfmIbM8B.js} +1 -1
  502. package/dist/twilight/{p-bScl0xMh.js → p-CpO1SrBd.js} +1 -1
  503. package/dist/twilight/p-Cz6cYzxG.js +5 -0
  504. package/dist/twilight/p-Do4hSOGo.js +9 -0
  505. package/dist/twilight/{p-Ck4zxCil.js → p-JJmlh-ji.js} +1 -1
  506. package/dist/twilight/{p-dd2bd5dc.entry.js → p-a4aedcfe.entry.js} +1 -1
  507. package/dist/twilight/{p-06fa7327.entry.js → p-b0d01f9f.entry.js} +1 -1
  508. package/dist/twilight/p-b8404cfb.entry.js +4 -0
  509. package/dist/twilight/{p-108d8c8b.entry.js → p-b8e3e180.entry.js} +1 -1
  510. package/dist/twilight/{p-ad07f67a.entry.js → p-bd687cd0.entry.js} +1 -1
  511. package/dist/twilight/{p-44fa7521.entry.js → p-c0037fac.entry.js} +1 -1
  512. package/dist/twilight/{p-293c6cf3.entry.js → p-c121f8e4.entry.js} +1 -1
  513. package/dist/twilight/{p-a01f1992.entry.js → p-c29907df.entry.js} +1 -1
  514. package/dist/twilight/p-c39675ef.entry.js +4 -0
  515. package/dist/twilight/{p-bff4c7b3.entry.js → p-cb7a985e.entry.js} +1 -1
  516. package/dist/twilight/p-cbe620c4.entry.js +4 -0
  517. package/dist/twilight/{p-6f36541a.entry.js → p-d2fd79b4.entry.js} +1 -1
  518. package/dist/twilight/{p-d337c399.entry.js → p-d6cf0ffd.entry.js} +1 -1
  519. package/dist/twilight/{p-748df7e6.entry.js → p-d8f60f2f.entry.js} +1 -1
  520. package/dist/twilight/p-d99610f9.entry.js +4 -0
  521. package/dist/twilight/{p-e6bbf50d.entry.js → p-dc897bdd.entry.js} +1 -1
  522. package/dist/twilight/{p-f7999a6d.entry.js → p-dca46236.entry.js} +1 -1
  523. package/dist/twilight/{p-e94f217b.entry.js → p-e48853c9.entry.js} +1 -1
  524. package/dist/twilight/{p-09d39785.entry.js → p-e4fdb206.entry.js} +1 -1
  525. package/dist/twilight/p-ed913ae7.entry.js +4 -0
  526. package/dist/twilight/p-f067fcd6.entry.js +4 -0
  527. package/dist/twilight/{p-57ff1f25.entry.js → p-f2cd6975.entry.js} +1 -1
  528. package/dist/twilight/{p-ad041ab5.entry.js → p-f2ffbfbb.entry.js} +1 -1
  529. package/dist/twilight/{p-f5d15e71.entry.js → p-f3166e60.entry.js} +1 -1
  530. package/dist/twilight/{p-59ae82bd.entry.js → p-f8fcc8f4.entry.js} +1 -1
  531. package/dist/twilight/{p-c1fd45b1.entry.js → p-f9e52fd9.entry.js} +1 -1
  532. package/dist/twilight/p-fcddbfc3.entry.js +4 -0
  533. package/dist/twilight/{p-41c733c2.entry.js → p-fe7ac9bb.entry.js} +1 -1
  534. package/dist/twilight/{p-0add06f9.entry.js → p-ff14dca3.entry.js} +1 -1
  535. package/dist/twilight/{p-BZnoSB1s.js → p-mlFGjxcj.js} +1 -1
  536. package/dist/twilight/twilight.esm.js +1 -1
  537. package/dist/types/components.d.ts +177 -763
  538. package/dist/types/stencil-public-runtime.d.ts +11 -169
  539. package/package.json +5 -5
  540. package/dist/cjs/app-globals-oehrC7QI.js +0 -39
  541. package/dist/esm/app-globals-BFryt7-C.js +0 -37
  542. package/dist/twilight/p-1daeed6e.entry.js +0 -4
  543. package/dist/twilight/p-2ddb3fce.entry.js +0 -4
  544. package/dist/twilight/p-34968e31.entry.js +0 -4
  545. package/dist/twilight/p-665189b4.entry.js +0 -4
  546. package/dist/twilight/p-776c9d33.entry.js +0 -4
  547. package/dist/twilight/p-7b8313ef.entry.js +0 -4
  548. package/dist/twilight/p-7bd0ede5.entry.js +0 -4
  549. package/dist/twilight/p-8e8d9d7d.entry.js +0 -4
  550. package/dist/twilight/p-D1vqXXNX.js +0 -9
  551. package/dist/twilight/p-DYB20YqN.js +0 -5
  552. package/dist/twilight/p-Vl6qpttb.js +0 -4
  553. package/dist/twilight/p-af60e72a.entry.js +0 -4
  554. package/dist/twilight/p-e679884a.entry.js +0 -4
  555. package/dist/twilight/p-efab88c5.entry.js +0 -4
@@ -1,4 +1,1712 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{g as i}from"./_commonjsHelpers.js";function t(i,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(e){if("default"!==e&&!(e in i)){var s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:function(){return t[e]}})}}))})),Object.freeze(i)}var e,s,n,a={exports:{}};var r,o=n?s:(n=1,e||(e=1,r=function(i){return function(){for(var t=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua & Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia & Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros","km","269"],["Congo - Brazzaville","cg","242"],["Congo - Kinshasa","cd","243"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan","jo","962"],["Kazakhstan","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["North Macedonia","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé & Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["St Barthélemy","bl","590",1],["St Helena","sh","290"],["St Kitts & Nevis","kn","1",18,["869"]],["St Lucia","lc","1",19,["758"]],["St Martin","mf","590",2],["St Pierre & Miquelon","pm","508"],["St Vincent & Grenadines","vc","1",20,["784"]],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard & Jan Mayen","sj","47",1,["79"]],["Sweden","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad & Tobago","tt","1",22,["868"]],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks & Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["US Virgin Islands","vi","1",24,["340"]],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681"],["Western Sahara","eh","212",1,["5288","5289"]],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],e=0;e<t.length;e++){var s=t[e];t[e]={name:s[0],iso2:s[1],dialCode:s[2],priority:s[3]||0,areaCodes:s[4]||null}}function n(i,t,e){return(t=a(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function a(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(e!==i){var s=e.call(t,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var r={getInstance:function(i){var t=i.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[t]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=r);var o=0,h={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",countrySearch:!1,customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!1,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,showFlags:!0,useFullscreenPopup:"undefined"!=typeof navigator&&"undefined"!=typeof window&&(/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500),utilsScript:""},u=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],l=function(i,t){for(var e=Object.keys(i),s=0;s<e.length;s++)t(e[s],i[e[s]])},c=function(i){l(window.intlTelInputGlobals.instances,(function(t){window.intlTelInputGlobals.instances[t][i]()}))},d=function(){function e(i,t){var s=this;!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=o++,this.telInput=i,this.activeItem=null,this.highlightedItem=null;var n=t||{};this.options={},l(h,(function(i,t){s.options[i]=n.hasOwnProperty(i)?n[i]:t})),this.hadInitialPlaceholder=Boolean(i.getAttribute("placeholder"))}return s=e,r=[{key:"_init",value:function(){var i=this;if(this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.countrySearch&&!this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!0),this.options.nationalMode&&(this.options.autoInsertDialCode=!1),this.options.separateDialCode&&(this.options.autoInsertDialCode=!1),!this.options.showFlags&&this.options.allowDropdown&&!this.options.separateDialCode&&(this.options.showFlags=!0),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isRTL=!!this.telInput.closest("[dir=rtl]"),"undefined"!=typeof Promise){var t=new Promise((function(t,e){i.resolveAutoCountryPromise=t,i.rejectAutoCountryPromise=e})),e=new Promise((function(t,e){i.resolveUtilsScriptPromise=t,i.rejectUtilsScriptPromise=e}));this.promise=Promise.all([t,e])}else this.resolveAutoCountryPromise=this.rejectAutoCountryPromise=function(){},this.resolveUtilsScriptPromise=this.rejectUtilsScriptPromise=function(){};this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}},{key:"_processCountryData",value:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries(),this.options.localizedCountries&&this._translateCountriesByLocale(),(this.options.onlyCountries.length||this.options.localizedCountries)&&this.countries.sort(this._countryNameSort)}},{key:"_addCountryCode",value:function(t,e,s){e.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=e.length),this.countryCodes.hasOwnProperty(e)||(this.countryCodes[e]=[]);for(var n=0;n<this.countryCodes[e].length;n++)if(this.countryCodes[e][n]===t)return;this.countryCodes[e][s!==i?s:this.countryCodes[e].length]=t}},{key:"_processAllCountries",value:function(){if(this.options.onlyCountries.length){var i=this.options.onlyCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(t){return i.indexOf(t.iso2)>-1}))}else if(this.options.excludeCountries.length){var e=this.options.excludeCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(i){return-1===e.indexOf(i.iso2)}))}else this.countries=t}},{key:"_translateCountriesByLocale",value:function(){for(var i=0;i<this.countries.length;i++){var t=this.countries[i].iso2.toLowerCase();this.options.localizedCountries.hasOwnProperty(t)&&(this.countries[i].name=this.options.localizedCountries[t])}}},{key:"_countryNameSort",value:function(i,t){return i.name<t.name?-1:i.name>t.name?1:0}},{key:"_processCountryCodes",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.countryCodes={};for(var i=0;i<this.countries.length;i++){var t=this.countries[i];this.dialCodes[t.dialCode]||(this.dialCodes[t.dialCode]=!0),this._addCountryCode(t.iso2,t.dialCode,t.priority)}for(var e=0;e<this.countries.length;e++){var s=this.countries[e];if(s.areaCodes)for(var n=this.countryCodes[s.dialCode][0],a=0;a<s.areaCodes.length;a++){for(var r=s.areaCodes[a],o=1;o<r.length;o++){var h=s.dialCode+r.substr(0,o);this._addCountryCode(n,h),this._addCountryCode(s.iso2,h)}this._addCountryCode(s.iso2,s.dialCode+r)}}}},{key:"_processPreferredCountries",value:function(){this.preferredCountries=[];for(var i=0;i<this.options.preferredCountries.length;i++){var t=this.options.preferredCountries[i].toLowerCase(),e=this._getCountryData(t,!1,!0);e&&this.preferredCountries.push(e)}}},{key:"_createEl",value:function(i,t,e){var s=document.createElement(i);return t&&l(t,(function(i,t){return s.setAttribute(i,t)})),e&&e.appendChild(s),s}},{key:"_generateMarkup",value:function(){this.telInput.classList.add("iti__tel-input"),this.telInput.hasAttribute("autocomplete")||this.telInput.form&&this.telInput.form.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","off");var i=this.options,t=i.allowDropdown,e=i.separateDialCode,s=i.showFlags,a=i.customContainer,r=i.hiddenInput,o=i.dropdownContainer,h=i.fixDropdownWidth,u=i.useFullscreenPopup,l=i.countrySearch,c="iti";t&&(c+=" iti--allow-dropdown"),e&&(c+=" iti--separate-dial-code"),s&&(c+=" iti--show-flags"),a&&(c+=" ".concat(a));var d=this._createEl("div",{class:c});this.telInput.parentNode.insertBefore(d,this.telInput);var f=t||s||e;if(f&&(this.flagsContainer=this._createEl("div",{class:"iti__flag-container"},d)),d.appendChild(this.telInput),f&&(this.selectedFlag=this._createEl("div",function(i){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?Object(arguments[t]):{},s=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&s.push.apply(s,Object.getOwnPropertySymbols(e).filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),s.forEach((function(t){n(i,t,e[t])}))}return i}({class:"iti__selected-flag"},t&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.flagsContainer)),s&&(this.selectedFlagInner=this._createEl("div",{class:"iti__flag"},this.selectedFlag)),this.selectedFlag&&this.telInput.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),e&&(this.selectedDialCode=this._createEl("div",{class:"iti__selected-dial-code"},this.selectedFlag)),t)if(this.telInput.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.dropdownArrow=this._createEl("div",{class:"iti__arrow"},this.selectedFlag),this.dropdownContent=this._createEl("div",{class:"iti__dropdown-content iti__hide ".concat(h?"":"iti--flexible-dropdown-width")}),l&&(this.searchInput=this._createEl("input",{type:"text",class:"iti__search-input",placeholder:"Search"},this.dropdownContent)),this.countryList=this._createEl("ul",{class:"iti__country-list",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"},this.dropdownContent),this.preferredCountries.length&&!l&&(this._appendListItems(this.preferredCountries,"iti__preferred",!0),this._createEl("li",{class:"iti__divider","aria-hidden":"true"},this.countryList)),this._appendListItems(this.countries,"iti__standard"),o){var v="iti iti--container";u&&(v+=" iti--fullscreen-popup"),l&&(v+=" iti--country-search"),this.dropdown=this._createEl("div",{class:v}),this.dropdown.appendChild(this.dropdownContent)}else this.flagsContainer.appendChild(this.dropdownContent);if(r){var p=r,y=this.telInput.getAttribute("name");if(y){var m=y.lastIndexOf("[");-1!==m&&(p="".concat(y.substr(0,m),"[").concat(p,"]"))}this.hiddenInput=this._createEl("input",{type:"hidden",name:p}),d.appendChild(this.hiddenInput)}}},{key:"_appendListItems",value:function(i,t,e){for(var s=0;s<i.length;s++){var n=i[s],a=e?"-preferred":"",r=this._createEl("li",{id:"iti-".concat(this.id,"__item-").concat(n.iso2).concat(a),class:"iti__country ".concat(t),tabindex:"-1",role:"option","data-dial-code":n.dialCode,"data-country-code":n.iso2,"aria-selected":"false"},this.countryList);n.node=r;var o="";this.options.showFlags&&(o+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(n.iso2,"'></div></div>")),o+="<span class='iti__country-name'>".concat(n.name,"</span>"),o+="<span class='iti__dial-code'>+".concat(n.dialCode,"</span>"),r.insertAdjacentHTML("beforeend",o)}}},{key:"_setInitialState",value:function(){var i=this.telInput.getAttribute("value"),t=this.telInput.value,e=!i||"+"!==i.charAt(0)||t&&"+"===t.charAt(0)?t:i,s=this._getDialCode(e),n=this._isRegionlessNanp(e),a=this.options,r=a.initialCountry,o=a.autoInsertDialCode;s&&!n?this._updateFlagFromNumber(e):"auto"!==r&&(r&&this._getCountryData(r,!1,!0)?this._setFlag(r.toLowerCase()):s&&n?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),!e&&o&&(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),e&&this._updateValFromNumber(e)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoInsertDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var i=this;this._handleHiddenInputSubmit=function(){i.hiddenInput.value=i.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var i=this.telInput;i&&"LABEL"!==i.tagName;)i=i.parentNode;return i}},{key:"_initDropdownListeners",value:function(){var i=this;this._handleLabelClick=function(t){i.dropdownContent.classList.contains("iti__hide")?i.telInput.focus():t.preventDefault()};var t=this._getClosestLabel();t&&t.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!i.dropdownContent.classList.contains("iti__hide")||i.telInput.disabled||i.telInput.readOnly||i._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(t){i.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),i._showDropdown()),"Tab"===t.key&&i._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var i=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(i.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(i){window.intlTelInputGlobals.autoCountry=i.toLowerCase(),setTimeout((function(){return c("handleAutoCountry")}))}),(function(){return c("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var i=this;this._handleKeyupEvent=function(){i._updateFlagFromNumber(i.telInput.value)&&i._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(i._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(i){var t=this.telInput.getAttribute("maxlength");return t&&i.length>t?i.substr(0,t):i}},{key:"_initBlurListeners",value:function(){var i=this;this._handleSubmitOrBlurEvent=function(){i._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var i=this._getNumeric(this.telInput.value);i&&this.selectedCountryData.dialCode!==i||(this.telInput.value="")}}},{key:"_getNumeric",value:function(i){return i.replace(/\D/g,"")}},{key:"_trigger",value:function(i){var t=document.createEvent("Event");t.initEvent(i,!0,!0),this.telInput.dispatchEvent(t)}},{key:"_showDropdown",value:function(){this.options.fixDropdownWidth&&(this.dropdownContent.style.width="".concat(this.telInput.offsetWidth,"px")),this.dropdownContent.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.options.countrySearch?(this._highlightListItem(this.countryList.firstElementChild,!1),this.searchInput.focus()):this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(i,t,e){e&&!i.classList.contains(t)?i.classList.add(t):!e&&i.classList.contains(t)&&i.classList.remove(t)}},{key:"_setDropdownPosition",value:function(){var i=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){var t=this.telInput.getBoundingClientRect(),e=window.pageYOffset||document.documentElement.scrollTop,s=t.top+e,n=this.dropdownContent.offsetHeight,a=s+this.telInput.offsetHeight+n<e+window.innerHeight,r=!this.options.countrySearch&&!a&&s-n>e;this._toggleClass(this.dropdownContent,"iti__dropdown-content--dropup",r),this.options.dropdownContainer&&(this.dropdown.style.top="".concat(s+(r?0:this.telInput.offsetHeight),"px"),this.dropdown.style.left="".concat(t.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return i._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll))}}},{key:"_getClosestListItem",value:function(i){for(var t=i;t&&t!==this.countryList&&!t.classList.contains("iti__country");)t=t.parentNode;return t===this.countryList?null:t}},{key:"_bindDropdownListeners",value:function(){var i=this;this._handleMouseoverCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._highlightListItem(e,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._selectListItem(e)},this.countryList.addEventListener("click",this._handleClickCountryList);var t=!0;this._handleClickOffToClose=function(){t||i._closeDropdown(),t=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var e="",s=null;if(this._handleKeydownOnDropdown=function(t){["ArrowUp","ArrowDown","Enter","Escape"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key?i._handleUpDownKey(t.key):"Enter"===t.key?i._handleEnterKey():"Escape"===t.key&&i._closeDropdown()),!i.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(t.key)&&(t.stopPropagation(),s&&clearTimeout(s),e+=t.key.toLowerCase(),i._searchForCountry(e),s=setTimeout((function(){e=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){var n=null;this._handleSearchChange=function(){n&&clearTimeout(n),n=setTimeout((function(){var t;(t=i.searchInput.value.trim())?i._filterCountries(t.toLowerCase()):i._filterCountries(null,!0),n=null}),100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",(function(i){return i.stopPropagation()}))}}},{key:"_filterCountries",value:function(t){var e=arguments.length>1&&arguments[1]!==i&&arguments[1],s=!0;this.countryList.innerHTML="";for(var n=0;n<this.countries.length;n++){var a=this.countries[n],r=a.name.toLowerCase(),o="+".concat(a.dialCode);(e||r.includes(t)||o.includes(t))&&(this.countryList.appendChild(a.node),s&&(this._highlightListItem(a.node,!1),s=!1))}}},{key:"_handleUpDownKey",value:function(i){var t="ArrowUp"===i?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;t?t.classList.contains("iti__divider")&&(t="ArrowUp"===i?t.previousElementSibling:t.nextElementSibling):this.countryList.childElementCount>1&&(t="ArrowUp"===i?this.countryList.lastElementChild:this.countryList.firstElementChild),t&&(this._highlightListItem(t,!this.options.countrySearch),this.options.countrySearch&&this._scrollTo(t,!1))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(i){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,i)){var e=this.countries[t].node;this._highlightListItem(e,!1),this._scrollTo(e,!0);break}}},{key:"_startsWith",value:function(i,t){return i.substr(0,t.length).toLowerCase()===t}},{key:"_updateValFromNumber",value:function(i){var t=i;if(this.options.formatOnDisplay&&window.intlTelInputUtils&&this.selectedCountryData){var e=this.options.nationalMode||"+"!==t.charAt(0)&&!this.options.separateDialCode,s=intlTelInputUtils.numberFormat;t=intlTelInputUtils.formatNumber(t,this.selectedCountryData.iso2,e?s.NATIONAL:s.INTERNATIONAL)}t=this._beforeSetNumber(t),this.telInput.value=t}},{key:"_updateFlagFromNumber",value:function(i){var t=i.indexOf("+"),e=t?i.substring(t):i,s=this.selectedCountryData.dialCode;e&&"1"===s&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1".concat(e)),e="+".concat(e)),this.options.separateDialCode&&s&&"+"!==e.charAt(0)&&(e="+".concat(s).concat(e));var n=this._getDialCode(e,!0),a=this._getNumeric(e),r=null;if(n){var o=this.countryCodes[this._getNumeric(n)],h=-1!==o.indexOf(this.selectedCountryData.iso2)&&a.length<=n.length-1;if(!("1"===s&&this._isRegionlessNanp(a)||h))for(var u=0;u<o.length;u++)if(o[u]){r=o[u];break}}else"+"===e.charAt(0)&&a.length?r="":e&&"+"!==e||(r=this.defaultCountry);return null!==r&&this._setFlag(r)}},{key:"_isRegionlessNanp",value:function(i){var t=this._getNumeric(i);if("1"===t.charAt(0)){var e=t.substr(1,3);return-1!==u.indexOf(e)}return!1}},{key:"_highlightListItem",value:function(i,t){var e=this.highlightedItem;e&&e.classList.remove("iti__highlight"),this.highlightedItem=i,this.highlightedItem.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",i.getAttribute("id")),t&&this.highlightedItem.focus()}},{key:"_getCountryData",value:function(i,e,s){for(var n=e?t:this.countries,a=0;a<n.length;a++)if(n[a].iso2===i)return n[a];if(s)return null;throw new Error("No country data for '".concat(i,"'"))}},{key:"_setFlag",value:function(i){var t=this.options,e=t.allowDropdown,s=t.separateDialCode,n=t.showFlags,a=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=i?this._getCountryData(i,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),n&&this.selectedFlagInner.setAttribute("class","iti__flag iti__".concat(i)),this._setSelectedCountryFlagTitleAttribute(i,s),s){var r=this.selectedCountryData.dialCode?"+".concat(this.selectedCountryData.dialCode):"";this.selectedDialCode.innerHTML=r;var o=this.selectedFlag.offsetWidth||this._getHiddenSelectedFlagWidth();this.isRTL?this.telInput.style.paddingRight="".concat(o+6,"px"):this.telInput.style.paddingLeft="".concat(o+6,"px")}if(this._updatePlaceholder(),e){var h=this.activeItem;if(h&&(h.classList.remove("iti__active"),h.setAttribute("aria-selected","false")),i){var u=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i,"-preferred"))||this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i));u.setAttribute("aria-selected","true"),u.classList.add("iti__active"),this.activeItem=u}}return a.iso2!==i}},{key:"_setSelectedCountryFlagTitleAttribute",value:function(i,t){var e;this.selectedFlag&&(e=i&&!t?"".concat(this.selectedCountryData.name,": +").concat(this.selectedCountryData.dialCode):i?this.selectedCountryData.name:"Unknown",this.selectedFlag.setAttribute("title",e))}},{key:"_getHiddenSelectedFlagWidth",value:function(){var i=this.telInput.parentNode.cloneNode();i.style.visibility="hidden",document.body.appendChild(i);var t=this.flagsContainer.cloneNode();i.appendChild(t);var e=this.selectedFlag.cloneNode(!0);t.appendChild(e);var s=e.offsetWidth;return i.parentNode.removeChild(i),s}},{key:"_updatePlaceholder",value:function(){if(window.intlTelInputUtils&&("aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&"polite"===this.options.autoPlaceholder)){var i=intlTelInputUtils.numberType[this.options.placeholderNumberType],t=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,i):"";t=this._beforeSetNumber(t),"function"==typeof this.options.customPlaceholder&&(t=this.options.customPlaceholder(t,this.selectedCountryData)),this.telInput.setAttribute("placeholder",t)}}},{key:"_selectListItem",value:function(i){var t=this._setFlag(i.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(i.getAttribute("data-dial-code")),this.telInput.focus();var e=this.telInput.value.length;this.telInput.setSelectionRange(e,e),t&&this._triggerCountryChange()}},{key:"_closeDropdown",value:function(){this.dropdownContent.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch&&this.searchInput.removeEventListener("input",this._handleSearchChange),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}},{key:"_scrollTo",value:function(i,t){var e=this.dropdownContent,s=window.pageYOffset||document.documentElement.scrollTop,n=e.offsetHeight,a=e.getBoundingClientRect().top+s,r=a+n,o=i.offsetHeight,h=i.getBoundingClientRect().top+s,u=h+o,l=h-a+e.scrollTop,c=n/2-o/2;h<a?(t&&(l-=c),e.scrollTop=l):u>r&&(t&&(l+=c),e.scrollTop=l-(n-o))}},{key:"_updateDialCode",value:function(i){var t,e=this.telInput.value,s="+".concat(i);if("+"===e.charAt(0)){var n=this._getDialCode(e);t=n?e.replace(n,s):s,this.telInput.value=t}else this.options.autoInsertDialCode&&(this.telInput.value=t=e?s+e:s)}},{key:"_getDialCode",value:function(i,t){var e="";if("+"===i.charAt(0))for(var s="",n=0;n<i.length;n++){var a=i.charAt(n);if(!isNaN(parseInt(a,10))){if(s+=a,t)this.countryCodes[s]&&(e=i.substr(0,n+1));else if(this.dialCodes[s]){e=i.substr(0,n+1);break}if(s.length===this.countryCodeMaxLen)break}}return e}},{key:"_getFullNumber",value:function(){var i=this.telInput.value.trim(),t=this.selectedCountryData.dialCode,e=this._getNumeric(i);return(this.options.separateDialCode&&"+"!==i.charAt(0)&&t&&e?"+".concat(t):"")+i}},{key:"_beforeSetNumber",value:function(i){var t=i;if(this.options.separateDialCode){var e=this._getDialCode(t);e&&(e="+".concat(this.selectedCountryData.dialCode),t=t.substr(" "===t[e.length]||"-"===t[e.length]?e.length+1:e.length))}return this._cap(t)}},{key:"_triggerCountryChange",value:function(){this._trigger("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=window.intlTelInputGlobals.autoCountry,this.telInput.value||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this._updatePlaceholder()),this.resolveUtilsScriptPromise()}},{key:"destroy",value:function(){var i=this.telInput.form;if(this.options.allowDropdown){this._closeDropdown(),this.selectedFlag.removeEventListener("click",this._handleClickSelectedFlag),this.flagsContainer.removeEventListener("keydown",this._handleFlagsContainerKeydown);var t=this._getClosestLabel();t&&t.removeEventListener("click",this._handleLabelClick)}this.hiddenInput&&i&&i.removeEventListener("submit",this._handleHiddenInputSubmit),this.options.autoInsertDialCode&&(i&&i.removeEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.removeEventListener("blur",this._handleSubmitOrBlurEvent)),this.telInput.removeEventListener("keyup",this._handleKeyupEvent),this.telInput.removeEventListener("cut",this._handleClipboardEvent),this.telInput.removeEventListener("paste",this._handleClipboardEvent),this.telInput.removeAttribute("data-intl-tel-input-id");var e=this.telInput.parentNode;e.parentNode.insertBefore(this.telInput,e),e.parentNode.removeChild(e),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(i){if(window.intlTelInputUtils){var t=this.selectedCountryData.iso2;return intlTelInputUtils.formatNumber(this._getFullNumber(),t,i)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.selectedCountryData}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var i=this.selectedCountryData.iso2;return intlTelInputUtils.getValidationError(this._getFullNumber(),i)}return-99}},{key:"isValidNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(i,this.selectedCountryData.iso2):null}},{key:"isPossibleNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isPossibleNumber(i,this.selectedCountryData.iso2):null}},{key:"setCountry",value:function(i){var t=i.toLowerCase();this.selectedCountryData.iso2!==t&&(this._setFlag(t),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}},{key:"setNumber",value:function(i){var t=this._updateFlagFromNumber(i);this._updateValFromNumber(i),t&&this._triggerCountryChange()}},{key:"setPlaceholderNumberType",value:function(i){this.options.placeholderNumberType=i,this._updatePlaceholder()}}],r&&function(i,t){for(var e=0;e<t.length;e++){var s=t[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,a(s.key),s)}}(s.prototype,r),Object.defineProperty(s,"prototype",{writable:!1}),e;var s,r}();r.getCountryData=function(){return t};var f=function(i,t,e){var s=document.createElement("script");s.onload=function(){c("handleUtils"),t&&t()},s.onerror=function(){c("rejectUtilsScriptPromise"),e&&e()},s.className="iti-load-utils",s.async=!0,s.src=i,document.body.appendChild(s)};return r.loadUtils=function(i){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise((function(t,e){return f(i,t,e)}));f(i)}return null},r.defaults=h,r.version="18.5.3",function(i,t){var e=new d(i,t);return e._init(),i.setAttribute("data-intl-tel-input-id",e.id),window.intlTelInputGlobals.instances[e.id]=e,e}}()},a.exports?a.exports=r():window.intlTelInput=r()),s=a.exports),h=t({__proto__:null,default:i(o)},[o]);export{h as i}
4
+ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.js';
5
+
6
+ function _mergeNamespaces(n, m) {
7
+ m.forEach(function (e) {
8
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
9
+ if (k !== 'default' && !(k in n)) {
10
+ var d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: function () { return e[k]; }
14
+ });
15
+ }
16
+ });
17
+ });
18
+ return Object.freeze(n);
19
+ }
20
+
21
+ var intlTelInput$1 = {exports: {}};
22
+
23
+ /*
24
+ * International Telephone Input v18.5.3
25
+ * https://github.com/jackocnr/intl-tel-input.git
26
+ * Licensed under the MIT license
27
+ */
28
+
29
+ var hasRequiredIntlTelInput$1;
30
+
31
+ function requireIntlTelInput$1 () {
32
+ if (hasRequiredIntlTelInput$1) return intlTelInput$1.exports;
33
+ hasRequiredIntlTelInput$1 = 1;
34
+ (function (module) {
35
+ // wrap in UMD
36
+ (function(factory) {
37
+ if (module.exports) module.exports = factory(); else window.intlTelInput = factory();
38
+ })(function(undefined$1) {
39
+ return function() {
40
+ // Array of country objects for the flag dropdown.
41
+ // Here is the criteria for the plugin to support a given country/territory
42
+ // - It has an iso2 code: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
43
+ // - It has it's own country calling code (it is not a sub-region of another country): https://en.wikipedia.org/wiki/List_of_country_calling_codes
44
+ // - It has a flag in the region-flags project: https://github.com/behdad/region-flags/tree/gh-pages/png
45
+ // - It is supported by libphonenumber (it must be listed on this page): https://github.com/googlei18n/libphonenumber/blob/master/resources/ShortNumberMetadata.xml
46
+ // Each country array has the following information:
47
+ // [
48
+ // Country name,
49
+ // iso2 code,
50
+ // International dial code,
51
+ // Order (if >1 country with same dial code),
52
+ // Area codes
53
+ // ]
54
+ var allCountries = [ [ "Afghanistan", "af", "93" ], [ "Albania", "al", "355" ], [ "Algeria", "dz", "213" ], [ "American Samoa", "as", "1", 5, [ "684" ] ], [ "Andorra", "ad", "376" ], [ "Angola", "ao", "244" ], [ "Anguilla", "ai", "1", 6, [ "264" ] ], [ "Antigua & Barbuda", "ag", "1", 7, [ "268" ] ], [ "Argentina", "ar", "54" ], [ "Armenia", "am", "374" ], [ "Aruba", "aw", "297" ], [ "Ascension Island", "ac", "247" ], [ "Australia", "au", "61", 0 ], [ "Austria", "at", "43" ], [ "Azerbaijan", "az", "994" ], [ "Bahamas", "bs", "1", 8, [ "242" ] ], [ "Bahrain", "bh", "973" ], [ "Bangladesh", "bd", "880" ], [ "Barbados", "bb", "1", 9, [ "246" ] ], [ "Belarus", "by", "375" ], [ "Belgium", "be", "32" ], [ "Belize", "bz", "501" ], [ "Benin", "bj", "229" ], [ "Bermuda", "bm", "1", 10, [ "441" ] ], [ "Bhutan", "bt", "975" ], [ "Bolivia", "bo", "591" ], [ "Bosnia & Herzegovina", "ba", "387" ], [ "Botswana", "bw", "267" ], [ "Brazil", "br", "55" ], [ "British Indian Ocean Territory", "io", "246" ], [ "British Virgin Islands", "vg", "1", 11, [ "284" ] ], [ "Brunei", "bn", "673" ], [ "Bulgaria", "bg", "359" ], [ "Burkina Faso", "bf", "226" ], [ "Burundi", "bi", "257" ], [ "Cambodia", "kh", "855" ], [ "Cameroon", "cm", "237" ], [ "Canada", "ca", "1", 1, [ "204", "226", "236", "249", "250", "263", "289", "306", "343", "354", "365", "367", "368", "382", "387", "403", "416", "418", "428", "431", "437", "438", "450", "584", "468", "474", "506", "514", "519", "548", "579", "581", "584", "587", "604", "613", "639", "647", "672", "683", "705", "709", "742", "753", "778", "780", "782", "807", "819", "825", "867", "873", "902", "905" ] ], [ "Cape Verde", "cv", "238" ], [ "Caribbean Netherlands", "bq", "599", 1, [ "3", "4", "7" ] ], [ "Cayman Islands", "ky", "1", 12, [ "345" ] ], [ "Central African Republic", "cf", "236" ], [ "Chad", "td", "235" ], [ "Chile", "cl", "56" ], [ "China", "cn", "86" ], [ "Christmas Island", "cx", "61", 2, [ "89164" ] ], [ "Cocos (Keeling) Islands", "cc", "61", 1, [ "89162" ] ], [ "Colombia", "co", "57" ], [ "Comoros", "km", "269" ], [ "Congo - Brazzaville", "cg", "242" ], [ "Congo - Kinshasa", "cd", "243" ], [ "Cook Islands", "ck", "682" ], [ "Costa Rica", "cr", "506" ], [ "Côte d’Ivoire", "ci", "225" ], [ "Croatia", "hr", "385" ], [ "Cuba", "cu", "53" ], [ "Curaçao", "cw", "599", 0 ], [ "Cyprus", "cy", "357" ], [ "Czech Republic", "cz", "420" ], [ "Denmark", "dk", "45" ], [ "Djibouti", "dj", "253" ], [ "Dominica", "dm", "1", 13, [ "767" ] ], [ "Dominican Republic", "do", "1", 2, [ "809", "829", "849" ] ], [ "Ecuador", "ec", "593" ], [ "Egypt", "eg", "20" ], [ "El Salvador", "sv", "503" ], [ "Equatorial Guinea", "gq", "240" ], [ "Eritrea", "er", "291" ], [ "Estonia", "ee", "372" ], [ "Eswatini", "sz", "268" ], [ "Ethiopia", "et", "251" ], [ "Falkland Islands", "fk", "500" ], [ "Faroe Islands", "fo", "298" ], [ "Fiji", "fj", "679" ], [ "Finland", "fi", "358", 0 ], [ "France", "fr", "33" ], [ "French Guiana", "gf", "594" ], [ "French Polynesia", "pf", "689" ], [ "Gabon", "ga", "241" ], [ "Gambia", "gm", "220" ], [ "Georgia", "ge", "995" ], [ "Germany", "de", "49" ], [ "Ghana", "gh", "233" ], [ "Gibraltar", "gi", "350" ], [ "Greece", "gr", "30" ], [ "Greenland", "gl", "299" ], [ "Grenada", "gd", "1", 14, [ "473" ] ], [ "Guadeloupe", "gp", "590", 0 ], [ "Guam", "gu", "1", 15, [ "671" ] ], [ "Guatemala", "gt", "502" ], [ "Guernsey", "gg", "44", 1, [ "1481", "7781", "7839", "7911" ] ], [ "Guinea", "gn", "224" ], [ "Guinea-Bissau", "gw", "245" ], [ "Guyana", "gy", "592" ], [ "Haiti", "ht", "509" ], [ "Honduras", "hn", "504" ], [ "Hong Kong", "hk", "852" ], [ "Hungary", "hu", "36" ], [ "Iceland", "is", "354" ], [ "India", "in", "91" ], [ "Indonesia", "id", "62" ], [ "Iran", "ir", "98" ], [ "Iraq", "iq", "964" ], [ "Ireland", "ie", "353" ], [ "Isle of Man", "im", "44", 2, [ "1624", "74576", "7524", "7924", "7624" ] ], [ "Israel", "il", "972" ], [ "Italy", "it", "39", 0 ], [ "Jamaica", "jm", "1", 4, [ "876", "658" ] ], [ "Japan", "jp", "81" ], [ "Jersey", "je", "44", 3, [ "1534", "7509", "7700", "7797", "7829", "7937" ] ], [ "Jordan", "jo", "962" ], [ "Kazakhstan", "kz", "7", 1, [ "33", "7" ] ], [ "Kenya", "ke", "254" ], [ "Kiribati", "ki", "686" ], [ "Kosovo", "xk", "383" ], [ "Kuwait", "kw", "965" ], [ "Kyrgyzstan", "kg", "996" ], [ "Laos", "la", "856" ], [ "Latvia", "lv", "371" ], [ "Lebanon", "lb", "961" ], [ "Lesotho", "ls", "266" ], [ "Liberia", "lr", "231" ], [ "Libya", "ly", "218" ], [ "Liechtenstein", "li", "423" ], [ "Lithuania", "lt", "370" ], [ "Luxembourg", "lu", "352" ], [ "Macau", "mo", "853" ], [ "Madagascar", "mg", "261" ], [ "Malawi", "mw", "265" ], [ "Malaysia", "my", "60" ], [ "Maldives", "mv", "960" ], [ "Mali", "ml", "223" ], [ "Malta", "mt", "356" ], [ "Marshall Islands", "mh", "692" ], [ "Martinique", "mq", "596" ], [ "Mauritania", "mr", "222" ], [ "Mauritius", "mu", "230" ], [ "Mayotte", "yt", "262", 1, [ "269", "639" ] ], [ "Mexico", "mx", "52" ], [ "Micronesia", "fm", "691" ], [ "Moldova", "md", "373" ], [ "Monaco", "mc", "377" ], [ "Mongolia", "mn", "976" ], [ "Montenegro", "me", "382" ], [ "Montserrat", "ms", "1", 16, [ "664" ] ], [ "Morocco", "ma", "212", 0 ], [ "Mozambique", "mz", "258" ], [ "Myanmar (Burma)", "mm", "95" ], [ "Namibia", "na", "264" ], [ "Nauru", "nr", "674" ], [ "Nepal", "np", "977" ], [ "Netherlands", "nl", "31" ], [ "New Caledonia", "nc", "687" ], [ "New Zealand", "nz", "64" ], [ "Nicaragua", "ni", "505" ], [ "Niger", "ne", "227" ], [ "Nigeria", "ng", "234" ], [ "Niue", "nu", "683" ], [ "Norfolk Island", "nf", "672" ], [ "North Korea", "kp", "850" ], [ "North Macedonia", "mk", "389" ], [ "Northern Mariana Islands", "mp", "1", 17, [ "670" ] ], [ "Norway", "no", "47", 0 ], [ "Oman", "om", "968" ], [ "Pakistan", "pk", "92" ], [ "Palau", "pw", "680" ], [ "Palestine", "ps", "970" ], [ "Panama", "pa", "507" ], [ "Papua New Guinea", "pg", "675" ], [ "Paraguay", "py", "595" ], [ "Peru", "pe", "51" ], [ "Philippines", "ph", "63" ], [ "Poland", "pl", "48" ], [ "Portugal", "pt", "351" ], [ "Puerto Rico", "pr", "1", 3, [ "787", "939" ] ], [ "Qatar", "qa", "974" ], [ "Réunion", "re", "262", 0 ], [ "Romania", "ro", "40" ], [ "Russia", "ru", "7", 0 ], [ "Rwanda", "rw", "250" ], [ "Samoa", "ws", "685" ], [ "San Marino", "sm", "378" ], [ "São Tomé & Príncipe", "st", "239" ], [ "Saudi Arabia", "sa", "966" ], [ "Senegal", "sn", "221" ], [ "Serbia", "rs", "381" ], [ "Seychelles", "sc", "248" ], [ "Sierra Leone", "sl", "232" ], [ "Singapore", "sg", "65" ], [ "Sint Maarten", "sx", "1", 21, [ "721" ] ], [ "Slovakia", "sk", "421" ], [ "Slovenia", "si", "386" ], [ "Solomon Islands", "sb", "677" ], [ "Somalia", "so", "252" ], [ "South Africa", "za", "27" ], [ "South Korea", "kr", "82" ], [ "South Sudan", "ss", "211" ], [ "Spain", "es", "34" ], [ "Sri Lanka", "lk", "94" ], [ "St Barthélemy", "bl", "590", 1 ], [ "St Helena", "sh", "290" ], [ "St Kitts & Nevis", "kn", "1", 18, [ "869" ] ], [ "St Lucia", "lc", "1", 19, [ "758" ] ], [ "St Martin", "mf", "590", 2 ], [ "St Pierre & Miquelon", "pm", "508" ], [ "St Vincent & Grenadines", "vc", "1", 20, [ "784" ] ], [ "Sudan", "sd", "249" ], [ "Suriname", "sr", "597" ], [ "Svalbard & Jan Mayen", "sj", "47", 1, [ "79" ] ], [ "Sweden", "se", "46" ], [ "Switzerland", "ch", "41" ], [ "Syria", "sy", "963" ], [ "Taiwan", "tw", "886" ], [ "Tajikistan", "tj", "992" ], [ "Tanzania", "tz", "255" ], [ "Thailand", "th", "66" ], [ "Timor-Leste", "tl", "670" ], [ "Togo", "tg", "228" ], [ "Tokelau", "tk", "690" ], [ "Tonga", "to", "676" ], [ "Trinidad & Tobago", "tt", "1", 22, [ "868" ] ], [ "Tunisia", "tn", "216" ], [ "Turkey", "tr", "90" ], [ "Turkmenistan", "tm", "993" ], [ "Turks & Caicos Islands", "tc", "1", 23, [ "649" ] ], [ "Tuvalu", "tv", "688" ], [ "Uganda", "ug", "256" ], [ "Ukraine", "ua", "380" ], [ "United Arab Emirates", "ae", "971" ], [ "United Kingdom", "gb", "44", 0 ], [ "United States", "us", "1", 0 ], [ "Uruguay", "uy", "598" ], [ "US Virgin Islands", "vi", "1", 24, [ "340" ] ], [ "Uzbekistan", "uz", "998" ], [ "Vanuatu", "vu", "678" ], [ "Vatican City", "va", "39", 1, [ "06698" ] ], [ "Venezuela", "ve", "58" ], [ "Vietnam", "vn", "84" ], [ "Wallis & Futuna", "wf", "681" ], [ "Western Sahara", "eh", "212", 1, [ "5288", "5289" ] ], [ "Yemen", "ye", "967" ], [ "Zambia", "zm", "260" ], [ "Zimbabwe", "zw", "263" ], [ "Åland Islands", "ax", "358", 1, [ "18" ] ] ];
55
+ // loop over all of the countries above, restructuring the data to be objects with named keys
56
+ for (var i = 0; i < allCountries.length; i++) {
57
+ var c = allCountries[i];
58
+ allCountries[i] = {
59
+ name: c[0],
60
+ iso2: c[1],
61
+ dialCode: c[2],
62
+ priority: c[3] || 0,
63
+ areaCodes: c[4] || null
64
+ };
65
+ }
66
+ function _objectSpread(target) {
67
+ for (var i = 1; i < arguments.length; i++) {
68
+ var source = arguments[i] != null ? Object(arguments[i]) : {};
69
+ var ownKeys = Object.keys(source);
70
+ if (typeof Object.getOwnPropertySymbols === "function") {
71
+ ownKeys.push.apply(ownKeys, Object.getOwnPropertySymbols(source).filter(function(sym) {
72
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
73
+ }));
74
+ }
75
+ ownKeys.forEach(function(key) {
76
+ _defineProperty(target, key, source[key]);
77
+ });
78
+ }
79
+ return target;
80
+ }
81
+ function _defineProperty(obj, key, value) {
82
+ key = _toPropertyKey(key);
83
+ if (key in obj) {
84
+ Object.defineProperty(obj, key, {
85
+ value: value,
86
+ enumerable: true,
87
+ configurable: true,
88
+ writable: true
89
+ });
90
+ } else {
91
+ obj[key] = value;
92
+ }
93
+ return obj;
94
+ }
95
+ function _classCallCheck(instance, Constructor) {
96
+ if (!(instance instanceof Constructor)) {
97
+ throw new TypeError("Cannot call a class as a function");
98
+ }
99
+ }
100
+ function _defineProperties(target, props) {
101
+ for (var i = 0; i < props.length; i++) {
102
+ var descriptor = props[i];
103
+ descriptor.enumerable = descriptor.enumerable || false;
104
+ descriptor.configurable = true;
105
+ if ("value" in descriptor) descriptor.writable = true;
106
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
107
+ }
108
+ }
109
+ function _createClass(Constructor, protoProps, staticProps) {
110
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
111
+ Object.defineProperty(Constructor, "prototype", {
112
+ writable: false
113
+ });
114
+ return Constructor;
115
+ }
116
+ function _toPropertyKey(arg) {
117
+ var key = _toPrimitive(arg, "string");
118
+ return typeof key === "symbol" ? key : String(key);
119
+ }
120
+ function _toPrimitive(input, hint) {
121
+ if (typeof input !== "object" || input === null) return input;
122
+ var prim = input[Symbol.toPrimitive];
123
+ if (prim !== undefined$1) {
124
+ var res = prim.call(input, hint);
125
+ if (typeof res !== "object") return res;
126
+ throw new TypeError("@@toPrimitive must return a primitive value.");
127
+ }
128
+ return (String )(input);
129
+ }
130
+ var intlTelInputGlobals = {
131
+ getInstance: function getInstance(input) {
132
+ var id = input.getAttribute("data-intl-tel-input-id");
133
+ return window.intlTelInputGlobals.instances[id];
134
+ },
135
+ instances: {},
136
+ // using a global like this allows us to mock it in the tests
137
+ documentReady: function documentReady() {
138
+ return document.readyState === "complete";
139
+ }
140
+ };
141
+ if (typeof window === "object") {
142
+ window.intlTelInputGlobals = intlTelInputGlobals;
143
+ }
144
+ // these vars persist through all instances of the plugin
145
+ var id = 0;
146
+ var defaults = {
147
+ // whether or not to allow the dropdown
148
+ allowDropdown: true,
149
+ // auto insert dial code (A) on init, (B) on user selecting a country, (C) on calling setCountry
150
+ // also listen for blur/submit and auto remove dial code if that's all there is
151
+ autoInsertDialCode: false,
152
+ // add a placeholder in the input with an example number for the selected country
153
+ autoPlaceholder: "polite",
154
+ // add a country search input at the top of the dropdown
155
+ countrySearch: false,
156
+ // modify the parentClass
157
+ customContainer: "",
158
+ // modify the auto placeholder
159
+ customPlaceholder: null,
160
+ // append menu to specified element
161
+ dropdownContainer: null,
162
+ // don't display these countries
163
+ excludeCountries: [],
164
+ // fix the dropdown width to the input width (rather than being as wide as the longest country name)
165
+ fixDropdownWidth: false,
166
+ // format the input value during initialisation and on setNumber
167
+ formatOnDisplay: true,
168
+ // geoIp lookup function
169
+ geoIpLookup: null,
170
+ // inject a hidden input with this name, and on submit, populate it with the result of getNumber
171
+ hiddenInput: "",
172
+ // initial country
173
+ initialCountry: "",
174
+ // localized country names e.g. { 'de': 'Deutschland' }
175
+ localizedCountries: null,
176
+ // national vs international formatting for numbers e.g. placeholders and displaying existing numbers
177
+ nationalMode: true,
178
+ // display only these countries
179
+ onlyCountries: [],
180
+ // number type to use for placeholders
181
+ placeholderNumberType: "MOBILE",
182
+ // the countries at the top of the list. defaults to united states and united kingdom
183
+ preferredCountries: [ "us", "gb" ],
184
+ // display the country dial code next to the selected flag
185
+ separateDialCode: false,
186
+ // option to hide the flags - must be used with separateDialCode, or allowDropdown=false
187
+ showFlags: true,
188
+ // use full screen popup instead of dropdown for country list
189
+ useFullscreenPopup: typeof navigator !== "undefined" && typeof window !== "undefined" ? // we cannot just test screen size as some smartphones/website meta tags will report desktop
190
+ // resolutions
191
+ // Note: to target Android Mobiles (and not Tablets), we must find 'Android' and 'Mobile'
192
+ /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 500 : false,
193
+ // specify the path to the libphonenumber script to enable validation/formatting
194
+ utilsScript: ""
195
+ };
196
+ // https://en.wikipedia.org/wiki/List_of_North_American_Numbering_Plan_area_codes#Non-geographic_area_codes
197
+ var regionlessNanpNumbers = [ "800", "822", "833", "844", "855", "866", "877", "880", "881", "882", "883", "884", "885", "886", "887", "888", "889" ];
198
+ // utility function to iterate over an object. can't use Object.entries or native forEach because
199
+ // of IE11
200
+ var forEachProp = function forEachProp(obj, callback) {
201
+ var keys = Object.keys(obj);
202
+ for (var i = 0; i < keys.length; i++) {
203
+ callback(keys[i], obj[keys[i]]);
204
+ }
205
+ };
206
+ // run a method on each instance of the plugin
207
+ var forEachInstance = function forEachInstance(method) {
208
+ forEachProp(window.intlTelInputGlobals.instances, function(key) {
209
+ window.intlTelInputGlobals.instances[key][method]();
210
+ });
211
+ };
212
+ // this is our plugin class that we will create an instance of
213
+ // eslint-disable-next-line no-unused-vars
214
+ var Iti = /*#__PURE__*/ function() {
215
+ function Iti(input, options) {
216
+ var _this = this;
217
+ _classCallCheck(this, Iti);
218
+ this.id = id++;
219
+ this.telInput = input;
220
+ this.activeItem = null;
221
+ this.highlightedItem = null;
222
+ // process specified options / defaults
223
+ // alternative to Object.assign, which isn't supported by IE11
224
+ var customOptions = options || {};
225
+ this.options = {};
226
+ forEachProp(defaults, function(key, value) {
227
+ _this.options[key] = customOptions.hasOwnProperty(key) ? customOptions[key] : value;
228
+ });
229
+ this.hadInitialPlaceholder = Boolean(input.getAttribute("placeholder"));
230
+ }
231
+ _createClass(Iti, [ {
232
+ key: "_init",
233
+ value: function _init() {
234
+ var _this2 = this;
235
+ // if showing fullscreen popup, do not fix the width
236
+ if (this.options.useFullscreenPopup) {
237
+ this.options.fixDropdownWidth = false;
238
+ }
239
+ // when search enabled, we must fix the width else it would change with different results
240
+ if (this.options.countrySearch && !this.options.useFullscreenPopup) {
241
+ this.options.fixDropdownWidth = true;
242
+ }
243
+ // if in nationalMode, do not insert dial codes
244
+ if (this.options.nationalMode) {
245
+ this.options.autoInsertDialCode = false;
246
+ }
247
+ // if separateDialCode enabled, do not insert dial codes
248
+ if (this.options.separateDialCode) {
249
+ this.options.autoInsertDialCode = false;
250
+ }
251
+ // force showFlags=true if there's a dropdown and we're not displaying the dial code,
252
+ // as otherwise you just have a down arrow on it's own which doesn't make sense
253
+ var forceShowFlags = this.options.allowDropdown && !this.options.separateDialCode;
254
+ if (!this.options.showFlags && forceShowFlags) {
255
+ this.options.showFlags = true;
256
+ }
257
+ // on mobile, we want a full screen dropdown, so we must append it to the body
258
+ if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
259
+ this.options.dropdownContainer = document.body;
260
+ }
261
+ // check if input has one parent with RTL
262
+ this.isRTL = !!this.telInput.closest("[dir=rtl]");
263
+ // these promises get resolved when their individual requests complete
264
+ // this way the dev can do something like iti.promise.then(...) to know when all requests are
265
+ // complete
266
+ if (typeof Promise !== "undefined") {
267
+ var autoCountryPromise = new Promise(function(resolve, reject) {
268
+ _this2.resolveAutoCountryPromise = resolve;
269
+ _this2.rejectAutoCountryPromise = reject;
270
+ });
271
+ var utilsScriptPromise = new Promise(function(resolve, reject) {
272
+ _this2.resolveUtilsScriptPromise = resolve;
273
+ _this2.rejectUtilsScriptPromise = reject;
274
+ });
275
+ this.promise = Promise.all([ autoCountryPromise, utilsScriptPromise ]);
276
+ } else {
277
+ // prevent errors when Promise doesn't exist
278
+ this.resolveAutoCountryPromise = this.rejectAutoCountryPromise = function() {};
279
+ this.resolveUtilsScriptPromise = this.rejectUtilsScriptPromise = function() {};
280
+ }
281
+ // in various situations there could be no country selected initially, but we need to be able
282
+ // to assume this variable exists
283
+ this.selectedCountryData = {};
284
+ // process all the data: onlyCountries, excludeCountries, preferredCountries etc
285
+ this._processCountryData();
286
+ // generate the markup
287
+ this._generateMarkup();
288
+ // set the initial state of the input value and the selected flag
289
+ this._setInitialState();
290
+ // start all of the event listeners: autoInsertDialCode, input keydown, selectedFlag click
291
+ this._initListeners();
292
+ // utils script, and auto country
293
+ this._initRequests();
294
+ }
295
+ }, {
296
+ key: "_processCountryData",
297
+ value: function _processCountryData() {
298
+ // process onlyCountries or excludeCountries array if present
299
+ this._processAllCountries();
300
+ // process the countryCodes map
301
+ this._processCountryCodes();
302
+ // process the preferredCountries
303
+ this._processPreferredCountries();
304
+ // translate countries according to localizedCountries option
305
+ if (this.options.localizedCountries) {
306
+ this._translateCountriesByLocale();
307
+ }
308
+ // sort countries by name
309
+ if (this.options.onlyCountries.length || this.options.localizedCountries) {
310
+ this.countries.sort(this._countryNameSort);
311
+ }
312
+ }
313
+ }, {
314
+ key: "_addCountryCode",
315
+ value: function _addCountryCode(iso2, countryCode, priority) {
316
+ if (countryCode.length > this.countryCodeMaxLen) {
317
+ this.countryCodeMaxLen = countryCode.length;
318
+ }
319
+ if (!this.countryCodes.hasOwnProperty(countryCode)) {
320
+ this.countryCodes[countryCode] = [];
321
+ }
322
+ // bail if we already have this country for this countryCode
323
+ for (var i = 0; i < this.countryCodes[countryCode].length; i++) {
324
+ if (this.countryCodes[countryCode][i] === iso2) {
325
+ return;
326
+ }
327
+ }
328
+ // check for undefined as 0 is falsy
329
+ var index = priority !== undefined$1 ? priority : this.countryCodes[countryCode].length;
330
+ this.countryCodes[countryCode][index] = iso2;
331
+ }
332
+ }, {
333
+ key: "_processAllCountries",
334
+ value: function _processAllCountries() {
335
+ if (this.options.onlyCountries.length) {
336
+ var lowerCaseOnlyCountries = this.options.onlyCountries.map(function(country) {
337
+ return country.toLowerCase();
338
+ });
339
+ this.countries = allCountries.filter(function(country) {
340
+ return lowerCaseOnlyCountries.indexOf(country.iso2) > -1;
341
+ });
342
+ } else if (this.options.excludeCountries.length) {
343
+ var lowerCaseExcludeCountries = this.options.excludeCountries.map(function(country) {
344
+ return country.toLowerCase();
345
+ });
346
+ this.countries = allCountries.filter(function(country) {
347
+ return lowerCaseExcludeCountries.indexOf(country.iso2) === -1;
348
+ });
349
+ } else {
350
+ this.countries = allCountries;
351
+ }
352
+ }
353
+ }, {
354
+ key: "_translateCountriesByLocale",
355
+ value: function _translateCountriesByLocale() {
356
+ for (var i = 0; i < this.countries.length; i++) {
357
+ var iso = this.countries[i].iso2.toLowerCase();
358
+ if (this.options.localizedCountries.hasOwnProperty(iso)) {
359
+ this.countries[i].name = this.options.localizedCountries[iso];
360
+ }
361
+ }
362
+ }
363
+ }, {
364
+ key: "_countryNameSort",
365
+ value: function _countryNameSort(a, b) {
366
+ if (a.name < b.name) {
367
+ return -1;
368
+ }
369
+ if (a.name > b.name) {
370
+ return 1;
371
+ }
372
+ return 0;
373
+ }
374
+ }, {
375
+ key: "_processCountryCodes",
376
+ value: function _processCountryCodes() {
377
+ this.countryCodeMaxLen = 0;
378
+ // here we store just dial codes
379
+ this.dialCodes = {};
380
+ // here we store "country codes" (both dial codes and their area codes)
381
+ this.countryCodes = {};
382
+ // first: add dial codes
383
+ for (var i = 0; i < this.countries.length; i++) {
384
+ var c = this.countries[i];
385
+ if (!this.dialCodes[c.dialCode]) {
386
+ this.dialCodes[c.dialCode] = true;
387
+ }
388
+ this._addCountryCode(c.iso2, c.dialCode, c.priority);
389
+ }
390
+ // next: add area codes
391
+ // this is a second loop over countries, to make sure we have all of the "root" countries
392
+ // already in the map, so that we can access them, as each time we add an area code substring
393
+ // to the map, we also need to include the "root" country's code, as that also matches
394
+ for (var _i = 0; _i < this.countries.length; _i++) {
395
+ var _c = this.countries[_i];
396
+ // area codes
397
+ if (_c.areaCodes) {
398
+ var rootCountryCode = this.countryCodes[_c.dialCode][0];
399
+ // for each area code
400
+ for (var j = 0; j < _c.areaCodes.length; j++) {
401
+ var areaCode = _c.areaCodes[j];
402
+ // for each digit in the area code to add all partial matches as well
403
+ for (var k = 1; k < areaCode.length; k++) {
404
+ var partialDialCode = _c.dialCode + areaCode.substr(0, k);
405
+ // start with the root country, as that also matches this dial code
406
+ this._addCountryCode(rootCountryCode, partialDialCode);
407
+ this._addCountryCode(_c.iso2, partialDialCode);
408
+ }
409
+ // add the full area code
410
+ this._addCountryCode(_c.iso2, _c.dialCode + areaCode);
411
+ }
412
+ }
413
+ }
414
+ }
415
+ }, {
416
+ key: "_processPreferredCountries",
417
+ value: function _processPreferredCountries() {
418
+ this.preferredCountries = [];
419
+ for (var i = 0; i < this.options.preferredCountries.length; i++) {
420
+ var countryCode = this.options.preferredCountries[i].toLowerCase();
421
+ var countryData = this._getCountryData(countryCode, false, true);
422
+ if (countryData) {
423
+ this.preferredCountries.push(countryData);
424
+ }
425
+ }
426
+ }
427
+ }, {
428
+ key: "_createEl",
429
+ value: function _createEl(name, attrs, container) {
430
+ var el = document.createElement(name);
431
+ if (attrs) {
432
+ forEachProp(attrs, function(key, value) {
433
+ return el.setAttribute(key, value);
434
+ });
435
+ }
436
+ if (container) {
437
+ container.appendChild(el);
438
+ }
439
+ return el;
440
+ }
441
+ }, {
442
+ key: "_generateMarkup",
443
+ value: function _generateMarkup() {
444
+ this.telInput.classList.add("iti__tel-input");
445
+ // if autocomplete does not exist on the element and its form, then
446
+ // prevent autocomplete as there's no safe, cross-browser event we can react to, so it can
447
+ // easily put the plugin in an inconsistent state e.g. the wrong flag selected for the
448
+ // autocompleted number, which on submit could mean wrong number is saved
449
+ if (!this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete"))) {
450
+ this.telInput.setAttribute("autocomplete", "off");
451
+ }
452
+ var _this$options = this.options, allowDropdown = _this$options.allowDropdown, separateDialCode = _this$options.separateDialCode, showFlags = _this$options.showFlags, customContainer = _this$options.customContainer, hiddenInput = _this$options.hiddenInput, dropdownContainer = _this$options.dropdownContainer, fixDropdownWidth = _this$options.fixDropdownWidth, useFullscreenPopup = _this$options.useFullscreenPopup, countrySearch = _this$options.countrySearch;
453
+ // containers (mostly for positioning)
454
+ var parentClass = "iti";
455
+ if (allowDropdown) {
456
+ parentClass += " iti--allow-dropdown";
457
+ }
458
+ if (separateDialCode) {
459
+ parentClass += " iti--separate-dial-code";
460
+ }
461
+ if (showFlags) {
462
+ parentClass += " iti--show-flags";
463
+ }
464
+ if (customContainer) {
465
+ parentClass += " ".concat(customContainer);
466
+ }
467
+ var wrapper = this._createEl("div", {
468
+ "class": parentClass
469
+ });
470
+ this.telInput.parentNode.insertBefore(wrapper, this.telInput);
471
+ // only hide the flagsContainer if allowDropdown, showFlags and separateDialCode are all false
472
+ var showFlagsContainer = allowDropdown || showFlags || separateDialCode;
473
+ if (showFlagsContainer) {
474
+ this.flagsContainer = this._createEl("div", {
475
+ "class": "iti__flag-container"
476
+ }, wrapper);
477
+ }
478
+ wrapper.appendChild(this.telInput);
479
+ // selected flag (displayed to left of input)
480
+ // using Aria tags for "Select-Only Combobox Example"
481
+ // https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
482
+ if (showFlagsContainer) {
483
+ this.selectedFlag = this._createEl("div", _objectSpread({
484
+ "class": "iti__selected-flag"
485
+ }, allowDropdown && {
486
+ role: "combobox",
487
+ "aria-haspopup": "listbox",
488
+ "aria-controls": "iti-".concat(this.id, "__country-listbox"),
489
+ "aria-expanded": "false",
490
+ "aria-label": "Telephone country code"
491
+ }), this.flagsContainer);
492
+ }
493
+ if (showFlags) {
494
+ this.selectedFlagInner = this._createEl("div", {
495
+ "class": "iti__flag"
496
+ }, this.selectedFlag);
497
+ }
498
+ if (this.selectedFlag && this.telInput.disabled) {
499
+ this.selectedFlag.setAttribute("aria-disabled", "true");
500
+ }
501
+ if (separateDialCode) {
502
+ this.selectedDialCode = this._createEl("div", {
503
+ "class": "iti__selected-dial-code"
504
+ }, this.selectedFlag);
505
+ }
506
+ if (allowDropdown) {
507
+ if (!this.telInput.disabled) {
508
+ // make element focusable and tab navigable
509
+ this.selectedFlag.setAttribute("tabindex", "0");
510
+ }
511
+ this.dropdownArrow = this._createEl("div", {
512
+ "class": "iti__arrow"
513
+ }, this.selectedFlag);
514
+ var extraClasses = fixDropdownWidth ? "" : "iti--flexible-dropdown-width";
515
+ this.dropdownContent = this._createEl("div", {
516
+ "class": "iti__dropdown-content iti__hide ".concat(extraClasses)
517
+ });
518
+ if (countrySearch) {
519
+ this.searchInput = this._createEl("input", {
520
+ type: "text",
521
+ "class": "iti__search-input",
522
+ placeholder: "Search"
523
+ }, this.dropdownContent);
524
+ }
525
+ // country list: preferred countries, then divider, then all countries
526
+ this.countryList = this._createEl("ul", {
527
+ "class": "iti__country-list",
528
+ id: "iti-".concat(this.id, "__country-listbox"),
529
+ role: "listbox",
530
+ "aria-label": "List of countries"
531
+ }, this.dropdownContent);
532
+ if (this.preferredCountries.length && !countrySearch) {
533
+ this._appendListItems(this.preferredCountries, "iti__preferred", true);
534
+ this._createEl("li", {
535
+ "class": "iti__divider",
536
+ "aria-hidden": "true"
537
+ }, this.countryList);
538
+ }
539
+ this._appendListItems(this.countries, "iti__standard");
540
+ // create dropdownContainer markup
541
+ if (dropdownContainer) {
542
+ var dropdownClasses = "iti iti--container";
543
+ if (useFullscreenPopup) {
544
+ dropdownClasses += " iti--fullscreen-popup";
545
+ }
546
+ if (countrySearch) {
547
+ dropdownClasses += " iti--country-search";
548
+ }
549
+ this.dropdown = this._createEl("div", {
550
+ "class": dropdownClasses
551
+ });
552
+ this.dropdown.appendChild(this.dropdownContent);
553
+ } else {
554
+ this.flagsContainer.appendChild(this.dropdownContent);
555
+ }
556
+ }
557
+ if (hiddenInput) {
558
+ var hiddenInputName = hiddenInput;
559
+ var name = this.telInput.getAttribute("name");
560
+ if (name) {
561
+ var i = name.lastIndexOf("[");
562
+ // if input name contains square brackets, then give the hidden input the same name,
563
+ // replacing the contents of the last set of brackets with the given hiddenInput name
564
+ if (i !== -1) {
565
+ hiddenInputName = "".concat(name.substr(0, i), "[").concat(hiddenInputName, "]");
566
+ }
567
+ }
568
+ this.hiddenInput = this._createEl("input", {
569
+ type: "hidden",
570
+ name: hiddenInputName
571
+ });
572
+ wrapper.appendChild(this.hiddenInput);
573
+ }
574
+ }
575
+ }, {
576
+ key: "_appendListItems",
577
+ value: function _appendListItems(countries, className, preferred) {
578
+ for (var i = 0; i < countries.length; i++) {
579
+ var c = countries[i];
580
+ var idSuffix = preferred ? "-preferred" : "";
581
+ var listItem = this._createEl("li", {
582
+ id: "iti-".concat(this.id, "__item-").concat(c.iso2).concat(idSuffix),
583
+ "class": "iti__country ".concat(className),
584
+ tabindex: "-1",
585
+ role: "option",
586
+ "data-dial-code": c.dialCode,
587
+ "data-country-code": c.iso2,
588
+ "aria-selected": "false"
589
+ }, this.countryList);
590
+ // store this for later use e.g. country search filtering
591
+ c.node = listItem;
592
+ var content = "";
593
+ // add the flag
594
+ if (this.options.showFlags) {
595
+ content += "<div class='iti__flag-box'><div class='iti__flag iti__".concat(c.iso2, "'></div></div>");
596
+ }
597
+ // and the country name and dial code
598
+ content += "<span class='iti__country-name'>".concat(c.name, "</span>");
599
+ content += "<span class='iti__dial-code'>+".concat(c.dialCode, "</span>");
600
+ listItem.insertAdjacentHTML("beforeend", content);
601
+ }
602
+ }
603
+ }, {
604
+ key: "_setInitialState",
605
+ value: function _setInitialState() {
606
+ // fix firefox bug: when first load page (with input with value set to number with intl dial
607
+ // code) and initialising plugin removes the dial code from the input, then refresh page,
608
+ // and we try to init plugin again but this time on number without dial code so get grey flag
609
+ var attributeValue = this.telInput.getAttribute("value");
610
+ var inputValue = this.telInput.value;
611
+ var useAttribute = attributeValue && attributeValue.charAt(0) === "+" && (!inputValue || inputValue.charAt(0) !== "+");
612
+ var val = useAttribute ? attributeValue : inputValue;
613
+ var dialCode = this._getDialCode(val);
614
+ var isRegionlessNanp = this._isRegionlessNanp(val);
615
+ var _this$options2 = this.options, initialCountry = _this$options2.initialCountry, autoInsertDialCode = _this$options2.autoInsertDialCode;
616
+ // if we already have a dial code, and it's not a regionlessNanp, we can go ahead and set the
617
+ // flag, else fall back to the default country
618
+ if (dialCode && !isRegionlessNanp) {
619
+ this._updateFlagFromNumber(val);
620
+ } else if (initialCountry !== "auto") {
621
+ var isValidInitialCountry = initialCountry && this._getCountryData(initialCountry, false, true);
622
+ // see if we should select a flag
623
+ if (isValidInitialCountry) {
624
+ this._setFlag(initialCountry.toLowerCase());
625
+ } else {
626
+ if (dialCode && isRegionlessNanp) {
627
+ // has intl dial code, is regionless nanp, and no initialCountry, so default to US
628
+ this._setFlag("us");
629
+ } else {
630
+ // no dial code and no initialCountry, so default to first in list
631
+ this.defaultCountry = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.countries[0].iso2;
632
+ if (!val) {
633
+ this._setFlag(this.defaultCountry);
634
+ }
635
+ }
636
+ }
637
+ // if empty and autoInsertDialCode then insert the dial code
638
+ if (!val && autoInsertDialCode) {
639
+ this.telInput.value = "+".concat(this.selectedCountryData.dialCode);
640
+ }
641
+ }
642
+ // NOTE: if initialCountry is set to auto, that will be handled separately
643
+ // format - note this wont be run after _updateDialCode as that's only called if no val
644
+ if (val) {
645
+ this._updateValFromNumber(val);
646
+ }
647
+ }
648
+ }, {
649
+ key: "_initListeners",
650
+ value: function _initListeners() {
651
+ this._initKeyListeners();
652
+ if (this.options.autoInsertDialCode) {
653
+ this._initBlurListeners();
654
+ }
655
+ if (this.options.allowDropdown) {
656
+ this._initDropdownListeners();
657
+ }
658
+ if (this.hiddenInput) {
659
+ this._initHiddenInputListener();
660
+ }
661
+ }
662
+ }, {
663
+ key: "_initHiddenInputListener",
664
+ value: function _initHiddenInputListener() {
665
+ var _this3 = this;
666
+ this._handleHiddenInputSubmit = function() {
667
+ _this3.hiddenInput.value = _this3.getNumber();
668
+ };
669
+ if (this.telInput.form) {
670
+ this.telInput.form.addEventListener("submit", this._handleHiddenInputSubmit);
671
+ }
672
+ }
673
+ }, {
674
+ key: "_getClosestLabel",
675
+ value: function _getClosestLabel() {
676
+ var el = this.telInput;
677
+ while (el && el.tagName !== "LABEL") {
678
+ el = el.parentNode;
679
+ }
680
+ return el;
681
+ }
682
+ }, {
683
+ key: "_initDropdownListeners",
684
+ value: function _initDropdownListeners() {
685
+ var _this4 = this;
686
+ // hack for input nested inside label (which is valid markup): clicking the selected-flag to
687
+ // open the dropdown would then automatically trigger a 2nd click on the input which would
688
+ // close it again
689
+ this._handleLabelClick = function(e) {
690
+ // if the dropdown is closed, then focus the input, else ignore the click
691
+ if (_this4.dropdownContent.classList.contains("iti__hide")) {
692
+ _this4.telInput.focus();
693
+ } else {
694
+ e.preventDefault();
695
+ }
696
+ };
697
+ var label = this._getClosestLabel();
698
+ if (label) {
699
+ label.addEventListener("click", this._handleLabelClick);
700
+ }
701
+ // toggle country dropdown on click
702
+ this._handleClickSelectedFlag = function() {
703
+ // only intercept this event if we're opening the dropdown
704
+ // else let it bubble up to the top ("click-off-to-close" listener)
705
+ // we cannot just stopPropagation as it may be needed to close another instance
706
+ if (_this4.dropdownContent.classList.contains("iti__hide") && !_this4.telInput.disabled && !_this4.telInput.readOnly) {
707
+ _this4._showDropdown();
708
+ }
709
+ };
710
+ this.selectedFlag.addEventListener("click", this._handleClickSelectedFlag);
711
+ // open dropdown if selected flag is focused and they press up/down/space/enter
712
+ this._handleFlagsContainerKeydown = function(e) {
713
+ var isDropdownHidden = _this4.dropdownContent.classList.contains("iti__hide");
714
+ if (isDropdownHidden && [ "ArrowUp", "ArrowDown", " ", "Enter" ].includes(e.key)) {
715
+ // prevent form from being submitted if "ENTER" was pressed
716
+ e.preventDefault();
717
+ // prevent event from being handled again by document
718
+ e.stopPropagation();
719
+ _this4._showDropdown();
720
+ }
721
+ // allow navigation from dropdown to input on TAB
722
+ if (e.key === "Tab") {
723
+ _this4._closeDropdown();
724
+ }
725
+ };
726
+ this.flagsContainer.addEventListener("keydown", this._handleFlagsContainerKeydown);
727
+ }
728
+ }, {
729
+ key: "_initRequests",
730
+ value: function _initRequests() {
731
+ var _this5 = this;
732
+ // if the user has specified the path to the utils script, fetch it on window.load, else resolve
733
+ if (this.options.utilsScript && !window.intlTelInputUtils) {
734
+ // if the plugin is being initialised after the window.load event has already been fired
735
+ if (window.intlTelInputGlobals.documentReady()) {
736
+ window.intlTelInputGlobals.loadUtils(this.options.utilsScript);
737
+ } else {
738
+ // wait until the load event so we don't block any other requests e.g. the flags image
739
+ window.addEventListener("load", function() {
740
+ window.intlTelInputGlobals.loadUtils(_this5.options.utilsScript);
741
+ });
742
+ }
743
+ } else {
744
+ this.resolveUtilsScriptPromise();
745
+ }
746
+ if (this.options.initialCountry === "auto") {
747
+ this._loadAutoCountry();
748
+ } else {
749
+ this.resolveAutoCountryPromise();
750
+ }
751
+ }
752
+ }, {
753
+ key: "_loadAutoCountry",
754
+ value: function _loadAutoCountry() {
755
+ // 3 options:
756
+ // 1) already loaded (we're done)
757
+ // 2) not already started loading (start)
758
+ // 3) already started loading (do nothing - just wait for loading callback to fire)
759
+ if (window.intlTelInputGlobals.autoCountry) {
760
+ this.handleAutoCountry();
761
+ } else if (!window.intlTelInputGlobals.startedLoadingAutoCountry) {
762
+ // don't do this twice!
763
+ window.intlTelInputGlobals.startedLoadingAutoCountry = true;
764
+ if (typeof this.options.geoIpLookup === "function") {
765
+ this.options.geoIpLookup(function(countryCode) {
766
+ window.intlTelInputGlobals.autoCountry = countryCode.toLowerCase();
767
+ // tell all instances the auto country is ready
768
+ // TODO: this should just be the current instances
769
+ // UPDATE: use setTimeout in case their geoIpLookup function calls this callback straight
770
+ // away (e.g. if they have already done the geo ip lookup somewhere else). Using
771
+ // setTimeout means that the current thread of execution will finish before executing
772
+ // this, which allows the plugin to finish initialising.
773
+ setTimeout(function() {
774
+ return forEachInstance("handleAutoCountry");
775
+ });
776
+ }, function() {
777
+ return forEachInstance("rejectAutoCountryPromise");
778
+ });
779
+ }
780
+ }
781
+ }
782
+ }, {
783
+ key: "_initKeyListeners",
784
+ value: function _initKeyListeners() {
785
+ var _this6 = this;
786
+ // update flag on keyup
787
+ this._handleKeyupEvent = function() {
788
+ if (_this6._updateFlagFromNumber(_this6.telInput.value)) {
789
+ _this6._triggerCountryChange();
790
+ }
791
+ };
792
+ this.telInput.addEventListener("keyup", this._handleKeyupEvent);
793
+ // update flag on cut/paste events (now supported in all major browsers)
794
+ this._handleClipboardEvent = function() {
795
+ // hack because "paste" event is fired before input is updated
796
+ setTimeout(_this6._handleKeyupEvent);
797
+ };
798
+ this.telInput.addEventListener("cut", this._handleClipboardEvent);
799
+ this.telInput.addEventListener("paste", this._handleClipboardEvent);
800
+ }
801
+ }, {
802
+ key: "_cap",
803
+ value: function _cap(number) {
804
+ var max = this.telInput.getAttribute("maxlength");
805
+ return max && number.length > max ? number.substr(0, max) : number;
806
+ }
807
+ }, {
808
+ key: "_initBlurListeners",
809
+ value: function _initBlurListeners() {
810
+ var _this7 = this;
811
+ // on blur or form submit: if just a dial code then remove it
812
+ this._handleSubmitOrBlurEvent = function() {
813
+ _this7._removeEmptyDialCode();
814
+ };
815
+ if (this.telInput.form) {
816
+ this.telInput.form.addEventListener("submit", this._handleSubmitOrBlurEvent);
817
+ }
818
+ this.telInput.addEventListener("blur", this._handleSubmitOrBlurEvent);
819
+ }
820
+ }, {
821
+ key: "_removeEmptyDialCode",
822
+ value: function _removeEmptyDialCode() {
823
+ if (this.telInput.value.charAt(0) === "+") {
824
+ var numeric = this._getNumeric(this.telInput.value);
825
+ // if just a plus, or if just a dial code
826
+ if (!numeric || this.selectedCountryData.dialCode === numeric) {
827
+ this.telInput.value = "";
828
+ }
829
+ }
830
+ }
831
+ }, {
832
+ key: "_getNumeric",
833
+ value: function _getNumeric(s) {
834
+ return s.replace(/\D/g, "");
835
+ }
836
+ }, {
837
+ key: "_trigger",
838
+ value: function _trigger(name) {
839
+ // have to use old school document.createEvent as IE11 doesn't support `new Event()` syntax
840
+ var e = document.createEvent("Event");
841
+ e.initEvent(name, true, true);
842
+ // can bubble, and is cancellable
843
+ this.telInput.dispatchEvent(e);
844
+ }
845
+ }, {
846
+ key: "_showDropdown",
847
+ value: function _showDropdown() {
848
+ if (this.options.fixDropdownWidth) {
849
+ this.dropdownContent.style.width = "".concat(this.telInput.offsetWidth, "px");
850
+ }
851
+ this.dropdownContent.classList.remove("iti__hide");
852
+ this.selectedFlag.setAttribute("aria-expanded", "true");
853
+ this._setDropdownPosition();
854
+ if (this.options.countrySearch) {
855
+ // start by highlighting the first item in the list
856
+ this._highlightListItem(this.countryList.firstElementChild, false);
857
+ this.searchInput.focus();
858
+ } else if (this.activeItem) {
859
+ // update highlighting and scroll to active list item
860
+ this._highlightListItem(this.activeItem, false);
861
+ this._scrollTo(this.activeItem, true);
862
+ }
863
+ // bind all the dropdown-related listeners: mouseover, click, click-off, keydown
864
+ this._bindDropdownListeners();
865
+ // update the arrow
866
+ this.dropdownArrow.classList.add("iti__arrow--up");
867
+ this._trigger("open:countrydropdown");
868
+ }
869
+ }, {
870
+ key: "_toggleClass",
871
+ value: function _toggleClass(el, className, shouldHaveClass) {
872
+ if (shouldHaveClass && !el.classList.contains(className)) {
873
+ el.classList.add(className);
874
+ } else if (!shouldHaveClass && el.classList.contains(className)) {
875
+ el.classList.remove(className);
876
+ }
877
+ }
878
+ }, {
879
+ key: "_setDropdownPosition",
880
+ value: function _setDropdownPosition() {
881
+ var _this8 = this;
882
+ if (this.options.dropdownContainer) {
883
+ this.options.dropdownContainer.appendChild(this.dropdown);
884
+ }
885
+ if (!this.options.useFullscreenPopup) {
886
+ var pos = this.telInput.getBoundingClientRect();
887
+ // windowTop from https://stackoverflow.com/a/14384091/217866
888
+ var windowTop = window.pageYOffset || document.documentElement.scrollTop;
889
+ var inputTop = pos.top + windowTop;
890
+ var dropdownHeight = this.dropdownContent.offsetHeight;
891
+ // dropdownFitsBelow = (dropdownBottom < windowBottom)
892
+ var dropdownFitsBelow = inputTop + this.telInput.offsetHeight + dropdownHeight < windowTop + window.innerHeight;
893
+ var dropdownFitsAbove = inputTop - dropdownHeight > windowTop;
894
+ // dont allow positioning above when country search enabled as the search box jumps around as you filter countries
895
+ var positionDropdownAboveInput = !this.options.countrySearch && !dropdownFitsBelow && dropdownFitsAbove;
896
+ // by default, the dropdown will be below the input. If we want to position it above the
897
+ // input, we add the dropup class.
898
+ this._toggleClass(this.dropdownContent, "iti__dropdown-content--dropup", positionDropdownAboveInput);
899
+ // if dropdownContainer is enabled, calculate postion
900
+ if (this.options.dropdownContainer) {
901
+ // by default the dropdown will be directly over the input because it's not in the flow.
902
+ // If we want to position it below, we need to add some extra top value.
903
+ var extraTop = positionDropdownAboveInput ? 0 : this.telInput.offsetHeight;
904
+ // calculate placement
905
+ this.dropdown.style.top = "".concat(inputTop + extraTop, "px");
906
+ this.dropdown.style.left = "".concat(pos.left + document.body.scrollLeft, "px");
907
+ // close menu on window scroll
908
+ this._handleWindowScroll = function() {
909
+ return _this8._closeDropdown();
910
+ };
911
+ window.addEventListener("scroll", this._handleWindowScroll);
912
+ }
913
+ }
914
+ }
915
+ }, {
916
+ key: "_getClosestListItem",
917
+ value: function _getClosestListItem(target) {
918
+ var el = target;
919
+ while (el && el !== this.countryList && !el.classList.contains("iti__country")) {
920
+ el = el.parentNode;
921
+ }
922
+ // if we reached the countryList element, then return null
923
+ return el === this.countryList ? null : el;
924
+ }
925
+ }, {
926
+ key: "_bindDropdownListeners",
927
+ value: function _bindDropdownListeners() {
928
+ var _this9 = this;
929
+ // when mouse over a list item, just highlight that one
930
+ // we add the class "highlight", so if they hit "enter" we know which one to select
931
+ this._handleMouseoverCountryList = function(e) {
932
+ // handle event delegation, as we're listening for this event on the countryList
933
+ var listItem = _this9._getClosestListItem(e.target);
934
+ if (listItem) {
935
+ _this9._highlightListItem(listItem, false);
936
+ }
937
+ };
938
+ this.countryList.addEventListener("mouseover", this._handleMouseoverCountryList);
939
+ // listen for country selection
940
+ this._handleClickCountryList = function(e) {
941
+ var listItem = _this9._getClosestListItem(e.target);
942
+ if (listItem) {
943
+ _this9._selectListItem(listItem);
944
+ }
945
+ };
946
+ this.countryList.addEventListener("click", this._handleClickCountryList);
947
+ // click off to close
948
+ // (except when this initial opening click is bubbling up)
949
+ // we cannot just stopPropagation as it may be needed to close another instance
950
+ var isOpening = true;
951
+ this._handleClickOffToClose = function() {
952
+ if (!isOpening) {
953
+ _this9._closeDropdown();
954
+ }
955
+ isOpening = false;
956
+ };
957
+ document.documentElement.addEventListener("click", this._handleClickOffToClose);
958
+ // listen for up/down scrolling, enter to select, or escape to close
959
+ // use keydown as keypress doesn't fire for non-char keys and we want to catch if they
960
+ // just hit down and hold it to scroll down (no keyup event).
961
+ // listen on the document because that's where key events are triggered if no input has focus
962
+ var query = "";
963
+ var queryTimer = null;
964
+ this._handleKeydownOnDropdown = function(e) {
965
+ // prevent down key from scrolling the whole page,
966
+ // and enter key from submitting a form etc
967
+ if ([ "ArrowUp", "ArrowDown", "Enter", "Escape" ].includes(e.key)) {
968
+ e.preventDefault();
969
+ e.stopPropagation();
970
+ // up and down to navigate
971
+ if (e.key === "ArrowUp" || e.key === "ArrowDown") {
972
+ _this9._handleUpDownKey(e.key);
973
+ } else if (e.key === "Enter") {
974
+ _this9._handleEnterKey();
975
+ } else if (e.key === "Escape") {
976
+ _this9._closeDropdown();
977
+ }
978
+ }
979
+ // alpha chars to perform search
980
+ // regex allows one latin alpha char or space, based on https://stackoverflow.com/a/26900132/217866)
981
+ if (!_this9.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(e.key)) {
982
+ e.stopPropagation();
983
+ // jump to countries that start with the query string
984
+ if (queryTimer) {
985
+ clearTimeout(queryTimer);
986
+ }
987
+ query += e.key.toLowerCase();
988
+ _this9._searchForCountry(query);
989
+ // if the timer hits 1 second, reset the query
990
+ queryTimer = setTimeout(function() {
991
+ query = "";
992
+ }, 1e3);
993
+ }
994
+ };
995
+ document.addEventListener("keydown", this._handleKeydownOnDropdown);
996
+ if (this.options.countrySearch) {
997
+ var doFilter = function doFilter() {
998
+ var inputQuery = _this9.searchInput.value.trim();
999
+ if (inputQuery) {
1000
+ _this9._filterCountries(inputQuery.toLowerCase());
1001
+ } else {
1002
+ _this9._filterCountries(null, true);
1003
+ }
1004
+ };
1005
+ var keyupTimer = null;
1006
+ this._handleSearchChange = function() {
1007
+ // filtering country nodes is expensive (lots of DOM manipulation), so rate limit it
1008
+ if (keyupTimer) {
1009
+ clearTimeout(keyupTimer);
1010
+ }
1011
+ keyupTimer = setTimeout(function() {
1012
+ doFilter();
1013
+ keyupTimer = null;
1014
+ }, 100);
1015
+ };
1016
+ this.searchInput.addEventListener("input", this._handleSearchChange);
1017
+ // stop propagation on search input click, so doesn't trigger click-off-to-close listener
1018
+ this.searchInput.addEventListener("click", function(e) {
1019
+ return e.stopPropagation();
1020
+ });
1021
+ }
1022
+ }
1023
+ }, {
1024
+ key: "_filterCountries",
1025
+ value: function _filterCountries(query) {
1026
+ var isReset = arguments.length > 1 && arguments[1] !== undefined$1 ? arguments[1] : false;
1027
+ var isFirst = true;
1028
+ this.countryList.innerHTML = "";
1029
+ for (var i = 0; i < this.countries.length; i++) {
1030
+ var c = this.countries[i];
1031
+ var nameLower = c.name.toLowerCase();
1032
+ var fullDialCode = "+".concat(c.dialCode);
1033
+ if (isReset || nameLower.includes(query) || fullDialCode.includes(query)) {
1034
+ this.countryList.appendChild(c.node);
1035
+ // highlight the first item
1036
+ if (isFirst) {
1037
+ this._highlightListItem(c.node, false);
1038
+ isFirst = false;
1039
+ }
1040
+ }
1041
+ }
1042
+ }
1043
+ }, {
1044
+ key: "_handleUpDownKey",
1045
+ value: function _handleUpDownKey(key) {
1046
+ var next = key === "ArrowUp" ? this.highlightedItem.previousElementSibling : this.highlightedItem.nextElementSibling;
1047
+ if (next) {
1048
+ // skip the divider
1049
+ if (next.classList.contains("iti__divider")) {
1050
+ next = key === "ArrowUp" ? next.previousElementSibling : next.nextElementSibling;
1051
+ }
1052
+ } else if (this.countryList.childElementCount > 1) {
1053
+ // otherwise, we must be at the end, so loop round again
1054
+ next = key === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild;
1055
+ }
1056
+ if (next) {
1057
+ // if country search enabled, dont lose focus from the search input on up/down
1058
+ var doFocus = !this.options.countrySearch;
1059
+ this._highlightListItem(next, doFocus);
1060
+ if (this.options.countrySearch) {
1061
+ this._scrollTo(next, false);
1062
+ }
1063
+ }
1064
+ }
1065
+ }, {
1066
+ key: "_handleEnterKey",
1067
+ value: function _handleEnterKey() {
1068
+ if (this.highlightedItem) {
1069
+ this._selectListItem(this.highlightedItem);
1070
+ }
1071
+ }
1072
+ }, {
1073
+ key: "_searchForCountry",
1074
+ value: function _searchForCountry(query) {
1075
+ for (var i = 0; i < this.countries.length; i++) {
1076
+ if (this._startsWith(this.countries[i].name, query)) {
1077
+ var listItem = this.countries[i].node;
1078
+ // update highlighting and scroll
1079
+ this._highlightListItem(listItem, false);
1080
+ this._scrollTo(listItem, true);
1081
+ break;
1082
+ }
1083
+ }
1084
+ }
1085
+ }, {
1086
+ key: "_startsWith",
1087
+ value: function _startsWith(a, b) {
1088
+ return a.substr(0, b.length).toLowerCase() === b;
1089
+ }
1090
+ }, {
1091
+ key: "_updateValFromNumber",
1092
+ value: function _updateValFromNumber(fullNumber) {
1093
+ var number = fullNumber;
1094
+ if (this.options.formatOnDisplay && window.intlTelInputUtils && this.selectedCountryData) {
1095
+ var useNational = this.options.nationalMode || number.charAt(0) !== "+" && !this.options.separateDialCode;
1096
+ var _intlTelInputUtils$nu = intlTelInputUtils.numberFormat, NATIONAL = _intlTelInputUtils$nu.NATIONAL, INTERNATIONAL = _intlTelInputUtils$nu.INTERNATIONAL;
1097
+ var format = useNational ? NATIONAL : INTERNATIONAL;
1098
+ number = intlTelInputUtils.formatNumber(number, this.selectedCountryData.iso2, format);
1099
+ }
1100
+ number = this._beforeSetNumber(number);
1101
+ this.telInput.value = number;
1102
+ }
1103
+ }, {
1104
+ key: "_updateFlagFromNumber",
1105
+ value: function _updateFlagFromNumber(fullNumber) {
1106
+ var plusIndex = fullNumber.indexOf("+");
1107
+ // if it contains a plus, discard any chars before it e.g. accidental space char.
1108
+ // this keeps the selected country auto-updating correctly, which we want as
1109
+ // libphonenumber's validation/getNumber methods will ignore these chars anyway
1110
+ var number = plusIndex ? fullNumber.substring(plusIndex) : fullNumber;
1111
+ // if we already have US/Canada selected, make sure the number starts
1112
+ // with a +1 so _getDialCode will be able to extract the area code
1113
+ // update: if we dont yet have selectedCountryData, but we're here (trying to update the flag
1114
+ // from the number), that means we're initialising the plugin with a number that already has a
1115
+ // dial code, so fine to ignore this bit
1116
+ var selectedDialCode = this.selectedCountryData.dialCode;
1117
+ var isNanp = selectedDialCode === "1";
1118
+ if (number && isNanp && number.charAt(0) !== "+") {
1119
+ if (number.charAt(0) !== "1") {
1120
+ number = "1".concat(number);
1121
+ }
1122
+ number = "+".concat(number);
1123
+ }
1124
+ // if separateDialCode enabled, then consider the selected dial code to be part of the number
1125
+ if (this.options.separateDialCode && selectedDialCode && number.charAt(0) !== "+") {
1126
+ number = "+".concat(selectedDialCode).concat(number);
1127
+ }
1128
+ // try and extract valid dial code from input
1129
+ var dialCode = this._getDialCode(number, true);
1130
+ var numeric = this._getNumeric(number);
1131
+ var countryCode = null;
1132
+ if (dialCode) {
1133
+ var countryCodes = this.countryCodes[this._getNumeric(dialCode)];
1134
+ // check if the right country is already selected. this should be false if the number is
1135
+ // longer than the matched dial code because in this case we need to make sure that if
1136
+ // there are multiple country matches, that the first one is selected (note: we could
1137
+ // just check that here, but it requires the same loop that we already have later)
1138
+ var alreadySelected = countryCodes.indexOf(this.selectedCountryData.iso2) !== -1 && numeric.length <= dialCode.length - 1;
1139
+ var isRegionlessNanpNumber = selectedDialCode === "1" && this._isRegionlessNanp(numeric);
1140
+ // only update the flag if:
1141
+ // A) NOT (we currently have a NANP flag selected, and the number is a regionlessNanp)
1142
+ // AND
1143
+ // B) the right country is not already selected
1144
+ if (!isRegionlessNanpNumber && !alreadySelected) {
1145
+ // if using onlyCountries option, countryCodes[0] may be empty, so we must find the first
1146
+ // non-empty index
1147
+ for (var j = 0; j < countryCodes.length; j++) {
1148
+ if (countryCodes[j]) {
1149
+ countryCode = countryCodes[j];
1150
+ break;
1151
+ }
1152
+ }
1153
+ }
1154
+ } else if (number.charAt(0) === "+" && numeric.length) {
1155
+ // invalid dial code, so empty
1156
+ // Note: use getNumeric here because the number has not been formatted yet, so could contain
1157
+ // bad chars
1158
+ countryCode = "";
1159
+ } else if (!number || number === "+") {
1160
+ // empty, or just a plus, so default
1161
+ countryCode = this.defaultCountry;
1162
+ }
1163
+ if (countryCode !== null) {
1164
+ return this._setFlag(countryCode);
1165
+ }
1166
+ return false;
1167
+ }
1168
+ }, {
1169
+ key: "_isRegionlessNanp",
1170
+ value: function _isRegionlessNanp(number) {
1171
+ var numeric = this._getNumeric(number);
1172
+ if (numeric.charAt(0) === "1") {
1173
+ var areaCode = numeric.substr(1, 3);
1174
+ return regionlessNanpNumbers.indexOf(areaCode) !== -1;
1175
+ }
1176
+ return false;
1177
+ }
1178
+ }, {
1179
+ key: "_highlightListItem",
1180
+ value: function _highlightListItem(listItem, shouldFocus) {
1181
+ var prevItem = this.highlightedItem;
1182
+ if (prevItem) {
1183
+ prevItem.classList.remove("iti__highlight");
1184
+ }
1185
+ this.highlightedItem = listItem;
1186
+ this.highlightedItem.classList.add("iti__highlight");
1187
+ this.selectedFlag.setAttribute("aria-activedescendant", listItem.getAttribute("id"));
1188
+ if (shouldFocus) {
1189
+ this.highlightedItem.focus();
1190
+ }
1191
+ }
1192
+ }, {
1193
+ key: "_getCountryData",
1194
+ value: function _getCountryData(countryCode, ignoreOnlyCountriesOption, allowFail) {
1195
+ var countryList = ignoreOnlyCountriesOption ? allCountries : this.countries;
1196
+ for (var i = 0; i < countryList.length; i++) {
1197
+ if (countryList[i].iso2 === countryCode) {
1198
+ return countryList[i];
1199
+ }
1200
+ }
1201
+ if (allowFail) {
1202
+ return null;
1203
+ }
1204
+ throw new Error("No country data for '".concat(countryCode, "'"));
1205
+ }
1206
+ }, {
1207
+ key: "_setFlag",
1208
+ value: function _setFlag(countryCode) {
1209
+ var _this$options3 = this.options, allowDropdown = _this$options3.allowDropdown, separateDialCode = _this$options3.separateDialCode, showFlags = _this$options3.showFlags;
1210
+ var prevCountry = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
1211
+ // do this first as it will throw an error and stop if countryCode is invalid
1212
+ this.selectedCountryData = countryCode ? this._getCountryData(countryCode, false, false) : {};
1213
+ // update the defaultCountry - we only need the iso2 from now on, so just store that
1214
+ if (this.selectedCountryData.iso2) {
1215
+ this.defaultCountry = this.selectedCountryData.iso2;
1216
+ }
1217
+ if (showFlags) {
1218
+ this.selectedFlagInner.setAttribute("class", "iti__flag iti__".concat(countryCode));
1219
+ }
1220
+ this._setSelectedCountryFlagTitleAttribute(countryCode, separateDialCode);
1221
+ if (separateDialCode) {
1222
+ var dialCode = this.selectedCountryData.dialCode ? "+".concat(this.selectedCountryData.dialCode) : "";
1223
+ this.selectedDialCode.innerHTML = dialCode;
1224
+ // offsetWidth is zero if input is in a hidden container during initialisation
1225
+ var selectedFlagWidth = this.selectedFlag.offsetWidth || this._getHiddenSelectedFlagWidth();
1226
+ // add 6px of padding after the grey selected-dial-code box, as this is what we use in the css
1227
+ if (this.isRTL) {
1228
+ this.telInput.style.paddingRight = "".concat(selectedFlagWidth + 6, "px");
1229
+ } else {
1230
+ this.telInput.style.paddingLeft = "".concat(selectedFlagWidth + 6, "px");
1231
+ }
1232
+ }
1233
+ // and the input's placeholder
1234
+ this._updatePlaceholder();
1235
+ // update the active list item
1236
+ if (allowDropdown) {
1237
+ var prevItem = this.activeItem;
1238
+ if (prevItem) {
1239
+ prevItem.classList.remove("iti__active");
1240
+ prevItem.setAttribute("aria-selected", "false");
1241
+ }
1242
+ if (countryCode) {
1243
+ // check if there is a preferred item first, else fall back to standard
1244
+ var nextItem = this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(countryCode, "-preferred")) || this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(countryCode));
1245
+ nextItem.setAttribute("aria-selected", "true");
1246
+ nextItem.classList.add("iti__active");
1247
+ this.activeItem = nextItem;
1248
+ }
1249
+ }
1250
+ // return if the flag has changed or not
1251
+ return prevCountry.iso2 !== countryCode;
1252
+ }
1253
+ }, {
1254
+ key: "_setSelectedCountryFlagTitleAttribute",
1255
+ value: function _setSelectedCountryFlagTitleAttribute(countryCode, separateDialCode) {
1256
+ if (!this.selectedFlag) {
1257
+ return;
1258
+ }
1259
+ var title;
1260
+ if (countryCode && !separateDialCode) {
1261
+ title = "".concat(this.selectedCountryData.name, ": +").concat(this.selectedCountryData.dialCode);
1262
+ } else if (countryCode) {
1263
+ // For screen reader output, we don't want to include the dial code in the reader output twice
1264
+ // so just use the selected country name here:
1265
+ title = this.selectedCountryData.name;
1266
+ } else {
1267
+ title = "Unknown";
1268
+ }
1269
+ this.selectedFlag.setAttribute("title", title);
1270
+ }
1271
+ }, {
1272
+ key: "_getHiddenSelectedFlagWidth",
1273
+ value: function _getHiddenSelectedFlagWidth() {
1274
+ // to get the right styling to apply, all we need is a shallow clone of the container,
1275
+ // and then to inject a deep clone of the selectedFlag element
1276
+ var containerClone = this.telInput.parentNode.cloneNode();
1277
+ containerClone.style.visibility = "hidden";
1278
+ document.body.appendChild(containerClone);
1279
+ var flagsContainerClone = this.flagsContainer.cloneNode();
1280
+ containerClone.appendChild(flagsContainerClone);
1281
+ var selectedFlagClone = this.selectedFlag.cloneNode(true);
1282
+ flagsContainerClone.appendChild(selectedFlagClone);
1283
+ var width = selectedFlagClone.offsetWidth;
1284
+ containerClone.parentNode.removeChild(containerClone);
1285
+ return width;
1286
+ }
1287
+ }, {
1288
+ key: "_updatePlaceholder",
1289
+ value: function _updatePlaceholder() {
1290
+ var shouldSetPlaceholder = this.options.autoPlaceholder === "aggressive" || !this.hadInitialPlaceholder && this.options.autoPlaceholder === "polite";
1291
+ if (window.intlTelInputUtils && shouldSetPlaceholder) {
1292
+ var numberType = intlTelInputUtils.numberType[this.options.placeholderNumberType];
1293
+ var placeholder = this.selectedCountryData.iso2 ? intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2, this.options.nationalMode, numberType) : "";
1294
+ placeholder = this._beforeSetNumber(placeholder);
1295
+ if (typeof this.options.customPlaceholder === "function") {
1296
+ placeholder = this.options.customPlaceholder(placeholder, this.selectedCountryData);
1297
+ }
1298
+ this.telInput.setAttribute("placeholder", placeholder);
1299
+ }
1300
+ }
1301
+ }, {
1302
+ key: "_selectListItem",
1303
+ value: function _selectListItem(listItem) {
1304
+ // update selected flag and active list item
1305
+ var flagChanged = this._setFlag(listItem.getAttribute("data-country-code"));
1306
+ this._closeDropdown();
1307
+ this._updateDialCode(listItem.getAttribute("data-dial-code"));
1308
+ // focus the input
1309
+ this.telInput.focus();
1310
+ // put cursor at end - this fix is required for FF and IE11 (with auto inserting dial code),
1311
+ // who try to put the cursor at the beginning the first time
1312
+ var len = this.telInput.value.length;
1313
+ this.telInput.setSelectionRange(len, len);
1314
+ if (flagChanged) {
1315
+ this._triggerCountryChange();
1316
+ }
1317
+ }
1318
+ }, {
1319
+ key: "_closeDropdown",
1320
+ value: function _closeDropdown() {
1321
+ this.dropdownContent.classList.add("iti__hide");
1322
+ this.selectedFlag.setAttribute("aria-expanded", "false");
1323
+ this.selectedFlag.removeAttribute("aria-activedescendant");
1324
+ // update the arrow
1325
+ this.dropdownArrow.classList.remove("iti__arrow--up");
1326
+ // unbind key events
1327
+ document.removeEventListener("keydown", this._handleKeydownOnDropdown);
1328
+ if (this.options.countrySearch) {
1329
+ this.searchInput.removeEventListener("input", this._handleSearchChange);
1330
+ }
1331
+ document.documentElement.removeEventListener("click", this._handleClickOffToClose);
1332
+ this.countryList.removeEventListener("mouseover", this._handleMouseoverCountryList);
1333
+ this.countryList.removeEventListener("click", this._handleClickCountryList);
1334
+ // remove menu from container
1335
+ if (this.options.dropdownContainer) {
1336
+ if (!this.options.useFullscreenPopup) {
1337
+ window.removeEventListener("scroll", this._handleWindowScroll);
1338
+ }
1339
+ if (this.dropdown.parentNode) {
1340
+ this.dropdown.parentNode.removeChild(this.dropdown);
1341
+ }
1342
+ }
1343
+ this._trigger("close:countrydropdown");
1344
+ }
1345
+ }, {
1346
+ key: "_scrollTo",
1347
+ value: function _scrollTo(element, middle) {
1348
+ var container = this.dropdownContent;
1349
+ // windowTop from https://stackoverflow.com/a/14384091/217866
1350
+ var windowTop = window.pageYOffset || document.documentElement.scrollTop;
1351
+ var containerHeight = container.offsetHeight;
1352
+ var containerTop = container.getBoundingClientRect().top + windowTop;
1353
+ var containerBottom = containerTop + containerHeight;
1354
+ var elementHeight = element.offsetHeight;
1355
+ var elementTop = element.getBoundingClientRect().top + windowTop;
1356
+ var elementBottom = elementTop + elementHeight;
1357
+ var newScrollTop = elementTop - containerTop + container.scrollTop;
1358
+ var middleOffset = containerHeight / 2 - elementHeight / 2;
1359
+ if (elementTop < containerTop) {
1360
+ // scroll up
1361
+ if (middle) {
1362
+ newScrollTop -= middleOffset;
1363
+ }
1364
+ container.scrollTop = newScrollTop;
1365
+ } else if (elementBottom > containerBottom) {
1366
+ // scroll down
1367
+ if (middle) {
1368
+ newScrollTop += middleOffset;
1369
+ }
1370
+ var heightDifference = containerHeight - elementHeight;
1371
+ container.scrollTop = newScrollTop - heightDifference;
1372
+ }
1373
+ }
1374
+ }, {
1375
+ key: "_updateDialCode",
1376
+ value: function _updateDialCode(newDialCodeBare) {
1377
+ var inputVal = this.telInput.value;
1378
+ // save having to pass this every time
1379
+ var newDialCode = "+".concat(newDialCodeBare);
1380
+ var newNumber;
1381
+ if (inputVal.charAt(0) === "+") {
1382
+ // there's a plus so we're dealing with a replacement
1383
+ var prevDialCode = this._getDialCode(inputVal);
1384
+ if (prevDialCode) {
1385
+ // current number contains a valid dial code, so replace it
1386
+ newNumber = inputVal.replace(prevDialCode, newDialCode);
1387
+ } else {
1388
+ // current number contains an invalid dial code, so ditch it
1389
+ // (no way to determine where the invalid dial code ends and the rest of the number begins)
1390
+ newNumber = newDialCode;
1391
+ }
1392
+ this.telInput.value = newNumber;
1393
+ } else if (this.options.autoInsertDialCode) {
1394
+ if (inputVal) {
1395
+ // there is an existing value with no dial code: prefix the new dial code
1396
+ newNumber = newDialCode + inputVal;
1397
+ } else {
1398
+ newNumber = newDialCode;
1399
+ }
1400
+ this.telInput.value = newNumber;
1401
+ }
1402
+ }
1403
+ }, {
1404
+ key: "_getDialCode",
1405
+ value: function _getDialCode(number, includeAreaCode) {
1406
+ var dialCode = "";
1407
+ // only interested in international numbers (starting with a plus)
1408
+ if (number.charAt(0) === "+") {
1409
+ var numericChars = "";
1410
+ // iterate over chars
1411
+ for (var i = 0; i < number.length; i++) {
1412
+ var c = number.charAt(i);
1413
+ // if char is number (https://stackoverflow.com/a/8935649/217866)
1414
+ if (!isNaN(parseInt(c, 10))) {
1415
+ numericChars += c;
1416
+ // if current numericChars make a valid dial code
1417
+ if (includeAreaCode) {
1418
+ if (this.countryCodes[numericChars]) {
1419
+ // store the actual raw string (useful for matching later)
1420
+ dialCode = number.substr(0, i + 1);
1421
+ }
1422
+ } else {
1423
+ if (this.dialCodes[numericChars]) {
1424
+ dialCode = number.substr(0, i + 1);
1425
+ // if we're just looking for a dial code, we can break as soon as we find one
1426
+ break;
1427
+ }
1428
+ }
1429
+ // stop searching as soon as we can - in this case when we hit max len
1430
+ if (numericChars.length === this.countryCodeMaxLen) {
1431
+ break;
1432
+ }
1433
+ }
1434
+ }
1435
+ }
1436
+ return dialCode;
1437
+ }
1438
+ }, {
1439
+ key: "_getFullNumber",
1440
+ value: function _getFullNumber() {
1441
+ var val = this.telInput.value.trim();
1442
+ var dialCode = this.selectedCountryData.dialCode;
1443
+ var prefix;
1444
+ var numericVal = this._getNumeric(val);
1445
+ if (this.options.separateDialCode && val.charAt(0) !== "+" && dialCode && numericVal) {
1446
+ // when using separateDialCode, it is visible so is effectively part of the typed number
1447
+ prefix = "+".concat(dialCode);
1448
+ } else {
1449
+ prefix = "";
1450
+ }
1451
+ return prefix + val;
1452
+ }
1453
+ }, {
1454
+ key: "_beforeSetNumber",
1455
+ value: function _beforeSetNumber(fullNumber) {
1456
+ var number = fullNumber;
1457
+ if (this.options.separateDialCode) {
1458
+ var dialCode = this._getDialCode(number);
1459
+ // if there is a valid dial code
1460
+ if (dialCode) {
1461
+ // in case _getDialCode returned an area code as well
1462
+ dialCode = "+".concat(this.selectedCountryData.dialCode);
1463
+ // a lot of numbers will have a space separating the dial code and the main number, and
1464
+ // some NANP numbers will have a hyphen e.g. +1 684-733-1234 - in both cases we want to get
1465
+ // rid of it
1466
+ // NOTE: don't just trim all non-numerics as may want to preserve an open parenthesis etc
1467
+ var start = number[dialCode.length] === " " || number[dialCode.length] === "-" ? dialCode.length + 1 : dialCode.length;
1468
+ number = number.substr(start);
1469
+ }
1470
+ }
1471
+ return this._cap(number);
1472
+ }
1473
+ }, {
1474
+ key: "_triggerCountryChange",
1475
+ value: function _triggerCountryChange() {
1476
+ this._trigger("countrychange");
1477
+ }
1478
+ }, {
1479
+ key: "handleAutoCountry",
1480
+ value: function handleAutoCountry() {
1481
+ if (this.options.initialCountry === "auto") {
1482
+ // we must set this even if there is an initial val in the input: in case the initial val is
1483
+ // invalid and they delete it - they should see their auto country
1484
+ this.defaultCountry = window.intlTelInputGlobals.autoCountry;
1485
+ // if there's no initial value in the input, then update the flag
1486
+ if (!this.telInput.value) {
1487
+ this.setCountry(this.defaultCountry);
1488
+ }
1489
+ this.resolveAutoCountryPromise();
1490
+ }
1491
+ }
1492
+ }, {
1493
+ key: "handleUtils",
1494
+ value: function handleUtils() {
1495
+ // if the request was successful
1496
+ if (window.intlTelInputUtils) {
1497
+ // if there's an initial value in the input, then format it
1498
+ if (this.telInput.value) {
1499
+ this._updateValFromNumber(this.telInput.value);
1500
+ }
1501
+ this._updatePlaceholder();
1502
+ }
1503
+ this.resolveUtilsScriptPromise();
1504
+ }
1505
+ }, {
1506
+ key: "destroy",
1507
+ value: function destroy() {
1508
+ var form = this.telInput.form;
1509
+ if (this.options.allowDropdown) {
1510
+ // make sure the dropdown is closed (and unbind listeners)
1511
+ this._closeDropdown();
1512
+ this.selectedFlag.removeEventListener("click", this._handleClickSelectedFlag);
1513
+ this.flagsContainer.removeEventListener("keydown", this._handleFlagsContainerKeydown);
1514
+ // label click hack
1515
+ var label = this._getClosestLabel();
1516
+ if (label) {
1517
+ label.removeEventListener("click", this._handleLabelClick);
1518
+ }
1519
+ }
1520
+ // unbind hiddenInput listeners
1521
+ if (this.hiddenInput && form) {
1522
+ form.removeEventListener("submit", this._handleHiddenInputSubmit);
1523
+ }
1524
+ // unbind autoInsertDialCode listeners
1525
+ if (this.options.autoInsertDialCode) {
1526
+ if (form) {
1527
+ form.removeEventListener("submit", this._handleSubmitOrBlurEvent);
1528
+ }
1529
+ this.telInput.removeEventListener("blur", this._handleSubmitOrBlurEvent);
1530
+ }
1531
+ // unbind key events, and cut/paste events
1532
+ this.telInput.removeEventListener("keyup", this._handleKeyupEvent);
1533
+ this.telInput.removeEventListener("cut", this._handleClipboardEvent);
1534
+ this.telInput.removeEventListener("paste", this._handleClipboardEvent);
1535
+ // remove attribute of id instance: data-intl-tel-input-id
1536
+ this.telInput.removeAttribute("data-intl-tel-input-id");
1537
+ // remove markup (but leave the original input)
1538
+ var wrapper = this.telInput.parentNode;
1539
+ wrapper.parentNode.insertBefore(this.telInput, wrapper);
1540
+ wrapper.parentNode.removeChild(wrapper);
1541
+ delete window.intlTelInputGlobals.instances[this.id];
1542
+ }
1543
+ }, {
1544
+ key: "getExtension",
1545
+ value: function getExtension() {
1546
+ if (window.intlTelInputUtils) {
1547
+ return intlTelInputUtils.getExtension(this._getFullNumber(), this.selectedCountryData.iso2);
1548
+ }
1549
+ return "";
1550
+ }
1551
+ }, {
1552
+ key: "getNumber",
1553
+ value: function getNumber(format) {
1554
+ if (window.intlTelInputUtils) {
1555
+ var iso2 = this.selectedCountryData.iso2;
1556
+ return intlTelInputUtils.formatNumber(this._getFullNumber(), iso2, format);
1557
+ }
1558
+ return "";
1559
+ }
1560
+ }, {
1561
+ key: "getNumberType",
1562
+ value: function getNumberType() {
1563
+ if (window.intlTelInputUtils) {
1564
+ return intlTelInputUtils.getNumberType(this._getFullNumber(), this.selectedCountryData.iso2);
1565
+ }
1566
+ return -99;
1567
+ }
1568
+ }, {
1569
+ key: "getSelectedCountryData",
1570
+ value: function getSelectedCountryData() {
1571
+ return this.selectedCountryData;
1572
+ }
1573
+ }, {
1574
+ key: "getValidationError",
1575
+ value: function getValidationError() {
1576
+ if (window.intlTelInputUtils) {
1577
+ var iso2 = this.selectedCountryData.iso2;
1578
+ return intlTelInputUtils.getValidationError(this._getFullNumber(), iso2);
1579
+ }
1580
+ return -99;
1581
+ }
1582
+ }, {
1583
+ key: "isValidNumber",
1584
+ value: function isValidNumber() {
1585
+ var val = this._getFullNumber().trim();
1586
+ return window.intlTelInputUtils ? intlTelInputUtils.isValidNumber(val, this.selectedCountryData.iso2) : null;
1587
+ }
1588
+ }, {
1589
+ key: "isPossibleNumber",
1590
+ value: function isPossibleNumber() {
1591
+ var val = this._getFullNumber().trim();
1592
+ return window.intlTelInputUtils ? intlTelInputUtils.isPossibleNumber(val, this.selectedCountryData.iso2) : null;
1593
+ }
1594
+ }, {
1595
+ key: "setCountry",
1596
+ value: function setCountry(originalCountryCode) {
1597
+ var countryCode = originalCountryCode.toLowerCase();
1598
+ // check if already selected
1599
+ if (this.selectedCountryData.iso2 !== countryCode) {
1600
+ this._setFlag(countryCode);
1601
+ this._updateDialCode(this.selectedCountryData.dialCode);
1602
+ this._triggerCountryChange();
1603
+ }
1604
+ }
1605
+ }, {
1606
+ key: "setNumber",
1607
+ value: function setNumber(number) {
1608
+ // we must update the flag first, which updates this.selectedCountryData, which is used for
1609
+ // formatting the number before displaying it
1610
+ var flagChanged = this._updateFlagFromNumber(number);
1611
+ this._updateValFromNumber(number);
1612
+ if (flagChanged) {
1613
+ this._triggerCountryChange();
1614
+ }
1615
+ }
1616
+ }, {
1617
+ key: "setPlaceholderNumberType",
1618
+ value: function setPlaceholderNumberType(type) {
1619
+ this.options.placeholderNumberType = type;
1620
+ this._updatePlaceholder();
1621
+ }
1622
+ } ]);
1623
+ return Iti;
1624
+ }();
1625
+ /********************
1626
+ * STATIC METHODS
1627
+ ********************/
1628
+ // get the country data object
1629
+ intlTelInputGlobals.getCountryData = function() {
1630
+ return allCountries;
1631
+ };
1632
+ // inject a <script> element to load utils.js
1633
+ var injectScript = function injectScript(path, handleSuccess, handleFailure) {
1634
+ // inject a new script element into the page
1635
+ var script = document.createElement("script");
1636
+ script.onload = function() {
1637
+ forEachInstance("handleUtils");
1638
+ if (handleSuccess) {
1639
+ handleSuccess();
1640
+ }
1641
+ };
1642
+ script.onerror = function() {
1643
+ forEachInstance("rejectUtilsScriptPromise");
1644
+ if (handleFailure) {
1645
+ handleFailure();
1646
+ }
1647
+ };
1648
+ script.className = "iti-load-utils";
1649
+ script.async = true;
1650
+ script.src = path;
1651
+ document.body.appendChild(script);
1652
+ };
1653
+ // load the utils script
1654
+ intlTelInputGlobals.loadUtils = function(path) {
1655
+ // 2 options:
1656
+ // 1) not already started loading (start)
1657
+ // 2) already started loading (do nothing - just wait for the onload callback to fire, which will
1658
+ // trigger handleUtils on all instances, invoking their resolveUtilsScriptPromise functions)
1659
+ if (!window.intlTelInputUtils && !window.intlTelInputGlobals.startedLoadingUtilsScript) {
1660
+ // only do this once
1661
+ window.intlTelInputGlobals.startedLoadingUtilsScript = true;
1662
+ // if we have promises, then return a promise
1663
+ if (typeof Promise !== "undefined") {
1664
+ return new Promise(function(resolve, reject) {
1665
+ return injectScript(path, resolve, reject);
1666
+ });
1667
+ }
1668
+ injectScript(path);
1669
+ }
1670
+ return null;
1671
+ };
1672
+ // default options
1673
+ intlTelInputGlobals.defaults = defaults;
1674
+ // version
1675
+ intlTelInputGlobals.version = "18.5.3";
1676
+ // convenience wrapper
1677
+ return function(input, options) {
1678
+ var iti = new Iti(input, options);
1679
+ iti._init();
1680
+ input.setAttribute("data-intl-tel-input-id", iti.id);
1681
+ window.intlTelInputGlobals.instances[iti.id] = iti;
1682
+ return iti;
1683
+ };
1684
+ }();
1685
+ });
1686
+ } (intlTelInput$1));
1687
+ return intlTelInput$1.exports;
1688
+ }
1689
+
1690
+ /**
1691
+ * Exposing intl-tel-input as a component
1692
+ */
1693
+
1694
+ var intlTelInput;
1695
+ var hasRequiredIntlTelInput;
1696
+
1697
+ function requireIntlTelInput () {
1698
+ if (hasRequiredIntlTelInput) return intlTelInput;
1699
+ hasRequiredIntlTelInput = 1;
1700
+ intlTelInput = requireIntlTelInput$1();
1701
+ return intlTelInput;
1702
+ }
1703
+
1704
+ var intlTelInputExports = requireIntlTelInput();
1705
+ var index = /*@__PURE__*/getDefaultExportFromCjs(intlTelInputExports);
1706
+
1707
+ var index$1 = /*#__PURE__*/_mergeNamespaces({
1708
+ __proto__: null,
1709
+ default: index
1710
+ }, [intlTelInputExports]);
1711
+
1712
+ export { index$1 as i };