@internetarchive/elements 1.1.4-webdev-9274.0 → 1.1.6

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 (255) hide show
  1. package/README.md +33 -0
  2. package/dist/src/elements/ia-button/ia-button.d.ts.map +1 -1
  3. package/dist/src/elements/ia-button/ia-button.js +2 -2
  4. package/dist/src/elements/ia-button/ia-button.js.map +1 -1
  5. package/dist/src/elements/ia-combo-box/ia-combo-box.d.ts.map +1 -1
  6. package/dist/src/elements/ia-combo-box/ia-combo-box.js +3 -2
  7. package/dist/src/elements/ia-combo-box/ia-combo-box.js.map +1 -1
  8. package/dist/src/elements/ia-donation-form/currency-validator.d.ts +16 -0
  9. package/dist/src/elements/ia-donation-form/currency-validator.d.ts.map +1 -0
  10. package/dist/src/elements/ia-donation-form/currency-validator.js +37 -0
  11. package/dist/src/elements/ia-donation-form/currency-validator.js.map +1 -0
  12. package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.d.ts +21 -0
  13. package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.d.ts.map +1 -0
  14. package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.js +182 -0
  15. package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.js.map +1 -0
  16. package/dist/src/elements/ia-donation-form/models/donation-payment-info.d.ts +34 -0
  17. package/dist/src/elements/ia-donation-form/models/donation-payment-info.d.ts.map +1 -0
  18. package/dist/src/elements/ia-donation-form/models/donation-payment-info.js +54 -0
  19. package/dist/src/elements/ia-donation-form/models/donation-payment-info.js.map +1 -0
  20. package/dist/src/elements/ia-donation-form/models/donation-request.d.ts +62 -0
  21. package/dist/src/elements/ia-donation-form/models/donation-request.d.ts.map +1 -0
  22. package/dist/src/elements/ia-donation-form/models/donation-request.js +35 -0
  23. package/dist/src/elements/ia-donation-form/models/donation-request.js.map +1 -0
  24. package/dist/src/elements/ia-donation-form/models/donation-response.d.ts +67 -0
  25. package/dist/src/elements/ia-donation-form/models/donation-response.d.ts.map +1 -0
  26. package/dist/src/elements/ia-donation-form/models/donation-response.js +57 -0
  27. package/dist/src/elements/ia-donation-form/models/donation-response.js.map +1 -0
  28. package/dist/src/elements/ia-donation-form/models/donation-type.d.ts +8 -0
  29. package/dist/src/elements/ia-donation-form/models/donation-type.d.ts.map +1 -0
  30. package/dist/src/elements/ia-donation-form/models/donation-type.js +7 -0
  31. package/dist/src/elements/ia-donation-form/models/donation-type.js.map +1 -0
  32. package/dist/src/elements/ia-donation-form/models/donor-contact-info.d.ts +38 -0
  33. package/dist/src/elements/ia-donation-form/models/donor-contact-info.d.ts.map +1 -0
  34. package/dist/src/elements/ia-donation-form/models/donor-contact-info.js +27 -0
  35. package/dist/src/elements/ia-donation-form/models/donor-contact-info.js.map +1 -0
  36. package/dist/src/elements/ia-donation-form/models/payment-provider.d.ts +10 -0
  37. package/dist/src/elements/ia-donation-form/models/payment-provider.d.ts.map +1 -0
  38. package/dist/src/elements/ia-donation-form/models/payment-provider.js +9 -0
  39. package/dist/src/elements/ia-donation-form/models/payment-provider.js.map +1 -0
  40. package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.d.ts +2 -2
  41. package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.d.ts.map +1 -1
  42. package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js +4 -5
  43. package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js.map +1 -1
  44. package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.d.ts +4 -4
  45. package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.d.ts.map +1 -1
  46. package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.js +5 -8
  47. package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.js.map +1 -1
  48. package/dist/src/elements/ia-image-viewer/ia-image-viewer.d.ts.map +1 -1
  49. package/dist/src/elements/ia-image-viewer/ia-image-viewer.js +3 -2
  50. package/dist/src/elements/ia-image-viewer/ia-image-viewer.js.map +1 -1
  51. package/dist/src/elements/ia-image-viewer/ia-imgview-controls.d.ts.map +1 -1
  52. package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js +3 -2
  53. package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js.map +1 -1
  54. package/dist/src/elements/ia-image-viewer/ia-imgview-slide.d.ts.map +1 -1
  55. package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js +3 -2
  56. package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js.map +1 -1
  57. package/dist/src/elements/ia-otp-form/ia-otp-form.d.ts.map +1 -1
  58. package/dist/src/elements/ia-otp-form/ia-otp-form.js +3 -2
  59. package/dist/src/elements/ia-otp-form/ia-otp-form.js.map +1 -1
  60. package/dist/src/elements/ia-playback-controls/ia-playback-controls.d.ts.map +1 -1
  61. package/dist/src/elements/ia-playback-controls/ia-playback-controls.js +3 -2
  62. package/dist/src/elements/ia-playback-controls/ia-playback-controls.js.map +1 -1
  63. package/dist/src/elements/ia-radio-player/ia-radio-player.d.ts.map +1 -1
  64. package/dist/src/elements/ia-radio-player/ia-radio-player.js +3 -2
  65. package/dist/src/elements/ia-radio-player/ia-radio-player.js.map +1 -1
  66. package/dist/src/elements/ia-radio-player/ia-search-results-switcher.d.ts.map +1 -1
  67. package/dist/src/elements/ia-radio-player/ia-search-results-switcher.js +3 -2
  68. package/dist/src/elements/ia-radio-player/ia-search-results-switcher.js.map +1 -1
  69. package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.d.ts +2 -2
  70. package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.d.ts.map +1 -1
  71. package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js +4 -5
  72. package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js.map +1 -1
  73. package/dist/src/elements/ia-status-indicator/ia-status-indicator.d.ts +3 -3
  74. package/dist/src/elements/ia-status-indicator/ia-status-indicator.d.ts.map +1 -1
  75. package/dist/src/elements/ia-status-indicator/ia-status-indicator.js +7 -12
  76. package/dist/src/elements/ia-status-indicator/ia-status-indicator.js.map +1 -1
  77. package/dist/src/elements/ia-topnav/assets/img/icon-audio.d.ts +3 -0
  78. package/dist/src/elements/ia-topnav/assets/img/icon-audio.d.ts.map +1 -0
  79. package/dist/src/elements/ia-topnav/assets/img/icon-audio.js +28 -0
  80. package/dist/src/elements/ia-topnav/assets/img/icon-audio.js.map +1 -0
  81. package/dist/src/elements/ia-topnav/assets/img/icon-close.d.ts +3 -0
  82. package/dist/src/elements/ia-topnav/assets/img/icon-close.d.ts.map +1 -0
  83. package/dist/src/elements/ia-topnav/assets/img/icon-close.js +20 -0
  84. package/dist/src/elements/ia-topnav/assets/img/icon-close.js.map +1 -0
  85. package/dist/src/elements/ia-topnav/assets/img/icon-donate-unpadded.d.ts +3 -0
  86. package/dist/src/elements/ia-topnav/assets/img/icon-donate-unpadded.d.ts.map +1 -0
  87. package/dist/src/elements/ia-topnav/assets/img/icon-donate-unpadded.js +19 -0
  88. package/dist/src/elements/ia-topnav/assets/img/icon-donate-unpadded.js.map +1 -0
  89. package/dist/src/elements/ia-topnav/assets/img/icon-donate.d.ts +3 -0
  90. package/dist/src/elements/ia-topnav/assets/img/icon-donate.d.ts.map +1 -0
  91. package/dist/src/elements/ia-topnav/assets/img/icon-donate.js +18 -0
  92. package/dist/src/elements/ia-topnav/assets/img/icon-donate.js.map +1 -0
  93. package/dist/src/elements/ia-topnav/assets/img/icon-ellipses.d.ts +3 -0
  94. package/dist/src/elements/ia-topnav/assets/img/icon-ellipses.d.ts.map +1 -0
  95. package/dist/src/elements/ia-topnav/assets/img/icon-ellipses.js +19 -0
  96. package/dist/src/elements/ia-topnav/assets/img/icon-ellipses.js.map +1 -0
  97. package/dist/src/elements/ia-topnav/assets/img/icon-ia-logo.d.ts +3 -0
  98. package/dist/src/elements/ia-topnav/assets/img/icon-ia-logo.d.ts.map +1 -0
  99. package/dist/src/elements/ia-topnav/assets/img/icon-ia-logo.js +30 -0
  100. package/dist/src/elements/ia-topnav/assets/img/icon-ia-logo.js.map +1 -0
  101. package/dist/src/elements/ia-topnav/assets/img/icon-images.d.ts +3 -0
  102. package/dist/src/elements/ia-topnav/assets/img/icon-images.d.ts.map +1 -0
  103. package/dist/src/elements/ia-topnav/assets/img/icon-images.js +19 -0
  104. package/dist/src/elements/ia-topnav/assets/img/icon-images.js.map +1 -0
  105. package/dist/src/elements/ia-topnav/assets/img/icon-search.d.ts +3 -0
  106. package/dist/src/elements/ia-topnav/assets/img/icon-search.d.ts.map +1 -0
  107. package/dist/src/elements/ia-topnav/assets/img/icon-search.js +19 -0
  108. package/dist/src/elements/ia-topnav/assets/img/icon-search.js.map +1 -0
  109. package/dist/src/elements/ia-topnav/assets/img/icon-software.d.ts +3 -0
  110. package/dist/src/elements/ia-topnav/assets/img/icon-software.d.ts.map +1 -0
  111. package/dist/src/elements/ia-topnav/assets/img/icon-software.js +18 -0
  112. package/dist/src/elements/ia-topnav/assets/img/icon-software.js.map +1 -0
  113. package/dist/src/elements/ia-topnav/assets/img/icon-texts.d.ts +3 -0
  114. package/dist/src/elements/ia-topnav/assets/img/icon-texts.d.ts.map +1 -0
  115. package/dist/src/elements/ia-topnav/assets/img/icon-texts.js +18 -0
  116. package/dist/src/elements/ia-topnav/assets/img/icon-texts.js.map +1 -0
  117. package/dist/src/elements/ia-topnav/assets/img/icon-upload-unpadded.d.ts +3 -0
  118. package/dist/src/elements/ia-topnav/assets/img/icon-upload-unpadded.d.ts.map +1 -0
  119. package/dist/src/elements/ia-topnav/assets/img/icon-upload-unpadded.js +18 -0
  120. package/dist/src/elements/ia-topnav/assets/img/icon-upload-unpadded.js.map +1 -0
  121. package/dist/src/elements/ia-topnav/assets/img/icon-upload.d.ts +3 -0
  122. package/dist/src/elements/ia-topnav/assets/img/icon-upload.d.ts.map +1 -0
  123. package/dist/src/elements/ia-topnav/assets/img/icon-upload.js +21 -0
  124. package/dist/src/elements/ia-topnav/assets/img/icon-upload.js.map +1 -0
  125. package/dist/src/elements/ia-topnav/assets/img/icon-user.d.ts +3 -0
  126. package/dist/src/elements/ia-topnav/assets/img/icon-user.d.ts.map +1 -0
  127. package/dist/src/elements/ia-topnav/assets/img/icon-user.js +19 -0
  128. package/dist/src/elements/ia-topnav/assets/img/icon-user.js.map +1 -0
  129. package/dist/src/elements/ia-topnav/assets/img/icon-video.d.ts +3 -0
  130. package/dist/src/elements/ia-topnav/assets/img/icon-video.d.ts.map +1 -0
  131. package/dist/src/elements/ia-topnav/assets/img/icon-video.js +19 -0
  132. package/dist/src/elements/ia-topnav/assets/img/icon-video.js.map +1 -0
  133. package/dist/src/elements/ia-topnav/assets/img/icon-web.d.ts +3 -0
  134. package/dist/src/elements/ia-topnav/assets/img/icon-web.d.ts.map +1 -0
  135. package/dist/src/elements/ia-topnav/assets/img/icon-web.js +19 -0
  136. package/dist/src/elements/ia-topnav/assets/img/icon-web.js.map +1 -0
  137. package/dist/src/elements/ia-topnav/assets/img/icon.d.ts +6 -0
  138. package/dist/src/elements/ia-topnav/assets/img/icon.d.ts.map +1 -0
  139. package/dist/src/elements/ia-topnav/assets/img/icon.js +17 -0
  140. package/dist/src/elements/ia-topnav/assets/img/icon.js.map +1 -0
  141. package/dist/src/elements/ia-topnav/assets/img/icons.d.ts +19 -0
  142. package/dist/src/elements/ia-topnav/assets/img/icons.d.ts.map +1 -0
  143. package/dist/src/elements/ia-topnav/assets/img/icons.js +33 -0
  144. package/dist/src/elements/ia-topnav/assets/img/icons.js.map +1 -0
  145. package/dist/src/elements/ia-topnav/assets/img/wayback-logo.d.ts +3 -0
  146. package/dist/src/elements/ia-topnav/assets/img/wayback-logo.d.ts.map +1 -0
  147. package/dist/src/elements/ia-topnav/assets/img/wayback-logo.js +21 -0
  148. package/dist/src/elements/ia-topnav/assets/img/wayback-logo.js.map +1 -0
  149. package/dist/src/elements/ia-topnav/assets/img/wordmark-stacked.d.ts +3 -0
  150. package/dist/src/elements/ia-topnav/assets/img/wordmark-stacked.d.ts.map +1 -0
  151. package/dist/src/elements/ia-topnav/assets/img/wordmark-stacked.js +13 -0
  152. package/dist/src/elements/ia-topnav/assets/img/wordmark-stacked.js.map +1 -0
  153. package/dist/src/elements/ia-topnav/data/menus.d.ts +14 -0
  154. package/dist/src/elements/ia-topnav/data/menus.d.ts.map +1 -0
  155. package/dist/src/elements/ia-topnav/data/menus.js +675 -0
  156. package/dist/src/elements/ia-topnav/data/menus.js.map +1 -0
  157. package/dist/src/elements/ia-topnav/dropdown-menu.d.ts +21 -0
  158. package/dist/src/elements/ia-topnav/dropdown-menu.d.ts.map +1 -0
  159. package/dist/src/elements/ia-topnav/dropdown-menu.js +315 -0
  160. package/dist/src/elements/ia-topnav/dropdown-menu.js.map +1 -0
  161. package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.d.ts +11 -0
  162. package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.d.ts.map +1 -0
  163. package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.js +89 -0
  164. package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.js.map +1 -0
  165. package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.d.ts +6 -0
  166. package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.d.ts.map +1 -0
  167. package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.js +47 -0
  168. package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.js.map +1 -0
  169. package/dist/src/elements/ia-topnav/ia-topnav-login-button.d.ts +20 -0
  170. package/dist/src/elements/ia-topnav/ia-topnav-login-button.d.ts.map +1 -0
  171. package/dist/src/elements/ia-topnav/ia-topnav-login-button.js +183 -0
  172. package/dist/src/elements/ia-topnav/ia-topnav-login-button.js.map +1 -0
  173. package/dist/src/elements/ia-topnav/ia-topnav-media-button.d.ts +31 -0
  174. package/dist/src/elements/ia-topnav/ia-topnav-media-button.d.ts.map +1 -0
  175. package/dist/src/elements/ia-topnav/ia-topnav-media-button.js +307 -0
  176. package/dist/src/elements/ia-topnav/ia-topnav-media-button.js.map +1 -0
  177. package/dist/src/elements/ia-topnav/ia-topnav-media-menu.d.ts +21 -0
  178. package/dist/src/elements/ia-topnav/ia-topnav-media-menu.d.ts.map +1 -0
  179. package/dist/src/elements/ia-topnav/ia-topnav-media-menu.js +222 -0
  180. package/dist/src/elements/ia-topnav/ia-topnav-media-menu.js.map +1 -0
  181. package/dist/src/elements/ia-topnav/ia-topnav-media-slider.d.ts +16 -0
  182. package/dist/src/elements/ia-topnav/ia-topnav-media-slider.d.ts.map +1 -0
  183. package/dist/src/elements/ia-topnav/ia-topnav-media-slider.js +221 -0
  184. package/dist/src/elements/ia-topnav/ia-topnav-media-slider.js.map +1 -0
  185. package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.d.ts +20 -0
  186. package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.d.ts.map +1 -0
  187. package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.js +285 -0
  188. package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.js.map +1 -0
  189. package/dist/src/elements/ia-topnav/ia-topnav-more-slider.d.ts +12 -0
  190. package/dist/src/elements/ia-topnav/ia-topnav-more-slider.d.ts.map +1 -0
  191. package/dist/src/elements/ia-topnav/ia-topnav-more-slider.js +65 -0
  192. package/dist/src/elements/ia-topnav/ia-topnav-more-slider.js.map +1 -0
  193. package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.d.ts +53 -0
  194. package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.d.ts.map +1 -0
  195. package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js +653 -0
  196. package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js.map +1 -0
  197. package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.d.ts +12 -0
  198. package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.d.ts.map +1 -0
  199. package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.js +128 -0
  200. package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.js.map +1 -0
  201. package/dist/src/elements/ia-topnav/ia-topnav-signed-out-dropdown.d.ts +4 -0
  202. package/dist/src/elements/ia-topnav/ia-topnav-signed-out-dropdown.d.ts.map +1 -0
  203. package/dist/src/elements/ia-topnav/ia-topnav-signed-out-dropdown.js +10 -0
  204. package/dist/src/elements/ia-topnav/ia-topnav-signed-out-dropdown.js.map +1 -0
  205. package/dist/src/elements/ia-topnav/ia-topnav-user-menu.d.ts +7 -0
  206. package/dist/src/elements/ia-topnav/ia-topnav-user-menu.d.ts.map +1 -0
  207. package/dist/src/elements/ia-topnav/ia-topnav-user-menu.js +39 -0
  208. package/dist/src/elements/ia-topnav/ia-topnav-user-menu.js.map +1 -0
  209. package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.d.ts +10 -0
  210. package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.d.ts.map +1 -0
  211. package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.js +64 -0
  212. package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.js.map +1 -0
  213. package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.d.ts +20 -0
  214. package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.d.ts.map +1 -0
  215. package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.js +131 -0
  216. package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.js.map +1 -0
  217. package/dist/src/elements/ia-topnav/ia-topnav.d.ts +91 -0
  218. package/dist/src/elements/ia-topnav/ia-topnav.d.ts.map +1 -0
  219. package/dist/src/elements/ia-topnav/ia-topnav.js +445 -0
  220. package/dist/src/elements/ia-topnav/ia-topnav.js.map +1 -0
  221. package/dist/src/elements/ia-topnav/lib/helpers.d.ts +13 -0
  222. package/dist/src/elements/ia-topnav/lib/helpers.d.ts.map +1 -0
  223. package/dist/src/elements/ia-topnav/lib/helpers.js +24 -0
  224. package/dist/src/elements/ia-topnav/lib/helpers.js.map +1 -0
  225. package/dist/src/elements/ia-topnav/lib/keyboard-navigation.d.ts +46 -0
  226. package/dist/src/elements/ia-topnav/lib/keyboard-navigation.d.ts.map +1 -0
  227. package/dist/src/elements/ia-topnav/lib/keyboard-navigation.js +136 -0
  228. package/dist/src/elements/ia-topnav/lib/keyboard-navigation.js.map +1 -0
  229. package/dist/src/elements/ia-topnav/models.d.ts +59 -0
  230. package/dist/src/elements/ia-topnav/models.d.ts.map +1 -0
  231. package/dist/src/elements/ia-topnav/models.js +10 -0
  232. package/dist/src/elements/ia-topnav/models.js.map +1 -0
  233. package/dist/src/elements/ia-topnav/subnav-list-styles.d.ts +2 -0
  234. package/dist/src/elements/ia-topnav/subnav-list-styles.d.ts.map +1 -0
  235. package/dist/src/elements/ia-topnav/subnav-list-styles.js +49 -0
  236. package/dist/src/elements/ia-topnav/subnav-list-styles.js.map +1 -0
  237. package/dist/src/elements/ia-topnav/tracked-element.d.ts +6 -0
  238. package/dist/src/elements/ia-topnav/tracked-element.d.ts.map +1 -0
  239. package/dist/src/elements/ia-topnav/tracked-element.js +29 -0
  240. package/dist/src/elements/ia-topnav/tracked-element.js.map +1 -0
  241. package/dist/src/elements/ia-transcript-view/ia-transcript-entry.d.ts.map +1 -1
  242. package/dist/src/elements/ia-transcript-view/ia-transcript-entry.js +4 -0
  243. package/dist/src/elements/ia-transcript-view/ia-transcript-entry.js.map +1 -1
  244. package/dist/src/elements/ia-transcript-view/ia-transcript-view.d.ts.map +1 -1
  245. package/dist/src/elements/ia-transcript-view/ia-transcript-view.js +3 -2
  246. package/dist/src/elements/ia-transcript-view/ia-transcript-view.js.map +1 -1
  247. package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.d.ts +24 -0
  248. package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.d.ts.map +1 -0
  249. package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.js +240 -0
  250. package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.js.map +1 -0
  251. package/dist/src/locales/es.d.ts +40 -0
  252. package/dist/src/locales/es.d.ts.map +1 -0
  253. package/dist/src/locales/es.js +45 -0
  254. package/dist/src/locales/es.js.map +1 -0
  255. package/package.json +25 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ia-donation-section.d.ts","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/form-elements/ia-donation-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAMb,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB;;;;CAI3B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAE3E;;;GAGG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IAC/C,uDAAuD;IAC3B,YAAY,SAAO;IAEnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,wBAAwB,CAC1B;IAErC,MAAM,IAAI,cAAc;IAkBxB,MAAM,KAAK,MAAM,IAAI,cAAc,CA+HlC;CACF"}
