@bikdotai/bik-component-library 0.0.512 → 0.0.513-beta.1

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 (119) hide show
  1. package/dist/cjs/assets/icons/sub_category.svg.js +1 -0
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  6. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  7. package/dist/cjs/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  8. package/dist/cjs/components/bik-layout/MockMenus.d.ts +1 -0
  9. package/dist/cjs/components/carousel-preview/CarouselPreviewCard.js +1 -1
  10. package/dist/cjs/components/floater/floater.d.ts +1 -2
  11. package/dist/cjs/components/floater/floater.js +1 -1
  12. package/dist/cjs/components/input-with-vars/InputWithVariables.d.ts +0 -1
  13. package/dist/cjs/components/input-with-vars/InputWithVariables.js +2 -2
  14. package/dist/cjs/components/list-item/ListItem.d.ts +1 -0
  15. package/dist/cjs/components/list-item/ListItem.js +1 -1
  16. package/dist/cjs/components/spinner/Spinner.d.ts +0 -6
  17. package/dist/cjs/components/spinner/Spinner.js +1 -18
  18. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  19. package/dist/cjs/components/template-context-mapper/context/templateModalContext.d.ts +8 -0
  20. package/dist/cjs/components/template-context-mapper/context/templateModalContext.js +1 -1
  21. package/dist/cjs/components/template-context-mapper/modalElements/Body.js +9 -12
  22. package/dist/cjs/components/template-context-mapper/modalElements/DesktopPreview.js +1 -1
  23. package/dist/cjs/components/template-context-mapper/modalElements/DiscountCodeComponent.d.ts +0 -2
  24. package/dist/cjs/components/template-context-mapper/modalElements/DiscountCodeComponent.js +1 -1
  25. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
  26. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaV2.style.js +1 -0
  27. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  28. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +1 -1
  29. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  30. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +3 -5
  31. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +4 -4
  32. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +3 -3
  33. package/dist/cjs/components/template-context-mapper/modalElements/useEditWhtasappTemplateMedia.js +1 -1
  34. package/dist/cjs/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +4 -4
  35. package/dist/cjs/components/template-preview/helpers/VariableEditorHelper.js +1 -1
  36. package/dist/cjs/components/variable-picker-v3/Content.d.ts +5 -0
  37. package/dist/cjs/components/variable-picker-v3/Content.js +1 -0
  38. package/dist/cjs/components/variable-picker-v3/NoResult.d.ts +6 -0
  39. package/dist/cjs/components/variable-picker-v3/NoResult.js +17 -0
  40. package/dist/cjs/components/variable-picker-v3/SubHeaderItems.d.ts +10 -0
  41. package/dist/cjs/components/variable-picker-v3/SubHeaderItems.js +1 -0
  42. package/dist/cjs/components/variable-picker-v3/VariablePicker.d.ts +5 -0
  43. package/dist/cjs/components/variable-picker-v3/VariablePicker.js +1 -0
  44. package/dist/cjs/components/variable-picker-v3/context.d.ts +21 -0
  45. package/dist/cjs/components/variable-picker-v3/context.js +1 -0
  46. package/dist/cjs/components/variable-picker-v3/index.d.ts +1 -0
  47. package/dist/cjs/components/variable-picker-v3/model.d.ts +48 -0
  48. package/dist/cjs/components/variable-picker-v3/model.js +1 -0
  49. package/dist/cjs/components/variable-picker-v3/recommendVaribles.d.ts +1 -0
  50. package/dist/cjs/components/variable-picker-v3/recommendVaribles.js +1 -0
  51. package/dist/cjs/components/variable-picker-v3/searchVariables.d.ts +2 -0
  52. package/dist/cjs/components/variable-picker-v3/searchVariables.js +1 -0
  53. package/dist/cjs/components/variable-picker-v3/styles.d.ts +6 -0
  54. package/dist/cjs/components/variable-picker-v3/styles.js +37 -0
  55. package/dist/cjs/helpers/index.d.ts +1 -0
  56. package/dist/cjs/index.d.ts +1 -0
  57. package/dist/cjs/index.js +1 -1
  58. package/dist/esm/assets/icons/sub_category.svg.js +1 -0
  59. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  60. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  61. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  62. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  63. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  64. package/dist/esm/components/analytics-chips-and-dropdowns/chart/Pie/PieChartAnalytics.js +1 -1
  65. package/dist/esm/components/bik-layout/MockMenus.d.ts +1 -0
  66. package/dist/esm/components/carousel-preview/CarouselPreviewCard.js +1 -1
  67. package/dist/esm/components/floater/floater.d.ts +1 -2
  68. package/dist/esm/components/floater/floater.js +1 -1
  69. package/dist/esm/components/input-with-vars/InputWithVariables.d.ts +0 -1
  70. package/dist/esm/components/input-with-vars/InputWithVariables.js +3 -3
  71. package/dist/esm/components/list-item/ListItem.d.ts +1 -0
  72. package/dist/esm/components/list-item/ListItem.js +1 -1
  73. package/dist/esm/components/spinner/Spinner.d.ts +0 -6
  74. package/dist/esm/components/spinner/Spinner.js +1 -18
  75. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  76. package/dist/esm/components/template-context-mapper/context/templateModalContext.d.ts +8 -0
  77. package/dist/esm/components/template-context-mapper/context/templateModalContext.js +1 -1
  78. package/dist/esm/components/template-context-mapper/modalElements/Body.js +9 -12
  79. package/dist/esm/components/template-context-mapper/modalElements/DesktopPreview.js +2 -2
  80. package/dist/esm/components/template-context-mapper/modalElements/DiscountCodeComponent.d.ts +0 -2
  81. package/dist/esm/components/template-context-mapper/modalElements/DiscountCodeComponent.js +1 -1
  82. package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
  83. package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.style.js +1 -0
  84. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  85. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.d.ts +1 -1
  86. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  87. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +3 -5
  88. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +4 -4
  89. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.js +3 -3
  90. package/dist/esm/components/template-context-mapper/modalElements/useEditWhtasappTemplateMedia.js +1 -1
  91. package/dist/esm/components/template-preview/WhatsApp/WhatsAppLikePreviewV2.js +5 -5
  92. package/dist/esm/components/template-preview/helpers/VariableEditorHelper.js +1 -1
  93. package/dist/esm/components/variable-picker-v3/Content.d.ts +5 -0
  94. package/dist/esm/components/variable-picker-v3/Content.js +1 -0
  95. package/dist/esm/components/variable-picker-v3/NoResult.d.ts +6 -0
  96. package/dist/esm/components/variable-picker-v3/NoResult.js +17 -0
  97. package/dist/esm/components/variable-picker-v3/SubHeaderItems.d.ts +10 -0
  98. package/dist/esm/components/variable-picker-v3/SubHeaderItems.js +1 -0
  99. package/dist/esm/components/variable-picker-v3/VariablePicker.d.ts +5 -0
  100. package/dist/esm/components/variable-picker-v3/VariablePicker.js +1 -0
  101. package/dist/esm/components/variable-picker-v3/context.d.ts +21 -0
  102. package/dist/esm/components/variable-picker-v3/context.js +1 -0
  103. package/dist/esm/components/variable-picker-v3/index.d.ts +1 -0
  104. package/dist/esm/components/variable-picker-v3/model.d.ts +48 -0
  105. package/dist/esm/components/variable-picker-v3/model.js +1 -0
  106. package/dist/esm/components/variable-picker-v3/recommendVaribles.d.ts +1 -0
  107. package/dist/esm/components/variable-picker-v3/recommendVaribles.js +1 -0
  108. package/dist/esm/components/variable-picker-v3/searchVariables.d.ts +2 -0
  109. package/dist/esm/components/variable-picker-v3/searchVariables.js +1 -0
  110. package/dist/esm/components/variable-picker-v3/styles.d.ts +6 -0
  111. package/dist/esm/components/variable-picker-v3/styles.js +37 -0
  112. package/dist/esm/helpers/index.d.ts +1 -0
  113. package/dist/esm/index.d.ts +1 -0
  114. package/dist/esm/index.js +1 -1
  115. package/package.json +1 -1
  116. package/dist/cjs/components/template-context-mapper/utils/constants.d.ts +0 -1
  117. package/dist/cjs/components/template-context-mapper/utils/constants.js +0 -1
  118. package/dist/esm/components/template-context-mapper/utils/constants.d.ts +0 -1
  119. package/dist/esm/components/template-context-mapper/utils/constants.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(this,arguments)}var l=e=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),t||(t=r.createElement("path",{fill:"#616161",fillRule:"evenodd",d:"M2.667 4a.667.667 0 0 0-1.333 0 6 6 0 0 0 6 6h4.836l-1.999 2.221a.667.667 0 1 0 .991.892l2.999-3.331c0-.002.002-.003.003-.004l.4-.444-.4-.444-.003-.004-2.999-3.331a.667.667 0 0 0-.99.892l1.998 2.22H7.333a4.667 4.667 0 0 1-4.666-4.666Z",clipRule:"evenodd"})));exports.default=l;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default EventsTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
2
+ import { QueryBuilderNodeProps } from "../../../Types/QueryBuilderNodeProps.type";
3
3
  declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
4
4
  export default IGTrigger;
@@ -1,2 +1,2 @@
1
- import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
1
+ import { QueryBuilderAPIData } from "../../../Types/QueryBuilderAPI.type";
2
2
  export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DropdownOption } from "../../../dropdown/type";
3
- import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
4
- import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
3
+ import { QueryBuilderProperty } from "../../Types/QueryBuilder.type";
4
+ import { QueryBuilderNodeProps } from "../../Types/QueryBuilderNodeProps.type";
5
5
  declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
6
6
  cacheKey: string;
