@internetarchive/elements 1.1.6 → 1.1.7-webdev-9054.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/elements/ia-donation-form/analytics.d.ts +12 -0
- package/dist/src/elements/ia-donation-form/analytics.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/analytics.js +2 -0
- package/dist/src/elements/ia-donation-form/analytics.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/braintree-manager-interface.d.ts +79 -0
- package/dist/src/elements/ia-donation-form/braintree/braintree-manager-interface.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/braintree-manager-interface.js +2 -0
- package/dist/src/elements/ia-donation-form/braintree/braintree-manager-interface.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/braintree-manager.d.ts +73 -0
- package/dist/src/elements/ia-donation-form/braintree/braintree-manager.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/braintree-manager.js +126 -0
- package/dist/src/elements/ia-donation-form/braintree/braintree-manager.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/hosting-environment.d.ts +10 -0
- package/dist/src/elements/ia-donation-form/braintree/hosting-environment.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/hosting-environment.js +9 -0
- package/dist/src/elements/ia-donation-form/braintree/hosting-environment.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-clients.d.ts +47 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-clients.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-clients.js +104 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-clients.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-interface.d.ts +11 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-interface.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-interface.js +2 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-interface.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-datasource-interface.d.ts +20 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-datasource-interface.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-datasource-interface.js +2 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-datasource-interface.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-datasource.d.ts +21 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-datasource.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-datasource.js +83 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-datasource.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-manager.d.ts +11 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-manager.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-manager.js +13 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay-session-manager.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay.d.ts +27 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay.js +67 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/apple-pay/apple-pay.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/credit-card-interface.d.ts +19 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/credit-card-interface.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/credit-card-interface.js +2 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/credit-card-interface.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/credit-card.d.ts +42 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/credit-card.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/credit-card.js +99 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/credit-card.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/hosted-field-configuration.d.ts +14 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/hosted-field-configuration.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/hosted-field-configuration.js +9 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/hosted-field-configuration.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/hosted-field-container.d.ts +40 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/hosted-field-container.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/hosted-field-container.js +58 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/credit-card/hosted-field-container.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/google-pay/google-pay-interface.d.ts +8 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/google-pay/google-pay-interface.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/google-pay/google-pay-interface.js +2 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/google-pay/google-pay-interface.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/google-pay/google-pay.d.ts +19 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/google-pay/google-pay.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/google-pay/google-pay.js +45 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/google-pay/google-pay.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal-button-datasource.d.ts +57 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal-button-datasource.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal-button-datasource.js +44 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal-button-datasource.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal-interface.d.ts +14 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal-interface.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal-interface.js +2 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal-interface.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.d.ts +27 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.js +44 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo-interface.d.ts +8 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo-interface.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo-interface.js +2 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo-interface.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo-restoration-state-handler.d.ts +44 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo-restoration-state-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo-restoration-state-handler.js +65 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo-restoration-state-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo.d.ts +25 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo.js +42 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/venmo/venmo.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers-interface.d.ts +18 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers-interface.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers-interface.js +2 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers-interface.js.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers.d.ts +42 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers.js +99 -0
- package/dist/src/elements/ia-donation-form/braintree/payment-providers.js.map +1 -0
- package/dist/src/elements/ia-donation-form/donation-form-error.d.ts +5 -0
- package/dist/src/elements/ia-donation-form/donation-form-error.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/donation-form-error.js +8 -0
- package/dist/src/elements/ia-donation-form/donation-form-error.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.d.ts +118 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.js +194 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.d.ts +24 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.js +70 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.d.ts +44 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.js +116 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.d.ts +24 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.js +74 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.d.ts +47 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.js +204 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.d.ts +30 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.js +77 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.js.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.d.ts +80 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.js +72 -0
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.d.ts +2 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.js +2 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.d.ts +3 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.js +254 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.d.ts +68 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js +483 -0
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.d.ts +26 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js +163 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.d.ts +39 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js +212 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.d.ts +118 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.js +774 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.d.ts +31 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.js +93 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.d.ts +33 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js +380 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.d.ts +11 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.js +59 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.js.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.d.ts +10 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.js +75 -0
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.js.map +1 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.d.ts +111 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js +522 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js.map +1 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form.d.ts +95 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form.js +522 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form.js.map +1 -0
- package/dist/src/elements/ia-donation-form/icons/apple-pay.svg +22 -0
- package/dist/src/elements/ia-donation-form/icons/calendar.svg +15 -0
- package/dist/src/elements/ia-donation-form/icons/credit-card.svg +15 -0
- package/dist/src/elements/ia-donation-form/icons/google-pay.svg +38 -0
- package/dist/src/elements/ia-donation-form/icons/lock.svg +6 -0
- package/dist/src/elements/ia-donation-form/icons/paypal.svg +39 -0
- package/dist/src/elements/ia-donation-form/icons/venmo.svg +9 -0
- package/dist/src/elements/ia-donation-form/icons.d.ts +9 -0
- package/dist/src/elements/ia-donation-form/icons.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/icons.js +27 -0
- package/dist/src/elements/ia-donation-form/icons.js.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.d.ts +27 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js +195 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.d.ts +7 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.js +63 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.js.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.d.ts +28 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js +313 -0
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js.map +1 -0
- package/dist/src/elements/ia-donation-form/recaptcha-manager.d.ts +36 -0
- package/dist/src/elements/ia-donation-form/recaptcha-manager.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/recaptcha-manager.js +76 -0
- package/dist/src/elements/ia-donation-form/recaptcha-manager.js.map +1 -0
- package/package.json +12 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-donation-edit-donation.js","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,GAIR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,uBAAuB,CAAC;AAE/B,6DAA6D;AAC7D,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,aAAa;CAClB,CAAC;AAKX,2CAA2C;AAC3C,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,QAAQ;CACR,CAAC;AAKX,kFAAkF;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AAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CA+wBlC","sourcesContent":["import {\n css,\n html,\n LitElement,\n nothing,\n type CSSResultGroup,\n type PropertyValues,\n type TemplateResult,\n} from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\nimport { msg, str } from '@lit/localize';\nimport currency from 'currency.js';\n\nimport themeStyles from '@src/themes/theme-styles';\nimport { CurrencyValidator } from '../currency-validator';\nimport {\n DonationPaymentInfo,\n defaultDonationAmounts,\n defaultSelectedDonationInfo,\n} from '../models/donation-payment-info';\nimport { DonationType } from '../models/donation-type';\nimport { DonationSectionBadgeMode } from './ia-donation-section';\nimport './ia-donation-section';\n\n/** Whether the numbered step badges show on the sections. */\nexport const EditDonationStepNumberMode = {\n HideNumbers: 'hidenumbers',\n ShowNumbers: 'shownumbers',\n} as const;\n\nexport type EditDonationStepNumberMode =\n (typeof EditDonationStepNumberMode)[keyof typeof EditDonationStepNumberMode];\n\n/** The radio button groups in the form. */\nexport const EditDonationSelectionGroup = {\n DonationType: 'donationType',\n Amount: 'amount',\n} as const;\n\nexport type EditDonationSelectionGroup =\n (typeof EditDonationSelectionGroup)[keyof typeof EditDonationSelectionGroup];\n\n/** The outcome of validating an amount. Sent in the `editDonationError` event. */\nexport const EditDonationInfoStatus = {\n ValidDonationAmount: 'valid_donation_amount',\n InvalidDonationAmount: 'invalid_donation_amount',\n DonationTooHigh: 'donation_too_high',\n DonationTooLow: 'donation_too_low',\n} as const;\n\nexport type EditDonationInfoStatus =\n (typeof EditDonationInfoStatus)[keyof typeof EditDonationInfoStatus];\n\n/** How the one-time / monthly choice is presented. */\nexport const EditDonationFrequencySelectionMode = {\n Button: 'button',\n Checkbox: 'checkbox',\n Hide: 'hide',\n} as const;\n\nexport type EditDonationFrequencySelectionMode =\n (typeof EditDonationFrequencySelectionMode)[keyof typeof EditDonationFrequencySelectionMode];\n\n/** Whether the amount buttons wrap onto several lines or stay on one. */\nexport const EditDonationAmountSelectionLayout = {\n SingleLine: 'single-line',\n MultiLine: 'multi-line',\n} as const;\n\nexport type EditDonationAmountSelectionLayout =\n (typeof EditDonationAmountSelectionLayout)[keyof typeof EditDonationAmountSelectionLayout];\n\n/**\n * The part of the donation form where the donor picks a frequency, an amount\n * (preset or custom) and whether to cover the processing fee. Fires\n * `donationInfoChanged` with the new `DonationPaymentInfo` on every change\n * and `editDonationError` when a custom amount is out of range.\n *\n * The petabox donation banner uses this on its own, without the rest of the\n * form.\n */\n@customElement('ia-donation-edit-donation')\nexport class IADonationEditDonation extends LitElement {\n @property({ type: Object })\n donationInfo: DonationPaymentInfo = defaultSelectedDonationInfo;\n\n @property({ type: String })\n stepNumberMode: EditDonationStepNumberMode =\n EditDonationStepNumberMode.ShowNumbers;\n\n /**\n * A convenience for setting the selected amount from plain HTML. When\n * present it wins over `donationInfo`.\n */\n @property({ type: Number }) defaultSelectedAmount?: number;\n\n @property({ type: Array }) amountOptions: number[] = defaultDonationAmounts;\n\n @property({ type: String })\n amountSelectionLayout: EditDonationAmountSelectionLayout =\n EditDonationAmountSelectionLayout.MultiLine;\n\n @property({ type: String, reflect: true })\n frequencySelectionMode: EditDonationFrequencySelectionMode =\n EditDonationFrequencySelectionMode.Button;\n\n @property({ type: String, reflect: true }) customAmountMode:\n | 'display'\n | 'hide' = 'display';\n\n @property({ type: String, reflect: true }) coverFeesCheckboxMode:\n | 'display'\n | 'hide' = 'display';\n\n /** `slot` renders the `edit-donation-amount-title` slot in place of the default headline. */\n @property({ type: String, reflect: true }) amountTitleDisplayMode:\n | 'default'\n | 'slot' = 'default';\n\n @state() private error?: TemplateResult;\n\n @state() private customAmountSelected = false;\n\n @query('#custom-amount-button') private customAmountButton!: HTMLInputElement;\n\n @query('#custom-amount-input') private customAmountInput!: HTMLInputElement;\n\n private currencyValidator: CurrencyValidator = new CurrencyValidator();\n\n render(): TemplateResult {\n const amountTitle =\n this.amountTitleDisplayMode === 'default'\n ? msg('Choose an amount (USD)')\n : '';\n return html`\n ${this.frequencySelectionMode ===\n EditDonationFrequencySelectionMode.Button\n ? this.frequencyButtonsTemplate\n : nothing}\n\n <ia-donation-section\n sectionBadge=\"${this.amountSelectionSectionNumber}\"\n headline=${amountTitle}\n badgeMode=${this.formSectionNumberMode}\n >\n ${this.amountTitleDisplayMode === 'slot'\n ? html`<slot name=\"edit-donation-amount-title\"></slot>`\n : nothing}\n <ul class=\"amount-selector\">\n ${this.presetAmountsTemplate}\n ${this.customAmountMode === 'display'\n ? html`<li class=\"custom-amount\">${this.customAmountTemplate}</li>`\n : nothing}\n </ul>\n\n <div class=\"errors\" id=\"amount-errors\" aria-live=\"polite\">\n ${this.error}\n </div>\n\n ${this.coverFeesCheckboxMode === 'display'\n ? html`<div class=\"checkbox-options\">\n ${this.coverFeesCheckboxTemplate}\n ${this.frequencySelectionMode ===\n EditDonationFrequencySelectionMode.Checkbox\n ? this.frequencyCheckboxTemplate\n : nothing}\n </div>`\n : nothing}\n </ia-donation-section>\n `;\n }\n\n updated(changedProperties: PropertyValues): void {\n if (changedProperties.has('customAmountSelected')) {\n if (this.customAmountButton) {\n this.customAmountButton.checked = this.customAmountSelected;\n }\n }\n if (changedProperties.has('amountOptions')) {\n this.customAmountSelected = false;\n this.updateSelectedDonationInfo();\n this.setupAmountColumnsLayoutConfig();\n }\n if (changedProperties.has('amountSelectionLayout')) {\n this.setupAmountColumnsLayoutConfig();\n }\n if (changedProperties.has('donationInfo')) {\n this.updateSelectedDonationInfo();\n }\n if (\n changedProperties.has('defaultSelectedAmount') &&\n this.defaultSelectedAmount !== undefined\n ) {\n this.customAmountSelected = false;\n this.donationInfo = new DonationPaymentInfo({\n donationType: this.donationInfo.donationType,\n amount: this.defaultSelectedAmount,\n coverFees: this.donationInfo.coverFees,\n });\n }\n }\n\n private get frequencyButtonsTemplate(): TemplateResult {\n return html`\n <ia-donation-section\n sectionBadge=\"1\"\n headline=${msg('Choose a frequency')}\n badgeMode=${this.formSectionNumberMode}\n >\n <ul class=\"frequency-selector\">\n ${this.frequencyTemplate}\n </ul>\n </ia-donation-section>\n `;\n }\n\n private get frequencyCheckboxTemplate(): TemplateResult {\n return html`\n <div class=\"checkbox-option-container\">\n <input\n type=\"checkbox\"\n id=\"make-this-monthly\"\n @input=${this.monthlyCheckboxChecked}\n .checked=${this.donationInfo.donationType === DonationType.Monthly}\n tabindex=\"0\"\n />\n <label for=\"make-this-monthly\">${msg('Make this monthly')}</label>\n </div>\n `;\n }\n\n private get coverFeesCheckboxTemplate(): TemplateResult {\n return html`\n <div class=\"checkbox-option-container\">\n <input\n type=\"checkbox\"\n id=\"cover-fees\"\n @input=${this.coverFeesChecked}\n .checked=${this.donationInfo.coverFees}\n tabindex=\"0\"\n />\n <label for=\"cover-fees\">${this.coverFeesText}</label>\n </div>\n `;\n }\n\n /** The amount step is 2 when the frequency buttons come first, otherwise 1. */\n private get amountSelectionSectionNumber(): number {\n return this.frequencySelectionMode ===\n EditDonationFrequencySelectionMode.Button\n ? 2\n : 1;\n }\n\n private get formSectionNumberMode(): DonationSectionBadgeMode {\n switch (this.stepNumberMode) {\n case EditDonationStepNumberMode.ShowNumbers:\n return DonationSectionBadgeMode.ShowBadge;\n case EditDonationStepNumberMode.HideNumbers:\n return DonationSectionBadgeMode.HideBadge;\n }\n }\n\n /**\n * Picks the amount grid's column count, and how many columns the custom\n * amount field spans, from how many preset amounts there are.\n */\n private setupAmountColumnsLayoutConfig(): void {\n const minimalView =\n this.customAmountMode === 'hide' &&\n this.coverFeesCheckboxMode === 'hide' &&\n this.frequencySelectionMode === EditDonationFrequencySelectionMode.Hide;\n const amountCount = this.amountOptions.length;\n let columnCount = 5;\n let customAmountSpan = 3;\n switch (amountCount) {\n case 7:\n columnCount = 5;\n customAmountSpan = 3;\n break;\n case 6:\n columnCount = 4;\n customAmountSpan = 2;\n break;\n case 5:\n columnCount = 4;\n customAmountSpan = 3;\n break;\n case 4:\n if (minimalView) {\n columnCount = 4;\n customAmountSpan = 0;\n break;\n }\n columnCount = 3;\n customAmountSpan = 2;\n break;\n case 3:\n columnCount = 2;\n customAmountSpan = 1;\n break;\n }\n\n if (\n this.amountSelectionLayout ===\n EditDonationAmountSelectionLayout.SingleLine\n ) {\n columnCount = amountCount + 3;\n customAmountSpan = 3;\n }\n\n this.style.setProperty(\n '--ia-donation-edit-amount-column-count',\n `${columnCount}`,\n );\n this.style.setProperty(\n '--ia-donation-edit-custom-amount-col-span',\n `${customAmountSpan}`,\n );\n }\n\n /**\n * Syncs the radios and the custom field with `donationInfo`. A preset\n * amount checks its radio and clears the custom field; anything else\n * selects the custom field and formats the amount into it.\n */\n private updateSelectedDonationInfo(): void {\n // Keep the custom amount selected while the donor is typing in it, even\n // if the value matches a preset, so the selection doesn't jump to the\n // preset radio mid-keystroke.\n // With the custom field hidden both sides would be null, so guard on it\n // existing first.\n const typingInCustomAmount =\n !!this.customAmountInput &&\n this.shadowRoot?.activeElement === this.customAmountInput;\n if (\n !this.isCustomAmount &&\n !(this.customAmountSelected && typingInCustomAmount)\n ) {\n const radioButton = this.shadowRoot?.querySelector<HTMLInputElement>(\n `input[type=\"radio\"][name=\"${EditDonationSelectionGroup.Amount}\"][value=\"${this.donationInfo.amount}\"]`,\n );\n if (radioButton) radioButton.checked = true;\n this.customAmountSelected = false;\n this.error = undefined;\n if (this.customAmountInput) {\n this.customAmountInput.value = '';\n }\n } else {\n this.customAmountSelected = true;\n // Leave the field alone while it has focus, the donor may be typing\n if (!typingInCustomAmount && this.customAmountInput) {\n this.customAmountInput.value = this.customAmountDisplayValue;\n const donationInfoStatus = this.getDonationInfoStatus(\n this.donationInfo.amount,\n );\n this.handleDonationInfoStatus(donationInfoStatus);\n }\n }\n }\n\n private get coverFeesText(): string {\n const feeAmountString = currency(this.donationInfo.fee, {\n symbol: '$',\n }).format();\n\n return msg(str`I'll generously add ${feeAmountString} to cover fees.`);\n }\n\n /**\n * Formats a dollar amount without cents when it's a whole number and with\n * them when it isn't: `$5` and `$5.50`.\n */\n private formatShortenedAmount(dollars: number): string {\n const precision = dollars % 1 === 0 ? 0 : 2;\n return currency(dollars, { symbol: '$', precision }).format();\n }\n\n private get frequencyTemplate(): TemplateResult {\n return html`\n <li>\n ${this.getRadioButton({\n group: EditDonationSelectionGroup.DonationType,\n value: DonationType.OneTime,\n displayText: msg('One time'),\n checked: this.donationInfo.donationType === DonationType.OneTime,\n })}\n </li>\n\n <li>\n ${this.getRadioButton({\n group: EditDonationSelectionGroup.DonationType,\n value: DonationType.Monthly,\n displayText: msg('Monthly'),\n checked: this.donationInfo.donationType === DonationType.Monthly,\n })}\n </li>\n `;\n }\n\n private get presetAmountsTemplate(): TemplateResult {\n return html`\n ${this.amountOptions.map((amount) => {\n const checked =\n !this.customAmountSelected && amount === this.donationInfo.amount;\n\n return html`\n <li>\n ${this.getRadioButton({\n group: EditDonationSelectionGroup.Amount,\n value: `${amount}`,\n displayText: this.formatShortenedAmount(amount),\n checked,\n })}\n </li>\n `;\n })}\n `;\n }\n\n private getRadioButton(options: {\n group: EditDonationSelectionGroup;\n value: string;\n displayText: string;\n checked: boolean;\n }): TemplateResult {\n const radioId = `${options.group}-${options.value}-option`;\n return html`\n <div class=\"selection-button\">\n <input\n type=\"radio\"\n name=${options.group}\n value=${options.value}\n id=${radioId}\n tabindex=\"0\"\n .checked=${options.checked}\n @change=${this.radioSelected}\n @click=${(e: Event): void => {\n // `change` doesn't fire when the checked radio is clicked again,\n // so re-selecting the current amount is caught here. It matters\n // after a custom amount, which unchecks the presets visually.\n const isAmountSelection =\n options.group === EditDonationSelectionGroup.Amount;\n if (isAmountSelection) {\n const isSameValue =\n parseFloat(options.value) === this.donationInfo.amount;\n if (isSameValue) {\n this.radioSelected(e);\n }\n }\n }}\n />\n <label for=${radioId}>${options.displayText}</label>\n </div>\n `;\n }\n\n private get isCustomAmount(): boolean {\n return !this.amountOptions.includes(this.donationInfo.amount);\n }\n\n private get customAmountDisplayValue(): string {\n if (!this.isCustomAmount) return '';\n return currency(this.donationInfo.amount, { symbol: '' }).format();\n }\n\n private get customAmountTemplate(): TemplateResult {\n return html`\n <div class=\"selection-button\">\n <input\n type=\"radio\"\n name=${EditDonationSelectionGroup.Amount}\n value=\"custom\"\n id=\"custom-amount-button\"\n tabindex=\"0\"\n @change=${this.customRadioSelected}\n />\n\n <label for=\"custom-amount-button\">\n <span class=\"custom-amount-text\">${msg('Custom: $')}</span\n ><input\n type=\"text\"\n id=\"custom-amount-input\"\n tabindex=\"-1\"\n aria-label=${msg('Custom amount in dollars')}\n aria-describedby=\"amount-errors\"\n value=${this.customAmountDisplayValue}\n @input=${this.customAmountChanged}\n @keydown=${this.currencyValidator.keydown}\n @focus=${this.customAmountFocused}\n @blur=${this.customAmountBlurred}\n />\n </label>\n </div>\n `;\n }\n\n private customRadioSelected(): void {\n this.customAmountInput.focus();\n }\n\n private customAmountFocused(e: Event): void {\n const target = e.target as HTMLInputElement;\n this.customAmountSelected = true;\n this.handleCustomAmountInput(target.value);\n }\n\n /**\n * Once focus leaves the custom field the mid-keystroke protection is over,\n * so the UI re-syncs with `donationInfo`: a typed amount equal to a preset\n * moves to that preset, anything else gets re-formatted in place.\n */\n private customAmountBlurred(): void {\n this.updateSelectedDonationInfo();\n }\n\n private coverFeesChecked(e: Event): void {\n const target = e.target as HTMLInputElement;\n this.updateDonationInfo({ coverFees: target.checked });\n }\n\n private customAmountChanged(e: Event): void {\n const target = e.target as HTMLInputElement;\n this.customAmountSelected = true;\n this.handleCustomAmountInput(target.value);\n }\n\n private handleCustomAmountInput(value: string): void {\n const amount = parseFloat(value);\n if (isNaN(amount)) {\n this.dispatchEditDonationError(\n EditDonationInfoStatus.InvalidDonationAmount,\n );\n } else {\n this.amountChanged(amount);\n }\n }\n\n private handleDonationInfoStatus(status: EditDonationInfoStatus): void {\n switch (status) {\n case EditDonationInfoStatus.ValidDonationAmount:\n this.error = undefined;\n break;\n case EditDonationInfoStatus.DonationTooHigh:\n this.error = msg(html`\n To make a donation of $10,000 or more, please contact our philanthropy\n department at\n <a href=\"mailto:donations@archive.org\">donations@archive.org</a>\n `);\n this.dispatchEditDonationError(status);\n break;\n case EditDonationInfoStatus.DonationTooLow:\n if (this.customAmountInput.value.length > 0) {\n this.error = html`${msg('Please select an amount (minimum $1)')}`;\n }\n this.dispatchEditDonationError(status);\n break;\n case EditDonationInfoStatus.InvalidDonationAmount:\n this.error = html`${msg('Please enter a valid donation amount')}`;\n this.dispatchEditDonationError(status);\n break;\n }\n }\n\n private amountChanged(amount: number): void {\n const donationInfoStatus = this.getDonationInfoStatus(amount);\n this.handleDonationInfoStatus(donationInfoStatus);\n\n // Only a valid amount makes it into the donation info\n if (donationInfoStatus === EditDonationInfoStatus.ValidDonationAmount) {\n this.updateDonationInfo({ amount });\n }\n }\n\n private getDonationInfoStatus(amount: number): EditDonationInfoStatus {\n if (isNaN(amount)) {\n return EditDonationInfoStatus.InvalidDonationAmount;\n }\n\n if (amount >= 10000) {\n return EditDonationInfoStatus.DonationTooHigh;\n }\n\n if (amount < 1) {\n return EditDonationInfoStatus.DonationTooLow;\n }\n\n return EditDonationInfoStatus.ValidDonationAmount;\n }\n\n private radioSelected(e: Event): void {\n const radioButton = e.target as HTMLInputElement;\n const group = radioButton.name as EditDonationSelectionGroup;\n const { value } = radioButton;\n\n switch (group) {\n case EditDonationSelectionGroup.Amount:\n this.presetAmountChanged(parseFloat(value));\n break;\n case EditDonationSelectionGroup.DonationType:\n this.updateDonationInfo({ donationType: value as DonationType });\n break;\n default:\n break;\n }\n }\n\n private monthlyCheckboxChecked(e: Event): void {\n const isChecked = (e.target as HTMLInputElement).checked;\n const donationType = isChecked\n ? DonationType.Monthly\n : DonationType.OneTime;\n this.updateDonationInfo({ donationType });\n }\n\n private dispatchEditDonationError(error: EditDonationInfoStatus): void {\n const event = new CustomEvent('editDonationError', {\n detail: { error },\n });\n this.dispatchEvent(event);\n }\n\n private presetAmountChanged(amount: number): void {\n this.error = undefined;\n this.customAmountSelected = false;\n if (this.customAmountInput) {\n this.customAmountInput.value = '';\n }\n this.updateDonationInfo({ amount });\n }\n\n private updateDonationInfo(options: {\n donationType?: DonationType;\n amount?: number;\n coverFees?: boolean;\n }): void {\n const newDonationInfo = new DonationPaymentInfo({\n donationType: options.donationType ?? this.donationInfo.donationType,\n amount: options.amount ?? this.donationInfo.amount,\n coverFees: options.coverFees ?? this.donationInfo.coverFees,\n });\n\n this.donationInfo = newDonationInfo;\n\n const event = new CustomEvent('donationInfoChanged', {\n detail: { donationInfo: newDonationInfo },\n });\n this.dispatchEvent(event);\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 keeps the element self-contained, so it looks the same\n * whatever the page's root size is. Override it to rescale\n * everything, sections included.\n */\n --donation-edit-base-font-size--: var(\n --ia-donation-edit-base-font-size,\n 10px\n );\n\n --donation-edit-button-border-color--: var(\n --ia-donation-edit-button-border-color,\n var(--mid-gray)\n );\n --donation-edit-button-grid-gap--: var(\n --ia-donation-edit-button-grid-gap,\n var(--donation-edit-base-font-size--)\n );\n --donation-edit-button-font-size--: var(\n --ia-donation-edit-button-font-size,\n calc(var(--donation-edit-base-font-size--) * 1.6)\n );\n --donation-edit-button-font-color--: var(\n --ia-donation-edit-button-font-color,\n #000\n );\n --donation-edit-button-selected-font-color--: var(\n --ia-donation-edit-button-selected-font-color,\n #000\n );\n --donation-edit-button-selected-color--: var(\n --ia-donation-edit-button-selected-color,\n #f9bf3b\n );\n --donation-edit-button-focused-outline-color--: var(\n --ia-donation-edit-button-focused-outline-color,\n #7fb3f9\n );\n --donation-edit-button-color--: var(\n --ia-donation-edit-button-color,\n var(--true-white)\n );\n --donation-edit-cover-fees-font-size--: var(\n --ia-donation-edit-cover-fees-font-size,\n calc(var(--donation-edit-base-font-size--) * 1.2)\n );\n --donation-edit-cover-fees-font-weight--: var(\n --ia-donation-edit-cover-fees-font-weight,\n bold\n );\n --donation-edit-custom-amount-width--: var(\n --ia-donation-edit-custom-amount-width,\n calc(var(--donation-edit-base-font-size--) * 4)\n );\n --donation-edit-input-font-color--: var(\n --ia-donation-edit-input-font-color,\n var(--mid-gray)\n );\n --donation-edit-input-border--: var(\n --ia-donation-edit-input-border,\n 1px solid #d9d9d9\n );\n /* These two are set on the host by the element itself, from the number of amounts */\n --donation-edit-amount-column-count--: var(\n --ia-donation-edit-amount-column-count,\n 5\n );\n --donation-edit-custom-amount-col-span--: var(\n --ia-donation-edit-custom-amount-col-span,\n 3\n );\n --donation-edit-error-color--: var(--color-danger);\n\n /* Passed through to the sections */\n --ia-donation-section-base-font-size: var(\n --donation-edit-base-font-size--\n );\n --ia-donation-section-background-color: var(\n --ia-donation-edit-background-color,\n transparent\n );\n --ia-donation-section-badge-background-color: var(\n --ia-donation-edit-badge-background-color,\n var(--mid-gray)\n );\n --ia-donation-section-badge-font-color: var(\n --ia-donation-edit-badge-font-color,\n var(--true-white)\n );\n }\n\n .errors {\n color: var(--donation-edit-error-color--);\n font-size: calc(var(--donation-edit-base-font-size--) * 1.4);\n margin-top: var(--padding-sm);\n }\n\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n display: grid;\n grid-gap: var(--donation-edit-button-grid-gap--);\n }\n\n li {\n margin: 0;\n padding: 0;\n display: inline-block;\n }\n\n .frequency-selector {\n grid-template-columns: repeat(2, 1fr);\n }\n\n .amount-selector {\n grid-template-columns: repeat(\n var(--donation-edit-amount-column-count--),\n 1fr\n );\n }\n\n .custom-amount {\n grid-column: span var(--donation-edit-custom-amount-col-span--);\n }\n\n .selection-button {\n height: calc(var(--donation-edit-base-font-size--) * 3);\n }\n\n .selection-button label {\n padding: 0 calc(var(--donation-edit-base-font-size--) * 0.3);\n display: flex;\n cursor: pointer;\n text-align: center;\n font-size: var(--donation-edit-button-font-size--);\n font-weight: bold;\n border: 1px solid var(--donation-edit-button-border-color--);\n border-radius: 5px;\n height: 100%;\n justify-content: center;\n align-items: center;\n }\n\n label[for='custom-amount-button'] {\n padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .custom-amount-text {\n white-space: nowrap;\n margin-right: var(--padding-sm);\n }\n\n input[type='radio'] {\n opacity: 0;\n width: 0;\n height: 0;\n position: absolute;\n }\n\n input[type='radio'] + label {\n color: var(--donation-edit-button-font-color--);\n background-color: var(--donation-edit-button-color--);\n }\n\n input[type='radio']:checked + label {\n color: var(--donation-edit-button-selected-font-color--);\n background-color: var(--donation-edit-button-selected-color--);\n }\n\n input[type='radio']:focus + label {\n outline: 2px solid var(--donation-edit-button-focused-outline-color--);\n }\n\n .checkbox-options {\n margin-top: var(--donation-edit-base-font-size--);\n }\n\n .checkbox-option-container {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .checkbox-option-container input {\n width: calc(var(--donation-edit-base-font-size--) * 2);\n }\n\n .checkbox-option-container label {\n font-size: var(--donation-edit-cover-fees-font-size--);\n font-weight: var(--donation-edit-cover-fees-font-weight--);\n flex: 1;\n }\n\n #custom-amount-input {\n width: var(--donation-edit-custom-amount-width--);\n font-size: var(--donation-edit-button-font-size--);\n font-weight: bold;\n color: var(--donation-edit-input-font-color--);\n padding: calc(var(--donation-edit-base-font-size--) * 0.1);\n border: var(--donation-edit-input-border--);\n appearance: none;\n }\n `,\n ];\n }\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
+
import { type DonationPaymentInfo } from '../models/donation-payment-info.js';
|
|
3
|
+
import { EditDonationAmountSelectionLayout, EditDonationFrequencySelectionMode } from './ia-donation-edit-donation.js';
|
|
4
|
+
import './ia-donation-edit-donation.js';
|
|
5
|
+
import './ia-donation-summary.js';
|
|
6
|
+
/** Whether the top of the form shows the editable amount picker or the collapsed summary. */
|
|
7
|
+
export declare const DonationHeaderMode: {
|
|
8
|
+
readonly Summary: "summary";
|
|
9
|
+
readonly Edit: "edit";
|
|
10
|
+
};
|
|
11
|
+
export type DonationHeaderMode = (typeof DonationHeaderMode)[keyof typeof DonationHeaderMode];
|
|
12
|
+
/**
|
|
13
|
+
* The top of the donation form: the frequency and amount picker, or a
|
|
14
|
+
* one-line summary of the choice with an edit button. Relays the picker's
|
|
15
|
+
* events upward.
|
|
16
|
+
*/
|
|
17
|
+
export declare class IADonationHeader extends LitElement {
|
|
18
|
+
donationInfo?: DonationPaymentInfo;
|
|
19
|
+
mode: DonationHeaderMode;
|
|
20
|
+
amountOptions: number[];
|
|
21
|
+
amountSelectionLayout: EditDonationAmountSelectionLayout;
|
|
22
|
+
frequencySelectionMode: EditDonationFrequencySelectionMode;
|
|
23
|
+
render(): TemplateResult;
|
|
24
|
+
private get editDonationTemplate();
|
|
25
|
+
private get donationSummaryTemplate();
|
|
26
|
+
private donationInfoChanged;
|
|
27
|
+
private editDonationError;
|
|
28
|
+
private summaryEditClicked;
|
|
29
|
+
private showSummaryClicked;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=ia-donation-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-donation-header.d.ts","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/form-elements/ia-donation-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAI5D,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,6BAA6B,CAAC;AACrC,OAAO,uBAAuB,CAAC;AAE/B,6FAA6F;AAC7F,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE/D;;;;GAIG;AACH,qBACa,gBAAiB,SAAQ,UAAU;IAClB,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC,IAAI,EAAE,kBAAkB,CAC1B;IAEC,aAAa,EAAE,MAAM,EAAE,CAA0B;IAG5E,qBAAqB,EAAE,iCAAiC,CACV;IAG9C,sBAAsB,EAAE,kCAAkC,CACd;IAE5C,MAAM,IAAI,cAAc;IASxB,OAAO,KAAK,oBAAoB,GAa/B;IAED,OAAO,KAAK,uBAAuB,GAQlC;IAED,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,kBAAkB;CAG3B"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, LitElement } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import { customElement } from '../../../util/custom-element.js';
|
|
5
|
+
import { defaultDonationAmounts, } from '../models/donation-payment-info.js';
|
|
6
|
+
import { EditDonationAmountSelectionLayout, EditDonationFrequencySelectionMode, } from './ia-donation-edit-donation.js';
|
|
7
|
+
import './ia-donation-edit-donation.js';
|
|
8
|
+
import './ia-donation-summary.js';
|
|
9
|
+
/** Whether the top of the form shows the editable amount picker or the collapsed summary. */
|
|
10
|
+
export const DonationHeaderMode = {
|
|
11
|
+
Summary: 'summary',
|
|
12
|
+
Edit: 'edit',
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The top of the donation form: the frequency and amount picker, or a
|
|
16
|
+
* one-line summary of the choice with an edit button. Relays the picker's
|
|
17
|
+
* events upward.
|
|
18
|
+
*/
|
|
19
|
+
let IADonationHeader = class IADonationHeader extends LitElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.mode = DonationHeaderMode.Edit;
|
|
23
|
+
this.amountOptions = defaultDonationAmounts;
|
|
24
|
+
this.amountSelectionLayout = EditDonationAmountSelectionLayout.MultiLine;
|
|
25
|
+
this.frequencySelectionMode = EditDonationFrequencySelectionMode.Button;
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
switch (this.mode) {
|
|
29
|
+
case DonationHeaderMode.Summary:
|
|
30
|
+
return this.donationSummaryTemplate;
|
|
31
|
+
case DonationHeaderMode.Edit:
|
|
32
|
+
return this.editDonationTemplate;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
get editDonationTemplate() {
|
|
36
|
+
return html `
|
|
37
|
+
<ia-donation-edit-donation
|
|
38
|
+
.donationInfo=${this.donationInfo}
|
|
39
|
+
.amountOptions=${this.amountOptions}
|
|
40
|
+
.amountSelectionLayout=${this.amountSelectionLayout}
|
|
41
|
+
.frequencySelectionMode=${this.frequencySelectionMode}
|
|
42
|
+
@donationInfoChanged=${this.donationInfoChanged}
|
|
43
|
+
@showSummaryClicked=${this.showSummaryClicked}
|
|
44
|
+
@editDonationError=${this.editDonationError}
|
|
45
|
+
>
|
|
46
|
+
</ia-donation-edit-donation>
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
get donationSummaryTemplate() {
|
|
50
|
+
return html `
|
|
51
|
+
<ia-donation-summary
|
|
52
|
+
.donationInfo=${this.donationInfo}
|
|
53
|
+
@editClicked=${this.summaryEditClicked}
|
|
54
|
+
>
|
|
55
|
+
</ia-donation-summary>
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
donationInfoChanged(e) {
|
|
59
|
+
this.donationInfo = e.detail.donationInfo;
|
|
60
|
+
this.dispatchEvent(new CustomEvent('donationInfoChanged', {
|
|
61
|
+
detail: { donationInfo: this.donationInfo },
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
editDonationError(e) {
|
|
65
|
+
this.dispatchEvent(new CustomEvent('editDonationError', { detail: e.detail }));
|
|
66
|
+
}
|
|
67
|
+
summaryEditClicked() {
|
|
68
|
+
this.mode = DonationHeaderMode.Edit;
|
|
69
|
+
}
|
|
70
|
+
showSummaryClicked() {
|
|
71
|
+
this.mode = DonationHeaderMode.Summary;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
__decorate([
|
|
75
|
+
property({ type: Object })
|
|
76
|
+
], IADonationHeader.prototype, "donationInfo", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
property({ type: String })
|
|
79
|
+
], IADonationHeader.prototype, "mode", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
property({ type: Array })
|
|
82
|
+
], IADonationHeader.prototype, "amountOptions", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
property({ type: String })
|
|
85
|
+
], IADonationHeader.prototype, "amountSelectionLayout", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
property({ type: String })
|
|
88
|
+
], IADonationHeader.prototype, "frequencySelectionMode", void 0);
|
|
89
|
+
IADonationHeader = __decorate([
|
|
90
|
+
customElement('ia-donation-header')
|
|
91
|
+
], IADonationHeader);
|
|
92
|
+
export { IADonationHeader };
|
|
93
|
+
//# sourceMappingURL=ia-donation-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-donation-header.js","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/form-elements/ia-donation-header.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EACL,sBAAsB,GAEvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,6BAA6B,CAAC;AACrC,OAAO,uBAAuB,CAAC;AAE/B,6FAA6F;AAC7F,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACJ,CAAC;AAKX;;;;GAIG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QAGuB,SAAI,GAC9B,kB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,GAAG,kBAAkB,CAAC,IAAI,CAAC;IACtC,CAAC;IAEO,kBAAkB;QACxB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC;IACzC,CAAC;CACF,CAAA;AAvE6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAoC;AAEnC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACD;AAEC;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;uDAAkD;AAG5E;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+DAEmB;AAG9C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gEAEiB;AAdjC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAwE5B","sourcesContent":["import { html, LitElement, type TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\n\nimport {\n defaultDonationAmounts,\n type DonationPaymentInfo,\n} from '../models/donation-payment-info';\nimport {\n EditDonationAmountSelectionLayout,\n EditDonationFrequencySelectionMode,\n} from './ia-donation-edit-donation';\nimport './ia-donation-edit-donation';\nimport './ia-donation-summary';\n\n/** Whether the top of the form shows the editable amount picker or the collapsed summary. */\nexport const DonationHeaderMode = {\n Summary: 'summary',\n Edit: 'edit',\n} as const;\n\nexport type DonationHeaderMode =\n (typeof DonationHeaderMode)[keyof typeof DonationHeaderMode];\n\n/**\n * The top of the donation form: the frequency and amount picker, or a\n * one-line summary of the choice with an edit button. Relays the picker's\n * events upward.\n */\n@customElement('ia-donation-header')\nexport class IADonationHeader extends LitElement {\n @property({ type: Object }) donationInfo?: DonationPaymentInfo;\n\n @property({ type: String }) mode: DonationHeaderMode =\n DonationHeaderMode.Edit;\n\n @property({ type: Array }) amountOptions: number[] = defaultDonationAmounts;\n\n @property({ type: String })\n amountSelectionLayout: EditDonationAmountSelectionLayout =\n EditDonationAmountSelectionLayout.MultiLine;\n\n @property({ type: String })\n frequencySelectionMode: EditDonationFrequencySelectionMode =\n EditDonationFrequencySelectionMode.Button;\n\n render(): TemplateResult {\n switch (this.mode) {\n case DonationHeaderMode.Summary:\n return this.donationSummaryTemplate;\n case DonationHeaderMode.Edit:\n return this.editDonationTemplate;\n }\n }\n\n private get editDonationTemplate(): TemplateResult {\n return html`\n <ia-donation-edit-donation\n .donationInfo=${this.donationInfo}\n .amountOptions=${this.amountOptions}\n .amountSelectionLayout=${this.amountSelectionLayout}\n .frequencySelectionMode=${this.frequencySelectionMode}\n @donationInfoChanged=${this.donationInfoChanged}\n @showSummaryClicked=${this.showSummaryClicked}\n @editDonationError=${this.editDonationError}\n >\n </ia-donation-edit-donation>\n `;\n }\n\n private get donationSummaryTemplate(): TemplateResult {\n return html`\n <ia-donation-summary\n .donationInfo=${this.donationInfo}\n @editClicked=${this.summaryEditClicked}\n >\n </ia-donation-summary>\n `;\n }\n\n private donationInfoChanged(e: CustomEvent): void {\n this.donationInfo = e.detail.donationInfo as DonationPaymentInfo;\n this.dispatchEvent(\n new CustomEvent('donationInfoChanged', {\n detail: { donationInfo: this.donationInfo },\n }),\n );\n }\n\n private editDonationError(e: CustomEvent): void {\n this.dispatchEvent(\n new CustomEvent('editDonationError', { detail: e.detail }),\n );\n }\n\n private summaryEditClicked(): void {\n this.mode = DonationHeaderMode.Edit;\n }\n\n private showSummaryClicked(): void {\n this.mode = DonationHeaderMode.Summary;\n }\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LitElement, type CSSResultGroup, type PropertyValues, type TemplateResult } from 'lit';
|
|
2
|
+
import type { PaymentProvidersInterface } from '../braintree/payment-providers-interface.js';
|
|
3
|
+
/**
|
|
4
|
+
* The row of payment method buttons. Each provider button asks its handler
|
|
5
|
+
* whether the browser supports it and hides itself if not. Once one is picked
|
|
6
|
+
* the others collapse behind a "Change payment method" button.
|
|
7
|
+
*
|
|
8
|
+
* The real PayPal button is slotted in from the light DOM (it can't live in
|
|
9
|
+
* a shadow root); the local PayPal button sits over it to catch clicks while
|
|
10
|
+
* the donation amount is invalid.
|
|
11
|
+
*/
|
|
12
|
+
export declare class IADonationPaymentSelector extends LitElement {
|
|
13
|
+
donationInfoValid: boolean;
|
|
14
|
+
paymentProviders?: PaymentProvidersInterface;
|
|
15
|
+
private applePayMode;
|
|
16
|
+
private googlePayMode;
|
|
17
|
+
private venmoMode;
|
|
18
|
+
private payPalMode;
|
|
19
|
+
private paymentModeSelected?;
|
|
20
|
+
render(): TemplateResult;
|
|
21
|
+
firstUpdated(): void;
|
|
22
|
+
updated(changed: PropertyValues): void;
|
|
23
|
+
showPaypalButton(): void;
|
|
24
|
+
/** Asks each provider whether this browser can use it, and shows or hides its button. */
|
|
25
|
+
private setButtonVisibility;
|
|
26
|
+
private googlePaySelected;
|
|
27
|
+
private applePaySelected;
|
|
28
|
+
private venmoSelected;
|
|
29
|
+
private creditCardSelected;
|
|
30
|
+
private localPaypalButtonClicked;
|
|
31
|
+
static get styles(): CSSResultGroup;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ia-donation-payment-selector.d.ts.map
|
package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ia-donation-payment-selector.d.ts","sourceRoot":"","sources":["../../../../../src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEV,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAMb,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAe1F;;;;;;;;GAQG;AACH,qBACa,yBAA0B,SAAQ,UAAU;IAC1B,iBAAiB,UAAQ;IAE1B,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAEhE,OAAO,CAAC,YAAY,CAAgD;IAEpE,OAAO,CAAC,aAAa,CAAgD;IAErE,OAAO,CAAC,SAAS,CAAgD;IAEjE,OAAO,CAAC,UAAU,CAAgD;IAElE,OAAO,CAAC,mBAAmB,CAAC,CAAc;IAEnD,MAAM,IAAI,cAAc;IA+GxB,YAAY,IAAI,IAAI;IAIpB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAMtC,gBAAgB,IAAI,IAAI;IAIxB,yFAAyF;YAC3E,mBAAmB;IA4CjC,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,wBAAwB;IAIhC,MAAM,KAAK,MAAM,IAAI,cAAc,CAgJlC;CACF"}
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, html, LitElement, nothing, } from 'lit';
|
|
3
|
+
import { property, state } from 'lit/decorators.js';
|
|
4
|
+
import { customElement } from '../../../util/custom-element.js';
|
|
5
|
+
import { msg } from '@lit/localize';
|
|
6
|
+
import themeStyles from '../../../themes/theme-styles.js';
|
|
7
|
+
import { applePayLogo, googlePayLogo, paypalLogo, venmoLogo } from '../icons.js';
|
|
8
|
+
/** A provider button starts hidden-but-reserved, then shows or disappears once its availability is known. */
|
|
9
|
+
const PaymentButtonMode = {
|
|
10
|
+
Loading: 'loading',
|
|
11
|
+
Available: 'available',
|
|
12
|
+
Unavailable: 'unavailable',
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The row of payment method buttons. Each provider button asks its handler
|
|
16
|
+
* whether the browser supports it and hides itself if not. Once one is picked
|
|
17
|
+
* the others collapse behind a "Change payment method" button.
|
|
18
|
+
*
|
|
19
|
+
* The real PayPal button is slotted in from the light DOM (it can't live in
|
|
20
|
+
* a shadow root); the local PayPal button sits over it to catch clicks while
|
|
21
|
+
* the donation amount is invalid.
|
|
22
|
+
*/
|
|
23
|
+
let IADonationPaymentSelector = class IADonationPaymentSelector extends LitElement {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.donationInfoValid = true;
|
|
27
|
+
this.applePayMode = PaymentButtonMode.Loading;
|
|
28
|
+
this.googlePayMode = PaymentButtonMode.Loading;
|
|
29
|
+
this.venmoMode = PaymentButtonMode.Loading;
|
|
30
|
+
this.payPalMode = PaymentButtonMode.Loading;
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const paymentSelectedCss = this.paymentModeSelected
|
|
34
|
+
? 'payment-selected'
|
|
35
|
+
: '';
|
|
36
|
+
return html `
|
|
37
|
+
<div
|
|
38
|
+
class="payment-container ${this.donationInfoValid
|
|
39
|
+
? 'donation-info-valid'
|
|
40
|
+
: 'donation-info-invalid'} ${paymentSelectedCss}"
|
|
41
|
+
>
|
|
42
|
+
<div class="payment-provider-container">
|
|
43
|
+
<button
|
|
44
|
+
class="applepay provider-button ${this.applePayMode} ${this
|
|
45
|
+
.paymentModeSelected === 'apple'
|
|
46
|
+
? 'selected'
|
|
47
|
+
: ''}"
|
|
48
|
+
aria-label=${msg('Pay with Apple Pay')}
|
|
49
|
+
@click=${(e) => {
|
|
50
|
+
this.paymentModeSelected = 'apple';
|
|
51
|
+
this.applePaySelected(e);
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<div class="payment-image">${applePayLogo}</div>
|
|
55
|
+
</button>
|
|
56
|
+
|
|
57
|
+
<button
|
|
58
|
+
class="googlepay provider-button ${this.googlePayMode} ${this
|
|
59
|
+
.paymentModeSelected === 'google'
|
|
60
|
+
? 'selected'
|
|
61
|
+
: ''}"
|
|
62
|
+
aria-label=${msg('Pay with Google Pay')}
|
|
63
|
+
@click=${() => {
|
|
64
|
+
this.paymentModeSelected = 'google';
|
|
65
|
+
this.googlePaySelected();
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<div class="payment-image">${googlePayLogo}</div>
|
|
69
|
+
</button>
|
|
70
|
+
|
|
71
|
+
<button
|
|
72
|
+
class="venmo provider-button ${this.venmoMode} ${this
|
|
73
|
+
.paymentModeSelected === 'venmo'
|
|
74
|
+
? 'selected'
|
|
75
|
+
: ''}"
|
|
76
|
+
aria-label=${msg('Pay with Venmo')}
|
|
77
|
+
@click=${() => {
|
|
78
|
+
this.paymentModeSelected = 'venmo';
|
|
79
|
+
this.venmoSelected();
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
<div class="payment-image">${venmoLogo}</div>
|
|
83
|
+
</button>
|
|
84
|
+
|
|
85
|
+
<div
|
|
86
|
+
class="paypal-container provider-button ${this.payPalMode} ${this
|
|
87
|
+
.paymentModeSelected === 'paypal'
|
|
88
|
+
? 'selected'
|
|
89
|
+
: ''}"
|
|
90
|
+
>
|
|
91
|
+
<div class="payment-image">
|
|
92
|
+
<button
|
|
93
|
+
class="paypal-local-button"
|
|
94
|
+
aria-label=${msg('Pay with PayPal')}
|
|
95
|
+
@click=${() => {
|
|
96
|
+
this.paymentModeSelected = 'paypal';
|
|
97
|
+
this.localPaypalButtonClicked();
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
${paypalLogo}
|
|
101
|
+
</button>
|
|
102
|
+
<slot name="paypal-button"></slot>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="credit-card-container">
|
|
108
|
+
<button
|
|
109
|
+
@click=${() => {
|
|
110
|
+
this.paymentModeSelected = 'cc';
|
|
111
|
+
this.creditCardSelected();
|
|
112
|
+
}}
|
|
113
|
+
class="button-style credit-card-button ${this
|
|
114
|
+
.paymentModeSelected === 'cc'
|
|
115
|
+
? 'selected'
|
|
116
|
+
: ''}"
|
|
117
|
+
>
|
|
118
|
+
<div class="cc-title">${msg('Credit Card')}</div>
|
|
119
|
+
<div class="cc-background"></div>
|
|
120
|
+
</button>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
${this.paymentModeSelected
|
|
125
|
+
? html `
|
|
126
|
+
<button
|
|
127
|
+
id="change-payment-method"
|
|
128
|
+
@click=${() => {
|
|
129
|
+
this.paymentModeSelected = undefined;
|
|
130
|
+
this.dispatchEvent(new Event('resetPaymentMethod'));
|
|
131
|
+
this.setButtonVisibility();
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
${msg('Change payment method')}
|
|
135
|
+
</button>
|
|
136
|
+
|
|
137
|
+
<slot name="credit-card-fields"></slot>
|
|
138
|
+
`
|
|
139
|
+
: nothing}
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
firstUpdated() {
|
|
143
|
+
this.dispatchEvent(new Event('firstUpdated'));
|
|
144
|
+
}
|
|
145
|
+
updated(changed) {
|
|
146
|
+
if (changed.has('paymentProviders')) {
|
|
147
|
+
this.setButtonVisibility();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
showPaypalButton() {
|
|
151
|
+
this.payPalMode = PaymentButtonMode.Available;
|
|
152
|
+
}
|
|
153
|
+
/** Asks each provider whether this browser can use it, and shows or hides its button. */
|
|
154
|
+
async setButtonVisibility() {
|
|
155
|
+
const providers = this.paymentProviders;
|
|
156
|
+
if (!providers)
|
|
157
|
+
return;
|
|
158
|
+
const mode = (supported) => supported ? PaymentButtonMode.Available : PaymentButtonMode.Unavailable;
|
|
159
|
+
providers.venmoHandler
|
|
160
|
+
.get()
|
|
161
|
+
.then(async (handler) => {
|
|
162
|
+
if (!handler)
|
|
163
|
+
return false;
|
|
164
|
+
return handler.isBrowserSupported();
|
|
165
|
+
})
|
|
166
|
+
.then((supported) => {
|
|
167
|
+
this.venmoMode = mode(supported);
|
|
168
|
+
})
|
|
169
|
+
.catch((reason) => {
|
|
170
|
+
console.error('venmo unavailable', reason);
|
|
171
|
+
this.venmoMode = PaymentButtonMode.Unavailable;
|
|
172
|
+
});
|
|
173
|
+
providers.applePayHandler
|
|
174
|
+
.get()
|
|
175
|
+
.then((handler) => handler.isAvailable())
|
|
176
|
+
.then((supported) => {
|
|
177
|
+
this.applePayMode = mode(supported);
|
|
178
|
+
})
|
|
179
|
+
.catch((reason) => {
|
|
180
|
+
console.error('apple pay unavailable', reason);
|
|
181
|
+
this.applePayMode = PaymentButtonMode.Unavailable;
|
|
182
|
+
});
|
|
183
|
+
providers.googlePayHandler
|
|
184
|
+
.get()
|
|
185
|
+
.then((handler) => handler.isBrowserSupported())
|
|
186
|
+
.then((supported) => {
|
|
187
|
+
this.googlePayMode = mode(supported);
|
|
188
|
+
})
|
|
189
|
+
.catch((reason) => {
|
|
190
|
+
console.error('google pay unavailable', reason);
|
|
191
|
+
this.googlePayMode = PaymentButtonMode.Unavailable;
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
googlePaySelected() {
|
|
195
|
+
this.dispatchEvent(new Event('googlePaySelected'));
|
|
196
|
+
}
|
|
197
|
+
applePaySelected(e) {
|
|
198
|
+
this.dispatchEvent(new CustomEvent('applePaySelected', { detail: { originalEvent: e } }));
|
|
199
|
+
}
|
|
200
|
+
venmoSelected() {
|
|
201
|
+
this.dispatchEvent(new Event('venmoSelected'));
|
|
202
|
+
}
|
|
203
|
+
creditCardSelected() {
|
|
204
|
+
this.dispatchEvent(new Event('creditCardSelected'));
|
|
205
|
+
}
|
|
206
|
+
localPaypalButtonClicked() {
|
|
207
|
+
this.dispatchEvent(new Event('paypalBlockerSelected'));
|
|
208
|
+
}
|
|
209
|
+
static get styles() {
|
|
210
|
+
return [
|
|
211
|
+
themeStyles,
|
|
212
|
+
css `
|
|
213
|
+
:host {
|
|
214
|
+
--donation-selector-base-font-size--: var(
|
|
215
|
+
--ia-donation-form-base-font-size,
|
|
216
|
+
10px
|
|
217
|
+
);
|
|
218
|
+
--donation-selector-button-width--: var(
|
|
219
|
+
--ia-donation-payment-button-width,
|
|
220
|
+
calc(var(--donation-selector-base-font-size--) * 5)
|
|
221
|
+
);
|
|
222
|
+
--donation-selector-button-height--: var(
|
|
223
|
+
--ia-donation-payment-button-height,
|
|
224
|
+
calc(var(--donation-selector-base-font-size--) * 3.2)
|
|
225
|
+
);
|
|
226
|
+
--donation-selector-cc-font-size--: var(
|
|
227
|
+
--ia-donation-credit-card-font-size,
|
|
228
|
+
calc(var(--donation-selector-base-font-size--) * 1.8)
|
|
229
|
+
);
|
|
230
|
+
--donation-selector-cc-font-color--: var(
|
|
231
|
+
--ia-donation-credit-card-button-font-color,
|
|
232
|
+
var(--mid-gray)
|
|
233
|
+
);
|
|
234
|
+
--donation-selector-cc-color--: var(
|
|
235
|
+
--ia-donation-credit-card-button-color,
|
|
236
|
+
var(--true-white)
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
button {
|
|
241
|
+
color: inherit;
|
|
242
|
+
font-family: inherit;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.payment-container {
|
|
246
|
+
width: 100%;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.payment-provider-container {
|
|
250
|
+
display: grid;
|
|
251
|
+
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
252
|
+
grid-gap: var(--donation-selector-base-font-size--);
|
|
253
|
+
margin-bottom: var(--donation-selector-base-font-size--);
|
|
254
|
+
max-width: calc(var(--donation-selector-base-font-size--) * 23);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.provider-button {
|
|
258
|
+
border: 0;
|
|
259
|
+
padding: 0;
|
|
260
|
+
background: none;
|
|
261
|
+
cursor: pointer;
|
|
262
|
+
width: var(--donation-selector-button-width--);
|
|
263
|
+
height: var(--donation-selector-button-height--);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.provider-button.unavailable {
|
|
267
|
+
display: none;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.provider-button.loading {
|
|
271
|
+
border: 1px solid #ddd;
|
|
272
|
+
border-radius: 2px;
|
|
273
|
+
/* Accounts for the border that goes away once the provider loads, so the layout doesn't shift */
|
|
274
|
+
margin-bottom: -2px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.provider-button.loading .payment-image {
|
|
278
|
+
display: none;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.payment-image,
|
|
282
|
+
.brand-logo {
|
|
283
|
+
width: 100%;
|
|
284
|
+
height: 100%;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.brand-logo {
|
|
288
|
+
display: block;
|
|
289
|
+
object-fit: contain;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.paypal-local-button {
|
|
293
|
+
position: absolute;
|
|
294
|
+
border: 0;
|
|
295
|
+
padding: 0;
|
|
296
|
+
background: none;
|
|
297
|
+
cursor: pointer;
|
|
298
|
+
width: var(--donation-selector-button-width--);
|
|
299
|
+
height: var(--donation-selector-button-height--);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.donation-info-valid .paypal-local-button {
|
|
303
|
+
z-index: 0;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.donation-info-invalid .paypal-local-button {
|
|
307
|
+
z-index: 250;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.credit-card-button {
|
|
311
|
+
color: var(--donation-selector-cc-font-color--);
|
|
312
|
+
background-color: var(--donation-selector-cc-color--);
|
|
313
|
+
border: 1px solid var(--mid-gray);
|
|
314
|
+
border-radius: 4px;
|
|
315
|
+
cursor: pointer;
|
|
316
|
+
margin: 0;
|
|
317
|
+
padding: calc(var(--donation-selector-base-font-size--) * 0.7)
|
|
318
|
+
var(--donation-selector-base-font-size--);
|
|
319
|
+
width: 100%;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.credit-card-button .cc-background {
|
|
323
|
+
height: calc(var(--donation-selector-base-font-size--) * 2.4);
|
|
324
|
+
width: 100%;
|
|
325
|
+
background-repeat: no-repeat;
|
|
326
|
+
background-image: url(https://archive.org/images/cc_logos.png);
|
|
327
|
+
background-position: 50% 50%;
|
|
328
|
+
background-size: contain;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.credit-card-button .cc-title {
|
|
332
|
+
font-size: var(--donation-selector-cc-font-size--);
|
|
333
|
+
font-weight: 700;
|
|
334
|
+
margin-bottom: var(--padding-sm);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
button#change-payment-method {
|
|
338
|
+
margin-top: 10px;
|
|
339
|
+
margin-bottom: 10px;
|
|
340
|
+
background: var(--true-white);
|
|
341
|
+
border: 1px solid;
|
|
342
|
+
border-radius: 3px;
|
|
343
|
+
padding: 5px;
|
|
344
|
+
cursor: pointer;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.payment-selected .provider-button:not(.selected),
|
|
348
|
+
.payment-selected .credit-card-button:not(.selected) {
|
|
349
|
+
display: none;
|
|
350
|
+
}
|
|
351
|
+
`,
|
|
352
|
+
];
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
__decorate([
|
|
356
|
+
property({ type: Boolean })
|
|
357
|
+
], IADonationPaymentSelector.prototype, "donationInfoValid", void 0);
|
|
358
|
+
__decorate([
|
|
359
|
+
property({ type: Object })
|
|
360
|
+
], IADonationPaymentSelector.prototype, "paymentProviders", void 0);
|
|
361
|
+
__decorate([
|
|
362
|
+
state()
|
|
363
|
+
], IADonationPaymentSelector.prototype, "applePayMode", void 0);
|
|
364
|
+
__decorate([
|
|
365
|
+
state()
|
|
366
|
+
], IADonationPaymentSelector.prototype, "googlePayMode", void 0);
|
|
367
|
+
__decorate([
|
|
368
|
+
state()
|
|
369
|
+
], IADonationPaymentSelector.prototype, "venmoMode", void 0);
|
|
370
|
+
__decorate([
|
|
371
|
+
state()
|
|
372
|
+
], IADonationPaymentSelector.prototype, "payPalMode", void 0);
|
|
373
|
+
__decorate([
|
|
374
|
+
state()
|
|
375
|
+
], IADonationPaymentSelector.prototype, "paymentModeSelected", void 0);
|
|
376
|
+
IADonationPaymentSelector = __decorate([
|
|
377
|
+
customElement('ia-donation-payment-selector')
|
|
378
|
+
], IADonationPaymentSelector);
|
|
379
|
+
export { IADonationPaymentSelector };
|
|
380
|
+
//# sourceMappingURL=ia-donation-payment-selector.js.map
|