@internetarchive/elements 1.4.1-webdev-9540.1 → 1.5.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-book-actions/assets/data/archive-logo.d.ts +2 -0
- package/dist/src/elements/ia-book-actions/assets/data/archive-logo.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/archive-logo.js +32 -0
- package/dist/src/elements/ia-book-actions/assets/data/archive-logo.js.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/dropdown-arrow.d.ts +3 -0
- package/dist/src/elements/ia-book-actions/assets/data/dropdown-arrow.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/dropdown-arrow.js +24 -0
- package/dist/src/elements/ia-book-actions/assets/data/dropdown-arrow.js.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/info-icon.d.ts +2 -0
- package/dist/src/elements/ia-book-actions/assets/data/info-icon.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/info-icon.js +17 -0
- package/dist/src/elements/ia-book-actions/assets/data/info-icon.js.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/purchase.d.ts +2 -0
- package/dist/src/elements/ia-book-actions/assets/data/purchase.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/data/purchase.js +23 -0
- package/dist/src/elements/ia-book-actions/assets/data/purchase.js.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.d.ts +3 -0
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.js +167 -0
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.js.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.d.ts +3 -0
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.js +102 -0
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/analytics-event-and-category.d.ts +33 -0
- package/dist/src/elements/ia-book-actions/core/config/analytics-event-and-category.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/analytics-event-and-category.js +33 -0
- package/dist/src/elements/ia-book-actions/core/config/analytics-event-and-category.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/constants.d.ts +9 -0
- package/dist/src/elements/ia-book-actions/core/config/constants.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/constants.js +9 -0
- package/dist/src/elements/ia-book-actions/core/config/constants.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/ia-lending-intervals.d.ts +2 -0
- package/dist/src/elements/ia-book-actions/core/config/ia-lending-intervals.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/ia-lending-intervals.js +54 -0
- package/dist/src/elements/ia-book-actions/core/config/ia-lending-intervals.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/sentry-events.d.ts +17 -0
- package/dist/src/elements/ia-book-actions/core/config/sentry-events.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/sentry-events.js +17 -0
- package/dist/src/elements/ia-book-actions/core/config/sentry-events.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/url-helper.d.ts +31 -0
- package/dist/src/elements/ia-book-actions/core/config/url-helper.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/config/url-helper.js +79 -0
- package/dist/src/elements/ia-book-actions/core/config/url-helper.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-config.d.ts +65 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-config.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-config.js +231 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-config.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler-service.d.ts +35 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler-service.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler-service.js +140 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler-service.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler.d.ts +78 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler.js +372 -0
- package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/doc-cookies.d.ts +42 -0
- package/dist/src/elements/ia-book-actions/core/services/doc-cookies.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/doc-cookies.js +75 -0
- package/dist/src/elements/ia-book-actions/core/services/doc-cookies.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/get-lending-actions.d.ts +72 -0
- package/dist/src/elements/ia-book-actions/core/services/get-lending-actions.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/get-lending-actions.js +392 -0
- package/dist/src/elements/ia-book-actions/core/services/get-lending-actions.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-analytics.d.ts +59 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-analytics.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-analytics.js +134 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-analytics.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-renew-helper.d.ts +58 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-renew-helper.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-renew-helper.js +135 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-renew-helper.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-token-poller.d.ts +73 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-token-poller.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-token-poller.js +143 -0
- package/dist/src/elements/ia-book-actions/core/services/loan-token-poller.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/logger.d.ts +18 -0
- package/dist/src/elements/ia-book-actions/core/services/logger.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/logger.js +26 -0
- package/dist/src/elements/ia-book-actions/core/services/logger.js.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/sentry-report.d.ts +19 -0
- package/dist/src/elements/ia-book-actions/core/services/sentry-report.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/core/services/sentry-report.js +25 -0
- package/dist/src/elements/ia-book-actions/core/services/sentry-report.js.map +1 -0
- package/dist/src/elements/ia-book-actions/globals.d.ts +38 -0
- package/dist/src/elements/ia-book-actions/globals.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/globals.js +6 -0
- package/dist/src/elements/ia-book-actions/globals.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.d.ts +97 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js +308 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.d.ts +14 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js +58 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.d.ts +13 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js +45 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.d.ts +20 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js +92 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.d.ts +41 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js +86 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions.d.ts +270 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions.js +1156 -0
- package/dist/src/elements/ia-book-actions/ia-book-actions.js.map +1 -0
- package/dist/src/elements/ia-book-actions/models.d.ts +206 -0
- package/dist/src/elements/ia-book-actions/models.d.ts.map +1 -0
- package/dist/src/elements/ia-book-actions/models.js +2 -0
- package/dist/src/elements/ia-book-actions/models.js.map +1 -0
- 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/payment-providers/paypal/paypal.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.js +4 -3
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.js.map +1 -1
- 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 +78 -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 +212 -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 +489 -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 +165 -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-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 +379 -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 +523 -0
- package/dist/src/elements/ia-donation-form/ia-donation-form.js.map +1 -0
- package/dist/src/elements/ia-donation-form/icons.d.ts +13 -0
- package/dist/src/elements/ia-donation-form/icons.d.ts.map +1 -0
- package/dist/src/elements/ia-donation-form/icons.js +21 -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-feature-feedback/assets/img/thumb-down.d.ts +2 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-down.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-down.js +8 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-down.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-up.d.ts +2 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-up.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-up.js +4 -0
- package/dist/src/elements/ia-feature-feedback/assets/img/thumb-up.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/feature-feedback-service.d.ts +54 -0
- package/dist/src/elements/ia-feature-feedback/feature-feedback-service.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/feature-feedback-service.js +79 -0
- package/dist/src/elements/ia-feature-feedback/feature-feedback-service.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.d.ts +99 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js +224 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.d.ts +41 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.js +61 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.d.ts +141 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js +447 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.d.ts +273 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js +879 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.d.ts +100 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js +779 -0
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-feature-feedback-service.d.ts +34 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-feature-feedback-service.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-feature-feedback-service.js +21 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-feature-feedback-service.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-manager.d.ts +11 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-manager.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-manager.js +11 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-manager.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-widget.d.ts +5 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-widget.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-widget.js +6 -0
- package/dist/src/elements/ia-feature-feedback/mocks/mock-recaptcha-widget.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/models.d.ts +109 -0
- package/dist/src/elements/ia-feature-feedback/models.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/models.js +31 -0
- package/dist/src/elements/ia-feature-feedback/models.js.map +1 -0
- package/dist/src/elements/ia-feature-feedback/utils/timed-promise.d.ts +29 -0
- package/dist/src/elements/ia-feature-feedback/utils/timed-promise.d.ts.map +1 -0
- package/dist/src/elements/ia-feature-feedback/utils/timed-promise.js +32 -0
- package/dist/src/elements/ia-feature-feedback/utils/timed-promise.js.map +1 -0
- package/dist/src/elements/ia-topnav/dropdown-menu.d.ts +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.d.ts +1 -1
- package/dist/src/locales/es.d.ts +31 -0
- package/dist/src/locales/es.d.ts.map +1 -1
- package/dist/src/locales/es.js +31 -0
- package/dist/src/locales/es.js.map +1 -1
- package/package.json +5 -1
package/dist/src/elements/ia-book-actions/core/services/actions-handler/actions-handler.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-handler.js","sourceRoot":"","sources":["../../../../../../../src/elements/ia-book-actions/core/services/actions-handler/actions-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAIjC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,qBAAqB,MAAM,2BAA2B,CAAC;AAC9D,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,GAChB,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAO1C,OAAO,kBAAkB,CAAC;AAE1B,MAAM,GAAG,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;AAEpC;;;;;GAKG;AAEH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU;IA0BpD;QACE,KAAK,EAAE,CAAC;QAXV;;WAEG;QACH,6BAAwB,GAAG,CAAC,CAAC;QAE7B;;WAEG;QACH,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;QAKpC,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAEO,MAAM,CACZ,IAAY,EACZ,OAAwC;QAExC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,KAAqB,EAAE,EAAE;YACrD,GAAG,C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O,CACb,WAAW,IAAI,CAAC,UAAU,KAAK,EAC/B,EAAE,EACF,IAAI,EACJ,GAAG,EACH,cAAc,CACf,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,oBAAoB,CAAC,KAAc;QACjC,MAAM,MAAM,GACV,MAAM,CAAC,QAAQ,CAAC,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC;QAC1E,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,mBAAmB;QACpF,OAAO,CAAC,OAAO,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;CACF","sourcesContent":["import { LitElement } from 'lit';\nimport type { LocalCacheInterface } from '@internetarchive/local-cache';\nimport type { FetchHandlerInterface } from '@src/services/fetch-handler/fetch-handler-interface';\n\nimport { URLHelper } from '../../config/url-helper';\nimport { sentryLogs } from '../../config/sentry-events';\nimport { createLogger } from '../logger';\nimport { sentryCaptureException, sentryCaptureMessage } from '../sentry-report';\n\nimport ActionsHandlerService from './actions-handler-service';\nimport LoanAnanlytics from '../loan-analytics';\nimport {\n analyticsCategories,\n analyticsActions,\n analyticsLabels,\n} from '../../config/analytics-event-and-category';\nimport * as Cookies from '../doc-cookies';\nimport type {\n ActionClickDetail,\n AutoRenewDetail,\n LoanServiceResponse,\n ReturnNowDetail,\n} from '../../../models';\nimport '../../../globals';\n\nconst log = createLogger('actions');\n\n/**\n * These are callback functions calling from actions-config.ts file.\n *\n * ActionsHandlerService is a function being used to execute APIs based of the request made by user.\n *\n */\n\nexport default class ActionsHandler extends LitElement {\n /** The item being borrowed. Elements that extend this declare it as a property. */\n declare identifier: string;\n\n /** Where to go after a loan is returned. Elements that extend this declare it as a property. */\n declare returnUrl: string;\n\n /** Total seconds of a one-hour loan. Set by the parent element. */\n declare loanTotalTime: number;\n\n /** Where the loan and page-change times are kept. Set by the parent element. */\n declare localCache: LocalCacheInterface;\n\n /** Makes the lending service requests. Set by the parent element. */\n declare fetchHandler?: FetchHandlerInterface;\n\n /**\n * wait untill borrow is complete, then refresh the page, in seconds\n */\n waitUntillBorrowComplete = 6;\n\n /**\n * bind events for lending bar\n */\n loanAnanlytics = new LoanAnanlytics();\n\n constructor() {\n super();\n\n this.bindEvents();\n }\n\n private listen<T = undefined>(\n name: string,\n handler: (event: CustomEvent<T>) => void,\n ): void {\n this.addEventListener(name, ((event: CustomEvent<T>) => {\n log.debug(`click: ${name}`, { identifier: this.identifier });\n handler(event);\n }) as EventListener);\n }\n\n bindEvents(): void {\n this.listen('browseBook', async () => {\n this.handleBrowseIt();\n await this.loanAnanlytics?.storeLoanStatsCount(this.identifier, 'browse');\n });\n\n this.listen('browseBookAgain', async () => {\n this.handleBrowseIt();\n await this.loanAnanlytics?.storeLoanStatsCount(\n this.identifier,\n 'browseagain',\n );\n });\n\n this.listen<AutoRenewDetail | undefined>('autoRenew', ({ detail }) => {\n this.handleLoanRenewNow(detail?.renewType);\n });\n\n this.listen('autoReturn', async () => {\n this.handleReturnIt();\n await this.loanAnanlytics?.storeLoanStatsCount(\n this.identifier,\n 'autoreturn',\n );\n\n this.loanAnanlytics?.sendEvent(\n analyticsCategories.browse,\n analyticsActions.browseReturn,\n analyticsLabels.browseAutoReturn,\n this.identifier,\n );\n });\n\n this.listen<ReturnNowDetail | undefined>('returnNow', ({ detail }) => {\n // use loan stats count when 1-hour borrow is active\n if (detail?.borrowType === 'browse') {\n this.loanAnanlytics?.storeLoanStatsCount(this.identifier, 'return');\n\n this.loanAnanlytics?.sendEvent(\n analyticsCategories.browse,\n analyticsActions.browseReturn,\n analyticsLabels.browseManualReturn,\n this.identifier,\n );\n }\n\n this.handleReturnIt('returnNow');\n\n // send these events if 14-day borrow return\n if (detail?.borrowType === 'borrow') {\n const { category, action } = detail.event as ActionClickDetail['event'];\n this.loanAnanlytics?.sendEvent(category, action, this.identifier);\n }\n });\n\n this.listen<ActionClickDetail>('borrowBook', ({ detail }) => {\n this.handleBorrowIt();\n const { category, action } = detail.event;\n this.loanAnanlytics?.sendEvent(category, action, this.identifier);\n });\n\n this.listen<ActionClickDetail>('loginAndBorrow', ({ detail }) => {\n this.handleLoginOk();\n const { category, action } = detail.event;\n this.loanAnanlytics?.sendEvent(category, action, this.identifier);\n });\n\n this.listen<ActionClickDetail>('leaveWaitlist', ({ detail }) => {\n this.handleRemoveFromWaitingList();\n const { category, action } = detail.event;\n this.loanAnanlytics?.sendEvent(category, action, this.identifier);\n });\n\n this.listen<ActionClickDetail>('joinWaitlist', ({ detail }) => {\n this.handleReserveIt();\n const { category, action } = detail.event;\n this.loanAnanlytics?.sendEvent(category, action, this.identifier);\n });\n\n this.listen<ActionClickDetail>('purchaseBook', ({ detail }) => {\n const { category, action } = detail.event;\n this.loanAnanlytics?.sendEvent(category, action, this.identifier);\n });\n\n this.listen<ActionClickDetail>('adminAccess', ({ detail }) => {\n const { category, action } = detail.event;\n this.loanAnanlytics?.sendEvent(category, action, this.identifier);\n\n this.setStickyAdminAccess(true);\n\n // keep existing params and add new one\n const url = new URL(window.location.href);\n url.searchParams.append('admin', '1');\n window.location.search = url.search;\n });\n\n this.listen<ActionClickDetail>('exitAdminAccess', ({ detail }) => {\n const { category, action } = detail.event;\n this.loanAnanlytics?.sendEvent(category, action, this.identifier);\n\n this.setStickyAdminAccess(false);\n });\n\n this.listen<ActionClickDetail>('bookTitleBar', ({ detail }) => {\n const { category, action } = detail.event;\n this.loanAnanlytics?.sendEvent(category, action, this.identifier);\n });\n }\n\n handleBrowseIt(): void {\n const action = 'browse_book';\n this.dispatchToggleActionGroup();\n\n ActionsHandlerService({\n action,\n identifier: this.identifier,\n fetchHandler: this.fetchHandler,\n success: () => {\n this.setBrowseTimeSession();\n this.handleReadItNow();\n },\n error: (data) => {\n this.dispatchActionError(action, data);\n },\n });\n }\n\n handleLoanRenewNow(renewType?: string): void {\n const action = 'renew_loan';\n\n ActionsHandlerService({\n action,\n identifier: this.identifier,\n fetchHandler: this.fetchHandler,\n success: async (data) => {\n // Anything thrown in here is an unhandled rejection that dispatches\n // NOTHING, and IABookActions only clears loanRenewInProgress when\n // one of these two events arrives, so a throw here would latch it on\n // permanently (dead countdown, loan stuck \"active\"). Always exit\n // through exactly one of the two dispatches below.\n try {\n log.debug('renew_loan succeeded', {\n identifier: this.identifier,\n data,\n });\n const activeLoan = data.loan ? data.loan : undefined;\n // Optional chaining: `data.loan` is genuinely absent on some\n // failures, and `activeLoan` can be undefined here.\n const isRenewal = activeLoan?.renewal;\n\n if (activeLoan && isRenewal) {\n // Await: loanAutoRenewed listeners read this same cache key\n // immediately, so the write has to land before the dispatch.\n await this.setBrowseTimeSession();\n\n // Only record the renew analytics event once the renewal has\n // actually succeeded, not merely attempted.\n await this.loanAnanlytics?.storeLoanStatsCount(\n this.identifier,\n 'autorenew',\n );\n const analyticsLabel =\n renewType === 'auto'\n ? analyticsLabels.browseAutoRenew\n : analyticsLabels.browseManualRenew;\n this.loanAnanlytics?.sendEvent(\n analyticsCategories.browse,\n analyticsActions.browseRenew,\n analyticsLabel,\n this.identifier,\n );\n\n // Dispatch the success outcome ONLY for a confirmed renewal.\n // A `{loan: {renewal: false}}` response goes through\n // dispatchActionError below instead, never both.\n this.dispatchEvent(\n new CustomEvent('loanAutoRenewed', {\n detail: { action, data: { ...data, loan: activeLoan } },\n }),\n );\n return;\n }\n\n log.warn('renew_loan answered without a renewal', {\n identifier: this.identifier,\n isRenewal,\n activeLoan,\n data,\n });\n sentryCaptureMessage(\n `${sentryLogs.bookRenewFailed} - no loan active`,\n {\n identifier: this.identifier,\n action,\n extra: { response: JSON.stringify(data) },\n },\n );\n this.dispatchActionError(action, {\n data,\n error: true,\n message: 'Loan renewal failed: no loan active.',\n });\n } catch (error) {\n log.error('renew_loan success handler threw', {\n identifier: this.identifier,\n error,\n });\n sentryCaptureException(error, {\n identifier: this.identifier,\n action,\n extra: { message: `${sentryLogs.bookRenewFailed} - threw` },\n });\n this.dispatchActionError(action, {\n data,\n error: true,\n message: `Loan renewal failed: ${error}`,\n });\n }\n },\n error: (data) => {\n this.dispatchActionError(action, data);\n },\n });\n }\n\n /**\n * excute function when loan is returning\n *\n * @param type loan return type returnNow|''\n */\n handleReturnIt(type = ''): void {\n const action = 'return_loan';\n\n if (type === 'returnNow') this.dispatchToggleActionGroup();\n\n ActionsHandlerService({\n action,\n identifier: this.identifier,\n fetchHandler: this.fetchHandler,\n success: () => {\n this.deleteLoanCookies();\n\n if (type === 'returnNow') URLHelper.goToUrl(this.returnUrl, true);\n },\n error: (data) => {\n this.dispatchActionError(action, data);\n },\n });\n }\n\n handleBorrowIt(): void {\n const action = 'borrow_book';\n this.dispatchToggleActionGroup();\n\n ActionsHandlerService({\n action,\n identifier: this.identifier,\n fetchHandler: this.fetchHandler,\n success: () => {\n this.handleReadItNow();\n },\n error: (data) => {\n this.dispatchActionError(action, data);\n },\n });\n }\n\n handleReserveIt(): void {\n const action = 'join_waitlist';\n this.dispatchToggleActionGroup();\n\n ActionsHandlerService({\n action,\n identifier: this.identifier,\n fetchHandler: this.fetchHandler,\n success: () => {\n URLHelper.goToUrl(URLHelper.getRedirectUrl(), true);\n },\n error: (data) => {\n this.dispatchActionError(action, data);\n },\n });\n }\n\n handleRemoveFromWaitingList(): void {\n const action = 'leave_waitlist';\n this.dispatchToggleActionGroup();\n\n ActionsHandlerService({\n action,\n identifier: this.identifier,\n fetchHandler: this.fetchHandler,\n success: () => {\n URLHelper.goToUrl(URLHelper.getRedirectUrl(), true);\n },\n error: (data) => {\n this.dispatchActionError(action, data);\n },\n });\n }\n\n /**\n * Dispatches event when an error occured on action\n * Notes:- toggle <ia-book-actions-collapsible-action-group> visibility (enable/disable).\n *\n * @param action name of action like browse_book, borrow_book\n * @param data erroneous response from api call\n *\n * @fires ActionsHandler#lendingActionError\n */\n dispatchActionError(action: string, data: LoanServiceResponse = {}): void {\n // send LendingServiceError to GA\n this.loanAnanlytics?.sendEvent('LendingServiceError', action);\n\n this.dispatchEvent(\n new CustomEvent('lendingActionError', {\n detail: { action, data },\n }),\n );\n }\n\n /**\n * Dispatches event when patron is clicked on action buttons.\n * Notes:- toggle <ia-book-actions-collapsible-action-group> disable/enable.\n *\n * @fires ActionsHandler#toggleActionGroup\n */\n dispatchToggleActionGroup(): void {\n this.dispatchEvent(new CustomEvent('toggleActionGroup'));\n }\n\n handleLoginOk(): void {\n const target = `/account/login?referer=${encodeURIComponent(\n URLHelper.getRedirectUrl(),\n )}`;\n URLHelper.goToUrl(target, true);\n }\n\n handleReadItNow(extraParam?: string | Record<string, string>): void {\n const currentParams = new URLSearchParams(window.location.search);\n\n if (extraParam) {\n // append extraParam key-value in currentParams\n const extraParams = new URLSearchParams(extraParam);\n for (const [key, val] of extraParams.entries()) {\n currentParams.append(key, val);\n }\n }\n\n const convertedToString = currentParams.toString();\n const newParams = convertedToString ? `?${convertedToString}` : '';\n\n // get current URL and add query parameters including search\n const redirectTo =\n window.location.origin + window.location.pathname + newParams;\n\n // redirection on details page after 5 seconds because borrowing book takes time to create item creation.\n setTimeout(() => {\n URLHelper.goToUrl(redirectTo, true);\n }, this.waitUntillBorrowComplete * 1000);\n }\n\n /**\n * set browse time in indexedDB\n */\n async setBrowseTimeSession(): Promise<void> {\n // TODO: USE loan info to determine what we have left\n try {\n const expireDate = new Date(\n new Date().getTime() + this.loanTotalTime * 1000,\n );\n\n log.debug('setBrowseTimeSession: resetting loanTime', {\n identifier: this.identifier,\n expireDate,\n loanTotalTime: this.loanTotalTime,\n });\n\n // set a value\n await this.localCache.set({\n key: `${this.identifier}-loanTime`,\n value: expireDate,\n ttl: Number(this.loanTotalTime),\n });\n\n // delete pageChangedTime when book is auto renew at nth minute\n await this.localCache.delete(`${this.identifier}-pageChangedTime`);\n\n log.debug('setBrowseTimeSession: loanTime reset complete', {\n identifier: this.identifier,\n });\n } catch (error) {\n log.error('setBrowseTimeSession failed', {\n identifier: this.identifier,\n error,\n });\n }\n }\n\n deleteLoanCookies(): void {\n log.debug('deleteLoanCookies: expiring loan cookies', {\n identifier: this.identifier,\n });\n\n const date = new Date();\n date.setTime(date.getTime() - 24 * 60 * 60 * 1000); // one day ago\n\n Cookies.setItem(\n `loan-${this.identifier}=\"\"`,\n '',\n date,\n '/',\n '.archive.org',\n );\n Cookies.setItem(\n `br-loan-${this.identifier}=\"\"`,\n '',\n date,\n '/',\n '.archive.org',\n );\n }\n\n /**\n * Set sticky admin access on or off.\n * @see WEBDEV-6835\n *\n * @param value Whether to enable or disable sticky admin access.\n */\n setStickyAdminAccess(value: boolean): void {\n const domain =\n window.location.hostname === 'localhost' ? 'localhost' : '.archive.org';\n const expires = new Date(Date.now() + 30 * 24 * 60 * 60 * 1000); // 30 days from now\n Cookies.setItem('sticky-admin-access', value, expires, '/', domain);\n }\n}\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper module use to get, set and remove item from cookie
|
|
3
|
+
*
|
|
4
|
+
* See more:
|
|
5
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
|
|
6
|
+
* https://developer.mozilla.org/User:fusionchess
|
|
7
|
+
* https://github.com/madmurphy/cookies.js
|
|
8
|
+
* This framework is released under the GNU Public License, version 3 or later.
|
|
9
|
+
* http://www.gnu.org/licenses/gpl-3.0-standalone.html
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Get specific key's value stored in cookie
|
|
13
|
+
*
|
|
14
|
+
* @param sKey
|
|
15
|
+
*/
|
|
16
|
+
export declare function getItem(sKey: string): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Set specific key's value in cookie
|
|
19
|
+
*
|
|
20
|
+
* @param sKey cookie name
|
|
21
|
+
* @param sValue cookie value
|
|
22
|
+
* @param vEnd expire date
|
|
23
|
+
* @param sPath path of current item
|
|
24
|
+
* @param sDomain domain name
|
|
25
|
+
* @param bSecure
|
|
26
|
+
*/
|
|
27
|
+
export declare function setItem(sKey: string, sValue: string | number | boolean, vEnd?: Date, sPath?: string, sDomain?: string, bSecure?: boolean): true;
|
|
28
|
+
/**
|
|
29
|
+
* Remove specific key's value from cookie
|
|
30
|
+
*
|
|
31
|
+
* @param sKey cookie name
|
|
32
|
+
* @param sPath path of current item
|
|
33
|
+
* @param sDomain
|
|
34
|
+
*/
|
|
35
|
+
export declare function removeItem(sKey: string, sPath?: string, sDomain?: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* determine if a specific cookie is exist
|
|
38
|
+
*
|
|
39
|
+
* @param sKey cookie name
|
|
40
|
+
*/
|
|
41
|
+
export declare function hasItem(sKey: string): boolean;
|
|
42
|
+
//# sourceMappingURL=doc-cookies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-cookies.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/ia-book-actions/core/services/doc-cookies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAenD;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EACjC,IAAI,CAAC,EAAE,IAAI,EACX,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,OAAO,GAChB,IAAI,CAWN;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAUT;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAa7C"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper module use to get, set and remove item from cookie
|
|
3
|
+
*
|
|
4
|
+
* See more:
|
|
5
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
|
|
6
|
+
* https://developer.mozilla.org/User:fusionchess
|
|
7
|
+
* https://github.com/madmurphy/cookies.js
|
|
8
|
+
* This framework is released under the GNU Public License, version 3 or later.
|
|
9
|
+
* http://www.gnu.org/licenses/gpl-3.0-standalone.html
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Get specific key's value stored in cookie
|
|
13
|
+
*
|
|
14
|
+
* @param sKey
|
|
15
|
+
*/
|
|
16
|
+
export function getItem(sKey) {
|
|
17
|
+
if (!sKey)
|
|
18
|
+
return null;
|
|
19
|
+
return (decodeURIComponent(document.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*' +
|
|
20
|
+
encodeURIComponent(sKey).replace(/[-.+*]/g, '\\$&') +
|
|
21
|
+
'\\s*\\=\\s*([^;]*).*$)|^.*$'), '$1')) || null);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Set specific key's value in cookie
|
|
25
|
+
*
|
|
26
|
+
* @param sKey cookie name
|
|
27
|
+
* @param sValue cookie value
|
|
28
|
+
* @param vEnd expire date
|
|
29
|
+
* @param sPath path of current item
|
|
30
|
+
* @param sDomain domain name
|
|
31
|
+
* @param bSecure
|
|
32
|
+
*/
|
|
33
|
+
export function setItem(sKey, sValue, vEnd, sPath, sDomain, bSecure) {
|
|
34
|
+
document.cookie =
|
|
35
|
+
encodeURIComponent(sKey) +
|
|
36
|
+
'=' +
|
|
37
|
+
encodeURIComponent(sValue) +
|
|
38
|
+
(vEnd ? `; expires=${vEnd.toUTCString()}` : '') +
|
|
39
|
+
(sDomain ? `; domain=${sDomain}` : '') +
|
|
40
|
+
(sPath ? `; path=${sPath}` : '') +
|
|
41
|
+
(bSecure ? `; secure` : '');
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Remove specific key's value from cookie
|
|
46
|
+
*
|
|
47
|
+
* @param sKey cookie name
|
|
48
|
+
* @param sPath path of current item
|
|
49
|
+
* @param sDomain
|
|
50
|
+
*/
|
|
51
|
+
export function removeItem(sKey, sPath, sDomain) {
|
|
52
|
+
if (!hasItem(sKey))
|
|
53
|
+
return false;
|
|
54
|
+
document.cookie =
|
|
55
|
+
encodeURIComponent(sKey) +
|
|
56
|
+
`=; expires=Thu, 01 Jan 1970 00:00:00 GMT` +
|
|
57
|
+
(sDomain ? `; domain=${sDomain}` : '') +
|
|
58
|
+
(sPath ? `; path=${sPath}` : '');
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* determine if a specific cookie is exist
|
|
63
|
+
*
|
|
64
|
+
* @param sKey cookie name
|
|
65
|
+
*/
|
|
66
|
+
export function hasItem(sKey) {
|
|
67
|
+
const reCNameAllowed = /^(?:expires|max-age|path|domain|secure|samesite|httponly)$/i;
|
|
68
|
+
if (!sKey || reCNameAllowed.test(sKey)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return new RegExp('(?:^|;\\s*)' +
|
|
72
|
+
encodeURIComponent(sKey).replace(/[-.+*]/g, '\\$&') +
|
|
73
|
+
'\\s*\\=').test(document.cookie);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=doc-cookies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-cookies.js","sourceRoot":"","sources":["../../../../../../src/elements/ia-book-actions/core/services/doc-cookies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,OAAO,CACL,kBAAkB,CAChB,QAAQ,CAAC,MAAM,CAAC,OAAO,CACrB,IAAI,MAAM,CACR,kBAAkB;QAChB,kBAA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cAAc,GAClB,6DAA6D,CAAC;IAEhE,IAAI,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACvC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,MAAM,CACf,aAAa;QACX,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;QACnD,SAAS,CACZ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["/**\n * Helper module use to get, set and remove item from cookie\n *\n * See more:\n * https://developer.mozilla.org/en-US/docs/Web/API/document.cookie\n * https://developer.mozilla.org/User:fusionchess\n * https://github.com/madmurphy/cookies.js\n * This framework is released under the GNU Public License, version 3 or later.\n * http://www.gnu.org/licenses/gpl-3.0-standalone.html\n */\n\n/**\n * Get specific key's value stored in cookie\n *\n * @param sKey\n */\nexport function getItem(sKey: string): string | null {\n if (!sKey) return null;\n\n return (\n decodeURIComponent(\n document.cookie.replace(\n new RegExp(\n '(?:(?:^|.*;)\\\\s*' +\n encodeURIComponent(sKey).replace(/[-.+*]/g, '\\\\$&') +\n '\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$',\n ),\n '$1',\n ),\n ) || null\n );\n}\n\n/**\n * Set specific key's value in cookie\n *\n * @param sKey cookie name\n * @param sValue cookie value\n * @param vEnd expire date\n * @param sPath path of current item\n * @param sDomain domain name\n * @param bSecure\n */\nexport function setItem(\n sKey: string,\n sValue: string | number | boolean,\n vEnd?: Date,\n sPath?: string,\n sDomain?: string,\n bSecure?: boolean,\n): true {\n document.cookie =\n encodeURIComponent(sKey) +\n '=' +\n encodeURIComponent(sValue) +\n (vEnd ? `; expires=${vEnd.toUTCString()}` : '') +\n (sDomain ? `; domain=${sDomain}` : '') +\n (sPath ? `; path=${sPath}` : '') +\n (bSecure ? `; secure` : '');\n\n return true;\n}\n\n/**\n * Remove specific key's value from cookie\n *\n * @param sKey cookie name\n * @param sPath path of current item\n * @param sDomain\n */\nexport function removeItem(\n sKey: string,\n sPath?: string,\n sDomain?: string,\n): boolean {\n if (!hasItem(sKey)) return false;\n\n document.cookie =\n encodeURIComponent(sKey) +\n `=; expires=Thu, 01 Jan 1970 00:00:00 GMT` +\n (sDomain ? `; domain=${sDomain}` : '') +\n (sPath ? `; path=${sPath}` : '');\n\n return true;\n}\n\n/**\n * determine if a specific cookie is exist\n *\n * @param sKey cookie name\n */\nexport function hasItem(sKey: string): boolean {\n const reCNameAllowed =\n /^(?:expires|max-age|path|domain|secure|samesite|httponly)$/i;\n\n if (!sKey || reCNameAllowed.test(sKey)) {\n return false;\n }\n\n return new RegExp(\n '(?:^|;\\\\s*)' +\n encodeURIComponent(sKey).replace(/[-.+*]/g, '\\\\$&') +\n '\\\\s*\\\\=',\n ).test(document.cookie);\n}\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import ActionsConfig from './actions-config.js';
|
|
2
|
+
import type { LendingActions, LendingStatus } from '../../models.js';
|
|
3
|
+
/**
|
|
4
|
+
* This is the main controller/service class helps to fetch different action buttons
|
|
5
|
+
* from a lendable item.
|
|
6
|
+
*
|
|
7
|
+
* We are showing action button in two column
|
|
8
|
+
* 1. primaryAction: contains primary action button like Browse, Borrow, Return, Waitlist etc...
|
|
9
|
+
* 2. secondaryActions: container secondary action button like Admin Access, Purchase link etc...
|
|
10
|
+
*
|
|
11
|
+
* Response of this class contain an object as follows:-
|
|
12
|
+
* {
|
|
13
|
+
* primaryTitle: '',
|
|
14
|
+
* primaryActions: [this.actionsConfig.returnBookConfig()],
|
|
15
|
+
* primaryColor: 'primary',
|
|
16
|
+
* secondaryActions: [this.actionsConfig.purchaseConfig()],
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* Explanation of above fields are as follows:-
|
|
20
|
+
* 1. primaryTitle: Describe current loan status of this book.
|
|
21
|
+
* 2. primaryActions: Consists an array of action buttons (Browse, Borrow, Return) based on loanStatus.
|
|
22
|
+
* The action buttons configuration is coming from ActionsConfig class.
|
|
23
|
+
* 3. primaryColor: Color of initial action button and dropdown button on mobile devices.
|
|
24
|
+
* 4. secondaryActions: Consists an array of action buttons (Admin Acess, Purchase Link) based on availability.
|
|
25
|
+
* The action buttons configuration is coming from ActionsConfig class.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Book titles. Each one is looked up when it is read, so it follows the
|
|
29
|
+
* active locale.
|
|
30
|
+
*/
|
|
31
|
+
export declare const bookTitles: {
|
|
32
|
+
readonly available_1hr: string;
|
|
33
|
+
readonly available_14d: string;
|
|
34
|
+
readonly available_pd: string;
|
|
35
|
+
readonly available_waitlist: string;
|
|
36
|
+
readonly admin_access: string;
|
|
37
|
+
readonly claim_waitlist: string;
|
|
38
|
+
readonly being_borrowed: string;
|
|
39
|
+
readonly eligible_pd: string;
|
|
40
|
+
readonly on_waitlist: string;
|
|
41
|
+
readonly session_expired: string;
|
|
42
|
+
readonly unavailable: string;
|
|
43
|
+
};
|
|
44
|
+
export declare class GetLendingActions {
|
|
45
|
+
userid: string;
|
|
46
|
+
identifier: string;
|
|
47
|
+
lendingStatus: LendingStatus;
|
|
48
|
+
bwbPurchaseUrl: string;
|
|
49
|
+
actionsConfig: ActionsConfig;
|
|
50
|
+
constructor(userid: string, identifier: string, lendingStatus: LendingStatus, bwbPurchaseUrl: string);
|
|
51
|
+
onlyAdminAction(): LendingActions;
|
|
52
|
+
adminOrPrintDisabledReadingAction(): LendingActions;
|
|
53
|
+
patronIsReadingAction(): LendingActions;
|
|
54
|
+
claimWaitlistAction(): LendingActions;
|
|
55
|
+
borrowPrintDisabledAction(): LendingActions;
|
|
56
|
+
onlyPrintDisabledAction(): LendingActions;
|
|
57
|
+
onWaitlistAction(): LendingActions;
|
|
58
|
+
restrictedAction(): LendingActions;
|
|
59
|
+
loggedOutOptions(): LendingActions;
|
|
60
|
+
borrow1HrAction(): LendingActions;
|
|
61
|
+
borrowAction(): LendingActions;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated
|
|
64
|
+
*
|
|
65
|
+
* Builds the countdown toolbar title.
|
|
66
|
+
*
|
|
67
|
+
* @return string innerHTML for the dialogOpts title attribute
|
|
68
|
+
*/
|
|
69
|
+
getBrowseCountdownTitle(): string;
|
|
70
|
+
getCurrentLendingActions(): LendingActions;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=get-lending-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-lending-actions.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/ia-book-actions/core/services/get-lending-actions.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAgB,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;GAGG;AACH,eAAO,MAAM,UAAU;4BACA,MAAM;4BAGN,MAAM;2BAGP,MAAM;iCAGA,MAAM;2BAGZ,MAAM;6BAGJ,MAAM;6BAGN,MAAM;0BAGT,MAAM;0BAGN,MAAM;8BAGF,MAAM;0BAGV,MAAM;CAG1B,CAAC;AAOF,qBAAa,iBAAiB;IAC5B,MAAM,EAAE,MAAM,CAAC;IAEf,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,EAAE,aAAa,CAAC;IAE7B,cAAc,EAAE,MAAM,CAAC;IAEvB,aAAa,EAAE,aAAa,CAAC;gBAG3B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,MAAM;IAcxB,eAAe,IAAI,cAAc;IAYjC,iCAAiC,IAAI,cAAc;IASnD,qBAAqB,IAAI,cAAc;IAmCvC,mBAAmB,IAAI,cAAc;IAyBrC,yBAAyB,IAAI,cAAc;IAY3C,uBAAuB,IAAI,cAAc;IAYzC,gBAAgB,IAAI,cAAc;IAgBlC,gBAAgB,IAAI,cAAc;IAoBlC,gBAAgB,IAAI,cAAc;IA2ClC,eAAe,IAAI,cAAc;IAkEjC,YAAY,IAAI,cAAc;IA8C9B;;;;;;OAMG;IACH,uBAAuB,IAAI,MAAM;IAiBjC,wBAAwB,IAAI,cAAc;CA4D3C"}
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { msg, str } from '@lit/localize';
|
|
2
|
+
import { URLHelper } from '../config/url-helper.js';
|
|
3
|
+
import ActionsConfig from './actions-config.js';
|
|
4
|
+
/**
|
|
5
|
+
* This is the main controller/service class helps to fetch different action buttons
|
|
6
|
+
* from a lendable item.
|
|
7
|
+
*
|
|
8
|
+
* We are showing action button in two column
|
|
9
|
+
* 1. primaryAction: contains primary action button like Browse, Borrow, Return, Waitlist etc...
|
|
10
|
+
* 2. secondaryActions: container secondary action button like Admin Access, Purchase link etc...
|
|
11
|
+
*
|
|
12
|
+
* Response of this class contain an object as follows:-
|
|
13
|
+
* {
|
|
14
|
+
* primaryTitle: '',
|
|
15
|
+
* primaryActions: [this.actionsConfig.returnBookConfig()],
|
|
16
|
+
* primaryColor: 'primary',
|
|
17
|
+
* secondaryActions: [this.actionsConfig.purchaseConfig()],
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* Explanation of above fields are as follows:-
|
|
21
|
+
* 1. primaryTitle: Describe current loan status of this book.
|
|
22
|
+
* 2. primaryActions: Consists an array of action buttons (Browse, Borrow, Return) based on loanStatus.
|
|
23
|
+
* The action buttons configuration is coming from ActionsConfig class.
|
|
24
|
+
* 3. primaryColor: Color of initial action button and dropdown button on mobile devices.
|
|
25
|
+
* 4. secondaryActions: Consists an array of action buttons (Admin Acess, Purchase Link) based on availability.
|
|
26
|
+
* The action buttons configuration is coming from ActionsConfig class.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Book titles. Each one is looked up when it is read, so it follows the
|
|
30
|
+
* active locale.
|
|
31
|
+
*/
|
|
32
|
+
export const bookTitles = {
|
|
33
|
+
get available_1hr() {
|
|
34
|
+
return msg('Renews automatically with continued use.');
|
|
35
|
+
},
|
|
36
|
+
get available_14d() {
|
|
37
|
+
return msg('This book can be borrowed for 14 days.');
|
|
38
|
+
},
|
|
39
|
+
get available_pd() {
|
|
40
|
+
return msg('Book available to patrons with print disabilities.');
|
|
41
|
+
},
|
|
42
|
+
get available_waitlist() {
|
|
43
|
+
return msg('A waitlist is available.');
|
|
44
|
+
},
|
|
45
|
+
get admin_access() {
|
|
46
|
+
return msg('You have administrative privileges to read this book.');
|
|
47
|
+
},
|
|
48
|
+
get claim_waitlist() {
|
|
49
|
+
return msg('You are at the top of the waitlist for this book.');
|
|
50
|
+
},
|
|
51
|
+
get being_borrowed() {
|
|
52
|
+
return msg('Another patron is using this book. Please check back later.');
|
|
53
|
+
},
|
|
54
|
+
get eligible_pd() {
|
|
55
|
+
return msg('You are eligible for print-disabled access.');
|
|
56
|
+
},
|
|
57
|
+
get on_waitlist() {
|
|
58
|
+
return msg('You are on the waitlist for this book.');
|
|
59
|
+
},
|
|
60
|
+
get session_expired() {
|
|
61
|
+
return msg('Renews automatically with continued use.');
|
|
62
|
+
},
|
|
63
|
+
get unavailable() {
|
|
64
|
+
return msg('This book is not available at this time.');
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
/** True when both numbers are known and `count` has reached `limit`. */
|
|
68
|
+
function hasReached(count, limit) {
|
|
69
|
+
return count !== undefined && limit !== undefined && count >= limit;
|
|
70
|
+
}
|
|
71
|
+
export class GetLendingActions {
|
|
72
|
+
constructor(userid, identifier, lendingStatus, bwbPurchaseUrl) {
|
|
73
|
+
this.userid = userid;
|
|
74
|
+
this.identifier = identifier;
|
|
75
|
+
this.lendingStatus = lendingStatus;
|
|
76
|
+
this.bwbPurchaseUrl = bwbPurchaseUrl;
|
|
77
|
+
this.actionsConfig = new ActionsConfig(this.userid, this.identifier, this.lendingStatus, this.bwbPurchaseUrl);
|
|
78
|
+
}
|
|
79
|
+
onlyAdminAction() {
|
|
80
|
+
return {
|
|
81
|
+
primaryTitle: bookTitles.admin_access,
|
|
82
|
+
primaryActions: [],
|
|
83
|
+
primaryColor: 'primary',
|
|
84
|
+
secondaryActions: [
|
|
85
|
+
this.actionsConfig.adminAccessConfig(),
|
|
86
|
+
this.actionsConfig.purchaseConfig(),
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
adminOrPrintDisabledReadingAction() {
|
|
91
|
+
return {
|
|
92
|
+
primaryTitle: '',
|
|
93
|
+
primaryActions: [],
|
|
94
|
+
secondaryActions: [this.actionsConfig.adminOrPrintDisabledExitConfig()],
|
|
95
|
+
borrowType: 'adminBorrowed',
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
patronIsReadingAction() {
|
|
99
|
+
const lendingStatus = this.lendingStatus || {};
|
|
100
|
+
const disableBorrow = hasReached(lendingStatus.loanCount, lendingStatus.maxLoans);
|
|
101
|
+
let primaryTitleText = '';
|
|
102
|
+
const isBrowsing = lendingStatus.user_has_browsed && !lendingStatus.browsingExpired;
|
|
103
|
+
if (isBrowsing) {
|
|
104
|
+
primaryTitleText = bookTitles.available_1hr;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
primaryTitleText = msg(str `Your loan of this book has ${lendingStatus.daysLeftOnLoan} days left.`);
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
primaryTitle: primaryTitleText,
|
|
111
|
+
primaryActions: [
|
|
112
|
+
this.actionsConfig.returnBookConfig(),
|
|
113
|
+
this.actionsConfig.borrowBookConfig(disableBorrow),
|
|
114
|
+
this.actionsConfig.waitlistConfig(),
|
|
115
|
+
this.actionsConfig.printDisabilityConfig(),
|
|
116
|
+
],
|
|
117
|
+
primaryColor: 'danger',
|
|
118
|
+
secondaryActions: [
|
|
119
|
+
this.actionsConfig.adminAccessConfig(),
|
|
120
|
+
this.actionsConfig.purchaseConfig(),
|
|
121
|
+
],
|
|
122
|
+
borrowType: isBrowsing ? 'browsed' : 'borrowed',
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
claimWaitlistAction() {
|
|
126
|
+
const lendingStatus = this.lendingStatus || {};
|
|
127
|
+
const leaveWaitlist = this.actionsConfig.leaveWaitlistConfig();
|
|
128
|
+
const borrowBook = this.actionsConfig.borrowBookConfig();
|
|
129
|
+
const browseBook = lendingStatus.available_to_browse
|
|
130
|
+
? this.actionsConfig.firstBrowseConfig()
|
|
131
|
+
: null;
|
|
132
|
+
const actions = [borrowBook];
|
|
133
|
+
if (browseBook)
|
|
134
|
+
actions.push(browseBook);
|
|
135
|
+
actions.push(leaveWaitlist);
|
|
136
|
+
return {
|
|
137
|
+
primaryTitle: bookTitles.claim_waitlist,
|
|
138
|
+
primaryActions: actions,
|
|
139
|
+
primaryColor: 'primary',
|
|
140
|
+
footer: 'printDisabilityLine()',
|
|
141
|
+
secondaryActions: [
|
|
142
|
+
this.actionsConfig.adminAccessConfig(),
|
|
143
|
+
this.actionsConfig.purchaseConfig(),
|
|
144
|
+
],
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
borrowPrintDisabledAction() {
|
|
148
|
+
return {
|
|
149
|
+
primaryTitle: bookTitles.eligible_pd,
|
|
150
|
+
primaryActions: [this.actionsConfig.borrowBookConfig()],
|
|
151
|
+
primaryColor: 'primary',
|
|
152
|
+
secondaryActions: [
|
|
153
|
+
this.actionsConfig.adminAccessConfig(),
|
|
154
|
+
this.actionsConfig.purchaseConfig(),
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
onlyPrintDisabledAction() {
|
|
159
|
+
const unavailable = !this.lendingStatus.isAdmin
|
|
160
|
+
? this.actionsConfig.unavailableBookConfig()
|
|
161
|
+
: null;
|
|
162
|
+
return {
|
|
163
|
+
primaryTitle: bookTitles.available_pd,
|
|
164
|
+
primaryActions: [unavailable],
|
|
165
|
+
primaryColor: 'primary',
|
|
166
|
+
secondaryActions: [],
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
onWaitlistAction() {
|
|
170
|
+
return {
|
|
171
|
+
primaryTitle: bookTitles.on_waitlist,
|
|
172
|
+
primaryActions: [
|
|
173
|
+
this.actionsConfig.leaveWaitlistConfig(),
|
|
174
|
+
this.actionsConfig.firstBrowseConfig(),
|
|
175
|
+
],
|
|
176
|
+
primaryColor: 'primary',
|
|
177
|
+
secondaryActions: [
|
|
178
|
+
this.actionsConfig.adminAccessConfig(),
|
|
179
|
+
this.actionsConfig.purchaseConfig(),
|
|
180
|
+
],
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
// check restricted item behaviour here /activemeasuresse0000ridt
|
|
184
|
+
restrictedAction() {
|
|
185
|
+
const lendingStatus = this.lendingStatus || {};
|
|
186
|
+
const anotherPatronUsing = lendingStatus.max_browsable_copies &&
|
|
187
|
+
!lendingStatus.available_lendable_copies;
|
|
188
|
+
const title = anotherPatronUsing
|
|
189
|
+
? bookTitles.being_borrowed
|
|
190
|
+
: bookTitles.unavailable;
|
|
191
|
+
return {
|
|
192
|
+
primaryTitle: title,
|
|
193
|
+
primaryActions: [this.actionsConfig.unavailableBookConfig()],
|
|
194
|
+
primaryColor: 'primary',
|
|
195
|
+
secondaryActions: [
|
|
196
|
+
this.actionsConfig.adminAccessConfig(),
|
|
197
|
+
this.actionsConfig.purchaseConfig(),
|
|
198
|
+
],
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
loggedOutOptions() {
|
|
202
|
+
const lendingStatus = this.lendingStatus || {};
|
|
203
|
+
const showCantBorrowPlaceholder = !lendingStatus.available_to_waitlist &&
|
|
204
|
+
!lendingStatus.available_to_borrow;
|
|
205
|
+
const waitlist = this.actionsConfig.waitlistConfig();
|
|
206
|
+
let borrow = null;
|
|
207
|
+
if (lendingStatus.available_to_borrow ||
|
|
208
|
+
lendingStatus.available_to_browse) {
|
|
209
|
+
borrow = this.actionsConfig.loginAndBorrowBookConfig();
|
|
210
|
+
}
|
|
211
|
+
else if (showCantBorrowPlaceholder) {
|
|
212
|
+
borrow = this.actionsConfig.unavailableBookConfig();
|
|
213
|
+
}
|
|
214
|
+
const printDisability = this.actionsConfig.printDisabilityConfig();
|
|
215
|
+
const actions = [borrow, waitlist, printDisability].filter((action) => {
|
|
216
|
+
return action !== null;
|
|
217
|
+
});
|
|
218
|
+
const title = lendingStatus.available_to_browse
|
|
219
|
+
? bookTitles.available_1hr
|
|
220
|
+
: lendingStatus.available_to_borrow
|
|
221
|
+
? bookTitles.available_14d
|
|
222
|
+
: bookTitles.unavailable;
|
|
223
|
+
return {
|
|
224
|
+
primaryTitle: title,
|
|
225
|
+
primaryActions: actions,
|
|
226
|
+
primaryColor: 'primary',
|
|
227
|
+
footer: 'printDisabilityLine()',
|
|
228
|
+
secondaryActions: [
|
|
229
|
+
this.actionsConfig.adminAccessConfig(),
|
|
230
|
+
this.actionsConfig.purchaseConfig(),
|
|
231
|
+
],
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
borrow1HrAction() {
|
|
235
|
+
const lendingStatus = this.lendingStatus || {};
|
|
236
|
+
// assess borrowable state
|
|
237
|
+
const browsingHasExpired = !lendingStatus.available_to_browse && lendingStatus.browsingExpired;
|
|
238
|
+
const canBrowse = lendingStatus.available_to_browse || browsingHasExpired;
|
|
239
|
+
const canBrowseAndBorrow = canBrowse && lendingStatus.available_to_borrow;
|
|
240
|
+
const canBrowseHasWaitlist = canBrowse &&
|
|
241
|
+
!lendingStatus.available_to_borrow &&
|
|
242
|
+
lendingStatus.available_to_waitlist;
|
|
243
|
+
const canBrowseCantBorrowCantWaitlist = canBrowse &&
|
|
244
|
+
!lendingStatus.available_to_borrow &&
|
|
245
|
+
!lendingStatus.available_to_waitlist;
|
|
246
|
+
const availableCopies = lendingStatus.available_browsable_copies;
|
|
247
|
+
const maxCopies = lendingStatus.max_browsable_copies;
|
|
248
|
+
const allBrowsableCopiesTaken = availableCopies !== undefined &&
|
|
249
|
+
maxCopies !== undefined &&
|
|
250
|
+
availableCopies < 1 &&
|
|
251
|
+
availableCopies < maxCopies;
|
|
252
|
+
// end config
|
|
253
|
+
const title = browsingHasExpired
|
|
254
|
+
? bookTitles.session_expired
|
|
255
|
+
: !canBrowse && allBrowsableCopiesTaken
|
|
256
|
+
? bookTitles.being_borrowed
|
|
257
|
+
: !canBrowse && lendingStatus.available_to_waitlist
|
|
258
|
+
? bookTitles.available_waitlist
|
|
259
|
+
: bookTitles.available_1hr;
|
|
260
|
+
// one hour borrow config
|
|
261
|
+
const oneHrBorrow = browsingHasExpired
|
|
262
|
+
? this.actionsConfig.browseAgainConfig()
|
|
263
|
+
: this.actionsConfig.firstBrowseConfig();
|
|
264
|
+
const borrow = this.actionsConfig.borrowBookConfig();
|
|
265
|
+
const waitlist = this.actionsConfig.waitlistConfig();
|
|
266
|
+
const printDisability = this.actionsConfig.printDisabilityConfig();
|
|
267
|
+
const dropdownOptions = canBrowseAndBorrow
|
|
268
|
+
? [oneHrBorrow, borrow, printDisability]
|
|
269
|
+
: canBrowseHasWaitlist
|
|
270
|
+
? [oneHrBorrow, waitlist, printDisability]
|
|
271
|
+
: [];
|
|
272
|
+
const actions = canBrowseCantBorrowCantWaitlist
|
|
273
|
+
? [oneHrBorrow, printDisability]
|
|
274
|
+
: dropdownOptions;
|
|
275
|
+
return {
|
|
276
|
+
primaryTitle: title,
|
|
277
|
+
primaryActions: actions,
|
|
278
|
+
primaryColor: 'primary',
|
|
279
|
+
footer: 'printDisabilityLine()',
|
|
280
|
+
secondaryActions: [
|
|
281
|
+
this.actionsConfig.adminAccessConfig(),
|
|
282
|
+
this.actionsConfig.purchaseConfig(),
|
|
283
|
+
],
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
borrowAction() {
|
|
287
|
+
const lendingStatus = this.lendingStatus || {};
|
|
288
|
+
const isLoggedIn = !!this.userid;
|
|
289
|
+
if (!isLoggedIn) {
|
|
290
|
+
return this.loggedOutOptions();
|
|
291
|
+
}
|
|
292
|
+
if (lendingStatus.available_to_browse || lendingStatus.browsingExpired) {
|
|
293
|
+
return this.borrow1HrAction();
|
|
294
|
+
}
|
|
295
|
+
/* Borrow 14day */
|
|
296
|
+
let borrow = null;
|
|
297
|
+
const waitlist = this.actionsConfig.waitlistConfig();
|
|
298
|
+
const printDisability = this.actionsConfig.printDisabilityConfig();
|
|
299
|
+
const disableBorrow = hasReached(lendingStatus.loanCount, lendingStatus.maxLoans);
|
|
300
|
+
const cantBorrowNorWaitlist = !lendingStatus.available_to_borrow && !waitlist;
|
|
301
|
+
if (cantBorrowNorWaitlist) {
|
|
302
|
+
borrow = this.actionsConfig.unavailableBookConfig();
|
|
303
|
+
}
|
|
304
|
+
else if (lendingStatus.available_to_borrow) {
|
|
305
|
+
borrow = this.actionsConfig.borrowBookConfig(disableBorrow);
|
|
306
|
+
}
|
|
307
|
+
const actions = [borrow, waitlist, printDisability].filter((action) => {
|
|
308
|
+
return action !== null;
|
|
309
|
+
});
|
|
310
|
+
return {
|
|
311
|
+
primaryTitle: waitlist ? bookTitles.being_borrowed : '',
|
|
312
|
+
primaryActions: actions,
|
|
313
|
+
primaryColor: 'primary',
|
|
314
|
+
secondaryActions: [
|
|
315
|
+
this.actionsConfig.adminAccessConfig(),
|
|
316
|
+
this.actionsConfig.purchaseConfig(),
|
|
317
|
+
],
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* @deprecated
|
|
322
|
+
*
|
|
323
|
+
* Builds the countdown toolbar title.
|
|
324
|
+
*
|
|
325
|
+
* @return string innerHTML for the dialogOpts title attribute
|
|
326
|
+
*/
|
|
327
|
+
getBrowseCountdownTitle() {
|
|
328
|
+
const secondsRemaining = Number(this.lendingStatus.secondsLeftOnLoan);
|
|
329
|
+
const borrowEndTime = new Date(+new Date() + secondsRemaining * 1000);
|
|
330
|
+
let hour = borrowEndTime.getHours() % 12;
|
|
331
|
+
const minute = ('' + borrowEndTime.getMinutes()).replace(/^(\d{1})$/, '0$1');
|
|
332
|
+
const ampm = borrowEndTime.getHours() > 11 ? ' PM' : ' AM';
|
|
333
|
+
if (hour === 0) {
|
|
334
|
+
hour = 12;
|
|
335
|
+
}
|
|
336
|
+
return 'Borrow ends at ' + hour + ':' + minute + ampm;
|
|
337
|
+
}
|
|
338
|
+
getCurrentLendingActions() {
|
|
339
|
+
let lendingActions;
|
|
340
|
+
const lendingStatus = this.lendingStatus || {};
|
|
341
|
+
const isAdminReading = URLHelper.getQueryParam('admin') == '1' && lendingStatus.isAdmin;
|
|
342
|
+
const userIsPrintdisabledReading = URLHelper.getQueryParam('access') == '1' &&
|
|
343
|
+
lendingStatus.user_is_printdisabled;
|
|
344
|
+
const patronIsReading = lendingStatus.user_has_borrowed ||
|
|
345
|
+
(lendingStatus.user_has_browsed && !lendingStatus.browsingExpired);
|
|
346
|
+
const notBorrowed = !lendingStatus.user_has_borrowed && !lendingStatus.user_has_browsed;
|
|
347
|
+
const notBorrowable = !lendingStatus.available_to_borrow && !lendingStatus.available_to_browse;
|
|
348
|
+
const userCanAccessPrintDisabled = lendingStatus.is_printdisabled && lendingStatus.user_is_printdisabled;
|
|
349
|
+
const canBorrow = (lendingStatus.available_to_browse ||
|
|
350
|
+
lendingStatus.available_to_borrow) &&
|
|
351
|
+
notBorrowed &&
|
|
352
|
+
!lendingStatus.user_on_waitlist;
|
|
353
|
+
// sequential order of hierarchal access from lendingStatus
|
|
354
|
+
// - admin or print-disabled reading
|
|
355
|
+
// - partron reading (browsing/borrowing)
|
|
356
|
+
// - leave waitlist
|
|
357
|
+
// - can borrow print-disabled
|
|
358
|
+
// - can borrow
|
|
359
|
+
// - only print-disabled access
|
|
360
|
+
// - is on waitlist
|
|
361
|
+
// - restricted items
|
|
362
|
+
if (isAdminReading || userIsPrintdisabledReading) {
|
|
363
|
+
lendingActions = this.adminOrPrintDisabledReadingAction();
|
|
364
|
+
}
|
|
365
|
+
else if (lendingStatus.isAdmin && notBorrowed && notBorrowable) {
|
|
366
|
+
lendingActions = this.onlyAdminAction();
|
|
367
|
+
}
|
|
368
|
+
else if (patronIsReading) {
|
|
369
|
+
lendingActions = this.patronIsReadingAction();
|
|
370
|
+
}
|
|
371
|
+
else if (lendingStatus.user_can_claim_waitlist) {
|
|
372
|
+
lendingActions = this.claimWaitlistAction();
|
|
373
|
+
}
|
|
374
|
+
else if (userCanAccessPrintDisabled) {
|
|
375
|
+
lendingActions = this.borrowPrintDisabledAction();
|
|
376
|
+
}
|
|
377
|
+
else if (canBorrow || lendingStatus.browsingExpired) {
|
|
378
|
+
lendingActions = this.borrowAction();
|
|
379
|
+
}
|
|
380
|
+
else if (lendingStatus.isPrintDisabledOnly) {
|
|
381
|
+
lendingActions = this.onlyPrintDisabledAction();
|
|
382
|
+
}
|
|
383
|
+
else if (lendingStatus.user_on_waitlist) {
|
|
384
|
+
lendingActions = this.onWaitlistAction();
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
lendingActions = this.restrictedAction();
|
|
388
|
+
}
|
|
389
|
+
return lendingActions;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
//# sourceMappingURL=get-lending-actions.js.map
|