@hhgtech/hhg-components 1.29.481-beta-1 → 1.29.481
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/build/{InputDate-3636db90.js → InputDate-aa02d9a5.js} +5 -5
- package/build/{LastPeriod-b174d087.js → LastPeriod-543ccfea.js} +1 -1
- package/build/{MobileBottomNavigationIcon-3282e68d.js → MobileBottomNavigationIcon-7f30516d.js} +3 -3
- package/build/{Spinner-43a43219.js → Spinner-4e5067bf.js} +1 -1
- package/build/{WhatsApp-4e8363c9.js → WhatsApp-cd094714.js} +1 -1
- package/build/adapters.js +20 -20
- package/build/atoms.js +50 -50
- package/build/babyGrowth.js +86 -86
- package/build/cache.js +2 -2
- package/build/care.js +18 -18
- package/build/careBookingSearchBar.js +14 -14
- package/build/careBookingSearchBarV2.js +15 -15
- package/build/components/atoms/imageUpload/ImageUpload.types.d.ts +1 -1
- package/build/components/molecules/cardListItem/index.styled.d.ts +0 -3
- package/build/components/molecules/index.d.ts +0 -1
- package/build/components/molecules/toolBannerCard/index.d.ts +1 -2
- package/build/components/molecules/toolBannerCard/index.styles.d.ts +0 -1
- package/build/components.js +104 -105
- package/build/{constants-57cacb02.js → constants-ec0ad7eb.js} +1 -1
- package/build/constants.js +3 -3
- package/build/constantsDomainLocales.js +1 -1
- package/build/constantsRiskScreener.js +2 -2
- package/build/constantsSite.js +2 -2
- package/build/{core-6e43ff94.js → core-4caf0281.js} +1 -1
- package/build/{dataTransform-44fe5a27.js → dataTransform-4f16bc3b.js} +1 -1
- package/build/ecom.js +5 -5
- package/build/{editor-27e8ed3a.js → editor-99238f87.js} +11 -11
- package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
- package/build/embeddedHeathToolCards_babyPoop.js +23 -23
- package/build/embeddedHeathToolCards_babyVaccine.js +25 -25
- package/build/embeddedHeathToolCards_bmi_bmi.js +30 -30
- package/build/embeddedHeathToolCards_bmrBmr.js +28 -28
- package/build/embeddedHeathToolCards_dueDate_dueDate.js +25 -25
- package/build/embeddedHeathToolCards_ovulation_ovulation.js +25 -25
- package/build/embeddedHeathToolCards_pwg_pwg.js +29 -29
- package/build/embeddedHeathToolCards_targetHeartRate.js +30 -30
- package/build/esm/{InputDate-079946dd.js → InputDate-a808832c.js} +5 -5
- package/build/esm/{LastPeriod-10794941.js → LastPeriod-7df0e40c.js} +1 -1
- package/build/esm/{MobileBottomNavigationIcon-9f87bc11.js → MobileBottomNavigationIcon-f9a7b2c5.js} +3 -3
- package/build/esm/{Spinner-318c3595.js → Spinner-e1d5632b.js} +1 -1
- package/build/esm/{WhatsApp-9de799dd.js → WhatsApp-b750f3fa.js} +1 -1
- package/build/esm/adapters.js +20 -20
- package/build/esm/atoms.js +50 -50
- package/build/esm/babyGrowth.js +86 -86
- package/build/esm/cache.js +2 -2
- package/build/esm/care.js +18 -18
- package/build/esm/careBookingSearchBar.js +14 -14
- package/build/esm/careBookingSearchBarV2.js +15 -15
- package/build/esm/components/atoms/imageUpload/ImageUpload.types.d.ts +1 -1
- package/build/esm/components/molecules/cardListItem/index.styled.d.ts +0 -3
- package/build/esm/components/molecules/index.d.ts +0 -1
- package/build/esm/components/molecules/toolBannerCard/index.d.ts +1 -2
- package/build/esm/components/molecules/toolBannerCard/index.styles.d.ts +0 -1
- package/build/esm/components.js +104 -104
- package/build/esm/{constants-e7102a1f.js → constants-62fa0540.js} +1 -1
- package/build/esm/constants.js +3 -3
- package/build/esm/constantsDomainLocales.js +1 -1
- package/build/esm/constantsRiskScreener.js +2 -2
- package/build/esm/constantsSite.js +2 -2
- package/build/esm/{core-aaf7165a.js → core-61f7753e.js} +1 -1
- package/build/esm/{dataTransform-ef2b9b5e.js → dataTransform-06069b17.js} +1 -1
- package/build/esm/ecom.js +5 -5
- package/build/esm/{editor-8a8575fe.js → editor-5f33212f.js} +11 -11
- package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
- package/build/esm/embeddedHeathToolCards_babyPoop.js +23 -23
- package/build/esm/embeddedHeathToolCards_babyVaccine.js +25 -25
- package/build/esm/embeddedHeathToolCards_bmi_bmi.js +30 -30
- package/build/esm/embeddedHeathToolCards_bmrBmr.js +28 -28
- package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +25 -25
- package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +25 -25
- package/build/esm/embeddedHeathToolCards_pwg_pwg.js +29 -29
- package/build/esm/embeddedHeathToolCards_targetHeartRate.js +30 -30
- package/build/esm/footer.js +22 -22
- package/build/esm/gAssets.js +2 -2
- package/build/esm/{healthTools-5be0b7ab.js → healthTools-df7d3d42.js} +1 -1
- package/build/esm/healthToolsCardWrapper.js +21 -21
- package/build/esm/healthToolsForm.js +35 -35
- package/build/esm/hooks.js +13 -13
- package/build/esm/i18n.js +2 -2
- package/build/esm/i18nV2.js +2 -2
- package/build/esm/{index-1fef967e.js → index-032b480f.js} +2 -2
- package/build/esm/{index-12f1afb0.js → index-07238cdd.js} +6 -6
- package/build/esm/{index-60f23445.js → index-09b790a7.js} +3 -3
- package/build/esm/{index-4e2cb08c.js → index-0c3d2686.js} +4 -4
- package/build/esm/{index-6e7b983e.js → index-1132ec9b.js} +17 -17
- package/build/esm/{index-710dbed9.js → index-146a6ed0.js} +1 -1
- package/build/esm/{index-1579fb4a.js → index-14b3401c.js} +22 -22
- package/build/esm/{index-7f25e440.js → index-16504c90.js} +27 -27
- package/build/esm/{index-de037937.js → index-1e726ac4.js} +2 -2
- package/build/esm/{index-1163c2a2.js → index-1e80c3fb.js} +3 -3
- package/build/esm/{index-ff2de97f.js → index-1f9403e6.js} +5 -5
- package/build/esm/{index-8014bad7.js → index-209091c1.js} +6 -6
- package/build/esm/{index-de2af0b4.js → index-2366ac67.js} +16 -16
- package/build/esm/{index-20327942.js → index-23e88e31.js} +14 -14
- package/build/esm/{index-e66d5d69.js → index-257784e5.js} +1 -1
- package/build/esm/index-2893c22f.js +16 -0
- package/build/esm/{index-9a48dac8.js → index-31186afa.js} +1 -1
- package/build/esm/{index-6dd86cd9.js → index-376fae17.js} +2 -2
- package/build/esm/{index-d31fc929.js → index-3a3b322f.js} +3 -3
- package/build/esm/{index-a498fd7d.js → index-3e76e93c.js} +2 -2
- package/build/esm/{index-128ed9aa.js → index-48481573.js} +3 -3
- package/build/esm/{index-b69cdfa7.js → index-4b3ad3ae.js} +8 -8
- package/build/esm/{index-d61477fa.js → index-4bdbfe70.js} +32 -32
- package/build/esm/{index-b1d570a3.js → index-4d4a9120.js} +3 -3
- package/build/esm/{index-1b504848.js → index-507ba61a.js} +15 -15
- package/build/esm/{index-e706949e.js → index-57916c0e.js} +2 -2
- package/build/esm/{index-eb94a71a.js → index-5996b05c.js} +7 -7
- package/build/esm/{index-c9d4fec6.js → index-59ce3a76.js} +15 -15
- package/build/esm/{index-86c4e157.js → index-59ede64d.js} +21 -21
- package/build/esm/{index-efeea0c7.js → index-5e8a6d61.js} +2 -2
- package/build/esm/{index-00f9a478.js → index-5f919c50.js} +18 -18
- package/build/esm/{index-6fe71184.js → index-69e990a8.js} +32 -32
- package/build/esm/{index-9074ab66.js → index-6d63d999.js} +8 -8
- package/build/esm/{index-290f0108.js → index-6e6a61c1.js} +2 -2
- package/build/esm/{index-5b3a19e7.js → index-711e22b3.js} +2 -2
- package/build/esm/{index-fd102d9a.js → index-7958499c.js} +16 -23
- package/build/esm/{index-3048e729.js → index-81775e00.js} +18 -18
- package/build/esm/{index-4970f0eb.js → index-82e7dcdf.js} +4 -4
- package/build/esm/{index-36762bfa.js → index-84cc353f.js} +25 -25
- package/build/esm/{index-b7068c0c.js → index-85185164.js} +9 -9
- package/build/esm/{index-cefc18e4.js → index-8be82feb.js} +11 -11
- package/build/esm/{index-2969860a.js → index-8c0ef0e7.js} +19 -19
- package/build/esm/{index-8a437344.js → index-8e23d685.js} +2 -2
- package/build/esm/{index-30fe58af.js → index-8e7da2c3.js} +1 -1
- package/build/esm/{index-9fea046c.js → index-8f569603.js} +2 -2
- package/build/esm/{index-cd3cd772.js → index-933ce739.js} +6 -6
- package/build/esm/{index-89005c6a.js → index-a36a9447.js} +21 -21
- package/build/esm/{index-b02a244f.js → index-a4de248d.js} +2 -2
- package/build/esm/{index-1061cb45.js → index-a56b42ef.js} +2 -2
- package/build/esm/{index-bb5a4249.js → index-a871943b.js} +16 -16
- package/build/esm/{index-feeab0f7.js → index-a99d6645.js} +6 -6
- package/build/esm/{index-532adc6e.js → index-b0b19577.js} +30 -30
- package/build/esm/{index-de47f2b2.js → index-b81e787f.js} +2 -2
- package/build/esm/{index-8a11f382.js → index-c3a52528.js} +1 -1
- package/build/esm/{index-25f1014a.js → index-c7ebd761.js} +7 -7
- package/build/esm/{index-1365ef94.js → index-c8465d3a.js} +3 -3
- package/build/esm/{index-1a606e96.js → index-c945f7e2.js} +3 -3
- package/build/esm/{index-376b6321.js → index-ca6313b7.js} +1 -1
- package/build/esm/{index-9838dcc4.js → index-da553b67.js} +13 -13
- package/build/esm/{index-2300eb11.js → index-da888d7e.js} +14 -14
- package/build/esm/{index-59bbc7ed.js → index-de4985b4.js} +2 -2
- package/build/esm/{index-fcaa6554.js → index-e0d1553d.js} +14 -14
- package/build/esm/{index-085dc2ae.js → index-e1dcea6e.js} +2 -2
- package/build/esm/{index-35303540.js → index-e46ed082.js} +3 -3
- package/build/esm/{index-b90d6623.js → index-e863697a.js} +10 -10
- package/build/esm/{index-11537c7e.js → index-e8e2e7e2.js} +5 -5
- package/build/esm/{index-6d933a31.js → index-eb104df2.js} +1 -1
- package/build/esm/{index-c53f83d3.js → index-f1c71313.js} +13 -13
- package/build/esm/{index-e0495a88.js → index-f33317d1.js} +16 -16
- package/build/esm/{index-28284662.js → index-f4068f14.js} +16 -16
- package/build/esm/{index-b6ab7c48.js → index-f57b5c1f.js} +2 -2
- package/build/esm/{index-01317ff2.js → index-fde3116a.js} +2 -2
- package/build/esm/index.js +124 -124
- package/build/esm/{labelSorting-275277e5.js → labelSorting-cc033bf5.js} +4 -4
- package/build/esm/lead/LeadGenTranslationContext.d.ts +13 -2
- package/build/esm/lead/index.d.ts +2 -0
- package/build/esm/lead.js +990 -977
- package/build/esm/{logoIcon-89c6ed30.js → logoIcon-1376b9f8.js} +2 -2
- package/build/esm/mantine.js +29 -38
- package/build/esm/misc.js +19 -19
- package/build/esm/miscGetDynamicHealthTool.js +4 -4
- package/build/esm/miscGetSocialList.js +8 -8
- package/build/esm/miscScreenSizeContext.js +1 -1
- package/build/esm/mobileBottomNavigation.js +5 -5
- package/build/esm/mobileBottomNavigationIcon.js +5 -5
- package/build/esm/molecules.js +78 -78
- package/build/esm/moleculesArticleCard.js +6 -6
- package/build/esm/moleculesArticleCardV2.js +17 -17
- package/build/esm/navigation.js +47 -47
- package/build/esm/navigationLogoutPopup.js +11 -11
- package/build/esm/navigationProfileButton.js +27 -27
- package/build/esm/onboardingV2.js +30 -30
- package/build/esm/organisms.js +57 -57
- package/build/esm/{post-113ee38e.js → post-8eca589f.js} +2 -2
- package/build/esm/profileNavigation.js +20 -20
- package/build/esm/progressBar.js +1 -1
- package/build/esm/pwg.js +23 -23
- package/build/esm/ssoV2.js +31 -40
- package/build/esm/{store-2faecd11.js → store-0d8b6df6.js} +3 -3
- package/build/esm/subot/hooks/useVerifyPhoneNumber.d.ts +1 -0
- package/build/esm/subot/index.d.ts +1 -0
- package/build/esm/subot/subotInline/assets/arrow-down.d.ts +3 -0
- package/build/esm/subot/subotInline/assets/arrow-left.d.ts +3 -0
- package/build/esm/subot/subotInline/assets/arrow-right.d.ts +3 -0
- package/build/esm/subot/subotInline/assets/arrow-up.d.ts +3 -0
- package/build/esm/subot/subotInline/assets/check.d.ts +3 -0
- package/build/esm/subot/subotInline/assets/checkbox.d.ts +3 -0
- package/build/esm/subot/subotInline/assets/chevronRightActive.d.ts +3 -0
- package/build/esm/subot/subotInline/assets/dislike-article.d.ts +3 -0
- package/build/esm/subot/subotInline/assets/index.d.ts +10 -0
- package/build/esm/subot/subotInline/assets/like-article.d.ts +3 -0
- package/build/esm/subot/subotInline/assets/rotate-left.d.ts +3 -0
- package/build/esm/subot/subotInline/index.d.ts +4 -0
- package/build/esm/subot/subotInline/index.styled.d.ts +67 -0
- package/build/esm/subot/subotInline/subotInline.config.d.ts +38 -0
- package/build/esm/subot/subotInline/subotInlineAction/index.d.ts +25 -0
- package/build/esm/subot/subotInline/subotInlineAction/subotInlineAction.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineAction/subotInlineAction.styled.d.ts +54 -0
- package/build/esm/subot/subotInline/subotInlineFooter.d.ts +17 -0
- package/build/esm/subot/subotInline/subotInlineHeader.d.ts +3 -0
- package/build/esm/subot/subotInline/subotInlineIntent/index.d.ts +100 -0
- package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntent.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntent.styled.d.ts +159 -0
- package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntentFinal.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/SubotInlineNodeResultPoll.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/index.d.ts +15 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNode.d.ts +5 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNode.styled.d.ts +74 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeFinal.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeFinalThankYou.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeForm.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeImage.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeMultiple.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeOTP.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodePoll.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeRating.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeReaction.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeReview.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeSSO.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeStart.d.ts +4 -0
- package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeText.d.ts +4 -0
- package/build/esm/subot/subotInlineRevamp/context.d.ts +1 -1
- package/build/esm/subot/subotInlineRevamp/types.d.ts +2 -0
- package/build/esm/subot.js +3266 -112
- package/build/esm/surveyOrPremiumBanner.js +34 -34
- package/build/esm/surveyQuestionCard.js +11 -11
- package/build/esm/{surveyThankyouCard-b3dda5e9.js → surveyThankyouCard-65d1a136.js} +5 -5
- package/build/esm/together/togetherComponentGlobalContext.d.ts +2 -0
- package/build/esm/together.js +57 -57
- package/build/esm/togetherApiUtils.js +4 -4
- package/build/esm/togetherAtoms.js +31 -31
- package/build/esm/togetherComponentGlobalContext.js +4 -4
- package/build/esm/togetherMolecules.js +52 -52
- package/build/esm/togetherMoleculesCardAuthor.js +29 -29
- package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
- package/build/esm/togetherMoleculesProfileDetail.js +40 -40
- package/build/esm/togetherOrganisms.js +51 -51
- package/build/esm/togetherRichTextEditor.js +18 -18
- package/build/esm/togetherShareBox.js +10 -10
- package/build/esm/{translationsProvider-3ef6cba4.js → translationsProvider-ae869aee.js} +1 -1
- package/build/esm/{treePopoverMenu-d34b533f.js → treePopoverMenu-587e898a.js} +19 -19
- package/build/esm/types.js +2 -2
- package/build/esm/{useHealthToolCache-4628e2d9.js → useHealthToolCache-0a28ec43.js} +1 -1
- package/build/esm/{usePhoneValidator-9a8713f4.js → usePhoneValidator-40b60db1.js} +5 -5
- package/build/esm/{usePlacesAutocomplete-021fa87d.js → usePlacesAutocomplete-51e606e2.js} +1 -1
- package/build/esm/useTogetherAuthRequiredAction.js +10 -10
- package/build/esm/{utils-3a1412da.js → utils-0152f899.js} +3 -3
- package/build/esm/{utils-b5c1cfce.js → utils-33eee6d7.js} +5 -5
- package/build/esm/{utils-93d8e3fa.js → utils-72f73e2c.js} +2 -2
- package/build/esm/{utils-da7ecec9.js → utils-a362ad3e.js} +2 -2
- package/build/esm/vaccination.js +22 -22
- package/build/footer.js +22 -22
- package/build/gAssets.js +2 -2
- package/build/{healthTools-eb1ccbaa.js → healthTools-4e928273.js} +1 -1
- package/build/healthToolsCardWrapper.js +21 -21
- package/build/healthToolsForm.js +35 -35
- package/build/hooks.js +13 -13
- package/build/i18n.js +2 -2
- package/build/i18nV2.js +1 -1
- package/build/{index-93f25936.js → index-00ce34fe.js} +2 -2
- package/build/{index-10510354.js → index-039f1cdd.js} +2 -2
- package/build/{index-fa267608.js → index-03cd71e0.js} +9 -9
- package/build/{index-77e110f2.js → index-048722ab.js} +3 -3
- package/build/{index-ed1cc4e2.js → index-04c7b02e.js} +19 -19
- package/build/{index-1990eff6.js → index-0570f20a.js} +4 -4
- package/build/{index-9d556b03.js → index-08ca673f.js} +13 -13
- package/build/{index-cbbe9fd6.js → index-0e18bc17.js} +11 -11
- package/build/{index-557c5f8f.js → index-0fa224ce.js} +5 -5
- package/build/{index-deef3fa2.js → index-28cbf6d6.js} +27 -27
- package/build/{index-6e698a28.js → index-2937f4a2.js} +2 -2
- package/build/{index-a2d51632.js → index-2b16774c.js} +2 -2
- package/build/{index-5f28a730.js → index-2ecc215c.js} +6 -6
- package/build/{index-53be3962.js → index-2f7adb56.js} +1 -1
- package/build/{index-7ac974c0.js → index-3148672d.js} +16 -23
- package/build/{index-873b4bbd.js → index-32c973eb.js} +6 -6
- package/build/{index-a9a8c672.js → index-34a55146.js} +13 -13
- package/build/{index-51ffa1f5.js → index-366354c9.js} +1 -1
- package/build/{index-ceb84907.js → index-3d4023fb.js} +2 -2
- package/build/{index-cfd06798.js → index-3ddcceda.js} +5 -5
- package/build/{index-1fa4b47c.js → index-4097159b.js} +2 -2
- package/build/{index-d358b040.js → index-4101fdc2.js} +2 -2
- package/build/{index-63bbd42f.js → index-4183a3a2.js} +3 -3
- package/build/{index-791182a1.js → index-487227c1.js} +3 -3
- package/build/{index-9a380531.js → index-4ef9e32d.js} +25 -25
- package/build/{index-d261736c.js → index-4f881245.js} +3 -3
- package/build/{index-d0f41c3e.js → index-536b962f.js} +1 -1
- package/build/{index-0f673f3e.js → index-594a5310.js} +22 -22
- package/build/{index-2de1864d.js → index-5ab55624.js} +3 -3
- package/build/{index-b5ecd965.js → index-5b509361.js} +30 -30
- package/build/{index-cee44178.js → index-64be8d38.js} +14 -14
- package/build/{index-d62a7634.js → index-67dba9e9.js} +2 -2
- package/build/{index-9e5ce0e6.js → index-68051107.js} +15 -15
- package/build/{index-5e40aac1.js → index-69f935ae.js} +2 -2
- package/build/{index-bccc21a1.js → index-6c769047.js} +16 -16
- package/build/{index-fb3512d4.js → index-6e4020ea.js} +32 -32
- package/build/{index-cd311f41.js → index-6f281db1.js} +17 -17
- package/build/{index-cb712595.js → index-730a49cd.js} +7 -7
- package/build/index-787cf506.js +22 -0
- package/build/{index-bf71ce85.js → index-78d3b311.js} +1 -1
- package/build/{index-84dd735a.js → index-7a8db159.js} +2 -2
- package/build/{index-bc198dc9.js → index-7fc51c71.js} +32 -32
- package/build/{index-d0a6e634.js → index-803e0a7c.js} +21 -21
- package/build/{index-65c15d7a.js → index-83965296.js} +7 -7
- package/build/{index-56eb63a6.js → index-8c1779dd.js} +2 -2
- package/build/{index-80a12b26.js → index-8dd7dcd9.js} +2 -2
- package/build/{index-bfe6ddd3.js → index-970be111.js} +16 -16
- package/build/{index-9b546f20.js → index-9a36414e.js} +2 -2
- package/build/{index-6ea7e7e4.js → index-9e41dc44.js} +3 -3
- package/build/{index-0912b470.js → index-9ec9f9d4.js} +8 -8
- package/build/{index-12b629e2.js → index-a3e73281.js} +16 -16
- package/build/{index-62e5d1e3.js → index-a44ea4a0.js} +2 -2
- package/build/{index-5eca0f42.js → index-a856b835.js} +1 -1
- package/build/{index-7ebed188.js → index-ab0d74e9.js} +16 -16
- package/build/{index-b47ef442.js → index-ac4131bc.js} +10 -10
- package/build/{index-269e78e9.js → index-b2ac64db.js} +6 -6
- package/build/{index-8e63f13c.js → index-b8e1973a.js} +18 -18
- package/build/{index-64bd65c9.js → index-bb307a67.js} +14 -14
- package/build/{index-61e566ec.js → index-bc6437d1.js} +1 -1
- package/build/{index-bb84cb93.js → index-bf2cd97d.js} +3 -3
- package/build/{index-77d6cac2.js → index-c06fecd6.js} +8 -8
- package/build/{index-3c04e011.js → index-cdda0a00.js} +21 -21
- package/build/{index-a5fe038e.js → index-dbee5fb8.js} +18 -18
- package/build/{index-d5152845.js → index-e5cfd8f1.js} +15 -15
- package/build/{index-6ef4a34b.js → index-eb8ad24a.js} +2 -2
- package/build/{index-0c19cba5.js → index-eb99ce41.js} +2 -2
- package/build/{index-85d181d3.js → index-ebf45408.js} +14 -14
- package/build/{index-df13a45e.js → index-ef150e32.js} +1 -1
- package/build/{index-cffc4281.js → index-f0e815f1.js} +2 -2
- package/build/{index-0a414c91.js → index-f3413db7.js} +6 -6
- package/build/{index-0b3bce7a.js → index-f3e6d350.js} +4 -4
- package/build/{index-fdf1f740.js → index-fe41a2b8.js} +3 -3
- package/build/index.js +124 -125
- package/build/{labelSorting-e6690d6d.js → labelSorting-9da05440.js} +4 -4
- package/build/lead/LeadGenTranslationContext.d.ts +13 -2
- package/build/lead/index.d.ts +2 -0
- package/build/lead.js +989 -976
- package/build/{logoIcon-db460765.js → logoIcon-17e1116c.js} +2 -2
- package/build/mantine.js +40 -48
- package/build/misc.js +19 -19
- package/build/miscGetDynamicHealthTool.js +4 -4
- package/build/miscGetSocialList.js +8 -8
- package/build/miscScreenSizeContext.js +1 -1
- package/build/mobileBottomNavigation.js +5 -5
- package/build/mobileBottomNavigationIcon.js +5 -5
- package/build/molecules.js +78 -79
- package/build/moleculesArticleCard.js +6 -6
- package/build/moleculesArticleCardV2.js +17 -17
- package/build/navigation.js +47 -47
- package/build/navigationLogoutPopup.js +11 -11
- package/build/navigationProfileButton.js +27 -27
- package/build/onboardingV2.js +29 -29
- package/build/organisms.js +57 -57
- package/build/{post-4e7d1275.js → post-0ea1554e.js} +2 -2
- package/build/profileNavigation.js +20 -20
- package/build/progressBar.js +1 -1
- package/build/pwg.js +23 -23
- package/build/ssoV2.js +29 -38
- package/build/{store-c771d6e1.js → store-6620f22f.js} +3 -3
- package/build/subot/hooks/useVerifyPhoneNumber.d.ts +1 -0
- package/build/subot/index.d.ts +1 -0
- package/build/subot/subotInline/assets/arrow-down.d.ts +3 -0
- package/build/subot/subotInline/assets/arrow-left.d.ts +3 -0
- package/build/subot/subotInline/assets/arrow-right.d.ts +3 -0
- package/build/subot/subotInline/assets/arrow-up.d.ts +3 -0
- package/build/subot/subotInline/assets/check.d.ts +3 -0
- package/build/subot/subotInline/assets/checkbox.d.ts +3 -0
- package/build/subot/subotInline/assets/chevronRightActive.d.ts +3 -0
- package/build/subot/subotInline/assets/dislike-article.d.ts +3 -0
- package/build/subot/subotInline/assets/index.d.ts +10 -0
- package/build/subot/subotInline/assets/like-article.d.ts +3 -0
- package/build/subot/subotInline/assets/rotate-left.d.ts +3 -0
- package/build/subot/subotInline/index.d.ts +4 -0
- package/build/subot/subotInline/index.styled.d.ts +67 -0
- package/build/subot/subotInline/subotInline.config.d.ts +38 -0
- package/build/subot/subotInline/subotInlineAction/index.d.ts +25 -0
- package/build/subot/subotInline/subotInlineAction/subotInlineAction.d.ts +4 -0
- package/build/subot/subotInline/subotInlineAction/subotInlineAction.styled.d.ts +54 -0
- package/build/subot/subotInline/subotInlineFooter.d.ts +17 -0
- package/build/subot/subotInline/subotInlineHeader.d.ts +3 -0
- package/build/subot/subotInline/subotInlineIntent/index.d.ts +100 -0
- package/build/subot/subotInline/subotInlineIntent/subotInlineIntent.d.ts +4 -0
- package/build/subot/subotInline/subotInlineIntent/subotInlineIntent.styled.d.ts +159 -0
- package/build/subot/subotInline/subotInlineIntent/subotInlineIntentFinal.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/SubotInlineNodeResultPoll.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/index.d.ts +15 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNode.d.ts +5 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNode.styled.d.ts +74 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeFinal.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeFinalThankYou.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeForm.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeImage.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeMultiple.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeOTP.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodePoll.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeRating.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeReaction.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeReview.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeSSO.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeStart.d.ts +4 -0
- package/build/subot/subotInline/subotInlineNode/subotInlineNodeText.d.ts +4 -0
- package/build/subot/subotInlineRevamp/context.d.ts +1 -1
- package/build/subot/subotInlineRevamp/types.d.ts +2 -0
- package/build/subot.js +3269 -113
- package/build/surveyOrPremiumBanner.js +34 -34
- package/build/surveyQuestionCard.js +11 -11
- package/build/{surveyThankyouCard-4ac6cf84.js → surveyThankyouCard-8f337e64.js} +5 -5
- package/build/together/togetherComponentGlobalContext.d.ts +2 -0
- package/build/together.js +57 -57
- package/build/togetherApiUtils.js +4 -4
- package/build/togetherAtoms.js +31 -31
- package/build/togetherComponentGlobalContext.js +4 -4
- package/build/togetherMolecules.js +52 -52
- package/build/togetherMoleculesCardAuthor.js +29 -29
- package/build/togetherMoleculesPostImagePreview.js +11 -11
- package/build/togetherMoleculesProfileDetail.js +40 -40
- package/build/togetherOrganisms.js +51 -51
- package/build/togetherRichTextEditor.js +18 -18
- package/build/togetherShareBox.js +10 -10
- package/build/{translationsProvider-78861891.js → translationsProvider-1a3f4c69.js} +1 -1
- package/build/{treePopoverMenu-021827a5.js → treePopoverMenu-e4d38f15.js} +19 -19
- package/build/types.js +2 -2
- package/build/{useHealthToolCache-76887e0f.js → useHealthToolCache-940bbe7c.js} +1 -1
- package/build/{usePhoneValidator-209692a1.js → usePhoneValidator-44dcc6ba.js} +5 -5
- package/build/{usePlacesAutocomplete-f9c22817.js → usePlacesAutocomplete-6bb93dd8.js} +1 -1
- package/build/useTogetherAuthRequiredAction.js +10 -10
- package/build/{utils-ef6e1a4f.js → utils-1d11608a.js} +2 -2
- package/build/{utils-08e02596.js → utils-8b3db262.js} +3 -3
- package/build/{utils-7e890074.js → utils-98559d51.js} +2 -2
- package/build/{utils-dccb42b6.js → utils-f888ab19.js} +5 -5
- package/build/vaccination.js +22 -22
- package/package.json +4 -2
- /package/build/{BMI_BOYS.percentile.monthly-7a42f7c6.js → BMI_BOYS.percentile.monthly-3a992204.js} +0 -0
- /package/build/{BMI_BOYS.percentile.weekly-0c2078ef.js → BMI_BOYS.percentile.weekly-95824985.js} +0 -0
- /package/build/{BMI_BOYS.percentile.yearly-7b9058c4.js → BMI_BOYS.percentile.yearly-c515fd7c.js} +0 -0
- /package/build/{BMI_BOYS.zscore.monthly-c115eaf8.js → BMI_BOYS.zscore.monthly-7bf26547.js} +0 -0
- /package/build/{BMI_BOYS.zscore.weekly-bd2604a5.js → BMI_BOYS.zscore.weekly-80ad437e.js} +0 -0
- /package/build/{BMI_BOYS.zscore.yearly-3442915f.js → BMI_BOYS.zscore.yearly-e990d13d.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.monthly-b8ecd44d.js → BMI_GIRLS.percentile.monthly-64ee65ee.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.weekly-ff61bc1d.js → BMI_GIRLS.percentile.weekly-26878366.js} +0 -0
- /package/build/{BMI_GIRLS.percentile.yearly-48caca4c.js → BMI_GIRLS.percentile.yearly-a29a6807.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.monthly-158aacd3.js → BMI_GIRLS.zscore.monthly-bb5f6287.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.weekly-b14e1993.js → BMI_GIRLS.zscore.weekly-086936f0.js} +0 -0
- /package/build/{BMI_GIRLS.zscore.yearly-78fe37f7.js → BMI_GIRLS.zscore.yearly-8cbe3c80.js} +0 -0
- /package/build/{ChevronDown-48bf2241.js → ChevronDown-acf6c3ca.js} +0 -0
- /package/build/{Close-18464187.js → Close-b1efd086.js} +0 -0
- /package/build/{Google-8938a6c8.js → Google-09868f74.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-38d7fe79.js → HEAD CIRCUM_BOYS.percentile.monthly-c5d44748.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-a4f0b074.js → HEAD CIRCUM_BOYS.percentile.weekly-91fe4021.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-5c77312c.js → HEAD CIRCUM_BOYS.percentile.yearly-7fac3788.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-98738b85.js → HEAD CIRCUM_BOYS.zscore.monthly-c1af3f3e.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-6e85e67b.js → HEAD CIRCUM_BOYS.zscore.weekly-637f5605.js} +0 -0
- /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-a85cd385.js → HEAD CIRCUM_BOYS.zscore.yearly-e2162e6f.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-860f1545.js → HEAD CIRCUM_GIRLS.percentile.monthly-062647ea.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-f0e528d8.js → HEAD CIRCUM_GIRLS.percentile.weekly-1c601e28.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-7e3bb555.js → HEAD CIRCUM_GIRLS.percentile.yearly-abd22c86.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-a8476ac9.js → HEAD CIRCUM_GIRLS.zscore.monthly-01e63f87.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-ea52934c.js → HEAD CIRCUM_GIRLS.zscore.weekly-23b492cb.js} +0 -0
- /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-ddf19ca1.js → HEAD CIRCUM_GIRLS.zscore.yearly-a02c79c0.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.monthly-ccad4084.js → HEIGHT_BOYS.percentile.monthly-132a5d71.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.weekly-3daad9d1.js → HEIGHT_BOYS.percentile.weekly-8b59d42e.js} +0 -0
- /package/build/{HEIGHT_BOYS.percentile.yearly-6b351b52.js → HEIGHT_BOYS.percentile.yearly-fafae744.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.monthly-9bc45bf2.js → HEIGHT_BOYS.zscore.monthly-dbf2290f.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.weekly-36808d7c.js → HEIGHT_BOYS.zscore.weekly-fb350a7f.js} +0 -0
- /package/build/{HEIGHT_BOYS.zscore.yearly-d2e998cd.js → HEIGHT_BOYS.zscore.yearly-0b977905.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.monthly-80d58108.js → HEIGHT_GIRLS.percentile.monthly-0ad4b28b.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.weekly-d428d580.js → HEIGHT_GIRLS.percentile.weekly-320ef2a1.js} +0 -0
- /package/build/{HEIGHT_GIRLS.percentile.yearly-d50f0227.js → HEIGHT_GIRLS.percentile.yearly-8cc9cb9c.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.monthly-cf5f3cff.js → HEIGHT_GIRLS.zscore.monthly-65cd5d6d.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.weekly-52642f5f.js → HEIGHT_GIRLS.zscore.weekly-b6410bea.js} +0 -0
- /package/build/{HEIGHT_GIRLS.zscore.yearly-1cbf5e4b.js → HEIGHT_GIRLS.zscore.yearly-d419996d.js} +0 -0
- /package/build/{Locale-788d4cb6.js → Locale-f24f8e73.js} +0 -0
- /package/build/{Visible-ab0bedac.js → Visible-19ec28f0.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.monthly-f75e5880.js → WEIGHT_BOYS.percentile.monthly-26b9df83.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.weekly-f4584c57.js → WEIGHT_BOYS.percentile.weekly-297f757d.js} +0 -0
- /package/build/{WEIGHT_BOYS.percentile.yearly-cd7c81a1.js → WEIGHT_BOYS.percentile.yearly-7a9cc965.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.monthly-ae9b238a.js → WEIGHT_BOYS.zscore.monthly-32d71b0d.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.weekly-e5314ffe.js → WEIGHT_BOYS.zscore.weekly-98b88378.js} +0 -0
- /package/build/{WEIGHT_BOYS.zscore.yearly-8da75668.js → WEIGHT_BOYS.zscore.yearly-44fcde90.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.monthly-0739c45f.js → WEIGHT_GIRLS.percentile.monthly-b442170b.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.weekly-a38f38ab.js → WEIGHT_GIRLS.percentile.weekly-68b8a005.js} +0 -0
- /package/build/{WEIGHT_GIRLS.percentile.yearly-4063d1f0.js → WEIGHT_GIRLS.percentile.yearly-7d24e36d.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.monthly-d11aa751.js → WEIGHT_GIRLS.zscore.monthly-5e8d5da8.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.weekly-97f81100.js → WEIGHT_GIRLS.zscore.weekly-de70e63b.js} +0 -0
- /package/build/{WEIGHT_GIRLS.zscore.yearly-8703b793.js → WEIGHT_GIRLS.zscore.yearly-0b665e75.js} +0 -0
- /package/build/{ageGenerate-49ac28aa.js → ageGenerate-7ea42e02.js} +0 -0
- /package/build/{animation-e2c6aae6.js → animation-96f630aa.js} +0 -0
- /package/build/{constants-f3f906e9.js → constants-58df8a9b.js} +0 -0
- /package/build/{constants-7b4d3f11.js → constants-87793bc2.js} +0 -0
- /package/build/{constants-eeab42f8.js → constants-d9240b27.js} +0 -0
- /package/build/{context-c386f70b.js → context-a8b8fe05.js} +0 -0
- /package/build/{dataTransform-b6ef1192.js → dataTransform-b57cb178.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.monthly-d69c97a5.js → BMI_BOYS.percentile.monthly-c9a1107a.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.weekly-d880bb94.js → BMI_BOYS.percentile.weekly-39074931.js} +0 -0
- /package/build/esm/{BMI_BOYS.percentile.yearly-6985598b.js → BMI_BOYS.percentile.yearly-90fbb210.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.monthly-1c82c634.js → BMI_BOYS.zscore.monthly-a98c7c15.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.weekly-2a87c990.js → BMI_BOYS.zscore.weekly-10cc4d29.js} +0 -0
- /package/build/esm/{BMI_BOYS.zscore.yearly-cd233bef.js → BMI_BOYS.zscore.yearly-c6e8e0a6.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.monthly-f2504662.js → BMI_GIRLS.percentile.monthly-cf7b0c19.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.weekly-34019918.js → BMI_GIRLS.percentile.weekly-a1b0d202.js} +0 -0
- /package/build/esm/{BMI_GIRLS.percentile.yearly-11a6464f.js → BMI_GIRLS.percentile.yearly-e18e23d5.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.monthly-65a67db6.js → BMI_GIRLS.zscore.monthly-c6b08952.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.weekly-3c93a54a.js → BMI_GIRLS.zscore.weekly-0a6c6e84.js} +0 -0
- /package/build/esm/{BMI_GIRLS.zscore.yearly-5433b843.js → BMI_GIRLS.zscore.yearly-9a09a2c4.js} +0 -0
- /package/build/esm/{ChevronDown-883c452f.js → ChevronDown-86d763fc.js} +0 -0
- /package/build/esm/{Close-efe699a6.js → Close-4f6a6063.js} +0 -0
- /package/build/esm/{Google-0832c5d4.js → Google-663de247.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-3112c2be.js → HEAD CIRCUM_BOYS.percentile.monthly-ecc112f3.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-bd4a5801.js → HEAD CIRCUM_BOYS.percentile.weekly-5e65dc2b.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-2585b962.js → HEAD CIRCUM_BOYS.percentile.yearly-94b7e6c3.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-8b701fb4.js → HEAD CIRCUM_BOYS.zscore.monthly-79789749.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-2cc16630.js → HEAD CIRCUM_BOYS.zscore.weekly-d265f453.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-4e864334.js → HEAD CIRCUM_BOYS.zscore.yearly-e3249df4.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-c396888f.js → HEAD CIRCUM_GIRLS.percentile.monthly-121b5c54.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-e7eeb9b0.js → HEAD CIRCUM_GIRLS.percentile.weekly-11810aae.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-ba72c3c8.js → HEAD CIRCUM_GIRLS.percentile.yearly-e68accf3.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-3bacb348.js → HEAD CIRCUM_GIRLS.zscore.monthly-c2d4fd03.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-01d712b5.js → HEAD CIRCUM_GIRLS.zscore.weekly-b1858e8a.js} +0 -0
- /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-7490aad8.js → HEAD CIRCUM_GIRLS.zscore.yearly-e83a5964.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.monthly-b28c1a73.js → HEIGHT_BOYS.percentile.monthly-01a41e72.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.weekly-2b01a6f3.js → HEIGHT_BOYS.percentile.weekly-37ee1af4.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.percentile.yearly-82040977.js → HEIGHT_BOYS.percentile.yearly-7ae83b39.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.monthly-da729685.js → HEIGHT_BOYS.zscore.monthly-4dbb07b5.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.weekly-acaab41d.js → HEIGHT_BOYS.zscore.weekly-022ce8d0.js} +0 -0
- /package/build/esm/{HEIGHT_BOYS.zscore.yearly-c0436733.js → HEIGHT_BOYS.zscore.yearly-bdfd3d46.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-0f473194.js → HEIGHT_GIRLS.percentile.monthly-bd284619.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-e89b1cd8.js → HEIGHT_GIRLS.percentile.weekly-8a339d51.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-8c045db5.js → HEIGHT_GIRLS.percentile.yearly-287fdb04.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-6eea619e.js → HEIGHT_GIRLS.zscore.monthly-50af2f84.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-03715891.js → HEIGHT_GIRLS.zscore.weekly-5de624f3.js} +0 -0
- /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-43cc003c.js → HEIGHT_GIRLS.zscore.yearly-24fdcc91.js} +0 -0
- /package/build/esm/{Locale-71e44b1f.js → Locale-ae6a3517.js} +0 -0
- /package/build/esm/{Visible-240571df.js → Visible-64e07707.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.monthly-28514ce1.js → WEIGHT_BOYS.percentile.monthly-8402784d.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.weekly-6b4cb37d.js → WEIGHT_BOYS.percentile.weekly-19349d18.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.percentile.yearly-8bd68e16.js → WEIGHT_BOYS.percentile.yearly-366e44d1.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.monthly-94bb79a8.js → WEIGHT_BOYS.zscore.monthly-4fc6d27f.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.weekly-48230f02.js → WEIGHT_BOYS.zscore.weekly-706c9911.js} +0 -0
- /package/build/esm/{WEIGHT_BOYS.zscore.yearly-5a36ec30.js → WEIGHT_BOYS.zscore.yearly-67c54073.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-e6e4e1a0.js → WEIGHT_GIRLS.percentile.monthly-f1278d3a.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-d4217775.js → WEIGHT_GIRLS.percentile.weekly-56953b27.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-d116daa5.js → WEIGHT_GIRLS.percentile.yearly-b4201709.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-db2f5531.js → WEIGHT_GIRLS.zscore.monthly-6b87e48b.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-4702bf9b.js → WEIGHT_GIRLS.zscore.weekly-571d33b2.js} +0 -0
- /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-64666978.js → WEIGHT_GIRLS.zscore.yearly-7044e88f.js} +0 -0
- /package/build/esm/{ageGenerate-5d2599eb.js → ageGenerate-d9155c35.js} +0 -0
- /package/build/esm/{animation-3bf8617e.js → animation-ad5dd370.js} +0 -0
- /package/build/esm/{constants-27f6a360.js → constants-2eead44d.js} +0 -0
- /package/build/esm/{constants-d86f8362.js → constants-9d0f340b.js} +0 -0
- /package/build/esm/{constants-0d9362f5.js → constants-bb7365f2.js} +0 -0
- /package/build/esm/{context-e6e1997a.js → context-08e3b1bc.js} +0 -0
- /package/build/esm/{dataTransform-fc38fcab.js → dataTransform-f7b0bcb9.js} +0 -0
- /package/build/esm/{index-194242a3.js → index-0420ac0b.js} +0 -0
- /package/build/esm/{index-89fc8db5.js → index-19f8afb9.js} +0 -0
- /package/build/esm/{index-5220f93f.js → index-3a624f24.js} +0 -0
- /package/build/esm/{index-26e2a3bf.js → index-626c4113.js} +0 -0
- /package/build/esm/{index-6a51131c.js → index-9311ce10.js} +0 -0
- /package/build/esm/{index-150f8e29.js → index-9e96534d.js} +0 -0
- /package/build/esm/{index-5ee684cf.js → index-d6b2f50d.js} +0 -0
- /package/build/esm/{index-d73f2d9c.js → index-d973dda2.js} +0 -0
- /package/build/esm/{index-3afa1d39.js → index-da2db16e.js} +0 -0
- /package/build/esm/{index.styles-810d632f.js → index.styles-008046cd.js} +0 -0
- /package/build/esm/{localizeNumberFormat-a1104278.js → localizeNumberFormat-9a095e20.js} +0 -0
- /package/build/esm/{normalizeLink-93c61066.js → normalizeLink-bdccd192.js} +0 -0
- /package/build/esm/{number-a05bea6c.js → number-75b8999c.js} +0 -0
- /package/build/esm/{paths-b4b4b7d2.js → paths-e7c84f42.js} +0 -0
- /package/build/esm/{shared-598c2dfd.js → shared-37b0921d.js} +0 -0
- /package/build/esm/{translationsContext-a5aaee40.js → translationsContext-af917846.js} +0 -0
- /package/build/esm/{tslib.es6-04e47048.js → tslib.es6-66838b4c.js} +0 -0
- /package/build/esm/{types-f19b4f83.js → types-a8969720.js} +0 -0
- /package/build/esm/{types-39401c66.js → types-bf43a8e8.js} +0 -0
- /package/build/esm/{useIsInit-44ba789e.js → useIsInit-5da0a0ae.js} +0 -0
- /package/build/esm/{useOutsideClick-2507e9fb.js → useOutsideClick-e0be87ad.js} +0 -0
- /package/build/esm/{useScrollbarSize-0dae8f67.js → useScrollbarSize-35578f92.js} +0 -0
- /package/build/esm/{useUniqueId-43a93ec7.js → useUniqueId-c17e11b4.js} +0 -0
- /package/build/esm/{utils-063d5e54.js → utils-231a9c1b.js} +0 -0
- /package/build/esm/{utils-f3ead128.js → utils-28b75903.js} +0 -0
- /package/build/{index-33dba9cd.js → index-1d983f41.js} +0 -0
- /package/build/{index-0b7364b2.js → index-400ac85c.js} +0 -0
- /package/build/{index-be6985c5.js → index-4890570c.js} +0 -0
- /package/build/{index-ccaeb9a0.js → index-4cc4e94c.js} +0 -0
- /package/build/{index-2bcb7fb6.js → index-4e847075.js} +0 -0
- /package/build/{index-6e83c8cd.js → index-649acf51.js} +0 -0
- /package/build/{index-9fee1060.js → index-68feb624.js} +0 -0
- /package/build/{index-259c2bc3.js → index-89e472ae.js} +0 -0
- /package/build/{index-1029ee59.js → index-a5ed4245.js} +0 -0
- /package/build/{index.styles-6ba02a76.js → index.styles-d012f777.js} +0 -0
- /package/build/{localizeNumberFormat-40733246.js → localizeNumberFormat-24eb2277.js} +0 -0
- /package/build/{normalizeLink-678e875a.js → normalizeLink-cb644fd3.js} +0 -0
- /package/build/{number-e84e29f2.js → number-3d6a2cda.js} +0 -0
- /package/build/{paths-4317aebf.js → paths-dfe2bf5e.js} +0 -0
- /package/build/{shared-7eff181c.js → shared-d5ae85ac.js} +0 -0
- /package/build/{translationsContext-d610fe38.js → translationsContext-2057a072.js} +0 -0
- /package/build/{tslib.es6-4a797eff.js → tslib.es6-32438f57.js} +0 -0
- /package/build/{types-09ab809a.js → types-28a94c6c.js} +0 -0
- /package/build/{types-af8700f0.js → types-3f6819f7.js} +0 -0
- /package/build/{useIsInit-5f873666.js → useIsInit-1dbc3cdd.js} +0 -0
- /package/build/{useOutsideClick-d55910ca.js → useOutsideClick-8b68180d.js} +0 -0
- /package/build/{useScrollbarSize-30b48e8f.js → useScrollbarSize-0bd5bd56.js} +0 -0
- /package/build/{useUniqueId-7fa06486.js → useUniqueId-80352f05.js} +0 -0
- /package/build/{utils-140b5e84.js → utils-4b7f1f41.js} +0 -0
- /package/build/{utils-a42d098a.js → utils-4e787da9.js} +0 -0
package/build/subot.js
CHANGED
|
@@ -3,77 +3,82 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var index$2 = require('./index-
|
|
7
|
-
var tslib_es6 = require('./tslib.es6-
|
|
8
|
-
var index$3 = require('./index-
|
|
6
|
+
var index$2 = require('./index-2f7adb56.js');
|
|
7
|
+
var tslib_es6 = require('./tslib.es6-32438f57.js');
|
|
8
|
+
var index$3 = require('./index-9a36414e.js');
|
|
9
9
|
var Cookies = require('js-cookie');
|
|
10
10
|
var fd = require('fastdom');
|
|
11
11
|
var fastdomPromised = require('fastdom/extensions/fastdom-promised');
|
|
12
|
-
var togetherComponentGlobalContext = require('./utils-
|
|
12
|
+
var togetherComponentGlobalContext = require('./utils-8b3db262.js');
|
|
13
13
|
var formatString = require('string-format');
|
|
14
|
-
var index$1 = require('./index-
|
|
14
|
+
var index$1 = require('./index-487227c1.js');
|
|
15
15
|
var dayjs = require('dayjs');
|
|
16
16
|
var constantsDomainLocales = require('./constantsDomainLocales.js');
|
|
17
17
|
var classNames = require('classnames');
|
|
18
|
-
var index$b = require('./index-
|
|
19
|
-
var index$a = require('./index-
|
|
18
|
+
var index$b = require('./index-1d983f41.js');
|
|
19
|
+
var index$a = require('./index-7a8db159.js');
|
|
20
20
|
var framerMotion = require('framer-motion');
|
|
21
21
|
var styled = require('@emotion/styled');
|
|
22
|
-
var utils = require('./utils-
|
|
23
|
-
var index$4 = require('./index-
|
|
22
|
+
var utils = require('./utils-4e787da9.js');
|
|
23
|
+
var index$4 = require('./index-048722ab.js');
|
|
24
24
|
var remarkable = require('remarkable');
|
|
25
25
|
var other = require('@hhgtech/icons/other');
|
|
26
26
|
var reactIntersectionObserver = require('react-intersection-observer');
|
|
27
27
|
var core = require('@mantine/core');
|
|
28
|
-
var index$5 = require('./index-
|
|
28
|
+
var index$5 = require('./index-4890570c.js');
|
|
29
29
|
var isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
|
|
30
|
-
var constants = require('./constants-
|
|
30
|
+
var constants = require('./constants-87793bc2.js');
|
|
31
31
|
var uuid = require('uuid');
|
|
32
|
-
var index$6 = require('./index-
|
|
32
|
+
var index$6 = require('./index-f0e815f1.js');
|
|
33
33
|
var miscTheme = require('./miscTheme.js');
|
|
34
34
|
var constantsIsProduction = require('./constantsIsProduction.js');
|
|
35
|
-
var index$7 = require('./index-
|
|
35
|
+
var index$7 = require('./index-c06fecd6.js');
|
|
36
36
|
require('@mantine/dates');
|
|
37
|
-
require('./index-
|
|
38
|
-
require('./index-
|
|
39
|
-
require('./index.styles-
|
|
40
|
-
require('./translationsContext-
|
|
37
|
+
require('./index-9ec9f9d4.js');
|
|
38
|
+
require('./index-4e847075.js');
|
|
39
|
+
require('./index.styles-d012f777.js');
|
|
40
|
+
require('./translationsContext-2057a072.js');
|
|
41
41
|
require('@mantine/hooks');
|
|
42
|
-
require('./index-
|
|
42
|
+
require('./index-5ab55624.js');
|
|
43
43
|
var isEmpty = require('lodash/isEmpty');
|
|
44
44
|
var reactHookForm = require('react-hook-form');
|
|
45
45
|
var PhoneInputBase = require('react-phone-number-input');
|
|
46
46
|
var api = require('@react-google-maps/api');
|
|
47
|
-
var usePlacesAutocomplete = require('./usePlacesAutocomplete-
|
|
47
|
+
var usePlacesAutocomplete = require('./usePlacesAutocomplete-6bb93dd8.js');
|
|
48
48
|
var miscDefaultClassWrapper = require('./miscDefaultClassWrapper.js');
|
|
49
|
-
var Locale = require('./Locale-
|
|
50
|
-
var InputDate = require('./InputDate-
|
|
51
|
-
var index$8 = require('./index-
|
|
52
|
-
var index$9 = require('./index-
|
|
53
|
-
var store = require('./store-
|
|
54
|
-
var utils$1 = require('./utils-
|
|
49
|
+
var Locale = require('./Locale-f24f8e73.js');
|
|
50
|
+
var InputDate = require('./InputDate-aa02d9a5.js');
|
|
51
|
+
var index$8 = require('./index-a44ea4a0.js');
|
|
52
|
+
var index$9 = require('./index-68feb624.js');
|
|
53
|
+
var store = require('./store-6620f22f.js');
|
|
54
|
+
var utils$1 = require('./utils-f888ab19.js');
|
|
55
|
+
var index$c = require('./index-787cf506.js');
|
|
56
|
+
var StarRatings = require('react-star-ratings');
|
|
57
|
+
var moleculesArticleCard = require('./moleculesArticleCard.js');
|
|
58
|
+
var index$d = require('./index-34a55146.js');
|
|
59
|
+
var index$e = require('./index-3d4023fb.js');
|
|
55
60
|
require('date-fns/locale');
|
|
56
61
|
require('./constantsSite.js');
|
|
57
62
|
require('./constantsRiskScreener.js');
|
|
58
|
-
require('./index-
|
|
63
|
+
require('./index-a5ed4245.js');
|
|
59
64
|
require('./miscCookieHelper.js');
|
|
60
65
|
require('slugify');
|
|
61
66
|
require('./togetherApiPaths.js');
|
|
62
|
-
require('./index-
|
|
63
|
-
require('./WhatsApp-
|
|
64
|
-
require('./Spinner-
|
|
65
|
-
require('./index-
|
|
66
|
-
require('./shared-
|
|
67
|
-
require('./index-
|
|
67
|
+
require('./index-4f881245.js');
|
|
68
|
+
require('./WhatsApp-cd094714.js');
|
|
69
|
+
require('./Spinner-4e5067bf.js');
|
|
70
|
+
require('./index-366354c9.js');
|
|
71
|
+
require('./shared-d5ae85ac.js');
|
|
72
|
+
require('./index-eb8ad24a.js');
|
|
68
73
|
require('@mantine/carousel');
|
|
69
|
-
require('./useUniqueId-
|
|
74
|
+
require('./useUniqueId-80352f05.js');
|
|
70
75
|
require('@emotion/react');
|
|
71
76
|
require('@hhgtech/icons/core');
|
|
72
77
|
require('@mantine/notifications');
|
|
73
78
|
require('zustand');
|
|
74
|
-
require('./index-
|
|
75
|
-
require('./normalizeLink-
|
|
76
|
-
require('./healthTools-
|
|
79
|
+
require('./index-0570f20a.js');
|
|
80
|
+
require('./normalizeLink-cb644fd3.js');
|
|
81
|
+
require('./healthTools-4e928273.js');
|
|
77
82
|
|
|
78
83
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
79
84
|
|
|
@@ -88,6 +93,7 @@ var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
|
88
93
|
var isSameOrBefore__default = /*#__PURE__*/_interopDefault(isSameOrBefore);
|
|
89
94
|
var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty);
|
|
90
95
|
var PhoneInputBase__default = /*#__PURE__*/_interopDefault(PhoneInputBase);
|
|
96
|
+
var StarRatings__default = /*#__PURE__*/_interopDefault(StarRatings);
|
|
91
97
|
|
|
92
98
|
// extend fastdom
|
|
93
99
|
const fastdom = fd__default["default"].extend(fastdomPromised__default["default"]);
|
|
@@ -169,7 +175,7 @@ const getSubotApiPath = (path, params) => {
|
|
|
169
175
|
return apiUrl + formatString__default["default"](path, Object.assign({}, params));
|
|
170
176
|
};
|
|
171
177
|
/** inline message */
|
|
172
|
-
const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
178
|
+
const subotInlineMessage$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
173
179
|
try {
|
|
174
180
|
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_MESSAGE), 'POST', {
|
|
175
181
|
data,
|
|
@@ -177,7 +183,7 @@ const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0,
|
|
|
177
183
|
}
|
|
178
184
|
catch (error) { }
|
|
179
185
|
});
|
|
180
|
-
const computeExtraSettingsForBot = (data) => {
|
|
186
|
+
const computeExtraSettingsForBot$1 = (data) => {
|
|
181
187
|
var _a;
|
|
182
188
|
if ((data === null || data === void 0 ? void 0 : data._status) === 1 && ((_a = data === null || data === void 0 ? void 0 : data._data) === null || _a === void 0 ? void 0 : _a.extra_settings)) {
|
|
183
189
|
try {
|
|
@@ -200,11 +206,11 @@ const computeExtraSettingsForBot = (data) => {
|
|
|
200
206
|
return data;
|
|
201
207
|
};
|
|
202
208
|
/** inline first node */
|
|
203
|
-
const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
209
|
+
const subotInlineFirstNode$1 = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
204
210
|
try {
|
|
205
211
|
const data = yield CachedSystem.withCached('SubotInlineFirstNode/' + id, () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
206
212
|
const response = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_FIRST_NODE) + `/${id}`, 'GET');
|
|
207
|
-
computeExtraSettingsForBot(response);
|
|
213
|
+
computeExtraSettingsForBot$1(response);
|
|
208
214
|
return response;
|
|
209
215
|
}));
|
|
210
216
|
return data;
|
|
@@ -214,7 +220,7 @@ const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0,
|
|
|
214
220
|
}
|
|
215
221
|
});
|
|
216
222
|
/** inline click */
|
|
217
|
-
const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
223
|
+
const subotInlineClick$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
218
224
|
try {
|
|
219
225
|
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_CLICK), 'POST', {
|
|
220
226
|
data,
|
|
@@ -223,7 +229,7 @@ const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, f
|
|
|
223
229
|
catch (error) { }
|
|
224
230
|
});
|
|
225
231
|
/** inline impression */
|
|
226
|
-
const subotInlineImpression = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
232
|
+
const subotInlineImpression$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
227
233
|
try {
|
|
228
234
|
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_IMPRESSION), 'POST', {
|
|
229
235
|
data,
|
|
@@ -822,7 +828,7 @@ const detectToSkipNodeStart = (botItem, currentActiveId, currentListNodes) => {
|
|
|
822
828
|
return [currentActiveId, currentListNodes];
|
|
823
829
|
};
|
|
824
830
|
|
|
825
|
-
const SubotInlineContext = React.createContext({
|
|
831
|
+
const SubotInlineContext$1 = React.createContext({
|
|
826
832
|
activeId: '',
|
|
827
833
|
params: {},
|
|
828
834
|
listNodes: [],
|
|
@@ -838,7 +844,7 @@ const SubotInlineContext = React.createContext({
|
|
|
838
844
|
setLoading: () => null,
|
|
839
845
|
userInfo: null,
|
|
840
846
|
});
|
|
841
|
-
const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer, bgColor: _bgColor, primaryColor: _primaryColor, textColor, textButtonColor, bgContentColor, bgImgFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, typeFormProps, isMobile, locale, }) => {
|
|
847
|
+
const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer, bgColor: _bgColor, primaryColor: _primaryColor, textColor, textButtonColor, bgContentColor, bgImgFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, typeFormProps, customUrl, isMobile, locale, }) => {
|
|
842
848
|
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
843
849
|
const ref = React.useRef(null);
|
|
844
850
|
// const { formatMessage: f } = useIntl()
|
|
@@ -885,8 +891,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
|
|
|
885
891
|
/** Get Params */
|
|
886
892
|
const getParams = React.useCallback(() => {
|
|
887
893
|
const gaData = window.gaData;
|
|
888
|
-
const url = window.location.origin +
|
|
889
|
-
index$3.basePath +
|
|
894
|
+
const url = (customUrl || window.location.origin + index$3.basePath) +
|
|
890
895
|
((togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.locale) === 'tl-PH'
|
|
891
896
|
? articleLink.replace('fil/', '')
|
|
892
897
|
: articleLink);
|
|
@@ -935,7 +940,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
|
|
|
935
940
|
let newActiveId = '';
|
|
936
941
|
let nodes = [];
|
|
937
942
|
setLoading(true);
|
|
938
|
-
const resFirst = yield subotInlineFirstNode(params.bot_id);
|
|
943
|
+
const resFirst = yield subotInlineFirstNode$1(params.bot_id);
|
|
939
944
|
if ((resFirst === null || resFirst === void 0 ? void 0 : resFirst._status) === 1) {
|
|
940
945
|
newActiveId = resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.id.toString();
|
|
941
946
|
nodes.push(resFirst === null || resFirst === void 0 ? void 0 : resFirst._data, resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.first_node);
|
|
@@ -953,7 +958,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
|
|
|
953
958
|
if (previousState &&
|
|
954
959
|
previousState.params.action_id &&
|
|
955
960
|
previousState.params.action_value) {
|
|
956
|
-
const resResultInline = yield subotInlineMessage(previousState.params);
|
|
961
|
+
const resResultInline = yield subotInlineMessage$1(previousState.params);
|
|
957
962
|
if ((resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._status) === 1 && (resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node)) {
|
|
958
963
|
newActiveId = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node.id;
|
|
959
964
|
nodes = previousState.listNodes;
|
|
@@ -1022,7 +1027,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
|
|
|
1022
1027
|
const onNext = React.useCallback((messageParams) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
1023
1028
|
if (messageParams === null || messageParams === void 0 ? void 0 : messageParams.node_id) {
|
|
1024
1029
|
const newMessage = Object.assign(Object.assign({}, messageParams), getCurrentTotalDynamicScore(listNodes, activeId, messageParams.action_id));
|
|
1025
|
-
const res = yield subotInlineMessage(newMessage);
|
|
1030
|
+
const res = yield subotInlineMessage$1(newMessage);
|
|
1026
1031
|
setLoading(false);
|
|
1027
1032
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
1028
1033
|
const _b = res === null || res === void 0 ? void 0 : res._data, { node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
|
|
@@ -1170,7 +1175,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
|
|
|
1170
1175
|
if (!listNodes.length) {
|
|
1171
1176
|
return null;
|
|
1172
1177
|
}
|
|
1173
|
-
return (React__default["default"].createElement(SubotInlineContext.Provider, { value: value },
|
|
1178
|
+
return (React__default["default"].createElement(SubotInlineContext$1.Provider, { value: value },
|
|
1174
1179
|
React__default["default"].createElement("div", { ref: ref }, children)));
|
|
1175
1180
|
};
|
|
1176
1181
|
|
|
@@ -1674,7 +1679,7 @@ const Container$u = () => {
|
|
|
1674
1679
|
var _a, _b, _c;
|
|
1675
1680
|
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
1676
1681
|
const currentUrl = useCurrentUrl();
|
|
1677
|
-
const { listNodes, activeId, isShowFooter, onNext, onPrev, params, onStartOver, loading, } = React.useContext(SubotInlineContext);
|
|
1682
|
+
const { listNodes, activeId, isShowFooter, onNext, onPrev, params, onStartOver, loading, } = React.useContext(SubotInlineContext$1);
|
|
1678
1683
|
const { value } = React.useContext(NodeContext);
|
|
1679
1684
|
const validation = useValidationMultiOption();
|
|
1680
1685
|
const botItem = listNodes[0];
|
|
@@ -2066,7 +2071,7 @@ const Container$s = ({ node, onClickStart }) => {
|
|
|
2066
2071
|
const refImpression = React.useRef(false);
|
|
2067
2072
|
const { ref, inView } = reactIntersectionObserver.useInView();
|
|
2068
2073
|
const currentUrl = useCurrentUrl();
|
|
2069
|
-
const { params, getParams, onNext, setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
|
|
2074
|
+
const { params, getParams, onNext, setIsShowFooter, listNodes } = React.useContext(SubotInlineContext$1);
|
|
2070
2075
|
const botItem = listNodes[0];
|
|
2071
2076
|
const botType = (_a = botItem === null || botItem === void 0 ? void 0 : botItem.extra_settings) === null || _a === void 0 ? void 0 : _a.subot_type;
|
|
2072
2077
|
React.useMemo(() => {
|
|
@@ -2076,14 +2081,14 @@ const Container$s = ({ node, onClickStart }) => {
|
|
|
2076
2081
|
if (!inView || refImpression.current) {
|
|
2077
2082
|
return;
|
|
2078
2083
|
}
|
|
2079
|
-
subotInlineImpression(getParams());
|
|
2084
|
+
subotInlineImpression$1(getParams());
|
|
2080
2085
|
refImpression.current = true;
|
|
2081
2086
|
}, [inView]);
|
|
2082
2087
|
const handleClickStart = () => {
|
|
2083
2088
|
// 1. Tracking Event Click
|
|
2084
2089
|
const params = getParams();
|
|
2085
2090
|
params.device_id = index$1.checkMobile(window.navigator.userAgent) ? 2 : 1;
|
|
2086
|
-
subotInlineClick(params);
|
|
2091
|
+
subotInlineClick$1(params);
|
|
2087
2092
|
// 2. Call API to fetch next node
|
|
2088
2093
|
onNext();
|
|
2089
2094
|
onClickStart === null || onClickStart === void 0 ? void 0 : onClickStart();
|
|
@@ -2362,7 +2367,7 @@ const handleFrisoRedirecition = (listNode) => {
|
|
|
2362
2367
|
|
|
2363
2368
|
const Container$r = ({ intent }) => {
|
|
2364
2369
|
var _a;
|
|
2365
|
-
const { listNodes } = React.useContext(SubotInlineContext);
|
|
2370
|
+
const { listNodes } = React.useContext(SubotInlineContext$1);
|
|
2366
2371
|
const handleOnClick = () => {
|
|
2367
2372
|
var _a;
|
|
2368
2373
|
if ((_a = intent.url) === null || _a === void 0 ? void 0 : _a.includes('{{.frisoRedirectUrl}}')) {
|
|
@@ -2418,7 +2423,7 @@ const Container$q = ({ intent }) => {
|
|
|
2418
2423
|
Container$q.displayName = 'SubotInlineIntentBotImage';
|
|
2419
2424
|
|
|
2420
2425
|
const Container$p = ({ intent, indexNumber }) => {
|
|
2421
|
-
const { listNodes } = React.useContext(SubotInlineContext);
|
|
2426
|
+
const { listNodes } = React.useContext(SubotInlineContext$1);
|
|
2422
2427
|
const isShowLabel = ![index$2.NodeIntentType.SSO_INTENT].includes(intent === null || intent === void 0 ? void 0 : intent.type);
|
|
2423
2428
|
const isText = [
|
|
2424
2429
|
index$2.NodeIntentType.BOT_TEXT,
|
|
@@ -2452,7 +2457,7 @@ Container$p.displayName = 'SubotInlineIntentBotTitle';
|
|
|
2452
2457
|
|
|
2453
2458
|
const Container$o = ({ intent }) => {
|
|
2454
2459
|
const currentUrl = useCurrentUrl();
|
|
2455
|
-
const { listNodes, activeId, params } = React.useContext(SubotInlineContext);
|
|
2460
|
+
const { listNodes, activeId, params } = React.useContext(SubotInlineContext$1);
|
|
2456
2461
|
const foundNode = listNodes.find((n) => n.id == activeId);
|
|
2457
2462
|
if (!intent.label || !foundNode) {
|
|
2458
2463
|
return null;
|
|
@@ -2793,7 +2798,7 @@ const StyledWrap$e = styled__default["default"].div `
|
|
|
2793
2798
|
`;
|
|
2794
2799
|
|
|
2795
2800
|
const Container$k = ({ intent }) => {
|
|
2796
|
-
const { listNodes } = React.useContext(SubotInlineContext);
|
|
2801
|
+
const { listNodes } = React.useContext(SubotInlineContext$1);
|
|
2797
2802
|
if (!(intent === null || intent === void 0 ? void 0 : intent.label)) {
|
|
2798
2803
|
return null;
|
|
2799
2804
|
}
|
|
@@ -2854,15 +2859,15 @@ const Container$j = ({ intent }) => {
|
|
|
2854
2859
|
};
|
|
2855
2860
|
Container$j.displayName = 'SubotInlineIntentSSO';
|
|
2856
2861
|
|
|
2857
|
-
var _a$
|
|
2858
|
-
const SubotInlineIntentCol = styled__default["default"].div `
|
|
2862
|
+
var _a$2;
|
|
2863
|
+
const SubotInlineIntentCol$1 = styled__default["default"].div `
|
|
2859
2864
|
width: ${({ width }) => width || '100%'};
|
|
2860
2865
|
padding: 4px;
|
|
2861
2866
|
${utils.MediaQueries.mbDown} {
|
|
2862
2867
|
width: 100%;
|
|
2863
2868
|
}
|
|
2864
2869
|
`;
|
|
2865
|
-
const SubotInlineIntentUrlContainer = styled__default["default"].div `
|
|
2870
|
+
const SubotInlineIntentUrlContainer$1 = styled__default["default"].div `
|
|
2866
2871
|
display: flex;
|
|
2867
2872
|
.feature {
|
|
2868
2873
|
width: 30%;
|
|
@@ -2890,7 +2895,7 @@ const SubotInlineIntentUrlContainer = styled__default["default"].div `
|
|
|
2890
2895
|
margin-left: 10px;
|
|
2891
2896
|
line-height: 1.5;
|
|
2892
2897
|
a {
|
|
2893
|
-
color: ${((_a$
|
|
2898
|
+
color: ${((_a$2 = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _a$2 === void 0 ? void 0 : _a$2.gray800) || '#262626'};
|
|
2894
2899
|
text-decoration: none;
|
|
2895
2900
|
}
|
|
2896
2901
|
}
|
|
@@ -2900,8 +2905,8 @@ const Container$i = ({ intent, }) => {
|
|
|
2900
2905
|
const article = React.useMemo(() => intent.label.includes('{')
|
|
2901
2906
|
? JSON.parse(intent.label)
|
|
2902
2907
|
: {}, [intent.label]);
|
|
2903
|
-
return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol, null,
|
|
2904
|
-
React__default["default"].createElement(SubotInlineIntentUrlContainer, null,
|
|
2908
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol$1, null,
|
|
2909
|
+
React__default["default"].createElement(SubotInlineIntentUrlContainer$1, null,
|
|
2905
2910
|
React__default["default"].createElement("div", { className: "feature" },
|
|
2906
2911
|
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature-wrapper" },
|
|
2907
2912
|
React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title, className: "feature-img" }))),
|
|
@@ -2938,7 +2943,7 @@ const SubotInlineIntentBaseTarget = {
|
|
|
2938
2943
|
/** intents fake for sso block */
|
|
2939
2944
|
[index$2.NodeIntentType.SSO_INTENT]: Container$j,
|
|
2940
2945
|
};
|
|
2941
|
-
const SubotInlineIntentBase = new Proxy(SubotInlineIntentBaseTarget, {
|
|
2946
|
+
const SubotInlineIntentBase$1 = new Proxy(SubotInlineIntentBaseTarget, {
|
|
2942
2947
|
get(_, prop) {
|
|
2943
2948
|
const UnknowComponent = () => {
|
|
2944
2949
|
if (constantsIsProduction.isProduction)
|
|
@@ -2965,7 +2970,7 @@ const Container$h = ({ intents: intentsProp, indexNumber, }) => {
|
|
|
2965
2970
|
const intentType = (intent === null || intent === void 0 ? void 0 : intent.type) || '';
|
|
2966
2971
|
if (excludeIntents.includes(intentType))
|
|
2967
2972
|
return null;
|
|
2968
|
-
const NodeIntent = SubotInlineIntentBase[intentType];
|
|
2973
|
+
const NodeIntent = SubotInlineIntentBase$1[intentType];
|
|
2969
2974
|
return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
2970
2975
|
})))));
|
|
2971
2976
|
};
|
|
@@ -2973,7 +2978,7 @@ Container$h.displayName = 'SubotInlineIntent';
|
|
|
2973
2978
|
|
|
2974
2979
|
const Container$g = ({ node }) => {
|
|
2975
2980
|
var _a, _b;
|
|
2976
|
-
const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
|
|
2981
|
+
const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext$1);
|
|
2977
2982
|
const botItem = listNodes[0];
|
|
2978
2983
|
React.useMemo(() => {
|
|
2979
2984
|
setIsShowFooter(true);
|
|
@@ -3164,7 +3169,7 @@ const SubInlineIntent = ({ subIntents }) => {
|
|
|
3164
3169
|
React__default["default"].createElement(ChevronDown, { className: "si-chevron-down" })),
|
|
3165
3170
|
React__default["default"].createElement(framerMotion.motion.div, { className: "si-sub-intent-expand", animate: isShow ? { height: 'auto' } : { height: 0 }, transition: { duration: 0.3 }, "data-show": isShow }, restSubIntents.map((intent) => {
|
|
3166
3171
|
const intentType = (intent === null || intent === void 0 ? void 0 : intent.type) || '';
|
|
3167
|
-
const NodeIntent = SubotInlineIntentBase[intentType];
|
|
3172
|
+
const NodeIntent = SubotInlineIntentBase$1[intentType];
|
|
3168
3173
|
return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
3169
3174
|
}))));
|
|
3170
3175
|
};
|
|
@@ -3175,7 +3180,7 @@ const Container$f = ({ node }) => {
|
|
|
3175
3180
|
// const isMobile = useGetIsMobile(true)
|
|
3176
3181
|
const refMainIntents = React.useRef(null);
|
|
3177
3182
|
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
3178
|
-
const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
|
|
3183
|
+
const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext$1);
|
|
3179
3184
|
const [isShowMore, setIsShowMore] = React.useState(false);
|
|
3180
3185
|
React.useEffect(() => {
|
|
3181
3186
|
var _a;
|
|
@@ -3280,11 +3285,11 @@ const Container$f = ({ node }) => {
|
|
|
3280
3285
|
defaultMessage: 'See more',
|
|
3281
3286
|
}))),
|
|
3282
3287
|
React__default["default"].createElement("div", { className: "wrap-main-button-intent" }, (_a = [...mainButtonIntents, ...bookingButtonIntents]) === null || _a === void 0 ? void 0 : _a.map((intent) => {
|
|
3283
|
-
const NodeIntent = SubotInlineIntentBase[intent.type || ''];
|
|
3288
|
+
const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
|
|
3284
3289
|
return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
3285
3290
|
})),
|
|
3286
3291
|
(suggestedServiceIntents === null || suggestedServiceIntents === void 0 ? void 0 : suggestedServiceIntents.length) > 0 && (React__default["default"].createElement("div", null, suggestedServiceIntents.map((intent) => {
|
|
3287
|
-
const NodeIntent = SubotInlineIntentBase[intent.type || ''];
|
|
3292
|
+
const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
|
|
3288
3293
|
return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
3289
3294
|
}))),
|
|
3290
3295
|
(relatedArticleIntents === null || relatedArticleIntents === void 0 ? void 0 : relatedArticleIntents.length) > 0 && (React__default["default"].createElement("div", { style: { marginTop: 24 } },
|
|
@@ -3293,7 +3298,7 @@ const Container$f = ({ node }) => {
|
|
|
3293
3298
|
defaultMessage: 'Related Articles',
|
|
3294
3299
|
})),
|
|
3295
3300
|
React__default["default"].createElement("div", { style: { padding: '8px 0' } }, relatedArticleIntents.map((intent) => {
|
|
3296
|
-
const NodeIntent = SubotInlineIntentBase[intent.type || ''];
|
|
3301
|
+
const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
|
|
3297
3302
|
return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
|
|
3298
3303
|
})))),
|
|
3299
3304
|
React__default["default"].createElement(SubInlineIntent, { subIntents: subIntents })));
|
|
@@ -3307,7 +3312,7 @@ const StyledWrap$b = styled__default["default"].div `
|
|
|
3307
3312
|
`;
|
|
3308
3313
|
|
|
3309
3314
|
const Container$e = ({ node }) => {
|
|
3310
|
-
const { params, onNext, setIsShowFooter } = React.useContext(SubotInlineContext);
|
|
3315
|
+
const { params, onNext, setIsShowFooter } = React.useContext(SubotInlineContext$1);
|
|
3311
3316
|
React.useMemo(() => {
|
|
3312
3317
|
setIsShowFooter(true);
|
|
3313
3318
|
}, []);
|
|
@@ -3719,7 +3724,7 @@ const CountDown = ({ onFinish, onClick, isFinished, resendLabel, className }, re
|
|
|
3719
3724
|
};
|
|
3720
3725
|
var CountDown$1 = React.forwardRef(CountDown);
|
|
3721
3726
|
|
|
3722
|
-
styled__default["default"].div `
|
|
3727
|
+
const StyledUserInfoFormContainer$1 = styled__default["default"].div `
|
|
3723
3728
|
margin: 0 auto;
|
|
3724
3729
|
background: #f7f9fc;
|
|
3725
3730
|
border-radius: ${miscTheme.theme.borderRadius};
|
|
@@ -4651,7 +4656,7 @@ const OTP_VERIFIED_MSG_CODE = {
|
|
|
4651
4656
|
},
|
|
4652
4657
|
};
|
|
4653
4658
|
|
|
4654
|
-
var _a, _b, _c, _d, _e;
|
|
4659
|
+
var _a$1, _b$1, _c$1, _d$1, _e$1;
|
|
4655
4660
|
const StyledPhoneCode = styled__default["default"].div `
|
|
4656
4661
|
display: flex;
|
|
4657
4662
|
align-items: center;
|
|
@@ -4663,21 +4668,21 @@ const StyledPhoneCode = styled__default["default"].div `
|
|
|
4663
4668
|
border-radius: 2px;
|
|
4664
4669
|
}
|
|
4665
4670
|
> div {
|
|
4666
|
-
color: ${((_a = miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.gray800) || ''};
|
|
4671
|
+
color: ${((_a$1 = miscTheme.theme.colors) === null || _a$1 === void 0 ? void 0 : _a$1.gray800) || ''};
|
|
4667
4672
|
white-space: nowrap;
|
|
4668
4673
|
}
|
|
4669
4674
|
`;
|
|
4670
4675
|
styled__default["default"](PhoneInputBase__default["default"]) `
|
|
4671
4676
|
display: flex;
|
|
4672
|
-
border: 1px solid ${((_b = miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.gray200) || ''};
|
|
4677
|
+
border: 1px solid ${((_b$1 = miscTheme.theme.colors) === null || _b$1 === void 0 ? void 0 : _b$1.gray200) || ''};
|
|
4673
4678
|
border-radius: ${miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.borderRadius};
|
|
4674
4679
|
.PhoneInputCountry {
|
|
4675
4680
|
position: relative;
|
|
4676
4681
|
padding: 12px 8px 12px 16px;
|
|
4677
|
-
border-right: 1px solid ${((_c = miscTheme.theme.colors) === null || _c === void 0 ? void 0 : _c.gray200) || ''};
|
|
4678
|
-
background-color: ${((_d = miscTheme.theme.colors) === null || _d === void 0 ? void 0 : _d.gray100) || ''};
|
|
4682
|
+
border-right: 1px solid ${((_c$1 = miscTheme.theme.colors) === null || _c$1 === void 0 ? void 0 : _c$1.gray200) || ''};
|
|
4683
|
+
background-color: ${((_d$1 = miscTheme.theme.colors) === null || _d$1 === void 0 ? void 0 : _d$1.gray100) || ''};
|
|
4679
4684
|
border-radius: 6px 0 0 6px;
|
|
4680
|
-
color: ${((_e = miscTheme.theme.colors) === null || _e === void 0 ? void 0 : _e.gray800) || ''};
|
|
4685
|
+
color: ${((_e$1 = miscTheme.theme.colors) === null || _e$1 === void 0 ? void 0 : _e$1.gray800) || ''};
|
|
4681
4686
|
.PhoneInputCountrySelect {
|
|
4682
4687
|
position: absolute;
|
|
4683
4688
|
top: 0;
|
|
@@ -5514,14 +5519,14 @@ const StyledWrap$a = styled__default["default"].div `
|
|
|
5514
5519
|
const Container$d = ({ node, indexNumber }) => {
|
|
5515
5520
|
var _a;
|
|
5516
5521
|
const locale = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.locale;
|
|
5517
|
-
const { params, listNodes, activeId, onSubmit, setIsShowFooter } = React.useContext(SubotInlineContext);
|
|
5522
|
+
const { params, listNodes, activeId, onSubmit, setIsShowFooter } = React.useContext(SubotInlineContext$1);
|
|
5518
5523
|
React.useMemo(() => {
|
|
5519
5524
|
setIsShowFooter(true);
|
|
5520
5525
|
}, []);
|
|
5521
5526
|
const handleSubmit = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
5522
5527
|
checkSyncDataOnFrisoCampaign(listNodes[0], data.form_submit_meta);
|
|
5523
5528
|
const _message = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node._message), data), getCurrentTotalDynamicScore(listNodes, activeId, data.action_id, data.form_submit_meta)), { node_id: node.id });
|
|
5524
|
-
const res = yield subotInlineMessage(_message);
|
|
5529
|
+
const res = yield subotInlineMessage$1(_message);
|
|
5525
5530
|
// asking
|
|
5526
5531
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
5527
5532
|
const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
|
|
@@ -5686,7 +5691,7 @@ const StyledWrap$7 = styled__default["default"].div `
|
|
|
5686
5691
|
`;
|
|
5687
5692
|
const Container$c = ({ action, active, onChange, htmlType, }) => {
|
|
5688
5693
|
const currentUrl = useCurrentUrl();
|
|
5689
|
-
const { params } = React.useContext(SubotInlineContext);
|
|
5694
|
+
const { params } = React.useContext(SubotInlineContext$1);
|
|
5690
5695
|
return (React__default["default"].createElement(StyledWrap$7, { className: "si-action-img-choice", onClick: () => onChange && onChange(action), active: !!active, "data-event-category": "Service Connection", "data-event-action": "Risk Screening Answer Click", "data-event-label": currentUrl, "data-bot-id": params.bot_id },
|
|
5691
5696
|
React__default["default"].createElement("div", { className: "si-action-image-wrap" },
|
|
5692
5697
|
React__default["default"].createElement("img", { loading: "lazy", src: action === null || action === void 0 ? void 0 : action.url, alt: action === null || action === void 0 ? void 0 : action.label })),
|
|
@@ -5702,7 +5707,7 @@ const StyledWrap$6 = styled__default["default"].div `
|
|
|
5702
5707
|
`;
|
|
5703
5708
|
const Container$b = ({ action, onChange }) => {
|
|
5704
5709
|
const currentUrl = useCurrentUrl();
|
|
5705
|
-
const { params, activeId } = React.useContext(SubotInlineContext);
|
|
5710
|
+
const { params, activeId } = React.useContext(SubotInlineContext$1);
|
|
5706
5711
|
return (React__default["default"].createElement(StyledWrap$6, null,
|
|
5707
5712
|
React__default["default"].createElement(index$4.Button, { onClick: () => onChange && onChange(action), size: "lg", "data-event-category": "Service Connection", "data-event-action": "Risk Screening Sign Up for Result", "data-event-label": currentUrl, "data-bot-id": params.bot_id, "data-event-question-id": activeId, styles: {
|
|
5708
5713
|
root: {
|
|
@@ -5764,7 +5769,7 @@ const Container$a = ({ action, onChange, active, htmlType, formSubmitMeta, }) =>
|
|
|
5764
5769
|
const currentUrl = useCurrentUrl();
|
|
5765
5770
|
const inputRef = React.useRef(null);
|
|
5766
5771
|
const [otherText, setOtherText] = React.useState('');
|
|
5767
|
-
const { params } = React.useContext(SubotInlineContext);
|
|
5772
|
+
const { params } = React.useContext(SubotInlineContext$1);
|
|
5768
5773
|
const isActionPollWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
|
|
5769
5774
|
const isActionSelectWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
|
|
5770
5775
|
isActionPollWithOther;
|
|
@@ -5848,7 +5853,7 @@ const SubotInlineActionBaseTarget = {
|
|
|
5848
5853
|
// [NodeActionType.RESULT_BUTTON]: SubotInlineActionTextChoice,
|
|
5849
5854
|
// [NodeActionType.POLL_RESULT]: SubotInlinePollResult,
|
|
5850
5855
|
};
|
|
5851
|
-
const SubotInlineActionBase = new Proxy(SubotInlineActionBaseTarget, {
|
|
5856
|
+
const SubotInlineActionBase$1 = new Proxy(SubotInlineActionBaseTarget, {
|
|
5852
5857
|
get(_, prop) {
|
|
5853
5858
|
const UnknowComponent = () => {
|
|
5854
5859
|
if (constantsIsProduction.isProduction)
|
|
@@ -5879,14 +5884,14 @@ const Container$7 = ({ actions, value, onChange, htmlType, node_type, formSubmit
|
|
|
5879
5884
|
const actionType = action.type;
|
|
5880
5885
|
if (excludeActions.includes(actionType))
|
|
5881
5886
|
return null;
|
|
5882
|
-
const NodeAction = SubotInlineActionBase[action.type];
|
|
5887
|
+
const NodeAction = SubotInlineActionBase$1[action.type];
|
|
5883
5888
|
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: onChange, active: value === null || value === void 0 ? void 0 : value.includes(action.id), htmlType: htmlType, formSubmitMeta: formSubmitMeta })));
|
|
5884
5889
|
})));
|
|
5885
5890
|
};
|
|
5886
5891
|
Container$7.displayName = 'SubotInlineAction';
|
|
5887
5892
|
|
|
5888
5893
|
const Container$6 = ({ node, indexNumber }) => {
|
|
5889
|
-
const { params, listNodes, activeId, onSubmit, setIsShowFooter, setLoading } = React.useContext(SubotInlineContext);
|
|
5894
|
+
const { params, listNodes, activeId, onSubmit, setIsShowFooter, setLoading } = React.useContext(SubotInlineContext$1);
|
|
5890
5895
|
const { value, setValue } = React.useContext(NodeContext);
|
|
5891
5896
|
React.useMemo(() => {
|
|
5892
5897
|
setIsShowFooter(true);
|
|
@@ -5901,7 +5906,7 @@ const Container$6 = ({ node, indexNumber }) => {
|
|
|
5901
5906
|
setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
|
|
5902
5907
|
const newParams = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(listNodes, activeId, action.id));
|
|
5903
5908
|
setLoading(true);
|
|
5904
|
-
const res = yield subotInlineMessage(newParams);
|
|
5909
|
+
const res = yield subotInlineMessage$1(newParams);
|
|
5905
5910
|
setLoading(false);
|
|
5906
5911
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
5907
5912
|
const _a = res === null || res === void 0 ? void 0 : res._data, { node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
@@ -5926,7 +5931,7 @@ const StyledWrap$3 = styled__default["default"].div `
|
|
|
5926
5931
|
|
|
5927
5932
|
const Container$5 = ({ node, indexNumber }) => {
|
|
5928
5933
|
var _a;
|
|
5929
|
-
const { setIsShowFooter, onChange } = React.useContext(SubotInlineContext);
|
|
5934
|
+
const { setIsShowFooter, onChange } = React.useContext(SubotInlineContext$1);
|
|
5930
5935
|
const { value, setValue } = React.useContext(NodeContext);
|
|
5931
5936
|
React.useMemo(() => {
|
|
5932
5937
|
setIsShowFooter(true);
|
|
@@ -6038,7 +6043,7 @@ const StyledWrap$2 = styled__default["default"].div `
|
|
|
6038
6043
|
`;
|
|
6039
6044
|
|
|
6040
6045
|
const Container$4 = ({ node, indexNumber }) => {
|
|
6041
|
-
const { onChange, setIsShowFooter } = React.useContext(SubotInlineContext);
|
|
6046
|
+
const { onChange, setIsShowFooter } = React.useContext(SubotInlineContext$1);
|
|
6042
6047
|
const { value, setValue } = React.useContext(NodeContext);
|
|
6043
6048
|
const descriptionNode = useDescriptionPollNode({ node });
|
|
6044
6049
|
React.useMemo(() => {
|
|
@@ -6113,7 +6118,7 @@ const StyledWrap$1 = styled__default["default"].div ``;
|
|
|
6113
6118
|
const Container$3 = ({ node }) => {
|
|
6114
6119
|
const refIsTrigger = React.useRef(false);
|
|
6115
6120
|
const { formatMessage: f, data: { userInfo }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
6116
|
-
const { params, setIsShowFooter, listNodes, activeId } = React.useContext(SubotInlineContext);
|
|
6121
|
+
const { params, setIsShowFooter, listNodes, activeId } = React.useContext(SubotInlineContext$1);
|
|
6117
6122
|
React.useMemo(() => {
|
|
6118
6123
|
setIsShowFooter(true);
|
|
6119
6124
|
}, []);
|
|
@@ -6175,7 +6180,7 @@ const StyledWrap = styled__default["default"].div `
|
|
|
6175
6180
|
`;
|
|
6176
6181
|
|
|
6177
6182
|
const Container$2 = ({ node, indexNumber }) => {
|
|
6178
|
-
const { params, onSubmit, setIsShowFooter, listNodes, activeId, setLoading, onChange, } = React.useContext(SubotInlineContext);
|
|
6183
|
+
const { params, onSubmit, setIsShowFooter, listNodes, activeId, setLoading, onChange, } = React.useContext(SubotInlineContext$1);
|
|
6179
6184
|
const { value, setValue } = React.useContext(NodeContext);
|
|
6180
6185
|
React.useMemo(() => {
|
|
6181
6186
|
setIsShowFooter(true);
|
|
@@ -6191,7 +6196,7 @@ const Container$2 = ({ node, indexNumber }) => {
|
|
|
6191
6196
|
const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
6192
6197
|
const newParams = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: undefined }), getCurrentTotalDynamicScore(listNodes, activeId, action.id));
|
|
6193
6198
|
setLoading(true);
|
|
6194
|
-
const res = yield subotInlineMessage(newParams);
|
|
6199
|
+
const res = yield subotInlineMessage$1(newParams);
|
|
6195
6200
|
setLoading(false);
|
|
6196
6201
|
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
6197
6202
|
const _a = res === null || res === void 0 ? void 0 : res._data, { node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
@@ -6239,7 +6244,7 @@ const SubotInlineNodeBaseTarget = {
|
|
|
6239
6244
|
// RESULT_RATING = 12,
|
|
6240
6245
|
// RESULT_REACTION = 13,
|
|
6241
6246
|
};
|
|
6242
|
-
const SubotInlineNodeBase = new Proxy(SubotInlineNodeBaseTarget, {
|
|
6247
|
+
const SubotInlineNodeBase$1 = new Proxy(SubotInlineNodeBaseTarget, {
|
|
6243
6248
|
get(_, prop) {
|
|
6244
6249
|
const UnknowComponent = () => {
|
|
6245
6250
|
if (constantsIsProduction.isProduction)
|
|
@@ -6254,7 +6259,7 @@ const SubotInlineNodeBase = new Proxy(SubotInlineNodeBaseTarget, {
|
|
|
6254
6259
|
|
|
6255
6260
|
const Container$1 = ({ onClickStart }) => {
|
|
6256
6261
|
var _a;
|
|
6257
|
-
const { listNodes, activeId, isDisabledAnimationOnMobile } = React.useContext(SubotInlineContext);
|
|
6262
|
+
const { listNodes, activeId, isDisabledAnimationOnMobile } = React.useContext(SubotInlineContext$1);
|
|
6258
6263
|
const foundIdx = React.useMemo(() => {
|
|
6259
6264
|
return listNodes.findIndex((n) => n.id == activeId);
|
|
6260
6265
|
}, [listNodes, activeId]);
|
|
@@ -6275,10 +6280,10 @@ const Container$1 = ({ onClickStart }) => {
|
|
|
6275
6280
|
const nodeType = index$2.NodeType[node.type].valueOf();
|
|
6276
6281
|
const nodeTypeSSO = (_a = index$2.NodePosition[node.position]) === null || _a === void 0 ? void 0 : _a.valueOf();
|
|
6277
6282
|
let NodeComponent = node.position === index$2.NodePosition.SSO
|
|
6278
|
-
? SubotInlineNodeBase[nodeTypeSSO]
|
|
6279
|
-
: SubotInlineNodeBase[nodeType];
|
|
6283
|
+
? SubotInlineNodeBase$1[nodeTypeSSO]
|
|
6284
|
+
: SubotInlineNodeBase$1[nodeType];
|
|
6280
6285
|
if (node.is_multi_select && node.type !== index$2.NodeType.POLL) {
|
|
6281
|
-
NodeComponent = SubotInlineNodeBase['MULTIPLE'];
|
|
6286
|
+
NodeComponent = SubotInlineNodeBase$1['MULTIPLE'];
|
|
6282
6287
|
}
|
|
6283
6288
|
return (React__default["default"].createElement(framerMotion.motion.div, { key: node.id, initial: { opacity: 1, y: -300 }, animate: { opacity: 1, y: 0 }, transition: {
|
|
6284
6289
|
y: { type: 'spring', stiffness: 300, damping: 30 },
|
|
@@ -6316,7 +6321,7 @@ const View = ({ loading, backgroundImage, isShowFooter, isFullContainer, isDisab
|
|
|
6316
6321
|
backgroundRepeat: 'no-repeat',
|
|
6317
6322
|
backgroundPosition: 'center',
|
|
6318
6323
|
}), [backgroundImage]);
|
|
6319
|
-
const { isMobile, locale } = React.useContext(SubotInlineContext);
|
|
6324
|
+
const { isMobile, locale } = React.useContext(SubotInlineContext$1);
|
|
6320
6325
|
const [isDisplayFullMobile, setIsDisplayFullMobile] = React.useState(false);
|
|
6321
6326
|
React.useEffect(() => {
|
|
6322
6327
|
if (isDisplayFullMobile) {
|
|
@@ -6379,7 +6384,7 @@ const ViewWithMemo = React.memo(View);
|
|
|
6379
6384
|
ViewWithMemo.displayName = 'SubotInlineRevampView';
|
|
6380
6385
|
|
|
6381
6386
|
const Container = () => {
|
|
6382
|
-
const { loading, listNodes, isShowFooter, activeId, isFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, bgImgFullContainer, typeFormProps, } = React.useContext(SubotInlineContext);
|
|
6387
|
+
const { loading, listNodes, isShowFooter, activeId, isFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, bgImgFullContainer, typeFormProps, } = React.useContext(SubotInlineContext$1);
|
|
6383
6388
|
const backgroundImage = React.useMemo(() => {
|
|
6384
6389
|
var _a, _b;
|
|
6385
6390
|
const foundNode = listNodes.find((n) => n.id == activeId);
|
|
@@ -6436,6 +6441,3155 @@ const SubotInlineRevampWithTheme = (props) => {
|
|
|
6436
6441
|
return (React__default["default"].createElement(ContainerWithProvider, Object.assign({}, props, { primaryColor: (_b = (_a = botData.extra_settings) === null || _a === void 0 ? void 0 : _a.inline_styles) === null || _b === void 0 ? void 0 : _b.primary_color, textColor: (_d = (_c = botData.extra_settings) === null || _c === void 0 ? void 0 : _c.inline_styles) === null || _d === void 0 ? void 0 : _d.text_color, textButtonColor: (_f = (_e = botData.extra_settings) === null || _e === void 0 ? void 0 : _e.inline_styles) === null || _f === void 0 ? void 0 : _f.text_button_color, bgColor: (_h = (_g = botData.extra_settings) === null || _g === void 0 ? void 0 : _g.inline_styles) === null || _h === void 0 ? void 0 : _h.container_bg_color, bgContentColor: (_k = (_j = botData.extra_settings) === null || _j === void 0 ? void 0 : _j.inline_styles) === null || _k === void 0 ? void 0 : _k.content_bg_color, bgImgFullContainer: (_m = (_l = botData.extra_settings) === null || _l === void 0 ? void 0 : _l.inline_styles) === null || _m === void 0 ? void 0 : _m.container_bg_image })));
|
|
6437
6442
|
};
|
|
6438
6443
|
|
|
6444
|
+
const SubotInlineContext = React.createContext({
|
|
6445
|
+
activeId: '',
|
|
6446
|
+
params: {},
|
|
6447
|
+
nodes: [],
|
|
6448
|
+
getParams: () => ({}),
|
|
6449
|
+
trackingCommonInline: {},
|
|
6450
|
+
});
|
|
6451
|
+
/** inline click */
|
|
6452
|
+
const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
6453
|
+
try {
|
|
6454
|
+
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_CLICK), 'POST', {
|
|
6455
|
+
data,
|
|
6456
|
+
});
|
|
6457
|
+
}
|
|
6458
|
+
catch (error) { }
|
|
6459
|
+
});
|
|
6460
|
+
/** inline impression */
|
|
6461
|
+
const subotInlineImpression = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
6462
|
+
try {
|
|
6463
|
+
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_IMPRESSION), 'POST', {
|
|
6464
|
+
data,
|
|
6465
|
+
});
|
|
6466
|
+
}
|
|
6467
|
+
catch (error) { }
|
|
6468
|
+
});
|
|
6469
|
+
/** inline message */
|
|
6470
|
+
const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
6471
|
+
try {
|
|
6472
|
+
return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_MESSAGE), 'POST', {
|
|
6473
|
+
data,
|
|
6474
|
+
});
|
|
6475
|
+
}
|
|
6476
|
+
catch (error) { }
|
|
6477
|
+
});
|
|
6478
|
+
const computeExtraSettingsForBot = (data) => {
|
|
6479
|
+
var _a;
|
|
6480
|
+
if ((data === null || data === void 0 ? void 0 : data._status) === 1 && ((_a = data === null || data === void 0 ? void 0 : data._data) === null || _a === void 0 ? void 0 : _a.extra_settings)) {
|
|
6481
|
+
try {
|
|
6482
|
+
const extraSettingsObj = JSON.parse(data._data.extra_settings);
|
|
6483
|
+
if (typeof extraSettingsObj === 'object') {
|
|
6484
|
+
data._data.extra_settings = extraSettingsObj;
|
|
6485
|
+
}
|
|
6486
|
+
else {
|
|
6487
|
+
data._data.extra_settings = {
|
|
6488
|
+
sync_data_friso_campaign: false,
|
|
6489
|
+
};
|
|
6490
|
+
}
|
|
6491
|
+
}
|
|
6492
|
+
catch (err) {
|
|
6493
|
+
data._data.extra_settings = {
|
|
6494
|
+
sync_data_friso_campaign: false,
|
|
6495
|
+
};
|
|
6496
|
+
}
|
|
6497
|
+
}
|
|
6498
|
+
return data;
|
|
6499
|
+
};
|
|
6500
|
+
/** inline first node */
|
|
6501
|
+
const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
6502
|
+
try {
|
|
6503
|
+
const data = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_FIRST_NODE) + `/${id}`, 'GET');
|
|
6504
|
+
computeExtraSettingsForBot(data);
|
|
6505
|
+
return data;
|
|
6506
|
+
}
|
|
6507
|
+
catch (error) { }
|
|
6508
|
+
});
|
|
6509
|
+
|
|
6510
|
+
const SubotInlineFormContainer = styled__default["default"].div `
|
|
6511
|
+
margin-top: 2rem;
|
|
6512
|
+
.form {
|
|
6513
|
+
background-color: ${miscTheme.theme.colors.white || '#fff'};
|
|
6514
|
+
}
|
|
6515
|
+
`;
|
|
6516
|
+
const SubotInlineIntentContainer = styled__default["default"].div ``;
|
|
6517
|
+
const SubotInlineActionContainer = styled__default["default"].div `
|
|
6518
|
+
margin-top: 1.25rem;
|
|
6519
|
+
`;
|
|
6520
|
+
const SubotInlineReviewContainer = styled__default["default"].div `
|
|
6521
|
+
margin-bottom: 1rem;
|
|
6522
|
+
`;
|
|
6523
|
+
const SubotInlineDescription$1 = styled__default["default"].div `
|
|
6524
|
+
font-weight: 400;
|
|
6525
|
+
font-size: 16px;
|
|
6526
|
+
line-height: 24px;
|
|
6527
|
+
color: #595959;
|
|
6528
|
+
font-style: italic;
|
|
6529
|
+
`;
|
|
6530
|
+
const SubotInlineFinalButton = styled__default["default"](index$8.Button) `
|
|
6531
|
+
position: relative;
|
|
6532
|
+
min-width: 180px;
|
|
6533
|
+
svg {
|
|
6534
|
+
path {
|
|
6535
|
+
stroke: currentColor;
|
|
6536
|
+
}
|
|
6537
|
+
}
|
|
6538
|
+
&:hover {
|
|
6539
|
+
svg {
|
|
6540
|
+
path {
|
|
6541
|
+
stroke: currentColor;
|
|
6542
|
+
}
|
|
6543
|
+
}
|
|
6544
|
+
}
|
|
6545
|
+
`;
|
|
6546
|
+
const SubotInlineFinalMoreContainer = styled__default["default"].div `
|
|
6547
|
+
display: flex;
|
|
6548
|
+
align-items: center;
|
|
6549
|
+
justify-content: center;
|
|
6550
|
+
`;
|
|
6551
|
+
const SubotInlineFinalWrapper = styled__default["default"].div `
|
|
6552
|
+
position: relative;
|
|
6553
|
+
overflow: ${({ isMore }) => (isMore ? 'unset' : 'hidden')};
|
|
6554
|
+
max-height: ${({ maxHeight }) => (maxHeight ? maxHeight + 'px' : 'auto')};
|
|
6555
|
+
margin-bottom: 8px;
|
|
6556
|
+
transition: 0.25s all linear;
|
|
6557
|
+
&:before {
|
|
6558
|
+
position: absolute;
|
|
6559
|
+
z-index: 1;
|
|
6560
|
+
top: 50%;
|
|
6561
|
+
right: 0;
|
|
6562
|
+
bottom: 0;
|
|
6563
|
+
left: 0;
|
|
6564
|
+
background-image: linear-gradient(
|
|
6565
|
+
to top,
|
|
6566
|
+
${miscTheme.theme.colors.neutral50 || '#F7F9FC'} 0%,
|
|
6567
|
+
transparent 100%
|
|
6568
|
+
);
|
|
6569
|
+
content: '';
|
|
6570
|
+
pointer-events: none;
|
|
6571
|
+
${({ isMore }) => isMore && `opacity: 0;`}
|
|
6572
|
+
}
|
|
6573
|
+
`;
|
|
6574
|
+
const SubotInlineFinalContainer = styled__default["default"].div `
|
|
6575
|
+
position: relative;
|
|
6576
|
+
padding: 32px 32px 16px;
|
|
6577
|
+
background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
|
|
6578
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
6579
|
+
${utils.MediaQueries.tdDown} {
|
|
6580
|
+
padding: 24px 24px 16px;
|
|
6581
|
+
}
|
|
6582
|
+
${utils.MediaQueries.mbDown} {
|
|
6583
|
+
padding: 16px;
|
|
6584
|
+
border-radius: 0px;
|
|
6585
|
+
}
|
|
6586
|
+
`;
|
|
6587
|
+
const SubotInlineWrapper$1 = styled__default["default"].div `
|
|
6588
|
+
padding: 12px 32px 32px;
|
|
6589
|
+
${utils.MediaQueries.tdDown} {
|
|
6590
|
+
padding: 12px 24px 24px;
|
|
6591
|
+
}
|
|
6592
|
+
${utils.MediaQueries.mbDown} {
|
|
6593
|
+
padding: 12px 16px 16px;
|
|
6594
|
+
}
|
|
6595
|
+
`;
|
|
6596
|
+
const SubotInlineContainer$1 = styled__default["default"].div `
|
|
6597
|
+
border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
6598
|
+
background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
|
|
6599
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
6600
|
+
${utils.MediaQueries.mbDown} {
|
|
6601
|
+
border: none;
|
|
6602
|
+
}
|
|
6603
|
+
`;
|
|
6604
|
+
|
|
6605
|
+
const CheckboxIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6606
|
+
React__default["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11 21C16.5228 21 21 16.5228 21 11C21 5.47715 16.5228 1 11 1C5.47715 1 1 5.47715 1 11C1 16.5228 5.47715 21 11 21Z", fill: "#2D87F3", stroke: "#2D87F3", strokeWidth: "2" }),
|
|
6607
|
+
React__default["default"].createElement("path", { d: "M15.5714 8L9.67857 14L7 11.2727", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6608
|
+
|
|
6609
|
+
const CheckIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6610
|
+
React__default["default"].createElement("path", { d: "M13.3346 4L6.0013 11.3333L2.66797 8", stroke: "#737373", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6611
|
+
|
|
6612
|
+
const LikeIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6613
|
+
React__default["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.0521 5.70293L11.8834 2L12.6635 2.03149C12.6635 2.03149 13.5407 2.05593 14.4487 2.51311C15.3568 2.9703 16.375 4.04935 16.375 5.69552C16.375 6.76085 16.1102 7.83874 15.8458 8.67047H20.125C21.1497 8.67047 22 9.53063 22 10.5673V12.8847C22 13.1046 21.9497 13.3294 21.8462 13.533L18.6437 19.9571C18.3261 20.5939 17.6767 21 16.9701 21H8.875C7.85025 21 7 20.1398 7 19.1031V10.0579C7 9.50164 7.24299 8.97147 7.66284 8.61119L11.0521 5.70293ZM13.4432 4.15712C13.4125 4.15279 13.3784 4.14799 13.3263 4.1321L12.7422 6.73842L8.875 10.0579V19.1031H16.9701L20.125 12.7717V10.5673H13.0864L13.6357 9.25027C13.6357 9.25027 14.5 7.01241 14.5 5.69552C14.5 4.74112 14.1119 4.46257 13.6138 4.21176C13.5294 4.16929 13.4902 4.16376 13.4432 4.15712Z", fill: "#595959" }),
|
|
6614
|
+
React__default["default"].createElement("path", { d: "M2 10.5C2 9.672 2.672 9 3.5 9C4.328 9 5 9.672 5 10.5V19.5C5 20.328 4.328 21 3.5 21C2.672 21 2 20.328 2 19.5V10.5Z", fill: "#595959" })));
|
|
6615
|
+
|
|
6616
|
+
const DislikeIcon = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6617
|
+
React__default["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.0521 17.2971L11.8834 21L12.6635 20.9685C12.6635 20.9685 13.5407 20.9441 14.4487 20.4869C15.3568 20.0297 16.375 18.9507 16.375 17.3045C16.375 16.2391 16.1102 15.1613 15.8458 14.3295H20.125C21.1497 14.3295 22 13.4694 22 12.4327V10.1153C22 9.89545 21.9497 9.6706 21.8462 9.467L18.6437 3.0429C18.3261 2.40607 17.6767 2 16.9701 2H8.875C7.85025 2 7 2.86016 7 3.89685V12.9421C7 13.4984 7.24299 14.0285 7.66284 14.3888L11.0521 17.2971ZM13.4432 18.8429C13.4125 18.8472 13.3784 18.852 13.3263 18.8679L12.7422 16.2616L8.875 12.9421V3.89685H16.9701L20.125 10.2283V12.4327H13.0864L13.6357 13.7497C13.6357 13.7497 14.5 15.9876 14.5 17.3045C14.5 18.2589 14.1119 18.5374 13.6138 18.7882C13.5294 18.8307 13.4902 18.8362 13.4432 18.8429Z", fill: "#595959" }),
|
|
6618
|
+
React__default["default"].createElement("path", { d: "M2 12.5C2 13.328 2.672 14 3.5 14C4.328 14 5 13.328 5 12.5V3.5C5 2.672 4.328 2 3.5 2C2.672 2 2 2.672 2 3.5V12.5Z", fill: "#595959" })));
|
|
6619
|
+
|
|
6620
|
+
const ArrowDown = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6621
|
+
React__default["default"].createElement("path", { d: "M1 1L5 5L9 1", stroke: "#595959", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6622
|
+
|
|
6623
|
+
const ArrowLeft = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "7", height: "10", viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6624
|
+
React__default["default"].createElement("path", { d: "M5.5 9L1.5 5L5.5 1", stroke: "#2D87F3", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6625
|
+
|
|
6626
|
+
const ArrowRight = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "7", height: "10", viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6627
|
+
React__default["default"].createElement("path", { d: "M1.5 9L5.5 5L1.5 1", stroke: "#2D87F3", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6628
|
+
|
|
6629
|
+
const ArrowUp = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6630
|
+
React__default["default"].createElement("path", { d: "M1 5L5 1L9 5", stroke: "#FC5D9A", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6631
|
+
|
|
6632
|
+
const ChevronRightActive = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6633
|
+
React__default["default"].createElement("path", { d: "M6 12L10 8L6 4", stroke: "#2D87F3", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
6634
|
+
|
|
6635
|
+
const RotateLeft = (props) => (React__default["default"].createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
6636
|
+
React__default["default"].createElement("g", { clipPath: "url(#clip0)" },
|
|
6637
|
+
React__default["default"].createElement("path", { d: "M0.666626 2.6665V6.6665H4.66663", stroke: "#737373", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
6638
|
+
React__default["default"].createElement("path", { d: "M2.33996 10.0001C2.77222 11.227 3.59152 12.2802 4.6744 13.001C5.75728 13.7218 7.04508 14.0712 8.34377 13.9964C9.64246 13.9217 10.8817 13.4269 11.8747 12.5866C12.8677 11.7464 13.5608 10.6061 13.8494 9.3377C14.1381 8.06929 14.0067 6.74143 13.475 5.55419C12.9434 4.36696 12.0403 3.38466 10.9018 2.7553C9.76339 2.12595 8.45123 1.88364 7.16308 2.06487C5.87493 2.24611 4.68057 2.84108 3.75996 3.76013L0.666626 6.6668", stroke: "#737373", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
6639
|
+
React__default["default"].createElement("defs", null,
|
|
6640
|
+
React__default["default"].createElement("clipPath", { id: "clip0" },
|
|
6641
|
+
React__default["default"].createElement("rect", { width: "16", height: "16", fill: "white" })))));
|
|
6642
|
+
|
|
6643
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6644
|
+
const SubotInlineButtonReaction = styled__default["default"].div `
|
|
6645
|
+
display: flex;
|
|
6646
|
+
align-items: center;
|
|
6647
|
+
justify-content: center;
|
|
6648
|
+
padding: 12px 24px;
|
|
6649
|
+
border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
6650
|
+
background-color: ${miscTheme.theme.colors.white || 'white'};
|
|
6651
|
+
border-radius: 32px;
|
|
6652
|
+
cursor: pointer;
|
|
6653
|
+
transition: 0.25s all linear;
|
|
6654
|
+
svg {
|
|
6655
|
+
height: 16px;
|
|
6656
|
+
margin-right: 3px;
|
|
6657
|
+
}
|
|
6658
|
+
&:hover {
|
|
6659
|
+
background-color: ${miscTheme.theme.colors.neutral100};
|
|
6660
|
+
}
|
|
6661
|
+
&.active {
|
|
6662
|
+
background-color: ${miscTheme.theme.colors.primaryActive};
|
|
6663
|
+
color: ${miscTheme.theme.colors.white || '#fff'};
|
|
6664
|
+
svg {
|
|
6665
|
+
stroke: ${miscTheme.theme.colors.white || '#fff'};
|
|
6666
|
+
}
|
|
6667
|
+
}
|
|
6668
|
+
`;
|
|
6669
|
+
const SubotInlineButtonReview = styled__default["default"].div `
|
|
6670
|
+
padding: 12px 24px;
|
|
6671
|
+
border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
6672
|
+
background-color: ${miscTheme.theme.colors.white || 'white'};
|
|
6673
|
+
border-radius: 32px;
|
|
6674
|
+
cursor: pointer;
|
|
6675
|
+
transition: 0.25s all linear;
|
|
6676
|
+
&.active {
|
|
6677
|
+
background-color: ${(_a = miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.primaryActive};
|
|
6678
|
+
color: ${miscTheme.theme.colors.white || '#fff'};
|
|
6679
|
+
svg {
|
|
6680
|
+
stroke: ${miscTheme.theme.colors.white || '#fff'};
|
|
6681
|
+
}
|
|
6682
|
+
}
|
|
6683
|
+
`;
|
|
6684
|
+
const SubotInlineActionText = styled__default["default"].div `
|
|
6685
|
+
display: flex;
|
|
6686
|
+
align-items: center;
|
|
6687
|
+
padding: 16px 24px;
|
|
6688
|
+
border: 1px solid
|
|
6689
|
+
${({ active }) => active
|
|
6690
|
+
? miscTheme.theme.colors.primaryBase || '#2685F1'
|
|
6691
|
+
: miscTheme.theme.colors.white || '#fff'};
|
|
6692
|
+
background-color: ${miscTheme.theme.colors.white || '#fff'};
|
|
6693
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
6694
|
+
cursor: pointer;
|
|
6695
|
+
transition: 0.25s all linear;
|
|
6696
|
+
.label {
|
|
6697
|
+
flex: 1;
|
|
6698
|
+
}
|
|
6699
|
+
.icon {
|
|
6700
|
+
position: relative;
|
|
6701
|
+
z-index: 0;
|
|
6702
|
+
display: flex;
|
|
6703
|
+
width: 24px;
|
|
6704
|
+
height: 24px;
|
|
6705
|
+
align-items: center;
|
|
6706
|
+
justify-content: center;
|
|
6707
|
+
padding: 1px;
|
|
6708
|
+
transition: 0.2s linear all;
|
|
6709
|
+
.icon-checkbox {
|
|
6710
|
+
width: 100%;
|
|
6711
|
+
height: 100%;
|
|
6712
|
+
opacity: 0;
|
|
6713
|
+
${({ active }) => active && `opacity: 1`};
|
|
6714
|
+
transition: 0.25s all linear;
|
|
6715
|
+
}
|
|
6716
|
+
&:before {
|
|
6717
|
+
position: absolute;
|
|
6718
|
+
top: 50%;
|
|
6719
|
+
left: 50%;
|
|
6720
|
+
width: 22px;
|
|
6721
|
+
height: 22px;
|
|
6722
|
+
border: 2px solid
|
|
6723
|
+
${({ active }) => active
|
|
6724
|
+
? miscTheme.theme.colors.primaryBase || '#2685F1'
|
|
6725
|
+
: miscTheme.theme.colors.gray600 || '#595959'};
|
|
6726
|
+
border-radius: 50%;
|
|
6727
|
+
content: '';
|
|
6728
|
+
transform: translate(-50%, -50%);
|
|
6729
|
+
transition: 0.25s all linear;
|
|
6730
|
+
}
|
|
6731
|
+
&:after {
|
|
6732
|
+
position: absolute;
|
|
6733
|
+
z-index: -1;
|
|
6734
|
+
top: 50%;
|
|
6735
|
+
left: 50%;
|
|
6736
|
+
width: 10px;
|
|
6737
|
+
height: 10px;
|
|
6738
|
+
background-color: ${miscTheme.theme.colors.primaryBase || '#2685F1'};
|
|
6739
|
+
border-radius: 50%;
|
|
6740
|
+
content: '';
|
|
6741
|
+
opacity: 0;
|
|
6742
|
+
${({ active }) => active && `opacity: 1`};
|
|
6743
|
+
transform: translate(-50%, -50%);
|
|
6744
|
+
transition: 0.25s all linear;
|
|
6745
|
+
}
|
|
6746
|
+
}
|
|
6747
|
+
&:hover {
|
|
6748
|
+
border-color: ${((_b = miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.primaryBase) || '#2685F1'};
|
|
6749
|
+
.icon {
|
|
6750
|
+
&:before {
|
|
6751
|
+
border-color: ${((_c = miscTheme.theme.colors) === null || _c === void 0 ? void 0 : _c.primaryBase) || '#2685F1'};
|
|
6752
|
+
transition: 0.2s linear all;
|
|
6753
|
+
}
|
|
6754
|
+
}
|
|
6755
|
+
}
|
|
6756
|
+
${utils.MediaQueries.tdDown} {
|
|
6757
|
+
padding: 16px 20px;
|
|
6758
|
+
}
|
|
6759
|
+
`;
|
|
6760
|
+
const SubotInlineActionImage = styled__default["default"](SubotInlineActionText) `
|
|
6761
|
+
position: relative;
|
|
6762
|
+
flex-wrap: wrap;
|
|
6763
|
+
padding: 16px;
|
|
6764
|
+
background-color: ${((_d = miscTheme.theme.colors) === null || _d === void 0 ? void 0 : _d.white) || '#fff'};
|
|
6765
|
+
.image-container {
|
|
6766
|
+
position: relative;
|
|
6767
|
+
overflow: hidden;
|
|
6768
|
+
width: 100%;
|
|
6769
|
+
padding-top: 67%;
|
|
6770
|
+
border-radius: 10px;
|
|
6771
|
+
.image {
|
|
6772
|
+
position: absolute;
|
|
6773
|
+
top: 50%;
|
|
6774
|
+
left: 50%;
|
|
6775
|
+
width: 100%;
|
|
6776
|
+
min-width: 100%;
|
|
6777
|
+
height: auto;
|
|
6778
|
+
min-height: 100%;
|
|
6779
|
+
transform: translate(-50%, -50%);
|
|
6780
|
+
}
|
|
6781
|
+
}
|
|
6782
|
+
.label {
|
|
6783
|
+
margin-top: 16px;
|
|
6784
|
+
}
|
|
6785
|
+
.icon {
|
|
6786
|
+
position: absolute;
|
|
6787
|
+
top: 1.75rem;
|
|
6788
|
+
right: 1.75rem;
|
|
6789
|
+
&:before {
|
|
6790
|
+
z-index: -1;
|
|
6791
|
+
background-color: #fff;
|
|
6792
|
+
}
|
|
6793
|
+
}
|
|
6794
|
+
${utils.MediaQueries.tdDown} {
|
|
6795
|
+
padding: 12px;
|
|
6796
|
+
.label {
|
|
6797
|
+
margin-top: 12px;
|
|
6798
|
+
}
|
|
6799
|
+
.icon {
|
|
6800
|
+
top: 1.3rem;
|
|
6801
|
+
right: 1.3rem;
|
|
6802
|
+
}
|
|
6803
|
+
}
|
|
6804
|
+
${utils.MediaQueries.tdDown} {
|
|
6805
|
+
padding: 8px;
|
|
6806
|
+
.label {
|
|
6807
|
+
margin-top: 8px;
|
|
6808
|
+
}
|
|
6809
|
+
.icon {
|
|
6810
|
+
top: 0.9rem;
|
|
6811
|
+
right: 0.9rem;
|
|
6812
|
+
}
|
|
6813
|
+
}
|
|
6814
|
+
`;
|
|
6815
|
+
const SubotInlineActionRatingStartContainer = styled__default["default"].div `
|
|
6816
|
+
display: flex;
|
|
6817
|
+
align-items: center;
|
|
6818
|
+
justify-content: flex-start;
|
|
6819
|
+
${utils.MediaQueries.tdDown} {
|
|
6820
|
+
justify-content: center;
|
|
6821
|
+
}
|
|
6822
|
+
`;
|
|
6823
|
+
const SubotInlineActionRatingDescriptionContainer = styled__default["default"].div `
|
|
6824
|
+
textarea {
|
|
6825
|
+
background-color: ${((_e = miscTheme.theme.colors) === null || _e === void 0 ? void 0 : _e.white) || '#fff'};
|
|
6826
|
+
}
|
|
6827
|
+
`;
|
|
6828
|
+
const SubotInlineActionPollResult = styled__default["default"].div `
|
|
6829
|
+
margin-top: 20px;
|
|
6830
|
+
color: ${((_f = miscTheme.theme.colors) === null || _f === void 0 ? void 0 : _f.gray500) || '#737373'};
|
|
6831
|
+
font-weight: 600;
|
|
6832
|
+
`;
|
|
6833
|
+
const SubotInlineActionPollChoiceResult = styled__default["default"].div `
|
|
6834
|
+
position: relative;
|
|
6835
|
+
z-index: 0;
|
|
6836
|
+
display: flex;
|
|
6837
|
+
overflow: hidden;
|
|
6838
|
+
align-items: center;
|
|
6839
|
+
padding: 16px 20px;
|
|
6840
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
6841
|
+
.number {
|
|
6842
|
+
width: 32px;
|
|
6843
|
+
margin-right: 14px;
|
|
6844
|
+
font-weight: 600;
|
|
6845
|
+
}
|
|
6846
|
+
.content {
|
|
6847
|
+
flex: 1;
|
|
6848
|
+
}
|
|
6849
|
+
.icon {
|
|
6850
|
+
width: 16px;
|
|
6851
|
+
margin-left: 8px;
|
|
6852
|
+
}
|
|
6853
|
+
&:before {
|
|
6854
|
+
position: absolute;
|
|
6855
|
+
z-index: -1;
|
|
6856
|
+
top: 0;
|
|
6857
|
+
right: ${({ percent }) => (percent ? `${100 - percent}%` : '100%')};
|
|
6858
|
+
bottom: 0;
|
|
6859
|
+
left: 0;
|
|
6860
|
+
background-color: ${({ is_chosen }) => is_chosen
|
|
6861
|
+
? miscTheme.theme.colors.primary50 || '#E3F2FF'
|
|
6862
|
+
: miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
6863
|
+
content: '';
|
|
6864
|
+
transition: 0.3s all linear;
|
|
6865
|
+
}
|
|
6866
|
+
&:after {
|
|
6867
|
+
position: absolute;
|
|
6868
|
+
z-index: -2;
|
|
6869
|
+
top: 0;
|
|
6870
|
+
right: 0;
|
|
6871
|
+
bottom: 0;
|
|
6872
|
+
left: 0;
|
|
6873
|
+
background-color: ${((_g = miscTheme.theme.colors) === null || _g === void 0 ? void 0 : _g.white) || '#fff'};
|
|
6874
|
+
content: '';
|
|
6875
|
+
}
|
|
6876
|
+
${utils.MediaQueries.mbDown} {
|
|
6877
|
+
padding: 6px 16px;
|
|
6878
|
+
}
|
|
6879
|
+
`;
|
|
6880
|
+
const SubotInlineActionItemContainer = styled__default["default"].div `
|
|
6881
|
+
width: ${({ width }) => width || '100%'};
|
|
6882
|
+
padding: 4px;
|
|
6883
|
+
&.item-image-container {
|
|
6884
|
+
padding: 16px;
|
|
6885
|
+
${utils.MediaQueries.tdDown} {
|
|
6886
|
+
padding: 7.5px;
|
|
6887
|
+
}
|
|
6888
|
+
${utils.MediaQueries.mbDown} {
|
|
6889
|
+
width: 50%;
|
|
6890
|
+
}
|
|
6891
|
+
}
|
|
6892
|
+
`;
|
|
6893
|
+
const SubotInlineActionListContainer = styled__default["default"].div `
|
|
6894
|
+
display: flex;
|
|
6895
|
+
flex-wrap: wrap;
|
|
6896
|
+
align-items: flex-start;
|
|
6897
|
+
justify-content: center;
|
|
6898
|
+
margin: -4px;
|
|
6899
|
+
|
|
6900
|
+
&.list-container {
|
|
6901
|
+
margin: -16px;
|
|
6902
|
+
${utils.MediaQueries.tdDown} {
|
|
6903
|
+
margin: -7.5px;
|
|
6904
|
+
}
|
|
6905
|
+
}
|
|
6906
|
+
|
|
6907
|
+
&.review-container {
|
|
6908
|
+
margin: -8px;
|
|
6909
|
+
> div {
|
|
6910
|
+
padding: 8px;
|
|
6911
|
+
}
|
|
6912
|
+
}
|
|
6913
|
+
`;
|
|
6914
|
+
|
|
6915
|
+
const SubotInlineAction = ({ actions, value, onChange, htmlType, node_type, formSubmitMeta, }) => {
|
|
6916
|
+
const className = React.useMemo(() => {
|
|
6917
|
+
switch (node_type) {
|
|
6918
|
+
case index$2.NodeType.IMAGE:
|
|
6919
|
+
case index$2.NodeType.REACTION:
|
|
6920
|
+
return 'list-container';
|
|
6921
|
+
default:
|
|
6922
|
+
return '';
|
|
6923
|
+
}
|
|
6924
|
+
}, [node_type]);
|
|
6925
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, actions && !!(actions === null || actions === void 0 ? void 0 : actions.length) && (React__default["default"].createElement(SubotInlineActionListContainer, { className: className }, actions === null || actions === void 0 ? void 0 : actions.map((action) => {
|
|
6926
|
+
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
6927
|
+
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: onChange, active: value === null || value === void 0 ? void 0 : value.includes(action.id), htmlType: htmlType, formSubmitMeta: formSubmitMeta })));
|
|
6928
|
+
})))));
|
|
6929
|
+
};
|
|
6930
|
+
|
|
6931
|
+
const ButtonStyled = styled__default["default"](index$8.Button) `
|
|
6932
|
+
&:disabled {
|
|
6933
|
+
background-color: rgb(242, 242, 242);
|
|
6934
|
+
color: rgb(140, 140, 140);
|
|
6935
|
+
|
|
6936
|
+
&:hover {
|
|
6937
|
+
border: 0;
|
|
6938
|
+
}
|
|
6939
|
+
}
|
|
6940
|
+
svg {
|
|
6941
|
+
path {
|
|
6942
|
+
stroke: currentColor;
|
|
6943
|
+
}
|
|
6944
|
+
}
|
|
6945
|
+
`;
|
|
6946
|
+
const ButtonBackStyled = styled__default["default"](ButtonStyled) `
|
|
6947
|
+
&:disabled {
|
|
6948
|
+
background-color: rgb(242, 242, 242);
|
|
6949
|
+
color: rgb(140, 140, 140);
|
|
6950
|
+
&:hover {
|
|
6951
|
+
border: 0;
|
|
6952
|
+
}
|
|
6953
|
+
}
|
|
6954
|
+
svg {
|
|
6955
|
+
path {
|
|
6956
|
+
stroke: currentColor;
|
|
6957
|
+
}
|
|
6958
|
+
}
|
|
6959
|
+
`;
|
|
6960
|
+
const SubotInlineFooterStyled = styled__default["default"].div `
|
|
6961
|
+
display: flex;
|
|
6962
|
+
align-items: center;
|
|
6963
|
+
justify-content: flex-end;
|
|
6964
|
+
padding: 16px 32px;
|
|
6965
|
+
border-top: 4px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
6966
|
+
.mantine-Button-root {
|
|
6967
|
+
+ .mantine-Button-root {
|
|
6968
|
+
margin-left: 8px;
|
|
6969
|
+
}
|
|
6970
|
+
}
|
|
6971
|
+
${utils.MediaQueries.tdDown} {
|
|
6972
|
+
padding: 12px 24px;
|
|
6973
|
+
}
|
|
6974
|
+
${utils.MediaQueries.mbDown} {
|
|
6975
|
+
padding: 12px 16px;
|
|
6976
|
+
}
|
|
6977
|
+
`;
|
|
6978
|
+
|
|
6979
|
+
const SubotInlineActionTextChoice = ({ action, onChange, active, htmlType, formSubmitMeta, }) => {
|
|
6980
|
+
const { trackingCommonInline } = React.useContext(SubotInlineContext);
|
|
6981
|
+
const inputRef = React.useRef(null);
|
|
6982
|
+
const [otherText, setOtherText] = React.useState('');
|
|
6983
|
+
const isActionPollWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
|
|
6984
|
+
const isActionSelectWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
|
|
6985
|
+
isActionPollWithOther;
|
|
6986
|
+
const onChangeTextArea = (evt) => {
|
|
6987
|
+
setOtherText(evt.target.value);
|
|
6988
|
+
if (isActionSelectWithOther) {
|
|
6989
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(action, [
|
|
6990
|
+
{
|
|
6991
|
+
key: KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD,
|
|
6992
|
+
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type] || 'text',
|
|
6993
|
+
value: evt.target.value,
|
|
6994
|
+
action_id: action.id,
|
|
6995
|
+
},
|
|
6996
|
+
]);
|
|
6997
|
+
}
|
|
6998
|
+
};
|
|
6999
|
+
React.useEffect(() => {
|
|
7000
|
+
var _a, _b;
|
|
7001
|
+
if (active) {
|
|
7002
|
+
setOtherText(((_a = formSubmitMeta === null || formSubmitMeta === void 0 ? void 0 : formSubmitMeta.find((f) => f.key === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD)) === null || _a === void 0 ? void 0 : _a.value) || '');
|
|
7003
|
+
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
7004
|
+
}
|
|
7005
|
+
}, [active, formSubmitMeta]);
|
|
7006
|
+
return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7007
|
+
React__default["default"].createElement(SubotInlineActionText, Object.assign({ active: !!active, onClick: () => onChange === null || onChange === void 0 ? void 0 : onChange(action), className: "pointer-event-child-none" }, trackingCommonInline, { "data-response-id": action === null || action === void 0 ? void 0 : action.id, "data-event-action": "Answer Click" }),
|
|
7008
|
+
React__default["default"].createElement("div", { className: "label" },
|
|
7009
|
+
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label)),
|
|
7010
|
+
React__default["default"].createElement("div", { className: "icon" }, htmlType === 'checkbox' && (React__default["default"].createElement(CheckboxIcon, { className: "icon-checkbox", viewBox: "0 0 22 22" })))),
|
|
7011
|
+
isActionSelectWithOther && active && (React__default["default"].createElement(core.Box, { mt: "6px", style: { textAlign: 'right' } },
|
|
7012
|
+
React__default["default"].createElement(core.Textarea, { ref: inputRef, placeholder: action === null || action === void 0 ? void 0 : action.label, styles: {
|
|
7013
|
+
input: {
|
|
7014
|
+
paddingLeft: '24px',
|
|
7015
|
+
paddingRight: '24px',
|
|
7016
|
+
boxShadow: 'none',
|
|
7017
|
+
':focus': { boxShadow: 'none' },
|
|
7018
|
+
},
|
|
7019
|
+
}, value: otherText, onChange: onChangeTextArea, maxLength: 360 })))));
|
|
7020
|
+
};
|
|
7021
|
+
const SubotInlineActionImageChoice = ({ action, onChange, active, htmlType, }) => {
|
|
7022
|
+
const { trackingCommonInline } = React.useContext(SubotInlineContext);
|
|
7023
|
+
return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "45%", className: 'item-image-container' },
|
|
7024
|
+
React__default["default"].createElement(SubotInlineActionImage, Object.assign({ onClick: () => onChange && onChange(action), active: !!active }, trackingCommonInline, { "data-response-id": action === null || action === void 0 ? void 0 : action.id, "data-event-action": "Answer Click" }),
|
|
7025
|
+
React__default["default"].createElement("div", { className: "image-container" },
|
|
7026
|
+
React__default["default"].createElement("img", { loading: "lazy", src: action === null || action === void 0 ? void 0 : action.url, alt: action === null || action === void 0 ? void 0 : action.label, className: "image" })),
|
|
7027
|
+
(action === null || action === void 0 ? void 0 : action.label) && (React__default["default"].createElement("div", { className: "label" },
|
|
7028
|
+
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))),
|
|
7029
|
+
React__default["default"].createElement("div", { className: "icon" }, htmlType === 'checkbox' && (React__default["default"].createElement(CheckboxIcon, { className: "icon-checkbox", viewBox: "0 0 22 22" }))))));
|
|
7030
|
+
};
|
|
7031
|
+
const SubotInlineActionSSO = ({ action, onChange, }) => {
|
|
7032
|
+
const { trackingCommonInline } = React.useContext(SubotInlineContext);
|
|
7033
|
+
return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "50%", style: { alignSelf: 'center' } },
|
|
7034
|
+
React__default["default"].createElement(ButtonStyled, Object.assign({ onClick: () => onChange && onChange(action), size: "lg", isBlock: true }, trackingCommonInline, { className: "pointer-event-child-none", "data-event-action": "Login Click", "data-response-id": action === null || action === void 0 ? void 0 : action.id }),
|
|
7035
|
+
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
|
|
7036
|
+
};
|
|
7037
|
+
const SubotInlinePollChoice = ({ active, action, onChange, htmlType, node_type, }) => {
|
|
7038
|
+
const handleOnChange = (action) => {
|
|
7039
|
+
if (action)
|
|
7040
|
+
onChange &&
|
|
7041
|
+
onChange({
|
|
7042
|
+
key: (action === null || action === void 0 ? void 0 : action.key) || '',
|
|
7043
|
+
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
|
|
7044
|
+
value: '',
|
|
7045
|
+
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
7046
|
+
});
|
|
7047
|
+
};
|
|
7048
|
+
if (node_type === index$2.NodeType.RESULT_POLL)
|
|
7049
|
+
return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7050
|
+
React__default["default"].createElement(SubotInlineActionPollChoiceResult, { percent: (action === null || action === void 0 ? void 0 : action.percent) || 0, is_chosen: action === null || action === void 0 ? void 0 : action.is_chosen },
|
|
7051
|
+
React__default["default"].createElement("div", { className: "number" }, action === null || action === void 0 ? void 0 :
|
|
7052
|
+
action.percent,
|
|
7053
|
+
"%"),
|
|
7054
|
+
React__default["default"].createElement("div", { className: "content" }, action === null || action === void 0 ? void 0 : action.label),
|
|
7055
|
+
React__default["default"].createElement("div", { className: "icon" }, (action === null || action === void 0 ? void 0 : action.is_chosen) && React__default["default"].createElement(CheckIcon, { viewBox: "0 0 16 16" })))));
|
|
7056
|
+
return (React__default["default"].createElement(SubotInlineActionTextChoice, { active: !!active, action: action, onChange: handleOnChange, htmlType: htmlType }));
|
|
7057
|
+
};
|
|
7058
|
+
const SubotInlinePollChoiceImage = ({ active, action, onChange, htmlType, node_type, }) => {
|
|
7059
|
+
const handleOnChange = (action) => {
|
|
7060
|
+
if (action)
|
|
7061
|
+
onChange &&
|
|
7062
|
+
onChange({
|
|
7063
|
+
key: action === null || action === void 0 ? void 0 : action.key,
|
|
7064
|
+
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
|
|
7065
|
+
value: '',
|
|
7066
|
+
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
7067
|
+
});
|
|
7068
|
+
};
|
|
7069
|
+
if (node_type === index$2.NodeType.RESULT_POLL)
|
|
7070
|
+
// TODO: Update layout result poll image
|
|
7071
|
+
return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7072
|
+
React__default["default"].createElement(SubotInlineActionPollChoiceResult, { percent: (action === null || action === void 0 ? void 0 : action.percent) || 0, is_chosen: action === null || action === void 0 ? void 0 : action.is_chosen },
|
|
7073
|
+
React__default["default"].createElement("div", { className: "number" }, action === null || action === void 0 ? void 0 :
|
|
7074
|
+
action.percent,
|
|
7075
|
+
"%"),
|
|
7076
|
+
React__default["default"].createElement("div", { className: "content" }, action === null || action === void 0 ? void 0 : action.label),
|
|
7077
|
+
React__default["default"].createElement("div", { className: "icon" }, (action === null || action === void 0 ? void 0 : action.is_chosen) && React__default["default"].createElement(CheckIcon, { viewBox: "0 0 16 16" })))));
|
|
7078
|
+
return (React__default["default"].createElement(SubotInlineActionImageChoice, { active: !!active, action: action, onChange: handleOnChange, htmlType: htmlType }));
|
|
7079
|
+
};
|
|
7080
|
+
const SubotInlineRatingStar = ({ action, value, onChange, }) => {
|
|
7081
|
+
var _a, _b;
|
|
7082
|
+
return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7083
|
+
React__default["default"].createElement(SubotInlineActionRatingStartContainer, null,
|
|
7084
|
+
React__default["default"].createElement(StarRatings__default["default"], { rating: value && typeof value !== 'string' && (value === null || value === void 0 ? void 0 : value.value)
|
|
7085
|
+
? parseInt(value === null || value === void 0 ? void 0 : value.value)
|
|
7086
|
+
: 0, changeRating: (star) => {
|
|
7087
|
+
const _value = {
|
|
7088
|
+
key: action === null || action === void 0 ? void 0 : action.key,
|
|
7089
|
+
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
|
|
7090
|
+
value: star.toString(),
|
|
7091
|
+
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
7092
|
+
};
|
|
7093
|
+
onChange && onChange(_value);
|
|
7094
|
+
}, starHoverColor: (_a = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.yellow600, starRatedColor: (_b = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.yellow600, starDimension: "48" }))));
|
|
7095
|
+
};
|
|
7096
|
+
const SubotInlineTextArea = ({ action, value, onChange, }) => {
|
|
7097
|
+
return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7098
|
+
React__default["default"].createElement(SubotInlineActionRatingDescriptionContainer, null,
|
|
7099
|
+
React__default["default"].createElement(index$c.TextArea, { placeholder: action === null || action === void 0 ? void 0 : action.label, value: value && typeof value !== 'string' && (value === null || value === void 0 ? void 0 : value.value)
|
|
7100
|
+
? value === null || value === void 0 ? void 0 : value.value
|
|
7101
|
+
: '', onChange: (evt) => {
|
|
7102
|
+
const _value = {
|
|
7103
|
+
key: action === null || action === void 0 ? void 0 : action.key,
|
|
7104
|
+
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
|
|
7105
|
+
value: evt.target.value,
|
|
7106
|
+
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
7107
|
+
};
|
|
7108
|
+
onChange && onChange(_value);
|
|
7109
|
+
} }))));
|
|
7110
|
+
};
|
|
7111
|
+
const SubotInlineLikeChoice = ({ action, active, onChange, }) => {
|
|
7112
|
+
return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "40%", className: 'item-image-container' },
|
|
7113
|
+
React__default["default"].createElement(SubotInlineButtonReaction, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange && onChange(action) },
|
|
7114
|
+
React__default["default"].createElement(LikeIcon, { viewBox: "0 0 24 24" }),
|
|
7115
|
+
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
|
|
7116
|
+
};
|
|
7117
|
+
const SubotInlineDislikeChoice = ({ action, active, onChange, }) => {
|
|
7118
|
+
return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "40%", className: 'item-image-container' },
|
|
7119
|
+
React__default["default"].createElement(SubotInlineButtonReaction, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange && onChange(action) },
|
|
7120
|
+
React__default["default"].createElement(DislikeIcon, { viewBox: "0 0 24 24" }),
|
|
7121
|
+
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
|
|
7122
|
+
};
|
|
7123
|
+
const SubotInlineReviewChoice = ({ active, action, onChange, }) => (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "auto", className: "review-choice" },
|
|
7124
|
+
React__default["default"].createElement(SubotInlineButtonReview, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange &&
|
|
7125
|
+
onChange({
|
|
7126
|
+
key: action === null || action === void 0 ? void 0 : action.key,
|
|
7127
|
+
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
|
|
7128
|
+
value: '',
|
|
7129
|
+
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
7130
|
+
}) },
|
|
7131
|
+
React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
|
|
7132
|
+
const SubotInlinePollResult = ({ action, }) => (React__default["default"].createElement(SubotInlineActionItemContainer, null,
|
|
7133
|
+
React__default["default"].createElement(SubotInlineActionPollResult, null, action === null || action === void 0 ? void 0 : action.label)));
|
|
7134
|
+
const SubotInlineActionBase = {
|
|
7135
|
+
'user-image': SubotInlineActionImageChoice,
|
|
7136
|
+
[index$2.NodeActionType.USER_CHOICE_TEXT]: SubotInlineActionTextChoice,
|
|
7137
|
+
[index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT]: SubotInlineActionTextChoice,
|
|
7138
|
+
[index$2.NodeActionType.USER_CHOICE_IMAGE]: SubotInlineActionImageChoice,
|
|
7139
|
+
[index$2.NodeActionType.ACTION_SSO_REDIRECT]: SubotInlineActionSSO,
|
|
7140
|
+
[index$2.NodeActionType.POLL_CHOICE]: SubotInlinePollChoice,
|
|
7141
|
+
[index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT]: SubotInlineActionTextChoice,
|
|
7142
|
+
[index$2.NodeActionType.POLL_CHOICE_IMAGE]: SubotInlinePollChoiceImage,
|
|
7143
|
+
[index$2.NodeActionType.RATING_STAR]: SubotInlineRatingStar,
|
|
7144
|
+
[index$2.NodeActionType.RATING_DESCRIPTION]: SubotInlineTextArea,
|
|
7145
|
+
[index$2.NodeActionType.LIKE_CHOICE]: SubotInlineLikeChoice,
|
|
7146
|
+
[index$2.NodeActionType.DISLIKE_CHOICE]: SubotInlineDislikeChoice,
|
|
7147
|
+
[index$2.NodeActionType.REVIEW_CHOICE]: SubotInlineReviewChoice,
|
|
7148
|
+
[index$2.NodeActionType.REVIEW_DESCRIPTION]: SubotInlineTextArea,
|
|
7149
|
+
[index$2.NodeActionType.RESULT_BUTTON]: SubotInlineActionTextChoice,
|
|
7150
|
+
[index$2.NodeActionType.POLL_RESULT]: SubotInlinePollResult,
|
|
7151
|
+
};
|
|
7152
|
+
|
|
7153
|
+
const SubotInlineFooter = ({ onBack, onNext: onSubmit, hideBack, hideNext, nextText, backProps, nextProps, }) => {
|
|
7154
|
+
var _a, _b, _c;
|
|
7155
|
+
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
7156
|
+
const { nodes: listNodes, activeId, params, onNext, trackingCommonInline, } = React.useContext(SubotInlineContext);
|
|
7157
|
+
const nodeMessage = listNodes.find((nodeItem) => nodeItem.id == activeId);
|
|
7158
|
+
const actionNextChoice = (_a = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage.actions) === null || _a === void 0 ? void 0 : _a.find((act) => act.type === index$2.NodeActionType.USER_CHOICE_NEXT);
|
|
7159
|
+
const handleNextChoice = () => {
|
|
7160
|
+
if (nodeMessage && actionNextChoice) {
|
|
7161
|
+
const nextValue = {
|
|
7162
|
+
node_id: nodeMessage.id,
|
|
7163
|
+
action_id: actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.id,
|
|
7164
|
+
action_value: actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.key,
|
|
7165
|
+
};
|
|
7166
|
+
onNext === null || onNext === void 0 ? void 0 : onNext(Object.assign(Object.assign(Object.assign({}, params), nextValue), nodeMessage._message));
|
|
7167
|
+
}
|
|
7168
|
+
};
|
|
7169
|
+
const actionSubmitMultiple = (_b = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage.actions) === null || _b === void 0 ? void 0 : _b.find((act) => act.type === index$2.NodeActionType.ACTION_MULTIPLE_BUTTON);
|
|
7170
|
+
return (React__default["default"].createElement(SubotInlineFooterStyled, null,
|
|
7171
|
+
!hideBack && (React__default["default"].createElement(ButtonBackStyled, Object.assign({ size: "md", color: "secondary", onClick: onBack }, backProps, { className: classNames__default["default"]('pointer-event-child-none', backProps === null || backProps === void 0 ? void 0 : backProps.className) }, trackingCommonInline, { "data-event-action": "Back Click" }),
|
|
7172
|
+
React__default["default"].createElement(ArrowLeft, { style: { marginRight: 10 } }),
|
|
7173
|
+
f({
|
|
7174
|
+
id: 'riskScreener.back',
|
|
7175
|
+
defaultMessage: 'Back',
|
|
7176
|
+
}))),
|
|
7177
|
+
!hideNext && (React__default["default"].createElement(ButtonStyled, Object.assign({ size: "md", color: "primary", onClick: actionNextChoice ? handleNextChoice : onSubmit }, nextProps, { className: classNames__default["default"]('pointer-event-child-none', nextProps === null || nextProps === void 0 ? void 0 : nextProps.className) }, trackingCommonInline, { "data-event-action": "Answer Click", "data-response-id": (actionSubmitMultiple === null || actionSubmitMultiple === void 0 ? void 0 : actionSubmitMultiple.id) ||
|
|
7178
|
+
(actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.id) ||
|
|
7179
|
+
((_c = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage._message) === null || _c === void 0 ? void 0 : _c.action_id) }),
|
|
7180
|
+
!nextText
|
|
7181
|
+
? f({
|
|
7182
|
+
id: 'riskScreener.next',
|
|
7183
|
+
defaultMessage: 'Next',
|
|
7184
|
+
})
|
|
7185
|
+
: nextText,
|
|
7186
|
+
React__default["default"].createElement(ArrowRight, { style: { marginLeft: 10 } })))));
|
|
7187
|
+
};
|
|
7188
|
+
var SubotInlineFooter$1 = React.memo(SubotInlineFooter);
|
|
7189
|
+
|
|
7190
|
+
const SubotInlineHeadline = styled__default["default"].h4 `
|
|
7191
|
+
padding: 32px 0px 12px;
|
|
7192
|
+
border-bottom: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
|
|
7193
|
+
margin: 0px 32px;
|
|
7194
|
+
color: ${miscTheme.theme.colors.gray500 || '#737373'};
|
|
7195
|
+
font-size: 14px;
|
|
7196
|
+
font-weight: 700;
|
|
7197
|
+
line-height: 1.5;
|
|
7198
|
+
${utils.MediaQueries.tdDown} {
|
|
7199
|
+
padding: 24px 0px 12px;
|
|
7200
|
+
margin: 0px 24px;
|
|
7201
|
+
}
|
|
7202
|
+
${utils.MediaQueries.mbDown} {
|
|
7203
|
+
padding: 16px 0px 12px;
|
|
7204
|
+
margin: 0px 16px;
|
|
7205
|
+
}
|
|
7206
|
+
`;
|
|
7207
|
+
const SubotInlineHeader = () => {
|
|
7208
|
+
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
7209
|
+
const { nodes } = React.useContext(SubotInlineContext);
|
|
7210
|
+
const headline = React.useMemo(() => { var _a; return (_a = nodes[0]) === null || _a === void 0 ? void 0 : _a.inline_headline; }, [nodes]);
|
|
7211
|
+
return (React__default["default"].createElement(SubotInlineHeadline, null, headline ||
|
|
7212
|
+
f({
|
|
7213
|
+
id: 'subotInline.quote',
|
|
7214
|
+
defaultMessage: 'HAVE TIME FOR A QUICK QUESTION?',
|
|
7215
|
+
})));
|
|
7216
|
+
};
|
|
7217
|
+
var SubotInlineHeader$1 = React.memo(SubotInlineHeader);
|
|
7218
|
+
|
|
7219
|
+
const SubotInlineIntentTitle = styled__default["default"].h3 `
|
|
7220
|
+
margin-bottom: 0px;
|
|
7221
|
+
font-size: 22px;
|
|
7222
|
+
font-weight: bold;
|
|
7223
|
+
line-height: 1.45;
|
|
7224
|
+
${utils.MediaQueries.tdDown} {
|
|
7225
|
+
font-size: 20px;
|
|
7226
|
+
}
|
|
7227
|
+
`;
|
|
7228
|
+
const SubotInlineRecalculateButton = styled__default["default"](index$8.Button) `
|
|
7229
|
+
&.bot-recalculate {
|
|
7230
|
+
svg {
|
|
7231
|
+
path {
|
|
7232
|
+
stroke: ${miscTheme.theme.colors.primaryBase || '#2685F1'} !important;
|
|
7233
|
+
}
|
|
7234
|
+
}
|
|
7235
|
+
&:hover {
|
|
7236
|
+
svg {
|
|
7237
|
+
path {
|
|
7238
|
+
stroke: #fff !important;
|
|
7239
|
+
}
|
|
7240
|
+
}
|
|
7241
|
+
}
|
|
7242
|
+
}
|
|
7243
|
+
`;
|
|
7244
|
+
const SubotInlineIntentButton = styled__default["default"](index$8.Button) `
|
|
7245
|
+
border: 2px solid transparent;
|
|
7246
|
+
`;
|
|
7247
|
+
const SubotInlineItemIcon = styled__default["default"].div `
|
|
7248
|
+
display: flex;
|
|
7249
|
+
padding-top: 10px;
|
|
7250
|
+
padding-bottom: 10px;
|
|
7251
|
+
.icon {
|
|
7252
|
+
width: 64px;
|
|
7253
|
+
height: 64px;
|
|
7254
|
+
margin-right: 16px;
|
|
7255
|
+
object-fit: contain;
|
|
7256
|
+
object-position: center;
|
|
7257
|
+
}
|
|
7258
|
+
.content {
|
|
7259
|
+
flex: 1;
|
|
7260
|
+
.title {
|
|
7261
|
+
margin-top: 0;
|
|
7262
|
+
margin-bottom: 0;
|
|
7263
|
+
font-size: inherit;
|
|
7264
|
+
font-weight: 700;
|
|
7265
|
+
line-height: 1.4;
|
|
7266
|
+
}
|
|
7267
|
+
.description {
|
|
7268
|
+
color: ${miscTheme.theme.colors.gray700 || '#404040'};
|
|
7269
|
+
line-height: 1.4;
|
|
7270
|
+
}
|
|
7271
|
+
}
|
|
7272
|
+
${utils.MediaQueries.mbDown} {
|
|
7273
|
+
.icon {
|
|
7274
|
+
width: 47px;
|
|
7275
|
+
height: 47px;
|
|
7276
|
+
margin-right: 16px;
|
|
7277
|
+
}
|
|
7278
|
+
.content {
|
|
7279
|
+
.title {
|
|
7280
|
+
font-size: 14px;
|
|
7281
|
+
}
|
|
7282
|
+
.description {
|
|
7283
|
+
font-size: 14px;
|
|
7284
|
+
}
|
|
7285
|
+
}
|
|
7286
|
+
}
|
|
7287
|
+
`;
|
|
7288
|
+
styled__default["default"](index$8.Button) ``;
|
|
7289
|
+
const SubotInlineIntentFirstTextWrapper = styled__default["default"].div `
|
|
7290
|
+
display: flex;
|
|
7291
|
+
align-items: flex-start;
|
|
7292
|
+
color: ${miscTheme.theme.colors.gray800 || '#262626'};
|
|
7293
|
+
font-size: 22px;
|
|
7294
|
+
font-weight: 700;
|
|
7295
|
+
letter-space: -0.6px;
|
|
7296
|
+
line-height: 1.45;
|
|
7297
|
+
.number {
|
|
7298
|
+
margin-right: 3px;
|
|
7299
|
+
}
|
|
7300
|
+
.title {
|
|
7301
|
+
flex: 1;
|
|
7302
|
+
}
|
|
7303
|
+
${utils.MediaQueries.tdDown} {
|
|
7304
|
+
font-size: 20px;
|
|
7305
|
+
}
|
|
7306
|
+
${utils.MediaQueries.mbDown} {
|
|
7307
|
+
font-size: 18px;
|
|
7308
|
+
}
|
|
7309
|
+
`;
|
|
7310
|
+
const SubotInlineIntentFirstImageWrapper = styled__default["default"].div `
|
|
7311
|
+
display: flex;
|
|
7312
|
+
justify-content: center;
|
|
7313
|
+
`;
|
|
7314
|
+
const SubotInlineIntentFirstTextContainer = styled__default["default"].div ``;
|
|
7315
|
+
const SubotInlineIntentTextContainer = styled__default["default"].div `
|
|
7316
|
+
padding: 12px 16px;
|
|
7317
|
+
border: 1px solid ${miscTheme.theme.colors.gray200 || '#D9D9D9'};
|
|
7318
|
+
background-color: ${miscTheme.theme.colors.white || '#fff'};
|
|
7319
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
7320
|
+
line-height: 1.5;
|
|
7321
|
+
`;
|
|
7322
|
+
const SubotInlineIntentImageContainer = styled__default["default"].div `
|
|
7323
|
+
border: ${miscTheme.theme.colors.gray200 || '#D9D9D9'};
|
|
7324
|
+
background-color: ${miscTheme.theme.colors.white || '#FFF'};
|
|
7325
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
7326
|
+
.intent-img {
|
|
7327
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
7328
|
+
&.has-label {
|
|
7329
|
+
border-bottom-left-radius: 0px;
|
|
7330
|
+
border-bottom-right-radius: 0px;
|
|
7331
|
+
}
|
|
7332
|
+
}
|
|
7333
|
+
.intent-img-label {
|
|
7334
|
+
padding: 5px 10px;
|
|
7335
|
+
font-size: 0.8em;
|
|
7336
|
+
font-style: italic;
|
|
7337
|
+
font-weight: 400;
|
|
7338
|
+
}
|
|
7339
|
+
`;
|
|
7340
|
+
const SubotInlineIntentUrlContainer = styled__default["default"].div `
|
|
7341
|
+
display: flex;
|
|
7342
|
+
.feature {
|
|
7343
|
+
width: 30%;
|
|
7344
|
+
.feature-wrapper {
|
|
7345
|
+
position: relative;
|
|
7346
|
+
display: block;
|
|
7347
|
+
overflow: hidden;
|
|
7348
|
+
width: 100%;
|
|
7349
|
+
padding-top: 66%;
|
|
7350
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
7351
|
+
.feature-img {
|
|
7352
|
+
position: absolute;
|
|
7353
|
+
top: 50%;
|
|
7354
|
+
left: 50%;
|
|
7355
|
+
width: 100%;
|
|
7356
|
+
min-width: 100%;
|
|
7357
|
+
height: auto;
|
|
7358
|
+
min-height: 100%;
|
|
7359
|
+
transform: translate(-50%, -50%);
|
|
7360
|
+
}
|
|
7361
|
+
}
|
|
7362
|
+
}
|
|
7363
|
+
.body {
|
|
7364
|
+
flex: 1;
|
|
7365
|
+
margin-left: 10px;
|
|
7366
|
+
line-height: 1.5;
|
|
7367
|
+
a {
|
|
7368
|
+
color: ${miscTheme.theme.colors.gray800 || '#262626'};
|
|
7369
|
+
text-decoration: none;
|
|
7370
|
+
}
|
|
7371
|
+
}
|
|
7372
|
+
`;
|
|
7373
|
+
const SubotInlineIntentRiskScreenerContainer = styled__default["default"].div `
|
|
7374
|
+
display: flex;
|
|
7375
|
+
align-items: center;
|
|
7376
|
+
justify-content: space-between;
|
|
7377
|
+
padding: 20px 40px 20px 16px;
|
|
7378
|
+
background-color: #fff;
|
|
7379
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
7380
|
+
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 2px rgba(0, 0, 0, 0.06),
|
|
7381
|
+
0px 0px 1px rgba(0, 0, 0, 0.04);
|
|
7382
|
+
.feature {
|
|
7383
|
+
display: block;
|
|
7384
|
+
overflow: hidden;
|
|
7385
|
+
width: 72px;
|
|
7386
|
+
height: 72px;
|
|
7387
|
+
margin-right: 16px;
|
|
7388
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
7389
|
+
img {
|
|
7390
|
+
width: 100%;
|
|
7391
|
+
height: 100%;
|
|
7392
|
+
object-fit: cover;
|
|
7393
|
+
object-position: center;
|
|
7394
|
+
}
|
|
7395
|
+
}
|
|
7396
|
+
.title-container {
|
|
7397
|
+
display: flex;
|
|
7398
|
+
flex: 1;
|
|
7399
|
+
align-items: center;
|
|
7400
|
+
justify-content: space-between;
|
|
7401
|
+
a {
|
|
7402
|
+
font-size: 16px;
|
|
7403
|
+
line-height: 1.5em;
|
|
7404
|
+
text-decoration: none;
|
|
7405
|
+
.title {
|
|
7406
|
+
padding: 0;
|
|
7407
|
+
color: #262626;
|
|
7408
|
+
font-size: inherit;
|
|
7409
|
+
line-height: inherit;
|
|
7410
|
+
}
|
|
7411
|
+
&.link {
|
|
7412
|
+
display: flex;
|
|
7413
|
+
align-items: center;
|
|
7414
|
+
justify-content: center;
|
|
7415
|
+
margin-left: 20px;
|
|
7416
|
+
color: #2d87f3;
|
|
7417
|
+
font-weight: 700;
|
|
7418
|
+
}
|
|
7419
|
+
}
|
|
7420
|
+
}
|
|
7421
|
+
@media screen and (max-width: 769px) {
|
|
7422
|
+
padding: 16px 12px;
|
|
7423
|
+
.feature {
|
|
7424
|
+
width: 50px;
|
|
7425
|
+
height: 50px;
|
|
7426
|
+
}
|
|
7427
|
+
.title-container {
|
|
7428
|
+
a {
|
|
7429
|
+
font-size: 13px;
|
|
7430
|
+
line-height: 20px;
|
|
7431
|
+
&.link {
|
|
7432
|
+
margin-left: 10px;
|
|
7433
|
+
}
|
|
7434
|
+
}
|
|
7435
|
+
}
|
|
7436
|
+
}
|
|
7437
|
+
`;
|
|
7438
|
+
const SubotInlineIntentFinalButtonContainer = styled__default["default"].div `
|
|
7439
|
+
display: flex;
|
|
7440
|
+
align-items: center;
|
|
7441
|
+
justify-content: center;
|
|
7442
|
+
`;
|
|
7443
|
+
styled__default["default"].div `
|
|
7444
|
+
padding: 16px;
|
|
7445
|
+
margin-top: 32px;
|
|
7446
|
+
margin-bottom: 32px;
|
|
7447
|
+
background-color: ${miscTheme.theme.colors.primary50 || ''};
|
|
7448
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
7449
|
+
.item-grid {
|
|
7450
|
+
> div {
|
|
7451
|
+
box-shadow: none;
|
|
7452
|
+
}
|
|
7453
|
+
}
|
|
7454
|
+
.lp--affiliate-product {
|
|
7455
|
+
.arrow-left {
|
|
7456
|
+
left: -20px;
|
|
7457
|
+
}
|
|
7458
|
+
.arrow-right {
|
|
7459
|
+
right: -16px;
|
|
7460
|
+
}
|
|
7461
|
+
}
|
|
7462
|
+
.bullet-nav {
|
|
7463
|
+
bottom: -10px;
|
|
7464
|
+
}
|
|
7465
|
+
`;
|
|
7466
|
+
const SubotInlineIntentFinalCol = styled__default["default"].div `
|
|
7467
|
+
width: ${({ width }) => width || '100%'};
|
|
7468
|
+
padding: 8px;
|
|
7469
|
+
${utils.MediaQueries.mbDown} {
|
|
7470
|
+
width: 100%;
|
|
7471
|
+
}
|
|
7472
|
+
`;
|
|
7473
|
+
const SubotInlineIntentFinalRow = styled__default["default"].div `
|
|
7474
|
+
display: flex;
|
|
7475
|
+
flex-wrap: wrap;
|
|
7476
|
+
align-items: flex-start;
|
|
7477
|
+
justify-content: center;
|
|
7478
|
+
margin: 0 -8px;
|
|
7479
|
+
`;
|
|
7480
|
+
const SubotInlineIntentCol = styled__default["default"].div `
|
|
7481
|
+
width: ${({ width }) => width || '100%'};
|
|
7482
|
+
padding: 4px;
|
|
7483
|
+
${utils.MediaQueries.mbDown} {
|
|
7484
|
+
width: 100%;
|
|
7485
|
+
}
|
|
7486
|
+
`;
|
|
7487
|
+
const SubotInlineIntentRow = styled__default["default"].div `
|
|
7488
|
+
display: flex;
|
|
7489
|
+
flex-wrap: wrap;
|
|
7490
|
+
align-items: flex-start;
|
|
7491
|
+
justify-content: center;
|
|
7492
|
+
margin: 0 -4px;
|
|
7493
|
+
`;
|
|
7494
|
+
const SubotInlineIntentList = styled__default["default"].div `
|
|
7495
|
+
margin-top: 20px;
|
|
7496
|
+
`;
|
|
7497
|
+
|
|
7498
|
+
const SubotInlineIntent = ({ intents, indexNumber, }) => {
|
|
7499
|
+
var _a, _b;
|
|
7500
|
+
const title = React.useMemo(() => {
|
|
7501
|
+
const _title = intents && intents[0];
|
|
7502
|
+
if (_title)
|
|
7503
|
+
return _title;
|
|
7504
|
+
return null;
|
|
7505
|
+
}, []);
|
|
7506
|
+
if (!intents.length)
|
|
7507
|
+
return React__default["default"].createElement(SubotInlineIntentBotTitle, { indexNumber: indexNumber });
|
|
7508
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
7509
|
+
title && (React__default["default"].createElement(SubotInlineIntentBotTitle, { intent: title, indexNumber: indexNumber })),
|
|
7510
|
+
!!((_a = intents.slice(1)) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineIntentList, null,
|
|
7511
|
+
React__default["default"].createElement(SubotInlineIntentRow, null, (_b = intents.slice(1)) === null || _b === void 0 ? void 0 : _b.map((intent) => {
|
|
7512
|
+
const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
|
|
7513
|
+
return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
|
|
7514
|
+
}))))));
|
|
7515
|
+
};
|
|
7516
|
+
|
|
7517
|
+
const SubotInlineIntentFinal = ({ intents: intentsProps, }) => {
|
|
7518
|
+
const intents = React.useMemo(() => {
|
|
7519
|
+
const mainIntents = [];
|
|
7520
|
+
const subIntents = [];
|
|
7521
|
+
const rest = [];
|
|
7522
|
+
intentsProps === null || intentsProps === void 0 ? void 0 : intentsProps.map((intent) => {
|
|
7523
|
+
switch (intent === null || intent === void 0 ? void 0 : intent.type) {
|
|
7524
|
+
case index$2.NodeIntentType.BOT_MAIN_IMAGE:
|
|
7525
|
+
mainIntents.push(intent);
|
|
7526
|
+
break;
|
|
7527
|
+
case index$2.NodeIntentType.BOT_MAIN_TITLE:
|
|
7528
|
+
mainIntents.push(intent);
|
|
7529
|
+
break;
|
|
7530
|
+
case index$2.NodeIntentType.BOT_MAIN_BODY:
|
|
7531
|
+
mainIntents.push(intent);
|
|
7532
|
+
break;
|
|
7533
|
+
case index$2.NodeIntentType.BOT_MAIN_BUTTON:
|
|
7534
|
+
mainIntents.push(intent);
|
|
7535
|
+
break;
|
|
7536
|
+
case index$2.NodeIntentType.BOT_RECALCULATE:
|
|
7537
|
+
mainIntents.push(intent);
|
|
7538
|
+
break;
|
|
7539
|
+
case index$2.NodeIntentType.BOT_SUB_TITLE:
|
|
7540
|
+
subIntents.push(intent);
|
|
7541
|
+
break;
|
|
7542
|
+
case index$2.NodeIntentType.BOT_SUB_BODY:
|
|
7543
|
+
subIntents.push(intent);
|
|
7544
|
+
break;
|
|
7545
|
+
default:
|
|
7546
|
+
rest.push(intent);
|
|
7547
|
+
break;
|
|
7548
|
+
}
|
|
7549
|
+
});
|
|
7550
|
+
return {
|
|
7551
|
+
mainIntents,
|
|
7552
|
+
subIntents,
|
|
7553
|
+
intents: rest,
|
|
7554
|
+
};
|
|
7555
|
+
}, []);
|
|
7556
|
+
if (!(intentsProps === null || intentsProps === void 0 ? void 0 : intentsProps.length)) {
|
|
7557
|
+
return null;
|
|
7558
|
+
}
|
|
7559
|
+
function renderIntent(intent) {
|
|
7560
|
+
const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
|
|
7561
|
+
if (!NodeIntent) {
|
|
7562
|
+
return null;
|
|
7563
|
+
}
|
|
7564
|
+
return React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
7565
|
+
}
|
|
7566
|
+
return (React__default["default"].createElement(SubotInlineIntentRow, null,
|
|
7567
|
+
React__default["default"].createElement(SubotInlineIntentCol, null,
|
|
7568
|
+
React__default["default"].createElement(SubotInlineIntentFinalRow, null,
|
|
7569
|
+
intents.mainIntents.map(renderIntent),
|
|
7570
|
+
intents.subIntents.map(renderIntent),
|
|
7571
|
+
intents.intents.map(renderIntent)))));
|
|
7572
|
+
};
|
|
7573
|
+
|
|
7574
|
+
/*******************************************************************************/
|
|
7575
|
+
/*************************** NodeIntentType: 'bot-text' ************************/
|
|
7576
|
+
//#region
|
|
7577
|
+
const SubotInlineIntentBotText = ({ intent, }) => {
|
|
7578
|
+
if (!(intent === null || intent === void 0 ? void 0 : intent.label))
|
|
7579
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7580
|
+
return (React__default["default"].createElement(SubotInlineIntentCol, null,
|
|
7581
|
+
React__default["default"].createElement(SubotInlineIntentTextContainer, null,
|
|
7582
|
+
React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
|
|
7583
|
+
};
|
|
7584
|
+
//#endregion
|
|
7585
|
+
/*************************** END - NodeIntentType: 'bot-text' ******************/
|
|
7586
|
+
/*******************************************************************************/
|
|
7587
|
+
/*******************************************************************************/
|
|
7588
|
+
/*************************** NodeIntentType: 'bot-image' ***********************/
|
|
7589
|
+
//#region
|
|
7590
|
+
const SubotInlineIntentBotImage = ({ intent, }) => {
|
|
7591
|
+
if (!intent.url)
|
|
7592
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7593
|
+
const isObject = (() => {
|
|
7594
|
+
try {
|
|
7595
|
+
return Boolean(JSON.parse((intent === null || intent === void 0 ? void 0 : intent.label) || ''));
|
|
7596
|
+
}
|
|
7597
|
+
catch (err) {
|
|
7598
|
+
return false;
|
|
7599
|
+
}
|
|
7600
|
+
})();
|
|
7601
|
+
return (React__default["default"].createElement(SubotInlineIntentCol, { width: "50%" },
|
|
7602
|
+
React__default["default"].createElement(SubotInlineIntentImageContainer, null,
|
|
7603
|
+
React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
|
|
7604
|
+
isObject && (React__default["default"].createElement("h4", { className: "intent-img-label" },
|
|
7605
|
+
React__default["default"].createElement(Markdown, null, intent.label))))));
|
|
7606
|
+
};
|
|
7607
|
+
//#endregion
|
|
7608
|
+
/*************************** END - NodeIntentType: 'bot-image' *****************/
|
|
7609
|
+
/*******************************************************************************/
|
|
7610
|
+
/*******************************************************************************/
|
|
7611
|
+
/*************************** NodeIntentType: 'bot-button' **********************/
|
|
7612
|
+
//#region
|
|
7613
|
+
const SubotInlineIntentBotButton = ({ intent, }) => {
|
|
7614
|
+
const { trackingCommonInline } = React.useContext(SubotInlineContext);
|
|
7615
|
+
const handleOnClick = () => {
|
|
7616
|
+
window.location.href = intent.url;
|
|
7617
|
+
};
|
|
7618
|
+
if (!(intent === null || intent === void 0 ? void 0 : intent.label))
|
|
7619
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7620
|
+
return (React__default["default"].createElement(SubotInlineIntentCol, { width: "60%" },
|
|
7621
|
+
React__default["default"].createElement(SubotInlineIntentButton, Object.assign({ size: "lg", color: "primary", onClick: handleOnClick, isBlock: true }, trackingCommonInline, { "data-event-action": "Click CTA", "data-response-id": intent.id }),
|
|
7622
|
+
React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
|
|
7623
|
+
};
|
|
7624
|
+
//#endregion
|
|
7625
|
+
/*************************** END - NodeIntentType: 'bot-button' ****************/
|
|
7626
|
+
/*******************************************************************************/
|
|
7627
|
+
/*******************************************************************************/
|
|
7628
|
+
/*************************** NodeIntentType: 'bot-url' *************************/
|
|
7629
|
+
//#region
|
|
7630
|
+
const SubotInlineIntentUrl = ({ intent, }) => {
|
|
7631
|
+
const article = React.useMemo(() => intent.label.includes('{')
|
|
7632
|
+
? JSON.parse(intent.label)
|
|
7633
|
+
: {}, [intent.label]);
|
|
7634
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol, null,
|
|
7635
|
+
React__default["default"].createElement(SubotInlineIntentUrlContainer, null,
|
|
7636
|
+
React__default["default"].createElement("div", { className: "feature" },
|
|
7637
|
+
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature-wrapper" },
|
|
7638
|
+
React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title, className: "feature-img" }))),
|
|
7639
|
+
React__default["default"].createElement("div", { className: "body" },
|
|
7640
|
+
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url },
|
|
7641
|
+
React__default["default"].createElement("h5", { className: "title" },
|
|
7642
|
+
React__default["default"].createElement(Markdown, null, article === null || article === void 0 ? void 0 : article.title)))))))));
|
|
7643
|
+
};
|
|
7644
|
+
//#endregion
|
|
7645
|
+
/*************************** END - NodeIntentType: 'bot-url' *******************/
|
|
7646
|
+
/*******************************************************************************/
|
|
7647
|
+
/*******************************************************************************/
|
|
7648
|
+
/*************************** NodeIntentType: 'sso-intent' *************************/
|
|
7649
|
+
//#region
|
|
7650
|
+
const SubotInlineIntentSSO = ({ intent, }) => {
|
|
7651
|
+
const info = (() => {
|
|
7652
|
+
try {
|
|
7653
|
+
return (intent === null || intent === void 0 ? void 0 : intent.label) ? JSON.parse(intent === null || intent === void 0 ? void 0 : intent.label) : {};
|
|
7654
|
+
}
|
|
7655
|
+
catch (err) {
|
|
7656
|
+
return {};
|
|
7657
|
+
}
|
|
7658
|
+
})();
|
|
7659
|
+
if (!info || !info.title)
|
|
7660
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7661
|
+
return (React__default["default"].createElement(SubotInlineIntentCol, null,
|
|
7662
|
+
React__default["default"].createElement(SubotInlineItemIcon, null,
|
|
7663
|
+
React__default["default"].createElement("img", { loading: "lazy", src: intent === null || intent === void 0 ? void 0 : intent.url, className: "icon", alt: "" }),
|
|
7664
|
+
React__default["default"].createElement("div", { className: "content" },
|
|
7665
|
+
React__default["default"].createElement("h3", { className: "title" }, info.title),
|
|
7666
|
+
React__default["default"].createElement("div", { className: "description" }, info === null || info === void 0 ? void 0 : info.description)))));
|
|
7667
|
+
};
|
|
7668
|
+
//#endregion
|
|
7669
|
+
/*************************** END - NodeIntentType: 'sso-intent' *******************/
|
|
7670
|
+
/*******************************************************************************/
|
|
7671
|
+
/*******************************************************************************/
|
|
7672
|
+
/*************************** NodeIntentType: 'bot-title' ***********************/
|
|
7673
|
+
//#region
|
|
7674
|
+
const SubotInlineIntentBotTitle = ({ intent, indexNumber, }) => {
|
|
7675
|
+
const isShowLabel = ![index$2.NodeIntentType.SSO_INTENT].includes(intent === null || intent === void 0 ? void 0 : intent.type);
|
|
7676
|
+
return (React__default["default"].createElement(SubotInlineIntentFirstTextContainer, null,
|
|
7677
|
+
React__default["default"].createElement(SubotInlineIntentFirstTextWrapper, null,
|
|
7678
|
+
indexNumber && (React__default["default"].createElement("div", { className: "number" },
|
|
7679
|
+
indexNumber < 10 ? `0${indexNumber}` : indexNumber,
|
|
7680
|
+
".")),
|
|
7681
|
+
isShowLabel &&
|
|
7682
|
+
intent &&
|
|
7683
|
+
[index$2.NodeIntentType.BOT_TEXT, index$2.NodeIntentType.BOT_BUTTON].includes(intent === null || intent === void 0 ? void 0 : intent.type) && React__default["default"].createElement(Markdown, { className: "title" }, intent.label)),
|
|
7684
|
+
intent &&
|
|
7685
|
+
[index$2.NodeIntentType.BOT_IMAGE].includes(intent === null || intent === void 0 ? void 0 : intent.type) && (React__default["default"].createElement(SubotInlineIntentFirstImageWrapper, null,
|
|
7686
|
+
React__default["default"].createElement(SubotInlineIntentBotImage, { intent: intent })))));
|
|
7687
|
+
};
|
|
7688
|
+
//#endregion
|
|
7689
|
+
/*************************** END - NodeIntentType: 'bot-title' *****************/
|
|
7690
|
+
/*******************************************************************************/
|
|
7691
|
+
/*******************************************************************************/
|
|
7692
|
+
/*************************** NodeIntentType: 'bot-main-title' ******************/
|
|
7693
|
+
//#region
|
|
7694
|
+
const SubotInlineIntentBotMainTitle = ({ intent, }) => {
|
|
7695
|
+
if (!intent.label ||
|
|
7696
|
+
intent.label === 'Sub title' ||
|
|
7697
|
+
intent.label === 'Main title') {
|
|
7698
|
+
return null;
|
|
7699
|
+
}
|
|
7700
|
+
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7701
|
+
React__default["default"].createElement(SubotInlineIntentTitle, null,
|
|
7702
|
+
React__default["default"].createElement(Markdown, null, intent.label))));
|
|
7703
|
+
};
|
|
7704
|
+
//#endregion
|
|
7705
|
+
/*************************** END - NodeIntentType: 'bot-main-title' ************/
|
|
7706
|
+
/*******************************************************************************/
|
|
7707
|
+
/*******************************************************************************/
|
|
7708
|
+
/*************************** NodeIntentType: 'bot-main-image' ******************/
|
|
7709
|
+
//#region
|
|
7710
|
+
const SubotInlineIntentBotMainImage = ({ intent, }) => {
|
|
7711
|
+
if (!intent.url)
|
|
7712
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7713
|
+
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7714
|
+
React__default["default"].createElement(SubotInlineIntentImageContainer, null,
|
|
7715
|
+
React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
|
|
7716
|
+
intent.label && (React__default["default"].createElement("h4", { className: "intent-img-label" },
|
|
7717
|
+
React__default["default"].createElement(Markdown, null, intent.label))))));
|
|
7718
|
+
};
|
|
7719
|
+
//#endregion
|
|
7720
|
+
/*************************** END - NodeIntentType: 'bot-main-image' ************/
|
|
7721
|
+
/*******************************************************************************/
|
|
7722
|
+
/*******************************************************************************/
|
|
7723
|
+
/*************************** NodeIntentType: 'bot-main-body' ******************/
|
|
7724
|
+
//#region
|
|
7725
|
+
const SubotInlineIntentBotMainBody = ({ intent, }) => {
|
|
7726
|
+
if (!intent.label ||
|
|
7727
|
+
intent.label === 'Main body' ||
|
|
7728
|
+
intent.label === 'Sub body') {
|
|
7729
|
+
return null;
|
|
7730
|
+
}
|
|
7731
|
+
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7732
|
+
React__default["default"].createElement("div", { className: "intents__item markdown" },
|
|
7733
|
+
React__default["default"].createElement(Markdown, null, intent.label))));
|
|
7734
|
+
};
|
|
7735
|
+
//#endregion
|
|
7736
|
+
/*************************** END - NodeIntentType: 'bot-main-body' ************/
|
|
7737
|
+
/*******************************************************************************/
|
|
7738
|
+
/*******************************************************************************/
|
|
7739
|
+
/*************************** NodeIntentType: 'bot-main-button' *****************/
|
|
7740
|
+
//#region
|
|
7741
|
+
const SubotInlineIntentBotMainButton = ({ intent, }) => {
|
|
7742
|
+
const { trackingCommonInline } = React.useContext(SubotInlineContext);
|
|
7743
|
+
const handleOnClick = () => {
|
|
7744
|
+
window.location.href = intent.url;
|
|
7745
|
+
};
|
|
7746
|
+
if (!intent.label)
|
|
7747
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7748
|
+
return (React__default["default"].createElement(SubotInlineIntentCol, { width: "auto" },
|
|
7749
|
+
React__default["default"].createElement(SubotInlineIntentFinalButtonContainer, null,
|
|
7750
|
+
React__default["default"].createElement(SubotInlineIntentButton, Object.assign({ size: "lg", color: "primary", onClick: handleOnClick, className: "pointer-event-child-none" }, trackingCommonInline, { "data-event-action": "Click CTA", "data-response-id": intent.id }),
|
|
7751
|
+
React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label)))));
|
|
7752
|
+
};
|
|
7753
|
+
//#endregion
|
|
7754
|
+
/*************************** END - NodeIntentType: 'bot-main-button' ***********/
|
|
7755
|
+
/*******************************************************************************/
|
|
7756
|
+
/*******************************************************************************/
|
|
7757
|
+
/*************************** NodeIntentType: 'bot-recalculate' *****************/
|
|
7758
|
+
//#region
|
|
7759
|
+
const SubotInlineIntentBotRecalculate = ({ intent }) => {
|
|
7760
|
+
const { onReset } = React.useContext(SubotInlineContext);
|
|
7761
|
+
const handleOnClick = () => {
|
|
7762
|
+
onReset && onReset();
|
|
7763
|
+
};
|
|
7764
|
+
if (!(intent === null || intent === void 0 ? void 0 : intent.label))
|
|
7765
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7766
|
+
return (React__default["default"].createElement(SubotInlineIntentCol, { width: "auto", style: { justifyContent: 'center', display: 'flex' } },
|
|
7767
|
+
React__default["default"].createElement(SubotInlineRecalculateButton, { size: "lg", color: "secondary", onClick: handleOnClick, icon: React__default["default"].createElement(RotateLeft, null), className: "bot-recalculate" },
|
|
7768
|
+
React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
|
|
7769
|
+
};
|
|
7770
|
+
//#endregion
|
|
7771
|
+
/*************************** END - NodeIntentType: 'bot-recalculate' ***********/
|
|
7772
|
+
/*******************************************************************************/
|
|
7773
|
+
/*******************************************************************************/
|
|
7774
|
+
/*************************** NodeIntentType: 'bot-risk-screener' ***************/
|
|
7775
|
+
//#region
|
|
7776
|
+
const SubotInlineIntentBotRiskScreener = ({ intent }) => {
|
|
7777
|
+
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
7778
|
+
const article = React.useMemo(() => {
|
|
7779
|
+
if (intent.label && intent.label.includes('{')) {
|
|
7780
|
+
return JSON.parse(intent.label);
|
|
7781
|
+
}
|
|
7782
|
+
return {};
|
|
7783
|
+
}, [intent, intent === null || intent === void 0 ? void 0 : intent.label]);
|
|
7784
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, !!(article === null || article === void 0 ? void 0 : article.title) && !!(article === null || article === void 0 ? void 0 : article.thumbnail) && !!(article === null || article === void 0 ? void 0 : article.url) && (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7785
|
+
React__default["default"].createElement(SubotInlineIntentRiskScreenerContainer, null,
|
|
7786
|
+
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature" },
|
|
7787
|
+
React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title })),
|
|
7788
|
+
React__default["default"].createElement("div", { className: "title-container" },
|
|
7789
|
+
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url },
|
|
7790
|
+
React__default["default"].createElement("h5", { className: "title" }, article === null || article === void 0 ? void 0 : article.title)),
|
|
7791
|
+
React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "link" },
|
|
7792
|
+
f({
|
|
7793
|
+
id: 'riskScreener.start',
|
|
7794
|
+
defaultMessage: 'Start',
|
|
7795
|
+
}),
|
|
7796
|
+
React__default["default"].createElement(ChevronRightActive, { style: { marginLeft: 10 } }))))))));
|
|
7797
|
+
};
|
|
7798
|
+
//#endregion
|
|
7799
|
+
/*************************** END - NodeIntentType: 'bot-risk-screener' *********/
|
|
7800
|
+
/*******************************************************************************/
|
|
7801
|
+
/*******************************************************************************/
|
|
7802
|
+
/*************************** NodeIntentType: 'bot-related-article' *************/
|
|
7803
|
+
//#region
|
|
7804
|
+
const SubotInlineIntentBotRelatedArticle = ({ intent }) => {
|
|
7805
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
7806
|
+
const article = React.useMemo(() => {
|
|
7807
|
+
if (intent.label && intent.label.includes('{')) {
|
|
7808
|
+
const _article = JSON.parse(intent.label);
|
|
7809
|
+
if (_article.meta) {
|
|
7810
|
+
const tmp = {};
|
|
7811
|
+
_article.meta.map(({ key, value }) => {
|
|
7812
|
+
if (key && value)
|
|
7813
|
+
tmp[key] = value;
|
|
7814
|
+
});
|
|
7815
|
+
_article.meta = Object.assign({}, tmp);
|
|
7816
|
+
}
|
|
7817
|
+
return Object.assign({}, _article);
|
|
7818
|
+
}
|
|
7819
|
+
return {};
|
|
7820
|
+
}, [intent, intent === null || intent === void 0 ? void 0 : intent.label]);
|
|
7821
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, !!(article === null || article === void 0 ? void 0 : article.title) &&
|
|
7822
|
+
!!(article === null || article === void 0 ? void 0 : article.thumbnail) &&
|
|
7823
|
+
!!(article === null || article === void 0 ? void 0 : article.url) &&
|
|
7824
|
+
!!(article === null || article === void 0 ? void 0 : article.meta) &&
|
|
7825
|
+
!!((_a = article === null || article === void 0 ? void 0 : article.meta) === null || _a === void 0 ? void 0 : _a.post_modified) &&
|
|
7826
|
+
!!((_b = article === null || article === void 0 ? void 0 : article.meta) === null || _b === void 0 ? void 0 : _b.reviewed_display_name) &&
|
|
7827
|
+
!!((_c = article === null || article === void 0 ? void 0 : article.meta) === null || _c === void 0 ? void 0 : _c.reviewed_url) &&
|
|
7828
|
+
!!((_d = article === null || article === void 0 ? void 0 : article.meta) === null || _d === void 0 ? void 0 : _d.reviewed_avatar_thumbnail) &&
|
|
7829
|
+
!!((_e = article === null || article === void 0 ? void 0 : article.meta) === null || _e === void 0 ? void 0 : _e.category_url) &&
|
|
7830
|
+
!!((_f = article === null || article === void 0 ? void 0 : article.meta) === null || _f === void 0 ? void 0 : _f.category_name) && (React__default["default"].createElement(SubotInlineIntentFinalCol, { width: "40%" },
|
|
7831
|
+
React__default["default"].createElement(moleculesArticleCard.ArticleCard, { title: article === null || article === void 0 ? void 0 : article.title, uploadTime: dayjs__default["default"]((_g = article === null || article === void 0 ? void 0 : article.meta) === null || _g === void 0 ? void 0 : _g.post_modified).format('DD/MM/YYYY'), authorName: (_h = article === null || article === void 0 ? void 0 : article.meta) === null || _h === void 0 ? void 0 : _h.reviewed_display_name, authorLink: (_j = article === null || article === void 0 ? void 0 : article.meta) === null || _j === void 0 ? void 0 : _j.reviewed_url, avatarImg: React__default["default"].createElement("img", { loading: "lazy", src: (_k = article === null || article === void 0 ? void 0 : article.meta) === null || _k === void 0 ? void 0 : _k.reviewed_avatar_thumbnail, alt: (_l = article === null || article === void 0 ? void 0 : article.meta) === null || _l === void 0 ? void 0 : _l.reviewed_display_name }), categoryLink: (_m = article === null || article === void 0 ? void 0 : article.meta) === null || _m === void 0 ? void 0 : _m.category_url, categoryName: (_o = article === null || article === void 0 ? void 0 : article.meta) === null || _o === void 0 ? void 0 : _o.category_name, banner: React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title }), text: "", size: "sm", direction: "vertical" })))));
|
|
7832
|
+
};
|
|
7833
|
+
//#endregion
|
|
7834
|
+
/*************************** END - NodeIntentType: 'bot-related-article' *******/
|
|
7835
|
+
/*******************************************************************************/
|
|
7836
|
+
/*******************************************************************************/
|
|
7837
|
+
/*************************** NodeIntentType: 'thank-you-image' *****************/
|
|
7838
|
+
//#region
|
|
7839
|
+
const SubotInlineIntentThankYouImage = ({ intent, }) => {
|
|
7840
|
+
if (!intent.url)
|
|
7841
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7842
|
+
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7843
|
+
React__default["default"].createElement(SubotInlineIntentImageContainer, null,
|
|
7844
|
+
React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
|
|
7845
|
+
intent.label && (React__default["default"].createElement("h4", { className: "intent-img-label" },
|
|
7846
|
+
React__default["default"].createElement(Markdown, null, intent.label))))));
|
|
7847
|
+
};
|
|
7848
|
+
//#endregion
|
|
7849
|
+
/*************************** END - NodeIntentType: 'thank-you-image' ***********/
|
|
7850
|
+
/*******************************************************************************/
|
|
7851
|
+
/*******************************************************************************/
|
|
7852
|
+
/*************************** NodeIntentType: 'thank-you-title' *****************/
|
|
7853
|
+
//#region
|
|
7854
|
+
const SubotInlineIntentThankYouTitle = ({ intent, }) => {
|
|
7855
|
+
if (!intent.label)
|
|
7856
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7857
|
+
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7858
|
+
React__default["default"].createElement(SubotInlineIntentTitle, null,
|
|
7859
|
+
React__default["default"].createElement(Markdown, null, intent.label))));
|
|
7860
|
+
};
|
|
7861
|
+
//#endregion
|
|
7862
|
+
/*************************** END - NodeIntentType: 'thank-you-title' ***********/
|
|
7863
|
+
/*******************************************************************************/
|
|
7864
|
+
/*******************************************************************************/
|
|
7865
|
+
/*************************** NodeIntentType: 'thank-you-body' ******************/
|
|
7866
|
+
//#region
|
|
7867
|
+
const SubotInlineIntentThankYouBody = ({ intent, }) => {
|
|
7868
|
+
if (!intent.label)
|
|
7869
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
7870
|
+
return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
|
|
7871
|
+
React__default["default"].createElement("div", { className: "intents__item markdown" },
|
|
7872
|
+
React__default["default"].createElement(Markdown, null, intent.label))));
|
|
7873
|
+
};
|
|
7874
|
+
//#endregion
|
|
7875
|
+
/*************************** END - NodeIntentType: 'thank-you-body' ************/
|
|
7876
|
+
/*******************************************************************************/
|
|
7877
|
+
const SubotInlineIntentBase = {
|
|
7878
|
+
[index$2.NodeIntentType.BOT_TEXT]: SubotInlineIntentBotText,
|
|
7879
|
+
[index$2.NodeIntentType.BOT_IMAGE]: SubotInlineIntentBotImage,
|
|
7880
|
+
[index$2.NodeIntentType.BOT_BUTTON]: SubotInlineIntentBotButton,
|
|
7881
|
+
[index$2.NodeIntentType.BOT_URL]: SubotInlineIntentUrl,
|
|
7882
|
+
[index$2.NodeIntentType.BOT_RECALCULATE]: SubotInlineIntentBotRecalculate,
|
|
7883
|
+
[index$2.NodeIntentType.BOT_MAIN_TITLE]: SubotInlineIntentBotMainTitle,
|
|
7884
|
+
[index$2.NodeIntentType.BOT_MAIN_IMAGE]: SubotInlineIntentBotMainImage,
|
|
7885
|
+
[index$2.NodeIntentType.BOT_MAIN_BODY]: SubotInlineIntentBotMainBody,
|
|
7886
|
+
[index$2.NodeIntentType.BOT_MAIN_BUTTON]: SubotInlineIntentBotMainButton,
|
|
7887
|
+
[index$2.NodeIntentType.BOT_SUB_TITLE]: SubotInlineIntentBotMainTitle,
|
|
7888
|
+
[index$2.NodeIntentType.BOT_SUB_BODY]: SubotInlineIntentBotMainBody,
|
|
7889
|
+
[index$2.NodeIntentType.BOT_LANDING_PAGE_URL]: SubotInlineIntentBotText,
|
|
7890
|
+
[index$2.NodeIntentType.BOT_LANDING_PAGE_BUTTON]: SubotInlineIntentBotText,
|
|
7891
|
+
[index$2.NodeIntentType.BOT_RISK_SCREEN]: SubotInlineIntentBotRiskScreener,
|
|
7892
|
+
[index$2.NodeIntentType.BOT_RELATED_ARTICLE]: SubotInlineIntentBotRelatedArticle,
|
|
7893
|
+
[index$2.NodeIntentType.THANK_YOU_IMAGE]: SubotInlineIntentThankYouImage,
|
|
7894
|
+
[index$2.NodeIntentType.THANK_YOU_TITLE]: SubotInlineIntentThankYouTitle,
|
|
7895
|
+
[index$2.NodeIntentType.THANK_YOU_BODY]: SubotInlineIntentThankYouBody,
|
|
7896
|
+
/** intents fake for sso block */
|
|
7897
|
+
[index$2.NodeIntentType.SSO_INTENT]: SubotInlineIntentSSO,
|
|
7898
|
+
};
|
|
7899
|
+
|
|
7900
|
+
/***************** type: TEXT, IMAGE ***************/
|
|
7901
|
+
const SubotInlineNode = ({ node, indexNumber, }) => {
|
|
7902
|
+
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
7903
|
+
const { params, onChange, onSubmit, onPrev, onNext, nodes, activeId } = React.useContext(SubotInlineContext);
|
|
7904
|
+
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
7905
|
+
const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
7906
|
+
const _message = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(nodes, activeId, action.id));
|
|
7907
|
+
delete _message.form_submit_meta;
|
|
7908
|
+
const res = yield subotInlineMessage(_message);
|
|
7909
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
7910
|
+
const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
7911
|
+
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
7912
|
+
delete _nextNode._message.form_submit_meta;
|
|
7913
|
+
onSubmit && onSubmit(_nextNode, _message);
|
|
7914
|
+
}
|
|
7915
|
+
});
|
|
7916
|
+
const handleOnChange = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
7917
|
+
if (!action)
|
|
7918
|
+
return;
|
|
7919
|
+
const actionWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
|
|
7920
|
+
(action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
|
|
7921
|
+
const newValue = Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: formSubmitMeta });
|
|
7922
|
+
if (actionWithOther) {
|
|
7923
|
+
setValue(newValue);
|
|
7924
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
7925
|
+
return;
|
|
7926
|
+
}
|
|
7927
|
+
delete newValue.form_submit_meta;
|
|
7928
|
+
setValue(newValue);
|
|
7929
|
+
handleOnChangeNormal(action);
|
|
7930
|
+
});
|
|
7931
|
+
const handleOnNext = () => {
|
|
7932
|
+
const newMessage = JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value)));
|
|
7933
|
+
if ((value === null || value === void 0 ? void 0 : value.action_id) &&
|
|
7934
|
+
(value === null || value === void 0 ? void 0 : value.action_value) === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD) {
|
|
7935
|
+
onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
|
|
7936
|
+
return;
|
|
7937
|
+
}
|
|
7938
|
+
if (!(value === null || value === void 0 ? void 0 : value.action_id) || !(value === null || value === void 0 ? void 0 : value.action_value)) {
|
|
7939
|
+
pushNotifications({
|
|
7940
|
+
title: '',
|
|
7941
|
+
message: f({
|
|
7942
|
+
id: 'multiSelectError.required',
|
|
7943
|
+
defaultMessage: `There is no answer!`,
|
|
7944
|
+
}),
|
|
7945
|
+
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
7946
|
+
});
|
|
7947
|
+
}
|
|
7948
|
+
else {
|
|
7949
|
+
delete newMessage.form_submit_meta;
|
|
7950
|
+
onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
|
|
7951
|
+
}
|
|
7952
|
+
};
|
|
7953
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
7954
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
7955
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
7956
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
7957
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
7958
|
+
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
7959
|
+
React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange, formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
|
|
7960
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
|
|
7961
|
+
};
|
|
7962
|
+
|
|
7963
|
+
const SubotInlineNodeFinal = ({ node, }) => {
|
|
7964
|
+
var _a, _b;
|
|
7965
|
+
const fixHeight = 350;
|
|
7966
|
+
const { nodes } = React.useContext(SubotInlineContext);
|
|
7967
|
+
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
7968
|
+
const flag = React.useRef(null);
|
|
7969
|
+
const wrapper = React.useRef(null);
|
|
7970
|
+
const [height, setHeight] = React.useState(fixHeight);
|
|
7971
|
+
const [showMore, setShowMore] = React.useState(true);
|
|
7972
|
+
const [isMore, setIsMore] = React.useState(false);
|
|
7973
|
+
const handleOnClick = React.useCallback(() => {
|
|
7974
|
+
fastdom.measure(() => {
|
|
7975
|
+
var _a;
|
|
7976
|
+
if (wrapper.current) {
|
|
7977
|
+
const wrapperHeight = (_a = wrapper.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
|
|
7978
|
+
if (height && height < wrapperHeight) {
|
|
7979
|
+
setHeight(wrapperHeight);
|
|
7980
|
+
setIsMore(true);
|
|
7981
|
+
}
|
|
7982
|
+
else {
|
|
7983
|
+
setHeight(fixHeight);
|
|
7984
|
+
setIsMore(false);
|
|
7985
|
+
}
|
|
7986
|
+
flag.current &&
|
|
7987
|
+
flag.current.scrollIntoView({
|
|
7988
|
+
behavior: 'smooth',
|
|
7989
|
+
block: 'start',
|
|
7990
|
+
inline: 'start',
|
|
7991
|
+
});
|
|
7992
|
+
}
|
|
7993
|
+
});
|
|
7994
|
+
}, [height]);
|
|
7995
|
+
React.useLayoutEffect(() => {
|
|
7996
|
+
fastdom.measure(() => {
|
|
7997
|
+
if (wrapper.current) {
|
|
7998
|
+
setTimeout(() => {
|
|
7999
|
+
var _a;
|
|
8000
|
+
const wrapperHeight = (_a = wrapper.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
|
|
8001
|
+
if (wrapperHeight && height > wrapperHeight) {
|
|
8002
|
+
setShowMore(false);
|
|
8003
|
+
setIsMore(false);
|
|
8004
|
+
}
|
|
8005
|
+
}, 400);
|
|
8006
|
+
}
|
|
8007
|
+
});
|
|
8008
|
+
}, []);
|
|
8009
|
+
const botItem = nodes[0];
|
|
8010
|
+
const botType = (_a = botItem === null || botItem === void 0 ? void 0 : botItem.extra_settings) === null || _a === void 0 ? void 0 : _a.subot_type;
|
|
8011
|
+
const suggestedServiceIntents = React.useMemo(() => {
|
|
8012
|
+
var _a;
|
|
8013
|
+
return (((_a = node === null || node === void 0 ? void 0 : node.intents) === null || _a === void 0 ? void 0 : _a.filter((i) => i.type === index$2.NodeIntentType.BOT_SUGGESTED_SERVICE)) || []);
|
|
8014
|
+
}, []);
|
|
8015
|
+
return (React__default["default"].createElement(SubotInlineFinalContainer, null,
|
|
8016
|
+
React__default["default"].createElement("div", { ref: flag, className: "hhg-flag", style: {
|
|
8017
|
+
position: 'absolute',
|
|
8018
|
+
top: -100,
|
|
8019
|
+
left: 0,
|
|
8020
|
+
pointerEvents: 'none',
|
|
8021
|
+
} }),
|
|
8022
|
+
React__default["default"].createElement(SubotInlineFinalWrapper, { maxHeight: height, isMore: isMore },
|
|
8023
|
+
React__default["default"].createElement("div", { ref: wrapper },
|
|
8024
|
+
React__default["default"].createElement(SubotInlineIntentFinal, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [] }),
|
|
8025
|
+
suggestedServiceIntents.length > 0 && (React__default["default"].createElement("div", null, suggestedServiceIntents.map((intent) => {
|
|
8026
|
+
const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
|
|
8027
|
+
return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
|
|
8028
|
+
}))))),
|
|
8029
|
+
showMore && (React__default["default"].createElement(SubotInlineFinalMoreContainer, null,
|
|
8030
|
+
React__default["default"].createElement(SubotInlineFinalButton, { size: "md", color: "secondary", onClick: handleOnClick }, !isMore ? (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
8031
|
+
f({ id: 'subotInline.showMore', defaultMessage: 'Show more' }),
|
|
8032
|
+
React__default["default"].createElement(ArrowDown, { style: { marginLeft: 10 } }))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
8033
|
+
f({ id: 'subotInline.showLess', defaultMessage: 'Show less' }),
|
|
8034
|
+
React__default["default"].createElement(ArrowUp, { style: { marginLeft: 10 } })))))),
|
|
8035
|
+
botType === index$2.SubotType.voucherAcuvue && (React__default["default"].createElement(SubotInlineVoucherLeftUI, { clientId: (_b = botItem.extra_settings) === null || _b === void 0 ? void 0 : _b.client_id, voucherAnswers: extractVoucherAnswers(nodes, botItem) }))));
|
|
8036
|
+
};
|
|
8037
|
+
|
|
8038
|
+
const SubotInlineResultButton = styled__default["default"].span `
|
|
8039
|
+
display: inline-block;
|
|
8040
|
+
margin-top: 20px;
|
|
8041
|
+
color: ${miscTheme.theme.colors.primaryBase || '#2D87F3'};
|
|
8042
|
+
cursor: pointer;
|
|
8043
|
+
transition: 0.3 all ease;
|
|
8044
|
+
&:hover {
|
|
8045
|
+
color: ${miscTheme.theme.colors.primaryHover || '#2D87F3'};
|
|
8046
|
+
}
|
|
8047
|
+
${utils.MediaQueries.tdDown} {
|
|
8048
|
+
margin-top: 16px;
|
|
8049
|
+
}
|
|
8050
|
+
${utils.MediaQueries.mbDown} {
|
|
8051
|
+
margin-top: 12px;
|
|
8052
|
+
}
|
|
8053
|
+
`;
|
|
8054
|
+
const SubotInlineWrapper = styled__default["default"].div `
|
|
8055
|
+
max-width: 430px;
|
|
8056
|
+
margin-right: auto;
|
|
8057
|
+
margin-left: auto;
|
|
8058
|
+
`;
|
|
8059
|
+
const SubotInlineContainer = styled__default["default"].div `
|
|
8060
|
+
padding: 44px 16px 32px;
|
|
8061
|
+
background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
|
|
8062
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
8063
|
+
position: relative;
|
|
8064
|
+
text-align: center;
|
|
8065
|
+
${utils.MediaQueries.tdDown} {
|
|
8066
|
+
padding: 36px 16px 24px;
|
|
8067
|
+
}
|
|
8068
|
+
${utils.MediaQueries.mbDown} {
|
|
8069
|
+
padding: 16px;
|
|
8070
|
+
border-radius: 0px;
|
|
8071
|
+
}
|
|
8072
|
+
`;
|
|
8073
|
+
const SubotInlineNodeFinalThankYou = ({ node, }) => {
|
|
8074
|
+
var _a;
|
|
8075
|
+
const { params, onNext } = React.useContext(SubotInlineContext);
|
|
8076
|
+
const resultButton = React.useMemo(() => {
|
|
8077
|
+
var _a;
|
|
8078
|
+
const _resultButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.RESULT_BUTTON);
|
|
8079
|
+
if (_resultButton)
|
|
8080
|
+
return _resultButton;
|
|
8081
|
+
return null;
|
|
8082
|
+
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8083
|
+
const handleOnNext = React.useCallback(() => {
|
|
8084
|
+
onNext &&
|
|
8085
|
+
onNext(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), { action_id: resultButton === null || resultButton === void 0 ? void 0 : resultButton.id, action_value: resultButton === null || resultButton === void 0 ? void 0 : resultButton.key }));
|
|
8086
|
+
}, [resultButton]);
|
|
8087
|
+
return (React__default["default"].createElement(SubotInlineContainer, null,
|
|
8088
|
+
React__default["default"].createElement(SubotInlineWrapper, null, (_a = node === null || node === void 0 ? void 0 : node.intents) === null || _a === void 0 ? void 0 :
|
|
8089
|
+
_a.map((intent) => {
|
|
8090
|
+
const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
|
|
8091
|
+
return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
|
|
8092
|
+
}),
|
|
8093
|
+
resultButton && (React__default["default"].createElement(SubotInlineResultButton, { onClick: handleOnNext }, resultButton === null || resultButton === void 0 ? void 0 : resultButton.label)))));
|
|
8094
|
+
};
|
|
8095
|
+
|
|
8096
|
+
const SubotInlineNodeForm = ({ node, indexNumber, }) => {
|
|
8097
|
+
var _a;
|
|
8098
|
+
const { data: { locale }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8099
|
+
const { params, onPrev, onSubmit, trackingCommonInline, nodes, activeId } = React.useContext(SubotInlineContext);
|
|
8100
|
+
const handleSubmit = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8101
|
+
const res = yield subotInlineMessage(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node._message), data), getCurrentTotalDynamicScore(nodes, activeId, data.action_id, data.form_submit_meta)));
|
|
8102
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8103
|
+
const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
|
|
8104
|
+
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8105
|
+
onSubmit && onSubmit(_nextNode, Object.assign(Object.assign({}, node._message), data));
|
|
8106
|
+
}
|
|
8107
|
+
});
|
|
8108
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8109
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8110
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8111
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8112
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8113
|
+
React__default["default"].createElement(SubotInlineFormContainer, null,
|
|
8114
|
+
React__default["default"].createElement(UserInfoForm, { botId: params.bot_id, nodeId: String(node === null || node === void 0 ? void 0 : node.id), className: "form", actions: (node === null || node === void 0 ? void 0 : node.actions) || [], formSubmitMeta: ((_a = node === null || node === void 0 ? void 0 : node._message) === null || _a === void 0 ? void 0 : _a.form_submit_meta) || null, callBack: handleSubmit, countryCode: (locale === null || locale === void 0 ? void 0 : locale.split('-')[1]) || 'PH', trackingSubmitBtn: Object.assign(Object.assign({}, trackingCommonInline), { 'data-event-action': 'Submit' }) }))),
|
|
8115
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
|
|
8116
|
+
};
|
|
8117
|
+
|
|
8118
|
+
const SubotInlineNodeImage = ({ node, indexNumber, }) => {
|
|
8119
|
+
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8120
|
+
const { params, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8121
|
+
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8122
|
+
const handleOnChange = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8123
|
+
if (action) {
|
|
8124
|
+
setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
|
|
8125
|
+
const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
|
|
8126
|
+
const res = yield subotInlineMessage(_message);
|
|
8127
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8128
|
+
const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
8129
|
+
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8130
|
+
onSubmit && onSubmit(_nextNode, _message);
|
|
8131
|
+
}
|
|
8132
|
+
}
|
|
8133
|
+
});
|
|
8134
|
+
const handleOnNext = () => {
|
|
8135
|
+
var _a;
|
|
8136
|
+
if (!(node === null || node === void 0 ? void 0 : node._message) || !((_a = node._message) === null || _a === void 0 ? void 0 : _a.action_id)) {
|
|
8137
|
+
pushNotifications({
|
|
8138
|
+
title: '',
|
|
8139
|
+
message: f({
|
|
8140
|
+
id: 'multiSelectError.required',
|
|
8141
|
+
defaultMessage: `There is no answer!`,
|
|
8142
|
+
}),
|
|
8143
|
+
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8144
|
+
});
|
|
8145
|
+
}
|
|
8146
|
+
else {
|
|
8147
|
+
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
|
|
8148
|
+
}
|
|
8149
|
+
};
|
|
8150
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8151
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8152
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8153
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8154
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8155
|
+
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8156
|
+
React__default["default"].createElement(SubotInlineAction, { node_type: node === null || node === void 0 ? void 0 : node.type, value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange }))),
|
|
8157
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
|
|
8158
|
+
};
|
|
8159
|
+
|
|
8160
|
+
const SubotInlineNodeMultiple = ({ node, indexNumber, }) => {
|
|
8161
|
+
const { params, onChange, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8162
|
+
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8163
|
+
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8164
|
+
const submitButton = React.useMemo(() => {
|
|
8165
|
+
var _a;
|
|
8166
|
+
const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.ACTION_MULTIPLE_BUTTON);
|
|
8167
|
+
if (_submitButton)
|
|
8168
|
+
return _submitButton;
|
|
8169
|
+
return null;
|
|
8170
|
+
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8171
|
+
const activeActions = React.useMemo(() => {
|
|
8172
|
+
if (value === null || value === void 0 ? void 0 : value.selected_actions) {
|
|
8173
|
+
return Object.keys(value === null || value === void 0 ? void 0 : value.selected_actions);
|
|
8174
|
+
}
|
|
8175
|
+
return [];
|
|
8176
|
+
}, [value, value === null || value === void 0 ? void 0 : value.selected_actions]);
|
|
8177
|
+
const validateSelectActions = (selected_actions, callBack) => {
|
|
8178
|
+
const activeActions = Object.keys(selected_actions);
|
|
8179
|
+
if (!activeActions.length) {
|
|
8180
|
+
pushNotifications({
|
|
8181
|
+
title: '',
|
|
8182
|
+
message: f({
|
|
8183
|
+
id: 'multiSelectError.required',
|
|
8184
|
+
defaultMessage: `There is no answer!`,
|
|
8185
|
+
}),
|
|
8186
|
+
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8187
|
+
});
|
|
8188
|
+
return;
|
|
8189
|
+
}
|
|
8190
|
+
else if ((node === null || node === void 0 ? void 0 : node.multi_select_option) === index$2.NodeMultipleOptions.RANGE &&
|
|
8191
|
+
activeActions.length < (node === null || node === void 0 ? void 0 : node.from)) {
|
|
8192
|
+
pushNotifications({
|
|
8193
|
+
title: '',
|
|
8194
|
+
message: f({
|
|
8195
|
+
id: 'multiSelectError.range',
|
|
8196
|
+
defaultMessage: 'You must choose from {from} to {to} answers (Ex: You must choose from 3 to 5 answers)',
|
|
8197
|
+
}, {
|
|
8198
|
+
from: node.from,
|
|
8199
|
+
to: node.to,
|
|
8200
|
+
}),
|
|
8201
|
+
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8202
|
+
});
|
|
8203
|
+
return;
|
|
8204
|
+
}
|
|
8205
|
+
else if ((node === null || node === void 0 ? void 0 : node.multi_select_option) === index$2.NodeMultipleOptions.EXACT_NUMBER &&
|
|
8206
|
+
activeActions.length !== (node === null || node === void 0 ? void 0 : node.from)) {
|
|
8207
|
+
pushNotifications({
|
|
8208
|
+
message: f({
|
|
8209
|
+
id: 'multiSelectError.exactNumber',
|
|
8210
|
+
defaultMessage: 'You must choose {from} answers.',
|
|
8211
|
+
}, {
|
|
8212
|
+
from: node.from,
|
|
8213
|
+
}),
|
|
8214
|
+
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8215
|
+
});
|
|
8216
|
+
return;
|
|
8217
|
+
}
|
|
8218
|
+
else {
|
|
8219
|
+
callBack();
|
|
8220
|
+
}
|
|
8221
|
+
};
|
|
8222
|
+
const handleOnClick = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8223
|
+
var _a, _b;
|
|
8224
|
+
if (action) {
|
|
8225
|
+
const _value = JSON.parse(JSON.stringify(Object.assign(Object.assign({}, value), { action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, selected_actions: Object.assign({}, value === null || value === void 0 ? void 0 : value.selected_actions) })));
|
|
8226
|
+
if ((action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT ||
|
|
8227
|
+
(action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT) {
|
|
8228
|
+
const isExistedPoll = (_value === null || _value === void 0 ? void 0 : _value.selected_actions) && action.id in _value.selected_actions;
|
|
8229
|
+
if (isExistedPoll) {
|
|
8230
|
+
if (formSubmitMeta) {
|
|
8231
|
+
_value.form_submit_meta = formSubmitMeta;
|
|
8232
|
+
}
|
|
8233
|
+
else {
|
|
8234
|
+
delete _value.form_submit_meta;
|
|
8235
|
+
(_a = _value.selected_actions) === null || _a === void 0 ? true : delete _a[action.id];
|
|
8236
|
+
}
|
|
8237
|
+
}
|
|
8238
|
+
else {
|
|
8239
|
+
if (action === null || action === void 0 ? void 0 : action.id) {
|
|
8240
|
+
_value.selected_actions = Object.assign(Object.assign({}, _value.selected_actions), { [action.id]: action.key || '' });
|
|
8241
|
+
}
|
|
8242
|
+
}
|
|
8243
|
+
setValue(_value);
|
|
8244
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_value);
|
|
8245
|
+
return;
|
|
8246
|
+
}
|
|
8247
|
+
if (!((_b = _value.selected_actions) === null || _b === void 0 ? void 0 : _b[action.id])) {
|
|
8248
|
+
_value.selected_actions = Object.assign(Object.assign({}, _value.selected_actions), { [action.id]: action.key || '' });
|
|
8249
|
+
onChange && onChange(_value);
|
|
8250
|
+
setValue(_value);
|
|
8251
|
+
return;
|
|
8252
|
+
}
|
|
8253
|
+
if (_value.selected_actions[action.id]) {
|
|
8254
|
+
delete _value.selected_actions[action.id];
|
|
8255
|
+
onChange && onChange(_value);
|
|
8256
|
+
setValue(_value);
|
|
8257
|
+
return;
|
|
8258
|
+
}
|
|
8259
|
+
}
|
|
8260
|
+
});
|
|
8261
|
+
const handleOnNext = React.useCallback(() => {
|
|
8262
|
+
validateSelectActions((value === null || value === void 0 ? void 0 : value.selected_actions) || {}, () => {
|
|
8263
|
+
onNext &&
|
|
8264
|
+
onNext(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value), { node_id: node.id }));
|
|
8265
|
+
});
|
|
8266
|
+
}, [value, value === null || value === void 0 ? void 0 : value.selected_actions, onNext]);
|
|
8267
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8268
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8269
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8270
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8271
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8272
|
+
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8273
|
+
React__default["default"].createElement(SubotInlineAction, { value: activeActions, actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnClick, htmlType: "checkbox", formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
|
|
8274
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
|
|
8275
|
+
};
|
|
8276
|
+
|
|
8277
|
+
const OTPInfoForm = ({ className, style, actions, countryCode, phoneNumber, areaCode,
|
|
8278
|
+
// verified,
|
|
8279
|
+
callBack, }) => {
|
|
8280
|
+
const countRef = React.useRef();
|
|
8281
|
+
const [isFinishedCountDown, setIsFinishedCountDown] = React.useState(false);
|
|
8282
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
8283
|
+
const [isLoadingVerify, setIsLoadingVerify] = React.useState(false);
|
|
8284
|
+
const [sentOTP, setSentOTP] = React.useState(false);
|
|
8285
|
+
const { register, formState: { errors }, control, trigger, getValues, setValue, } = reactHookForm.useForm();
|
|
8286
|
+
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8287
|
+
// useEffect(() => {
|
|
8288
|
+
// const actionPhone = actions.find(
|
|
8289
|
+
// (action) => action.type === NodeActionType.USER_SUBMIT_PHONE,
|
|
8290
|
+
// )
|
|
8291
|
+
// actionPhone?.key && setValue(actionPhone.key, '+84343261825')
|
|
8292
|
+
// setSentOTP(true)
|
|
8293
|
+
// }, [])
|
|
8294
|
+
// const placeholderPhone = useMemo(() => {
|
|
8295
|
+
// return actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_PHONE)
|
|
8296
|
+
// ?.label
|
|
8297
|
+
// }, [actions])
|
|
8298
|
+
// const placeholderOtp = useMemo(() => {
|
|
8299
|
+
// return actions.find(
|
|
8300
|
+
// ({ type }) => type === NodeActionType.USER_SUBMIT_NUMBER,
|
|
8301
|
+
// )?.label
|
|
8302
|
+
// }, [actions])
|
|
8303
|
+
// const labelBtnSendOtp = 'Gửi mã OTP'
|
|
8304
|
+
// const labelBtnVerifyOtp = useMemo(() => {
|
|
8305
|
+
// return (
|
|
8306
|
+
// actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_SEND)
|
|
8307
|
+
// ?.label || 'Xác minh mã OTP'
|
|
8308
|
+
// )
|
|
8309
|
+
// }, [actions])
|
|
8310
|
+
// const labelBtnResendOtp = useMemo(() => {
|
|
8311
|
+
// return (
|
|
8312
|
+
// actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_RESEND)
|
|
8313
|
+
// ?.label || 'Gửi lại mã OTP'
|
|
8314
|
+
// )
|
|
8315
|
+
// }, [actions])
|
|
8316
|
+
const handleSendOTP = (event) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8317
|
+
var _a;
|
|
8318
|
+
event.preventDefault();
|
|
8319
|
+
const data = getValues();
|
|
8320
|
+
const parsedPhone = PhoneInputBase.parsePhoneNumber(data.phone || '');
|
|
8321
|
+
if (!(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.nationalNumber) || !(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.countryCallingCode)) {
|
|
8322
|
+
return;
|
|
8323
|
+
}
|
|
8324
|
+
setIsLoading(true);
|
|
8325
|
+
try {
|
|
8326
|
+
const result = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.POST_SEND_OTP), 'POST', {
|
|
8327
|
+
data: {
|
|
8328
|
+
phone_number: parsedPhone.nationalNumber,
|
|
8329
|
+
area_code: `+${parsedPhone.countryCallingCode}`,
|
|
8330
|
+
},
|
|
8331
|
+
});
|
|
8332
|
+
setIsLoading(false);
|
|
8333
|
+
if ((result === null || result === void 0 ? void 0 : result._status) === 1) {
|
|
8334
|
+
if (sentOTP) {
|
|
8335
|
+
setIsFinishedCountDown(false);
|
|
8336
|
+
countRef.current.reset();
|
|
8337
|
+
}
|
|
8338
|
+
setSentOTP(true);
|
|
8339
|
+
setTimeout(() => {
|
|
8340
|
+
const input = document.querySelector('.input-otp-code');
|
|
8341
|
+
if (input) {
|
|
8342
|
+
input.focus();
|
|
8343
|
+
input.scrollIntoView({ block: 'center' });
|
|
8344
|
+
}
|
|
8345
|
+
}, 100);
|
|
8346
|
+
return;
|
|
8347
|
+
}
|
|
8348
|
+
if ((result === null || result === void 0 ? void 0 : result._status) === 0 &&
|
|
8349
|
+
((_a = result === null || result === void 0 ? void 0 : result._messages) === null || _a === void 0 ? void 0 : _a[0]) === 'This phone number was verified') {
|
|
8350
|
+
// const { _messages } = result
|
|
8351
|
+
if (countRef.current) {
|
|
8352
|
+
countRef.current.cancel();
|
|
8353
|
+
}
|
|
8354
|
+
pushNotifications({
|
|
8355
|
+
title: '',
|
|
8356
|
+
message: 'Số điện thoại này đã được xác minh.',
|
|
8357
|
+
type: 'success',
|
|
8358
|
+
});
|
|
8359
|
+
const action = actions.find((action) => action.type === index$2.NodeActionType.USER_SUBMIT_SEND);
|
|
8360
|
+
action && callBack(action, data.phone);
|
|
8361
|
+
return;
|
|
8362
|
+
}
|
|
8363
|
+
throw new Error();
|
|
8364
|
+
}
|
|
8365
|
+
catch (error) {
|
|
8366
|
+
setIsLoading(false);
|
|
8367
|
+
if (countRef.current) {
|
|
8368
|
+
countRef.current.cancel();
|
|
8369
|
+
}
|
|
8370
|
+
showMessageSomethingWrong();
|
|
8371
|
+
}
|
|
8372
|
+
});
|
|
8373
|
+
const handleOnVerify = (event, action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8374
|
+
event.preventDefault();
|
|
8375
|
+
setIsLoadingVerify(true);
|
|
8376
|
+
yield trigger();
|
|
8377
|
+
if (isEmpty__default["default"](errors)) {
|
|
8378
|
+
const data = getValues();
|
|
8379
|
+
const { number } = data;
|
|
8380
|
+
const parsedPhone = PhoneInputBase.parsePhoneNumber(data.phone || '');
|
|
8381
|
+
if (!(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.nationalNumber) || !(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.countryCallingCode)) {
|
|
8382
|
+
return;
|
|
8383
|
+
}
|
|
8384
|
+
try {
|
|
8385
|
+
const result = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.POST_VERIFY_OTP), 'POST', {
|
|
8386
|
+
data: {
|
|
8387
|
+
phone_number: parsedPhone.nationalNumber,
|
|
8388
|
+
area_code: `+${parsedPhone.countryCallingCode}`,
|
|
8389
|
+
code: number,
|
|
8390
|
+
},
|
|
8391
|
+
});
|
|
8392
|
+
setIsLoadingVerify(false);
|
|
8393
|
+
if ((result === null || result === void 0 ? void 0 : result._status) === 1) {
|
|
8394
|
+
pushNotifications({
|
|
8395
|
+
title: '',
|
|
8396
|
+
message: f({ id: 'subot.verifyOTP.success.message' }),
|
|
8397
|
+
type: 'success',
|
|
8398
|
+
});
|
|
8399
|
+
callBack(action, data.phone);
|
|
8400
|
+
return;
|
|
8401
|
+
}
|
|
8402
|
+
throw new Error();
|
|
8403
|
+
}
|
|
8404
|
+
catch (error) {
|
|
8405
|
+
pushNotifications({
|
|
8406
|
+
title: '',
|
|
8407
|
+
message: f({ id: 'validation.error.validOTP' }),
|
|
8408
|
+
type: 'danger',
|
|
8409
|
+
});
|
|
8410
|
+
setIsLoadingVerify(false);
|
|
8411
|
+
}
|
|
8412
|
+
}
|
|
8413
|
+
else {
|
|
8414
|
+
setIsLoadingVerify(false);
|
|
8415
|
+
}
|
|
8416
|
+
});
|
|
8417
|
+
const showMessageSomethingWrong = () => {
|
|
8418
|
+
pushNotifications({
|
|
8419
|
+
title: '',
|
|
8420
|
+
message: f({ id: 'notification.comment.somethingWrong' }),
|
|
8421
|
+
type: 'danger',
|
|
8422
|
+
});
|
|
8423
|
+
};
|
|
8424
|
+
const renderFormInput = (action) => {
|
|
8425
|
+
if (!action.key) {
|
|
8426
|
+
return null;
|
|
8427
|
+
}
|
|
8428
|
+
switch (action.type) {
|
|
8429
|
+
case index$2.NodeActionType.USER_SUBMIT_PHONE:
|
|
8430
|
+
return (React__default["default"].createElement("div", { className: "input-row", key: action.id },
|
|
8431
|
+
React__default["default"].createElement("label", { htmlFor: action.key }, action.label),
|
|
8432
|
+
React__default["default"].createElement(reactHookForm.Controller, { name: action.key, control: control, rules: {
|
|
8433
|
+
required: true,
|
|
8434
|
+
validate: (value) => PhoneInputBase.isPossiblePhoneNumber(value),
|
|
8435
|
+
}, render: ({ field: { onChange, value } }) => {
|
|
8436
|
+
const disabledPhone = (!isFinishedCountDown && sentOTP) || isLoading;
|
|
8437
|
+
return (React__default["default"].createElement(StyleWrapperPhoneInput, null,
|
|
8438
|
+
React__default["default"].createElement(PhoneInputWithCode, { value: value, defaultValue: phoneNumber, onChange: onChange, defaultCountry: countryCode, id: action.id, className: `input-row ${action.id}`, name: action.key, disabled: disabledPhone, flagComponent: FlagComponent, placeholder: action.label }),
|
|
8439
|
+
disabledPhone && (React__default["default"].createElement(IconEdit, { viewBox: "0 0 24 24", className: "icon-edit-phone", onClick: () => {
|
|
8440
|
+
var _a;
|
|
8441
|
+
onChange('');
|
|
8442
|
+
setSentOTP(false);
|
|
8443
|
+
setIsLoadingVerify(false);
|
|
8444
|
+
(_a = countRef.current) === null || _a === void 0 ? void 0 : _a.cancel();
|
|
8445
|
+
} })),
|
|
8446
|
+
action.key && errors[action.key] && (React__default["default"].createElement("p", { className: "error-message" }, f({
|
|
8447
|
+
id: 'validation.error.validNumber',
|
|
8448
|
+
defaultMessage: 'Please enter a valid number.',
|
|
8449
|
+
}))),
|
|
8450
|
+
React__default["default"].createElement("div", { className: "submit-btn-row", key: action.id },
|
|
8451
|
+
React__default["default"].createElement(index$8.Button, { className: "submit-btn", size: "lg", onClick: handleSendOTP, isDisabled: (!isFinishedCountDown && sentOTP) || isLoading, isLoading: isLoading }, sentOTP ? (React__default["default"].createElement(CountDown$1, { ref: countRef, isFinished: isFinishedCountDown, onFinish: setIsFinishedCountDown })) : (React__default["default"].createElement("span", null, f({
|
|
8452
|
+
id: 'subot.sendOTP.button',
|
|
8453
|
+
defaultMessage: 'Send OTP',
|
|
8454
|
+
})))))));
|
|
8455
|
+
} })));
|
|
8456
|
+
case index$2.NodeActionType.USER_SUBMIT_NUMBER:
|
|
8457
|
+
if (!sentOTP) {
|
|
8458
|
+
return '';
|
|
8459
|
+
}
|
|
8460
|
+
return (React__default["default"].createElement("div", { className: "input-row", key: action.id },
|
|
8461
|
+
React__default["default"].createElement("label", { htmlFor: action.key }, action.label),
|
|
8462
|
+
React__default["default"].createElement("input", Object.assign({ type: "tel", id: action.id, placeholder: action.label }, register(action.key, {
|
|
8463
|
+
required: true,
|
|
8464
|
+
pattern: /^[0-9]{0,6}$/,
|
|
8465
|
+
}), { className: "input-otp-code" })),
|
|
8466
|
+
errors[action.key] && (React__default["default"].createElement("p", { className: "error-message" }, f({
|
|
8467
|
+
id: 'validation.error.validOTP',
|
|
8468
|
+
defaultMessage: 'Invalid OTP provided',
|
|
8469
|
+
})))));
|
|
8470
|
+
default:
|
|
8471
|
+
return '';
|
|
8472
|
+
}
|
|
8473
|
+
};
|
|
8474
|
+
const renderFormSubmitAndTerms = (action) => {
|
|
8475
|
+
switch (action.type) {
|
|
8476
|
+
case index$2.NodeActionType.USER_SUBMIT_SEND:
|
|
8477
|
+
if (!sentOTP)
|
|
8478
|
+
return '';
|
|
8479
|
+
return (React__default["default"].createElement("div", { className: "submit-btn-row", key: action.id },
|
|
8480
|
+
React__default["default"].createElement(index$8.Button, { className: "submit-btn", size: "lg", isDisabled: isLoadingVerify, isLoading: isLoadingVerify, onClick: (event) => handleOnVerify(event, action) }, action.label)));
|
|
8481
|
+
default:
|
|
8482
|
+
return '';
|
|
8483
|
+
}
|
|
8484
|
+
};
|
|
8485
|
+
React.useEffect(() => {
|
|
8486
|
+
if (phoneNumber) {
|
|
8487
|
+
const action = actions.find((action) => action.type === index$2.NodeActionType.USER_SUBMIT_PHONE);
|
|
8488
|
+
if (action && action.key) {
|
|
8489
|
+
setValue(action.key, `+${areaCode}${phoneNumber}`);
|
|
8490
|
+
}
|
|
8491
|
+
}
|
|
8492
|
+
}, [phoneNumber, areaCode]);
|
|
8493
|
+
return (React__default["default"].createElement(StyledUserInfoFormContainer$1, { className: className, style: style },
|
|
8494
|
+
React__default["default"].createElement("form", { className: "user-info-form" },
|
|
8495
|
+
actions.map((action) => renderFormInput(action)),
|
|
8496
|
+
actions.map((action) => renderFormSubmitAndTerms(action)))));
|
|
8497
|
+
};
|
|
8498
|
+
|
|
8499
|
+
const useVerifyPhoneNumber = () => {
|
|
8500
|
+
const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
|
|
8501
|
+
const [verifiedPhone, setVerifiedPhone] = React.useState(false);
|
|
8502
|
+
React.useEffect(() => {
|
|
8503
|
+
if (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone) {
|
|
8504
|
+
if (userInfo.phone_verified_at && userInfo.verify_phone_code) {
|
|
8505
|
+
setVerifiedPhone(true);
|
|
8506
|
+
}
|
|
8507
|
+
}
|
|
8508
|
+
}, [userInfo]);
|
|
8509
|
+
return verifiedPhone;
|
|
8510
|
+
};
|
|
8511
|
+
|
|
8512
|
+
const SubotInlineNodeOTP = ({ node, indexNumber, }) => {
|
|
8513
|
+
const { params, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8514
|
+
const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
|
|
8515
|
+
const locale = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.locale;
|
|
8516
|
+
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8517
|
+
const verifiedPhone = useVerifyPhoneNumber();
|
|
8518
|
+
const handleOnVerify = (action, phoneNumber) => {
|
|
8519
|
+
var _a;
|
|
8520
|
+
const actionPhone = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.USER_SUBMIT_PHONE);
|
|
8521
|
+
if (!action || !actionPhone) {
|
|
8522
|
+
return;
|
|
8523
|
+
}
|
|
8524
|
+
const form_submit_meta = [
|
|
8525
|
+
{
|
|
8526
|
+
key: String(actionPhone.key),
|
|
8527
|
+
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[index$2.NodeActionType.USER_SUBMIT_PHONE],
|
|
8528
|
+
value: phoneNumber,
|
|
8529
|
+
},
|
|
8530
|
+
];
|
|
8531
|
+
const newValue = Object.assign(Object.assign({}, value), { form_submit_meta, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
|
|
8532
|
+
setValue(newValue);
|
|
8533
|
+
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), newValue), node === null || node === void 0 ? void 0 : node._message));
|
|
8534
|
+
};
|
|
8535
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8536
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8537
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8538
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8539
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8540
|
+
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8541
|
+
React__default["default"].createElement(OTPInfoForm, { phoneNumber: userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone, verified: verifiedPhone, areaCode: userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code, callBack: handleOnVerify, actions: (node === null || node === void 0 ? void 0 : node.actions) || [], countryCode: (locale === null || locale === void 0 ? void 0 : locale.split('-')[1]) || 'PH' }))),
|
|
8542
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
|
|
8543
|
+
};
|
|
8544
|
+
|
|
8545
|
+
// Poll Message
|
|
8546
|
+
// {
|
|
8547
|
+
// form_meta: [
|
|
8548
|
+
// { key: "poll4", control: "formmeta", value: "", action_id: "action.id" },
|
|
8549
|
+
// { key: "poll2", control: "formmeta", value: "", action_id: "action.id" },
|
|
8550
|
+
// { key: "poll3", control: "formmeta", value: "", action_id: "action.id" },
|
|
8551
|
+
// { key: 'attribite-description', control:"formmeta-description", value: '', action_id: "action.id"}
|
|
8552
|
+
// ],
|
|
8553
|
+
// action_id: "button_id",
|
|
8554
|
+
// action_value: "button_attribute"
|
|
8555
|
+
// }
|
|
8556
|
+
const SubotInlineNodePoll = ({ node, indexNumber, }) => {
|
|
8557
|
+
var _a, _b;
|
|
8558
|
+
const { params, onChange, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8559
|
+
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8560
|
+
const validation = useValidationMultiOption();
|
|
8561
|
+
const descriptionNode = useDescriptionPollNode({ node });
|
|
8562
|
+
const submitButton = React.useMemo(() => {
|
|
8563
|
+
var _a;
|
|
8564
|
+
const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.POLL_BUTTON);
|
|
8565
|
+
if (_submitButton)
|
|
8566
|
+
return _submitButton;
|
|
8567
|
+
return null;
|
|
8568
|
+
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8569
|
+
const handleOnChange = (action, formSubmitMeta) => {
|
|
8570
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
8571
|
+
const newValue = JSON.parse(JSON.stringify(Object.assign(Object.assign({}, value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: [...((value === null || value === void 0 ? void 0 : value.form_submit_meta) || [])] })));
|
|
8572
|
+
if ((action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT ||
|
|
8573
|
+
(action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT) {
|
|
8574
|
+
const isExistedPoll = (_a = newValue.form_submit_meta) === null || _a === void 0 ? void 0 : _a.some(({ action_id }) => action_id === action.id);
|
|
8575
|
+
if (isExistedPoll) {
|
|
8576
|
+
newValue.form_submit_meta =
|
|
8577
|
+
typeof formSubmitMeta === 'undefined'
|
|
8578
|
+
? (_b = newValue.form_submit_meta) === null || _b === void 0 ? void 0 : _b.filter(({ action_id }) => action_id !== action.id)
|
|
8579
|
+
: (_c = newValue.form_submit_meta) === null || _c === void 0 ? void 0 : _c.filter(({ action_id }) => action_id !== action.id).concat(formSubmitMeta);
|
|
8580
|
+
}
|
|
8581
|
+
else {
|
|
8582
|
+
newValue.form_submit_meta = (_d = newValue.form_submit_meta) === null || _d === void 0 ? void 0 : _d.concat([
|
|
8583
|
+
{
|
|
8584
|
+
key: action === null || action === void 0 ? void 0 : action.key,
|
|
8585
|
+
control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type] || 'text',
|
|
8586
|
+
value: '',
|
|
8587
|
+
action_id: action === null || action === void 0 ? void 0 : action.id,
|
|
8588
|
+
},
|
|
8589
|
+
]);
|
|
8590
|
+
}
|
|
8591
|
+
setValue(newValue);
|
|
8592
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
8593
|
+
return;
|
|
8594
|
+
}
|
|
8595
|
+
const isPoll = (_e = newValue.form_submit_meta) === null || _e === void 0 ? void 0 : _e.some(({ action_id }) => action_id === (action === null || action === void 0 ? void 0 : action.action_id));
|
|
8596
|
+
if (isPoll) {
|
|
8597
|
+
newValue.form_submit_meta = (_f = newValue.form_submit_meta) === null || _f === void 0 ? void 0 : _f.filter(({ action_id }) => action_id !== (action === null || action === void 0 ? void 0 : action.action_id));
|
|
8598
|
+
}
|
|
8599
|
+
else {
|
|
8600
|
+
newValue.form_submit_meta = (_g = newValue.form_submit_meta) === null || _g === void 0 ? void 0 : _g.concat([action]);
|
|
8601
|
+
}
|
|
8602
|
+
setValue(newValue);
|
|
8603
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
8604
|
+
};
|
|
8605
|
+
const activeActions = React.useMemo(() => {
|
|
8606
|
+
if (value === null || value === void 0 ? void 0 : value.form_submit_meta) {
|
|
8607
|
+
return value === null || value === void 0 ? void 0 : value.form_submit_meta.map(({ action_id }) => action_id);
|
|
8608
|
+
}
|
|
8609
|
+
return [];
|
|
8610
|
+
}, [value, value === null || value === void 0 ? void 0 : value.form_submit_meta]);
|
|
8611
|
+
const handleOnNext = () => {
|
|
8612
|
+
const tmp = {};
|
|
8613
|
+
if (value.form_submit_meta && value.form_submit_meta.length) {
|
|
8614
|
+
tmp[node.id] = value.form_submit_meta.map((_v) => _v.action_id);
|
|
8615
|
+
}
|
|
8616
|
+
const newValue = Object.assign(Object.assign({}, value), { current_polls: tmp });
|
|
8617
|
+
validation.validateSelectActions(activeActions, node, () => {
|
|
8618
|
+
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), newValue));
|
|
8619
|
+
});
|
|
8620
|
+
};
|
|
8621
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8622
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8623
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8624
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8625
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8626
|
+
React__default["default"].createElement(SubotInlineDescription$1, null, descriptionNode),
|
|
8627
|
+
React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.POLL_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
|
|
8628
|
+
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
8629
|
+
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, active: activeActions.includes(action.id), action: action, onChange: handleOnChange, htmlType: "checkbox", formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta })));
|
|
8630
|
+
}))))),
|
|
8631
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
|
|
8632
|
+
};
|
|
8633
|
+
|
|
8634
|
+
// Rating Message
|
|
8635
|
+
// {
|
|
8636
|
+
// form_meta: [
|
|
8637
|
+
// { key: "action.key", control: "star", value: "", action_id: 'action.id' },
|
|
8638
|
+
// { key: 'action.key', control: "text", value: '', action_id: 'action.id' }
|
|
8639
|
+
// ],
|
|
8640
|
+
// action_id: "button_id",
|
|
8641
|
+
// action_value: "button_attribute"
|
|
8642
|
+
// }
|
|
8643
|
+
const SubotInlineNodeRating = ({ node, indexNumber, }) => {
|
|
8644
|
+
var _a, _b;
|
|
8645
|
+
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8646
|
+
const { params, onChange, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8647
|
+
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8648
|
+
const [isSubmit, setIsSubmit] = React.useState(false);
|
|
8649
|
+
const ratingStarValue = React.useMemo(() => {
|
|
8650
|
+
var _a;
|
|
8651
|
+
const _ratingStar = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.RATING_STAR);
|
|
8652
|
+
if (value.form_submit_meta && _ratingStar) {
|
|
8653
|
+
const formIndex = value === null || value === void 0 ? void 0 : value.form_submit_meta.findIndex(({ action_id }) => action_id === (_ratingStar === null || _ratingStar === void 0 ? void 0 : _ratingStar.id));
|
|
8654
|
+
if (formIndex !== -1)
|
|
8655
|
+
return parseInt(value === null || value === void 0 ? void 0 : value.form_submit_meta[formIndex].value);
|
|
8656
|
+
}
|
|
8657
|
+
return 0;
|
|
8658
|
+
}, [value === null || value === void 0 ? void 0 : value.form_submit_meta]);
|
|
8659
|
+
const submitButton = React.useMemo(() => {
|
|
8660
|
+
var _a;
|
|
8661
|
+
const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.RATING_BUTTON);
|
|
8662
|
+
if (_submitButton)
|
|
8663
|
+
return _submitButton;
|
|
8664
|
+
return null;
|
|
8665
|
+
}, []);
|
|
8666
|
+
const handleOnChange = (formValue) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8667
|
+
if (formValue) {
|
|
8668
|
+
const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
|
|
8669
|
+
? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
|
|
8670
|
+
: [] });
|
|
8671
|
+
const tmpFormSubmitMeta = [
|
|
8672
|
+
..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
|
|
8673
|
+
];
|
|
8674
|
+
const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
|
|
8675
|
+
if (formUpdateIndex !== -1)
|
|
8676
|
+
tmpFormSubmitMeta[formUpdateIndex] = Object.assign({}, formValue);
|
|
8677
|
+
else
|
|
8678
|
+
tmpFormSubmitMeta.push(formValue);
|
|
8679
|
+
_message.form_submit_meta = [...tmpFormSubmitMeta];
|
|
8680
|
+
setValue(_message);
|
|
8681
|
+
onChange && onChange(_message);
|
|
8682
|
+
}
|
|
8683
|
+
});
|
|
8684
|
+
const handleOnNext = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8685
|
+
if (!value.form_submit_meta || ratingStarValue === 0) {
|
|
8686
|
+
pushNotifications({
|
|
8687
|
+
title: '',
|
|
8688
|
+
message: f({
|
|
8689
|
+
id: 'multiSelectError.required',
|
|
8690
|
+
defaultMessage: `There is no answer!`,
|
|
8691
|
+
}),
|
|
8692
|
+
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8693
|
+
});
|
|
8694
|
+
return;
|
|
8695
|
+
}
|
|
8696
|
+
if (!isSubmit) {
|
|
8697
|
+
const _message = Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value);
|
|
8698
|
+
const res = yield subotInlineMessage(_message);
|
|
8699
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8700
|
+
const _c = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _c, restData = tslib_es6.__rest(_c, ["node"]);
|
|
8701
|
+
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8702
|
+
onSubmit && onSubmit(_nextNode, _message);
|
|
8703
|
+
setIsSubmit(true);
|
|
8704
|
+
}
|
|
8705
|
+
}
|
|
8706
|
+
else {
|
|
8707
|
+
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
|
|
8708
|
+
}
|
|
8709
|
+
});
|
|
8710
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8711
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8712
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8713
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8714
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8715
|
+
React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.RATING_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
|
|
8716
|
+
var _a;
|
|
8717
|
+
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
8718
|
+
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnChange, value: (value &&
|
|
8719
|
+
(value === null || value === void 0 ? void 0 : value.form_submit_meta) &&
|
|
8720
|
+
((_a = value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) })));
|
|
8721
|
+
}))))),
|
|
8722
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
|
|
8723
|
+
};
|
|
8724
|
+
|
|
8725
|
+
const SubotInlineNodeReaction = ({ node, indexNumber, }) => {
|
|
8726
|
+
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8727
|
+
const { params, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8728
|
+
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8729
|
+
const handleOnChange = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8730
|
+
if (action) {
|
|
8731
|
+
setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
|
|
8732
|
+
const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
|
|
8733
|
+
const res = yield subotInlineMessage(_message);
|
|
8734
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8735
|
+
const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
8736
|
+
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8737
|
+
onSubmit && onSubmit(_nextNode, _message);
|
|
8738
|
+
}
|
|
8739
|
+
}
|
|
8740
|
+
});
|
|
8741
|
+
const handleOnNext = () => {
|
|
8742
|
+
var _a;
|
|
8743
|
+
if (!(node === null || node === void 0 ? void 0 : node._message) || !((_a = node._message) === null || _a === void 0 ? void 0 : _a.action_id)) {
|
|
8744
|
+
pushNotifications({
|
|
8745
|
+
title: '',
|
|
8746
|
+
message: f({
|
|
8747
|
+
id: 'multiSelectError.required',
|
|
8748
|
+
defaultMessage: `There is no answer!`,
|
|
8749
|
+
}),
|
|
8750
|
+
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8751
|
+
});
|
|
8752
|
+
}
|
|
8753
|
+
else {
|
|
8754
|
+
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
|
|
8755
|
+
}
|
|
8756
|
+
};
|
|
8757
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8758
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8759
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8760
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8761
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8762
|
+
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8763
|
+
React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: (node === null || node === void 0 ? void 0 : node.actions) || [], onChange: handleOnChange }))),
|
|
8764
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
|
|
8765
|
+
};
|
|
8766
|
+
|
|
8767
|
+
const SubotInlineNodeResultPoll = ({ node, }) => {
|
|
8768
|
+
var _a, _b;
|
|
8769
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8770
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8771
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8772
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8773
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [] })),
|
|
8774
|
+
React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.POLL_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
|
|
8775
|
+
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
8776
|
+
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, htmlType: "checkbox", node_type: node === null || node === void 0 ? void 0 : node.type })));
|
|
8777
|
+
})))))));
|
|
8778
|
+
};
|
|
8779
|
+
|
|
8780
|
+
// Review Message
|
|
8781
|
+
// {
|
|
8782
|
+
// form_meta: [
|
|
8783
|
+
// { key: "review1", control: "formmeta", value: '', action_id: "action.id" },
|
|
8784
|
+
// { key: "review2", control: "formmeta", value: '', action_id: "action.id" },
|
|
8785
|
+
// { key: "review3", control: "formmeta", value: "" },
|
|
8786
|
+
// { key: "review4", control: "formmeta", value: "" },
|
|
8787
|
+
// { key: "review5", control: "formmeta", value: "" },
|
|
8788
|
+
// {key: 'attribite-description', control:"formmeta-description", value: ''}
|
|
8789
|
+
// ],
|
|
8790
|
+
// action_id: "button_id",
|
|
8791
|
+
// action_value: "button_attribute"
|
|
8792
|
+
// }
|
|
8793
|
+
const SubotInlineNodeReview = ({ node, indexNumber, }) => {
|
|
8794
|
+
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8795
|
+
const { params, onChange, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
|
|
8796
|
+
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8797
|
+
const [isSubmit, setIsSubmit] = React.useState(false);
|
|
8798
|
+
const reviewChoices = React.useMemo(() => {
|
|
8799
|
+
var _a;
|
|
8800
|
+
return ((_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.filter(({ type }) => type === index$2.NodeActionType.REVIEW_CHOICE)) || [];
|
|
8801
|
+
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8802
|
+
const reviewDescriptions = React.useMemo(() => {
|
|
8803
|
+
var _a;
|
|
8804
|
+
return ((_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.filter(({ type }) => type === index$2.NodeActionType.REVIEW_DESCRIPTION)) || [];
|
|
8805
|
+
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8806
|
+
const submitButton = React.useMemo(() => {
|
|
8807
|
+
var _a;
|
|
8808
|
+
const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.REVIEW_BUTTON);
|
|
8809
|
+
if (_submitButton)
|
|
8810
|
+
return _submitButton;
|
|
8811
|
+
return null;
|
|
8812
|
+
}, [node === null || node === void 0 ? void 0 : node.actions]);
|
|
8813
|
+
const activeActions = React.useMemo(() => {
|
|
8814
|
+
if (value === null || value === void 0 ? void 0 : value.form_submit_meta) {
|
|
8815
|
+
return value === null || value === void 0 ? void 0 : value.form_submit_meta.map(({ action_id }) => action_id).filter((action_id) => !!(reviewChoices === null || reviewChoices === void 0 ? void 0 : reviewChoices.map(({ id }) => id).includes(action_id)));
|
|
8816
|
+
}
|
|
8817
|
+
return [];
|
|
8818
|
+
}, [value, value === null || value === void 0 ? void 0 : value.form_submit_meta]);
|
|
8819
|
+
const handleOnClick = (formValue) => {
|
|
8820
|
+
if (formValue) {
|
|
8821
|
+
const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
|
|
8822
|
+
? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
|
|
8823
|
+
: [] });
|
|
8824
|
+
let tmpFormSubmitMeta = [
|
|
8825
|
+
..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
|
|
8826
|
+
];
|
|
8827
|
+
const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
|
|
8828
|
+
if (formUpdateIndex !== -1)
|
|
8829
|
+
tmpFormSubmitMeta = [
|
|
8830
|
+
...tmpFormSubmitMeta.slice(0, formUpdateIndex),
|
|
8831
|
+
...tmpFormSubmitMeta.slice(formUpdateIndex + 1),
|
|
8832
|
+
];
|
|
8833
|
+
else
|
|
8834
|
+
tmpFormSubmitMeta.push(formValue);
|
|
8835
|
+
_message.form_submit_meta = [...tmpFormSubmitMeta];
|
|
8836
|
+
setValue(_message);
|
|
8837
|
+
setIsSubmit(false);
|
|
8838
|
+
onChange && onChange(_message);
|
|
8839
|
+
}
|
|
8840
|
+
};
|
|
8841
|
+
const handleOnChange = (formValue) => {
|
|
8842
|
+
if (formValue) {
|
|
8843
|
+
const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
|
|
8844
|
+
? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
|
|
8845
|
+
: [] });
|
|
8846
|
+
const tmpFormSubmitMeta = [
|
|
8847
|
+
..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
|
|
8848
|
+
];
|
|
8849
|
+
const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
|
|
8850
|
+
if (formUpdateIndex !== -1)
|
|
8851
|
+
tmpFormSubmitMeta[formUpdateIndex] = Object.assign({}, formValue);
|
|
8852
|
+
else
|
|
8853
|
+
tmpFormSubmitMeta.push(formValue);
|
|
8854
|
+
_message.form_submit_meta = [...tmpFormSubmitMeta];
|
|
8855
|
+
setValue(_message);
|
|
8856
|
+
setIsSubmit(false);
|
|
8857
|
+
onChange && onChange(_message);
|
|
8858
|
+
}
|
|
8859
|
+
};
|
|
8860
|
+
const handleOnNext = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8861
|
+
var _a;
|
|
8862
|
+
if (!((_a = node === null || node === void 0 ? void 0 : node._message) === null || _a === void 0 ? void 0 : _a.form_submit_meta) || !activeActions.length) {
|
|
8863
|
+
pushNotifications({
|
|
8864
|
+
title: '',
|
|
8865
|
+
message: f({
|
|
8866
|
+
id: 'multiSelectError.required',
|
|
8867
|
+
defaultMessage: `There is no answer!`,
|
|
8868
|
+
}),
|
|
8869
|
+
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
8870
|
+
});
|
|
8871
|
+
return;
|
|
8872
|
+
}
|
|
8873
|
+
if (!isSubmit) {
|
|
8874
|
+
const _message = Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value);
|
|
8875
|
+
const res = yield subotInlineMessage(_message);
|
|
8876
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8877
|
+
const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
|
|
8878
|
+
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8879
|
+
onSubmit && onSubmit(_nextNode, _message);
|
|
8880
|
+
setIsSubmit(true);
|
|
8881
|
+
}
|
|
8882
|
+
}
|
|
8883
|
+
else {
|
|
8884
|
+
onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
|
|
8885
|
+
}
|
|
8886
|
+
});
|
|
8887
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8888
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8889
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8890
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8891
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
8892
|
+
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8893
|
+
!!reviewChoices.length && (React__default["default"].createElement(SubotInlineReviewContainer, null,
|
|
8894
|
+
React__default["default"].createElement(SubotInlineActionListContainer, { className: "review-container" }, reviewChoices.map((action) => {
|
|
8895
|
+
var _a;
|
|
8896
|
+
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
8897
|
+
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnClick, active: (value &&
|
|
8898
|
+
!!((_a = value === null || value === void 0 ? void 0 : value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) ||
|
|
8899
|
+
false })));
|
|
8900
|
+
})))),
|
|
8901
|
+
!!(reviewDescriptions === null || reviewDescriptions === void 0 ? void 0 : reviewDescriptions.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, reviewDescriptions.map((action) => {
|
|
8902
|
+
var _a;
|
|
8903
|
+
const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
|
|
8904
|
+
return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnChange, value: (value &&
|
|
8905
|
+
(value === null || value === void 0 ? void 0 : value.form_submit_meta) &&
|
|
8906
|
+
((_a = value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) })));
|
|
8907
|
+
}))))),
|
|
8908
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
|
|
8909
|
+
};
|
|
8910
|
+
|
|
8911
|
+
const SubotInlineNodeSSO = ({ node, indexNumber, }) => {
|
|
8912
|
+
const refIsTrigger = React.useRef(false);
|
|
8913
|
+
const { params, onPrev, nodes, activeId, userInfo } = React.useContext(SubotInlineContext);
|
|
8914
|
+
React.useEffect(() => {
|
|
8915
|
+
var _a;
|
|
8916
|
+
const actionSSO = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find((act) => act.type === index$2.NodeActionType.ACTION_SSO_REDIRECT);
|
|
8917
|
+
if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) && actionSSO && !refIsTrigger.current) {
|
|
8918
|
+
refIsTrigger.current = true;
|
|
8919
|
+
handleOnChange(actionSSO);
|
|
8920
|
+
}
|
|
8921
|
+
}, [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
|
|
8922
|
+
const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8923
|
+
const handleOnChange = (action) => {
|
|
8924
|
+
if (action && action.type === index$2.NodeActionType.ACTION_SSO_REDIRECT) {
|
|
8925
|
+
const currentState = {
|
|
8926
|
+
params: Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, mode: 'inline' }),
|
|
8927
|
+
listNodes: nodes,
|
|
8928
|
+
activeId,
|
|
8929
|
+
createdAt: new Date().getTime(),
|
|
8930
|
+
botId: params.bot_id,
|
|
8931
|
+
};
|
|
8932
|
+
localStorage.setItem(STATE_SUBOT_INLINE_KEY, JSON.stringify(currentState));
|
|
8933
|
+
const urlObj = utils$1.getURLwithSSOTracking(window.location.href, {
|
|
8934
|
+
botItem: nodes[0],
|
|
8935
|
+
});
|
|
8936
|
+
urlObj.searchParams.set('bot_id', String(params.bot_id));
|
|
8937
|
+
urlObj.searchParams.set('mode', 'inline');
|
|
8938
|
+
urlObj.searchParams.set('source', 'subot-inline');
|
|
8939
|
+
const returnUrl = urlObj.href;
|
|
8940
|
+
if (store.IS_SSOV2_ENABLED()) {
|
|
8941
|
+
store.useSSOV2Store.getState().triggerLogin({
|
|
8942
|
+
returnUrl,
|
|
8943
|
+
source: `subot-inline`,
|
|
8944
|
+
});
|
|
8945
|
+
}
|
|
8946
|
+
else {
|
|
8947
|
+
window.location.href = `${index$3.SSO_URL}?returnUrl=${encodeURIComponent(returnUrl)}`;
|
|
8948
|
+
}
|
|
8949
|
+
}
|
|
8950
|
+
};
|
|
8951
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
8952
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
8953
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
8954
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
8955
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: [
|
|
8956
|
+
...((node === null || node === void 0 ? void 0 : node.intents) || []),
|
|
8957
|
+
...index$1.ssoIntents(f),
|
|
8958
|
+
], indexNumber: indexNumber })),
|
|
8959
|
+
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
8960
|
+
React__default["default"].createElement(SubotInlineAction, { actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange }))),
|
|
8961
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
|
|
8962
|
+
};
|
|
8963
|
+
|
|
8964
|
+
const SubotInlineNodeText = ({ node, indexNumber, }) => {
|
|
8965
|
+
const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
|
|
8966
|
+
const { nodes, activeId, params, onSubmit, onPrev, onNext, onChange } = React.useContext(SubotInlineContext);
|
|
8967
|
+
const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
|
|
8968
|
+
const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8969
|
+
const _message = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(nodes, activeId, action.id));
|
|
8970
|
+
delete _message.form_submit_meta;
|
|
8971
|
+
const res = yield subotInlineMessage(_message);
|
|
8972
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
8973
|
+
const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
8974
|
+
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
8975
|
+
onSubmit && onSubmit(_nextNode, _message);
|
|
8976
|
+
}
|
|
8977
|
+
});
|
|
8978
|
+
const handleOnChange = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
8979
|
+
if (!action)
|
|
8980
|
+
return;
|
|
8981
|
+
const actionWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
|
|
8982
|
+
(action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
|
|
8983
|
+
const newValue = Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: formSubmitMeta });
|
|
8984
|
+
if (actionWithOther) {
|
|
8985
|
+
setValue(newValue);
|
|
8986
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
8987
|
+
return;
|
|
8988
|
+
}
|
|
8989
|
+
delete newValue.form_submit_meta;
|
|
8990
|
+
setValue(newValue);
|
|
8991
|
+
handleOnChangeNormal(action);
|
|
8992
|
+
});
|
|
8993
|
+
const handleOnNext = () => {
|
|
8994
|
+
const newMessage = JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value)));
|
|
8995
|
+
if ((value === null || value === void 0 ? void 0 : value.action_id) &&
|
|
8996
|
+
(value === null || value === void 0 ? void 0 : value.action_value) === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD) {
|
|
8997
|
+
onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
|
|
8998
|
+
return;
|
|
8999
|
+
}
|
|
9000
|
+
if (!(value === null || value === void 0 ? void 0 : value.action_id) || !(value === null || value === void 0 ? void 0 : value.action_value)) {
|
|
9001
|
+
pushNotifications({
|
|
9002
|
+
title: '',
|
|
9003
|
+
message: f({
|
|
9004
|
+
id: 'multiSelectError.required',
|
|
9005
|
+
defaultMessage: `There is no answer!`,
|
|
9006
|
+
}),
|
|
9007
|
+
type: 'warning', // "success" | "danger" | "info" | "warning"
|
|
9008
|
+
});
|
|
9009
|
+
}
|
|
9010
|
+
else {
|
|
9011
|
+
delete newMessage.form_submit_meta;
|
|
9012
|
+
onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
|
|
9013
|
+
}
|
|
9014
|
+
};
|
|
9015
|
+
return (React__default["default"].createElement(SubotInlineContainer$1, null,
|
|
9016
|
+
React__default["default"].createElement(SubotInlineHeader$1, null),
|
|
9017
|
+
React__default["default"].createElement(SubotInlineWrapper$1, null,
|
|
9018
|
+
React__default["default"].createElement(SubotInlineIntentContainer, null,
|
|
9019
|
+
React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
|
|
9020
|
+
React__default["default"].createElement(SubotInlineActionContainer, null,
|
|
9021
|
+
React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange, formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
|
|
9022
|
+
React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
|
|
9023
|
+
};
|
|
9024
|
+
|
|
9025
|
+
const SubotInlineNodeBase = {
|
|
9026
|
+
TEXT: SubotInlineNodeText,
|
|
9027
|
+
IMAGE: SubotInlineNodeImage,
|
|
9028
|
+
FORM: SubotInlineNodeForm,
|
|
9029
|
+
CONDITION: SubotInlineNode,
|
|
9030
|
+
FINAL_STANDARD: SubotInlineNodeFinal,
|
|
9031
|
+
FINAL: SubotInlineNodeFinal,
|
|
9032
|
+
FINAL_THANK_YOU: SubotInlineNodeFinalThankYou,
|
|
9033
|
+
SSO: SubotInlineNodeSSO,
|
|
9034
|
+
MULTIPLE: SubotInlineNodeMultiple,
|
|
9035
|
+
POLL: SubotInlineNodePoll,
|
|
9036
|
+
RATING: SubotInlineNodeRating,
|
|
9037
|
+
REACTION: SubotInlineNodeReaction,
|
|
9038
|
+
REVIEW: SubotInlineNodeReview,
|
|
9039
|
+
RESULT_POLL: SubotInlineNodeResultPoll,
|
|
9040
|
+
OTP: SubotInlineNodeOTP,
|
|
9041
|
+
// RESULT_RATING = 12,
|
|
9042
|
+
// RESULT_REACTION = 13,
|
|
9043
|
+
};
|
|
9044
|
+
|
|
9045
|
+
const SubotInlineButton = styled__default["default"](index$8.Button) `
|
|
9046
|
+
margin-top: 24px;
|
|
9047
|
+
${utils.MediaQueries.mbUp} {
|
|
9048
|
+
margin-top: 16px;
|
|
9049
|
+
}
|
|
9050
|
+
`;
|
|
9051
|
+
const SubotInlineDescription = styled__default["default"].div `
|
|
9052
|
+
margin-top: 24px;
|
|
9053
|
+
`;
|
|
9054
|
+
const SubotInlineReview = styled__default["default"](index$d.Text) `
|
|
9055
|
+
text-align: center;
|
|
9056
|
+
${utils.MediaQueries.mbUp} {
|
|
9057
|
+
text-align: left;
|
|
9058
|
+
}
|
|
9059
|
+
`;
|
|
9060
|
+
const SubotInlineTitle = styled__default["default"](index$e.Heading) `
|
|
9061
|
+
text-align: center;
|
|
9062
|
+
margin-bottom: 8px;
|
|
9063
|
+
|
|
9064
|
+
${utils.MediaQueries.mbUp} {
|
|
9065
|
+
margin-bottom: 0;
|
|
9066
|
+
text-align: left;
|
|
9067
|
+
}
|
|
9068
|
+
`;
|
|
9069
|
+
const SubotInlineImage = styled__default["default"].div `
|
|
9070
|
+
background-color: #ffffff;
|
|
9071
|
+
border-radius: 50%;
|
|
9072
|
+
width: 120px;
|
|
9073
|
+
height: 120px;
|
|
9074
|
+
object-fit: contain;
|
|
9075
|
+
overflow: hidden;
|
|
9076
|
+
flex-shrink: 0;
|
|
9077
|
+
|
|
9078
|
+
img {
|
|
9079
|
+
width: 100%;
|
|
9080
|
+
height: 100%;
|
|
9081
|
+
object-fit: cover;
|
|
9082
|
+
}
|
|
9083
|
+
`;
|
|
9084
|
+
const SubotInlineContent = styled__default["default"].div `
|
|
9085
|
+
flex-grow: 1;
|
|
9086
|
+
${utils.MediaQueries.tdDown} {
|
|
9087
|
+
width: 100%;
|
|
9088
|
+
margin-left: 0;
|
|
9089
|
+
}
|
|
9090
|
+
`;
|
|
9091
|
+
const SubotInlineStartWrapper = styled__default["default"].div `
|
|
9092
|
+
position: relative;
|
|
9093
|
+
display: flex;
|
|
9094
|
+
gap: 24px;
|
|
9095
|
+
${utils.MediaQueries.mbDown} {
|
|
9096
|
+
flex-wrap: wrap;
|
|
9097
|
+
justify-content: center;
|
|
9098
|
+
}
|
|
9099
|
+
`;
|
|
9100
|
+
const SubotInlineStartContainer = styled__default["default"].div `
|
|
9101
|
+
position: relative;
|
|
9102
|
+
overflow: hidden;
|
|
9103
|
+
background-color: ${miscTheme.theme.colors.primary50};
|
|
9104
|
+
padding: 32px;
|
|
9105
|
+
border-radius: ${miscTheme.theme.borderRadius};
|
|
9106
|
+
background-image: url('/images/subot-bg-transparent.png');
|
|
9107
|
+
background-size: contain;
|
|
9108
|
+
background-repeat: repeat-y;
|
|
9109
|
+
${utils.MediaQueries.mbDown} {
|
|
9110
|
+
padding: 24px;
|
|
9111
|
+
}
|
|
9112
|
+
`;
|
|
9113
|
+
const SubotInlineNodeStart = ({ node, setLoading, }) => {
|
|
9114
|
+
const startRef = React.useRef({
|
|
9115
|
+
impress: false,
|
|
9116
|
+
});
|
|
9117
|
+
const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
|
|
9118
|
+
const { params, onNext, trackingCommonInline, isMobile } = React.useContext(SubotInlineContext);
|
|
9119
|
+
const handleOnClick = (isCountClick = true) => () => {
|
|
9120
|
+
if (isCountClick) {
|
|
9121
|
+
const queryParams = {
|
|
9122
|
+
cookie_id: params.cookie_id,
|
|
9123
|
+
window_id: params.window_id,
|
|
9124
|
+
bot_id: params.bot_id,
|
|
9125
|
+
title_url: params.title_url,
|
|
9126
|
+
url: params.url,
|
|
9127
|
+
gtm_id: params.gtm_id,
|
|
9128
|
+
ga_client_id: params.ga_client_id,
|
|
9129
|
+
device_id: index$1.checkMobile(window.navigator.userAgent) ? 2 : 1,
|
|
9130
|
+
account_id: params.account_id || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || null,
|
|
9131
|
+
};
|
|
9132
|
+
subotInlineClick(queryParams);
|
|
9133
|
+
}
|
|
9134
|
+
onNext && onNext();
|
|
9135
|
+
};
|
|
9136
|
+
React.useEffect(() => {
|
|
9137
|
+
const inViewport = (element, callback, options = {}) => {
|
|
9138
|
+
if (!!window.IntersectionObserver && !startRef.current.impress) {
|
|
9139
|
+
const observer = new IntersectionObserver((entries, observer) => {
|
|
9140
|
+
entries.forEach((entry) => callback(entry, observer));
|
|
9141
|
+
}, options);
|
|
9142
|
+
observer.observe(element);
|
|
9143
|
+
}
|
|
9144
|
+
};
|
|
9145
|
+
const eventScrollImpress = () => {
|
|
9146
|
+
if (startRef.current.element) {
|
|
9147
|
+
inViewport(startRef.current.element, (element, observer) => {
|
|
9148
|
+
/** Not in viewport */
|
|
9149
|
+
if (!element.isIntersecting) {
|
|
9150
|
+
if (startRef.current.impress) {
|
|
9151
|
+
startRef.current.impress = false;
|
|
9152
|
+
}
|
|
9153
|
+
return;
|
|
9154
|
+
}
|
|
9155
|
+
if (!startRef.current.impress) {
|
|
9156
|
+
startRef.current.impress = true;
|
|
9157
|
+
if (startRef.current.debounce) {
|
|
9158
|
+
clearTimeout(startRef.current.debounce);
|
|
9159
|
+
}
|
|
9160
|
+
if (!(node === null || node === void 0 ? void 0 : node.inline_start_button)) {
|
|
9161
|
+
setLoading(true);
|
|
9162
|
+
}
|
|
9163
|
+
startRef.current.debounce = setTimeout(() => {
|
|
9164
|
+
const queryParams = {
|
|
9165
|
+
cookie_id: params.cookie_id,
|
|
9166
|
+
window_id: params.window_id,
|
|
9167
|
+
bot_id: params.bot_id,
|
|
9168
|
+
title_url: params.title_url,
|
|
9169
|
+
url: params.url,
|
|
9170
|
+
gtm_id: params.gtm_id,
|
|
9171
|
+
ga_client_id: params.ga_client_id,
|
|
9172
|
+
device_id: index$1.checkMobile(window.navigator.userAgent) ? 2 : 1,
|
|
9173
|
+
account_id: params.account_id || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || null,
|
|
9174
|
+
};
|
|
9175
|
+
queryParams && subotInlineImpression(queryParams);
|
|
9176
|
+
/** Auto skip the starting node in the case
|
|
9177
|
+
* CTA Start value is not contributed on Subot Admin */
|
|
9178
|
+
if (!(node === null || node === void 0 ? void 0 : node.inline_start_button)) {
|
|
9179
|
+
handleOnClick(false)();
|
|
9180
|
+
}
|
|
9181
|
+
}, 400);
|
|
9182
|
+
startRef.current.element &&
|
|
9183
|
+
(observer === null || observer === void 0 ? void 0 : observer.unobserve(startRef.current.element));
|
|
9184
|
+
}
|
|
9185
|
+
}, {
|
|
9186
|
+
rootMargin: '1000px',
|
|
9187
|
+
});
|
|
9188
|
+
}
|
|
9189
|
+
};
|
|
9190
|
+
eventScrollImpress();
|
|
9191
|
+
window.addEventListener('scroll', eventScrollImpress, { passive: true });
|
|
9192
|
+
return () => window.removeEventListener('scroll', eventScrollImpress);
|
|
9193
|
+
}, [onNext]);
|
|
9194
|
+
if (!node)
|
|
9195
|
+
return null;
|
|
9196
|
+
return (React__default["default"].createElement(SubotInlineStartContainer, null,
|
|
9197
|
+
React__default["default"].createElement(SubotInlineStartWrapper, { ref: (ref) => (startRef.current.element = ref) },
|
|
9198
|
+
node.inline_image && (React__default["default"].createElement(SubotInlineImage, null,
|
|
9199
|
+
React__default["default"].createElement("img", { loading: "lazy", src: node.inline_image, alt: "" }))),
|
|
9200
|
+
React__default["default"].createElement(SubotInlineContent, null,
|
|
9201
|
+
node.inline_title || node.inline_headline ? (React__default["default"].createElement(SubotInlineTitle, { tag: "h3", fontWeight: "bold", color: miscTheme.theme.colors.secondaryBase },
|
|
9202
|
+
React__default["default"].createElement(Markdown, null, node.inline_title || node.inline_headline))) : null,
|
|
9203
|
+
node.inline_review && (React__default["default"].createElement(SubotInlineReview, { size: "s4", color: miscTheme.theme.colors.gray600,
|
|
9204
|
+
// fix error html, div is not allowed as child of p
|
|
9205
|
+
as: 'div' },
|
|
9206
|
+
React__default["default"].createElement(Markdown, null, node.inline_review))),
|
|
9207
|
+
node.inline_start_button && (React__default["default"].createElement(SubotInlineButton, Object.assign({ size: "md", isBlock: isMobile, onClick: handleOnClick(true), className: "pointer-event-child-none" }, trackingCommonInline, { "data-event-action": "Start" }), node.inline_start_button)))),
|
|
9208
|
+
React__default["default"].createElement(SubotInlineDescription, null,
|
|
9209
|
+
React__default["default"].createElement(Markdown, null, node.inline_description))));
|
|
9210
|
+
};
|
|
9211
|
+
|
|
9212
|
+
const SubotInlineLoading = styled__default["default"].div `
|
|
9213
|
+
position: absolute;
|
|
9214
|
+
z-index: 2;
|
|
9215
|
+
top: 0;
|
|
9216
|
+
right: 0;
|
|
9217
|
+
bottom: 0;
|
|
9218
|
+
left: 0;
|
|
9219
|
+
display: flex;
|
|
9220
|
+
flex-direction: column;
|
|
9221
|
+
align-items: center;
|
|
9222
|
+
justify-content: center;
|
|
9223
|
+
color: ${miscTheme.theme.colors.gray800};
|
|
9224
|
+
opacity: 0;
|
|
9225
|
+
pointer-events: none;
|
|
9226
|
+
&:before {
|
|
9227
|
+
position: absolute;
|
|
9228
|
+
z-index: -1;
|
|
9229
|
+
top: 0;
|
|
9230
|
+
right: 0;
|
|
9231
|
+
bottom: 0;
|
|
9232
|
+
left: 0;
|
|
9233
|
+
background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
|
|
9234
|
+
content: '';
|
|
9235
|
+
opacity: 1;
|
|
9236
|
+
}
|
|
9237
|
+
${({ isLoading }) => isLoading && ` opacity: 1; pointer-events: auto; `};
|
|
9238
|
+
`;
|
|
9239
|
+
const SubotInlineLoadingContainer = styled__default["default"].div `
|
|
9240
|
+
position: relative;
|
|
9241
|
+
z-index: 1;
|
|
9242
|
+
line-height: 1.5;
|
|
9243
|
+
transition: 0.25s all linear;
|
|
9244
|
+
margin-block: 16px;
|
|
9245
|
+
content-visibility: auto;
|
|
9246
|
+
contain-intrinsic-size: 500px;
|
|
9247
|
+
&.hhg-subot-style {
|
|
9248
|
+
min-height: 100px;
|
|
9249
|
+
}
|
|
9250
|
+
${utils.MediaQueries.mbDown} {
|
|
9251
|
+
margin-right: -1rem;
|
|
9252
|
+
margin-left: -1rem;
|
|
9253
|
+
}
|
|
9254
|
+
`;
|
|
9255
|
+
const SubotInline = ({ id, isMobile, articleLink, customUrl, }) => {
|
|
9256
|
+
const currentUrl = useCurrentUrl();
|
|
9257
|
+
const refAccountIdFromLogs = React.useRef(null);
|
|
9258
|
+
const flag = React.useRef(null);
|
|
9259
|
+
const [loading, setLoading] = React.useState(true);
|
|
9260
|
+
const [state, setState] = React.useState({
|
|
9261
|
+
activeId: '',
|
|
9262
|
+
params: {},
|
|
9263
|
+
nodes: [],
|
|
9264
|
+
getParams: () => ({}),
|
|
9265
|
+
});
|
|
9266
|
+
const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
|
|
9267
|
+
const currentNode = React.useMemo(() => {
|
|
9268
|
+
return state.nodes.find((n) => n.id == state.activeId);
|
|
9269
|
+
}, [state.nodes, state.activeId]);
|
|
9270
|
+
const trackingCommonInline = React.useMemo(() => ({
|
|
9271
|
+
'data-event-category': 'Subot',
|
|
9272
|
+
'data-event-label': currentUrl,
|
|
9273
|
+
'data-bot-id': state.params.bot_id,
|
|
9274
|
+
'data-bot-type': 'Inline',
|
|
9275
|
+
'data-question-id': typeof (currentNode === null || currentNode === void 0 ? void 0 : currentNode.id) === 'string' ? currentNode === null || currentNode === void 0 ? void 0 : currentNode.id : null,
|
|
9276
|
+
}), [currentNode, currentUrl, state.params.bot_id]);
|
|
9277
|
+
/** Get Params */
|
|
9278
|
+
const getParams = React.useCallback(() => {
|
|
9279
|
+
var _a, _b, _c, _d;
|
|
9280
|
+
const gaData = window.gaData;
|
|
9281
|
+
const _url = (customUrl || window.location.origin + index$3.basePath) +
|
|
9282
|
+
(togetherComponentGlobalContext.GlobalData.locale === 'tl-PH'
|
|
9283
|
+
? articleLink.replace('fil/', '')
|
|
9284
|
+
: articleLink);
|
|
9285
|
+
const params = {
|
|
9286
|
+
bot_id: id,
|
|
9287
|
+
account_id: ((_a = index$1.getUserInfoFromCookie()) === null || _a === void 0 ? void 0 : _a.id) || null,
|
|
9288
|
+
action_id: '',
|
|
9289
|
+
action_value: '',
|
|
9290
|
+
cookie_id: index$1.getSubotCookieId((_c = (_b = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.router) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.cookie_id),
|
|
9291
|
+
current_score: 0,
|
|
9292
|
+
current_keys: [],
|
|
9293
|
+
current_selected: [],
|
|
9294
|
+
form_submit_meta: [],
|
|
9295
|
+
gtm_id: gaData ? Object.keys(gaData)[0] : '',
|
|
9296
|
+
ga_client_id: Cookies__default["default"].get('_ga') || '',
|
|
9297
|
+
is_new: false,
|
|
9298
|
+
mode: 'inline',
|
|
9299
|
+
node_id: '',
|
|
9300
|
+
selected_actions: {},
|
|
9301
|
+
title_url: document.title || '',
|
|
9302
|
+
// url: _url,
|
|
9303
|
+
// Keep this commnent line to test on local
|
|
9304
|
+
url: _url
|
|
9305
|
+
.replace('http://localhost', 'https://discover.hellobacsi.com')
|
|
9306
|
+
.replace('dev.', 'discover.'),
|
|
9307
|
+
window_id: index$1.getWindowId(),
|
|
9308
|
+
};
|
|
9309
|
+
return index$1.overrideParamsByQuery(params, (_d = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.router) === null || _d === void 0 ? void 0 : _d.query);
|
|
9310
|
+
}, []);
|
|
9311
|
+
const elementScrollIntoView = () => {
|
|
9312
|
+
flag.current &&
|
|
9313
|
+
flag.current.scrollIntoView({
|
|
9314
|
+
behavior: 'smooth',
|
|
9315
|
+
block: 'start',
|
|
9316
|
+
inline: 'start',
|
|
9317
|
+
});
|
|
9318
|
+
};
|
|
9319
|
+
const onChange = (message) => {
|
|
9320
|
+
setState((state) => {
|
|
9321
|
+
var _a;
|
|
9322
|
+
if (message && (message === null || message === void 0 ? void 0 : message.node_id) && (message === null || message === void 0 ? void 0 : message.node_id) == (state === null || state === void 0 ? void 0 : state.activeId)) {
|
|
9323
|
+
const nodeActiveIndex = state.nodes.findIndex(({ id }) => id == (state === null || state === void 0 ? void 0 : state.activeId));
|
|
9324
|
+
if (nodeActiveIndex !== -1) {
|
|
9325
|
+
const tmpNode = Object.assign(Object.assign({}, state.nodes[nodeActiveIndex]), { _message: Object.assign(Object.assign({}, (_a = state.nodes[nodeActiveIndex]) === null || _a === void 0 ? void 0 : _a._message), message) });
|
|
9326
|
+
state.nodes[nodeActiveIndex] = tmpNode;
|
|
9327
|
+
}
|
|
9328
|
+
}
|
|
9329
|
+
return Object.assign({}, state);
|
|
9330
|
+
});
|
|
9331
|
+
};
|
|
9332
|
+
const onSubmit = (nextNode, message) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
9333
|
+
/**
|
|
9334
|
+
* Skip the OTP Node if user's phone number is verified.
|
|
9335
|
+
*/
|
|
9336
|
+
// if (nextNode) {
|
|
9337
|
+
// const isNextNodeOTP = nextNode.type === NodeType.OTP
|
|
9338
|
+
// if (isNextNodeOTP && verifiedPhone) {
|
|
9339
|
+
// const actionOTPSubmit = nextNode.actions?.find(
|
|
9340
|
+
// (action) => action.type === NodeActionType.USER_SUBMIT_SEND,
|
|
9341
|
+
// )
|
|
9342
|
+
// const blockOTPMessage: SubotMessage = {
|
|
9343
|
+
// ...state.params,
|
|
9344
|
+
// node_id: nextNode.id,
|
|
9345
|
+
// action_id: actionOTPSubmit?.id,
|
|
9346
|
+
// action_value: actionOTPSubmit?.key,
|
|
9347
|
+
// }
|
|
9348
|
+
// const res = await subotInlineMessage(blockOTPMessage)
|
|
9349
|
+
// if (res?._status === 1) {
|
|
9350
|
+
// const { node: _node, ...restData } = res?._data
|
|
9351
|
+
// const nextNodeAfterOTP = {
|
|
9352
|
+
// ..._node,
|
|
9353
|
+
// _message: { ...restData, node_id: _node.id },
|
|
9354
|
+
// }
|
|
9355
|
+
// onSubmit && onSubmit(nextNodeAfterOTP, message)
|
|
9356
|
+
// return
|
|
9357
|
+
// }
|
|
9358
|
+
// pushNotifications({
|
|
9359
|
+
// title: '',
|
|
9360
|
+
// message: f({ id: 'notification.comment.somethingWrong' }),
|
|
9361
|
+
// type: 'danger',
|
|
9362
|
+
// })
|
|
9363
|
+
// return
|
|
9364
|
+
// }
|
|
9365
|
+
// }
|
|
9366
|
+
const _state = Object.assign(Object.assign({}, state), { nodes: [...state.nodes] });
|
|
9367
|
+
if (message && (message === null || message === void 0 ? void 0 : message.node_id)) {
|
|
9368
|
+
const updateNodeIndex = _state.nodes.findIndex(({ id }) => id == message.node_id);
|
|
9369
|
+
if (updateNodeIndex !== -1) {
|
|
9370
|
+
_state.nodes[updateNodeIndex]._message = Object.assign(Object.assign({}, _state.nodes[updateNodeIndex]._message), message);
|
|
9371
|
+
_state.nodes = [..._state.nodes.slice(0, updateNodeIndex + 1)];
|
|
9372
|
+
}
|
|
9373
|
+
}
|
|
9374
|
+
setLoading(true);
|
|
9375
|
+
if (nextNode) {
|
|
9376
|
+
const nextNodeFindIndex = _state.nodes.findIndex(({ id }) => id == (nextNode === null || nextNode === void 0 ? void 0 : nextNode.id));
|
|
9377
|
+
if (nextNodeFindIndex === -1) {
|
|
9378
|
+
_state.nodes = [..._state.nodes, Object.assign({}, nextNode)];
|
|
9379
|
+
}
|
|
9380
|
+
else {
|
|
9381
|
+
const tmpNode = Object.assign(Object.assign(Object.assign({}, _state.nodes[nextNodeFindIndex]), nextNode), { _message: Object.assign(Object.assign({}, _state.nodes[nextNodeFindIndex]._message), nextNode === null || nextNode === void 0 ? void 0 : nextNode._message) });
|
|
9382
|
+
_state.nodes = [
|
|
9383
|
+
..._state.nodes.slice(0, nextNodeFindIndex),
|
|
9384
|
+
Object.assign({}, tmpNode),
|
|
9385
|
+
..._state.nodes.slice(nextNodeFindIndex + 1),
|
|
9386
|
+
];
|
|
9387
|
+
}
|
|
9388
|
+
_state.activeId = nextNode.id;
|
|
9389
|
+
}
|
|
9390
|
+
setTimeout(() => {
|
|
9391
|
+
setState(_state);
|
|
9392
|
+
setLoading(false);
|
|
9393
|
+
_state.activeId &&
|
|
9394
|
+
saveSubotInlineLogs({
|
|
9395
|
+
nodes: _state.nodes,
|
|
9396
|
+
activeId: _state.activeId,
|
|
9397
|
+
params: _state.params,
|
|
9398
|
+
accountIdFromLogs: refAccountIdFromLogs.current,
|
|
9399
|
+
});
|
|
9400
|
+
}, 250);
|
|
9401
|
+
elementScrollIntoView();
|
|
9402
|
+
});
|
|
9403
|
+
const onPrev = () => {
|
|
9404
|
+
var _a;
|
|
9405
|
+
const _state = Object.assign({}, state);
|
|
9406
|
+
const nodeActiveIndex = (_a = _state === null || _state === void 0 ? void 0 : _state.nodes) === null || _a === void 0 ? void 0 : _a.findIndex(({ id }) => id == (_state === null || _state === void 0 ? void 0 : _state.activeId));
|
|
9407
|
+
if (nodeActiveIndex && nodeActiveIndex !== -1 && nodeActiveIndex > 1) {
|
|
9408
|
+
const prevNode = _state.nodes[nodeActiveIndex - 1];
|
|
9409
|
+
if (prevNode)
|
|
9410
|
+
_state.activeId = prevNode.id;
|
|
9411
|
+
}
|
|
9412
|
+
elementScrollIntoView();
|
|
9413
|
+
setState(Object.assign({}, _state));
|
|
9414
|
+
_state.activeId &&
|
|
9415
|
+
saveSubotInlineLogs({
|
|
9416
|
+
nodes: _state.nodes,
|
|
9417
|
+
activeId: _state.activeId,
|
|
9418
|
+
params: _state.params,
|
|
9419
|
+
accountIdFromLogs: refAccountIdFromLogs.current,
|
|
9420
|
+
});
|
|
9421
|
+
};
|
|
9422
|
+
const onNext = (message) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
9423
|
+
if (message && (message === null || message === void 0 ? void 0 : message.node_id)) {
|
|
9424
|
+
const newMessage = Object.assign(Object.assign({}, message), getCurrentTotalDynamicScore(state.nodes, state.activeId, message.action_id));
|
|
9425
|
+
const res = yield subotInlineMessage(newMessage);
|
|
9426
|
+
setLoading(false);
|
|
9427
|
+
if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
|
|
9428
|
+
const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
|
|
9429
|
+
const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
|
|
9430
|
+
const nextNodeFindIndex = state.nodes.findIndex(({ id }) => id === _nextNode.id);
|
|
9431
|
+
if (nextNodeFindIndex !== -1) {
|
|
9432
|
+
onSubmit(_nextNode);
|
|
9433
|
+
}
|
|
9434
|
+
else {
|
|
9435
|
+
onSubmit(_nextNode, message);
|
|
9436
|
+
}
|
|
9437
|
+
return;
|
|
9438
|
+
}
|
|
9439
|
+
}
|
|
9440
|
+
const nodeActive = state.nodes.find(({ id }) => id == (state === null || state === void 0 ? void 0 : state.activeId));
|
|
9441
|
+
if (nodeActive && !nodeActive.hasOwnProperty('type')) {
|
|
9442
|
+
setLoading(true);
|
|
9443
|
+
if (state.nodes[0].id == (state === null || state === void 0 ? void 0 : state.activeId)) {
|
|
9444
|
+
// elementScrollIntoView()
|
|
9445
|
+
setTimeout(() => {
|
|
9446
|
+
setState(Object.assign(Object.assign({}, state), { activeId: state.nodes[1].id.toString() }));
|
|
9447
|
+
setLoading(false);
|
|
9448
|
+
saveSubotInlineLogs({
|
|
9449
|
+
nodes: state.nodes,
|
|
9450
|
+
activeId: state.nodes[1].id.toString(),
|
|
9451
|
+
params: getParams(),
|
|
9452
|
+
accountIdFromLogs: refAccountIdFromLogs.current,
|
|
9453
|
+
});
|
|
9454
|
+
}, 250);
|
|
9455
|
+
}
|
|
9456
|
+
}
|
|
9457
|
+
});
|
|
9458
|
+
const onReset = () => {
|
|
9459
|
+
setLoading(true);
|
|
9460
|
+
setState((state) => {
|
|
9461
|
+
state.nodes = state.nodes.slice(0, 2);
|
|
9462
|
+
state.nodes[1] = Object.assign(Object.assign({}, state.nodes[1]), { _message: undefined });
|
|
9463
|
+
state.activeId = state.nodes[0].id.toString();
|
|
9464
|
+
return Object.assign({}, state);
|
|
9465
|
+
});
|
|
9466
|
+
setTimeout(() => {
|
|
9467
|
+
setLoading(false);
|
|
9468
|
+
}, 250);
|
|
9469
|
+
elementScrollIntoView();
|
|
9470
|
+
};
|
|
9471
|
+
const getFirstAPI = (params) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
|
|
9472
|
+
var _b;
|
|
9473
|
+
if ((params === null || params === void 0 ? void 0 : params.url) && (params === null || params === void 0 ? void 0 : params.bot_id)) {
|
|
9474
|
+
let activeId = '';
|
|
9475
|
+
let nodes = [];
|
|
9476
|
+
setLoading(true);
|
|
9477
|
+
const resFirst = yield subotInlineFirstNode(params.bot_id);
|
|
9478
|
+
if ((resFirst === null || resFirst === void 0 ? void 0 : resFirst._status) === 1) {
|
|
9479
|
+
activeId = resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.id.toString();
|
|
9480
|
+
nodes.push(resFirst === null || resFirst === void 0 ? void 0 : resFirst._data, resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.first_node);
|
|
9481
|
+
}
|
|
9482
|
+
const subotLogs = yield getSubotInlineLogs(nodes[0]);
|
|
9483
|
+
if (subotLogs) {
|
|
9484
|
+
const lastNode = subotLogs.nodes[subotLogs.nodes.length - 1];
|
|
9485
|
+
const isComplete = [
|
|
9486
|
+
index$2.NodeType.FINAL,
|
|
9487
|
+
index$2.NodeType.FINAL_THANK_YOU,
|
|
9488
|
+
index$2.NodeType.FINAL_STANDARD,
|
|
9489
|
+
].includes(lastNode.type);
|
|
9490
|
+
if (!isComplete) {
|
|
9491
|
+
nodes = subotLogs.nodes;
|
|
9492
|
+
activeId = subotLogs.activeId;
|
|
9493
|
+
refAccountIdFromLogs.current = ((_b = subotLogs.params) === null || _b === void 0 ? void 0 : _b.account_id) || 0;
|
|
9494
|
+
}
|
|
9495
|
+
}
|
|
9496
|
+
/** [Subot Inline] Show result page after redirect from SSO */
|
|
9497
|
+
const previousState = getPreviousStateFromStorage(params.bot_id, {
|
|
9498
|
+
getParams,
|
|
9499
|
+
});
|
|
9500
|
+
if (previousState &&
|
|
9501
|
+
previousState.params.action_id &&
|
|
9502
|
+
previousState.params.action_value) {
|
|
9503
|
+
const resResultInline = yield subotInlineMessage(previousState.params);
|
|
9504
|
+
if ((resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._status) === 1 && (resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node)) {
|
|
9505
|
+
activeId = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node.id;
|
|
9506
|
+
nodes = previousState.listNodes;
|
|
9507
|
+
nodes[nodes.length - 1] = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node;
|
|
9508
|
+
saveSubotInlineLogs({
|
|
9509
|
+
nodes,
|
|
9510
|
+
activeId: activeId,
|
|
9511
|
+
params: previousState.params,
|
|
9512
|
+
accountIdFromLogs: refAccountIdFromLogs.current,
|
|
9513
|
+
});
|
|
9514
|
+
setTimeout(() => {
|
|
9515
|
+
elementScrollIntoView();
|
|
9516
|
+
}, 100);
|
|
9517
|
+
}
|
|
9518
|
+
}
|
|
9519
|
+
const newParams = (previousState === null || previousState === void 0 ? void 0 : previousState.params) || (subotLogs === null || subotLogs === void 0 ? void 0 : subotLogs.params) || params;
|
|
9520
|
+
const _state = Object.assign(Object.assign({}, state), { params: newParams, activeId, nodes: nodes });
|
|
9521
|
+
setLoading(false);
|
|
9522
|
+
setState(_state);
|
|
9523
|
+
}
|
|
9524
|
+
});
|
|
9525
|
+
React.useEffect(() => {
|
|
9526
|
+
var _a;
|
|
9527
|
+
if (!!((_a = state === null || state === void 0 ? void 0 : state.nodes) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
9528
|
+
console.log('Subot Already Loaded');
|
|
9529
|
+
return () => undefined;
|
|
9530
|
+
}
|
|
9531
|
+
if (!Cookies__default["default"].get(index$3.GA_TOKEN_COOKIE)) {
|
|
9532
|
+
index$1.checkUntilFinished({
|
|
9533
|
+
condition: () => Boolean(Cookies__default["default"].get(index$3.GA_TOKEN_COOKIE)),
|
|
9534
|
+
finished: () => {
|
|
9535
|
+
const params = getParams();
|
|
9536
|
+
getFirstAPI(params);
|
|
9537
|
+
},
|
|
9538
|
+
});
|
|
9539
|
+
}
|
|
9540
|
+
else {
|
|
9541
|
+
const params = getParams();
|
|
9542
|
+
getFirstAPI(params);
|
|
9543
|
+
}
|
|
9544
|
+
}, []);
|
|
9545
|
+
if (state.nodes.length && !state.nodes[0].inline_active) {
|
|
9546
|
+
return null;
|
|
9547
|
+
}
|
|
9548
|
+
return (React__default["default"].createElement(SubotInlineContext.Provider, { value: Object.assign(Object.assign({}, state), { isMobile,
|
|
9549
|
+
getParams,
|
|
9550
|
+
onChange,
|
|
9551
|
+
onSubmit,
|
|
9552
|
+
onPrev,
|
|
9553
|
+
onNext,
|
|
9554
|
+
onReset,
|
|
9555
|
+
trackingCommonInline,
|
|
9556
|
+
userInfo }) },
|
|
9557
|
+
React__default["default"].createElement(SubotInlineLoadingContainer, { className: classNames__default["default"]('hhg-subot', `hhg-subot-${id}`, !!state.nodes.length && 'hhg-subot-style') }, !!state.nodes.length && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
9558
|
+
React__default["default"].createElement("div", { ref: flag, className: "hhg-flag", style: {
|
|
9559
|
+
position: 'absolute',
|
|
9560
|
+
top: -150,
|
|
9561
|
+
left: 0,
|
|
9562
|
+
pointerEvents: 'none',
|
|
9563
|
+
} }),
|
|
9564
|
+
React__default["default"].createElement(SubotInlineLoading, { isLoading: !!loading },
|
|
9565
|
+
React__default["default"].createElement(index$a.Loading, null),
|
|
9566
|
+
"Verifying..."),
|
|
9567
|
+
state.nodes.map((node, index) => {
|
|
9568
|
+
if (node.id.toString() === (state === null || state === void 0 ? void 0 : state.activeId)) {
|
|
9569
|
+
if (node.hasOwnProperty('type')) {
|
|
9570
|
+
let NodeComponent;
|
|
9571
|
+
switch (node === null || node === void 0 ? void 0 : node.position) {
|
|
9572
|
+
case index$2.NodePosition.SSO:
|
|
9573
|
+
NodeComponent =
|
|
9574
|
+
SubotInlineNodeBase[index$2.NodePosition[node === null || node === void 0 ? void 0 : node.position].valueOf()];
|
|
9575
|
+
break;
|
|
9576
|
+
default:
|
|
9577
|
+
NodeComponent =
|
|
9578
|
+
SubotInlineNodeBase[index$2.NodeType[node === null || node === void 0 ? void 0 : node.type].valueOf()];
|
|
9579
|
+
}
|
|
9580
|
+
if (node.is_multi_select &&
|
|
9581
|
+
node.type !== index$2.NodeType.POLL)
|
|
9582
|
+
NodeComponent = SubotInlineNodeBase['MULTIPLE'];
|
|
9583
|
+
return (NodeComponent && (React__default["default"].createElement(NodeComponent, { key: index.toString(), indexNumber: index, node: node })));
|
|
9584
|
+
}
|
|
9585
|
+
else {
|
|
9586
|
+
return (React__default["default"].createElement(SubotInlineNodeStart, { key: index.toString(), node: node, setLoading: setLoading }));
|
|
9587
|
+
}
|
|
9588
|
+
}
|
|
9589
|
+
return null;
|
|
9590
|
+
}))))));
|
|
9591
|
+
};
|
|
9592
|
+
|
|
6439
9593
|
// subot.sendOTP.button
|
|
6440
9594
|
// subot.resendOTP.button
|
|
6441
9595
|
// subot.verifyOTP.button
|
|
@@ -6475,6 +9629,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
6475
9629
|
Markdown: Markdown,
|
|
6476
9630
|
hexRgb: hexRgb,
|
|
6477
9631
|
SubotInlineVoucherLeftUI: SubotInlineVoucherLeftUI,
|
|
9632
|
+
SubotInline: SubotInline,
|
|
6478
9633
|
overrideParamsByQuery: index$1.overrideParamsByQuery,
|
|
6479
9634
|
ssoIntents: index$1.ssoIntents,
|
|
6480
9635
|
checkUntilFinished: index$1.checkUntilFinished,
|
|
@@ -6490,11 +9645,11 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
6490
9645
|
isFakeEmail: index$1.isFakeEmail,
|
|
6491
9646
|
formatUrlWithEncrypedGa: index$1.formatUrlWithEncrypedGa,
|
|
6492
9647
|
getSubotApiPath: getSubotApiPath,
|
|
6493
|
-
subotInlineMessage: subotInlineMessage,
|
|
6494
|
-
computeExtraSettingsForBot: computeExtraSettingsForBot,
|
|
6495
|
-
subotInlineFirstNode: subotInlineFirstNode,
|
|
6496
|
-
subotInlineClick: subotInlineClick,
|
|
6497
|
-
subotInlineImpression: subotInlineImpression,
|
|
9648
|
+
subotInlineMessage: subotInlineMessage$1,
|
|
9649
|
+
computeExtraSettingsForBot: computeExtraSettingsForBot$1,
|
|
9650
|
+
subotInlineFirstNode: subotInlineFirstNode$1,
|
|
9651
|
+
subotInlineClick: subotInlineClick$1,
|
|
9652
|
+
subotInlineImpression: subotInlineImpression$1,
|
|
6498
9653
|
PATHS: PATHS$1,
|
|
6499
9654
|
getPreviousStateFromStorage: getPreviousStateFromStorage,
|
|
6500
9655
|
getSubotInlineLogs: getSubotInlineLogs,
|
|
@@ -6505,7 +9660,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
6505
9660
|
detectToSkipNodeStart: detectToSkipNodeStart,
|
|
6506
9661
|
KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD: KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD,
|
|
6507
9662
|
SubotInlineIntentBaseTarget: SubotInlineIntentBaseTarget,
|
|
6508
|
-
SubotInlineIntentBase: SubotInlineIntentBase,
|
|
9663
|
+
SubotInlineIntentBase: SubotInlineIntentBase$1,
|
|
6509
9664
|
checkSyncDataOnFrisoCampaign: checkSyncDataOnFrisoCampaign,
|
|
6510
9665
|
handleFrisoRedirecition: handleFrisoRedirecition,
|
|
6511
9666
|
getDynamicScore: getDynamicScore,
|
|
@@ -6530,13 +9685,14 @@ exports.ssoIntents = index$1.ssoIntents;
|
|
|
6530
9685
|
exports.KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD = KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD;
|
|
6531
9686
|
exports.Markdown = Markdown;
|
|
6532
9687
|
exports.PATHS = PATHS$1;
|
|
6533
|
-
exports.
|
|
9688
|
+
exports.SubotInline = SubotInline;
|
|
9689
|
+
exports.SubotInlineIntentBase = SubotInlineIntentBase$1;
|
|
6534
9690
|
exports.SubotInlineIntentBaseTarget = SubotInlineIntentBaseTarget;
|
|
6535
9691
|
exports.SubotInlineRevampWithTheme = SubotInlineRevampWithTheme;
|
|
6536
9692
|
exports.SubotInlineVoucherLeftUI = SubotInlineVoucherLeftUI;
|
|
6537
9693
|
exports.UserInfoForm = UserInfoForm;
|
|
6538
9694
|
exports.checkSyncDataOnFrisoCampaign = checkSyncDataOnFrisoCampaign;
|
|
6539
|
-
exports.computeExtraSettingsForBot = computeExtraSettingsForBot;
|
|
9695
|
+
exports.computeExtraSettingsForBot = computeExtraSettingsForBot$1;
|
|
6540
9696
|
exports["default"] = ContainerWithProvider;
|
|
6541
9697
|
exports.detectToSkipNodeStart = detectToSkipNodeStart;
|
|
6542
9698
|
exports.extractUnifiedAnswers = extractUnifiedAnswers;
|
|
@@ -6551,7 +9707,7 @@ exports.handleFrisoRedirecition = handleFrisoRedirecition;
|
|
|
6551
9707
|
exports.hexRgb = hexRgb;
|
|
6552
9708
|
exports.replaceTextWithVariables = replaceTextWithVariables;
|
|
6553
9709
|
exports.saveSubotInlineLogs = saveSubotInlineLogs;
|
|
6554
|
-
exports.subotInlineClick = subotInlineClick;
|
|
6555
|
-
exports.subotInlineFirstNode = subotInlineFirstNode;
|
|
6556
|
-
exports.subotInlineImpression = subotInlineImpression;
|
|
6557
|
-
exports.subotInlineMessage = subotInlineMessage;
|
|
9710
|
+
exports.subotInlineClick = subotInlineClick$1;
|
|
9711
|
+
exports.subotInlineFirstNode = subotInlineFirstNode$1;
|
|
9712
|
+
exports.subotInlineImpression = subotInlineImpression$1;
|
|
9713
|
+
exports.subotInlineMessage = subotInlineMessage$1;
|