@bikdotai/bik-component-library 0.0.689 → 0.0.691

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.
Files changed (59) hide show
  1. package/dist/cjs/_virtual/billing.js +1 -0
  2. package/dist/cjs/_virtual/index.js +1 -0
  3. package/dist/cjs/_virtual/store.js +1 -0
  4. package/dist/cjs/components/code-block/index.d.ts +1 -0
  5. package/dist/cjs/components/code-block/languageSpecificFormatting/html.js +1 -0
  6. package/dist/cjs/components/code-block/languageSpecificFormatting/index.d.ts +2 -0
  7. package/dist/cjs/components/data-source-panel/DataSourceInfoFooter.d.ts +1 -1
  8. package/dist/cjs/components/data-source-panel/DataSourceInfoFooter.js +1 -1
  9. package/dist/cjs/components/data-source-panel/DataSourcePanel.d.ts +1 -1
  10. package/dist/cjs/components/data-source-panel/DataSourcePanel.js +1 -1
  11. package/dist/cjs/components/discount-modal/DiscountModal.d.ts +1 -1
  12. package/dist/cjs/components/discount-modal/DiscountModal.js +1 -1
  13. package/dist/cjs/components/product-picker-v2/collectionScreen.d.ts +1 -1
  14. package/dist/cjs/components/product-picker-v2/modal.d.ts +1 -1
  15. package/dist/cjs/components/product-picker-v2/modal.js +1 -1
  16. package/dist/cjs/components/product-picker-v2/productScreen.d.ts +1 -1
  17. package/dist/cjs/components/product-picker-v2/rearrangeScreen.d.ts +1 -1
  18. package/dist/cjs/components/product-picker-v2/searchScreen.d.ts +1 -1
  19. package/dist/cjs/components/product-picker-v2/selectedScreen.d.ts +1 -1
  20. package/dist/cjs/components/product-picker-v2/utility.d.ts +1 -1
  21. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.d.ts +1 -1
  22. package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +1 -1
  23. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  24. package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryResponseList.d.ts +1 -1
  25. package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js +1 -1
  26. package/dist/cjs/index.js +1 -1
  27. package/dist/cjs/node_modules/@bikdotai/bik-models/growth/index.js +1 -0
  28. package/dist/cjs/node_modules/@bikdotai/bik-models/growth/models/billing.js +1 -0
  29. package/dist/cjs/node_modules/@bikdotai/bik-models/growth/models/store.js +1 -0
  30. package/dist/esm/_virtual/billing.js +1 -0
  31. package/dist/esm/_virtual/index.js +1 -0
  32. package/dist/esm/_virtual/store.js +1 -0
  33. package/dist/esm/components/code-block/index.d.ts +1 -0
  34. package/dist/esm/components/code-block/languageSpecificFormatting/html.js +1 -0
  35. package/dist/esm/components/code-block/languageSpecificFormatting/index.d.ts +2 -0
  36. package/dist/esm/components/data-source-panel/DataSourceInfoFooter.d.ts +1 -1
  37. package/dist/esm/components/data-source-panel/DataSourceInfoFooter.js +1 -1
  38. package/dist/esm/components/data-source-panel/DataSourcePanel.d.ts +1 -1
  39. package/dist/esm/components/data-source-panel/DataSourcePanel.js +1 -1
  40. package/dist/esm/components/discount-modal/DiscountModal.d.ts +1 -1
  41. package/dist/esm/components/discount-modal/DiscountModal.js +1 -1
  42. package/dist/esm/components/product-picker-v2/collectionScreen.d.ts +1 -1
  43. package/dist/esm/components/product-picker-v2/modal.d.ts +1 -1
  44. package/dist/esm/components/product-picker-v2/modal.js +1 -1
  45. package/dist/esm/components/product-picker-v2/productScreen.d.ts +1 -1
  46. package/dist/esm/components/product-picker-v2/rearrangeScreen.d.ts +1 -1
  47. package/dist/esm/components/product-picker-v2/searchScreen.d.ts +1 -1
  48. package/dist/esm/components/product-picker-v2/selectedScreen.d.ts +1 -1
  49. package/dist/esm/components/product-picker-v2/utility.d.ts +1 -1
  50. package/dist/esm/components/template-context-mapper/TemplateContextMapper.d.ts +1 -1
  51. package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +1 -1
  52. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  53. package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.d.ts +1 -1
  54. package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js +1 -1
  55. package/dist/esm/index.js +1 -1
  56. package/dist/esm/node_modules/@bikdotai/bik-models/growth/index.js +1 -0
  57. package/dist/esm/node_modules/@bikdotai/bik-models/growth/models/billing.js +1 -0
  58. package/dist/esm/node_modules/@bikdotai/bik-models/growth/models/store.js +1 -0
  59. package/package.json +2 -2
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./amplitude/index.js"),r=require("./components/template-preview/constants/regexPatterns.js"),t=require("./utils/StringUtils.js"),o=require("./constants/Theme.js"),n=require("./constants/zindex.js"),a=require("./components/checkBox/CheckBox.js"),i=require("./components/list-item/ListItem.js"),s=require("./components/pagination/Pagination.js"),p=require("./components/radioButton/RadioButton.js"),u=require("./components/toaster/Toaster.js"),c=require("./components/tooltips/Tooltip.js"),l=require("./components/spinner/Spinner.js"),d=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),T=require("./components/icon-button/IconButton.js"),x=require("./components/template-preview/TemplatePreview.js"),P=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),S=require("./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),A=require("./components/template-preview/helpers/SmsTemplateHelper.js"),C=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/template-preview/helpers/VariableEditorHelper.js"),O=require("./components/template-preview/models/TemplateMeta.js"),b=require("./components/template-preview/models/WhatsAppTemplate.js"),j=require("./components/template-preview/models/Channels.js"),E=require("./components/template-context-mapper/TemplateContextMapper.js"),R=require("./components/template-context-mapper/utils/getDataFromTemplateComponent.js"),g=require("./components/template-context-mapper/utils/validateIsUrl.js");require("./_virtual/_tslib.js");var h=require("./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js"),B=require("./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js"),I=require("./components/fab-menu/FABMenu.js"),_=require("./components/floating-action-button/FloatingActionButton.js"),q=require("./components/floating-action-button/FloatingActionButton.styles.js"),f=require("./components/image-compress/ImageCompress.js"),D=require("./components/TypographyStyle.js"),N=require("./components/button/Button.js"),k=require("./components/progress-bar/ProgressBarComponent.js");require("react/jsx-runtime");var L=require("./components/progress-bar-v2/ProgressBarV2.js"),w=require("./components/QueryBuilder/QueryBuilder.js"),M=require("./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),V=require("./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js"),v=require("./components/QueryBuilder/redux/queryBuilder.reducer.js"),U=require("./components/QueryBuilder/redux/queryBuilderCache.reducer.js"),G=require("./components/QueryBuilder/types/QueryBuilderOperator.type.js"),F=require("./components/modals/styledModal.js"),H=require("./components/dropdown/DropdownPopover/index.js"),W=require("./components/dropdown/Dropdown.js"),Y=require("./components/dropdown/ChipDropdown.js"),Q=require("./components/dropdown/OpenedDropdown/components/OpennedDropdown.js"),K=require("./components/dropdown/MenuItem/MenuItem.js"),z=require("./components/analytics-card/AnalyticsCard.js"),Z=require("./components/analytics-card/AnalyticsCard.styled.js"),X=require("./components/input/Input.js"),J=require("./components/analytics-chips-and-dropdowns/AnalyticsChip.js"),$=require("./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js"),ee=require("./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js"),re=require("./components/analytics-chips-and-dropdowns/AnalyticsMetric.js"),te=require("./components/analytics-chips-and-dropdowns/AnalyticsTrend.js"),oe=require("./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),ne=require("./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js"),ae=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),ie=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),se=require("./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),pe=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),ue=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),ce=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),le=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),de=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js"),me=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),Te=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),xe=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),Pe=require("./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js"),Se=require("./components/avatar/Avatar.js"),Ae=require("./components/avatar/AvatarHelper.js"),Ce=require("./components/alerts/Alert.js"),ye=require("./components/alerts/AlertHelper.js"),Oe=require("./components/thumbnail/Thumbnail.js"),be=require("./components/curtain/Curtain.js"),je=require("./components/datePicker/DatePicker.js"),Ee=require("./components/datePicker/DatePickerWrapper.js"),Re=require("./components/switch/Switch.js"),ge=require("./components/plans/SubscriptionPlan.js"),he=require("./components/plans/SubscriptionPlanSelector.js"),Be=require("./components/plans/NewSubscriptionPlan.js"),Ie=require("./components/plans/SubscriptionPlansCollected.js"),_e=require("./components/tabs/Tabs.js"),qe=require("./components/dynamic-tabs/DynamicTabs.js"),fe=require("./components/shimmer/ShimmerComponent/BikShimmer.js"),De=require("./components/TablePagination/TablePagination.js"),Ne=require("./components/TablePagination/TablePaginationCard.js"),ke=require("./components/states-modal/StateModalComponent.js"),Le=require("./components/states-modal/DeleteConfirmationModal.js"),we=require("./components/states/StateComponent.js"),Me=require("./components/states/ShopifyScopeWrapper.js"),Ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditor.js"),ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),Ue=require("./helpers/BaseWhatsappContentLang.helper.js"),Ge=require("./components/curtain/CurtainHelper.js"),Fe=require("./utils/resizeImage.js"),He=require("./components/variable-picker-v3/model.js"),We=require("./components/card-selection-modal/CardSelectionModal.js"),Ye=require("./components/image-cropper/BikImageCropper.js"),Qe=require("./components/image-cropper/BikImagePipeline/BikImagePipeline.js"),Ke=require("./components/buttonGroup/ButtonGroup.js"),ze=require("./components/accordion/Accordion.js"),Ze=require("./components/file-uploader/FileUploader.js"),Xe=require("./components/colourInput/ColourInput.js"),Je=require("./components/code-block/CodeBlock.js"),$e=require("./components/code-block/types.js"),er=require("./components/bik-layout/BikHeader.js"),rr=require("./components/bik-layout/BikLayout.js"),tr=require("./components/bik-layout/BikProfile.js"),or=require("./components/bik-layout/SimpleSidebar.js"),nr=require("./components/bik-layout/BikSidebar.js"),ar=require("./components/bik-layout/FeatureModal.js"),ir=require("./components/bik-layout/SidebarSkeleton.js"),sr=require("./components/bik-layout/ShowShopifyRestrictedModal.js"),pr=require("./components/bik-layout/FeatureModalV2.js"),ur=require("./components/searchBar/searchBar.js"),cr=require("./components/custom-date-time/CustomDateTime.js"),lr=require("./components/product-picker/ProductPickerModal.js"),dr=require("./components/discount-modal/DiscountModal.js"),mr=require("./components/discount-modal/CouponExpiration/CouponExpiration.js"),Tr=require("./components/discount-modal/type.js"),xr=require("./components/country-code-picker/CountryCodePicker.js"),Pr=require("./components/country-code-picker/CountryCodePicker.modal.js"),Sr=require("./components/shimmer-image/ShimmerImage.js"),Ar=require("./components/product-picker-v2/modal.js"),Cr=require("./components/product-picker-v2/type.js"),yr=require("./components/carousel/carousel.js"),Or=require("./components/carousel-secondary/CarouselSecondary.js"),br=require("./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js"),jr=require("./components/radioList/RadioList.js"),Er=require("./components/checkList/CheckList.js"),Rr=require("./components/postPicker/postPicker.js"),gr=require("./components/dropdown-button/DropdownButton.js"),hr=require("./components/side-modal/SideModal.js"),Br=require("./components/keywords-input/KeywordsInput.js"),Ir=require("./components/add-variableV2/AddVariableV2SideModal.js"),_r=require("./components/add-variableV2/AddVariableV2.js"),qr=require("./components/navigation-hyperlink/NavigationHyperlink.js"),fr=require("./components/SearchFilter/index.js"),Dr=require("./components/input-with-vars/InputWithVariables.js"),Nr=require("./components/dashboard-review-popup/DashboardReviewPopUp.js"),kr=require("./components/star-rating/StarRating.js"),Lr=require("./components/testimonial-card/TestimonialCard.js"),wr=require("./components/slider/slider.js"),Mr=require("./components/resizeImage/index.js"),Vr=require("./utils/validator.js"),vr=require("./components/carousel-preview/CarouselPreview.js"),Ur=require("./components/floater/floater.js"),Gr=require("./components/card-selector/CardSelector.js"),Fr=require("./components/card-selector/CardSelectorGroup.js"),Hr=require("./components/variable-picker-v3/VariablePicker.js"),Wr=require("./components/action-button/ActionButtons.js"),Yr=require("./components/ai-modals/ActivateBikAI.js"),Qr=require("./components/ai-modals/AiSyncProgress.js"),Kr=require("./components/ai-modals/AiCreditsExhausted.js"),zr=require("./components/ai-modals/AiCreditsLow.js"),Zr=require("./components/input-with-vars/customPortal.js"),Xr=require("./components/floating-input-dropdown/FloatingInputDropdown.js"),Jr=require("./components/dropdown/MultilevelDropdownPopover/index.js"),$r=require("./components/dropShadow/DropShadow.js"),et=require("./components/multi-level-dropdown/MultiLevelDropdown.js"),rt=require("./components/data-source-panel/DataSourcePanel.js"),tt=require("./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js"),ot=require("./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js"),nt=require("./components/data-source-panel/model.js"),at=require("./components/carousel-secondary/model.js");exports.AmplitudeEvent=e.AmplitudeEvent,exports.regexPatterns=r,exports.StringUtils=t.default,exports.BASE_COLORS=o.BASE_COLORS,exports.COLORS=o.COLORS,exports.DEFAULT_THEME=o.DEFAULT_THEME,exports.FONTS=o.FONTS,exports.ComponentZindex=n.ComponentZindex,exports.CheckBox=a.CheckBox,exports.ListItem=i.ListItem,exports.Pagination=s.Pagination,exports.RadioButton=p.RadioButton,exports.Toaster=u.Toaster,exports.Tooltip=c.Tooltip,exports.PureSpinner=l.PureSpinner,exports.Spinner=l.Spinner,exports.Stepper=d.Stepper,exports.Tag=m.Tag,exports.IconButton=T.IconButton,exports.TemplatePreview=x.TemplatePreview,exports.WhatsappLikePreview=P.WhatsappLikePreview,exports.WhatsappLikePreviewV2=S.WhatsappLikePreviewV2,exports.renderVariableUIForPreview=A.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=C.WhatsAppFormatToHTML,exports.VariableEditorHelper=y.VariableEditorHelper,Object.defineProperty(exports,"ACTIONS_TYPES",{enumerable:!0,get:function(){return O.ACTIONS_TYPES}}),exports.CUSTOM_URL_NAME=O.CUSTOM_URL_NAME,Object.defineProperty(exports,"HEADER_TYPES",{enumerable:!0,get:function(){return O.HEADER_TYPES}}),exports.STATIC_URL_CTA_OPTION=O.STATIC_URL_CTA_OPTION,Object.defineProperty(exports,"TEMPLATE_EDITOR",{enumerable:!0,get:function(){return O.TEMPLATE_EDITOR}}),Object.defineProperty(exports,"TEMPLATE_STATUS",{enumerable:!0,get:function(){return O.TEMPLATE_STATUS}}),Object.defineProperty(exports,"BUTTON_TYPE",{enumerable:!0,get:function(){return b.BUTTON_TYPE}}),Object.defineProperty(exports,"POD",{enumerable:!0,get:function(){return b.POD}}),Object.defineProperty(exports,"TEMPLATE_QUALITY",{enumerable:!0,get:function(){return b.TEMPLATE_QUALITY}}),Object.defineProperty(exports,"CHANNEL_TYPE",{enumerable:!0,get:function(){return j.CHANNEL_TYPE}}),exports.TemplateContextMapper=E.TemplateContextMapper,exports.getAllDataFromTemplateComponent=R.getAllDataFromTemplateComponent,exports.getAllDataFromWebpushTemplateComponent=R.getAllDataFromWebpushTemplateComponent,exports.isVariable=g.isVariable,exports.validateIsUrl=g.validateIsUrl,exports.TemplateAnalyticsSkeleton=h.TemplateAnalyticsSkeleton,exports.AnalyticsItem=B.AnalyticsItem,exports.RightPanelTemplateAnalytics=B.RightPanelTemplateAnalytics,exports.TemplateAnalyticsComponent=B.TemplateAnalyticsComponent,exports.FABMenu=I.FABMenu,exports.FloatingActionButton=_.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return q.DROP_POSITION}}),exports.DropdownToggleContainer=q.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return q.FAB_POSITION}}),exports.FloatingActionButtonContainer=q.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=q.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return q.MENU_ALIGNMENT}}),exports.StyledDropdown=q.StyledDropdown,exports.TooltipStyled=q.TooltipStyled,exports.ImageService=f.ImageService,exports.AiBodyCaption=D.AiBodyCaption,exports.AiBodyTiny=D.AiBodyTiny,exports.BodyCaption=D.BodyCaption,exports.BodyLarge=D.BodyLarge,exports.BodyPrimary=D.BodyPrimary,exports.BodyPrimaryLink=D.BodyPrimaryLink,exports.BodyRegular=D.BodyRegular,exports.BodySecondary=D.BodySecondary,exports.BodySecondaryLink=D.BodySecondaryLink,exports.BodySmall=D.BodySmall,exports.BodyTiny=D.BodyTiny,exports.ButtonLarge=D.ButtonLarge,exports.ButtonLargeAI=D.ButtonLargeAI,exports.ButtonRegular=D.ButtonRegular,exports.ButtonRegularAI=D.ButtonRegularAI,exports.Caption=D.Caption,exports.CaptionBold=D.CaptionBold,exports.Display=D.Display,exports.SmallRegular=D.SmallRegular,exports.SubHeading=D.SubHeading,exports.TextPlaceholder=D.TextPlaceholder,exports.Tiny=D.Tiny,exports.TitleFour=D.TitleFour,exports.TitleLarge=D.TitleLarge,exports.TitleMedium=D.TitleMedium,exports.TitleRegular=D.TitleRegular,exports.TitleSmall=D.TitleSmall,exports.TitleXlarge=D.TitleXlarge,exports.Button=N.Button,exports.ProgressBarComponent=k.ProgressBarComponent,exports.ProgressCompletedBar=k.ProgressCompletedBar,Object.defineProperty(exports,"ProgressBarType",{enumerable:!0,get:function(){return L.ProgressBarType}}),exports.ProgressBarV2=L.ProgressBarV2,Object.defineProperty(exports,"TextAlignment",{enumerable:!0,get:function(){return L.TextAlignment}}),exports.QueryBuilder=w.QueryBuilder,exports.BaseQueryBuilderNode=M.BaseQueryBuilderNode,exports.PropertyNode=V.PropertyNode,exports.PropertyNodeHeadless=V.PropertyNodeHeadless,exports.queryBuilderSlice=v.queryBuilderSlice,exports.queryBuilderCacheSlice=U.queryBuilderCacheSlice,Object.defineProperty(exports,"AD_STRING_OPERATORS",{enumerable:!0,get:function(){return G.AD_STRING_OPERATORS}}),Object.defineProperty(exports,"ANY_AD_OPERATORS",{enumerable:!0,get:function(){return G.ANY_AD_OPERATORS}}),Object.defineProperty(exports,"ANY_IG_OPERATORS",{enumerable:!0,get:function(){return G.ANY_IG_OPERATORS}}),Object.defineProperty(exports,"BOOLEAN_OPERATORS",{enumerable:!0,get:function(){return G.BOOLEAN_OPERATORS}}),Object.defineProperty(exports,"DATE_OPERATORS",{enumerable:!0,get:function(){return G.DATE_OPERATORS}}),Object.defineProperty(exports,"EVENT_VALUES",{enumerable:!0,get:function(){return G.EVENT_VALUES}}),Object.defineProperty(exports,"EXACTLY_OPERATORS",{enumerable:!0,get:function(){return G.EXACTLY_OPERATORS}}),Object.defineProperty(exports,"FREQUENCY_OPERATORS",{enumerable:!0,get:function(){return G.FREQUENCY_OPERATORS}}),Object.defineProperty(exports,"ICE_BREAKER_OPERATORS",{enumerable:!0,get:function(){return G.ICE_BREAKER_OPERATORS}}),Object.defineProperty(exports,"IG_STRING_OPERATORS",{enumerable:!0,get:function(){return G.IG_STRING_OPERATORS}}),Object.defineProperty(exports,"INTEGER_OPERATORS",{enumerable:!0,get:function(){return G.INTEGER_OPERATORS}}),Object.defineProperty(exports,"MAIL_SUBJECT_OPERATORS",{enumerable:!0,get:function(){return G.MAIL_SUBJECT_OPERATORS}}),Object.defineProperty(exports,"REACTION_OPERATORS",{enumerable:!0,get:function(){return G.REACTION_OPERATORS}}),Object.defineProperty(exports,"SPECIFIC_IG_OPERATORS",{enumerable:!0,get:function(){return G.SPECIFIC_IG_OPERATORS}}),Object.defineProperty(exports,"STRING_OPERATORS",{enumerable:!0,get:function(){return G.STRING_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_2",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_2}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_3",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_3}}),exports.StyledModal=F.StyledModal,exports.DropdownPopover=H.DropdownPopover,exports.Dropdown=W.Dropdown,exports.ChipDropdown=Y.ChipDropdown,exports.ChipDropdownContainer=Y.ChipDropdownContainer,exports.OpenedDropdown=Q.OpenedDropdown,exports.MenuItemDropdown=K.MenuItemDropdown,exports.AnalyticsCard=z.AnalyticsCard,exports.AnalyticsContainer=Z.AnalyticsContainer,exports.CardDataContainer=Z.CardDataContainer,exports.Input=X.Input,exports.AnalyticsChip=J.AnalyticsChip,exports.AnalyticsDropdown=$.AnalyticsDropdown,exports.EachItem=$.EachItem,exports.formatDate=$.formatDate,exports.AnalyticsMultiChip=ee.AnalyticsMultiChip,exports.AnalyticsMetric=re.AnalyticsMetric,exports.AnalyticsTrend=te.AnalyticsTrend,exports.LineChart=oe.LineChart,exports.LinearChipGroupedChart=ne.LinearChipGroupedChart,exports.Card=ae.Card,exports.PieChartAnalytics=ae.PieChartAnalytics,exports.PieChart=ie.PieChart,exports.HorizontalGraph=se.HorizontalGraph,exports.StackedBarChart=pe.StackedBarChart,exports.StackedBarDistributionChart=ue.StackedBarDistributionChart,Object.defineProperty(exports,"GRAPH_ORIENTATION",{enumerable:!0,get:function(){return ce.GRAPH_ORIENTATION}}),exports.VerticalGraph=le.VerticalGraph,exports.FunnelVerticalBarGraph=de.FunnelVerticalBarGraph,Object.defineProperty(exports,"HEAT",{enumerable:!0,get:function(){return me.HEAT}}),exports.HEAT_COLORS=me.HEAT_COLORS,Object.defineProperty(exports,"HEAT_GRADING_TYPE",{enumerable:!0,get:function(){return me.HEAT_GRADING_TYPE}}),exports.HeatMap=me.HeatMap,exports.HeatBoxStyled=Te.HeatBoxStyled,exports.HeatMapVertical=Te.HeatMapVertical,exports.VerticalBarAndLinearGraph=xe.VerticalBarAndLinearGraph,Object.defineProperty(exports,"TruncateValue",{enumerable:!0,get:function(){return Pe.TruncateValue}}),exports.calculatePercentage=Pe.calculatePercentage,exports.roundNumber=Pe.roundNumber,exports.truncateValueForIndianStore=Pe.truncateValueForIndianStore,exports.truncateValueForInternationalStore=Pe.truncateValueForInternationalStore,exports.truncateValueTo10K=Pe.truncateValueTo10K,exports.truncateValueToA=Pe.truncateValueToA,exports.truncateValueToB=Pe.truncateValueToB,exports.truncateValueToC=Pe.truncateValueToC,exports.truncateValueToK=Pe.truncateValueToK,exports.truncateValueToL=Pe.truncateValueToL,exports.truncateValueToM=Pe.truncateValueToM,exports.truncateValueToT=Pe.truncateValueToT,exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=Se.AVATAR_SIZE_VS_ICON_SIZE_MAP,exports.Avatar=Se.Avatar,exports.BACKGROUND_VS_TEXT_COLOR_MAP=Se.BACKGROUND_VS_TEXT_COLOR_MAP,Object.defineProperty(exports,"MESSAGE_CHANNELS",{enumerable:!0,get:function(){return Se.MESSAGE_CHANNELS}}),Object.defineProperty(exports,"AVATAR_BACKGROUND",{enumerable:!0,get:function(){return Ae.AVATAR_BACKGROUND}}),exports.AVATAR_SIZE_MAP=Ae.AVATAR_SIZE_MAP,Object.defineProperty(exports,"AVATAR_TYPES",{enumerable:!0,get:function(){return Ae.AVATAR_TYPES}}),Object.defineProperty(exports,"SIZE",{enumerable:!0,get:function(){return Ae.SIZE}}),exports.Alert=Ce.Alert,Object.defineProperty(exports,"ALERT_TYPES",{enumerable:!0,get:function(){return ye.ALERT_TYPES}}),exports.COLOR_CONFIG_MAP=ye.COLOR_CONFIG_MAP,Object.defineProperty(exports,"CONTENT_POSITION",{enumerable:!0,get:function(){return ye.CONTENT_POSITION}}),Object.defineProperty(exports,"RATIO",{enumerable:!0,get:function(){return Oe.RATIO}}),exports.Thumbnail=Oe.Thumbnail,exports.Curtain=be.Curtain,exports.DatePicker=je.DatePicker,exports.DatePickerWrapper=Ee.DatePickerWrapper,exports.Loader=Re.Loader,exports.Switch=Re.Switch,exports.SwitchContainer=Re.SwitchContainer,exports.Thumb=Re.Thumb,exports.SubscriptionPlan=ge.SubscriptionPlan,exports.BottomWrapper=he.BottomWrapper,exports.HeaderWrapper=he.HeaderWrapper,exports.SubscriptionPlanSelector=he.SubscriptionPlanSelector,exports.defaultTabs=he.defaultTabs,exports.NewSubscriptionPlan=Be.NewSubscriptionPlan,exports.SubscriptionPlansCollected=Ie.SubscriptionPlansCollected,exports.TabItemComponent=_e.TabItemComponent,exports.Tabs=_e.Tabs,exports.DynamicTabs=qe.DynamicTabs,exports.BikShimmer=fe.BikShimmer,exports.TablePagination=De.TablePagination,exports.TablePaginationCard=Ne.TablePaginationCard,exports.TablePaginationCardStyled=Ne.TablePaginationCardStyled,exports.StateModalComponent=ke.StateModalComponent,exports.DeleteConfirmationModal=Le.DeleteConfirmationModal,Object.defineProperty(exports,"ButtonActions",{enumerable:!0,get:function(){return we.ButtonActions}}),Object.defineProperty(exports,"ButtonTypes",{enumerable:!0,get:function(){return we.ButtonTypes}}),exports.StateComponent=we.StateComponent,Object.defineProperty(exports,"StateInterface",{enumerable:!0,get:function(){return we.StateInterface}}),exports.ShopifyScopeWrapper=Me.ShopifyScopeWrapper,exports.WhatsAppTextEditor=Ve.WhatsAppTextEditor,exports.CustomRightBorder=ve.CustomRightBorder,Object.defineProperty(exports,"EditorActionTypes",{enumerable:!0,get:function(){return ve.EditorActionTypes}}),exports.WhatsAppTextEditorHeader=ve.WhatsAppTextEditorHeader,exports.BaseWhatsappContentLangHelper=Ue.BaseWhatsappContentLangHelper,exports.CURTAIN_COLOR_CONFIG_MAP=Ge.CURTAIN_COLOR_CONFIG_MAP,Object.defineProperty(exports,"CURTAIN_MODE",{enumerable:!0,get:function(){return Ge.CURTAIN_MODE}}),Object.defineProperty(exports,"CURTAIN_TYPES",{enumerable:!0,get:function(){return Ge.CURTAIN_TYPES}}),exports.resizeImage=Fe.resizeImage,Object.defineProperty(exports,"PickerType",{enumerable:!0,get:function(){return He.PickerType}}),exports.CardSelectionModal=We.CardSelectionModal,exports.BikImageCropper=Ye.BikImageCropper,exports.BikImagePipeline=Qe.BikImagePipeline,exports.ButtonGroup=Ke.ButtonGroup,exports.BikAccordion=ze.BikAccordion,exports.FileUploader=Ze.FileUploader,exports.ColourInput=Xe.ColourInput,exports.CodeBlock=Je.CodeBlock,Object.defineProperty(exports,"CodeLanguage",{enumerable:!0,get:function(){return $e.CodeLanguage}}),exports.BikHeader=er.BikHeader,exports.BikLayout=rr.BikLayout,exports.BikProfile=tr.BikProfile,exports.SimpleSidebar=or.SimpleSidebar,exports.BikSidebar=nr.BikSidebar,exports.FeatureModal=ar.FeatureModal,exports.SidebarSkeleton=ir.SidebarSkeleton,exports.ShowShopifyRestrictedModal=sr.ShowShopifyRestrictedModal,exports.FeatureModalV2=pr.FeatureModalV2,exports.SearchBar=ur.SearchBar,exports.CustomDateTime=cr.CustomDateTime,exports.PricePleaseProductPicker=lr.PricePleaseProductPicker,exports.ProductPickerContent=lr.ProductPickerContent,exports.DiscountModal=dr.DiscountModal,exports.CouponExpiration=mr.CouponExpiration,Object.defineProperty(exports,"COUPON_EXPIRATION",{enumerable:!0,get:function(){return Tr.COUPON_EXPIRATION}}),Object.defineProperty(exports,"DISCOUNT_APPLIES_TO",{enumerable:!0,get:function(){return Tr.DISCOUNT_APPLIES_TO}}),Object.defineProperty(exports,"DISCOUNT_TARGET_SELECTION",{enumerable:!0,get:function(){return Tr.DISCOUNT_TARGET_SELECTION}}),Object.defineProperty(exports,"DISCOUNT_TARGET_TYPES",{enumerable:!0,get:function(){return Tr.DISCOUNT_TARGET_TYPES}}),Object.defineProperty(exports,"DISCOUNT_TYPES",{enumerable:!0,get:function(){return Tr.DISCOUNT_TYPES}}),Object.defineProperty(exports,"DISCOUNT_VALUE_TYPES",{enumerable:!0,get:function(){return Tr.DISCOUNT_VALUE_TYPES}}),Object.defineProperty(exports,"MIN_PURCHASE_REQUIREMENT",{enumerable:!0,get:function(){return Tr.MIN_PURCHASE_REQUIREMENT}}),Object.defineProperty(exports,"OFFER_APPLIES_TO",{enumerable:!0,get:function(){return Tr.OFFER_APPLIES_TO}}),exports.initialDynamicCouponErrorState=Tr.initialDynamicCouponErrorState,exports.initialStaticCouponErrorState=Tr.initialStaticCouponErrorState,exports.CountryCodePicker=xr.CountryCodePicker,exports.CountriesData=Pr.CountriesData,exports.DEFAULT_IMAGE=Sr.DEFAULT_IMAGE,exports.ShimmerImage=Sr.ShimmerImage,exports.ProductPickerModal=Ar.ProductPickerModal,Object.defineProperty(exports,"ScreenName",{enumerable:!0,get:function(){return Cr.ScreenName}}),exports.Carousel=yr.Carousel,exports.CarouselSecondary=Or.CarouselSecondary,exports.AccessTokenTroubleshootDialog=br.AccessTokenTroubleshootDialog,exports.RadioList=jr.RadioList,exports.CheckList=Er.CheckList,Object.defineProperty(exports,"DateKeys",{enumerable:!0,get:function(){return Rr.DateKeys}}),Object.defineProperty(exports,"MEDIA_TYPES",{enumerable:!0,get:function(){return Rr.MEDIA_TYPES}}),exports.PostPicker=Rr.PostPicker,exports.dateOptions=Rr.dateOptions,exports.DropdownButton=gr.DropdownButton,exports.SideModal=hr.SideModal,exports.KeywordsInput=Br.KeywordsInput,exports.AddVariableV2SideModal=Ir.AddVariableV2SideModal,exports.AddVariableV2=_r.AddVariableV2,exports.NaLinkWrapper=qr.NaLinkWrapper,exports.NavigationHyperlink=qr.NavigationHyperlink,exports.SearchFilter=fr.SearchFilter,exports.InputWithVariables=Dr.InputWithVariables,exports.DashboardReviewPopUp=Nr.DashboardReviewPopUp,exports.StarRating=kr.StarRating,exports.TestimonialCard=Lr.TestimonialCard,exports.BikSlider=wr.BikSlider,exports.ResizableImage=Mr.ResizableImage,exports.validateURL=Vr.validateURL,exports.CarouselPreview=vr.CarouselPreview,exports.Floater=Ur.Floater,exports.CardSelector=Gr.CardSelector,exports.CardSelectorGroup=Fr.CardSelectorGroup,exports.VariablePicker=Hr.VariablePicker,exports.ActionButtons=Wr.ActionButtons,exports.ActivateBikAi=Yr.ActivateBikAi,exports.AiSyncProgress=Qr.AiSyncProgress,exports.AiCreditsExhausted=Kr.AiCreditsExhausted,exports.AiCreditsLow=zr.AiCreditsLow,exports.CustomPortal=Zr.CustomPortal,exports.FloatingInputDropdown=Xr.FloatingInputDropdown,exports.MultilevelDropdownPopover=Jr.MultilevelDropdownPopover,exports.DropShadow=$r.DropShadow,exports.MultiLevelDropdown=et.MultiLevelDropdown,exports.DataSourcePanel=rt.DataSourcePanel,exports.UnsatisfactoryResponseList=tt.UnsatisfactoryResponseList,exports.UnsatisfactoryCountIntentWiseModal=ot.UnsatisfactoryCountIntentWiseModal,Object.defineProperty(exports,"CustomDataCategories",{enumerable:!0,get:function(){return nt.CustomDataCategories}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function(){return nt.CustomDataType}}),Object.defineProperty(exports,"CarouselVersion",{enumerable:!0,get:function(){return at.CarouselVersion}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./amplitude/index.js"),r=require("./components/template-preview/constants/regexPatterns.js"),t=require("./utils/StringUtils.js"),o=require("./constants/Theme.js"),n=require("./constants/zindex.js"),a=require("./components/checkBox/CheckBox.js"),i=require("./components/list-item/ListItem.js"),s=require("./components/pagination/Pagination.js"),p=require("./components/radioButton/RadioButton.js"),u=require("./components/toaster/Toaster.js"),c=require("./components/tooltips/Tooltip.js"),l=require("./components/spinner/Spinner.js"),d=require("./components/stepper/Stepper.js"),m=require("./components/tag/Tag.js"),T=require("./components/icon-button/IconButton.js"),x=require("./components/template-preview/TemplatePreview.js"),P=require("./components/template-preview/WhatsApp/WhatsAppLikePreview.js"),S=require("./components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),A=require("./components/template-preview/helpers/SmsTemplateHelper.js"),C=require("./components/template-preview/helpers/WhatsAppFormatToHTML.js"),y=require("./components/template-preview/helpers/VariableEditorHelper.js"),O=require("./components/template-preview/models/TemplateMeta.js"),b=require("./components/template-preview/models/WhatsAppTemplate.js"),j=require("./components/template-preview/models/Channels.js"),E=require("./components/template-context-mapper/TemplateContextMapper.js"),g=require("./components/template-context-mapper/utils/getDataFromTemplateComponent.js"),R=require("./components/template-context-mapper/utils/validateIsUrl.js");require("./_virtual/_tslib.js");var h=require("./components/template-context-mapper/modalElements/TemplateAnalyticsSkeleton.js"),B=require("./components/template-context-mapper/modalElements/TemplateAnalyticsComponent.js"),I=require("./components/fab-menu/FABMenu.js"),_=require("./components/floating-action-button/FloatingActionButton.js"),q=require("./components/floating-action-button/FloatingActionButton.styles.js"),f=require("./components/image-compress/ImageCompress.js"),D=require("./components/TypographyStyle.js"),k=require("./components/button/Button.js"),N=require("./components/progress-bar/ProgressBarComponent.js");require("react/jsx-runtime");var L=require("./components/progress-bar-v2/ProgressBarV2.js"),w=require("./components/QueryBuilder/QueryBuilder.js"),M=require("./components/QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),V=require("./components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.js"),v=require("./components/QueryBuilder/redux/queryBuilder.reducer.js"),U=require("./components/QueryBuilder/redux/queryBuilderCache.reducer.js"),G=require("./components/QueryBuilder/types/QueryBuilderOperator.type.js"),F=require("./components/modals/styledModal.js"),H=require("./components/dropdown/DropdownPopover/index.js"),W=require("./components/dropdown/Dropdown.js"),Y=require("./components/dropdown/ChipDropdown.js"),Q=require("./components/dropdown/OpenedDropdown/components/OpennedDropdown.js"),K=require("./components/dropdown/MenuItem/MenuItem.js"),z=require("./components/analytics-card/AnalyticsCard.js"),Z=require("./components/analytics-card/AnalyticsCard.styled.js"),X=require("./components/input/Input.js"),J=require("./components/analytics-chips-and-dropdowns/AnalyticsChip.js"),$=require("./components/analytics-chips-and-dropdowns/AnalyticsDropdown.js"),ee=require("./components/analytics-chips-and-dropdowns/AnalyticsMultiChip.js"),re=require("./components/analytics-chips-and-dropdowns/AnalyticsMetric.js"),te=require("./components/analytics-chips-and-dropdowns/AnalyticsTrend.js"),oe=require("./components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js"),ne=require("./components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.js"),ae=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js"),ie=require("./components/analytics-chips-and-dropdowns/chart/Pie/PieChart.js"),se=require("./components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.js"),pe=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.js"),ue=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.js"),ce=require("./components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarDistributionChart.model.js"),le=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.js"),de=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/FunnelVerticalBarGraph.js"),me=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMap.js"),Te=require("./components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.js"),xe=require("./components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),Pe=require("./components/analytics-chips-and-dropdowns/chart/utils/calcPercentage.js"),Se=require("./components/avatar/Avatar.js"),Ae=require("./components/avatar/AvatarHelper.js"),Ce=require("./components/alerts/Alert.js"),ye=require("./components/alerts/AlertHelper.js"),Oe=require("./components/thumbnail/Thumbnail.js"),be=require("./components/curtain/Curtain.js"),je=require("./components/datePicker/DatePicker.js"),Ee=require("./components/datePicker/DatePickerWrapper.js"),ge=require("./components/switch/Switch.js"),Re=require("./components/plans/SubscriptionPlan.js"),he=require("./components/plans/SubscriptionPlanSelector.js"),Be=require("./components/plans/NewSubscriptionPlan.js"),Ie=require("./components/plans/SubscriptionPlansCollected.js"),_e=require("./components/tabs/Tabs.js"),qe=require("./components/dynamic-tabs/DynamicTabs.js"),fe=require("./components/shimmer/ShimmerComponent/BikShimmer.js"),De=require("./components/TablePagination/TablePagination.js"),ke=require("./components/TablePagination/TablePaginationCard.js"),Ne=require("./components/states-modal/StateModalComponent.js"),Le=require("./components/states-modal/DeleteConfirmationModal.js"),we=require("./components/states/StateComponent.js"),Me=require("./components/states/ShopifyScopeWrapper.js"),Ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditor.js"),ve=require("./components/WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),Ue=require("./helpers/BaseWhatsappContentLang.helper.js"),Ge=require("./components/curtain/CurtainHelper.js"),Fe=require("./utils/resizeImage.js"),He=require("./components/variable-picker-v3/model.js"),We=require("./components/card-selection-modal/CardSelectionModal.js"),Ye=require("./components/image-cropper/BikImageCropper.js"),Qe=require("./components/image-cropper/BikImagePipeline/BikImagePipeline.js"),Ke=require("./components/buttonGroup/ButtonGroup.js"),ze=require("./components/accordion/Accordion.js"),Ze=require("./components/file-uploader/FileUploader.js"),Xe=require("./components/colourInput/ColourInput.js"),Je=require("./components/code-block/CodeBlock.js"),$e=require("./components/code-block/types.js"),er=require("./components/code-block/languageSpecificFormatting/html.js"),rr=require("./components/code-block/languageSpecificFormatting/javascript.js"),tr=require("./components/bik-layout/BikHeader.js"),or=require("./components/bik-layout/BikLayout.js"),nr=require("./components/bik-layout/BikProfile.js"),ar=require("./components/bik-layout/SimpleSidebar.js"),ir=require("./components/bik-layout/BikSidebar.js"),sr=require("./components/bik-layout/FeatureModal.js"),pr=require("./components/bik-layout/SidebarSkeleton.js"),ur=require("./components/bik-layout/ShowShopifyRestrictedModal.js"),cr=require("./components/bik-layout/FeatureModalV2.js"),lr=require("./components/searchBar/searchBar.js"),dr=require("./components/custom-date-time/CustomDateTime.js"),mr=require("./components/product-picker/ProductPickerModal.js"),Tr=require("./components/discount-modal/DiscountModal.js"),xr=require("./components/discount-modal/CouponExpiration/CouponExpiration.js"),Pr=require("./components/discount-modal/type.js"),Sr=require("./components/country-code-picker/CountryCodePicker.js"),Ar=require("./components/country-code-picker/CountryCodePicker.modal.js"),Cr=require("./components/shimmer-image/ShimmerImage.js"),yr=require("./components/product-picker-v2/modal.js"),Or=require("./components/product-picker-v2/type.js"),br=require("./components/carousel/carousel.js"),jr=require("./components/carousel-secondary/CarouselSecondary.js"),Er=require("./components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.js"),gr=require("./components/radioList/RadioList.js"),Rr=require("./components/checkList/CheckList.js"),hr=require("./components/postPicker/postPicker.js"),Br=require("./components/dropdown-button/DropdownButton.js"),Ir=require("./components/side-modal/SideModal.js"),_r=require("./components/keywords-input/KeywordsInput.js"),qr=require("./components/add-variableV2/AddVariableV2SideModal.js"),fr=require("./components/add-variableV2/AddVariableV2.js"),Dr=require("./components/navigation-hyperlink/NavigationHyperlink.js"),kr=require("./components/SearchFilter/index.js"),Nr=require("./components/input-with-vars/InputWithVariables.js"),Lr=require("./components/dashboard-review-popup/DashboardReviewPopUp.js"),wr=require("./components/star-rating/StarRating.js"),Mr=require("./components/testimonial-card/TestimonialCard.js"),Vr=require("./components/slider/slider.js"),vr=require("./components/resizeImage/index.js"),Ur=require("./utils/validator.js"),Gr=require("./components/carousel-preview/CarouselPreview.js"),Fr=require("./components/floater/floater.js"),Hr=require("./components/card-selector/CardSelector.js"),Wr=require("./components/card-selector/CardSelectorGroup.js"),Yr=require("./components/variable-picker-v3/VariablePicker.js"),Qr=require("./components/action-button/ActionButtons.js"),Kr=require("./components/ai-modals/ActivateBikAI.js"),zr=require("./components/ai-modals/AiSyncProgress.js"),Zr=require("./components/ai-modals/AiCreditsExhausted.js"),Xr=require("./components/ai-modals/AiCreditsLow.js"),Jr=require("./components/input-with-vars/customPortal.js"),$r=require("./components/floating-input-dropdown/FloatingInputDropdown.js"),et=require("./components/dropdown/MultilevelDropdownPopover/index.js"),rt=require("./components/dropShadow/DropShadow.js"),tt=require("./components/multi-level-dropdown/MultiLevelDropdown.js"),ot=require("./components/data-source-panel/DataSourcePanel.js"),nt=require("./components/unsatisfactory-response-list/UnsatisfactoryResponseList.js"),at=require("./components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.js"),it=require("./components/data-source-panel/model.js"),st=require("./components/carousel-secondary/model.js");exports.AmplitudeEvent=e.AmplitudeEvent,exports.regexPatterns=r,exports.StringUtils=t.default,exports.BASE_COLORS=o.BASE_COLORS,exports.COLORS=o.COLORS,exports.DEFAULT_THEME=o.DEFAULT_THEME,exports.FONTS=o.FONTS,exports.ComponentZindex=n.ComponentZindex,exports.CheckBox=a.CheckBox,exports.ListItem=i.ListItem,exports.Pagination=s.Pagination,exports.RadioButton=p.RadioButton,exports.Toaster=u.Toaster,exports.Tooltip=c.Tooltip,exports.PureSpinner=l.PureSpinner,exports.Spinner=l.Spinner,exports.Stepper=d.Stepper,exports.Tag=m.Tag,exports.IconButton=T.IconButton,exports.TemplatePreview=x.TemplatePreview,exports.WhatsappLikePreview=P.WhatsappLikePreview,exports.WhatsappLikePreviewV2=S.WhatsappLikePreviewV2,exports.renderVariableUIForPreview=A.renderVariableUIForPreview,exports.WhatsAppFormatToHTML=C.WhatsAppFormatToHTML,exports.VariableEditorHelper=y.VariableEditorHelper,Object.defineProperty(exports,"ACTIONS_TYPES",{enumerable:!0,get:function(){return O.ACTIONS_TYPES}}),exports.CUSTOM_URL_NAME=O.CUSTOM_URL_NAME,Object.defineProperty(exports,"HEADER_TYPES",{enumerable:!0,get:function(){return O.HEADER_TYPES}}),exports.STATIC_URL_CTA_OPTION=O.STATIC_URL_CTA_OPTION,Object.defineProperty(exports,"TEMPLATE_EDITOR",{enumerable:!0,get:function(){return O.TEMPLATE_EDITOR}}),Object.defineProperty(exports,"TEMPLATE_STATUS",{enumerable:!0,get:function(){return O.TEMPLATE_STATUS}}),Object.defineProperty(exports,"BUTTON_TYPE",{enumerable:!0,get:function(){return b.BUTTON_TYPE}}),Object.defineProperty(exports,"POD",{enumerable:!0,get:function(){return b.POD}}),Object.defineProperty(exports,"TEMPLATE_QUALITY",{enumerable:!0,get:function(){return b.TEMPLATE_QUALITY}}),Object.defineProperty(exports,"CHANNEL_TYPE",{enumerable:!0,get:function(){return j.CHANNEL_TYPE}}),exports.TemplateContextMapper=E.TemplateContextMapper,exports.getAllDataFromTemplateComponent=g.getAllDataFromTemplateComponent,exports.getAllDataFromWebpushTemplateComponent=g.getAllDataFromWebpushTemplateComponent,exports.isVariable=R.isVariable,exports.validateIsUrl=R.validateIsUrl,exports.TemplateAnalyticsSkeleton=h.TemplateAnalyticsSkeleton,exports.AnalyticsItem=B.AnalyticsItem,exports.RightPanelTemplateAnalytics=B.RightPanelTemplateAnalytics,exports.TemplateAnalyticsComponent=B.TemplateAnalyticsComponent,exports.FABMenu=I.FABMenu,exports.FloatingActionButton=_.FloatingActionButton,Object.defineProperty(exports,"DROP_POSITION",{enumerable:!0,get:function(){return q.DROP_POSITION}}),exports.DropdownToggleContainer=q.DropdownToggleContainer,Object.defineProperty(exports,"FAB_POSITION",{enumerable:!0,get:function(){return q.FAB_POSITION}}),exports.FloatingActionButtonContainer=q.FloatingActionButtonContainer,exports.FloatingActionButtonOuterContainer=q.FloatingActionButtonOuterContainer,Object.defineProperty(exports,"MENU_ALIGNMENT",{enumerable:!0,get:function(){return q.MENU_ALIGNMENT}}),exports.StyledDropdown=q.StyledDropdown,exports.TooltipStyled=q.TooltipStyled,exports.ImageService=f.ImageService,exports.AiBodyCaption=D.AiBodyCaption,exports.AiBodyTiny=D.AiBodyTiny,exports.BodyCaption=D.BodyCaption,exports.BodyLarge=D.BodyLarge,exports.BodyPrimary=D.BodyPrimary,exports.BodyPrimaryLink=D.BodyPrimaryLink,exports.BodyRegular=D.BodyRegular,exports.BodySecondary=D.BodySecondary,exports.BodySecondaryLink=D.BodySecondaryLink,exports.BodySmall=D.BodySmall,exports.BodyTiny=D.BodyTiny,exports.ButtonLarge=D.ButtonLarge,exports.ButtonLargeAI=D.ButtonLargeAI,exports.ButtonRegular=D.ButtonRegular,exports.ButtonRegularAI=D.ButtonRegularAI,exports.Caption=D.Caption,exports.CaptionBold=D.CaptionBold,exports.Display=D.Display,exports.SmallRegular=D.SmallRegular,exports.SubHeading=D.SubHeading,exports.TextPlaceholder=D.TextPlaceholder,exports.Tiny=D.Tiny,exports.TitleFour=D.TitleFour,exports.TitleLarge=D.TitleLarge,exports.TitleMedium=D.TitleMedium,exports.TitleRegular=D.TitleRegular,exports.TitleSmall=D.TitleSmall,exports.TitleXlarge=D.TitleXlarge,exports.Button=k.Button,exports.ProgressBarComponent=N.ProgressBarComponent,exports.ProgressCompletedBar=N.ProgressCompletedBar,Object.defineProperty(exports,"ProgressBarType",{enumerable:!0,get:function(){return L.ProgressBarType}}),exports.ProgressBarV2=L.ProgressBarV2,Object.defineProperty(exports,"TextAlignment",{enumerable:!0,get:function(){return L.TextAlignment}}),exports.QueryBuilder=w.QueryBuilder,exports.BaseQueryBuilderNode=M.BaseQueryBuilderNode,exports.PropertyNode=V.PropertyNode,exports.PropertyNodeHeadless=V.PropertyNodeHeadless,exports.queryBuilderSlice=v.queryBuilderSlice,exports.queryBuilderCacheSlice=U.queryBuilderCacheSlice,Object.defineProperty(exports,"AD_STRING_OPERATORS",{enumerable:!0,get:function(){return G.AD_STRING_OPERATORS}}),Object.defineProperty(exports,"ANY_AD_OPERATORS",{enumerable:!0,get:function(){return G.ANY_AD_OPERATORS}}),Object.defineProperty(exports,"ANY_IG_OPERATORS",{enumerable:!0,get:function(){return G.ANY_IG_OPERATORS}}),Object.defineProperty(exports,"BOOLEAN_OPERATORS",{enumerable:!0,get:function(){return G.BOOLEAN_OPERATORS}}),Object.defineProperty(exports,"DATE_OPERATORS",{enumerable:!0,get:function(){return G.DATE_OPERATORS}}),Object.defineProperty(exports,"EVENT_VALUES",{enumerable:!0,get:function(){return G.EVENT_VALUES}}),Object.defineProperty(exports,"EXACTLY_OPERATORS",{enumerable:!0,get:function(){return G.EXACTLY_OPERATORS}}),Object.defineProperty(exports,"FREQUENCY_OPERATORS",{enumerable:!0,get:function(){return G.FREQUENCY_OPERATORS}}),Object.defineProperty(exports,"ICE_BREAKER_OPERATORS",{enumerable:!0,get:function(){return G.ICE_BREAKER_OPERATORS}}),Object.defineProperty(exports,"IG_STRING_OPERATORS",{enumerable:!0,get:function(){return G.IG_STRING_OPERATORS}}),Object.defineProperty(exports,"INTEGER_OPERATORS",{enumerable:!0,get:function(){return G.INTEGER_OPERATORS}}),Object.defineProperty(exports,"MAIL_SUBJECT_OPERATORS",{enumerable:!0,get:function(){return G.MAIL_SUBJECT_OPERATORS}}),Object.defineProperty(exports,"REACTION_OPERATORS",{enumerable:!0,get:function(){return G.REACTION_OPERATORS}}),Object.defineProperty(exports,"SPECIFIC_IG_OPERATORS",{enumerable:!0,get:function(){return G.SPECIFIC_IG_OPERATORS}}),Object.defineProperty(exports,"STRING_OPERATORS",{enumerable:!0,get:function(){return G.STRING_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_2",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_2}}),Object.defineProperty(exports,"STRING_RESTRICTED_OPERATORS_3",{enumerable:!0,get:function(){return G.STRING_RESTRICTED_OPERATORS_3}}),exports.StyledModal=F.StyledModal,exports.DropdownPopover=H.DropdownPopover,exports.Dropdown=W.Dropdown,exports.ChipDropdown=Y.ChipDropdown,exports.ChipDropdownContainer=Y.ChipDropdownContainer,exports.OpenedDropdown=Q.OpenedDropdown,exports.MenuItemDropdown=K.MenuItemDropdown,exports.AnalyticsCard=z.AnalyticsCard,exports.AnalyticsContainer=Z.AnalyticsContainer,exports.CardDataContainer=Z.CardDataContainer,exports.Input=X.Input,exports.AnalyticsChip=J.AnalyticsChip,exports.AnalyticsDropdown=$.AnalyticsDropdown,exports.EachItem=$.EachItem,exports.formatDate=$.formatDate,exports.AnalyticsMultiChip=ee.AnalyticsMultiChip,exports.AnalyticsMetric=re.AnalyticsMetric,exports.AnalyticsTrend=te.AnalyticsTrend,exports.LineChart=oe.LineChart,exports.LinearChipGroupedChart=ne.LinearChipGroupedChart,exports.Card=ae.Card,exports.PieChartAnalytics=ae.PieChartAnalytics,exports.PieChart=ie.PieChart,exports.HorizontalGraph=se.HorizontalGraph,exports.StackedBarChart=pe.StackedBarChart,exports.StackedBarDistributionChart=ue.StackedBarDistributionChart,Object.defineProperty(exports,"GRAPH_ORIENTATION",{enumerable:!0,get:function(){return ce.GRAPH_ORIENTATION}}),exports.VerticalGraph=le.VerticalGraph,exports.FunnelVerticalBarGraph=de.FunnelVerticalBarGraph,Object.defineProperty(exports,"HEAT",{enumerable:!0,get:function(){return me.HEAT}}),exports.HEAT_COLORS=me.HEAT_COLORS,Object.defineProperty(exports,"HEAT_GRADING_TYPE",{enumerable:!0,get:function(){return me.HEAT_GRADING_TYPE}}),exports.HeatMap=me.HeatMap,exports.HeatBoxStyled=Te.HeatBoxStyled,exports.HeatMapVertical=Te.HeatMapVertical,exports.VerticalBarAndLinearGraph=xe.VerticalBarAndLinearGraph,Object.defineProperty(exports,"TruncateValue",{enumerable:!0,get:function(){return Pe.TruncateValue}}),exports.calculatePercentage=Pe.calculatePercentage,exports.roundNumber=Pe.roundNumber,exports.truncateValueForIndianStore=Pe.truncateValueForIndianStore,exports.truncateValueForInternationalStore=Pe.truncateValueForInternationalStore,exports.truncateValueTo10K=Pe.truncateValueTo10K,exports.truncateValueToA=Pe.truncateValueToA,exports.truncateValueToB=Pe.truncateValueToB,exports.truncateValueToC=Pe.truncateValueToC,exports.truncateValueToK=Pe.truncateValueToK,exports.truncateValueToL=Pe.truncateValueToL,exports.truncateValueToM=Pe.truncateValueToM,exports.truncateValueToT=Pe.truncateValueToT,exports.AVATAR_SIZE_VS_ICON_SIZE_MAP=Se.AVATAR_SIZE_VS_ICON_SIZE_MAP,exports.Avatar=Se.Avatar,exports.BACKGROUND_VS_TEXT_COLOR_MAP=Se.BACKGROUND_VS_TEXT_COLOR_MAP,Object.defineProperty(exports,"MESSAGE_CHANNELS",{enumerable:!0,get:function(){return Se.MESSAGE_CHANNELS}}),Object.defineProperty(exports,"AVATAR_BACKGROUND",{enumerable:!0,get:function(){return Ae.AVATAR_BACKGROUND}}),exports.AVATAR_SIZE_MAP=Ae.AVATAR_SIZE_MAP,Object.defineProperty(exports,"AVATAR_TYPES",{enumerable:!0,get:function(){return Ae.AVATAR_TYPES}}),Object.defineProperty(exports,"SIZE",{enumerable:!0,get:function(){return Ae.SIZE}}),exports.Alert=Ce.Alert,Object.defineProperty(exports,"ALERT_TYPES",{enumerable:!0,get:function(){return ye.ALERT_TYPES}}),exports.COLOR_CONFIG_MAP=ye.COLOR_CONFIG_MAP,Object.defineProperty(exports,"CONTENT_POSITION",{enumerable:!0,get:function(){return ye.CONTENT_POSITION}}),Object.defineProperty(exports,"RATIO",{enumerable:!0,get:function(){return Oe.RATIO}}),exports.Thumbnail=Oe.Thumbnail,exports.Curtain=be.Curtain,exports.DatePicker=je.DatePicker,exports.DatePickerWrapper=Ee.DatePickerWrapper,exports.Loader=ge.Loader,exports.Switch=ge.Switch,exports.SwitchContainer=ge.SwitchContainer,exports.Thumb=ge.Thumb,exports.SubscriptionPlan=Re.SubscriptionPlan,exports.BottomWrapper=he.BottomWrapper,exports.HeaderWrapper=he.HeaderWrapper,exports.SubscriptionPlanSelector=he.SubscriptionPlanSelector,exports.defaultTabs=he.defaultTabs,exports.NewSubscriptionPlan=Be.NewSubscriptionPlan,exports.SubscriptionPlansCollected=Ie.SubscriptionPlansCollected,exports.TabItemComponent=_e.TabItemComponent,exports.Tabs=_e.Tabs,exports.DynamicTabs=qe.DynamicTabs,exports.BikShimmer=fe.BikShimmer,exports.TablePagination=De.TablePagination,exports.TablePaginationCard=ke.TablePaginationCard,exports.TablePaginationCardStyled=ke.TablePaginationCardStyled,exports.StateModalComponent=Ne.StateModalComponent,exports.DeleteConfirmationModal=Le.DeleteConfirmationModal,Object.defineProperty(exports,"ButtonActions",{enumerable:!0,get:function(){return we.ButtonActions}}),Object.defineProperty(exports,"ButtonTypes",{enumerable:!0,get:function(){return we.ButtonTypes}}),exports.StateComponent=we.StateComponent,Object.defineProperty(exports,"StateInterface",{enumerable:!0,get:function(){return we.StateInterface}}),exports.ShopifyScopeWrapper=Me.ShopifyScopeWrapper,exports.WhatsAppTextEditor=Ve.WhatsAppTextEditor,exports.CustomRightBorder=ve.CustomRightBorder,Object.defineProperty(exports,"EditorActionTypes",{enumerable:!0,get:function(){return ve.EditorActionTypes}}),exports.WhatsAppTextEditorHeader=ve.WhatsAppTextEditorHeader,exports.BaseWhatsappContentLangHelper=Ue.BaseWhatsappContentLangHelper,exports.CURTAIN_COLOR_CONFIG_MAP=Ge.CURTAIN_COLOR_CONFIG_MAP,Object.defineProperty(exports,"CURTAIN_MODE",{enumerable:!0,get:function(){return Ge.CURTAIN_MODE}}),Object.defineProperty(exports,"CURTAIN_TYPES",{enumerable:!0,get:function(){return Ge.CURTAIN_TYPES}}),exports.resizeImage=Fe.resizeImage,Object.defineProperty(exports,"PickerType",{enumerable:!0,get:function(){return He.PickerType}}),exports.CardSelectionModal=We.CardSelectionModal,exports.BikImageCropper=Ye.BikImageCropper,exports.BikImagePipeline=Qe.BikImagePipeline,exports.ButtonGroup=Ke.ButtonGroup,exports.BikAccordion=ze.BikAccordion,exports.FileUploader=Ze.FileUploader,exports.ColourInput=Xe.ColourInput,exports.CodeBlock=Je.CodeBlock,Object.defineProperty(exports,"CodeLanguage",{enumerable:!0,get:function(){return $e.CodeLanguage}}),exports.format=er.format,exports.colorMap=rr.colorMap,exports.colorOverWrite=rr.colorOverWrite,exports.BikHeader=tr.BikHeader,exports.BikLayout=or.BikLayout,exports.BikProfile=nr.BikProfile,exports.SimpleSidebar=ar.SimpleSidebar,exports.BikSidebar=ir.BikSidebar,exports.FeatureModal=sr.FeatureModal,exports.SidebarSkeleton=pr.SidebarSkeleton,exports.ShowShopifyRestrictedModal=ur.ShowShopifyRestrictedModal,exports.FeatureModalV2=cr.FeatureModalV2,exports.SearchBar=lr.SearchBar,exports.CustomDateTime=dr.CustomDateTime,exports.PricePleaseProductPicker=mr.PricePleaseProductPicker,exports.ProductPickerContent=mr.ProductPickerContent,exports.DiscountModal=Tr.DiscountModal,exports.CouponExpiration=xr.CouponExpiration,Object.defineProperty(exports,"COUPON_EXPIRATION",{enumerable:!0,get:function(){return Pr.COUPON_EXPIRATION}}),Object.defineProperty(exports,"DISCOUNT_APPLIES_TO",{enumerable:!0,get:function(){return Pr.DISCOUNT_APPLIES_TO}}),Object.defineProperty(exports,"DISCOUNT_TARGET_SELECTION",{enumerable:!0,get:function(){return Pr.DISCOUNT_TARGET_SELECTION}}),Object.defineProperty(exports,"DISCOUNT_TARGET_TYPES",{enumerable:!0,get:function(){return Pr.DISCOUNT_TARGET_TYPES}}),Object.defineProperty(exports,"DISCOUNT_TYPES",{enumerable:!0,get:function(){return Pr.DISCOUNT_TYPES}}),Object.defineProperty(exports,"DISCOUNT_VALUE_TYPES",{enumerable:!0,get:function(){return Pr.DISCOUNT_VALUE_TYPES}}),Object.defineProperty(exports,"MIN_PURCHASE_REQUIREMENT",{enumerable:!0,get:function(){return Pr.MIN_PURCHASE_REQUIREMENT}}),Object.defineProperty(exports,"OFFER_APPLIES_TO",{enumerable:!0,get:function(){return Pr.OFFER_APPLIES_TO}}),exports.initialDynamicCouponErrorState=Pr.initialDynamicCouponErrorState,exports.initialStaticCouponErrorState=Pr.initialStaticCouponErrorState,exports.CountryCodePicker=Sr.CountryCodePicker,exports.CountriesData=Ar.CountriesData,exports.DEFAULT_IMAGE=Cr.DEFAULT_IMAGE,exports.ShimmerImage=Cr.ShimmerImage,exports.ProductPickerModal=yr.ProductPickerModal,Object.defineProperty(exports,"ScreenName",{enumerable:!0,get:function(){return Or.ScreenName}}),exports.Carousel=br.Carousel,exports.CarouselSecondary=jr.CarouselSecondary,exports.AccessTokenTroubleshootDialog=Er.AccessTokenTroubleshootDialog,exports.RadioList=gr.RadioList,exports.CheckList=Rr.CheckList,Object.defineProperty(exports,"DateKeys",{enumerable:!0,get:function(){return hr.DateKeys}}),Object.defineProperty(exports,"MEDIA_TYPES",{enumerable:!0,get:function(){return hr.MEDIA_TYPES}}),exports.PostPicker=hr.PostPicker,exports.dateOptions=hr.dateOptions,exports.DropdownButton=Br.DropdownButton,exports.SideModal=Ir.SideModal,exports.KeywordsInput=_r.KeywordsInput,exports.AddVariableV2SideModal=qr.AddVariableV2SideModal,exports.AddVariableV2=fr.AddVariableV2,exports.NaLinkWrapper=Dr.NaLinkWrapper,exports.NavigationHyperlink=Dr.NavigationHyperlink,exports.SearchFilter=kr.SearchFilter,exports.InputWithVariables=Nr.InputWithVariables,exports.DashboardReviewPopUp=Lr.DashboardReviewPopUp,exports.StarRating=wr.StarRating,exports.TestimonialCard=Mr.TestimonialCard,exports.BikSlider=Vr.BikSlider,exports.ResizableImage=vr.ResizableImage,exports.validateURL=Ur.validateURL,exports.CarouselPreview=Gr.CarouselPreview,exports.Floater=Fr.Floater,exports.CardSelector=Hr.CardSelector,exports.CardSelectorGroup=Wr.CardSelectorGroup,exports.VariablePicker=Yr.VariablePicker,exports.ActionButtons=Qr.ActionButtons,exports.ActivateBikAi=Kr.ActivateBikAi,exports.AiSyncProgress=zr.AiSyncProgress,exports.AiCreditsExhausted=Zr.AiCreditsExhausted,exports.AiCreditsLow=Xr.AiCreditsLow,exports.CustomPortal=Jr.CustomPortal,exports.FloatingInputDropdown=$r.FloatingInputDropdown,exports.MultilevelDropdownPopover=et.MultilevelDropdownPopover,exports.DropShadow=rt.DropShadow,exports.MultiLevelDropdown=tt.MultiLevelDropdown,exports.DataSourcePanel=ot.DataSourcePanel,exports.UnsatisfactoryResponseList=nt.UnsatisfactoryResponseList,exports.UnsatisfactoryCountIntentWiseModal=at.UnsatisfactoryCountIntentWiseModal,Object.defineProperty(exports,"CustomDataCategories",{enumerable:!0,get:function(){return it.CustomDataCategories}}),Object.defineProperty(exports,"CustomDataType",{enumerable:!0,get:function(){return it.CustomDataType}}),Object.defineProperty(exports,"CarouselVersion",{enumerable:!0,get:function(){return st.CarouselVersion}});
@@ -0,0 +1 @@
1
+ "use strict";var e=require("../../../../_virtual/_commonjsHelpers.js"),r=require("../../../../_virtual/index.js");require("./models/store.js"),require("./models/billing.js"),require("./models/bik-store.js");var o,t,i,s=require("../../../../_virtual/store.js"),l=require("../../../../_virtual/billing.js"),n=require("../../../../_virtual/bik-store.js");o=r.__exports,t=e.commonjsGlobal&&e.commonjsGlobal.__createBinding||(Object.create?function(e,r,o,t){void 0===t&&(t=o);var i=Object.getOwnPropertyDescriptor(r,o);i&&!("get"in i?!r.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return r[o]}}),Object.defineProperty(e,t,i)}:function(e,r,o,t){void 0===t&&(t=o),e[t]=r[o]}),i=e.commonjsGlobal&&e.commonjsGlobal.__exportStar||function(e,r){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(r,o)||t(r,e,o)},Object.defineProperty(o,"__esModule",{value:!0}),i(s.__exports,o),i(l.__exports,o),i(n.__exports,o);
@@ -0,0 +1 @@
1
+ "use strict";!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ExchangeRateMap=e.PACKAGES=e.TIER=e.PACKAGENAMES=e.MANIFEST_PACKAGENAMES=void 0;const _=14;var a,r,i;(a=e.MANIFEST_PACKAGENAMES||(e.MANIFEST_PACKAGENAMES={})).FREE="FREE",a.GLOBAL_STARTER_1_MONTH="GLOBAL_STARTER_1_MONTH",a.GLOBAL_BOOST_1_MONTH="GLOBAL_BOOST_1_MONTH",a.GLOBAL_GROWTH_1_MONTH="GLOBAL_GROWTH_1_MONTH",a.GLOBAL_SCALE_1_MONTH="GLOBAL_SCALE_1_MONTH",a.GLOBAL_STARTER_12_MONTH="GLOBAL_STARTER_12_MONTH",a.GLOBAL_BOOST_12_MONTH="GLOBAL_BOOST_12_MONTH",a.GLOBAL_GROWTH_12_MONTH="GLOBAL_GROWTH_12_MONTH",a.GLOBAL_SCALE_12_MONTH="GLOBAL_SCALE_12_MONTH",a.GLOBAL_BASIC_1_MONTH="GLOBAL_BASIC_1_MONTH",a.GLOBAL_PREMIUM_1_MONTH="GLOBAL_PREMIUM_1_MONTH",a.GLOBAL_VIP_1_MONTH="GLOBAL_VIP_1_MONTH",a.GLOBAL_ENTERPRISE_1_MONTH="GLOBAL_ENTERPRISE_1_MONTH",a.GLOBAL_BASIC_12_MONTH="GLOBAL_BASIC_12_MONTH",a.GLOBAL_PREMIUM_12_MONTH="GLOBAL_PREMIUM_12_MONTH",a.GLOBAL_VIP_12_MONTH="GLOBAL_VIP_12_MONTH",a.GLOBAL_ENTERPRISE_12_MONTH="GLOBAL_ENTERPRISE_12_MONTH",function(e){e.BIK_INSTAGRAM_PLAN="BIK_INSTAGRAM_PLAN",e.BIK_GROWTH_PLAN="BIK_GROWTH_PLAN",e.BIK_BUSINESS_PLAN="BIK_BUSINESS_PLAN",e.BIK_CUSTOM_PLAN="BIK_CUSTOM_PLAN",e.BIK_FREE_PLAN="BIK_FREE_PLAN",e.BIK_PLG_GROWTH_PLAN="BIK_PLG_GROWTH_PLAN",e.BIK_PLG_BUSINESS_PLAN="BIK_PLG_BUSINESS_PLAN",e.BIK_PLG_STARTER_PLAN="BIK_PLG_STARTER_PLAN",e.BIK_SALES_STARTER_PLAN="BIK_SALES_STARTER_PLAN",e.BIK_SALES_GROWTH_PLAN="BIK_SALES_GROWTH_PLAN",e.BIK_SALES_BUSINESS_PLAN="BIK_SALES_BUSINESS_PLAN"}(r=e.PACKAGENAMES||(e.PACKAGENAMES={})),function(e){e.TIER_0="TIER_0",e.TIER_1="TIER_1",e.TIER_2="TIER_2",e.TIER_3="TIER_3",e.TIER_4="TIER_4",e.TIER_5="TIER_5",e.TIER_6="TIER_6"}(i=e.TIER||(e.TIER={})),e.PACKAGES={FREE:{packageName:"FREE",quota:100,duration:30,description:"Free plan",price:0,freeTrialDays:0,overagePrice:0,overageAllowed:0},GLOBAL_STARTER_1_MONTH:{packageName:"GLOBAL_STARTER_1_MONTH",quota:1e3,duration:30,description:"Bik Starter Monthly Package",price:39,freeTrialDays:_,overagePrice:.04,overageAllowed:4975},GLOBAL_BOOST_1_MONTH:{packageName:"GLOBAL_BOOST_1_MONTH",quota:3e3,duration:30,description:"Bik Boost Monthly Package",price:99,freeTrialDays:_,overagePrice:.04,overageAllowed:4975},GLOBAL_GROWTH_1_MONTH:{packageName:"GLOBAL_GROWTH_1_MONTH",quota:7500,duration:30,description:"Bik Growth Monthly Package",price:249,freeTrialDays:_,overagePrice:.035,overageAllowed:14229},GLOBAL_SCALE_1_MONTH:{packageName:"GLOBAL_SCALE_1_MONTH",quota:3e4,duration:30,description:"Bik Scale Monthly Package",price:799,freeTrialDays:_,overagePrice:.025,overageAllowed:63920},GLOBAL_STARTER_12_MONTH:{packageName:"GLOBAL_STARTER_12_MONTH",quota:12e3,duration:365,description:"Bik Starter Annual Package",price:399,freeTrialDays:_},GLOBAL_BOOST_12_MONTH:{packageName:"GLOBAL_BOOST_12_MONTH",quota:36e3,duration:365,description:"Bik Boost Annual Package",price:999,freeTrialDays:_},GLOBAL_GROWTH_12_MONTH:{packageName:"GLOBAL_GROWTH_12_MONTH",quota:9e4,duration:365,description:"Bik Growth Annual Package",price:2499,freeTrialDays:_},GLOBAL_SCALE_12_MONTH:{packageName:"GLOBAL_SCALE_12_MONTH",quota:36e4,duration:365,description:"Bik Scale Annual Package",price:7999,freeTrialDays:_},GLOBAL_BASIC_1_MONTH:{packageName:"GLOBAL_BASIC_1_MONTH",quota:600,duration:30,description:"Bik Basic Monthly Package",price:99,freeTrialDays:7,overagePrice:.2,overageAllowed:1500},GLOBAL_PREMIUM_1_MONTH:{packageName:"GLOBAL_PREMIUM_1_MONTH",quota:2500,duration:30,description:"Bik Premium Monthly Package",price:249,freeTrialDays:7,overagePrice:.15,overageAllowed:5e3},GLOBAL_VIP_1_MONTH:{packageName:"GLOBAL_VIP_1_MONTH",quota:7e3,duration:30,description:"Bik VIP Monthly Package",price:499,freeTrialDays:7,overagePrice:.1,overageAllowed:15e3},GLOBAL_ENTERPRISE_1_MONTH:{packageName:"GLOBAL_ENTERPRISE_1_MONTH",quota:7e3,duration:30,description:"Manifest Enterprise Monthly Package",price:499,overagePrice:.1,overageAllowed:15e3,freeTrialDays:7},GLOBAL_BASIC_12_MONTH:{packageName:"GLOBAL_BASIC_12_MONTH",quota:7200,duration:365,description:"Bik Basic Annual Package",price:999,freeTrialDays:7},GLOBAL_PREMIUM_12_MONTH:{packageName:"GLOBAL_PREMIUM_12_MONTH",quota:3e4,duration:365,description:"Bik Premium Annual Package",price:2499,freeTrialDays:7},GLOBAL_VIP_12_MONTH:{packageName:"GLOBAL_VIP_12_MONTH",quota:84e3,duration:365,description:"Bik VIP Annual Package",price:4999,freeTrialDays:7},GLOBAL_ENTERPRISE_12_MONTH:{packageName:"GLOBAL_ENTERPRISE_12_MONTH",quota:84e3,duration:365,description:"Manifest Enterprise Annual Package",price:4999,freeTrialDays:7},[r.BIK_INSTAGRAM_PLAN]:{packageName:r.BIK_INSTAGRAM_PLAN,quota:2990,duration:30,description:"Instagram Plan",price:299,freeTrialDays:14,overageAllowed:598,waFreeCredits:1.1,emailFreeCredits:5.95,freeContacts:1e4,emailUnitCost:37e-5},[r.BIK_GROWTH_PLAN]:{packageName:r.BIK_GROWTH_PLAN,quota:5990,duration:30,description:"Growth Plan",price:599,freeTrialDays:14,overageAllowed:1198,waFreeCredits:4.95,emailFreeCredits:35.71,freeContacts:1e5,emailUnitCost:37e-5,tierMapping:{[i.TIER_1]:{price:199},[i.TIER_2]:{price:269},[i.TIER_3]:{price:469},[i.TIER_4]:{price:669},[i.TIER_5]:{price:819}}},[r.BIK_BUSINESS_PLAN]:{packageName:r.BIK_BUSINESS_PLAN,quota:7990,duration:30,description:"Business Plan",price:799,freeTrialDays:14,overageAllowed:1598,waFreeCredits:49.5,emailFreeCredits:35.71,emailUnitCost:37e-5,freeContacts:2e6,tierMapping:{[i.TIER_1]:{price:250},[i.TIER_2]:{price:339},[i.TIER_3]:{price:589},[i.TIER_4]:{price:829},[i.TIER_5]:{price:999}}},[r.BIK_CUSTOM_PLAN]:{packageName:r.BIK_CUSTOM_PLAN,quota:5e3,duration:30,description:"Custom Plan",price:0,freeTrialDays:0,overageAllowed:79900,waFreeCredits:12.5,emailFreeCredits:12.5,emailUnitCost:37e-5},[r.BIK_FREE_PLAN]:{packageName:r.BIK_FREE_PLAN,quota:10,duration:30,description:"Free Plan",price:0,freeTrialDays:0,overageAllowed:10,waFreeCredits:.55,emailFreeCredits:.6,freeContacts:500,emailUnitCost:37e-5},[r.BIK_PLG_STARTER_PLAN]:{packageName:r.BIK_PLG_STARTER_PLAN,quota:990,duration:30,description:"BIK Starter Plan",price:99,freeTrialDays:14,overageAllowed:198,waFreeCredits:1.1,emailFreeCredits:5.95,freeContacts:1e4,emailUnitCost:37e-5,tierMapping:{[i.TIER_1]:{price:99},[i.TIER_2]:{price:169},[i.TIER_3]:{price:179},[i.TIER_4]:{price:329},[i.TIER_5]:{price:529}}},[r.BIK_PLG_GROWTH_PLAN]:{packageName:r.BIK_PLG_GROWTH_PLAN,quota:3990,duration:30,description:"BIK Growth Plan",price:399,freeTrialDays:14,overageAllowed:798,waFreeCredits:4.95,emailFreeCredits:35.71,freeContacts:1e5,emailUnitCost:37e-5,tierMapping:{[i.TIER_1]:{price:199},[i.TIER_2]:{price:269},[i.TIER_3]:{price:469},[i.TIER_4]:{price:669},[i.TIER_5]:{price:819}}},[r.BIK_PLG_BUSINESS_PLAN]:{packageName:r.BIK_PLG_BUSINESS_PLAN,quota:7990,duration:30,description:"BIK Business Plan",price:799,freeTrialDays:14,overageAllowed:1598,waFreeCredits:49.5,emailFreeCredits:35.71,freeContacts:2e6,emailUnitCost:37e-5,tierMapping:{[i.TIER_1]:{price:250},[i.TIER_2]:{price:339},[i.TIER_3]:{price:589},[i.TIER_4]:{price:829},[i.TIER_5]:{price:999}}},[r.BIK_SALES_STARTER_PLAN]:{packageName:r.BIK_SALES_STARTER_PLAN,quota:990,duration:30,description:"BIK Sales Starter Plan",price:99,freeTrialDays:14,overageAllowed:198,waFreeCredits:0,emailFreeCredits:0,freeContacts:0,emailUnitCost:37e-5,tierMapping:{[i.TIER_1]:{price:99},[i.TIER_2]:{price:169},[i.TIER_3]:{price:179},[i.TIER_4]:{price:329},[i.TIER_5]:{price:529}}},[r.BIK_SALES_GROWTH_PLAN]:{packageName:r.BIK_SALES_GROWTH_PLAN,quota:3990,duration:30,description:"BIK Sales Growth Plan",price:399,freeTrialDays:14,overageAllowed:798,waFreeCredits:0,emailFreeCredits:0,freeContacts:0,emailUnitCost:37e-5,tierMapping:{[i.TIER_1]:{price:199},[i.TIER_2]:{price:269},[i.TIER_3]:{price:469},[i.TIER_4]:{price:669},[i.TIER_5]:{price:819}}},[r.BIK_SALES_BUSINESS_PLAN]:{packageName:r.BIK_SALES_BUSINESS_PLAN,quota:7990,duration:30,description:"BIK Sales Business Plan",price:799,freeTrialDays:14,overageAllowed:1598,waFreeCredits:0,emailFreeCredits:0,freeContacts:0,emailUnitCost:37e-5,tierMapping:{[i.TIER_1]:{price:250},[i.TIER_2]:{price:339},[i.TIER_3]:{price:589},[i.TIER_4]:{price:829},[i.TIER_5]:{price:999}}}},e.ExchangeRateMap={"USD-INR":83.235758,"INR-USD":.0120141,"GBP-INR":101.020305081,"INR-GBP":.00990747,"AUD-INR":52.606042,"INR-AUD":.0190078,"JPY-INR":.55805653,"INR-JPY":1.79193,"INR-PKR":3.41966,"PKR-INR":.2924269,"CAD-INR":60.719681,"INR-CAD":.0164691,"INR-RUB":1.19476,"RUB-INR":.83698689,"INR-AED":.0441093,"AED-INR":22.670942,"INR-EUR":.011435464,"EUR-INR":87.447258,"INR-BRL":.061935861,"BRL-INR":16.1457,"USD-GBP":.811721,"USD-EUR":.940639,"USD-CAD":1.36082,"USD-SGD":1.36185,"USD-USD":1,"USD-SAR":3.75,"SAR-USD":.26666667,"KWD-USD":3.23494,"USD-KWD":.309125,"QAR-USD":.27472527,"USD-QAR":3.64,"AED-USD":.27229408,"USD-AED":3.6725,"ZAR-USD":.053130272,"USD-ZAR":18.8202,"PKR-USD":.0035818064,"USD-PKR":279.189,"LKR-USD":.0030839229,"USD-LKR":324.262,"TRY-USD":.03604935,"USD-TRY":27.7395,"CNY-USD":.13756281,"USD-CNY":7.26941,"CNH-USD":.13701883,"USD-CNH":7.29853,"BRL-USD":.19798628,"USD-BRL":5.05086,"KRW-USD":.0007471076,"USD-KRW":1338.5,"AUD-USD":.6409892,"USD-AUD":1.56009,"JPY-USD":.0067046544,"USD-JPY":149.15,"CAD-USD":.7348507,"GBP-USD":1.2319473,"EUR-USD":1.0631068,"SGD-USD":.73429505}}(require("../../../../../_virtual/billing.js").__exports);
@@ -0,0 +1 @@
1
+ "use strict";var T,S,e,A,_,P,O=require("../../../../../_virtual/store.js");T=O.__exports,Object.defineProperty(T,"__esModule",{value:!0}),T.ATTRIBUTION_TYPE=T.Statuses=T.PartnerSyncStatusType=T.AppType=T.BillingType=void 0,(S=T.BillingType||(T.BillingType={})).COMPLETELY_ON_SHOPIFY="COMPLETELY_ON_SHOPIFY",S.PARTIALLY_ON_SHOPIFY="PARTIALLY_ON_SHOPIFY",S.OUTSIDE_SHOPIFY="OUTSIDE_SHOPIFY",(e=T.AppType||(T.AppType={})).GLOBAL="GLOBAL",e.WHATSAPP="WHATSAPP",e.BSP="BSP",e.WHATSAPP_CUSTOM="WHATSAPP_CUSTOM",e.WHATSAPP_LISTING="WHATSAPP_LISTING",e.GLOBAL_LISTING="GLOBAL_LISTING",e.GLOBAL_CUSTOM="GLOBAL_CUSTOM",(A=T.PartnerSyncStatusType||(T.PartnerSyncStatusType={})).NOT_STARTED="NOT_STARTED",A.IN_PROGRESS="IN_PROGRESS",A.COMPLETED="COMPLETED",A.FAILED="FAILED",(_=T.Statuses||(T.Statuses={})).Active="Active",_.Inactive="Inactive",_.Blocked="Blocked",_.Closed="Closed",_.Churned_deleted="Churned_deleted",(P=T.ATTRIBUTION_TYPE||(T.ATTRIBUTION_TYPE={})).CLICK_BASED="CLICK_BASED",P.OPEN_BASED="OPEN_BASED",P.DELIVERY_BASED="DELIVERY_BASED";
@@ -0,0 +1 @@
1
+ var r={};export{r as __exports};
@@ -0,0 +1 @@
1
+ var r={};export{r as __exports};
@@ -0,0 +1 @@
1
+ var r={};export{r as __exports};
@@ -1,2 +1,3 @@
1
1
  export * from './CodeBlock';