7
7
  propertyAddBtnText: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),r=require("react/jsx-runtime"),i=require("../../../../utils/StringUtils.js"),t=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var s=require("react");require("../../../checkBox/CheckBox.styled.js");var g=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../toaster/Toaster.styled.js"),require("../../../tooltips/Tooltip.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js"),require("../../../icon-button/IconButton.js"),require("../../../template-preview/TemplatePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../curtain/CurtainHelper.js"),require("../../../template-preview/models/TemplateMeta.js"),require("../../../template-preview/models/WhatsAppTemplate.js"),require("../../../modals/styledModal.js"),require("../../../template-preview/models/Channels.js"),require("../../../template-context-mapper/context/templateModalContext.js"),require("../../../template-context-mapper/modalElements/Footer.js"),require("../../../template-context-mapper/modalElements/Body.js"),require("../../../template-context-mapper/modalElements/Header.js"),require("../../../zeroState/ZeroState.js"),require("../../../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../../../button/Button.js"),require("../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../../input/Input.js"),require("react-bootstrap"),require("../../../floating-action-button/FloatingActionButton.styles.js"),require("../../../image-compress/ImageCompress.js"),require("../../../progress-bar/ProgressBarComponent.js"),require("../../../QueryBuilder/QueryBuilder.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),require("../../../QueryBuilder/constants/connectorPosition.js"),require("../../../QueryBuilder/constants/connector.js"),require("../../../QueryBuilder/types/QueryBuilder.type.js"),require("../../../dropdown/Dropdown.js"),require("../../../QueryBuilder/components/InputLoader.js"),require("../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js"),require("react-chips"),require("../../../input/ChipInput.styled.js"),require("../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js"),require("../../../QueryBuilder/components/Connectors/Components/IgPicker.js"),require("../../../QueryBuilder/components/Connectors/Components/InTheLast.js"),require("../../../QueryBuilder/components/Connectors/Components/InTwoLast.js"),require("react-calendar"),require("../../../../utils/DateUtils.js"),require("../../../datePicker/DatePickerWrapper.styled.js"),require("../../../QueryBuilder/components/Connectors/Connector.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js"),require("../../../QueryBuilder/redux/queryBuilder.reducer.js"),require("../../../QueryBuilder/redux/queryBuilderCache.reducer.js"),require("../../../QueryBuilder/types/QueryBuilderOperator.type.js"),require("../../../dropdown/DropdownPopover/index.js"),require("../../../dropdown/ChipDropdown.js"),require("../../../dropdown/MenuItem/MenuItem.js"),require("../../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../analytics-card/AnalyticsCard.styled.js"),require("../../CommonStyles.js"),require("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var I=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../StackedBarChart/StackedBarDistributionChart.js"),require("../StackedBarChart/StackedBarDistributionChart.model.js"),require("../VerticalBarGraph/VerticalGraph.js"),require("../heatmap/HeatMap.js"),require("../heatmap/HeatMapVertical.js"),require("../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../../avatar/Avatar.js"),require("../../../avatar/AvatarHelper.js"),require("../../../alerts/Alert.styled.js"),require("../../../alerts/AlertHelper.js"),require("../../../thumbnail/Thumbnail.js"),require("../../../curtain/Curtain.styled.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.js"),require("../../../plans/SubscriptionPlansCollected.js"),require("../../../tabs/Tabs.js"),require("../../../TablePagination/TablePagination.styled.js"),require("../../../TablePagination/TablePaginationCard.js"),require("../../../states/StateComponent.js"),require("../../../../_virtual/_tslib.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditor.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),require("../../../card-selection-modal/CardSelectionModal.styled.js"),require("react-image-crop"),require("../../../buttonGroup/ButtonGroupStyle.js"),require("../../../accordion/Accordion.style.js"),require("../../../accordion/AccordionArrow.js"),require("../../../file-uploader/FileUploaderStyle.js"),require("../../../colourInput/ColourInput.styled.js"),require("../../../bik-layout/CommonStyles.js"),require("../../../navigation-hyperlink/NavigationHyperlink.js"),require("../../../bik-layout/SidebarStyles.js"),require("date-fns"),require("react-popper"),require("../../../dropdown/Common.styled.js"),require("../../../custom-date-time/CustomDateTime.styled.js"),require("../../../../node_modules/lodash.debounce/index.js"),require("../../../product-picker/ProductPicker.styled.js"),require("../../../discount-modal/type.js"),require("../../../product-picker-v2/modal.js"),require("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../discount-modal/CouponExpiration/CouponExpiration.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.style.js"),require("../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js"),require("../../../radioList/RadioList.styled.js"),require("../../../checkList/CheckList.styled.js"),require("../../../postPicker/postPicker.js"),require("../../../dropdown-button/DropdownButton.style.js"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../modals/modal.styled.js"),require("../../../SearchFilter/types/SearchFilter.type.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/components/DateRangeOnlyButton.js"),require("../../../input-with-vars/InputWithVariables.js"),require("../../../star-rating/StarRating.js"),require("../../../dashboard-review-popup/components/FiveStar.styled.js"),require("../../../dashboard-review-popup/components/Form.styled.js"),require("../../../dashboard-review-popup/components/ZeroState.js"),require("../../../dashboard-review-popup/DashboardReviewPopUp.styled.js"),require("../../../testimonial-card/TestimonialCard.style.js"),require("../../../slider/slider.js"),require("pure-react-carousel"),require("../../../carousel-preview/CarouselPreview.style.js"),require("../../../card-selector/CardSelector.styled.js");var C=require("chart.js"),o=require("react-chartjs-2");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e);C.Chart.register(C.ArcElement,C.Legend);const l={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const r=e.dataset.data.reduce(((e,r)=>e+r),0),i=parseFloat((e.raw/r*100).toFixed(1));return` ${e.label}: ${i}%`}}}}},d=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],u=a.default("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(e=>t.COLORS.surface.standard),";border:1px solid ",(e=>t.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlBpZUNoYXJ0QW5hbHl0aWNzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQzhCIiwiZ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Db2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZXJSYWRpdXM6IDgsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIH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iAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>r.jsx(u,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:t,slices:C,size:c}=e;const[a,u]=s.useState([]),[A,n]=s.useState();return s.useEffect((()=>{const e=C.reduce(((e,r)=>e+r.count),0);let r=[];if(r=Object.keys(C).map(((e,r)=>Object.assign({color:d[r%d.length]},C[e]))),u([...r]),0===e){n({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:C.map((e=>i.default.capitalize(e.name))),datasets:[{data:C.map((e=>e.count)),backgroundColor:C.map(((e,r)=>{var i;return null!==(i=e.color)&&void 0!==i?i:d[r%d.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};n(e)}}),[C]),A?r.jsxs(r.Fragment,{children:[t&&r.jsx(g.TitleMedium,Object.assign({style:{marginBottom:16}},{children:t})),r.jsxs("div",Object.assign({className:"row"},{children:[r.jsx("div",Object.assign({className:"col-6"},{children:r.jsx("div",Object.assign({style:{width:c,height:c}},{children:r.jsx(o.Doughnut,{data:A,options:Object.assign(Object.assign({},l),{maintainAspectRatio:!c})})}))})),r.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:r.jsx(I.PieChart,{slices:a})}))]}))]}):r.jsx(r.Fragment,{})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@emotion/styled/base"),r=require("react/jsx-runtime"),i=require("../../../../utils/StringUtils.js"),t=require("../../../../constants/Theme.js");require("../../../../constants/zindex.js");var s=require("react");require("../../../checkBox/CheckBox.styled.js");var g=require("../../../TypographyStyle.js");require("../../../list-item/ListItem.js"),require("../../../pagination/Pagination.js"),require("../../../radioButton/RadioButton.styled.js"),require("react-dom"),require("react-toastify"),require("../../../toaster/Toaster.styled.js"),require("../../../tooltips/Tooltip.js"),require("../../../spinner/Spinner.js"),require("../../../stepper/Stepper.styled.js"),require("../../../tag/Tag.js"),require("../../../icon-button/IconButton.js"),require("../../../template-preview/TemplatePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../curtain/CurtainHelper.js"),require("../../../variable-picker-v3/model.js"),require("../../../template-preview/models/TemplateMeta.js"),require("../../../template-preview/models/WhatsAppTemplate.js"),require("../../../modals/styledModal.js"),require("../../../template-preview/models/Channels.js"),require("../../../template-context-mapper/context/templateModalContext.js"),require("../../../template-context-mapper/modalElements/Footer.js"),require("../../../template-context-mapper/modalElements/Body.js"),require("../../../template-context-mapper/modalElements/Header.js"),require("../../../zeroState/ZeroState.js"),require("../../../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../../../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../../../button/Button.js"),require("../../../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../../../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../../../input/Input.js"),require("react-bootstrap"),require("../../../floating-action-button/FloatingActionButton.styles.js"),require("../../../image-compress/ImageCompress.js"),require("../../../progress-bar/ProgressBarComponent.js"),require("../../../QueryBuilder/QueryBuilder.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Base/BaseQueryBuilderNode.js"),require("../../../QueryBuilder/constants/connectorPosition.js"),require("../../../QueryBuilder/constants/connector.js"),require("../../../QueryBuilder/types/QueryBuilder.type.js"),require("../../../dropdown/Dropdown.js"),require("../../../QueryBuilder/components/InputLoader.js"),require("../../../QueryBuilder/components/Connectors/Components/EmojiPicker.js"),require("react-chips"),require("../../../input/ChipInput.styled.js"),require("../../../QueryBuilder/components/Connectors/Components/FrequencyIntegerPositiveSingle.js"),require("../../../QueryBuilder/components/Connectors/Components/IgPicker.js"),require("../../../QueryBuilder/components/Connectors/Components/InTheLast.js"),require("../../../QueryBuilder/components/Connectors/Components/InTwoLast.js"),require("react-calendar"),require("../../../../utils/DateUtils.js"),require("../../../datePicker/DatePickerWrapper.styled.js"),require("../../../QueryBuilder/components/Connectors/Connector.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.js"),require("../../../QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.js"),require("../../../QueryBuilder/redux/queryBuilder.reducer.js"),require("../../../QueryBuilder/redux/queryBuilderCache.reducer.js"),require("../../../QueryBuilder/types/QueryBuilderOperator.type.js"),require("../../../dropdown/DropdownPopover/index.js"),require("../../../dropdown/ChipDropdown.js"),require("../../../dropdown/MenuItem/MenuItem.js"),require("../../../shimmer/ShimmerComponent/ShimmerStyled.js"),require("../../../analytics-card/AnalyticsCard.styled.js"),require("../../CommonStyles.js"),require("../../../datePicker/DatePicker.styled.js"),require("../../AnalyticsMetric.js"),require("../LineChart/LineChart.js"),require("../linearChipGroupedChart/LinearChipGroupedChart.styled.js");var I=require("./PieChart.js");require("../HorizontalBarGraph/HorizontalGraph.js"),require("../StackedBarChart/StackedBarChart.js"),require("../StackedBarChart/StackedBarDistributionChart.js"),require("../StackedBarChart/StackedBarDistributionChart.model.js"),require("../VerticalBarGraph/VerticalGraph.js"),require("../heatmap/HeatMap.js"),require("../heatmap/HeatMapVertical.js"),require("../VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.js"),require("../../../avatar/Avatar.js"),require("../../../avatar/AvatarHelper.js"),require("../../../alerts/Alert.styled.js"),require("../../../alerts/AlertHelper.js"),require("../../../thumbnail/Thumbnail.js"),require("../../../curtain/Curtain.styled.js"),require("../../../switch/Switch.js"),require("../../../plans/SubscriptionPlanStyled.js"),require("../../../plans/SubscriptionPlanSelector.js"),require("../../../plans/SubscriptionPlansCollected.js"),require("../../../tabs/Tabs.js"),require("../../../TablePagination/TablePagination.styled.js"),require("../../../TablePagination/TablePaginationCard.js"),require("../../../states/StateComponent.js"),require("../../../../_virtual/_tslib.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditor.js"),require("../../../WhatsAppTextEditor/WhatsAppTextEditorHeader.js"),require("../../../card-selection-modal/CardSelectionModal.styled.js"),require("react-image-crop"),require("../../../buttonGroup/ButtonGroupStyle.js"),require("../../../accordion/Accordion.style.js"),require("../../../accordion/AccordionArrow.js"),require("../../../file-uploader/FileUploaderStyle.js"),require("../../../colourInput/ColourInput.styled.js"),require("../../../bik-layout/CommonStyles.js"),require("../../../navigation-hyperlink/NavigationHyperlink.js"),require("../../../bik-layout/SidebarStyles.js"),require("date-fns"),require("react-popper"),require("../../../dropdown/Common.styled.js"),require("../../../custom-date-time/CustomDateTime.styled.js"),require("../../../../node_modules/lodash.debounce/index.js"),require("../../../product-picker/ProductPicker.styled.js"),require("../../../discount-modal/type.js"),require("../../../product-picker-v2/modal.js"),require("../../../discount-modal/DiscountModal.styled.js"),require("../../../discount-modal/DynamicCoupon/DynamicCoupon.js"),require("../../../discount-modal/CouponExpiration/CouponExpiration.js"),require("../../../country-code-picker/CountryCodePicker.styled.js"),require("../../../carousel/carousel.js"),require("../../../carousel-secondary/CarouselSecondary.style.js"),require("../../../access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.js"),require("../../../radioList/RadioList.styled.js"),require("../../../checkList/CheckList.styled.js"),require("../../../postPicker/postPicker.js"),require("../../../dropdown-button/DropdownButton.style.js"),require("../../../side-modal/SideModal.style.js"),require("../../../add-variableV2/AddVariableV2.styled.js"),require("../../../modals/modal.styled.js"),require("../../../SearchFilter/types/SearchFilter.type.js"),require("../../../SearchFilter/components/DatePickerButton.js"),require("../../../SearchFilter/components/DateRangeOnlyButton.js"),require("../../../input-with-vars/InputWithVariables.js"),require("../../../star-rating/StarRating.js"),require("../../../dashboard-review-popup/components/FiveStar.styled.js"),require("../../../dashboard-review-popup/components/Form.styled.js"),require("../../../dashboard-review-popup/components/ZeroState.js"),require("../../../dashboard-review-popup/DashboardReviewPopUp.styled.js"),require("../../../testimonial-card/TestimonialCard.style.js"),require("../../../slider/slider.js"),require("pure-react-carousel"),require("../../../carousel-preview/CarouselPreview.style.js"),require("../../../card-selector/CardSelector.styled.js"),require("../../../variable-picker-v3/NoResult.js"),require("../../../variable-picker-v3/styles.js");var C=require("chart.js"),o=require("react-chartjs-2");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e);C.Chart.register(C.ArcElement,C.Legend);const l={plugins:{legend:{display:!1},tooltip:{enabled:!0,callbacks:{label:e=>{if(!e.label)return" 0%";const r=e.dataset.data.reduce(((e,r)=>e+r),0),i=parseFloat((e.raw/r*100).toFixed(1));return` ${e.label}: ${i}%`}}}}},u=["#5E07BB","#9E77ED","#D2AEFF","#CDE1FF","#92AFFA","#3935E1"],d=c.default("div","production"===process.env.NODE_ENV?{target:"elaov7f0"}:{target:"elaov7f0",label:"CartStyled"})("background:",(e=>t.COLORS.surface.standard),";border:1px solid ",(e=>t.COLORS.stroke.primary),";border-radius:4px;"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3Vy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DogdHJ1ZSxcclxuICAgICAgICAgICAgY2FsbGJhY2tzOiB7XHJcbiAgICAgICAgICAgICAgICBsYWJlbDogKHRvb2x0aXBJdGVtKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0b29sdGlwSXRlbS5sYWJlbCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYCAwJWA7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRvdGFsID0gdG9vbHRpcEl0ZW0uZGF0YXNldC5kYXRhLnJlZHVjZSgoYWNjLCBjdXIpID0+IGFjYyArIGN1ciwgMCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGVyY2VudGFnZSA9IHBhcnNlRmxvYXQoKCh0b29sdGlwSXRlbS5yYXcgLyB0b3RhbCkgKiAxMDApLnRvRml4ZWQoMSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBgICR7dG9vbHRpcEl0ZW0ubGFiZWx9OiAke3BlcmNlbnRhZ2V9JWA7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgIH0sXHJcbiAgICB9LFxyXG59O1xyXG5jb25zdCBHUkFQSF9DT0xPUlMgPSBbXHJcbiAgICAnIzVFMDdCQicsXHJcbiAgICAnIzlFNzdFRCcsXHJcbiAgICAnI0QyQUVGRicsXHJcbiAgICAnI0NERTFGRicsXHJcbiAgICAnIzkyQUZGQScsXHJcbiAgICAnIzM5MzVFMScsXHJcbl07XHJcbmNvbnN0IENhcnRTdHlsZWQgPSBzdHlsZWQuZGl2IGBcblx0YmFja2dyb3VuZDogJHsocHJvcHMpID0+IENPTE9SUy5zdXJmYWNlLnN0YW5kYXJkfTtcblx0Ym9yZGVyOiAxcHggc29saWQgJHsocHJvcHMpID0+IENPTE9SUy5zdHJva2UucHJpbWFyeX07XG5cdGJvcmRlci1yYWRpdXM6IDRweDtcbm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cclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogWzEwMF0sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogWycjRjBGMEYwJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiAwLFxyXG4gICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBzZXREYXRhKGRhdGFTZXQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YVNldCA9IHtcclxuICAgICAgICAgICAgICAgIGxhYmVsczogc2xpY2VzLm1hcCgoc2xpY2UpID0+IFN0cmluZ1V0aWxzLmNhcGl0YWxpemUoc2xpY2UubmFtZSkpLFxyXG4gICAgICAgICAgICAgICAgZGF0YXNldHM6IFtcclxuICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHNsaWNlcy5tYXAoKHNsaWNlKSA9PiBzbGljZS5jb3VudCksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogc2xpY2VzLm1hcCgoc2xpY2UsIGluZGV4KSA9PiB7IHZhciBfYTsgcmV0dXJuIChfYSA9IHNsaWNlLmNvbG9yKSAhPT0gbnVsbCAmJiBfYSAhPT0gdm9pZCAwID8gX2EgOiBHUkFQSF9DT0xPUlNbaW5kZXggJSBHUkFQSF9DT0xPUlMubGVuZ3RoXTsgfSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlckNvbG9yOiBbJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJywgJ3doaXRlJ10sXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBib3JkZX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fSkpLCBfanN4KFwiZGl2XCIsIE9iamVjdC5hc3NpZ24oeyBjbGFzc05hbWU6ICdjb2wtNicsIHN0eWxlOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nTGVmdDogNDgsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGV4RGlyZWN0aW9uOiAnY29sdW1uJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSB9LCB7IGNoaWxkcmVuOiBfanN4KFBpZUNoYXJ0LCB7IHNsaWNlczogc2xpY2VzV2l0aENvbG9yIH0pIH0pKV0gfSkpXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVBpZUNoYXJ0QW5hbHl0aWNzLmpzLm1hcCJdfQ== */"));exports.Card=e=>r.jsx(d,Object.assign({style:{padding:24}},{children:e.children})),exports.PieChartAnalytics=e=>{let{title:t,slices:C,size:a}=e;const[c,d]=s.useState([]),[A,n]=s.useState();return s.useEffect((()=>{const e=C.reduce(((e,r)=>e+r.count),0);let r=[];if(r=Object.keys(C).map(((e,r)=>Object.assign({color:u[r%u.length]},C[e]))),d([...r]),0===e){n({datasets:[{data:[100],backgroundColor:["#F0F0F0"],borderWidth:0}]})}else{const e={labels:C.map((e=>i.default.capitalize(e.name))),datasets:[{data:C.map((e=>e.count)),backgroundColor:C.map(((e,r)=>{var i;return null!==(i=e.color)&&void 0!==i?i:u[r%u.length]})),borderColor:["white","white","white","white","white","white"],borderWidth:4,borderRadius:8}]};n(e)}}),[C]),A?r.jsxs(r.Fragment,{children:[t&&r.jsx(g.TitleMedium,Object.assign({style:{marginBottom:16}},{children:t})),r.jsxs("div",Object.assign({className:"row"},{children:[r.jsx("div",Object.assign({className:"col-6"},{children:r.jsx("div",Object.assign({style:{width:a,height:a}},{children:r.jsx(o.Doughnut,{data:A,options:Object.assign(Object.assign({},l),{maintainAspectRatio:!a})})}))})),r.jsx("div",Object.assign({className:"col-6",style:{paddingLeft:48,display:"flex",flexDirection:"column",justifyContent:"center"}},{children:r.jsx(I.PieChart,{slices:c})}))]}))]}):r.jsx(r.Fragment,{})};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const Menus: ({
2
3
  displayName: string;
3
4
  key: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../template-context-mapper/context/templateModalContext.js"),a=require("../template-preview/TemplatePreview.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../constants/Theme.js"),require("../curtain/CurtainHelper.js"),require("../template-preview/models/TemplateMeta.js"),require("../template-preview/models/WhatsAppTemplate.js");const l=i(t).default.forwardRef((t=>{let{channel:i,currentTemplate:l,showSampleValues:s,carouselCardIndex:p,isPreview:n,width:u}=t;var o,d,m;const{cardWidth:c,template:v}=r.useTemplateModalContext(),h=(null!==(m=null===(d=null===(o=null==v?void 0:v.components)||void 0===o?void 0:o[1].cards)||void 0===d?void 0:d.length)&&void 0!==m?m:0)-1===p?12:0;return e.jsx("div",Object.assign({style:{width:u||c}},{children:e.jsx(a.TemplatePreview,{showSampleValues:s,template:l,channel:i,size:"small",hideHeader:!0,carouselCardIndex:p,isWhatsappCarousel:!0,isPreview:n,whatsAppSpecificMeta:{templateContainerStyles:{marginRight:h}}})}))}));exports.default=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../template-context-mapper/context/templateModalContext.js"),a=require("../template-preview/TemplatePreview.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../constants/Theme.js"),require("../curtain/CurtainHelper.js"),require("../variable-picker-v3/model.js"),require("../template-preview/models/TemplateMeta.js"),require("../template-preview/models/WhatsAppTemplate.js");const l=i(t).default.forwardRef((t=>{let{channel:i,currentTemplate:l,showSampleValues:s,carouselCardIndex:p,isPreview:n,width:u}=t;var o,d,m;const{cardWidth:c,template:v}=r.useTemplateModalContext(),h=(null!==(m=null===(d=null===(o=null==v?void 0:v.components)||void 0===o?void 0:o[1].cards)||void 0===d?void 0:d.length)&&void 0!==m?m:0)-1===p?12:0;return e.jsx("div",Object.assign({style:{width:u||c}},{children:e.jsx(a.TemplatePreview,{showSampleValues:s,template:l,channel:i,size:"small",hideHeader:!0,carouselCardIndex:p,isWhatsappCarousel:!0,isPreview:n,whatsAppSpecificMeta:{templateContainerStyles:{marginRight:h}}})}))}));exports.default=l;
