@bikdotai/bik-component-library 0.0.744-beta.8 → 0.0.744

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 (39) hide show
  1. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  2. package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  3. package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  4. package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  5. package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  6. package/dist/cjs/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +1 -1
  7. package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
  8. package/dist/cjs/components/carousel-preview/CarouselPreview.js +1 -1
  9. package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +1 -1
  10. package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +1 -1
  11. package/dist/cjs/components/feature-announcements/constants/dimensions.d.ts +25 -99
  12. package/dist/cjs/components/feature-announcements/constants/dimensions.js +1 -1
  13. package/dist/cjs/components/feature-announcements/styles/joyride.styles.d.ts +2 -2
  14. package/dist/cjs/components/feature-announcements/styles/majorPopup.styles.d.ts +2 -18
  15. package/dist/cjs/components/feature-announcements/styles/majorPopup.styles.js +1 -1
  16. package/dist/cjs/components/feature-announcements/types/feature.types.d.ts +0 -31
  17. package/dist/cjs/components/feature-announcements/types/props.types.d.ts +3 -25
  18. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  19. package/dist/cjs/components/whats-new/WhatsNewPanel.js +1 -1
  20. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
  21. package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  22. package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
  23. package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
  24. package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
  25. package/dist/esm/components/QueryBuilder/helpers/MetaCustomProcessor.d.ts +1 -1
  26. package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
  27. package/dist/esm/components/carousel-preview/CarouselPreview.js +1 -1
  28. package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +1 -1
  29. package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +1 -1
  30. package/dist/esm/components/feature-announcements/constants/dimensions.d.ts +25 -99
  31. package/dist/esm/components/feature-announcements/constants/dimensions.js +1 -1
  32. package/dist/esm/components/feature-announcements/styles/joyride.styles.d.ts +2 -2
  33. package/dist/esm/components/feature-announcements/styles/majorPopup.styles.d.ts +2 -18
  34. package/dist/esm/components/feature-announcements/styles/majorPopup.styles.js +1 -1
  35. package/dist/esm/components/feature-announcements/types/feature.types.d.ts +0 -31
  36. package/dist/esm/components/feature-announcements/types/props.types.d.ts +3 -25
  37. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppCarouselTemplateV2.js +1 -1
  38. package/dist/esm/components/whats-new/WhatsNewPanel.js +1 -1
  39. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("date-fns"),s=require("react"),r=require("../../assets/icons/searchIcon.svg.js"),n=require("../../assets/icons/whatsNew.svg.js"),a=require("../../constants/Theme.js"),i=require("../button/Button.js"),o=require("../feature-announcements/VideoModal.js"),c=require("../searchBar/searchBar.js"),d=require("../side-modal/SideModal.js"),l=require("../TypographyStyle.js"),h=require("./WhatsNew.styles.js");exports.WhatsNewPanel=u=>{let{isOpen:j,onClose:m,content:x,isLoading:g=!1,title:w="What's new on BIK",searchPlaceholder:p="Search posts",emptyStateTitle:b="Nothing new!",emptyStateDescription:C="There are no new updates or features at the moment. Check back soon!",noResultsText:f="Sorry, no results found.",width:y="480px",onContentClick:O,renderCustomContent:N}=u;const[S,v]=s.useState(""),[M,L]=s.useState(!1),[q,k]=s.useState(""),T=e=>{if(!e.createdAt)return!1;const s=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return t.differenceInBusinessDays(new Date,s)<7},B=s.useMemo((()=>{if(!S.trim())return x;const e=S.toLowerCase();return x.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[x,S]),W=e=>{e.productVideo?(k(e.productVideo),L(!0)):e.redirectUrl&&(e=>{const t=e.trim();try{const e=new URL(t,window.location.origin);e.origin===window.location.origin?window.location.href=e.href:window.open(e.href,"_blank","noopener,noreferrer")}catch(e){t.startsWith("/")||t.startsWith(".")?window.location.href=t:/^https?:\/\//i.test(t)&&window.open(t,"_blank","noopener,noreferrer")}})(e.redirectUrl),O&&O(e)},D=0===x.length,R=0===B.length;return j?e.jsxs(d.SideModal,Object.assign({width:y,onClose:m,header:"",headerCustomComponent:e.jsx(l.TitleMedium,Object.assign({color:a.COLORS.background.inverse},{children:w})),headerStyle:{background:a.COLORS.background.brandLight},hideFooter:!0},{children:[e.jsxs(h.MainContainer,{children:[e.jsx("div",Object.assign({className:"mt-8"},{children:e.jsx(c.SearchBar,{width:"100%",isEnabled:!D,onChange:e=>{v(e)},onEnter:e=>{v(e)},placeholder:p,variant:"default",searchValue:S,onClickCross:()=>{v("")}})})),e.jsx(h.WhatsNewWrapper,{children:D||R?e.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsx("div",Object.assign({className:"icon--wrapper"},{children:D?e.jsx(n.default,{width:32,height:32}):e.jsx(r.default,{width:32,height:32})})),D?e.jsxs(e.Fragment,{children:[e.jsx(l.TitleRegular,{children:b}),e.jsx(l.BodyPrimary,Object.assign({color:a.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:C}))]}):R?e.jsx(l.BodyPrimary,Object.assign({color:a.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:f})):null]})):e.jsx("div",Object.assign({className:"scroller"},{children:B.map(((s,r)=>N?N(s):e.jsxs(h.MainCardContainer,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsx(h.BackgroundImageContainer,{imageUrl:s.image,height:"209px",width:"100%",style:{borderRadius:"4px"}}),e.jsx("div",Object.assign({className:"mt-20 full--width"},{children:e.jsxs("div",Object.assign({className:"created--at flex flex--row"},{children:[T(s)?e.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsx(l.Caption,{children:"New"})})):e.jsx(e.Fragment,{}),e.jsx(l.Caption,Object.assign({style:{color:a.COLORS.content.placeholder}},{children:s.createdAt?t.format(s.createdAt.toDate?s.createdAt.toDate():new Date(s.createdAt),"dd MMMM yyyy"):""}))]}))})),e.jsx("div",Object.assign({className:"mt--8"},{children:e.jsx(l.TitleSmall,{children:s.title})})),e.jsx("div",{dangerouslySetInnerHTML:{__html:s.body},className:"card--desc mt--12"}),e.jsx("div",Object.assign({className:"flex flex--row mt-20 full--width"},{children:e.jsx(i.Button,{buttonText:s.buttonText||"Explore the feature",onClick:()=>W(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${r}`)))}))})]}),e.jsx(o.VideoModal,{isOpen:M,videoUrl:q,onClose:()=>{L(!1)}})]})):e.jsx(e.Fragment,{})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("date-fns"),s=require("react"),a=require("../../assets/icons/searchIcon.svg.js"),r=require("../../assets/icons/whatsNew.svg.js"),n=require("../../constants/Theme.js"),i=require("../button/Button.js"),o=require("../feature-announcements/VideoModal.js"),c=require("../searchBar/searchBar.js"),d=require("../side-modal/SideModal.js"),l=require("../TypographyStyle.js"),h=require("./WhatsNew.styles.js");exports.WhatsNewPanel=u=>{let{isOpen:j,onClose:m,content:x,isLoading:g=!1,title:w="What's new on BIK",searchPlaceholder:b="Search posts",emptyStateTitle:p="Nothing new!",emptyStateDescription:C="There are no new updates or features at the moment. Check back soon!",noResultsText:O="Sorry, no results found.",width:y="480px",onContentClick:f,renderCustomContent:N}=u;const[S,v]=s.useState(""),[M,q]=s.useState(!1),[L,T]=s.useState(""),k=e=>{if(!e.createdAt)return!1;const s=e.createdAt.toDate?e.createdAt.toDate():new Date(e.createdAt);return t.differenceInBusinessDays(new Date,s)<7},B=s.useMemo((()=>{if(!S.trim())return x;const e=S.toLowerCase();return x.filter((t=>t.title.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||t.content&&t.content.toLowerCase().includes(e)))}),[x,S]),D=0===x.length,A=0===B.length;return j?e.jsxs(d.SideModal,Object.assign({width:y,onClose:m,header:"",headerCustomComponent:e.jsx(l.TitleMedium,Object.assign({color:n.COLORS.background.inverse},{children:w})),headerStyle:{background:n.COLORS.background.brandLight},hideFooter:!0},{children:[e.jsxs(h.MainContainer,{children:[e.jsx("div",Object.assign({className:"mt-8"},{children:e.jsx(c.SearchBar,{width:"100%",isEnabled:!D,onChange:e=>{v(e)},onEnter:e=>{v(e)},placeholder:b,variant:"default",searchValue:S,onClickCross:()=>{v("")}})})),e.jsx(h.WhatsNewWrapper,{children:D||A?e.jsxs("div",Object.assign({className:"no--data--found"},{children:[e.jsx("div",Object.assign({className:"icon--wrapper"},{children:D?e.jsx(r.default,{width:32,height:32}):e.jsx(a.default,{width:32,height:32})})),D?e.jsxs(e.Fragment,{children:[e.jsx(l.TitleRegular,{children:p}),e.jsx(l.BodyPrimary,Object.assign({color:n.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:C}))]}):A?e.jsx(l.BodyPrimary,Object.assign({color:n.COLORS.content.secondary,className:"text--align",style:{maxWidth:300}},{children:O})):null]})):e.jsx("div",Object.assign({className:"scroller"},{children:B.map(((s,a)=>N?N(s):e.jsxs(h.MainCardContainer,Object.assign({className:"padding--16 mb-mt-8"},{children:[e.jsx(h.BackgroundImageContainer,{imageUrl:s.image,height:"209px",width:"100%",style:{borderRadius:"4px"}}),e.jsx("div",Object.assign({className:"mt-20 full--width"},{children:e.jsxs("div",Object.assign({className:"created--at flex flex--row"},{children:[k(s)?e.jsx("div",Object.assign({className:"new--content--tag"},{children:e.jsx(l.Caption,{children:"New"})})):e.jsx(e.Fragment,{}),e.jsx(l.Caption,Object.assign({style:{color:n.COLORS.content.placeholder}},{children:s.createdAt?t.format(s.createdAt.toDate?s.createdAt.toDate():new Date(s.createdAt),"dd MMMM yyyy"):""}))]}))})),e.jsx("div",Object.assign({className:"mt--8"},{children:e.jsx(l.TitleSmall,{children:s.title})})),e.jsx("div",{dangerouslySetInnerHTML:{__html:s.body},className:"card--desc mt--12"}),e.jsx("div",Object.assign({className:"flex flex--row mt-20 full--width"},{children:e.jsx(i.Button,{buttonText:s.buttonText||"Explore the feature",onClick:()=>(e=>{e.productVideo?(T(e.productVideo),q(!0)):e.redirectUrl&&window.open(e.redirectUrl,"_blank"),f&&f(e)})(s),matchParentWidth:!0,size:"medium"})}))]}),`whats-new-${a}`)))}))})]}),e.jsx(o.VideoModal,{isOpen:M,videoUrl:L,onClose:()=>{q(!1)}})]})):e.jsx(e.Fragment,{})};
@@ -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;
@@ -36,7 +36,7 @@ export declare class MetaCustomProcessor {
36
36
  value: {
37
37
  operator: string;
38
38
  dataType: import("../types").QueryBuilderConnectorType;
39
- value?: string | number | string[] | number[] | Date | Date[] | undefined;
39
+ value?: string | number | Date | string[] | number[] | Date[] | undefined;
40
40
  };
41
41
  key: string;
42
42
  refresh?: boolean | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Menus: ({
3
2
  displayName: string;
4
3
  key: number;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import o from"react";import l from"react-slick";import{Container as t,CarouselSlickContainer as s}from"./CarouselPreview.style.js";import n from"./CarouselPreviewCard.js";import{useTemplateModalContext as i}from"../template-context-mapper/context/templateModalContext.js";import{determineCardIndex as a,isRCSChannel as d}from"../template-preview/helpers/templateMiscHelper.js";import{RCSCarousalContainer as u}from"../template-preview/RCS/RCSPreview.styled.js";import{CustomCarouselRightArrow as c,CustomCarouselLeftArrow as m}from"./CustomCarouselArrows.js";const p=o.forwardRef((o=>{let{channel:l,template:s,isPreview:c,removeBottomBorder:m,borderRadius:p,showArrows:w,hideBorder:h,showSampleValues:C}=o;var f,x;const{sliderRef:j,selectedCarouselIndex:g,cardCount:I,setIsCarouselHovered:P,cardIndex:R}=i(),b=-1==R?a(l):R,S=null===(x=null===(f=null==s?void 0:s.components)||void 0===f?void 0:f[b])||void 0===x?void 0:x.cards,A=(null==S?void 0:S.length)?e(v,{cards:S,cardCount:null!=I?I:0,selectedCarouselIndex:null!=g?g:-1,sliderRef:j,isPreview:c,showArrows:w,channel:l,template:s,setIsCarouselHovered:P,showSampleValues:!!C}):null;return d(l)?e(u,Object.assign({borderRadius:p},{children:A})):r(t,Object.assign({removeBottomBorder:m,borderRadius:p,hideBorder:h},{children:[e(n,{channel:l,currentTemplate:s,carouselCardIndex:-1,isPreview:c,width:"77%"}),A]}))})),v=r=>{let{cards:o,cardCount:t,selectedCarouselIndex:i,sliderRef:a,isPreview:d,showArrows:u,channel:p,template:v,setIsCarouselHovered:w,showSampleValues:h}=r;return e(s,Object.assign({cardCount:t,selectedCarouselIndex:i,onMouseEnter:()=>null==w?void 0:w(!0),onMouseLeave:()=>null==w?void 0:w(!1)},{children:e(l,Object.assign({ref:a,swipeToSlide:!0,draggable:!0,swipe:!0,infinite:!1,focusOnSelect:!d,centerMode:!0,arrows:u,adaptiveHeight:!0,nextArrow:e(c,{isPreview:null!=d&&d}),prevArrow:e(m,{isPreview:null!=d&&d})},{children:null==o?void 0:o.map(((r,o)=>{var l,t;const s={components:r.components,mapping:null===(t=null===(l=null==v?void 0:v.mapping)||void 0===l?void 0:l.cards)||void 0===t?void 0:t[o],content:null==v?void 0:v.content,templateType:null==v?void 0:v.templateType};return e(n,{channel:p,currentTemplate:s,carouselCardIndex:o,isPreview:d,width:"100%",showSampleValues:h},o)}))}))}))};export{p as CarouselPreview};
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import o from"react";import l from"react-slick";import{Container as t,CarouselSlickContainer as s}from"./CarouselPreview.style.js";import i from"./CarouselPreviewCard.js";import{useTemplateModalContext as a}from"../template-context-mapper/context/templateModalContext.js";import{determineCardIndex as n,isRCSChannel as d}from"../template-preview/helpers/templateMiscHelper.js";import{RCSCarousalContainer as c}from"../template-preview/RCS/RCSPreview.styled.js";import{CustomCarouselRightArrow as u,CustomCarouselLeftArrow as m}from"./CustomCarouselArrows.js";const p=o.forwardRef((o=>{let{channel:l,template:s,isPreview:u,removeBottomBorder:m,borderRadius:p,showArrows:w,hideBorder:h,showSampleValues:C}=o;var f,x;const{sliderRef:P,selectedCarouselIndex:b,cardCount:j,setIsCarouselHovered:g,cardIndex:I,showVariablePicker:R}=a(),S=-1==I?n(l):I,V=null===(x=null===(f=null==s?void 0:s.components)||void 0===f?void 0:f[S])||void 0===x?void 0:x.cards,A=(null==V?void 0:V.length)?e(v,{cards:V,cardCount:null!=j?j:0,selectedCarouselIndex:null!=b?b:-1,sliderRef:P,isPreview:u,showArrows:w,channel:l,template:s,setIsCarouselHovered:g,showSampleValues:!!C,showVariablePicker:R}):null;return d(l)?e(c,Object.assign({borderRadius:p},{children:A})):r(t,Object.assign({removeBottomBorder:m,borderRadius:p,hideBorder:h},{children:[e(i,{channel:l,currentTemplate:s,carouselCardIndex:-1,isPreview:u,width:"77%"}),A]}))})),v=r=>{let{cards:o,cardCount:t,selectedCarouselIndex:a,sliderRef:n,isPreview:d,showArrows:c,channel:p,template:v,setIsCarouselHovered:w,showSampleValues:h,showVariablePicker:C}=r;return e(s,Object.assign({cardCount:t,selectedCarouselIndex:a,onMouseEnter:()=>!C&&(null==w?void 0:w(!0)),onMouseLeave:()=>!C&&(null==w?void 0:w(!1))},{children:e(l,Object.assign({ref:n,swipeToSlide:!0,draggable:!0,swipe:!0,infinite:!1,focusOnSelect:!d,centerMode:!0,arrows:c,adaptiveHeight:!0,nextArrow:e(u,{isPreview:null!=d&&d}),prevArrow:e(m,{isPreview:null!=d&&d})},{children:null==o?void 0:o.map(((r,o)=>{var l,t;const s={components:r.components,mapping:null===(t=null===(l=null==v?void 0:v.mapping)||void 0===l?void 0:l.cards)||void 0===t?void 0:t[o],content:null==v?void 0:v.content,templateType:null==v?void 0:v.templateType};return e(i,{channel:p,currentTemplate:s,carouselCardIndex:o,isPreview:d,width:"100%",showSampleValues:h},o)}))}))}))};export{p as CarouselPreview};
@@ -1 +1 @@
1
- import{__awaiter as t}from"../../_virtual/_tslib.js";import{jsx as e,jsxs as o,Fragment as n}from"react/jsx-runtime";import{useState as r,useEffect as a,useCallback as i}from"react";import s,{ACTIONS as d}from"react-joyride";import"./constants/animations.js";import{SELECTORS as l}from"./constants/selectors.js";import{useFeatureAnnouncements as u}from"./hooks/useFeatureAnnouncements.js";import c from"./MajorUpdatePopup.js";import p from"./MinorUpdatePopup.js";import{VideoModal as f}from"./VideoModal.js";const m=m=>{let{children:b,fetchVisibleFeatures:g,getStoreFeatureProgress:h,fetchFeatureById:y,markFeatureAsViewedForStore:x,isFeatureApplicableToCurrentPage:k,module:S,router:C,storeId:T,onAnnouncementShown:v,onAnnouncementInteracted:w}=m;var I;const{majorUpdateFeatures:B,minorUpdateFeatures:F,isLoading:E,markFeatureAsViewed:N}=u({fetchVisibleFeatures:g,getStoreFeatureProgress:h,fetchFeatureById:y,markFeatureAsViewedForStore:x,isFeatureApplicableToCurrentPage:k,module:S,router:C}),[j,P]=r(null),[U,W]=r(null),[V,M]=r(!1),[O,q]=r([]),[_,A]=r(!1),[L,R]=r([]),[$,z]=r(!1),[H,Z]=r(!1),[D,G]=r([]),[J,K]=r(!1),[Q,X]=r(!1),[Y,tt]=r(!1),[et,ot]=r(""),[nt,rt]=r(!1),[at,it]=r(!1),[st,dt]=r(!1),[lt,ut]=r(0),[ct,pt]=r(0),[ft,mt]=r(new Set);a((()=>{const t="minor-spotlight-cutout-style";let e=document.getElementById(t);return e||(e=document.createElement("style"),e.id=t,document.head.appendChild(e)),e.textContent="\n\t\t\t.react-joyride__spotlight {\n\t\t\t\ttransition: box-shadow 0.3s ease-in-out !important;\n\t\t\t\twill-change: box-shadow, transform;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__tooltip {\n\t\t\t\twill-change: transform, opacity;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__floater {\n\t\t\t\tright: 12px !important;\n\t\t\t\tleft: auto !important;\n\t\t\t}\n\t\t",()=>{const e=document.getElementById(t);e&&e.remove()}}),[]),a((()=>{ut((t=>t+1)),pt((t=>t+1)),it(!1),dt(!1),mt(new Set)}),[null==C?void 0:C.pathname]),a((()=>{if(!(B.length>0)||j||E||$||nt)0!==B.length||E||X(!0);else{X(!1),K(!1),M(!1),q([]),W(null),G([]);let t=0;const e=10,o=()=>{t++;document.querySelector('[data-testid="whats-new-button"]')?bt(B[0]):t<e?setTimeout(o,1e3):X(!0)};o()}}),[B,j,E,$,nt]),a((()=>{var t;const e=null===(t=null==C?void 0:C.query)||void 0===t?void 0:t.featureId;if(!e||E||0===F.length)return;const o=F.find((t=>t.id===e));if(!o||!o.featureTag)return;K(!0),Z(!0);let n=0;const r=setInterval((()=>{n++;const t=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;if(document.querySelector(t)){const t=[o];G(t),Tt(o,t),clearInterval(r)}else n>=25&&(Z(!1),clearInterval(r))}),200);return()=>{clearInterval(r)}}),[F,null===(I=null==C?void 0:C.query)||void 0===I?void 0:I.featureId,E]),a((()=>{var t;if(F.length>0&&!E&&!V&&!H&&!U&&!J&&Q&&!nt){let t=null,e=null,o=null,n=!1;const r=()=>{if(n||H||U||J||!Q)return;const r=F.filter((t=>{if(!t.featureTag||""===t.featureTag.trim())return!1;if(ft.has(t.id))return!1;const e=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`;return null!==document.querySelector(e)}));r.length>0&&(G(r),Tt(r[0],r),t&&(t.disconnect(),t=null),e&&(window.removeEventListener("scroll",e),e=null),o&&(clearTimeout(o),o=null))};return t=new MutationObserver((t=>{let e=!1;for(const o of t){if("childList"===o.type&&o.addedNodes.length>0)for(let t=0;t<o.addedNodes.length;t++){const n=o.addedNodes[t];if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(t.id||t.querySelector("[id]")){e=!0;break}}}if(e)break}V||n||H||U||J||!Q||!e||(o&&clearTimeout(o),o=setTimeout((()=>{n||H||U||J||!Q||r()}),200))})),e=()=>{V||n||H||U||J||!Q||(o&&clearTimeout(o),requestAnimationFrame((()=>{o=setTimeout((()=>{n||H||U||J||!Q||r()}),300)})))},t&&t.observe(document.body,{childList:!0,subtree:!0}),e&&window.addEventListener("scroll",e,{passive:!0}),r(),setTimeout((()=>{n||H||U||J||!Q||r()}),100),setTimeout((()=>{n||H||U||J||!Q||r()}),1e3),setTimeout((()=>{n||H||U||J||!Q||r()}),500),()=>{n=!0,t&&t.disconnect(),e&&window.removeEventListener("scroll",e),o&&clearTimeout(o)}}if(0===F.length||E){(null===(t=null==C?void 0:C.query)||void 0===t?void 0:t.featureId)&&U||(M(!1),q([]),W(null),G([]),K(!1))}}),[F,E,V,H,U,J,Q,N,nt]);const bt=t=>{P(t);const o=B.findIndex((e=>e.id===t.id)),n=B.length,r=[{target:l.WHATS_NEW_BUTTON,content:e(c,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>gt(t),onExplore:()=>ht(t),onPrevious:()=>yt(t),onNext:()=>xt(t),setIsClosing:it}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(r),A(!0),v&&T&&v({storeId:T,announcementId:t.id,announcementTitle:t.title,imageUrl:t.displayImage||t.image,videoUrl:t.productVideo})},gt=i((t=>{const e=t||j;e&&(z(!0),B.forEach((t=>{N(t.id)})),A(!1),P(null),R([]),X(!0),w&&T&&w({storeId:T,announcementId:e.id,announcementTitle:e.title,imageUrl:e.displayImage||e.image,videoUrl:e.productVideo,buttonClicked:"Skip",buttonName:"Skip",buttonUrl:void 0}),setTimeout((()=>{z(!1)}),500))}),[j,B,N]),ht=i((t=>{z(!0),N(t.id),t.productVideo&&(ot(t.productVideo),tt(!0),rt(!0)),A(!1),P(null),R([]);B.findIndex((e=>e.id===t.id))===B.length-1&&X(!0),w&&T&&w({storeId:T,announcementId:t.id,announcementTitle:t.title,imageUrl:t.displayImage||t.image,videoUrl:t.productVideo,buttonClicked:"Primary",buttonName:t.buttonText||"Explore",buttonUrl:t.redirectUrl||t.productVideo}),setTimeout((()=>{z(!1)}),500)}),[B,N]),yt=i((t=>{const o=t||j;if(!o)return;const n=B.findIndex((t=>t.id===o.id));if(n>0){const t=B[n-1];P(t);const o=n-1,r=B.length,a=[{target:'[data-testid="whats-new-button"]',content:e(c,{feature:t,currentIndex:o,totalFeatures:r,onSkip:()=>gt(t),onExplore:()=>ht(t),onPrevious:()=>yt(t),onNext:()=>xt(t),setIsClosing:it}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(a)}}),[j,B]),xt=i((t=>{const o=t||j;if(!o)return;const n=B.findIndex((t=>t.id===o.id));if(n<B.length-1){const t=B[n+1];P(t);const o=n+1,r=B.length,a=[{target:'[data-testid="whats-new-button"]',content:e(c,{feature:t,currentIndex:o,totalFeatures:r,onSkip:()=>gt(t),onExplore:()=>ht(t),onPrevious:()=>yt(t),onNext:()=>xt(t),setIsClosing:it}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(a)}else z(!0),N(o.id),A(!1),P(null),R([]),X(!0),setTimeout((()=>{z(!1)}),500)}),[j,B,N]),kt=()=>{if(B.length>0&&!j){document.querySelector('[data-testid="whats-new-button"]')&&bt(B[0])}};a((()=>(window.showMajorUpdatePopup=kt,()=>{delete window.showMajorUpdatePopup})),[B,j]);const St=i((t=>{const{action:e}=t;e===d.CLOSE&&(j&&(z(!0),B.forEach((t=>{N(t.id)})),X(!0),setTimeout((()=>{z(!1)}),500)),A(!1),P(null),R([]))}),[j,B,N]),Ct=i((t=>{const{action:e}=t;if(e===d.CLOSE){if(U){Z(!0),N(U.id);D.findIndex((t=>t.id===U.id))===D.length-1&&K(!0),setTimeout((()=>{Z(!1)}),500)}M(!1),W(null),q([])}}),[U,D,N]),Tt=(o,n)=>t(void 0,void 0,void 0,(function*(){W(o);const t=n||D,r=t.findIndex((t=>t.id===o.id)),a=t.length,i=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`,s=document.querySelector(i);if(s)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(s,120)}catch(t){}const d=[{target:i,content:e(p,{feature:o,currentIndex:r,totalFeatures:a,onSkip:()=>vt(o),onExplore:()=>wt(o),onPrevious:()=>It(o),onNext:()=>Bt(o),setIsClosing:dt}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:o,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];q(d),M(!0)})),vt=i((t=>{const e=t||U;if(e){Z(!0),N(e.id),mt((t=>new Set(t).add(e.id))),M(!1),W(null),q([]);const t=D.find((t=>t.id!==e.id&&!ft.has(t.id)));setTimeout((()=>{Z(!1),t?Tt(t,D):K(!0)}),500)}}),[U,D,N,ft]),wt=i((t=>{Z(!0),N(t.id),mt((e=>new Set(e).add(t.id))),t.productVideo&&(ot(t.productVideo),tt(!0),rt(!0)),M(!1),W(null),q([]);const e=D.find((e=>e.id!==t.id&&!ft.has(e.id)));setTimeout((()=>{Z(!1),e&&!t.productVideo?Tt(e,D):e||K(!0)}),500)}),[D,N,ft]),It=i((o=>t(void 0,void 0,void 0,(function*(){const t=o||U;if(!t)return;const n=D.findIndex((e=>e.id===t.id));if(n>0){const t=D[n-1];W(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,r=document.querySelector(o);if(r)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(r,120)}catch(t){}const a=n-1,i=D.length,s=[{target:o,content:e(p,{feature:t,currentIndex:a,totalFeatures:i,onSkip:()=>vt(t),onExplore:()=>wt(t),onPrevious:()=>It(t),onNext:()=>Bt(t),setIsClosing:dt}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];q(s)}}))),[U,D]),Bt=i((o=>t(void 0,void 0,void 0,(function*(){const t=o||U;if(!t)return;const n=D.findIndex((e=>e.id===t.id));if(n<D.length-1){const t=D[n+1];W(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,r=document.querySelector(o);if(r)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(r,120)}catch(t){}const a=n+1,i=D.length,s=[{target:o,content:e(p,{feature:t,currentIndex:a,totalFeatures:i,onSkip:()=>vt(t),onExplore:()=>wt(t),onPrevious:()=>It(t),onNext:()=>Bt(t),setIsClosing:dt}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];q(s)}else Z(!0),K(!0),N(t.id),M(!1),W(null),q([]),setTimeout((()=>{Z(!1)}),500)}))),[U,D,N]);return o(n,{children:[b,L.length>0&&e(s,{steps:L,run:_,continuous:!1,showProgress:!1,showSkipButton:!1,callback:St,disableOverlayClose:!0,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:{options:{primaryColor:"#007bff",zIndex:1e4,width:"auto",arrowColor:at?"transparent":"#212121"},overlay:{backgroundColor:"transparent"},spotlight:{backgroundColor:"transparent",border:"none",boxShadow:"none"},tooltip:{borderRadius:"16px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}},`major-joyride-${lt}`),O.length>0&&e(s,{steps:O,run:V,continuous:!1,showProgress:!1,showSkipButton:!1,callback:Ct,disableOverlayClose:!0,disableCloseOnEsc:!1,disableOverlay:!1,scrollToFirstStep:!0,scrollOffset:120,disableScrolling:!1,styles:{options:{primaryColor:"#007bff",zIndex:1e4,width:"auto",arrowColor:st?"transparent":"#ffffff"},overlay:{backgroundColor:"transparent"},spotlight:{backgroundColor:"transparent",borderRadius:"8px",boxShadow:st?"none":"0 0 0 9999px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 20px 8px rgba(255, 255, 255, 0.4)"},tooltip:{borderRadius:"4px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonSkip:{display:"none"},buttonClose:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}},`minor-joyride-${ct}`),e(f,{isOpen:Y,videoUrl:et,onClose:()=>{tt(!1),ot(""),rt(!1);const t=D.find((t=>!ft.has(t.id)));t?setTimeout((()=>{Tt(t,D)}),300):K(!0)}})]})};export{m as default};
1
+ import{__awaiter as t}from"../../_virtual/_tslib.js";import{jsx as e,jsxs as o,Fragment as n}from"react/jsx-runtime";import{useState as r,useEffect as a,useCallback as i}from"react";import s,{ACTIONS as d}from"react-joyride";import"./constants/animations.js";import{SELECTORS as l}from"./constants/selectors.js";import{useFeatureAnnouncements as u}from"./hooks/useFeatureAnnouncements.js";import c from"./MajorUpdatePopup.js";import p from"./MinorUpdatePopup.js";import{VideoModal as f}from"./VideoModal.js";const b=b=>{let{children:m,fetchVisibleFeatures:g,getStoreFeatureProgress:h,fetchFeatureById:y,markFeatureAsViewedForStore:x,isFeatureApplicableToCurrentPage:C,module:S,router:k}=b;var T;const{majorUpdateFeatures:w,minorUpdateFeatures:v,isLoading:B,markFeatureAsViewed:I}=u({fetchVisibleFeatures:g,getStoreFeatureProgress:h,fetchFeatureById:y,markFeatureAsViewedForStore:x,isFeatureApplicableToCurrentPage:C,module:S,router:k}),[F,E]=r(null),[j,N]=r(null),[W,P]=r(!1),[M,O]=r([]),[q,V]=r(!1),[L,R]=r([]),[_,A]=r(!1),[U,$]=r(!1),[z,H]=r([]),[Z,D]=r(!1),[G,J]=r(!1),[K,Q]=r(!1),[X,Y]=r(""),[tt,et]=r(!1),[ot,nt]=r(!1),[rt,at]=r(!1),[it,st]=r(0),[dt,lt]=r(0),[ut,ct]=r(new Set);a((()=>{const t="minor-spotlight-cutout-style";let e=document.getElementById(t);return e||(e=document.createElement("style"),e.id=t,document.head.appendChild(e)),e.textContent="\n\t\t\t.react-joyride__spotlight {\n\t\t\t\ttransition: box-shadow 0.3s ease-in-out !important;\n\t\t\t\twill-change: box-shadow, transform;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t\t.react-joyride__tooltip {\n\t\t\t\twill-change: transform, opacity;\n\t\t\t\ttransform: translateZ(0);\n\t\t\t}\n\t\t",()=>{const e=document.getElementById(t);e&&e.remove()}}),[]),a((()=>{st((t=>t+1)),lt((t=>t+1)),nt(!1),at(!1),ct(new Set)}),[null==k?void 0:k.pathname]),a((()=>{if(!(w.length>0)||F||B||_||tt)0!==w.length||B||J(!0);else{J(!1),D(!1),P(!1),O([]),N(null),H([]);let t=0;const e=10,o=()=>{t++;document.querySelector('[data-testid="whats-new-button"]')?pt(w[0]):t<e?setTimeout(o,1e3):J(!0)};o()}}),[w,F,B,_,tt]),a((()=>{var t;const e=null===(t=null==k?void 0:k.query)||void 0===t?void 0:t.featureId;if(!e||B||0===v.length)return;const o=v.find((t=>t.id===e));if(!o||!o.featureTag)return;D(!0),$(!0);let n=0;const r=setInterval((()=>{n++;const t=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`;if(document.querySelector(t)){const t=[o];H(t),Ct(o,t),clearInterval(r)}else n>=25&&($(!1),clearInterval(r))}),200);return()=>{clearInterval(r)}}),[v,null===(T=null==k?void 0:k.query)||void 0===T?void 0:T.featureId,B]),a((()=>{var t;if(v.length>0&&!B&&!W&&!U&&!j&&!Z&&G&&!tt){let t=null,e=null,o=null,n=!1;const r=()=>{if(n||U||j||Z||!G)return;const r=v.filter((t=>{if(!t.featureTag||""===t.featureTag.trim())return!1;if(ut.has(t.id))return!1;const e=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`;return null!==document.querySelector(e)}));r.length>0&&(H(r),Ct(r[0],r),t&&(t.disconnect(),t=null),e&&(window.removeEventListener("scroll",e),e=null),o&&(clearTimeout(o),o=null))};return t=new MutationObserver((t=>{let e=!1;for(const o of t){if("childList"===o.type&&o.addedNodes.length>0)for(let t=0;t<o.addedNodes.length;t++){const n=o.addedNodes[t];if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(t.id||t.querySelector("[id]")){e=!0;break}}}if(e)break}W||n||U||j||Z||!G||!e||(o&&clearTimeout(o),o=setTimeout((()=>{n||U||j||Z||!G||r()}),200))})),e=()=>{W||n||U||j||Z||!G||(o&&clearTimeout(o),requestAnimationFrame((()=>{o=setTimeout((()=>{n||U||j||Z||!G||r()}),300)})))},t&&t.observe(document.body,{childList:!0,subtree:!0}),e&&window.addEventListener("scroll",e,{passive:!0}),r(),setTimeout((()=>{n||U||j||Z||!G||r()}),100),setTimeout((()=>{n||U||j||Z||!G||r()}),1e3),setTimeout((()=>{n||U||j||Z||!G||r()}),500),()=>{n=!0,t&&t.disconnect(),e&&window.removeEventListener("scroll",e),o&&clearTimeout(o)}}if(0===v.length||B){(null===(t=null==k?void 0:k.query)||void 0===t?void 0:t.featureId)&&j||(P(!1),O([]),N(null),H([]),D(!1))}}),[v,B,W,U,j,Z,G,I,tt]);const pt=t=>{E(t);const o=w.findIndex((e=>e.id===t.id)),n=w.length,r=[{target:l.WHATS_NEW_BUTTON,content:e(c,{feature:t,currentIndex:o,totalFeatures:n,onSkip:()=>ft(t),onExplore:()=>bt(t),onPrevious:()=>mt(t),onNext:()=>gt(t),setIsClosing:nt}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(r),V(!0)},ft=i((t=>{(t||F)&&(A(!0),w.forEach((t=>{I(t.id)})),V(!1),E(null),R([]),J(!0),setTimeout((()=>{A(!1)}),500))}),[F,w,I]),bt=i((t=>{A(!0),I(t.id),t.productVideo&&(Y(t.productVideo),Q(!0),et(!0)),V(!1),E(null),R([]);w.findIndex((e=>e.id===t.id))===w.length-1&&J(!0),setTimeout((()=>{A(!1)}),500)}),[w,I]),mt=i((t=>{const o=t||F;if(!o)return;const n=w.findIndex((t=>t.id===o.id));if(n>0){const t=w[n-1];E(t);const o=n-1,r=w.length,a=[{target:'[data-testid="whats-new-button"]',content:e(c,{feature:t,currentIndex:o,totalFeatures:r,onSkip:()=>ft(t),onExplore:()=>bt(t),onPrevious:()=>mt(t),onNext:()=>gt(t),setIsClosing:nt}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(a)}}),[F,w]),gt=i((t=>{const o=t||F;if(!o)return;const n=w.findIndex((t=>t.id===o.id));if(n<w.length-1){const t=w[n+1];E(t);const o=n+1,r=w.length,a=[{target:'[data-testid="whats-new-button"]',content:e(c,{feature:t,currentIndex:o,totalFeatures:r,onSkip:()=>ft(t),onExplore:()=>bt(t),onPrevious:()=>mt(t),onNext:()=>gt(t),setIsClosing:nt}),placement:"bottom-start",placementBeacon:"top-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMajor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"16px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];R(a)}else A(!0),I(o.id),V(!1),E(null),R([]),J(!0),setTimeout((()=>{A(!1)}),500)}),[F,w,I]),ht=()=>{if(w.length>0&&!F){document.querySelector('[data-testid="whats-new-button"]')&&pt(w[0])}};a((()=>(window.showMajorUpdatePopup=ht,()=>{delete window.showMajorUpdatePopup})),[w,F]);const yt=i((t=>{const{action:e}=t;e===d.CLOSE&&(F&&(A(!0),w.forEach((t=>{I(t.id)})),J(!0),setTimeout((()=>{A(!1)}),500)),V(!1),E(null),R([]))}),[F,w,I]),xt=i((t=>{const{action:e}=t;if(e===d.CLOSE){if(j){$(!0),I(j.id);z.findIndex((t=>t.id===j.id))===z.length-1&&D(!0),setTimeout((()=>{$(!1)}),500)}P(!1),N(null),O([])}}),[j,z,I]),Ct=(o,n)=>t(void 0,void 0,void 0,(function*(){N(o);const t=n||z,r=t.findIndex((t=>t.id===o.id)),a=t.length,i=o.featureTag.startsWith("#")||o.featureTag.startsWith(".")||o.featureTag.startsWith("[")?o.featureTag:`#${o.featureTag}`,s=document.querySelector(i);if(s)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(s,120)}catch(t){}const d=[{target:i,content:e(p,{feature:o,currentIndex:r,totalFeatures:a,onSkip:()=>St(o),onExplore:()=>kt(o),onPrevious:()=>Tt(o),onNext:()=>wt(o),setIsClosing:at}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:o,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];O(d),P(!0)})),St=i((t=>{const e=t||j;if(e){$(!0),I(e.id),ct((t=>new Set(t).add(e.id))),P(!1),N(null),O([]);const t=z.find((t=>t.id!==e.id&&!ut.has(t.id)));setTimeout((()=>{$(!1),t?Ct(t,z):D(!0)}),500)}}),[j,z,I,ut]),kt=i((t=>{$(!0),I(t.id),ct((e=>new Set(e).add(t.id))),t.productVideo&&(Y(t.productVideo),Q(!0),et(!0)),P(!1),N(null),O([]);const e=z.find((e=>e.id!==t.id&&!ut.has(e.id)));setTimeout((()=>{$(!1),e&&!t.productVideo?Ct(e,z):e||D(!0)}),500)}),[z,I,ut]),Tt=i((o=>t(void 0,void 0,void 0,(function*(){const t=o||j;if(!t)return;const n=z.findIndex((e=>e.id===t.id));if(n>0){const t=z[n-1];N(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,r=document.querySelector(o);if(r)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(r,120)}catch(t){}const a=n-1,i=z.length,s=[{target:o,content:e(p,{feature:t,currentIndex:a,totalFeatures:i,onSkip:()=>St(t),onExplore:()=>kt(t),onPrevious:()=>Tt(t),onNext:()=>wt(t),setIsClosing:at}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];O(s)}}))),[j,z]),wt=i((o=>t(void 0,void 0,void 0,(function*(){const t=o||j;if(!t)return;const n=z.findIndex((e=>e.id===t.id));if(n<z.length-1){const t=z[n+1];N(t);const o=t.featureTag.startsWith("#")||t.featureTag.startsWith(".")||t.featureTag.startsWith("[")?t.featureTag:`#${t.featureTag}`,r=document.querySelector(o);if(r)try{const{scrollToElementSmooth:t}=yield import("./utils/elementHelpers.js");yield t(r,120)}catch(t){}const a=n+1,i=z.length,s=[{target:o,content:e(p,{feature:t,currentIndex:a,totalFeatures:i,onSkip:()=>St(t),onExplore:()=>kt(t),onPrevious:()=>Tt(t),onNext:()=>wt(t),setIsClosing:at}),placement:"bottom",placementBeacon:"bottom-end",disableBeacon:!0,hideCloseButton:!0,hideSkipButton:!0,hideFooter:!0,offset:0,data:{feature:t,isMinor:!0},styles:{tooltip:{padding:0,backgroundColor:"transparent",borderRadius:"4px",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}}}];O(s)}else $(!0),D(!0),I(t.id),P(!1),N(null),O([]),setTimeout((()=>{$(!1)}),500)}))),[j,z,I]);return o(n,{children:[m,L.length>0&&e(s,{steps:L,run:q,continuous:!1,showProgress:!1,showSkipButton:!1,callback:yt,disableOverlayClose:!0,disableCloseOnEsc:!1,disableOverlay:!1,spotlightClicks:!1,styles:{options:{primaryColor:"#007bff",zIndex:1e4,width:"auto",arrowColor:ot?"transparent":"#212121"},overlay:{backgroundColor:"transparent"},spotlight:{backgroundColor:"transparent",border:"none",boxShadow:"none"},tooltip:{borderRadius:"16px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonClose:{display:"none"},buttonSkip:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}},`major-joyride-${it}`),M.length>0&&e(s,{steps:M,run:W,continuous:!1,showProgress:!1,showSkipButton:!1,callback:xt,disableOverlayClose:!0,disableCloseOnEsc:!1,disableOverlay:!1,scrollToFirstStep:!0,scrollOffset:120,disableScrolling:!1,styles:{options:{primaryColor:"#007bff",zIndex:1e4,width:"auto",arrowColor:rt?"transparent":"#ffffff"},overlay:{backgroundColor:"transparent"},spotlight:{backgroundColor:"transparent",borderRadius:"8px",boxShadow:rt?"none":"0 0 0 9999px rgba(0, 0, 0, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 20px 8px rgba(255, 255, 255, 0.4)"},tooltip:{borderRadius:"4px",fontSize:"14px",padding:0,backgroundColor:"transparent",border:"none",filter:"none",boxShadow:"none"},tooltipContent:{padding:0},buttonNext:{display:"none"},buttonBack:{display:"none"},buttonSkip:{display:"none"},buttonClose:{display:"none"}},locale:{back:"Back",close:"Close",last:"Close",next:"Next",skip:"Skip"}},`minor-joyride-${dt}`),e(f,{isOpen:K,videoUrl:X,onClose:()=>{Q(!1),Y(""),et(!1);const t=z.find((t=>!ut.has(t.id)));t?setTimeout((()=>{Ct(t,z)}),300):D(!0)}})]})};export{b as default};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as e,Fragment as n}from"react/jsx-runtime";import{useState as r,useRef as o,useEffect as s}from"react";import{TEXT as a}from"./constants/index.js";import{getMajorPopupStyles as i}from"./styles/majorPopup.styles.js";import"../../constants/Theme.js";import"./constants/animations.js";import{decodeHTMLEntities as l}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as c,calculateCloseTransform as u,executeAfterAnimation as d}from"./utils/animationHelpers.js";import{findWhatsNewButton as p}from"./utils/elementHelpers.js";const g=g=>{let{feature:y,currentIndex:b,totalFeatures:h,onSkip:v,onExplore:j,onPrevious:f,onNext:m,setIsClosing:B,onSecondaryAction:O,ratio:k="16:9",padding:T}=g;const[x,w]=r(!1),[L,E]=r(!1),[C,M]=r(""),P=o(null),[U,_]=r(!1),[W,I]=r(!0),D=o(null);s((()=>{x&&E(!0)}),[x]);const S=()=>{j(),c(P.current);const t=p();if(t&&P.current){const e=u(P.current,t);M(e)}else M("scale(0)");null==B||B(!0),w(!0)},A=t=>{if(t.preventDefault(),t.stopPropagation(),y.secondaryButtonUrl){y.secondaryButtonUrl.startsWith("http")?window.open(y.secondaryButtonUrl,"_blank","noopener,noreferrer"):window.location.href=y.secondaryButtonUrl}O&&O(),c(P.current);const e=p();if(e&&P.current){const t=u(P.current,e);M(t)}else M("scale(0)");null==B||B(!0),w(!0)},H=i(L,C,k,T||y.padding,y.primaryButtonStyle,y.secondaryButtonStyle),F=t=>{t.stopPropagation(),D.current&&(D.current.paused?(D.current.play(),_(!1),I(!1)):(D.current.pause(),_(!0),I(!0)))};return t("div",Object.assign({ref:P,style:H.container},{children:[e("style",{children:"\n\t\t\t\t[data-popup-content] ul {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t\tpadding-left: 20px;\n\t\t\t\t\tlist-style-type: disc;\n\t\t\t\t}\n\t\t\t\t[data-popup-content] ul li {\n\t\t\t\t\tmargin-bottom: 8px;\n\t\t\t\t\tcolor: rgba(255, 255, 255, 0.8);\n\t\t\t\t\tfont-size: 12px;\n\t\t\t\t\tline-height: 16px;\n\t\t\t\t\tfont-family: Inter, sans-serif;\n\t\t\t\t}\n\t\t\t"}),t("div",Object.assign({style:H.contentWrapper},{children:[e("div",Object.assign({style:H.imageContainer},{children:y.productVideo?t(n,{children:[e("video",{ref:D,src:y.productVideo,style:H.image,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,onClick:F,onPlay:()=>{I(!1)},onPause:()=>{I(!0)},"aria-label":`Product video for ${y.title}`}),(U||W)&&e("div",Object.assign({style:H.videoOverlay,onClick:F,role:"button",tabIndex:0,"aria-label":U?"Play video":"Pause video",onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),D.current&&(D.current.paused?(D.current.play(),_(!1),I(!1)):(D.current.pause(),_(!0),I(!0))))}},{children:e((()=>t("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",strokeLinecap:"round",strokeLinejoin:"round",style:H.playIcon},{children:[e("circle",{cx:"12",cy:"12",r:"10",fill:"rgba(0,0,0,0.5)",stroke:"none"}),e("polygon",{points:"10 8 16 12 10 16 10 8",fill:"#fff",stroke:"none"})]}))),{})}))]}):y.displayImage?e("img",{src:y.displayImage,alt:y.title,style:H.image,onError:t=>{y.image&&(t.target.src=y.image)}}):e("div",Object.assign({style:H.imagePlaceholder},{children:a.FEATURE_PREVIEW_PLACEHOLDER}))})),t("div",Object.assign({style:H.contentContainer},{children:[e("div",Object.assign({style:H.skipButtonContainer},{children:e("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),(t=>{c(P.current);const e=p();if(e&&P.current){const t=u(P.current,e);M(t)}else M("scale(0)");null==B||B(!0),w(!0),d(t)})(v)},style:H.skipButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,H.skipButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,H.skipButton.base),"aria-label":"Skip feature announcement"},{children:"Skip"}))})),e("h3",Object.assign({style:H.title},{children:y.title})),e("div",{"data-popup-content":!0,style:H.content,dangerouslySetInnerHTML:{__html:l(y.content||y.body||"")}}),t("div",Object.assign({style:H.actionsWrapper},{children:[t("div",Object.assign({style:H.buttonsGroup},{children:[y.redirectUrl?e("a",Object.assign({href:y.redirectUrl,target:y.redirectUrl.startsWith("http")?"_blank":"_self",rel:y.redirectUrl.startsWith("http")?"noopener noreferrer":void 0,onClick:S,style:H.exploreButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,H.exploreButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,H.exploreButton.base)},{children:y.buttonText||a.DEFAULT_BUTTON_TEXT})):e("button",Object.assign({onClick:S,style:H.exploreButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,H.exploreButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,H.exploreButton.base)},{children:y.buttonText||a.DEFAULT_BUTTON_TEXT})),y.secondaryButtonText&&(y.secondaryButtonUrl?e("a",Object.assign({href:y.secondaryButtonUrl,target:y.secondaryButtonUrl.startsWith("http")?"_blank":"_self",rel:y.secondaryButtonUrl.startsWith("http")?"noopener noreferrer":void 0,onClick:A,style:H.secondaryButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,H.secondaryButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,H.secondaryButton.base)},{children:y.secondaryButtonText})):e("button",Object.assign({onClick:A,style:H.secondaryButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,H.secondaryButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,H.secondaryButton.base)},{children:y.secondaryButtonText})))]})),h>1&&t("div",Object.assign({style:H.navigationContainer},{children:[e("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),f()},disabled:0===b,style:H.navigationButton(0===b).base,onMouseEnter:t=>{0!==b&&Object.assign(t.currentTarget.style,H.navigationButton(!1).hover)},onMouseLeave:t=>{0!==b&&Object.assign(t.currentTarget.style,H.navigationButton(!1).base)}},{children:e("svg",Object.assign({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))})),e("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),m()},disabled:b===h-1,style:H.navigationButton(b===h-1).base,onMouseEnter:t=>{b!==h-1&&Object.assign(t.currentTarget.style,H.navigationButton(!1).hover)},onMouseLeave:t=>{b!==h-1&&Object.assign(t.currentTarget.style,H.navigationButton(b===h-1).base)}},{children:e("svg",Object.assign({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}))}))]}))]}))]}))]}))]}))};export{g as default};
1
+ import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useState as n,useRef as s,useEffect as o}from"react";import{TEXT as r}from"./constants/index.js";import{getMajorPopupStyles as i}from"./styles/majorPopup.styles.js";import"../../constants/Theme.js";import"./constants/animations.js";import{decodeHTMLEntities as a}from"./utils/htmlHelpers.js";import{hideJoyrideArrow as l,calculateCloseTransform as c,executeAfterAnimation as u}from"./utils/animationHelpers.js";import{findWhatsNewButton as g}from"./utils/elementHelpers.js";const b=b=>{let{feature:p,currentIndex:m,totalFeatures:d,onSkip:j,onExplore:v,onPrevious:y,onNext:O,setIsClosing:T}=b;const[h,E]=n(!1),[f,B]=n(!1),[I,x]=n(""),P=s(null);o((()=>{h&&B(!0)}),[h]);const C=i(f,I);return t("div",Object.assign({ref:P,style:C.container},{children:[e("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),(t=>{l(P.current);const e=g();if(e&&P.current){const t=c(P.current,e);x(t)}else x("scale(0)");null==T||T(!0),E(!0),u(t)})(j)},style:C.skipButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,C.skipButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,C.skipButton.base)},{children:r.SKIP_BUTTON})),e("div",Object.assign({style:C.imageContainer},{children:p.displayImage?e("img",{src:p.displayImage,alt:p.title,style:C.image,onError:t=>{p.image&&(t.target.src=p.image)}}):e("div",Object.assign({style:C.imagePlaceholder},{children:r.FEATURE_PREVIEW_PLACEHOLDER}))})),t("div",Object.assign({style:C.contentContainer},{children:[t("div",{children:[e("h3",Object.assign({style:C.title},{children:p.title})),e("div",{style:C.content,dangerouslySetInnerHTML:{__html:a(p.content||p.body||"")}}),e("button",Object.assign({onClick:()=>{v(),l(P.current);const t=g();if(t&&P.current){const e=c(P.current,t);x(e)}else x("scale(0)");null==T||T(!0),E(!0)},style:C.exploreButton.base,onMouseEnter:t=>Object.assign(t.currentTarget.style,C.exploreButton.hover),onMouseLeave:t=>Object.assign(t.currentTarget.style,C.exploreButton.base)},{children:p.buttonText||r.DEFAULT_BUTTON_TEXT}))]}),d>1&&t("div",Object.assign({style:C.navigationContainer},{children:[e("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),y()},disabled:0===m,style:C.navigationButton(0===m).base,onMouseEnter:t=>{0!==m&&Object.assign(t.currentTarget.style,C.navigationButton(!1).hover)},onMouseLeave:t=>{0!==m&&Object.assign(t.currentTarget.style,C.navigationButton(!1).base)}},{children:r.NAVIGATION_PREVIOUS})),e("button",Object.assign({onClick:t=>{t.preventDefault(),t.stopPropagation(),O()},disabled:m===d-1,style:C.navigationButton(m===d-1).base,onMouseEnter:t=>{m!==d-1&&Object.assign(t.currentTarget.style,C.navigationButton(!1).hover)},onMouseLeave:t=>{m!==d-1&&Object.assign(t.currentTarget.style,C.navigationButton(m===d-1).base)}},{children:r.NAVIGATION_NEXT}))]}))]}))]}))};export{b as default};
@@ -1,12 +1,16 @@
1
+ /**
2
+ * Popup dimension constants
3
+ */
1
4
  export declare const POPUP_DIMENSIONS: {
2
5
  readonly MAJOR: {
3
- readonly height: 224;
4
- readonly textAreaWidth: 398;
5
- readonly imageWidth: {
6
- readonly '16:9': 398;
7
- readonly '1:1': 224;
8
- readonly '4:3': 299;
9
- };
6
+ readonly width: 959;
7
+ readonly height: 274;
8
+ readonly imageWidth: 480;
9
+ readonly imageHeight: 274;
10
+ readonly imageInnerWidth: 464;
11
+ readonly imageInnerHeight: 258;
12
+ readonly imagePlaceholderWidth: 290;
13
+ readonly imagePlaceholderHeight: 258;
10
14
  };
11
15
  readonly MINOR: {
12
16
  readonly width: 519;
@@ -16,41 +20,20 @@ export declare const POPUP_DIMENSIONS: {
16
20
  readonly badgeHeight: 27;
17
21
  };
18
22
  };
19
- export declare const TEXT_LIMITS: {
20
- readonly MAJOR: {
21
- readonly TITLE: {
22
- readonly MAX_LINES: 2;
23
- };
24
- readonly CONTENT: {
25
- readonly MAX_LINES: 4;
26
- readonly MAX_CHARS: 360;
27
- readonly CHARS_PER_LINE: 72;
28
- };
29
- };
30
- };
31
23
  /**
32
24
  * Spacing constants
33
25
  */
34
26
  export declare const SPACING: {
35
27
  readonly MAJOR: {
36
- readonly containerPadding: "16px";
37
- readonly contentGap: "16px";
38
- readonly titleBottom: "0px";
39
- readonly listGap: "8px";
40
- readonly actionsTop: "16px";
41
- readonly headerMarginBottom: "8px";
42
- readonly contentMarginLeft: "0px";
43
- readonly skipButtonContainerMargin: "8px";
44
- readonly contentMargin: "0 0 0 0px";
45
- readonly imagePadding: "0px";
46
- readonly titlePadding: "0 0 0px 0";
47
- readonly buttonMarginTop: "0px";
48
- readonly skipButtonPadding: "2px 4px";
49
- readonly skipButtonTop: "8px";
50
- readonly skipButtonRight: "8px";
51
- readonly navigationBottom: "0px";
52
- readonly navigationRight: "0px";
53
- readonly navigationGap: "4px";
28
+ readonly contentMargin: "0 8px 0 0";
29
+ readonly imagePadding: "8px";
30
+ readonly titlePadding: "36px 0 0 0";
31
+ readonly buttonMarginTop: "16px";
32
+ readonly skipButtonTop: "10px";
33
+ readonly skipButtonRight: "10px";
34
+ readonly navigationBottom: "16px";
35
+ readonly navigationRight: "16px";
36
+ readonly navigationGap: "8px";
54
37
  };
55
38
  readonly MINOR: {
56
39
  readonly imageMargin: "13px 10px 13px 10px";
@@ -60,71 +43,14 @@ export declare const SPACING: {
60
43
  readonly actionsGap: "16px";
61
44
  };
62
45
  };
46
+ /**
47
+ * Border radius constants
48
+ */
63
49
  export declare const BORDER_RADIUS: {
64
- readonly POPUP: "8px";
65
- readonly IMAGE: "6px";
50
+ readonly POPUP: "4px";
51
+ readonly IMAGE: "4px";
66
52
  readonly BUTTON: "4px";
67
53
  readonly VIDEO_MODAL: "12px";
68
54
  readonly CLOSE_BUTTON: "50%";
69
55
  readonly SPOTLIGHT: "8px";
70
56
  };
71
- /**
72
- * Design tokens - Colors
73
- */
74
- export declare const DESIGN_COLORS: {
75
- readonly BACKGROUND: {
76
- readonly SURFACE: "#212121";
77
- readonly IMAGE: "#F0F0F0";
78
- };
79
- readonly TEXT: {
80
- readonly PRIMARY: "#FFFFFF";
81
- readonly SECONDARY: "rgba(255, 255, 255, 0.8)";
82
- readonly TERTIARY: "#BDBDBD";
83
- };
84
- readonly BUTTON: {
85
- readonly PRIMARY_TEXT: "#FEC02D";
86
- readonly PRIMARY_BORDER: "#FEC02D";
87
- };
88
- readonly ICON: {
89
- readonly DISABLED: "rgba(255, 255, 255, 0.3)";
90
- readonly ENABLED: "#FFFFFF";
91
- };
92
- };
93
- /**
94
- * Design tokens - Typography
95
- */
96
- export declare const DESIGN_TYPOGRAPHY: {
97
- readonly SKIP_BUTTON: {
98
- readonly fontSize: "14px";
99
- readonly fontWeight: "600";
100
- readonly lineHeight: "20px";
101
- readonly fontFamily: "Inter, sans-serif";
102
- };
103
- readonly TITLE: {
104
- readonly fontSize: "14px";
105
- readonly fontWeight: "600";
106
- readonly lineHeight: "20px";
107
- readonly fontFamily: "Inter, sans-serif";
108
- };
109
- readonly CONTENT: {
110
- readonly fontSize: "12px";
111
- readonly fontWeight: "400";
112
- readonly lineHeight: "16px";
113
- readonly fontFamily: "Inter, sans-serif";
114
- };
115
- readonly BUTTON: {
116
- readonly fontSize: "14px";
117
- readonly fontWeight: "600";
118
- readonly lineHeight: "20px";
119
- readonly fontFamily: "Inter, sans-serif";
120
- };
121
- };
122
- /**
123
- * Design tokens - Dimensions
124
- */
125
- export declare const DESIGN_DIMENSIONS: {
126
- readonly IMAGE_HEIGHT: 224;
127
- readonly NAVIGATION_BUTTON_SIZE: 24;
128
- readonly BUTTON_HEIGHT: 32;
129
- readonly BUTTON_PADDING_HORIZONTAL: "12px";
130
- };
@@ -1 +1 @@
1
- const t={MAJOR:{height:224,textAreaWidth:398,imageWidth:{"16:9":398,"1:1":224,"4:3":299}},MINOR:{width:519,height:160,imageWidth:235,imageHeight:134,badgeHeight:27}},i={MAJOR:{containerPadding:"16px",contentGap:"16px",titleBottom:"0px",listGap:"8px",actionsTop:"16px",headerMarginBottom:"8px",contentMarginLeft:"0px",skipButtonContainerMargin:"8px",contentMargin:"0 0 0 0px",imagePadding:"0px",titlePadding:"0 0 0px 0",buttonMarginTop:"0px",skipButtonPadding:"2px 4px",skipButtonTop:"8px",skipButtonRight:"8px",navigationBottom:"0px",navigationRight:"0px",navigationGap:"4px"},MINOR:{imageMargin:"13px 10px 13px 10px",contentMargin:"13px 13px 13px 3px",actionsBottom:"13px",actionsRight:"10px",actionsGap:"16px"}},n={POPUP:"8px",IMAGE:"6px",BUTTON:"4px",VIDEO_MODAL:"12px",CLOSE_BUTTON:"50%",SPOTLIGHT:"8px"},p={BACKGROUND:{SURFACE:"#212121",IMAGE:"#F0F0F0"},TEXT:{PRIMARY:"#FFFFFF",SECONDARY:"rgba(255, 255, 255, 0.8)",TERTIARY:"#BDBDBD"},BUTTON:{PRIMARY_TEXT:"#FEC02D",PRIMARY_BORDER:"#FEC02D"},ICON:{DISABLED:"rgba(255, 255, 255, 0.3)",ENABLED:"#FFFFFF"}},e={SKIP_BUTTON:{fontSize:"14px",fontWeight:"600",lineHeight:"20px",fontFamily:"Inter, sans-serif"},TITLE:{fontSize:"14px",fontWeight:"600",lineHeight:"20px",fontFamily:"Inter, sans-serif"},CONTENT:{fontSize:"12px",fontWeight:"400",lineHeight:"16px",fontFamily:"Inter, sans-serif"},BUTTON:{fontSize:"14px",fontWeight:"600",lineHeight:"20px",fontFamily:"Inter, sans-serif"}},x={IMAGE_HEIGHT:224,NAVIGATION_BUTTON_SIZE:24,BUTTON_HEIGHT:32,BUTTON_PADDING_HORIZONTAL:"12px"};export{n as BORDER_RADIUS,p as DESIGN_COLORS,x as DESIGN_DIMENSIONS,e as DESIGN_TYPOGRAPHY,t as POPUP_DIMENSIONS,i as SPACING};
1
+ const i={MAJOR:{width:959,height:274,imageWidth:480,imageHeight:274,imageInnerWidth:464,imageInnerHeight:258,imagePlaceholderWidth:290,imagePlaceholderHeight:258},MINOR:{width:519,height:160,imageWidth:235,imageHeight:134,badgeHeight:27}},t={MAJOR:{contentMargin:"0 8px 0 0",imagePadding:"8px",titlePadding:"36px 0 0 0",buttonMarginTop:"16px",skipButtonTop:"10px",skipButtonRight:"10px",navigationBottom:"16px",navigationRight:"16px",navigationGap:"8px"},MINOR:{imageMargin:"13px 10px 13px 10px",contentMargin:"13px 13px 13px 3px",actionsBottom:"13px",actionsRight:"10px",actionsGap:"16px"}},p={POPUP:"4px",IMAGE:"4px",BUTTON:"4px",VIDEO_MODAL:"12px",CLOSE_BUTTON:"50%",SPOTLIGHT:"8px"};export{p as BORDER_RADIUS,i as POPUP_DIMENSIONS,t as SPACING};
@@ -27,7 +27,7 @@ export declare const minorStepStyles: {
27
27
  tooltip: {
28
28
  padding: number;
29
29
  backgroundColor: string;
30
- borderRadius: "8px";
30
+ borderRadius: "4px";
31
31
  border: string;
32
32
  filter: string;
33
33
  boxShadow: string;
@@ -101,7 +101,7 @@ export declare const getMinorJoyrideStyles: (isClosing: boolean) => {
101
101
  tooltip: {
102
102
  padding: number;
103
103
  backgroundColor: string;
104
- borderRadius: "8px";
104
+ borderRadius: "4px";
105
105
  border: string;
106
106
  filter: string;
107
107
  boxShadow: string;
@@ -1,9 +1,6 @@
1
1
  import { CSSProperties } from 'react';
2
- import { ButtonStyle } from '../types/feature.types';
3
- export declare const getMajorPopupStyles: (startAnimation: boolean, transform: string, ratio?: '16:9' | '1:1' | '4:3', padding?: string, primaryButtonStyle?: ButtonStyle, secondaryButtonStyle?: ButtonStyle) => {
2
+ export declare const getMajorPopupStyles: (startAnimation: boolean, transform: string) => {
4
3
  container: CSSProperties;
5
- headerContainer: CSSProperties;
6
- contentWrapper: CSSProperties;
7
4
  skipButton: {
8
5
  base: CSSProperties;
9
6
  hover: CSSProperties;
@@ -11,29 +8,16 @@ export declare const getMajorPopupStyles: (startAnimation: boolean, transform: s
11
8
  imageContainer: CSSProperties;
12
9
  image: CSSProperties;
13
10
  imagePlaceholder: CSSProperties;
14
- videoOverlay: CSSProperties;
15
- playIcon: CSSProperties;
16
11
  contentContainer: CSSProperties;
17
- skipButtonContainer: CSSProperties;
18
12
  title: CSSProperties;
19
13
  content: CSSProperties;
20
- actionsWrapper: CSSProperties;
21
- buttonsGroup: CSSProperties;
22
14
  exploreButton: {
23
15
  base: CSSProperties;
24
16
  hover: CSSProperties;
25
17
  };
26
- secondaryButton: {
27
- base: CSSProperties;
28
- hover: CSSProperties;
29
- };
30
18
  navigationContainer: CSSProperties;
31
19
  navigationButton: (disabled: boolean) => {
32
20
  base: CSSProperties;
33
- hover: {
34
- backgroundColor: string;
35
- } | {
36
- backgroundColor?: undefined;
37
- };
21
+ hover: CSSProperties;
38
22
  };
39
23
  };
@@ -1 +1 @@
1
- import{BASE_COLORS as t}from"../../../constants/Theme.js";import{POPUP_TRANSITION as o}from"../constants/animations.js";import{SPACING as n,POPUP_DIMENSIONS as e,DESIGN_COLORS as i,BORDER_RADIUS as r,DESIGN_TYPOGRAPHY as a,DESIGN_DIMENSIONS as l}from"../constants/dimensions.js";const d=(t,o)=>Object.assign(Object.assign(Object.assign(Object.assign({},t),(null==o?void 0:o.textColor)&&{color:o.textColor}),(null==o?void 0:o.backgroundColor)&&{backgroundColor:o.backgroundColor}),(null==o?void 0:o.borderColor)&&{borderColor:o.borderColor}),g=function(g,s){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"16:9",T=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.MAJOR.containerPadding,p=arguments.length>4?arguments[4]:void 0,f=arguments.length>5?arguments[5]:void 0;const h=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"16:9";return e.MAJOR.imageWidth[t]||e.MAJOR.imageWidth["16:9"]}(c),u=parseInt(T,10)||16,O=l.IMAGE_HEIGHT+2*u;return{container:{width:`${u+h+parseInt(n.MAJOR.contentGap,10)+e.MAJOR.textAreaWidth+u}px`,height:"auto",minHeight:`${O}px`,display:"flex",flexDirection:"column",backgroundColor:i.BACKGROUND.SURFACE,borderRadius:r.BUTTON,overflow:"hidden",position:"relative",padding:T,transform:g?s:"scale(1)",opacity:g?0:1,transition:o,boxSizing:"border-box"},headerContainer:{width:"100%",display:"flex",justifyContent:"flex-end",marginBottom:n.MAJOR.headerMarginBottom,position:"relative"},contentWrapper:{display:"flex",flex:1,gap:n.MAJOR.contentGap},skipButton:{base:{background:"transparent",border:"none",color:i.TEXT.TERTIARY,fontSize:a.SKIP_BUTTON.fontSize,fontWeight:a.SKIP_BUTTON.fontWeight,cursor:"pointer",transition:"all 0.2s",padding:n.MAJOR.skipButtonPadding,borderRadius:r.BUTTON,fontFamily:a.SKIP_BUTTON.fontFamily,lineHeight:a.SKIP_BUTTON.lineHeight},hover:{backgroundColor:"rgba(255, 255, 255, 0.1)",color:i.TEXT.PRIMARY}},imageContainer:{backgroundColor:i.BACKGROUND.IMAGE,width:`${h}px`,height:`${l.IMAGE_HEIGHT}px`,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:r.BUTTON,overflow:"hidden",flexShrink:0},image:{width:"100%",height:"100%",objectFit:"cover"},imagePlaceholder:{color:t.grayscale[500],fontSize:"14px",textAlign:"center",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t.grayscale[800]},videoOverlay:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.4)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,transition:"opacity 0.2s"},playIcon:{width:"84px",height:"84px",color:"#060606ff"},contentContainer:{flex:1,display:"flex",marginLeft:n.MAJOR.contentMarginLeft,flexDirection:"column",justifyContent:"flex-start",background:"transparent",maxWidth:`${e.MAJOR.textAreaWidth}px`,gap:n.MAJOR.listGap},skipButtonContainer:{width:"100%",display:"flex",justifyContent:"flex-end",marginBottom:n.MAJOR.skipButtonContainerMargin},title:{fontSize:a.TITLE.fontSize,fontWeight:a.TITLE.fontWeight,marginBottom:n.MAJOR.titleBottom,padding:0,color:i.TEXT.PRIMARY,lineHeight:a.TITLE.lineHeight,textAlign:"left",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",fontFamily:a.TITLE.fontFamily},content:{fontSize:a.CONTENT.fontSize,lineHeight:a.CONTENT.lineHeight,color:i.TEXT.SECONDARY,textAlign:"left",marginBottom:"auto",fontFamily:a.CONTENT.fontFamily,fontWeight:a.CONTENT.fontWeight},actionsWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",marginRight:n.MAJOR.actionsTop,gap:"8px",flexWrap:"nowrap"},buttonsGroup:{display:"flex",alignItems:"center",gap:n.MAJOR.listGap},exploreButton:{base:d({backgroundColor:"transparent",border:`1px solid ${i.BUTTON.PRIMARY_BORDER}`,color:i.BUTTON.PRIMARY_TEXT,borderRadius:r.BUTTON,fontSize:a.BUTTON.fontSize,fontWeight:a.BUTTON.fontWeight,cursor:"pointer",padding:`0 ${l.BUTTON_PADDING_HORIZONTAL}`,height:`${l.BUTTON_HEIGHT}px`,transition:"all 0.2s",textAlign:"center",minWidth:"auto",textDecoration:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:a.BUTTON.fontFamily,lineHeight:a.BUTTON.lineHeight},p),hover:{backgroundColor:(null==p?void 0:p.backgroundColor)?`${p.backgroundColor}cc`:"rgba(254, 192, 45, 0.1)"}},secondaryButton:{base:d({backgroundColor:"transparent",color:i.BUTTON.PRIMARY_TEXT,borderRadius:r.BUTTON,fontSize:a.BUTTON.fontSize,fontWeight:a.BUTTON.fontWeight,cursor:"pointer",padding:`0 ${l.BUTTON_PADDING_HORIZONTAL}`,height:`${l.BUTTON_HEIGHT}px`,transition:"all 0.2s",textAlign:"center",minWidth:"auto",textDecoration:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:a.BUTTON.fontFamily,lineHeight:a.BUTTON.lineHeight},f),hover:{backgroundColor:(null==f?void 0:f.backgroundColor)?`${f.backgroundColor}cc`:"rgba(254, 192, 45, 0.1)"}},navigationContainer:{display:"flex",gap:n.MAJOR.navigationGap,alignItems:"center"},navigationButton:t=>({base:{width:`${l.NAVIGATION_BUTTON_SIZE}px`,height:`${l.NAVIGATION_BUTTON_SIZE}px`,backgroundColor:"transparent",border:"none",color:t?i.ICON.DISABLED:i.ICON.ENABLED,fontSize:"16px",cursor:t?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",borderRadius:r.BUTTON,padding:0},hover:t?{}:{backgroundColor:"rgba(255, 255, 255, 0.1)"}})}};export{g as getMajorPopupStyles};
1
+ import{BASE_COLORS as t}from"../../../constants/Theme.js";import{POPUP_TRANSITION as e}from"../constants/animations.js";import{POPUP_DIMENSIONS as n,BORDER_RADIUS as i,SPACING as o}from"../constants/dimensions.js";import{Z_INDEX as a}from"../constants/zIndex.js";const r=(r,l)=>({container:{width:`${n.MAJOR.width}px`,height:`${n.MAJOR.height}px`,display:"flex",backgroundColor:t.grayscale[900],borderRadius:i.POPUP,overflow:"hidden",position:"relative",transform:r?l:"scale(1)",opacity:r?0:1,transition:e},skipButton:{base:{position:"absolute",top:o.MAJOR.skipButtonTop,right:o.MAJOR.skipButtonRight,background:"transparent",border:"none",color:t.grayscale[400],fontSize:"14px",fontWeight:"500",cursor:"pointer",zIndex:a.SKIP_BUTTON,transition:"all 0.2s"},hover:{backgroundColor:t.grayscale[100],color:t.grayscale[700]}},imageContainer:{backgroundColor:t.grayscale[900],width:`${n.MAJOR.imageWidth}px`,height:`${n.MAJOR.imageHeight}px`,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:o.MAJOR.imagePadding},image:{width:`${n.MAJOR.imageInnerWidth}px`,height:`${n.MAJOR.imageInnerHeight}px`,objectFit:"cover"},imagePlaceholder:{color:t.grayscale[500],fontSize:"14px",textAlign:"center",width:`${n.MAJOR.imagePlaceholderWidth}px`,height:`${n.MAJOR.imagePlaceholderHeight}px`,display:"flex",alignItems:"center",justifyContent:"center"},contentContainer:{flex:1,display:"flex",margin:o.MAJOR.contentMargin,flexDirection:"column",justifyContent:"space-between",background:"transparent"},title:{fontSize:"16px",fontWeight:"600",padding:o.MAJOR.titlePadding,color:t.grayscale.white,lineHeight:"1.25",textAlign:"left"},content:{fontSize:"14px",lineHeight:"1.5",color:"rgba(255, 255, 255, 0.8)",textAlign:"left"},exploreButton:{base:{backgroundColor:"transparent",border:`1px solid ${t.warning[500]}`,color:t.warning[500],borderRadius:i.BUTTON,fontSize:"14px",fontWeight:"600",cursor:"pointer",width:"154px",height:"32px",transition:"all 0.2s",textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",marginTop:o.MAJOR.buttonMarginTop},hover:{backgroundColor:"rgba(254, 192, 45, 0.1)"}},navigationContainer:{position:"absolute",bottom:o.MAJOR.navigationBottom,right:o.MAJOR.navigationRight,display:"flex",gap:o.MAJOR.navigationGap,alignItems:"center"},navigationButton:e=>({base:{width:"24px",height:"24px",backgroundColor:"transparent",border:"none",color:e?t.grayscale[700]:t.grayscale.white,fontSize:"20px",cursor:e?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},hover:{color:t.warning[500]}})});export{r as getMajorPopupStyles};
@@ -5,14 +5,6 @@ export interface FirestoreTimestamp {
5
5
  seconds: number;
6
6
  nanoseconds?: number;
7
7
  }
8
- /**
9
- * Button styling configuration
10
- */
11
- export interface ButtonStyle {
12
- textColor?: string;
13
- backgroundColor?: string;
14
- borderColor?: string;
15
- }
16
8
  /**
17
9
  * Feature announcement data model
18
10
  */
@@ -35,11 +27,6 @@ export interface FeatureAnnouncement {
35
27
  archived?: boolean;
36
28
  createdAt: FirestoreTimestamp;
37
29
  expirationDate?: FirestoreTimestamp | string | Date;
38
- primaryButtonStyle?: ButtonStyle;
39
- secondaryButtonText?: string;
40
- secondaryButtonUrl?: string;
41
- secondaryButtonStyle?: ButtonStyle;
42
- padding?: string;
43
30
  }
44
31
  /**
45
32
  * Store feature progress tracking
@@ -52,21 +39,3 @@ export interface StoreFeatureProgress {
52
39
  * Feature update types
53
40
  */
54
41
  export type FeatureUpdateType = 'Major' | 'Minor';
55
- /**
56
- * Announcement event data (for tracking when announcement is shown)
57
- */
58
- export interface AnnouncementEvent {
59
- storeId: string;
60
- announcementId: string;
61
- announcementTitle: string;
62
- imageUrl?: string;
63
- videoUrl?: string;
64
- }
65
- /**
66
- * Announcement interaction event data (for tracking button clicks)
67
- */
68
- export interface AnnouncementInteractionEvent extends AnnouncementEvent {
69
- buttonClicked: 'Primary' | 'Secondary' | 'Skip';
70
- buttonName: string;
71
- buttonUrl?: string;
72
- }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { AnnouncementEvent, AnnouncementInteractionEvent, FeatureAnnouncement } from './feature.types';
2
+ import { FeatureAnnouncement } from './feature.types';
3
3
  import { FeatureAnnouncementRepository } from './repository.types';
4
4
  import { RouterProps } from './router.types';
5
5
  /**
@@ -14,27 +14,17 @@ export interface PopupBaseProps {
14
14
  onPrevious: () => void;
15
15
  onNext: () => void;
16
16
  setIsClosing?: (isClosing: boolean) => void;
17
- onSecondaryAction?: () => void;
18
17
  }
19
18
  /**
20
19
  * Major update popup props
21
20
  */
22
21
  export interface MajorUpdatePopupProps extends PopupBaseProps {
23
- /**
24
- * Aspect ratio for the image/video container
25
- * @default '16:9'
26
- */
27
- ratio?: '16:9' | '1:1' | '4:3';
28
- /**
29
- * Custom padding for the popup container
30
- * @default '16px'
31
- */
32
- padding?: string;
33
22
  }
34
23
  /**
35
24
  * Minor update popup props
36
25
  */
37
- export type MinorUpdatePopupProps = PopupBaseProps;
26
+ export interface MinorUpdatePopupProps extends PopupBaseProps {
27
+ }
38
28
  /**
39
29
  * Video modal props
40
30
  */
@@ -50,16 +40,4 @@ export interface FeatureAnnouncementProviderProps extends FeatureAnnouncementRep
50
40
  children: React.ReactNode;
51
41
  module?: string;
52
42
  router?: RouterProps;
53
- /**
54
- * Store ID for event tracking
55
- */
56
- storeId?: string;
57
- /**
58
- * Callback fired when a major announcement popup is shown
59
- */
60
- onAnnouncementShown?: (event: AnnouncementEvent) => void;
61
- /**
62
- * Callback fired when user interacts with an announcement (clicks a button)
63
- */
64
- onAnnouncementInteracted?: (event: AnnouncementInteractionEvent) => void;
65
43
  }
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{ApplicationType as o}from"@bikdotai/bik-models/growth/models/bik-store";import i from"../../../assets/icons/arrow_back.svg.js";import n from"../../../assets/icons/chevronLeft.svg.js";import r from"../../../assets/icons/chevronRight.svg.js";import a from"../../../assets/icons/PlusIcon.js";import{cloneDeep as d}from"lodash";import{useState as s,useEffect as c}from"react";import{Button as u}from"../../button/Button.js";import{IconButton as p}from"../../icon-button/IconButton.js";import{ProductPickerModal as m}from"../../product-picker-v2/modal.js";import{ScreenName as v}from"../../product-picker-v2/type.js";import{Badge as h}from"../Badge/index.js";import{useTemplateModalContext as g}from"../context/templateModalContext.js";import f from"./EditWhatsAppTemplateV2.js";import{ProductBox as y}from"./ProductBox.js";import"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import{COLORS as b}from"../../../constants/Theme.js";import"../../curtain/CurtainHelper.js";import"../../variable-picker-v3/model.js";import"../../template-preview/models/TemplateMeta.js";import{POD as j}from"../../template-preview/models/WhatsAppTemplate.js";import"../../template-preview/models/Channels.js";import{isRCSChannel as C}from"../../template-preview/helpers/templateMiscHelper.js";import{TitleMedium as x,TitleRegular as I,BodySecondary as k,BodyCaption as w}from"../../TypographyStyle.js";const O=O=>{let{template:P,whatsappSpecificPickerMeta:T,showVariableModal:S,variableListForImage:L,discountCode:B,setDiscountCode:E}=O;var A,M,V,D,F,R,W,$;const{selectedCarouselIndex:q,setTemplate:N,pickerConf:_,isProductCarouselType:z,pod:G,cardCount:H,carouselProducts:K,setCarouselProducts:J,isError:Q,cardImages:U,disableEditVariable:X,onDeleteSelectedProducts:Y,setSelectedCarouselIndex:Z,setVariableCallback:ee,setShowVariablePicker:te,sliderRef:le}=g(),[oe,ie]=s(C(null==P?void 0:P.channel)?"Carousel Cards":-1==q?"First Message (Step 1/2)":z?"Product Carousel "+((null===(M=null===(A=null==P?void 0:P.mapping)||void 0===A?void 0:A.body)||void 0===M?void 0:M.length)?"(Step 2/2)":""):"Carousel Cards "+((null===(D=null===(V=null==P?void 0:P.mapping)||void 0===V?void 0:V.body)||void 0===D?void 0:D.length)?"(Step 2/2)":"")),[ne,re]=s(!1),[ae,de]=s(!1),se=q===(null!=H?H:-1)-1,ce=(null!=q?q:-1)<1;c((()=>{var e,t,l,o;ie(C(null==P?void 0:P.channel)?"Carousel Cards":-1==q?"First Message (Step 1/2)":z?"Product Carousel "+((null===(t=null===(e=null==P?void 0:P.mapping)||void 0===e?void 0:e.body)||void 0===t?void 0:t.length)?"(Step 2/2)":""):"Carousel Cards "+((null===(o=null===(l=null==P?void 0:P.mapping)||void 0===l?void 0:l.body)||void 0===o?void 0:o.length)?"(Step 2/2)":""))}),[q]);const ue=e=>{null==J||J([{name:"variable",productName:e.actualValue}])};return c((()=>{-1===q&&C(null==P?void 0:P.channel)&&(null==Z||Z(0))}),[q,null==P?void 0:P.channel]),e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"row",alignItems:"center"}},{children:[!C(null==P?void 0:P.channel)&&null!=q&&q>=0&&!!(null===(R=null===(F=null==P?void 0:P.mapping)||void 0===F?void 0:F.body)||void 0===R?void 0:R.length)&&t(p,{Icon:i,onClick:()=>{null==Z||Z(-1)}}),t(x,Object.assign({style:{marginLeft:10}},{children:oe}))]})),z&&(null!==(W=null==K?void 0:K.length)&&void 0!==W?W:0)>0&&null!=q&&q>=0&&e("div",Object.assign({style:{display:"flex",rowGap:8,marginBottom:16,marginLeft:10,marginRight:10,flexDirection:"column"}},{children:[t(y,{editItem:()=>{1===(null==K?void 0:K.length)&&"variable"===K[0].name?(ee((()=>ue)),te(!0)):re(!ne)},cardBody:1===(null==K?void 0:K.length)&&"variable"===K[0].name?`${K[0].productName}`:`${null==K?void 0:K.length} Products Selected`,hideIcon:1===(null==K?void 0:K.length)&&"variable"===K[0].name,deleteItem:()=>{var e;if(1===(null==K?void 0:K.length)&&"variable"===K[0].name)return void(null==J||J([]));const t=d(Object.assign({},P));t&&(U&&U.length>0?null==U||U.forEach(((e,l)=>{var o;t.components[1].cards[l].components[0].example.header_handle=[null!==(o=U[l])&&void 0!==o?o:"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,l)=>{t.components[1].cards[l].components[0].example.header_handle=["https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})),null==N||N(t)),null==J||J([]),null==Y||Y()}}),K&&(null==K?void 0:K.length)>0&&"variable"!=K[0].name&&t(u,{disabled:(null!==($=null==K?void 0:K.length)&&void 0!==$?$:0)<=1,style:{alignSelf:"flex-end"},onClick:()=>{de(!0),re(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),!X&&z&&0===(null==K?void 0:K.length)&&null!=q&&q>=0&&e(l,{children:[e("div",Object.assign({style:{marginLeft:12}},{children:[t(I,{children:"Product(s)"}),t(k,{children:`Select ${null!=H?H:1} products`})]})),e("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:Q?16:12,marginRight:Q?16:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[t(u,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12,border:Q?`2px dashed ${b.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s)",buttonType:Q?"tertiaryGray":"dashBold",LeadingIcon:()=>t("div",Object.assign({style:{display:"flex",width:18,height:18}},{children:t(a,{width:18,height:18,color:b.content.secondary})})),onClick:e=>{re(!0)}}),G===j.CHATBOT&&e(l,{children:[e("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8}}),t(w,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8}})]})),t(u,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%",border:Q?`2px dashed ${b.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s) Variable",buttonType:Q?"tertiaryGray":"dashBold",LeadingIcon:()=>t("div",Object.assign({style:{display:"flex"}},{children:t(a,{width:18,height:18,color:b.content.secondary})})),onClick:e=>{ee((()=>ue)),te(!0)}})]})]})),Q&&t("div",Object.assign({style:{marginLeft:10,marginBottom:16}},{children:t(h,{padding:"8px",errorText:"Please add products"})}))]}),!z&&(null!=q?q:-1)>-1&&e("div",Object.assign({style:{display:"flex",background:b.surface.hovered,alignItems:"center"}},{children:[t(p,{Icon:n,disabled:ce,width:8,height:14,svgStyle:ce?{}:{color:b.content.secondary},onClick:()=>{var e;null===(e=null==le?void 0:le.current)||void 0===e||e.slickPrev(),(null!=q?q:-1)<1||null==Z||Z((e=>e-1))}}),t(I,Object.assign({style:{flex:1,display:"flex",justifyContent:"center"},color:b.content.secondary},{children:`Card ${(null!=q?q:0)+1}/${H}`})),t(p,{Icon:r,width:8,height:14,disabled:se,svgStyle:se?{}:{color:b.content.secondary},onClick:()=>{var e;null===(e=null==le?void 0:le.current)||void 0===e||e.slickNext(),(null!=q?q:-1)>=(null!=H?H:-1)-1||null==Z||Z((e=>e+1))}})]})),t(f,{whatsappSpecificPickerMeta:T,template:P,onTemplateChange:e=>{null==N||N(e)},showVariableModal:S,variableListForImage:L,discountCode:B,setDiscountCode:E}),ne&&_&&t(m,{zIndex:200,startupScreen:ae?v.RearrangeProducts:v.Collections,rearrangeEnabled:!0,storeId:_.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const l of e){const e=null==l?void 0:l.collectionId,o=l.productId,i=l.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),o in t[e].products||(t[e].products[o]={variants:{},name:(null==l?void 0:l.productName)||"",image:(null==l?void 0:l.productImage)||""}),t[e].products[o].variants[i]={name:(null==l?void 0:l.name)||"",price:"",image:(null==l?void 0:l.image)||"",quantity:l.quantity||0,displayOrder:l.displayOrder}}return t}return{}})(null!=K?K:[]),collectionFetcher:_.fetchCollections,productFetcher:_.fetchProducts,onAdd:(e,t)=>{var l,o,i,n,r,a;de(!1);const s=[];delete e.isCustom;for(const t of Object.keys(e)){const d=e[t].products;if(void 0!==d&&Object.keys(d).length)for(const e of Object.keys(d)){const c=d[e].variants;if(void 0!==c&&Object.keys(c).length)for(const u of Object.keys(c)){const{name:p,image:m,quantity:v,displayOrder:h}=c[u],g={name:p,image:null!==(o=null!=m?m:null===(l=d[e])||void 0===l?void 0:l.image)&&void 0!==o?o:"",quantity:v,variantId:u,productId:e,displayOrder:h,collectionId:t,productName:null!==(n=null===(i=d[e])||void 0===i?void 0:i.name)&&void 0!==n?n:"",productImage:null!==(a=null===(r=d[e])||void 0===r?void 0:r.image)&&void 0!==a?a:""};s.push(g)}}}const c=s.sort(((e,t)=>e.displayOrder-t.displayOrder)),u=s.map((e=>e.image)),p=d(Object.assign({},P));p&&(u.forEach(((e,t)=>{var l;p.components[1].cards[t].components[0].example.header_handle=e?[e]:[null!==(l=null==U?void 0:U[t])&&void 0!==l?l:""]})),null==N||N(p)),null==J||J(c),re(!1)},searchInCollectionFetcher:_.searchInCollection,searchFetcher:_.searchProducts,visible:ne,onClose:()=>{re(!1)},exactLimit:null!=H?H:1,appType:_.appType||o.BIK})]}))};export{O as default};
1
+ import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{ApplicationType as o}from"@bikdotai/bik-models/growth/models/bik-store";import i from"../../../assets/icons/arrow_back.svg.js";import n from"../../../assets/icons/chevronLeft.svg.js";import r from"../../../assets/icons/chevronRight.svg.js";import a from"../../../assets/icons/PlusIcon.js";import{cloneDeep as d}from"lodash";import{useState as s,useEffect as c}from"react";import{Button as u}from"../../button/Button.js";import{IconButton as p}from"../../icon-button/IconButton.js";import{ProductPickerModal as m}from"../../product-picker-v2/modal.js";import{ScreenName as v}from"../../product-picker-v2/type.js";import{Badge as h}from"../Badge/index.js";import{useTemplateModalContext as g}from"../context/templateModalContext.js";import f from"./EditWhatsAppTemplateV2.js";import{ProductBox as y}from"./ProductBox.js";import"../../template-preview/TemplatePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreview.js";import"../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js";import{COLORS as b}from"../../../constants/Theme.js";import"../../curtain/CurtainHelper.js";import"../../variable-picker-v3/model.js";import"../../template-preview/models/TemplateMeta.js";import{POD as j}from"../../template-preview/models/WhatsAppTemplate.js";import"../../template-preview/models/Channels.js";import{isRCSChannel as x}from"../../template-preview/helpers/templateMiscHelper.js";import{TitleMedium as C,TitleRegular as I,BodySecondary as k,BodyCaption as w}from"../../TypographyStyle.js";const O=O=>{let{template:P,whatsappSpecificPickerMeta:T,showVariableModal:S,variableListForImage:L,discountCode:B,setDiscountCode:E}=O;var A,M,V,D,F,R,W,$;const{selectedCarouselIndex:q,setTemplate:N,pickerConf:_,isProductCarouselType:z,pod:G,cardCount:H,carouselProducts:K,setCarouselProducts:J,isError:Q,cardImages:U,disableEditVariable:X,onDeleteSelectedProducts:Y,setSelectedCarouselIndex:Z,setVariableCallback:ee,setShowVariablePicker:te,sliderRef:le}=g(),[oe,ie]=s(x(null==P?void 0:P.channel)?"Carousel Cards":-1==q?"First Message (Step 1/2)":z?"Product Carousel "+((null===(M=null===(A=null==P?void 0:P.mapping)||void 0===A?void 0:A.body)||void 0===M?void 0:M.length)?"(Step 2/2)":""):"Carousel Cards "+((null===(D=null===(V=null==P?void 0:P.mapping)||void 0===V?void 0:V.body)||void 0===D?void 0:D.length)?"(Step 2/2)":"")),[ne,re]=s(!1),[ae,de]=s(!1),se=q===(null!=H?H:-1)-1,ce=(null!=q?q:-1)<1;c((()=>{var e,t,l,o;ie(x(null==P?void 0:P.channel)?"Carousel Cards":-1==q?"First Message (Step 1/2)":z?"Product Carousel "+((null===(t=null===(e=null==P?void 0:P.mapping)||void 0===e?void 0:e.body)||void 0===t?void 0:t.length)?"(Step 2/2)":""):"Carousel Cards "+((null===(o=null===(l=null==P?void 0:P.mapping)||void 0===l?void 0:l.body)||void 0===o?void 0:o.length)?"(Step 2/2)":""))}),[q]),c((()=>{te(!1)}),[q]);const ue=e=>{null==J||J([{name:"variable",productName:e.actualValue}])};return c((()=>{-1===q&&x(null==P?void 0:P.channel)&&(null==Z||Z(0))}),[q,null==P?void 0:P.channel]),e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:"16px"}},{children:[e("div",Object.assign({style:{display:"flex",flexDirection:"row",alignItems:"center"}},{children:[!x(null==P?void 0:P.channel)&&null!=q&&q>=0&&!!(null===(R=null===(F=null==P?void 0:P.mapping)||void 0===F?void 0:F.body)||void 0===R?void 0:R.length)&&t(p,{Icon:i,onClick:()=>{null==Z||Z(-1)}}),t(C,Object.assign({style:{marginLeft:10}},{children:oe}))]})),z&&(null!==(W=null==K?void 0:K.length)&&void 0!==W?W:0)>0&&null!=q&&q>=0&&e("div",Object.assign({style:{display:"flex",rowGap:8,marginBottom:16,marginLeft:10,marginRight:10,flexDirection:"column"}},{children:[t(y,{editItem:()=>{1===(null==K?void 0:K.length)&&"variable"===K[0].name?(ee((()=>ue)),te(!0)):re(!ne)},cardBody:1===(null==K?void 0:K.length)&&"variable"===K[0].name?`${K[0].productName}`:`${null==K?void 0:K.length} Products Selected`,hideIcon:1===(null==K?void 0:K.length)&&"variable"===K[0].name,deleteItem:()=>{var e;if(1===(null==K?void 0:K.length)&&"variable"===K[0].name)return void(null==J||J([]));const t=d(Object.assign({},P));t&&(U&&U.length>0?null==U||U.forEach(((e,l)=>{var o;t.components[1].cards[l].components[0].example.header_handle=[null!==(o=U[l])&&void 0!==o?o:"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,l)=>{t.components[1].cards[l].components[0].example.header_handle=["https://res.cloudinary.com/drqhot9ot/image/upload/v1708753454/fake-product.png"]})),null==N||N(t)),null==J||J([]),null==Y||Y()}}),K&&(null==K?void 0:K.length)>0&&"variable"!=K[0].name&&t(u,{disabled:(null!==($=null==K?void 0:K.length)&&void 0!==$?$:0)<=1,style:{alignSelf:"flex-end"},onClick:()=>{de(!0),re(!0)},buttonText:"Rearrange Products",buttonType:"tertiary"})]})),!X&&z&&0===(null==K?void 0:K.length)&&null!=q&&q>=0&&e(l,{children:[e("div",Object.assign({style:{marginLeft:12}},{children:[t(I,{children:"Product(s)"}),t(k,{children:`Select ${null!=H?H:1} products`})]})),e("div",Object.assign({style:{marginTop:16,marginBottom:16,marginLeft:Q?16:12,marginRight:Q?16:12,flexDirection:"column",display:"flex",alignItems:"center"}},{children:[t(u,{matchParentWidth:!0,style:{flex:1,display:"flex",width:"100%",marginBottom:12,border:Q?`2px dashed ${b.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s)",buttonType:Q?"tertiaryGray":"dashBold",LeadingIcon:()=>t("div",Object.assign({style:{display:"flex",width:18,height:18}},{children:t(a,{width:18,height:18,color:b.content.secondary})})),onClick:e=>{re(!0)}}),G===j.CHATBOT&&e(l,{children:[e("div",Object.assign({style:{display:"flex",flex:1,alignItems:"center",justifyContent:"space-between",flexDirection:"row",width:"100%"}},{children:[t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginRight:8,flex:1}}),t(w,Object.assign({style:{color:"#616161",overflow:"unset"}},{children:"OR"})),t("div",{style:{width:"100%",height:1,backgroundColor:"#E0E0E0",marginLeft:8,flex:1}})]})),t(u,{matchParentWidth:!0,style:{flex:1,display:"flex",marginTop:12,width:"100%",border:Q?`2px dashed ${b.content.negative}`:void 0},size:"medium",buttonText:"Add Product(s) Variable",buttonType:Q?"tertiaryGray":"dashBold",LeadingIcon:()=>t("div",Object.assign({style:{display:"flex"}},{children:t(a,{width:18,height:18,color:b.content.secondary})})),onClick:e=>{ee((()=>ue)),te(!0)}})]})]})),Q&&t("div",Object.assign({style:{marginLeft:10,marginBottom:16}},{children:t(h,{padding:"8px",errorText:"Please add products"})}))]}),!z&&(null!=q?q:-1)>-1&&e("div",Object.assign({style:{display:"flex",background:b.surface.hovered,alignItems:"center"}},{children:[t(p,{Icon:n,disabled:ce,width:8,height:14,svgStyle:ce?{}:{color:b.content.secondary},onClick:()=>{var e;null===(e=null==le?void 0:le.current)||void 0===e||e.slickPrev(),(null!=q?q:-1)<1||null==Z||Z((e=>e-1))}}),t(I,Object.assign({style:{flex:1,display:"flex",justifyContent:"center"},color:b.content.secondary},{children:`Card ${(null!=q?q:0)+1}/${H}`})),t(p,{Icon:r,width:8,height:14,disabled:se,svgStyle:se?{}:{color:b.content.secondary},onClick:()=>{var e;null===(e=null==le?void 0:le.current)||void 0===e||e.slickNext(),(null!=q?q:-1)>=(null!=H?H:-1)-1||null==Z||Z((e=>e+1))}})]})),t(f,{whatsappSpecificPickerMeta:T,template:P,onTemplateChange:e=>{null==N||N(e)},showVariableModal:S,variableListForImage:L,discountCode:B,setDiscountCode:E}),ne&&_&&t(m,{zIndex:200,startupScreen:ae?v.RearrangeProducts:v.Collections,rearrangeEnabled:!0,storeId:_.storeId,selectedItems:(e=>{if(e.length>0){const t={};for(const l of e){const e=null==l?void 0:l.collectionId,o=l.productId,i=l.variantId;e in t||(t[e]={products:{},name:"",image:"",isSmartCollection:!1}),o in t[e].products||(t[e].products[o]={variants:{},name:(null==l?void 0:l.productName)||"",image:(null==l?void 0:l.productImage)||""}),t[e].products[o].variants[i]={name:(null==l?void 0:l.name)||"",price:"",image:(null==l?void 0:l.image)||"",quantity:l.quantity||0,displayOrder:l.displayOrder}}return t}return{}})(null!=K?K:[]),collectionFetcher:_.fetchCollections,productFetcher:_.fetchProducts,onAdd:(e,t)=>{var l,o,i,n,r,a;de(!1);const s=[];delete e.isCustom;for(const t of Object.keys(e)){const d=e[t].products;if(void 0!==d&&Object.keys(d).length)for(const e of Object.keys(d)){const c=d[e].variants;if(void 0!==c&&Object.keys(c).length)for(const u of Object.keys(c)){const{name:p,image:m,quantity:v,displayOrder:h}=c[u],g={name:p,image:null!==(o=null!=m?m:null===(l=d[e])||void 0===l?void 0:l.image)&&void 0!==o?o:"",quantity:v,variantId:u,productId:e,displayOrder:h,collectionId:t,productName:null!==(n=null===(i=d[e])||void 0===i?void 0:i.name)&&void 0!==n?n:"",productImage:null!==(a=null===(r=d[e])||void 0===r?void 0:r.image)&&void 0!==a?a:""};s.push(g)}}}const c=s.sort(((e,t)=>e.displayOrder-t.displayOrder)),u=s.map((e=>e.image)),p=d(Object.assign({},P));p&&(u.forEach(((e,t)=>{var l;p.components[1].cards[t].components[0].example.header_handle=e?[e]:[null!==(l=null==U?void 0:U[t])&&void 0!==l?l:""]})),null==N||N(p)),null==J||J(c),re(!1)},searchInCollectionFetcher:_.searchInCollection,searchFetcher:_.searchProducts,visible:ne,onClose:()=>{re(!1)},exactLimit:null!=H?H:1,appType:_.appType||o.BIK})]}))};export{O as default};