@@ -0,0 +1,182 @@
1
+ import { __decorate } from "tslib";
2
+ import { css, html, LitElement, nothing, } from 'lit';
3
+ import { property } from 'lit/decorators.js';
4
+ import { customElement } from '../../../util/custom-element.js';
5
+ import themeStyles from '../../../themes/theme-styles.js';
6
+ /** Whether the numbered badge shows, hides, or hides but keeps its column. */
7
+ export const DonationSectionBadgeMode = {
8
+ HideBadge: 'hidebadge',
9
+ ShowBadge: 'showbadge',
10
+ HideBadgeLeaveSpacing: 'hidebadgeleavespacing',
11
+ };
12
+ /**
13
+ * One step of the donation form: a round numbered badge, an optional
14
+ * headline, and whatever content is slotted in.
15
+ */
16
+ let IADonationSection = class IADonationSection extends LitElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ /** What goes in the badge, usually the step number. */
20
+ this.sectionBadge = '0';
21
+ this.badgeMode = DonationSectionBadgeMode.ShowBadge;
22
+ }
23
+ render() {
24
+ return html `
25
+ <div class="container ${this.badgeMode}">
26
+ <div class="badge-container">
27
+ <div class="badge">${this.sectionBadge}</div>
28
+ </div>
29
+ <div class="content-container">
30
+ ${this.headline
31
+ ? html `<div class="title">${this.headline}</div>`
32
+ : nothing}
33
+ <div class="content">
34
+ <slot></slot>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ `;
39
+ }
40
+ static get styles() {
41
+ return [
42
+ themeStyles,
43
+ css `
44
+ :host {
45
+ /*
46
+ * The donation form was built for a 10px root font size. Sizing off
47
+ * this base instead keeps the section self-contained, so it looks the
48
+ * same whatever the page's root size is. Override it to rescale
49
+ * everything.
50
+ */
51
+ --donation-section-base-font-size--: var(
52
+ --ia-donation-section-base-font-size,
53
+ 10px
54
+ );
55
+
56
+ --donation-section-badge-transition--: var(
57
+ --ia-donation-section-badge-transition,
58
+ 0.25s ease-out
59
+ );
60
+ --donation-section-badge-margin--: var(
61
+ --ia-donation-section-badge-margin,
62
+ var(--donation-section-base-font-size--)
63
+ );
64
+ --donation-section-badge-background-color--: var(
65
+ --ia-donation-section-badge-background-color,
66
+ var(--mid-gray)
67
+ );
68
+ --donation-section-badge-radius--: var(
69
+ --ia-donation-section-badge-radius,
70
+ calc(var(--donation-section-base-font-size--) * 1.2)
71
+ );
72
+ --donation-section-badge-width--: calc(
73
+ var(--donation-section-badge-radius--) * 2
74
+ );
75
+ --donation-section-badge-font-size--: var(
76
+ --ia-donation-section-badge-font-size,
77
+ calc(var(--donation-section-base-font-size--) * 1.8)
78
+ );
79
+ --donation-section-badge-font-weight--: var(
80
+ --ia-donation-section-badge-font-weight,
81
+ bold
82
+ );
83
+ --donation-section-badge-font-color--: var(
84
+ --ia-donation-section-badge-font-color,
85
+ var(--true-white)
86
+ );
87
+ --donation-section-title-font-size--: var(
88
+ --ia-donation-section-title-font-size,
89
+ calc(var(--donation-section-base-font-size--) * 1.8)
90
+ );
91
+ --donation-section-title-font-weight--: var(
92
+ --ia-donation-section-title-font-weight,
93
+ bold
94
+ );
95
+ --donation-section-background-color--: var(
96
+ --ia-donation-section-background-color,
97
+ transparent
98
+ );
99
+ --donation-section-text-color--: var(--primary-text-color);
100
+
101
+ display: block;
102
+ background-color: var(--donation-section-background-color--);
103
+ color: var(--donation-section-text-color--);
104
+ }
105
+
106
+ .container {
107
+ position: relative;
108
+ padding: var(--padding-sm);
109
+ }
110
+
111
+ .content-container {
112
+ position: relative;
113
+ left: calc(
114
+ var(--donation-section-badge-width--) +
115
+ var(--donation-section-badge-margin--)
116
+ );
117
+ width: calc(
118
+ 100% -
119
+ (
120
+ var(--donation-section-badge-width--) +
121
+ var(--donation-section-badge-margin--)
122
+ )
123
+ );
124
+ transition: var(--donation-section-badge-transition--);
125
+ z-index: 1;
126
+ }
127
+
128
+ .hidebadge .content-container {
129
+ left: 0;
130
+ width: 100%;
131
+ }
132
+
133
+ .hidebadge .badge-container {
134
+ display: none;
135
+ }
136
+
137
+ .hidebadgeleavespacing .badge {
138
+ display: none;
139
+ }
140
+
141
+ .badge-container {
142
+ position: absolute;
143
+ width: var(--donation-section-badge-width--);
144
+ }
145
+
146
+ .badge {
147
+ background-color: var(--donation-section-badge-background-color--);
148
+ color: var(--donation-section-badge-font-color--);
149
+ width: var(--donation-section-badge-width--);
150
+ height: var(--donation-section-badge-width--);
151
+ border-radius: var(--donation-section-badge-radius--);
152
+ display: flex;
153
+ justify-content: center;
154
+ align-items: center;
155
+ font-weight: var(--donation-section-badge-font-weight--);
156
+ font-size: var(--donation-section-badge-font-size--);
157
+ }
158
+
159
+ .title {
160
+ line-height: var(--donation-section-badge-width--);
161
+ margin-bottom: var(--padding-sm);
162
+ font-size: var(--donation-section-title-font-size--);
163
+ font-weight: var(--donation-section-title-font-weight--);
164
+ }
165
+ `,
166
+ ];
167
+ }
168
+ };
169
+ __decorate([
170
+ property({ type: String })
171
+ ], IADonationSection.prototype, "sectionBadge", void 0);
172
+ __decorate([
173
+ property({ type: String })
174
+ ], IADonationSection.prototype, "headline", void 0);
175
+ __decorate([
176
+ property({ type: String })
177
+ ], IADonationSection.prototype, "badgeMode", void 0);
178
+ IADonationSection = __decorate([
179
+ customElement('ia-donation-section')
180
+ ], IADonationSection);
181
+ export { IADonationSection };
182
+ //# sourceMappingURL=ia-donation-section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ia-donation-section.js","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/form-elements/ia-donation-section.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,GAGR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AAEnD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,qBAAqB,EAAE,uBAAuB;CACtC,CAAC;AAKX;;;GAGG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAA1C;;QACL,uDAAuD;QAC3B,iBAAY,GAAG,GAAG,CAAC;QAInB,cAAS,GACnC,wBAAwB,CAAC,SAAS,CAAC;IAoJvC,CAAC;IAlJC,MAAM;QACJ,OAAO,IAAI,CAAA;8BACe,IAAI,CAAC,SAAS;;+BAEb,IAAI,CAAC,YAAY;;;YAGpC,IAAI,CAAC,QAAQ;YACb,CAAC,CAAC,IAAI,CAAA,sBAAsB,IAAI,CAAC,QAAQ,QAAQ;YACjD,CAAC,CAAC,OAAO;;;;;;KAMhB,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO;YACL,WAAW;YACX,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0HF;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAzJ6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAoB;AAEnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAmB;AAElB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDACU;AAP1B,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA2J7B","sourcesContent":["import {\n css,\n html,\n LitElement,\n nothing,\n type CSSResultGroup,\n type TemplateResult,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\n\nimport themeStyles from '@src/themes/theme-styles';\n\n/** Whether the numbered badge shows, hides, or hides but keeps its column. */\nexport const DonationSectionBadgeMode = {\n HideBadge: 'hidebadge',\n ShowBadge: 'showbadge',\n HideBadgeLeaveSpacing: 'hidebadgeleavespacing',\n} as const;\n\nexport type DonationSectionBadgeMode =\n (typeof DonationSectionBadgeMode)[keyof typeof DonationSectionBadgeMode];\n\n/**\n * One step of the donation form: a round numbered badge, an optional\n * headline, and whatever content is slotted in.\n */\n@customElement('ia-donation-section')\nexport class IADonationSection extends LitElement {\n /** What goes in the badge, usually the step number. */\n @property({ type: String }) sectionBadge = '0';\n\n @property({ type: String }) headline?: string;\n\n @property({ type: String }) badgeMode: DonationSectionBadgeMode =\n DonationSectionBadgeMode.ShowBadge;\n\n render(): TemplateResult {\n return html`\n <div class=\"container ${this.badgeMode}\">\n <div class=\"badge-container\">\n <div class=\"badge\">${this.sectionBadge}</div>\n </div>\n <div class=\"content-container\">\n ${this.headline\n ? html`<div class=\"title\">${this.headline}</div>`\n : nothing}\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n css`\n :host {\n /*\n * The donation form was built for a 10px root font size. Sizing off\n * this base instead keeps the section self-contained, so it looks the\n * same whatever the page's root size is. Override it to rescale\n * everything.\n */\n --donation-section-base-font-size--: var(\n --ia-donation-section-base-font-size,\n 10px\n );\n\n --donation-section-badge-transition--: var(\n --ia-donation-section-badge-transition,\n 0.25s ease-out\n );\n --donation-section-badge-margin--: var(\n --ia-donation-section-badge-margin,\n var(--donation-section-base-font-size--)\n );\n --donation-section-badge-background-color--: var(\n --ia-donation-section-badge-background-color,\n var(--mid-gray)\n );\n --donation-section-badge-radius--: var(\n --ia-donation-section-badge-radius,\n calc(var(--donation-section-base-font-size--) * 1.2)\n );\n --donation-section-badge-width--: calc(\n var(--donation-section-badge-radius--) * 2\n );\n --donation-section-badge-font-size--: var(\n --ia-donation-section-badge-font-size,\n calc(var(--donation-section-base-font-size--) * 1.8)\n );\n --donation-section-badge-font-weight--: var(\n --ia-donation-section-badge-font-weight,\n bold\n );\n --donation-section-badge-font-color--: var(\n --ia-donation-section-badge-font-color,\n var(--true-white)\n );\n --donation-section-title-font-size--: var(\n --ia-donation-section-title-font-size,\n calc(var(--donation-section-base-font-size--) * 1.8)\n );\n --donation-section-title-font-weight--: var(\n --ia-donation-section-title-font-weight,\n bold\n );\n --donation-section-background-color--: var(\n --ia-donation-section-background-color,\n transparent\n );\n --donation-section-text-color--: var(--primary-text-color);\n\n display: block;\n background-color: var(--donation-section-background-color--);\n color: var(--donation-section-text-color--);\n }\n\n .container {\n position: relative;\n padding: var(--padding-sm);\n }\n\n .content-container {\n position: relative;\n left: calc(\n var(--donation-section-badge-width--) +\n var(--donation-section-badge-margin--)\n );\n width: calc(\n 100% -\n (\n var(--donation-section-badge-width--) +\n var(--donation-section-badge-margin--)\n )\n );\n transition: var(--donation-section-badge-transition--);\n z-index: 1;\n }\n\n .hidebadge .content-container {\n left: 0;\n width: 100%;\n }\n\n .hidebadge .badge-container {\n display: none;\n }\n\n .hidebadgeleavespacing .badge {\n display: none;\n }\n\n .badge-container {\n position: absolute;\n width: var(--donation-section-badge-width--);\n }\n\n .badge {\n background-color: var(--donation-section-badge-background-color--);\n color: var(--donation-section-badge-font-color--);\n width: var(--donation-section-badge-width--);\n height: var(--donation-section-badge-width--);\n border-radius: var(--donation-section-badge-radius--);\n display: flex;\n justify-content: center;\n align-items: center;\n font-weight: var(--donation-section-badge-font-weight--);\n font-size: var(--donation-section-badge-font-size--);\n }\n\n .title {\n line-height: var(--donation-section-badge-width--);\n margin-bottom: var(--padding-sm);\n font-size: var(--donation-section-title-font-size--);\n font-weight: var(--donation-section-title-font-weight--);\n }\n `,\n ];\n }\n}\n"]}
@@ -0,0 +1,34 @@
1
+ import { DonationType } from './donation-type.js';
2
+ /**
3
+ * Everything needed to represent and calculate a donation amount.
4
+ *
5
+ * Given an amount and whether the donor is covering the processing fee, it
6
+ * calculates the fee and the total, rounded to the cent. It also carries the
7
+ * `DonationType`: one-time, monthly, or upsell.
8
+ */
9
+ export declare class DonationPaymentInfo {
10
+ donationType: DonationType;
11
+ amount: number;
12
+ coverFees: boolean;
13
+ constructor(params: {
14
+ donationType: DonationType;
15
+ amount: number;
16
+ coverFees: boolean;
17
+ });
18
+ /** The fee the donor is paying on top of the amount, or 0 if they aren't covering it. */
19
+ get feeAmountCovered(): number;
20
+ /** The processing fee for this amount, whether or not the donor covers it. */
21
+ get fee(): number;
22
+ /** The amount charged: the donation plus the fee when the donor covers it. */
23
+ get total(): number;
24
+ /** The total for an amount, with the fee added when `coverFees` is set. Rounded to the cent. */
25
+ static calculateTotal(amount: number, coverFees: boolean): number;
26
+ /** The processing fee for an amount. Rounded to the cent. */
27
+ static calculateFeeAmount(amount: number): number;
28
+ private static roundAmount;
29
+ }
30
+ /** The preset amounts the donation form offers. */
31
+ export declare const defaultDonationAmounts: number[];
32
+ /** The amount selected when the form first renders. */
33
+ export declare const defaultSelectedDonationInfo: DonationPaymentInfo;
34
+ //# sourceMappingURL=donation-payment-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donation-payment-info.d.ts","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/models/donation-payment-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;GAMG;AACH,qBAAa,mBAAmB;IAC9B,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEP,MAAM,EAAE;QAClB,YAAY,EAAE,YAAY,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,OAAO,CAAC;KACpB;IAMD,yFAAyF;IACzF,IAAI,gBAAgB,IAAI,MAAM,CAE7B;IAED,8EAA8E;IAC9E,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED,8EAA8E;IAC9E,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,gGAAgG;IAChG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM;IAOjE,6DAA6D;IAC7D,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAMjD,OAAO,CAAC,MAAM,CAAC,WAAW;CAG3B;AAED,mDAAmD;AACnD,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAAoC,CAAC;AAEhF,uDAAuD;AACvD,eAAO,MAAM,2BAA2B,EAAE,mBAKtC,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { DonationType } from './donation-type.js';
2
+ /**
3
+ * Everything needed to represent and calculate a donation amount.
4
+ *
5
+ * Given an amount and whether the donor is covering the processing fee, it
6
+ * calculates the fee and the total, rounded to the cent. It also carries the
7
+ * `DonationType`: one-time, monthly, or upsell.
8
+ */
9
+ export class DonationPaymentInfo {
10
+ constructor(params) {
11
+ this.donationType = params.donationType;
12
+ this.amount = params.amount;
13
+ this.coverFees = params.coverFees;
14
+ }
15
+ /** The fee the donor is paying on top of the amount, or 0 if they aren't covering it. */
16
+ get feeAmountCovered() {
17
+ return this.coverFees ? this.fee : 0;
18
+ }
19
+ /** The processing fee for this amount, whether or not the donor covers it. */
20
+ get fee() {
21
+ return DonationPaymentInfo.calculateFeeAmount(this.amount);
22
+ }
23
+ /** The amount charged: the donation plus the fee when the donor covers it. */
24
+ get total() {
25
+ return DonationPaymentInfo.calculateTotal(this.amount, this.coverFees);
26
+ }
27
+ /** The total for an amount, with the fee added when `coverFees` is set. Rounded to the cent. */
28
+ static calculateTotal(amount, coverFees) {
29
+ const fee = coverFees ? this.calculateFeeAmount(amount) : 0;
30
+ const total = amount + fee;
31
+ if (isNaN(total))
32
+ return 0;
33
+ return this.roundAmount(total);
34
+ }
35
+ /** The processing fee for an amount. Rounded to the cent. */
36
+ static calculateFeeAmount(amount) {
37
+ const fee = amount * 0.0219 + 0.29;
38
+ if (isNaN(fee))
39
+ return 0;
40
+ return this.roundAmount(fee);
41
+ }
42
+ static roundAmount(amount) {
43
+ return Math.round(amount * 100) / 100;
44
+ }
45
+ }
46
+ /** The preset amounts the donation form offers. */
47
+ export const defaultDonationAmounts = [5, 10, 25, 50, 100, 500, 1000];
48
+ /** The amount selected when the form first renders. */
49
+ export const defaultSelectedDonationInfo = new DonationPaymentInfo({
50
+ donationType: DonationType.OneTime,
51
+ amount: 10,
52
+ coverFees: false,
53
+ });
54
+ //# sourceMappingURL=donation-payment-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donation-payment-info.js","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/models/donation-payment-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,OAAO,mBAAmB;IAK9B,YAAY,MAIX;QACC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACpC,CAAC;IAED,yFAAyF;IACzF,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,8EAA8E;IAC9E,IAAI,GAAG;QACL,OAAO,mBAAmB,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,CAAC;IAED,8EAA8E;IAC9E,IAAI,KAAK;QACP,OAAO,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACzE,CAAC;IAED,gGAAgG;IAChG,MAAM,CAAC,cAAc,CAAC,MAAc,EAAE,SAAkB;QACtD,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,MAAM,KAAK,GAAG,MAAM,GAAG,GAAG,CAAC;QAC3B,IAAI,KAAK,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,6DAA6D;IAC7D,MAAM,CAAC,kBAAkB,CAAC,MAAc;QACtC,MAAM,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;QACnC,IAAI,KAAK,CAAC,GAAG,CAAC;YAAE,OAAO,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAEO,MAAM,CAAC,WAAW,CAAC,MAAc;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;IACxC,CAAC;CACF;AAED,mDAAmD;AACnD,MAAM,CAAC,MAAM,sBAAsB,GAAa,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AAEhF,uDAAuD;AACvD,MAAM,CAAC,MAAM,2BAA2B,GACtC,IAAI,mBAAmB,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC,OAAO;IAClC,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,KAAK;CACjB,CAAC,CAAC","sourcesContent":["import { DonationType } from './donation-type';\n\n/**\n * Everything needed to represent and calculate a donation amount.\n *\n * Given an amount and whether the donor is covering the processing fee, it\n * calculates the fee and the total, rounded to the cent. It also carries the\n * `DonationType`: one-time, monthly, or upsell.\n */\nexport class DonationPaymentInfo {\n donationType: DonationType;\n amount: number;\n coverFees: boolean;\n\n constructor(params: {\n donationType: DonationType;\n amount: number;\n coverFees: boolean;\n }) {\n this.donationType = params.donationType;\n this.amount = params.amount;\n this.coverFees = params.coverFees;\n }\n\n /** The fee the donor is paying on top of the amount, or 0 if they aren't covering it. */\n get feeAmountCovered(): number {\n return this.coverFees ? this.fee : 0;\n }\n\n /** The processing fee for this amount, whether or not the donor covers it. */\n get fee(): number {\n return DonationPaymentInfo.calculateFeeAmount(this.amount);\n }\n\n /** The amount charged: the donation plus the fee when the donor covers it. */\n get total(): number {\n return DonationPaymentInfo.calculateTotal(this.amount, this.coverFees);\n }\n\n /** The total for an amount, with the fee added when `coverFees` is set. Rounded to the cent. */\n static calculateTotal(amount: number, coverFees: boolean): number {\n const fee = coverFees ? this.calculateFeeAmount(amount) : 0;\n const total = amount + fee;\n if (isNaN(total)) return 0;\n return this.roundAmount(total);\n }\n\n /** The processing fee for an amount. Rounded to the cent. */\n static calculateFeeAmount(amount: number): number {\n const fee = amount * 0.0219 + 0.29;\n if (isNaN(fee)) return 0;\n return this.roundAmount(fee);\n }\n\n private static roundAmount(amount: number): number {\n return Math.round(amount * 100) / 100;\n }\n}\n\n/** The preset amounts the donation form offers. */\nexport const defaultDonationAmounts: number[] = [5, 10, 25, 50, 100, 500, 1000];\n\n/** The amount selected when the form first renders. */\nexport const defaultSelectedDonationInfo: DonationPaymentInfo =\n new DonationPaymentInfo({\n donationType: DonationType.OneTime,\n amount: 10,\n coverFees: false,\n });\n"]}
@@ -0,0 +1,62 @@
1
+ import type { BillingInfo, CustomerInfo } from './donor-contact-info.js';
2
+ import type { DonationType } from './donation-type.js';
3
+ import type { PaymentProvider } from './payment-provider.js';
4
+ /**
5
+ * Extra fields sent with a donation. Each one has to exist in the Braintree
6
+ * control panel before the backend will accept it, which is why the names are
7
+ * snake_case: they match the Braintree field names.
8
+ */
9
+ export declare class DonationRequestCustomFields {
10
+ logged_in_user?: string;
11
+ referrer?: string;
12
+ fee_amount_covered?: number;
13
+ /**
14
+ * Campaign and A/B test information about where the donor came from.
15
+ *
16
+ * Freeform, but keep it something identifiable so it can be queried in
17
+ * CiviCRM. The donation banner uses `{Source}-{Test Name}-{Variant Name}`,
18
+ * e.g. `DonateBanner-Campaign Start 2020-IADefault`. Add more segments for
19
+ * more specificity: `DonateBanner-MidJuly2020 Campaign-VariantA-Button1`.
20
+ */
21
+ origin?: string;
22
+ constructor(options?: {
23
+ logged_in_user?: string;
24
+ referrer?: string;
25
+ fee_amount_covered?: number;
26
+ origin?: string;
27
+ });
28
+ }
29
+ /** The request submitted to the backend to make a donation. */
30
+ export declare class DonationRequest {
31
+ paymentProvider: PaymentProvider;
32
+ paymentMethodNonce: string;
33
+ recaptchaToken?: string;
34
+ customerId?: string;
35
+ deviceData?: string;
36
+ upsellOnetimeTransactionId?: string;
37
+ /** First 6 digits of the credit card */
38
+ bin?: string;
39
+ /** The credit card's bank name */
40
+ binName?: string;
41
+ amount: number;
42
+ donationType: DonationType;
43
+ customer: CustomerInfo;
44
+ billing: BillingInfo;
45
+ customFields: DonationRequestCustomFields;
46
+ constructor(options: {
47
+ paymentProvider: PaymentProvider;
48
+ paymentMethodNonce: string;
49
+ recaptchaToken?: string;
50
+ customerId?: string;
51
+ deviceData?: string;
52
+ upsellOnetimeTransactionId?: string;
53
+ bin?: string;
54
+ binName?: string;
55
+ amount: number;
56
+ donationType: DonationType;
57
+ customer: CustomerInfo;
58
+ billing: BillingInfo;
59
+ customFields?: DonationRequestCustomFields;
60
+ });
61
+ }
62
+ //# sourceMappingURL=donation-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donation-request.d.ts","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/models/donation-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,2BAA2B;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEJ,OAAO,CAAC,EAAE;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;CAMF;AAED,+DAA+D;AAC/D,qBAAa,eAAe;IAC1B,eAAe,EAAE,eAAe,CAAC;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAEpC,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;IAE3B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,2BAA2B,CAAqC;gBAElE,OAAO,EAAE;QACnB,eAAe,EAAE,eAAe,CAAC;QACjC,kBAAkB,EAAE,MAAM,CAAC;QAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,0BAA0B,CAAC,EAAE,MAAM,CAAC;QACpC,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,YAAY,CAAC;QAC3B,QAAQ,EAAE,YAAY,CAAC;QACvB,OAAO,EAAE,WAAW,CAAC;QACrB,YAAY,CAAC,EAAE,2BAA2B,CAAC;KAC5C;CAqBF"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Extra fields sent with a donation. Each one has to exist in the Braintree
3
+ * control panel before the backend will accept it, which is why the names are
4
+ * snake_case: they match the Braintree field names.
5
+ */
6
+ export class DonationRequestCustomFields {
7
+ constructor(options) {
8
+ this.logged_in_user = options?.logged_in_user;
9
+ this.referrer = options?.referrer;
10
+ this.fee_amount_covered = options?.fee_amount_covered;
11
+ this.origin = options?.origin;
12
+ }
13
+ }
14
+ /** The request submitted to the backend to make a donation. */
15
+ export class DonationRequest {
16
+ constructor(options) {
17
+ this.customFields = new DonationRequestCustomFields();
18
+ this.paymentProvider = options.paymentProvider;
19
+ this.paymentMethodNonce = options.paymentMethodNonce;
20
+ this.recaptchaToken = options.recaptchaToken;
21
+ this.customerId = options.customerId;
22
+ this.deviceData = options.deviceData;
23
+ this.upsellOnetimeTransactionId = options.upsellOnetimeTransactionId;
24
+ this.bin = options.bin;
25
+ this.binName = options.binName;
26
+ this.amount = options.amount;
27
+ this.donationType = options.donationType;
28
+ this.customer = options.customer;
29
+ this.billing = options.billing;
30
+ if (options.customFields) {
31
+ this.customFields = options.customFields;
32
+ }
33
+ }
34
+ }
35
+ //# sourceMappingURL=donation-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donation-request.js","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/models/donation-request.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,OAAO,2BAA2B;IAetC,YAAY,OAKX;QACC,IAAI,CAAC,cAAc,GAAG,OAAO,EAAE,cAAc,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE,QAAQ,CAAC;QAClC,IAAI,CAAC,kBAAkB,GAAG,OAAO,EAAE,kBAAkB,CAAC;QACtD,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAChC,CAAC;CACF;AAED,+DAA+D;AAC/D,MAAM,OAAO,eAAe;IAoB1B,YAAY,OAcX;QAhBD,iBAAY,GAAgC,IAAI,2BAA2B,EAAE,CAAC;QAiB5E,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;QAErE,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAE/B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QAEzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAE/B,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YACzB,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QAC3C,CAAC;IACH,CAAC;CACF","sourcesContent":["import type { BillingInfo, CustomerInfo } from './donor-contact-info';\nimport type { DonationType } from './donation-type';\nimport type { PaymentProvider } from './payment-provider';\n\n/**\n * Extra fields sent with a donation. Each one has to exist in the Braintree\n * control panel before the backend will accept it, which is why the names are\n * snake_case: they match the Braintree field names.\n */\nexport class DonationRequestCustomFields {\n logged_in_user?: string;\n referrer?: string;\n fee_amount_covered?: number;\n\n /**\n * Campaign and A/B test information about where the donor came from.\n *\n * Freeform, but keep it something identifiable so it can be queried in\n * CiviCRM. The donation banner uses `{Source}-{Test Name}-{Variant Name}`,\n * e.g. `DonateBanner-Campaign Start 2020-IADefault`. Add more segments for\n * more specificity: `DonateBanner-MidJuly2020 Campaign-VariantA-Button1`.\n */\n origin?: string;\n\n constructor(options?: {\n logged_in_user?: string;\n referrer?: string;\n fee_amount_covered?: number;\n origin?: string;\n }) {\n this.logged_in_user = options?.logged_in_user;\n this.referrer = options?.referrer;\n this.fee_amount_covered = options?.fee_amount_covered;\n this.origin = options?.origin;\n }\n}\n\n/** The request submitted to the backend to make a donation. */\nexport class DonationRequest {\n paymentProvider: PaymentProvider;\n paymentMethodNonce: string;\n recaptchaToken?: string;\n customerId?: string;\n deviceData?: string;\n upsellOnetimeTransactionId?: string;\n\n /** First 6 digits of the credit card */\n bin?: string;\n /** The credit card's bank name */\n binName?: string;\n\n amount: number;\n donationType: DonationType;\n\n customer: CustomerInfo;\n billing: BillingInfo;\n customFields: DonationRequestCustomFields = new DonationRequestCustomFields();\n\n constructor(options: {\n paymentProvider: PaymentProvider;\n paymentMethodNonce: string;\n recaptchaToken?: string;\n customerId?: string;\n deviceData?: string;\n upsellOnetimeTransactionId?: string;\n bin?: string;\n binName?: string;\n amount: number;\n donationType: DonationType;\n customer: CustomerInfo;\n billing: BillingInfo;\n customFields?: DonationRequestCustomFields;\n }) {\n this.paymentProvider = options.paymentProvider;\n this.paymentMethodNonce = options.paymentMethodNonce;\n this.recaptchaToken = options.recaptchaToken;\n this.customerId = options.customerId;\n this.deviceData = options.deviceData;\n this.upsellOnetimeTransactionId = options.upsellOnetimeTransactionId;\n\n this.bin = options.bin;\n this.binName = options.binName;\n\n this.amount = options.amount;\n this.donationType = options.donationType;\n\n this.customer = options.customer;\n this.billing = options.billing;\n\n if (options.customFields) {\n this.customFields = options.customFields;\n }\n }\n}\n"]}
@@ -0,0 +1,67 @@
1
+ import { BillingInfo, CustomerInfo } from './donor-contact-info.js';
2
+ import type { DonationType } from './donation-type.js';
3
+ import type { PaymentProvider } from './payment-provider.js';
4
+ /** The subscription Braintree created for a monthly donation. */
5
+ export declare class SubscriptionResponse {
6
+ id: string;
7
+ constructor(params: {
8
+ id: string;
9
+ });
10
+ }
11
+ /**
12
+ * What the backend returns for a donation that went through. The snake_case
13
+ * fields are the backend's own names.
14
+ */
15
+ export declare class SuccessResponse {
16
+ paymentProvider: PaymentProvider;
17
+ paymentMethodNonce: string;
18
+ amount: number;
19
+ donationType: DonationType;
20
+ transaction_id: string;
21
+ customer_id: string;
22
+ customer: CustomerInfo;
23
+ billing: BillingInfo;
24
+ subscription?: SubscriptionResponse;
25
+ constructor(params: {
26
+ paymentProvider: PaymentProvider;
27
+ paymentMethodNonce: string;
28
+ amount: number;
29
+ donationType: DonationType;
30
+ transaction_id: string;
31
+ customer_id: string;
32
+ customer: CustomerInfo;
33
+ billing: BillingInfo;
34
+ subscription?: SubscriptionResponse;
35
+ });
36
+ }
37
+ /** A code and message pair, for telling one error apart from another. */
38
+ export declare class CodedError {
39
+ code: string;
40
+ message: string;
41
+ constructor(params: {
42
+ code: string;
43
+ message: string;
44
+ });
45
+ }
46
+ /** What the backend returns for a donation that failed. */
47
+ export declare class ErrorResponse {
48
+ message: string;
49
+ errors: CodedError[];
50
+ constructor(params: {
51
+ message: string;
52
+ errors?: CodedError[];
53
+ });
54
+ }
55
+ /**
56
+ * The backend's answer to a `DonationRequest`. `value` is a `SuccessResponse`
57
+ * or an `ErrorResponse` depending on `success`.
58
+ */
59
+ export declare class DonationResponse {
60
+ success: boolean;
61
+ value: SuccessResponse | ErrorResponse;
62
+ constructor(params: {
63
+ success: boolean;
64
+ value: SuccessResponse | ErrorResponse;
65
+ });
66
+ }
67
+ //# sourceMappingURL=donation-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donation-response.d.ts","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/models/donation-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,iEAAiE;AACjE,qBAAa,oBAAoB;IAC/B,EAAE,EAAE,MAAM,CAAC;gBAEC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;CAGnC;AAED;;;GAGG;AACH,qBAAa,eAAe;IAC1B,eAAe,EAAE,eAAe,CAAC;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;IACrB,YAAY,CAAC,EAAE,oBAAoB,CAAC;gBAExB,MAAM,EAAE;QAClB,eAAe,EAAE,eAAe,CAAC;QACjC,kBAAkB,EAAE,MAAM,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,YAAY,CAAC;QAC3B,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,YAAY,CAAC;QACvB,OAAO,EAAE,WAAW,CAAC;QACrB,YAAY,CAAC,EAAE,oBAAoB,CAAC;KACrC;CAeF;AAED,yEAAyE;AACzE,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;gBAEJ,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;CAItD;AAED,2DAA2D;AAC3D,qBAAa,aAAa;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,UAAU,EAAE,CAAC;gBAET,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;KAAE;CAM/D;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,eAAe,GAAG,aAAa,CAAC;gBAE3B,MAAM,EAAE;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,KAAK,EAAE,eAAe,GAAG,aAAa,CAAC;KACxC;CASF"}
@@ -0,0 +1,57 @@
1
+ import { BillingInfo, CustomerInfo } from './donor-contact-info.js';
2
+ /** The subscription Braintree created for a monthly donation. */
3
+ export class SubscriptionResponse {
4
+ constructor(params) {
5
+ this.id = params.id;
6
+ }
7
+ }
8
+ /**
9
+ * What the backend returns for a donation that went through. The snake_case
10
+ * fields are the backend's own names.
11
+ */
12
+ export class SuccessResponse {
13
+ constructor(params) {
14
+ this.paymentProvider = params.paymentProvider;
15
+ this.paymentMethodNonce = params.paymentMethodNonce;
16
+ this.amount = params.amount;
17
+ this.donationType = params.donationType;
18
+ this.transaction_id = params.transaction_id;
19
+ this.customer_id = params.customer_id;
20
+ this.customer = new CustomerInfo(params.customer);
21
+ this.billing = new BillingInfo(params.billing);
22
+ if (params.subscription) {
23
+ this.subscription = new SubscriptionResponse(params.subscription);
24
+ }
25
+ }
26
+ }
27
+ /** A code and message pair, for telling one error apart from another. */
28
+ export class CodedError {
29
+ constructor(params) {
30
+ this.code = params.code;
31
+ this.message = params.message;
32
+ }
33
+ }
34
+ /** What the backend returns for a donation that failed. */
35
+ export class ErrorResponse {
36
+ constructor(params) {
37
+ this.message = params.message;
38
+ const { errors = [] } = params;
39
+ this.errors = errors.map((error) => new CodedError(error));
40
+ }
41
+ }
42
+ /**
43
+ * The backend's answer to a `DonationRequest`. `value` is a `SuccessResponse`
44
+ * or an `ErrorResponse` depending on `success`.
45
+ */
46
+ export class DonationResponse {
47
+ constructor(params) {
48
+ this.success = params.success;
49
+ if (this.success) {
50
+ this.value = new SuccessResponse(params.value);
51
+ }
52
+ else {
53
+ this.value = new ErrorResponse(params.value);
54
+ }
55
+ }
56
+ }
57
+ //# sourceMappingURL=donation-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donation-response.js","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/models/donation-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIjE,iEAAiE;AACjE,MAAM,OAAO,oBAAoB;IAG/B,YAAY,MAAsB;QAChC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;IACtB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,eAAe;IAW1B,YAAY,MAUX;QACC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAC9C,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QAEtC,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAE/C,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,IAAI,CAAC,YAAY,GAAG,IAAI,oBAAoB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;CACF;AAED,yEAAyE;AACzE,MAAM,OAAO,UAAU;IAIrB,YAAY,MAAyC;QACnD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,CAAC;CACF;AAED,2DAA2D;AAC3D,MAAM,OAAO,aAAa;IAIxB,YAAY,MAAkD;QAC5D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAE9B,MAAM,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAiB,EAAE,EAAE,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAI3B,YAAY,MAGX;QACC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAE9B,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,KAAwB,CAAC,CAAC;QACpE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,KAAsB,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;CACF","sourcesContent":["import { BillingInfo, CustomerInfo } from './donor-contact-info';\nimport type { DonationType } from './donation-type';\nimport type { PaymentProvider } from './payment-provider';\n\n/** The subscription Braintree created for a monthly donation. */\nexport class SubscriptionResponse {\n id: string;\n\n constructor(params: { id: string }) {\n this.id = params.id;\n }\n}\n\n/**\n * What the backend returns for a donation that went through. The snake_case\n * fields are the backend's own names.\n */\nexport class SuccessResponse {\n paymentProvider: PaymentProvider;\n paymentMethodNonce: string;\n amount: number;\n donationType: DonationType;\n transaction_id: string;\n customer_id: string;\n customer: CustomerInfo;\n billing: BillingInfo;\n subscription?: SubscriptionResponse;\n\n constructor(params: {\n paymentProvider: PaymentProvider;\n paymentMethodNonce: string;\n amount: number;\n donationType: DonationType;\n transaction_id: string;\n customer_id: string;\n customer: CustomerInfo;\n billing: BillingInfo;\n subscription?: SubscriptionResponse;\n }) {\n this.paymentProvider = params.paymentProvider;\n this.paymentMethodNonce = params.paymentMethodNonce;\n this.amount = params.amount;\n this.donationType = params.donationType;\n this.transaction_id = params.transaction_id;\n this.customer_id = params.customer_id;\n\n this.customer = new CustomerInfo(params.customer);\n this.billing = new BillingInfo(params.billing);\n\n if (params.subscription) {\n this.subscription = new SubscriptionResponse(params.subscription);\n }\n }\n}\n\n/** A code and message pair, for telling one error apart from another. */\nexport class CodedError {\n code: string;\n message: string;\n\n constructor(params: { code: string; message: string }) {\n this.code = params.code;\n this.message = params.message;\n }\n}\n\n/** What the backend returns for a donation that failed. */\nexport class ErrorResponse {\n message: string;\n errors: CodedError[];\n\n constructor(params: { message: string; errors?: CodedError[] }) {\n this.message = params.message;\n\n const { errors = [] } = params;\n this.errors = errors.map((error: CodedError) => new CodedError(error));\n }\n}\n\n/**\n * The backend's answer to a `DonationRequest`. `value` is a `SuccessResponse`\n * or an `ErrorResponse` depending on `success`.\n */\nexport class DonationResponse {\n success: boolean;\n value: SuccessResponse | ErrorResponse;\n\n constructor(params: {\n success: boolean;\n value: SuccessResponse | ErrorResponse;\n }) {\n this.success = params.success;\n\n if (this.success) {\n this.value = new SuccessResponse(params.value as SuccessResponse);\n } else {\n this.value = new ErrorResponse(params.value as ErrorResponse);\n }\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /** How often the donor is charged. `Upsell` is the monthly offer made after a one-time gift. */
2
+ export declare const DonationType: {
3
+ readonly OneTime: "one-time";
4
+ readonly Monthly: "monthly";
5
+ readonly Upsell: "up_sell";
6
+ };
7
+ export type DonationType = (typeof DonationType)[keyof typeof DonationType];
8
+ //# sourceMappingURL=donation-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donation-type.d.ts","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/models/donation-type.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ /** How often the donor is charged. `Upsell` is the monthly offer made after a one-time gift. */
2
+ export const DonationType = {
3
+ OneTime: 'one-time',
4
+ Monthly: 'monthly',
5
+ Upsell: 'up_sell',
6
+ };
7
+ //# sourceMappingURL=donation-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donation-type.js","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/models/donation-type.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;CACT,CAAC","sourcesContent":["/** How often the donor is charged. `Upsell` is the monthly offer made after a one-time gift. */\nexport const DonationType = {\n OneTime: 'one-time',\n Monthly: 'monthly',\n Upsell: 'up_sell',\n} as const;\n\nexport type DonationType = (typeof DonationType)[keyof typeof DonationType];\n"]}
@@ -0,0 +1,38 @@
1
+ /** The donor's name and email. */
2
+ export declare class CustomerInfo {
3
+ email?: string;
4
+ firstName?: string;
5
+ lastName?: string;
6
+ constructor(params?: {
7
+ email?: string;
8
+ firstName?: string;
9
+ lastName?: string;
10
+ });
11
+ }
12
+ /** The donor's billing address, in Braintree's field names. */
13
+ export declare class BillingInfo {
14
+ streetAddress?: string;
15
+ extendedAddress?: string;
16
+ locality?: string;
17
+ region?: string;
18
+ postalCode?: string;
19
+ countryCodeAlpha2?: string;
20
+ constructor(params?: {
21
+ streetAddress?: string;
22
+ extendedAddress?: string;
23
+ locality?: string;
24
+ region?: string;
25
+ postalCode?: string;
26
+ countryCodeAlpha2?: string;
27
+ });
28
+ }
29
+ /** `CustomerInfo` and `BillingInfo` together, since they travel together. */
30
+ export declare class DonorContactInfo {
31
+ customer: CustomerInfo;
32
+ billing: BillingInfo;
33
+ constructor(params: {
34
+ customer: CustomerInfo;
35
+ billing: BillingInfo;
36
+ });
37
+ }
38
+ //# sourceMappingURL=donor-contact-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"donor-contact-info.d.ts","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/models/donor-contact-info.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,qBAAa,YAAY;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAEN,MAAM,CAAC,EAAE;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;CAKF;AAED,+DAA+D;AAC/D,qBAAa,WAAW;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;gBAEf,MAAM,CAAC,EAAE;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B;CAQF;AAED,6EAA6E;AAC7E,qBAAa,gBAAgB;IAC3B,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;gBAET,MAAM,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE;CAIrE"}