@nylas/web-elements 1.1.0-canary.3 → 1.1.0-canary.5
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/cjs/add-circle-icon.cjs.entry.js +1 -1
- package/dist/cjs/add-circle-icon_22.cjs.entry.js +20 -20
- package/dist/cjs/archive-icon.cjs.entry.js +1 -1
- package/dist/cjs/archive-icon_7.cjs.entry.js +7 -7
- package/dist/cjs/arrow-icon.cjs.entry.js +1 -1
- package/dist/cjs/bold-icon.cjs.entry.js +1 -1
- package/dist/cjs/bold-icon_3.cjs.entry.js +3 -3
- package/dist/cjs/button-component.cjs.entry.js +1 -1
- package/dist/cjs/calendar-cancel-icon.cjs.entry.js +1 -1
- package/dist/cjs/calendar-check-icon.cjs.entry.js +1 -1
- package/dist/cjs/calendar-check-icon_2.cjs.entry.js +2 -2
- package/dist/cjs/calendar-icon.cjs.entry.js +1 -1
- package/dist/cjs/calendar-info-icon.cjs.entry.js +1 -1
- package/dist/cjs/calendar-patterns-icon.cjs.entry.js +1 -1
- package/dist/cjs/checkmark-circle-icon.cjs.entry.js +1 -1
- package/dist/cjs/chevron-icon.cjs.entry.js +1 -1
- package/dist/cjs/chevron-icon_3.cjs.entry.js +4 -4
- package/dist/cjs/close-icon.cjs.entry.js +1 -1
- package/dist/cjs/document-refresh-icon.cjs.entry.js +1 -1
- package/dist/cjs/flow-icon.cjs.entry.js +1 -1
- package/dist/cjs/folder-icon.cjs.entry.js +1 -1
- package/dist/cjs/forward-icon.cjs.entry.js +1 -1
- package/dist/cjs/forward-icon_6.cjs.entry.js +9 -9
- package/dist/cjs/globe-icon.cjs.entry.js +1 -1
- package/dist/cjs/google-logo-icon.cjs.entry.js +1 -1
- package/dist/cjs/{google-logo-icon_3.cjs.entry.js → google-logo-icon_4.cjs.entry.js} +137 -16
- package/dist/cjs/google-logo-icon_4.cjs.entry.js.map +1 -0
- package/dist/cjs/inbox-icon.cjs.entry.js +1 -1
- package/dist/cjs/index-7af03e3f.js +6 -6
- package/dist/cjs/index-c14ea8f5.js +12 -8
- package/dist/cjs/index.cjs.js +3 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{index.es-68425511.js → index.es-0a0f2d87.js} +9 -4
- package/dist/cjs/index.es-0a0f2d87.js.map +1 -0
- package/dist/cjs/{index.es-447c5aca.js → index.es-b12b7df1.js} +9 -4
- package/dist/cjs/index.es-b12b7df1.js.map +1 -0
- package/dist/cjs/info-icon.cjs.entry.js +1 -1
- package/dist/cjs/info-icon_2.cjs.entry.js +2 -2
- package/dist/cjs/italic-icon.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/loading-icon.cjs.entry.js +1 -1
- package/dist/cjs/location-icon.cjs.entry.js +1 -1
- package/dist/cjs/location-off-icon.cjs.entry.js +1 -1
- package/dist/cjs/{mailbox-store-556bc7b6.js → mailbox-store-05fa3bec.js} +3 -3
- package/dist/cjs/{mailbox-store-556bc7b6.js.map → mailbox-store-05fa3bec.js.map} +1 -1
- package/dist/cjs/{mailbox-store-aacd75ff.js → mailbox-store-14531fd4.js} +3 -3
- package/dist/cjs/{mailbox-store-aacd75ff.js.map → mailbox-store-14531fd4.js.map} +1 -1
- package/dist/cjs/microsoft-logo-icon.cjs.entry.js +1 -1
- package/dist/cjs/multi-select-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/nylas-additional-participants.cjs.entry.js +3 -3
- package/dist/cjs/{nylas-api-request-8ec3a89c.js → nylas-api-request-2a0e7022.js} +17 -7
- package/dist/cjs/nylas-api-request-2a0e7022.js.map +1 -0
- package/dist/cjs/{nylas-api-request-ab24150d.js → nylas-api-request-55923233.js} +17 -7
- package/dist/cjs/nylas-api-request-55923233.js.map +1 -0
- package/dist/cjs/nylas-availability-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booked-event-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js +6 -6
- package/dist/cjs/nylas-booking-calendar-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-booking-form.cjs.entry.js +2 -2
- package/dist/cjs/nylas-buffer-time.cjs.entry.js +2 -2
- package/dist/cjs/nylas-calendar-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-cancel-booking-form.cjs.entry.js +3 -3
- package/dist/cjs/nylas-cancelled-event-card.cjs.entry.js +3 -3
- package/dist/cjs/nylas-composer.cjs.entry.js +2 -2
- package/dist/cjs/nylas-custom-booking-flow.cjs.entry.js +3 -3
- package/dist/cjs/nylas-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js +25 -8
- package/dist/cjs/nylas-editor-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-event-description.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-duration.cjs.entry.js +2 -2
- package/dist/cjs/nylas-event-info.cjs.entry.js +3 -3
- package/dist/cjs/nylas-event-limits.cjs.entry.js +3 -3
- package/dist/cjs/nylas-event-title.cjs.entry.js +2 -2
- package/dist/cjs/nylas-form-card.cjs.entry.js +3 -3
- package/dist/cjs/nylas-if-state.cjs.entry.js +2 -2
- package/dist/cjs/nylas-limit-future-bookings.cjs.entry.js +3 -3
- package/dist/cjs/nylas-list-configurations.cjs.entry.js +114 -0
- package/dist/cjs/nylas-list-configurations.cjs.entry.js.map +1 -0
- package/dist/cjs/nylas-list-folders.cjs.entry.js +3 -3
- package/dist/cjs/nylas-list-threads.cjs.entry.js +3 -3
- package/dist/cjs/nylas-locale-switch.cjs.entry.js +2 -2
- package/dist/cjs/nylas-location-component.cjs.entry.js +5 -5
- package/dist/cjs/nylas-login.cjs.entry.js +3 -3
- package/dist/cjs/nylas-logo.cjs.entry.js +1 -1
- package/dist/cjs/nylas-mailbox-pagination.cjs.entry.js +2 -2
- package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js +3 -3
- package/dist/cjs/nylas-mailbox.cjs.entry.js +4 -4
- package/dist/cjs/nylas-min-cancellation-notice.cjs.entry.js +3 -3
- package/dist/cjs/nylas-notification.cjs.entry.js +2 -2
- package/dist/cjs/nylas-provider.cjs.entry.js +6 -6
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +207 -66
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +6 -6
- package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-selected-event-card.cjs.entry.js +2 -2
- package/dist/cjs/nylas-summarize-message-button.cjs.entry.js +4 -4
- package/dist/cjs/nylas-threads-refresh.cjs.entry.js +4 -4
- package/dist/cjs/nylas-threads-search.cjs.entry.js +3 -3
- package/dist/cjs/nylas-time-window-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-timeslot-picker.cjs.entry.js +2 -2
- package/dist/cjs/nylas-view-email.cjs.entry.js +2 -2
- package/dist/cjs/nylas-view-thread.cjs.entry.js +3 -3
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/cjs/people-icon.cjs.entry.js +1 -1
- package/dist/cjs/play-icon.cjs.entry.js +1 -1
- package/dist/cjs/play-icon_2.cjs.entry.js +2 -2
- package/dist/cjs/refresh-icon.cjs.entry.js +1 -1
- package/dist/cjs/{register-component-d729f3f7.js → register-component-09ebdf31.js} +8 -2
- package/dist/cjs/register-component-09ebdf31.js.map +1 -0
- package/dist/cjs/{register-component-f1ebc65d.js → register-component-c8b6e907.js} +8 -2
- package/dist/cjs/register-component-c8b6e907.js.map +1 -0
- package/dist/cjs/reply-all-icon.cjs.entry.js +1 -1
- package/dist/cjs/reply-icon.cjs.entry.js +1 -1
- package/dist/cjs/{scheduler-config-store-9c2cc421.js → scheduler-config-store-4d93a9b7.js} +8 -1
- package/dist/cjs/scheduler-config-store-4d93a9b7.js.map +1 -0
- package/dist/cjs/{scheduler-config-store-31b83ad3.js → scheduler-config-store-a0e08cab.js} +8 -1
- package/dist/cjs/scheduler-config-store-a0e08cab.js.map +1 -0
- package/dist/cjs/{scheduler-store-7320f5d0.js → scheduler-store-a492526c.js} +2 -2
- package/dist/cjs/{scheduler-store-7320f5d0.js.map → scheduler-store-a492526c.js.map} +1 -1
- package/dist/cjs/{scheduler-store-4cb46b3c.js → scheduler-store-e148a4cc.js} +2 -2
- package/dist/cjs/{scheduler-store-4cb46b3c.js.map → scheduler-store-e148a4cc.js.map} +1 -1
- package/dist/cjs/search-icon.cjs.entry.js +1 -1
- package/dist/cjs/select-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/sent-icon.cjs.entry.js +1 -1
- package/dist/cjs/spam-icon.cjs.entry.js +1 -1
- package/dist/cjs/star-icon.cjs.entry.js +1 -1
- package/dist/cjs/stop-icon.cjs.entry.js +1 -1
- package/dist/cjs/time-period-selector.cjs.entry.js +2 -2
- package/dist/cjs/tooltip-component.cjs.entry.js +1 -1
- package/dist/cjs/translate-icon.cjs.entry.js +1 -1
- package/dist/cjs/trash-icon.cjs.entry.js +1 -1
- package/dist/cjs/underline-icon.cjs.entry.js +1 -1
- package/dist/cjs/{utils-53dd7574.js → utils-20663d54.js} +19 -1
- package/dist/cjs/utils-20663d54.js.map +1 -0
- package/dist/cjs/{utils-53298b01.js → utils-2c7f0895.js} +19 -1
- package/dist/cjs/{utils-53298b01.js.map → utils-2c7f0895.js.map} +1 -1
- package/dist/cjs/warning-icon.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/common/abstract-provider.js +7 -2
- package/dist/collection/common/abstract-provider.js.map +1 -1
- package/dist/collection/common/component-types.js.map +1 -1
- package/dist/collection/common/icons/add-circle.js +1 -1
- package/dist/collection/common/icons/archive.js +1 -1
- package/dist/collection/common/icons/arrow.js +1 -1
- package/dist/collection/common/icons/bold.js +1 -1
- package/dist/collection/common/icons/calendar-cancel.js +1 -1
- package/dist/collection/common/icons/calendar-check.js +1 -1
- package/dist/collection/common/icons/calendar-info.js +1 -1
- package/dist/collection/common/icons/calendar-patterns.js +1 -1
- package/dist/collection/common/icons/calendar.js +1 -1
- package/dist/collection/common/icons/checkmark-circle.js +1 -1
- package/dist/collection/common/icons/chevron.js +1 -1
- package/dist/collection/common/icons/close.js +1 -1
- package/dist/collection/common/icons/document-refresh.js +1 -1
- package/dist/collection/common/icons/flow.js +1 -1
- package/dist/collection/common/icons/folder.js +1 -1
- package/dist/collection/common/icons/forward.js +1 -1
- package/dist/collection/common/icons/globe.js +1 -1
- package/dist/collection/common/icons/google-logo.js +1 -1
- package/dist/collection/common/icons/inbox.js +1 -1
- package/dist/collection/common/icons/info.js +1 -1
- package/dist/collection/common/icons/italic.js +1 -1
- package/dist/collection/common/icons/loading.js +1 -1
- package/dist/collection/common/icons/location-off.js +1 -1
- package/dist/collection/common/icons/location.js +1 -1
- package/dist/collection/common/icons/microsoft-logo.js +1 -1
- package/dist/collection/common/icons/nylas-logo.js +1 -1
- package/dist/collection/common/icons/people.js +1 -1
- package/dist/collection/common/icons/play.js +1 -1
- package/dist/collection/common/icons/refresh.js +1 -1
- package/dist/collection/common/icons/reply-all.js +1 -1
- package/dist/collection/common/icons/reply.js +1 -1
- package/dist/collection/common/icons/search.js +1 -1
- package/dist/collection/common/icons/sent.js +1 -1
- package/dist/collection/common/icons/spam.js +1 -1
- package/dist/collection/common/icons/star.js +1 -1
- package/dist/collection/common/icons/stop.js +1 -1
- package/dist/collection/common/icons/translate.js +1 -1
- package/dist/collection/common/icons/trash.js +1 -1
- package/dist/collection/common/icons/underline.js +1 -1
- package/dist/collection/common/icons/warning.js +1 -1
- package/dist/collection/common/nylas-api-request.js +15 -6
- package/dist/collection/common/nylas-api-request.js.map +1 -1
- package/dist/collection/common/register-component.js +6 -0
- package/dist/collection/common/register-component.js.map +1 -1
- package/dist/collection/common/types.js.map +1 -1
- package/dist/collection/components/design-system/button-component/button-component.js +1 -1
- package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js +2 -2
- package/dist/collection/components/design-system/select-dropdown/select-dropdown.js +2 -2
- package/dist/collection/components/design-system/time-period-selector/time-period-selector.js +1 -1
- package/dist/collection/components/design-system/tooltip-component/toolitp-component.js +1 -1
- package/dist/collection/components/mailbox/nylas-composer/nylas-composer.js +1 -1
- package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.js +1 -1
- package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.js +1 -1
- package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.js +1 -1
- package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.js +1 -1
- package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.js +2 -2
- package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.js +2 -2
- package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.js +1 -1
- package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.js +1 -1
- package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.js +1 -1
- package/dist/collection/components/nylas-login/nylas-login.js +1 -1
- package/dist/collection/components/nylas-provider/nylas-provider.js +1 -1
- package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js +1 -1
- package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +1 -1
- package/dist/collection/components/scheduler/nylas-notification/nylas-notification.js +1 -1
- package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduling.js +5 -5
- package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduling.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-custom-booking-flow/nylas-custom-booking-flow.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.css +15 -8
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +75 -7
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-form-card/nylas-form-card.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.css +105 -0
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js +293 -0
- package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js.map +1 -0
- package/dist/collection/components/scheduler-editor/nylas-location-component/nylas-location-component.js +3 -3
- package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js +1 -1
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/LoginRequired.js +30 -0
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/LoginRequired.js.map +1 -0
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.css +17 -2
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js +90 -40
- package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.js +1 -1
- package/dist/collection/connector/nylas-scheduler-config-connector/index.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler-config.js +114 -26
- package/dist/collection/connector/shared/api/scheduler-config.js.map +1 -1
- package/dist/collection/stores/scheduler-config-store.js +7 -0
- package/dist/collection/stores/scheduler-config-store.js.map +1 -1
- package/dist/collection/utils/utils.js +16 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/collection/utils/utils.spec.js +8 -1
- package/dist/collection/utils/utils.spec.js.map +1 -1
- package/dist/components/add-circle.js +1 -2
- package/dist/components/add-circle.js.map +1 -1
- package/dist/components/archive.js +1 -2
- package/dist/components/archive.js.map +1 -1
- package/dist/components/arrow.js +1 -2
- package/dist/components/arrow.js.map +1 -1
- package/dist/components/bold.js +1 -2
- package/dist/components/bold.js.map +1 -1
- package/dist/components/button-component2.js +1 -2
- package/dist/components/button-component2.js.map +1 -1
- package/dist/components/calendar-cancel.js +1 -2
- package/dist/components/calendar-cancel.js.map +1 -1
- package/dist/components/calendar-check.js +1 -2
- package/dist/components/calendar-check.js.map +1 -1
- package/dist/components/calendar-info.js +1 -2
- package/dist/components/calendar-info.js.map +1 -1
- package/dist/components/calendar-patterns.js +1 -2
- package/dist/components/calendar-patterns.js.map +1 -1
- package/dist/components/calendar.js +1 -2
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/checkmark-circle.js +1 -2
- package/dist/components/checkmark-circle.js.map +1 -1
- package/dist/components/chevron.js +1 -2
- package/dist/components/chevron.js.map +1 -1
- package/dist/components/close.js +1 -2
- package/dist/components/close.js.map +1 -1
- package/dist/components/constants.js +1 -1
- package/dist/components/document-refresh-icon.js +1 -2
- package/dist/components/document-refresh-icon.js.map +1 -1
- package/dist/components/flow.js +1 -2
- package/dist/components/flow.js.map +1 -1
- package/dist/components/focus-visible.js +1 -1
- package/dist/components/folder.js +1 -2
- package/dist/components/folder.js.map +1 -1
- package/dist/components/forward.js +1 -2
- package/dist/components/forward.js.map +1 -1
- package/dist/components/globe.js +1 -2
- package/dist/components/globe.js.map +1 -1
- package/dist/components/google-logo.js +1 -2
- package/dist/components/google-logo.js.map +1 -1
- package/dist/components/inbox.js +1 -2
- package/dist/components/inbox.js.map +1 -1
- package/dist/components/index.d.ts +179 -0
- package/dist/components/index.es.js +201 -4
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index.js +89 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/info.js +1 -2
- package/dist/components/info.js.map +1 -1
- package/dist/components/italic.js +1 -2
- package/dist/components/italic.js.map +1 -1
- package/dist/components/loading.js +1 -2
- package/dist/components/loading.js.map +1 -1
- package/dist/components/location-off.js +1 -2
- package/dist/components/location-off.js.map +1 -1
- package/dist/components/location.js +1 -2
- package/dist/components/location.js.map +1 -1
- package/dist/components/mailbox-store.js +1 -2
- package/dist/components/mailbox-store.js.map +1 -1
- package/dist/components/microsoft-logo.js +1 -2
- package/dist/components/microsoft-logo.js.map +1 -1
- package/dist/components/multi-select-dropdown2.js +2 -3
- package/dist/components/multi-select-dropdown2.js.map +1 -1
- package/dist/components/nylas-additional-participants.js +1 -2
- package/dist/components/nylas-additional-participants.js.map +1 -1
- package/dist/components/nylas-availability-picker2.js +1 -2
- package/dist/components/nylas-availability-picker2.js.map +1 -1
- package/dist/components/nylas-booked-event-card2.js +0 -1
- package/dist/components/nylas-booked-event-card2.js.map +1 -1
- package/dist/components/nylas-booking-calendar-picker2.js +0 -1
- package/dist/components/nylas-booking-calendar-picker2.js.map +1 -1
- package/dist/components/nylas-booking-form2.js +0 -1
- package/dist/components/nylas-booking-form2.js.map +1 -1
- package/dist/components/nylas-buffer-time2.js +0 -1
- package/dist/components/nylas-buffer-time2.js.map +1 -1
- package/dist/components/nylas-calendar-picker2.js +0 -1
- package/dist/components/nylas-calendar-picker2.js.map +1 -1
- package/dist/components/nylas-cancel-booking-form2.js +1 -2
- package/dist/components/nylas-cancel-booking-form2.js.map +1 -1
- package/dist/components/nylas-cancelled-event-card2.js +1 -2
- package/dist/components/nylas-cancelled-event-card2.js.map +1 -1
- package/dist/components/nylas-composer2.js +1 -2
- package/dist/components/nylas-composer2.js.map +1 -1
- package/dist/components/nylas-custom-booking-flow2.js +1 -2
- package/dist/components/nylas-custom-booking-flow2.js.map +1 -1
- package/dist/components/nylas-date-picker2.js +1 -2
- package/dist/components/nylas-date-picker2.js.map +1 -1
- package/dist/components/nylas-editor-tabs2.js +25 -8
- package/dist/components/nylas-editor-tabs2.js.map +1 -1
- package/dist/components/nylas-event-description2.js +0 -1
- package/dist/components/nylas-event-description2.js.map +1 -1
- package/dist/components/nylas-event-duration2.js +0 -1
- package/dist/components/nylas-event-duration2.js.map +1 -1
- package/dist/components/nylas-event-info2.js +1 -2
- package/dist/components/nylas-event-info2.js.map +1 -1
- package/dist/components/nylas-event-limits2.js +1 -2
- package/dist/components/nylas-event-limits2.js.map +1 -1
- package/dist/components/nylas-event-title2.js +1 -2
- package/dist/components/nylas-event-title2.js.map +1 -1
- package/dist/components/nylas-form-card2.js +1 -2
- package/dist/components/nylas-form-card2.js.map +1 -1
- package/dist/components/nylas-if-state.js +0 -1
- package/dist/components/nylas-if-state.js.map +1 -1
- package/dist/components/nylas-limit-future-bookings2.js +1 -2
- package/dist/components/nylas-limit-future-bookings2.js.map +1 -1
- package/dist/components/nylas-list-configurations.d.ts +11 -0
- package/dist/components/nylas-list-configurations.js +8 -0
- package/dist/components/nylas-list-configurations.js.map +1 -0
- package/dist/components/nylas-list-configurations2.js +142 -0
- package/dist/components/nylas-list-configurations2.js.map +1 -0
- package/dist/components/nylas-list-folders.js +2 -3
- package/dist/components/nylas-list-folders.js.map +1 -1
- package/dist/components/nylas-list-threads.js +2 -3
- package/dist/components/nylas-list-threads.js.map +1 -1
- package/dist/components/nylas-locale-switch2.js +0 -1
- package/dist/components/nylas-locale-switch2.js.map +1 -1
- package/dist/components/nylas-location-component2.js +3 -4
- package/dist/components/nylas-location-component2.js.map +1 -1
- package/dist/components/nylas-login.js +1 -2
- package/dist/components/nylas-login.js.map +1 -1
- package/dist/components/nylas-logo2.js +1 -2
- package/dist/components/nylas-logo2.js.map +1 -1
- package/dist/components/nylas-mailbox-pagination.js +0 -1
- package/dist/components/nylas-mailbox-pagination.js.map +1 -1
- package/dist/components/nylas-mailbox-toolbar-button.js +1 -2
- package/dist/components/nylas-mailbox-toolbar-button.js.map +1 -1
- package/dist/components/nylas-mailbox.js +1 -2
- package/dist/components/nylas-mailbox.js.map +1 -1
- package/dist/components/nylas-min-cancellation-notice2.js +1 -2
- package/dist/components/nylas-min-cancellation-notice2.js.map +1 -1
- package/dist/components/nylas-notification2.js +1 -2
- package/dist/components/nylas-notification2.js.map +1 -1
- package/dist/components/nylas-provider.js +1 -2
- package/dist/components/nylas-provider.js.map +1 -1
- package/dist/components/nylas-scheduler-editor.js +317 -128
- package/dist/components/nylas-scheduler-editor.js.map +1 -1
- package/dist/components/nylas-scheduling.js +4 -5
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/nylas-selected-event-card2.js +0 -1
- package/dist/components/nylas-selected-event-card2.js.map +1 -1
- package/dist/components/nylas-summarize-message-button2.js +3 -4
- package/dist/components/nylas-summarize-message-button2.js.map +1 -1
- package/dist/components/nylas-threads-refresh.js +2 -3
- package/dist/components/nylas-threads-refresh.js.map +1 -1
- package/dist/components/nylas-threads-search.js +1 -2
- package/dist/components/nylas-threads-search.js.map +1 -1
- package/dist/components/nylas-time-window-picker2.js +2 -4
- package/dist/components/nylas-time-window-picker2.js.map +1 -1
- package/dist/components/nylas-timeslot-picker2.js +1 -2
- package/dist/components/nylas-timeslot-picker2.js.map +1 -1
- package/dist/components/nylas-view-email2.js +2 -4
- package/dist/components/nylas-view-email2.js.map +1 -1
- package/dist/components/nylas-view-thread.js +2 -3
- package/dist/components/nylas-view-thread.js.map +1 -1
- package/dist/components/people-icon.js +1 -2
- package/dist/components/people-icon.js.map +1 -1
- package/dist/components/play.js +1 -2
- package/dist/components/play.js.map +1 -1
- package/dist/components/refresh.js +1 -2
- package/dist/components/refresh.js.map +1 -1
- package/dist/components/register-component.js +7 -1
- package/dist/components/register-component.js.map +1 -1
- package/dist/components/reply-all.js +1 -2
- package/dist/components/reply-all.js.map +1 -1
- package/dist/components/reply.js +1 -2
- package/dist/components/reply.js.map +1 -1
- package/dist/components/scheduler-config-store.js +8 -1
- package/dist/components/scheduler-config-store.js.map +1 -1
- package/dist/components/scheduler-store.js +1 -1
- package/dist/components/search.js +1 -2
- package/dist/components/search.js.map +1 -1
- package/dist/components/select-dropdown2.js +2 -3
- package/dist/components/select-dropdown2.js.map +1 -1
- package/dist/components/sent.js +1 -2
- package/dist/components/sent.js.map +1 -1
- package/dist/components/spam.js +1 -2
- package/dist/components/spam.js.map +1 -1
- package/dist/components/star.js +1 -2
- package/dist/components/star.js.map +1 -1
- package/dist/components/stop.js +1 -2
- package/dist/components/stop.js.map +1 -1
- package/dist/components/time-period-selector2.js +1 -2
- package/dist/components/time-period-selector2.js.map +1 -1
- package/dist/components/toolitp-component.js +1 -2
- package/dist/components/toolitp-component.js.map +1 -1
- package/dist/components/translate.js +1 -2
- package/dist/components/translate.js.map +1 -1
- package/dist/components/trash.js +1 -2
- package/dist/components/trash.js.map +1 -1
- package/dist/components/underline.js +1 -2
- package/dist/components/underline.js.map +1 -1
- package/dist/components/utils.js +49 -2
- package/dist/components/utils.js.map +1 -1
- package/dist/components/warning.js +1 -2
- package/dist/components/warning.js.map +1 -1
- package/dist/esm/add-circle-icon.entry.js +1 -1
- package/dist/esm/add-circle-icon_22.entry.js +20 -20
- package/dist/esm/archive-icon.entry.js +1 -1
- package/dist/esm/archive-icon_7.entry.js +7 -7
- package/dist/esm/arrow-icon.entry.js +1 -1
- package/dist/esm/bold-icon.entry.js +1 -1
- package/dist/esm/bold-icon_3.entry.js +3 -3
- package/dist/esm/button-component.entry.js +1 -1
- package/dist/esm/calendar-cancel-icon.entry.js +1 -1
- package/dist/esm/calendar-check-icon.entry.js +1 -1
- package/dist/esm/calendar-check-icon_2.entry.js +2 -2
- package/dist/esm/calendar-icon.entry.js +1 -1
- package/dist/esm/calendar-info-icon.entry.js +1 -1
- package/dist/esm/calendar-patterns-icon.entry.js +1 -1
- package/dist/esm/checkmark-circle-icon.entry.js +1 -1
- package/dist/esm/chevron-icon.entry.js +1 -1
- package/dist/esm/chevron-icon_3.entry.js +4 -4
- package/dist/esm/close-icon.entry.js +1 -1
- package/dist/esm/document-refresh-icon.entry.js +1 -1
- package/dist/esm/flow-icon.entry.js +1 -1
- package/dist/esm/folder-icon.entry.js +1 -1
- package/dist/esm/forward-icon.entry.js +1 -1
- package/dist/esm/forward-icon_6.entry.js +9 -9
- package/dist/esm/globe-icon.entry.js +1 -1
- package/dist/esm/google-logo-icon.entry.js +1 -1
- package/dist/esm/{google-logo-icon_3.entry.js → google-logo-icon_4.entry.js} +138 -18
- package/dist/esm/google-logo-icon_4.entry.js.map +1 -0
- package/dist/esm/inbox-icon.entry.js +1 -1
- package/dist/esm/index-7cb0dd3d.js +6 -6
- package/dist/esm/index-8362ce5c.js +12 -8
- package/dist/{nylas-web-elements/index.es-bd511719.js → esm/index.es-2842f8c8.js} +9 -4
- package/dist/esm/index.es-2842f8c8.js.map +1 -0
- package/dist/esm/{index.es-2578c6a5.js → index.es-f57e612a.js} +9 -4
- package/dist/esm/index.es-f57e612a.js.map +1 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/info-icon.entry.js +1 -1
- package/dist/esm/info-icon_2.entry.js +2 -2
- package/dist/esm/italic-icon.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/loading-icon.entry.js +1 -1
- package/dist/esm/location-icon.entry.js +1 -1
- package/dist/esm/location-off-icon.entry.js +1 -1
- package/dist/esm/{mailbox-store-bb21512c.js → mailbox-store-47fc8a1a.js} +3 -3
- package/dist/{nylas-web-elements/mailbox-store-150cc456.js.map → esm/mailbox-store-47fc8a1a.js.map} +1 -1
- package/dist/esm/{mailbox-store-150cc456.js → mailbox-store-d48269de.js} +3 -3
- package/dist/esm/{mailbox-store-150cc456.js.map → mailbox-store-d48269de.js.map} +1 -1
- package/dist/esm/microsoft-logo-icon.entry.js +1 -1
- package/dist/esm/multi-select-dropdown.entry.js +3 -3
- package/dist/esm/nylas-additional-participants.entry.js +3 -3
- package/dist/esm/{nylas-api-request-c97a0153.js → nylas-api-request-3120d9ac.js} +17 -7
- package/dist/esm/nylas-api-request-3120d9ac.js.map +1 -0
- package/dist/{nylas-web-elements/nylas-api-request-55446aba.js → esm/nylas-api-request-4f3dbb72.js} +17 -7
- package/dist/esm/nylas-api-request-4f3dbb72.js.map +1 -0
- package/dist/esm/nylas-availability-picker.entry.js +2 -2
- package/dist/esm/nylas-booked-event-card.entry.js +2 -2
- package/dist/esm/nylas-booked-event-card_10.entry.js +6 -6
- package/dist/esm/nylas-booking-calendar-picker.entry.js +2 -2
- package/dist/esm/nylas-booking-form.entry.js +2 -2
- package/dist/esm/nylas-buffer-time.entry.js +2 -2
- package/dist/esm/nylas-calendar-picker.entry.js +2 -2
- package/dist/esm/nylas-cancel-booking-form.entry.js +3 -3
- package/dist/esm/nylas-cancelled-event-card.entry.js +3 -3
- package/dist/esm/nylas-composer.entry.js +2 -2
- package/dist/esm/nylas-custom-booking-flow.entry.js +3 -3
- package/dist/esm/nylas-date-picker.entry.js +2 -2
- package/dist/esm/nylas-editor-tabs.entry.js +26 -9
- package/dist/esm/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/esm/nylas-event-description.entry.js +2 -2
- package/dist/esm/nylas-event-duration.entry.js +2 -2
- package/dist/esm/nylas-event-info.entry.js +3 -3
- package/dist/esm/nylas-event-limits.entry.js +3 -3
- package/dist/esm/nylas-event-title.entry.js +2 -2
- package/dist/esm/nylas-form-card.entry.js +3 -3
- package/dist/esm/nylas-if-state.entry.js +2 -2
- package/dist/esm/nylas-limit-future-bookings.entry.js +3 -3
- package/dist/esm/nylas-list-configurations.entry.js +110 -0
- package/dist/esm/nylas-list-configurations.entry.js.map +1 -0
- package/dist/esm/nylas-list-folders.entry.js +3 -3
- package/dist/esm/nylas-list-threads.entry.js +3 -3
- package/dist/esm/nylas-locale-switch.entry.js +2 -2
- package/dist/esm/nylas-location-component.entry.js +5 -5
- package/dist/esm/nylas-login.entry.js +3 -3
- package/dist/esm/nylas-logo.entry.js +1 -1
- package/dist/esm/nylas-mailbox-pagination.entry.js +2 -2
- package/dist/esm/nylas-mailbox-toolbar-button.entry.js +3 -3
- package/dist/esm/nylas-mailbox.entry.js +4 -4
- package/dist/esm/nylas-min-cancellation-notice.entry.js +3 -3
- package/dist/esm/nylas-notification.entry.js +2 -2
- package/dist/esm/nylas-provider.entry.js +6 -6
- package/dist/esm/nylas-scheduler-editor.entry.js +208 -67
- package/dist/esm/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/esm/nylas-scheduling.entry.js +6 -6
- package/dist/esm/nylas-scheduling.entry.js.map +1 -1
- package/dist/esm/nylas-selected-event-card.entry.js +2 -2
- package/dist/esm/nylas-summarize-message-button.entry.js +4 -4
- package/dist/esm/nylas-threads-refresh.entry.js +4 -4
- package/dist/esm/nylas-threads-search.entry.js +3 -3
- package/dist/esm/nylas-time-window-picker.entry.js +2 -2
- package/dist/esm/nylas-timeslot-picker.entry.js +2 -2
- package/dist/esm/nylas-view-email.entry.js +2 -2
- package/dist/esm/nylas-view-thread.entry.js +3 -3
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/esm/people-icon.entry.js +1 -1
- package/dist/esm/play-icon.entry.js +1 -1
- package/dist/esm/play-icon_2.entry.js +2 -2
- package/dist/esm/refresh-icon.entry.js +1 -1
- package/dist/esm/{register-component-dc659dc3.js → register-component-cf5c8420.js} +8 -2
- package/dist/esm/register-component-cf5c8420.js.map +1 -0
- package/dist/{nylas-web-elements/register-component-0645dce0.js → esm/register-component-e5afe237.js} +8 -2
- package/dist/esm/register-component-e5afe237.js.map +1 -0
- package/dist/esm/reply-all-icon.entry.js +1 -1
- package/dist/esm/reply-icon.entry.js +1 -1
- package/dist/esm/{scheduler-config-store-bc59545b.js → scheduler-config-store-0efc3519.js} +8 -1
- package/dist/esm/scheduler-config-store-0efc3519.js.map +1 -0
- package/dist/esm/{scheduler-config-store-51ee4f42.js → scheduler-config-store-6222c0ed.js} +8 -1
- package/dist/esm/scheduler-config-store-6222c0ed.js.map +1 -0
- package/dist/esm/{scheduler-store-72116723.js → scheduler-store-39d37291.js} +2 -2
- package/dist/esm/{scheduler-store-4d0a4f8a.js.map → scheduler-store-39d37291.js.map} +1 -1
- package/dist/{nylas-web-elements/scheduler-store-4d0a4f8a.js → esm/scheduler-store-8ddcc496.js} +2 -2
- package/dist/esm/{scheduler-store-72116723.js.map → scheduler-store-8ddcc496.js.map} +1 -1
- package/dist/esm/search-icon.entry.js +1 -1
- package/dist/esm/select-dropdown.entry.js +2 -2
- package/dist/esm/sent-icon.entry.js +1 -1
- package/dist/esm/spam-icon.entry.js +1 -1
- package/dist/esm/star-icon.entry.js +1 -1
- package/dist/esm/stop-icon.entry.js +1 -1
- package/dist/esm/time-period-selector.entry.js +2 -2
- package/dist/esm/tooltip-component.entry.js +1 -1
- package/dist/esm/translate-icon.entry.js +1 -1
- package/dist/esm/trash-icon.entry.js +1 -1
- package/dist/esm/underline-icon.entry.js +1 -1
- package/dist/{nylas-web-elements/utils-3a8d433a.js → esm/utils-73d8a928.js} +18 -2
- package/dist/{nylas-web-elements/utils-3a8d433a.js.map → esm/utils-73d8a928.js.map} +1 -1
- package/dist/esm/{utils-c00bdc3c.js → utils-d6204242.js} +18 -2
- package/dist/esm/utils-d6204242.js.map +1 -0
- package/dist/esm/warning-icon.entry.js +1 -1
- package/dist/nylas-web-elements/add-circle-icon.entry.js +1 -1
- package/dist/nylas-web-elements/archive-icon.entry.js +1 -1
- package/dist/nylas-web-elements/arrow-icon.entry.js +1 -1
- package/dist/nylas-web-elements/bold-icon.entry.js +1 -1
- package/dist/nylas-web-elements/button-component.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-cancel-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-check-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-info-icon.entry.js +1 -1
- package/dist/nylas-web-elements/calendar-patterns-icon.entry.js +1 -1
- package/dist/nylas-web-elements/checkmark-circle-icon.entry.js +1 -1
- package/dist/nylas-web-elements/chevron-icon.entry.js +1 -1
- package/dist/nylas-web-elements/close-icon.entry.js +1 -1
- package/dist/nylas-web-elements/document-refresh-icon.entry.js +1 -1
- package/dist/nylas-web-elements/flow-icon.entry.js +1 -1
- package/dist/nylas-web-elements/folder-icon.entry.js +1 -1
- package/dist/nylas-web-elements/forward-icon.entry.js +1 -1
- package/dist/nylas-web-elements/globe-icon.entry.js +1 -1
- package/dist/nylas-web-elements/google-logo-icon.entry.js +1 -1
- package/dist/nylas-web-elements/inbox-icon.entry.js +1 -1
- package/dist/{esm/index.es-bd511719.js → nylas-web-elements/index.es-2842f8c8.js} +9 -4
- package/dist/nylas-web-elements/index.es-2842f8c8.js.map +1 -0
- package/dist/nylas-web-elements/index.esm.js +3 -1
- package/dist/nylas-web-elements/index.esm.js.map +1 -1
- package/dist/nylas-web-elements/info-icon.entry.js +1 -1
- package/dist/nylas-web-elements/italic-icon.entry.js +1 -1
- package/dist/nylas-web-elements/loading-icon.entry.js +1 -1
- package/dist/nylas-web-elements/location-icon.entry.js +1 -1
- package/dist/nylas-web-elements/location-off-icon.entry.js +1 -1
- package/dist/nylas-web-elements/{mailbox-store-150cc456.js → mailbox-store-d48269de.js} +3 -3
- package/dist/{esm/mailbox-store-bb21512c.js.map → nylas-web-elements/mailbox-store-d48269de.js.map} +1 -1
- package/dist/nylas-web-elements/microsoft-logo-icon.entry.js +1 -1
- package/dist/nylas-web-elements/multi-select-dropdown.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-additional-participants.entry.js +3 -3
- package/dist/{esm/nylas-api-request-55446aba.js → nylas-web-elements/nylas-api-request-4f3dbb72.js} +17 -7
- package/dist/nylas-web-elements/nylas-api-request-4f3dbb72.js.map +1 -0
- package/dist/nylas-web-elements/nylas-availability-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booked-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booking-calendar-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-booking-form.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-buffer-time.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-calendar-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-cancel-booking-form.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-cancelled-event-card.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-composer.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-custom-booking-flow.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-date-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +26 -9
- package/dist/nylas-web-elements/nylas-editor-tabs.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-event-description.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-duration.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-event-info.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-event-limits.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-event-title.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-form-card.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-if-state.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-limit-future-bookings.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-list-configurations.entry.js +110 -0
- package/dist/nylas-web-elements/nylas-list-configurations.entry.js.map +1 -0
- package/dist/nylas-web-elements/nylas-list-folders.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-list-threads.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-locale-switch.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-location-component.entry.js +5 -5
- package/dist/nylas-web-elements/nylas-login.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-logo.entry.js +1 -1
- package/dist/nylas-web-elements/nylas-mailbox-pagination.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-mailbox-toolbar-button.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-mailbox.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-min-cancellation-notice.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-notification.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-provider.entry.js +6 -6
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js +208 -67
- package/dist/nylas-web-elements/nylas-scheduler-editor.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-scheduling.entry.js +6 -6
- package/dist/nylas-web-elements/nylas-scheduling.entry.js.map +1 -1
- package/dist/nylas-web-elements/nylas-selected-event-card.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-summarize-message-button.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-threads-refresh.entry.js +4 -4
- package/dist/nylas-web-elements/nylas-threads-search.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-time-window-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-timeslot-picker.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-view-email.entry.js +2 -2
- package/dist/nylas-web-elements/nylas-view-thread.entry.js +3 -3
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/{p-f48d0571.entry.js → p-04e3a98e.entry.js} +2 -2
- package/dist/nylas-web-elements/p-0edb3b69.entry.js +2 -0
- package/dist/nylas-web-elements/{p-40ed7eab.entry.js → p-1260ac06.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-af22da60.entry.js → p-1655dec3.entry.js} +4 -4
- package/dist/nylas-web-elements/p-1655dec3.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-64364434.entry.js → p-18a936a3.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-df5e9aaf.js → p-1aa7b357.js} +2 -2
- package/dist/nylas-web-elements/{p-b2208193.entry.js → p-1ab25f04.entry.js} +2 -2
- package/dist/nylas-web-elements/p-1c94940d.entry.js +2 -0
- package/dist/nylas-web-elements/{p-d85eecf4.entry.js.map → p-1c94940d.entry.js.map} +1 -1
- package/dist/nylas-web-elements/p-1f843391.js +2 -0
- package/dist/nylas-web-elements/p-1f843391.js.map +1 -0
- package/dist/nylas-web-elements/{p-42a4c2fd.entry.js → p-266f9995.entry.js} +2 -2
- package/dist/nylas-web-elements/p-3116f5cc.js +2 -0
- package/dist/nylas-web-elements/p-3116f5cc.js.map +1 -0
- package/dist/nylas-web-elements/{p-ad9c3cab.entry.js → p-370cdcca.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-2c5d5953.entry.js → p-3f6155de.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-901f9612.js → p-41dc0d93.js} +2 -2
- package/dist/nylas-web-elements/p-41dc0d93.js.map +1 -0
- package/dist/nylas-web-elements/{p-006ab406.entry.js → p-424f4d9a.entry.js} +2 -2
- package/dist/nylas-web-elements/p-47180df9.entry.js +2 -0
- package/dist/nylas-web-elements/{p-5a3809a7.entry.js → p-55368bc0.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-374527e6.entry.js → p-572bf8c2.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-2523c292.entry.js → p-57b753c6.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-a0c2ce03.entry.js → p-605142a9.entry.js} +2 -2
- package/dist/nylas-web-elements/p-618b94cd.entry.js +2 -0
- package/dist/nylas-web-elements/p-618b94cd.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-4d9fceeb.entry.js → p-674b6d5d.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-39b280e2.entry.js → p-6dcc9411.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-395f49eb.entry.js → p-7692056f.entry.js} +2 -2
- package/dist/nylas-web-elements/p-7c55dfa0.entry.js +2 -0
- package/dist/nylas-web-elements/{p-ba3d383f.entry.js.map → p-7c55dfa0.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-9dac153b.entry.js → p-81ea7310.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-a1e27dc5.entry.js → p-858f0aad.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-baa620b4.entry.js → p-8b1a6e27.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-deafc6bc.entry.js → p-945caf14.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-ae01e1cb.entry.js → p-9b195811.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-409d4410.entry.js → p-9c399019.entry.js} +2 -2
- package/dist/nylas-web-elements/p-9d0c0340.entry.js +2 -0
- package/dist/nylas-web-elements/{p-fbbca7a6.entry.js → p-9d4bffbb.entry.js} +2 -2
- package/dist/nylas-web-elements/p-9d75bcb2.entry.js +2 -0
- package/dist/nylas-web-elements/p-9d75bcb2.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-9ea458c3.js +2 -0
- package/dist/nylas-web-elements/p-9ea458c3.js.map +1 -0
- package/dist/nylas-web-elements/{p-7b1bb792.entry.js → p-ae893050.entry.js} +3 -3
- package/dist/nylas-web-elements/{p-d92a0405.entry.js → p-be7124f0.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-3da66838.entry.js → p-c199d203.entry.js} +2 -2
- package/dist/nylas-web-elements/p-c451c9e1.entry.js +2 -0
- package/dist/nylas-web-elements/{p-41c1654e.entry.js.map → p-c451c9e1.entry.js.map} +1 -1
- package/dist/nylas-web-elements/p-c45ac7c6.entry.js +2 -0
- package/dist/nylas-web-elements/{p-d224c7af.entry.js → p-e03b2592.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-9f168ff0.js → p-e22aa0b0.js} +2 -2
- package/dist/nylas-web-elements/{p-408dda49.js → p-eaa9151b.js} +2 -2
- package/dist/nylas-web-elements/p-eaa9151b.js.map +1 -0
- package/dist/nylas-web-elements/{p-3631e6e5.entry.js → p-fe3b8e66.entry.js} +2 -2
- package/dist/nylas-web-elements/people-icon.entry.js +1 -1
- package/dist/nylas-web-elements/play-icon.entry.js +1 -1
- package/dist/nylas-web-elements/refresh-icon.entry.js +1 -1
- package/dist/{esm/register-component-0645dce0.js → nylas-web-elements/register-component-e5afe237.js} +8 -2
- package/dist/nylas-web-elements/register-component-e5afe237.js.map +1 -0
- package/dist/nylas-web-elements/reply-all-icon.entry.js +1 -1
- package/dist/nylas-web-elements/reply-icon.entry.js +1 -1
- package/dist/nylas-web-elements/{scheduler-config-store-bc59545b.js → scheduler-config-store-0efc3519.js} +8 -1
- package/dist/nylas-web-elements/scheduler-config-store-0efc3519.js.map +1 -0
- package/dist/{esm/scheduler-store-4d0a4f8a.js → nylas-web-elements/scheduler-store-8ddcc496.js} +2 -2
- package/dist/nylas-web-elements/{scheduler-store-4d0a4f8a.js.map → scheduler-store-8ddcc496.js.map} +1 -1
- package/dist/nylas-web-elements/search-icon.entry.js +1 -1
- package/dist/nylas-web-elements/select-dropdown.entry.js +2 -2
- package/dist/nylas-web-elements/sent-icon.entry.js +1 -1
- package/dist/nylas-web-elements/spam-icon.entry.js +1 -1
- package/dist/nylas-web-elements/star-icon.entry.js +1 -1
- package/dist/nylas-web-elements/stop-icon.entry.js +1 -1
- package/dist/nylas-web-elements/time-period-selector.entry.js +2 -2
- package/dist/nylas-web-elements/tooltip-component.entry.js +1 -1
- package/dist/nylas-web-elements/translate-icon.entry.js +1 -1
- package/dist/nylas-web-elements/trash-icon.entry.js +1 -1
- package/dist/nylas-web-elements/underline-icon.entry.js +1 -1
- package/dist/{esm/utils-3a8d433a.js → nylas-web-elements/utils-73d8a928.js} +18 -2
- package/dist/{esm/utils-3a8d433a.js.map → nylas-web-elements/utils-73d8a928.js.map} +1 -1
- package/dist/nylas-web-elements/warning-icon.entry.js +1 -1
- package/dist/types/common/component-types.d.ts +3 -1
- package/dist/types/common/nylas-api-request.d.ts +3 -2
- package/dist/types/common/register-component.d.ts +1 -0
- package/dist/types/common/types.d.ts +3 -1
- package/dist/types/components/scheduler/nylas-scheduler/nylas-scheduling.d.ts +1 -1
- package/dist/types/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.d.ts +6 -2
- package/dist/types/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.d.ts +25 -0
- package/dist/types/components/scheduler-editor/nylas-scheduler-editor/LoginRequired.d.ts +4 -0
- package/dist/types/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.d.ts +7 -2
- package/dist/types/components.d.ts +125 -2
- package/dist/types/connector/nylas-scheduler-config-connector/index.d.ts +2 -2
- package/dist/types/connector/shared/api/scheduler-config.d.ts +45 -8
- package/dist/types/stores/scheduler-config-store.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +4 -1
- package/package.json +1 -2
- package/dist/cjs/google-logo-icon_3.cjs.entry.js.map +0 -1
- package/dist/cjs/index.es-447c5aca.js.map +0 -1
- package/dist/cjs/index.es-68425511.js.map +0 -1
- package/dist/cjs/nylas-api-request-8ec3a89c.js.map +0 -1
- package/dist/cjs/nylas-api-request-ab24150d.js.map +0 -1
- package/dist/cjs/register-component-d729f3f7.js.map +0 -1
- package/dist/cjs/register-component-f1ebc65d.js.map +0 -1
- package/dist/cjs/scheduler-config-store-31b83ad3.js.map +0 -1
- package/dist/cjs/scheduler-config-store-9c2cc421.js.map +0 -1
- package/dist/cjs/utils-53dd7574.js.map +0 -1
- package/dist/components/_commonjsHelpers.js +0 -36
- package/dist/components/_commonjsHelpers.js.map +0 -1
- package/dist/components/index2.js +0 -196
- package/dist/components/index2.js.map +0 -1
- package/dist/components/nylas-api-request.js +0 -37
- package/dist/components/nylas-api-request.js.map +0 -1
- package/dist/esm/google-logo-icon_3.entry.js.map +0 -1
- package/dist/esm/index.es-2578c6a5.js.map +0 -1
- package/dist/esm/index.es-bd511719.js.map +0 -1
- package/dist/esm/nylas-api-request-55446aba.js.map +0 -1
- package/dist/esm/nylas-api-request-c97a0153.js.map +0 -1
- package/dist/esm/register-component-0645dce0.js.map +0 -1
- package/dist/esm/register-component-dc659dc3.js.map +0 -1
- package/dist/esm/scheduler-config-store-51ee4f42.js.map +0 -1
- package/dist/esm/scheduler-config-store-bc59545b.js.map +0 -1
- package/dist/esm/utils-c00bdc3c.js.map +0 -1
- package/dist/nylas-web-elements/index.es-bd511719.js.map +0 -1
- package/dist/nylas-web-elements/nylas-api-request-55446aba.js.map +0 -1
- package/dist/nylas-web-elements/p-01bf65c2.entry.js +0 -2
- package/dist/nylas-web-elements/p-408dda49.js.map +0 -1
- package/dist/nylas-web-elements/p-41c1654e.entry.js +0 -2
- package/dist/nylas-web-elements/p-59b6ae90.entry.js +0 -2
- package/dist/nylas-web-elements/p-59b6ae90.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-65fdfb60.js +0 -2
- package/dist/nylas-web-elements/p-65fdfb60.js.map +0 -1
- package/dist/nylas-web-elements/p-901f9612.js.map +0 -1
- package/dist/nylas-web-elements/p-a3d5a1dd.entry.js +0 -2
- package/dist/nylas-web-elements/p-af22da60.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-ba3d383f.entry.js +0 -2
- package/dist/nylas-web-elements/p-bfdc148c.entry.js +0 -2
- package/dist/nylas-web-elements/p-cadc9052.js +0 -2
- package/dist/nylas-web-elements/p-cadc9052.js.map +0 -1
- package/dist/nylas-web-elements/p-d67d1c72.js +0 -2
- package/dist/nylas-web-elements/p-d67d1c72.js.map +0 -1
- package/dist/nylas-web-elements/p-d85eecf4.entry.js +0 -2
- package/dist/nylas-web-elements/p-dc1cee56.entry.js +0 -2
- package/dist/nylas-web-elements/p-dc1cee56.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-de63bc35.entry.js +0 -2
- package/dist/nylas-web-elements/register-component-0645dce0.js.map +0 -1
- package/dist/nylas-web-elements/scheduler-config-store-bc59545b.js.map +0 -1
- /package/dist/nylas-web-elements/{p-f48d0571.entry.js.map → p-04e3a98e.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a3d5a1dd.entry.js.map → p-0edb3b69.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-40ed7eab.entry.js.map → p-1260ac06.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-64364434.entry.js.map → p-18a936a3.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-df5e9aaf.js.map → p-1aa7b357.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-b2208193.entry.js.map → p-1ab25f04.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-42a4c2fd.entry.js.map → p-266f9995.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-ad9c3cab.entry.js.map → p-370cdcca.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2c5d5953.entry.js.map → p-3f6155de.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-006ab406.entry.js.map → p-424f4d9a.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-bfdc148c.entry.js.map → p-47180df9.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-5a3809a7.entry.js.map → p-55368bc0.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-374527e6.entry.js.map → p-572bf8c2.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2523c292.entry.js.map → p-57b753c6.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a0c2ce03.entry.js.map → p-605142a9.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-4d9fceeb.entry.js.map → p-674b6d5d.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-39b280e2.entry.js.map → p-6dcc9411.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-395f49eb.entry.js.map → p-7692056f.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9dac153b.entry.js.map → p-81ea7310.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a1e27dc5.entry.js.map → p-858f0aad.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-baa620b4.entry.js.map → p-8b1a6e27.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-deafc6bc.entry.js.map → p-945caf14.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-ae01e1cb.entry.js.map → p-9b195811.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-409d4410.entry.js.map → p-9c399019.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-01bf65c2.entry.js.map → p-9d0c0340.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-fbbca7a6.entry.js.map → p-9d4bffbb.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-7b1bb792.entry.js.map → p-ae893050.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-d92a0405.entry.js.map → p-be7124f0.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3da66838.entry.js.map → p-c199d203.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-de63bc35.entry.js.map → p-c45ac7c6.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-d224c7af.entry.js.map → p-e03b2592.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9f168ff0.js.map → p-e22aa0b0.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-3631e6e5.entry.js.map → p-fe3b8e66.entry.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"nylas-api-request-55446aba.js","mappings":"MAyCsB,eAAe;CAcpC;MAOY,2BAA2B;IAYtC,YAAY,OAAsB;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;KACxB;IAQD,gBAAgB,CAAC,OAAe;QAC9B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;KAC9B;IAWD,MAAM,OAAO,CAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAoB;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,IAAI,EAAE,EAAE;YAC7C,MAAM;YACN,OAAO,EAAE,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS;YACnD,IAAI;YACJ,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,aAAa,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC;SACjG,CAAe,CAAC;KAClB;IAOD,MAAM,WAAW;QACf,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/E,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC;SACb;QAED,OAAO;YACL,EAAE,EAAE,OAAO,CAAC,GAAG;YACf,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC;KACH;IAOD,MAAM,iBAAiB,CAAC,QAAmB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;KAC1C;;;;;","names":[],"sources":["src/common/nylas-api-request.ts"],"sourcesContent":["import type { NylasSessions } from '@nylas/identity';\n\n/**\n * Arguments for making a request to the Nylas API.\n */\nexport type NylasRequestArgs = {\n method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n path: string;\n body?: any;\n headers?: Record<string, string>;\n};\n\n/**\n * A model representing a user in the Nylas Identity system.\n */\nexport type User = {\n id: string;\n email: string;\n name?: string;\n};\n\n/**\n * Arguments for authenticating a user with the Nylas Identity system.\n */\nexport type AuthArgs = {\n provider?: string;\n scope?: Array<string>;\n loginHint?: string;\n includeGrantScopes?: boolean;\n prompt?: string;\n metadata?: string;\n state?: string;\n};\n\n/**\n * Interface for making requests to the Nylas API.\n *\n * This is an abstract class that is meant to be implemented by customers to provide their own\n * implementation of making requests to the Nylas API. This allows customers to use their own\n * authentication mechanism, or to use a different HTTP client library.\n */\nexport abstract class NylasApiRequest {\n /**\n * This method should make an authenticated request to the Nylas API.\n * @param args NylasRequestArgs\n */\n abstract request<T>(args: NylasRequestArgs): Promise<T>;\n /**\n * This method should return the current user's information.\n */\n abstract currentUser(): Promise<User | null>;\n /**\n * This method should return the URL to redirect the user to for authentication.\n */\n abstract authenticationUrl(authArgs?: AuthArgs): Promise<string | undefined>;\n}\n\n/**\n * A wrapper around the Nylas Identity session that implements the NylasApiRequest interface.\n * This class is used by the Nylas Web Elements to make requests to the Nylas API if no custom\n * implementation of NylasApiRequest is provided.\n */\nexport class NylasIdentityRequestWrapper implements NylasApiRequest {\n /**\n * The Nylas Identity session instance.\n */\n private session: NylasSessions;\n\n /**\n * The grant_id to use for requests, if there is multi-account support\n * enabled in the Nylas Identity settings.\n */\n private activeGrantId?: string;\n\n constructor(session: NylasSessions) {\n this.session = session;\n }\n\n /**\n * This method sets the grant_id to use for requests.\n * This is used when there is multi-account support enabled in the Nylas Identity settings.\n *\n * @param grantId\n */\n setActiveGrantId(grantId: string) {\n this.activeGrantId = grantId;\n }\n\n /**\n * This method makes a request to the Nylas API, using the Nylas Identity's fetch method.\n *\n * The `grants/me/` prefix is added because all requests made from the browser to the Nylas API\n * must be made on behalf of the currently logged in user with a valid access token.\n *\n * @param NylasRequestArgs\n * @returns Promise<T>\n */\n async request<T>({ method, path, body, headers }: NylasRequestArgs): Promise<T> {\n return this.session.fetch(`grants/me/${path}`, {\n method,\n headers: headers ? new Headers(headers) : undefined,\n body,\n ...(this.session.isMultiAccount() && this.activeGrantId ? { grant_id: this.activeGrantId } : {}),\n }) as Promise<T>;\n }\n\n /**\n * This method returns the current (logged in) user's information.\n * If the user is not logged in, it returns null.\n * @returns Promise<User | null>\n */\n async currentUser(): Promise<User | null> {\n const grantId = this.session.isMultiAccount() ? this.activeGrantId : undefined;\n const idToken = await this.session.getProfile(grantId);\n if (!idToken) {\n return null;\n }\n\n return {\n id: idToken.sub,\n email: idToken.email,\n name: idToken.name,\n };\n }\n\n /**\n * This method returns the URL to redirect the user to for authentication.\n * @param authConfig authArgs\n * @returns Promise<string | undefined>\n */\n async authenticationUrl(authArgs?: AuthArgs): Promise<string | undefined> {\n return this.session.auth(authArgs || {});\n }\n}\n"],"version":3}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as c,h as e}from"./p-68c2fadf.js";const a=".sc-close-icon-h{display:flex}";const f=a;const t=class{constructor(e){c(this,e);this.width="16";this.height="16"}render(){return e("svg",{key:"fc5bac9399bb646bdd95f084a7ba6475b2d1a69f",width:"21",height:"21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("g",{key:"9b5ac5fac2583beb647755639af45fbe87921913","clip-path":"url(#a)"},e("path",{key:"96b4b222f11978135af32b3198d96e0cba77bfcd",d:"M5.73 4.574a.75.75 0 1 0-1.061 1.06l4.419 4.42-4.42 4.42a.75.75 0 1 0 1.061 1.06l4.42-4.42 4.419 4.42a.75.75 0 0 0 1.06-1.06l-4.419-4.42 4.42-4.42a.75.75 0 1 0-1.061-1.06l-4.42 4.42-4.419-4.42Z",fill:"currentColor"})),e("defs",{key:"85becca58c32c86afb041ec461e73c59945d3e14"},e("clipPath",{key:"c0e241158efdf7d70b42c1318c99ce4a2e019aff",id:"a"},e("path",{key:"35e32ec342dcc97c22016b9feeac37209f2ce683",fill:"#fff",transform:"translate(.148 .054)",d:"M0 0h20v20H0z"}))))}};t.style=f;export{t as close_icon};
|
|
2
|
-
//# sourceMappingURL=p-01bf65c2.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createComponentEvent","instance","registeredComponent","eventName","CustomEvent","bubbles","composed","detail","unregisterComponentEvent","RegisterComponent","config","target","propKey","componentName","name","debug","origionalCallback","componentWillLoad","error","origionalConnectCallback","connectedCallback","origionalDisconnectCallback","disconnectedCallback","storeToProps","stateToProps","storeToPropsKeys","Array","from","values","stateToPropsKeys","intersection","filter","key","includes","length","join","eventToPropsMap","Map","eventToProps","Object","keys","forEach","set","origionalResult","call","this","host","getElement","dataset","nylasId","defineProperty","get","enumerable","getStoresToProp","authToProp","connectorToProp","fireRegisterEvent","element","event","registrationEventName","dispatchEvent","unregistrationEventName"],"sources":["src/common/register-component.ts"],"sourcesContent":["import { BaseNylasConnectorInterface } from '@/connector/connector-interface';\nimport { debug, error } from '@/utils/utils';\nimport { ComponentInterface, getElement } from '@stencil/core';\nimport { CombinedStoreStateKeys, EventEmitterEventType, ExtractEventEmitterKeys, ExtractEventEmitterProperties } from './types';\nexport interface RegisteredComponent<H extends ComponentInterface, B extends BaseNylasConnectorInterface, MailboxStores = string> {\n name: string;\n element: HTMLElement;\n getStoresToProp?: keyof H;\n storeToProps?: Map<string, keyof H>;\n stateToProps?: Map<MailboxStores, keyof H>;\n eventToProps?: Map<ExtractEventEmitterKeys<H>, (event: CustomEvent<EventEmitterEventType<H[ExtractEventEmitterKeys<H>]>>, nylasConnector: B) => Promise<void>>;\n authToProp?: keyof H;\n connectorToProp?: keyof H;\n registrationEventName?: string;\n unregistrationEventName?: string;\n}\n\nexport function createComponentEvent<T extends ComponentInterface, B extends BaseNylasConnectorInterface>(\n instance: T,\n registeredComponent: RegisteredComponent<T, B>,\n eventName: string = 'registerComponent',\n) {\n return new CustomEvent<RegisteredComponent<typeof instance, B>>(eventName, {\n bubbles: true,\n composed: true,\n detail: registeredComponent,\n });\n}\n\nexport function unregisterComponentEvent<T extends ComponentInterface, B extends BaseNylasConnectorInterface>(\n instance: T,\n registeredComponent: RegisteredComponent<T, B>,\n eventName: string = 'unregisterComponent',\n) {\n return new CustomEvent<RegisteredComponent<typeof instance, B>>(eventName, {\n bubbles: true,\n composed: true,\n detail: registeredComponent,\n });\n}\n\nexport interface RegisterComponentConfig<H extends ComponentInterface, B extends BaseNylasConnectorInterface, MailboxStores>\n extends Omit<RegisteredComponent<H, B, MailboxStores>, 'eventToProps' | 'name' | 'element'> {\n name: string;\n eventToProps?: Partial<{\n [P in ExtractEventEmitterProperties<H> as P['key']]: (event: CustomEvent<P['eventType']>, nylasConnector: B) => Promise<void>;\n }>;\n fireRegisterEvent?: boolean;\n}\n\nexport interface NylasComponentInterface extends ComponentInterface {\n authToProp?: keyof this;\n connectorToProp?: keyof this;\n}\n\nexport function RegisterComponent<H extends NylasComponentInterface, B extends BaseNylasConnectorInterface, MailboxStores extends Record<string, any>>(\n config: RegisterComponentConfig<H, B, CombinedStoreStateKeys<keyof MailboxStores, MailboxStores>>,\n) {\n return (target: H, propKey: string) => {\n const componentName = config.name;\n debug(`[${componentName}] Registering component ${componentName} being called on ${propKey}`);\n\n const origionalCallback = target.componentWillLoad;\n if (!origionalCallback) {\n error(`[${componentName}] componentWillLoad lifecycle method in ${componentName} missing. Required for RegisterComponent decorator.`);\n return;\n }\n\n const origionalConnectCallback = target.connectedCallback;\n if (!origionalConnectCallback) {\n error(`[${componentName}] connectedCallback lifecycle method in ${componentName} missing. Required for RegisterComponent decorator.`);\n return;\n }\n\n const origionalDisconnectCallback = target.disconnectedCallback;\n if (!origionalDisconnectCallback) {\n error(`[${componentName}] disconnectedCallback lifecycle method in ${componentName} missing. Required for RegisterComponent decorator.`);\n return;\n }\n\n // Detect a conflict if config.storeToProps and config.stateToProps are both defined\n // for overlapping prop keys\n if (config.storeToProps && config.stateToProps) {\n const storeToPropsKeys = Array.from(config.storeToProps.values());\n const stateToPropsKeys = Array.from(config.stateToProps.values());\n const intersection = storeToPropsKeys.filter(key => stateToPropsKeys.includes(key));\n if (intersection.length > 0) {\n error(\n `[${componentName}] Overlapping prop keys detected in ${componentName} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${intersection.join(\n ', ',\n )}`,\n );\n return;\n }\n }\n\n // Convert the record of eventToProps to a map\n const eventToPropsMap = new Map<ExtractEventEmitterKeys<H>, (event: CustomEvent<EventEmitterEventType<H[ExtractEventEmitterKeys<H>]>>, nylasConnector: B) => Promise<void>>();\n if (config.eventToProps) {\n Object.keys(config.eventToProps).forEach(key => {\n eventToPropsMap.set(\n key as ExtractEventEmitterKeys<H>,\n config.eventToProps?.[key as ExtractEventEmitterKeys<H>] as (\n event: CustomEvent<EventEmitterEventType<H[ExtractEventEmitterKeys<H>]>>,\n nylasConnector: B,\n ) => Promise<void>,\n );\n });\n }\n\n target.connectedCallback = function () {\n debug(`[~${componentName}] connectedCallback called`);\n const origionalResult = origionalConnectCallback?.call(this);\n const host = getElement(this);\n\n // If the nylas id is already set, then we don't need to do anything\n if (host.dataset.nylasId) {\n return origionalResult;\n }\n\n Object.defineProperty(host, 'registerNylasComponent', {\n get() {\n return true;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'stateToProps', {\n get() {\n return config.stateToProps;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'getStoresToProp', {\n get() {\n return config.getStoresToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'storeToProps', {\n get() {\n return config.storeToProps;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'eventToProps', {\n get() {\n return eventToPropsMap;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'authToProp', {\n get() {\n return config.authToProp;\n },\n enumerable: true,\n });\n Object.defineProperty(host, 'connectorToProp', {\n get() {\n return config.connectorToProp;\n },\n enumerable: true,\n });\n return origionalResult;\n };\n\n if (config.fireRegisterEvent) {\n target.componentWillLoad = function () {\n const origionalResult = origionalCallback?.call(this);\n const host = getElement(this);\n\n // We use our host element to dispatch a registration event that is picked up by the\n // the nylas-provider component.\n const registeredComponent: RegisteredComponent<H, B> = {\n element: host,\n ...config,\n eventToProps: eventToPropsMap,\n };\n const event = createComponentEvent(target, registeredComponent, config.registrationEventName);\n if (host.dispatchEvent(event)) {\n debug(`[${componentName}] Component ${componentName} successfully fired registration event`);\n }\n\n return origionalResult;\n };\n\n target.disconnectedCallback = function () {\n const origionalResult = origionalDisconnectCallback?.call(this);\n const host = getElement(this);\n\n // We use our host element to dispatch a registration event that is picked up by the\n // the nylas-provider component.\n const registeredComponent: RegisteredComponent<H, B> = {\n element: host,\n ...config,\n eventToProps: eventToPropsMap,\n };\n const event = unregisterComponentEvent(target, registeredComponent, config.unregistrationEventName);\n if (host.dispatchEvent(event)) {\n debug(`[${componentName}] Component ${componentName} successfully fired unregistration event`);\n }\n\n return origionalResult;\n };\n }\n };\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as s,H as i}from"./p-68c2fadf.js";import{R as r}from"./p-408dda49.js";import{d as n}from"./p-901f9612.js";import"./p-cb65c223.js";const a=":host{display:contents}.container{width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.pull-to-refresh{display:none;border:0;background-color:transparent;text-align:center;width:100%;justify-content:center}.pulling{position:relative;display:flex;margin:0 auto;padding:1rem}.pulling svg{width:24px;height:24px;color:var(--nylas-color-primary-500);transform:rotate(90deg)}.refreshing{position:relative;display:flex;margin:0 auto;padding:1rem}.refreshing svg{width:24px;height:24px;fill:var(--nylas-color-primary-500);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";const o=a;var h=undefined&&undefined.__decorate||function(e,t,s,i){var r=arguments.length,n=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,s):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)if(a=e[o])n=(r<3?a(n):r>3?a(t,s,n):a(t,s))||n;return r>3&&n&&Object.defineProperty(t,s,n),n};var c=undefined&&undefined.__metadata||function(e,t){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(e,t)};const f=class{constructor(s){e(this,s);this.refresh=t(this,"refresh",7);this.threshold=100;this.onTouchStart=e=>{n(`[nylas-threads-refresh] Touch start`,e.touches[0].pageY,this.containerElement?.scrollTop,this.containerElement?.offsetHeight,this.contentElement?.scrollTop);if(this.containerElement?.scrollTop===0){this.start=e.touches[0].pageY}else{this.start=0}};this.onTouchMove=e=>{if(this.start){const t=e.touches[0].pageY-this.start;if(t>this.threshold){this.pulling=true}else{this.pulling=false}}};this.onTouchEnd=e=>{if(this.start){const t=e.changedTouches[0].pageY-this.start;if(t>this.threshold){this.pulling=false;this.refresh.emit({updateState:this.updateState})}this.start=0}};this.start=0;this.state="ready";this.pulling=false;n(`[nylas-threads-refresh] Constructor`);this.updateState=this.updateState.bind(this)}connectedCallback(){}async componentWillLoad(){n(`[nylas-threads-refresh] Component will load`)}componentDidLoad(){n(`[nylas-threads-refresh] Component did load`);this.containerElement?.addEventListener("touchstart",this.onTouchStart);this.containerElement?.addEventListener("touchmove",this.onTouchMove);this.containerElement?.addEventListener("touchend",this.onTouchEnd)}disconnectedCallback(){n(`[nylas-threads-refresh] Component disconnected`);this.containerElement?.removeEventListener("touchstart",this.onTouchStart);this.containerElement?.removeEventListener("touchmove",this.onTouchMove);this.containerElement?.removeEventListener("touchend",this.onTouchEnd)}async updateState(e){this.state=e}render(){return s(i,{key:"8b1c69762b81b03cbe942f980fd7c3f2c861a72e"},s("div",{key:"f79595227147faeb6fe37c4928f0f9e715c7870c",class:"container",ref:e=>this.containerElement=e},s("button",{key:"e897c025006514ffff9a0c799b7716ec17c3febb",class:{"pull-to-refresh":true,pulling:this.pulling,refreshing:this.state==="loading"},"aria-label":"Refreshing..."},this.state==="loading"&&s("refresh-icon",{slot:"icon"}),this.state!=="loading"&&s("arrow-icon",{slot:"icon"})),s("div",{key:"ba683ed78ab4c0a4131ec319abb4322de618e6d7",class:"content",ref:e=>this.contentElement=e},s("slot",{key:"3111550c7d75d3d610394ed0c8a64b5a520d092c"}))))}};h([r({name:"nylas-threads-refresh",eventToProps:{refresh:async(e,t)=>{n(`[nylas-threads-refresh] Refreshing threads`);const{updateState:s}=e.detail;await s("loading");await t.threads.getThreads(undefined,"overwrite",false);await s("ready")}},fireRegisterEvent:true}),c("design:type",Function),c("design:paramtypes",[]),c("design:returntype",void 0)],f.prototype,"render",null);f.style=o;export{f as nylas_threads_refresh};
|
|
2
|
-
//# sourceMappingURL=p-41c1654e.entry.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as e,F as t,r as n,c as s,H as a,a as i}from"./p-68c2fadf.js";import{N as o,n as r}from"./p-65fdfb60.js";import{d as l}from"./p-901f9612.js";import{N as d,C as c,E as h}from"./p-df5e9aaf.js";import"./p-cb65c223.js";import"./p-cabb2e68.js";class p{constructor({schedulerAPIURL:e,nylasSchedulerStore:t,sessionId:n,configId:s}){if(!e){throw new Error("schedulerAPIURL is required")}if(!t){throw new Error("nylasSchedulerStore is required")}if(!n&&!s){throw new Error("sessionId is required for private configs, if not config id is required for public configs")}if(e==="/"){const t=new URL(window.location.href);e=t.origin}this.configId=s;this.sessionId=n;this.schedulerAPIURL=e;this.nylasSchedulerStore=t}init(){l("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){if(this._schedulerAPIConnector){return this._schedulerAPIConnector}this._schedulerAPIConnector=new d({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId});return this._schedulerAPIConnector}resetStores(){this.nylasSchedulerStore.reset()}}const g=(n,s)=>{const a=n.isLoading;const i=n.showNotification;const o=n.nylasBranding;return e(t,null,i&&e("nylas-notification",null),a&&e("div",{class:"loading"},e("div",{class:"left"},e("div",{class:"skeleton"})),e("div",{class:"right"},e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}))),!a&&s,e("div",{class:"footer"},o&&e(t,null,"Powered by ",e("nylas-logo",null))))};const f=(t,n)=>e("div",{class:"message-banner"},n);const u=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin-top:1rem}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{padding:1rem 20px 0;gap:1rem;height:512px;min-width:384px;border-top-left-radius:inherit;background:var(--nylas-base-0)}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{padding:0.5rem 4px 0}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:1px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:512px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:496px}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer svg{fill:var(--nylas-base-500)}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}';const b=u;const m={title:"Something went wrong...",type:r.Error,category:h.Component};const y=class{constructor(e){n(this,e);this.init=s(this,"init",7);this.schedulerWillLoad=s(this,"schedulerWillLoad",7);this.schedulerDidLoad=s(this,"schedulerDidLoad",7);this.nylasSchedulerError=s(this,"nylasSchedulerError",7);this.mode="app";this.defaultSchedulerState=undefined;this.sessionId=undefined;this.schedulerApiUrl="https://api.us.nylas.com";this.bookingInfo=undefined;this.rescheduleBookingId=undefined;this.cancelBookingId=undefined;this.configId=undefined;this.nylasBranding=true;this.eventOverrides={};this.isLoading=undefined;this.themeConfig=undefined;this.showNotification=true;this.automaticComponentRegistration=true;this.selectedDateLabel=(new Date).toLocaleDateString(undefined,{dateStyle:"full"})||"No date selected"}connectedCallback(){l(`[nylas-scheduler] connectedCallback`)}async componentWillLoad(){l(`[nylas-scheduler] Component will load`);const e=this.schedulerWillLoad.emit(this.host);if(e.defaultPrevented){return}if(!this.checkIfSessionIdOrConfigIdExists()){return}this.stores={scheduler:c({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,...this.defaultSchedulerState})};this.baseProvider=new o(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);const t=this.baseProvider?.getStore("scheduler");this.nylasSchedulerConnector=new p({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.configId,nylasSchedulerStore:t});this.init.emit(this.host);this.baseProvider?.componentWillLoad(this.nylasSchedulerConnector);if(this.themeConfig){for(const[e,t]of Object.entries(this.themeConfig)){this.host.style.setProperty(`${e}`,t)}}}async componentDidLoad(){this.baseProvider?.componentDidLoad();if(!this.checkIfSessionIdOrConfigIdExists()){return}const e=this.baseProvider?.getStore("scheduler");const t=e?.get("selectedTimeslot");if(t&&t?.start_time){if(!this.isTimeslotValid(t)){return}if(e?.get("showBookingForm")){e?.set("selectedDate",t.start_time);return}}const n=e?.get("selectedDate");const s=e?.get("availability");let a;if(s&&s.length>0){return}if(!n){a=await(this.nylasSchedulerConnector?.scheduler.getAvailability())}else{const e=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3;const t=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3;a=await(this.nylasSchedulerConnector?.scheduler.getAvailability(e,t))}if(!a||"error"in a){this.nylasSchedulerError.emit({...this.getErrorObject(a?.error)})}if(!n){let t=new Date;const n=e?.get("availability").find((e=>new Date(e.start_time)>new Date));if(n){t=n.start_time}e?.set("selectedDate",t)}}componentDisconnected(){this.baseProvider?.componentDisconnected()}bookingInfoChanged(e){this.stores?.scheduler.set("bookingInfo",e)}async registerComponentHandler(e){this.baseProvider?.registerComponent(e.detail)}async unregisterComponentHandler(e){this.baseProvider?.unregisterComponent(e.detail)}async monthChangedHandler(e){const t=e.detail;const n=new Date(t.getFullYear(),t.getMonth(),1).getTime()/1e3;const s=new Date(t.getFullYear(),t.getMonth()+1,1).getTime()/1e3;const a=await(this.nylasSchedulerConnector?.scheduler.getAvailability(n,s));if(!a||"error"in a){this.nylasSchedulerError.emit({...this.getErrorObject(a?.error)})}}async bookButtonClickedHandler(e){if(this.rescheduleBookingId){const t=await(this.nylasSchedulerConnector?.scheduler.rescheduleBooking(this.rescheduleBookingId,e.detail));if(!t||"error"in t){this.nylasSchedulerError.emit({...this.getErrorObject(t?.error)})}return}const t=await(this.nylasSchedulerConnector?.scheduler.bookTimeslot(e.detail));if(!t||"error"in t){this.nylasSchedulerError.emit({...this.getErrorObject(t?.error)})}}dateSelectedHandler(e){const t=e.detail;this.selectedDateLabel=t?t.toLocaleDateString(undefined,{dateStyle:"full"}):"No date selected"}cancelBookedEventErrorHandler(e){this.nylasSchedulerError.emit({...this.getErrorObject(e.detail.error)})}rescheduleBookedEventErrorHandler(e){this.nylasSchedulerError.emit({...this.getErrorObject(e.detail.error)})}async getNylasSchedulerStore(){return this.baseProvider?.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(e){return{title:e?.title||m.title,category:e?.category||m.category,type:r.Error,description:e?.message||"",id:(new Date).getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.configId){this.nylasSchedulerError.emit({title:"No sessionId!",category:h.Component,type:r.Error,description:"Session ID is required",id:(new Date).getTime().toString(),ttl:"none"});return false}return true}isTimeslotValid(e){const t=new Date(e.start_time);if(t<new Date){this.nylasSchedulerError.emit({title:"Invalid tiemslot!",category:h.Component,type:r.Error,description:"The selected timeslot is invalid.",id:(new Date).getTime().toString(),ttl:"none"});return false}return true}render(){const t=this.mode==="app";const n=this.baseProvider?.getStore("scheduler");const s=n?.get("eventInfo");const i=n?.get("showBookingForm");const o=n?.get("cancelledEventInfo");const r=n?.get("cancelBookingId")||this.cancelBookingId;const l=n?.get("selectedTimeslot");const d=n?.get("rescheduleBookingId")||this.rescheduleBookingId;const c=n?.get("nylasBranding")||this.nylasBranding;if(t&&r&&!o){return e(a,null,e(g,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e("nylas-cancel-booking-form",{cancelBookingId:r,exportparts:"ncbf, ncbf__input-textfield, ncbf__button-cta, ncbf__button-outline, ncbf__input-label"}))))}if(t&&o){return e(a,null,e(g,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e("nylas-cancelled-event-card",{cancelledEventInfo:o,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))))}if(t&&s){return e(a,null,e(g,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"booked-event-page",part:"booked-event-page"},e("nylas-booked-event-card",{selectedTimeslot:l,eventInfo:s,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))))}if(t&&(!s||!!d)&&!i){const t=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e(a,null,e(g,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},d&&e(f,null,"Choose another time slot to reschedule your meeting"),e("div",{class:"select-date-page",part:"select-date-page"},e("div",{class:"left-panel"},e("nylas-date-picker",{exportparts:"ndp, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e("div",{class:"border"}),e("nylas-locale-switch",null)),e("div",{class:"right-panel"},e("h2",null,e("calendar-icon",null),e("span",{id:"selectedDate"},this.selectedDateLabel)),e("nylas-timeslot-picker",{exportparts:"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},t&&e("span",{slot:"timeslot-picker-cta-label"},e("slot",{name:"timeslot-picker-cta-label"})))))))}if(t&&!s&&i){const t=this.host.querySelector('[slot="custom-booking-form"]');return e(a,null,e(g,{nylasBranding:c,isLoading:this.isLoading,showNotification:this.showNotification},d&&e(f,null,"Choose another time slot to reschedule your meeting"),e("div",{class:"additional-data-page",part:"additional-data-page"},e("div",{class:"left-panel"},e("div",{class:"wrapper"},e("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time"}))),e("div",{class:"right-panel"},e("nylas-booking-form",{exportparts:"nbf, nbf__input-label, nbf__input-textfield, nbf__button-ghost, nbf__button-primary, nbf__button-outline"},t&&e("div",{slot:"custom-booking-form"},e("slot",{name:"custom-booking-form"})))))))}return e(a,null,e("slot",null))}get host(){return i(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"]}}};y.style=b;export{y as nylas_scheduling};
|
|
2
|
-
//# sourceMappingURL=p-59b6ae90.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NylasSchedulerConnector","constructor","schedulerAPIURL","nylasSchedulerStore","sessionId","configId","Error","url","URL","window","location","href","origin","this","init","debug","schedulerStore","scheduler","_schedulerAPIConnector","NylaSchedulerAPIConnector","resetStores","reset","SchedulerView","props","children","isLoading","showNotification","nylasBranding","h","Fragment","class","MessageBanner","_props","nylasSchedulingCss","NylasSchedulingStyle0","genericError","title","type","NotificationType","category","ErrorCategory","Component","NylasScheduling","Date","toLocaleDateString","undefined","dateStyle","connectedCallback","componentWillLoad","schedulerWillLoadEvent","schedulerWillLoad","emit","host","defaultPrevented","checkIfSessionIdOrConfigIdExists","stores","CreateNylasSchedulerStore","bookingInfo","defaultSchedulerState","baseProvider","NylasBaseProvider","automaticComponentRegistration","eventOverrides","getStore","nylasSchedulerConnector","schedulerApiUrl","themeConfig","key","value","Object","entries","style","setProperty","componentDidLoad","selectedTimeslot","get","start_time","isTimeslotValid","set","selectedDate","availability","result","length","getAvailability","startTime","getFullYear","getMonth","getTime","endTime","nylasSchedulerError","getErrorObject","error","_selectedDate","firstAvailableDate","find","timeslot","componentDisconnected","bookingInfoChanged","newVal","registerComponentHandler","event","registerComponent","detail","unregisterComponentHandler","unregisterComponent","monthChangedHandler","date","bookButtonClickedHandler","rescheduleBookingId","rescheduleBooking","bookTimeslot","dateSelectedHandler","selectedDateLabel","cancelBookedEventErrorHandler","rescheduleBookedEventErrorHandler","getNylasSchedulerStore","getNylasSchedulerConnector","getRef","description","message","id","toString","ttl","render","showDefaultScheduler","mode","eventInfo","showBookingForm","cancelledEventInfo","cancelBookingId","Host","part","exportparts","timeslotPickerCTALabel","querySelector","slot","name","customTemplateSlot"],"sources":["src/connector/nylas-scheduler-connector/index.ts","src/components/scheduler/nylas-scheduler/scheduler-view.tsx","src/components/scheduler/nylas-scheduler/message-banner.tsx","src/components/scheduler/nylas-scheduler/nylas-scheduling.scss?tag=nylas-scheduling&encapsulation=shadow","src/components/scheduler/nylas-scheduler/nylas-scheduling.tsx"],"sourcesContent":["import { NylasSchedulerStoreType } from '@/stores/scheduler-store';\nimport { debug } from '@/utils/utils';\nimport { NylasSchedulerConnectorInterface } from '../connector-interface';\nimport { NylaSchedulerAPIConnector } from '../shared/api/scheduler';\n\ntype NylasSchedulerConnectorOptions = {\n schedulerAPIURL: string;\n nylasSchedulerStore: NylasSchedulerStoreType;\n sessionId?: string;\n configId?: string;\n};\n/**\n * Base class for the Nylas connector.\n */\nexport class NylasSchedulerConnector implements NylasSchedulerConnectorInterface {\n public schedulerAPIURL: string;\n public nylasSchedulerStore: NylasSchedulerStoreType;\n public sessionId: string | undefined;\n public configId: string | undefined;\n\n private _schedulerAPIConnector: NylaSchedulerAPIConnector | undefined;\n\n constructor({ schedulerAPIURL, nylasSchedulerStore, sessionId, configId }: NylasSchedulerConnectorOptions) {\n if (!schedulerAPIURL) {\n throw new Error('schedulerAPIURL is required');\n }\n\n if (!nylasSchedulerStore) {\n throw new Error('nylasSchedulerStore is required');\n }\n\n if (!sessionId && !configId) {\n throw new Error('sessionId is required for private configs, if not config id is required for public configs');\n }\n\n // If the url is only /, then we need to add the base url.\n // We assume that the base url is the same as the current url.\n if (schedulerAPIURL === '/') {\n const url = new URL(window.location.href);\n schedulerAPIURL = url.origin;\n }\n\n this.configId = configId;\n this.sessionId = sessionId;\n this.schedulerAPIURL = schedulerAPIURL;\n this.nylasSchedulerStore = nylasSchedulerStore;\n }\n\n public init() {\n debug('NylasConnector init');\n }\n\n public get schedulerStore() {\n return this.nylasSchedulerStore;\n }\n\n public get scheduler() {\n if (this._schedulerAPIConnector) {\n return this._schedulerAPIConnector;\n }\n this._schedulerAPIConnector = new NylaSchedulerAPIConnector({\n schedulerAPIURL: this.schedulerAPIURL,\n schedulerStore: this.schedulerStore,\n sessionId: this.sessionId,\n configId: this.configId,\n });\n return this._schedulerAPIConnector;\n }\n\n public resetStores() {\n this.nylasSchedulerStore.reset();\n }\n}\nexport type PublicMethods<T> = {\n [K in keyof T]: T[K] extends Function ? (string extends K ? never : K) : never;\n}[keyof T];\n\nexport type NylasSchedulerConnectorPublicMethods = PublicMethods<NylasSchedulerConnector>;\n","import { Fragment, FunctionalComponent, h } from '@stencil/core';\n\nexport type SchedulerViewProps = {\n isLoading?: boolean;\n showNotification?: boolean;\n nylasBranding?: boolean;\n};\n\n/**\n * The Scheduler view component.\n */\nexport const SchedulerView: FunctionalComponent<SchedulerViewProps> = (props: SchedulerViewProps, children) => {\n const isLoading = props.isLoading;\n const showNotification = props.showNotification;\n const nylasBranding = props.nylasBranding;\n\n return (\n <Fragment>\n {showNotification && <nylas-notification></nylas-notification>}\n\n {isLoading && (\n <div class={'loading'}>\n <div class={'left'}>\n <div class={'skeleton'} />\n </div>\n <div class={'right'}>\n <div class={'skeleton'} />\n <div class={'skeleton'} />\n <div class={'skeleton'} />\n <div class={'skeleton'} />\n <div class={'skeleton'} />\n </div>\n </div>\n )}\n {!isLoading && children}\n <div class={'footer'}>\n {nylasBranding && (\n <Fragment>\n Powered by \n <nylas-logo />\n </Fragment>\n )}\n </div>\n </Fragment>\n );\n};\n","import { FunctionalComponent, h } from '@stencil/core';\n\nexport type HeaderBannerProps = {};\n\nexport const MessageBanner: FunctionalComponent<HeaderBannerProps> = (_props: HeaderBannerProps, children) => <div class=\"message-banner\">{children}</div>;\n","@import '../../../common/styles/variables.scss';\n\n:host {\n display: flex;\n flex-direction: column;\n overflow: visible;\n border-radius: var(--nylas-border-radius-2x);\n width: fit-content;\n @media #{$mobile} {\n width: auto;\n min-width: 325px;\n }\n background: var(--nylas-base-0);\n position: relative;\n box-shadow:\n 0px 4px 6px -2px rgba(0, 0, 0, 0.05),\n 0px 10px 15px -3px rgba(0, 0, 0, 0.1);\n @include default-css-variables;\n font-family: var(--nylas-font-family);\n font-optical-sizing: auto;\n font-style: normal;\n font-variation-settings: 'slnt' 0;\n}\n\n:root {\n font-family: inherit;\n}\n\n.error {\n padding: 8rem 12rem;\n color: var(--nylas-base-0);\n background-color: var(--nylas-error);\n margin: 1.5rem;\n border-radius: var(--nylas-border-radius-2x);\n}\n\n.message-banner {\n text-align: right;\n color: var(--nylas-base-800);\n padding: 1rem;\n border-bottom: 1px solid var(--nylas-color-primary-200);\n margin-top: 1rem;\n}\n\n.loading {\n margin: 1.5rem;\n display: flex;\n gap: 1rem;\n\n .skeleton {\n border-radius: var(--nylas-border-radius-2x);\n animation: pulsate 1.5s infinite;\n &:nth-child(2) {\n animation-delay: -100ms;\n }\n &:nth-child(3) {\n animation-delay: -200ms;\n }\n &:nth-child(4) {\n animation-delay: -300ms;\n }\n &:nth-child(5) {\n animation-delay: -400ms;\n }\n }\n\n .left .skeleton {\n height: 100%;\n width: 400px;\n }\n .right .skeleton {\n height: 5rem;\n width: 300px;\n margin-bottom: 1rem;\n &:last-child {\n margin-bottom: 0;\n }\n }\n}\n\n@keyframes pulsate {\n 0% {\n background-color: var(--nylas-base-50);\n }\n 50% {\n background-color: var(--nylas-base-100);\n }\n 100% {\n background-color: var(--nylas-base-50);\n }\n}\n\n.select-date-page,\n.additional-data-page,\n.booked-event-page,\n.cancelled-event-page,\n.cancel-flow-page {\n border-top-left-radius: var(--nylas-border-radius-2x);\n border-top-right-radius: var(--nylas-border-radius-2x);\n}\n\n.select-date-page,\n.additional-data-page {\n display: flex;\n\n @media #{$mobile} {\n flex-direction: column;\n }\n}\n\n.booked-event-page {\n background-color: var(--nylas-base-50);\n}\n\n.cancelled-event-page,\n.cancel-flow-page {\n padding: 1rem;\n height: 496px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.booked-event-page,\n.cancelled-event-page,\n.cancel-flow-page {\n min-width: 784px;\n @media #{$mobile} {\n min-width: 90%;\n }\n background: var(--nylas-base-50);\n}\n\n.left-panel {\n padding: 1rem 20px 0;\n gap: 1rem;\n height: 512px;\n min-width: 384px;\n border-top-left-radius: inherit;\n background: var(--nylas-base-0);\n @media #{$mobile} {\n border-top-right-radius: inherit;\n min-width: unset;\n height: auto;\n }\n}\n\n.select-date-page .left-panel {\n @media #{$mobile} {\n padding: 0.5rem 4px 0;\n }\n}\n\n.border {\n margin-left: -20px; // Offset left padding\n margin-right: -20px; // Offset right padding\n border-top-width: 1px;\n height: 1px;\n background-color: var(--nylas-base-200);\n @media #{$mobile} {\n display: none;\n }\n}\n\n.right-panel {\n min-width: 360px;\n width: 360px;\n background-color: var(--nylas-base-50);\n height: 512px;\n padding-top: 16px;\n border-left: 1px solid var(--nylas-base-200);\n border-top-right-radius: inherit;\n @media #{$mobile} {\n border-top-right-radius: 0px;\n width: inherit;\n min-width: unset;\n height: auto;\n }\n h2 {\n display: flex;\n margin: 0;\n height: 48px;\n gap: 0.5rem;\n justify-content: center;\n align-items: center;\n width: auto;\n font-size: 1.125rem;\n line-height: 1.5rem;\n font-weight: 500;\n text-align: center;\n color: var(--nylas-base-800);\n }\n}\n\n.additional-data-page {\n .left-panel {\n background-color: var(--nylas-base-50);\n }\n .right-panel {\n background-color: var(--nylas-base-0);\n }\n}\n\nnylas-selected-event-card {\n height: 496px;\n\n @media #{$mobile} {\n height: 250px;\n }\n}\n\n.footer {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n padding: 16px;\n font-size: 14px;\n font-weight: 300;\n color: var(--nylas-base-500);\n border-top: 1px solid var(--nylas-base-200);\n min-height: 24px;\n svg {\n fill: var(--nylas-base-500);\n }\n}\n\n.footer svg {\n margin-top: 1px;\n}\n\nnylas-selected-event-card::part(nsec__timezone) {\n position: absolute;\n bottom: 0;\n}\n","import { NylasBaseProvider } from '@/common/abstract-provider';\nimport { RegisteredComponent } from '@/common/register-component';\nimport type { SchedulerEventOverride } from '@/common/component-types';\nimport { NylasSchedulerConnector } from '@/connector/nylas-scheduler-connector';\nimport { CreateNylasSchedulerStore, NylasSchedulerStoreState, NylasSchedulerStoreType } from '@/stores/scheduler-store';\nimport { NylasSchedulerBookingData, ThemeConfig, Notification, NotificationType, NylasSchedulerErrorResponse, Timeslot } from '@nylas/core';\nimport { Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { debug } from '@/utils/utils';\nimport { SchedulerView } from './scheduler-view';\nimport { ErrorCategory } from '@/connector/nylas-scheduler-connector/errors';\nimport { MessageBanner } from './message-banner';\n\nconst genericError = { title: 'Something went wrong...', type: NotificationType.Error, category: ErrorCategory.Component };\n\n/**\n * The `nylas-scheduling` component is used to display the Nylas Scheduling UI.\n *\n * @slot custom-booking-form - This slot is used to pass a custom booking form to the Nylas Scheduling component.\n * @slot timeslot-picker-cta-label - This slot is used to pass a custom label to the timeslot picker CTA. The default label is \"Next\".\n *\n * @part ndp - [nylas-date-picker] The date picker host.\n * @part ndp__month-header - [nylas-date-picker] The month header.\n * @part ndp__month-button - [nylas-date-picker] The month button.\n * @part ndp__day - [nylas-date-picker] The day.\n * @part ndp__date - [nylas-date-picker] The date.\n * @part ndp__date--selected - [nylas-date-picker] The selected date.\n * @part ndp__date--current-day - [nylas-date-picker] The current day.\n * @part ndp__date--current-month - [nylas-date-picker] The dates in the current month.\n * @part ntp - [nylas-timeslot-picker] The timeslot picker component.\n * @part ntp__timeslot - [nylas-timeslot-picker] The timeslot button.\n * @part ntp__timeslot--selected - [nylas-timeslot-picker] The selected timeslot button.\n * @part ntp__button-primary - [nylas-timeslot-picker] The timeslot picker CTA.\n * @part nsec - [nylas-selected-event-card] The selected event card component.\n * @part nsec__card - [nylas-selected-event-card] The card component.\n * @part nsec__icon - [nylas-selected-event-card] The calendar icon.\n * @part nsec__date - [nylas-selected-event-card] The date selected.\n * @part nsec__time - [nylas-selected-event-card] The timeslot selected.\n * @part nbf - [nylas-booking-form] The booking form host.\n * @part nbf__input-label - [nylas-booking-form] The input label.\n * @part nbf__input-textfield - [nylas-booking-form] The input textfield.\n * @part nbf__button-ghost - [nylas-booking-form] The ghost button for adding guests.\n * @part nbf__button-primary - [nylas-booking-form] The primary button for booking.\n * @part nbf__button-outline - [nylas-booking-form] The outline button for canceling.\n * @part ncec - [nylas-cancelled-event-card] The cancelled event card host.\n * @part ncec__icon - [nylas-cancelled-event-card] The calendar icon.\n * @part ncec__title - [nylas-cancelled-event-card] The title of the cancelled event card.\n * @part ncec__description - [nylas-cancelled-event-card] The description of the cancelled event card.\n * @part ncec__button-outline - [nylas-cancelled-event-card] The close button CTA.\n * @part ncec__card - [nylas-cancelled-event-card] The cancelled event card.\n * @part nbec - [nylas-booked-event-card] The booked event card host.\n * @part nbec__card - [nylas-booked-event-card] The booked event card.\n * @part nbec__title - [nylas-booked-event-card] The title of the booked event card.\n * @part nbec__description - [nylas-booked-event-card] The description of the booked event card.\n * @part nbec__button-outline - [nylas-booked-event-card] The cancel & reschedule button CTA.\n * @part nbec__cancel-cta - [nylas-booked-event-card] The cancel button CTA.\n * @part nbec__reschedule-cta - [nylas-booked-event-card] The reschedule button CTA.\n */\n@Component({\n tag: 'nylas-scheduling',\n styleUrl: 'nylas-scheduling.scss',\n shadow: true,\n})\nexport class NylasScheduling {\n /**\n * Stores to be used by the provider.\n */\n private stores?: { scheduler: NylasSchedulerStoreType };\n\n /**\n * This is a base provide that defines the common methods and properties\n * that all providers should have.\n *\n * Because stencil does not support abstract classes, we have to use a\n * property to store the base provider instance.\n */\n private baseProvider?: NylasBaseProvider<Exclude<typeof this.stores, undefined>>;\n\n /**\n * The Nylas Scheduler Connector instance.\n * The branins of the provider. It manages data fetching and state synchronization.\n */\n private nylasSchedulerConnector?: NylasSchedulerConnector;\n\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasSchedulingElement;\n\n /**\n * This is used to set the mode for the Nylas Scheduler.\n * The mode can be either `app` or `composable`. The default mode is `app`.\n * - `app`: This mode is used to show the default Nylas Scheduler UI.\n * - `composable`: This mode is used to show the composable Nylas Scheduler UI\n * by passing the individual scheduler components as children.\n */\n @Prop() readonly mode: 'app' | 'composable' = 'app';\n\n /**\n * The default scheduler store state.\n * Used to set the initial state of the scheduler store.\n */\n @Prop({ attribute: 'default-scheduler-store-state' }) readonly defaultSchedulerState?: Partial<NylasSchedulerStoreState>;\n\n /**\n * The session ID for the Nylas Scheduler.\n * This is used to authenticate the user.\n */\n @Prop() readonly sessionId?: string;\n\n /**\n * The URL for the Nylas Scheduler API. (staging or production URL)\n */\n @Prop() readonly schedulerApiUrl: string = 'https://api.us.nylas.com';\n\n /**\n * This enables passing the bookingInfo object to the Scheduler UI for direct booking event creation.\n * When used with timeslotConfirmedHandler, it bypasses the additional data page and immediately\n * invokes the handler after booking.\n */\n @Prop() readonly bookingInfo?: NylasSchedulerBookingData;\n\n /**\n * Booking Id required for rescheduling flow.\n */\n @Prop() readonly rescheduleBookingId?: string;\n\n /**\n * Booking Id required for cancelling flow.\n */\n @Prop() readonly cancelBookingId?: string;\n\n /**\n * The config ID for the Nylas Scheduler. This should be passed in when using a public config,\n * in which case the sessionId is not required.\n */\n @Prop() readonly configId?: string;\n\n /**\n * This prop lets you hide the Nylas branding.\n * Default is true.\n */\n @Prop() readonly nylasBranding?: boolean = true;\n\n /**\n * This provides an easy way to override the default function of the event emitter.\n * An example of this is the `timeslotConfirmed` event. By default, this event will set the scheduler store state for `showBookingForm` to `true` which will\n * show the booking form. However, if you want to override this behavior, you can pass in the prop `eventOverride` like:\n * ```html\n * <nylas-scheduling eventOverride={{\"timeslotConfirmed\": (event, nylasConnector) => { console.log(\"Timeslot confirmed event fired!\"); } }} />\n * ```\n */\n @Prop({ attribute: 'event-overrides' }) readonly eventOverrides: SchedulerEventOverride = {};\n\n /**\n * The loading state. This is used to set the loading state for the Nylas Scheduler when fetching data.\n */\n @Prop() readonly isLoading?: boolean;\n\n /**\n * Theme config, used to automatically generate a theme with color palette and\n * CSS variables to customize the look and feel of the Nylas Scheduler.\n */\n @Prop() readonly themeConfig?: ThemeConfig;\n\n /*\n * Displays notifications for errors by default. When enabled (`true`), errors\n * automatically appear as notifications. Disabling this feature (`false`) allows\n * the parent application to capture and manage errors by listening to the\n * `nylasSchedulerError` event, providing flexibility in error handling.\n */\n @Prop() readonly showNotification?: boolean = true;\n\n /**\n * Automatically register components that have the `@RegisterComponent` decorator.\n * If this is set to false, you will need to manually register components using the\n * `registerComponent` method.\n * @default true\n */\n @State() automaticComponentRegistration: boolean = true;\n\n /**\n * The selected date label for the Nylas Scheduler.\n * This is used to set the initial date label for the Nylas Scheduler.\n */\n @State() selectedDateLabel: string = new Date().toLocaleDateString(undefined, { dateStyle: 'full' }) || 'No date selected';\n\n /**\n * This event is fired when the provider is initialized.\n * It can be used to set the initial state of the provider,\n * or to prevent the provider from firing some default behavior.\n */\n @Event({ cancelable: true }) init!: EventEmitter<HTMLNylasSchedulingElement>;\n\n /**\n * This event is fired when the scheduler component enters componentWillLoad lifecycle.\n */\n @Event() schedulerWillLoad!: EventEmitter<HTMLNylasSchedulingElement>;\n\n /**\n * This event is fired when the scheduler component enters componentDidLoad lifecycle.\n */\n @Event() schedulerDidLoad!: EventEmitter<HTMLNylasSchedulingElement>;\n\n @Event({\n eventName: 'nylasSchedulerError',\n })\n nylasSchedulerError!: EventEmitter<Notification>;\n\n /**\n * This function is called when the component is connected to the DOM.\n * At this point in the component lifecycle, the base provider has not yet\n * been initialized. So avoid using the base provider in this method or stores\n * in this method.\n */\n connectedCallback() {\n debug(`[nylas-scheduler] connectedCallback`);\n }\n\n async componentWillLoad() {\n debug(`[nylas-scheduler] Component will load`);\n\n // Emit the schedulerWillLoad event to allow the parent application to set the initial\n // state of the provider or to prevent the provider from firing some default behavior.\n const schedulerWillLoadEvent = this.schedulerWillLoad.emit(this.host);\n if (schedulerWillLoadEvent.defaultPrevented) {\n return;\n }\n\n if (!this.checkIfSessionIdOrConfigIdExists()) {\n return;\n }\n\n this.stores = {\n scheduler: CreateNylasSchedulerStore({\n bookingInfo: this.bookingInfo,\n nylasBranding: this.nylasBranding,\n ...this.defaultSchedulerState,\n }),\n };\n\n this.baseProvider = new NylasBaseProvider(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides);\n\n const nylasSchedulerStore = this.baseProvider?.getStore('scheduler');\n this.nylasSchedulerConnector = new NylasSchedulerConnector({\n schedulerAPIURL: this.schedulerApiUrl,\n sessionId: this.sessionId,\n configId: this.configId,\n nylasSchedulerStore,\n });\n this.init.emit(this.host);\n\n this.baseProvider?.componentWillLoad(this.nylasSchedulerConnector);\n // Override theme\n if (this.themeConfig) {\n for (const [key, value] of Object.entries(this.themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n async componentDidLoad() {\n this.baseProvider?.componentDidLoad();\n\n // If sessionId is not provided, do not fetch availability\n if (!this.checkIfSessionIdOrConfigIdExists()) {\n return;\n }\n\n const nylasSchedulerStore = this.baseProvider?.getStore('scheduler');\n\n const selectedTimeslot = nylasSchedulerStore?.get('selectedTimeslot');\n\n if (selectedTimeslot && selectedTimeslot?.start_time) {\n if (!this.isTimeslotValid(selectedTimeslot)) {\n return;\n }\n\n // If the selected timeslot is already set, do not fetch availability\n if (nylasSchedulerStore?.get('showBookingForm')) {\n nylasSchedulerStore?.set('selectedDate', selectedTimeslot.start_time);\n return;\n }\n }\n\n const selectedDate = nylasSchedulerStore?.get('selectedDate');\n const availability = nylasSchedulerStore?.get('availability');\n let result;\n\n if (availability && availability.length > 0) {\n return;\n }\n\n if (!selectedDate) {\n result = await this.nylasSchedulerConnector?.scheduler.getAvailability();\n } else {\n const startTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), 1).getTime() / 1000;\n const endTime = new Date(selectedDate.getFullYear(), selectedDate.getMonth() + 1, 1).getTime() / 1000;\n result = await this.nylasSchedulerConnector?.scheduler.getAvailability(startTime, endTime);\n }\n\n if (!result || 'error' in result) {\n this.nylasSchedulerError.emit({ ...this.getErrorObject(result?.error) });\n }\n\n if (!selectedDate) {\n let _selectedDate = new Date();\n const firstAvailableDate = nylasSchedulerStore?.get('availability').find((timeslot: any) => new Date(timeslot.start_time) > new Date());\n if (firstAvailableDate) {\n _selectedDate = firstAvailableDate.start_time;\n }\n nylasSchedulerStore?.set('selectedDate', _selectedDate);\n }\n }\n\n componentDisconnected() {\n this.baseProvider?.componentDisconnected();\n }\n\n @Watch('bookingInfo')\n bookingInfoChanged(newVal?: NylasSchedulerBookingData) {\n this.stores?.scheduler.set('bookingInfo', newVal);\n }\n\n /**\n * This is a custom event handler that is used to register a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to register\n * @returns Promise<void>\n */\n @Listen('registerComponent')\n async registerComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.registerComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to unregister a component with the provider.\n * It is used by components that have the `@RegisterComponent` decorator.\n * @param event A custom event that contains the component to unregister\n * @returns Promise<void>\n */\n @Listen('unregisterComponent')\n async unregisterComponentHandler(event: CustomEvent<RegisteredComponent<any, any>>): Promise<void> {\n this.baseProvider?.unregisterComponent(event.detail);\n }\n\n /**\n * This is a custom event handler that is used to refetch the availability when the month is changed.\n */\n @Listen('monthChanged')\n async monthChangedHandler(event: CustomEvent<Date>) {\n const date = event.detail;\n const startTime = new Date(date.getFullYear(), date.getMonth(), 1).getTime() / 1000;\n const endTime = new Date(date.getFullYear(), date.getMonth() + 1, 1).getTime() / 1000;\n\n const result = await this.nylasSchedulerConnector?.scheduler.getAvailability(startTime, endTime);\n\n if (!result || 'error' in result) {\n this.nylasSchedulerError.emit({ ...this.getErrorObject(result?.error) });\n }\n }\n\n /**\n * This is a custom event handler to book an event.\n */\n @Listen('detailsConfirmed')\n async bookButtonClickedHandler(event: CustomEvent<NylasSchedulerBookingData>) {\n if (this.rescheduleBookingId) {\n const result = await this.nylasSchedulerConnector?.scheduler.rescheduleBooking(this.rescheduleBookingId, event.detail);\n if (!result || 'error' in result) {\n this.nylasSchedulerError.emit({ ...this.getErrorObject(result?.error) });\n }\n return;\n }\n const result = await this.nylasSchedulerConnector?.scheduler.bookTimeslot(event.detail);\n if (!result || 'error' in result) {\n this.nylasSchedulerError.emit({ ...this.getErrorObject(result?.error) });\n }\n }\n\n /**\n * This is a custom event handler to update the selected date label.\n */\n @Listen('dateSelected')\n dateSelectedHandler(event: CustomEvent<Date>) {\n const date = event.detail;\n this.selectedDateLabel = date ? date.toLocaleDateString(undefined, { dateStyle: 'full' }) : 'No date selected';\n }\n\n /**\n * This is an event handler to handle the error (if any) when the\n * cancel booking button is clicked on the cancel booking form.\n */\n @Listen('cancelBookedEventError')\n cancelBookedEventErrorHandler(event: CustomEvent<NylasSchedulerErrorResponse>) {\n this.nylasSchedulerError.emit({ ...this.getErrorObject(event.detail.error) });\n }\n\n /**\n * This is an event handler to handle the error (if any) when the\n * reschedule button is clicked on the booked event card.\n */\n @Listen('rescheduleBookedEventError')\n rescheduleBookedEventErrorHandler(event: CustomEvent<NylasSchedulerErrorResponse>) {\n this.nylasSchedulerError.emit({ ...this.getErrorObject(event.detail.error) });\n }\n\n /**\n * This method is used to retrieve the NylasScheduler instance\n * @returns The NylasScheduler instance\n */\n @Method()\n async getNylasSchedulerStore(): Promise<NylasSchedulerStoreType | undefined> {\n return this.baseProvider?.getStore('scheduler');\n }\n\n /**\n * This method is used to retrieve the NylasConnector instance\n * @returns The NylasConnector instance\n */\n @Method()\n async getNylasSchedulerConnector() {\n return this.nylasSchedulerConnector;\n }\n\n @Method()\n async getRef() {\n return this.host;\n }\n\n private getErrorObject(error: NylasSchedulerErrorResponse['error']): Notification {\n return {\n title: error?.title || genericError.title,\n category: error?.category || genericError.category,\n type: NotificationType.Error,\n description: error?.message || '',\n id: new Date().getTime().toString(),\n ttl: 'none',\n };\n }\n\n private checkIfSessionIdOrConfigIdExists(): boolean {\n if (!this.sessionId && !this.configId) {\n this.nylasSchedulerError.emit({\n title: 'No sessionId!',\n category: ErrorCategory.Component,\n type: NotificationType.Error,\n description: 'Session ID is required',\n id: new Date().getTime().toString(),\n ttl: 'none',\n });\n return false;\n }\n return true;\n }\n\n private isTimeslotValid(timeslot: Timeslot): boolean {\n const selectedDate = new Date(timeslot.start_time);\n if (selectedDate < new Date()) {\n this.nylasSchedulerError.emit({\n title: 'Invalid tiemslot!',\n category: ErrorCategory.Component,\n type: NotificationType.Error,\n description: 'The selected timeslot is invalid.',\n id: new Date().getTime().toString(),\n ttl: 'none',\n });\n return false;\n }\n return true;\n }\n\n render() {\n const showDefaultScheduler = this.mode === 'app';\n const nylasSchedulerStore = this.baseProvider?.getStore('scheduler');\n const eventInfo = nylasSchedulerStore?.get('eventInfo');\n const showBookingForm = nylasSchedulerStore?.get('showBookingForm');\n const cancelledEventInfo = nylasSchedulerStore?.get('cancelledEventInfo');\n const cancelBookingId = nylasSchedulerStore?.get('cancelBookingId') || this.cancelBookingId;\n const selectedTimeslot = nylasSchedulerStore?.get('selectedTimeslot') as Timeslot;\n const rescheduleBookingId = nylasSchedulerStore?.get('rescheduleBookingId') || this.rescheduleBookingId;\n const nylasBranding = nylasSchedulerStore?.get('nylasBranding') || this.nylasBranding;\n\n if (showDefaultScheduler && cancelBookingId && !cancelledEventInfo) {\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n <div class=\"cancel-flow-page\" part=\"cancel-flow-page\">\n <nylas-cancel-booking-form cancelBookingId={cancelBookingId} exportparts=\"ncbf, ncbf__input-textfield, ncbf__button-cta, ncbf__button-outline, ncbf__input-label\" />\n </div>\n </SchedulerView>\n </Host>\n );\n }\n\n // Cancelled event card is shown when the event is cancelled\n if (showDefaultScheduler && cancelledEventInfo) {\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n <div class=\"cancelled-event-page\" part=\"cancelled-event-page\">\n <nylas-cancelled-event-card\n cancelledEventInfo={cancelledEventInfo}\n exportparts=\"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card\"\n />\n </div>\n </SchedulerView>\n </Host>\n );\n }\n // Booked event card is shown when the event is booked\n if (showDefaultScheduler && eventInfo) {\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n <div class=\"booked-event-page\" part=\"booked-event-page\">\n <nylas-booked-event-card\n selectedTimeslot={selectedTimeslot}\n eventInfo={eventInfo}\n exportparts=\"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta\"\n />\n </div>\n </SchedulerView>\n </Host>\n );\n }\n // Date and time picker is shown when the event is not booked and no additional data is shown\n if (showDefaultScheduler && (!eventInfo || !!rescheduleBookingId) && !showBookingForm) {\n const timeslotPickerCTALabel = this.host.querySelector('[slot=\"timeslot-picker-cta-label\"]');\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n {rescheduleBookingId && <MessageBanner>Choose another time slot to reschedule your meeting</MessageBanner>}\n <div class=\"select-date-page\" part=\"select-date-page\">\n <div class=\"left-panel\">\n <nylas-date-picker exportparts=\"ndp, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--selected, ndp__date--current-day, ndp__date--current-month\"></nylas-date-picker>\n <div class=\"border\"></div>\n <nylas-locale-switch></nylas-locale-switch>\n </div>\n <div class=\"right-panel\">\n <h2>\n <calendar-icon></calendar-icon>\n <span id=\"selectedDate\">{this.selectedDateLabel}</span>\n </h2>\n <nylas-timeslot-picker exportparts=\"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary\">\n {timeslotPickerCTALabel && (\n <span slot=\"timeslot-picker-cta-label\">\n <slot name=\"timeslot-picker-cta-label\"></slot>\n </span>\n )}\n </nylas-timeslot-picker>\n </div>\n </div>\n </SchedulerView>\n </Host>\n );\n }\n // Additional data is shown when the time is selected, event is not booked and additional data is shown\n if (showDefaultScheduler && !eventInfo && showBookingForm) {\n // Check if a \"custom-booking-form\" slot is provided\n const customTemplateSlot = this.host.querySelector('[slot=\"custom-booking-form\"]');\n\n return (\n <Host>\n <SchedulerView nylasBranding={nylasBranding} isLoading={this.isLoading} showNotification={this.showNotification}>\n {rescheduleBookingId && <MessageBanner>Choose another time slot to reschedule your meeting</MessageBanner>}\n <div class=\"additional-data-page\" part=\"additional-data-page\">\n <div class=\"left-panel\">\n <div class=\"wrapper\">\n <nylas-selected-event-card exportparts=\"nsec, nsec__card, nsec__icon, nsec__date, nsec__time\"></nylas-selected-event-card>\n </div>\n </div>\n <div class=\"right-panel\">\n <nylas-booking-form exportparts=\"nbf, nbf__input-label, nbf__input-textfield, nbf__button-ghost, nbf__button-primary, nbf__button-outline\">\n {customTemplateSlot && (\n <div slot=\"custom-booking-form\">\n <slot name=\"custom-booking-form\"></slot>\n </div>\n )}\n </nylas-booking-form>\n </div>\n </div>\n </SchedulerView>\n </Host>\n );\n }\n\n return (\n <Host>\n <slot />\n </Host>\n );\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as t,u as n,c as e}from"./p-901f9612.js";class r{constructor(n,e,r=true,i){this.automaticComponentRegistration=true;this.registeredComponents={};this.propStateRegistrations=new Map;this.eventListenerRegistrations=new Map;this.host=n;this.stores=e;this.automaticComponentRegistration=r;this.eventOverrides=i;t(`[${this.hostTagName}] Initializing (abstract) provider.`,{eventOverrides:i});this.registerComponent=this.registerComponent.bind(this);this.getStore=this.getStore.bind(this);Object.keys(this.stores).forEach((t=>{this.propStateRegistrations.set(t,new Map)}))}async componentWillLoad(n){t(`[${this.hostTagName}] Will load`);this.setupStoreListeners();this.nylasConnector=n;const e=Array.from(this.host.querySelectorAll("*")).filter((t=>t.tagName.toLowerCase().startsWith("nylas-")));t(`[${this.hostTagName}] Found ${e.length} child component(s).`,{childComponents:e});e.forEach((n=>{const e=n;if(!e){t(`[~${this.hostTagName}] Component ${e.tagName} does not have a name. Skipping.`);return}if(!e.registerNylasComponent){t(`[~${this.hostTagName}] Component ${e.tagName} is not a component that can be registered. Skipping.`,{component:e});return}const r={element:e,name:e.tagName.toLowerCase(),getStoresToProp:e.getStoresToProp,storeToProps:e.storeToProps,stateToProps:e.stateToProps,authToProp:e.authToProp,eventToProps:e.eventToProps,connectorToProp:e.connectorToProp};this.registerComponent(r)}))}async componentDidLoad(){t(`[${this.hostTagName}] Did load`)}async componentDisconnected(){Object.values(this.stores).forEach((t=>{t.dispose()}))}async registerComponentHandler(n){n.stopPropagation();if(!this.automaticComponentRegistration){t(`[${this.hostTagName}] Automatic component registration disabled. Skipping registration of ${n.detail.name}.`);return}this.registerComponent(n.detail)}async unregisterComponentHandler(n){n.stopPropagation();if(!this.automaticComponentRegistration){t(`[${this.hostTagName}] Automatic component registration disabled. Skipping unregistration of ${n.detail.name}.`);return}this.unregisterComponent(n.detail)}registerComponent(r){t(`[${this.hostTagName}] Registering component ${r.name}.`);const i=r.element.dataset.nylasId;if(i&&this.registeredComponents[i]){t(`[${this.hostTagName}] Component ${r.name} already registered. Skipping.`);return}const{stateToProps:s,getStoresToProp:o,eventToProps:u,storeToProps:a,connectorToProp:c,element:l}=r;l.dataset.nylasId=n();this.registeredComponents[l.dataset.nylasId]=r;const h=this.eventOverrides;console.log("eventOverrides",h,r.name,u);u?.forEach(((n,i)=>{const s=this.nylasConnector;const o=async e=>{t(`[${this.hostTagName}] Handling "${r.name}" prop "${String(i)}" event.`,{event:e});if(i in h){t(`[${this.hostTagName}] Found event override for "${String(i)}" event. Calling override.`);await h[i](e,s)}if(!e.defaultPrevented){await n(e,s)}return};const u=r.element.dataset.nylasId;if(u&&!this.eventListenerRegistrations.has(u)){this.eventListenerRegistrations.set(u,[])}if(u){this.eventListenerRegistrations.get(u)?.push([l,i,o])}t(`[${this.hostTagName}] Setting "${r.name}" event "${String(i)}" to automcially call NylasConnector method.`);const a=e(i.toString());t(`[${this.hostTagName}] Adding event listener for "${a}" on "${l.tagName}"`);l.addEventListener(a,o)}));s?.forEach(((n,e)=>{const[i,s]=e.split(".");const o=this.getStore(i);const u=o.state[s];if(!l.dataset.nylasId){t(`[${this.hostTagName}] Component "${r.name}" not registered. Skipping.`,{component:r});return}if(!this.propStateRegistrations.has(i)){this.propStateRegistrations.set(i,new Map)}if(!this.propStateRegistrations.get(i)?.has(s)){this.propStateRegistrations.get(i)?.set(s,[{elementId:l.dataset.nylasId,propKey:n}])}else{this.propStateRegistrations.get(i)?.get(s)?.push({elementId:l.dataset.nylasId,propKey:n})}l[n.toString()]=u;t(`[${this.hostTagName}] Setting "${r.name}" prop "${n.toString()}" to "${e}" value.`,{stateValue:u})}));if(o){l[o?.toString()]=this.getStore;t(`[${this.hostTagName}] Setting "${r.name}" prop "${o.toString()}" to "getStore" method.`)}a?.forEach(((n,e)=>{const i=this.getStore(e);l[n.toString()]=i;t(`[${this.hostTagName}] Setting "${r.name}" prop "${n.toString()}" to "${e}" store.`,{store:i})}));if(c){l[c?.toString()]=this.nylasConnector;t(`[${this.hostTagName}] Setting "${r.name}" prop "${c.toString()}" to "nylasConnector" value.`,{connectorToProp:c})}t(`[${this.hostTagName}] Component ${r.name} registered.`)}unregisterComponent(n){t(`[${this.hostTagName}] Unregistering component ${n.name}.`);const r=n.element.dataset.nylasId;if(!r){t(`[${this.hostTagName}] Component ${n.name} not registered. Skipping.`);return}if(this.registeredComponents[r]){t(`[${this.hostTagName}] Component ${n.name} not registered. Skipping.`);return}this.propStateRegistrations.forEach(((t,n)=>{t.forEach(((t,e)=>{const i=this.propStateRegistrations.get(n)?.get(e);const s=i?.filter((t=>t.elementId!==r));if(s){this.propStateRegistrations.get(n)?.set(e,s)}}))}));const i=this.eventListenerRegistrations.get(r);i?.forEach((([n,r,i])=>{const s=e(r.toString());t(`[${this.hostTagName}] Removing event listener for "${s}" on "${n.tagName}"`);n.removeEventListener(s,i)}));delete this.registeredComponents[r]}getStore(t){const n=this.stores[t];if(!n){throw new Error(`[${this.hostTagName}] Store "${t.toString()}" not found.`)}return n}async setupStoreListeners(){const n=this;Object.entries(this.stores).forEach((([e,r])=>{t(`[${n.hostTagName}] Listening for changes in "${e}" store.`);r.use({set(r,i,s){t(`[${n.hostTagName}] Store "${e}" state "${r.toString()}" changed`,{newValue:i,oldValue:s});if(i===s){t(`[${n.hostTagName}] Store "${e}" state "${r.toString()}" unchanged. Skipping.`);return}const o=n.registeredComponents;if(!o){t(`[${n.hostTagName}] No registered components found. Skipping.`);return}const u=n.propStateRegistrations.get(e)?.get(r.toString())||[];t(`[${n.hostTagName}] Found ${u.length} prop(s) registered for "${r.toString()}" store.`,{props:u,propStateRegistrations:n.propStateRegistrations});u.forEach((({elementId:i,propKey:s})=>{const u=o[i];if(!u){t(`[${n.hostTagName}] Component "${i}" not found. Skipping.`,{component:u});return}const a=n.getStore(e);const c=a.state[r];u.element[s.toString()]=c;t(`[${n.hostTagName}] Setting "${u.name}" prop "${s.toString()}" to "${r.toString()}" value.`,{stateValue:c})}))}})}))}get hostTagName(){return this.host?.tagName?.toLowerCase()??"nylas-provider"}}class i extends r{}const s=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};var o=Object.defineProperty;var u=(t,n,e)=>n in t?o(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var a=(t,n,e)=>(u(t,typeof n!="symbol"?n+"":n,e),e);var c=(t=>(t.Error="error",t.Warning="warning",t.Info="info",t.Success="success",t))(c||{});const l=t=>"error"in t;class h extends Error{constructor(t){super(t==null?void 0:t.message);a(this,"apiError");this.name="NylasAPIError",this.stack=(new Error).stack,this.apiError=t}}async function f(t){const n=(new TextEncoder).encode(t),e=await crypto.subtle.digest("SHA-256",n),r=Array.from(new Uint8Array(e)).map((t=>t.toString(16).padStart(2,"0"))).join("");return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const d=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:s,y=Object.keys,p=Array.isArray;function v(t,n){return typeof n!="object"||y(n).forEach((function(e){t[e]=n[e]})),t}typeof Promise>"u"||d.Promise||(d.Promise=Promise);const w=Object.getPrototypeOf,g={}.hasOwnProperty;function m(t,n){return g.call(t,n)}function b(t,n){typeof n=="function"&&(n=n(w(t))),(typeof Reflect>"u"?y:Reflect.ownKeys)(n).forEach((e=>{$(t,e,n[e])}))}const k=Object.defineProperty;function $(t,n,e,r){k(t,n,v(e&&m(e,"get")&&typeof e.get=="function"?{get:e.get,set:e.set,configurable:!0}:{value:e,configurable:!0,writable:!0},r))}function A(t){return{from:function(n){return t.prototype=Object.create(n.prototype),$(t.prototype,"constructor",t),{extend:b.bind(null,t.prototype)}}}}const S=Object.getOwnPropertyDescriptor;function x(t,n){let e;return S(t,n)||(e=w(t))&&x(e,n)}const P=[].slice;function E(t,n,e){return P.call(t,n,e)}function C(t,n){return n(t)}function O(t){if(!t)throw new Error("Assertion Failed")}function T(t){d.setImmediate?setImmediate(t):setTimeout(t,0)}function D(t,n){return t.reduce(((t,e,r)=>{var i=n(e,r);return i&&(t[i[0]]=i[1]),t}),{})}function I(t,n){if(m(t,n))return t[n];if(!n)return t;if(typeof n!="string"){for(var e=[],r=0,i=n.length;r<i;++r){var s=I(t,n[r]);e.push(s)}return e}var o=n.indexOf(".");if(o!==-1){var u=t[n.substr(0,o)];return u===void 0?void 0:I(u,n.substr(o+1))}}function j(t,n,e){if(t&&n!==void 0&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if(typeof n!="string"&&"length"in n){O(typeof e!="string"&&"length"in e);for(var r=0,i=n.length;r<i;++r)j(t,n[r],e[r])}else{var s=n.indexOf(".");if(s!==-1){var o=n.substr(0,s),u=n.substr(s+1);if(u==="")e===void 0?p(t)&&!isNaN(parseInt(o))?t.splice(o,1):delete t[o]:t[o]=e;else{var a=t[o];a&&m(t,o)||(a=t[o]={}),j(a,u,e)}}else e===void 0?p(t)&&!isNaN(parseInt(n))?t.splice(n,1):delete t[n]:t[n]=e}}function R(t){var n={};for(var e in t)m(t,e)&&(n[e]=t[e]);return n}const K=[].concat;function B(t){return K.apply([],t)}const _="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(B([8,16,32,64].map((t=>["Int","Uint","Float"].map((n=>n+t+"Array")))))).filter((t=>d[t])),q=_.map((t=>d[t]));D(_,(t=>[t,!0]));let N=null;function M(t){N=typeof WeakMap<"u"&&new WeakMap;const n=F(t);return N=null,n}function F(t){if(!t||typeof t!="object")return t;let n=N&&N.get(t);if(n)return n;if(p(t)){n=[],N&&N.set(t,n);for(var e=0,r=t.length;e<r;++e)n.push(F(t[e]))}else if(q.indexOf(t.constructor)>=0)n=t;else{const e=w(t);for(var i in n=e===Object.prototype?{}:Object.create(e),N&&N.set(t,n),t)m(t,i)&&(n[i]=F(t[i]))}return n}const{toString:U}={};function L(t){return U.call(t).slice(8,-1)}const V=typeof Symbol<"u"?Symbol.iterator:"@@iterator",H=typeof V=="symbol"?function(t){var n;return t!=null&&(n=t[V])&&n.apply(t)}:function(){return null},W={};function G(t){var n,e,r,i;if(arguments.length===1){if(p(t))return t.slice();if(this===W&&typeof t=="string")return[t];if(i=H(t)){for(e=[];!(r=i.next()).done;)e.push(r.value);return e}if(t==null)return[t];if(typeof(n=t.length)=="number"){for(e=new Array(n);n--;)e[n]=t[n];return e}return[t]}for(n=arguments.length,e=new Array(n);n--;)e[n]=arguments[n];return e}const z=typeof Symbol<"u"?t=>t[Symbol.toStringTag]==="AsyncFunction":()=>!1;var J=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Y(t,n){J=t,Q=n}var Q=()=>!0;const X=!new Error("").stack;function Z(){if(X)try{throw new Error}catch(t){return t}return new Error}function tt(t,n){var e=t.stack;return e?(n=n||0,e.indexOf(t.name)===0&&(n+=(t.name+t.message).split(`\n`).length),e.split(`\n`).slice(n).filter(Q).map((t=>`\n`+t)).join("")):""}var nt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],et=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(nt),rt={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function it(t,n){this._e=Z(),this.name=t,this.message=n}function st(t,n){return t+". Errors: "+Object.keys(n).map((t=>n[t].toString())).filter(((t,n,e)=>e.indexOf(t)===n)).join(`\n`)}function ot(t,n,e,r){this._e=Z(),this.failures=n,this.failedKeys=r,this.successCount=e,this.message=st(t,n)}function ut(t,n){this._e=Z(),this.name="BulkError",this.failures=Object.keys(n).map((t=>n[t])),this.failuresByPos=n,this.message=st(t,n)}A(it).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+tt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),A(ot).from(it),A(ut).from(it);var at=et.reduce(((t,n)=>(t[n]=n+"Error",t)),{});const ct=it;var lt=et.reduce(((t,n)=>{var e=n+"Error";function r(t,r){this._e=Z(),this.name=e,t?typeof t=="string"?(this.message=`${t}${r?`\n `+r:""}`,this.inner=r||null):typeof t=="object"&&(this.message=`${t.name} ${t.message}`,this.inner=t):(this.message=rt[n]||e,this.inner=null)}return A(r).from(ct),t[n]=r,t}),{});lt.Syntax=SyntaxError,lt.Type=TypeError,lt.Range=RangeError;var ht=nt.reduce(((t,n)=>(t[n+"Error"]=lt[n],t)),{}),ft=et.reduce(((t,n)=>(["Syntax","Type","Range"].indexOf(n)===-1&&(t[n+"Error"]=lt[n]),t)),{});function dt(){}function yt(t){return t}function pt(t,n){return t==null||t===yt?n:function(e){return n(t(e))}}function vt(t,n){return function(){t.apply(this,arguments),n.apply(this,arguments)}}function wt(t,n){return t===dt?n:function(){var e=t.apply(this,arguments);e!==void 0&&(arguments[0]=e);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=n.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?vt(r,this.onsuccess):r),i&&(this.onerror=this.onerror?vt(i,this.onerror):i),s!==void 0?s:e}}function gt(t,n){return t===dt?n:function(){t.apply(this,arguments);var e=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,n.apply(this,arguments),e&&(this.onsuccess=this.onsuccess?vt(e,this.onsuccess):e),r&&(this.onerror=this.onerror?vt(r,this.onerror):r)}}function mt(t,n){return t===dt?n:function(e){var r=t.apply(this,arguments);v(e,r);var i=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var o=n.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?vt(i,this.onsuccess):i),s&&(this.onerror=this.onerror?vt(s,this.onerror):s),r===void 0?o===void 0?void 0:o:v(r,o)}}function bt(t,n){return t===dt?n:function(){return n.apply(this,arguments)!==!1&&t.apply(this,arguments)}}function kt(t,n){return t===dt?n:function(){var e=t.apply(this,arguments);if(e&&typeof e.then=="function"){for(var r=this,i=arguments.length,s=new Array(i);i--;)s[i]=arguments[i];return e.then((function(){return n.apply(r,s)}))}return n.apply(this,arguments)}}ft.ModifyError=ot,ft.DexieError=it,ft.BulkError=ut;var $t={};const At=100,[St,xt,Pt]=typeof Promise>"u"?[]:(()=>{let t=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[t,w(t),t];const n=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[n,w(n),t]})(),Et=xt&&xt.then,Ct=St&&St.constructor,Ot=!!Pt;var Tt=!1,Dt=Pt?()=>{Pt.then(tn)}:d.setImmediate?setImmediate.bind(null,tn):d.MutationObserver?()=>{var t=document.createElement("div");new MutationObserver((()=>{tn(),t=null})).observe(t,{attributes:!0}),t.setAttribute("i","1")}:()=>{setTimeout(tn,0)},It=function(t,n){Ft.push([t,n]),Rt&&(Dt(),Rt=!1)},jt=!0,Rt=!0,Kt=[],Bt=[],_t=null,qt=yt,Nt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Pn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((t=>{try{Pn(t[0],t[1])}catch{}}))}},Mt=Nt,Ft=[],Ut=0,Lt=[];function Vt(t){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=dt,this._lib=!1;var n=this._PSD=Mt;if(J&&(this._stackHolder=Z(),this._prev=null,this._numPrev=0),typeof t!="function"){if(t!==$t)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&zt(this,this._value))}this._state=null,this._value=null,++n.ref,Gt(this,t)}const Ht={get:function(){var t=Mt,n=hn;function e(e,r){var i=!t.global&&(t!==Mt||n!==hn);const s=i&&!pn();var o=new Vt(((n,o)=>{Yt(this,new Wt(An(e,t,i,s),An(r,t,i,s),n,o,t))}));return J&&Zt(o,this),o}return e.prototype=$t,e},set:function(t){$(this,"then",t&&t.prototype===$t?Ht:{get:function(){return t},set:Ht.set})}};function Wt(t,n,e,r,i){this.onFulfilled=typeof t=="function"?t:null,this.onRejected=typeof n=="function"?n:null,this.resolve=e,this.reject=r,this.psd=i}function Gt(t,n){try{n((n=>{if(t._state===null){if(n===t)throw new TypeError("A promise cannot be resolved with itself.");var e=t._lib&&nn();n&&typeof n.then=="function"?Gt(t,((t,e)=>{n instanceof Vt?n._then(t,e):n.then(t,e)})):(t._state=!0,t._value=n,Jt(t)),e&&en()}}),zt.bind(null,t))}catch(n){zt(t,n)}}function zt(t,n){if(Bt.push(n),t._state===null){var e=t._lib&&nn();n=qt(n),t._state=!1,t._value=n,J&&n!==null&&typeof n=="object"&&!n._promise&&function(t,n,e){try{t.apply(null,e)}catch(t){n&&n(t)}}((()=>{var e=x(n,"stack");n._promise=t,$(n,"stack",{get:()=>Tt?e&&(e.get?e.get.apply(n):e.value):t.stack})})),function(t){Kt.some((n=>n._value===t._value))||Kt.push(t)}(t),Jt(t),e&&en()}}function Jt(t){var n=t._listeners;t._listeners=[];for(var e=0,r=n.length;e<r;++e)Yt(t,n[e]);var i=t._PSD;--i.ref||i.finalize(),Ut===0&&(++Ut,It((()=>{--Ut==0&&rn()}),[]))}function Yt(t,n){if(t._state!==null){var e=t._state?n.onFulfilled:n.onRejected;if(e===null)return(t._state?n.resolve:n.reject)(t._value);++n.psd.ref,++Ut,It(Qt,[e,t,n])}else t._listeners.push(n)}function Qt(t,n,e){try{_t=n;var r,i=n._value;n._state?r=t(i):(Bt.length&&(Bt=[]),r=t(i),Bt.indexOf(i)===-1&&function(t){for(var n=Kt.length;n;)if(Kt[--n]._value===t._value)return void Kt.splice(n,1)}(n)),e.resolve(r)}catch(t){e.reject(t)}finally{_t=null,--Ut==0&&rn(),--e.psd.ref||e.psd.finalize()}}function Xt(t,n,e){if(n.length===e)return n;var r="";if(t._state===!1){var i,s,o=t._value;o!=null?(i=o.name||"Error",s=o.message||o,r=tt(o,0)):(i=o,s=""),n.push(i+(s?": "+s:"")+r)}return J&&((r=tt(t._stackHolder,2))&&n.indexOf(r)===-1&&n.push(r),t._prev&&Xt(t._prev,n,e)),n}function Zt(t,n){var e=n?n._numPrev+1:0;e<100&&(t._prev=n,t._numPrev=e)}function tn(){nn()&&en()}function nn(){var t=jt;return jt=!1,Rt=!1,t}function en(){var t,n,e;do{for(;Ft.length>0;)for(t=Ft,Ft=[],e=t.length,n=0;n<e;++n){var r=t[n];r[0].apply(null,r[1])}}while(Ft.length>0);jt=!0,Rt=!0}function rn(){var t=Kt;Kt=[],t.forEach((t=>{t._PSD.onunhandled.call(null,t._value,t)}));for(var n=Lt.slice(0),e=n.length;e;)n[--e]()}function sn(t){return new Vt($t,!1,t)}function on(t,n){var e=Mt;return function(){var r=nn(),i=Mt;try{return mn(e,!0),t.apply(this,arguments)}catch(t){n&&n(t)}finally{mn(i,!1),r&&en()}}}b(Vt.prototype,{then:Ht,_then:function(t,n){Yt(this,new Wt(null,null,t,n,Mt))},catch:function(t){if(arguments.length===1)return this.then(null,t);var n=arguments[0],e=arguments[1];return typeof n=="function"?this.then(null,(t=>t instanceof n?e(t):sn(t))):this.then(null,(t=>t&&t.name===n?e(t):sn(t)))},finally:function(t){return this.then((n=>(t(),n)),(n=>(t(),sn(n))))},stack:{get:function(){if(this._stack)return this._stack;try{Tt=!0;var t=Xt(this,[],20).join(`\nFrom previous: `);return this._state!==null&&(this._stack=t),t}finally{Tt=!1}}},timeout:function(t,n){return t<1/0?new Vt(((e,r)=>{var i=setTimeout((()=>r(new lt.Timeout(n))),t);this.then(e,r).finally(clearTimeout.bind(null,i))})):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&$(Vt.prototype,Symbol.toStringTag,"Dexie.Promise"),Nt.env=bn(),b(Vt,{all:function(){var t=G.apply(null,arguments).map(vn);return new Vt((function(n,e){t.length===0&&n([]);var r=t.length;t.forEach(((i,s)=>Vt.resolve(i).then((e=>{t[s]=e,--r||n(t)}),e)))}))},resolve:t=>{if(t instanceof Vt)return t;if(t&&typeof t.then=="function")return new Vt(((n,e)=>{t.then(n,e)}));var n=new Vt($t,!0,t);return Zt(n,_t),n},reject:sn,race:function(){var t=G.apply(null,arguments).map(vn);return new Vt(((n,e)=>{t.map((t=>Vt.resolve(t).then(n,e)))}))},PSD:{get:()=>Mt,set:t=>Mt=t},totalEchoes:{get:()=>hn},newPSD:dn,usePSD:kn,scheduler:{get:()=>It,set:t=>{It=t}},rejectionMapper:{get:()=>qt,set:t=>{qt=t}},follow:(t,n)=>new Vt(((e,r)=>dn(((n,e)=>{var r=Mt;r.unhandleds=[],r.onunhandled=e,r.finalize=vt((function(){(function(t){function n(){t(),Lt.splice(Lt.indexOf(n),1)}Lt.push(n),++Ut,It((()=>{--Ut==0&&rn()}),[])})((()=>{this.unhandleds.length===0?n():e(this.unhandleds[0])}))}),r.finalize),t()}),n,e,r)))}),Ct&&(Ct.allSettled&&$(Vt,"allSettled",(function(){const t=G.apply(null,arguments).map(vn);return new Vt((n=>{t.length===0&&n([]);let e=t.length;const r=new Array(e);t.forEach(((t,i)=>Vt.resolve(t).then((t=>r[i]={status:"fulfilled",value:t}),(t=>r[i]={status:"rejected",reason:t})).then((()=>--e||n(r)))))}))})),Ct.any&&typeof AggregateError<"u"&&$(Vt,"any",(function(){const t=G.apply(null,arguments).map(vn);return new Vt(((n,e)=>{t.length===0&&e(new AggregateError([]));let r=t.length;const i=new Array(r);t.forEach(((t,s)=>Vt.resolve(t).then((t=>n(t)),(t=>{i[s]=t,--r||e(new AggregateError(i))}))))}))})));const un={awaits:0,echoes:0,id:0};var an=0,cn=[],ln=0,hn=0,fn=0;function dn(t,n,e,r){var i=Mt,s=Object.create(i);s.parent=i,s.ref=0,s.global=!1,s.id=++fn;var o=Nt.env;s.env=Ot?{Promise:Vt,PromiseProp:{value:Vt,configurable:!0,writable:!0},all:Vt.all,race:Vt.race,allSettled:Vt.allSettled,any:Vt.any,resolve:Vt.resolve,reject:Vt.reject,nthen:Sn(o.nthen,s),gthen:Sn(o.gthen,s)}:{},n&&v(s,n),++i.ref,s.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=kn(s,t,e,r);return s.ref===0&&s.finalize(),u}function yn(){return un.id||(un.id=++an),++un.awaits,un.echoes+=At,un.id}function pn(){return!!un.awaits&&(--un.awaits==0&&(un.id=0),un.echoes=un.awaits*At,!0)}function vn(t){return un.echoes&&t&&t.constructor===Ct?(yn(),t.then((t=>(pn(),t)),(t=>(pn(),En(t))))):t}function wn(t){++hn,un.echoes&&--un.echoes!=0||(un.echoes=un.id=0),cn.push(Mt),mn(t,!0)}function gn(){var t=cn[cn.length-1];cn.pop(),mn(t,!1)}function mn(t,n){var e=Mt;if((n?!un.echoes||ln++&&t===Mt:!ln||--ln&&t===Mt)||$n(n?wn.bind(null,t):gn),t!==Mt&&(Mt=t,e===Nt&&(Nt.env=bn()),Ot)){var r=Nt.env.Promise,i=t.env;xt.then=i.nthen,r.prototype.then=i.gthen,(e.global||t.global)&&(Object.defineProperty(d,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function bn(){var t=d.Promise;return Ot?{Promise:t,PromiseProp:Object.getOwnPropertyDescriptor(d,"Promise"),all:t.all,race:t.race,allSettled:t.allSettled,any:t.any,resolve:t.resolve,reject:t.reject,nthen:xt.then,gthen:t.prototype.then}:{}}function kn(t,n,e,r,i){var s=Mt;try{return mn(t,!0),n(e,r,i)}finally{mn(s,!1)}}function $n(t){Et.call(St,t)}function An(t,n,e,r){return typeof t!="function"?t:function(){var i=Mt;e&&yn(),mn(n,!0);try{return t.apply(this,arguments)}finally{mn(i,!1),r&&$n(pn)}}}function Sn(t,n){return function(e,r){return t.call(this,An(e,n),An(r,n))}}(""+Et).indexOf("[native code]")===-1&&(yn=pn=dt);const xn="unhandledrejection";function Pn(t,n){var e;try{e=n.onuncatched(t)}catch{}if(e!==!1)try{var r,i={promise:n,reason:t};if(d.document&&document.createEvent?((r=document.createEvent("Event")).initEvent(xn,!0,!0),v(r,i)):d.CustomEvent&&v(r=new CustomEvent(xn,{detail:i}),i),r&&d.dispatchEvent&&(dispatchEvent(r),!d.PromiseRejectionEvent&&d.onunhandledrejection))try{d.onunhandledrejection(r)}catch{}J&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${t.stack||t}`)}catch{}}var En=Vt.reject;function Cn(t,n,e,r){if(t.idbdb&&(t._state.openComplete||Mt.letThrough||t._vip)){var i=t._createTransaction(n,e,t._dbSchema);try{i.create(),t._state.PR1398_maxLoop=3}catch(i){return i.name===at.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then((()=>Cn(t,n,e,r)))):En(i)}return i._promise(n,((t,n)=>dn((()=>(Mt.trans=i,r(t,n,i)))))).then((t=>i._completion.then((()=>t))))}if(t._state.openComplete)return En(new lt.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return En(new lt.DatabaseClosed);t.open().catch(dt)}return t._state.dbReadyPromise.then((()=>Cn(t,n,e,r)))}const On="3.2.4",Tn=String.fromCharCode(65535),Dn=-1/0,In="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",jn="String expected.",Rn=[],Kn=typeof navigator<"u"&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Bn=Kn,_n=Kn,qn=t=>!/(dexie\.js|dexie\.min\.js)/.test(t),Nn="__dbnames",Mn="readonly",Fn="readwrite";function Un(t,n){return t?n?function(){return t.apply(this,arguments)&&n.apply(this,arguments)}:t:n}const Ln={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Vn(t){return typeof t!="string"||/\./.test(t)?t=>t:n=>(n[t]===void 0&&t in n&&delete(n=M(n))[t],n)}class Hn{_trans(t,n,e){const r=this._tx||Mt.trans,i=this.name;function s(t,e,r){if(!r.schema[i])throw new lt.NotFound("Table "+i+" not part of transaction");return n(r.idbtrans,r)}const o=nn();try{return r&&r.db===this.db?r===Mt.trans?r._promise(t,s,e):dn((()=>r._promise(t,s,e)),{trans:r,transless:Mt.transless||Mt}):Cn(this.db,t,[this.name],s)}finally{o&&en()}}get(t,n){return t&&t.constructor===Object?this.where(t).first(n):this._trans("readonly",(n=>this.core.get({trans:n,key:t}).then((t=>this.hook.reading.fire(t))))).then(n)}where(t){if(typeof t=="string")return new this.db.WhereClause(this,t);if(p(t))return new this.db.WhereClause(this,`[${t.join("+")}]`);const n=y(t);if(n.length===1)return this.where(n[0]).equals(t[n[0]]);const e=this.schema.indexes.concat(this.schema.primKey).filter((t=>t.compound&&n.every((n=>t.keyPath.indexOf(n)>=0))&&t.keyPath.every((t=>n.indexOf(t)>=0))))[0];if(e&&this.db._maxKey!==Tn)return this.where(e.name).equals(e.keyPath.map((n=>t[n])));!e&&J&&console.warn(`The query ${JSON.stringify(t)} on ${this.name} would benefit of a compound index [${n.join("+")}]`);const{idxByName:r}=this.schema,i=this.db._deps.indexedDB;function s(t,n){try{return i.cmp(t,n)===0}catch{return!1}}const[o,u]=n.reduce((([n,e],i)=>{const o=r[i],u=t[i];return[n||o,n||!o?Un(e,o&&o.multi?t=>{const n=I(t,i);return p(n)&&n.some((t=>s(u,t)))}:t=>s(u,I(t,i))):e]}),[null,null]);return o?this.where(o.name).equals(t[o.keyPath]).filter(u):e?this.filter(u):this.where(n).equals("")}filter(t){return this.toCollection().and(t)}count(t){return this.toCollection().count(t)}offset(t){return this.toCollection().offset(t)}limit(t){return this.toCollection().limit(t)}each(t){return this.toCollection().each(t)}toArray(t){return this.toCollection().toArray(t)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(t){return new this.db.Collection(new this.db.WhereClause(this,p(t)?`[${t.join("+")}]`:t))}reverse(){return this.toCollection().reverse()}mapToClass(t){this.schema.mappedClass=t;const n=n=>{if(!n)return n;const e=Object.create(t.prototype);for(var r in n)if(m(n,r))try{e[r]=n[r]}catch{}return e};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=n,this.hook("reading",n),t}defineClass(){return this.mapToClass((function(t){v(this,t)}))}add(t,n){const{auto:e,keyPath:r}=this.schema.primKey;let i=t;return r&&e&&(i=Vn(r)(t)),this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"add",keys:n!=null?[n]:null,values:[i]}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):t.lastResult)).then((n=>{if(r)try{j(t,r,n)}catch{}return n}))}update(t,n){if(typeof t!="object"||p(t))return this.where(":id").equals(t).modify(n);{const e=I(t,this.schema.primKey.keyPath);if(e===void 0)return En(new lt.InvalidArgument("Given object does not contain its primary key"));try{typeof n!="function"?y(n).forEach((e=>{j(t,e,n[e])})):n(t,{value:t,primKey:e})}catch{}return this.where(":id").equals(e).modify(n)}}put(t,n){const{auto:e,keyPath:r}=this.schema.primKey;let i=t;return r&&e&&(i=Vn(r)(t)),this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"put",values:[i],keys:n!=null?[n]:null}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):t.lastResult)).then((n=>{if(r)try{j(t,r,n)}catch{}return n}))}delete(t){return this._trans("readwrite",(n=>this.core.mutate({trans:n,type:"delete",keys:[t]}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):void 0))}clear(){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"deleteRange",range:Ln}))).then((t=>t.numFailures?Vt.reject(t.failures[0]):void 0))}bulkGet(t){return this._trans("readonly",(n=>this.core.getMany({keys:t,trans:n}).then((t=>t.map((t=>this.hook.reading.fire(t)))))))}bulkAdd(t,n,e){const r=Array.isArray(n)?n:void 0,i=(e=e||(r?void 0:n))?e.allKeys:void 0;return this._trans("readwrite",(n=>{const{auto:e,keyPath:s}=this.schema.primKey;if(s&&r)throw new lt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==t.length)throw new lt.InvalidArgument("Arguments objects and keys must have the same length");const o=t.length;let u=s&&e?t.map(Vn(s)):t;return this.core.mutate({trans:n,type:"add",keys:r,values:u,wantResults:i}).then((({numFailures:t,results:n,lastResult:e,failures:r})=>{if(t===0)return i?n:e;throw new ut(`${this.name}.bulkAdd(): ${t} of ${o} operations failed`,r)}))}))}bulkPut(t,n,e){const r=Array.isArray(n)?n:void 0,i=(e=e||(r?void 0:n))?e.allKeys:void 0;return this._trans("readwrite",(n=>{const{auto:e,keyPath:s}=this.schema.primKey;if(s&&r)throw new lt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==t.length)throw new lt.InvalidArgument("Arguments objects and keys must have the same length");const o=t.length;let u=s&&e?t.map(Vn(s)):t;return this.core.mutate({trans:n,type:"put",keys:r,values:u,wantResults:i}).then((({numFailures:t,results:n,lastResult:e,failures:r})=>{if(t===0)return i?n:e;throw new ut(`${this.name}.bulkPut(): ${t} of ${o} operations failed`,r)}))}))}bulkDelete(t){const n=t.length;return this._trans("readwrite",(n=>this.core.mutate({trans:n,type:"delete",keys:t}))).then((({numFailures:t,lastResult:e,failures:r})=>{if(t===0)return e;throw new ut(`${this.name}.bulkDelete(): ${t} of ${n} operations failed`,r)}))}}function Wn(t){var n={},e=function(e,r){if(r){for(var i=arguments.length,s=new Array(i-1);--i;)s[i-1]=arguments[i];return n[e].subscribe.apply(null,s),t}if(typeof e=="string")return n[e]};e.addEventType=s;for(var r=1,i=arguments.length;r<i;++r)s(arguments[r]);return e;function s(t,r,i){if(typeof t!="object"){var o;r||(r=bt),i||(i=dt);var u={subscribers:[],fire:i,subscribe:function(t){u.subscribers.indexOf(t)===-1&&(u.subscribers.push(t),u.fire=r(u.fire,t))},unsubscribe:function(t){u.subscribers=u.subscribers.filter((function(n){return n!==t})),u.fire=u.subscribers.reduce(r,i)}};return n[t]=e[t]=u,u}y(o=t).forEach((function(t){var n=o[t];if(p(n))s(t,o[t][0],o[t][1]);else{if(n!=="asap")throw new lt.InvalidArgument("Invalid event config");var e=s(t,yt,(function(){for(var t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];e.subscribers.forEach((function(t){T((function(){t.apply(null,n)}))}))}))}}))}}function Gn(t,n){return A(n).from({prototype:t}),n}function zn(t,n){return!(t.filter||t.algorithm||t.or)&&(n?t.justLimit:!t.replayFilter)}function Jn(t,n){t.filter=Un(t.filter,n)}function Yn(t,n,e){var r=t.replayFilter;t.replayFilter=r?()=>Un(r(),n()):n,t.justLimit=e&&!r}function Qn(t,n){if(t.isPrimKey)return n.primaryKey;const e=n.getIndexByKeyPath(t.index);if(!e)throw new lt.Schema("KeyPath "+t.index+" on object store "+n.name+" is not indexed");return e}function Xn(t,n,e){const r=Qn(t,n.schema);return n.openCursor({trans:e,values:!t.keysOnly,reverse:t.dir==="prev",unique:!!t.unique,query:{index:r,range:t.range}})}function Zn(t,n,e,r){const i=t.replayFilter?Un(t.filter,t.replayFilter()):t.filter;if(t.or){const s={},o=(t,e,r)=>{if(!i||i(e,r,(t=>e.stop(t)),(t=>e.fail(t)))){var o=e.primaryKey,u=""+o;u==="[object ArrayBuffer]"&&(u=""+new Uint8Array(o)),m(s,u)||(s[u]=!0,n(t,e,r))}};return Promise.all([t.or._iterate(o,e),te(Xn(t,r,e),t.algorithm,o,!t.keysOnly&&t.valueMapper)])}return te(Xn(t,r,e),Un(t.algorithm,i),n,!t.keysOnly&&t.valueMapper)}function te(t,n,e,r){var i=on(r?(t,n,i)=>e(r(t),n,i):e);return t.then((t=>{if(t)return t.start((()=>{var e=()=>t.continue();n&&!n(t,(t=>e=t),(n=>{t.stop(n),e=dt}),(n=>{t.fail(n),e=dt}))||i(t.value,t,(t=>e=t)),e()}))}))}function ne(t,n){try{const e=ee(t),r=ee(n);if(e!==r)return e==="Array"?1:r==="Array"?-1:e==="binary"?1:r==="binary"?-1:e==="string"?1:r==="string"?-1:e==="Date"?1:r!=="Date"?NaN:-1;switch(e){case"number":case"Date":case"string":return t>n?1:t<n?-1:0;case"binary":return function(t,n){const e=t.length,r=n.length,i=e<r?e:r;for(let e=0;e<i;++e)if(t[e]!==n[e])return t[e]<n[e]?-1:1;return e===r?0:e<r?-1:1}(re(t),re(n));case"Array":return function(t,n){const e=t.length,r=n.length,i=e<r?e:r;for(let e=0;e<i;++e){const r=ne(t[e],n[e]);if(r!==0)return r}return e===r?0:e<r?-1:1}(t,n)}}catch{}return NaN}function ee(t){const n=typeof t;if(n!=="object")return n;if(ArrayBuffer.isView(t))return"binary";const e=L(t);return e==="ArrayBuffer"?"binary":e}function re(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)}class ie{_read(t,n){var e=this._ctx;return e.error?e.table._trans(null,En.bind(null,e.error)):e.table._trans("readonly",t).then(n)}_write(t){var n=this._ctx;return n.error?n.table._trans(null,En.bind(null,n.error)):n.table._trans("readwrite",t,"locked")}_addAlgorithm(t){var n=this._ctx;n.algorithm=Un(n.algorithm,t)}_iterate(t,n){return Zn(this._ctx,t,n,this._ctx.table.core)}clone(t){var n=Object.create(this.constructor.prototype),e=Object.create(this._ctx);return t&&v(e,t),n._ctx=e,n}raw(){return this._ctx.valueMapper=null,this}each(t){var n=this._ctx;return this._read((e=>Zn(n,t,e,n.table.core)))}count(t){return this._read((t=>{const n=this._ctx,e=n.table.core;if(zn(n,!0))return e.count({trans:t,query:{index:Qn(n,e.schema),range:n.range}}).then((t=>Math.min(t,n.limit)));var r=0;return Zn(n,(()=>(++r,!1)),t,e).then((()=>r))})).then(t)}sortBy(t,n){const e=t.split(".").reverse(),r=e[0],i=e.length-1;function s(t,n){return n?s(t[e[n]],n-1):t[r]}var o=this._ctx.dir==="next"?1:-1;function u(t,n){var e=s(t,i),r=s(n,i);return e<r?-o:e>r?o:0}return this.toArray((function(t){return t.sort(u)})).then(n)}toArray(t){return this._read((t=>{var n=this._ctx;if(n.dir==="next"&&zn(n,!0)&&n.limit>0){const{valueMapper:e}=n,r=Qn(n,n.table.core.schema);return n.table.core.query({trans:t,limit:n.limit,values:!0,query:{index:r,range:n.range}}).then((({result:t})=>e?t.map(e):t))}{const e=[];return Zn(n,(t=>e.push(t)),t,n.table.core).then((()=>e))}}),t)}offset(t){var n=this._ctx;return t<=0||(n.offset+=t,zn(n)?Yn(n,(()=>{var n=t;return(t,e)=>n===0||(n===1?(--n,!1):(e((()=>{t.advance(n),n=0})),!1))})):Yn(n,(()=>{var n=t;return()=>--n<0}))),this}limit(t){return this._ctx.limit=Math.min(this._ctx.limit,t),Yn(this._ctx,(()=>{var n=t;return function(t,e,r){return--n<=0&&e(r),n>=0}}),!0),this}until(t,n){return Jn(this._ctx,(function(e,r,i){return!t(e.value)||(r(i),n)})),this}first(t){return this.limit(1).toArray((function(t){return t[0]})).then(t)}last(t){return this.reverse().first(t)}filter(t){var n,e;return Jn(this._ctx,(function(n){return t(n.value)})),n=this._ctx,e=t,n.isMatch=Un(n.isMatch,e),this}and(t){return this.filter(t)}or(t){return new this.db.WhereClause(this._ctx.table,t,this)}reverse(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each((function(n,e){t(e.key,e)}))}eachUniqueKey(t){return this._ctx.unique="unique",this.eachKey(t)}eachPrimaryKey(t){var n=this._ctx;return n.keysOnly=!n.isMatch,this.each((function(n,e){t(e.primaryKey,e)}))}keys(t){var n=this._ctx;n.keysOnly=!n.isMatch;var e=[];return this.each((function(t,n){e.push(n.key)})).then((function(){return e})).then(t)}primaryKeys(t){var n=this._ctx;if(n.dir==="next"&&zn(n,!0)&&n.limit>0)return this._read((t=>{var e=Qn(n,n.table.core.schema);return n.table.core.query({trans:t,values:!1,limit:n.limit,query:{index:e,range:n.range}})})).then((({result:t})=>t)).then(t);n.keysOnly=!n.isMatch;var e=[];return this.each((function(t,n){e.push(n.primaryKey)})).then((function(){return e})).then(t)}uniqueKeys(t){return this._ctx.unique="unique",this.keys(t)}firstKey(t){return this.limit(1).keys((function(t){return t[0]})).then(t)}lastKey(t){return this.reverse().firstKey(t)}distinct(){var t=this._ctx,n=t.index&&t.table.schema.idxByName[t.index];if(!n||!n.multi)return this;var e={};return Jn(this._ctx,(function(t){var n=t.primaryKey.toString(),r=m(e,n);return e[n]=!0,!r})),this}modify(t){var n=this._ctx;return this._write((e=>{var r;if(typeof t=="function")r=t;else{var i=y(t),s=i.length;r=function(n){for(var e=!1,r=0;r<s;++r){var o=i[r],u=t[o];I(n,o)!==u&&(j(n,o,u),e=!0)}return e}}const o=n.table.core,{outbound:u,extractKey:a}=o.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let h=0;const f=[],d=(t,n)=>{const{failures:e,numFailures:r}=n;h+=t-r;for(let t of y(e))l.push(e[t])};return this.clone().primaryKeys().then((i=>{const s=l=>{const h=Math.min(c,i.length-l);return o.getMany({trans:e,keys:i.slice(l,l+h),cache:"immutable"}).then((f=>{const y=[],p=[],v=u?[]:null,w=[];for(let t=0;t<h;++t){const n=f[t],e={value:M(n),primKey:i[l+t]};r.call(e,e.value,e)!==!1&&(e.value==null?w.push(i[l+t]):u||ne(a(n),a(e.value))===0?(p.push(e.value),u&&v.push(i[l+t])):(w.push(i[l+t]),y.push(e.value)))}const g=zn(n)&&n.limit===1/0&&(typeof t!="function"||t===se)&&{index:n.index,range:n.range};return Promise.resolve(y.length>0&&o.mutate({trans:e,type:"add",values:y}).then((t=>{for(let n in t.failures)w.splice(parseInt(n),1);d(y.length,t)}))).then((()=>(p.length>0||g&&typeof t=="object")&&o.mutate({trans:e,type:"put",keys:v,values:p,criteria:g,changeSpec:typeof t!="function"&&t}).then((t=>d(p.length,t))))).then((()=>(w.length>0||g&&t===se)&&o.mutate({trans:e,type:"delete",keys:w,criteria:g}).then((t=>d(w.length,t))))).then((()=>i.length>l+h&&s(l+c)))}))};return s(0).then((()=>{if(l.length>0)throw new ot("Error modifying one or more objects",l,h,f);return i.length}))}))}))}delete(){var t=this._ctx,n=t.range;return zn(t)&&(t.isPrimKey&&!_n||n.type===3)?this._write((e=>{const{primaryKey:r}=t.table.core.schema,i=n;return t.table.core.count({trans:e,query:{index:r,range:i}}).then((n=>t.table.core.mutate({trans:e,type:"deleteRange",range:i}).then((({failures:t,lastResult:e,results:r,numFailures:i})=>{if(i)throw new ot("Could not delete some values",Object.keys(t).map((n=>t[n])),n-i);return n-i}))))})):this.modify(se)}}const se=(t,n)=>n.value=null;function oe(t,n){return t<n?-1:t===n?0:1}function ue(t,n){return t>n?-1:t===n?0:1}function ae(t,n,e){var r=t instanceof ye?new t.Collection(t):t;return r._ctx.error=e?new e(n):new TypeError(n),r}function ce(t){return new t.Collection(t,(()=>de(""))).limit(0)}function le(t,n,e,r,i,s){for(var o=Math.min(t.length,r.length),u=-1,a=0;a<o;++a){var c=n[a];if(c!==r[a])return i(t[a],e[a])<0?t.substr(0,a)+e[a]+e.substr(a+1):i(t[a],r[a])<0?t.substr(0,a)+r[a]+e.substr(a+1):u>=0?t.substr(0,u)+n[u]+e.substr(u+1):null;i(t[a],c)<0&&(u=a)}return o<r.length&&s==="next"?t+e.substr(t.length):o<t.length&&s==="prev"?t.substr(0,e.length):u<0?null:t.substr(0,u)+r[u]+e.substr(u+1)}function he(t,n,e,r){var i,s,o,u,a,c,l,h=e.length;if(!e.every((t=>typeof t=="string")))return ae(t,jn);function f(t){i=function(t){return t==="next"?t=>t.toUpperCase():t=>t.toLowerCase()}(t),s=function(t){return t==="next"?t=>t.toLowerCase():t=>t.toUpperCase()}(t),o=t==="next"?oe:ue;var n=e.map((function(t){return{lower:s(t),upper:i(t)}})).sort((function(t,n){return o(t.lower,n.lower)}));u=n.map((function(t){return t.upper})),a=n.map((function(t){return t.lower})),c=t,l=t==="next"?"":r}f("next");var d=new t.Collection(t,(()=>fe(u[0],a[h-1]+r)));d._ondirectionchange=function(t){f(t)};var y=0;return d._addAlgorithm((function(t,e,r){var i=t.key;if(typeof i!="string")return!1;var f=s(i);if(n(f,a,y))return!0;for(var d=null,p=y;p<h;++p){var v=le(i,f,u[p],a[p],o,c);v===null&&d===null?y=p+1:(d===null||o(d,v)>0)&&(d=v)}return e(d!==null?function(){t.continue(d+l)}:r),!1})),d}function fe(t,n,e,r){return{type:2,lower:t,upper:n,lowerOpen:e,upperOpen:r}}function de(t){return{type:1,lower:t,upper:t}}class ye{get Collection(){return this._ctx.table.db.Collection}between(t,n,e,r){e=e!==!1,r=r===!0;try{return this._cmp(t,n)>0||this._cmp(t,n)===0&&(e||r)&&(!e||!r)?ce(this):new this.Collection(this,(()=>fe(t,n,!e,!r)))}catch{return ae(this,In)}}equals(t){return t==null?ae(this,In):new this.Collection(this,(()=>de(t)))}above(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(t,void 0,!0)))}aboveOrEqual(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(t,void 0,!1)))}below(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(void 0,t,!1,!0)))}belowOrEqual(t){return t==null?ae(this,In):new this.Collection(this,(()=>fe(void 0,t)))}startsWith(t){return typeof t!="string"?ae(this,jn):this.between(t,t+Tn,!0,!0)}startsWithIgnoreCase(t){return t===""?this.startsWith(t):he(this,((t,n)=>t.indexOf(n[0])===0),[t],Tn)}equalsIgnoreCase(t){return he(this,((t,n)=>t===n[0]),[t],"")}anyOfIgnoreCase(){var t=G.apply(W,arguments);return t.length===0?ce(this):he(this,((t,n)=>n.indexOf(t)!==-1),t,"")}startsWithAnyOfIgnoreCase(){var t=G.apply(W,arguments);return t.length===0?ce(this):he(this,((t,n)=>n.some((n=>t.indexOf(n)===0))),t,Tn)}anyOf(){const t=G.apply(W,arguments);let n=this._cmp;try{t.sort(n)}catch{return ae(this,In)}if(t.length===0)return ce(this);const e=new this.Collection(this,(()=>fe(t[0],t[t.length-1])));e._ondirectionchange=e=>{n=e==="next"?this._ascending:this._descending,t.sort(n)};let r=0;return e._addAlgorithm(((e,i,s)=>{const o=e.key;for(;n(o,t[r])>0;)if(++r,r===t.length)return i(s),!1;return n(o,t[r])===0||(i((()=>{e.continue(t[r])})),!1)})),e}notEqual(t){return this.inAnyRange([[Dn,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const t=G.apply(W,arguments);if(t.length===0)return new this.Collection(this);try{t.sort(this._ascending)}catch{return ae(this,In)}const n=t.reduce(((t,n)=>t?t.concat([[t[t.length-1][1],n]]):[[Dn,n]]),null);return n.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})}inAnyRange(t,n){const e=this._cmp,r=this._ascending,i=this._descending,s=this._min,o=this._max;if(t.length===0)return ce(this);if(!t.every((t=>t[0]!==void 0&&t[1]!==void 0&&r(t[0],t[1])<=0)))return ae(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",lt.InvalidArgument);const u=!n||n.includeLowers!==!1,a=n&&n.includeUppers===!0;let c,l=r;function h(t,n){return l(t[0],n[0])}try{c=t.reduce((function(t,n){let r=0,i=t.length;for(;r<i;++r){const i=t[r];if(e(n[0],i[1])<0&&e(n[1],i[0])>0){i[0]=s(i[0],n[0]),i[1]=o(i[1],n[1]);break}}return r===i&&t.push(n),t}),[]),c.sort(h)}catch{return ae(this,In)}let f=0;const d=a?t=>r(t,c[f][1])>0:t=>r(t,c[f][1])>=0,y=u?t=>i(t,c[f][0])>0:t=>i(t,c[f][0])>=0;let p=d;const v=new this.Collection(this,(()=>fe(c[0][0],c[c.length-1][1],!u,!a)));return v._ondirectionchange=t=>{t==="next"?(p=d,l=r):(p=y,l=i),c.sort(h)},v._addAlgorithm(((t,n,e)=>{for(var i=t.key;p(i);)if(++f,f===c.length)return n(e),!1;return!!function(t){return!d(t)&&!y(t)}(i)||(this._cmp(i,c[f][1])===0||this._cmp(i,c[f][0])===0||n((()=>{l===r?t.continue(c[f][0]):t.continue(c[f][1])})),!1)})),v}startsWithAnyOf(){const t=G.apply(W,arguments);return t.every((t=>typeof t=="string"))?t.length===0?ce(this):this.inAnyRange(t.map((t=>[t,t+Tn]))):ae(this,"startsWithAnyOf() only works with strings")}}function pe(t){return on((function(n){return ve(n),t(n.target.error),!1}))}function ve(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()}const we="storagemutated",ge="x-storagemutated-1",me=Wn(null,we);class be{_lock(){return O(!Mt.global),++this._reculock,this._reculock!==1||Mt.global||(Mt.lockOwnerFor=this),this}_unlock(){if(O(!Mt.global),--this._reculock==0)for(Mt.global||(Mt.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{kn(t[1],t[0])}catch{}}return this}_locked(){return this._reculock&&Mt.lockOwnerFor!==this}create(t){if(!this.mode)return this;const n=this.db.idbdb,e=this.db._state.dbOpenError;if(O(!this.idbtrans),!t&&!n)switch(e&&e.name){case"DatabaseClosedError":throw new lt.DatabaseClosed(e);case"MissingAPIError":throw new lt.MissingAPI(e.message,e);default:throw new lt.OpenFailed(e)}if(!this.active)throw new lt.TransactionInactive;return O(this._completion._state===null),(t=this.idbtrans=t||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=on((n=>{ve(n),this._reject(t.error)})),t.onabort=on((n=>{ve(n),this.active&&this._reject(new lt.Abort(t.error)),this.active=!1,this.on("abort").fire(n)})),t.oncomplete=on((()=>{this.active=!1,this._resolve(),"mutatedParts"in t&&me.storagemutated.fire(t.mutatedParts)})),this}_promise(t,n,e){if(t==="readwrite"&&this.mode!=="readwrite")return En(new lt.ReadOnly("Transaction is readonly"));if(!this.active)return En(new lt.TransactionInactive);if(this._locked())return new Vt(((r,i)=>{this._blockedFuncs.push([()=>{this._promise(t,n,e).then(r,i)},Mt])}));if(e)return dn((()=>{var t=new Vt(((t,e)=>{this._lock();const r=n(t,e,this);r&&r.then&&r.then(t,e)}));return t.finally((()=>this._unlock())),t._lib=!0,t}));var r=new Vt(((t,e)=>{var r=n(t,e,this);r&&r.then&&r.then(t,e)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(t){var n=this._root();const e=Vt.resolve(t);if(n._waitingFor)n._waitingFor=n._waitingFor.then((()=>e));else{n._waitingFor=e,n._waitingQueue=[];var r=n.idbtrans.objectStore(n.storeNames[0]);(function t(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(r.get(-1/0).onsuccess=t)})()}var i=n._waitingFor;return new Vt(((t,r)=>{e.then((e=>n._waitingQueue.push(on(t.bind(null,e)))),(t=>n._waitingQueue.push(on(r.bind(null,t))))).finally((()=>{n._waitingFor===i&&(n._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new lt.Abort))}table(t){const n=this._memoizedTables||(this._memoizedTables={});if(m(n,t))return n[t];const e=this.schema[t];if(!e)throw new lt.NotFound("Table "+t+" not part of transaction");const r=new this.db.Table(t,e,this);return r.core=this.db.core.table(t),n[t]=r,r}}function ke(t,n,e,r,i,s,o){return{name:t,keyPath:n,unique:e,multi:r,auto:i,compound:s,src:(e&&!o?"&":"")+(r?"*":"")+(i?"++":"")+$e(n)}}function $e(t){return typeof t=="string"?t:t?"["+[].join.call(t,"+")+"]":""}function Ae(t,n,e){return{name:t,primKey:n,indexes:e,mappedClass:null,idxByName:D(e,(t=>[t.name,t]))}}let Se=t=>{try{return t.only([[]]),Se=()=>[[]],[[]]}catch{return Se=()=>Tn,Tn}};function xe(t){return t==null?()=>{}:typeof t=="string"?function(t){return t.split(".").length===1?n=>n[t]:n=>I(n,t)}(t):n=>I(n,t)}function Pe(t){return[].slice.call(t)}let Ee=0;function Ce(t){return t==null?":id":typeof t=="string"?t:`[${t.join("+")}]`}function Oe(t,n,e){function r(t){if(t.type===3)return null;if(t.type===4)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:e,upper:r,lowerOpen:i,upperOpen:s}=t;return e===void 0?r===void 0?null:n.upperBound(r,!!s):r===void 0?n.lowerBound(e,!!i):n.bound(e,r,!!i,!!s)}const{schema:i,hasGetAll:s}=function(t,n){const e=Pe(t.objectStoreNames);return{schema:{name:t.name,tables:e.map((t=>n.objectStore(t))).map((t=>{const{keyPath:n,autoIncrement:e}=t,r=p(n),i=n==null,s={},o={name:t.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:n,autoIncrement:e,unique:!0,extractKey:xe(n)},indexes:Pe(t.indexNames).map((n=>t.index(n))).map((t=>{const{name:n,unique:e,multiEntry:r,keyPath:i}=t,o={name:n,compound:p(i),keyPath:i,unique:e,multiEntry:r,extractKey:xe(i)};return s[Ce(i)]=o,o})),getIndexByKeyPath:t=>s[Ce(t)]};return s[":id"]=o.primaryKey,n!=null&&(s[Ce(n)]=o.primaryKey),o}))},hasGetAll:e.length>0&&"getAll"in n.objectStore(e[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(t,e),o=i.tables.map((t=>function(t){const n=t.name;return{name:n,schema:t,mutate:function({trans:t,type:e,keys:i,values:s,range:o}){return new Promise(((u,a)=>{u=on(u);const c=t.objectStore(n),l=c.keyPath==null,h=e==="put"||e==="add";if(!h&&e!=="delete"&&e!=="deleteRange")throw new Error("Invalid operation type: "+e);const{length:f}=i||s||{length:1};if(i&&s&&i.length!==s.length)throw new Error("Given keys array must have same length as given values array.");if(f===0)return u({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const y=[],p=[];let v=0;const w=t=>{++v,ve(t)};if(e==="deleteRange"){if(o.type===4)return u({numFailures:v,failures:p,results:[],lastResult:void 0});o.type===3?y.push(d=c.clear()):y.push(d=c.delete(r(o)))}else{const[t,n]=h?l?[s,i]:[s,null]:[i,null];if(h)for(let r=0;r<f;++r)y.push(d=n&&n[r]!==void 0?c[e](t[r],n[r]):c[e](t[r])),d.onerror=w;else for(let n=0;n<f;++n)y.push(d=c[e](t[n])),d.onerror=w}const g=t=>{const n=t.target.result;y.forEach(((t,n)=>t.error!=null&&(p[n]=t.error))),u({numFailures:v,failures:p,results:e==="delete"?i:y.map((t=>t.result)),lastResult:n})};d.onerror=t=>{w(t),g(t)},d.onsuccess=g}))},getMany:({trans:t,keys:e})=>new Promise(((r,i)=>{r=on(r);const s=t.objectStore(n),o=e.length,u=new Array(o);let a,c=0,l=0;const h=t=>{const n=t.target;u[n._pos]=n.result,++l===c&&r(u)},f=pe(i);for(let t=0;t<o;++t)e[t]!=null&&(a=s.get(e[t]),a._pos=t,a.onsuccess=h,a.onerror=f,++c);c===0&&r(u)})),get:({trans:t,key:e})=>new Promise(((r,i)=>{r=on(r);const s=t.objectStore(n).get(e);s.onsuccess=t=>r(t.target.result),s.onerror=pe(i)})),query:function(t){return e=>new Promise(((i,s)=>{i=on(i);const{trans:o,values:u,limit:a,query:c}=e,l=a===1/0?void 0:a,{index:h,range:f}=c,d=o.objectStore(n),y=h.isPrimaryKey?d:d.index(h.name),p=r(f);if(a===0)return i({result:[]});if(t){const t=u?y.getAll(p,l):y.getAllKeys(p,l);t.onsuccess=t=>i({result:t.target.result}),t.onerror=pe(s)}else{let t=0;const n=u||!("openKeyCursor"in y)?y.openCursor(p):y.openKeyCursor(p),e=[];n.onsuccess=r=>{const s=n.result;return s?(e.push(u?s.value:s.primaryKey),++t===a?i({result:e}):void s.continue()):i({result:e})},n.onerror=pe(s)}}))}(s),openCursor:function({trans:t,values:e,query:i,reverse:s,unique:o}){return new Promise(((u,a)=>{u=on(u);const{index:c,range:l}=i,h=t.objectStore(n),f=c.isPrimaryKey?h:h.index(c.name),d=s?o?"prevunique":"prev":o?"nextunique":"next",y=e||!("openKeyCursor"in f)?f.openCursor(r(l),d):f.openKeyCursor(r(l),d);y.onerror=pe(a),y.onsuccess=on((n=>{const e=y.result;if(!e)return void u(null);e.___id=++Ee,e.done=!1;const r=e.continue.bind(e);let i=e.continuePrimaryKey;i&&(i=i.bind(e));const s=e.advance.bind(e),o=()=>{throw new Error("Cursor not stopped")};e.trans=t,e.stop=e.continue=e.continuePrimaryKey=e.advance=()=>{throw new Error("Cursor not started")},e.fail=on(a),e.next=function(){let t=1;return this.start((()=>t--?this.continue():this.stop())).then((()=>this))},e.start=t=>{const n=new Promise(((t,n)=>{t=on(t),y.onerror=pe(n),e.fail=n,e.stop=n=>{e.stop=e.continue=e.continuePrimaryKey=e.advance=o,t(n)}})),u=()=>{if(y.result)try{t()}catch(t){e.fail(t)}else e.done=!0,e.start=()=>{throw new Error("Cursor behind last entry")},e.stop()};return y.onsuccess=on((t=>{y.onsuccess=u,u()})),e.continue=r,e.continuePrimaryKey=i,e.advance=s,u(),n},u(e)}),a)}))},count({query:t,trans:e}){const{index:i,range:s}=t;return new Promise(((t,o)=>{const u=e.objectStore(n),a=i.isPrimaryKey?u:u.index(i.name),c=r(s),l=c?a.count(c):a.count();l.onsuccess=on((n=>t(n.target.result))),l.onerror=pe(o)}))}}}(t))),u={};return o.forEach((t=>u[t.name]=t)),{stack:"dbcore",transaction:t.transaction.bind(t),table(t){if(!u[t])throw new Error(`Table '${t}' not found`);return u[t]},MIN_KEY:-1/0,MAX_KEY:Se(n),schema:i}}function Te({_novip:t},n){const e=n.db,r=function(t,n,{IDBKeyRange:e,indexedDB:r},i){return{dbcore:function(t,n){return n.reduce(((t,{create:n})=>({...t,...n(t)})),t)}(Oe(n,e,i),t.dbcore)}}(t._middlewares,e,t._deps,n);t.core=r.dbcore,t.tables.forEach((n=>{const e=n.name;t.core.schema.tables.some((t=>t.name===e))&&(n.core=t.core.table(e),t[e]instanceof t.Table&&(t[e].core=n.core))}))}function De({_novip:t},n,e,r){e.forEach((e=>{const i=r[e];n.forEach((n=>{const r=x(n,e);(!r||"value"in r&&r.value===void 0)&&(n===t.Transaction.prototype||n instanceof t.Transaction?$(n,e,{get(){return this.table(e)},set(t){k(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):n[e]=new t.Table(e,i))}))}))}function Ie({_novip:t},n){n.forEach((n=>{for(let e in n)n[e]instanceof t.Table&&delete n[e]}))}function je(t,n){return t._cfg.version-n._cfg.version}function Re(t,n,e,r){const i=t._dbSchema,s=t._createTransaction("readwrite",t._storeNames,i);s.create(e),s._completion.catch(r);const o=s._reject.bind(s),u=Mt.transless||Mt;dn((()=>{Mt.trans=s,Mt.transless=u,n===0?(y(i).forEach((t=>{Be(e,t,i[t].primKey,i[t].indexes)})),Te(t,e),Vt.follow((()=>t.on.populate.fire(s))).catch(o)):function({_novip:t},n,e,r){const i=[],s=t._versions;let o=t._dbSchema=qe(t,t.idbdb,r),u=!1;const a=s.filter((t=>t._cfg.version>=n));function c(){return i.length?Vt.resolve(i.shift()(e.idbtrans)).then(c):Vt.resolve()}return a.forEach((s=>{i.push((()=>{const i=o,a=s._cfg.dbschema;Ne(t,i,r),Ne(t,a,r),o=t._dbSchema=a;const c=Ke(i,a);c.add.forEach((t=>{Be(r,t[0],t[1].primKey,t[1].indexes)})),c.change.forEach((t=>{if(t.recreate)throw new lt.Upgrade("Not yet support for changing primary key");{const n=r.objectStore(t.name);t.add.forEach((t=>_e(n,t))),t.change.forEach((t=>{n.deleteIndex(t.name),_e(n,t)})),t.del.forEach((t=>n.deleteIndex(t)))}}));const l=s._cfg.contentUpgrade;if(l&&s._cfg.version>n){Te(t,r),e._memoizedTables={},u=!0;let n=R(a);c.del.forEach((t=>{n[t]=i[t]})),Ie(t,[t.Transaction.prototype]),De(t,[t.Transaction.prototype],y(n),n),e.schema=n;const s=z(l);let o;s&&yn();const h=Vt.follow((()=>{if(o=l(e),o&&s){var t=pn.bind(null,null);o.then(t,t)}}));return o&&typeof o.then=="function"?Vt.resolve(o):h.then((()=>o))}})),i.push((n=>{(!u||!Bn)&&function(t,n){[].slice.call(n.db.objectStoreNames).forEach((e=>t[e]==null&&n.db.deleteObjectStore(e)))}(s._cfg.dbschema,n),Ie(t,[t.Transaction.prototype]),De(t,[t.Transaction.prototype],t._storeNames,t._dbSchema),e.schema=t._dbSchema}))})),c().then((()=>{var t,n;n=r,y(t=o).forEach((e=>{n.db.objectStoreNames.contains(e)||Be(n,e,t[e].primKey,t[e].indexes)}))}))}(t,n,s,e).catch(o)}))}function Ke(t,n){const e={del:[],add:[],change:[]};let r;for(r in t)n[r]||e.del.push(r);for(r in n){const i=t[r],s=n[r];if(i){const t={name:r,def:s,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(s.primKey.keyPath||"")||i.primKey.auto!==s.primKey.auto&&!Kn)t.recreate=!0,e.change.push(t);else{const n=i.idxByName,r=s.idxByName;let o;for(o in n)r[o]||t.del.push(o);for(o in r){const e=n[o],i=r[o];e?e.src!==i.src&&t.change.push(i):t.add.push(i)}(t.del.length>0||t.add.length>0||t.change.length>0)&&e.change.push(t)}}else e.add.push([r,s])}return e}function Be(t,n,e,r){const i=t.db.createObjectStore(n,e.keyPath?{keyPath:e.keyPath,autoIncrement:e.auto}:{autoIncrement:e.auto});return r.forEach((t=>_e(i,t))),i}function _e(t,n){t.createIndex(n.name,n.keyPath,{unique:n.unique,multiEntry:n.multi})}function qe(t,n,e){const r={};return E(n.objectStoreNames,0).forEach((t=>{const n=e.objectStore(t);let i=n.keyPath;const s=ke($e(i),i||"",!1,!1,!!n.autoIncrement,i&&typeof i!="string",!0),o=[];for(let t=0;t<n.indexNames.length;++t){const e=n.index(n.indexNames[t]);i=e.keyPath;var u=ke(e.name,i,!!e.unique,!!e.multiEntry,!1,i&&typeof i!="string",!1);o.push(u)}r[t]=Ae(t,s,o)})),r}function Ne({_novip:t},n,e){const r=e.db.objectStoreNames;for(let i=0;i<r.length;++i){const s=r[i],o=e.objectStore(s);t._hasGetAll="getAll"in o;for(let t=0;t<o.indexNames.length;++t){const e=o.indexNames[t],r=o.index(e).keyPath,i=typeof r=="string"?r:"["+E(r).join("+")+"]";if(n[s]){const t=n[s].idxByName[i];t&&(t.name=e,delete n[s].idxByName[i],n[s].idxByName[e]=t)}}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&d.WorkerGlobalScope&&d instanceof d.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(t._hasGetAll=!1)}class Me{_parseStoresSpec(t,n){y(t).forEach((e=>{if(t[e]!==null){var r=t[e].split(",").map(((t,n)=>{const e=(t=t.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(e)?e.match(/^\[(.*)\]$/)[1].split("+"):e;return ke(e,r||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),p(r),n===0)})),i=r.shift();if(i.multi)throw new lt.Schema("Primary key cannot be multi-valued");r.forEach((t=>{if(t.auto)throw new lt.Schema("Only primary key can be marked as autoIncrement (++)");if(!t.keyPath)throw new lt.Schema("Index must have a name and cannot be an empty string")})),n[e]=Ae(e,i,r)}}))}stores(t){const n=this.db;this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,t):t;const e=n._versions,r={};let i={};return e.forEach((t=>{v(r,t._cfg.storesSource),i=t._cfg.dbschema={},t._parseStoresSpec(r,i)})),n._dbSchema=i,Ie(n,[n._allTables,n,n.Transaction.prototype]),De(n,[n._allTables,n,n.Transaction.prototype,this._cfg.tables],y(i),i),n._storeNames=y(i),this}upgrade(t){return this._cfg.contentUpgrade=kt(this._cfg.contentUpgrade||dt,t),this}}function Fe(t,n){let e=t._dbNamesDB;return e||(e=t._dbNamesDB=new lr(Nn,{addons:[],indexedDB:t,IDBKeyRange:n}),e.version(1).stores({dbnames:"name"})),e.table("dbnames")}function Ue(t){return t&&typeof t.databases=="function"}function Le(t){return dn((function(){return Mt.letThrough=!0,t()}))}function Ve(){var t;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(n){var e=function(){return indexedDB.databases().finally(n)};t=setInterval(e,100),e()})).finally((function(){return clearInterval(t)})):Promise.resolve()}function He(t){const n=t._state,{indexedDB:e}=t._deps;if(n.isBeingOpened||t.idbdb)return n.dbReadyPromise.then((()=>n.dbOpenError?En(n.dbOpenError):t));J&&(n.openCanceller._stackHolder=Z()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;const r=n.openCanceller;function i(){if(n.openCanceller!==r)throw new lt.DatabaseClosed("db.open() was cancelled")}let s=n.dbReadyResolve,o=null,u=!1;return Vt.race([r,(typeof navigator>"u"?Vt.resolve():Ve()).then((()=>new Vt(((r,s)=>{if(i(),!e)throw new lt.MissingAPI;const a=t.name,c=n.autoSchema?e.open(a):e.open(a,Math.round(10*t.verno));if(!c)throw new lt.MissingAPI;c.onerror=pe(s),c.onblocked=on(t._fireOnBlocked),c.onupgradeneeded=on((r=>{if(o=c.transaction,n.autoSchema&&!t._options.allowEmptyDB){c.onerror=ve,o.abort(),c.result.close();const t=e.deleteDatabase(a);t.onsuccess=t.onerror=on((()=>{s(new lt.NoSuchDatabase(`Database ${a} doesnt exist`))}))}else{o.onerror=pe(s);var i=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;u=i<1,t._novip.idbdb=c.result,Re(t,i/10,o,s)}}),s),c.onsuccess=on((()=>{o=null;const e=t._novip.idbdb=c.result,i=E(e.objectStoreNames);if(i.length>0)try{const r=e.transaction((s=i).length===1?s[0]:s,"readonly");n.autoSchema?function({_novip:t},n,e){t.verno=n.version/10;const r=t._dbSchema=qe(0,n,e);t._storeNames=E(n.objectStoreNames,0),De(t,[t._allTables],y(r),r)}(t,e,r):(Ne(t,t._dbSchema,r),function(t,n){const e=Ke(qe(0,t.idbdb,n),t._dbSchema);return!(e.add.length||e.change.some((t=>t.add.length||t.change.length)))}(t,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Te(t,r)}catch{}var s;Rn.push(t),e.onversionchange=on((e=>{n.vcFired=!0,t.on("versionchange").fire(e)})),e.onclose=on((n=>{t.on("close").fire(n)})),u&&function({indexedDB:t,IDBKeyRange:n},e){!Ue(t)&&e!==Nn&&Fe(t,n).put({name:e}).catch(dt)}(t._deps,a),r()}),s)}))))]).then((()=>(i(),n.onReadyBeingFired=[],Vt.resolve(Le((()=>t.on.ready.fire(t.vip)))).then((function e(){if(n.onReadyBeingFired.length>0){let r=n.onReadyBeingFired.reduce(kt,dt);return n.onReadyBeingFired=[],Vt.resolve(Le((()=>r(t.vip)))).then(e)}}))))).finally((()=>{n.onReadyBeingFired=null,n.isBeingOpened=!1})).then((()=>t)).catch((e=>{n.dbOpenError=e;try{o&&o.abort()}catch{}return r===n.openCanceller&&t._close(),En(e)})).finally((()=>{n.openComplete=!0,s()}))}function We(t){var n=n=>t.next(n),e=i(n),r=i((n=>t.throw(n)));function i(t){return n=>{var i=t(n),s=i.value;return i.done?s:s&&typeof s.then=="function"?s.then(e,r):p(s)?Promise.all(s).then(e,r):e(s)}}return i(n)()}function Ge(t,n,e){var r=arguments.length;if(r<2)throw new lt.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return e=i.pop(),[t,B(i),e]}function ze(t,n,e,r,i){return Vt.resolve().then((()=>{const s=Mt.transless||Mt,o=t._createTransaction(n,e,t._dbSchema,r),u={trans:o,transless:s};if(r)o.idbtrans=r.idbtrans;else try{o.create(),t._state.PR1398_maxLoop=3}catch(r){return r.name===at.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then((()=>ze(t,n,e,null,i)))):En(r)}const a=z(i);let c;a&&yn();const l=Vt.follow((()=>{if(c=i.call(o,o),c)if(a){var t=pn.bind(null,null);c.then(t,t)}else typeof c.next=="function"&&typeof c.throw=="function"&&(c=We(c))}),u);return(c&&typeof c.then=="function"?Vt.resolve(c).then((t=>o.active?t:En(new lt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((t=>(r&&o._resolve(),o._completion.then((()=>t))))).catch((t=>(o._reject(t),En(t))))}))}function Je(t,n,e){const r=p(t)?t.slice():[t];for(let t=0;t<e;++t)r.push(n);return r}const Ye={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(t){return{...t,table(n){const e=t.table(n),{schema:r}=e,i={},s=[];function o(t,n,e){const r=Ce(t),u=i[r]=i[r]||[],a=t==null?0:typeof t=="string"?1:t.length,c=n>0,l={...e,isVirtual:c,keyTail:n,keyLength:a,extractKey:xe(t),unique:!c&&e.unique};return u.push(l),l.isPrimaryKey||s.push(l),a>1&&o(a===2?t[0]:t.slice(0,a-1),n+1,e),u.sort(((t,n)=>t.keyTail-n.keyTail)),l}const u=o(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[u];for(const t of r.indexes)o(t.keyPath,0,t);function a(n){const e=n.query.index;return e.isVirtual?{...n,query:{index:e,range:(r=n.query.range,i=e.keyTail,{type:r.type===1?2:r.type,lower:Je(r.lower,r.lowerOpen?t.MAX_KEY:t.MIN_KEY,i),lowerOpen:!0,upper:Je(r.upper,r.upperOpen?t.MIN_KEY:t.MAX_KEY,i),upperOpen:!0})}}:n;var r,i}return{...e,schema:{...r,primaryKey:u,indexes:s,getIndexByKeyPath:function(t){const n=i[Ce(t)];return n&&n[0]}},count:t=>e.count(a(t)),query:t=>e.query(a(t)),openCursor(n){const{keyTail:r,isVirtual:i,keyLength:s}=n.query.index;return i?e.openCursor(a(n)).then((e=>e&&function(e){return Object.create(e,{continue:{value:function(i){i!=null?e.continue(Je(i,n.reverse?t.MAX_KEY:t.MIN_KEY,r)):n.unique?e.continue(e.key.slice(0,s).concat(n.reverse?t.MIN_KEY:t.MAX_KEY,r)):e.continue()}},continuePrimaryKey:{value(n,i){e.continuePrimaryKey(Je(n,t.MAX_KEY,r),i)}},primaryKey:{get:()=>e.primaryKey},key:{get(){const t=e.key;return s===1?t[0]:t.slice(0,s)}},value:{get:()=>e.value}})}(e))):e.openCursor(n)}}}}}};function Qe(t,n,e,r){return e=e||{},r=r||"",y(t).forEach((i=>{if(m(n,i)){var s=t[i],o=n[i];if(typeof s=="object"&&typeof o=="object"&&s&&o){const t=L(s);t!==L(o)?e[r+i]=n[i]:t==="Object"?Qe(s,o,e,r+i+"."):s!==o&&(e[r+i]=n[i])}else s!==o&&(e[r+i]=n[i])}else e[r+i]=void 0})),y(n).forEach((i=>{m(t,i)||(e[r+i]=n[i])})),e}const Xe={stack:"dbcore",name:"HooksMiddleware",level:2,create:t=>({...t,table(n){const e=t.table(n),{primaryKey:r}=e.schema;return{...e,mutate(t){const i=Mt.trans,{deleting:s,creating:o,updating:u}=i.table(n).hook;switch(t.type){case"add":if(o.fire===dt)break;return i._promise("readwrite",(()=>a(t)),!0);case"put":if(o.fire===dt&&u.fire===dt)break;return i._promise("readwrite",(()=>a(t)),!0);case"delete":if(s.fire===dt)break;return i._promise("readwrite",(()=>a(t)),!0);case"deleteRange":if(s.fire===dt)break;return i._promise("readwrite",(()=>function(t){return c(t.trans,t.range,1e4)}(t)),!0)}return e.mutate(t);function a(t){const n=Mt.trans,i=t.keys||function(t,n){return n.type==="delete"?n.keys:n.keys||n.values.map(t.extractKey)}(r,t);if(!i)throw new Error("Keys missing");return(t=t.type==="add"||t.type==="put"?{...t,keys:i}:{...t}).type!=="delete"&&(t.values=[...t.values]),t.keys&&(t.keys=[...t.keys]),function(t,n,e){return n.type==="add"?Promise.resolve([]):t.getMany({trans:n.trans,keys:e,cache:"immutable"})}(e,t,i).then((a=>{const c=i.map(((e,i)=>{const c=a[i],l={onerror:null,onsuccess:null};if(t.type==="delete")s.fire.call(l,e,c,n);else if(t.type==="add"||c===void 0){const s=o.fire.call(l,e,t.values[i],n);e==null&&s!=null&&(e=s,t.keys[i]=e,r.outbound||j(t.values[i],r.keyPath,e))}else{const r=Qe(c,t.values[i]),s=u.fire.call(l,r,e,c,n);if(s){const n=t.values[i];Object.keys(s).forEach((t=>{m(n,t)?n[t]=s[t]:j(n,t,s[t])}))}}return l}));return e.mutate(t).then((({failures:n,results:e,numFailures:r,lastResult:s})=>{for(let r=0;r<i.length;++r){const s=e?e[r]:i[r],o=c[r];s==null?o.onerror&&o.onerror(n[r]):o.onsuccess&&o.onsuccess(t.type==="put"&&a[r]?t.values[r]:s)}return{failures:n,results:e,numFailures:r,lastResult:s}})).catch((t=>(c.forEach((n=>n.onerror&&n.onerror(t))),Promise.reject(t))))}))}function c(t,n,i){return e.query({trans:t,values:!1,query:{index:r,range:n},limit:i}).then((({result:e})=>a({type:"delete",keys:e,trans:t}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):e.length<i?{failures:[],numFailures:0,lastResult:void 0}:c(t,{...n,lower:e[e.length-1],lowerOpen:!0},i)))))}}}}})};function Ze(t,n,e){try{if(!n||n.keys.length<t.length)return null;const r=[];for(let i=0,s=0;i<n.keys.length&&s<t.length;++i)ne(n.keys[i],t[s])===0&&(r.push(e?M(n.values[i]):n.values[i]),++s);return r.length===t.length?r:null}catch{return null}}const tr={stack:"dbcore",level:-1,create:t=>({table:n=>{const e=t.table(n);return{...e,getMany:t=>{if(!t.cache)return e.getMany(t);const n=Ze(t.keys,t.trans._cache,t.cache==="clone");return n?Vt.resolve(n):e.getMany(t).then((n=>(t.trans._cache={keys:t.keys,values:t.cache==="clone"?M(n):n},n)))},mutate:t=>(t.type!=="add"&&(t.trans._cache=null),e.mutate(t))}}})};function nr(t){return!("from"in t)}const er=function(t,n){if(!this){const n=new er;return t&&"d"in t&&v(n,t),n}v(this,arguments.length?{d:1,from:t,to:arguments.length>1?n:t}:{d:0})};function rr(t,n,e){const r=ne(n,e);if(isNaN(r))return;if(r>0)throw RangeError();if(nr(t))return v(t,{from:n,to:e,d:1});const i=t.l,s=t.r;if(ne(e,t.from)<0)return i?rr(i,n,e):t.l={from:n,to:e,d:1,l:null,r:null},ur(t);if(ne(n,t.to)>0)return s?rr(s,n,e):t.r={from:n,to:e,d:1,l:null,r:null},ur(t);ne(n,t.from)<0&&(t.from=n,t.l=null,t.d=s?s.d+1:1),ne(e,t.to)>0&&(t.to=e,t.r=null,t.d=t.l?t.l.d+1:1);const o=!t.r;i&&!t.l&&ir(t,i),s&&o&&ir(t,s)}function ir(t,n){nr(n)||function t(n,{from:e,to:r,l:i,r:s}){rr(n,e,r),i&&t(n,i),s&&t(n,s)}(t,n)}function sr(t,n){const e=or(n);let r=e.next();if(r.done)return!1;let i=r.value;const s=or(t);let o=s.next(i.from),u=o.value;for(;!r.done&&!o.done;){if(ne(u.from,i.to)<=0&&ne(u.to,i.from)>=0)return!0;ne(i.from,u.from)<0?i=(r=e.next(u.from)).value:u=(o=s.next(i.from)).value}return!1}function or(t){let n=nr(t)?null:{s:0,n:t};return{next(t){const e=arguments.length>0;for(;n;)switch(n.s){case 0:if(n.s=1,e)for(;n.n.l&&ne(t,n.n.from)<0;)n={up:n,n:n.n.l,s:1};else for(;n.n.l;)n={up:n,n:n.n.l,s:1};case 1:if(n.s=2,!e||ne(t,n.n.to)<=0)return{value:n.n,done:!1};case 2:if(n.n.r){n.s=3,n={up:n,n:n.n.r,s:0};continue}case 3:n=n.up}return{done:!0}}}}function ur(t){var n,e;const r=(((n=t.r)===null||n===void 0?void 0:n.d)||0)-(((e=t.l)===null||e===void 0?void 0:e.d)||0),i=r>1?"r":r<-1?"l":"";if(i){const n=i==="r"?"l":"r",e={...t},r=t[i];t.from=r.from,t.to=r.to,t[i]=r[i],e[i]=r[n],t[n]=e,e.d=ar(e)}t.d=ar(t)}function ar({r:t,l:n}){return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}b(er.prototype,{add(t){return ir(this,t),this},addKey(t){return rr(this,t,t),this},addKeys(t){return t.forEach((t=>rr(this,t,t))),this},[V](){return or(this)}});const cr={stack:"dbcore",level:0,create:t=>{const n=t.schema.name,e=new er(t.MIN_KEY,t.MAX_KEY);return{...t,table:r=>{const i=t.table(r),{schema:s}=i,{primaryKey:o}=s,{extractKey:u,outbound:a}=o,c={...i,mutate:t=>{const o=t.trans,u=o.mutatedParts||(o.mutatedParts={}),a=t=>{const e=`idb://${n}/${r}/${t}`;return u[e]||(u[e]=new er)},c=a(""),l=a(":dels"),{type:h}=t;let[f,d]=t.type==="deleteRange"?[t.range]:t.type==="delete"?[t.keys]:t.values.length<50?[[],t.values]:[];const y=t.trans._cache;return i.mutate(t).then((t=>{if(p(f)){h!=="delete"&&(f=t.results),c.addKeys(f);const n=Ze(f,y);n||h==="add"||l.addKeys(f),(n||d)&&function(t,n,e,r){function i(n){const i=t(n.name||"");function s(t){return t!=null?n.extractKey(t):null}const o=t=>n.multiEntry&&p(t)?t.forEach((t=>i.addKey(t))):i.addKey(t);(e||r).forEach(((t,n)=>{const i=e&&s(e[n]),u=r&&s(r[n]);ne(i,u)!==0&&(i!=null&&o(i),u!=null&&o(u))}))}n.indexes.forEach(i)}(a,s,n,d)}else if(f){const t={from:f.lower,to:f.upper};l.add(t),c.add(t)}else c.add(e),l.add(e),s.indexes.forEach((t=>a(t.name).add(e)));return t}))}},l=({query:{index:n,range:e}})=>{var r,i;return[n,new er((r=e.lower)!==null&&r!==void 0?r:t.MIN_KEY,(i=e.upper)!==null&&i!==void 0?i:t.MAX_KEY)]},h={get:t=>[o,new er(t.key)],getMany:t=>[o,(new er).addKeys(t.keys)],count:l,query:l,openCursor:l};return y(h).forEach((t=>{c[t]=function(s){const{subscr:o}=Mt;if(o){const c=t=>{const e=`idb://${n}/${r}/${t}`;return o[e]||(o[e]=new er)},l=c(""),f=c(":dels"),[d,y]=h[t](s);if(c(d.name||"").add(y),!d.isPrimaryKey){if(t!=="count"){const n=t==="query"&&a&&s.values&&i.query({...s,values:!1});return i[t].apply(this,arguments).then((e=>{if(t==="query"){if(a&&s.values)return n.then((({result:t})=>(l.addKeys(t),e)));const t=s.values?e.result.map(u):e.result;s.values?l.addKeys(t):f.addKeys(t)}else if(t==="openCursor"){const t=e,n=s.values;return t&&Object.create(t,{key:{get:()=>(f.addKey(t.primaryKey),t.key)},primaryKey:{get(){const n=t.primaryKey;return f.addKey(n),n}},value:{get:()=>(n&&l.addKey(t.primaryKey),t.value)}})}return e}))}f.add(e)}}return i[t].apply(this,arguments)}})),c}}}};class lr{constructor(t,n){this._middlewares={},this.verno=0;const e=lr.dependencies;this._options=n={addons:lr.addons,autoOpen:!0,indexedDB:e.indexedDB,IDBKeyRange:e.IDBKeyRange,...n},this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};const{addons:r}=n;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:dt,dbReadyPromise:null,cancelOpen:dt,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var s;i.dbReadyPromise=new Vt((t=>{i.dbReadyResolve=t})),i.openCanceller=new Vt(((t,n)=>{i.cancelOpen=n})),this._state=i,this.name=t,this.on=Wn(this,"populate","blocked","versionchange","close",{ready:[kt,dt]}),this.on.ready.subscribe=C(this.on.ready.subscribe,(t=>(n,e)=>{lr.vip((()=>{const r=this._state;if(r.openComplete)r.dbOpenError||Vt.resolve().then(n),e&&t(n);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(n),e&&t(n);else{t(n);const r=this;e||t((function t(){r.on.ready.unsubscribe(n),r.on.ready.unsubscribe(t)}))}}))})),this.Collection=(s=this,Gn(ie.prototype,(function(t,n){this.db=s;let e=Ln,r=null;if(n)try{e=n()}catch(t){r=t}const i=t._ctx,o=i.table,u=o.hook.reading.fire;this._ctx={table:o,index:i.index,isPrimKey:!i.index||o.schema.primKey.keyPath&&i.index===o.schema.primKey.name,range:e,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:u!==yt?u:null}}))),this.Table=function(t){return Gn(Hn.prototype,(function(n,e,r){this.db=t,this._tx=r,this.name=n,this.schema=e,this.hook=t._allTables[n]?t._allTables[n].hook:Wn(null,{creating:[wt,dt],reading:[pt,yt],updating:[mt,dt],deleting:[gt,dt]})}))}(this),this.Transaction=function(t){return Gn(be.prototype,(function(n,e,r,i,s){this.db=t,this.mode=n,this.storeNames=e,this.schema=r,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=Wn(this,"complete","error","abort"),this.parent=s||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Vt(((t,n)=>{this._resolve=t,this._reject=n})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(t=>{var n=this.active;return this.active=!1,this.on.error.fire(t),this.parent?this.parent._reject(t):n&&this.idbtrans&&this.idbtrans.abort(),En(t)}))}))}(this),this.Version=function(t){return Gn(Me.prototype,(function(n){this.db=t,this._cfg={version:n,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(t){return Gn(ye.prototype,(function(n,e,r){this.db=t,this._ctx={table:n,index:e===":id"?null:e,or:r};const i=t._deps.indexedDB;if(!i)throw new lt.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(t,n)=>i.cmp(n,t),this._max=(t,n)=>i.cmp(t,n)>0?t:n,this._min=(t,n)=>i.cmp(t,n)<0?t:n,this._IDBKeyRange=t._deps.IDBKeyRange}))}(this),this.on("versionchange",(t=>{t.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(t=>{!t.newVersion||t.newVersion<t.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${t.oldVersion/10}`)})),this._maxKey=Se(n.IDBKeyRange),this._createTransaction=(t,n,e,r)=>new this.Transaction(t,n,e,this._options.chromeTransactionDurability,r),this._fireOnBlocked=t=>{this.on("blocked").fire(t),Rn.filter((t=>t.name===this.name&&t!==this&&!t._state.vcFired)).map((n=>n.on("versionchange").fire(t)))},this.use(Ye),this.use(Xe),this.use(cr),this.use(tr),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach((t=>t(this)))}version(t){if(isNaN(t)||t<.1)throw new lt.Type("Given version is not a positive number");if(t=Math.round(10*t)/10,this.idbdb||this._state.isBeingOpened)throw new lt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);const n=this._versions;var e=n.filter((n=>n._cfg.version===t))[0];return e||(e=new this.Version(t),n.push(e),n.sort(je),e.stores({}),this._state.autoSchema=!1,e)}_whenReady(t){return this.idbdb&&(this._state.openComplete||Mt.letThrough||this._vip)?t():new Vt(((t,n)=>{if(this._state.openComplete)return n(new lt.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void n(new lt.DatabaseClosed);this.open().catch(dt)}this._state.dbReadyPromise.then(t,n)})).then(t)}use({stack:t,create:n,level:e,name:r}){r&&this.unuse({stack:t,name:r});const i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:n,level:e??10,name:r}),i.sort(((t,n)=>t.level-n.level)),this}unuse({stack:t,name:n,create:e}){return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((t=>e?t.create!==e:!!n&&t.name!==n))),this}open(){return He(this)}_close(){const t=this._state,n=Rn.indexOf(this);if(n>=0&&Rn.splice(n,1),this.idbdb){try{this.idbdb.close()}catch{}this._novip.idbdb=null}t.dbReadyPromise=new Vt((n=>{t.dbReadyResolve=n})),t.openCanceller=new Vt(((n,e)=>{t.cancelOpen=e}))}close(){this._close();const t=this._state;this._options.autoOpen=!1,t.dbOpenError=new lt.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError)}delete(){const t=arguments.length>0,n=this._state;return new Vt(((e,r)=>{const i=()=>{this.close();var t=this._deps.indexedDB.deleteDatabase(this.name);t.onsuccess=on((()=>{(function({indexedDB:t,IDBKeyRange:n},e){!Ue(t)&&e!==Nn&&Fe(t,n).delete(e).catch(dt)})(this._deps,this.name),e()})),t.onerror=pe(r),t.onblocked=this._fireOnBlocked};if(t)throw new lt.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()}))}backendDB(){return this.idbdb}isOpen(){return this.idbdb!==null}hasBeenClosed(){const t=this._state.dbOpenError;return t&&t.name==="DatabaseClosed"}hasFailed(){return this._state.dbOpenError!==null}dynamicallyOpened(){return this._state.autoSchema}get tables(){return y(this._allTables).map((t=>this._allTables[t]))}transaction(){const t=Ge.apply(this,arguments);return this._transaction.apply(this,t)}_transaction(t,n,e){let r=Mt.trans;r&&r.db===this&&t.indexOf("!")===-1||(r=null);const i=t.indexOf("?")!==-1;let s,o;t=t.replace("!","").replace("?","");try{if(o=n.map((t=>{var n=t instanceof this.Table?t.name:t;if(typeof n!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return n})),t=="r"||t===Mn)s=Mn;else{if(t!="rw"&&t!=Fn)throw new lt.InvalidArgument("Invalid transaction mode: "+t);s=Fn}if(r){if(r.mode===Mn&&s===Fn){if(!i)throw new lt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&o.forEach((t=>{if(r&&r.storeNames.indexOf(t)===-1){if(!i)throw new lt.SubTransaction("Table "+t+" not included in parent transaction.");r=null}})),i&&r&&!r.active&&(r=null)}}catch(t){return r?r._promise(null,((n,e)=>{e(t)})):En(t)}const u=ze.bind(null,this,s,o,r,e);return r?r._promise(s,u,"lock"):Mt.trans?kn(Mt.transless,(()=>this._whenReady(u))):this._whenReady(u)}table(t){if(!m(this._allTables,t))throw new lt.InvalidTable(`Table ${t} does not exist`);return this._allTables[t]}}const hr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable";class fr{constructor(t){this._subscribe=t}subscribe(t,n,e){return this._subscribe(t&&typeof t!="function"?t:{next:t,error:n,complete:e})}[hr](){return this}}function dr(t,n){return y(n).forEach((e=>{ir(t[e]||(t[e]=new er),n[e])})),t}function yr(t){let n,e=!1;const r=new fr((r=>{const i=z(t);let s=!1,o={},u={};const a={get closed(){return s},unsubscribe:()=>{s=!0,me.storagemutated.unsubscribe(f)}};r.start&&r.start(a);let c=!1,l=!1;function h(){return y(u).some((t=>o[t]&&sr(o[t],u[t])))}const f=t=>{dr(o,t),h()&&d()},d=()=>{if(c||s)return;o={};const y={},p=function(n){i&&yn();const e=()=>dn(t,{subscr:n,trans:null}),r=Mt.trans?kn(Mt.transless,e):e();return i&&r.then(pn,pn),r}(y);l||(me(we,f),l=!0),c=!0,Promise.resolve(p).then((t=>{e=!0,n=t,c=!1,s||(h()?d():(o={},u=y,r.next&&r.next(t)))}),(t=>{c=!1,e=!1,r.error&&r.error(t),a.unsubscribe()}))};return d(),a}));return r.hasValue=()=>e,r.getValue=()=>n,r}let pr;try{pr={indexedDB:d.indexedDB||d.mozIndexedDB||d.webkitIndexedDB||d.msIndexedDB,IDBKeyRange:d.IDBKeyRange||d.webkitIDBKeyRange}}catch{pr={indexedDB:null,IDBKeyRange:null}}const vr=lr;function wr(t){let n=gr;try{gr=!0,me.storagemutated.fire(t)}finally{gr=n}}b(vr,{...ft,delete:t=>new vr(t,{addons:[]}).delete(),exists:t=>new vr(t,{addons:[]}).open().then((t=>(t.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(t){try{return function({indexedDB:t,IDBKeyRange:n}){return Ue(t)?Promise.resolve(t.databases()).then((t=>t.map((t=>t.name)).filter((t=>t!==Nn)))):Fe(t,n).toCollection().primaryKeys()}(vr.dependencies).then(t)}catch{return En(new lt.MissingAPI)}},defineClass:()=>function(t){v(this,t)},ignoreTransaction:t=>Mt.trans?kn(Mt.transless,t):t(),vip:Le,async:function(t){return function(){try{var n=We(t.apply(this,arguments));return n&&typeof n.then=="function"?n:Vt.resolve(n)}catch(t){return En(t)}}},spawn:function(t,n,e){try{var r=We(t.apply(e,n||[]));return r&&typeof r.then=="function"?r:Vt.resolve(r)}catch(t){return En(t)}},currentTransaction:{get:()=>Mt.trans||null},waitFor:function(t,n){const e=Vt.resolve(typeof t=="function"?vr.ignoreTransaction(t):t).timeout(n||6e4);return Mt.trans?Mt.trans.waitFor(e):e},Promise:Vt,debug:{get:()=>J,set:t=>{Y(t,t==="dexie"?()=>!0:qn)}},derive:A,extend:v,props:b,override:C,Events:Wn,on:me,liveQuery:yr,extendObservabilitySet:dr,getByKeyPath:I,setByKeyPath:j,delByKeyPath:function(t,n){typeof n=="string"?j(t,n,void 0):"length"in n&&[].map.call(n,(function(n){j(t,n,void 0)}))},shallowClone:R,deepClone:M,getObjectDiff:Qe,cmp:ne,asap:T,minKey:Dn,addons:[],connections:Rn,errnames:at,dependencies:pr,semVer:On,version:On.split(".").map((t=>parseInt(t))).reduce(((t,n,e)=>t+n/Math.pow(10,2*e)))}),vr.maxKey=Se(vr.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(me(we,(t=>{if(!gr){let n;Kn?(n=document.createEvent("CustomEvent"),n.initCustomEvent(ge,!0,!0,t)):n=new CustomEvent(ge,{detail:t}),gr=!0,dispatchEvent(n),gr=!1}})),addEventListener(ge,(({detail:t})=>{gr||wr(t)})));let gr=!1;if(typeof BroadcastChannel<"u"){const t=new BroadcastChannel(ge);typeof t.unref=="function"&&t.unref(),me(we,(n=>{gr||t.postMessage(n)})),t.onmessage=t=>{t.data&&wr(t.data)}}else if(typeof self<"u"&&typeof navigator<"u"){me(we,(t=>{try{gr||(typeof localStorage<"u"&&localStorage.setItem(ge,JSON.stringify({trig:Math.random(),changedParts:t})),typeof self.clients=="object"&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((n=>n.postMessage({type:ge,changedParts:t}))))}catch{}})),typeof addEventListener<"u"&&addEventListener("storage",(t=>{if(t.key===ge){const n=JSON.parse(t.newValue);n&&wr(n.changedParts)}}));const t=self.document&&navigator.serviceWorker;t&&t.addEventListener("message",(function({data:t}){t&&t.type===ge&&wr(t.changedParts)}))}Vt.rejectionMapper=function(t,n){if(!t||t instanceof it||t instanceof TypeError||t instanceof SyntaxError||!t.name||!ht[t.name])return t;var e=new ht[t.name](n||t.message,t);return"stack"in t&&$(e,"stack",{get:function(){return this.inner.stack}}),e},Y(J,qn);class mr extends lr{constructor(){super("NylasAuthDatabase");a(this,"grant");a(this,"pkce");this.version(1).stores({grant:"++id,token",pkce:"++id,codeVerifier"}),this.grant=this.table("grant"),this.pkce=this.table("pkce")}}class br{constructor(){a(this,"theDB");this.theDB=new mr}async setCodeVerifier(t){await this.theDB.pkce.put({id:1,codeVerifier:t},1)}async getCodeVerifier(){const[t]=await this.theDB.pkce.toArray();return t?t.codeVerifier:null}async getTokenInfo(){const t=await this.theDB.grant.get(1);return t?t.token:null}async setTokenInfo(t){await this.theDB.grant.put({id:1,token:t},1)}async reset(){await this.theDB.grant.clear()}}function kr(t){const n="NylasAuth";if(!t)throw new Error("NylasAuth requires a config object");let e=null;if(t.storageType==="indexeddb"&&(e=new br),!e)throw new Error("NylasAuth requires a storage object");const r=[{type:"read-only",value:"https://www.googleapis.com/auth/gmail.readonly"},{type:"modify",value:"https://www.googleapis.com/auth/gmail.modify"},{type:"compose",value:"https://www.googleapis.com/auth/gmail.compose"},{type:"insert",value:"https://www.googleapis.com/auth/gmail.insert"},{type:"labels",value:"https://www.googleapis.com/auth/gmail.labels"},{type:"metadata",value:"https://www.googleapis.com/auth/gmail.metadata"},{type:"settings.basic",value:"https://www.googleapis.com/auth/gmail.settings.basic"},{type:"settings.sharing",value:"https://www.googleapis.com/auth/gmail.settings.sharing"}],i=[{type:"read-only",value:"https://outlook.office.com/mail.read"},{type:"modify",value:"https://outlook.office.com/mail.readwrite"},{type:"send",value:"https://outlook.office.com/mail.send"},{type:"offline",value:"offline_access"}];async function s(r,i,s,o=!0,u,a){const c=await(e==null?void 0:e.getTokenInfo()),l=new URL(r,u??t.apiUri),h=new Headers;h.append("Accept","application/json"),h.append("Content-Type","application/json"),h.append("User-Agent",n),c&&h.append("Authorization",`Bearer ${c.access_token}`);const f=await fetch(l.toString(),{method:i||"GET",headers:h,mode:"cors",referrer:location.origin,body:s?JSON.stringify(s):void 0,...a||{}});return o?await f.json():f.body}return{config:t,async getHostedAuthRedirectURL(n=t.defaultScopes,r,i){const s=await f(Math.random().toString()),o=await f(s);await(e==null?void 0:e.setCodeVerifier(s));const u=new URL(`${t.apiUri}/v3/connect/auth`);return u.searchParams.set("client_id",t.clientId),u.searchParams.set("response_type","code"),u.searchParams.set("scope",n.join(" ")),u.searchParams.set("redirect_uri",t.redirectURI),u.searchParams.set("access_type","offline"),u.searchParams.set("code_challenge",o),u.searchParams.set("code_challenge_method","S256"),u.searchParams.set("options","rotate_refresh_token"),i&&u.searchParams.set("provider",i),r&&u.searchParams.set("login_hint",r),u.toString()},nylasAPIRequest:s,async exchangeAuthCodeForTokenInfo(n){if(!n)return null;const r=await(e==null?void 0:e.getCodeVerifier()),i=await this.nylasAPIRequest("/v3/connect/token","POST",{code:n,client_id:t.clientId,grant_type:"authorization_code",redirect_uri:t.redirectURI,code_verifier:r});return"error"in i||await(e==null?void 0:e.setTokenInfo(i)),i},async nylasDownloadFileRequest(r,i="GET",s){const o=await(e==null?void 0:e.getTokenInfo()),u=new URL(r,t.apiUri),a=new Headers;return a.append("Accept","application/json"),a.append("Content-Type","application/octet-stream"),a.append("User-Agent",n),o&&a.append("Authorization",`Bearer ${o.access_token}`),(await fetch(u.toString(),{method:i,headers:a,mode:"cors",referrer:location.origin,body:s?JSON.stringify(s):void 0})).blob()},async logout(){const t=await(e==null?void 0:e.getTokenInfo());t&&await this.nylasAPIRequest(`/v3/connect/revoke?token=${t.access_token}`,"POST"),await(e==null?void 0:e.reset())},async isAuthenticated(){return!!await(e==null?void 0:e.getTokenInfo())},async getTokenInfo(){const t=await(e==null?void 0:e.getTokenInfo());if(!t)return null;const{access_token:n,...r}=t;return r},async isAccessTokenValid(){const t=await(e==null?void 0:e.getTokenInfo());return t?"data"in await this.nylasAPIRequest(`/v3/connect/tokeninfo?id_token=${t.id_token}`,"GET"):!1},async refreshAccessToken(){const n=await(e==null?void 0:e.getTokenInfo());if(!n)return null;const r=await this.nylasAPIRequest("/v3/connect/token","POST",{client_id:t.clientId,grant_type:"refresh_token",refresh_token:n.refresh_token});return"error"in r||await(e==null?void 0:e.setTokenInfo(r)),r},async hasScopeByType(t="email",n){const s=await(e==null?void 0:e.getTokenInfo());if(!s)return!1;const o=s.scope.toLowerCase().split(" ");let u=[];const a=Array.isArray(n)?n:[n];return t==="email"&&(u=[...i,...r].filter((t=>a.includes(t.type)))),u.every((t=>o.includes(t.value)))},async hasScope(t){const n=await(e==null?void 0:e.getTokenInfo());if(!n)return!1;const r=n.scope.toLowerCase().split(" ");return(Array.isArray(t)?t:[t]).some((t=>r.includes(t.toLowerCase())))}}}export{i as N,l as X,h as Z,kr as e,s as g,c as n};
|
|
2
|
-
//# sourceMappingURL=p-65fdfb60.js.map
|