@@ -3,7 +3,6 @@ type FloaterProps = {
3
3
  children?: React.ReactNode;
4
4
  refElement: React.MutableRefObject<any>;
5
5
  leftOffset?: number;
6
- childHeight?: number;
7
6
  };
8
- export declare const Floater: (props: FloaterProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const Floater: (props: FloaterProps) => import("react/jsx-runtime").JSX.Element | null;
9
8
  export {};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");exports.Floater=i=>{const[r,n]=t.useState(-1e4),[s,c]=t.useState(-1e3);return t.useEffect((()=>{if(i.refElement.current){const e=i.refElement.current.getBoundingClientRect();if(n(e.top),i.leftOffset?c(e.left+i.leftOffset):c(e.left+e.width+40),i.childHeight){const t=window.innerHeight;e.top+i.childHeight>t&&n(e.top-(e.top+i.childHeight-t)-10)}}})),e.jsx("div",Object.assign({style:{top:r,left:s,position:"fixed"}},{children:i.children}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");exports.Floater=n=>{const i=t.useRef(null),[r,s]=t.useState(0),[o,f]=t.useState(0),[l,u]=t.useState(!1);return t.useEffect((()=>{if(n.refElement.current){const e=n.refElement.current.getBoundingClientRect();(e=>{let t=0;t=n.leftOffset?e.left+n.leftOffset:e.left+e.width+40;const r=null==i?void 0:i.current;r?(t>window.innerWidth-r.offsetWidth&&(t=window.innerWidth-r.offsetWidth-10),f(t)):f(t)})(e),(e=>{let t=e.top;const n=null==i?void 0:i.current;if(!n)return void s(t);const r=window.innerHeight;e.top+n.offsetHeight>r&&(t=e.top-(e.top+n.offsetHeight-r)-10),s(t)})(e),u(!0)}})),l?e.jsx("div",Object.assign({style:{top:r,left:o,position:"fixed"}},{children:e.jsx("div",Object.assign({ref:i},{children:n.children}))})):null};
