@botonic/plugin-flow-builder 0.57.0-rslib-esm.0 → 0.57.0-rslib-esm.2
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/README.md +1 -1
- package/lib/action/ai-agent-from-user-input.js.map +1 -0
- package/lib/action/context.js.map +1 -0
- package/lib/action/fallback.js.map +1 -0
- package/lib/action/first-interaction.js.map +1 -0
- package/lib/action/get-contents.js.map +1 -0
- package/lib/action/index.js.map +1 -0
- package/lib/action/payload.js.map +1 -0
- package/lib/api.js.map +1 -0
- package/lib/constants.js.map +1 -0
- package/lib/content-fields/content-fields-base.js.map +1 -0
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/custom-conditional/flow-custom-condition-v2.d.ts +1 -1
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-ai-agent-base.js +6 -0
- package/lib/content-fields/flow-ai-agent-base.js.map +1 -0
- package/lib/content-fields/flow-ai-agent-router.js.map +1 -0
- package/lib/content-fields/flow-ai-agent.js.map +1 -0
- package/lib/content-fields/flow-bot-action.js.map +1 -0
- package/lib/content-fields/flow-button.js.map +1 -0
- package/lib/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/content-fields/flow-carousel.js.map +1 -0
- package/lib/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/content-fields/flow-country-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-custom-conditional.d.ts +1 -1
- package/lib/content-fields/flow-custom-conditional.js.map +1 -0
- package/lib/content-fields/flow-element.js.map +1 -0
- package/lib/content-fields/flow-go-to-flow.js.map +1 -0
- package/lib/content-fields/flow-handoff.js.map +1 -0
- package/lib/content-fields/flow-image.js.map +1 -0
- package/lib/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/lib/content-fields/flow-rating.js.map +1 -0
- package/lib/content-fields/flow-text.js.map +1 -0
- package/lib/content-fields/flow-video.js.map +1 -0
- package/lib/content-fields/flow-webview.js.map +1 -0
- package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-request-contact-info.d.ts +2 -1
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-request-contact-info.js +10 -0
- package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
- package/lib/content-fields/flow-whatsapp-template.js.map +1 -0
- package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
- package/lib/content-fields/hubtype-fields/ai-agent.js.map +1 -0
- package/lib/content-fields/hubtype-fields/bot-action.js.map +1 -0
- package/lib/content-fields/hubtype-fields/button.js.map +1 -0
- package/lib/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/lib/content-fields/hubtype-fields/carousel.js.map +1 -0
- package/lib/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/lib/content-fields/hubtype-fields/common.js.map +1 -0
- package/lib/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/lib/content-fields/hubtype-fields/function.js.map +1 -0
- package/lib/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/lib/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/lib/content-fields/hubtype-fields/image.js.map +1 -0
- package/lib/content-fields/hubtype-fields/index.js.map +1 -0
- package/lib/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/lib/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/lib/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/lib/content-fields/hubtype-fields/payload.js.map +1 -0
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/content-fields/hubtype-fields/rating.js.map +1 -0
- package/lib/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/lib/content-fields/hubtype-fields/text.js.map +1 -0
- package/lib/content-fields/hubtype-fields/url.js.map +1 -0
- package/lib/content-fields/hubtype-fields/video.js.map +1 -0
- package/lib/content-fields/hubtype-fields/webview.js.map +1 -0
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
- package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/index.d.ts +1 -1
- package/lib/content-fields/index.js.map +1 -0
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/lib/content-fields/whatsapp-button-list/index.js.map +1 -0
- package/lib/filters/index.js.map +1 -0
- package/lib/flow-factory.js.map +1 -0
- package/lib/functions/index.js.map +1 -0
- package/lib/index.js.map +1 -0
- package/lib/services/hubtype-queues-api.js.map +1 -0
- package/lib/structured-output/flow-builder-content.js.map +1 -0
- package/lib/tracking.js.map +1 -0
- package/lib/types.js.map +1 -0
- package/lib/user-input/capture-user-input-api.js.map +1 -0
- package/lib/user-input/index.js.map +1 -0
- package/lib/user-input/keyword.js.map +1 -0
- package/lib/user-input/smart-intent.js.map +1 -0
- package/lib/utils/ai-agent.js.map +1 -0
- package/lib/utils/authentication.js.map +1 -0
- package/lib/utils/flow-locale.js.map +1 -0
- package/lib/utils/get-flow-builder-plugin.js.map +1 -0
- package/lib/{esm/utils → utils}/hubtype-assistant-content.d.ts +1 -0
- package/lib/{esm/utils → utils}/hubtype-assistant-content.js +13 -0
- package/lib/utils/hubtype-assistant-content.js.map +1 -0
- package/lib/utils/input.js.map +1 -0
- package/lib/webview/contents-context.js.map +1 -0
- package/lib/webview/index.js.map +1 -0
- package/lib/webview/types.js.map +1 -0
- package/lib/webview/use-webview-contents.js.map +1 -0
- package/package.json +9 -8
- package/src/content-fields/flow-ai-agent-base.tsx +11 -0
- package/src/content-fields/flow-whatsapp-request-contact-info.tsx +17 -1
- package/src/content-fields/index.ts +2 -2
- package/src/utils/hubtype-assistant-content.ts +14 -0
- package/lib/esm/action/ai-agent-from-user-input.js.map +0 -1
- package/lib/esm/action/context.js.map +0 -1
- package/lib/esm/action/fallback.js.map +0 -1
- package/lib/esm/action/first-interaction.js.map +0 -1
- package/lib/esm/action/get-contents.js.map +0 -1
- package/lib/esm/action/index.js.map +0 -1
- package/lib/esm/action/payload.js.map +0 -1
- package/lib/esm/api.js.map +0 -1
- package/lib/esm/constants.js.map +0 -1
- package/lib/esm/content-fields/content-fields-base.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent-base.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent-router.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/esm/content-fields/flow-bot-action.js.map +0 -1
- package/lib/esm/content-fields/flow-button.js.map +0 -1
- package/lib/esm/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/esm/content-fields/flow-carousel.js.map +0 -1
- package/lib/esm/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-element.js.map +0 -1
- package/lib/esm/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/esm/content-fields/flow-handoff.js.map +0 -1
- package/lib/esm/content-fields/flow-image.js.map +0 -1
- package/lib/esm/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-rating.js.map +0 -1
- package/lib/esm/content-fields/flow-text.js.map +0 -1
- package/lib/esm/content-fields/flow-video.js.map +0 -1
- package/lib/esm/content-fields/flow-webview.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-template.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/button.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/carousel.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/common.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/fallback.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/function.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/handoff.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/keyword.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/payload.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/rating.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/text.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/video.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/webview.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/esm/content-fields/index.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/index.js.map +0 -1
- package/lib/esm/filters/index.js.map +0 -1
- package/lib/esm/flow-factory.js.map +0 -1
- package/lib/esm/functions/index.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/package.json +0 -3
- package/lib/esm/services/hubtype-queues-api.js.map +0 -1
- package/lib/esm/structured-output/flow-builder-content.js.map +0 -1
- package/lib/esm/tracking.js.map +0 -1
- package/lib/esm/types.js.map +0 -1
- package/lib/esm/user-input/capture-user-input-api.js.map +0 -1
- package/lib/esm/user-input/index.js.map +0 -1
- package/lib/esm/user-input/keyword.js.map +0 -1
- package/lib/esm/user-input/smart-intent.js.map +0 -1
- package/lib/esm/utils/ai-agent.js.map +0 -1
- package/lib/esm/utils/authentication.js.map +0 -1
- package/lib/esm/utils/flow-locale.js.map +0 -1
- package/lib/esm/utils/get-flow-builder-plugin.js.map +0 -1
- package/lib/esm/utils/hubtype-assistant-content.js.map +0 -1
- package/lib/esm/utils/input.js.map +0 -1
- package/lib/esm/webview/contents-context.js.map +0 -1
- package/lib/esm/webview/index.js.map +0 -1
- package/lib/esm/webview/types.js.map +0 -1
- package/lib/esm/webview/use-webview-contents.js.map +0 -1
- /package/lib/{esm/action → action}/ai-agent-from-user-input.d.ts +0 -0
- /package/lib/{esm/action → action}/ai-agent-from-user-input.js +0 -0
- /package/lib/{esm/action → action}/context.d.ts +0 -0
- /package/lib/{esm/action → action}/context.js +0 -0
- /package/lib/{esm/action → action}/fallback.d.ts +0 -0
- /package/lib/{esm/action → action}/fallback.js +0 -0
- /package/lib/{esm/action → action}/first-interaction.d.ts +0 -0
- /package/lib/{esm/action → action}/first-interaction.js +0 -0
- /package/lib/{esm/action → action}/get-contents.d.ts +0 -0
- /package/lib/{esm/action → action}/get-contents.js +0 -0
- /package/lib/{esm/action → action}/index.d.ts +0 -0
- /package/lib/{esm/action → action}/index.js +0 -0
- /package/lib/{esm/action → action}/payload.d.ts +0 -0
- /package/lib/{esm/action → action}/payload.js +0 -0
- /package/lib/{esm/api.d.ts → api.d.ts} +0 -0
- /package/lib/{esm/api.js → api.js} +0 -0
- /package/lib/{esm/constants.d.ts → constants.d.ts} +0 -0
- /package/lib/{esm/constants.js → constants.js} +0 -0
- /package/lib/{esm/content-fields → content-fields}/content-fields-base.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/content-fields-base.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-evaluators.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-resolver.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/custom-conditional/flow-custom-condition-v2.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-ai-agent-base.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-ai-agent-router.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-ai-agent-router.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-ai-agent.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-ai-agent.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-bot-action.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-bot-action.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-button.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-button.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-capture-user-input.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-capture-user-input.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-carousel.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-carousel.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-channel-conditional.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-channel-conditional.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-country-conditional.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-country-conditional.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-custom-conditional.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-element.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-element.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-go-to-flow.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-go-to-flow.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-handoff.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-handoff.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-image.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-image.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-queue-status-conditional.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-queue-status-conditional.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-rating.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-rating.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-text.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-text.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-video.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-video.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-webview.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-webview.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-whatsapp-cta-url-button.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-whatsapp-cta-url-button.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-whatsapp-template.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/flow-whatsapp-template.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/ai-agent-router.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/ai-agent-router.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/ai-agent.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/ai-agent.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/bot-action.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/bot-action.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/button.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/button.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/capture-user-input.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/capture-user-input.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/carousel.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/carousel.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/channel-conditional.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/channel-conditional.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/common.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/common.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/country-conditional.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/country-conditional.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional-v2.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional-v2.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/fallback.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/fallback.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/function.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/function.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/go-to-flow.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/go-to-flow.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/handoff.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/handoff.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/image.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/image.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/index.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/index.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/keyword.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/keyword.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/node-types.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/node-types.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/nodes.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/nodes.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/payload.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/payload.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/queue-status-conditional.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/queue-status-conditional.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/rating.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/rating.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/smart-intent.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/smart-intent.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/text.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/text.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/url.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/url.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/video.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/video.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/webview.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/webview.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-button-list.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-button-list.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-cta-url-button.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-request-contact-info.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-template.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-template.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/index.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list.js +0 -0
- /package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/index.d.ts +0 -0
- /package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/index.js +0 -0
- /package/lib/{esm/filters → filters}/index.d.ts +0 -0
- /package/lib/{esm/filters → filters}/index.js +0 -0
- /package/lib/{esm/flow-factory.d.ts → flow-factory.d.ts} +0 -0
- /package/lib/{esm/flow-factory.js → flow-factory.js} +0 -0
- /package/lib/{esm/functions → functions}/index.d.ts +0 -0
- /package/lib/{esm/functions → functions}/index.js +0 -0
- /package/lib/{esm/index.d.ts → index.d.ts} +0 -0
- /package/lib/{esm/index.js → index.js} +0 -0
- /package/lib/{esm/services → services}/hubtype-queues-api.d.ts +0 -0
- /package/lib/{esm/services → services}/hubtype-queues-api.js +0 -0
- /package/lib/{esm/structured-output → structured-output}/flow-builder-content.d.ts +0 -0
- /package/lib/{esm/structured-output → structured-output}/flow-builder-content.js +0 -0
- /package/lib/{esm/tracking.d.ts → tracking.d.ts} +0 -0
- /package/lib/{esm/tracking.js → tracking.js} +0 -0
- /package/lib/{esm/types.d.ts → types.d.ts} +0 -0
- /package/lib/{esm/types.js → types.js} +0 -0
- /package/lib/{esm/user-input → user-input}/capture-user-input-api.d.ts +0 -0
- /package/lib/{esm/user-input → user-input}/capture-user-input-api.js +0 -0
- /package/lib/{esm/user-input → user-input}/index.d.ts +0 -0
- /package/lib/{esm/user-input → user-input}/index.js +0 -0
- /package/lib/{esm/user-input → user-input}/keyword.d.ts +0 -0
- /package/lib/{esm/user-input → user-input}/keyword.js +0 -0
- /package/lib/{esm/user-input → user-input}/smart-intent.d.ts +0 -0
- /package/lib/{esm/user-input → user-input}/smart-intent.js +0 -0
- /package/lib/{esm/utils → utils}/ai-agent.d.ts +0 -0
- /package/lib/{esm/utils → utils}/ai-agent.js +0 -0
- /package/lib/{esm/utils → utils}/authentication.d.ts +0 -0
- /package/lib/{esm/utils → utils}/authentication.js +0 -0
- /package/lib/{esm/utils → utils}/flow-locale.d.ts +0 -0
- /package/lib/{esm/utils → utils}/flow-locale.js +0 -0
- /package/lib/{esm/utils → utils}/get-flow-builder-plugin.d.ts +0 -0
- /package/lib/{esm/utils → utils}/get-flow-builder-plugin.js +0 -0
- /package/lib/{esm/utils → utils}/input.d.ts +0 -0
- /package/lib/{esm/utils → utils}/input.js +0 -0
- /package/lib/{esm/webview → webview}/contents-context.d.ts +0 -0
- /package/lib/{esm/webview → webview}/contents-context.js +0 -0
- /package/lib/{esm/webview → webview}/index.d.ts +0 -0
- /package/lib/{esm/webview → webview}/index.js +0 -0
- /package/lib/{esm/webview → webview}/types.d.ts +0 -0
- /package/lib/{esm/webview → webview}/types.js +0 -0
- /package/lib/{esm/webview → webview}/use-webview-contents.d.ts +0 -0
- /package/lib/{esm/webview → webview}/use-webview-contents.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-button.js","sources":["../../../src/content-fields/flow-button.tsx"],"sourcesContent":["import type { BotContext } from '@botonic/core'\nimport { Button, Reply, type Webview } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { SOURCE_INFO_SEPARATOR } from '../constants'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowWebview } from './flow-webview'\nimport {\n type HtButton,\n HtButtonStyle,\n HtNodeWithContentType,\n type HtUrlNode,\n} from './hubtype-fields'\nimport type { HtRatingButton } from './hubtype-fields/rating'\n\nexport class FlowButton extends ContentFieldsBase {\n public text = ''\n public url?: string\n public payload?: string\n public target?: string\n public webview?: Webview\n public flowWebview?: FlowWebview // Used for tracking\n public params?: Record<string, string>\n\n static fromHubtypeCMS(\n cmsButton: HtButton,\n locale: string,\n cmsApi: FlowBuilderApi,\n botContext: BotContext\n ): FlowButton {\n const urlId = FlowButton.getUrlId(cmsButton, locale)\n\n const newButton = new FlowButton(cmsButton.id)\n newButton.text = FlowButton.getTextByLocale(locale, cmsButton.text)\n if (cmsButton.target) {\n const webview = FlowButton.getTargetWebview(cmsApi, cmsButton.target.id)\n if (webview) {\n newButton.flowWebview = webview\n newButton.webview = { name: webview.webviewComponentName }\n newButton.params = webview.getParams(botContext)\n } else {\n newButton.payload = cmsApi.getPayload(cmsButton.target)\n }\n }\n\n if (cmsButton.url && urlId) {\n const urlNode = cmsApi.getNodeById<HtUrlNode>(urlId)\n newButton.url = urlNode.content.url\n }\n\n return newButton\n }\n\n static fromAIAgent(button: {\n id: string\n text: string\n payload?: string\n url?: string\n target?: string\n }): FlowButton {\n const newButton = new FlowButton(button.id)\n newButton.text = button.text\n if (button.url) {\n newButton.url = button.url\n newButton.target = button.target\n } else {\n newButton.payload = button.payload\n }\n return newButton\n }\n\n static fromRating(button: HtRatingButton): FlowButton {\n const newButton = new FlowButton(button.id)\n newButton.text = button.text\n newButton.payload = button.payload\n newButton.target = button.target?.id\n return newButton\n }\n\n static getUrlId(cmsButton: HtButton, locale: string): string | undefined {\n return cmsButton.url.find(url => url.locale === locale)?.id\n }\n\n static getTargetWebview(\n cmsApi: FlowBuilderApi,\n targetId: string\n ): FlowWebview | undefined {\n const targetNode = cmsApi.getNodeById(targetId)\n if (targetNode.type !== HtNodeWithContentType.WEBVIEW) {\n return undefined\n }\n return FlowWebview.fromHubtypeCMS(targetNode)\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n if (this.flowWebview) {\n await this.flowWebview.trackFlow(botContext)\n }\n }\n\n async processContent(): Promise<void> {\n return\n }\n\n renderButton(buttonIndex: number, buttonStyle?: HtButtonStyle): JSX.Element {\n if (buttonStyle === HtButtonStyle.QUICK_REPLY) {\n return (\n <Reply key={this.id} payload={this.getButtonPayload(buttonIndex)}>\n {this.text}\n </Reply>\n )\n }\n\n return (\n <Button\n key={this.id}\n url={this.url}\n payload={this.getButtonPayload(buttonIndex)}\n target={this.target}\n webview={this.webview}\n params={this.params}\n >\n {this.text}\n </Button>\n )\n }\n\n private getButtonPayload(buttonIndex: number): string | undefined {\n return this.payload\n ? `${this.payload}${SOURCE_INFO_SEPARATOR}${buttonIndex}`\n : undefined\n }\n}\n"],"names":["Button","Reply","SOURCE_INFO_SEPARATOR","ContentFieldsBase","FlowWebview","HtButtonStyle","HtNodeWithContentType","FlowButton","cmsButton","locale","cmsApi","botContext","urlId","newButton","webview","urlNode","button","url","targetId","targetNode","undefined","buttonIndex","buttonStyle"],"mappings":";;;;;;;;;;;;;;AAC4D;AAGR;AACK;AACb;AAMnB;AAGlB,MAAMO,UAAUA,SAASJ,iBAAiBA;IAS/C,OAAO,eACLK,SAAmB,EACnBC,MAAc,EACdC,MAAsB,EACtBC,UAAsB,EACV;QACZ,MAAMC,QAAQL,UAAUA,CAAC,QAAQ,CAACC,WAAWC;QAE7C,MAAMI,YAAY,IAAIN,UAAUA,CAACC,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KAAKR,SAAS;IAC3D;IAEA,OAAO,iBACLC,MAAsB,EACtBQ,QAAgB,EACS;QACzB,MAAMC,aAAaT,OAAO,WAAW,CAACQ;QACtC,IAAIC,WAAW,IAAI,KAAKb,6BAA6B,EAAE;YACrD,OAAOc;QACT;QACA,OAAOhB,0BAA0B,CAACe;IACpC;IAEA,MAAM,UAAUR,UAAsB,EAAiB;QACrD,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAACA;QACnC;IACF;IAEA,MAAM,iBAAgC;QACpC;IACF;IAEA,aAAaU,WAAmB,EAAEC,WAA2B,EAAe;QAC1E,IAAIA,gBAAgBjB,yBAAyB,EAAE;YAC7C,qBACE,IAACJ,KAAKA;gBAAe,SAAS,IAAI,CAAC,gBAAgB,CAACoB;0BACjD,IAAI,CAAC,IAAI;eADA,IAAI,CAAC,EAAE;QAIvB;QAEA,qBACE,IAACrB,MAAMA;YAEL,KAAK,IAAI,CAAC,GAAG;YACb,SAAS,IAAI,CAAC,gBAAgB,CAACqB;YAC/B,QAAQ,IAAI,CAAC,MAAM;YACnB,SAAS,IAAI,CAAC,OAAO;YACrB,QAAQ,IAAI,CAAC,MAAM;sBAElB,IAAI,CAAC,IAAI;WAPL,IAAI,CAAC,EAAE;IAUlB;IAEQ,iBAAiBA,WAAmB,EAAsB;QAChE,OAAO,IAAI,CAAC,OAAO,GACf,GAAG,IAAI,CAAC,OAAO,GAAGnB,qBAAqBA,GAAGmB,aAAa,GACvDD;IACN;;QApHK,qBACE,OAAO;;AAoHhB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-capture-user-input.js","sources":["../../../src/content-fields/flow-capture-user-input.tsx"],"sourcesContent":["import type { BotContext } from '@botonic/core'\n\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { ContentFieldsBase } from './content-fields-base'\nimport {\n HtAiValidationType,\n type HtCaptureUserInputNode,\n} from './hubtype-fields/capture-user-input'\n\nexport class FlowCaptureUserInput extends ContentFieldsBase {\n public fieldName = ''\n public aiValidationType = HtAiValidationType.NONE\n public aiValidationInstructions = ''\n public captureSuccessId = ''\n public captureFailId = ''\n\n static fromHubtypeCMS(cmsText: HtCaptureUserInputNode): FlowCaptureUserInput {\n const newCaptureUserInput = new FlowCaptureUserInput(cmsText.id)\n newCaptureUserInput.code = cmsText.code\n newCaptureUserInput.fieldName = cmsText.content.field_name\n newCaptureUserInput.aiValidationType =\n cmsText.content.ai_validation_type || HtAiValidationType.NONE\n newCaptureUserInput.aiValidationInstructions =\n cmsText.content.ai_validation_instructions || ''\n newCaptureUserInput.captureSuccessId = cmsText.content.capture_success.id\n newCaptureUserInput.captureFailId = cmsText.content.capture_fail.id\n newCaptureUserInput.followUp = undefined\n\n return newCaptureUserInput\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async trackFlow(_botContext: BotContext): Promise<void> {\n return\n }\n\n async processContent(): Promise<void> {\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n cmsApi.setCaptureUserInputId(this.id)\n\n return <></>\n }\n}\n"],"names":["getFlowBuilderPlugin","ContentFieldsBase","HtAiValidationType","FlowCaptureUserInput","cmsText","newCaptureUserInput","undefined","_botContext","botContext","flowBuilderPlugin","cmsApi"],"mappings":";;;;;;;;;;AAEuE;AACd;AAIb;AAErC,MAAMG,oBAAoBA,SAASF,iBAAiBA;IAOzD,OAAO,eAAeG,OAA+B,EAAwB;QAC3E,MAAMC,sBAAsB,IAAIF,oBAAoBA,CAACC,QAAQ,EAAE;QAC/DC,oBAAoB,IAAI,GAAGD,QAAQ,IAAI;QACvCC,oBAAoB,SAAS,GAAGD,QAAQ,OAAO,CAAC,UAAU;QAC1DC,oBAAoB,gBAAgB,GAClCD,QAAQ,OAAO,CAAC,kBAAkB,IAAIF,uBAAuB;QAC/DG,oBAAoB,wBAAwB,GAC1CD,QAAQ,OAAO,CAAC,0BAA0B,IAAI;QAChDC,oBAAoB,gBAAgB,GAAGD,QAAQ,OAAO,CAAC,eAAe,CAAC,EAAE;QACzEC,oBAAoB,aAAa,GAAGD,QAAQ,OAAO,CAAC,YAAY,CAAC,EAAE;QACnEC,oBAAoB,QAAQ,GAAGC;QAE/B,OAAOD;IACT;IAEA,6DAA6D;IAC7D,MAAM,UAAUE,WAAuB,EAAiB;QACtD;IACF;IAEA,MAAM,iBAAgC;QACpC;IACF;IAEA,UAAUC,UAAsB,EAAe;QAC7C,MAAMC,oBAAoBT,oBAAoBA,CAACQ,WAAW,OAAO;QACjE,MAAME,SAASD,kBAAkB,MAAM;QACvCC,OAAO,qBAAqB,CAAC,IAAI,CAAC,EAAE;QAEpC,qBAAO;IACT;;QArCK,qBACE,YAAY,SACZ,mBAAmBR,uBAAuB,OAC1C,2BAA2B,SAC3B,mBAAmB,SACnB,gBAAgB;;AAiCzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-carousel.js","sources":["../../../src/content-fields/flow-carousel.tsx"],"sourcesContent":["import {\n type BotContext,\n type CarouselMessage,\n isWhatsapp,\n OutputMessageType,\n} from '@botonic/core'\nimport {\n type ActionRequest,\n Button,\n CardType,\n Carousel,\n Text,\n WhatsappCTAUrlButton,\n WhatsappCTAUrlHeaderType,\n type WhatsappInteractiveMediaCard,\n WhatsappInteractiveMediaCarousel,\n} from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { trackOneContent } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowElement } from './flow-element'\nimport type { HtCarouselNode } from './hubtype-fields'\n\nconst DEFAULT_TEXT_MESSAGE = 'These are the options'\nexport class FlowCarousel extends ContentFieldsBase {\n public whatsappText: string = ''\n public elements: FlowElement[] = []\n\n static fromHubtypeCMS(\n component: HtCarouselNode,\n locale: string,\n cmsApi: FlowBuilderApi,\n botContext: BotContext\n ): FlowCarousel {\n const newCarousel = new FlowCarousel(component.id)\n newCarousel.code = component.code\n newCarousel.elements = component.content.elements.map(element =>\n FlowElement.fromHubtypeCMS(element, locale, cmsApi, botContext)\n )\n newCarousel.whatsappText = FlowCarousel.getTextByLocale(\n locale,\n component.content.whatsapp_text\n )\n newCarousel.followUp = component.follow_up\n\n return newCarousel\n }\n\n async trackFlow(request: ActionRequest): Promise<void> {\n await trackOneContent(request, this)\n for (const element of this.elements) {\n await element.trackFlow(request)\n }\n }\n\n static areElementsValidForWhatsapp = (carouselMessage: CarouselMessage) => {\n const isValid =\n carouselMessage.content.elements.every(element => element.button.url) ||\n carouselMessage.content.elements.every(element => element.button.payload)\n\n if (!isValid) {\n console.warn(\n 'Cannot use WhatsappInteractiveMediaCarousel for Whatsapp created by AIAgent, all elements must have either url or payload.',\n carouselMessage.content\n )\n }\n return isValid\n }\n\n static generateWhatsappElementText(element: {\n title: string\n subtitle?: string\n }): string {\n if (element.subtitle) {\n return `*${element.title}*\\n${element.subtitle}`\n }\n return element.title\n }\n\n private static createCardsFromElements(\n elements: FlowElement[]\n ): WhatsappInteractiveMediaCard[] {\n return elements.map(element => {\n const text = FlowCarousel.generateWhatsappElementText(element)\n\n if (element.button?.url) {\n return {\n imageLink: element.image,\n text,\n type: CardType.CTA_URL as const,\n action: {\n buttonText: element.button.text,\n buttonUrl: element.button.url,\n },\n }\n }\n if (element.button?.payload) {\n return {\n imageLink: element.image,\n text,\n type: CardType.QUICK_REPLY as const,\n action: {\n buttons: [\n {\n text: element.button.text,\n payload: element.button.payload,\n },\n ],\n },\n }\n }\n throw new Error('Element must have a url or a payload')\n })\n }\n\n static fromAIAgent(\n id: string,\n carouselMessage: CarouselMessage,\n botContext: ActionRequest\n ): JSX.Element {\n if (\n isWhatsapp(botContext.session) &&\n FlowCarousel.areElementsValidForWhatsapp(carouselMessage)\n ) {\n if (\n carouselMessage.content.elements.length === 1 &&\n carouselMessage.content.elements[0].button?.url\n ) {\n const element = carouselMessage.content.elements[0]\n const buttonText = element.button.text\n const url = carouselMessage.content.elements[0].button.url\n // TODO: Add a new fromAIAgent method in FlowWhatsappCtaUrlButtonNode to create a WhatsappCTAUrlButton from an AIAgent message\n return (\n <WhatsappCTAUrlButton\n key={id}\n body={element.title}\n headerType={WhatsappCTAUrlHeaderType.Image}\n headerImage={element.image}\n footer={element.subtitle}\n displayText={buttonText}\n url={url}\n />\n )\n }\n\n if (\n carouselMessage.content.elements.length === 1 &&\n carouselMessage.content.elements[0].button?.payload\n ) {\n const element = carouselMessage.content.elements[0]\n const text = FlowCarousel.generateWhatsappElementText(element)\n const buttonPayload = carouselMessage.content.elements[0].button.payload\n const buttonText = carouselMessage.content.elements[0].button.text\n\n return (\n <Text>\n {text}\n <Button payload={buttonPayload}>{buttonText}</Button>\n </Text>\n )\n }\n\n const elements = carouselMessage.content.elements.map((element, index) =>\n FlowElement.fromAIAgent(`${id}-element-${index}`, element)\n )\n return (\n <WhatsappInteractiveMediaCarousel\n cards={FlowCarousel.createCardsFromElements(elements)}\n textMessage={carouselMessage.content.text || DEFAULT_TEXT_MESSAGE}\n />\n )\n }\n return (\n <Carousel key={id}>\n {carouselMessage.content.elements.map((element, index) =>\n FlowElement.fromAIAgent(\n `${id}-element-${index}`,\n element\n ).renderElement(id)\n )}\n </Carousel>\n )\n }\n\n private toCarouselMessage(elements: FlowElement[]): CarouselMessage {\n return {\n type: OutputMessageType.Carousel,\n content: {\n elements: elements.map(element => {\n return {\n button: {\n text: element.button?.text || '',\n payload: element.button?.payload,\n url: element.button?.url,\n },\n title: element.title,\n subtitle: element.subtitle,\n image: element.image,\n }\n }),\n },\n }\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const carouselMessage = this.toCarouselMessage(this.elements)\n if (\n isWhatsapp(botContext.session) &&\n FlowCarousel.areElementsValidForWhatsapp(carouselMessage)\n ) {\n if (this.elements.length === 1 && this.elements[0].button?.url) {\n const element = this.elements[0]\n const buttonText = this.elements[0].button.text\n const url = this.elements[0].button.url\n\n return (\n <WhatsappCTAUrlButton\n key={this.id}\n body={element.title}\n headerType={WhatsappCTAUrlHeaderType.Image}\n headerImage={element.image}\n displayText={buttonText}\n url={url}\n />\n )\n }\n\n if (\n this.elements.length === 1 &&\n this.elements[0].button &&\n this.elements[0].button?.payload\n ) {\n const element = this.elements[0]\n const text = FlowCarousel.generateWhatsappElementText(element)\n const buttonPayload = this.elements[0].button.payload\n const buttonText = this.elements[0].button.text\n\n return (\n <Text>\n {text}\n <Button payload={buttonPayload}>{buttonText}</Button>\n </Text>\n )\n }\n\n return (\n <WhatsappInteractiveMediaCarousel\n cards={FlowCarousel.createCardsFromElements(this.elements)}\n // TODO: Add the text message in flow builder frontend and take it from the carousel node with different languages\n textMessage={this.whatsappText || DEFAULT_TEXT_MESSAGE}\n />\n )\n }\n return (\n <Carousel key={this.id}>\n {this.elements.map(element => element.renderElement(this.id))}\n </Carousel>\n )\n }\n}\n"],"names":["isWhatsapp","OutputMessageType","Button","CardType","Carousel","Text","WhatsappCTAUrlButton","WhatsappCTAUrlHeaderType","WhatsappInteractiveMediaCarousel","trackOneContent","ContentFieldsBase","FlowElement","DEFAULT_TEXT_MESSAGE","FlowCarousel","component","locale","cmsApi","botContext","newCarousel","element","request","elements","text","Error","id","carouselMessage","buttonText","url","buttonPayload","index","isValid","console"],"mappings":";;;;;;;;;;;;;;AAKsB;AAWC;AAGsB;AACY;AACb;AAG5C,MAAMY,oBAAoBA,GAAG;AACtB,MAAMC,YAAYA,SAASH,iBAAiBA;IAIjD,OAAO,eACLI,SAAyB,EACzBC,MAAc,EACdC,MAAsB,EACtBC,UAAsB,EACR;QACd,MAAMC,cAAc,IAAIL,YAAYA,CAACC,UAAU,EAAE;QACjDI,YAAY,IAAI,GAAGJ,UAAU,IAAI;QACjCI,YAAY,QAAQ,GAAGJ,UA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AA8B,CAACY;IACpC,MAAMK,UACJL,gBAAgB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAACN,CAAAA,UAAWA,QAAQ,MAAM,CAAC,GAAG,KACpEM,gBAAgB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAACN,CAAAA,UAAWA,QAAQ,MAAM,CAAC,OAAO;IAE1E,IAAI,CAACW,SAAS;QACZC,QAAQ,IAAI,CACV,8HACAN,gBAAgB,OAAO;IAE3B;IACA,OAAOK;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-channel-conditional.js","sources":["../../../src/content-fields/flow-channel-conditional.tsx"],"sourcesContent":["import {\n type BotContext,\n EventAction,\n type EventConditionalChannel,\n} from '@botonic/core'\n\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtChannelConditionalNode } from './hubtype-fields/channel-conditional'\nimport type { HtFunctionResult } from './hubtype-fields/function'\n\nexport class FlowChannelConditional extends ContentFieldsBase {\n public resultMapping: HtFunctionResult[] = []\n public conditionalResult?: HtFunctionResult = undefined\n public channelResult: string = ''\n\n static fromHubtypeCMS(\n component: HtChannelConditionalNode,\n botContext: BotContext\n ): FlowChannelConditional {\n const newChannelConditional = new FlowChannelConditional(component.id)\n newChannelConditional.code = component.code\n newChannelConditional.resultMapping = component.content.result_mapping\n newChannelConditional.setConditionalResult(botContext)\n\n return newChannelConditional\n }\n\n setConditionalResult(botContext: BotContext): void {\n const provider = botContext.session.user.provider\n const conditionalResult =\n this.resultMapping.find(rMap => rMap.result === provider) ||\n this.resultMapping.find(rMap => rMap.result === 'default')\n if (!conditionalResult) {\n throw new Error(\n `No conditional result found for node ${this.code} with channel: ${provider}`\n )\n }\n this.conditionalResult = conditionalResult\n this.channelResult = conditionalResult.result as string\n this.followUp = conditionalResult.target\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n\n const eventChannelConditional: EventConditionalChannel = {\n action: EventAction.ConditionalChannel,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n channel: this.channelResult,\n }\n const { action, ...eventArgs } = eventChannelConditional\n await trackEvent(botContext, action, eventArgs)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n }\n\n toBotonic(): JSX.Element {\n return <></>\n }\n}\n"],"names":["EventAction","getCommonFlowContentEventArgsForContentId","trackEvent","ContentFieldsBase","FlowChannelConditional","component","botContext","newChannelConditional","provider","conditionalResult","rMap","Error","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","eventChannelConditional","action","eventArgs","undefined"],"mappings":";;;;;;;;;;AAIsB;AAKF;AACqC;AAIlD,MAAMI,sBAAsBA,SAASD,iBAAiBA;IAK3D,OAAO,eACLE,SAAmC,EACnCC,UAAsB,EACE;QACxB,MAAMC,wBAAwB,IAAIH,sBAAsBA,CAACC,UAAU,EAAE;QACrEE,sBAAsB,IAAI,GAAGF,UAAU,IAAI;QAC3CE,sBAAsB,aAAa,GAAGF,UAAU,OAAO,CAAC,cAAc;QACtEE,sBAAsB,oBAAoB,CAACD;QAE3C,OAAOC;IACT;IAEA,qBAAqBD,UAAsB,EAAQ;QACjD,MAAME,WAAWF,WAAW,OAAO,CAAC,IAAI,CAAC,QAAQ;QACjD,MAAMG,oBACJ,IAAI,CAAC,aAAa,CAAC,IAAI,CAACC,CAAAA,OAAQA,KAAK,MAAM,KAAKF,aAChD,IAAI,CAAC,aAAa,CAAC,IAAI,CAACE,CAAAA,OAAQA,KAAK,MAAM,KAAK;QAClD,IAAI,CAACD,mBAAmB;YACtB,MAAM,IAAIE,MACR,CAAC,qCAAqC,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAEH,UAAU;QAEjF;QACA,IAAI,CAAC,iBAAiB,GAAGC;QACzB,IAAI,CAAC,aAAa,GAAGA,kBAAkB,MAAM;QAC7C,IAAI,CAAC,QAAQ,GAAGA,kBAAkB,MAAM;IAC1C;IAEA,MAAM,UAAUH,UAAsB,EAAiB;QACrD,MAAM,EAAEM,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrEf,yCAAyCA,CAACK,YAAY,IAAI,CAAC,EAAE;QAE/D,MAAMW,0BAAmD;YACvD,QAAQjB,8BAA8B;YACtCY;YACAC;YACAC;YACAC;YACAC;YACA,sBAAsB;YACtB,SAAS,IAAI,CAAC,aAAa;QAC7B;QACA,MAAM,EAAEE,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMf,UAAUA,CAACI,YAAYY,QAAQC;IACvC;IAEA,MAAM,eAAeb,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;IACvB;IAEA,YAAyB;QACvB,qBAAO;IACT;;QAzDK,qBACE,gBAAoC,EAAE,OACtC,oBAAuCc,gBACvC,gBAAwB;;AAuDjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-country-conditional.js","sources":["../../../src/content-fields/flow-country-conditional.tsx"],"sourcesContent":["import {\n type BotContext,\n EventAction,\n type EventConditionalCountry,\n} from '@botonic/core'\n\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtFunctionResult } from './hubtype-fields'\nimport type { HtCountryConditionalNode } from './hubtype-fields/country-conditional'\n\nexport class FlowCountryConditional extends ContentFieldsBase {\n public resultMapping: HtFunctionResult[] = []\n public conditionalResult?: HtFunctionResult = undefined\n\n static fromHubtypeCMS(\n component: HtCountryConditionalNode,\n botContext: BotContext\n ): FlowCountryConditional {\n const newCountryConditional = new FlowCountryConditional(component.id)\n newCountryConditional.code = component.code\n newCountryConditional.resultMapping = component.content.result_mapping\n newCountryConditional.setConditionalResult(botContext)\n\n return newCountryConditional\n }\n\n setConditionalResult(botContext: BotContext): void {\n const country = botContext.getUserCountry()\n const conditionalResult =\n this.resultMapping.find(rMap => rMap.result === country) ||\n this.resultMapping.find(rMap => rMap.result === 'default')\n if (!conditionalResult) {\n throw new Error(\n `No conditional result found for node ${this.code} with country: ${country}`\n )\n }\n this.conditionalResult = conditionalResult\n this.followUp = conditionalResult.target\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n if (!this.conditionalResult?.result) {\n console.warn(\n `Tracking event for node ${this.code} but no conditional result found`\n )\n }\n const eventCountryConditional: EventConditionalCountry = {\n action: EventAction.ConditionalCountry,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n country: (this.conditionalResult?.result as string) ?? '',\n }\n const { action, ...eventArgs } = eventCountryConditional\n await trackEvent(botContext, action, eventArgs)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(): JSX.Element {\n return <></>\n }\n}\n"],"names":["EventAction","getCommonFlowContentEventArgsForContentId","trackEvent","ContentFieldsBase","FlowCountryConditional","component","botContext","newCountryConditional","country","conditionalResult","rMap","Error","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","console","eventCountryConditional","action","eventArgs","undefined"],"mappings":";;;;;;;;;;AAIsB;AAKF;AACqC;AAIlD,MAAMI,sBAAsBA,SAASD,iBAAiBA;IAI3D,OAAO,eACLE,SAAmC,EACnCC,UAAsB,EACE;QACxB,MAAMC,wBAAwB,IAAIH,sBAAsBA,CAACC,UAAU,EAAE;QACrEE,sBAAsB,IAAI,GAAGF,UAAU,IAAI;QAC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,qBAAO;IACT;;QA5DK,qBACE,gBAAoC,EAAE,OACtC,oBAAuCe;;AA2DhD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-custom-conditional.js","sources":["../../../src/content-fields/flow-custom-conditional.tsx"],"sourcesContent":["import {\n type BotContext,\n EventAction,\n type EventConditionalCustom,\n} from '@botonic/core'\n\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtCustomConditionalNode } from './hubtype-fields/custom-conditional'\nimport type {\n HtFunctionArgument,\n HtFunctionArguments,\n HtFunctionResult,\n} from './hubtype-fields/function'\n\nexport class FlowCustomConditional extends ContentFieldsBase {\n public arguments: HtFunctionArguments[] = []\n public resultMapping: HtFunctionResult[]\n public conditionalResult?: HtFunctionResult = undefined\n public customResult: boolean = false\n public variableFormat: string = ''\n\n static fromHubtypeCMS(\n component: HtCustomConditionalNode,\n botContext: BotContext\n ): FlowCustomConditional {\n const newCustomConditional = new FlowCustomConditional(component.id)\n newCustomConditional.code = component.code\n newCustomConditional.arguments = component.content.arguments\n newCustomConditional.resultMapping = component.content.result_mapping\n newCustomConditional.setConditionalResult(botContext)\n newCustomConditional.variableFormat = (\n component.content.arguments as HtFunctionArgument[]\n )[0].type\n\n return newCustomConditional\n }\n\n setConditionalResult(botContext: BotContext): void {\n const functionArgument = this.arguments.find(arg => {\n if ('name' in arg) {\n return arg.name === 'keyPath'\n }\n return false\n })\n\n let keyPath = ''\n\n if (functionArgument && 'value' in functionArgument) {\n keyPath = functionArgument.value\n } else {\n throw new Error(`Key path not found for node ${this.code}`)\n }\n\n const botVariable = this.getValueFromKeyPath(botContext, keyPath)\n\n let conditionalResult =\n this.resultMapping.find(rMap => rMap.result === botVariable) ||\n this.resultMapping.find(rMap => rMap.result === 'default')\n\n if (\n this.isBooleanConditional(this.resultMapping) &&\n typeof botVariable !== 'boolean'\n ) {\n conditionalResult =\n this.resultMapping.find(\n rMap =>\n rMap.result === (botVariable !== undefined && botVariable !== null)\n ) || this.resultMapping.find(rMap => rMap.result === 'default')\n }\n\n if (!conditionalResult) {\n throw new Error(\n `No conditional result found for node ${this.code} with key path: ${keyPath}`\n )\n }\n\n this.conditionalResult = conditionalResult\n this.customResult = conditionalResult.result as unknown as boolean\n this.followUp = conditionalResult.target\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n if (!this.conditionalResult?.result) {\n console.warn(\n `Tracking event for node ${this.code} but no conditional result found`\n )\n }\n const eventCustomConditional: EventConditionalCustom = {\n action: EventAction.ConditionalCustom,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n conditionalVariable: this.customResult.toString(),\n variableFormat: this.variableFormat,\n operator: '',\n }\n const { action, ...eventArgs } = eventCustomConditional\n await trackEvent(botContext, action, eventArgs)\n }\n\n private isBooleanConditional(resultMapping: HtFunctionResult[]): boolean {\n return (\n resultMapping.some(rMap => rMap.result === true) &&\n resultMapping.some(rMap => rMap.result === false) &&\n resultMapping.some(rMap => rMap.result === 'default')\n )\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic() {\n return <></>\n }\n}\n"],"names":["EventAction","getCommonFlowContentEventArgsForContentId","trackEvent","ContentFieldsBase","FlowCustomConditional","component","botContext","newCustomConditional","functionArgument","arg","keyPath","Error","botVariable","conditionalResult","rMap","undefined","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","console","eventCustomConditional","action","eventArgs","resultMapping"],"mappings":";;;;;;;;;;AAIsB;AAKF;AACqC;AAQlD,MAAMI,qBAAqBA,SAASD,iBAAiBA;IAO1D,OAAO,eACLE,SAAkC,EAClCC,UAAsB,EACC;QACvB,MAAMC,uBAAuB,IAAIH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AuGlC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-element.js","sources":["../../../src/content-fields/flow-element.tsx"],"sourcesContent":["import type { BotContext, Button } from '@botonic/core'\nimport { Element, Pic, Subtitle, Title } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowButton } from './flow-button'\nimport type { HtCarouselElement } from './hubtype-fields'\n\nexport class FlowElement extends ContentFieldsBase {\n public title = ''\n public subtitle = ''\n public button: FlowButton | undefined\n public image = ''\n public hidden = false\n\n static fromHubtypeCMS(\n component: HtCarouselElement,\n locale: string,\n cmsApi: FlowBuilderApi,\n botContext: BotContext\n ): FlowElement {\n const newElement = new FlowElement(component.id)\n newElement.title = FlowElement.getTextByLocale(locale, component.title)\n newElement.subtitle = FlowElement.getTextByLocale(\n locale,\n component.subtitle\n )\n newElement.image = FlowElement.getAssetByLocale(locale, component.image)\n newElement.button = FlowButton.fromHubtypeCMS(\n component.button,\n locale,\n cmsApi,\n botContext\n )\n return newElement\n }\n\n static fromAIAgent(\n id: string,\n element: {\n title: string\n subtitle: string\n image: string\n button: Button\n }\n ) {\n const newElement = new FlowElement(id)\n newElement.title = element.title\n newElement.subtitle = element.subtitle\n newElement.image = element.image\n newElement.button = FlowButton.fromAIAgent({\n id: `${id}-button`,\n text: element.button.text,\n url: element.button.url,\n })\n return newElement\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n if (this.button) {\n await this.button.trackFlow(botContext)\n }\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.trackFlow(botContext)\n return\n }\n\n renderElement(parentId: string): JSX.Element {\n return (\n <Element key={`${parentId}-${this.id}`}>\n <Pic src={this.image} />\n <Title>{this.title}</Title>\n <Subtitle>{this.subtitle}</Subtitle>\n {this.button?.renderButton(0)}\n </Element>\n )\n }\n}\n"],"names":["Element","Pic","Subtitle","Title","ContentFieldsBase","FlowButton","FlowElement","component","locale","cmsAp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ACpB,IAACE,KAAKA;8BAAE,IAAI,CAAC,KAAK;;8BAClB,IAACD,QAAQA;8BAAE,IAAI,CAAC,QAAQ;;gBACvB,IAAI,CAAC,MAAM,EAAE,aAAa;;WAJf,GAAGY,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE;IAO1C;;QAtEK,qBACE,QAAQ,SACR,WAAW,SAEX,QAAQ,SACR,SAAS;;AAkElB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-go-to-flow.js","sources":["../../../src/content-fields/flow-go-to-flow.tsx"],"sourcesContent":["import {\n type BotContext,\n EventAction,\n type EventRedirectFlow,\n} from '@botonic/core'\n\nimport type { FlowBuilderApi } from '../api'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtGoToFlow, HtNodeWithContent } from './hubtype-fields'\n\nexport class FlowGoToFlow extends ContentFieldsBase {\n public flowTargetId: string = ''\n public flowTargetName: string = ''\n public targetId: string = ''\n\n static fromHubtypeCMS(\n component: HtGoToFlow,\n cmsApi: FlowBuilderApi\n ): FlowGoToFlow {\n const newGoToFlow = new FlowGoToFlow(component.id)\n newGoToFlow.code = component.code\n newGoToFlow.flowTargetId = component.content.flow_id\n const targetId = cmsApi.getNodeByFlowId(component.content.flow_id).id\n newGoToFlow.targetId = targetId\n newGoToFlow.flowTargetName = cmsApi.getFlowName(component.content.flow_id)\n newGoToFlow.followUp = cmsApi.getNodeById<HtNodeWithContent>(targetId)\n\n return newGoToFlow\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n const eventGoToFlow: EventRedirectFlow = {\n action: EventAction.RedirectFlow,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId: flowNodeContentId || 'Go to flow',\n flowTargetId: this.flowTargetId,\n flowTargetName: this.flowTargetName,\n flowNodeIsMeaningful: false,\n }\n const { action, ...eventArgs } = eventGoToFlow\n await trackEvent(botContext, action, eventArgs)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(): JSX.Element {\n return <></>\n }\n}\n"],"names":["EventAction","getCommonFlowContentEventArgsForContentId","trackEvent","ContentFieldsBase","FlowGoToFlow","component","cmsApi","newGoToFlow","targetId","botContext","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","eventGoToFlow","action","eventArgs"],"mappings":";;;;;;;;;;AAIsB;AAMF;AACqC;AAGlD,MAAMI,YAAYA,SAASD,iBAAiBA;IAKjD,OAAO,eACLE,SAAqB,EACrBC,MAAsB,EACR;QACd,MAAMC,cAAc,IAAIH,YAAYA,CAACC,UAAU,EAAE;QACjDE,YAAY,IAAI,GAAGF,UAAU,IAAI;QACjCE,YAAY,YAAY,GAAGF,UAAU,OAAO,CAAC,OAAO;QACpD,MAAMG,WAAWF,OAAO,eAAe,CAACD,UAAU,OAAO,CAAC,OAAO,EAAE,EAAE;QACrEE,YAAY,QAAQ,GAAGC;QACvBD,YAAY,cAAc,GAAGD,OAAO,WAAW,CAACD,UAAU,OAAO,CAAC,OAAO;QACzEE,YAAY,QAAQ,GAAGD,OAAO,WAAW,CAAoBE;QAE7D,OAAOD;IACT;IAEA,MAAM,UAAUE,UAAsB,EAAiB;QACrD,MAAM,EAAEC,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrEb,yCAAyCA,CAACQ,YAAY,IAAI,CAAC,EAAE;QAC/D,MAAMM,gBAAmC;YACvC,QAAQf,wBAAwB;YAChCU;YACAC;YACAC;YACAC;YACA,mBAAmBC,qBAAqB;YACxC,cAAc,IAAI,CAAC,YAAY;YAC/B,gBAAgB,IAAI,CAAC,cAAc;YACnC,sBAAsB;QACxB;QACA,MAAM,EAAEE,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMb,UAAUA,CAACO,YAAYO,QAAQC;IACvC;IAEA,MAAM,eAAeR,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,YAAyB;QACvB,qBAAO;IACT;;QA9CK,qBACE,eAAuB,SACvB,iBAAyB,SACzB,WAAmB;;AA4C5B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-handoff.js","sources":["../../../src/content-fields/flow-handoff.tsx"],"sourcesContent":["import {\n type BotContext,\n HandOffBuilder,\n HelpdeskEvent,\n isDev,\n isWebchat,\n} from '@botonic/core'\nimport { WebchatSettings } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { getCommonFlowContentEventArgsForContentId } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtHandoffNode, HtQueueLocale } from './hubtype-fields'\n\nexport class FlowHandoff extends ContentFieldsBase {\n public queue?: HtQueueLocale\n public onFinishPayload?: string\n public handoffAutoAssign: boolean\n public hasQueuePositionChangedNotificationsEnabled: boolean\n public isTestIntegration: boolean\n\n static fromHubtypeCMS(\n cmsHandoff: HtHandoffNode,\n locale: string,\n cmsApi: FlowBuilderApi\n ): FlowHandoff {\n const newHandoff = new FlowHandoff(cmsHandoff.id)\n newHandoff.code = cmsHandoff.code\n newHandoff.queue = FlowHandoff.getQueueByLocale(\n locale,\n cmsHandoff.content.queue\n )\n newHandoff.onFinishPayload = FlowHandoff.getOnFinishPayload(\n cmsHandoff,\n cmsApi\n )\n newHandoff.handoffAutoAssign = cmsHandoff.content.has_auto_assign\n newHandoff.hasQueuePositionChangedNotificationsEnabled =\n cmsHandoff.content.has_queue_position_changed_notifications_enabled\n newHandoff.followUp = cmsHandoff.follow_up\n\n return newHandoff\n }\n\n private static getOnFinishPayload(\n cmsHandoff: HtHandoffNode,\n cmsApi: FlowBuilderApi\n ): string | undefined {\n if (cmsHandoff.target?.id) {\n return cmsApi.getPayload(cmsHandoff.target)\n }\n\n return undefined\n }\n\n async doHandoff(botContext: BotContext): Promise<void> {\n const handOffBuilder = new HandOffBuilder(botContext.session)\n handOffBuilder.withAutoAssignOnWaiting(this.handoffAutoAssign)\n\n if (this.hasQueuePositionChangedNotificationsEnabled) {\n handOffBuilder.withSubscribeHelpdeskEvents([\n HelpdeskEvent.QueuePositionChanged,\n ])\n }\n\n if (this.onFinishPayload) {\n handOffBuilder.withOnFinishPayload(this.onFinishPayload)\n }\n\n if (this.queue) {\n const language = botContext.getSystemLocale()\n\n handOffBuilder.withQueue(this.queue.id)\n\n const { flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n\n handOffBuilder.withBotEvent({\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n })\n\n handOffBuilder.withExtraData({\n language,\n })\n\n await handOffBuilder.handOff()\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async trackFlow(_botContext: BotContext): Promise<void> {\n // TODO: Not apply for this content because backend track handoff success event\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.doHandoff(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n return isDev(botContext.session) || isWebchat(botContext.session) ? (\n <WebchatSettings key={this.id} enableUserInput={true} />\n ) : (\n <></>\n )\n }\n}\n"],"names":["HandOffBuilder","HelpdeskEvent","isDev","isWebchat","WebchatSettings","getCommonFlowContentEventArgsForContentId","ContentFieldsBase","FlowHandoff","cmsHandoff","locale","cmsApi","newHandoff","undefined","botContext","handOffBuilder","language","flowId","flowName","flowNodeId","flowNodeContentId","_botContext"],"mappings":";;;;;;;;;;;;AAMsB;AAC0B;AAGuB;AACd;AAGlD,MAAMO,WAAWA,SAASD,iBAAiBA;IAOhD,OAAO,eACLE,UAAyB,E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,aAAa,CAAC;gBAC3BC;YACF;YAEA,MAAMD,eAAe,OAAO;QAC9B;IACF;IAEA,6DAA6D;IAC7D,MAAM,UAAUM,WAAuB,EAAiB;IACtD,+EAA+E;IACjF;IAEA,MAAM,eAAeP,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,UAAUA,UAAsB,EAAe;QAC7C,OAAOX,KAAKA,CAACW,WAAW,OAAO,KAAKV,SAASA,CAACU,WAAW,OAAO,kBAC9D,IAACT,eAAeA;YAAe,iBAAiB;WAA1B,IAAI,CAAC,EAAE,kBAE7B;IAEJ;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-image.js","sources":["../../../src/content-fields/flow-image.tsx"],"sourcesContent":["import type { BotContext } from '@botonic/core'\nimport { Image } from '@botonic/react'\n\nimport { trackOneContent } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtImageNode } from './hubtype-fields'\n\nexport class FlowImage extends ContentFieldsBase {\n public src = ''\n\n static fromHubtypeCMS(component: HtImageNode, locale: string): FlowImage {\n const newImage = new FlowImage(component.id)\n newImage.code = component.code\n newImage.src = FlowImage.getAssetByLocale(locale, component.content.image)\n newImage.followUp = component.follow_up\n\n return newImage\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(): JSX.Element {\n return <Image key={this.id} src={this.src} />\n }\n}\n"],"names":["Image","trackOneContent","ContentFieldsBase","FlowImage","component","locale","newImage","botContext"],"mappings":";;;;;;;;;;AACsC;AAEO;AACY;AAGlD,MAAMG,SAASA,SAASD,iBAAiBA;IAG9C,OAAO,eAAeE,SAAsB,EAAEC,MAAc,EAAa;QACvE,MAAMC,WAAW,IAAIH,SAASA,CAACC,UAAU,EAAE;QAC3CE,SAAS,IAAI,GAAGF,UAAU,IAAI;QAC9BE,SAAS,GAAG,GAAGH,SAASA,CAAC,gBAAgB,CAACE,QAAQD,UAAU,OAAO,CAAC,KAAK;QACzEE,SAAS,QAAQ,GAAGF,UAAU,SAAS;QAEvC,OAAOE;IACT;IAEA,MAAM,UAAUC,UAAsB,EAAiB;QACrD,MAAMN,eAAeA,CAACM,YAAY,IAAI;IACxC;IAEA,MAAM,eAAeA,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,YAAyB;QACvB,qBAAO,IAACP,KAAKA;YAAe,KAAK,IAAI,CAAC,GAAG;WAAtB,IAAI,CAAC,EAAE;IAC5B;;QAxBK,qBACE,MAAM;;AAwBf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-queue-status-conditional.js","sources":["../../../src/content-fields/flow-queue-status-conditional.tsx"],"sourcesContent":["import {\n type BotContext,\n EventAction,\n type EventConditionalQueueStatus,\n} from '@botonic/core'\n\nimport { getArgumentsByLocale } from '../functions'\nimport { HubtypeQueuesApi } from '../services/hubtype-queues-api'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type {\n HtFunctionArguments,\n HtFunctionResult,\n} from './hubtype-fields/function'\nimport type {\n HtQueueStatusConditionalNode,\n HtQueueStatusConditionalResultMapping,\n} from './hubtype-fields/queue-status-conditional'\n\nenum QueueStatusResult {\n OPEN = 'open',\n CLOSED = 'closed',\n OPEN_WITHOUT_AGENTS = 'open-without-agents',\n}\n\ntype ConditionalQueueStatusArgs = {\n queueId: string\n queueName: string\n checkAvailableAgents: boolean\n}\n\nexport class FlowQueueStatusConditional extends ContentFieldsBase {\n public arguments: HtFunctionArguments[] = []\n public resultMapping: HtQueueStatusConditionalResultMapping\n public conditionalResult?: HtFunctionResult\n public queueId: string = ''\n public queueName: string = ''\n public isQueueOpen: boolean = false\n public isAvailableAgent: boolean = false\n\n static async fromHubtypeCMS(\n component: HtQueueStatusConditionalNode,\n locale: string\n ): Promise<FlowQueueStatusConditional> {\n const newChannelConditional = new FlowQueueStatusConditional(component.id)\n newChannelConditional.code = component.code\n newChannelConditional.arguments = component.content.arguments\n newChannelConditional.resultMapping = component.content\n .result_mapping as HtQueueStatusConditionalResultMapping\n await newChannelConditional.setConditionalResult(locale)\n\n return newChannelConditional\n }\n\n async setConditionalResult(locale: string): Promise<void> {\n const args = getArgumentsByLocale(this.arguments, locale)\n\n const queueId = args.find(arg => arg.name === 'queue_id')?.value || ''\n const queueName = args.find(arg => arg.name === 'queue_name')?.value || ''\n const checkAvailableAgents =\n (args.find(arg => arg.name === 'check_available_agents')\n ?.value as unknown as boolean) || false\n\n const queueStatus = await this.conditionalQueueStatus({\n queueId,\n queueName,\n checkAvailableAgents,\n })\n\n const conditionalResult = this.resultMapping.find(\n rMap => rMap.result === queueStatus\n )\n\n if (!conditionalResult) {\n throw new Error(\n `No conditional result found for node ${this.code} with queue: ${queueName}`\n )\n }\n this.conditionalResult = conditionalResult\n this.followUp = conditionalResult.target\n }\n\n async conditionalQueueStatus({\n queueId,\n checkAvailableAgents,\n queueName,\n }: ConditionalQueueStatusArgs): Promise<QueueStatusResult> {\n const queuesApi = new HubtypeQueuesApi(queueId, checkAvailableAgents)\n const data = await queuesApi.getAvailability()\n this.queueId = queueId\n this.queueName = queueName\n this.isQueueOpen = data.open\n this.isAvailableAgent = data.available_agents > 0\n\n if (checkAvailableAgents && data.open && data.available_agents === 0) {\n return QueueStatusResult.OPEN_WITHOUT_AGENTS\n }\n\n return data.open ? QueueStatusResult.OPEN : QueueStatusResult.CLOSED\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n if (!this.conditionalResult?.result) {\n console.warn(\n `Tracking event for node ${this.code} but no conditional result found`\n )\n }\n const eventQueueStatusConditional: EventConditionalQueueStatus = {\n action: EventAction.ConditionalQueueStatus,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n queueId: this.queueId,\n queueName: this.queueName,\n isQueueOpen: this.isQueueOpen,\n isAvailableAgent: this.isAvailableAgent,\n }\n const { action, ...eventArgs } = eventQueueStatusConditional\n await trackEvent(botContext, action, eventArgs)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(): JSX.Element {\n return <></>\n }\n}\n"],"names":["EventAction","getArgumentsByLocale","HubtypeQueuesApi","getCommonFlowContentEventArgsForContentId","trackEvent","ContentFieldsBase","QueueStatusResult","FlowQueueStatusConditional","component","locale","newChannelConditional","args","queueId","arg","queueName","checkAvailableAgents","queueStatus","conditionalResult","rMap","Error","queuesApi","data","botContext","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","console","eventQueueStatusConditional","action","eventArgs"],"mappings":";;;;;;;;;;;;;;AAIsB;AAE6B;AACc;AAI7C;AACqC;AAUzD,IAAKM,+CAAiBA,iBAAjBA,gDAAAA,SAAAA;;;;WAAAA;EAAAA,+CAAiBA,OAAjBA,EAAAA;AAYE,MAAMC,0BAA0BA,SAASF,iBAAiBA;IAS/D,aAAa,eACXG,SAAuC,EACvCC,MAAc,EACuB;QACrC,MAAMC,wBAAwB,IAAIH,0BAA0BA,CAACC,UAAU,EAAE;QACzEE,sBAAsB,IAAI,GAAGF,UAAU,IAAI;QAC3CE,sBAAsB,SAAS,GAAGF,UAAU,OAAO,CAAC,SAAS;QAC7DE,sBAAsB,aAAa,GAAGF,UAAU,OAAO,CACpD,cAAc;QACjB,MAAME,sBAAsB,oBAAoB,CAACD;QAEjD,OAAOC;IACT;IAEA,M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AAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrExB,yCAAyCA,CAACmB,YAAY,IAAI,CAAC,EAAE;QAC/D,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ;YACnCM,QAAQ,IAAI,CACV,CAAC,wBAAwB,EAAE,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC;QAE1E;QACA,MAAMC,8BAA2D;YAC/D,QAAQ7B,kCAAkC;YAC1CuB;YACAC;YACAC;YACAC;YACAC;YACA,sBAAsB;YACtB,SAAS,IAAI,CAAC,OAAO;YACrB,WAAW,IAAI,CAAC,SAAS;YACzB,aAAa,IAAI,CAAC,WAAW;YAC7B,kBAAkB,IAAI,CAAC,gBAAgB;QACzC;QACA,MAAM,EAAEG,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMzB,UAAUA,CAACkB,YAAYQ,QAAQC;IACvC;IAEA,MAAM,eAAeT,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,YAAyB;QACvB,qBAAO;IACT;;QAvGK,qBACE,YAAmC,EAAE,OAGrC,UAAkB,SAClB,YAAoB,SACpB,cAAuB,YACvB,mBAA4B;;AAiGrC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-rating.js","sources":["../../../src/content-fields/flow-rating.tsx"],"sourcesContent":["import { type BotContext, isDev, isWebchat, isWhatsapp } from '@botonic/core'\nimport { CustomRatingMessage, Text, WhatsappButtonList } from '@botonic/react'\n\nimport { trackOneContent } from '../tracking'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowButton } from './flow-button'\nimport { type HtRatingNode, RatingType } from './hubtype-fields'\n\nexport class FlowRating extends ContentFieldsBase {\n public text = ''\n public sendButtonText = ''\n public ratingType = RatingType.Stars\n public buttons: FlowButton[] = []\n public openListButtonText = ''\n\n static fromHubtypeCMS(cmsText: HtRatingNode, locale: string): FlowRating {\n const newRating = new FlowRating(cmsText.id)\n newRating.code = cmsText.code\n newRating.text = FlowRating.getTextByLocale(locale, cmsText.content.text)\n newRating.sendButtonText = FlowRating.getTextByLocale(\n locale,\n cmsText.content.send_button_text\n )\n newRating.ratingType = cmsText.content.rating_type\n newRating.buttons = cmsText.content.buttons.map(button =>\n FlowButton.fromRating(button)\n )\n newRating.openListButtonText = FlowRating.getTextByLocale(\n locale,\n cmsText.content.open_list_button_text\n )\n newRating.followUp = cmsText.follow_up\n\n return newRating\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const customRatingMessageEnabled =\n flowBuilderPlugin.customRatingMessageEnabled\n const replacedText = this.replaceVariables(this.text, botContext)\n\n if (isWhatsapp(botContext.session)) {\n return (\n <WhatsappButtonList\n body={replacedText}\n button={this.openListButtonText}\n sections={[\n {\n rows: this.buttons.map(button => ({\n id: button.payload as string,\n title: button.text,\n })),\n },\n ]}\n />\n )\n }\n\n if (\n (isWebchat(botContext.session) || isDev(botContext.session)) &&\n customRatingMessageEnabled\n ) {\n const payloads = this.buttons\n .map(button => button.payload)\n .slice()\n .reverse()\n\n return (\n <CustomRatingMessage\n alt={replacedText}\n payloads={payloads}\n messageText={replacedText}\n buttonText={this.sendButtonText}\n ratingType={this.ratingType}\n />\n )\n }\n\n return (\n <Text key={this.id}>\n {replacedText}\n {this.buttons.map((button, buttonIndex) =>\n button.renderButton(buttonIndex)\n )}\n </Text>\n )\n }\n}\n"],"names":["isDev","isWebchat","isWhatsapp","CustomRatingMessage","Text","WhatsappButtonList","trackOneContent","getFlowBuilderPlugin","ContentFieldsBase","FlowButton","RatingType","FlowRating","cmsText","locale","newRating","button","botContext","flowBuilderPlugin","customRatingMessageEnabled","replacedText","payloads","buttonIndex"],"mappings":";;;;;;;;;;;;;;;;;;AAA6E;AACC;AAEjC;AAC0B;AACd;AACf;AACsB;AAEzD,MAAMW,UAAUA,SAASH,iBAAiBA;IAO/C,OAAO,eAAeI,OAAqB,EAAEC,MAAc,EAAc;QACvE,MAAMC,YAAY,IAAIH,UAAUA,CAACC,QAAQ,EAAE;QAC3CE,UAAU,IAAI,GAAGF,QAAQ,IAAI;QAC7BE,UAAU,IAAI,GAAGH,UAAUA,CAAC,eAAe,CAACE,QAAQD,QAAQ,OAAO,CAAC,IAAI;QACxEE,UAAU,cAAc,GAAGH,UAAUA,CAAC,eAAe,CACnDE,QACAD,QAAQ,OAAO,CAAC,gBAAgB;QAElCE,UAAU,UAAU,GAAGF,QAAQ,OAAO,CAAC,WAAW;QAClDE,UAAU,OAAO,GAAGF,QAAQ,OAAO,CAAC,OAAO,CAAC,GAAG,CAACG,CAAAA,SAC9CN,qBAAqB,CAACM;QAExBD,UAAU,kBAAkB,GAAGH,UAAUA,CAAC,eAAe,CACvDE,QACAD,QAAQ,OAAO,CAAC,qBAAqB;QAEvCE,UAAU,QAAQ,GAAGF,QAAQ,SAAS;QAEtC,OAAOE;IACT;IAEA,MAAM,UAAUE,UAAsB,EAAiB;QACrD,MAAMV,eAAeA,CAACU,YAAY,IAAI;IACxC;IAEA,MAAM,eAAeA,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,UAAUA,UAAsB,EAAe;QAC7C,MAAMC,oBAAoBV,oBAAoBA,CAACS,WAAW,OAAO;QACjE,MAAME,6BACJD,kBAAkB,0BAA0B;QAC9C,MAAME,eAAe,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAEH;QAEtD,IAAId,UAAUA,CAACc,WAAW,OAAO,GAAG;YAClC,qBACE,IAACX,kBAAkBA;gBACjB,MAAMc;gBACN,QAAQ,IAAI,CAAC,kBAAkB;gBAC/B,UAAU;oBACR;wBACE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAACJ,CAAAA,SAAW;gCAChC,IAAIA,OAAO,OAAO;gCAClB,OAAOA,OAAO,IAAI;4BACpB;oBACF;iBACD;;QAGP;QAEA,IACGd,CAAAA,SAASA,CAACe,WAAW,OAAO,KAAKhB,KAAKA,CAACgB,WAAW,OAAO,MAC1DE,4BACA;YACA,MAAME,WAAW,IAAI,CAAC,OAAO,CAC1B,GAAG,CAACL,CAAAA,SAAUA,OAAO,OAAO,EAC5B,KAAK,GACL,OAAO;YAEV,qBACE,IAACZ,mBAAmBA;gBAClB,KAAKgB;gBACL,UAAUC;gBACV,aAAaD;gBACb,YAAY,IAAI,CAAC,cAAc;gBAC/B,YAAY,IAAI,CAAC,UAAU;;QAGjC;QAEA,qBACE,KAACf,IAAIA;;gBACFe;gBACA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAACJ,QAAQM,cACzBN,OAAO,YAAY,CAACM;;WAHb,IAAI,CAAC,EAAE;IAOtB;;QAzFK,qBACE,OAAO,SACP,iBAAiB,SACjB,aAAaX,gBAAgB,OAC7B,UAAwB,EAAE,OAC1B,qBAAqB;;AAqF9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-text.js","sources":["../../../src/content-fields/flow-text.tsx"],"sourcesContent":["import type {\n BotContext,\n BotExecutorMessage,\n TextMessage,\n TextWithButtonsMessage,\n} from '@botonic/core'\nimport { Text } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { EMPTY_PAYLOAD, SOURCE_INFO_SEPARATOR } from '../constants'\nimport { trackOneContent } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowButton } from './flow-button'\nimport { HtButtonStyle, type HtTextNode } from './hubtype-fields'\n\nexport class FlowText extends ContentFieldsBase {\n public text = ''\n public buttons: FlowButton[] = []\n public buttonStyle = HtButtonStyle.BUTTON\n\n static fromHubtypeCMS(\n cmsText: HtTextNode,\n locale: string,\n cmsApi: FlowBuilderApi,\n botContext: BotContext\n ): FlowText {\n const newText = new FlowText(cmsText.id)\n newText.code = cmsText.code\n newText.buttonStyle = cmsText.content.buttons_style || HtButtonStyle.BUTTON\n newText.text = FlowText.getTextByLocale(locale, cmsText.content.text)\n newText.buttons = cmsText.content.buttons.map(button =>\n FlowButton.fromHubtypeCMS(button, locale, cmsApi, botContext)\n )\n newText.followUp = cmsText.follow_up\n\n return newText\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n for (const button of this.buttons) {\n await button.trackFlow(botContext)\n }\n }\n\n static fromAIAgent(\n id: string,\n textMessage: TextMessage | TextWithButtonsMessage | BotExecutorMessage\n ): JSX.Element {\n if (textMessage.type === 'text') {\n return <Text key={id}>{textMessage.content.text}</Text>\n }\n\n return (\n <Text key={id}>\n {textMessage.content.text}\n {textMessage.content.buttons.map((button, buttonIndex) => {\n const buttonData = {\n id: `${id}-button-${buttonIndex}`,\n text: button.text,\n url: button.url,\n target: button.target,\n payload:\n button.payload ||\n `${EMPTY_PAYLOAD}${SOURCE_INFO_SEPARATOR}${buttonIndex}`,\n }\n return FlowButton.fromAIAgent(buttonData).renderButton(buttonIndex)\n })}\n </Text>\n )\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const replacedText = this.replaceVariables(this.text, botContext)\n return (\n <Text key={this.id}>\n {replacedText}\n {this.buttons.map((button, buttonIndex) =>\n button.renderButton(buttonIndex, this.buttonStyle)\n )}\n </Text>\n )\n }\n}\n"],"names":["Text","EMPTY_PAYLOAD","SOURCE_INFO_SEPARATOR","trackOneContent","ContentFieldsBase","FlowButton","HtButtonStyle","FlowText","cmsText","locale","cmsApi","botContext","newText","button","id","textMessage","buttonIndex","buttonData","replacedText"],"mappings":";;;;;;;;;;;;;;;;AAMqC;AAG8B;AACtB;AACY;AACf;AACuB;AAE1D,MAAMO,QAAQA,SAASH,iBAAiBA;IAK7C,OAAO,eACLI,OAAmB,EACnBC,MAAc,EACdC,MAAsB,EACtBC,UAAsB,EACZ;QACV,MAAMC,UAAU,IAAIL,QAAQA,CAACC,QAAQ,EAAE;QACvCI,QAAQ,IAAI,GAAGJ,QAAQ,IAAI;QAC3BI,QAAQ,WAAW,GAAGJ,QAAQ,OAAO,CAAC,aAAa,IAAIF,oBAAoB;QAC3EM,QAAQ,IAAI,GAAGL,QAAQA,CAAC,eAAe,CAACE,QAAQD,QAAQ,OAAO,CAAC,IAAI;QACpEI,QAAQ,OAAO,GAAGJ,QAAQ,OAAO,CAAC,OAAO,CAAC,GAAG,CAACK,CAAAA,SAC5CR,yBAAyB,CAACQ,QAAQJ,QAAQC,QAAQC;QAEpDC,QAAQ,QAAQ,GAAGJ,QAAQ,SAAS;QAEpC,OAAOI;IACT;IAEA,MAAM,UAAUD,UAAsB,EAAiB;QACrD,MAAMR,eAAeA,CAACQ,YAAY,IAAI;QACtC,KAAK,MAAME,UAAU,IAAI,CAAC,OAAO,CAAE;YACjC,MAAMA,OAAO,SAAS,CAACF;QACzB;IACF;IAEA,OAAO,YACLG,EAAU,EACVC,WAAsE,EACzD;QACb,IAAIA,YAAY,IAAI,KAAK,QAAQ;YAC/B,qBAAO,IAACf,IAAIA;0BAAWe,YAAY,OAAO,CAAC,IAAI;eAA7BD;QACpB;QAEA,qBACE,KAACd,IAAIA;;gBACFe,YAAY,OAAO,CAAC,IAAI;gBACxBA,YAAY,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAACF,QAAQG;oBACxC,MAAMC,aAAa;wBACjB,IAAI,GAAGH,GAAG,QAAQ,EAAEE,aAAa;wBACjC,MAAMH,OAAO,IAAI;wBACjB,KAAKA,OAAO,GAAG;wBACf,QAAQA,OAAO,MAAM;wBACrB,SACEA,OAAO,OAAO,IACd,GAAGZ,aAAaA,GAAGC,qBAAqBA,GAAGc,aAAa;oBAC5D;oBACA,OAAOX,sBAAsB,CAACY,YAAY,YAAY,CAACD;gBACzD;;WAbSF;IAgBf;IAEA,MAAM,eAAeH,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,UAAUA,UAAsB,EAAe;QAC7C,MAAMO,eAAe,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAEP;QACtD,qBACE,KAACX,IAAIA;;gBACFkB;gBACA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAACL,QAAQG,cACzBH,OAAO,YAAY,CAACG,aAAa,IAAI,CAAC,WAAW;;WAH1C,IAAI,CAAC,EAAE;IAOtB;;QAzEK,qBACE,OAAO,SACP,UAAwB,EAAE,OAC1B,cAAcV,oBAAoB;;AAuE3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-video.js","sources":["../../../src/content-fields/flow-video.tsx"],"sourcesContent":["import type { BotContext } from '@botonic/core'\nimport { Video } from '@botonic/react'\n\nimport { trackOneContent } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtVideoNode } from './hubtype-fields'\n\nexport class FlowVideo extends ContentFieldsBase {\n public src = ''\n\n static fromHubtypeCMS(component: HtVideoNode, locale: string): FlowVideo {\n const newVideo = new FlowVideo(component.id)\n newVideo.code = component.code\n newVideo.src = FlowVideo.getVideoByLocale(locale, component.content.video)\n newVideo.followUp = component.follow_up\n\n return newVideo\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(): JSX.Element {\n return <Video key={this.id} src={this.src} />\n }\n}\n"],"names":["Video","trackOneContent","ContentFieldsBase","FlowVideo","component","locale","newVideo","botContext"],"mappings":";;;;;;;;;;AACsC;AAEO;AACY;AAGlD,MAAMG,SAASA,SAASD,iBAAiBA;IAG9C,OAAO,eAAeE,SAAsB,EAAEC,MAAc,EAAa;QACvE,MAAMC,WAAW,IAAIH,SAASA,CAACC,UAAU,EAAE;QAC3CE,SAAS,IAAI,GAAGF,UAAU,IAAI;QAC9BE,SAAS,GAAG,GAAGH,SAASA,CAAC,gBAAgB,CAACE,QAAQD,UAAU,OAAO,CAAC,KAAK;QACzEE,SAAS,QAAQ,GAAGF,UAAU,SAAS;QAEvC,OAAOE;IACT;IAEA,MAAM,UAAUC,UAAsB,EAAiB;QACrD,MAAMN,eAAeA,CAACM,YAAY,IAAI;IACxC;IAEA,MAAM,eAAeA,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,YAAyB;QACvB,qBAAO,IAACP,KAAKA;YAAe,KAAK,IAAI,CAAC,GAAG;WAAtB,IAAI,CAAC,EAAE;IAC5B;;QAxBK,qBACE,MAAM;;AAwBf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-webview.js","sources":["../../../src/content-fields/flow-webview.tsx"],"sourcesContent":["import {\n type BotContext,\n EventAction,\n type EventWebviewActionTriggered,\n} from '@botonic/core'\n\nimport type { FlowBuilderApi } from '../api'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type {\n HtNodeWithContent,\n HtWebviewExits,\n HtWebviewNode,\n} from './hubtype-fields'\n\nexport class FlowWebview extends ContentFieldsBase {\n public webviewTargetId: string = ''\n public webviewName: string = ''\n public webviewComponentName: string = ''\n public webviewParams: Record<string, string> = {}\n public exits: HtWebviewExits[] = []\n\n static fromHubtypeCMS(component: HtWebviewNode): FlowWebview {\n const newWebview = new FlowWebview(component.id)\n newWebview.webviewTargetId = component.content.webview_target_id\n newWebview.webviewName = component.content.webview_name\n newWebview.webviewComponentName = component.content.webview_component_name\n newWebview.webviewParams = component.content.webview_params ?? {}\n newWebview.exits = component.content.exits\n newWebview.followUp = component.follow_up\n\n return newWebview\n }\n\n getParams(botContext: BotContext): Record<string, string> {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n\n const params: Record<string, string> = {\n webviewId: this.webviewTargetId,\n t: Date.now().toString(),\n ...this.getResolvedWebviewParams(botContext),\n }\n const exitSuccessContentID = this.getExitSuccessContentID(cmsApi)\n\n if (exitSuccessContentID) {\n params.exitSuccessContentID = exitSuccessContentID\n }\n return params\n }\n\n private getResolvedWebviewParams(\n botContext: BotContext\n ): Record<string, string> {\n return Object.fromEntries(\n Object.entries(this.webviewParams).map(([key, value]) => [\n key,\n this.replaceVariables(value, botContext),\n ])\n )\n }\n\n private getExitSuccessContentID(cmsApi: FlowBuilderApi): string | undefined {\n const webviewSuccessExit = this.exits?.find(exit => exit.name === 'Success')\n const exitSuccessId = webviewSuccessExit?.target?.id\n if (!exitSuccessId) {\n return undefined\n }\n const exitNode = cmsApi.getNodeById<HtNodeWithContent>(exitSuccessId)\n\n return exitNode.code\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n\n const eventWebviewActionTriggered: EventWebviewActionTriggered = {\n action: EventAction.WebviewActionTriggered,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n webviewTargetId: this.webviewTargetId,\n webviewName: this.webviewName,\n webviewParams: this.getParams(botContext),\n }\n const { action, ...eventArgs } = eventWebviewActionTriggered\n await trackEvent(botContext, action, eventArgs)\n }\n\n async processContent(): Promise<void> {\n return\n }\n}\n"],"names":["EventAction","getCommonFlowContentEventArgsForContentId","trackEvent","getFlowBuilderPlugin","ContentFieldsBase","FlowWebview","component","newWebview","botContext","flowBuilderPlugin","cmsApi","params","Date","exitSuccessContentID","Object","key","value","webviewSuccessExit","exit","exitSuccessId","undefined","exitNode","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","eventWebviewActionTriggered","action","eventArgs"],"mappings":";;;;;;;;;AAIsB;AAMF;AACmD;AACd;AAOlD,MAAMK,WAAWA,SAASD,iBAAiBA;IAOhD,OAAO,eAAeE,SAAwB,EAAe;QAC3D,MAAMC,aAAa,IAAIF,WAAWA,CAACC,UAAU,EAAE;QAC/CC,WAAW,eAAe,GAAGD,UAAU,OAAO,CAAC,iBAAiB;QAChEC,WAAW,WAAW,GAAGD,UAAU,OAAO,CAAC,YAAY;QACvDC,WAAW,oBAAoB,GAAGD,UAAU,OAAO,CAAC,sBAAsB;QAC1EC,WAAW,aAAa,GAAGD,UAAU,OAAO,CAAC,cAAc,IAAI,CAAC;QAChEC,WAAW,KAAK,GAAGD,UAAU,OAAO,CAAC,KAAK;QAC1CC,WAAW,QAAQ,GAAGD,UAAU,SAAS;QAEzC,OAAOC;IACT;IAEA,UAAUC,UAAsB,EAA0B;QACxD,MAAMC,oBAAoBN,oBAAoBA,CAACK,WAAW,OAAO;QACjE,MAAME,SAASD,kBAAkB,MAAM;QAEvC,MAAME,SAAiC;YACrC,WAAW,IAAI,CAAC,eAAe;YAC/B,GAAGC,KAAK,GAAG,GAAG,QAAQ;YACtB,GAAG,IAAI,CAAC,wBAAwB,CAACJ,WAAW;QAC9C;QACA,MAAMK,uBAAuB,IAAI,CAAC,uBAAuB,CAACH;QAE1D,IAAIG,sBAAsB;YACxBF,OAAO,oBAAoB,GAAGE;QAChC;QACA,OAAOF;IACT;IAEQ,yBACNH,UAAsB,EACE;QACxB,OAAOM,OAAO,WAAW,CACvBA,OAAO,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,CAACC,KAAKC,MAAM,GAAK;gBACvDD;gBACA,IAAI,CAAC,gBAAgB,CAACC,OAAOR;aAC9B;IAEL;IAEQ,wBAAwBE,MAAsB,EAAsB;QAC1E,MAAMO,qBAAqB,IAAI,CAAC,KAAK,EAAE,KAAKC,CAAAA,OAAQA,KAAK,IAAI,KAAK;QAClE,MAAMC,gBAAgBF,oBAAoB,QAAQ;QAClD,IAAI,CAACE,eAAe;YAClB,OAAOC;QACT;QACA,MAAMC,WAAWX,OAAO,WAAW,CAAoBS;QAEvD,OAAOE,SAAS,IAAI;IACtB;IAEA,MAAM,UAAUb,UAAsB,EAAiB;QACrD,MAAM,EAAEc,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrEzB,yCAAyCA,CAACO,YAAY,IAAI,CAAC,EAAE;QAE/D,MAAMmB,8BAA2D;YAC/D,QAAQ3B,kCAAkC;YAC1CsB;YACAC;YACAC;YACAC;YACAC;YACA,sBAAsB;YACtB,iBAAiB,IAAI,CAAC,eAAe;YACrC,aAAa,IAAI,CAAC,WAAW;YAC7B,eAAe,IAAI,CAAC,SAAS,CAAClB;QAChC;QACA,MAAM,EAAEoB,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMzB,UAAUA,CAACM,YAAYoB,QAAQC;IACvC;IAEA,MAAM,iBAAgC;QACpC;IACF;;QAhFK,qBACE,kBAA0B,SAC1B,cAAsB,SACtB,uBAA+B,SAC/B,gBAAwC,CAAC,QACzC,QAA0B,EAAE;;AA4ErC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-whatsapp-cta-url-button.js","sources":["../../../src/content-fields/flow-whatsapp-cta-url-button.tsx"],"sourcesContent":["import { type BotContext, isWhatsapp } from '@botonic/core'\nimport {\n Button,\n Text,\n WhatsappCTAUrlButton,\n WhatsappCTAUrlHeaderType,\n} from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { trackOneContent } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowButton } from './flow-button'\nimport type { HtUrlNode, HtWhatsappCTAUrlButtonNode } from './hubtype-fields'\n\nexport class FlowWhatsappCtaUrlButtonNode extends ContentFieldsBase {\n public text = ''\n public header?: string\n public headerType?: WhatsappCTAUrlHeaderType\n public headerImage?: string\n public headerVideo?: string\n public headerDocument?: string\n public footer?: string\n public displayText = ''\n public url: string = ''\n\n static fromHubtypeCMS(\n component: HtWhatsappCTAUrlButtonNode,\n locale: string,\n cmsApi: FlowBuilderApi,\n botContext: BotContext\n ): FlowWhatsappCtaUrlButtonNode {\n const whatsappCtaUrlButton = new FlowWhatsappCtaUrlButtonNode(component.id)\n whatsappCtaUrlButton.code = component.code\n whatsappCtaUrlButton.text = FlowWhatsappCtaUrlButtonNode.getTextByLocale(\n locale,\n component.content.text\n )\n FlowWhatsappCtaUrlButtonNode.setHeader(\n whatsappCtaUrlButton,\n component,\n locale\n )\n whatsappCtaUrlButton.footer = FlowWhatsappCtaUrlButtonNode.getTextByLocale(\n locale,\n component.content.footer\n )\n const button = FlowButton.fromHubtypeCMS(\n component.content.button,\n locale,\n cmsApi,\n botContext\n )\n whatsappCtaUrlButton.displayText = button.text\n const urlId = FlowButton.getUrlId(component.content.button, locale)\n if (urlId) {\n const urlNode = cmsApi.getNodeById<HtUrlNode>(urlId)\n whatsappCtaUrlButton.url = urlNode.content.url\n }\n whatsappCtaUrlButton.followUp = component.follow_up\n\n return whatsappCtaUrlButton\n }\n\n private static setHeader(\n whatsappCtaUrlButton: FlowWhatsappCtaUrlButtonNode,\n component: HtWhatsappCTAUrlButtonNode,\n locale: string\n ) {\n // If header is set, set header_type to text, this is need to be compatible with the old version of the component\n if (component.content.header.length > 0) {\n component.content.header_type = WhatsappCTAUrlHeaderType.Text\n }\n\n whatsappCtaUrlButton.headerType = component.content\n .header_type as WhatsappCTAUrlHeaderType\n\n if (component.content.header_type === WhatsappCTAUrlHeaderType.Text) {\n whatsappCtaUrlButton.header =\n FlowWhatsappCtaUrlButtonNode.getTextByLocale(\n locale,\n component.content.header\n )\n }\n\n if (\n component.content.header_type === WhatsappCTAUrlHeaderType.Image &&\n component.content.header_image\n ) {\n whatsappCtaUrlButton.headerImage =\n FlowWhatsappCtaUrlButtonNode.getAssetByLocale(\n locale,\n component.content.header_image\n )\n }\n\n if (\n component.content.header_type === WhatsappCTAUrlHeaderType.Video &&\n component.content.header_video\n ) {\n whatsappCtaUrlButton.headerVideo =\n FlowWhatsappCtaUrlButtonNode.getAssetByLocale(\n locale,\n component.content.header_video\n )\n }\n\n if (\n component.content.header_type === WhatsappCTAUrlHeaderType.Document &&\n component.content.header_document\n ) {\n whatsappCtaUrlButton.headerDocument =\n FlowWhatsappCtaUrlButtonNode.getAssetByLocale(\n locale,\n component.content.header_document\n )\n }\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const replacedText = this.replaceVariables(this.text, botContext)\n\n if (!isWhatsapp(botContext.session)) {\n return (\n <Text>\n {replacedText}\n <Button url={this.url}>{this.displayText}</Button>\n </Text>\n )\n }\n\n if (\n this.headerType === WhatsappCTAUrlHeaderType.Image &&\n this.headerImage\n ) {\n return (\n <WhatsappCTAUrlButton\n key={this.id}\n body={replacedText}\n headerType={this.headerType}\n headerImage={this.headerImage}\n footer={this.footer}\n displayText={this.displayText}\n url={this.url}\n />\n )\n }\n\n if (\n this.headerType === WhatsappCTAUrlHeaderType.Video &&\n this.headerVideo\n ) {\n return (\n <WhatsappCTAUrlButton\n key={this.id}\n body={replacedText}\n headerType={this.headerType}\n headerVideo={this.headerVideo}\n footer={this.footer}\n displayText={this.displayText}\n url={this.url}\n />\n )\n }\n\n if (\n this.headerType === WhatsappCTAUrlHeaderType.Document &&\n this.headerDocument\n ) {\n return (\n <WhatsappCTAUrlButton\n key={this.id}\n body={replacedText}\n headerType={this.headerType}\n headerDocument={this.headerDocument}\n footer={this.footer}\n displayText={this.displayText}\n url={this.url}\n />\n )\n }\n\n if (this.headerType === WhatsappCTAUrlHeaderType.Text && this.header) {\n return (\n <WhatsappCTAUrlButton\n key={this.id}\n body={replacedText}\n header={this.header}\n headerType={this.headerType}\n footer={this.footer}\n displayText={this.displayText}\n url={this.url}\n />\n )\n }\n\n return (\n <WhatsappCTAUrlButton\n key={this.id}\n body={replacedText}\n footer={this.footer}\n displayText={this.displayText}\n url={this.url}\n />\n )\n }\n}\n"],"names":["isWhatsapp","Button","Text","WhatsappCTAUrlButton","WhatsappCTAUrlHeaderType","trackOneContent","ContentFieldsBase","FlowButton","FlowWhatsappCtaUrlButtonNode","component","locale","cmsApi","botContext","whatsappCtaUrlButton","button","urlId","urlNode","replacedText"],"mappings":";;;;;;;;;;;;;;AAA2D;AAMpC;AAGsB;AACY;AACf;AAGnC,MAAMQ,4BAA4BA,SAASF,iBAAiBA;IAWjE,OAAO,eACLG,SAAqC,EACrCC,MAAc,EACdC,MAAsB,EACtBC,UAAsB,EACQ;QAC9B,MAAMC,uBAAuB,IAAIL,4BAA4BA,CAACC,UAAU,EAAE;QAC1EI,qBAAqB,IAAI,GAAGJ,UAAU,IAAI;QAC1CI,qBAAqB,IAAI,GAAGL,4BAA4BA,CAAC,eAAe,CACtEE,QACAD,UAAU,OAAO,CAAC,IAAI;QAExBD,4BAA4BA,CAAC,SAAS,CACpCK,sBACAJ,WACAC;QAEFG,qBAAqB,MAAM,GAAGL,4BAA4BA,CAAC,eAAe,CACxEE,QACAD,UAAU,OAAO,CAAC,MAAM;QAE1B,MAAMK,SAASP,yBAAyB,CACtCE,UAAU,OAAO,CAAC,MAAM,EACxBC,QACAC,QACAC;Q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ACN,YAAY,IAAI,CAAC,UAAU;gBAC3B,gBAAgB,IAAI,CAAC,cAAc;gBACnC,QAAQ,IAAI,CAAC,MAAM;gBACnB,aAAa,IAAI,CAAC,WAAW;gBAC7B,KAAK,IAAI,CAAC,GAAG;eANR,IAAI,CAAC,EAAE;QASlB;QAEA,IAAI,IAAI,CAAC,UAAU,KAAKb,6BAA6B,IAAI,IAAI,CAAC,MAAM,EAAE;YACpE,qBACE,IAACD,oBAAoBA;gBAEnB,MAAMc;gBACN,QAAQ,IAAI,CAAC,MAAM;gBACnB,YAAY,IAAI,CAAC,UAAU;gBAC3B,QAAQ,IAAI,CAAC,MAAM;gBACnB,aAAa,IAAI,CAAC,WAAW;gBAC7B,KAAK,IAAI,CAAC,GAAG;eANR,IAAI,CAAC,EAAE;QASlB;QAEA,qBACE,IAACd,oBAAoBA;YAEnB,MAAMc;YACN,QAAQ,IAAI,CAAC,MAAM;YACnB,aAAa,IAAI,CAAC,WAAW;YAC7B,KAAK,IAAI,CAAC,GAAG;WAJR,IAAI,CAAC,EAAE;IAOlB;;QAxMK,qBACE,OAAO,SAOP,cAAc,SACd,MAAc;;AAgMvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-whatsapp-request-contact-info.js","sources":["../../../src/content-fields/flow-whatsapp-request-contact-info.tsx"],"sourcesContent":["import { type BotContext, isWhatsapp } from '@botonic/core'\nimport { Text, WhatsappRequestContactInfo } from '@botonic/react'\n\nimport { trackOneContent } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtWhatsappRequestContactInfoNode } from './hubtype-fields'\n\nexport class FlowWhatsappRequestContactInfoNode extends ContentFieldsBase {\n public text = ''\n\n static fromHubtypeCMS(\n component: HtWhatsappRequestContactInfoNode,\n locale: string\n ): FlowWhatsappRequestContactInfoNode {\n const requestContactInfo = new FlowWhatsappRequestContactInfoNode(\n component.id\n )\n requestContactInfo.code = component.code\n requestContactInfo.text =\n FlowWhatsappRequestContactInfoNode.getTextByLocale(\n locale,\n component.content.text\n )\n requestContactInfo.followUp = component.follow_up\n\n return requestContactInfo\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const replacedText = this.replaceVariables(this.text, botContext)\n\n if (!isWhatsapp(botContext.session)) {\n return <Text>{replacedText}</Text>\n }\n\n return <WhatsappRequestContactInfo key={this.id} body={replacedText} />\n }\n}\n"],"names":["isWhatsapp","Text","WhatsappRequestContactInfo","trackOneContent","ContentFieldsBase","FlowWhatsappRequestContactInfoNode","component","locale","requestContactInfo","botContext","replacedText"],"mappings":";;;;;;;;;;;;AAA2D;AACM;AAEpB;AACY;AAGlD,MAAMK,kCAAkCA,SAASD,iBAAiBA;IAGvE,OAAO,eACLE,SAA2C,EAC3CC,MAAc,EACsB;QACpC,MAAMC,qBAAqB,IAAIH,kCAAkCA,CAC/DC,UAAU,EAAE;QAEdE,mBAAmB,IAAI,GAAGF,UAAU,IAAI;QACxCE,mBAAmB,IAAI,GACrBH,kCAAkCA,CAAC,eAAe,CAChDE,QACAD,UAAU,OAAO,CAAC,IAAI;QAE1BE,mBAAmB,QAAQ,GAAGF,UAAU,SAAS;QAEjD,OAAOE;IACT;IAEA,MAAM,UAAUC,UAAsB,EAAiB;QACrD,MAAMN,eAAeA,CAACM,YAAY,IAAI;IACxC;IAEA,MAAM,eAAeA,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,UAAUA,UAAsB,EAAe;QAC7C,MAAMC,eAAe,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAED;QAEtD,IAAI,CAACT,UAAUA,CAACS,WAAW,OAAO,GAAG;YACnC,qBAAO,IAACR,IAAIA;0BAAES;;QAChB;QAEA,qBAAO,IAACR,0BAA0BA;YAAe,MAAMQ;WAAf,IAAI,CAAC,EAAE;IACjD;;QAvCK,qBACE,OAAO;;AAuChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-whatsapp-template.js","sources":["../../../src/content-fields/flow-whatsapp-template.tsx"],"sourcesContent":["import { type BotContext, isWhatsapp } from '@botonic/core'\nimport {\n Text,\n WhatsAppTemplateButtonSubType,\n WhatsAppTemplateComponentType,\n WhatsAppTemplateParameterType,\n WhatsappTemplate,\n type WhatsappTemplateButton,\n type WhatsappTemplateComponentBody,\n type WhatsappTemplateComponentButtons,\n type WhatsappTemplateComponentHeader,\n type WhatsappTemplateFlowAction,\n type WhatsappTemplateFlowButton,\n type WhatsappTemplatePhoneNumberButton,\n type WhatsappTemplateQuickReplyButton,\n type WhatsappTemplateRequestContactInfoButton,\n type WhatsappTemplateUrlButton,\n type WhatsappTemplateVoiceCallButton,\n} from '@botonic/react'\n\nimport { trackOneContent } from '../tracking'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { ContentFieldsBase } from './content-fields-base'\nimport {\n type HtButton,\n type HtFlowButtonActionValue,\n type HtMediaFileLocale,\n type HtWhatsAppTemplate,\n type HtWhatsAppTemplateButtonsComponent,\n HtWhatsAppTemplateFlowActionType,\n type HtWhatsAppTemplateHeaderComponent,\n type HtWhatsappTemplateContentByLocale,\n type HtWhatsappTemplateNode,\n} from './hubtype-fields'\n\ninterface HeaderVariables {\n type: WhatsAppTemplateParameterType\n text?: Record<string, string>\n media?: HtMediaFileLocale[]\n}\n\nexport class FlowWhatsappTemplate extends ContentFieldsBase {\n public htWhatsappTemplate: HtWhatsAppTemplate\n public variableValues: Record<string, string> = {}\n public headerVariables?: HeaderVariables\n public buttons?: HtButton[]\n public urlVariableValues?: Record<string, string>\n public flowButtonActionValues?: Record<string, HtFlowButtonActionValue>\n\n static fromHubtypeCMS(\n component: HtWhatsappTemplateNode,\n currentLocale: string\n ): FlowWhatsappTemplate {\n const whatsappTemplate = new FlowWhatsappTemplate(component.id)\n whatsappTemplate.code = component.code\n whatsappTemplate.buttons = component.content.buttons\n const contentByLocale = FlowWhatsappTemplate.getContentByLocale(\n component,\n currentLocale\n )\n\n if (!contentByLocale.template) {\n throw new Error(\n `Whatsapp template not configured for locale: ${currentLocale}`\n )\n }\n\n whatsappTemplate.htWhatsappTemplate = contentByLocale.template\n whatsappTemplate.headerVariables = contentByLocale.header_variables\n whatsappTemplate.variableValues = contentByLocale.variable_values || {}\n whatsappTemplate.urlVariableValues = contentByLocale.url_variable_values\n whatsappTemplate.flowButtonActionValues =\n contentByLocale.flow_button_action_values\n\n whatsappTemplate.followUp = component.follow_up\n\n return whatsappTemplate\n }\n\n private static getContentByLocale(\n component: HtWhatsappTemplateNode,\n currentLocale: string\n ) {\n const content: HtWhatsappTemplateContentByLocale | undefined =\n component.content.by_locale[currentLocale]\n if (!content) {\n throw new Error(\n `Whatsapp template content not found for locale: ${currentLocale}`\n )\n }\n return content\n }\n\n private getHeaderComponent(\n whatsappTemplate: HtWhatsAppTemplate,\n headerVariables: HeaderVariables,\n locale: string,\n botContext: BotContext\n ): WhatsappTemplateComponentHeader | undefined {\n const headerComponent = whatsappTemplate.components.find(\n component => component.type === WhatsAppTemplateComponentType.HEADER\n ) as HtWhatsAppTemplateHeaderComponent | undefined\n\n if (\n headerComponent &&\n headerComponent.format === WhatsAppTemplateParameterType.TEXT\n ) {\n return this.createHeaderTextComponent(headerVariables, botContext)\n }\n\n if (\n headerComponent &&\n headerComponent.format === WhatsAppTemplateParameterType.IMAGE\n ) {\n return this.createHeaderImageComponent(headerVariables, locale)\n }\n\n if (\n headerComponent &&\n headerComponent.format === WhatsAppTemplateParameterType.VIDEO\n ) {\n return this.createHeaderVideoComponent(headerVariables, locale)\n }\n\n return undefined\n }\n\n private createHeaderTextComponent(\n headerVariables: HeaderVariables,\n botContext: BotContext\n ): WhatsappTemplateComponentHeader {\n return {\n type: WhatsAppTemplateComponentType.HEADER,\n parameters: Object.values(headerVariables.text || {}).map(value => {\n const valueVariable = this.replaceVariables(value, botContext)\n return {\n type: WhatsAppTemplateParameterType.TEXT,\n text: valueVariable,\n }\n }),\n }\n }\n\n private createHeaderImageComponent(\n headerVariables: HeaderVariables,\n locale: string\n ): WhatsappTemplateComponentHeader {\n return {\n type: WhatsAppTemplateComponentType.HEADER,\n parameters: [\n {\n type: WhatsAppTemplateParameterType.IMAGE,\n image: {\n link:\n headerVariables.media?.find(m => m.locale === locale)?.file || '',\n },\n },\n ],\n }\n }\n\n private createHeaderVideoComponent(\n headerVariables: HeaderVariables,\n locale: string\n ): WhatsappTemplateComponentHeader {\n return {\n type: WhatsAppTemplateComponentType.HEADER,\n parameters: [\n {\n type: WhatsAppTemplateParameterType.VIDEO,\n video: {\n link:\n headerVariables.media?.find(m => m.locale === locale)?.file || '',\n },\n },\n ],\n }\n }\n\n // TODO: To use named variables (contact_info_fields) we need to take it from botContext.session.user.contact_info, this only be able in toBotonic method\n private getBodyComponent(\n variableValues: Record<string, string>,\n botContext: BotContext\n ): WhatsappTemplateComponentBody {\n return {\n type: WhatsAppTemplateComponentType.BODY,\n parameters: Object.entries(variableValues).map(([key, value]) => {\n const valueVariable = this.replaceVariables(value, botContext)\n return {\n type: WhatsAppTemplateParameterType.TEXT,\n parameter_name: key,\n text: valueVariable,\n }\n }),\n }\n }\n\n private getButtons(\n whatsappTemplate: HtWhatsAppTemplate,\n buttonNodes: HtButton[],\n urlVariableValues: Record<string, string>,\n flowButtonActionValues: Record<string, HtFlowButtonActionValue>,\n botContext: BotContext\n ): WhatsappTemplateComponentButtons | undefined {\n const htWhatsappTemplateButtons = whatsappTemplate.components.find(\n component => component.type === WhatsAppTemplateComponentType.BUTTONS\n ) as HtWhatsAppTemplateButtonsComponent | undefined\n\n if (!htWhatsappTemplateButtons) {\n return undefined\n }\n\n const buttons = htWhatsappTemplateButtons.buttons\n .map((button, index) =>\n this.mapTemplateButton(\n button,\n index,\n whatsappTemplate.name,\n buttonNodes,\n urlVariableValues,\n flowButtonActionValues,\n botContext\n )\n )\n .filter(button => button !== null)\n\n return {\n type: WhatsAppTemplateComponentType.BUTTONS,\n buttons: buttons as WhatsappTemplateButton[],\n }\n }\n\n private mapTemplateButton(\n button: HtWhatsAppTemplateButtonsComponent['buttons'][number],\n index: number,\n templateName: string,\n buttonNodes: HtButton[],\n urlVariableValues: Record<string, string>,\n flowButtonActionValues: Record<string, HtFlowButtonActionValue>,\n botContext: BotContext\n ): WhatsappTemplateButton | null {\n if (button.type === WhatsAppTemplateButtonSubType.URL) {\n const urlParam: string | undefined = urlVariableValues?.[String(index)]\n if (!urlParam) {\n return null\n }\n return this.createUrlButtonComponent(index, urlParam, botContext)\n }\n\n if (button.type === WhatsAppTemplateButtonSubType.QUICK_REPLY) {\n const payload = buttonNodes[index].target?.id || ''\n return this.createQuickReplyButtonComponent(index, payload)\n }\n\n if (button.type === WhatsAppTemplateButtonSubType.PHONE_NUMBER) {\n return this.createPhoneNumberButtonComponent(index)\n }\n\n if (button.type === WhatsAppTemplateButtonSubType.VOICE_CALL) {\n return this.createVoiceCallButtonComponent(index)\n }\n\n if (button.type === WhatsAppTemplateButtonSubType.REQUEST_CONTACT_INFO) {\n return this.createRequestContactInfoButtonComponent(index)\n }\n\n if (button.type === WhatsAppTemplateButtonSubType.FLOW) {\n const actionValue = flowButtonActionValues?.[String(index)]\n if (!actionValue) {\n throw new Error(\n `WhatsApp template '${templateName}' FLOW button at index ${index} requires flow_button_action_values`\n )\n }\n return this.createFlowButtonComponent(\n index,\n button,\n actionValue,\n botContext,\n templateName\n )\n }\n\n throw new Error(\n `WhatsApp template '${templateName}' has unsupported button at index ${index}`\n )\n }\n\n private createUrlButtonComponent(\n index: number,\n urlParam: string,\n botContext: BotContext\n ): WhatsappTemplateUrlButton {\n const variableUrlParam = this.replaceVariables(urlParam, botContext)\n return {\n type: WhatsAppTemplateComponentType.BUTTON,\n sub_type: WhatsAppTemplateButtonSubType.URL,\n index: index,\n parameters: urlParam\n ? [\n {\n type: WhatsAppTemplateParameterType.TEXT,\n text: variableUrlParam,\n },\n ]\n : [],\n }\n }\n\n private createQuickReplyButtonComponent(\n index: number,\n payload: string\n ): WhatsappTemplateQuickReplyButton {\n return {\n type: WhatsAppTemplateComponentType.BUTTON,\n sub_type: WhatsAppTemplateButtonSubType.QUICK_REPLY,\n index: index,\n parameters: [\n {\n type: WhatsAppTemplateParameterType.PAYLOAD,\n payload: payload,\n },\n ],\n }\n }\n\n private createVoiceCallButtonComponent(\n index: number\n ): WhatsappTemplateVoiceCallButton {\n return {\n type: WhatsAppTemplateComponentType.BUTTON,\n sub_type: WhatsAppTemplateButtonSubType.VOICE_CALL,\n index: index,\n parameters: [],\n }\n }\n\n private createPhoneNumberButtonComponent(\n index: number\n ): WhatsappTemplatePhoneNumberButton {\n return {\n type: WhatsAppTemplateComponentType.BUTTON,\n sub_type: WhatsAppTemplateButtonSubType.PHONE_NUMBER,\n index: index,\n parameters: [],\n }\n }\n\n private createRequestContactInfoButtonComponent(\n index: number\n ): WhatsappTemplateRequestContactInfoButton {\n return {\n type: WhatsAppTemplateComponentType.BUTTON,\n sub_type: WhatsAppTemplateButtonSubType.REQUEST_CONTACT_INFO,\n index: index,\n parameters: [],\n }\n }\n\n private resolveFlowActionData(\n flowActionData: Record<string, string> | undefined,\n botContext: BotContext\n ): Record<string, string> | undefined {\n if (!flowActionData) {\n return undefined\n }\n\n const resolvedData = Object.fromEntries(\n Object.entries(flowActionData).map(([key, value]) => [\n key,\n this.replaceVariables(value, botContext),\n ])\n )\n\n return Object.keys(resolvedData).length > 0 ? resolvedData : undefined\n }\n\n private createFlowButtonComponent(\n index: number,\n templateButton: Extract<\n HtWhatsAppTemplateButtonsComponent['buttons'][number],\n { type: WhatsAppTemplateButtonSubType.FLOW }\n >,\n actionValue: HtFlowButtonActionValue,\n botContext: BotContext,\n templateName: string\n ): WhatsappTemplateFlowButton {\n const flowToken = this.replaceVariables(actionValue.flow_token, botContext)\n if (!flowToken.trim()) {\n throw new Error(\n `WhatsApp template '${templateName}' FLOW button at index ${index} requires a non-empty flow_token`\n )\n }\n\n const action: WhatsappTemplateFlowAction = {\n flow_token: flowToken,\n }\n\n if (\n templateButton.flow_action !==\n HtWhatsAppTemplateFlowActionType.DATA_EXCHANGE\n ) {\n const flowActionData = this.resolveFlowActionData(\n actionValue.flow_action_data,\n botContext\n )\n if (flowActionData) {\n action.flow_action_data = flowActionData\n }\n }\n\n return {\n type: WhatsAppTemplateComponentType.BUTTON,\n sub_type: WhatsAppTemplateButtonSubType.FLOW,\n index: String(index),\n parameters: [\n {\n type: WhatsAppTemplateParameterType.ACTION,\n action,\n },\n ],\n }\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const templateName = this.htWhatsappTemplate.name\n const templateLanguage = this.htWhatsappTemplate.language\n const body = this.getBodyComponent(this.variableValues, botContext)\n const pluginFlowBuilder = getFlowBuilderPlugin(botContext.plugins)\n const resolvedLocale = pluginFlowBuilder.cmsApi.getResolvedLocale()\n\n const header = this.getHeaderComponent(\n this.htWhatsappTemplate,\n this.headerVariables || ({} as HeaderVariables),\n resolvedLocale,\n botContext\n )\n const buttons = this.getButtons(\n this.htWhatsappTemplate,\n this.buttons || [],\n this.urlVariableValues || {},\n this.flowButtonActionValues || {},\n botContext\n )\n\n if (isWhatsapp(botContext.session)) {\n return (\n <WhatsappTemplate\n key={this.id}\n name={templateName}\n language={templateLanguage}\n header={header}\n body={body}\n buttons={buttons}\n />\n )\n }\n\n return (\n <Text key={this.id}>\n {`WhatsApp Template: ${templateName} (${templateLanguage})`}\n {header && `${JSON.stringify(header, null, 2)}`}\n {body && `${JSON.stringify(body, null, 2)}`}\n {buttons && `${JSON.stringify(buttons, null, 2)}`}\n </Text>\n )\n }\n}\n"],"names":["isWhatsapp","Text","WhatsAppTemplateButtonSubType","WhatsAppTemplateComponentType","WhatsAppTemplateParameterType","WhatsappTemplate","trackOneContent","getFlowBuilderPlugin","ContentFieldsBase","HtWhatsAppTemplateFlowActionType","FlowWhatsappTemplate","component","currentLocale","whatsappTemplate","contentByLocale","Error","content","headerVariables","locale","botContext","headerComponent","undefined","Object","value","valueVariable","m","variableValues","key","buttonNodes","urlVariableValues","flowButtonActionValues","htWhatsappTemplateButtons","buttons","button","index","templateName","urlParam","String","payload","actionValue","variableUrlParam","flowActionData","resolvedData","templateButton","flowToken","action","templateLanguage","body","pluginFlowBuilder","resolvedLocale","header","JSON"],"mappings":";;;;;;;;;;;;;;;;AAA2D;AAkBpC;AAEsB;AAC0B;AACd;AAWhC;AAQlB,MAAMU,oBAAoBA,SAASF,iBAAiBA;IAQzD,OAAO,eACLG,SAAiC,EACjCC,aAAqB,EACC;QACtB,MAAMC,mBAAmB,IAAIH,oBAAoBA,CAACC,UAAU,EAAE;QAC9DE,iBAAiB,IAAI,GAAGF,UAAU,IAAI;QACtCE,iBAAiB,OAAO,GAAGF,UAAU,OAAO,CAAC,OAAO;QACpD,MAAMG,kBAAkBJ,oBAAoBA,CAAC,kBAAkB,CAC7DC,WACAC;QAGF,IAAI,CAACE,gBAAgB,QAAQ,EAAE;YAC7B,MAAM,IAAIC,MACR,CAAC,6CAA6C,EAAEH,eAAe;QAEnE;QAEAC,iBAAiB,kBAAkB,GAAGC,gBAAgB,QAAQ;QAC9DD,iBAAiB,eAAe,GAAGC,gBAAgB,gBAAgB;QACnED,iBAAiB,cAAc,GAAGC,gBAAgB,eAAe,IAAI,CAAC;QACtED,iBAAiB,iBAAiB,GAAGC,gBAAgB,mBAAmB;QACxED,iBAAiB,sBAAsB,GACrCC,gBAAgB,yBAAyB;QAE3CD,iBAAiB,QAAQ,GAAGF,UAAU,SAAS;QAE/C,OAAOE;IACT;I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;YAClC,qBACE,IAACd,gBAAgBA;gBAEf,MAAM8B;gBACN,UAAUW;gBACV,QAAQI;gBACR,MAAMH;gBACN,SAASf;eALJ,IAAI,CAAC,EAAE;QAQlB;QAEA,qBACE,KAAC/B,IAAIA;;gBACF,CAAC,mBAAmB,EAAEkC,aAAa,EAAE,EAAEW,iBAAiB,CAAC,CAAC;gBAC1DI,UAAU,GAAGC,KAAK,SAAS,CAACD,QAAQ,MAAM,IAAI;gBAC9CH,QAAQ,GAAGI,KAAK,SAAS,CAACJ,MAAM,MAAM,IAAI;gBAC1Cf,WAAW,GAAGmB,KAAK,SAAS,CAACnB,SAAS,MAAM,IAAI;;WAJxC,IAAI,CAAC,EAAE;IAOtB;;QAlbK,qBAEE,iBAAyC,CAAC;;AAibnD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/ai-agent-router.js","sources":["../../../../src/content-fields/hubtype-fields/ai-agent-router.ts"],"sourcesContent":["import type { VerbosityLevel } from '@botonic/core'\nimport type { HtInputGuardrailRule } from './ai-agent'\nimport type { HtBaseNode, HtNodeLink } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtAiAgentSpecialistNode {\n id: string\n target: HtNodeLink\n name?: string\n description?: string\n}\n\nexport interface HtAiAgentRouterNode extends HtBaseNode {\n type: HtNodeWithContentType.AI_AGENT_ROUTER\n content: {\n name: string\n instructions: string\n model: string\n verbosity: VerbosityLevel\n available_specialists: HtAiAgentSpecialistNode[]\n input_guardrail_rules?: HtInputGuardrailRule[]\n }\n}\n"],"names":[],"mappings":"AAsBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/ai-agent.js","sources":["../../../../src/content-fields/hubtype-fields/ai-agent.ts"],"sourcesContent":["import type { VerbosityLevel } from '@botonic/core'\nimport type { HtBaseNode } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtInputGuardrailRule {\n name: string\n description: string\n is_active: boolean\n}\n\nexport interface HtAiAgentNode extends HtBaseNode {\n type: HtNodeWithContentType.AI_AGENT\n content: {\n name: string\n instructions: string\n model: string\n verbosity: VerbosityLevel\n active_tools?: { name: string }[]\n input_guardrail_rules?: HtInputGuardrailRule[]\n sources?: { id: string; name: string }[]\n }\n}\n"],"names":[],"mappings":"AAqBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/bot-action.js","sources":["../../../../src/content-fields/hubtype-fields/bot-action.ts"],"sourcesContent":["import type { HtBaseNode } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtBotActionNode extends HtBaseNode {\n id: string\n type: HtNodeWithContentType.BOT_ACTION\n content: {\n payload_id: string\n payload_params?: string\n }\n}\n"],"names":[],"mappings":"AAUC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/button.js","sources":["../../../../src/content-fields/hubtype-fields/button.ts"],"sourcesContent":["import type { HtNodeLink, HtTextLocale, HtUrlLocale } from './common'\n\nexport interface HtButton {\n id: string\n text: HtTextLocale[]\n url: HtUrlLocale[]\n target?: HtNodeLink\n hidden: string[]\n}\n"],"names":[],"mappings":"AAQC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/capture-user-input.js","sources":["../../../../src/content-fields/hubtype-fields/capture-user-input.ts"],"sourcesContent":["import type { HtBaseNode, HtNodeLink } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport enum HtAiValidationType {\n NONE = 'none',\n NAME = 'name',\n EMAIL = 'email',\n PHONE = 'phone',\n CUSTOM = 'custom',\n}\n\nexport interface HtCaptureUserInputNode extends HtBaseNode {\n type: HtNodeWithContentType.CAPTURE_USER_INPUT\n content: {\n field_name: string\n ai_validation_type?: HtAiValidationType\n ai_validation_instructions?: string\n capture_success: HtNodeLink\n capture_fail: HtNodeLink\n }\n}\n"],"names":["HtAiValidationType"],"mappings":"AAGO,IAAKA,qCAAkBA,0BAAlBA;;;;;;WAAAA;MAMX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/carousel.js","sources":["../../../../src/content-fields/hubtype-fields/carousel.ts"],"sourcesContent":["import type { HtButton } from './button'\nimport type { HtBaseNode, HtMediaFileLocale, HtTextLocale } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtCarouselElement {\n id: string\n title: HtTextLocale[]\n subtitle: HtTextLocale[]\n image: HtMediaFileLocale[]\n button: HtButton\n}\n\nexport interface HtCarouselNode extends HtBaseNode {\n type: HtNodeWithContentType.CAROUSEL\n content: {\n whatsapp_text: HtTextLocale[]\n elements: HtCarouselElement[]\n }\n}\n"],"names":[],"mappings":"AAkBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/channel-conditional.js","sources":["../../../../src/content-fields/hubtype-fields/channel-conditional.ts"],"sourcesContent":["import type { HtBaseNode } from './common'\nimport type { HtFunctionResult } from './function'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtChannelConditionalNode extends HtBaseNode {\n type: HtNodeWithContentType.FUNCTION\n content: {\n action: string //'get-channel-type'\n result_mapping: HtFunctionResult[]\n }\n}\n"],"names":[],"mappings":"AAUC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/common.js","sources":["../../../../src/content-fields/hubtype-fields/common.ts"],"sourcesContent":["import type {\n HtNodeWithContentType,\n HtNodeWithoutContentType,\n} from './node-types'\nimport type { HtNodeComponent } from './nodes'\n\nexport interface HtFlowBuilderData {\n version: string\n name: string\n locales: string[]\n default_locale_code: string\n start_node_id?: string\n ai_model_id?: string\n is_ai_agent_active?: boolean\n nodes: HtNodeComponent[]\n flows: HtFlows[]\n webviews: HtFlowWebview[]\n campaigns: HtCampaign[]\n bot_variable_definitions: HtBotVariableDefinition[]\n}\n\nexport interface HtFlows {\n id: string\n name: string\n start_node_id: string\n}\n\nexport interface HtFlowWebview {\n id: string\n name: string\n component_name: string\n}\n\nexport interface HtCampaign {\n id: string\n name: string\n start_node_id: string\n}\n\nexport interface HtBotVariableDefinition {\n key_path: string\n is_from_bot_config: boolean\n type?: string\n}\n\nexport interface HtNodeLink {\n id: string\n type: HtNodeWithContentType | HtNodeWithoutContentType\n}\n\nexport interface HtBaseNode {\n id: string\n code: string\n meta: {\n x: number\n y: number\n }\n follow_up?: HtNodeLink\n target?: HtNodeLink\n flow_id: string // TODO: Review if this field is necessary in all HtBaseNode\n is_meaningful?: boolean\n}\n\nexport interface HtTextLocale {\n message: string\n locale: string\n}\n\nexport interface HtMediaFileLocale {\n id: string\n file: string\n locale: string\n}\n\nexport interface HtVideoLocale {\n url: string\n is_embedded: boolean\n locale: string\n}\n\nexport interface HtQueueLocale {\n id: string\n name: string\n locale: string\n}\n\nexport interface HtInputLocale {\n values: string[]\n locale: string\n}\n\nexport interface HtUrlLocale {\n id: string\n locale: string\n}\n\nexport interface HtPayloadLocale {\n id: string\n locale: string\n}\n"],"names":[],"mappings":"AAmGC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/country-conditional.js","sources":["../../../../src/content-fields/hubtype-fields/country-conditional.ts"],"sourcesContent":["import type { HtBaseNode } from './common'\nimport type { HtFunctionResult } from './function'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtCountryConditionalNode extends HtBaseNode {\n type: HtNodeWithContentType.FUNCTION\n content: {\n action: string //'check-country'\n result_mapping: HtFunctionResult[]\n }\n}\n"],"names":[],"mappings":"AAUC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/custom-conditional-v2.js","sources":["../../../../src/content-fields/hubtype-fields/custom-conditional-v2.ts"],"sourcesContent":["import type { HtBaseNode, HtNodeLink } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport enum VariableFormat {\n Boolean = 'boolean',\n Number = 'number',\n String = 'string',\n}\n\nexport enum StringConditionOperator {\n Contains = 'contains',\n NotContains = 'notContains',\n EqualsTo = 'equalsTo',\n NotEqualsTo = 'notEqualsTo',\n StartsWith = 'startsWith',\n NotStartsWith = 'notStartsWith',\n EndsWith = 'endsWith',\n NotEndsWith = 'notEndsWith',\n}\n\nexport interface HtStringCondition {\n operator: StringConditionOperator\n value?: string\n target?: HtNodeLink\n}\n\nexport enum NumberConditionOperator {\n EqualsTo = 'equalsTo',\n NotEqualsTo = 'notEqualsTo',\n GreaterThan = 'greaterThan',\n LessThan = 'lessThan',\n GreaterThanOrEqualTo = 'greaterThanOrEqualTo',\n LessThanOrEqualTo = 'lessThanOrEqualTo',\n Between = 'between',\n NotBetween = 'notBetween',\n}\n\nexport interface HtNumberCondition {\n operator: NumberConditionOperator\n value?: number\n min?: number\n max?: number\n target?: HtNodeLink\n}\n\nexport enum BooleanConditionOperator {\n IsTruthy = 'isTruthy',\n}\n\nexport interface HtBooleanCondition {\n operator: BooleanConditionOperator\n target?: HtNodeLink\n}\n\nexport type HtCondition =\n | HtStringCondition\n | HtNumberCondition\n | HtBooleanCondition\n\nexport interface HtCustomConditionalV2Node extends HtBaseNode {\n type: HtNodeWithContentType.CUSTOM_CONDITION\n content: {\n type: VariableFormat\n key_path: string\n conditions: HtCondition[]\n default_target: HtNodeLink\n }\n}\n"],"names":["VariableFormat","StringConditionOperator","NumberConditionOperator","BooleanConditionOperator"],"mappings":"AAGO,IAAKA,oCAAcA,0BAAdA;;;;WAAAA;MAIX;AAEM,IAAKC,6CAAuBA,0BAAvBA;;;;;;;;;WAAAA;MASX;AAQM,IAAKC,6CAAuBA,0BAAvBA;;;;;;;;;WAAAA;MASX;AAUM,IAAKC,8CAAwBA,0BAAxBA;;WAAAA;MAEX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/custom-conditional.js","sources":["../../../../src/content-fields/hubtype-fields/custom-conditional.ts"],"sourcesContent":["import type { HtBaseNode } from './common'\nimport type { HtFunctionArguments, HtFunctionResult } from './function'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtCustomConditionalNode extends HtBaseNode {\n type: HtNodeWithContentType.FUNCTION\n content: {\n action: string //'check-bot-variable'\n arguments: HtFunctionArguments[]\n result_mapping: HtFunctionResult[]\n }\n}\n"],"names":[],"mappings":"AAWC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/fallback.js","sources":["../../../../src/content-fields/hubtype-fields/fallback.ts"],"sourcesContent":["import type { HtBaseNode, HtNodeLink } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtFallbackNode extends HtBaseNode {\n type: HtNodeWithContentType.FALLBACK\n content: {\n first_message?: HtNodeLink\n second_message?: HtNodeLink\n }\n}\n"],"names":[],"mappings":"AASC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/function.js","sources":["../../../../src/content-fields/hubtype-fields/function.ts"],"sourcesContent":["import type { HtBaseNode, HtNodeLink } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport enum HtArgumentType {\n BOOLEAN = 'boolean',\n NUMBER = 'number',\n STRING = 'string',\n JSON = 'json',\n}\n\nexport interface HtFunctionArgument {\n type: HtArgumentType\n name: string\n value: string\n}\n\nexport interface HtFunctionArgumentLocale {\n locale: string\n values: HtFunctionArgument[]\n}\n\nexport interface HtFunctionResult {\n result: string | boolean | number\n target?: HtNodeLink\n}\n\nexport type HtFunctionArguments = HtFunctionArgumentLocale | HtFunctionArgument\n\nexport interface HtFunctionNode extends HtBaseNode {\n type: HtNodeWithContentType.FUNCTION\n content: {\n action: string\n arguments: HtFunctionArguments[]\n result_mapping: HtFunctionResult[]\n }\n}\n"],"names":["HtArgumentType"],"mappings":"AAGO,IAAKA,uBAAcA,0BAAdA;;;;;WAAAA;MAKX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/go-to-flow.js","sources":["../../../../src/content-fields/hubtype-fields/go-to-flow.ts"],"sourcesContent":["import type { HtBaseNode } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtGoToFlow extends HtBaseNode {\n id: string\n type: HtNodeWithContentType.GO_TO_FLOW\n content: {\n flow_id: string\n }\n}\n"],"names":[],"mappings":"AASC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/handoff.js","sources":["../../../../src/content-fields/hubtype-fields/handoff.ts"],"sourcesContent":["import type { HtBaseNode, HtPayloadLocale, HtQueueLocale } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtHandoffNode extends HtBaseNode {\n type: HtNodeWithContentType.HANDOFF\n content: {\n queue: HtQueueLocale[]\n payload: HtPayloadLocale[]\n has_auto_assign: boolean\n has_queue_position_changed_notifications_enabled: boolean\n }\n}\n"],"names":[],"mappings":"AAWC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/image.js","sources":["../../../../src/content-fields/hubtype-fields/image.ts"],"sourcesContent":["import type { HtBaseNode, HtMediaFileLocale } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtImageNode extends HtBaseNode {\n type: HtNodeWithContentType.IMAGE\n content: {\n image: HtMediaFileLocale[]\n }\n}\n"],"names":[],"mappings":"AAQC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/index.js","sources":["../../../../src/content-fields/hubtype-fields/index.ts"],"sourcesContent":["export * from './ai-agent'\nexport * from './ai-agent-router'\nexport * from './bot-action'\nexport * from './button'\nexport * from './capture-user-input'\nexport * from './carousel'\nexport * from './common'\nexport * from './custom-conditional-v2'\nexport * from './fallback'\nexport * from './function'\nexport * from './go-to-flow'\nexport * from './handoff'\nexport * from './image'\nexport * from './keyword'\nexport * from './node-types'\nexport * from './nodes'\nexport * from './payload'\nexport * from './rating'\nexport * from './smart-intent'\nexport * from './text'\nexport * from './url'\nexport * from './video'\nexport * from './webview'\nexport * from './whatsapp-button-list'\nexport * from './whatsapp-cta-url-button'\nexport * from './whatsapp-request-contact-info'\nexport * from './whatsapp-template'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAA0B;AACO;AACL;AACJ;AACY;AACV;AACF;AACe;AACb;AACA;AACE;AACH;AACF;AACE;AACG;AACL;AACE;AACD;AACM;AACR;AACD;AACE;AACE;AACa;AACG;AACM;AACZ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/keyword.js","sources":["../../../../src/content-fields/hubtype-fields/keyword.ts"],"sourcesContent":["import type { HtBaseNode, HtInputLocale, HtTextLocale } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtKeywordNode extends HtBaseNode {\n type: HtNodeWithContentType.KEYWORD\n content: {\n title: HtTextLocale[]\n keywords: HtInputLocale[]\n }\n}\n"],"names":[],"mappings":"AASC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/node-types.js","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"sourcesContent":["export enum HtNodeWithContentType {\n CAROUSEL = 'carousel',\n HANDOFF = 'handoff',\n IMAGE = 'image',\n TEXT = 'text',\n KEYWORD = 'keyword',\n SMART_INTENT = 'smart-intent',\n FUNCTION = 'function',\n FALLBACK = 'fallback',\n VIDEO = 'video',\n WHATSAPP_BUTTON_LIST = 'whatsapp-button-list',\n WHATSAPP_CTA_URL_BUTTON = 'whatsapp-cta-url-button',\n WHATSAPP_REQUEST_CONTACT_INFO = 'whatsapp-request-contact-info',\n WHATSAPP_TEMPLATE = 'whatsapp-template',\n BOT_ACTION = 'bot-action',\n AI_AGENT = 'ai-agent',\n AI_AGENT_ROUTER = 'ai-agent-router',\n RATING = 'rating',\n WEBVIEW = 'webview',\n GO_TO_FLOW = 'go-to-flow',\n CAPTURE_USER_INPUT = 'capture-user-input',\n CUSTOM_CONDITION = 'custom-condition',\n}\n\nexport enum HtNodeWithoutContentType {\n URL = 'url',\n PAYLOAD = 'payload',\n}\n\nexport enum HtButtonStyle {\n BUTTON = 'button',\n QUICK_REPLY = 'quick-reply',\n}\n"],"names":["HtNodeWithContentType","HtNodeWithoutContentType","HtButtonStyle"],"mappings":"AAAO,IAAKA,gCAAqBA,0BAArBA;;;;;;;;;;;;;;;;;;;;;;WAAAA;MAsBX;AAEM,IAAKC,mCAAwBA,0BAAxBA;;;WAAAA;MAGX;AAEM,IAAKC,wBAAaA,0BAAbA;;;WAAAA;MAGX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/nodes.js","sources":["../../../../src/content-fields/hubtype-fields/nodes.ts"],"sourcesContent":["import type { HtAiAgentNode } from './ai-agent'\nimport type { HtAiAgentRouterNode } from './ai-agent-router'\nimport type { HtBotActionNode } from './bot-action'\nimport type { HtCaptureUserInputNode } from './capture-user-input'\nimport type { HtCarouselNode } from './carousel'\nimport type { HtCustomConditionalV2Node } from './custom-conditional-v2'\n// import { HtChannelConditionalNode } from './channel-conditional'\n// import { HtCountryConditionalNode } from './country-conditional'\n// import { HtCustomConditionalNode } from './custom-conditional'\nimport type { HtFallbackNode } from './fallback'\nimport type { HtFunctionNode } from './function'\nimport type { HtGoToFlow } from './go-to-flow'\nimport type { HtHandoffNode } from './handoff'\nimport type { HtImageNode } from './image'\nimport type { HtKeywordNode } from './keyword'\nimport type { HtPayloadNode } from './payload'\n// import { HtQueueStatusConditionalNode } from './queue-status-conditional'\nimport type { HtRatingNode } from './rating'\nimport type { HtSmartIntentNode } from './smart-intent'\nimport type { HtTextNode } from './text'\nimport type { HtUrlNode } from './url'\nimport type { HtVideoNode } from './video'\nimport type { HtWebviewNode } from './webview'\nimport type { HtWhatsappButtonListNode } from './whatsapp-button-list'\nimport type { HtWhatsappCTAUrlButtonNode } from './whatsapp-cta-url-button'\nimport type { HtWhatsappRequestContactInfoNode } from './whatsapp-request-contact-info'\nimport type { HtWhatsappTemplateNode } from './whatsapp-template'\n\nexport type HtNodeWithContent =\n | HtTextNode\n | HtImageNode\n | HtVideoNode\n | HtCarouselNode\n | HtHandoffNode\n | HtKeywordNode\n | HtFunctionNode\n | HtFallbackNode\n | HtWhatsappButtonListNode\n | HtWhatsappCTAUrlButtonNode\n | HtWhatsappRequestContactInfoNode\n | HtSmartIntentNode\n | HtBotActionNode\n | HtAiAgentNode\n | HtAiAgentRouterNode\n | HtRatingNode\n | HtWebviewNode\n | HtGoToFlow\n | HtWhatsappTemplateNode\n | HtCaptureUserInputNode\n | HtCustomConditionalV2Node\n// | HtChannelConditionalNode\n// | HtCountryConditionalNode\n// | HtCustomConditionalNode\n// | HtQueueStatusConditionalNode\n\nexport type HtNodeWithoutContent = HtUrlNode | HtPayloadNode\n\nexport type HtNodeComponent = HtNodeWithContent | HtNodeWithoutContent\n"],"names":[],"mappings":"AAyDsE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/payload.js","sources":["../../../../src/content-fields/hubtype-fields/payload.ts"],"sourcesContent":["import type { HtNodeWithoutContentType } from './node-types'\n\nexport interface HtPayloadNode {\n id: string\n type: HtNodeWithoutContentType.PAYLOAD\n content: {\n payload: string\n }\n}\n"],"names":[],"mappings":"AAQC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/queue-status-conditional.js","sources":["../../../../src/content-fields/hubtype-fields/queue-status-conditional.ts"],"sourcesContent":["import type { HtBaseNode, HtNodeLink } from './common'\nimport type { HtFunctionArguments, HtFunctionResult } from './function'\nimport type { HtNodeWithContentType } from './node-types'\n\n/* TODO: In the future, refactor the conditional nodes so they are not of type FUNCTION and can use type-hints for all exact arguments and results. */\n\n// interface HtQueueArgument {\n// locale: string\n// values: [\n// {\n// type: 'string'\n// name: 'queue_id'\n// value: string\n// },\n// {\n// type: 'string'\n// name: 'queue_name'\n// value: string\n// },\n// ]\n// }\n\n// interface HtCheckAvailableAgentsArgument {\n// type: 'boolean'\n// name: 'check_available_agents'\n// value: boolean\n// }\n\n// export interface HtQueueStatusConditionalArguments {\n// values: HtQueueArgument[] | HtCheckAvailableAgentsArgument[]\n// }\n\nexport type HtQueueStatusConditionalResultMapping = [\n {\n result: 'open'\n target: HtNodeLink\n },\n {\n result: 'closed'\n target: HtNodeLink\n },\n {\n result: 'open-without-agents'\n target: HtNodeLink\n },\n]\n\nexport interface HtQueueStatusConditionalNode extends HtBaseNode {\n type: HtNodeWithContentType.FUNCTION\n content: {\n action: string //'get-channel-type'\n arguments: HtFunctionArguments[]\n result_mapping: HtFunctionResult[]\n }\n}\n"],"names":[],"mappings":"AAsDC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/rating.js","sources":["../../../../src/content-fields/hubtype-fields/rating.ts"],"sourcesContent":["import type { HtBaseNode, HtNodeLink, HtTextLocale } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport enum RatingType {\n Stars = 'stars',\n Smileys = 'smileys',\n}\n\nexport interface HtRatingButton {\n id: string\n text: string\n payload: string\n value: number\n target?: HtNodeLink\n}\n\nexport interface HtRatingNode extends HtBaseNode {\n type: HtNodeWithContentType.RATING\n content: {\n text: HtTextLocale[]\n buttons: HtRatingButton[]\n rating_type: RatingType\n send_button_text: HtTextLocale[]\n open_list_button_text: HtTextLocale[]\n }\n}\n"],"names":["RatingType"],"mappings":"AAGO,IAAKA,iBAAUA,0BAAVA;;;WAAAA;MAGX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/smart-intent.js","sources":["../../../../src/content-fields/hubtype-fields/smart-intent.ts"],"sourcesContent":["import type { HtBaseNode } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\ninterface SmartIntent {\n title: string\n description: string\n is_active?: boolean\n}\n\nexport interface HtSmartIntentNode extends HtBaseNode {\n type: HtNodeWithContentType.SMART_INTENT\n content: SmartIntent\n}\n"],"names":[],"mappings":"AAYC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/text.js","sources":["../../../../src/content-fields/hubtype-fields/text.ts"],"sourcesContent":["import type { HtButton } from './button'\nimport type { HtBaseNode, HtTextLocale } from './common'\nimport type { HtButtonStyle, HtNodeWithContentType } from './node-types'\n\nexport interface HtTextNode extends HtBaseNode {\n type: HtNodeWithContentType.TEXT\n content: {\n text: HtTextLocale[]\n buttons_style?: HtButtonStyle\n buttons: HtButton[]\n }\n}\n"],"names":[],"mappings":"AAWC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/url.js","sources":["../../../../src/content-fields/hubtype-fields/url.ts"],"sourcesContent":["import type { HtNodeWithoutContentType } from './node-types'\n\nexport interface HtUrlNode {\n id: string\n type: HtNodeWithoutContentType.URL\n content: {\n url: string\n }\n}\n"],"names":[],"mappings":"AAQC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/video.js","sources":["../../../../src/content-fields/hubtype-fields/video.ts"],"sourcesContent":["import type { HtBaseNode, HtVideoLocale } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtVideoNode extends HtBaseNode {\n type: HtNodeWithContentType.VIDEO\n content: {\n video: HtVideoLocale[]\n }\n}\n"],"names":[],"mappings":"AAQC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/webview.js","sources":["../../../../src/content-fields/hubtype-fields/webview.ts"],"sourcesContent":["import type { HtBaseNode, HtNodeLink } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtWebviewExits {\n id: string\n name: string\n target?: HtNodeLink\n}\n\nexport interface HtWebviewNode extends HtBaseNode {\n type: HtNodeWithContentType.WEBVIEW\n content: {\n webview_target_id: string\n webview_name: string\n webview_component_name: string\n webview_params: Record<string, string>\n exits: HtWebviewExits[]\n }\n}\n"],"names":[],"mappings":"AAkBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/whatsapp-button-list.js","sources":["../../../../src/content-fields/hubtype-fields/whatsapp-button-list.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { HtBaseNode, HtNodeLink, HtTextLocale } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtWhatsappButtonListRow {\n id: string\n text: HtTextLocale[]\n description: HtTextLocale[]\n target?: HtNodeLink\n}\n\nexport interface HtWhatsappButtonListSection {\n id: string\n title: HtTextLocale[]\n rows: HtWhatsappButtonListRow[]\n}\n\nexport interface HtWhatsappButtonListNode extends HtBaseNode {\n type: HtNodeWithContentType.WHATSAPP_BUTTON_LIST\n content: {\n text: HtTextLocale[]\n button_text: HtTextLocale[]\n sections: HtWhatsappButtonListSection[]\n }\n}\n"],"names":[],"mappings":"AAAA,uDAAuD,GAwBtD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/whatsapp-cta-url-button.js","sources":["../../../../src/content-fields/hubtype-fields/whatsapp-cta-url-button.ts"],"sourcesContent":["import type { WhatsappCTAUrlHeaderType } from '@botonic/react'\n\nimport type { HtButton } from './button'\nimport type { HtBaseNode, HtMediaFileLocale, HtTextLocale } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtWhatsappCTAUrlButtonNode extends HtBaseNode {\n type: HtNodeWithContentType.WHATSAPP_CTA_URL_BUTTON\n content: {\n text: HtTextLocale[]\n header: HtTextLocale[]\n header_type?: WhatsappCTAUrlHeaderType\n header_image?: HtMediaFileLocale[]\n header_video?: HtMediaFileLocale[]\n header_document?: HtMediaFileLocale[]\n footer: HtTextLocale[]\n button: HtButton\n }\n}\n"],"names":[],"mappings":"AAkBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/whatsapp-request-contact-info.js","sources":["../../../../src/content-fields/hubtype-fields/whatsapp-request-contact-info.ts"],"sourcesContent":["import type { HtBaseNode, HtTextLocale } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport interface HtWhatsappRequestContactInfoNode extends HtBaseNode {\n type: HtNodeWithContentType.WHATSAPP_REQUEST_CONTACT_INFO\n content: {\n text: HtTextLocale[]\n }\n}\n"],"names":[],"mappings":"AAQC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/hubtype-fields/whatsapp-template.js","sources":["../../../../src/content-fields/hubtype-fields/whatsapp-template.ts"],"sourcesContent":["import type {\n WhatsAppTemplateButtonSubType,\n WhatsAppTemplateComponentType,\n WhatsAppTemplateParameterType,\n} from '@botonic/react'\n\nimport type { HtButton } from './button'\nimport type { HtBaseNode, HtMediaFileLocale } from './common'\nimport type { HtNodeWithContentType } from './node-types'\n\nexport enum HtWhatsAppTemplateFlowActionType {\n NAVIGATE = 'navigate',\n DATA_EXCHANGE = 'data_exchange',\n}\n\ntype HtWhatsAppTemplateButton =\n | {\n type: WhatsAppTemplateButtonSubType.URL\n text: string\n url?: string\n index: number\n }\n | {\n type: WhatsAppTemplateButtonSubType.QUICK_REPLY\n text: string\n id: string\n index: number\n }\n | {\n type: WhatsAppTemplateButtonSubType.PHONE_NUMBER\n text: string\n phone_number: string\n index: number\n }\n | {\n type: WhatsAppTemplateButtonSubType.VOICE_CALL\n text: string\n index: number\n }\n | {\n type: WhatsAppTemplateButtonSubType.REQUEST_CONTACT_INFO\n text?: string\n index: number\n }\n | {\n type: WhatsAppTemplateButtonSubType.FLOW\n text: string\n flow_id: string\n flow_action?: HtWhatsAppTemplateFlowActionType\n navigate_screen?: string\n index: number\n }\n\nexport interface HtFlowButtonActionValue {\n flow_token: string\n flow_action_data?: Record<string, string>\n}\n\nexport interface HtWhatsAppTemplateHeaderComponent {\n type: WhatsAppTemplateComponentType.HEADER\n format:\n | WhatsAppTemplateParameterType.TEXT\n | WhatsAppTemplateParameterType.IMAGE\n | WhatsAppTemplateParameterType.VIDEO\n text?: string\n image?: { link: string }\n video?: { link: string }\n}\n\nexport interface HtWhatsAppTemplateBodyComponent {\n type: WhatsAppTemplateComponentType.BODY\n text: string\n}\n\nexport interface HtWhatsAppTemplateFooterComponent {\n type: WhatsAppTemplateComponentType.FOOTER\n text: string\n}\n\nexport interface HtWhatsAppTemplateButtonsComponent {\n type: WhatsAppTemplateComponentType.BUTTONS\n buttons: HtWhatsAppTemplateButton[]\n}\nexport type HtWhatsAppTemplateComponent =\n | HtWhatsAppTemplateHeaderComponent\n | HtWhatsAppTemplateBodyComponent\n | HtWhatsAppTemplateFooterComponent\n | HtWhatsAppTemplateButtonsComponent\n\nexport interface HtWhatsAppTemplate {\n id: string\n name: string\n language: string\n status: string\n category: string\n components: HtWhatsAppTemplateComponent[]\n namespace: string\n parameter_format: string\n}\n\nexport interface HtWhatsappTemplateContentByLocale {\n template?: HtWhatsAppTemplate\n header_variables?: {\n type: WhatsAppTemplateParameterType\n text?: Record<string, string>\n media?: HtMediaFileLocale[]\n }\n variable_values?: Record<string, string>\n url_variable_values?: Record<string, string>\n flow_button_action_values?: Record<string, HtFlowButtonActionValue>\n}\n\nexport interface HtWhatsappTemplateNode extends HtBaseNode {\n type: HtNodeWithContentType.WHATSAPP_TEMPLATE\n content: {\n by_locale: Record<string, HtWhatsappTemplateContentByLocale>\n buttons: HtButton[]\n }\n}\n"],"names":["HtWhatsAppTemplateFlowActionType"],"mappings":"AAUO,IAAKA,kDAAgCA,0BAAhCA;;;WAAAA;MAGX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/index.js","sources":["../../../src/content-fields/index.ts"],"sourcesContent":["import { FlowCustomConditionalV2 } from './custom-conditional/flow-custom-condition-v2'\nimport { FlowAiAgent } from './flow-ai-agent'\nimport { FlowAiAgentRouter } from './flow-ai-agent-router'\nimport { FlowBotAction } from './flow-bot-action'\nimport { FlowCaptureUserInput } from './flow-capture-user-input'\nimport { FlowCarousel } from './flow-carousel'\nimport { FlowChannelConditional } from './flow-channel-conditional'\nimport { FlowCountryConditional } from './flow-country-conditional'\nimport { FlowCustomConditional } from './flow-custom-conditional'\nimport { FlowGoToFlow } from './flow-go-to-flow'\nimport { FlowHandoff } from './flow-handoff'\nimport { FlowImage } from './flow-image'\nimport { FlowQueueStatusConditional } from './flow-queue-status-conditional'\nimport { FlowRating } from './flow-rating'\nimport { FlowText } from './flow-text'\nimport { FlowVideo } from './flow-video'\nimport { FlowWhatsappCtaUrlButtonNode } from './flow-whatsapp-cta-url-button'\nimport { FlowWhatsappRequestContactInfoNode } from './flow-whatsapp-request-contact-info'\nimport { FlowWhatsappTemplate } from './flow-whatsapp-template'\nimport {\n FlowWhatsappButtonList,\n FlowWhatsappButtonListRow,\n FlowWhatsappButtonListSection,\n} from './whatsapp-button-list'\n\nexport { ContentFieldsBase } from './content-fields-base'\nexport { FlowButton } from './flow-button'\nexport { FlowElement } from './flow-element'\nexport {\n FlowAiAgentRouter,\n FlowAiAgent,\n FlowBotAction,\n FlowCaptureUserInput,\n FlowCarousel,\n FlowChannelConditional,\n FlowCountryConditional,\n FlowCustomConditional,\n FlowGoToFlow,\n FlowHandoff,\n FlowImage,\n FlowQueueStatusConditional,\n FlowRating,\n FlowText,\n FlowVideo,\n FlowWhatsappButtonList,\n FlowWhatsappButtonListRow,\n FlowWhatsappButtonListSection,\n FlowWhatsappCtaUrlButtonNode,\n FlowWhatsappRequestContactInfoNode,\n FlowWhatsappTemplate,\n FlowCustomConditionalV2,\n}\n\nexport type FlowContent =\n | FlowCarousel\n | FlowImage\n | FlowText\n | FlowVideo\n | FlowWhatsappButtonList\n | FlowWhatsappCtaUrlButtonNode\n | FlowWhatsappRequestContactInfoNode\n | FlowWhatsappTemplate\n | FlowHandoff\n | FlowBotAction\n | FlowAiAgent\n | FlowRating\n | FlowCountryConditional\n | FlowChannelConditional\n | FlowQueueStatusConditional\n | FlowCustomConditional\n | FlowGoToFlow\n | FlowCaptureUserInput\n | FlowAiAgentRouter\n | FlowCustomConditionalV2\n"],"names":["FlowCustomConditionalV2","FlowAiAgent","FlowAiAgentRouter","FlowBotAction","FlowCaptureUserInput","FlowCarousel","FlowChannelConditional","FlowCountryConditional","FlowCustomConditional","FlowGoToFlow","FlowHandoff","FlowImage","FlowQueueStatusConditional","FlowRating","FlowText","FlowVideo","FlowWhatsappCtaUrlButtonNode","FlowWhatsappRequestContactInfoNode","FlowWhatsappTemplate","FlowWhatsappButtonList","FlowWhatsappButtonListRow","FlowWhatsappButtonListSection","ContentFieldsBase","FlowButton","FlowElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAuF;AAC1C;AACa;AACT;AACe;AAClB;AACqB;AACA;AACF;AACjB;AACJ;AACJ;AACoC;AAClC;AACJ;AACE;AACqC;AACY;AAC1B;AAKhC;AAE0B;AACf;AACE;AAwB3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js","sources":["../../../../src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.tsx"],"sourcesContent":["import type { WhatsappButtonListRowProps } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../../api'\nimport { SOURCE_INFO_SEPARATOR } from '../../constants'\nimport { ContentFieldsBase } from '../content-fields-base'\nimport type { HtWhatsappButtonListRow } from '../hubtype-fields'\n\nexport class FlowWhatsappButtonListRow extends ContentFieldsBase {\n public title = ''\n public description = ''\n public targetId?: string\n\n static fromHubtypeCMS(\n component: HtWhatsappButtonListRow,\n locale: string,\n cmsApi: FlowBuilderApi\n ): FlowWhatsappButtonListRow {\n const newRow = new FlowWhatsappButtonListRow(component.id)\n newRow.title = FlowWhatsappButtonListRow.getTextByLocale(\n locale,\n component.text\n )\n newRow.description = FlowWhatsappButtonListRow.getTextByLocale(\n locale,\n component.description\n )\n newRow.targetId = cmsApi.getPayload(component.target)\n\n return newRow\n }\n\n async trackFlow(): Promise<void> {\n return\n }\n\n async processContent(): Promise<void> {\n return\n }\n\n renderRow(\n rowIndex: number,\n sectionIndex: number\n ): WhatsappButtonListRowProps | undefined {\n if (!this.targetId) {\n console.error(`Row with title: '${this.title}' has no target`)\n return undefined\n }\n return {\n id: this.getRowId(rowIndex, sectionIndex),\n title: this.title,\n description: this.description,\n }\n }\n\n private getRowId(rowIndex: number, sectionIndex: number): string {\n return `${this.targetId}${SOURCE_INFO_SEPARATOR}${sectionIndex}.${rowIndex}`\n }\n}\n"],"names":["SOURCE_INFO_SEPARATOR","ContentFieldsBase","FlowWhatsappButtonListRow","component","locale","cmsApi","newRow","rowIndex","sectionIndex","console","undefined"],"mappings":";;;;;AAGuD;AACG;AAGnD,MAAME,yBAAyBA,SAASD,iBAAiBA;IAK9D,OAAO,eACLE,SAAkC,EAClCC,MAAc,EACdC,MAAsB,EACK;QAC3B,MAAMC,SAAS,IAAIJ,yBAAyBA,CAACC,UAAU,EAAE;QACzDG,OAAO,KAAK,GAAGJ,yBAAyBA,CAAC,eAAe,CACtDE,QACAD,UAAU,IAAI;QAEhBG,OAAO,WAAW,GAAGJ,yBAAyBA,CAAC,eAAe,CAC5DE,QACAD,UAAU,WAAW;QAEvBG,OAAO,QAAQ,GAAGD,OAAO,UAAU,CAACF,UAAU,MAAM;QAEpD,OAAOG;IACT;IAEA,MAAM,YAA2B;QAC/B;IACF;IAEA,MAAM,iBAAgC;QACpC;IACF;IAEA,UACEC,QAAgB,EAChBC,YAAoB,EACoB;QACxC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClBC,QAAQ,KAAK,CAAC,CAAC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;YAC7D,OAAOC;QACT;QACA,OAAO;YACL,IAAI,IAAI,CAAC,QAAQ,CAACH,UAAUC;YAC5B,OAAO,IAAI,CAAC,KAAK;YACjB,aAAa,IAAI,CAAC,WAAW;QAC/B;IACF;IAEQ,SAASD,QAAgB,EAAEC,YAAoB,EAAU;QAC/D,OAAO,GAAG,IAAI,CAAC,QAAQ,GAAGR,qBAAqBA,GAAGQ,aAAa,CAAC,EAAED,UAAU;IAC9E;;QAjDK,qBACE,QAAQ,SACR,cAAc;;AAgDvB"}
|
package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js","sources":["../../../../src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.tsx"],"sourcesContent":["import type {\n WhatsappButtonListRowProps,\n WhatsappButtonListSectionProps,\n} from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../../api'\nimport { ContentFieldsBase } from '../content-fields-base'\nimport type { HtWhatsappButtonListSection } from '../hubtype-fields'\nimport { FlowWhatsappButtonListRow } from './flow-whatsapp-button-list-row'\n\nexport class FlowWhatsappButtonListSection extends ContentFieldsBase {\n public title = ''\n public rows: FlowWhatsappButtonListRow[] = []\n\n static fromHubtypeCMS(\n component: HtWhatsappButtonListSection,\n locale: string,\n cmsApi: FlowBuilderApi\n ): FlowWhatsappButtonListSection {\n const newButton = new FlowWhatsappButtonListSection(component.id)\n newButton.title = FlowWhatsappButtonListSection.getTextByLocale(\n locale,\n component.title\n )\n newButton.rows = component.rows.map(row =>\n FlowWhatsappButtonListRow.fromHubtypeCMS(row, locale, cmsApi)\n )\n return newButton\n }\n\n async trackFlow(): Promise<void> {\n return\n }\n\n async processContent(): Promise<void> {\n return\n }\n\n renderSection(sectionIndex: number): WhatsappButtonListSectionProps {\n const rows = this.rows.reduce(\n (acc: WhatsappButtonListRowProps[], row, rowIndex) => {\n const botonicRow = row.renderRow(rowIndex, sectionIndex)\n if (botonicRow) {\n acc.push(botonicRow)\n }\n return acc\n },\n []\n )\n\n return { title: this.title, rows }\n }\n}\n"],"names":["ContentFieldsBase","FlowWhatsappButtonListRow","FlowWhatsappButtonListSection","component","locale","cmsApi","newButton","row","sectionIndex","rows","acc","rowIndex","botonicRow"],"mappings":";;;;;AAM0D;AAEiB;AAEpE,MAAME,6BAA6BA,SAASF,iBAAiBA;IAIlE,OAAO,eACLG,SAAsC,EACtCC,MAAc,EACdC,MAAsB,EACS;QAC/B,MAAMC,YAAY,IAAIJ,6BAA6BA,CAACC,UAAU,EAAE;QAChEG,UAAU,KAAK,GAAGJ,6BAA6BA,CAAC,eAAe,CAC7DE,QACAD,UAAU,KAAK;QAEjBG,UAAU,IAAI,GAAGH,UAAU,IAAI,CAAC,GAAG,CAACI,CAAAA,MAClCN,wCAAwC,CAACM,KAAKH,QAAQC;QAExD,OAAOC;IACT;IAEA,MAAM,YAA2B;QAC/B;IACF;IAEA,MAAM,iBAAgC;QACpC;IACF;IAEA,cAAcE,YAAoB,EAAkC;QAClE,MAAMC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAC3B,CAACC,KAAmCH,KAAKI;YACvC,MAAMC,aAAaL,IAAI,SAAS,CAACI,UAAUH;YAC3C,IAAII,YAAY;gBACdF,IAAI,IAAI,CAACE;YACX;YACA,OAAOF;QACT,GACA,EAAE;QAGJ,OAAO;YAAE,OAAO,IAAI,CAAC,KAAK;YAAED;QAAK;IACnC;;QAzCK,qBACE,QAAQ,SACR,OAAoC,EAAE;;AAwC/C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/whatsapp-button-list/flow-whatsapp-button-list.js","sources":["../../../../src/content-fields/whatsapp-button-list/flow-whatsapp-button-list.tsx"],"sourcesContent":["import { type BotContext, isWhatsapp } from '@botonic/core'\nimport { Button, Text, WhatsappButtonList } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../../api'\nimport { trackOneContent } from '../../tracking'\nimport { ContentFieldsBase } from '../content-fields-base'\nimport type { HtWhatsappButtonListNode } from '../hubtype-fields'\nimport { FlowWhatsappButtonListSection } from './flow-whatsapp-button-list-section'\n\nexport class FlowWhatsappButtonList extends ContentFieldsBase {\n public text = ''\n public listButtonText = ''\n public sections: FlowWhatsappButtonListSection[] = []\n\n static fromHubtypeCMS(\n component: HtWhatsappButtonListNode,\n locale: string,\n cmsApi: FlowBuilderApi\n ): FlowWhatsappButtonList {\n const newWhatsappButtonList = new FlowWhatsappButtonList(component.id)\n newWhatsappButtonList.code = component.code\n newWhatsappButtonList.text = FlowWhatsappButtonList.getTextByLocale(\n locale,\n component.content.text\n )\n newWhatsappButtonList.listButtonText =\n FlowWhatsappButtonList.getTextByLocale(\n locale,\n component.content.button_text\n )\n newWhatsappButtonList.sections = component.content.sections.map(section =>\n FlowWhatsappButtonListSection.fromHubtypeCMS(section, locale, cmsApi)\n )\n newWhatsappButtonList.followUp = component.follow_up\n\n return newWhatsappButtonList\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n await trackOneContent(botContext, this)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.trackFlow(botContext)\n await this.filterContent(botContext, this)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const replacedText = this.replaceVariables(this.text, botContext)\n\n if (!isWhatsapp(botContext.session)) {\n const rows = this.sections.flatMap(section => section.rows)\n const buttons = rows.map(row => (\n <Button key={row.id} payload={row.targetId}>\n {row.title}\n </Button>\n ))\n\n return (\n <Text>\n {replacedText}\n {buttons}\n </Text>\n )\n }\n\n return (\n <WhatsappButtonList\n key={this.id}\n body={replacedText}\n button={this.listButtonText}\n sections={this.sections.map((section, sectionIndex) =>\n section.renderSection(sectionIndex)\n )}\n />\n )\n }\n}\n"],"names":["isWhatsapp","Button","Text","WhatsappButtonList","trackOneContent","ContentFieldsBase","FlowWhatsappButtonListSection","FlowWhatsappButtonList","component","locale","cmsApi","newW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KrB,qBACE,KAACf,IAAIA;;oBACFY;oBACAE;;;QAGP;QAEA,qBACE,IAACb,kBAAkBA;YAEjB,MAAMW;YACN,QAAQ,IAAI,CAAC,cAAc;YAC3B,UAAU,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAACF,SAASM,eACpCN,QAAQ,aAAa,CAACM;WAJnB,IAAI,CAAC,EAAE;IAQlB;;QApEK,qBACE,OAAO,SACP,iBAAiB,SACjB,WAA4C,EAAE;;AAkEvD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/whatsapp-button-list/index.js","sources":["../../../../src/content-fields/whatsapp-button-list/index.ts"],"sourcesContent":["export { FlowWhatsappButtonList } from './flow-whatsapp-button-list'\nexport { FlowWhatsappButtonListRow } from './flow-whatsapp-button-list-row'\nexport { FlowWhatsappButtonListSection } from './flow-whatsapp-button-list-section'\n"],"names":["FlowWhatsappButtonList","FlowWhatsappButtonListRow","FlowWhatsappButtonListSection"],"mappings":";;;AAAoE;AACO;AACQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filters/index.js","sources":["../../../src/filters/index.ts"],"sourcesContent":["import type { BotContext } from '@botonic/core'\n\nimport type { FlowContent } from '../content-fields'\nimport type { ContentFilter } from '../types'\n\ninterface ContentFilterExecutorOptions {\n filters: ContentFilter[]\n}\n\nexport class ContentFilterExecutor {\n private filters: ContentFilter[] = []\n\n constructor(options: ContentFilterExecutorOptions) {\n this.filters = options.filters\n }\n\n async filter(\n request: BotContext,\n content: FlowContent\n ): Promise<FlowContent> {\n for (const filter of this.filters) {\n content = await filter(request, content)\n }\n\n return content\n }\n}\n"],"names":["ContentFilterExecutor","request","content","filter","options"],"mappings":"AASO,MAAMA,qBAAqBA;IAOhC,MAAM,OACJC,OAAmB,EACnBC,OAAoB,EACE;QACtB,KAAK,MAAMC,UAAU,IAAI,CAAC,OAAO,CAAE;YACjCD,UAAU,MAAMC,OAAOF,SAASC;QAClC;QAEA,OAAOA;IACT;IAbA,YAAYE,OAAqC,CAAE;aAF3C,UAA2B,EAAE;QAGnC,IAAI,CAAC,OAAO,GAAGA,QAAQ,OAAO;IAChC;AAYF"}
|