@qualified-salesforce/web 0.0.1-oidc-bootstrap
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/41842993ec71d6628e4949e9a22b146b.svg +3 -0
- package/7271f3433ed82fc7f56adcd9e30275f4.svg +17 -0
- package/LICENSE.txt +82 -0
- package/components/helpers/entriesStringValidations.js +69 -0
- package/components/helpers/languages.js +32 -0
- package/components/shared/assertUnreachable.js +5 -0
- package/components/shared/controls/imageCropperHelpers.js +43 -0
- package/components/shared/meetingLoadingProgressSpec.js +116 -0
- package/constants.generated.js +9883 -0
- package/css/widget/multimodal_v2/host.split-css.css +162 -0
- package/css/widget/multimodal_v2/index.split-css.panda.css +5240 -0
- package/css/widget/widget.split-css.css +100 -0
- package/fonts/inter/Inter-Black.woff +0 -0
- package/fonts/inter/Inter-Black.woff2 +0 -0
- package/fonts/inter/Inter-BlackItalic.woff +0 -0
- package/fonts/inter/Inter-BlackItalic.woff2 +0 -0
- package/fonts/inter/Inter-Bold.woff +0 -0
- package/fonts/inter/Inter-Bold.woff2 +0 -0
- package/fonts/inter/Inter-BoldItalic.woff +0 -0
- package/fonts/inter/Inter-BoldItalic.woff2 +0 -0
- package/fonts/inter/Inter-ExtraBold.woff +0 -0
- package/fonts/inter/Inter-ExtraBold.woff2 +0 -0
- package/fonts/inter/Inter-ExtraBoldItalic.woff +0 -0
- package/fonts/inter/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/inter/Inter-ExtraLight.woff +0 -0
- package/fonts/inter/Inter-ExtraLight.woff2 +0 -0
- package/fonts/inter/Inter-ExtraLightItalic.woff +0 -0
- package/fonts/inter/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/inter/Inter-Italic.woff +0 -0
- package/fonts/inter/Inter-Italic.woff2 +0 -0
- package/fonts/inter/Inter-Light.woff +0 -0
- package/fonts/inter/Inter-Light.woff2 +0 -0
- package/fonts/inter/Inter-LightItalic.woff +0 -0
- package/fonts/inter/Inter-LightItalic.woff2 +0 -0
- package/fonts/inter/Inter-Medium.woff +0 -0
- package/fonts/inter/Inter-Medium.woff2 +0 -0
- package/fonts/inter/Inter-MediumItalic.woff +0 -0
- package/fonts/inter/Inter-MediumItalic.woff2 +0 -0
- package/fonts/inter/Inter-Regular.woff +0 -0
- package/fonts/inter/Inter-Regular.woff2 +0 -0
- package/fonts/inter/Inter-SemiBold.woff +0 -0
- package/fonts/inter/Inter-SemiBold.woff2 +0 -0
- package/fonts/inter/Inter-SemiBoldItalic.woff +0 -0
- package/fonts/inter/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/inter/Inter-Thin.woff +0 -0
- package/fonts/inter/Inter-Thin.woff2 +0 -0
- package/fonts/inter/Inter-ThinItalic.woff +0 -0
- package/fonts/inter/Inter-ThinItalic.woff2 +0 -0
- package/fonts/inter/Inter-italic.var.woff2 +0 -0
- package/fonts/inter/Inter-roman.var.woff2 +0 -0
- package/images/close.js +63 -0
- package/images/logo.js +22 -0
- package/js/4101.js +19721 -0
- package/js/daily-esm.js +9948 -0
- package/js/date-fns.js +427 -0
- package/js/multimodal_v2.js +1653 -0
- package/js/runtime.js +109 -0
- package/media/Inter-Black.796be8d8bf.woff2 +0 -0
- package/media/Inter-Black.b254104c56.woff +0 -0
- package/media/Inter-BlackItalic.70306b0eae.woff +0 -0
- package/media/Inter-BlackItalic.752f1e0aaa.woff2 +0 -0
- package/media/Inter-Bold.579e0f95ca.woff2 +0 -0
- package/media/Inter-Bold.b1234477a5.woff +0 -0
- package/media/Inter-BoldItalic.3d0d804323.woff +0 -0
- package/media/Inter-BoldItalic.828a494e04.woff2 +0 -0
- package/media/Inter-ExtraBold.208a9e6c99.woff +0 -0
- package/media/Inter-ExtraBold.d65f028165.woff2 +0 -0
- package/media/Inter-ExtraBoldItalic.30429962ec.woff +0 -0
- package/media/Inter-ExtraBoldItalic.8c7eac5ce3.woff2 +0 -0
- package/media/Inter-ExtraLight.15c082a57d.woff +0 -0
- package/media/Inter-ExtraLight.6824177d1e.woff2 +0 -0
- package/media/Inter-ExtraLightItalic.05138dddf3.woff2 +0 -0
- package/media/Inter-ExtraLightItalic.3beee54f59.woff +0 -0
- package/media/Inter-Italic.9beab78452.woff +0 -0
- package/media/Inter-Italic.d593a8df79.woff2 +0 -0
- package/media/Inter-Light.27083fa637.woff2 +0 -0
- package/media/Inter-Light.91dfddd842.woff +0 -0
- package/media/Inter-LightItalic.0a783b89b3.woff2 +0 -0
- package/media/Inter-LightItalic.f8ccf2813f.woff +0 -0
- package/media/Inter-Medium.dc792b508e.woff2 +0 -0
- package/media/Inter-Medium.ec7dd2d9d8.woff +0 -0
- package/media/Inter-MediumItalic.17301e5b40.woff +0 -0
- package/media/Inter-MediumItalic.84d3493a9f.woff2 +0 -0
- package/media/Inter-Regular.f1f0c35b32.woff2 +0 -0
- package/media/Inter-Regular.f356e84aa0.woff +0 -0
- package/media/Inter-SemiBold.55027e4724.woff +0 -0
- package/media/Inter-SemiBold.fcb100c760.woff2 +0 -0
- package/media/Inter-SemiBoldItalic.ab9105ed3b.woff +0 -0
- package/media/Inter-SemiBoldItalic.d90f295d0c.woff2 +0 -0
- package/media/Inter-Thin.16325d9b0f.woff +0 -0
- package/media/Inter-Thin.dafaa44d99.woff2 +0 -0
- package/media/Inter-ThinItalic.4fc662b3cf.woff2 +0 -0
- package/media/Inter-ThinItalic.d3d8994788.woff +0 -0
- package/media/Inter-italic.var.958a0b9742.woff2 +0 -0
- package/media/Inter-roman.var.b2129c009c.woff2 +0 -0
- package/package.json +20 -0
- package/packs/widget/api/docking/docking_host.js +97 -0
- package/packs/widget/api/docking/index.js +294 -0
- package/packs/widget/api/docking/shared.js +164 -0
- package/packs/widget/api/docking/viewport_lock.js +488 -0
- package/packs/widget/api/docking/viewport_resize.js +1203 -0
- package/packs/widget/esm/fonts/Inter-Black.796be8d8bf.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Black.b254104c56.woff +0 -0
- package/packs/widget/esm/fonts/Inter-BlackItalic.70306b0eae.woff +0 -0
- package/packs/widget/esm/fonts/Inter-BlackItalic.752f1e0aaa.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Bold.579e0f95ca.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Bold.b1234477a5.woff +0 -0
- package/packs/widget/esm/fonts/Inter-BoldItalic.3d0d804323.woff +0 -0
- package/packs/widget/esm/fonts/Inter-BoldItalic.828a494e04.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraBold.208a9e6c99.woff +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraBold.d65f028165.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraBoldItalic.30429962ec.woff +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraBoldItalic.8c7eac5ce3.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraLight.15c082a57d.woff +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraLight.6824177d1e.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraLightItalic.05138dddf3.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ExtraLightItalic.3beee54f59.woff +0 -0
- package/packs/widget/esm/fonts/Inter-Italic.9beab78452.woff +0 -0
- package/packs/widget/esm/fonts/Inter-Italic.d593a8df79.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Light.27083fa637.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Light.91dfddd842.woff +0 -0
- package/packs/widget/esm/fonts/Inter-LightItalic.0a783b89b3.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-LightItalic.f8ccf2813f.woff +0 -0
- package/packs/widget/esm/fonts/Inter-Medium.dc792b508e.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Medium.ec7dd2d9d8.woff +0 -0
- package/packs/widget/esm/fonts/Inter-MediumItalic.17301e5b40.woff +0 -0
- package/packs/widget/esm/fonts/Inter-MediumItalic.84d3493a9f.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Regular.f1f0c35b32.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Regular.f356e84aa0.woff +0 -0
- package/packs/widget/esm/fonts/Inter-SemiBold.55027e4724.woff +0 -0
- package/packs/widget/esm/fonts/Inter-SemiBold.fcb100c760.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-SemiBoldItalic.ab9105ed3b.woff +0 -0
- package/packs/widget/esm/fonts/Inter-SemiBoldItalic.d90f295d0c.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-Thin.16325d9b0f.woff +0 -0
- package/packs/widget/esm/fonts/Inter-Thin.dafaa44d99.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ThinItalic.4fc662b3cf.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-ThinItalic.d3d8994788.woff +0 -0
- package/packs/widget/esm/fonts/Inter-italic.var.958a0b9742.woff2 +0 -0
- package/packs/widget/esm/fonts/Inter-roman.var.b2129c009c.woff2 +0 -0
- package/packs/widget/esm/index.js +183 -0
- package/packs/widget/esm/qualified.css +5502 -0
- package/routes/app/offers/scripts/OfferMainScript.js +154 -0
- package/routes/app/offers/scripts/constants.js +71 -0
- package/routes/app/offers/scripts/main/ButtonManager.js +65 -0
- package/routes/app/offers/scripts/main/FormManager.js +325 -0
- package/routes/app/offers/scripts/main/MainContext.js +19 -0
- package/routes/app/offers/scripts/main/OfferManager.js +91 -0
- package/routes/app/offers/scripts/main/TriggerManager.js +125 -0
- package/routes/app/offers/scripts/rendering/ContentManager.js +53 -0
- package/routes/app/offers/scripts/rendering/LocationManager.js +83 -0
- package/routes/app/offers/scripts/rendering/RenderedOffer.js +188 -0
- package/routes/app/offers/scripts/rendering/Renderer.js +69 -0
- package/routes/app/offers/scripts/rendering/RenderingInitializer.js +62 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationManager.js +31 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationManagerFooter.js +81 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationManagerHeader.js +81 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationManagerModal.js +117 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationManagerSidebar.js +75 -0
- package/routes/app/offers/scripts/rendering/animations/AnimationResult.js +43 -0
- package/routes/app/offers/scripts/rendering/animations/Animator.js +78 -0
- package/routes/app/offers/scripts/rendering/animations/BaseAnimationManager.js +25 -0
- package/routes/app/offers/scripts/rendering/lib/BaseComponent.js +106 -0
- package/routes/app/offers/scripts/rendering/lib/FormComponent.js +134 -0
- package/routes/app/offers/scripts/rendering/lib/OfferComponent.js +144 -0
- package/routes/app/offers/scripts/rendering/lib/ScrollbarWidth.js +27 -0
- package/routes/app/offers/scripts/rendering/lib/decorators.js +20 -0
- package/routes/app/offers/scripts/rendering/locations/CSSVarsManager.js +66 -0
- package/routes/app/offers/scripts/rendering/locations/ElementResizeObserver.js +49 -0
- package/routes/app/offers/scripts/rendering/locations/footer.js +53 -0
- package/routes/app/offers/scripts/rendering/locations/header/AsyncBatchProcessor.js +70 -0
- package/routes/app/offers/scripts/rendering/locations/header/CSSTransitionObserver.js +182 -0
- package/routes/app/offers/scripts/rendering/locations/header/ElementStyleChangeObserver.js +138 -0
- package/routes/app/offers/scripts/rendering/locations/header/ExternalStyleManager.js +110 -0
- package/routes/app/offers/scripts/rendering/locations/header/Header.js +353 -0
- package/routes/app/offers/scripts/rendering/locations/header/InlineStyleManager.js +105 -0
- package/routes/app/offers/scripts/rendering/locations/header/MatchingElementsObserver.js +107 -0
- package/routes/app/offers/scripts/rendering/locations/header/NewElementsObserver.js +129 -0
- package/routes/app/offers/scripts/rendering/locations/header/RuleWrapper.js +46 -0
- package/routes/app/offers/scripts/rendering/locations/header/SelectorObservable.js +23 -0
- package/routes/app/offers/scripts/rendering/locations/header/SelectorObserver.js +61 -0
- package/routes/app/offers/scripts/rendering/locations/header/ShiftedElementsManager.js +45 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleElementManager.js +37 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleElementWrapper.js +62 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleSelectorObserver/ObservedSelectorValue.js +45 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleSelectorObserver/ObservedSelectors.js +62 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleSelectorObserver/StyleSelectorObserver.js +294 -0
- package/routes/app/offers/scripts/rendering/locations/header/StyleSelectorObserver/constants.js +21 -0
- package/routes/app/offers/scripts/rendering/locations/header/WindowResizeObserver.js +43 -0
- package/routes/app/offers/scripts/rendering/locations/header/utils.js +25 -0
- package/routes/app/offers/scripts/rendering/locations/popup.js +66 -0
- package/routes/app/offers/scripts/rendering/locations/sidebar.js +21 -0
- package/routes/app/offers/scripts/rendering/variations/ButtonBanner.js +105 -0
- package/routes/app/offers/scripts/rendering/variations/ButtonModal.js +114 -0
- package/routes/app/offers/scripts/rendering/variations/FormBanner.js +214 -0
- package/routes/app/offers/scripts/rendering/variations/FormModal.js +325 -0
- package/routes/app/offers/scripts/rendering/variations/LinkBanner.js +105 -0
- package/routes/app/offers/scripts/rendering/variations/components/Body.js +29 -0
- package/routes/app/offers/scripts/rendering/variations/components/Button.js +128 -0
- package/routes/app/offers/scripts/rendering/variations/components/DismissButton.js +39 -0
- package/routes/app/offers/scripts/rendering/variations/components/ForegroundImageBanner.js +110 -0
- package/routes/app/offers/scripts/rendering/variations/components/ForegroundImageModal.js +128 -0
- package/routes/app/offers/scripts/rendering/variations/components/Headline.js +94 -0
- package/routes/app/offers/scripts/rendering/variations/components/MultiFieldForm.js +302 -0
- package/routes/app/offers/scripts/rendering/variations/components/Tooltip.js +74 -0
- package/routes/app/offers/scripts/rendering/variations/icons.js +15 -0
- package/routes/app/offers/scripts/utils.js +115 -0
- package/routes/app/offers/utils/HTMLUtils.js +10 -0
- package/routes/app/offers/utils/createTypeGuard.js +32 -0
- package/routes/app/offers/utils/promise-utils.js +22 -0
- package/routes/app/websiteBuilder/stores/storeHelpers.js +18 -0
- package/sounds/message-initial.mp3 +0 -0
- package/sounds/message-received.mp3 +0 -0
- package/sounds/message-sent.mp3 +0 -0
- package/src/arrays.js +15 -0
- package/src/audio.js +106 -0
- package/src/bounded-set.js +16 -0
- package/src/bounding_box_observer.js +129 -0
- package/src/decorators.js +29 -0
- package/src/dom.js +128 -0
- package/src/dom_roots.js +26 -0
- package/src/embedded_forms/EmbeddedForm.js +638 -0
- package/src/embedded_forms/QualifiedEmbeddedForm.js +51 -0
- package/src/embedded_forms/QualifiedFormField.js +137 -0
- package/src/embedded_forms/utils.js +17 -0
- package/src/graphql-types.js +1686 -0
- package/src/iframes.js +86 -0
- package/src/localstorage.js +43 -0
- package/src/mirror/Shipper.js +133 -0
- package/src/mirror/constants.generated.js +13 -0
- package/src/mirror/constants.js +238 -0
- package/src/mirror/shipper/ChangeQueue.js +155 -0
- package/src/mirror/shipper/DOMSerializer.js +392 -0
- package/src/mirror/shipper/observers.js +441 -0
- package/src/mirror/shipper/utils.js +98 -0
- package/src/mixins/disposable.js +125 -0
- package/src/mixins/injectable.js +37 -0
- package/src/personalizations/personalization-manager.js +110 -0
- package/src/personalizations/strategies/node-freezing-strategy.js +174 -0
- package/src/personalizations/utils.js +187 -0
- package/src/promises.js +107 -0
- package/src/proxy.js +144 -0
- package/src/qualified_root.js +35 -0
- package/src/query_params.js +55 -0
- package/src/shadow-dom-helper.js +63 -0
- package/src/singleton_host.js +39 -0
- package/src/smart_website/trigger.js +49 -0
- package/src/smart_website/utils.js +149 -0
- package/src/string.js +53 -0
- package/src/timezone.js +57 -0
- package/src/timing.js +49 -0
- package/src/type-utils.js +76 -0
- package/src/url-utils.js +102 -0
- package/src/url.js +50 -0
- package/src/utils.js +72 -0
- package/src/validation.js.js +29 -0
- package/src/validation_ts.js +6 -0
- package/vendor/actioncable/adapters.js +6 -0
- package/vendor/actioncable/connection.js +204 -0
- package/vendor/actioncable/connection_monitor.js +129 -0
- package/vendor/actioncable/consumer.js +91 -0
- package/vendor/actioncable/index.js +34 -0
- package/vendor/actioncable/internal.js +22 -0
- package/vendor/actioncable/logger.js +28 -0
- package/vendor/actioncable/subscription.js +93 -0
- package/vendor/actioncable/subscriptions.js +89 -0
- package/vendor/open-telemetry-idgenerator.js +43 -0
- package/widget/analytics/facebook_tracker.js +8 -0
- package/widget/analytics/google_analytics_tracker.js +83 -0
- package/widget/analytics/google_tag_manager_tracker.js +22 -0
- package/widget/analytics.js +58 -0
- package/widget/api_handler/api_handler.js +730 -0
- package/widget/api_handler/base_api_handler.js +249 -0
- package/widget/booker_intent_tracker.js +391 -0
- package/widget/booker_outcome_tracker.js +329 -0
- package/widget/capture_widget_exceptions.js +150 -0
- package/widget/channel.js +282 -0
- package/widget/composite_experience_adapter.js +101 -0
- package/widget/constants.generated.js +350 -0
- package/widget/constants.js +21 -0
- package/widget/container.js +193 -0
- package/widget/content_activity_emitter.js +36 -0
- package/widget/data360_visitor.js +67 -0
- package/widget/date_provider.js +11 -0
- package/widget/debug_mode_state.js +175 -0
- package/widget/dummy_module.js +9 -0
- package/widget/eloqua_visitor.js +17 -0
- package/widget/form_cta_booker_intent.js +246 -0
- package/widget/hubspot_visitor.js +39 -0
- package/widget/inline_meeting_booker_page.js +90 -0
- package/widget/local_state/abstract_local_state.js +38 -0
- package/widget/local_state/debug_state/abstract_debug_flow.js +29 -0
- package/widget/local_state/debug_state/custom_form_flow.js +14 -0
- package/widget/local_state/debug_state/hubspot_form_flow.js +19 -0
- package/widget/local_state/debug_state/hubspot_v4_form_flow.js +19 -0
- package/widget/local_state/debug_state/marketo_form_flow.js +20 -0
- package/widget/local_state/debug_state/pardot_form_flow.js +18 -0
- package/widget/local_state/debug_state.js +362 -0
- package/widget/local_state/trace_state.js +20 -0
- package/widget/location_provider.js +9 -0
- package/widget/marketo_visitor.js +39 -0
- package/widget/meetings/tracing/buttons_forms_triggering_tracer.js +124 -0
- package/widget/meetings/tracing/spans/button_spans.js +18 -0
- package/widget/meetings/tracing/spans/form_spans.js +11 -0
- package/widget/multimodal_v2/assets_preloader.js +97 -0
- package/widget/multimodal_v2/components/AppLayout.js +93 -0
- package/widget/multimodal_v2/components/CursorOverlay.js +93 -0
- package/widget/multimodal_v2/components/PointerRectOverlay.js +74 -0
- package/widget/multimodal_v2/components/app/Artifact.js +109 -0
- package/widget/multimodal_v2/components/app/Background.js +27 -0
- package/widget/multimodal_v2/components/app/CalendarLoadingContent.js +255 -0
- package/widget/multimodal_v2/components/app/Chat.js +39 -0
- package/widget/multimodal_v2/components/app/CookieConsentModal.js +149 -0
- package/widget/multimodal_v2/components/app/Foreground.js +48 -0
- package/widget/multimodal_v2/components/app/HiddenInput.js +41 -0
- package/widget/multimodal_v2/components/app/Input.js +72 -0
- package/widget/multimodal_v2/components/app/LightboxExperience.js +769 -0
- package/widget/multimodal_v2/components/app/LoadingOverlay.js +97 -0
- package/widget/multimodal_v2/components/app/Main.js +985 -0
- package/widget/multimodal_v2/components/app/MessengerButton.js +160 -0
- package/widget/multimodal_v2/components/app/Multimodal.js +17 -0
- package/widget/multimodal_v2/components/app/OverlayControls.js +79 -0
- package/widget/multimodal_v2/components/app/Preview.js +32 -0
- package/widget/multimodal_v2/components/app/PrivacyDisclosure.js +57 -0
- package/widget/multimodal_v2/components/app/RotateDeviceOverlay.js +70 -0
- package/widget/multimodal_v2/components/app/Toolbar.js +156 -0
- package/widget/multimodal_v2/components/chat/ChatComposer.js +129 -0
- package/widget/multimodal_v2/components/chat/ChatInputForm.js +398 -0
- package/widget/multimodal_v2/components/chat/ColdStartQuestions.js +354 -0
- package/widget/multimodal_v2/components/chat/ComposerErrorBanner.js +62 -0
- package/widget/multimodal_v2/components/chat/PostCallSurvey.js +359 -0
- package/widget/multimodal_v2/components/chat/preview/FieldRequestRenderer.js +41 -0
- package/widget/multimodal_v2/components/chat/preview/PreviewMessageRenderer.js +60 -0
- package/widget/multimodal_v2/components/chat/preview/SharedOfferRenderer.js +143 -0
- package/widget/multimodal_v2/components/chat/preview/TextRenderer.js +27 -0
- package/widget/multimodal_v2/components/chat/preview/TimelinePreview.js +254 -0
- package/widget/multimodal_v2/components/chat/timeline/CalendarEventOfferRenderer.js +103 -0
- package/widget/multimodal_v2/components/chat/timeline/CalendarEventPickRenderer.js +148 -0
- package/widget/multimodal_v2/components/chat/timeline/FieldEntryRenderer.js +84 -0
- package/widget/multimodal_v2/components/chat/timeline/FieldRequestRenderer.js +56 -0
- package/widget/multimodal_v2/components/chat/timeline/InlinePrivacyDisclosure.js +66 -0
- package/widget/multimodal_v2/components/chat/timeline/LinkPreviewCard.js +70 -0
- package/widget/multimodal_v2/components/chat/timeline/MessageEntry.js +88 -0
- package/widget/multimodal_v2/components/chat/timeline/PresentContentRenderer.js +30 -0
- package/widget/multimodal_v2/components/chat/timeline/PresentDeckRenderer.js +279 -0
- package/widget/multimodal_v2/components/chat/timeline/PresentVideoRenderer.js +131 -0
- package/widget/multimodal_v2/components/chat/timeline/ShareContentRenderer.js +59 -0
- package/widget/multimodal_v2/components/chat/timeline/SharedOfferRenderer.js +131 -0
- package/widget/multimodal_v2/components/chat/timeline/SystemRenderer.js +82 -0
- package/widget/multimodal_v2/components/chat/timeline/TextRenderer.js +66 -0
- package/widget/multimodal_v2/components/chat/timeline/Timeline.js +158 -0
- package/widget/multimodal_v2/components/debug/DebugMultimodalPanel.js +327 -0
- package/widget/multimodal_v2/components/decks/index.js +160 -0
- package/widget/multimodal_v2/components/field_request/BooleanField.js +77 -0
- package/widget/multimodal_v2/components/field_request/FieldComponents.js +69 -0
- package/widget/multimodal_v2/components/field_request/Form.js +87 -0
- package/widget/multimodal_v2/components/field_request/MultiPicklistField.js +240 -0
- package/widget/multimodal_v2/components/field_request/PicklistField.js +166 -0
- package/widget/multimodal_v2/components/field_request/SingleLineInputField.js +69 -0
- package/widget/multimodal_v2/components/field_request/TextField.js +37 -0
- package/widget/multimodal_v2/components/field_request/index.js +170 -0
- package/widget/multimodal_v2/components/helpers/AutoScroll.js +37 -0
- package/widget/multimodal_v2/components/helpers/ErrorBoundary.js +53 -0
- package/widget/multimodal_v2/components/helpers/FocusTrapDialog.js +26 -0
- package/widget/multimodal_v2/components/helpers/ImpressionTracker.js +94 -0
- package/widget/multimodal_v2/components/helpers/ListRenderer.js +37 -0
- package/widget/multimodal_v2/components/helpers/Localization.js +76 -0
- package/widget/multimodal_v2/components/helpers/Persisted.js +166 -0
- package/widget/multimodal_v2/components/helpers/RichText.js +358 -0
- package/widget/multimodal_v2/components/helpers/ScreenReaderHeading.js +17 -0
- package/widget/multimodal_v2/components/helpers/Thumbnail.js +190 -0
- package/widget/multimodal_v2/components/helpers/VisuallyHidden.js +41 -0
- package/widget/multimodal_v2/components/helpers/content_click_payloads.js +58 -0
- package/widget/multimodal_v2/components/helpers/useDraggable.js +103 -0
- package/widget/multimodal_v2/components/helpers/useTextOverflow.js +44 -0
- package/widget/multimodal_v2/components/lightbox_gather/index.js +741 -0
- package/widget/multimodal_v2/components/meetings/ArtifactEntryPoint.js +252 -0
- package/widget/multimodal_v2/components/meetings/MeetingAdditionalAttendees.js +325 -0
- package/widget/multimodal_v2/components/meetings/MeetingBookerEntry.js +100 -0
- package/widget/multimodal_v2/components/meetings/MeetingDetailsCard.js +99 -0
- package/widget/multimodal_v2/components/meetings/MeetingErrorBanner.js +62 -0
- package/widget/multimodal_v2/components/meetings/MeetingOfferEmailStep.js +239 -0
- package/widget/multimodal_v2/components/meetings/MeetingOfferFooter.js +104 -0
- package/widget/multimodal_v2/components/meetings/MeetingOfferSelectionStep.js +60 -0
- package/widget/multimodal_v2/components/meetings/MeetingRepHeader.js +222 -0
- package/widget/multimodal_v2/components/meetings/MeetingStepShell.js +92 -0
- package/widget/multimodal_v2/components/meetings/MeetingSummaryRail.js +515 -0
- package/widget/multimodal_v2/components/meetings/MeetingTimeSelector.js +603 -0
- package/widget/multimodal_v2/components/meetings/MonthDatePicker.js +422 -0
- package/widget/multimodal_v2/components/meetings/NavigationButtons.js +76 -0
- package/widget/multimodal_v2/components/meetings/TimeSlotHeader.js +357 -0
- package/widget/multimodal_v2/components/meetings/WeekViewHeader.js +20 -0
- package/widget/multimodal_v2/components/meetings/constants.js +7 -0
- package/widget/multimodal_v2/components/meetings/index.js +47 -0
- package/widget/multimodal_v2/components/meetings/utils.js +328 -0
- package/widget/multimodal_v2/components/multimodal/Audio.js +28 -0
- package/widget/multimodal_v2/components/multimodal/Controls.js +188 -0
- package/widget/multimodal_v2/components/multimodal/LiveVideo.js +63 -0
- package/widget/multimodal_v2/components/multimodal/MultiModalComponent.js +424 -0
- package/widget/multimodal_v2/components/multimodal/MultimodalAvatar.js +36 -0
- package/widget/multimodal_v2/components/multimodal/OrbAvatar.js +326 -0
- package/widget/multimodal_v2/components/multimodal/Status.js +220 -0
- package/widget/multimodal_v2/components/multimodal/VideoAvatar.js +24 -0
- package/widget/multimodal_v2/components/multimodal/VideoPreview.js +114 -0
- package/widget/multimodal_v2/components/multimodal/useAudioLevelMonitoring.js +96 -0
- package/widget/multimodal_v2/components/multimodal/useMultimodal.js +434 -0
- package/widget/multimodal_v2/components/presentations/index.js +372 -0
- package/widget/multimodal_v2/components/shared/Avatar.js +92 -0
- package/widget/multimodal_v2/components/shared/AvatarGroup.js +135 -0
- package/widget/multimodal_v2/components/shared/Button.js +245 -0
- package/widget/multimodal_v2/components/shared/ButtonGroup.js +133 -0
- package/widget/multimodal_v2/components/shared/ComposerForm.js +98 -0
- package/widget/multimodal_v2/components/shared/SpeakingIndicator.js +239 -0
- package/widget/multimodal_v2/components/shared/ThinkingAnimation.js +165 -0
- package/widget/multimodal_v2/components/shared/Tooltip.js +266 -0
- package/widget/multimodal_v2/components/shared/controls/Dropdown.js +79 -0
- package/widget/multimodal_v2/components/shared/controls/PillToggle.js +142 -0
- package/widget/multimodal_v2/components/shared/controls/TextArea.js +114 -0
- package/widget/multimodal_v2/components/shared/toolCallLabels.js +12 -0
- package/widget/multimodal_v2/components/slides/SlidesThumbnail.js +47 -0
- package/widget/multimodal_v2/components/slides/index.js +61 -0
- package/widget/multimodal_v2/constants.js +88 -0
- package/widget/multimodal_v2/host.split-css.js +2 -0
- package/widget/multimodal_v2/host.string.js +96 -0
- package/widget/multimodal_v2/images/icons.js +582 -0
- package/widget/multimodal_v2/images/posters/piper_low_res.jpg +0 -0
- package/widget/multimodal_v2/index.js +23 -0
- package/widget/multimodal_v2/index.panda.js +28 -0
- package/widget/multimodal_v2/index.split-css.panda.js +2 -0
- package/widget/multimodal_v2/inline_meeting_booker.js +182 -0
- package/widget/multimodal_v2/locales/cs.js +196 -0
- package/widget/multimodal_v2/locales/da.js +196 -0
- package/widget/multimodal_v2/locales/de.js +196 -0
- package/widget/multimodal_v2/locales/en.js +196 -0
- package/widget/multimodal_v2/locales/en_AU.js +197 -0
- package/widget/multimodal_v2/locales/en_GB.js +197 -0
- package/widget/multimodal_v2/locales/es.js +197 -0
- package/widget/multimodal_v2/locales/es_LA.js +196 -0
- package/widget/multimodal_v2/locales/fi.js +196 -0
- package/widget/multimodal_v2/locales/fr.js +197 -0
- package/widget/multimodal_v2/locales/fr_CA.js +196 -0
- package/widget/multimodal_v2/locales/id.js +196 -0
- package/widget/multimodal_v2/locales/index.js +48 -0
- package/widget/multimodal_v2/locales/it.js +196 -0
- package/widget/multimodal_v2/locales/ja.js +196 -0
- package/widget/multimodal_v2/locales/ko.js +196 -0
- package/widget/multimodal_v2/locales/nb.js +196 -0
- package/widget/multimodal_v2/locales/nl.js +196 -0
- package/widget/multimodal_v2/locales/pl.js +196 -0
- package/widget/multimodal_v2/locales/pt_BR.js +196 -0
- package/widget/multimodal_v2/locales/ru.js +196 -0
- package/widget/multimodal_v2/locales/sv.js +196 -0
- package/widget/multimodal_v2/locales/th.js +196 -0
- package/widget/multimodal_v2/locales/tr.js +196 -0
- package/widget/multimodal_v2/locales/vi.js +196 -0
- package/widget/multimodal_v2/locales/zh_CN.js +196 -0
- package/widget/multimodal_v2/locales/zh_TW.js +196 -0
- package/widget/multimodal_v2/multimodal.js +633 -0
- package/widget/multimodal_v2/multimodal_channel.js +195 -0
- package/widget/multimodal_v2/signals/active_conversation_signal.js +33 -0
- package/widget/multimodal_v2/signals/allowed_conversation_mode_signal.js +38 -0
- package/widget/multimodal_v2/signals/artifact_signal.js +22 -0
- package/widget/multimodal_v2/signals/layout_signal.js +98 -0
- package/widget/multimodal_v2/signals/messages_signal.js +207 -0
- package/widget/multimodal_v2/signals/ui_state_signal.js +128 -0
- package/widget/multimodal_v2/stable_bundle_src.js +44 -0
- package/widget/multimodal_v2/stores/ai_conversation_store.js +221 -0
- package/widget/multimodal_v2/stores/artifact_store.js +205 -0
- package/widget/multimodal_v2/stores/base_store.js +16 -0
- package/widget/multimodal_v2/stores/call_store.js +770 -0
- package/widget/multimodal_v2/stores/call_ui_adapter.js +225 -0
- package/widget/multimodal_v2/stores/debug_multimodal_scenario_store.js +471 -0
- package/widget/multimodal_v2/stores/decks_store.js +285 -0
- package/widget/multimodal_v2/stores/device_store.js +63 -0
- package/widget/multimodal_v2/stores/docking_store.js +62 -0
- package/widget/multimodal_v2/stores/field_request_store.js +326 -0
- package/widget/multimodal_v2/stores/meeting_store.js +477 -0
- package/widget/multimodal_v2/stores/participant_store.js +73 -0
- package/widget/multimodal_v2/stores/post_call_survey_store.js +160 -0
- package/widget/multimodal_v2/stores/pounce_tracking_store.js +163 -0
- package/widget/multimodal_v2/stores/pounce_tracking_store_v2.js +511 -0
- package/widget/multimodal_v2/stores/presentations_store.js +111 -0
- package/widget/multimodal_v2/stores/root_store.js +1919 -0
- package/widget/multimodal_v2/stores/screen_share_store.js +217 -0
- package/widget/multimodal_v2/stores/slides_store.js +21 -0
- package/widget/multimodal_v2/stores/translation_store.js +185 -0
- package/widget/multimodal_v2/stores/ui_store.js +496 -0
- package/widget/multimodal_v2/stores/waiting_store.js +159 -0
- package/widget/multimodal_v2/stores/website_navigation_store.js +767 -0
- package/widget/multimodal_v2/styled-system/css/conditions.js +34 -0
- package/widget/multimodal_v2/styled-system/css/css.js +48 -0
- package/widget/multimodal_v2/styled-system/css/cva.js +96 -0
- package/widget/multimodal_v2/styled-system/css/cx.js +13 -0
- package/widget/multimodal_v2/styled-system/css/index.js +15 -0
- package/widget/multimodal_v2/styled-system/css/sva.js +69 -0
- package/widget/multimodal_v2/styled-system/helpers.js +384 -0
- package/widget/multimodal_v2/styled-system/jsx/create-style-context.js +96 -0
- package/widget/multimodal_v2/styled-system/jsx/factory-helper.js +19 -0
- package/widget/multimodal_v2/styled-system/jsx/factory.js +111 -0
- package/widget/multimodal_v2/styled-system/jsx/index.js +12 -0
- package/widget/multimodal_v2/styled-system/jsx/is-valid-prop.js +22 -0
- package/widget/multimodal_v2/types.js +105 -0
- package/widget/multimodal_v2/utils/auto_scroller.js +157 -0
- package/widget/multimodal_v2/utils/flip_animation.js +124 -0
- package/widget/multimodal_v2/utils/focus_gate.js +237 -0
- package/widget/multimodal_v2/utils/locale.js +16 -0
- package/widget/multimodal_v2/utils/media_queries.js +30 -0
- package/widget/multimodal_v2/utils/multimodal_cache.js +19 -0
- package/widget/multimodal_v2/utils/mutation_effect.js +14 -0
- package/widget/multimodal_v2/utils/navigation_interceptor.js +205 -0
- package/widget/multimodal_v2/utils/navigation_strategies/dom_swap.js +393 -0
- package/widget/multimodal_v2/utils/navigation_strategies/index.js +12 -0
- package/widget/multimodal_v2/utils/navigation_strategies/lwr.js +61 -0
- package/widget/multimodal_v2/utils/navigation_strategies/navigation_utils.js +46 -0
- package/widget/multimodal_v2/utils/navigation_strategies/next_js.js +24 -0
- package/widget/multimodal_v2/utils/navigation_strategies/wouter_v3.js +15 -0
- package/widget/multimodal_v2/utils/objects_map.js +38 -0
- package/widget/multimodal_v2/utils/perceived_voice_turn_tracker.js +345 -0
- package/widget/multimodal_v2/utils/sanitize_html.js +132 -0
- package/widget/multimodal_v2/utils/signals.js +97 -0
- package/widget/multimodal_v2/utils/slide_zoom.js +114 -0
- package/widget/multimodal_v2/utils/theme_styles.js +137 -0
- package/widget/multimodal_v2/utils/url_observer.js +52 -0
- package/widget/multimodal_v2/utils/voice_onset_detector.js +127 -0
- package/widget/page_mirror.js +89 -0
- package/widget/page_view_activity_emitter.js +71 -0
- package/widget/pardot_visitor.js +137 -0
- package/widget/personalization_observer.js +96 -0
- package/widget/personalizations_config.js +160 -0
- package/widget/qualified_form/constants.js +23 -0
- package/widget/qualified_form/phone_utils.js +38 -0
- package/widget/qualified_form/qualified_form_action.js +91 -0
- package/widget/qualified_form/qualified_form_action_orchestrator.js +21 -0
- package/widget/qualified_form/qualified_form_api.js +471 -0
- package/widget/scroll_disabler.js +109 -0
- package/widget/server-logger.js +156 -0
- package/widget/smart_website_config.js +112 -0
- package/widget/telemetry/context.js +75 -0
- package/widget/telemetry/index.js +16 -0
- package/widget/telemetry/messenger_uptime.js +80 -0
- package/widget/telemetry/metrics.js +120 -0
- package/widget/telemetry/span.js +82 -0
- package/widget/telemetry/telemetry.js +180 -0
- package/widget/telemetry/tracer.js +41 -0
- package/widget/telemetry/tracing_store.js +310 -0
- package/widget/tracker.js +916 -0
- package/widget/utils/native_globals.js +129 -0
- package/widget/v1_adapter.js +50 -0
- package/widget/v2_adapter.js +368 -0
- package/widget/visitor/base_visitor_state.js +11 -0
- package/widget/visitor/cookie_visitor_state.js +128 -0
- package/widget/visitor/in_memory_visitor_state.js +29 -0
- package/widget/visitor/visitor_state.js +384 -0
- package/widget/visitor.js +356 -0
- package/widget/widget/linked_widget_v2.js +227 -0
- package/widget/widget/page_mirror_factory.js +22 -0
- package/widget/widget/sentry.js +130 -0
- package/widget/widget/widget.js +1698 -0
- package/widget/widget.split-css.js +2 -0
- package/widget/widget_bootstrap.js +97 -0
- package/widget/widget_object.js +73 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { withCaptureExceptions, captureWidgetExceptions } from "../../../../widget/capture_widget_exceptions.js";
|
|
2
|
+
import { default as WidgetObject } from "../../../../widget/widget_object.js";
|
|
3
|
+
import { ButtonManager } from "./main/ButtonManager.js";
|
|
4
|
+
import { FormManager } from "./main/FormManager.js";
|
|
5
|
+
import { MainContext } from "./main/MainContext.js";
|
|
6
|
+
import { OfferManager } from "./main/OfferManager.js";
|
|
7
|
+
import { TriggerManager } from "./main/TriggerManager.js";
|
|
8
|
+
import { RenderingInitializer } from "./rendering/RenderingInitializer.js";
|
|
9
|
+
import { __decorate, __metadata } from "../../../../js/4101.js";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class OfferMainScript extends WidgetObject {
|
|
22
|
+
get hasActiveForm() {
|
|
23
|
+
return this.formManager.hasActiveOffer;
|
|
24
|
+
}
|
|
25
|
+
pause() {
|
|
26
|
+
this.context.manager.pause();
|
|
27
|
+
}
|
|
28
|
+
resume() {
|
|
29
|
+
this.context.manager.resume();
|
|
30
|
+
}
|
|
31
|
+
get offerFeatureFlags() {
|
|
32
|
+
if (this._offerFeatureFlags) return this._offerFeatureFlags;
|
|
33
|
+
this._offerFeatureFlags = {
|
|
34
|
+
hasOffersFontEnhancements: this.config.hasOffersFontEnhancements,
|
|
35
|
+
disableQOfferInfo: this.config.disableQOfferInfo,
|
|
36
|
+
hasOffersPopupWithScrollDisabler: this.config.hasOffersPopupWithScrollDisabler,
|
|
37
|
+
hasWidgetFullScreenWithScrollDisabler: this.config.hasWidgetFullScreenWithScrollDisabler,
|
|
38
|
+
hasDismissButtonAccessibilityEnabled: this.config.hasDismissButtonAccessibilityEnabled,
|
|
39
|
+
hasOffersFormBannerMobileImprovements: this.config.hasOffersFormBannerMobileImprovements
|
|
40
|
+
};
|
|
41
|
+
return this._offerFeatureFlags;
|
|
42
|
+
}
|
|
43
|
+
async init(offers) {
|
|
44
|
+
const processedOffers = this.processOffers(offers);
|
|
45
|
+
if (this.context.manager.isPaused) {
|
|
46
|
+
this.pendingOffers = processedOffers;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const keptOffers = this.offers.filter((offer)=>processedOffers.some((o)=>o.id === offer.id));
|
|
50
|
+
await this.clearOffers({
|
|
51
|
+
except: keptOffers
|
|
52
|
+
});
|
|
53
|
+
this.offers = processedOffers;
|
|
54
|
+
await this.triggerManager.trigger(this.offers.filter((offer)=>!keptOffers.some((o)=>o.id === offer.id)));
|
|
55
|
+
}
|
|
56
|
+
initPendingOffers() {
|
|
57
|
+
if (!this.pendingOffers) return;
|
|
58
|
+
// Must await, void, or catch to avoid swallowing errors. In this case, we can use void,
|
|
59
|
+
// because init already uses captureWidgetExceptions to catch errors
|
|
60
|
+
void this.init(this.pendingOffers);
|
|
61
|
+
this.pendingOffers = null;
|
|
62
|
+
}
|
|
63
|
+
async clearOffers(param) {
|
|
64
|
+
let { except } = param;
|
|
65
|
+
await this.context.manager.clear({
|
|
66
|
+
except
|
|
67
|
+
});
|
|
68
|
+
this.offers = [
|
|
69
|
+
...except
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
// Sort the offers by position and remove duplicate locations, keeping the lowest position for each location
|
|
73
|
+
processOffers(queuedOffers) {
|
|
74
|
+
// Sort the offers by position
|
|
75
|
+
let offers = [
|
|
76
|
+
...queuedOffers
|
|
77
|
+
].sort((a, b)=>a.position - b.position);
|
|
78
|
+
// Remove duplicate locations, keep lowest position for each location
|
|
79
|
+
const locations = new Set();
|
|
80
|
+
offers = offers.filter((offer)=>{
|
|
81
|
+
if (locations.has(offer.currentVersion.location)) return false;
|
|
82
|
+
locations.add(offer.currentVersion.location);
|
|
83
|
+
return true;
|
|
84
|
+
});
|
|
85
|
+
return offers;
|
|
86
|
+
}
|
|
87
|
+
constructor(injectionProps){
|
|
88
|
+
super(injectionProps), this.offers = [], this.pendingOffers = null, this._offerFeatureFlags = null;
|
|
89
|
+
// This is a shared entry point for managing and rendering offers.
|
|
90
|
+
// We use captureWidgetExceptions and withCaptureExceptions here to
|
|
91
|
+
// ensure errors raised in offers-related code are caught and logged.
|
|
92
|
+
const OfferManagerWithCaptureExceptions = withCaptureExceptions(OfferManager, this.widget, {
|
|
93
|
+
context: "Offers::OfferManager"
|
|
94
|
+
});
|
|
95
|
+
this.context = new MainContext(this.pageViewActivityEmitter, this.dateProvider, this.channel, new OfferManagerWithCaptureExceptions(), ()=>this.iframeManager);
|
|
96
|
+
const TriggerManagerWithCaptureExceptions = withCaptureExceptions(TriggerManager, this.widget, {
|
|
97
|
+
context: "Offers::TriggerManager"
|
|
98
|
+
});
|
|
99
|
+
const ButtonManagerWithCaptureExceptions = withCaptureExceptions(ButtonManager, this.widget, {
|
|
100
|
+
context: "Offers::ButtonManager"
|
|
101
|
+
});
|
|
102
|
+
const FormManagerWithCaptureExceptions = withCaptureExceptions(FormManager, this.widget, {
|
|
103
|
+
context: "Offers::FormManager"
|
|
104
|
+
});
|
|
105
|
+
this.triggerManager = new TriggerManagerWithCaptureExceptions(this.context);
|
|
106
|
+
this.buttonManager = new ButtonManagerWithCaptureExceptions(this.context, this.offerFeatureFlags);
|
|
107
|
+
this.formManager = new FormManagerWithCaptureExceptions(this.context);
|
|
108
|
+
this.context.manager.subscribe("afterResume", ()=>this.initPendingOffers());
|
|
109
|
+
RenderingInitializer.init({
|
|
110
|
+
offerFeatureFlags: this.offerFeatureFlags,
|
|
111
|
+
offersHeaderConfig: this.config.offersHeaderConfig
|
|
112
|
+
});
|
|
113
|
+
this.channel.on("initOffers", (offers)=>{
|
|
114
|
+
this.offerScript.init(offers).then(()=>{
|
|
115
|
+
// We only care about the first call to initOffers per widget instance
|
|
116
|
+
if (this.widget.widgetIdForInitOffers === this.widget.widgetId) return;
|
|
117
|
+
this.widget.logTiming("Offers load time", "offers_time_to_init_ms");
|
|
118
|
+
this.widget.widgetIdForInitOffers = this.widget.widgetId;
|
|
119
|
+
}).catch(()=>{
|
|
120
|
+
// NOOP, OfferMainScript#init already uses captureWidgetExceptions to report errors
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
__decorate([
|
|
126
|
+
captureWidgetExceptions({
|
|
127
|
+
context: "Offers::OfferMainScript#init"
|
|
128
|
+
}),
|
|
129
|
+
__metadata("design:type", Function),
|
|
130
|
+
__metadata("design:paramtypes", [
|
|
131
|
+
typeof Immutable === "undefined" ? Object : Immutable
|
|
132
|
+
]),
|
|
133
|
+
__metadata("design:returntype", Promise)
|
|
134
|
+
], OfferMainScript.prototype, "init", null);
|
|
135
|
+
__decorate([
|
|
136
|
+
captureWidgetExceptions({
|
|
137
|
+
context: "Offers::OfferMainScript#initPendingOffers"
|
|
138
|
+
}),
|
|
139
|
+
__metadata("design:type", Function),
|
|
140
|
+
__metadata("design:paramtypes", []),
|
|
141
|
+
__metadata("design:returntype", void 0)
|
|
142
|
+
], OfferMainScript.prototype, "initPendingOffers", null);
|
|
143
|
+
__decorate([
|
|
144
|
+
captureWidgetExceptions({
|
|
145
|
+
context: "Offers::OfferMainScript#clearOffers"
|
|
146
|
+
}),
|
|
147
|
+
__metadata("design:type", Function),
|
|
148
|
+
__metadata("design:paramtypes", [
|
|
149
|
+
Object
|
|
150
|
+
]),
|
|
151
|
+
__metadata("design:returntype", Promise)
|
|
152
|
+
], OfferMainScript.prototype, "clearOffers", null);
|
|
153
|
+
|
|
154
|
+
export { OfferMainScript };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { LocationEnum } from "../../../../src/graphql-types.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// See #q-messenger-frame in services/app/javascript/widget/widget.string.scss
|
|
5
|
+
const Q_MESSENGER_FRAME_Z_INDEX = 2147483642;
|
|
6
|
+
// Ensure offers do not block messenger or dismiss messenger button
|
|
7
|
+
const DEFAULT_OFFERS_Z_INDEX = Q_MESSENGER_FRAME_Z_INDEX - 1;
|
|
8
|
+
// Unlike other offer types, popups are meant be overlayed on top all website content
|
|
9
|
+
const POPUP_OFFERS_Z_INDEX = Q_MESSENGER_FRAME_Z_INDEX + 1;
|
|
10
|
+
const PRIVACY_DISCLOSURE_ARIA_LABEL_PREFIX = "Privacy disclosure text: ";
|
|
11
|
+
const HOST_LOCATION_ATTRIBUTE = "data-qualified-offer-host-location";
|
|
12
|
+
const ANIMATED_FIXED_ELEMENT_DATA_ATTRIBUTE = "data-qualified-offer-animated-fixed-element";
|
|
13
|
+
// DO NOT CHANGE THIS VALUE, it is used externally
|
|
14
|
+
const HEADER_HEIGHT_CSS_VARIABLE = "--qualified-offer-header-height";
|
|
15
|
+
const HEADER_IGNORE_ELEMENT_DATA_ATTRIBUTE = "data-qualified-offer-header-ignore";
|
|
16
|
+
const HEADER_INCLUDE_ELEMENT_DATA_ATTRIBUTE = "data-qualified-offer-header-include";
|
|
17
|
+
// DO NOT CHANGE THIS VALUE, it is used externally
|
|
18
|
+
const FOOTER_HEIGHT_CSS_VARIABLE = "--qualified-offer-footer-height";
|
|
19
|
+
const RESIZE_THROTTLE_MS = 250;
|
|
20
|
+
const MOBILE_THRESHOLD = 540;
|
|
21
|
+
const MODAL_WIDTHS = {
|
|
22
|
+
desktop: {
|
|
23
|
+
[LocationEnum.Popup]: 450,
|
|
24
|
+
[LocationEnum.Sidebar]: 326
|
|
25
|
+
},
|
|
26
|
+
mobile: {
|
|
27
|
+
[LocationEnum.Popup]: 343,
|
|
28
|
+
[LocationEnum.Sidebar]: 326
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const MODAL_PADDING = {
|
|
32
|
+
desktop: {
|
|
33
|
+
[LocationEnum.Popup]: "64px",
|
|
34
|
+
[LocationEnum.Sidebar]: "32px"
|
|
35
|
+
},
|
|
36
|
+
mobile: {
|
|
37
|
+
[LocationEnum.Popup]: "32px",
|
|
38
|
+
[LocationEnum.Sidebar]: "32px"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const MODAL_IMAGE_MAX_HEIGHTS = {
|
|
42
|
+
mobile: {
|
|
43
|
+
[LocationEnum.Popup]: "400px",
|
|
44
|
+
[LocationEnum.Sidebar]: "300px"
|
|
45
|
+
},
|
|
46
|
+
desktop: {
|
|
47
|
+
[LocationEnum.Popup]: "400px",
|
|
48
|
+
[LocationEnum.Sidebar]: "300px"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const MODAL_IMAGE_MAX_WIDTHS = {
|
|
52
|
+
mobile: {
|
|
53
|
+
[LocationEnum.Popup]: "400px",
|
|
54
|
+
[LocationEnum.Sidebar]: "300px"
|
|
55
|
+
},
|
|
56
|
+
desktop: {
|
|
57
|
+
[LocationEnum.Popup]: "500px",
|
|
58
|
+
[LocationEnum.Sidebar]: "400px"
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
// Scale uploaded images to this width
|
|
62
|
+
const IMAGE_WIDTH_PX = 1000;
|
|
63
|
+
const BANNER_HEIGHT = "52px";
|
|
64
|
+
// Safety rails to ensure banner and banner content do not expand
|
|
65
|
+
// and fill the entire screen
|
|
66
|
+
const MAX_BANNER_HEIGHT = "200px";
|
|
67
|
+
const MAX_BANNER_HEADLINE_HEIGHT = "180px";
|
|
68
|
+
|
|
69
|
+
var constants_ANIMATED_FIXED_ELEMENT_DATA_ATTRIBUTE = /* unused export */ undefined;
|
|
70
|
+
var constants_IMAGE_WIDTH_PX = /* unused export */ undefined;
|
|
71
|
+
export { BANNER_HEIGHT, DEFAULT_OFFERS_Z_INDEX, FOOTER_HEIGHT_CSS_VARIABLE, HEADER_HEIGHT_CSS_VARIABLE, HEADER_IGNORE_ELEMENT_DATA_ATTRIBUTE, HEADER_INCLUDE_ELEMENT_DATA_ATTRIBUTE, HOST_LOCATION_ATTRIBUTE, MAX_BANNER_HEADLINE_HEIGHT, MAX_BANNER_HEIGHT, MOBILE_THRESHOLD, MODAL_IMAGE_MAX_HEIGHTS, MODAL_IMAGE_MAX_WIDTHS, MODAL_PADDING, MODAL_WIDTHS, POPUP_OFFERS_Z_INDEX, PRIVACY_DISCLOSURE_ARIA_LABEL_PREFIX, RESIZE_THROTTLE_MS, constants_ANIMATED_FIXED_ELEMENT_DATA_ATTRIBUTE as ANIMATED_FIXED_ELEMENT_DATA_ATTRIBUTE, constants_IMAGE_WIDTH_PX as IMAGE_WIDTH_PX };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { toBase64 } from "../../../../../src/string.js";
|
|
2
|
+
import { delay as timing_delay } from "../../../../../src/timing.js";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ButtonManager {
|
|
7
|
+
handle(offer) {
|
|
8
|
+
if (!offer.isButton()) return;
|
|
9
|
+
this.context.activityEmitter.emitOfferShown({
|
|
10
|
+
offerVersionId: offer.versionId
|
|
11
|
+
});
|
|
12
|
+
offer.registerListeners({
|
|
13
|
+
onDismissClick: ()=>this.handleOfferDismiss(offer),
|
|
14
|
+
onCtaClick: (e)=>this.handleOfferClick(offer, e)
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async handleOfferDismiss(offer) {
|
|
18
|
+
await this.context.manager.remove(offer);
|
|
19
|
+
this.context.activityEmitter.emitOfferDismiss({
|
|
20
|
+
offerVersionId: offer.versionId
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async handleOfferClick(offer, event) {
|
|
24
|
+
if (!event) return;
|
|
25
|
+
const anchor = event.currentTarget;
|
|
26
|
+
if (anchor.hasAttribute("data-is-acked")) {
|
|
27
|
+
await this.context.manager.remove(offer);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// Prevent default behaviour and stop bubbling to allow tracking of the click event
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
// Prevent the event from bubbling up to the parent element
|
|
33
|
+
event.stopImmediatePropagation();
|
|
34
|
+
// Mark the event as acked to prevent duplicate tracking
|
|
35
|
+
anchor.setAttribute("data-is-acked", "true");
|
|
36
|
+
// Disable pointer events to prevent the anchor from being clicked again
|
|
37
|
+
const originalPointerEvents = anchor.style.pointerEvents;
|
|
38
|
+
anchor.style.pointerEvents = "none";
|
|
39
|
+
// Track the click event
|
|
40
|
+
this.context.activityEmitter.emitOfferClick({
|
|
41
|
+
offerVersionId: offer.versionId
|
|
42
|
+
});
|
|
43
|
+
// Wait 100ms to make sure the click event is received by the server
|
|
44
|
+
await timing_delay(100);
|
|
45
|
+
// Restore pointer events
|
|
46
|
+
anchor.style.pointerEvents = originalPointerEvents;
|
|
47
|
+
const uri = new URL(anchor.href);
|
|
48
|
+
const expiration = this.context.dateProvider.now() + 60 * 1000; // expire in 1 minute
|
|
49
|
+
const offerInfo = toBase64(JSON.stringify({
|
|
50
|
+
id: offer.versionId,
|
|
51
|
+
expiration
|
|
52
|
+
}));
|
|
53
|
+
uri.searchParams.delete("q_offer_info");
|
|
54
|
+
if (!this.offerFeatureFlags.disableQOfferInfo) uri.searchParams.append("q_offer_info", offerInfo);
|
|
55
|
+
anchor.setAttribute("href", uri.toString());
|
|
56
|
+
anchor.click();
|
|
57
|
+
}
|
|
58
|
+
constructor(context, offerFeatureFlags){
|
|
59
|
+
this.context = context;
|
|
60
|
+
this.offerFeatureFlags = offerFeatureFlags;
|
|
61
|
+
context.manager.subscribe("afterAdd", (offer)=>this.handle(offer));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { ButtonManager };
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { __webpack_require__ } from "../../../../../js/runtime.js";
|
|
2
|
+
import { _debugLog } from "../../../../../src/smart_website/utils.js";
|
|
3
|
+
import { QualifiedFormApi } from "../../../../../widget/qualified_form/qualified_form_api.js";
|
|
4
|
+
import "../rendering/lib/FormComponent.js";
|
|
5
|
+
import { toFollowupQuestionsOffer } from "../utils.js";
|
|
6
|
+
import { LocationEnum } from "../../../../../src/graphql-types.js";
|
|
7
|
+
import "../../../../../widget/utils/native_globals.js";
|
|
8
|
+
|
|
9
|
+
/* provided dependency */ var FormManager_setTimeout = __webpack_require__(68034).pS;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const LOCATIONS_WITH_FOLLOWUP_MODAL = [
|
|
16
|
+
LocationEnum.Header,
|
|
17
|
+
LocationEnum.Footer
|
|
18
|
+
];
|
|
19
|
+
// Modal disclosures are displayed when the form is rendered initially
|
|
20
|
+
const LOCATIONS_WITH_DISCLOSURE_ON_RENDER = [
|
|
21
|
+
LocationEnum.Popup,
|
|
22
|
+
LocationEnum.Sidebar
|
|
23
|
+
];
|
|
24
|
+
// Banner disclosures are displayed within a tooltip when the form is focused
|
|
25
|
+
const LOCATIONS_WITH_DISCLOSURE_ON_INPUT_FOCUS = [
|
|
26
|
+
LocationEnum.Header,
|
|
27
|
+
LocationEnum.Footer
|
|
28
|
+
];
|
|
29
|
+
class FormManager {
|
|
30
|
+
get hasActiveOffer() {
|
|
31
|
+
return this.activeOffer !== null;
|
|
32
|
+
}
|
|
33
|
+
handle(offer) {
|
|
34
|
+
if (!offer.isForm()) return;
|
|
35
|
+
this.context.activityEmitter.emitOfferShown({
|
|
36
|
+
offerVersionId: offer.versionId
|
|
37
|
+
});
|
|
38
|
+
this.registerListeners(offer);
|
|
39
|
+
}
|
|
40
|
+
registerListeners(offer) {
|
|
41
|
+
const handlePrivacyDisclosureShown = ()=>{
|
|
42
|
+
var _offer_serializedOffer;
|
|
43
|
+
return this.handlePrivacyDisclosureShown(offer, offer.versionId, (offer == null ? void 0 : (_offer_serializedOffer = offer.serializedOffer) == null ? void 0 : _offer_serializedOffer.privacyDisclosureId) || undefined);
|
|
44
|
+
};
|
|
45
|
+
if (LOCATIONS_WITH_DISCLOSURE_ON_RENDER.includes(offer.location)) {
|
|
46
|
+
handlePrivacyDisclosureShown();
|
|
47
|
+
}
|
|
48
|
+
offer.registerListeners({
|
|
49
|
+
onDismissClick: ()=>this.handleOfferDismiss(offer),
|
|
50
|
+
onFormSubmit: ()=>this.handleOfferSubmit(offer),
|
|
51
|
+
onPrivacyDisclosureShown: ()=>{
|
|
52
|
+
return LOCATIONS_WITH_DISCLOSURE_ON_INPUT_FOCUS.includes(offer.location) ? handlePrivacyDisclosureShown() : ()=>{};
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async handleOfferDismiss(offer) {
|
|
57
|
+
var _this_activeOffer;
|
|
58
|
+
if (!this.activeOffer || !this.activeOffer.is(offer) || !this.activeOffer.isCompleted) {
|
|
59
|
+
this.context.activityEmitter.emitOfferDismiss({
|
|
60
|
+
offerVersionId: offer.versionId
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if ((_this_activeOffer = this.activeOffer) == null ? void 0 : _this_activeOffer.is(offer)) {
|
|
64
|
+
this.resumeAllFormOffers();
|
|
65
|
+
this.activeOffer = null;
|
|
66
|
+
}
|
|
67
|
+
await this.context.manager.remove(offer);
|
|
68
|
+
}
|
|
69
|
+
async handleOfferSubmit(offer) {
|
|
70
|
+
var _this_activeOffer, _offer_serializedOffer;
|
|
71
|
+
// Handle close button click
|
|
72
|
+
if (((_this_activeOffer = this.activeOffer) == null ? void 0 : _this_activeOffer.state.current) === (/* inlined export .FormState.End */"end")) {
|
|
73
|
+
await this.handleOfferDismiss(offer);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (this.activeOffer && !this.activeOffer.is(offer)) {
|
|
77
|
+
this.debugLog("Cannot submit form while another form is in progress");
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (!this.activeOffer) {
|
|
81
|
+
this.activeOffer = new ActiveOffer(offer, this.context);
|
|
82
|
+
this.pauseAllFormOffers();
|
|
83
|
+
}
|
|
84
|
+
await this.activeOffer.handleSubmission();
|
|
85
|
+
this.handlePrivacyDisclosureConsented(offer.versionId, (offer == null ? void 0 : (_offer_serializedOffer = offer.serializedOffer) == null ? void 0 : _offer_serializedOffer.privacyDisclosureId) || undefined);
|
|
86
|
+
}
|
|
87
|
+
handlePrivacyDisclosureShown(offer, offerVersionId, privacyDisclosureId) {
|
|
88
|
+
if (offerVersionId && privacyDisclosureId) {
|
|
89
|
+
if (this.offerVersionIdToShownPrivacyDisclosureId[offerVersionId]) return;
|
|
90
|
+
this.offerVersionIdToShownPrivacyDisclosureId[offerVersionId] = privacyDisclosureId;
|
|
91
|
+
this.context.activityEmitter.emitPrivacyDisclosureShown({
|
|
92
|
+
offerVersionId: offerVersionId,
|
|
93
|
+
privacyDisclosureId: privacyDisclosureId
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
// Accessibility callout: this allows us to programmatically focus the tooltip after pressing tab within email input.
|
|
97
|
+
// This ensures keyboard users can tab into the tooltip and access links within it.
|
|
98
|
+
if ((offer == null ? void 0 : offer.getEmailFormInput()) && (offer == null ? void 0 : offer.getPrivacyDisclosureTooltip())) {
|
|
99
|
+
const emailFormInput = offer.getEmailFormInput();
|
|
100
|
+
const privacyDisclosureTooltip = offer.getPrivacyDisclosureTooltip();
|
|
101
|
+
emailFormInput.tabIndex = 0;
|
|
102
|
+
privacyDisclosureTooltip.tabIndex = -1;
|
|
103
|
+
emailFormInput.addEventListener("keydown", (event)=>{
|
|
104
|
+
if (event.key === "Tab" && !event.shiftKey) {
|
|
105
|
+
// Temporary fix display to "flex" and force tooltip to be visible, because you cannot focus on hidden elements
|
|
106
|
+
privacyDisclosureTooltip.style.display = "flex";
|
|
107
|
+
privacyDisclosureTooltip.focus();
|
|
108
|
+
privacyDisclosureTooltip.style.display = "";
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
handlePrivacyDisclosureConsented(offerVersionId, privacyDisclosureId) {
|
|
114
|
+
if (offerVersionId && privacyDisclosureId) {
|
|
115
|
+
this.context.activityEmitter.emitPrivacyDisclosureConsented({
|
|
116
|
+
offerVersionId: offerVersionId,
|
|
117
|
+
privacyDisclosureId: privacyDisclosureId
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
pauseAllFormOffers() {
|
|
122
|
+
if (!this.activeOffer) return;
|
|
123
|
+
this.context.manager.pause();
|
|
124
|
+
for (const offer of this.context.manager.offers){
|
|
125
|
+
if (offer.isForm() && !this.activeOffer.is(offer)) {
|
|
126
|
+
offer.disableForm();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
resumeAllFormOffers() {
|
|
131
|
+
for (const offer of this.context.manager.offers){
|
|
132
|
+
offer.isForm() && offer.enableForm();
|
|
133
|
+
}
|
|
134
|
+
this.context.manager.resume();
|
|
135
|
+
}
|
|
136
|
+
debugLog(msg, context) {
|
|
137
|
+
_debugLog("[form-manager] " + msg, context);
|
|
138
|
+
}
|
|
139
|
+
constructor(context){
|
|
140
|
+
this.context = context;
|
|
141
|
+
this.activeOffer = null;
|
|
142
|
+
this.offerVersionIdToShownPrivacyDisclosureId = {};
|
|
143
|
+
this.context.manager.subscribe("afterAdd", (offer)=>this.handle(offer));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
class ActiveOffer {
|
|
147
|
+
get state() {
|
|
148
|
+
return this.offer.state;
|
|
149
|
+
}
|
|
150
|
+
get isCompleted() {
|
|
151
|
+
return this._isCompleted;
|
|
152
|
+
}
|
|
153
|
+
is(offer) {
|
|
154
|
+
return this.offer === offer;
|
|
155
|
+
}
|
|
156
|
+
async handleSubmission() {
|
|
157
|
+
if (this.state.loading || this.state.current === (/* inlined export .FormState.End */"end")) {
|
|
158
|
+
this.debugLog("Cannot submit form in state " + this.state);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
switch(this.state.current){
|
|
162
|
+
case (/* inlined export .FormState.EmailCapture */"emailCapture"):
|
|
163
|
+
await this.handleEmailSubmission();
|
|
164
|
+
break;
|
|
165
|
+
case (/* inlined export .FormState.FollowupQuestions */"followupQuestions"):
|
|
166
|
+
await this.handleFollowupQuestionsSubmission();
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
async handleEmailSubmission() {
|
|
171
|
+
const email = this.offer.getEmailInputValue();
|
|
172
|
+
if (!email) {
|
|
173
|
+
this.offer.setState({
|
|
174
|
+
current: (/* inlined export .FormState.EmailCapture */"emailCapture"),
|
|
175
|
+
error: "Please enter a valid email"
|
|
176
|
+
});
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const response = this.qualifiedFormApi.submitEmail(email);
|
|
180
|
+
if (!response.success) {
|
|
181
|
+
let error;
|
|
182
|
+
switch(response.error){
|
|
183
|
+
case (/* inlined export .EmailError.EMPTY */"empty"):
|
|
184
|
+
case (/* inlined export .EmailError.INVALID */"invalid"):
|
|
185
|
+
error = "Please enter a valid email.";
|
|
186
|
+
break;
|
|
187
|
+
case (/* inlined export .EmailError.NON_BUSINESS */"non_business"):
|
|
188
|
+
error = "Please provide a business email.";
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
this.offer.setState({
|
|
192
|
+
current: (/* inlined export .FormState.EmailCapture */"emailCapture"),
|
|
193
|
+
email,
|
|
194
|
+
error
|
|
195
|
+
});
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
this.context.activityEmitter.emitOfferClick({
|
|
199
|
+
offerVersionId: this.offer.versionId
|
|
200
|
+
});
|
|
201
|
+
this.offer.setState({
|
|
202
|
+
current: (/* inlined export .FormState.EmailCapture */"emailCapture"),
|
|
203
|
+
email,
|
|
204
|
+
loading: true
|
|
205
|
+
});
|
|
206
|
+
const { form, action } = await response.result;
|
|
207
|
+
this.followupQuestionsForm = form;
|
|
208
|
+
if (!this.offer.isOnScreen()) {
|
|
209
|
+
// Offer was dismissed before the form was loaded
|
|
210
|
+
// We might want to track this metric in the future
|
|
211
|
+
if (!form) {
|
|
212
|
+
// No followup questions, so we can mark the offer as completed
|
|
213
|
+
this.markAsCompleted();
|
|
214
|
+
}
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
// This is already handled by the backend
|
|
218
|
+
if (!form) {
|
|
219
|
+
this.markAsCompleted();
|
|
220
|
+
this.handleEndAction(await action);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
await this.transitionToFollowupQuestions();
|
|
224
|
+
}
|
|
225
|
+
async handleFollowupQuestionsSubmission() {
|
|
226
|
+
if (!this.followupQuestionsForm) return;
|
|
227
|
+
const entries = this.offer.getFormValues(...this.followupQuestionsForm.inputFields.map((field)=>field.name));
|
|
228
|
+
if (!entries) return;
|
|
229
|
+
const result = this.qualifiedFormApi.submitFollowUpQuestions(entries);
|
|
230
|
+
if (result.success) {
|
|
231
|
+
this.markAsCompleted();
|
|
232
|
+
this.offer.setState({
|
|
233
|
+
current: (/* inlined export .FormState.FollowupQuestions */"followupQuestions"),
|
|
234
|
+
email: this.offer.state.email,
|
|
235
|
+
loading: true
|
|
236
|
+
}, {
|
|
237
|
+
animate: true
|
|
238
|
+
});
|
|
239
|
+
const action = await result.action;
|
|
240
|
+
if (!this.offer.isOnScreen()) {
|
|
241
|
+
// Offer was dismissed before the action was received
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this.handleEndAction(action);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
this.offer.setState({
|
|
248
|
+
current: (/* inlined export .FormState.FollowupQuestions */"followupQuestions"),
|
|
249
|
+
email: this.offer.state.email,
|
|
250
|
+
errors: result.errors
|
|
251
|
+
}, {
|
|
252
|
+
animate: true
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
markAsCompleted() {
|
|
256
|
+
if (this._isCompleted) return;
|
|
257
|
+
this._isCompleted = true;
|
|
258
|
+
this.context.activityEmitter.emitFormFill({
|
|
259
|
+
formType: "offer",
|
|
260
|
+
offerVersionId: this.offer.versionId
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
handleEndAction(action) {
|
|
264
|
+
if (action.type === (/* inlined export .EndActionType.WIDGET */"widget")) {
|
|
265
|
+
this.offer.dismiss();
|
|
266
|
+
} else if (action.type === (/* inlined export .EndActionType.REDIRECT */"redirect") && action.url) {
|
|
267
|
+
window.location.href = action.url;
|
|
268
|
+
} else {
|
|
269
|
+
this.transitionToEnd({
|
|
270
|
+
dismiss: LOCATIONS_WITH_FOLLOWUP_MODAL.includes(this.offer.location)
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
transitionToEnd(param) {
|
|
275
|
+
let { dismiss = false } = param === void 0 ? {} : param;
|
|
276
|
+
if (dismiss) FormManager_setTimeout(()=>this.offer.dismiss(), 1000);
|
|
277
|
+
const state = {
|
|
278
|
+
current: (/* inlined export .FormState.End */"end"),
|
|
279
|
+
email: this.offer.state.email
|
|
280
|
+
};
|
|
281
|
+
const animatedLocations = [
|
|
282
|
+
LocationEnum.Popup,
|
|
283
|
+
LocationEnum.Sidebar
|
|
284
|
+
];
|
|
285
|
+
const animate = animatedLocations.includes(this.offer.location);
|
|
286
|
+
this.offer.setState(state, {
|
|
287
|
+
animate
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
async transitionToFollowupQuestions() {
|
|
291
|
+
if (!this.followupQuestionsForm) return;
|
|
292
|
+
this.offer.setState({
|
|
293
|
+
current: (/* inlined export .FormState.FollowupQuestions */"followupQuestions"),
|
|
294
|
+
form: this.followupQuestionsForm,
|
|
295
|
+
email: this.offer.state.email
|
|
296
|
+
}, {
|
|
297
|
+
animate: !LOCATIONS_WITH_FOLLOWUP_MODAL.includes(this.offer.location)
|
|
298
|
+
});
|
|
299
|
+
if (LOCATIONS_WITH_FOLLOWUP_MODAL.includes(this.offer.location)) {
|
|
300
|
+
await this.offer.update(toFollowupQuestionsOffer(this.offer.serializedOffer), {
|
|
301
|
+
animate: true,
|
|
302
|
+
copyListeners: true,
|
|
303
|
+
copyState: true
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
debugLog(msg, context) {
|
|
308
|
+
_debugLog("[offer-main-script] " + msg, context);
|
|
309
|
+
}
|
|
310
|
+
constructor(offer, context){
|
|
311
|
+
this.offer = offer;
|
|
312
|
+
this.context = context;
|
|
313
|
+
this.followupQuestionsForm = null;
|
|
314
|
+
this._isCompleted = false;
|
|
315
|
+
this.qualifiedFormApi = new QualifiedFormApi({
|
|
316
|
+
source: (/* inlined export .QualifiedFormSource.OFFERS */"offers"),
|
|
317
|
+
config: offer.qualifiedFormConfig,
|
|
318
|
+
channel: this.context.channel,
|
|
319
|
+
iframeManager: this.context.iframeManager,
|
|
320
|
+
offerId: this.offer.serializedOffer.id
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export { FormManager };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { tryGet } from "../../../../../src/utils.js";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class MainContext {
|
|
5
|
+
get iframeManager() {
|
|
6
|
+
var _tryGet;
|
|
7
|
+
return (_tryGet = tryGet(()=>this.getIframeManager())) != null ? _tryGet : null;
|
|
8
|
+
}
|
|
9
|
+
// eslint-disable-next-line no-useless-constructor
|
|
10
|
+
constructor(activityEmitter, dateProvider, channel, manager, getIframeManager){
|
|
11
|
+
this.activityEmitter = activityEmitter;
|
|
12
|
+
this.dateProvider = dateProvider;
|
|
13
|
+
this.channel = channel;
|
|
14
|
+
this.manager = manager;
|
|
15
|
+
this.getIframeManager = getIframeManager;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { MainContext };
|