2
2
  export * from './types';
3
+ export * from './languageSpecificFormatting';
@@ -0,0 +1 @@
1
+ function r(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").split("\n").filter(((r,e,t)=>{var i;return""!==r.trim()||""!==(null===(i=t[e-1])||void 0===i?void 0:i.trim())})).join("\n")}export{r as format};
@@ -0,0 +1,2 @@
1
+ export * from './html';
2
+ export * from './javascript';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
+ import { ApplicationType } from '@bikdotai/bik-models/growth';
3
3
  import { footerButtonOptionModel, MessageSource } from './model';
4
4
  interface SourceInfoFooterProps {
5
5
  appType: ApplicationType;
@@ -1 +1 @@
1
- import{jsx as e,Fragment as o,jsxs as t}from"react/jsx-runtime";import"../../node_modules/@bikdotai/bik-models/growth/models/bik-store.js";import i from"../../assets/icons/alert_triangle.svg.js";import n from"../../assets/icons/plus.svg.js";import{memo as r,useState as a,useMemo as s,useEffect as d}from"react";import{COLORS as l}from"../../constants/Theme.js";import{Button as c}from"../button/Button.js";import{BikShimmer as u}from"../shimmer/ShimmerComponent/BikShimmer.js";import{BodyCaption as p}from"../TypographyStyle.js";import{SourceInfoFooterStyle as h}from"./DataSourcePanel.style.js";import{__exports as m}from"../../_virtual/bik-store.js";const v=r((r=>{const{appType:v,sourceIntent:b,hideHeading:A,messageSource:y,trainingSourceCount:f={},ShowTrainingDataSource:_={},faqCount:I,ChecklistType:R,footerButtonOption:O,isFooterLoading:w,reasonForAiGeneratedResponse:N,showAiResponseReason:k}=r,C=_,[F,j]=a(!0),[D,E]=a(!0),S="/bik-ai/training",[x,P]=a({buttonTitle:"",redirectUrl:"",addFaqProps:{}}),[U,M]=a({title:"",subTitle:""}),q=s((()=>{const e=(null==f?void 0:f[b])||0;return e<=1?"There is "+e+"data source added to the identified intent":`There are ${e} data sources added to the identified intent`}),[f,b]),L=()=>{var e;(null==x?void 0:x.redirectUrl)?window.open(`${window.location.origin}${null==x?void 0:x.redirectUrl}`,"_self"):Object.keys(null!==(e=null==x?void 0:x.addFaqProps)&&void 0!==e?e:{}).length>0?null==O||O.onClick(x):(null==O?void 0:O.navigate)&&(null==O||O.navigate("Training",v==m.ApplicationType.MANIFEST?{tab:"/custom_data"}:{},{},!0))};return d((()=>{var e,o,t,i;if(b){if(null===(e=null==y?void 0:y.sources)||void 0===e?void 0:e.length){const e=y.sources[0];if(C[b])b===R.ORDER_ENQUIRY&&E(!1);else{let n=null==e?void 0:e.insights,r="";switch(b){case R.PRODUCT_DETAILS:"Product reviews"!==(null==e?void 0:e.title)&&(n=`${I||"No"} FAQs added for this product`,r="Add product-specific information via FAQs to improve responses",P({buttonTitle:"Add FAQ",addFaqProps:{faqProducts:[{id:null==e?void 0:e.productId,variantId:null==e?void 0:e.variantId,name:null==e?void 0:e.title,imageUrl:null==e?void 0:e.imageUrl}]},redirectUrl:""}));break;case R.ORDER_MODIFICATION:n=(null==f?void 0:f[b])?void 0:"Customers who are looking to modify their orders would be redirected to your live agents via the agent handover flow.",n&&P({buttonTitle:v==m.ApplicationType.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:v==m.ApplicationType.MANIFEST?"/customise?tab=AgentHandover":S,addFaqProps:{}});break;case R.ORDER_CANCELLATION:n=(null==f?void 0:f[b])?void 0:"Customers who are looking to cancel their orders would be redirected to your live agents via the agent handover flow.",P({buttonTitle:v==m.ApplicationType.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:v==m.ApplicationType.MANIFEST?"/customise?tab=AgentHandover":S,addFaqProps:{}});break;case R.ORDER_TRACKING:if("ORDER_NOT_FOUND"===(null==e?void 0:e.subIntent))break;P({buttonTitle:v==m.ApplicationType.MANIFEST?"Add order tracking link":"Add relevant data",redirectUrl:v==m.ApplicationType.MANIFEST?"/training/order-management":S,addFaqProps:{}});break;case R.PRODUCT_SEARCH:if("QUIZ"===(null==e?void 0:e.type))break;if(-1!==(null===(i=null===(t=null===(o=null==y?void 0:y.sources)||void 0===o?void 0:o[0])||void 0===t?void 0:t.title)||void 0===i?void 0:i.toLowerCase().indexOf("collection"))){n="Collections are recommended by matching queries with collection names and descriptions. Add relevant keywords to your collection description to improve results.";break}n="Products are recommended by matching queries with product names, descriptions, tags, and collections. Add relevant keywords and tags to your products to improve results."}M({title:null!=n?n:"",subTitle:r})}}(C[b]||[R.PRODUCT_DETAILS,R.ORDER_MODIFICATION,R.ORDER_CANCELLATION,R.ORDER_TRACKING].includes(b))&&j(!1)}}),[null==y?void 0:y.messageId,f,b,null==y?void 0:y.sources,C,R,I,v,y]),e(h,{children:e(o,w?{children:e(u,{gap:"8px",direction:"column",boxes:[{height:"20px",width:"300px"},{height:"80px",width:"300px"}]})}:{children:!(null==U?void 0:U.title)&&f&&b in f?t(o,{children:[e(g,{hideHeading:null!=A&&A}),e(T,{reason:N||"",showAiResponseReason:null!=k&&k}),t("div",Object.assign({className:"source_info_details "+(f[b]>0?"":"no_data_source")},{children:[f[b]>0&&D?t(o,{children:[e(p,{children:q}),e(p,Object.assign({color:l.content.secondary},{children:"Improve responses by adding more data sources for the identified intent"}))]}):D&&t("div",Object.assign({className:"no_data_source_title"},{children:[e(i,{width:15,height:15,color:l.content.negative,style:{marginTop:2}}),e(p,{children:"No data sources added to the identified link"})]})),!O||O.hideAddDataButton||F?e(o,{}):e(c,{size:"small",buttonType:"tertiary",LeadingIcon:n,buttonText:(null==x?void 0:x.buttonTitle.length)>0?null==x?void 0:x.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>L(),style:{backgroundColor:"unset"}})]}))]}):t(o,{children:[e(g,{hideHeading:null!=A&&A}),e(T,{reason:N||"",showAiResponseReason:null!=k&&k}),t("div",Object.assign({className:"source_info_details"},{children:[D&&t(o,{children:[e(p,{children:null==U?void 0:U.title}),e(p,Object.assign({color:l.content.secondary},{children:null==U?void 0:U.subTitle}))]}),!O||O.hideAddDataButton||F?e(o,{}):e(c,{size:"small",buttonType:"tertiary",LeadingIcon:n,buttonText:(null==x?void 0:x.buttonTitle.length)>0?null==x?void 0:x.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>L(),style:{backgroundColor:"unset"}})]}))]})})})})),g=r((o=>o.hideHeading?null:e(p,Object.assign({color:l.content.secondary},{children:"Training insights"})))),T=r((i=>{const[n,r]=a(!1),s=i.reason&&i.reason.length>50,d=s&&!n?i.reason.substring(0,50)+"...":i.reason;return i.showAiResponseReason?t("div",Object.assign({className:"source_info_details"},{children:[e(p,Object.assign({color:l.content.primary,className:"why_ai_gave_this_response"},{children:"Here’s why your AI gave this response"})),t(p,Object.assign({color:l.content.secondary,className:"clamp-text"},{children:[d||"No reason provided for this response.",s&&e(p,Object.assign({color:l.content.brand,style:{cursor:"pointer",textDecoration:"underline",marginTop:"4px"},onClick:()=>r(!n)},{children:n?"Show less":"Show more"}))]}))]})):e(o,{})}));T.displayName="WhyAiGaveThisResponse",g.displayName="TrainingInsightsHeading",v.displayName="SourceInfoFooter";export{v as default};
1
+ import{jsx as e,Fragment as o,jsxs as t}from"react/jsx-runtime";import"../../node_modules/@bikdotai/bik-models/growth/index.js";import i from"../../assets/icons/alert_triangle.svg.js";import n from"../../assets/icons/plus.svg.js";import{memo as r,useState as a,useMemo as s,useEffect as d}from"react";import{COLORS as l}from"../../constants/Theme.js";import{Button as c}from"../button/Button.js";import{BikShimmer as u}from"../shimmer/ShimmerComponent/BikShimmer.js";import{BodyCaption as p}from"../TypographyStyle.js";import{SourceInfoFooterStyle as h}from"./DataSourcePanel.style.js";import{__exports as m}from"../../_virtual/index.js";const v=r((r=>{const{appType:v,sourceIntent:b,hideHeading:A,messageSource:y,trainingSourceCount:f={},ShowTrainingDataSource:_={},faqCount:I,ChecklistType:R,footerButtonOption:O,isFooterLoading:w,reasonForAiGeneratedResponse:N,showAiResponseReason:k}=r,C=_,[F,j]=a(!0),[D,E]=a(!0),S="/bik-ai/training",[x,P]=a({buttonTitle:"",redirectUrl:"",addFaqProps:{}}),[U,M]=a({title:"",subTitle:""}),q=s((()=>{const e=(null==f?void 0:f[b])||0;return e<=1?"There is "+e+"data source added to the identified intent":`There are ${e} data sources added to the identified intent`}),[f,b]),L=()=>{var e;(null==x?void 0:x.redirectUrl)?window.open(`${window.location.origin}${null==x?void 0:x.redirectUrl}`,"_self"):Object.keys(null!==(e=null==x?void 0:x.addFaqProps)&&void 0!==e?e:{}).length>0?null==O||O.onClick(x):(null==O?void 0:O.navigate)&&(null==O||O.navigate("Training",v==m.ApplicationType.MANIFEST?{tab:"/custom_data"}:{},{},!0))};return d((()=>{var e,o,t,i;if(b){if(null===(e=null==y?void 0:y.sources)||void 0===e?void 0:e.length){const e=y.sources[0];if(C[b])b===R.ORDER_ENQUIRY&&E(!1);else{let n=null==e?void 0:e.insights,r="";switch(b){case R.PRODUCT_DETAILS:"Product reviews"!==(null==e?void 0:e.title)&&(n=`${I||"No"} FAQs added for this product`,r="Add product-specific information via FAQs to improve responses",P({buttonTitle:"Add FAQ",addFaqProps:{faqProducts:[{id:null==e?void 0:e.productId,variantId:null==e?void 0:e.variantId,name:null==e?void 0:e.title,imageUrl:null==e?void 0:e.imageUrl}]},redirectUrl:""}));break;case R.ORDER_MODIFICATION:n=(null==f?void 0:f[b])?void 0:"Customers who are looking to modify their orders would be redirected to your live agents via the agent handover flow.",n&&P({buttonTitle:v==m.ApplicationType.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:v==m.ApplicationType.MANIFEST?"/customise?tab=AgentHandover":S,addFaqProps:{}});break;case R.ORDER_CANCELLATION:n=(null==f?void 0:f[b])?void 0:"Customers who are looking to cancel their orders would be redirected to your live agents via the agent handover flow.",P({buttonTitle:v==m.ApplicationType.MANIFEST?"Manage agent handover":"Add relevant data",redirectUrl:v==m.ApplicationType.MANIFEST?"/customise?tab=AgentHandover":S,addFaqProps:{}});break;case R.ORDER_TRACKING:if("ORDER_NOT_FOUND"===(null==e?void 0:e.subIntent))break;P({buttonTitle:v==m.ApplicationType.MANIFEST?"Add order tracking link":"Add relevant data",redirectUrl:v==m.ApplicationType.MANIFEST?"/training/order-management":S,addFaqProps:{}});break;case R.PRODUCT_SEARCH:if("QUIZ"===(null==e?void 0:e.type))break;if(-1!==(null===(i=null===(t=null===(o=null==y?void 0:y.sources)||void 0===o?void 0:o[0])||void 0===t?void 0:t.title)||void 0===i?void 0:i.toLowerCase().indexOf("collection"))){n="Collections are recommended by matching queries with collection names and descriptions. Add relevant keywords to your collection description to improve results.";break}n="Products are recommended by matching queries with product names, descriptions, tags, and collections. Add relevant keywords and tags to your products to improve results."}M({title:null!=n?n:"",subTitle:r})}}(C[b]||[R.PRODUCT_DETAILS,R.ORDER_MODIFICATION,R.ORDER_CANCELLATION,R.ORDER_TRACKING].includes(b))&&j(!1)}}),[null==y?void 0:y.messageId,f,b,null==y?void 0:y.sources,C,R,I,v,y]),e(h,{children:e(o,w?{children:e(u,{gap:"8px",direction:"column",boxes:[{height:"20px",width:"300px"},{height:"80px",width:"300px"}]})}:{children:!(null==U?void 0:U.title)&&f&&b in f?t(o,{children:[e(g,{hideHeading:null!=A&&A}),e(T,{reason:N||"",showAiResponseReason:null!=k&&k}),t("div",Object.assign({className:"source_info_details "+(f[b]>0?"":"no_data_source")},{children:[f[b]>0&&D?t(o,{children:[e(p,{children:q}),e(p,Object.assign({color:l.content.secondary},{children:"Improve responses by adding more data sources for the identified intent"}))]}):D&&t("div",Object.assign({className:"no_data_source_title"},{children:[e(i,{width:15,height:15,color:l.content.negative,style:{marginTop:2}}),e(p,{children:"No data sources added to the identified link"})]})),!O||O.hideAddDataButton||F?e(o,{}):e(c,{size:"small",buttonType:"tertiary",LeadingIcon:n,buttonText:(null==x?void 0:x.buttonTitle.length)>0?null==x?void 0:x.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>L(),style:{backgroundColor:"unset"}})]}))]}):t(o,{children:[e(g,{hideHeading:null!=A&&A}),e(T,{reason:N||"",showAiResponseReason:null!=k&&k}),t("div",Object.assign({className:"source_info_details"},{children:[D&&t(o,{children:[e(p,{children:null==U?void 0:U.title}),e(p,Object.assign({color:l.content.secondary},{children:null==U?void 0:U.subTitle}))]}),!O||O.hideAddDataButton||F?e(o,{}):e(c,{size:"small",buttonType:"tertiary",LeadingIcon:n,buttonText:(null==x?void 0:x.buttonTitle.length)>0?null==x?void 0:x.buttonTitle:"Add relevant data",matchParentWidth:!0,onClick:()=>L(),style:{backgroundColor:"unset"}})]}))]})})})})),g=r((o=>o.hideHeading?null:e(p,Object.assign({color:l.content.secondary},{children:"Training insights"})))),T=r((i=>{const[n,r]=a(!1),s=i.reason&&i.reason.length>50,d=s&&!n?i.reason.substring(0,50)+"...":i.reason;return i.showAiResponseReason?t("div",Object.assign({className:"source_info_details"},{children:[e(p,Object.assign({color:l.content.primary,className:"why_ai_gave_this_response"},{children:"Here’s why your AI gave this response"})),t(p,Object.assign({color:l.content.secondary,className:"clamp-text"},{children:[d||"No reason provided for this response.",s&&e(p,Object.assign({color:l.content.brand,style:{cursor:"pointer",textDecoration:"underline",marginTop:"4px"},onClick:()=>r(!n)},{children:n?"Show less":"Show more"}))]}))]})):e(o,{})}));T.displayName="WhyAiGaveThisResponse",g.displayName="TrainingInsightsHeading",v.displayName="SourceInfoFooter";export{v as default};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
+ import { ApplicationType } from '@bikdotai/bik-models/growth';
3
3
  import { AllSourceInfoDetailsCustomDataModel, CustomDataType, DataSourcePanelZeroState, footerButtonOptionModel, InfoContent, MessageSource, ProductSourceData } from './model';
4
4
  export interface CollapsibleSectionProps {
5
5
  title: string;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import"../../node_modules/@bikdotai/bik-models/growth/models/bik-store.js";import o from"../../assets/icons/boxV2.svg.js";import n from"../../assets/icons/chevronDownOutline.svg.js";import s from"../../assets/icons/chevronUpOutline.svg.js";import l from"../../assets/icons/cross.svg.js";import r from"../../assets/icons/edit.svg.js";import a from"../../assets/icons/filePdf.svg.js";import c from"../../assets/icons/help.svg.js";import d from"../../assets/icons/info.svg.js";import p from"../../assets/icons/openai.svg.js";import u from"../../assets/icons/plus.svg.js";import g from"../../assets/icons/redirect.svg.js";import h from"../../assets/icons/text_t9.svg.js";import m from"../../assets/icons/website.svg.js";import{useState as f,useMemo as v,useEffect as y}from"react";import{COLORS as x}from"../../constants/Theme.js";import{Button as C}from"../button/Button.js";import{IconButton as I}from"../icon-button/IconButton.js";import{BikShimmer as b}from"../shimmer/ShimmerComponent/BikShimmer.js";import{SideModal as T}from"../side-modal/SideModal.js";import{Tag as j}from"../tag/Tag.js";import{Tooltip as O}from"../tooltips/Tooltip.js";import{TitleSmall as E,BodyCaption as S,BodySecondary as L}from"../TypographyStyle.js";import w from"./DataSourceInfoFooter.js";import{SourceInfoDetailsStyle as N}from"./DataSourcePanel.style.js";import{intentConfig as A}from"./IntentConfig.js";import{DescriptionModal as _}from"./Modals/DescriptionModal.js";import{CustomDataType as D}from"./model.js";import{__exports as k}from"../../_virtual/bik-store.js";const F=F=>{var R,B;const{appType:P,storeId:U,messageSource:K,setMessageSourcePanel:M,hideCloseButton:W,isSourceInfoFetched:H,allSourceInfoDetail:$,ChecklistType:q,title:Q,zeroStateButton:G,editableSources:Y,preFillTrainingSourceCount:z,redirect:X,footerButtonOption:V,fetchTrainingSourceCount:J,fetchProductFAQCount:Z,productSourceData:ee,reasonForAiGeneratedResponse:te,showAiResponseReason:ie}=F,{sources:oe}=K,ne=["blog","article","page","policy"],[se,le]=f(!1),[re,ae]=f(!1),[ce,de]=f(!1),[pe,ue]=f(0),[ge,he]=f(),[me,fe]=f(null!=z?z:{}),[ve,ye]=f(!1),[xe,Ce]=f(!1),Ie={};A.forEach((t=>{let{key:i,type:o,tagText:n}=t;q[i]&&(Ie[q[i]]=e(j,{theme:"light",type:o,tagText:n,cursor:"pointer"}))}));const be=oe.filter((e=>"PRODUCTS"==e.type||"Products"==e.subTitle||e.productId)),Te=oe.filter((e=>"PRODUCTS"!=e.type&&"Products"!=e.subTitle&&!e.productId)),je=v((()=>{const e={};return["STORE_INFORMATION","CONTACT_INFO","STORE_LOCATION","SHIPPING_POLICY","RETURN_AND_REFUND","SALES_AND_OFFERS","SALES_AND_OFFERS_ISSUES","PRODUCT_CUSTOMISATION","PAYMENT_METHODS","CHECKOUT_ENQUIRY","ORDER_ENQUIRY"].forEach((t=>{q[t]&&(e[q[t]]=q[t])})),["COLLABORATION","SUBSCRIPTION_ENQUIRY"].forEach((t=>{e[t]=t})),e}),[q]);y((()=>{var e,t,i,o;if(!(null==K?void 0:K.messageId))return;le(!0),ae(!0),de(!1!==(null===(t=null===(e=K.sources)||void 0===e?void 0:e[0])||void 0===t?void 0:t.isTrainable)||!!(null===(o=null===(i=K.sources)||void 0===i?void 0:i[0])||void 0===o?void 0:o.insights));const n=K.sources.filter((e=>!!e.productId)).map((e=>e.productId)),s=Array.from(new Set(n)).filter((e=>!!e));Z(U,s).then((e=>ue(e))).then((()=>{z?(fe(z),setTimeout((()=>{le(!1),ae(!1)}),100)):(setTimeout((()=>le(!1)),100),J(U).then((e=>fe(e))).then((()=>setTimeout((()=>{ae(!1)}),100))))}))}),[Z,J,null==K?void 0:K.messageId,K.sources,z,U]);const Oe=e=>!!(e&&0===e.length||(null==K?void 0:K.isUnsatisfactoryAnswer)),Ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i;return"custom"==e?e=D.FILES:ne.includes(e)?e=D.FETCHED_LINKS:"url"==e?e=D.WEBSITE_LINKS:"text"===e?e=D.TEXTS:"faq"===e&&(e=D.FAQ),t?e:null===(i=null==e?void 0:e.toLowerCase())||void 0===i?void 0:i.replace(/_/g," ")},Se=e=>e?"faq"==e.toLocaleLowerCase()?"FAQ":"openai"==e.toLocaleLowerCase()?"OPENAI":"files"==e.toLocaleLowerCase()?"PDF":"texts"==e.toLocaleLowerCase()?"Custom text":((e=(e=e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).replace("_"," ")).endsWith("s")&&(e=e.slice(0,-1)),e.replace("Website","Manual")):"",Le=t=>e("products"==t||"product"==t?o:"files"==t?a:"website links"==t||"fetched links"==t?m:"faq"==t?c:"texts"==t?h:p,{height:16,width:16,color:x.content.secondary}),we=e=>{const t=e.replace(/(<([^>]+)>)/gi,""),i=document.createElement("textarea");return i.innerHTML=t,i.value};if(se||!H)return e(N,{children:e(b,{boxes:[{width:"100px",height:"16px"},{width:"0",height:"4px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"0",height:"4px"},{width:"100%",height:"16px"}]})});const Ne=o=>{const{title:l,count:r,isExpanded:a,onToggle:c,children:d}=o;return t("div",{children:[t("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",cursor:"pointer"},onClick:c},{children:[t("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[e(S,Object.assign({style:{fontWeight:"600"}},{children:l})),P===k.ApplicationType.MANIFEST?e("div",Object.assign({style:{backgroundColor:x.surface.subdued,color:x.content.secondary,padding:"2px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"500"}},{children:r})):e(i,{})]})),e(i,{children:P===k.ApplicationType.BIK?e(i,{}):e(a?n:s,{width:20,height:20,color:x.content.primary})})]})),a&&d]})};return t(i,{children:[e(N,{children:t(i,{children:[t("div",Object.assign({className:"pop-up-header",style:{display:"flex",flexDirection:"column",paddingBottom:"12px"}},{children:[!!Q&&e(E,{children:Q}),t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",alignItems:"center"}},{children:[e(S,Object.assign({color:x.content.secondary},{children:"Intent"})),null!==(R=Ie[K.intent])&&void 0!==R?R:Ie.GENERIC,!W&&e("div",Object.assign({style:{display:"flex",marginLeft:"auto",cursor:"pointer"},onClick:()=>M(void 0)},{children:e(l,{height:20,width:20,color:x.content.secondary})}))]})),Oe(oe)?e("div",Object.assign({style:{display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",height:"calc(100vh - 300px)"}},{children:(()=>{var i,o;return t("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0px 30px",gap:"8px"}},{children:[e("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",backgroundColor:`${x.background.negative.light}`,borderRadius:"100px"}},{children:e(d,{width:24,height:24,color:x.stroke.negative.vibrant})})),e("div",Object.assign({style:{justifyContent:"center",alignItems:"center",marginBottom:"-4px"}},{children:e(E,{children:"Insufficient data"})})),e(L,Object.assign({color:x.content.secondary,style:{display:"flex",justifyContent:"center",textAlign:"center"}},{children:"No data available to answer this query. Add an FAQ to address it in the future"})),G&&e("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e(C,{LeadingIcon:null!==(i=G.leadingIcon)&&void 0!==i?i:u,buttonText:null!==(o=G.title)&&void 0!==o?o:"Add FAQ",buttonType:"secondary",size:"small",matchParentWidth:!0,onClick:()=>{G.onClick()}})}))]}))})()})):e(j,{LeadingIcon:d,version:"2.0",type:"grey",theme:"light",alignIcon:"start",contentPadding:12,tagText:K.isEditable?`If any of the information is incorrect, update the original data source and sync it again. Alternatively, you can make local corrections directly in ${P===k.ApplicationType.BIK?"BIK":"Manifest"}.`:"Edit the original source and save again to update the response"})]})),!Oe(oe)&&t("div",Object.assign({className:"info-container"},{children:[e(i,{children:be.length>0&&e("div",Object.assign({className:"info-product-source"},{children:e(Ne,Object.assign({title:"Product Sources",count:be.length,isExpanded:P!==k.ApplicationType.MANIFEST||ve,onToggle:()=>ye(!ve)},{children:e("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:be.map(((o,n)=>{var s,l,a,c;const d=Ee(o.type||o.subTitle||"OpenAI"),p=Ee(o.type||o.subTitle||"OpenAI",!0),u=Se(d),h=null==Y?void 0:Y.includes(p),m=$[null!==(s=o.productId)&&void 0!==s?s:"Products"],f=o.title,v=o.productId&&(null==ee?void 0:ee[o.productId]),y=v&&v.metafield.join(", ");return t("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:n+1<(null==be?void 0:be.length)?`1px solid ${x.stroke.primary}`:"none"}},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[t("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Le(d),e(O,Object.assign({body:f,placement:"top"},{children:e(L,Object.assign({style:p==D.FETCHED_LINKS||p==D.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:x.content.primary,className:"clamp-title",onClick:()=>p==D.FETCHED_LINKS||p==D.WEBSITE_LINKS?X(o):{}},{children:f}))}))]})),t("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[o.intent!==q.EMAIL_COLLECTION&&e(i,{children:e(S,Object.assign({color:x.content.secondary},{children:u}))}),(o.link||o.docId)&&e("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:e(I,h?{Icon:r,height:16,width:16,iconColor:x.content.secondary,onClick:()=>null==m?void 0:m.onEditClick(m.data,m.type),disabled:!m,disabledTooltip:"This source is deleted"}:{Icon:g,height:16,width:16,iconColor:x.content.secondary,disabled:"custom"===o.type&&!m,disabledTooltip:"This source is deleted",onClick:()=>X(o)})}))]}))]})),v&&t(S,{children:[e("span",Object.assign({className:"product-data-text1",onClick:()=>{var e;he({title:f,description:we(v.description),imageUrl:null!==(e=o.imageUrl)&&void 0!==e?e:"",onClose:()=>he(void 0)})}},{children:`${null===(l=v.description)||void 0===l?void 0:l.length} characters description,`})),e("span",Object.assign({className:"product-data-text1",onClick:()=>v.onEditFaqClick(v.faqs)},{children:`${null===(a=v.faqs)||void 0===a?void 0:a.length} FAQs, `})),e("span",Object.assign({className:"product-data-text2"},{children:"and"})),e(O,Object.assign({body:y,placement:"top"},{children:e("span",Object.assign({className:"product-data-text1"},{children:`${null===(c=v.metafield)||void 0===c?void 0:c.length} metafields`}))}))]})]}),`info-${n}`)}))}))}))}))}),e(i,{children:Te.length>0&&e("div",Object.assign({className:"info-content-source"},{children:e(Ne,Object.assign({title:"Content Sources",count:Te.length,isExpanded:P!==k.ApplicationType.MANIFEST||xe,onToggle:()=>Ce(!xe)},{children:e("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:Te.map(((o,n)=>{var s,l,a,c,d,p,u,h,m,f,v,y,C,b,T,j,E;const w=Ee(o.type||o.subTitle||"OpenAI"),N=Ee(o.type||o.subTitle||"OpenAI",!0),A=Se(w),_=null==Y?void 0:Y.includes(N),k="Products"===o.subTitle?$[null!==(s=o.productId)&&void 0!==s?s:"Products"]:$[null!==(l=o.docId)&&void 0!==l?l:""],F=N.toLowerCase()===(null===(a=D.FAQ)||void 0===a?void 0:a.toLowerCase())?"faq"===(null===(c=o.title)||void 0===c?void 0:c.toLowerCase())?o.subTitle:o.title:N.toLowerCase()===(null===(d=D.FILES)||void 0===d?void 0:d.toLowerCase())||N.toLowerCase()===(null===(p=D.FETCHED_LINKS)||void 0===p?void 0:p.toLowerCase())||N.toLowerCase()===(null===(u=D.TEXTS)||void 0===u?void 0:u.toLowerCase())?o.title:N.toLowerCase()===(null===(h=D.WEBSITE_LINKS)||void 0===h?void 0:h.toLowerCase())?o.title.split("/")[o.title.split("/").length-1].replace(/[^\w\s]/gi," ").replace(/^(.)(.*)$/,((e,t,i)=>t.toUpperCase()+i)):o.intent===q.EMAIL_COLLECTION?A:o.title,R="faq"===N.toLowerCase()?null!==(v=null!==(m=null==k?void 0:k.content)&&void 0!==m?m:null===(f=null==k?void 0:k.data)||void 0===f?void 0:f.answer)&&void 0!==v?v:"":N.toLowerCase()===(null===(y=D.FETCHED_LINKS)||void 0===y?void 0:y.toLowerCase())||N.toLowerCase()===(null===(C=D.WEBSITE_LINKS)||void 0===C?void 0:C.toLowerCase())||N.toLowerCase()===(null===(b=D.TEXTS)||void 0===b?void 0:b.toLowerCase())?null!==(E=null!==(T=null==k?void 0:k.content)&&void 0!==T?T:null===(j=null==k?void 0:k.data)||void 0===j?void 0:j.fileContentText)&&void 0!==E?E:"":o.intent===q.EMAIL_COLLECTION?"Collect leads before replying to messages":"";return t("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:n+1<(null==Te?void 0:Te.length)?`1px solid ${x.stroke.primary}`:"none"}},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[t("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Le(w),e(O,Object.assign({body:F,placement:"top"},{children:e(L,Object.assign({style:N==D.FETCHED_LINKS||N==D.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:x.content.primary,className:"clamp-title",onClick:()=>N==D.FETCHED_LINKS||N==D.WEBSITE_LINKS?X(o):{}},{children:F}))}))]})),t("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[o.intent!==q.EMAIL_COLLECTION&&e(i,{children:e(S,Object.assign({color:x.content.secondary},{children:A}))}),(o.link||o.docId)&&e("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:e(I,_?{Icon:r,height:16,width:16,iconColor:x.content.secondary,onClick:()=>null==k?void 0:k.onEditClick(k.data,k.type),disabled:!k,disabledTooltip:"This source is deleted"}:{Icon:g,height:16,width:16,iconColor:x.content.secondary,disabled:"custom"===o.type&&!k,disabledTooltip:"This source is deleted",onClick:()=>X(o)})}))]}))]})),(null!=R?R:"").trim()&&e("div",Object.assign({style:{padding:"4px 8px",border:`1px dashed ${x.stroke.primary}`,borderRadius:"4px",backgroundColor:x.surface.subdued}},{children:e(S,Object.assign({color:x.content.primary,className:"clamp-description"},{children:we(null!=R?R:"").trim()}))}))]}),`info-${n}`)}))}))}))}))})]})),ce&&!Oe(oe)&&e("div",Object.assign({className:"footer"},{children:e(w,{appType:P,storeId:U,messageSource:K,sourceIntent:null!==(B=K.intent)&&void 0!==B?B:q.GENERIC,faqCount:pe,trainingSourceCount:me,ShowTrainingDataSource:je,ChecklistType:q,footerButtonOption:V,isFooterLoading:re,reasonForAiGeneratedResponse:te,showAiResponseReason:ie})}))]})}),ge&&e(T,Object.assign({header:"Product description",onClose:()=>he(void 0),width:"30%"},{children:e(_,{title:ge.title,description:ge.description,imageUrl:ge.imageUrl,onClose:ge.onClose})}))]})};export{F as DataSourcePanel};
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import"../../node_modules/@bikdotai/bik-models/growth/index.js";import o from"../../assets/icons/boxV2.svg.js";import n from"../../assets/icons/chevronDownOutline.svg.js";import s from"../../assets/icons/chevronUpOutline.svg.js";import l from"../../assets/icons/cross.svg.js";import r from"../../assets/icons/edit.svg.js";import a from"../../assets/icons/filePdf.svg.js";import c from"../../assets/icons/help.svg.js";import d from"../../assets/icons/info.svg.js";import p from"../../assets/icons/openai.svg.js";import u from"../../assets/icons/plus.svg.js";import g from"../../assets/icons/redirect.svg.js";import h from"../../assets/icons/text_t9.svg.js";import m from"../../assets/icons/website.svg.js";import{useState as f,useMemo as v,useEffect as y}from"react";import{COLORS as x}from"../../constants/Theme.js";import{Button as C}from"../button/Button.js";import{IconButton as I}from"../icon-button/IconButton.js";import{BikShimmer as b}from"../shimmer/ShimmerComponent/BikShimmer.js";import{SideModal as T}from"../side-modal/SideModal.js";import{Tag as j}from"../tag/Tag.js";import{Tooltip as O}from"../tooltips/Tooltip.js";import{TitleSmall as E,BodyCaption as S,BodySecondary as L}from"../TypographyStyle.js";import w from"./DataSourceInfoFooter.js";import{SourceInfoDetailsStyle as N}from"./DataSourcePanel.style.js";import{intentConfig as A}from"./IntentConfig.js";import{DescriptionModal as _}from"./Modals/DescriptionModal.js";import{CustomDataType as D}from"./model.js";import{__exports as k}from"../../_virtual/index.js";const F=F=>{var R,B;const{appType:P,storeId:U,messageSource:K,setMessageSourcePanel:M,hideCloseButton:W,isSourceInfoFetched:H,allSourceInfoDetail:$,ChecklistType:q,title:Q,zeroStateButton:G,editableSources:Y,preFillTrainingSourceCount:z,redirect:X,footerButtonOption:V,fetchTrainingSourceCount:J,fetchProductFAQCount:Z,productSourceData:ee,reasonForAiGeneratedResponse:te,showAiResponseReason:ie}=F,{sources:oe}=K,ne=["blog","article","page","policy"],[se,le]=f(!1),[re,ae]=f(!1),[ce,de]=f(!1),[pe,ue]=f(0),[ge,he]=f(),[me,fe]=f(null!=z?z:{}),[ve,ye]=f(!1),[xe,Ce]=f(!1),Ie={};A.forEach((t=>{let{key:i,type:o,tagText:n}=t;q[i]&&(Ie[q[i]]=e(j,{theme:"light",type:o,tagText:n,cursor:"pointer"}))}));const be=oe.filter((e=>"PRODUCTS"==e.type||"Products"==e.subTitle||e.productId)),Te=oe.filter((e=>"PRODUCTS"!=e.type&&"Products"!=e.subTitle&&!e.productId)),je=v((()=>{const e={};return["STORE_INFORMATION","CONTACT_INFO","STORE_LOCATION","SHIPPING_POLICY","RETURN_AND_REFUND","SALES_AND_OFFERS","SALES_AND_OFFERS_ISSUES","PRODUCT_CUSTOMISATION","PAYMENT_METHODS","CHECKOUT_ENQUIRY","ORDER_ENQUIRY"].forEach((t=>{q[t]&&(e[q[t]]=q[t])})),["COLLABORATION","SUBSCRIPTION_ENQUIRY"].forEach((t=>{e[t]=t})),e}),[q]);y((()=>{var e,t,i,o;if(!(null==K?void 0:K.messageId))return;le(!0),ae(!0),de(!1!==(null===(t=null===(e=K.sources)||void 0===e?void 0:e[0])||void 0===t?void 0:t.isTrainable)||!!(null===(o=null===(i=K.sources)||void 0===i?void 0:i[0])||void 0===o?void 0:o.insights));const n=K.sources.filter((e=>!!e.productId)).map((e=>e.productId)),s=Array.from(new Set(n)).filter((e=>!!e));Z(U,s).then((e=>ue(e))).then((()=>{z?(fe(z),setTimeout((()=>{le(!1),ae(!1)}),100)):(setTimeout((()=>le(!1)),100),J(U).then((e=>fe(e))).then((()=>setTimeout((()=>{ae(!1)}),100))))}))}),[Z,J,null==K?void 0:K.messageId,K.sources,z,U]);const Oe=e=>!!(e&&0===e.length||(null==K?void 0:K.isUnsatisfactoryAnswer)),Ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i;return"custom"==e?e=D.FILES:ne.includes(e)?e=D.FETCHED_LINKS:"url"==e?e=D.WEBSITE_LINKS:"text"===e?e=D.TEXTS:"faq"===e&&(e=D.FAQ),t?e:null===(i=null==e?void 0:e.toLowerCase())||void 0===i?void 0:i.replace(/_/g," ")},Se=e=>e?"faq"==e.toLocaleLowerCase()?"FAQ":"openai"==e.toLocaleLowerCase()?"OPENAI":"files"==e.toLocaleLowerCase()?"PDF":"texts"==e.toLocaleLowerCase()?"Custom text":((e=(e=e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).replace("_"," ")).endsWith("s")&&(e=e.slice(0,-1)),e.replace("Website","Manual")):"",Le=t=>e("products"==t||"product"==t?o:"files"==t?a:"website links"==t||"fetched links"==t?m:"faq"==t?c:"texts"==t?h:p,{height:16,width:16,color:x.content.secondary}),we=e=>{const t=e.replace(/(<([^>]+)>)/gi,""),i=document.createElement("textarea");return i.innerHTML=t,i.value};if(se||!H)return e(N,{children:e(b,{boxes:[{width:"100px",height:"16px"},{width:"0",height:"4px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"100%",height:"32px"},{width:"0",height:"4px"},{width:"100%",height:"16px"}]})});const Ne=o=>{const{title:l,count:r,isExpanded:a,onToggle:c,children:d}=o;return t("div",{children:[t("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",cursor:"pointer"},onClick:c},{children:[t("div",Object.assign({style:{display:"flex",alignItems:"center",gap:"8px"}},{children:[e(S,Object.assign({style:{fontWeight:"600"}},{children:l})),P===k.ApplicationType.MANIFEST?e("div",Object.assign({style:{backgroundColor:x.surface.subdued,color:x.content.secondary,padding:"2px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"500"}},{children:r})):e(i,{})]})),e(i,{children:P===k.ApplicationType.BIK?e(i,{}):e(a?n:s,{width:20,height:20,color:x.content.primary})})]})),a&&d]})};return t(i,{children:[e(N,{children:t(i,{children:[t("div",Object.assign({className:"pop-up-header",style:{display:"flex",flexDirection:"column",paddingBottom:"12px"}},{children:[!!Q&&e(E,{children:Q}),t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",alignItems:"center"}},{children:[e(S,Object.assign({color:x.content.secondary},{children:"Intent"})),null!==(R=Ie[K.intent])&&void 0!==R?R:Ie.GENERIC,!W&&e("div",Object.assign({style:{display:"flex",marginLeft:"auto",cursor:"pointer"},onClick:()=>M(void 0)},{children:e(l,{height:20,width:20,color:x.content.secondary})}))]})),Oe(oe)?e("div",Object.assign({style:{display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",height:"calc(100vh - 300px)"}},{children:(()=>{var i,o;return t("div",Object.assign({style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0px 30px",gap:"8px"}},{children:[e("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"12px",backgroundColor:`${x.background.negative.light}`,borderRadius:"100px"}},{children:e(d,{width:24,height:24,color:x.stroke.negative.vibrant})})),e("div",Object.assign({style:{justifyContent:"center",alignItems:"center",marginBottom:"-4px"}},{children:e(E,{children:"Insufficient data"})})),e(L,Object.assign({color:x.content.secondary,style:{display:"flex",justifyContent:"center",textAlign:"center"}},{children:"No data available to answer this query. Add an FAQ to address it in the future"})),G&&e("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e(C,{LeadingIcon:null!==(i=G.leadingIcon)&&void 0!==i?i:u,buttonText:null!==(o=G.title)&&void 0!==o?o:"Add FAQ",buttonType:"secondary",size:"small",matchParentWidth:!0,onClick:()=>{G.onClick()}})}))]}))})()})):e(j,{LeadingIcon:d,version:"2.0",type:"grey",theme:"light",alignIcon:"start",contentPadding:12,tagText:K.isEditable?`If any of the information is incorrect, update the original data source and sync it again. Alternatively, you can make local corrections directly in ${P===k.ApplicationType.BIK?"BIK":"Manifest"}.`:"Edit the original source and save again to update the response"})]})),!Oe(oe)&&t("div",Object.assign({className:"info-container"},{children:[e(i,{children:be.length>0&&e("div",Object.assign({className:"info-product-source"},{children:e(Ne,Object.assign({title:"Product Sources",count:be.length,isExpanded:P!==k.ApplicationType.MANIFEST||ve,onToggle:()=>ye(!ve)},{children:e("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:be.map(((o,n)=>{var s,l,a,c;const d=Ee(o.type||o.subTitle||"OpenAI"),p=Ee(o.type||o.subTitle||"OpenAI",!0),u=Se(d),h=null==Y?void 0:Y.includes(p),m=$[null!==(s=o.productId)&&void 0!==s?s:"Products"],f=o.title,v=o.productId&&(null==ee?void 0:ee[o.productId]),y=v&&v.metafield.join(", ");return t("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:n+1<(null==be?void 0:be.length)?`1px solid ${x.stroke.primary}`:"none"}},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[t("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Le(d),e(O,Object.assign({body:f,placement:"top"},{children:e(L,Object.assign({style:p==D.FETCHED_LINKS||p==D.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:x.content.primary,className:"clamp-title",onClick:()=>p==D.FETCHED_LINKS||p==D.WEBSITE_LINKS?X(o):{}},{children:f}))}))]})),t("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[o.intent!==q.EMAIL_COLLECTION&&e(i,{children:e(S,Object.assign({color:x.content.secondary},{children:u}))}),(o.link||o.docId)&&e("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:e(I,h?{Icon:r,height:16,width:16,iconColor:x.content.secondary,onClick:()=>null==m?void 0:m.onEditClick(m.data,m.type),disabled:!m,disabledTooltip:"This source is deleted"}:{Icon:g,height:16,width:16,iconColor:x.content.secondary,disabled:"custom"===o.type&&!m,disabledTooltip:"This source is deleted",onClick:()=>X(o)})}))]}))]})),v&&t(S,{children:[e("span",Object.assign({className:"product-data-text1",onClick:()=>{var e;he({title:f,description:we(v.description),imageUrl:null!==(e=o.imageUrl)&&void 0!==e?e:"",onClose:()=>he(void 0)})}},{children:`${null===(l=v.description)||void 0===l?void 0:l.length} characters description,`})),e("span",Object.assign({className:"product-data-text1",onClick:()=>v.onEditFaqClick(v.faqs)},{children:`${null===(a=v.faqs)||void 0===a?void 0:a.length} FAQs, `})),e("span",Object.assign({className:"product-data-text2"},{children:"and"})),e(O,Object.assign({body:y,placement:"top"},{children:e("span",Object.assign({className:"product-data-text1"},{children:`${null===(c=v.metafield)||void 0===c?void 0:c.length} metafields`}))}))]})]}),`info-${n}`)}))}))}))}))}),e(i,{children:Te.length>0&&e("div",Object.assign({className:"info-content-source"},{children:e(Ne,Object.assign({title:"Content Sources",count:Te.length,isExpanded:P!==k.ApplicationType.MANIFEST||xe,onToggle:()=>Ce(!xe)},{children:e("div",Object.assign({className:"source",style:{padding:"0 12px",maxWidth:"100%"}},{children:Te.map(((o,n)=>{var s,l,a,c,d,p,u,h,m,f,v,y,C,b,T,j,E;const w=Ee(o.type||o.subTitle||"OpenAI"),N=Ee(o.type||o.subTitle||"OpenAI",!0),A=Se(w),_=null==Y?void 0:Y.includes(N),k="Products"===o.subTitle?$[null!==(s=o.productId)&&void 0!==s?s:"Products"]:$[null!==(l=o.docId)&&void 0!==l?l:""],F=N.toLowerCase()===(null===(a=D.FAQ)||void 0===a?void 0:a.toLowerCase())?"faq"===(null===(c=o.title)||void 0===c?void 0:c.toLowerCase())?o.subTitle:o.title:N.toLowerCase()===(null===(d=D.FILES)||void 0===d?void 0:d.toLowerCase())||N.toLowerCase()===(null===(p=D.FETCHED_LINKS)||void 0===p?void 0:p.toLowerCase())||N.toLowerCase()===(null===(u=D.TEXTS)||void 0===u?void 0:u.toLowerCase())?o.title:N.toLowerCase()===(null===(h=D.WEBSITE_LINKS)||void 0===h?void 0:h.toLowerCase())?o.title.split("/")[o.title.split("/").length-1].replace(/[^\w\s]/gi," ").replace(/^(.)(.*)$/,((e,t,i)=>t.toUpperCase()+i)):o.intent===q.EMAIL_COLLECTION?A:o.title,R="faq"===N.toLowerCase()?null!==(v=null!==(m=null==k?void 0:k.content)&&void 0!==m?m:null===(f=null==k?void 0:k.data)||void 0===f?void 0:f.answer)&&void 0!==v?v:"":N.toLowerCase()===(null===(y=D.FETCHED_LINKS)||void 0===y?void 0:y.toLowerCase())||N.toLowerCase()===(null===(C=D.WEBSITE_LINKS)||void 0===C?void 0:C.toLowerCase())||N.toLowerCase()===(null===(b=D.TEXTS)||void 0===b?void 0:b.toLowerCase())?null!==(E=null!==(T=null==k?void 0:k.content)&&void 0!==T?T:null===(j=null==k?void 0:k.data)||void 0===j?void 0:j.fileContentText)&&void 0!==E?E:"":o.intent===q.EMAIL_COLLECTION?"Collect leads before replying to messages":"";return t("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"8px",padding:"16px 0px",borderBottom:n+1<(null==Te?void 0:Te.length)?`1px solid ${x.stroke.primary}`:"none"}},{children:[t("div",Object.assign({style:{display:"flex",flexDirection:"row",gap:"12px",justifyContent:"space-between",alignItems:"center"}},{children:[t("div",Object.assign({style:{display:"flex",flex:1,gap:"8px",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},{children:[Le(w),e(O,Object.assign({body:F,placement:"top"},{children:e(L,Object.assign({style:N==D.FETCHED_LINKS||N==D.WEBSITE_LINKS?{cursor:"pointer",textDecoration:"underline"}:{},color:x.content.primary,className:"clamp-title",onClick:()=>N==D.FETCHED_LINKS||N==D.WEBSITE_LINKS?X(o):{}},{children:F}))}))]})),t("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:"4px",flex:"none"}},{children:[o.intent!==q.EMAIL_COLLECTION&&e(i,{children:e(S,Object.assign({color:x.content.secondary},{children:A}))}),(o.link||o.docId)&&e("div",Object.assign({style:{cursor:"pointer",marginLeft:"0px"}},{children:e(I,_?{Icon:r,height:16,width:16,iconColor:x.content.secondary,onClick:()=>null==k?void 0:k.onEditClick(k.data,k.type),disabled:!k,disabledTooltip:"This source is deleted"}:{Icon:g,height:16,width:16,iconColor:x.content.secondary,disabled:"custom"===o.type&&!k,disabledTooltip:"This source is deleted",onClick:()=>X(o)})}))]}))]})),(null!=R?R:"").trim()&&e("div",Object.assign({style:{padding:"4px 8px",border:`1px dashed ${x.stroke.primary}`,borderRadius:"4px",backgroundColor:x.surface.subdued}},{children:e(S,Object.assign({color:x.content.primary,className:"clamp-description"},{children:we(null!=R?R:"").trim()}))}))]}),`info-${n}`)}))}))}))}))})]})),ce&&!Oe(oe)&&e("div",Object.assign({className:"footer"},{children:e(w,{appType:P,storeId:U,messageSource:K,sourceIntent:null!==(B=K.intent)&&void 0!==B?B:q.GENERIC,faqCount:pe,trainingSourceCount:me,ShowTrainingDataSource:je,ChecklistType:q,footerButtonOption:V,isFooterLoading:re,reasonForAiGeneratedResponse:te,showAiResponseReason:ie})}))]})}),ge&&e(T,Object.assign({header:"Product description",onClose:()=>he(void 0),width:"30%"},{children:e(_,{title:ge.title,description:ge.description,imageUrl:ge.imageUrl,onClose:ge.onClose})}))]})};export{F as DataSourcePanel};
@@ -1,4 +1,4 @@
1
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
1
+ import { ApplicationType } from '@bikdotai/bik-models/growth';
2
2
  import React from 'react';