@@ -11,7 +11,6 @@ export interface InputWithVariablesProps {
11
11
  prevVariable: SelectedVariable;
12
12
  showHelp?: boolean;
13
13
  onlyVariables?: boolean;
14
- showSideVariablePanel?: boolean;
15
14
  placeHolder?: string;
16
15
  showAddButton?: boolean;
17
16
  errorMessage?: string;
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("../../assets/icons/PlusIcon.js"),l=require("react"),r=require("styled-components"),t=require("uuid"),i=require("../../constants/Theme.js"),d=require("../add-variableV2/AddVariableV2SideModal.js"),s=require("../add-variableV2/AddVariableV2.js"),u=require("../add-variableV2/AddVariableBox.styled.js"),n=require("../input/Input.js"),o=require("../TypographyStyle.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const v=c(r).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("../../assets/icons/PlusIcon.js"),t=require("react"),r=require("styled-components"),l=require("uuid"),i=require("../../constants/Theme.js"),s=require("../add-variableV2/AddVariableBox.styled.js"),n=require("../floater/floater.js"),u=require("../input/Input.js"),c=require("../TypographyStyle.js"),o=require("../variable-picker-v3/VariablePicker.js"),d=require("../variable-picker-v3/model.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const p=v(r).default.div`
2
2
  position: relative;
3
3
  margin-bottom: 16px;
4
4
  input {
5
5
  color: ${e=>e.isVar?i.COLORS.stroke.brand:"black"};
6
6
  }
7
- `;exports.InputWithVariables=r=>{let{type:i,allowMix:c,onChange:b,prevVariable:h,variablesList:V,onBlur:g,onlyVariables:p,placeHolder:x,showAddButton:T=!0,showHelp:j,showSideVariablePanel:y,errorMessage:f,showSideModal:m,maxCharLimit:S,noMaxCharCheck:q,labelText:C,labelElement:w,isRequired:A=!1,hintText:k,onEnterPress:O}=r;const E=l.useRef(!0),M=l.useRef(null),[B,L]=l.useState(!1),[N]=l.useState(t.v4()),[I,R]=l.useState(),[F,P]=l.useState(h),[Z,$]=l.useState(!1),[z,D]=l.useState(!1),[H,W]=l.useState(0);return l.useEffect((()=>{if(I&&I.actualValue)if(c){if(P((e=>{return{actualValue:(a=e.actualValue,l=I.actualValue,r=H,a.slice(0,r)+l+a.slice(r)),variableType:"string"};var a,l,r})),M.current){W(M.current.selectionStart);const e=H+I.actualValue.length+2;M.current.setSelectionRange(e,e),W(e)}}else P((e=>({actualValue:I.actualValue,variableType:I.variableType,needsFetching:I.needsFetching})))}),[I]),l.useEffect((()=>{E.current?E.current=!1:b(F)}),[F]),e.jsxs(e.Fragment,{children:[e.jsxs(v,Object.assign({isVar:/^{{.*}}$/.test(F.actualValue),onKeyDown:e=>{"Enter"===e.key&&(null==O||O(F.actualValue))}},{children:[e.jsx(n.Input,{isRequired:A,hintText:k,type:null!=i?i:"text",id:N,ref:M,skipFocus:!0,isActive:B,value:F.actualValue,validate:e=>[!0,""],errorMessage:f,noMaxCharCheck:q,maxCharLimit:S,labelText:C,labelElement:w,placeholder:x||"Add a value",onClick:e=>{M.current&&W(M.current.selectionStart)},onChangeText:(e,a)=>{if(M.current&&W(M.current.selectionStart),p){const e=(null==a?void 0:a.keyCode)||(null==a?void 0:a.charCode);8!==e&&46!==e||P({actualValue:"",variableType:"string"})}else P(c?{actualValue:e,variableType:"string"}:{actualValue:e.replace(/{{.*}}/,""),variableType:"string"})},onReferenceInit:()=>{},onFocus:e=>{L(!0),D(!0),document.getElementById("varList")&&!Z&&$(!0)},onBlur:e=>{var a,l,r,t,i,d,s;null==g||g(e,F),"addVar"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||"varList"===(null===(l=e.relatedTarget)||void 0===l?void 0:l.id)||(null===(t=null===(r=e.relatedTarget)||void 0===r?void 0:r.className)||void 0===t?void 0:t.includes("exlualr0"))||(null===(d=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===d?void 0:d.includes("sc-dZoequ "))?(M.current&&M.current.focus(),L(!0)):"search-bar"===(null===(s=e.relatedTarget)||void 0===s?void 0:s.id)?L(!0):(L(!1),$(!1),D(!1))}}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[F.actualValue&&j&&e.jsx("div",Object.assign({style:{marginTop:4}},{children:e.jsx(o.BodyCaption,{children:`This value is of type ${F.variableType}`})})),T&&z&&e.jsx("div",Object.assign({style:{marginTop:f||k?"-24px":"0px"}},{children:e.jsx(u.AddVariableStyled,Object.assign({id:"addVar",onClick:()=>{$(!Z)}},{children:e.jsxs("div",Object.assign({className:"add"},{children:[e.jsx(a.default,{color:"white"}),e.jsx("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))}))]})),!y&&Z&&e.jsx(s.AddVariableV2,{data:V,showVariable:!0,setShowVariable:()=>{$(!1)},variableValue:I,setVariableValue:R,placeholder:"",pickerSize:"large",enableVariable:!0,selectWithTypes:!0,onSearchBlur:e=>{var a,l,r,t,i,d;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(i=null===(t=e.relatedTarget)||void 0===t?void 0:t.className)||void 0===i?void 0:i.includes("sc-dZoequ "))?M.current.focus():"Enter here"===(null===(d=e.relatedTarget)||void 0===d?void 0:d.placeholder)?e.relatedTarget.id!==N&&($(!1),D(!1),L(!1)):($(!1),D(!1),L(!1))}})]})),y&&Z&&e.jsx(d.AddVariableV2SideModal,{zIndex:2e3,data:null!=V?V:[],showVariable:Z,setShowVariable:()=>{$(!1)},placeholder:"Add a variable",customTrigger:e=>{R({actualValue:e.actualValue,variableType:"string"}),P(e)},onSearchBlur:e=>{var a,l,r,t,i,d;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(i=null===(t=e.relatedTarget)||void 0===t?void 0:t.className)||void 0===i?void 0:i.includes("sc-dZoequ "))?M.current.focus():"Enter here"===(null===(d=e.relatedTarget)||void 0===d?void 0:d.placeholder)?e.relatedTarget.id!==N&&($(!1),D(!1),L(!1)):($(!1),D(!1),L(!1))}})]})};
7
+ `;exports.InputWithVariables=r=>{let{type:i,allowMix:v,onChange:b,prevVariable:h,variablesList:j,onBlur:x,onlyVariables:g,placeHolder:y,showAddButton:f=!0,showHelp:V,errorMessage:T,showSideModal:m,maxCharLimit:k,noMaxCharCheck:C,labelText:S,labelElement:q,isRequired:O=!1,hintText:E,onEnterPress:R}=r;const w=t.useRef(),A=t.useRef(!0),F=t.useRef(null),[I,M]=t.useState(!1),[B]=t.useState(l.v4()),[P,L]=t.useState(),[N,$]=t.useState(h),[D,H]=t.useState(!1),[_,z]=t.useState(!1),[K,W]=t.useState(0);return t.useEffect((()=>{if(P&&P.actualValue)if(v){if($((e=>{return{actualValue:(a=e.actualValue,t=P.actualValue,r=K,a.slice(0,r)+t+a.slice(r)),variableType:"string"};var a,t,r})),F.current){W(F.current.selectionStart);const e=K+P.actualValue.length+2;F.current.setSelectionRange(e,e),W(e)}}else $((e=>({actualValue:P.actualValue,variableType:P.variableType,needsFetching:P.needsFetching})))}),[P]),t.useEffect((()=>{A.current?A.current=!1:b(N)}),[N]),e.jsx(e.Fragment,{children:e.jsxs(p,Object.assign({isVar:/^{{.*}}$/.test(N.actualValue),onKeyDown:e=>{"Enter"===e.key&&(null==R||R(N.actualValue))}},{children:[e.jsx(u.Input,{isRequired:O,hintText:E,type:null!=i?i:"text",id:B,ref:F,skipFocus:!0,isActive:I,value:N.actualValue,validate:e=>[!0,""],errorMessage:T,noMaxCharCheck:C,maxCharLimit:k,labelText:S,labelElement:q,placeholder:y||"Add a value",onClick:e=>{F.current&&W(F.current.selectionStart)},onChangeText:(e,a)=>{if(F.current&&W(F.current.selectionStart),g){const e=(null==a?void 0:a.keyCode)||(null==a?void 0:a.charCode);8!==e&&46!==e||$({actualValue:"",variableType:"string"})}else $(v?{actualValue:e,variableType:"string"}:{actualValue:e.replace(/{{.*}}/,""),variableType:"string"})},onReferenceInit:()=>{},onFocus:e=>{M(!0),z(!0),document.getElementById("variable-picker-v3")&&!D&&H(!0)},onBlur:e=>{var a,t,r,l,i,s,n;console.log("ee",null===(a=e.relatedTarget)||void 0===a?void 0:a.id),null==x||x(e,N),"addVar"===(null===(t=e.relatedTarget)||void 0===t?void 0:t.id)||"variable-picker-v3"===(null===(r=e.relatedTarget)||void 0===r?void 0:r.id)||(null===(i=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===i?void 0:i.includes("accordion"))||"back-btn-v3"===(null===(s=e.relatedTarget)||void 0===s?void 0:s.id)?(F.current&&F.current.focus(),M(!0)):"search-bar-v3-picker"===(null===(n=e.relatedTarget)||void 0===n?void 0:n.id)?M(!0):(M(!1),H(!1),z(!1))}}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[N.actualValue&&V&&e.jsx("div",Object.assign({style:{marginTop:4}},{children:e.jsx(c.BodyCaption,{children:`This value is of type ${N.variableType}`})})),f&&_&&e.jsx("div",Object.assign({style:{marginTop:T||E?"-24px":"0px"}},{children:e.jsx(s.AddVariableStyled,Object.assign({ref:w,id:"addVar",onClick:()=>{H(!D)}},{children:e.jsxs("div",Object.assign({className:"add"},{children:[e.jsx(a.default,{color:"white"}),e.jsx("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))}))]})),D&&e.jsx("div",Object.assign({style:{zIndex:101,position:"relative"}},{children:e.jsx(n.Floater,Object.assign({refElement:w},{children:e.jsx(o.VariablePicker,{onClose:()=>H(!1),type:d.PickerType.FLOATER,data:j,onSelect:e=>{L(e)}})}))}))]}))})};
@@ -13,6 +13,7 @@ export interface ListItemProps extends React.HTMLAttributes<HTMLDivElement> {
13
13
  trailingIcon?: JSX.Element;
14
14
  borderBottom?: string;
15
15
  customComponent?: JSX.Element;
16
+ customListItemLabel?: JSX.Element;
16
17
  version?: '1.0' | '2.0';
17
18
  }
18
19
  export declare const ListItem: import("react").ForwardRefExoticComponent<ListItemProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),r=require("./themes.js"),s=require("../TypographyStyle.js"),n=require("../../constants/Theme.js"),o=require("./ListItem.styled.js");const l=i.forwardRef(((i,l)=>{var{id:a,onSelect:c,variant:d="default",trailingIcon:m,leadingIcon:u,subText:j,listItem:x,borderBottom:y,customComponent:g,version:p}=i,v=e.__rest(i,["id","onSelect","variant","trailingIcon","leadingIcon","subText","listItem","borderBottom","customComponent","version"]);return t.jsx(o.ListItem,Object.assign({ref:l,id:a,variant:d,onClick:()=>c&&c(x),borderBottom:y,version:p},v,{children:g?t.jsx(t.Fragment,{children:g}):t.jsxs("div",Object.assign({style:{display:"flex",alignItems:"All"===x.value?"flex-start":"center",gap:8}},{children:[!!u&&u,t.jsxs("div",Object.assign({style:{display:"flex",rowGap:"4px",flexDirection:"column"}},{children:[!!x&&t.jsx(s.BodySecondary,Object.assign({style:{fontSize:("2.0"===p?12:14)+"px",color:r.getColor(d)}},{children:x.label})),!!j&&t.jsx(s.BodyCaption,Object.assign({style:{color:"inactive"===d?n.COLORS.content.inactive:n.COLORS.text.secondary}},{children:j}))]})),!!m&&t.jsx("div",Object.assign({style:{display:"flex",marginLeft:"auto"}},{children:m}))]}))}))}));l.displayName="ListItem",exports.ListItem=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),s=require("react"),i=require("./themes.js"),r=require("../TypographyStyle.js"),n=require("../../constants/Theme.js"),o=require("./ListItem.styled.js");const l=s.forwardRef(((s,l)=>{var{id:a,onSelect:c,variant:d="default",trailingIcon:m,leadingIcon:u,subText:j,listItem:x,borderBottom:g,customComponent:y,customListItemLabel:b,version:p}=s,v=e.__rest(s,["id","onSelect","variant","trailingIcon","leadingIcon","subText","listItem","borderBottom","customComponent","customListItemLabel","version"]);return t.jsx(o.ListItem,Object.assign({ref:l,id:a,variant:d,onClick:()=>c&&c(x),borderBottom:g,version:p},v,{children:y?t.jsx(t.Fragment,{children:y}):t.jsxs("div",Object.assign({style:{display:"flex",alignItems:"All"===x.value?"flex-start":"center",gap:8,width:"100%"}},{children:[!!u&&u,t.jsxs("div",Object.assign({style:{display:"flex",rowGap:"4px",flexDirection:"column"}},{children:[b?t.jsx(t.Fragment,{children:b}):t.jsx(t.Fragment,{children:!!x&&t.jsx(r.BodySecondary,Object.assign({style:{fontSize:("2.0"===p?12:14)+"px",color:i.getColor(d)}},{children:x.label}))}),!!j&&t.jsx(r.BodyCaption,Object.assign({style:{color:"inactive"===d?n.COLORS.content.inactive:n.COLORS.text.secondary}},{children:j}))]})),!!m&&t.jsx("div",Object.assign({style:{display:"flex",marginLeft:"auto"}},{children:m}))]}))}))}));l.displayName="ListItem",exports.ListItem=l;
@@ -3,9 +3,3 @@ export declare const Spinner: {
3
3
  ({ size, color, className }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
- export declare const PureSpinner: import("styled-components").StyledComponent<"div", any, {
7
- width: string;
8
- height: string;
9
- color?: string | undefined;
10
- backgroundColor?: string | undefined;
11
- }, never>;
@@ -1,18 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react-lottie"),t=require("styled-components"),n=require("../../constants/Theme.js"),i=require("./lotties/black.json.js"),o=require("./lotties/brand.json.js"),s=require("./lotties/red.json.js"),a=require("./lotties/white.json.js"),l=require("./themes.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(r),c=d(t);const p={[n.COLORS.stroke.brand]:o,[n.COLORS.content.primary]:i,[n.COLORS.content.primaryInverse]:a,[n.COLORS.content.negative]:s},j=r=>{let{size:t,color:i,className:o}=r;const s={loop:!0,autoplay:!0,animationData:p[null!=i?i:n.COLORS.stroke.brand],rendererSettings:{preserveAspectRatio:"xMidYMid slice"}};return e.jsx("div",Object.assign({className:`spinner-container ${o}`},{children:e.jsx(u.default,{options:s,width:l.SizeMap[t],isStopped:!1,isPaused:!1})}))};j.displayName="Spinner";const m=c.default.div`
2
- width: ${e=>e.width};
3
- height: ${e=>e.height};
4
- border: 5px solid ${e=>{var r;return null!==(r=e.backgroundColor)&&void 0!==r?r:"transparent"}};
5
- border-bottom-color: ${e=>{var r;return null!==(r=e.color)&&void 0!==r?r:n.COLORS.stroke.brand}};
6
- border-radius: 50%;
7
- display: inline-block;
8
- animation: rotation 1s linear infinite;
9
-
10
- @keyframes rotation {
11
- 0% {
12
- transform: rotate(0deg);
13
- }
14
- 100% {
15
- transform: rotate(360deg);
16
- }
17
- }
18
- `;exports.PureSpinner=m,exports.Spinner=j;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react-lottie"),r=require("../../constants/Theme.js"),s=require("./lotties/black.json.js"),i=require("./lotties/brand.json.js"),n=require("./lotties/red.json.js"),o=require("./lotties/white.json.js"),a=require("./themes.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=l(t);const u={[r.COLORS.stroke.brand]:i,[r.COLORS.content.primary]:s,[r.COLORS.content.primaryInverse]:o,[r.COLORS.content.negative]:n},d=t=>{let{size:s,color:i,className:n}=t;const o={loop:!0,autoplay:!0,animationData:u[null!=i?i:r.COLORS.stroke.brand],rendererSettings:{preserveAspectRatio:"xMidYMid slice"}};return e.jsx("div",Object.assign({className:`spinner-container ${n}`},{children:e.jsx(c.default,{options:o,width:a.SizeMap[s],isStopped:!1,isPaused:!1})}))};d.displayName="Spinner",exports.Spinner=d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),t=require("../../utils/StringUtils.js"),o=require("../../constants/Theme.js"),a=require("../modals/styledModal.js"),r=require("../template-preview/models/Channels.js"),s=require("./context/templateModalContext.js"),i=require("./modalElements/Footer.js"),n=require("./modalElements/TemplateSelectModalContent.js"),d=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=u=>{let{selectedTemplate:c,closeDialog:p,showVariableMapping:v,channel:m,htmlContent:h,templateVariables:C,onTemplateSelect:E,globalPlaceholders:S,showOnlyContent:x,whatsappSpecificPickerMeta:b,zIndex:P,showVariableModal:g,variableList:T,discountCode:f,setDiscountCode:I,onBackPress:j,enabledCustomText:y,variableListForImage:L,showSampleValues:M,disableEditVariable:w,pod:N,extras:A,pickerConf:D,selectedCarouselProducts:V,disableEditExpiry:k,cardWidth:q,onDeleteSelectedProducts:H,fileName:O,setFileName:_,hideDeviceContainerInPreview:F}=u;var W,B,Y,z,R,$;l.useEffect((()=>{X(h)}),[h]);const U=m===r.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(B=null===(W=null==c?void 0:c.components)||void 0===W?void 0:W[1])||void 0===B?void 0:B.type),G=null==c?void 0:c.isProductCarouselType,[J,K]=l.useState(m===r.CHANNEL_TYPE.EMAIL||U?"desktop":"mobile"),[Q,X]=l.useState(h),[Z,ee]=l.useState(!1),[le,te]=l.useState([]),[oe,ae]=l.useState({}),[re,se]=l.useState(c),[ie,ne]=l.useState([]),[de,ue]=l.useState(!1),[ce,pe]=l.useState(null!=C?C:[]),[ve,me]=l.useState(!1),[he,Ce]=l.useState(-1),[Ee,Se]=l.useState([]);l.useEffect((()=>{V?Se(V):G&&Se([])}),[V]),l.useEffect((()=>{var e;if(!de&&G&&(!V||0===Se.length)){const l=null===(e=null==re?void 0:re.components)||void 0===e?void 0:e[1].cards,t=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,o,a;"HEADER"===e.type&&t.push(null!==(a=null===(o=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===o?void 0:o[0])&&void 0!==a?a:"")}))})),ne(t),ue(!0)}}),[de]);const xe=l.useMemo((()=>d.convertPlaceholdersToBikDropdown(S)),[S]);return e.jsx(s.TemplateModalContext.Provider,Object.assign({value:{template:re,setTemplate:se,device:J,setDevice:K,display_content:Q,setDisplayContent:X,originalVariableList:ce,setOriginalVariableList:pe,isError:Z,setIsError:ee,channel:m,globalNormalizedPlaceholders:xe,templateSelectionTriggered:ve,setTemplateSelectionTriggered:me,enabledCustomText:y,disableEditVariable:w,pod:N,extras:A,isWhatsappCarousel:U,selectedCarouselIndex:he,setSelectedCarouselIndex:Ce,isProductCarouselType:G,templateErrorIndexes:oe,cardCount:U?null===(z=null===(Y=c.components)||void 0===Y?void 0:Y[1].cards)||void 0===z?void 0:z.length:void 0,errorIndexes:le,setErrorIndexes:te,pickerConf:D,carouselProducts:Ee,setCarouselProducts:Se,disableEditExpiry:k,cardWidth:q,cardImages:ie,onDeleteSelectedProducts:H,hideDeviceContainerInPreview:F}},{children:x?e.jsx(n.default,{channel:r.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:P,centralContainerStyles:{width:U?900:m===r.CHANNEL_TYPE.EMAIL&&v?1e3:800},open:!0,onClose:()=>{null==p||p()},headingTitle:null==re?void 0:re.label,headingSubtitle:m===r.CHANNEL_TYPE.WHATSAPP?`${t.default.capitaliseFirstLetterOfString(null!==(R=null==re?void 0:re.category)&&void 0!==R?R:"")} • ${null!==($=null==re?void 0:re.templateCategory)&&void 0!==$?$:""}`:"",onBackPress:()=>{null==j||j()},modalHeaderStyles:{borderBottom:`1px solid ${o.COLORS.stroke.primary}`}},{children:[e.jsx(n.default,{showSampleValues:M,showVariableMapping:v,channel:m,whatsappSpecificPickerMeta:b,showVariableModal:g,variableList:T,discountCode:f,setDiscountCode:I,variableListForImage:L&&(null==L?void 0:L.length)>0?L:T,fileName:O,setFileName:e=>{null==_||_(e)}}),E?e.jsx(i.default,{isWhatsappCarousel:null!=U&&U,onSelect:function(){var e;if((null==Ee?void 0:Ee.length)<1&&G)return void ee(!0);const l=null==E?void 0:E(re,ce,null!=Q?Q:"",Ee);ae(null!==(e=null==l?void 0:l.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==l?void 0:l.errorIndexes)||(null==l?void 0:l.error)?((null==l?void 0:l.errorIndexes)&&te(l.errorIndexes),(null==l?void 0:l.error)&&ee(!!(null==l?void 0:l.error))):me(!0)}}):e.jsx(e.Fragment,{})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("react"),t=require("../../utils/StringUtils.js"),a=require("../../constants/Theme.js"),o=require("../modals/styledModal.js"),r=require("../template-preview/models/Channels.js"),s=require("./context/templateModalContext.js"),i=require("./modalElements/Footer.js"),n=require("./modalElements/TemplateSelectModalContent.js"),d=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=u=>{let{selectedTemplate:c,closeDialog:p,showVariableMapping:v,channel:m,htmlContent:h,templateVariables:C,onTemplateSelect:S,globalPlaceholders:b,showOnlyContent:E,whatsappSpecificPickerMeta:x,zIndex:P,showVariableModal:g,variableList:T,discountCode:f,setDiscountCode:I,onBackPress:j,enabledCustomText:y,variableListForImage:w,showSampleValues:L,disableEditVariable:M,pod:N,extras:k,pickerConf:A,selectedCarouselProducts:V,disableEditExpiry:D,cardWidth:q,onDeleteSelectedProducts:H,fileName:O,setFileName:_,hideDeviceContainerInPreview:F}=u;var W,B,Y,z,R,$;l.useEffect((()=>{ee(h)}),[h]);const U=m===r.CHANNEL_TYPE.WHATSAPP&&"CAROUSEL"===(null===(B=null===(W=null==c?void 0:c.components)||void 0===W?void 0:W[1])||void 0===B?void 0:B.type),G=null==c?void 0:c.isProductCarouselType,[J,K]=l.useState(m===r.CHANNEL_TYPE.EMAIL||U?"desktop":"mobile"),[Q,X]=l.useState(!1),[Z,ee]=l.useState(h),[le,te]=l.useState(!1),[ae,oe]=l.useState([]),[re,se]=l.useState({}),[ie,ne]=l.useState(c),[de,ue]=l.useState([]),[ce,pe]=l.useState(null),[ve,me]=l.useState(!1),[he,Ce]=l.useState(null!=C?C:[]),[Se,be]=l.useState(!1),[Ee,xe]=l.useState(-1),[Pe,ge]=l.useState([]);l.useEffect((()=>{V?ge(V):G&&ge([])}),[V]),l.useEffect((()=>{var e;if(!ve&&G&&(!V||0===ge.length)){const l=null===(e=null==ie?void 0:ie.components)||void 0===e?void 0:e[1].cards,t=[];null==l||l.forEach((e=>{var l;null===(l=null==e?void 0:e.components)||void 0===l||l.forEach((e=>{var l,a,o;"HEADER"===e.type&&t.push(null!==(o=null===(a=null===(l=e.example)||void 0===l?void 0:l.header_handle)||void 0===a?void 0:a[0])&&void 0!==o?o:"")}))})),ue(t),me(!0)}}),[ve]);const Te=l.useMemo((()=>d.convertPlaceholdersToBikDropdown(b)),[b]);return e.jsx(s.TemplateModalContext.Provider,Object.assign({value:{variableCallback:ce,setVariableCallback:pe,showVariablePicker:Q,setShowVariablePicker:X,template:ie,setTemplate:ne,device:J,setDevice:K,display_content:Z,setDisplayContent:ee,originalVariableList:he,setOriginalVariableList:Ce,isError:le,setIsError:te,channel:m,globalNormalizedPlaceholders:Te,templateSelectionTriggered:Se,setTemplateSelectionTriggered:be,enabledCustomText:y,disableEditVariable:M,pod:N,extras:k,isWhatsappCarousel:U,selectedCarouselIndex:Ee,setSelectedCarouselIndex:xe,isProductCarouselType:G,templateErrorIndexes:re,cardCount:U?null===(z=null===(Y=c.components)||void 0===Y?void 0:Y[1].cards)||void 0===z?void 0:z.length:void 0,errorIndexes:ae,setErrorIndexes:oe,pickerConf:A,carouselProducts:Pe,setCarouselProducts:ge,disableEditExpiry:D,cardWidth:q,cardImages:de,onDeleteSelectedProducts:H,hideDeviceContainerInPreview:F}},{children:E?e.jsx(n.default,{channel:r.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(o.StyledModal,Object.assign({zIndex:P,centralContainerStyles:{width:U?900:m===r.CHANNEL_TYPE.EMAIL&&v?1e3:800},open:!0,onClose:()=>{null==p||p()},headingTitle:null==ie?void 0:ie.label,headingSubtitle:m===r.CHANNEL_TYPE.WHATSAPP?`${t.default.capitaliseFirstLetterOfString(null!==(R=null==ie?void 0:ie.category)&&void 0!==R?R:"")} • ${null!==($=null==ie?void 0:ie.templateCategory)&&void 0!==$?$:""}`:"",onBackPress:()=>{null==j||j()},modalHeaderStyles:{borderBottom:`1px solid ${a.COLORS.stroke.primary}`}},{children:[e.jsx(n.default,{showSampleValues:L,showVariableMapping:v,channel:m,whatsappSpecificPickerMeta:x,showVariableModal:g,variableList:T,discountCode:f,setDiscountCode:I,variableListForImage:w&&(null==w?void 0:w.length)>0?w:T,fileName:O,setFileName:e=>{null==_||_(e)}}),S?e.jsx(i.default,{isWhatsappCarousel:null!=U&&U,onSelect:function(){var e;if((null==Pe?void 0:Pe.length)<1&&G)return void te(!0);const l=null==S?void 0:S(ie,he,null!=Z?Z:"",Pe);se(null!==(e=null==l?void 0:l.templateErrorIndexes)&&void 0!==e?e:{body:[],buttons:[]}),(null==l?void 0:l.errorIndexes)||(null==l?void 0:l.error)?((null==l?void 0:l.errorIndexes)&&oe(l.errorIndexes),(null==l?void 0:l.error)&&te(!!(null==l?void 0:l.error))):be(!0)}}):e.jsx(e.Fragment,{})]}))}))};
@@ -8,6 +8,10 @@ import { WhatsAppCarouselTemplate, WhatsAppCarouselTemplateVariables } from "../
8
8
  import { ExtrasWhatsapp, WhatsAppTemplate, WhatsAppTemplateVariables } from "../../template-preview/models/WhatsAppTemplate";
9
9
  export type DEVICE_TYPES = 'desktop' | 'mobile';
10
10
  export declare const TemplateModalContext: React.Context<{
11
+ variableCallback: any;
12
+ setVariableCallback: any;
13
+ showVariablePicker: boolean;
14
+ setShowVariablePicker: React.Dispatch<React.SetStateAction<boolean>>;
11
15
  device: DEVICE_TYPES;
12
16
  setDevice?: React.Dispatch<React.SetStateAction<DEVICE_TYPES>> | undefined;
13
17
  display_content: string | null;
@@ -54,6 +58,10 @@ export declare const TemplateModalContext: React.Context<{
54
58
  } | undefined;
55
59
  }>;
56
60
  export declare const useTemplateModalContext: () => {
61
+ variableCallback: any;
62
+ setVariableCallback: any;
63
+ showVariablePicker: boolean;
64
+ setShowVariablePicker: React.Dispatch<React.SetStateAction<boolean>>;
57
65
  device: DEVICE_TYPES;
58
66
  setDevice?: React.Dispatch<React.SetStateAction<DEVICE_TYPES>> | undefined;
59
67
  display_content: string | null;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../template-preview/models/Channels.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const a=l(e).default.createContext({device:"desktop",templateSelectionTriggered:!1,display_content:null,originalVariableList:[],channel:t.CHANNEL_TYPE.EMAIL,template:null,isError:!1,enabledCustomText:!1,disableEditVariable:!1,disableEditExpiry:!1});exports.TemplateModalContext=a,exports.useTemplateModalContext=()=>e.useContext(a);
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../template-preview/models/Channels.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const a=l(e).default.createContext({variableCallback:null,setVariableCallback:null,showVariablePicker:!1,setShowVariablePicker:()=>{},device:"desktop",templateSelectionTriggered:!1,display_content:null,originalVariableList:[],channel:t.CHANNEL_TYPE.EMAIL,template:null,isError:!1,enabledCustomText:!1,disableEditVariable:!1,disableEditExpiry:!1});exports.TemplateModalContext=a,exports.useTemplateModalContext=()=>e.useContext(a);
@@ -1,21 +1,18 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("styled-components"),a=require("../../carousel-preview/CarouselPreview.js"),l=require("./EditWhatsAppCarouselTemplateV2.js"),o=require("../../template-preview/models/Channels.js"),n=require("../../TypographyStyle.js"),s=require("../../../constants/Theme.js"),r=require("../context/templateModalContext.js"),d=require("../utils/constants.js"),p=require("../utils/getVariableNameEmail.js"),u=require("../utils/highlightFor.js"),c=require("./DesktopPreview.js"),h=require("./EditWhatsAppTemplateV2.js"),m=require("./MobilePreview.js"),C=require("./VariableConnectorsPanel.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=v(i);const w=f.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("../../curtain/CurtainHelper.js");var a=require("../../variable-picker-v3/model.js"),t=require("react"),i=require("styled-components"),l=require("../../carousel-preview/CarouselPreview.js"),o=require("./EditWhatsAppCarouselTemplateV2.js"),r=require("../../template-preview/models/Channels.js"),s=require("../../variable-picker-v3/VariablePicker.js"),n=require("../../../constants/Theme.js"),d=require("../context/templateModalContext.js"),u=require("../utils/getVariableNameEmail.js"),p=require("../utils/highlightFor.js"),c=require("./DesktopPreview.js"),h=require("./EditWhatsAppTemplateV2.js"),b=require("./MobilePreview.js"),v=require("./VariableConnectorsPanel.js");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var C=m(i);const f=C.default.div`
2
2
  display: flex;
3
3
  // height: 100%;
4
- `,x=f.default.div`
5
- padding: 16px 14px;
6
- max-width: ${e=>e.channel===o.CHANNEL_TYPE.EMAIL?"400px":"450px"};
4
+ `,g=C.default.div`
5
+ max-width: 450px;
7
6
 
8
- height: ${e=>e.channel===o.CHANNEL_TYPE.WHATSAPP?"500px":"475px"};
7
+ height: ${e=>e.channel===r.CHANNEL_TYPE.WHATSAPP?"500px":"475px"};
9
8
  overflow-y: auto;
10
9
  padding-bottom: 24px;
11
- border-left: ${s.COLORS.stroke.primary} 1px solid;
12
- border-top: ${e=>e.isWhatsappCarousel?`${s.COLORS.stroke.primary} 1px solid`:void 0};
13
- ${e=>!e.showVariableMapping&&"width: 340px; height: 500px"};
14
- `,P=f.default.div`
10
+ border-left: ${n.COLORS.stroke.primary} 1px solid;
11
+ border-top: ${e=>e.isWhatsappCarousel?`${n.COLORS.stroke.primary} 1px solid`:void 0};
12
+ `,w=C.default.div`
15
13
  padding: ${e=>e.isWhatsappCarousel?void 0:e.showOnlyContent?"16px 14px":"16px 32px"};
16
14
  flex: 1;
17
15
  height: ${e=>e.isWhatsappCarousel||e.hideDeviceContainerInPreview?"500px":"475px"};
18
16
  overflow-y: auto;
19
- background-image: ${e=>e.hideDeviceContainerInPreview&&e.channel===o.CHANNEL_TYPE.WHATSAPP?`url(${d.BACKGROUND_PREVIEW_IMAGE});`:"none"};
20
- display: ${e=>e.hideDeviceContainerInPreview&&e.channel===o.CHANNEL_TYPE.WHATSAPP?"flex":"initial"};
21
- `;exports.default=i=>{const{showVariableMapping:d,showOnlyContent:v,whatsappSpecificPickerMeta:f,showVariableModal:g,variableList:E,discountCode:b,setDiscountCode:j,variableListForImage:A,showSampleValues:y,fileName:N,setFileName:T}=i,L=t.useRef(),S=t.useRef(),{device:_,display_content:M,channel:O,template:V,setTemplate:W,isWhatsappCarousel:I,isProductCarouselType:q,hideDeviceContainerInPreview:H}=r.useTemplateModalContext();const k=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};return e.jsxs(w,{children:[e.jsx(P,Object.assign({showOnlyContent:v,showVariableMapping:d,isWhatsappCarousel:I,hideDeviceContainerInPreview:H,channel:O},{children:"mobile"===_?e.jsx(m.default,{ref:S,display_content:null!=M?M:"",channel:O,template:V,showSampleValues:y}):O===o.CHANNEL_TYPE.WHATSAPP&&I?e.jsx(a.CarouselPreview,{ref:L,channel:O,template:V,showSampleValues:y,isPreview:!1}):O!==o.CHANNEL_TYPE.MESSAGE?e.jsx(c.default,{ref:L,channel:O,display_content:null!=M?M:"",showSampleValues:y}):e.jsx(e.Fragment,{})})),(q||d)&&e.jsx(x,Object.assign({channel:O,isWhatsappCarousel:I,showVariableMapping:!0},{children:O!==o.CHANNEL_TYPE.WHATSAPP?e.jsx(C.default,{onFocus:O===o.CHANNEL_TYPE.EMAIL?function(e){var t,i,a;const l=null===document||void 0===document?void 0:document.getElementById("mobile"===_?"template_html_mobile":"template_html_desktop"),n=p.getVariableNameForEmailByIndex(e+1),r=O===o.CHANNEL_TYPE.EMAIL?null===(t=null==l?void 0:l.contentWindow)||void 0===t?void 0:t.document.getElementById(n):document.getElementById(n),d=k(r),c=null==r?void 0:r.offsetLeft;"desktop"===_?d&&L.current&&(null===(i=null==l?void 0:l.contentWindow)||void 0===i||i.scrollTo(null!=c?c:0,d),u.highlightFor(n,s.COLORS.background.warning.light,2,O,_)):d&&S.current&&(null===(a=null==l?void 0:l.contentWindow)||void 0===a||a.scrollTo(null!=c?c:0,d),u.highlightFor(n,s.COLORS.background.warning.light,2,O,_))}:void 0,showVariableModal:g,variableList:E,discountCode:b,setDiscountCode:j}):O===o.CHANNEL_TYPE.WHATSAPP&&I?e.jsx(l.default,{whatsappSpecificPickerMeta:f,template:V,showVariableModal:g,variableList:E,variableListForImage:A,discountCode:b,setDiscountCode:j}):e.jsx(h.default,{whatsappSpecificPickerMeta:f,template:V,onTemplateChange:e=>{null==W||W(e)},showVariableModal:g,variableList:E,variableListForImage:A,discountCode:b,setDiscountCode:j,fileName:N,setFileName:T})})),!d&&!q&&e.jsx(x,{children:e.jsx(n.BodySecondary,Object.assign({color:s.COLORS.content.secondary,style:{fontStyle:"italic"}},{children:"Click on ‘Select template’ below to use it"}))})]})};
17
+ background-image: ${e=>e.hideDeviceContainerInPreview?"url('https://firebasestorage.googleapis.com/v0/b/bikayi-chat.appspot.com/o/images-uid%2F341dba50-e84e-4457-b5b5-d9d8a0b95a73?alt=media&token=6fd32f23-8bb2-4980-bbee-bef39b38fd9f');":"none"};
18
+ `;exports.default=i=>{const{showVariableMapping:m,showOnlyContent:C,whatsappSpecificPickerMeta:x,showVariableModal:P,variableList:j,discountCode:E,setDiscountCode:k,variableListForImage:y,showSampleValues:T}=i,L=t.useRef(),A=t.useRef(),{variableCallback:S,showVariablePicker:V,setShowVariablePicker:q,device:M,display_content:N,channel:O,template:_,setTemplate:W,isWhatsappCarousel:H,isProductCarouselType:I,hideDeviceContainerInPreview:D}=d.useTemplateModalContext();const F=e=>{let a=0;for(;e;)a+=e.offsetTop,e=e.offsetParent;return a};return e.jsxs(f,{children:[e.jsx(w,Object.assign({showOnlyContent:C,showVariableMapping:m,isWhatsappCarousel:H,hideDeviceContainerInPreview:D},{children:"mobile"===M?e.jsx(b.default,{ref:A,display_content:null!=N?N:"",channel:O,template:_,showSampleValues:T}):O===r.CHANNEL_TYPE.WHATSAPP&&H?e.jsx(l.CarouselPreview,{ref:L,channel:O,template:_,showSampleValues:T,isPreview:!1}):O!==r.CHANNEL_TYPE.MESSAGE?e.jsx(c.default,{ref:L,channel:O,display_content:null!=N?N:"",showSampleValues:T}):e.jsx(e.Fragment,{})})),(I||m)&&e.jsxs(g,Object.assign({channel:O,isWhatsappCarousel:H},{children:[e.jsx("div",Object.assign({style:{width:428,display:V?"block":"none"}},{children:e.jsx(s.VariablePicker,{showHeader:!0,showBackButton:!0,onBackButtonClick:()=>q(!1),onSelect:e=>{S(e),q(!1)},onClose:()=>{q(!1)},type:a.PickerType.EMBEDDED,data:null!=j?j:[]})})),e.jsx("div",Object.assign({style:{padding:"16px 14px",display:V?"none":"block"}},{children:O!==r.CHANNEL_TYPE.WHATSAPP?e.jsx(v.default,{onFocus:O===r.CHANNEL_TYPE.EMAIL?function(e){var a,t,i;const l=null===document||void 0===document?void 0:document.getElementById("mobile"===M?"template_html_mobile":"template_html_desktop"),o=u.getVariableNameForEmailByIndex(e+1),s=O===r.CHANNEL_TYPE.EMAIL?null===(a=null==l?void 0:l.contentWindow)||void 0===a?void 0:a.document.getElementById(o):document.getElementById(o),d=F(s),c=null==s?void 0:s.offsetLeft;"desktop"===M?d&&L.current&&(null===(t=null==l?void 0:l.contentWindow)||void 0===t||t.scrollTo(null!=c?c:0,d),p.highlightFor(o,n.COLORS.background.warning.light,2,O,M)):d&&A.current&&(null===(i=null==l?void 0:l.contentWindow)||void 0===i||i.scrollTo(null!=c?c:0,d),p.highlightFor(o,n.COLORS.background.warning.light,2,O,M))}:void 0,showVariableModal:P,variableList:j,discountCode:E,setDiscountCode:k}):O===r.CHANNEL_TYPE.WHATSAPP&&H?e.jsx(o.default,{whatsappSpecificPickerMeta:x,template:_,showVariableModal:P,variableList:j,variableListForImage:y,discountCode:E,setDiscountCode:k}):e.jsx(h.default,{whatsappSpecificPickerMeta:x,template:_,onTemplateChange:e=>{null==W||W(e)},showVariableModal:P,variableList:j,variableListForImage:y,discountCode:E,setDiscountCode:k})}))]}))]})};
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("styled-components"),i=require("../../spinner/Spinner.js"),a=require("../../template-preview/TemplatePreview.js");require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var s=require("../../../constants/Theme.js");require("../../curtain/CurtainHelper.js"),require("../../template-preview/models/TemplateMeta.js"),require("../../template-preview/models/WhatsAppTemplate.js");var p=require("../../template-preview/models/Channels.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(r),o=l(t);const n=o.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("styled-components"),i=require("../../spinner/Spinner.js"),a=require("../../template-preview/TemplatePreview.js");require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var s=require("../../../constants/Theme.js");require("../../curtain/CurtainHelper.js"),require("../../variable-picker-v3/model.js"),require("../../template-preview/models/TemplateMeta.js"),require("../../template-preview/models/WhatsAppTemplate.js");var p=require("../../template-preview/models/Channels.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(r),o=l(t);const n=o.default.div`
2
2
  background: ${s.COLORS.surface.standard};
3
3
  border: 1px solid ${s.COLORS.stroke.primary};
4
4
  border-radius: 8px;
@@ -1,6 +1,4 @@
1
- import { VariableListInterfaceV2 } from "../../add-variableV2";
2
1
  export declare const DiscountCodeComponent: (props: {
3
2
  discountCode?: string | undefined;
4
3
  setDiscountCode?: ((code: string) => void) | undefined;
5
- variableList?: VariableListInterfaceV2[] | undefined;
6
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../assets/icons/PlusIcon.js"),a=require("react"),s=require("../../add-variableV2/AddVariableV2SideModal.js");require("../../../_virtual/_tslib.js"),require("../../add-variableV2/AddVariableV2.styled.js"),require("../../button/Button.js"),require("../../icon-button/IconButton.js");var i=require("../../input/Input.js");require("../../tooltips/Tooltip.js"),require("../../../constants/Theme.js"),require("../../modals/modal.styled.js"),require("../../switch/Switch.js");var t=require("../../TypographyStyle.js"),l=require("../../checkBox/CheckBox.js"),d=require("./VariableConnectorsPanel.js");exports.DiscountCodeComponent=o=>{const{discountCode:n,setDiscountCode:u,variableList:c}=o,[j,b]=a.useState(""),[h,v]=a.useState(!!n),[x,g]=a.useState(!1),[V,p]=a.useState(!1),q=a.useRef(),m=a.useRef();return a.useEffect((()=>{u&&j&&u(n+j)}),[j]),e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8}},{children:[e.jsx(l.CheckBox,{isChecked:h,onValueChange:()=>{h&&u&&(u(""),b("")),v(!h)}}),e.jsx(t.TitleSmall,Object.assign({style:{marginLeft:8}},{children:"Add discount code"}))]})),h&&e.jsxs("div",Object.assign({ref:q,style:{margin:10}},{children:[e.jsx(i.Input,{placeholder:"Enter your discount code",onChangeText:e=>{u&&u(e)},value:n,onFocus:()=>{g(!0)},onBlur:e=>{var r;"addVar"===(null===(r=e.relatedTarget)||void 0===r?void 0:r.id)?(q.current&&q.current.focus(),g(!0)):(g(!1),p(!1))},noErrorHint:!0,validate:e=>[!0,""]}),x&&e.jsx(d.AddVariableStyled,Object.assign({ref:m,id:"addVar",onClick:e=>{e.stopPropagation(),p(!0)}},{children:e.jsxs("div",Object.assign({className:"add"},{children:[e.jsx(r.default,{width:14,height:14,color:"white"}),e.jsx("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))]})),V&&e.jsx(s.AddVariableV2SideModal,{zIndex:2e3,data:null!=c?c:[],showVariable:V,setShowVariable:p,variableValue:j,setVariableValue:b,placeholder:"Add a variable",customTrigger:e=>{b(e.actualValue),g(!1)}})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../../assets/icons/PlusIcon.js"),t=require("react"),r=require("../../checkBox/CheckBox.js"),a=require("../../TypographyStyle.js"),i=require("../context/templateModalContext.js"),n=require("./VariableConnectorsPanel.js"),o=require("../../input/Input.js");exports.DiscountCodeComponent=l=>{const{discountCode:c,setDiscountCode:d}=l,[u,j]=t.useState(""),[x,h]=t.useState(!!c),[g,p]=t.useState(!1),{setVariableCallback:b,setShowVariablePicker:C}=i.useTemplateModalContext(),f=t.useRef(),v=t.useRef();t.useEffect((()=>{d&&u&&d(c+u)}),[u]);const m=e=>{j(e.actualValue)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",marginLeft:10,marginTop:8}},{children:[e.jsx(r.CheckBox,{isChecked:x,onValueChange:()=>{x&&d&&(d(""),j("")),h(!x)}}),e.jsx(a.TitleSmall,Object.assign({style:{marginLeft:8}},{children:"Add discount code"}))]})),x&&e.jsxs("div",Object.assign({ref:f,style:{margin:10}},{children:[e.jsx(o.Input,{placeholder:"Enter your discount code",onChangeText:e=>{d&&d(e)},value:c,onFocus:()=>{p(!0)},onBlur:e=>{var s;"addVar"===(null===(s=e.relatedTarget)||void 0===s?void 0:s.id)?(f.current&&f.current.focus(),p(!0)):p(!1)},noErrorHint:!0,validate:e=>[!0,""]}),g&&e.jsx(n.AddVariableStyled,Object.assign({ref:v,id:"addVar",onClick:e=>{e.stopPropagation(),b((()=>m)),C(!0)}},{children:e.jsxs("div",Object.assign({className:"add"},{children:[e.jsx(s.default,{width:14,height:14,color:"white"}),e.jsx("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))]}))]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/arrow_back.svg.js"),a=require("react"),i=require("../../button/Button.js"),r=require("../../image-cropper/BikImageCropper.js");require("../../image-compress/ImageCompress.js"),require("../../states/StateComponent.js"),require("../../../_virtual/_tslib.js"),require("../../../constants/zindex.js"),require("../../modals/styledModal.js");var s=require("../../spinner/Spinner.js"),l=require("../../input-with-vars/InputWithVariables.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var n=require("../../../constants/Theme.js");require("../../curtain/CurtainHelper.js");var o=require("../../template-preview/models/TemplateMeta.js"),d=require("../../template-preview/models/WhatsAppTemplate.js"),p=require("../../TypographyStyle.js"),c=require("../../../utils/validator.js"),u=require("../../../assets/icons/file.svg.js"),g=require("../../../assets/icons/filePdf.svg.js"),m=require("../../../assets/icons/image.svg.js"),j=require("../../../assets/icons/upload.svg.js"),h=require("../context/templateModalContext.js"),x=require("../utils/validateIsUrl.js");exports.default=E=>{let{setOpenEditMedia:v,mediaComponentFormat:b,variableListForImage:y,openEditMedia:f,uploadMedia:C,fileRef:M,useEditWhatsappTemplateMediaResponse:I}=E;const{pod:T}=h.useTemplateModalContext(),[q,A]=a.useState("");let P;if(P=b===o.HEADER_TYPES.IMAGE?"image/png, image/jpeg":b===o.HEADER_TYPES.VIDEO?"video/mp4":"application/pdf",!f)return e.jsx(e.Fragment,{});return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",gap:"10px",alignItems:"center",marginBottom:"16px"}},{children:[e.jsx(t.default,{onClick:e=>{e.stopPropagation(),v(!1),A("")},style:{cursor:"pointer"},width:16,height:16}),e.jsx(p.TitleRegular,{children:"Update Media"})]})),e.jsxs("div",Object.assign({style:{padding:24,borderRadius:4,border:`1px dashed ${n.DEFAULT_THEME.colorsV2.stroke.primary}`,backgroundColor:n.DEFAULT_THEME.colorsV2.surface.subdued,width:"100%",height:"100%",alignItems:"center",display:I.loading?"flex":"initial"}},{children:[e.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16}},{children:[I.loading?e.jsx(s.PureSpinner,{width:"40px",height:"40px",color:n.COLORS.content.brand}):e.jsx("div",Object.assign({style:{height:80,width:80,borderRadius:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n.DEFAULT_THEME.colorsV2.background.base}},{children:b===o.HEADER_TYPES.IMAGE?e.jsx(m.default,{width:40,height:40}):b===o.HEADER_TYPES.VIDEO?e.jsx(u.default,{width:40,height:40}):e.jsx(g.default,{width:40,height:40})})),e.jsx(p.TitleMedium,{children:I.loading?"Upload in progress...":b===o.HEADER_TYPES.IMAGE?"Upload an image":b===o.HEADER_TYPES.VIDEO?"Upload a video":"Upload a document"}),e.jsx(p.BodySecondary,Object.assign({color:n.COLORS.content.secondary},{children:I.loading?`Your ${b.toLowerCase()} is getting loaded. This may take a couple of minutes.`:b===o.HEADER_TYPES.IMAGE?"JPEG/ PNG format • Max 5MB":b===o.HEADER_TYPES.VIDEO?"MP4 format video • Max 16MB":"PDF format document • Max 100MB"}))]})),!I.loading&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"6px"}},{children:[e.jsx(p.BodyCaption,{children:"Press Enter after adding url/variable to add"}),e.jsx(l.InputWithVariables,{noMaxCharCheck:!0,allowMix:!1,onChange:()=>{},onEnterPress:e=>{e&&(c.validateURL(e)||x.isVariable(e)?(C(e),v(!1),A("")):A("Invalid Url/Variable"))},errorMessage:q,prevVariable:{actualValue:"",variableType:"string"},variablesList:y,showSideVariablePanel:!0,placeHolder:"Enter URL/Add variable",showAddButton:T!==d.POD.CAMPAIGN||b===o.HEADER_TYPES.IMAGE})]})),e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",marginBottom:"16px"}},{children:[e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}}),e.jsx(p.BodyCaption,{children:"Or upload media from device"}),e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}})]})),e.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsx(i.Button,{matchParentWidth:!0,buttonText:"Upload",buttonType:"secondary",LeadingIcon:j.default,onClick:()=>C(),size:"medium"})}))]})]})),e.jsx("input",{ref:M,style:{display:"none"},type:"file",onChange:I.handleImageUpload,accept:P}),!!I.selectedImage&&e.jsx(r.BikImageCropper,{aspectRatio:15/8,src:I.selectedImage,onCropComplete:I.onCropComplete,onCancel:()=>{I.setLoading(!1),I.setSelectedImage(""),M.current&&(M.current.value="")}})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/arrow_back.svg.js"),a=require("react"),i=require("../../button/Button.js"),r=require("../../image-cropper/BikImageCropper.js");require("../../image-compress/ImageCompress.js"),require("../../states/StateComponent.js"),require("../../../_virtual/_tslib.js"),require("../../../constants/zindex.js"),require("../../modals/styledModal.js");var s=require("../../spinner/Spinner.js"),l=require("../../input-with-vars/InputWithVariables.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var n=require("../../../constants/Theme.js");require("../../curtain/CurtainHelper.js"),require("../../variable-picker-v3/model.js");var o=require("../../template-preview/models/TemplateMeta.js"),d=require("../../template-preview/models/WhatsAppTemplate.js"),p=require("../../TypographyStyle.js"),c=require("../../../utils/validator.js"),u=require("../../../assets/icons/file.svg.js"),g=require("../../../assets/icons/filePdf.svg.js"),m=require("../../../assets/icons/image.svg.js"),j=require("../../../assets/icons/upload.svg.js"),h=require("../context/templateModalContext.js"),x=require("../utils/validateIsUrl.js");exports.default=E=>{let{setOpenEditMedia:v,mediaComponentFormat:b,variableListForImage:y,openEditMedia:f,uploadMedia:C,fileRef:M,useEditWhatsappTemplateMediaResponse:q}=E;const{pod:I}=h.useTemplateModalContext(),[T,A]=a.useState("");let P;if(P=b===o.HEADER_TYPES.IMAGE?"image/png, image/jpeg":b===o.HEADER_TYPES.VIDEO?"video/mp4":"application/pdf",!f)return e.jsx(e.Fragment,{});return e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",gap:"10px",alignItems:"center",marginBottom:"16px"}},{children:[e.jsx(t.default,{onClick:e=>{e.stopPropagation(),v(!1),A("")},style:{cursor:"pointer"},width:16,height:16}),e.jsx(p.TitleRegular,{children:"Update Media"})]})),e.jsxs("div",Object.assign({style:{padding:24,borderRadius:4,border:`1px dashed ${n.DEFAULT_THEME.colorsV2.stroke.primary}`,backgroundColor:n.DEFAULT_THEME.colorsV2.surface.subdued,width:"100%",height:"100%",alignItems:"center",display:q.loading?"flex":"initial"}},{children:[e.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16}},{children:[q.loading?e.jsx(s.Spinner,{size:"large"}):e.jsx("div",Object.assign({style:{height:80,width:80,borderRadius:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:n.DEFAULT_THEME.colorsV2.background.base}},{children:b===o.HEADER_TYPES.IMAGE?e.jsx(m.default,{width:40,height:40}):b===o.HEADER_TYPES.VIDEO?e.jsx(u.default,{width:40,height:40}):e.jsx(g.default,{width:40,height:40})})),e.jsx(p.TitleMedium,{children:q.loading?"Upload in progress...":b===o.HEADER_TYPES.IMAGE?"Upload an image":b===o.HEADER_TYPES.VIDEO?"Upload a video":"Upload a document"}),e.jsx(p.BodySecondary,Object.assign({color:n.COLORS.content.secondary},{children:q.loading?"Your image is getting loaded. This may take a couple of minutes.":b===o.HEADER_TYPES.IMAGE?"JPEG/ PNG format • Max 5MB":b===o.HEADER_TYPES.VIDEO?"MP4 format video • Max 16MB":"PDF format document • Max 100MB"}))]})),!q.loading&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"6px"}},{children:[e.jsx(p.BodyCaption,{children:"Press Enter after adding url/variable to add"}),e.jsx(l.InputWithVariables,{noMaxCharCheck:!0,allowMix:!1,onChange:()=>{},onEnterPress:e=>{e&&(c.validateURL(e)||x.isVariable(e)?(C(e),v(!1),A("")):A("Invalid Url/Variable"))},errorMessage:T,prevVariable:{actualValue:"",variableType:"string"},variablesList:y,placeHolder:"Enter URL/Add variable",showAddButton:I!==d.POD.CAMPAIGN||b===o.HEADER_TYPES.IMAGE})]})),e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4px",marginBottom:"16px"}},{children:[e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}}),e.jsx(p.BodyCaption,{children:"Or upload media from device"}),e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}})]})),e.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsx(i.Button,{matchParentWidth:!0,buttonText:"Upload",buttonType:"secondary",LeadingIcon:j.default,onClick:()=>C(),size:"medium"})}))]})]})),e.jsx("input",{ref:M,style:{display:"none"},type:"file",onChange:q.handleImageUpload,accept:P}),!!q.selectedImage&&e.jsx(r.BikImageCropper,{aspectRatio:15/8,src:q.selectedImage,onCropComplete:q.onCropComplete,onCancel:()=>{q.setLoading(!1),q.setSelectedImage(""),M.current&&(M.current.value="")}})]})};
@@ -26,6 +26,7 @@
26
26
  border-radius: 4px;
27
27
  margin-left: 8px;
28
28
  align-items: center;
29
+ height: 100%;
29
30
  `,a=i.default.div`
30
31
  padding-bottom: 0px;
31
32
  min-width: 285px;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/arrow_back.svg.js"),r=require("../../../assets/icons/PlusIcon.js"),l=require("lodash"),a=require("react"),i=require("../../add-variableV2/AddVariableV2SideModal.js");require("../../../_virtual/_tslib.js"),require("../../add-variableV2/AddVariableV2.styled.js");var o=require("../../button/Button.js"),s=require("../../icon-button/IconButton.js");require("../../input/Input.js"),require("../../tooltips/Tooltip.js");var n=require("../../../constants/Theme.js");require("../../modals/modal.styled.js"),require("../../switch/Switch.js");var d=require("../../TypographyStyle.js"),c=require("../../product-picker-v2/modal.js"),u=require("../Badge/index.js"),p=require("../context/templateModalContext.js"),m=require("./EditWhatsAppTemplateV2.js"),h=require("./ProductBox.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../curtain/CurtainHelper.js"),require("../../template-preview/models/TemplateMeta.js");var g=require("../../template-preview/models/WhatsAppTemplate.js");exports.default=v=>{let{template:j,whatsappSpecificPickerMeta:x,showVariableModal:y,variableList:b,variableListForImage:f,discountCode:C,setDiscountCode:O}=v;var q,I;const{selectedCarouselIndex:S,setTemplate:w,pickerConf:P,isProductCarouselType:T,pod:k,cardCount:B,carouselProducts:L,setCarouselProducts:V,isError:A,cardImages:E,disableEditVariable:M,onDeleteSelectedProducts:R,setSelectedCarouselIndex:D}=p.useTemplateModalContext(),[F,W]=a.useState(-1==S?"First Message (Step 1/2)":T?"Product Carousel (Step 2/2)":"Carousel Cards (Step 2/2)"),[_,N]=a.useState(!1),[$,z]=a.useState(!1),[G,H]=a.useState(!1);a.useEffect((()=>{W(-1==S?"First Message (Step 1/2)":T?"Product Carousel (Step 2/2)":"Carousel Cards (Step 2/2)")}),[S]);return e.jsxs("div",{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:24}},{children:[null!=S&&S>=0&&e.jsx(s.IconButton,{Icon:t.default,onClick:()=>{null==D||D(-1)}}),e.jsx(d.TitleMedium,Object.assign({style:{marginLeft:10}},{children:F}))]})),T&&(null!==(q=null==L?void 0:L.length)&&void 0!==q?q:0)>0&&null!=S&&S>=0&&e.jsxs("div",Object.assign({style:{display:"flex",rowGap:16,marginBottom:16,marginLeft:10,marginRight:10,flexDirection:"column"}},{children:[e.jsx(h.ProductBox,{editItem:()=>{1===(null==L?void 0:L.length)&&"variable"===L[0].name?H(!0):N(!_)},cardBody:1===(null==L?void 0:L.length)&&"variable"===L[0].name?`${L[0].productName}`:`${null==L?void 0:L.length} Products Selected`,hideIcon:1===(null==L?void 0:L.length)&&"variable"===L[0].name,deleteItem:()=>{var e;if(1===(null==L?void 0:L.length)&&"variable"===L[0].name)return void(null==V||V([]));const t=l.cloneDeep(Object.assign({},j));t&&(E&&E.length>0?null==E||E.forEach(((e,r)=>{var l;t.components[1].cards[r].components[0].example.header_handle=[null!==(l=E[r])&&void 0!==l?l:"https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})):null===(e=null==t?void 0:t.components[1].cards)||void 0===e||e.forEach(((e,r)=>{t.components[1].cards[r].components[0].example.header_handle=["https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})),null==w||w(t)),null==V||V([]),null==R||R()}}),L&&(null==L?void 0:L.length)>0&&"variable"!=L[0].name&&e.jsx(o.Button,{disabled:(null!==(I=null==L?void 0:L.length)&&void 0!==I?I:0)<=1,style:{alignSelf:"flex-end"},onClick:()=>{z(!0),N(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),!M&&T&&0===(null==L?void 0:L.length)&&null!=S&&S>=0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{marginLeft:12}},{children:[e.jsx(d.TitleRegular,{children:"Product(s)"}),e.jsx(d.BodySecondary,{children:`Select ${null!=B?B:1} products`})]})),e.jsxs("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:A?16:12,marginRight:A?16:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[e.jsx(o.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12,border:A?`2px dashed ${n.COLORS.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s)",buttonType:A?"tertiaryGray":"dashBold",LeadingIcon:()=>e.jsx("div",Object.assign({style:{display:"flex",width:18,height:18}},{children:e.jsx(r.default,{width:18,height:18,color:n.COLORS.content.secondary})})),onClick:e=>{N(!0)}}),k===g.POD.CHATBOT&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8}}),e.jsx(d.BodyCaption,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),e.jsx(o.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%",border:A?`2px dashed ${n.COLORS.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s) Variable",buttonType:A?"tertiaryGray":"dashBold",LeadingIcon:()=>e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(r.default,{width:18,height:18,color:n.COLORS.content.secondary})})),onClick:e=>{H(!0)}})]})]})),A&&e.jsx("div",Object.assign({style:{marginLeft:10,marginBottom:16}},{children:e.jsx(u.Badge,{padding:"8px",errorText:"Please add products"})}))]}),e.jsx(m.default,{whatsappSpecificPickerMeta:x,template:j,onTemplateChange:e=>{null==w||w(e)},showVariableModal:y,variableList:b,variableListForImage:f,discountCode:C,setDiscountCode:O}),_&&P&&e.jsx(c.ProductPickerModal,{zIndex:200,startupScreen:$?c.ScreenName.RearrangeProducts:c.ScreenName.Collections,rearrangeEnabled:!0,storeId:P.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const r of e){const e=null==r?void 0:r.collectionId,l=r.productId,a=r.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),l in t[e].products||(t[e].products[l]={variants:{},name:(null==r?void 0:r.productName)||"",image:(null==r?void 0:r.productImage)||""}),t[e].products[l].variants[a]={name:(null==r?void 0:r.name)||"",price:"",image:(null==r?void 0:r.image)||"",quantity:r.quantity||0,displayOrder:r.displayOrder}}return t}return{}})(null!=L?L:[]),collectionFetcher:P.fetchCollections,productFetcher:P.fetchProducts,onAdd:(e,t)=>{var r,a,i,o,s,n;z(!1);const d=[];delete e.isCustom;for(const t of Object.keys(e)){const l=e[t].products;if(void 0!==l&&Object.keys(l).length)for(const e of Object.keys(l)){const c=l[e].variants;if(void 0!==c&&Object.keys(c).length)for(const u of Object.keys(c)){const{name:p,image:m,quantity:h,displayOrder:g}=c[u],v={name:p,image:null!==(a=null!=m?m:null===(r=l[e])||void 0===r?void 0:r.image)&&void 0!==a?a:"",quantity:h,variantId:u,productId:e,displayOrder:g,collectionId:t,productName:null!==(o=null===(i=l[e])||void 0===i?void 0:i.name)&&void 0!==o?o:"",productImage:null!==(n=null===(s=l[e])||void 0===s?void 0:s.image)&&void 0!==n?n:""};d.push(v)}}}const c=d.sort(((e,t)=>e.displayOrder-t.displayOrder)),u=d.map((e=>e.image)),p=l.cloneDeep(Object.assign({},j));p&&(u.forEach(((e,t)=>{var r;p.components[1].cards[t].components[0].example.header_handle=e?[e]:[null!==(r=null==E?void 0:E[t])&&void 0!==r?r:""]})),null==w||w(p)),null==V||V(c),N(!1)},searchInCollectionFetcher:P.searchInCollection,searchFetcher:P.searchProducts,visible:_,onClose:()=>{N(!1)},exactLimit:null!=B?B:1}),G&&e.jsx(i.AddVariableV2SideModal,{zIndex:2e3,data:null!=b?b:[],showVariable:G,setShowVariable:H,placeholder:"Add a variable",customTrigger:e=>{null==V||V([{name:"variable",productName:e.actualValue}])}})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/arrow_back.svg.js"),r=require("../../../assets/icons/PlusIcon.js"),l=require("lodash"),a=require("react"),i=require("../../button/Button.js"),n=require("../../icon-button/IconButton.js"),o=require("../../product-picker-v2/modal.js"),s=require("../Badge/index.js"),d=require("../context/templateModalContext.js"),c=require("./EditWhatsAppTemplateV2.js"),u=require("./ProductBox.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var p=require("../../../constants/Theme.js");require("../../curtain/CurtainHelper.js"),require("../../variable-picker-v3/model.js"),require("../../template-preview/models/TemplateMeta.js");var m=require("../../template-preview/models/WhatsAppTemplate.js"),h=require("../../TypographyStyle.js");exports.default=g=>{let{template:v,whatsappSpecificPickerMeta:x,showVariableModal:j,variableList:y,variableListForImage:f,discountCode:b,setDiscountCode:C}=g;var O,I;const{selectedCarouselIndex:P,setTemplate:q,pickerConf:w,isProductCarouselType:S,pod:k,cardCount:T,carouselProducts:B,setCarouselProducts:L,isError:E,cardImages:M,disableEditVariable:R,onDeleteSelectedProducts:A,setSelectedCarouselIndex:D,setVariableCallback:F,setShowVariablePicker:V}=d.useTemplateModalContext(),[W,N]=a.useState(-1==P?"First Message (Step 1/2)":S?"Product Carousel (Step 2/2)":"Carousel Cards (Step 2/2)"),[_,$]=a.useState(!1),[z,G]=a.useState(!1);a.useEffect((()=>{N(-1==P?"First Message (Step 1/2)":S?"Product Carousel (Step 2/2)":"Carousel Cards (Step 2/2)")}),[P]);const H=e=>{null==L||L([{name:"variable",productName:e.actualValue}])};return e.jsxs("div",{children:[e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:24}},{children:[null!=P&&P>=0&&e.jsx(n.IconButton,{Icon:t.default,onClick:()=>{null==D||D(-1)}}),e.jsx(h.TitleMedium,Object.assign({style:{marginLeft:10}},{children:W}))]})),S&&(null!==(O=null==B?void 0:B.length)&&void 0!==O?O:0)>0&&null!=P&&P>=0&&e.jsxs("div",Object.assign({style:{display:"flex",rowGap:16,marginBottom:16,marginLeft:10,marginRight:10,flexDirection:"column"}},{children:[e.jsx(u.ProductBox,{editItem:()=>{1===(null==B?void 0:B.length)&&"variable"===B[0].name?(F((()=>H)),V(!0)):$(!_)},cardBody:1===(null==B?void 0:B.length)&&"variable"===B[0].name?`${B[0].productName}`:`${null==B?void 0:B.length} Products Selected`,hideIcon:1===(null==B?void 0:B.length)&&"variable"===B[0].name,deleteItem:()=>{var e;if(1===(null==B?void 0:B.length)&&"variable"===B[0].name)return void(null==L||L([]));const t=l.cloneDeep(Object.assign({},v));t&&(M&&M.length>0?null==M||M.forEach(((e,r)=>{var l;t.components[1].cards[r].components[0].example.header_handle=[null!==(l=M[r])&&void 0!==l?l:"https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})):null===(e=null==t?void 0:t.components[1].cards)||void 0===e||e.forEach(((e,r)=>{t.components[1].cards[r].components[0].example.header_handle=["https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})),null==q||q(t)),null==L||L([]),null==A||A()}}),B&&(null==B?void 0:B.length)>0&&"variable"!=B[0].name&&e.jsx(i.Button,{disabled:(null!==(I=null==B?void 0:B.length)&&void 0!==I?I:0)<=1,style:{alignSelf:"flex-end"},onClick:()=>{G(!0),$(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),!R&&S&&0===(null==B?void 0:B.length)&&null!=P&&P>=0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{marginLeft:12}},{children:[e.jsx(h.TitleRegular,{children:"Product(s)"}),e.jsx(h.BodySecondary,{children:`Select ${null!=T?T:1} products`})]})),e.jsxs("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:E?16:12,marginRight:E?16:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[e.jsx(i.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12,border:E?`2px dashed ${p.COLORS.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s)",buttonType:E?"tertiaryGray":"dashBold",LeadingIcon:()=>e.jsx("div",Object.assign({style:{display:"flex",width:18,height:18}},{children:e.jsx(r.default,{width:18,height:18,color:p.COLORS.content.secondary})})),onClick:e=>{$(!0)}}),k===m.POD.CHATBOT&&e.jsxs(e.Fragment,{children:[e.jsxs("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8}}),e.jsx(h.BodyCaption,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),e.jsx("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),e.jsx(i.Button,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%",border:E?`2px dashed ${p.COLORS.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s) Variable",buttonType:E?"tertiaryGray":"dashBold",LeadingIcon:()=>e.jsx("div",Object.assign({style:{display:"flex"}},{children:e.jsx(r.default,{width:18,height:18,color:p.COLORS.content.secondary})})),onClick:e=>{F((()=>H)),V(!0)}})]})]})),E&&e.jsx("div",Object.assign({style:{marginLeft:10,marginBottom:16}},{children:e.jsx(s.Badge,{padding:"8px",errorText:"Please add products"})}))]}),e.jsx(c.default,{whatsappSpecificPickerMeta:x,template:v,onTemplateChange:e=>{null==q||q(e)},showVariableModal:j,variableList:y,variableListForImage:f,discountCode:b,setDiscountCode:C}),_&&w&&e.jsx(o.ProductPickerModal,{zIndex:200,startupScreen:z?o.ScreenName.RearrangeProducts:o.ScreenName.Collections,rearrangeEnabled:!0,storeId:w.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const r of e){const e=null==r?void 0:r.collectionId,l=r.productId,a=r.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),l in t[e].products||(t[e].products[l]={variants:{},name:(null==r?void 0:r.productName)||"",image:(null==r?void 0:r.productImage)||""}),t[e].products[l].variants[a]={name:(null==r?void 0:r.name)||"",price:"",image:(null==r?void 0:r.image)||"",quantity:r.quantity||0,displayOrder:r.displayOrder}}return t}return{}})(null!=B?B:[]),collectionFetcher:w.fetchCollections,productFetcher:w.fetchProducts,onAdd:(e,t)=>{var r,a,i,n,o,s;G(!1);const d=[];delete e.isCustom;for(const t of Object.keys(e)){const l=e[t].products;if(void 0!==l&&Object.keys(l).length)for(const e of Object.keys(l)){const c=l[e].variants;if(void 0!==c&&Object.keys(c).length)for(const u of Object.keys(c)){const{name:p,image:m,quantity:h,displayOrder:g}=c[u],v={name:p,image:null!==(a=null!=m?m:null===(r=l[e])||void 0===r?void 0:r.image)&&void 0!==a?a:"",quantity:h,variantId:u,productId:e,displayOrder:g,collectionId:t,productName:null!==(n=null===(i=l[e])||void 0===i?void 0:i.name)&&void 0!==n?n:"",productImage:null!==(s=null===(o=l[e])||void 0===o?void 0:o.image)&&void 0!==s?s:""};d.push(v)}}}const c=d.sort(((e,t)=>e.displayOrder-t.displayOrder)),u=d.map((e=>e.image)),p=l.cloneDeep(Object.assign({},v));p&&(u.forEach(((e,t)=>{var r;p.components[1].cards[t].components[0].example.header_handle=e?[e]:[null!==(r=null==M?void 0:M[t])&&void 0!==r?r:""]})),null==q||q(p)),null==L||L(c),$(!1)},searchInCollectionFetcher:w.searchInCollection,searchFetcher:w.searchProducts,visible:_,onClose:()=>{$(!1)},exactLimit:null!=T?T:1})]})};
@@ -15,5 +15,5 @@ export interface EditWhatsAppTemplateV2Props {
15
15
  fileName?: string;
16
16
  setFileName?: (name: string) => void;
17
17
  }
18
- declare const EditWhatsAppTemplateV2: ({ template, onTemplateChange, whatsappSpecificPickerMeta, showVariableModal, variableList, variableListForImage, discountCode, setDiscountCode, fileName, setFileName, }: EditWhatsAppTemplateV2Props) => import("react/jsx-runtime").JSX.Element;
18
+ declare const EditWhatsAppTemplateV2: ({ template, onTemplateChange, whatsappSpecificPickerMeta, showVariableModal, variableList, variableListForImage, setDiscountCode, fileName, setFileName, }: EditWhatsAppTemplateV2Props) => import("react/jsx-runtime").JSX.Element;
19
19
  export default EditWhatsAppTemplateV2;