3
3
  import { ICouponData } from "./type";
4
4
  import { Collection, Product } from "../product-picker/type";
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i,Fragment as t}from"react/jsx-runtime";import"../../node_modules/@bikdotai/bik-models/growth/models/bik-store.js";import{useState as o,useEffect as n}from"react";import{DISCOUNT_TYPES as l,MIN_PURCHASE_REQUIREMENT as r,DISCOUNT_APPLIES_TO as d,OFFER_APPLIES_TO as a,initialStaticCouponErrorState as c,initialDynamicCouponErrorState as s,COUPON_EXPIRATION as u,DISCOUNT_TARGET_TYPES as p,DISCOUNT_TARGET_SELECTION as v,DISCOUNT_VALUE_TYPES as C}from"./type.js";import"../dropdown/DropdownPopover/index.js";import{Dropdown as b}from"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"../zeroState/ZeroState.js";import{TitleSmall as m,BodyCaption as y,TitleRegular as P}from"../TypographyStyle.js";import{DEFAULT_THEME as h}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{StyledModal as I}from"../modals/styledModal.js";import{ProductPickerContent as f}from"../product-picker/ProductPickerModal.js";import{Tag as T}from"../tag/Tag.js";import{Tooltip as E}from"../tooltips/Tooltip.js";import O from"../../assets/icons/gift_icon.svg.js";import S from"../../assets/icons/percentage_icon.svg.js";import g from"../../assets/icons/shipping_icon.svg.js";import _ from"../../assets/icons/triangle_error.svg.js";import V from"../../assets/icons/warning.svg.js";import{ProductPickerModal as A}from"../product-picker-v2/modal.js";import"../product-picker-v2/type.js";import{PickerType as D}from"../variable-picker-v3/model.js";import{VariablePicker as j}from"../variable-picker-v3/VariablePicker.js";import{StyledDiscountDialogueContainer as k,CouponTypeContainerStyled as N,VariablePickerContainer as x}from"./DiscountModal.styled.js";import{validateDiscountData as F,descriptionBuilder as w}from"./DiscountUtils.js";import R,{DISCOUNT_PRODUCTS as M}from"./DynamicCoupon/DynamicCoupon.js";import q from"./StaticCoupon/StaticCoupon.js";import{__exports as L}from"../../_virtual/bik-store.js";const U=U=>{var B,G,Y,X,Q,H,z,K,$,Z,J;const W=[{id:"0",label:"Amount",value:"amount",icon:i=>e("span",Object.assign({style:{fontSize:20,color:i,lineHeight:.9}},{children:U.currency||""}))},{id:"1",label:"Percentage",value:"percentage",icon:i=>e(S,{width:24,height:24,color:i})},{id:"2",label:"Buy X get Y",value:l.BUY_X_GET_Y,icon:i=>e(O,{width:24,height:24,color:i})},{id:"3",label:"Free Shipping",value:l.FREE_SHIPPING,icon:i=>e(g,{width:24,height:24,color:i})}],[ee,ie]=o(),[te,oe]=o(),[ne,le]=o(),[re,de]=o(null!==(B=U.data)&&void 0!==B?B:"string"==typeof U.hideOption?{isStaticCoupon:"dynamic"===U.hideOption}:{isStaticCoupon:!0}),[ae,ce]=o(!0),[se,ue]=o(),[pe,ve]=o((null===(G=U.data)||void 0===G?void 0:G.minAmount)?r.AMOUNT:(null===(Y=U.data)||void 0===Y?void 0:Y.minQuantity)?r.QUANTITY:r.NA),[Ce,be]=o(d.ENTIRE_ORDER),[me,ye]=o(a.SPECIFIC_PRODUCTS),[Pe,he]=o(a.SPECIFIC_PRODUCTS),[Ie,fe]=o(void 0),[Te,Ee]=o(void 0),[Oe,Se]=o(void 0),[ge,_e]=o(void 0),[Ve,Ae]=o(void 0),[De,je]=o(void 0),[ke,Ne]=o(0),[xe,Fe]=o(""),[we,Re]=o(W[0]),[Me,qe]=o(!1),[Le,Ue]=o(c),[Be,Ge]=o(s),[Ye,Xe]=o(u.DYNAMIC_EXPIRATION),Qe=[{value:l.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:se===l.AMOUNT_OFF_ORDER},{value:l.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:se===l.AMOUNT_OFF_PRODUCTS},{value:l.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:se===l.BUY_X_GET_Y},{value:l.FREE_SHIPPING,label:"Free shipping",selected:se===l.FREE_SHIPPING}];n((()=>{U.makeExpiryMandatory&&qe(!0)}),[U.makeExpiryMandatory]),n((()=>{var e,i,t,o,n,r,c,s;let p;const{tempCouponData:v,discountType:b}=He();ue(b);const m=(e,i)=>{Re(v.valueType===C.FIXED_AMOUNT?W[e]:W[i])},y=(e,i)=>{Object.keys(e||{}).length&&i(e)};switch(((null==v?void 0:v.expireAfter)||(null==v?void 0:v.expireAt))&&(qe(!0),(null==v?void 0:v.expireAt)&&Xe(u.FIXED_EXPIRATION),(null==v?void 0:v.expireAfter)&&Xe(u.DYNAMIC_EXPIRATION)),b){case l.AMOUNT_OFF_ORDER:m(0,1),be(d.ENTIRE_ORDER);break;case l.AMOUNT_OFF_PRODUCTS:m(0,1),(null===(e=v.entitledCollectionIds)||void 0===e?void 0:e.length)?be(d.SPECIFIC_COLLECTIONS):(null===(i=v.entitledProductIds)||void 0===i?void 0:i.length)||(null===(t=v.productVariableConf)||void 0===t?void 0:t.entitledProductVariable)?(be(d.SPECIFIC_PRODUCTS),y(null===(o=v.productVariableConf)||void 0===o?void 0:o.entitledProductVariable,_e)):be(d.ENTIRE_ORDER);break;case l.BUY_X_GET_Y:Re(W[2]),(null===(n=v.entitledCollectionIds)||void 0===n?void 0:n.length)?he(a.SPECIFIC_COLLECTIONS):(he(a.SPECIFIC_PRODUCTS),y(null===(r=v.productVariableConf)||void 0===r?void 0:r.entitledProductVariable,_e)),(null===(c=v.prerequisiteCollectionIds)||void 0===c?void 0:c.length)?ye(a.SPECIFIC_COLLECTIONS):(ye(a.SPECIFIC_PRODUCTS),y(null===(s=v.productVariableConf)||void 0===s?void 0:s.prerequisiteProductVariable,Ae));break;case l.FREE_SHIPPING:Re(W[3])}de(Object.assign({},v)),U.hideProbability||(p=$e()),ce(F(v,pe,b,U.hideProbability||!1,p,!!v.isStaticCoupon)),U.hideProbability||$e()}),[]),n((()=>{let e;U.hideProbability||(e=$e()),ce(F(re,pe,se,U.hideProbability||!1,e,!!re.isStaticCoupon))}),[re,ke,se,pe]),n((()=>{var e,i,t,o,n,l,r;if(!U.newPickerConf&&((null===(e=U.products)||void 0===e?void 0:e.length)||(null===(i=U.collection)||void 0===i?void 0:i.length))){if(U.products&&(null===(t=U.products)||void 0===t?void 0:t.length)){if(null===(o=U.data)||void 0===o?void 0:o.entitledProductIds){const e=U.products.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.entitledProductIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));Ee(e)}if(null===(n=U.data)||void 0===n?void 0:n.prerequisiteProductIds){const e=U.products.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.prerequisiteProductIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));fe(e)}}if(U.collection&&U.collection.length){if(null===(l=U.data)||void 0===l?void 0:l.entitledCollectionIds){const e=U.collection.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.entitledCollectionIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));je(e)}if(null===(r=U.data)||void 0===r?void 0:r.prerequisiteCollectionIds){const e=U.collection.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.prerequisiteCollectionIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));Se(e)}}}}),[U.products,U.collection]),n((()=>{var e,i,t,o,n,l,r,d;(null===(i=null===(e=U.data)||void 0===e?void 0:e.productsConf)||void 0===i?void 0:i.entitledProducts)&&Ee(U.data.productsConf.entitledProducts),(null===(o=null===(t=U.data)||void 0===t?void 0:t.productsConf)||void 0===o?void 0:o.prerequisiteProducts)&&fe(U.data.productsConf.prerequisiteProducts),(null===(l=null===(n=U.data)||void 0===n?void 0:n.collectionsConf)||void 0===l?void 0:l.entitledCollections)&&je(U.data.collectionsConf.entitledCollections),(null===(d=null===(r=U.data)||void 0===r?void 0:r.collectionsConf)||void 0===d?void 0:d.prerequisiteCollections)&&Se(U.data.collectionsConf.prerequisiteCollections)}),[null===(X=U.data)||void 0===X?void 0:X.productsConf,null===(Q=U.data)||void 0===Q?void 0:Q.collectionsConf]),n((()=>{if(!Te)return;if(U.newPickerConf){const e=[];return Object.values(Te).forEach((i=>{i.products&&Object.keys(i.products).forEach((i=>{e.push(parseInt(i))}))})),void de(Object.assign(Object.assign({},re),{entitledProductIds:e}))}const e=Te.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{entitledProductIds:e}))}),[Te]),n((()=>{if(!Ie)return;if(U.newPickerConf){const e=[];return Object.values(Ie).forEach((i=>{i.products&&Object.keys(i.products).forEach((i=>{e.push(parseInt(i))}))})),void de(Object.assign(Object.assign({},re),{prerequisiteProductIds:e}))}const e=Ie.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{prerequisiteProductIds:e}))}),[Ie]),n((()=>{if(!De)return;if(U.newPickerConf){(null==De?void 0:De.isCustom)&&delete De.isCustom;const e=Object.keys(De).map((e=>parseInt(e)));return void de(Object.assign(Object.assign({},re),{entitledCollectionIds:e}))}const e=De.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{entitledCollectionIds:e}))}),[De]),n((()=>{if(!Oe)return;if(U.newPickerConf){(null==Oe?void 0:Oe.isCustom)&&delete Oe.isCustom;const e=Object.keys(Oe).map((e=>parseInt(e)));return void de(Object.assign(Object.assign({},re),{prerequisiteCollectionIds:e}))}const e=Oe.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{prerequisiteCollectionIds:e}))}),[Oe]);const He=()=>{var e,i;let t,o=re;return re.isStaticCoupon||(re.targetType===p.SHIPPING_LINE?t=l.FREE_SHIPPING:re.targetType===p.LINE_ITEM?t=re.targetSelection===v.ENTITLED?(null===(e=re.prerequisiteProductIds)||void 0===e?void 0:e.length)||(null===(i=re.prerequisiteCollectionIds)||void 0===i?void 0:i.length)||re.prerequisiteQuantity||re.entitledQuantity?l.BUY_X_GET_Y:l.AMOUNT_OFF_PRODUCTS:l.AMOUNT_OFF_ORDER:(o=Object.assign(Object.assign({},o),{targetType:p.LINE_ITEM,targetSelection:v.ALL,valueType:C.FIXED_AMOUNT}),t=l.AMOUNT_OFF_ORDER)),{discountType:t,tempCouponData:o}},ze=()=>{Ue(c),Ge(s)},Ke=e=>{var i;const t={invalidDiscountCode:"Please add Discount Code",invalidCouponTitle:"Please add Discount Coupon Title",invalidCouponDescription:"Please add Coupon Description",inValidProbability:e.inValidProbability&&(null!==(i=re.probability)&&void 0!==i?i:-1)>1?"Probability should not exceed 1":re.isStaticCoupon?"Please add Probability":"Probability should be greater than 0",inValidDiscountAmount:"Please add Discount Amount",inValidMinimumAmount:"Specify minimum amount required",inValidMinimumQuantity:"Specify minimum items required",inValidCouponExpiry:"Please add Coupon Expiry",inValidProductSelection:"Please specify the products",inValidProductVariableSelection:"Please specify the product variables",inValidCollectionSelection:"Please specify the collections",inValidBuyXValue:"Please specify buy product quantity",inValidGetYValue:"Please specify get product quantity",inValidBuyXProductSelection:"Please specify the products",inValidBuyXCollectionSelection:"Please specify the collections",inValidGetYProductSelection:"Please specify the products",inValidGetYCollectionSelection:"Please specify the collections",inValidBuyXProductVariableSelection:"Please specify the product variables",inValidGetYProductVariableSelection:"Please specify the product variables"};let o="";Object.keys(e).forEach((i=>{e[i]&&(o=t[i])}));const n=Object.values(e).filter(Boolean).length;return n>0&&(Fe(n>1?"Please add discount details":o),!0)},$e=()=>{if(!U.quadrant||!U.probability)return;const e=[...U.probability];let i=[];e.length>=U.quadrant&&e.splice(U.quadrant-1,1),i=e;const t=i.reduce(((e,i)=>e+i),0)+(re.probability||0);return Ne(parseFloat(t.toFixed(4))),parseFloat(t.toFixed(4))},Ze=e=>{var i,t,o,n,r,d,a,c,s,u,b,m,y,P,h,I;const f=e.value;ue(f),fe([]),Ee([]),Se([]),je([]),f===l.FREE_SHIPPING?de({value:100,targetSelection:v.ALL,targetType:p.SHIPPING_LINE,valueType:C.PERCENTAGE,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(i=re.expireAt)&&void 0!==i?i:void 0,expireAfter:null!==(t=re.expireAfter)&&void 0!==t?t:void 0,probability:re.probability,minQuantity:null!==(o=re.minQuantity)&&void 0!==o?o:void 0,minAmount:null!==(n=re.minAmount)&&void 0!==n?n:void 0}):f===l.BUY_X_GET_Y?de({value:100,targetSelection:v.ENTITLED,targetType:p.LINE_ITEM,valueType:C.PERCENTAGE,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(r=re.expireAt)&&void 0!==r?r:void 0,expireAfter:null!==(d=re.expireAfter)&&void 0!==d?d:void 0,probability:re.probability,minQuantity:void 0,minAmount:void 0}):f===l.AMOUNT_OFF_ORDER?de({targetSelection:v.ALL,targetType:p.LINE_ITEM,valueType:null!==(a=re.valueType)&&void 0!==a?a:C.FIXED_AMOUNT,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(c=re.expireAt)&&void 0!==c?c:void 0,expireAfter:null!==(s=re.expireAfter)&&void 0!==s?s:void 0,probability:re.probability,value:re.value,minQuantity:null!==(u=re.minQuantity)&&void 0!==u?u:void 0,minAmount:null!==(b=re.minAmount)&&void 0!==b?b:void 0}):f===l.AMOUNT_OFF_PRODUCTS&&de({targetSelection:v.ENTITLED,targetType:p.LINE_ITEM,valueType:null!==(m=re.valueType)&&void 0!==m?m:C.FIXED_AMOUNT,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(y=re.expireAt)&&void 0!==y?y:void 0,expireAfter:null!==(P=re.expireAfter)&&void 0!==P?P:void 0,probability:re.probability,value:re.value,minQuantity:null!==(h=re.minQuantity)&&void 0!==h?h:void 0,minAmount:null!==(I=re.minAmount)&&void 0!==I?I:void 0})},Je=i=>i&&e(T,{theme:"light",tagText:i,type:"negative",LeadingIcon:V});return i(I,Object.assign({width:(ne||ee)&&U.newPickerConf?"25px":"640px",open:U.isOpen,hideCrossButton:!!te,headingTitle:ee?"Select Products":U.title,headingSubtitle:ee?void 0:U.subTitle,footerLeftCustomElement:xe?Je(xe):U.errorMsg?Je(U.errorMsg):!U.quadrant||U.hideProbability?e(t,{}):ke<=1?e(T,{theme:"light",tagText:`Current probability sum: ${ke}`,type:"white"}):e(E,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e("div",{children:e(T,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${ke}`,type:"negative",LeadingIcon:_})})})),headerRightCustomElement:U.allowStaticCoupon||ee?void 0:e(b,{options:Qe,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{Ze(e)}}),onClose:U.onClose,footerContainerStyle:{borderTop:`1px solid ${h.colorsV2.stroke.primary}`},primaryButton:ee?{buttonType:"primary",onClick:()=>{ie(void 0)},buttonText:"Add"}:ne?{buttonType:"primary",onClick:()=>{le(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Create discount code",isLoading:null!==(H=U.loading)&&void 0!==H&&H,onClick:()=>{var e,i,t,o,n;if(ze(),re.isStaticCoupon){const{isStaticCoupon:e,couponCode:i,title:t,description:o,quadrant:n,probability:l}=re,r={invalidDiscountCode:!i,invalidCouponTitle:!t,invalidCouponDescription:!o,inValidProbability:!U.hideProbability&&(null!=l?l:-1)<0||(null!=l?l:0)>1||Number.isNaN(null!=l?l:0)};if(Ke(r))return void Ue(r);if(ae||ke>1)return void Fe(!U.hideProbability&&ke>1?"Probability sum should not exceed 1":"Invalid coupon details");U.onSaveClicked({quadrant:n,couponCode:i,description:o,isStaticCoupon:e,probability:l,title:re.title})}else{const c={invalidCouponTitle:!re.title,inValidProbability:!U.hideProbability&&(null!==(e=re.probability)&&void 0!==e?e:-1)<=0||(null!==(i=re.probability)&&void 0!==i?i:-1)>1||Number.isNaN(null!==(t=re.probability)&&void 0!==t?t:-1),inValidDiscountAmount:!re.value,inValidMinimumQuantity:!1,inValidMinimumAmount:!1,inValidCouponExpiry:!1,inValidProductSelection:!1,inValidProductVariableSelection:!1,inValidCollectionSelection:!1,inValidBuyXValue:!1,inValidGetYValue:!1,inValidBuyXProductSelection:!1,inValidGetYProductSelection:!1,inValidBuyXCollectionSelection:!1,inValidGetYCollectionSelection:!1,inValidBuyXProductVariableSelection:!1,inValidGetYProductVariableSelection:!1};if(se!==l.BUY_X_GET_Y&&pe!==r.NA){const{minAmount:e,minQuantity:i}=re;c.inValidMinimumAmount=pe===r.AMOUNT&&!e,c.inValidMinimumQuantity=pe===r.QUANTITY&&!i}if(Me&&(c.inValidCouponExpiry=!re.expireAt&&!re.expireAfter),se!==l.AMOUNT_OFF_ORDER&&se!==l.AMOUNT_OFF_PRODUCTS||(Ce!==d.SPECIFIC_PRODUCTS||!Te||Object.keys(Te).length||ge||(c.inValidProductSelection=!0,c.inValidProductVariableSelection=!0),Ce===d.SPECIFIC_COLLECTIONS&&De&&!Object.keys(De).length&&(c.inValidCollectionSelection=!0)),se===l.BUY_X_GET_Y&&(re.prerequisiteQuantity||(c.inValidBuyXValue=!0),re.entitledQuantity||(c.inValidGetYValue=!0),me!==a.SPECIFIC_PRODUCTS||!Ie||Object.keys(Ie).length||Ve||(c.inValidBuyXProductSelection=!0,c.inValidBuyXProductVariableSelection=!0),me===a.SPECIFIC_COLLECTIONS&&Oe&&!Object.keys(Oe).length&&(c.inValidBuyXCollectionSelection=!0),Pe!==a.SPECIFIC_PRODUCTS||!Te||Object.keys(Te).length||ge||(c.inValidGetYProductSelection=!0,c.inValidGetYProductVariableSelection=!0),Pe===a.SPECIFIC_COLLECTIONS&&De&&!Object.keys(De).length&&(c.inValidGetYCollectionSelection=!0)),Ke(c))return void Ge(c);if(ae||ke>1)return void Fe(!U.hideProbability&&ke>1?"Probability sum should not exceed 1":"Invalid coupon details");U.onSaveClicked(Object.assign(Object.assign({},re),{description:w(re,U.currency,null!==(o=U.products)&&void 0!==o?o:[],null!==(n=U.collection)&&void 0!==n?n:[]),productsConf:{entitledProducts:null!=Te?Te:[],prerequisiteProducts:null!=Ie?Ie:[]},collectionsConf:{entitledCollections:null!=De?De:[],prerequisiteCollections:null!=Oe?Oe:[]},productVariableConf:{entitledProductVariable:null!=ge?ge:{},prerequisiteProductVariable:null!=Ve?Ve:{}}}))}}},secondaryButton:ee?{buttonType:"tertiaryGray",onClick:()=>{ie(void 0)},buttonText:"Back"}:ne?{buttonType:"tertiaryGray",onClick:()=>{le(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:U.onClose,buttonText:"Cancel"}},{children:[!ee&&!ne&&i(k,{children:[U.allowStaticCoupon&&!ee&&i(N,Object.assign({selectedDiv:re.isStaticCoupon?1:2},{children:["static"===U.hideOption?e(t,{}):i("div",Object.assign({className:"coupon-type__container",onClick:()=>{re.isStaticCoupon||(de({isStaticCoupon:!0,quadrant:re.quadrant}),Fe(""),ze())}},{children:[e(m,Object.assign({style:{marginBottom:"4px",color:re.isStaticCoupon?h.colorsV2.content.brand:void 0}},{children:"Static Code"})),e(y,Object.assign({style:re.isStaticCoupon?{color:h.colorsV2.content.brand}:{}},{children:"A uniform code provided manually, used for providing the same discount to all customers."}))]})),"dynamic"===U.hideOption?e(t,{}):i("div",Object.assign({className:"coupon-type__container",onClick:()=>{var i;re.isStaticCoupon&&(ue(l.AMOUNT_OFF_ORDER),de({isStaticCoupon:!1,quadrant:re.quadrant,targetType:p.LINE_ITEM,targetSelection:v.ALL,valueType:C.FIXED_AMOUNT}),Fe(""),ze(),Re({id:"0",label:"Amount",value:"amount",icon:i=>e("span",Object.assign({style:{fontSize:20,color:i}},{children:U.currency||""}))}),qe(null!==(i=U.makeExpiryMandatory)&&void 0!==i&&i),ve(r.NA))}},{children:[e(m,Object.assign({style:{marginBottom:"4px",color:re.isStaticCoupon?void 0:h.colorsV2.content.brand}},{children:"Dynamic Code"})),e(y,Object.assign({style:re.isStaticCoupon?{}:{color:h.colorsV2.content.brand}},{children:"Code will be unique for all customers, with the first 5 letters of the customer's name, followed by 10 random characters."}))]}))]})),e(P,Object.assign({style:{marginTop:"24px"}},{children:"Coupon Details"})),re.isStaticCoupon&&!ee&&e(q,{discountData:re,setDiscountData:de,hideProbability:U.hideProbability||!1,discountAdminUrl:U.discountAdminUrl,staticDiscountValidationError:Le,currency:U.currency}),!re.isStaticCoupon&&!ee&&!ne&&e(R,{currency:U.currency,entitledProducts:null!=Te?Te:[],prerequisiteProducts:null!=Ie?Ie:[],setEntitledProducts:Ee,setPrerequisiteProducts:fe,discountData:re,productPickerOpen:ee,productVariablePickerOpen:te,setIsProductPickerOpen:ie,setIsProductVariablePickerOpen:oe,setDiscountData:de,selectedCouponType:se,setSelectedCouponType:ue,selectedMinimumRequirement:pe,setSelectedMinimumRequirement:ve,discountCouponAppliesTo:Ce,offerAppliesToBuy:me,offerAppliesToGet:Pe,setDiscountCouponAppliesTo:be,setOfferAppliesToBuy:ye,setOfferAppliesToGet:he,hideProbability:U.hideProbability||!1,hideExpiration:U.hideExpiration||!1,allowStaticCoupon:U.allowStaticCoupon,onChangeCouponType:Ze,collectionPickerOpen:ne,entitledCollections:null!=De?De:[],prerequisiteCollections:null!=Oe?Oe:[],setIsCollectionPickerOpen:le,setEntitledCollections:je,setPrerequisiteCollections:Se,useNewPicker:!!U.newPickerConf,setSelectedDiscountDetails:Re,selectedDiscountDetails:we,isProductVariableSupported:U.isProductVariableSupported,entitledProductVariable:ge,setEntitledProductVariable:_e,preRequisiteProductVariable:Ve,setPreRequisiteProductVariable:Ae,productVariableList:U.productVariableList,isAddExpirationChecked:Me,setIsAddExpirationChecked:qe,dynamicDiscountValidationError:Be,setDynamicDiscountValidationError:Ge,setValidationErrorMessage:Fe,resetValidationErrors:ze,discountDetailsOptions:W,selectedExpiration:Ye,setSelectedExpiration:Xe,makeExpiryMandatory:!!U.makeExpiryMandatory})]}),!!ee&&i(t,{children:[!U.newPickerConf&&e("div",Object.assign({style:{padding:"12px 0"}},{children:e(f,{show:!0,onSave:()=>{},products:null!==(z=U.products)&&void 0!==z?z:[],title:"Select Products",onClose:()=>{ie(void 0)},selectedProducts:null!==(K=ee===M.ENTITLED?Te:Ie)&&void 0!==K?K:[],setSelectedProducts:ee===M.ENTITLED?Ee:fe,onSearchKeyChange:U.onProductSearch})})),U.newPickerConf&&e(A,{visible:!0,onClose:()=>ie(void 0),collectionFetcher:(e,i,t)=>{var o;return(null===(o=U.newPickerConf)||void 0===o?void 0:o.fetchCollections)?U.newPickerConf.fetchCollections(e,i,!1,t):null},productFetcher:(e,i,t,o,n)=>{var l;return(null===(l=U.newPickerConf)||void 0===l?void 0:l.fetchProducts)?U.newPickerConf.fetchProducts(e,i,o,n,!1,t):null},selectedItems:ee===M.ENTITLED?Te:Ie,onAdd:e=>{ee===M.ENTITLED?Ee(e):fe(e),ie(void 0)},zIndex:200,storeId:U.newPickerConf.storeId,appType:U.newPickerConf.appType||L.ApplicationType.BIK,searchInCollectionFetcher:(e,i,t,o)=>{var n;return(null===(n=U.newPickerConf)||void 0===n?void 0:n.searchInCollection)?U.newPickerConf.searchInCollection(e,i,t,!1,o):null},customCollectionRestriction:!1,searchFetcher:(e,i,t)=>{var o;return(null===(o=U.newPickerConf)||void 0===o?void 0:o.searchProducts)?U.newPickerConf.searchProducts(e,i,!1,t):null},hideCollectionCheckbox:!0,hideVariantCheckbox:!0,selectProductsFromCustomCollection:!0,hideSelectionCount:!0})]}),!!ne&&e("div",Object.assign({style:{padding:"12px 0"}},{children:i(t,{children:[U.newPickerConf&&e(A,{visible:!0,onClose:()=>le(void 0),collectionFetcher:U.newPickerConf.fetchCollections,productFetcher:U.newPickerConf.fetchProducts,selectedItems:ne===M.ENTITLED?De:Oe,onAdd:e=>{Object.values(e).forEach((e=>{e.products&&delete e.products})),ne===M.ENTITLED?je(e):Se(e),le(void 0)},customCollectionRestriction:!1,zIndex:200,storeId:U.newPickerConf.storeId,appType:U.newPickerConf.appType||L.ApplicationType.BIK,searchInCollectionFetcher:U.newPickerConf.searchInCollection,searchFetcher:U.newPickerConf.searchProducts,hideProductCheckbox:!0,hideVariantCheckbox:!0,title:"Select Collections",hideGlobalSearch:!0,hideSelectionCount:!0}),!U.newPickerConf&&e(f,{show:!0,onSave:()=>{},products:null!==($=U.collection)&&void 0!==$?$:[],title:"Select Products",onClose:()=>{le(void 0)},selectedProducts:null!==(Z=ne===M.ENTITLED?De:Oe)&&void 0!==Z?Z:[],setSelectedProducts:ne===M.ENTITLED?je:Se,onSearchKeyChange:U.onCollectionSearch,searchPlaceholder:"Search collections..."})]})})),te&&e(x,{children:e("div",Object.assign({style:{width:"50%",height:"100%",marginLeft:"50%"}},{children:e(j,{type:D.EMBEDDED,data:null!==(J=U.productVariableList)&&void 0!==J?J:[],showHeader:!0,onSelect:e=>{if(te===M.ENTITLED){const{displayName:i,actualValue:t,isAvailable:o}=e;_e({displayName:i,actualValue:t,isAvailable:o}),oe(void 0)}if(te===M.PREREQUISITE){const{displayName:i,actualValue:t,isAvailable:o}=e;Ae({displayName:i,actualValue:t,isAvailable:o}),oe(void 0)}},onClose:()=>{oe(void 0)}})}))})]}))};export{U as DiscountModal};
1
+ import{jsx as e,jsxs as i,Fragment as t}from"react/jsx-runtime";import"../../node_modules/@bikdotai/bik-models/growth/index.js";import{useState as o,useEffect as n}from"react";import{DISCOUNT_TYPES as l,MIN_PURCHASE_REQUIREMENT as r,DISCOUNT_APPLIES_TO as d,OFFER_APPLIES_TO as a,initialStaticCouponErrorState as c,initialDynamicCouponErrorState as s,COUPON_EXPIRATION as u,DISCOUNT_TARGET_TYPES as p,DISCOUNT_TARGET_SELECTION as v,DISCOUNT_VALUE_TYPES as C}from"./type.js";import"../dropdown/DropdownPopover/index.js";import{Dropdown as b}from"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"../zeroState/ZeroState.js";import{TitleSmall as m,BodyCaption as y,TitleRegular as P}from"../TypographyStyle.js";import{DEFAULT_THEME as h}from"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import"../icon-button/IconButton.js";import"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import{StyledModal as I}from"../modals/styledModal.js";import{ProductPickerContent as f}from"../product-picker/ProductPickerModal.js";import{Tag as T}from"../tag/Tag.js";import{Tooltip as E}from"../tooltips/Tooltip.js";import O from"../../assets/icons/gift_icon.svg.js";import S from"../../assets/icons/percentage_icon.svg.js";import g from"../../assets/icons/shipping_icon.svg.js";import _ from"../../assets/icons/triangle_error.svg.js";import V from"../../assets/icons/warning.svg.js";import{ProductPickerModal as A}from"../product-picker-v2/modal.js";import"../product-picker-v2/type.js";import{PickerType as D}from"../variable-picker-v3/model.js";import{VariablePicker as j}from"../variable-picker-v3/VariablePicker.js";import{StyledDiscountDialogueContainer as k,CouponTypeContainerStyled as N,VariablePickerContainer as x}from"./DiscountModal.styled.js";import{validateDiscountData as F,descriptionBuilder as w}from"./DiscountUtils.js";import R,{DISCOUNT_PRODUCTS as M}from"./DynamicCoupon/DynamicCoupon.js";import q from"./StaticCoupon/StaticCoupon.js";import{__exports as L}from"../../_virtual/index.js";const U=U=>{var B,G,Y,X,Q,H,z,K,$,Z,J;const W=[{id:"0",label:"Amount",value:"amount",icon:i=>e("span",Object.assign({style:{fontSize:20,color:i,lineHeight:.9}},{children:U.currency||""}))},{id:"1",label:"Percentage",value:"percentage",icon:i=>e(S,{width:24,height:24,color:i})},{id:"2",label:"Buy X get Y",value:l.BUY_X_GET_Y,icon:i=>e(O,{width:24,height:24,color:i})},{id:"3",label:"Free Shipping",value:l.FREE_SHIPPING,icon:i=>e(g,{width:24,height:24,color:i})}],[ee,ie]=o(),[te,oe]=o(),[ne,le]=o(),[re,de]=o(null!==(B=U.data)&&void 0!==B?B:"string"==typeof U.hideOption?{isStaticCoupon:"dynamic"===U.hideOption}:{isStaticCoupon:!0}),[ae,ce]=o(!0),[se,ue]=o(),[pe,ve]=o((null===(G=U.data)||void 0===G?void 0:G.minAmount)?r.AMOUNT:(null===(Y=U.data)||void 0===Y?void 0:Y.minQuantity)?r.QUANTITY:r.NA),[Ce,be]=o(d.ENTIRE_ORDER),[me,ye]=o(a.SPECIFIC_PRODUCTS),[Pe,he]=o(a.SPECIFIC_PRODUCTS),[Ie,fe]=o(void 0),[Te,Ee]=o(void 0),[Oe,Se]=o(void 0),[ge,_e]=o(void 0),[Ve,Ae]=o(void 0),[De,je]=o(void 0),[ke,Ne]=o(0),[xe,Fe]=o(""),[we,Re]=o(W[0]),[Me,qe]=o(!1),[Le,Ue]=o(c),[Be,Ge]=o(s),[Ye,Xe]=o(u.DYNAMIC_EXPIRATION),Qe=[{value:l.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:se===l.AMOUNT_OFF_ORDER},{value:l.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:se===l.AMOUNT_OFF_PRODUCTS},{value:l.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:se===l.BUY_X_GET_Y},{value:l.FREE_SHIPPING,label:"Free shipping",selected:se===l.FREE_SHIPPING}];n((()=>{U.makeExpiryMandatory&&qe(!0)}),[U.makeExpiryMandatory]),n((()=>{var e,i,t,o,n,r,c,s;let p;const{tempCouponData:v,discountType:b}=He();ue(b);const m=(e,i)=>{Re(v.valueType===C.FIXED_AMOUNT?W[e]:W[i])},y=(e,i)=>{Object.keys(e||{}).length&&i(e)};switch(((null==v?void 0:v.expireAfter)||(null==v?void 0:v.expireAt))&&(qe(!0),(null==v?void 0:v.expireAt)&&Xe(u.FIXED_EXPIRATION),(null==v?void 0:v.expireAfter)&&Xe(u.DYNAMIC_EXPIRATION)),b){case l.AMOUNT_OFF_ORDER:m(0,1),be(d.ENTIRE_ORDER);break;case l.AMOUNT_OFF_PRODUCTS:m(0,1),(null===(e=v.entitledCollectionIds)||void 0===e?void 0:e.length)?be(d.SPECIFIC_COLLECTIONS):(null===(i=v.entitledProductIds)||void 0===i?void 0:i.length)||(null===(t=v.productVariableConf)||void 0===t?void 0:t.entitledProductVariable)?(be(d.SPECIFIC_PRODUCTS),y(null===(o=v.productVariableConf)||void 0===o?void 0:o.entitledProductVariable,_e)):be(d.ENTIRE_ORDER);break;case l.BUY_X_GET_Y:Re(W[2]),(null===(n=v.entitledCollectionIds)||void 0===n?void 0:n.length)?he(a.SPECIFIC_COLLECTIONS):(he(a.SPECIFIC_PRODUCTS),y(null===(r=v.productVariableConf)||void 0===r?void 0:r.entitledProductVariable,_e)),(null===(c=v.prerequisiteCollectionIds)||void 0===c?void 0:c.length)?ye(a.SPECIFIC_COLLECTIONS):(ye(a.SPECIFIC_PRODUCTS),y(null===(s=v.productVariableConf)||void 0===s?void 0:s.prerequisiteProductVariable,Ae));break;case l.FREE_SHIPPING:Re(W[3])}de(Object.assign({},v)),U.hideProbability||(p=$e()),ce(F(v,pe,b,U.hideProbability||!1,p,!!v.isStaticCoupon)),U.hideProbability||$e()}),[]),n((()=>{let e;U.hideProbability||(e=$e()),ce(F(re,pe,se,U.hideProbability||!1,e,!!re.isStaticCoupon))}),[re,ke,se,pe]),n((()=>{var e,i,t,o,n,l,r;if(!U.newPickerConf&&((null===(e=U.products)||void 0===e?void 0:e.length)||(null===(i=U.collection)||void 0===i?void 0:i.length))){if(U.products&&(null===(t=U.products)||void 0===t?void 0:t.length)){if(null===(o=U.data)||void 0===o?void 0:o.entitledProductIds){const e=U.products.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.entitledProductIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));Ee(e)}if(null===(n=U.data)||void 0===n?void 0:n.prerequisiteProductIds){const e=U.products.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.prerequisiteProductIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));fe(e)}}if(U.collection&&U.collection.length){if(null===(l=U.data)||void 0===l?void 0:l.entitledCollectionIds){const e=U.collection.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.entitledCollectionIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));je(e)}if(null===(r=U.data)||void 0===r?void 0:r.prerequisiteCollectionIds){const e=U.collection.filter((e=>{var i,t;return null===(t=null===(i=U.data)||void 0===i?void 0:i.prerequisiteCollectionIds)||void 0===t?void 0:t.includes(parseInt(e.id))}));Se(e)}}}}),[U.products,U.collection]),n((()=>{var e,i,t,o,n,l,r,d;(null===(i=null===(e=U.data)||void 0===e?void 0:e.productsConf)||void 0===i?void 0:i.entitledProducts)&&Ee(U.data.productsConf.entitledProducts),(null===(o=null===(t=U.data)||void 0===t?void 0:t.productsConf)||void 0===o?void 0:o.prerequisiteProducts)&&fe(U.data.productsConf.prerequisiteProducts),(null===(l=null===(n=U.data)||void 0===n?void 0:n.collectionsConf)||void 0===l?void 0:l.entitledCollections)&&je(U.data.collectionsConf.entitledCollections),(null===(d=null===(r=U.data)||void 0===r?void 0:r.collectionsConf)||void 0===d?void 0:d.prerequisiteCollections)&&Se(U.data.collectionsConf.prerequisiteCollections)}),[null===(X=U.data)||void 0===X?void 0:X.productsConf,null===(Q=U.data)||void 0===Q?void 0:Q.collectionsConf]),n((()=>{if(!Te)return;if(U.newPickerConf){const e=[];return Object.values(Te).forEach((i=>{i.products&&Object.keys(i.products).forEach((i=>{e.push(parseInt(i))}))})),void de(Object.assign(Object.assign({},re),{entitledProductIds:e}))}const e=Te.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{entitledProductIds:e}))}),[Te]),n((()=>{if(!Ie)return;if(U.newPickerConf){const e=[];return Object.values(Ie).forEach((i=>{i.products&&Object.keys(i.products).forEach((i=>{e.push(parseInt(i))}))})),void de(Object.assign(Object.assign({},re),{prerequisiteProductIds:e}))}const e=Ie.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{prerequisiteProductIds:e}))}),[Ie]),n((()=>{if(!De)return;if(U.newPickerConf){(null==De?void 0:De.isCustom)&&delete De.isCustom;const e=Object.keys(De).map((e=>parseInt(e)));return void de(Object.assign(Object.assign({},re),{entitledCollectionIds:e}))}const e=De.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{entitledCollectionIds:e}))}),[De]),n((()=>{if(!Oe)return;if(U.newPickerConf){(null==Oe?void 0:Oe.isCustom)&&delete Oe.isCustom;const e=Object.keys(Oe).map((e=>parseInt(e)));return void de(Object.assign(Object.assign({},re),{prerequisiteCollectionIds:e}))}const e=Oe.map((e=>parseInt(e.id)));de(Object.assign(Object.assign({},re),{prerequisiteCollectionIds:e}))}),[Oe]);const He=()=>{var e,i;let t,o=re;return re.isStaticCoupon||(re.targetType===p.SHIPPING_LINE?t=l.FREE_SHIPPING:re.targetType===p.LINE_ITEM?t=re.targetSelection===v.ENTITLED?(null===(e=re.prerequisiteProductIds)||void 0===e?void 0:e.length)||(null===(i=re.prerequisiteCollectionIds)||void 0===i?void 0:i.length)||re.prerequisiteQuantity||re.entitledQuantity?l.BUY_X_GET_Y:l.AMOUNT_OFF_PRODUCTS:l.AMOUNT_OFF_ORDER:(o=Object.assign(Object.assign({},o),{targetType:p.LINE_ITEM,targetSelection:v.ALL,valueType:C.FIXED_AMOUNT}),t=l.AMOUNT_OFF_ORDER)),{discountType:t,tempCouponData:o}},ze=()=>{Ue(c),Ge(s)},Ke=e=>{var i;const t={invalidDiscountCode:"Please add Discount Code",invalidCouponTitle:"Please add Discount Coupon Title",invalidCouponDescription:"Please add Coupon Description",inValidProbability:e.inValidProbability&&(null!==(i=re.probability)&&void 0!==i?i:-1)>1?"Probability should not exceed 1":re.isStaticCoupon?"Please add Probability":"Probability should be greater than 0",inValidDiscountAmount:"Please add Discount Amount",inValidMinimumAmount:"Specify minimum amount required",inValidMinimumQuantity:"Specify minimum items required",inValidCouponExpiry:"Please add Coupon Expiry",inValidProductSelection:"Please specify the products",inValidProductVariableSelection:"Please specify the product variables",inValidCollectionSelection:"Please specify the collections",inValidBuyXValue:"Please specify buy product quantity",inValidGetYValue:"Please specify get product quantity",inValidBuyXProductSelection:"Please specify the products",inValidBuyXCollectionSelection:"Please specify the collections",inValidGetYProductSelection:"Please specify the products",inValidGetYCollectionSelection:"Please specify the collections",inValidBuyXProductVariableSelection:"Please specify the product variables",inValidGetYProductVariableSelection:"Please specify the product variables"};let o="";Object.keys(e).forEach((i=>{e[i]&&(o=t[i])}));const n=Object.values(e).filter(Boolean).length;return n>0&&(Fe(n>1?"Please add discount details":o),!0)},$e=()=>{if(!U.quadrant||!U.probability)return;const e=[...U.probability];let i=[];e.length>=U.quadrant&&e.splice(U.quadrant-1,1),i=e;const t=i.reduce(((e,i)=>e+i),0)+(re.probability||0);return Ne(parseFloat(t.toFixed(4))),parseFloat(t.toFixed(4))},Ze=e=>{var i,t,o,n,r,d,a,c,s,u,b,m,y,P,h,I;const f=e.value;ue(f),fe([]),Ee([]),Se([]),je([]),f===l.FREE_SHIPPING?de({value:100,targetSelection:v.ALL,targetType:p.SHIPPING_LINE,valueType:C.PERCENTAGE,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(i=re.expireAt)&&void 0!==i?i:void 0,expireAfter:null!==(t=re.expireAfter)&&void 0!==t?t:void 0,probability:re.probability,minQuantity:null!==(o=re.minQuantity)&&void 0!==o?o:void 0,minAmount:null!==(n=re.minAmount)&&void 0!==n?n:void 0}):f===l.BUY_X_GET_Y?de({value:100,targetSelection:v.ENTITLED,targetType:p.LINE_ITEM,valueType:C.PERCENTAGE,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(r=re.expireAt)&&void 0!==r?r:void 0,expireAfter:null!==(d=re.expireAfter)&&void 0!==d?d:void 0,probability:re.probability,minQuantity:void 0,minAmount:void 0}):f===l.AMOUNT_OFF_ORDER?de({targetSelection:v.ALL,targetType:p.LINE_ITEM,valueType:null!==(a=re.valueType)&&void 0!==a?a:C.FIXED_AMOUNT,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(c=re.expireAt)&&void 0!==c?c:void 0,expireAfter:null!==(s=re.expireAfter)&&void 0!==s?s:void 0,probability:re.probability,value:re.value,minQuantity:null!==(u=re.minQuantity)&&void 0!==u?u:void 0,minAmount:null!==(b=re.minAmount)&&void 0!==b?b:void 0}):f===l.AMOUNT_OFF_PRODUCTS&&de({targetSelection:v.ENTITLED,targetType:p.LINE_ITEM,valueType:null!==(m=re.valueType)&&void 0!==m?m:C.FIXED_AMOUNT,quadrant:re.quadrant,isStaticCoupon:!1,title:re.title,expireAt:null!==(y=re.expireAt)&&void 0!==y?y:void 0,expireAfter:null!==(P=re.expireAfter)&&void 0!==P?P:void 0,probability:re.probability,value:re.value,minQuantity:null!==(h=re.minQuantity)&&void 0!==h?h:void 0,minAmount:null!==(I=re.minAmount)&&void 0!==I?I:void 0})},Je=i=>i&&e(T,{theme:"light",tagText:i,type:"negative",LeadingIcon:V});return i(I,Object.assign({width:(ne||ee)&&U.newPickerConf?"25px":"640px",open:U.isOpen,hideCrossButton:!!te,headingTitle:ee?"Select Products":U.title,headingSubtitle:ee?void 0:U.subTitle,footerLeftCustomElement:xe?Je(xe):U.errorMsg?Je(U.errorMsg):!U.quadrant||U.hideProbability?e(t,{}):ke<=1?e(T,{theme:"light",tagText:`Current probability sum: ${ke}`,type:"white"}):e(E,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e("div",{children:e(T,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${ke}`,type:"negative",LeadingIcon:_})})})),headerRightCustomElement:U.allowStaticCoupon||ee?void 0:e(b,{options:Qe,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{Ze(e)}}),onClose:U.onClose,footerContainerStyle:{borderTop:`1px solid ${h.colorsV2.stroke.primary}`},primaryButton:ee?{buttonType:"primary",onClick:()=>{ie(void 0)},buttonText:"Add"}:ne?{buttonType:"primary",onClick:()=>{le(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Create discount code",isLoading:null!==(H=U.loading)&&void 0!==H&&H,onClick:()=>{var e,i,t,o,n;if(ze(),re.isStaticCoupon){const{isStaticCoupon:e,couponCode:i,title:t,description:o,quadrant:n,probability:l}=re,r={invalidDiscountCode:!i,invalidCouponTitle:!t,invalidCouponDescription:!o,inValidProbability:!U.hideProbability&&(null!=l?l:-1)<0||(null!=l?l:0)>1||Number.isNaN(null!=l?l:0)};if(Ke(r))return void Ue(r);if(ae||ke>1)return void Fe(!U.hideProbability&&ke>1?"Probability sum should not exceed 1":"Invalid coupon details");U.onSaveClicked({quadrant:n,couponCode:i,description:o,isStaticCoupon:e,probability:l,title:re.title})}else{const c={invalidCouponTitle:!re.title,inValidProbability:!U.hideProbability&&(null!==(e=re.probability)&&void 0!==e?e:-1)<=0||(null!==(i=re.probability)&&void 0!==i?i:-1)>1||Number.isNaN(null!==(t=re.probability)&&void 0!==t?t:-1),inValidDiscountAmount:!re.value,inValidMinimumQuantity:!1,inValidMinimumAmount:!1,inValidCouponExpiry:!1,inValidProductSelection:!1,inValidProductVariableSelection:!1,inValidCollectionSelection:!1,inValidBuyXValue:!1,inValidGetYValue:!1,inValidBuyXProductSelection:!1,inValidGetYProductSelection:!1,inValidBuyXCollectionSelection:!1,inValidGetYCollectionSelection:!1,inValidBuyXProductVariableSelection:!1,inValidGetYProductVariableSelection:!1};if(se!==l.BUY_X_GET_Y&&pe!==r.NA){const{minAmount:e,minQuantity:i}=re;c.inValidMinimumAmount=pe===r.AMOUNT&&!e,c.inValidMinimumQuantity=pe===r.QUANTITY&&!i}if(Me&&(c.inValidCouponExpiry=!re.expireAt&&!re.expireAfter),se!==l.AMOUNT_OFF_ORDER&&se!==l.AMOUNT_OFF_PRODUCTS||(Ce!==d.SPECIFIC_PRODUCTS||!Te||Object.keys(Te).length||ge||(c.inValidProductSelection=!0,c.inValidProductVariableSelection=!0),Ce===d.SPECIFIC_COLLECTIONS&&De&&!Object.keys(De).length&&(c.inValidCollectionSelection=!0)),se===l.BUY_X_GET_Y&&(re.prerequisiteQuantity||(c.inValidBuyXValue=!0),re.entitledQuantity||(c.inValidGetYValue=!0),me!==a.SPECIFIC_PRODUCTS||!Ie||Object.keys(Ie).length||Ve||(c.inValidBuyXProductSelection=!0,c.inValidBuyXProductVariableSelection=!0),me===a.SPECIFIC_COLLECTIONS&&Oe&&!Object.keys(Oe).length&&(c.inValidBuyXCollectionSelection=!0),Pe!==a.SPECIFIC_PRODUCTS||!Te||Object.keys(Te).length||ge||(c.inValidGetYProductSelection=!0,c.inValidGetYProductVariableSelection=!0),Pe===a.SPECIFIC_COLLECTIONS&&De&&!Object.keys(De).length&&(c.inValidGetYCollectionSelection=!0)),Ke(c))return void Ge(c);if(ae||ke>1)return void Fe(!U.hideProbability&&ke>1?"Probability sum should not exceed 1":"Invalid coupon details");U.onSaveClicked(Object.assign(Object.assign({},re),{description:w(re,U.currency,null!==(o=U.products)&&void 0!==o?o:[],null!==(n=U.collection)&&void 0!==n?n:[]),productsConf:{entitledProducts:null!=Te?Te:[],prerequisiteProducts:null!=Ie?Ie:[]},collectionsConf:{entitledCollections:null!=De?De:[],prerequisiteCollections:null!=Oe?Oe:[]},productVariableConf:{entitledProductVariable:null!=ge?ge:{},prerequisiteProductVariable:null!=Ve?Ve:{}}}))}}},secondaryButton:ee?{buttonType:"tertiaryGray",onClick:()=>{ie(void 0)},buttonText:"Back"}:ne?{buttonType:"tertiaryGray",onClick:()=>{le(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:U.onClose,buttonText:"Cancel"}},{children:[!ee&&!ne&&i(k,{children:[U.allowStaticCoupon&&!ee&&i(N,Object.assign({selectedDiv:re.isStaticCoupon?1:2},{children:["static"===U.hideOption?e(t,{}):i("div",Object.assign({className:"coupon-type__container",onClick:()=>{re.isStaticCoupon||(de({isStaticCoupon:!0,quadrant:re.quadrant}),Fe(""),ze())}},{children:[e(m,Object.assign({style:{marginBottom:"4px",color:re.isStaticCoupon?h.colorsV2.content.brand:void 0}},{children:"Static Code"})),e(y,Object.assign({style:re.isStaticCoupon?{color:h.colorsV2.content.brand}:{}},{children:"A uniform code provided manually, used for providing the same discount to all customers."}))]})),"dynamic"===U.hideOption?e(t,{}):i("div",Object.assign({className:"coupon-type__container",onClick:()=>{var i;re.isStaticCoupon&&(ue(l.AMOUNT_OFF_ORDER),de({isStaticCoupon:!1,quadrant:re.quadrant,targetType:p.LINE_ITEM,targetSelection:v.ALL,valueType:C.FIXED_AMOUNT}),Fe(""),ze(),Re({id:"0",label:"Amount",value:"amount",icon:i=>e("span",Object.assign({style:{fontSize:20,color:i}},{children:U.currency||""}))}),qe(null!==(i=U.makeExpiryMandatory)&&void 0!==i&&i),ve(r.NA))}},{children:[e(m,Object.assign({style:{marginBottom:"4px",color:re.isStaticCoupon?void 0:h.colorsV2.content.brand}},{children:"Dynamic Code"})),e(y,Object.assign({style:re.isStaticCoupon?{}:{color:h.colorsV2.content.brand}},{children:"Code will be unique for all customers, with the first 5 letters of the customer's name, followed by 10 random characters."}))]}))]})),e(P,Object.assign({style:{marginTop:"24px"}},{children:"Coupon Details"})),re.isStaticCoupon&&!ee&&e(q,{discountData:re,setDiscountData:de,hideProbability:U.hideProbability||!1,discountAdminUrl:U.discountAdminUrl,staticDiscountValidationError:Le,currency:U.currency}),!re.isStaticCoupon&&!ee&&!ne&&e(R,{currency:U.currency,entitledProducts:null!=Te?Te:[],prerequisiteProducts:null!=Ie?Ie:[],setEntitledProducts:Ee,setPrerequisiteProducts:fe,discountData:re,productPickerOpen:ee,productVariablePickerOpen:te,setIsProductPickerOpen:ie,setIsProductVariablePickerOpen:oe,setDiscountData:de,selectedCouponType:se,setSelectedCouponType:ue,selectedMinimumRequirement:pe,setSelectedMinimumRequirement:ve,discountCouponAppliesTo:Ce,offerAppliesToBuy:me,offerAppliesToGet:Pe,setDiscountCouponAppliesTo:be,setOfferAppliesToBuy:ye,setOfferAppliesToGet:he,hideProbability:U.hideProbability||!1,hideExpiration:U.hideExpiration||!1,allowStaticCoupon:U.allowStaticCoupon,onChangeCouponType:Ze,collectionPickerOpen:ne,entitledCollections:null!=De?De:[],prerequisiteCollections:null!=Oe?Oe:[],setIsCollectionPickerOpen:le,setEntitledCollections:je,setPrerequisiteCollections:Se,useNewPicker:!!U.newPickerConf,setSelectedDiscountDetails:Re,selectedDiscountDetails:we,isProductVariableSupported:U.isProductVariableSupported,entitledProductVariable:ge,setEntitledProductVariable:_e,preRequisiteProductVariable:Ve,setPreRequisiteProductVariable:Ae,productVariableList:U.productVariableList,isAddExpirationChecked:Me,setIsAddExpirationChecked:qe,dynamicDiscountValidationError:Be,setDynamicDiscountValidationError:Ge,setValidationErrorMessage:Fe,resetValidationErrors:ze,discountDetailsOptions:W,selectedExpiration:Ye,setSelectedExpiration:Xe,makeExpiryMandatory:!!U.makeExpiryMandatory})]}),!!ee&&i(t,{children:[!U.newPickerConf&&e("div",Object.assign({style:{padding:"12px 0"}},{children:e(f,{show:!0,onSave:()=>{},products:null!==(z=U.products)&&void 0!==z?z:[],title:"Select Products",onClose:()=>{ie(void 0)},selectedProducts:null!==(K=ee===M.ENTITLED?Te:Ie)&&void 0!==K?K:[],setSelectedProducts:ee===M.ENTITLED?Ee:fe,onSearchKeyChange:U.onProductSearch})})),U.newPickerConf&&e(A,{visible:!0,onClose:()=>ie(void 0),collectionFetcher:(e,i,t)=>{var o;return(null===(o=U.newPickerConf)||void 0===o?void 0:o.fetchCollections)?U.newPickerConf.fetchCollections(e,i,!1,t):null},productFetcher:(e,i,t,o,n)=>{var l;return(null===(l=U.newPickerConf)||void 0===l?void 0:l.fetchProducts)?U.newPickerConf.fetchProducts(e,i,o,n,!1,t):null},selectedItems:ee===M.ENTITLED?Te:Ie,onAdd:e=>{ee===M.ENTITLED?Ee(e):fe(e),ie(void 0)},zIndex:200,storeId:U.newPickerConf.storeId,appType:U.newPickerConf.appType||L.ApplicationType.BIK,searchInCollectionFetcher:(e,i,t,o)=>{var n;return(null===(n=U.newPickerConf)||void 0===n?void 0:n.searchInCollection)?U.newPickerConf.searchInCollection(e,i,t,!1,o):null},customCollectionRestriction:!1,searchFetcher:(e,i,t)=>{var o;return(null===(o=U.newPickerConf)||void 0===o?void 0:o.searchProducts)?U.newPickerConf.searchProducts(e,i,!1,t):null},hideCollectionCheckbox:!0,hideVariantCheckbox:!0,selectProductsFromCustomCollection:!0,hideSelectionCount:!0})]}),!!ne&&e("div",Object.assign({style:{padding:"12px 0"}},{children:i(t,{children:[U.newPickerConf&&e(A,{visible:!0,onClose:()=>le(void 0),collectionFetcher:U.newPickerConf.fetchCollections,productFetcher:U.newPickerConf.fetchProducts,selectedItems:ne===M.ENTITLED?De:Oe,onAdd:e=>{Object.values(e).forEach((e=>{e.products&&delete e.products})),ne===M.ENTITLED?je(e):Se(e),le(void 0)},customCollectionRestriction:!1,zIndex:200,storeId:U.newPickerConf.storeId,appType:U.newPickerConf.appType||L.ApplicationType.BIK,searchInCollectionFetcher:U.newPickerConf.searchInCollection,searchFetcher:U.newPickerConf.searchProducts,hideProductCheckbox:!0,hideVariantCheckbox:!0,title:"Select Collections",hideGlobalSearch:!0,hideSelectionCount:!0}),!U.newPickerConf&&e(f,{show:!0,onSave:()=>{},products:null!==($=U.collection)&&void 0!==$?$:[],title:"Select Products",onClose:()=>{le(void 0)},selectedProducts:null!==(Z=ne===M.ENTITLED?De:Oe)&&void 0!==Z?Z:[],setSelectedProducts:ne===M.ENTITLED?je:Se,onSearchKeyChange:U.onCollectionSearch,searchPlaceholder:"Search collections..."})]})})),te&&e(x,{children:e("div",Object.assign({style:{width:"50%",height:"100%",marginLeft:"50%"}},{children:e(j,{type:D.EMBEDDED,data:null!==(J=U.productVariableList)&&void 0!==J?J:[],showHeader:!0,onSelect:e=>{if(te===M.ENTITLED){const{displayName:i,actualValue:t,isAvailable:o}=e;_e({displayName:i,actualValue:t,isAvailable:o}),oe(void 0)}if(te===M.PREREQUISITE){const{displayName:i,actualValue:t,isAvailable:o}=e;Ae({displayName:i,actualValue:t,isAvailable:o}),oe(void 0)}},onClose:()=>{oe(void 0)}})}))})]}))};export{U as DiscountModal};
@@ -1,4 +1,4 @@
1
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
1
+ import { ApplicationType } from '@bikdotai/bik-models/growth';
2
2
  import React from 'react';
3
3
  import { Collection, CollectionFetcherReturn, SelectedItems } from '.';
4
4
  import { CollectionsActions, SelectedCollectionsActions } from './reducers';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
+ import { ApplicationType } from '@bikdotai/bik-models/growth';
3
3
  import { ButtonProps } from '../button/model';
4
4
  import { FooterForNonModalI, OUT_OF_STOCK_ACTION, ScreenName } from './type';
5
5
  export interface ProductVariant {
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import"../../node_modules/@bikdotai/bik-models/growth/models/bik-store.js";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useRef as i,useEffect as n}from"react";import{COLORS as l}from"../../constants/Theme.js";import a from"../../assets/icons/cross.svg.js";import{Button as d}from"../button/Button.js";import{Input as u}from"../input/Input.js";import{StyledModal as p}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as m}from"../tag/Tag.js";import{CollectionsScreen as C}from"./collectionScreen.js";import{ProductInfoOverlay as g}from"./productInfoOverlay.js";import{ProductsScreen as y}from"./productScreen.js";import{RearrangeScreen as b}from"./rearrangeScreen.js";import{collectionsReducer as f,searchReducer as S,selectedColectionsReducer as k,CollectionIdContext as v}from"./reducers.js";import{SearchScreen as j}from"./searchScreen.js";import{SelectedScreen as I}from"./selectedScreen.js";import{ContainerStyle as x,ScrollContainerStyle as P,StyledFooterForNonModal as O}from"./style.js";import{OUT_OF_STOCK_ACTION as T,ScreenName as D}from"./type.js";import{updateAllVariantsForSelectedProducts as F}from"./utility.js";import{__exports as R}from"../../_virtual/bik-store.js";const w=w=>{const{storeId:A,selectedItems:B,onClose:E,visible:L,zIndex:z,exactLimit:V,limit:$,hideCollectionCheckbox:M,hideProductCheckbox:H,outOfStockAction:W=T.BLUR,hideVariantCheckbox:_,selectProductsFromCustomCollection:G,hideSelectionCount:K,title:N,width:U,left:Y,renderWithoutModal:q,onClickSave:J,pickerType:Q,hideProductVariants:X=!1,startupScreen:Z=D.Collections,rearrangeEnabled:ee,selectSingleItem:te=!1,showProductDetails:oe,containerStyle:ce,crossButtonInsideHeader:re=!1,footerForNonModal:se={},primaryButton:ie,secondaryButton:ne,subtitle:le}=w,ae=w.appType||R.ApplicationType.BIK,[de,ue]=r(f,{}),[pe,he]=s([D.Collections,D.RearrangeProducts].includes(Z)?Z:D.Collections),[me,Ce]=s("grid"),[ge,ye]=s(""),[be,fe]=s(""),[Se,ke]=s(0),[ve,je]=s(!1),[Ie,xe]=s(0),[Pe,Oe]=s(""),[Te,De]=s(!1),[Fe,Re]=s(!1),[we,Ae]=r(S,{collections:{},products:{}}),[Be,Ee]=r(k,Object.keys(B).length>0?B:{}),Le=i(null),[ze,Ve]=s(!1),[$e,Me]=s();n((()=>{je(!0),Re(!0),w.collectionFetcher(Se,A,ae).then((e=>{ue({type:"fetched",data:(null==e?void 0:e.collections)||{}}),je(!1),ke((e=>e+1)),Re(!1)})).catch()}),[]),n((()=>{let e=0;X?Object.keys(Be||[]).forEach((t=>{var o;Object.keys((null===(o=Be[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&Be[-1]&&(null===(c=Be[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(Be||[]).forEach((t=>{var o;Object.keys((null===(o=Be[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=Be[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),xe(e)}),[de,Be,X]),n((()=>{be&&(je(!0),w.productFetcher(be,A,ae).then((e=>{Object.keys(e).length&&ue({type:"productsFetched",data:{collectionId:be,products:e}}),je(!1)})).catch())}),[be]),n((()=>{const e=setTimeout((()=>{"rearrange"!==pe&&(Pe.length||"collections"!==pe)&&(Pe.length?(De(!0),w.searchFetcher(A,Pe,ae).then((e=>{"collections"in e&&"products"in e?(Ae({type:"set",data:e}),ue({type:"searched",data:e.collections}),ue({type:"searched",data:e.products})):(Ae({type:"set",data:{collections:{},products:e}}),ue({type:"searched",data:e})),he("searchProducts"),je(!1),De(!1)}))):he("collections"))}),800);return()=>clearTimeout(e)}),[Pe]),n((()=>{J&&(w.onAdd(Be,Ie),He())}),[J]),n((()=>{te&&Object.keys(Be||{}).length&&Ie&&(w.onAdd(Be,Ie),He())}),[te,Be,Ie]);const He=()=>{Ee({type:"reset",data:{}})},We=()=>V&&Ie>V?t(m,{tagText:`You can only select ${V} products`,type:"negative"}):$&&Ie>$?t(m,{tagText:`You can only select ${$} products`,type:"negative"}):t(d,Ie>0?{onClick:()=>{he(ee?D.RearrangeProducts:D.SelectedProducts)},buttonText:V?`${Ie}/${V} products selected`:`${Ie} products selected`,buttonType:["rearrange","view"].includes(pe)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(pe)}:{disabled:!0,buttonText:V?`${Ie}/${V} products selected`:`${Ie} products selected`,buttonType:"tertiaryGray"}),_e=e=>ve?"Loading...":pe===D.RearrangeProducts?null!=e?e:"Done":null!=e?e:"Add",Ge=e(x,Object.assign({style:null!=ce?ce:{}},{children:[w.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:w.postHeader})),!w.hideGlobalSearch&&t(o,{children:("collections"===pe||"searchProducts"===pe)&&t("div",Object.assign({style:{padding:q?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(u,{placeholder:"Search using ID, Name or SKU ID",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Te?t(h,{size:"small",color:l.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:Pe,onChangeText:e=>{e.length&&e.trim().length?Oe(e):Oe("")}})}))}),e(P,Object.assign({ref:Le,screenName:pe},{children:["collections"===pe&&t(C,{customCollectionRestriction:w.customCollectionRestriction,dataLoading:Fe,collections:de,selectedCollectionsDispatch:Ee,setCollectionId:ye,setSelectedCollectionId:fe,setScreen:he,selectedCollections:Be,collectionFetcher:w.collectionFetcher,storeId:A,appType:ae,collectionsDispatch:ue,setSaveDisabled:je,pagingControls:{curPage:Se,setCurPage:ke},hideCollectionCheckbox:M,renderWithoutModal:q,pickerType:Q,scrollContainerRef:Le}),"products"===pe&&ge&&t(v.Provider,Object.assign({value:ge},{children:t(y,{hideInCollectionSearch:w.hideInCollectionSearch,customCollectionRestriction:w.customCollectionRestriction,productFetcher:w.productFetcher,setScreen:he,storeId:A,appType:ae,data:de[ge],collectionsDispatch:ue,selectedCollectionsDispatch:Ee,selectedData:Be,setSaveDisabled:je,searchInCollectionFetcher:w.searchInCollectionFetcher,hideProductCheckbox:H,outOfStockAction:W,hideVariantCheckbox:_,selectProductsFromCustomCollection:G,renderWithoutModal:q,pickerType:Q,hideProductVariants:X,fbStatusFetcher:w.fbStatusFetcher,onProductDetailClick:e=>{Ve(!0),Me(e)},showProductDetailInfoIcon:oe,scrollContainerRef:Le})})),"view"===pe&&t(I,{selectedCollections:Be||{},selectedCollectionsDispatch:Ee,setScreen:he,collections:de,hideProductVariants:X,outOfStockAction:W,storeId:A,appType:ae,fbStatusFetcher:w.fbStatusFetcher}),"rearrange"===pe&&t(b,{selectedCollections:Be||{},selectedCollectionsDispatch:Ee,setScreen:he,outOfStockAction:W,rearrangeViewType:"grid"===me?"list":"grid",scrollContainerRef:Le,storeId:A,appType:ae,fbStatusFetcher:w.fbStatusFetcher}),"searchProducts"===pe&&t(j,{customCollectionRestriction:w.customCollectionRestriction,selectedCollections:Be||{},searchedCollections:we||{},searchedCollectionsDispatch:Ae,selectedCollectionsDispatch:Ee,setScreen:he,collections:de,onBackPress:()=>{Oe(""),Ae({type:"set",data:{collections:{},products:{}}})},pickerType:Q,hideProductCheckbox:H,hideProductVariants:X,hideVariantCheckbox:_,storeId:A,appType:ae,fbStatusFetcher:w.fbStatusFetcher,setCollectionId:ye,setSelectedCollectionId:fe,renderWithoutModal:q,hideCollectionCheckbox:M,outOfStockAction:W})]}))]}));return t(o,{children:q?e(o,{children:[Ge,se.renderFooter?e(O,{children:[We(),t(d,{buttonText:_e(se.primaryButtonText),disabled:!se.isLoading&&(ve||Ie<1||V&&Ie<V||!V&&$&&Ie>$)||se.primaryButtonDisabled,isLoading:se.isLoading,onClick:()=>{w.onAdd(Be,Ie),He(),he([D.Collections,D.RearrangeProducts].includes(Z)?Z:D.Collections)}})]}):t(o,{}),ze&&$e?t(g,{productData:$e,outOfStockAction:W,useDynamicInfoImageSize:w.useDynamicInfoImageSize,onClose:()=>{Ve(!1)}}):t(o,{})]}):e(p,Object.assign({zIndex:z,open:L,onClose:()=>{null==E||E(),He()},headingTitle:N||("collections"===pe||"products"===pe?"Select Products":"view"===pe?"Selected Products":"searchProducts"===pe?"Searched Results":"rearrange"===pe?"Rearrange Products":void 0),headingSubtitle:le,footerShadow:!0,centralContainerStyles:{width:U||"600px",left:Y||"auto"},headerRightCustomElement:re?t("div",Object.assign({style:{cursor:"pointer",display:"flex"},onClick:E},{children:t(a,{width:20,height:20,color:l.content.secondary})})):t(o,{}),footerContainerStyle:w.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:l.surface.standard}:void 0,primaryButton:ie?(e=>Object.assign(Object.assign({},e),{disabled:!e.isLoading&&(ve||Ie<1||V&&Ie<V||!V&&$&&Ie>$)||e.disabled,onClick:()=>{w.onAdd(Be,Ie),He(),he([D.Collections,D.RearrangeProducts].includes(Z)?Z:D.Collections)}}))(ie):{buttonText:_e(),disabled:ve||Ie<1||V&&Ie<V||!V&&$&&Ie>$||!1,onClick:()=>{w.onAdd(Be,Ie),He()}},secondaryButton:ne?(e=>Object.assign(Object.assign({},e),{disabled:ve||Ie<1||V&&Ie<V||!V&&$&&Ie>$||!1,onClick:()=>{const e=F(Be,de,we);w.onAdd(e,Ie,!0)}}))(ne):void 0,wrapperStyle:w.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:K?t(o,{}):We(),hideCrossButton:ze||re},{children:[Ge,ze&&$e?t(g,{productData:$e,useDynamicInfoImageSize:w.useDynamicInfoImageSize,outOfStockAction:W,onClose:()=>{Ve(!1)}}):t(o,{})]}))})};export{w as ProductPickerModal};
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import"../../node_modules/@bikdotai/bik-models/growth/index.js";import c from"../../assets/icons/search.svg.js";import{useReducer as r,useState as s,useRef as i,useEffect as n}from"react";import{COLORS as l}from"../../constants/Theme.js";import a from"../../assets/icons/cross.svg.js";import{Button as d}from"../button/Button.js";import{Input as u}from"../input/Input.js";import{StyledModal as p}from"../modals/styledModal.js";import{Spinner as h}from"../spinner/Spinner.js";import{Tag as m}from"../tag/Tag.js";import{CollectionsScreen as C}from"./collectionScreen.js";import{ProductInfoOverlay as g}from"./productInfoOverlay.js";import{ProductsScreen as y}from"./productScreen.js";import{RearrangeScreen as b}from"./rearrangeScreen.js";import{collectionsReducer as f,searchReducer as S,selectedColectionsReducer as k,CollectionIdContext as v}from"./reducers.js";import{SearchScreen as j}from"./searchScreen.js";import{SelectedScreen as I}from"./selectedScreen.js";import{ContainerStyle as x,ScrollContainerStyle as P,StyledFooterForNonModal as O}from"./style.js";import{OUT_OF_STOCK_ACTION as T,ScreenName as D}from"./type.js";import{updateAllVariantsForSelectedProducts as F}from"./utility.js";import{__exports as R}from"../../_virtual/index.js";const w=w=>{const{storeId:A,selectedItems:B,onClose:E,visible:L,zIndex:z,exactLimit:V,limit:$,hideCollectionCheckbox:M,hideProductCheckbox:H,outOfStockAction:W=T.BLUR,hideVariantCheckbox:_,selectProductsFromCustomCollection:G,hideSelectionCount:K,title:N,width:U,left:Y,renderWithoutModal:q,onClickSave:J,pickerType:Q,hideProductVariants:X=!1,startupScreen:Z=D.Collections,rearrangeEnabled:ee,selectSingleItem:te=!1,showProductDetails:oe,containerStyle:ce,crossButtonInsideHeader:re=!1,footerForNonModal:se={},primaryButton:ie,secondaryButton:ne,subtitle:le}=w,ae=w.appType||R.ApplicationType.BIK,[de,ue]=r(f,{}),[pe,he]=s([D.Collections,D.RearrangeProducts].includes(Z)?Z:D.Collections),[me,Ce]=s("grid"),[ge,ye]=s(""),[be,fe]=s(""),[Se,ke]=s(0),[ve,je]=s(!1),[Ie,xe]=s(0),[Pe,Oe]=s(""),[Te,De]=s(!1),[Fe,Re]=s(!1),[we,Ae]=r(S,{collections:{},products:{}}),[Be,Ee]=r(k,Object.keys(B).length>0?B:{}),Le=i(null),[ze,Ve]=s(!1),[$e,Me]=s();n((()=>{je(!0),Re(!0),w.collectionFetcher(Se,A,ae).then((e=>{ue({type:"fetched",data:(null==e?void 0:e.collections)||{}}),je(!1),ke((e=>e+1)),Re(!1)})).catch()}),[]),n((()=>{let e=0;X?Object.keys(Be||[]).forEach((t=>{var o;Object.keys((null===(o=Be[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c;"-1"!==t&&Be[-1]&&(null===(c=Be[-1].products)||void 0===c?void 0:c[o])||(e+=1)}))})):Object.keys(Be||[]).forEach((t=>{var o;Object.keys((null===(o=Be[t])||void 0===o?void 0:o.products)||[]).forEach((o=>{var c,r;Object.keys((null===(r=null===(c=Be[t].products)||void 0===c?void 0:c[o])||void 0===r?void 0:r.variants)||[]).forEach((()=>{e+=1}))}))})),xe(e)}),[de,Be,X]),n((()=>{be&&(je(!0),w.productFetcher(be,A,ae).then((e=>{Object.keys(e).length&&ue({type:"productsFetched",data:{collectionId:be,products:e}}),je(!1)})).catch())}),[be]),n((()=>{const e=setTimeout((()=>{"rearrange"!==pe&&(Pe.length||"collections"!==pe)&&(Pe.length?(De(!0),w.searchFetcher(A,Pe,ae).then((e=>{"collections"in e&&"products"in e?(Ae({type:"set",data:e}),ue({type:"searched",data:e.collections}),ue({type:"searched",data:e.products})):(Ae({type:"set",data:{collections:{},products:e}}),ue({type:"searched",data:e})),he("searchProducts"),je(!1),De(!1)}))):he("collections"))}),800);return()=>clearTimeout(e)}),[Pe]),n((()=>{J&&(w.onAdd(Be,Ie),He())}),[J]),n((()=>{te&&Object.keys(Be||{}).length&&Ie&&(w.onAdd(Be,Ie),He())}),[te,Be,Ie]);const He=()=>{Ee({type:"reset",data:{}})},We=()=>V&&Ie>V?t(m,{tagText:`You can only select ${V} products`,type:"negative"}):$&&Ie>$?t(m,{tagText:`You can only select ${$} products`,type:"negative"}):t(d,Ie>0?{onClick:()=>{he(ee?D.RearrangeProducts:D.SelectedProducts)},buttonText:V?`${Ie}/${V} products selected`:`${Ie} products selected`,buttonType:["rearrange","view"].includes(pe)?"tertiaryGray":"tertiary",disabled:["rearrange","view"].includes(pe)}:{disabled:!0,buttonText:V?`${Ie}/${V} products selected`:`${Ie} products selected`,buttonType:"tertiaryGray"}),_e=e=>ve?"Loading...":pe===D.RearrangeProducts?null!=e?e:"Done":null!=e?e:"Add",Ge=e(x,Object.assign({style:null!=ce?ce:{}},{children:[w.postHeader&&t("div",Object.assign({style:{padding:"0 24px"}},{children:w.postHeader})),!w.hideGlobalSearch&&t(o,{children:("collections"===pe||"searchProducts"===pe)&&t("div",Object.assign({style:{padding:q?"8px 16px":"12px 24px",borderBottom:"1px solid #E0E0E0"}},{children:t(u,{placeholder:"Search using ID, Name or SKU ID",noKeyDownChange:!0,noErrorHint:!0,rightIcon:{icon:()=>Te?t(h,{size:"small",color:l.content.primary}):t(c,{})},id:"listInput",height:"24px",type:"text",value:Pe,onChangeText:e=>{e.length&&e.trim().length?Oe(e):Oe("")}})}))}),e(P,Object.assign({ref:Le,screenName:pe},{children:["collections"===pe&&t(C,{customCollectionRestriction:w.customCollectionRestriction,dataLoading:Fe,collections:de,selectedCollectionsDispatch:Ee,setCollectionId:ye,setSelectedCollectionId:fe,setScreen:he,selectedCollections:Be,collectionFetcher:w.collectionFetcher,storeId:A,appType:ae,collectionsDispatch:ue,setSaveDisabled:je,pagingControls:{curPage:Se,setCurPage:ke},hideCollectionCheckbox:M,renderWithoutModal:q,pickerType:Q,scrollContainerRef:Le}),"products"===pe&&ge&&t(v.Provider,Object.assign({value:ge},{children:t(y,{hideInCollectionSearch:w.hideInCollectionSearch,customCollectionRestriction:w.customCollectionRestriction,productFetcher:w.productFetcher,setScreen:he,storeId:A,appType:ae,data:de[ge],collectionsDispatch:ue,selectedCollectionsDispatch:Ee,selectedData:Be,setSaveDisabled:je,searchInCollectionFetcher:w.searchInCollectionFetcher,hideProductCheckbox:H,outOfStockAction:W,hideVariantCheckbox:_,selectProductsFromCustomCollection:G,renderWithoutModal:q,pickerType:Q,hideProductVariants:X,fbStatusFetcher:w.fbStatusFetcher,onProductDetailClick:e=>{Ve(!0),Me(e)},showProductDetailInfoIcon:oe,scrollContainerRef:Le})})),"view"===pe&&t(I,{selectedCollections:Be||{},selectedCollectionsDispatch:Ee,setScreen:he,collections:de,hideProductVariants:X,outOfStockAction:W,storeId:A,appType:ae,fbStatusFetcher:w.fbStatusFetcher}),"rearrange"===pe&&t(b,{selectedCollections:Be||{},selectedCollectionsDispatch:Ee,setScreen:he,outOfStockAction:W,rearrangeViewType:"grid"===me?"list":"grid",scrollContainerRef:Le,storeId:A,appType:ae,fbStatusFetcher:w.fbStatusFetcher}),"searchProducts"===pe&&t(j,{customCollectionRestriction:w.customCollectionRestriction,selectedCollections:Be||{},searchedCollections:we||{},searchedCollectionsDispatch:Ae,selectedCollectionsDispatch:Ee,setScreen:he,collections:de,onBackPress:()=>{Oe(""),Ae({type:"set",data:{collections:{},products:{}}})},pickerType:Q,hideProductCheckbox:H,hideProductVariants:X,hideVariantCheckbox:_,storeId:A,appType:ae,fbStatusFetcher:w.fbStatusFetcher,setCollectionId:ye,setSelectedCollectionId:fe,renderWithoutModal:q,hideCollectionCheckbox:M,outOfStockAction:W})]}))]}));return t(o,{children:q?e(o,{children:[Ge,se.renderFooter?e(O,{children:[We(),t(d,{buttonText:_e(se.primaryButtonText),disabled:!se.isLoading&&(ve||Ie<1||V&&Ie<V||!V&&$&&Ie>$)||se.primaryButtonDisabled,isLoading:se.isLoading,onClick:()=>{w.onAdd(Be,Ie),He(),he([D.Collections,D.RearrangeProducts].includes(Z)?Z:D.Collections)}})]}):t(o,{}),ze&&$e?t(g,{productData:$e,outOfStockAction:W,useDynamicInfoImageSize:w.useDynamicInfoImageSize,onClose:()=>{Ve(!1)}}):t(o,{})]}):e(p,Object.assign({zIndex:z,open:L,onClose:()=>{null==E||E(),He()},headingTitle:N||("collections"===pe||"products"===pe?"Select Products":"view"===pe?"Selected Products":"searchProducts"===pe?"Searched Results":"rearrange"===pe?"Rearrange Products":void 0),headingSubtitle:le,footerShadow:!0,centralContainerStyles:{width:U||"600px",left:Y||"auto"},headerRightCustomElement:re?t("div",Object.assign({style:{cursor:"pointer",display:"flex"},onClick:E},{children:t(a,{width:20,height:20,color:l.content.secondary})})):t(o,{}),footerContainerStyle:w.stickyFooter?{position:"absolute",bottom:0,left:0,width:"100%",zIndex:9,background:l.surface.standard}:void 0,primaryButton:ie?(e=>Object.assign(Object.assign({},e),{disabled:!e.isLoading&&(ve||Ie<1||V&&Ie<V||!V&&$&&Ie>$)||e.disabled,onClick:()=>{w.onAdd(Be,Ie),He(),he([D.Collections,D.RearrangeProducts].includes(Z)?Z:D.Collections)}}))(ie):{buttonText:_e(),disabled:ve||Ie<1||V&&Ie<V||!V&&$&&Ie>$||!1,onClick:()=>{w.onAdd(Be,Ie),He()}},secondaryButton:ne?(e=>Object.assign(Object.assign({},e),{disabled:ve||Ie<1||V&&Ie<V||!V&&$&&Ie>$||!1,onClick:()=>{const e=F(Be,de,we);w.onAdd(e,Ie,!0)}}))(ne):void 0,wrapperStyle:w.stickyFooter?{height:"calc(100vh - 168px)"}:void 0,footerLeftCustomElement:K?t(o,{}):We(),hideCrossButton:ze||re},{children:[Ge,ze&&$e?t(g,{productData:$e,useDynamicInfoImageSize:w.useDynamicInfoImageSize,outOfStockAction:W,onClose:()=>{Ve(!1)}}):t(o,{})]}))})};export{w as ProductPickerModal};
@@ -1,4 +1,4 @@
1
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
1
+ import { ApplicationType } from '@bikdotai/bik-models/growth';
2
2
  import React from 'react';
3
3
  import { Collection, FbStatusFetcherReturn, Product, ProductFetcherReturn, ProductVariant, SelectedItems } from '.';
4
4
  import { CollectionsActions, SelectedCollectionsActions } from './reducers';
@@ -1,4 +1,4 @@
1
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
1
+ import { ApplicationType } from '@bikdotai/bik-models/growth';
2
2
  import React from 'react';
3
3
  import { FbStatusFetcherReturn, SelectedItems } from '.';
4
4
  import { SelectedCollectionsActions } from './reducers';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ApplicationType } from '@bikdotai/bik-models/growth/models/bik-store';
2
+ import { ApplicationType } from '@bikdotai/bik-models/growth';
3
3
  import { Collection, FbStatusFetcherReturn, SearchedItems, SelectedItems } from '.';
4
4
  import { SearchReducerActions, SelectedCollectionsActions } from './reducers';
5
5
  import { OUT_OF_STOCK_ACTION } from './type';